Rename to gotify
This commit is contained in:
parent
4bb6950e34
commit
1e7e1a71f7
|
|
@ -1,2 +1,2 @@
|
|||
# Memo
|
||||
[](https://travis-ci.org/jmattheis/memo) [](https://codecov.io/gh/jmattheis/memo) [](https://goreportcard.com/report/github.com/jmattheis/memo)
|
||||
# Gotify Server
|
||||
[](https://travis-ci.org/gotify/server) [](https://codecov.io/gh/gotify/server) [](https://goreportcard.com/report/github.com/gotify/server)
|
||||
|
|
@ -6,8 +6,8 @@ import (
|
|||
"time"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/jmattheis/memo/auth"
|
||||
"github.com/jmattheis/memo/model"
|
||||
"github.com/gotify/server/auth"
|
||||
"github.com/gotify/server/model"
|
||||
)
|
||||
|
||||
// The MessageDatabase interface for encapsulating database access.
|
||||
|
|
|
|||
|
|
@ -9,9 +9,9 @@ import (
|
|||
|
||||
"github.com/bouk/monkey"
|
||||
"github.com/gin-gonic/gin"
|
||||
apimock "github.com/jmattheis/memo/api/mock"
|
||||
"github.com/jmattheis/memo/auth"
|
||||
"github.com/jmattheis/memo/model"
|
||||
apimock "github.com/gotify/server/api/mock"
|
||||
"github.com/gotify/server/auth"
|
||||
"github.com/gotify/server/model"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/mock"
|
||||
"github.com/stretchr/testify/suite"
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
package 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
|
||||
type MockMessageDatabase struct {
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
package 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
|
||||
type MockTokenDatabase struct {
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
package 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
|
||||
type MockUserDatabase struct {
|
||||
|
|
|
|||
|
|
@ -4,8 +4,8 @@ import (
|
|||
"fmt"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/jmattheis/memo/auth"
|
||||
"github.com/jmattheis/memo/model"
|
||||
"github.com/gotify/server/auth"
|
||||
"github.com/gotify/server/model"
|
||||
)
|
||||
|
||||
// The TokenDatabase interface for encapsulating database access.
|
||||
|
|
|
|||
|
|
@ -9,8 +9,8 @@ import (
|
|||
"testing"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
apimock "github.com/jmattheis/memo/api/mock"
|
||||
"github.com/jmattheis/memo/model"
|
||||
apimock "github.com/gotify/server/api/mock"
|
||||
"github.com/gotify/server/model"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/mock"
|
||||
"github.com/stretchr/testify/suite"
|
||||
|
|
|
|||
|
|
@ -5,8 +5,8 @@ import (
|
|||
"strconv"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/jmattheis/memo/auth"
|
||||
"github.com/jmattheis/memo/model"
|
||||
"github.com/gotify/server/auth"
|
||||
"github.com/gotify/server/model"
|
||||
)
|
||||
|
||||
type userResponse struct {
|
||||
|
|
|
|||
|
|
@ -9,9 +9,9 @@ import (
|
|||
|
||||
"github.com/bouk/monkey"
|
||||
"github.com/gin-gonic/gin"
|
||||
apimock "github.com/jmattheis/memo/api/mock"
|
||||
"github.com/jmattheis/memo/auth"
|
||||
"github.com/jmattheis/memo/model"
|
||||
apimock "github.com/gotify/server/api/mock"
|
||||
"github.com/gotify/server/auth"
|
||||
"github.com/gotify/server/model"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/mock"
|
||||
"github.com/stretchr/testify/suite"
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ import (
|
|||
"strings"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/jmattheis/memo/model"
|
||||
"github.com/gotify/server/model"
|
||||
)
|
||||
|
||||
const (
|
||||
|
|
|
|||
|
|
@ -8,8 +8,8 @@ import (
|
|||
"testing"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
authmock "github.com/jmattheis/memo/auth/mock"
|
||||
"github.com/jmattheis/memo/model"
|
||||
authmock "github.com/gotify/server/auth/mock"
|
||||
"github.com/gotify/server/model"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/mock"
|
||||
"github.com/stretchr/testify/suite"
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
package 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
|
||||
type MockDatabase struct {
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ package auth
|
|||
|
||||
import (
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/jmattheis/memo/model"
|
||||
"github.com/gotify/server/model"
|
||||
)
|
||||
|
||||
// RegisterAuthentication registers the user id, user and or token.
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ import (
|
|||
"testing"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/jmattheis/memo/model"
|
||||
"github.com/gotify/server/model"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/suite"
|
||||
)
|
||||
|
|
|
|||
|
|
@ -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).
|
||||
type Configuration struct {
|
||||
Port int `default:"8080"`
|
||||
Port int `default:"8080"`
|
||||
Database struct {
|
||||
Dialect string `default:"sqlite3"`
|
||||
Connection string `default:"memo.db"`
|
||||
Connection string `default:"gotify.db"`
|
||||
}
|
||||
DefaultUser struct {
|
||||
Name string `default:"admin"`
|
||||
|
|
@ -18,6 +18,6 @@ type Configuration struct {
|
|||
// Get returns the configuration extracted from env variables or config file.
|
||||
func Get() *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
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,11 +8,11 @@ import (
|
|||
)
|
||||
|
||||
func TestConfigEnv(t *testing.T) {
|
||||
os.Setenv("MEMO_DEFAULTUSER_NAME", "jmattheis")
|
||||
os.Setenv("GOTIFY_DEFAULTUSER_NAME", "jmattheis")
|
||||
conf := Get()
|
||||
assert.Equal(t, 8080, conf.Port, "should use defaults")
|
||||
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) {
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
package database
|
||||
|
||||
import (
|
||||
"github.com/jmattheis/memo/model"
|
||||
"github.com/gotify/server/model"
|
||||
)
|
||||
|
||||
// GetApplicationByID returns the application for the given id or nil.
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
package database
|
||||
|
||||
import (
|
||||
"github.com/jmattheis/memo/model"
|
||||
"github.com/gotify/server/model"
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
package database
|
||||
|
||||
import "github.com/jmattheis/memo/model"
|
||||
import "github.com/gotify/server/model"
|
||||
|
||||
// GetClientByID returns the client for the given id or nil.
|
||||
func (d *GormDatabase) GetClientByID(id string) *model.Client {
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
package database
|
||||
|
||||
import (
|
||||
"github.com/jmattheis/memo/model"
|
||||
"github.com/gotify/server/model"
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
|
|
|
|||
|
|
@ -1,12 +1,12 @@
|
|||
package database
|
||||
|
||||
import (
|
||||
"github.com/gotify/server/auth"
|
||||
"github.com/gotify/server/model"
|
||||
"github.com/jinzhu/gorm"
|
||||
_ "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/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.
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
package database
|
||||
|
||||
import (
|
||||
"github.com/jmattheis/memo/model"
|
||||
"github.com/gotify/server/model"
|
||||
)
|
||||
|
||||
// GetMessageByID returns the messages for the given id or nil.
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ import (
|
|||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/jmattheis/memo/model"
|
||||
"github.com/gotify/server/model"
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
package database
|
||||
|
||||
import (
|
||||
"github.com/jmattheis/memo/model"
|
||||
"github.com/gotify/server/model"
|
||||
)
|
||||
|
||||
// GetUserByName returns the user by the given name or nil.
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
package database
|
||||
|
||||
import (
|
||||
"github.com/jmattheis/memo/model"
|
||||
"github.com/gotify/server/model"
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
|
|
|
|||
|
|
@ -6,9 +6,9 @@ import (
|
|||
"time"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/jmattheis/memo/config"
|
||||
"github.com/jmattheis/memo/database"
|
||||
"github.com/jmattheis/memo/router"
|
||||
"github.com/gotify/server/config"
|
||||
"github.com/gotify/server/database"
|
||||
"github.com/gotify/server/router"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
|
|
|||
|
|
@ -4,11 +4,11 @@ import (
|
|||
"time"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/jmattheis/memo/api"
|
||||
"github.com/jmattheis/memo/auth"
|
||||
"github.com/jmattheis/memo/database"
|
||||
"github.com/jmattheis/memo/error"
|
||||
"github.com/jmattheis/memo/stream"
|
||||
"github.com/gotify/server/api"
|
||||
"github.com/gotify/server/auth"
|
||||
"github.com/gotify/server/database"
|
||||
"github.com/gotify/server/error"
|
||||
"github.com/gotify/server/stream"
|
||||
)
|
||||
|
||||
// Create creates the gin engine with all routes.
|
||||
|
|
|
|||
|
|
@ -11,8 +11,8 @@ import (
|
|||
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/gin-gonic/gin/json"
|
||||
"github.com/jmattheis/memo/database"
|
||||
"github.com/jmattheis/memo/model"
|
||||
"github.com/gotify/server/database"
|
||||
"github.com/gotify/server/model"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/suite"
|
||||
)
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ import (
|
|||
"time"
|
||||
|
||||
"github.com/gorilla/websocket"
|
||||
"github.com/jmattheis/memo/model"
|
||||
"github.com/gotify/server/model"
|
||||
)
|
||||
|
||||
const (
|
||||
|
|
|
|||
|
|
@ -6,8 +6,8 @@ import (
|
|||
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/gorilla/websocket"
|
||||
"github.com/jmattheis/memo/auth"
|
||||
"github.com/jmattheis/memo/model"
|
||||
"github.com/gotify/server/auth"
|
||||
"github.com/gotify/server/model"
|
||||
)
|
||||
|
||||
var upgrader = websocket.Upgrader{
|
||||
|
|
|
|||
|
|
@ -18,8 +18,8 @@ import (
|
|||
"github.com/fortytw2/leaktest"
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/gorilla/websocket"
|
||||
"github.com/jmattheis/memo/auth"
|
||||
"github.com/jmattheis/memo/model"
|
||||
"github.com/gotify/server/auth"
|
||||
"github.com/gotify/server/model"
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue