Rename to gotify
This commit is contained in:
parent
4bb6950e34
commit
1e7e1a71f7
|
|
@ -1,2 +1,2 @@
|
||||||
# Memo
|
# Gotify Server
|
||||||
[](https://travis-ci.org/jmattheis/memo) [](https://codecov.io/gh/jmattheis/memo) [](https://goreportcard.com/report/github.com/jmattheis/memo)
|
[](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"
|
"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.
|
||||||
|
|
|
||||||
|
|
@ -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"
|
||||||
|
|
|
||||||
|
|
@ -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 {
|
||||||
|
|
|
||||||
|
|
@ -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 {
|
||||||
|
|
|
||||||
|
|
@ -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 {
|
||||||
|
|
|
||||||
|
|
@ -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.
|
||||||
|
|
|
||||||
|
|
@ -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"
|
||||||
|
|
|
||||||
|
|
@ -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 {
|
||||||
|
|
|
||||||
|
|
@ -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"
|
||||||
|
|
|
||||||
|
|
@ -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 (
|
||||||
|
|
|
||||||
|
|
@ -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"
|
||||||
|
|
|
||||||
|
|
@ -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 {
|
||||||
|
|
|
||||||
|
|
@ -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.
|
||||||
|
|
|
||||||
|
|
@ -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"
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ 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
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -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) {
|
||||||
|
|
|
||||||
|
|
@ -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.
|
||||||
|
|
|
||||||
|
|
@ -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"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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 {
|
||||||
|
|
|
||||||
|
|
@ -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"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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.
|
||||||
|
|
|
||||||
|
|
@ -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.
|
||||||
|
|
|
||||||
|
|
@ -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"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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.
|
||||||
|
|
|
||||||
|
|
@ -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"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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() {
|
||||||
|
|
|
||||||
|
|
@ -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.
|
||||||
|
|
|
||||||
|
|
@ -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"
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -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 (
|
||||||
|
|
|
||||||
|
|
@ -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{
|
||||||
|
|
|
||||||
|
|
@ -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"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue