Rename to gotify

This commit is contained in:
Jannis Mattheis 2018-02-12 16:48:01 +01:00
parent 4bb6950e34
commit 1e7e1a71f7
32 changed files with 55 additions and 55 deletions

View File

@ -1,2 +1,2 @@
# Memo # Gotify Server
[![Build Status](https://travis-ci.org/jmattheis/memo.svg?branch=master)](https://travis-ci.org/jmattheis/memo) [![codecov](https://codecov.io/gh/jmattheis/memo/branch/master/graph/badge.svg)](https://codecov.io/gh/jmattheis/memo) [![Go Report Card](https://goreportcard.com/badge/github.com/jmattheis/memo)](https://goreportcard.com/report/github.com/jmattheis/memo) [![Build Status](https://travis-ci.org/gotify/server.svg?branch=master)](https://travis-ci.org/gotify/server) [![codecov](https://codecov.io/gh/gotify/server/branch/master/graph/badge.svg)](https://codecov.io/gh/gotify/server) [![Go Report Card](https://goreportcard.com/badge/github.com/gotify/server)](https://goreportcard.com/report/github.com/gotify/server)

View File

@ -6,8 +6,8 @@ import (
"time" "time"
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
"github.com/jmattheis/memo/auth" "github.com/gotify/server/auth"
"github.com/jmattheis/memo/model" "github.com/gotify/server/model"
) )
// The MessageDatabase interface for encapsulating database access. // The MessageDatabase interface for encapsulating database access.

View File

@ -9,9 +9,9 @@ import (
"github.com/bouk/monkey" "github.com/bouk/monkey"
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
apimock "github.com/jmattheis/memo/api/mock" apimock "github.com/gotify/server/api/mock"
"github.com/jmattheis/memo/auth" "github.com/gotify/server/auth"
"github.com/jmattheis/memo/model" "github.com/gotify/server/model"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"github.com/stretchr/testify/mock" "github.com/stretchr/testify/mock"
"github.com/stretchr/testify/suite" "github.com/stretchr/testify/suite"

View File

@ -2,7 +2,7 @@
package mock package mock
import mock "github.com/stretchr/testify/mock" import mock "github.com/stretchr/testify/mock"
import model "github.com/jmattheis/memo/model" import model "github.com/gotify/server/model"
// MockMessageDatabase is an autogenerated mock type for the MessageDatabase type // MockMessageDatabase is an autogenerated mock type for the MessageDatabase type
type MockMessageDatabase struct { type MockMessageDatabase struct {

View File

@ -2,7 +2,7 @@
package mock package mock
import mock "github.com/stretchr/testify/mock" import mock "github.com/stretchr/testify/mock"
import model "github.com/jmattheis/memo/model" import model "github.com/gotify/server/model"
// MockTokenDatabase is an autogenerated mock type for the TokenDatabase type // MockTokenDatabase is an autogenerated mock type for the TokenDatabase type
type MockTokenDatabase struct { type MockTokenDatabase struct {

View File

@ -2,7 +2,7 @@
package mock package mock
import mock "github.com/stretchr/testify/mock" import mock "github.com/stretchr/testify/mock"
import model "github.com/jmattheis/memo/model" import model "github.com/gotify/server/model"
// MockUserDatabase is an autogenerated mock type for the UserDatabase type // MockUserDatabase is an autogenerated mock type for the UserDatabase type
type MockUserDatabase struct { type MockUserDatabase struct {

View File

@ -4,8 +4,8 @@ import (
"fmt" "fmt"
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
"github.com/jmattheis/memo/auth" "github.com/gotify/server/auth"
"github.com/jmattheis/memo/model" "github.com/gotify/server/model"
) )
// The TokenDatabase interface for encapsulating database access. // The TokenDatabase interface for encapsulating database access.

View File

@ -9,8 +9,8 @@ import (
"testing" "testing"
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
apimock "github.com/jmattheis/memo/api/mock" apimock "github.com/gotify/server/api/mock"
"github.com/jmattheis/memo/model" "github.com/gotify/server/model"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"github.com/stretchr/testify/mock" "github.com/stretchr/testify/mock"
"github.com/stretchr/testify/suite" "github.com/stretchr/testify/suite"

View File

@ -5,8 +5,8 @@ import (
"strconv" "strconv"
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
"github.com/jmattheis/memo/auth" "github.com/gotify/server/auth"
"github.com/jmattheis/memo/model" "github.com/gotify/server/model"
) )
type userResponse struct { type userResponse struct {

View File

@ -9,9 +9,9 @@ import (
"github.com/bouk/monkey" "github.com/bouk/monkey"
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
apimock "github.com/jmattheis/memo/api/mock" apimock "github.com/gotify/server/api/mock"
"github.com/jmattheis/memo/auth" "github.com/gotify/server/auth"
"github.com/jmattheis/memo/model" "github.com/gotify/server/model"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"github.com/stretchr/testify/mock" "github.com/stretchr/testify/mock"
"github.com/stretchr/testify/suite" "github.com/stretchr/testify/suite"

View File

@ -5,7 +5,7 @@ import (
"strings" "strings"
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
"github.com/jmattheis/memo/model" "github.com/gotify/server/model"
) )
const ( const (

View File

@ -8,8 +8,8 @@ import (
"testing" "testing"
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
authmock "github.com/jmattheis/memo/auth/mock" authmock "github.com/gotify/server/auth/mock"
"github.com/jmattheis/memo/model" "github.com/gotify/server/model"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"github.com/stretchr/testify/mock" "github.com/stretchr/testify/mock"
"github.com/stretchr/testify/suite" "github.com/stretchr/testify/suite"

View File

@ -2,7 +2,7 @@
package mock package mock
import mock "github.com/stretchr/testify/mock" import mock "github.com/stretchr/testify/mock"
import model "github.com/jmattheis/memo/model" import model "github.com/gotify/server/model"
// MockDatabase is an autogenerated mock type for the Database type // MockDatabase is an autogenerated mock type for the Database type
type MockDatabase struct { type MockDatabase struct {

View File

@ -2,7 +2,7 @@ package auth
import ( import (
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
"github.com/jmattheis/memo/model" "github.com/gotify/server/model"
) )
// RegisterAuthentication registers the user id, user and or token. // RegisterAuthentication registers the user id, user and or token.

View File

@ -5,7 +5,7 @@ import (
"testing" "testing"
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
"github.com/jmattheis/memo/model" "github.com/gotify/server/model"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"github.com/stretchr/testify/suite" "github.com/stretchr/testify/suite"
) )

View File

@ -4,10 +4,10 @@ import "github.com/jinzhu/configor"
// Configuration is stuff that can be configured externally per env variables or config file (config.yml). // Configuration is stuff that can be configured externally per env variables or config file (config.yml).
type Configuration struct { type Configuration struct {
Port int `default:"8080"` Port int `default:"8080"`
Database struct { Database struct {
Dialect string `default:"sqlite3"` Dialect string `default:"sqlite3"`
Connection string `default:"memo.db"` Connection string `default:"gotify.db"`
} }
DefaultUser struct { DefaultUser struct {
Name string `default:"admin"` Name string `default:"admin"`
@ -18,6 +18,6 @@ type Configuration struct {
// Get returns the configuration extracted from env variables or config file. // Get returns the configuration extracted from env variables or config file.
func Get() *Configuration { func Get() *Configuration {
conf := new(Configuration) conf := new(Configuration)
configor.New(&configor.Config{ENVPrefix: "MEMO"}).Load(conf, "config.yml", "/etc/memo/config.yml") configor.New(&configor.Config{ENVPrefix: "GOTIFY"}).Load(conf, "config.yml", "/etc/gotify/config.yml")
return conf return conf
} }

View File

@ -8,11 +8,11 @@ import (
) )
func TestConfigEnv(t *testing.T) { func TestConfigEnv(t *testing.T) {
os.Setenv("MEMO_DEFAULTUSER_NAME", "jmattheis") os.Setenv("GOTIFY_DEFAULTUSER_NAME", "jmattheis")
conf := Get() conf := Get()
assert.Equal(t, 8080, conf.Port, "should use defaults") assert.Equal(t, 8080, conf.Port, "should use defaults")
assert.Equal(t, "jmattheis", conf.DefaultUser.Name, "should not use default but env var") assert.Equal(t, "jmattheis", conf.DefaultUser.Name, "should not use default but env var")
os.Unsetenv("MEMO_DEFAULTUSER_NAME") os.Unsetenv("GOTIFY_DEFAULTUSER_NAME")
} }
func TestConfigFile(t *testing.T) { func TestConfigFile(t *testing.T) {

View File

@ -1,7 +1,7 @@
package database package database
import ( import (
"github.com/jmattheis/memo/model" "github.com/gotify/server/model"
) )
// GetApplicationByID returns the application for the given id or nil. // GetApplicationByID returns the application for the given id or nil.

View File

@ -1,7 +1,7 @@
package database package database
import ( import (
"github.com/jmattheis/memo/model" "github.com/gotify/server/model"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
) )

View File

@ -1,6 +1,6 @@
package database package database
import "github.com/jmattheis/memo/model" import "github.com/gotify/server/model"
// GetClientByID returns the client for the given id or nil. // GetClientByID returns the client for the given id or nil.
func (d *GormDatabase) GetClientByID(id string) *model.Client { func (d *GormDatabase) GetClientByID(id string) *model.Client {

View File

@ -1,7 +1,7 @@
package database package database
import ( import (
"github.com/jmattheis/memo/model" "github.com/gotify/server/model"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
) )

View File

@ -1,12 +1,12 @@
package database package database
import ( import (
"github.com/gotify/server/auth"
"github.com/gotify/server/model"
"github.com/jinzhu/gorm" "github.com/jinzhu/gorm"
_ "github.com/jinzhu/gorm/dialects/mysql" // enable the mysql dialect _ "github.com/jinzhu/gorm/dialects/mysql" // enable the mysql dialect
_ "github.com/jinzhu/gorm/dialects/postgres" // enable the postgres dialect _ "github.com/jinzhu/gorm/dialects/postgres" // enable the postgres dialect
_ "github.com/jinzhu/gorm/dialects/sqlite" // enable the sqlite3 dialect _ "github.com/jinzhu/gorm/dialects/sqlite" // enable the sqlite3 dialect
"github.com/jmattheis/memo/auth"
"github.com/jmattheis/memo/model"
) )
// New creates a new wrapper for the gorm database framework. // New creates a new wrapper for the gorm database framework.

View File

@ -1,7 +1,7 @@
package database package database
import ( import (
"github.com/jmattheis/memo/model" "github.com/gotify/server/model"
) )
// GetMessageByID returns the messages for the given id or nil. // GetMessageByID returns the messages for the given id or nil.

View File

@ -4,7 +4,7 @@ import (
"testing" "testing"
"time" "time"
"github.com/jmattheis/memo/model" "github.com/gotify/server/model"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
) )

View File

@ -1,7 +1,7 @@
package database package database
import ( import (
"github.com/jmattheis/memo/model" "github.com/gotify/server/model"
) )
// GetUserByName returns the user by the given name or nil. // GetUserByName returns the user by the given name or nil.

View File

@ -1,7 +1,7 @@
package database package database
import ( import (
"github.com/jmattheis/memo/model" "github.com/gotify/server/model"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
) )

View File

@ -6,9 +6,9 @@ import (
"time" "time"
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
"github.com/jmattheis/memo/config" "github.com/gotify/server/config"
"github.com/jmattheis/memo/database" "github.com/gotify/server/database"
"github.com/jmattheis/memo/router" "github.com/gotify/server/router"
) )
func main() { func main() {

View File

@ -4,11 +4,11 @@ import (
"time" "time"
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
"github.com/jmattheis/memo/api" "github.com/gotify/server/api"
"github.com/jmattheis/memo/auth" "github.com/gotify/server/auth"
"github.com/jmattheis/memo/database" "github.com/gotify/server/database"
"github.com/jmattheis/memo/error" "github.com/gotify/server/error"
"github.com/jmattheis/memo/stream" "github.com/gotify/server/stream"
) )
// Create creates the gin engine with all routes. // Create creates the gin engine with all routes.

View File

@ -11,8 +11,8 @@ import (
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
"github.com/gin-gonic/gin/json" "github.com/gin-gonic/gin/json"
"github.com/jmattheis/memo/database" "github.com/gotify/server/database"
"github.com/jmattheis/memo/model" "github.com/gotify/server/model"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"github.com/stretchr/testify/suite" "github.com/stretchr/testify/suite"
) )

View File

@ -5,7 +5,7 @@ import (
"time" "time"
"github.com/gorilla/websocket" "github.com/gorilla/websocket"
"github.com/jmattheis/memo/model" "github.com/gotify/server/model"
) )
const ( const (

View File

@ -6,8 +6,8 @@ import (
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
"github.com/gorilla/websocket" "github.com/gorilla/websocket"
"github.com/jmattheis/memo/auth" "github.com/gotify/server/auth"
"github.com/jmattheis/memo/model" "github.com/gotify/server/model"
) )
var upgrader = websocket.Upgrader{ var upgrader = websocket.Upgrader{

View File

@ -18,8 +18,8 @@ import (
"github.com/fortytw2/leaktest" "github.com/fortytw2/leaktest"
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
"github.com/gorilla/websocket" "github.com/gorilla/websocket"
"github.com/jmattheis/memo/auth" "github.com/gotify/server/auth"
"github.com/jmattheis/memo/model" "github.com/gotify/server/model"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
) )