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
[![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)
# Gotify Server
[![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"
"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.

View File

@@ -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"

View File

@@ -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 {

View File

@@ -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 {

View File

@@ -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 {

View File

@@ -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.

View File

@@ -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"

View File

@@ -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 {

View File

@@ -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"

View File

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

View File

@@ -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"

View File

@@ -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 {

View File

@@ -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.

View File

@@ -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"
)

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).
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
}

View File

@@ -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) {

View File

@@ -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.

View File

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

View File

@@ -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 {

View File

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

View File

@@ -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.

View File

@@ -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.

View File

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

View File

@@ -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.

View File

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

View File

@@ -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() {

View File

@@ -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.

View File

@@ -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"
)

View File

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

View File

@@ -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{

View File

@@ -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"
)