mirror of
https://github.com/gotify/server.git
synced 2024-01-28 15:20:56 +03:00
Use v2 in package path
This commit is contained in:
@@ -8,8 +8,8 @@ import (
|
||||
"path/filepath"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/gotify/server/auth"
|
||||
"github.com/gotify/server/model"
|
||||
"github.com/gotify/server/v2/auth"
|
||||
"github.com/gotify/server/v2/model"
|
||||
"github.com/h2non/filetype"
|
||||
)
|
||||
|
||||
|
||||
@@ -12,10 +12,10 @@ import (
|
||||
"testing"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/gotify/server/mode"
|
||||
"github.com/gotify/server/model"
|
||||
"github.com/gotify/server/test"
|
||||
"github.com/gotify/server/test/testdb"
|
||||
"github.com/gotify/server/v2/mode"
|
||||
"github.com/gotify/server/v2/model"
|
||||
"github.com/gotify/server/v2/test"
|
||||
"github.com/gotify/server/v2/test/testdb"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/suite"
|
||||
)
|
||||
|
||||
@@ -4,8 +4,8 @@ import (
|
||||
"fmt"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/gotify/server/auth"
|
||||
"github.com/gotify/server/model"
|
||||
"github.com/gotify/server/v2/auth"
|
||||
"github.com/gotify/server/v2/model"
|
||||
)
|
||||
|
||||
// The ClientDatabase interface for encapsulating database access.
|
||||
|
||||
@@ -7,10 +7,10 @@ import (
|
||||
"testing"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/gotify/server/mode"
|
||||
"github.com/gotify/server/model"
|
||||
"github.com/gotify/server/test"
|
||||
"github.com/gotify/server/test/testdb"
|
||||
"github.com/gotify/server/v2/mode"
|
||||
"github.com/gotify/server/v2/model"
|
||||
"github.com/gotify/server/v2/test"
|
||||
"github.com/gotify/server/v2/test/testdb"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/suite"
|
||||
)
|
||||
|
||||
@@ -2,7 +2,7 @@ package api
|
||||
|
||||
import (
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/gotify/server/model"
|
||||
"github.com/gotify/server/v2/model"
|
||||
)
|
||||
|
||||
// The HealthDatabase interface for encapsulating database access.
|
||||
|
||||
@@ -5,10 +5,10 @@ import (
|
||||
"testing"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/gotify/server/mode"
|
||||
"github.com/gotify/server/model"
|
||||
"github.com/gotify/server/test"
|
||||
"github.com/gotify/server/test/testdb"
|
||||
"github.com/gotify/server/v2/mode"
|
||||
"github.com/gotify/server/v2/model"
|
||||
"github.com/gotify/server/v2/test"
|
||||
"github.com/gotify/server/v2/test/testdb"
|
||||
"github.com/stretchr/testify/suite"
|
||||
)
|
||||
|
||||
|
||||
@@ -10,8 +10,8 @@ import (
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/gin-gonic/gin/binding"
|
||||
"github.com/gotify/location"
|
||||
"github.com/gotify/server/auth"
|
||||
"github.com/gotify/server/model"
|
||||
"github.com/gotify/server/v2/auth"
|
||||
"github.com/gotify/server/v2/model"
|
||||
)
|
||||
|
||||
// The MessageDatabase interface for encapsulating database access.
|
||||
|
||||
@@ -8,11 +8,11 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/gotify/server/auth"
|
||||
"github.com/gotify/server/mode"
|
||||
"github.com/gotify/server/model"
|
||||
"github.com/gotify/server/test"
|
||||
"github.com/gotify/server/test/testdb"
|
||||
"github.com/gotify/server/v2/auth"
|
||||
"github.com/gotify/server/v2/mode"
|
||||
"github.com/gotify/server/v2/model"
|
||||
"github.com/gotify/server/v2/test"
|
||||
"github.com/gotify/server/v2/test/testdb"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/suite"
|
||||
)
|
||||
|
||||
@@ -9,10 +9,10 @@ import (
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/go-yaml/yaml"
|
||||
"github.com/gotify/server/auth"
|
||||
"github.com/gotify/server/model"
|
||||
"github.com/gotify/server/plugin"
|
||||
"github.com/gotify/server/plugin/compat"
|
||||
"github.com/gotify/server/v2/auth"
|
||||
"github.com/gotify/server/v2/model"
|
||||
"github.com/gotify/server/v2/plugin"
|
||||
"github.com/gotify/server/v2/plugin/compat"
|
||||
)
|
||||
|
||||
// The PluginDatabase interface for encapsulating database access.
|
||||
|
||||
@@ -10,13 +10,13 @@ import (
|
||||
|
||||
"github.com/go-yaml/yaml"
|
||||
|
||||
"github.com/gotify/server/mode"
|
||||
"github.com/gotify/server/model"
|
||||
"github.com/gotify/server/plugin"
|
||||
"github.com/gotify/server/plugin/compat"
|
||||
"github.com/gotify/server/plugin/testing/mock"
|
||||
"github.com/gotify/server/test"
|
||||
"github.com/gotify/server/test/testdb"
|
||||
"github.com/gotify/server/v2/mode"
|
||||
"github.com/gotify/server/v2/model"
|
||||
"github.com/gotify/server/v2/plugin"
|
||||
"github.com/gotify/server/v2/plugin/compat"
|
||||
"github.com/gotify/server/v2/plugin/testing/mock"
|
||||
"github.com/gotify/server/v2/test"
|
||||
"github.com/gotify/server/v2/test/testdb"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
|
||||
@@ -58,14 +58,14 @@ func (s *PluginSuite) BeforeTest(suiteName, testName string) {
|
||||
|
||||
s.db.CreatePluginConf(&model.PluginConf{
|
||||
UserID: 1,
|
||||
ModulePath: "github.com/gotify/server/plugin/example/removed",
|
||||
ModulePath: "github.com/gotify/server/v2/plugin/example/removed",
|
||||
Token: "P1234",
|
||||
Enabled: false,
|
||||
})
|
||||
}
|
||||
|
||||
func (s *PluginSuite) getDanglingConf(uid uint) *model.PluginConf {
|
||||
conf, err := s.db.GetPluginConfByUserAndPath(uid, "github.com/gotify/server/plugin/example/removed")
|
||||
conf, err := s.db.GetPluginConfByUserAndPath(uid, "github.com/gotify/server/v2/plugin/example/removed")
|
||||
assert.NoError(s.T(), err)
|
||||
return conf
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/gorilla/websocket"
|
||||
"github.com/gotify/server/model"
|
||||
"github.com/gotify/server/v2/model"
|
||||
)
|
||||
|
||||
const (
|
||||
|
||||
@@ -10,9 +10,9 @@ import (
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/gorilla/websocket"
|
||||
"github.com/gotify/server/auth"
|
||||
"github.com/gotify/server/mode"
|
||||
"github.com/gotify/server/model"
|
||||
"github.com/gotify/server/v2/auth"
|
||||
"github.com/gotify/server/v2/mode"
|
||||
"github.com/gotify/server/v2/model"
|
||||
)
|
||||
|
||||
// The API provides a handler for a WebSocket stream API.
|
||||
|
||||
@@ -14,9 +14,9 @@ import (
|
||||
"github.com/fortytw2/leaktest"
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/gorilla/websocket"
|
||||
"github.com/gotify/server/auth"
|
||||
"github.com/gotify/server/mode"
|
||||
"github.com/gotify/server/model"
|
||||
"github.com/gotify/server/v2/auth"
|
||||
"github.com/gotify/server/v2/mode"
|
||||
"github.com/gotify/server/v2/model"
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package api
|
||||
|
||||
import (
|
||||
"github.com/gotify/server/auth"
|
||||
"github.com/gotify/server/v2/auth"
|
||||
)
|
||||
|
||||
var generateApplicationToken = auth.GenerateApplicationToken
|
||||
|
||||
@@ -4,9 +4,9 @@ import (
|
||||
"errors"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/gotify/server/auth"
|
||||
"github.com/gotify/server/auth/password"
|
||||
"github.com/gotify/server/model"
|
||||
"github.com/gotify/server/v2/auth"
|
||||
"github.com/gotify/server/v2/auth/password"
|
||||
"github.com/gotify/server/v2/model"
|
||||
)
|
||||
|
||||
// The UserDatabase interface for encapsulating database access.
|
||||
|
||||
@@ -7,11 +7,11 @@ import (
|
||||
"testing"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/gotify/server/auth/password"
|
||||
"github.com/gotify/server/mode"
|
||||
"github.com/gotify/server/model"
|
||||
"github.com/gotify/server/test"
|
||||
"github.com/gotify/server/test/testdb"
|
||||
"github.com/gotify/server/v2/auth/password"
|
||||
"github.com/gotify/server/v2/mode"
|
||||
"github.com/gotify/server/v2/model"
|
||||
"github.com/gotify/server/v2/test"
|
||||
"github.com/gotify/server/v2/test/testdb"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/suite"
|
||||
)
|
||||
|
||||
12
app.go
12
app.go
@@ -6,12 +6,12 @@ import (
|
||||
"os"
|
||||
"time"
|
||||
|
||||
"github.com/gotify/server/config"
|
||||
"github.com/gotify/server/database"
|
||||
"github.com/gotify/server/mode"
|
||||
"github.com/gotify/server/model"
|
||||
"github.com/gotify/server/router"
|
||||
"github.com/gotify/server/runner"
|
||||
"github.com/gotify/server/v2/config"
|
||||
"github.com/gotify/server/v2/database"
|
||||
"github.com/gotify/server/v2/mode"
|
||||
"github.com/gotify/server/v2/model"
|
||||
"github.com/gotify/server/v2/router"
|
||||
"github.com/gotify/server/v2/runner"
|
||||
)
|
||||
|
||||
var (
|
||||
|
||||
@@ -4,8 +4,8 @@ import (
|
||||
"errors"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/gotify/server/auth/password"
|
||||
"github.com/gotify/server/model"
|
||||
"github.com/gotify/server/v2/auth/password"
|
||||
"github.com/gotify/server/v2/model"
|
||||
)
|
||||
|
||||
const (
|
||||
|
||||
@@ -8,10 +8,10 @@ import (
|
||||
"testing"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/gotify/server/auth/password"
|
||||
"github.com/gotify/server/mode"
|
||||
"github.com/gotify/server/model"
|
||||
"github.com/gotify/server/test/testdb"
|
||||
"github.com/gotify/server/v2/auth/password"
|
||||
"github.com/gotify/server/v2/mode"
|
||||
"github.com/gotify/server/v2/model"
|
||||
"github.com/gotify/server/v2/test/testdb"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/suite"
|
||||
)
|
||||
|
||||
@@ -6,8 +6,8 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/gin-contrib/cors"
|
||||
"github.com/gotify/server/config"
|
||||
"github.com/gotify/server/mode"
|
||||
"github.com/gotify/server/v2/config"
|
||||
"github.com/gotify/server/v2/mode"
|
||||
)
|
||||
|
||||
// CorsConfig generates a config to use in gin cors middleware based on server configuration
|
||||
|
||||
@@ -5,8 +5,8 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/gin-contrib/cors"
|
||||
"github.com/gotify/server/config"
|
||||
"github.com/gotify/server/mode"
|
||||
"github.com/gotify/server/v2/config"
|
||||
"github.com/gotify/server/v2/mode"
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ import (
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"github.com/gotify/server/test"
|
||||
"github.com/gotify/server/v2/test"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
@@ -2,7 +2,7 @@ package auth
|
||||
|
||||
import (
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/gotify/server/model"
|
||||
"github.com/gotify/server/v2/model"
|
||||
)
|
||||
|
||||
// RegisterAuthentication registers the user id, user and or token.
|
||||
|
||||
@@ -5,8 +5,8 @@ import (
|
||||
"testing"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/gotify/server/mode"
|
||||
"github.com/gotify/server/model"
|
||||
"github.com/gotify/server/v2/mode"
|
||||
"github.com/gotify/server/v2/model"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/suite"
|
||||
)
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
"strings"
|
||||
|
||||
"github.com/gotify/configor"
|
||||
"github.com/gotify/server/mode"
|
||||
"github.com/gotify/server/v2/mode"
|
||||
)
|
||||
|
||||
// Configuration is stuff that can be configured externally per env variables or config file (config.yml).
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
"path/filepath"
|
||||
"testing"
|
||||
|
||||
"github.com/gotify/server/mode"
|
||||
"github.com/gotify/server/v2/mode"
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package database
|
||||
|
||||
import (
|
||||
"github.com/gotify/server/model"
|
||||
"github.com/gotify/server/v2/model"
|
||||
"github.com/jinzhu/gorm"
|
||||
)
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package database
|
||||
|
||||
import (
|
||||
"github.com/gotify/server/model"
|
||||
"github.com/gotify/server/v2/model"
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package database
|
||||
|
||||
import (
|
||||
"github.com/gotify/server/model"
|
||||
"github.com/gotify/server/v2/model"
|
||||
"github.com/jinzhu/gorm"
|
||||
)
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package database
|
||||
|
||||
import (
|
||||
"github.com/gotify/server/model"
|
||||
"github.com/gotify/server/v2/model"
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
|
||||
@@ -4,8 +4,8 @@ import (
|
||||
"os"
|
||||
"path/filepath"
|
||||
|
||||
"github.com/gotify/server/auth/password"
|
||||
"github.com/gotify/server/model"
|
||||
"github.com/gotify/server/v2/auth/password"
|
||||
"github.com/gotify/server/v2/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
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
"os"
|
||||
"testing"
|
||||
|
||||
"github.com/gotify/server/test"
|
||||
"github.com/gotify/server/v2/test"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/suite"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package database
|
||||
|
||||
import (
|
||||
"github.com/gotify/server/model"
|
||||
"github.com/gotify/server/v2/model"
|
||||
"github.com/jinzhu/gorm"
|
||||
)
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/gotify/server/model"
|
||||
"github.com/gotify/server/v2/model"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
@@ -3,8 +3,8 @@ package database
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/gotify/server/model"
|
||||
"github.com/gotify/server/test"
|
||||
"github.com/gotify/server/v2/model"
|
||||
"github.com/gotify/server/v2/test"
|
||||
"github.com/jinzhu/gorm"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/suite"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package database
|
||||
|
||||
import (
|
||||
"github.com/gotify/server/model"
|
||||
"github.com/gotify/server/v2/model"
|
||||
"github.com/jinzhu/gorm"
|
||||
)
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package database
|
||||
|
||||
import (
|
||||
"github.com/gotify/server/model"
|
||||
"github.com/gotify/server/v2/model"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package database
|
||||
|
||||
import (
|
||||
"github.com/gotify/server/model"
|
||||
"github.com/gotify/server/v2/model"
|
||||
"github.com/jinzhu/gorm"
|
||||
)
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package database
|
||||
|
||||
import (
|
||||
"github.com/gotify/server/model"
|
||||
"github.com/gotify/server/v2/model"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
@@ -6,7 +6,7 @@ import (
|
||||
"testing"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/gotify/server/mode"
|
||||
"github.com/gotify/server/v2/mode"
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
"testing"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/gotify/server/mode"
|
||||
"github.com/gotify/server/v2/mode"
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ import (
|
||||
"unicode"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/gotify/server/model"
|
||||
"github.com/gotify/server/v2/model"
|
||||
"gopkg.in/go-playground/validator.v9"
|
||||
)
|
||||
|
||||
|
||||
@@ -8,8 +8,8 @@ import (
|
||||
"testing"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/gotify/server/mode"
|
||||
"github.com/gotify/server/model"
|
||||
"github.com/gotify/server/v2/mode"
|
||||
"github.com/gotify/server/v2/model"
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"net/http"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/gotify/server/model"
|
||||
"github.com/gotify/server/v2/model"
|
||||
)
|
||||
|
||||
// NotFound creates a gin middleware for handling page not found.
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
"testing"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/gotify/server/mode"
|
||||
"github.com/gotify/server/v2/mode"
|
||||
)
|
||||
|
||||
func TestNotFound(t *testing.T) {
|
||||
|
||||
2
go.mod
2
go.mod
@@ -1,4 +1,4 @@
|
||||
module github.com/gotify/server
|
||||
module github.com/gotify/server/v2
|
||||
|
||||
require (
|
||||
github.com/Southclaws/configor v1.0.0 // indirect
|
||||
|
||||
@@ -6,7 +6,7 @@ import (
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
const examplePluginPath = "github.com/gotify/server/plugin/example/echo"
|
||||
const examplePluginPath = "github.com/gotify/server/v2/plugin/example/echo"
|
||||
|
||||
func TestPluginInfoStringer(t *testing.T) {
|
||||
info := Info{
|
||||
|
||||
@@ -10,7 +10,7 @@ import (
|
||||
"plugin"
|
||||
"testing"
|
||||
|
||||
"github.com/gotify/server/test"
|
||||
"github.com/gotify/server/v2/test"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
|
||||
@@ -135,10 +135,10 @@ func TestWrapIncompatiblePlugins(t *testing.T) {
|
||||
tmpDir := test.NewTmpDir("gotify_testwrapincompatibleplugins")
|
||||
defer tmpDir.Clean()
|
||||
for i, modulePath := range []string{
|
||||
"github.com/gotify/server/plugin/testing/broken/noinstance",
|
||||
"github.com/gotify/server/plugin/testing/broken/nothing",
|
||||
"github.com/gotify/server/plugin/testing/broken/unknowninfo",
|
||||
"github.com/gotify/server/plugin/testing/broken/malformedconstructor",
|
||||
"github.com/gotify/server/v2/plugin/testing/broken/noinstance",
|
||||
"github.com/gotify/server/v2/plugin/testing/broken/nothing",
|
||||
"github.com/gotify/server/v2/plugin/testing/broken/unknowninfo",
|
||||
"github.com/gotify/server/v2/plugin/testing/broken/malformedconstructor",
|
||||
} {
|
||||
fName := tmpDir.Path(fmt.Sprintf("broken_%d.so", i))
|
||||
exec.Command("go", "get", "-d").Run()
|
||||
|
||||
@@ -12,7 +12,7 @@ func GetGotifyPluginInfo() plugin.Info {
|
||||
return plugin.Info{
|
||||
Name: "clock",
|
||||
Description: "Sends an hourly reminder",
|
||||
ModulePath: "github.com/gotify/server/example/clock",
|
||||
ModulePath: "github.com/gotify/server/v2/example/clock",
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ import (
|
||||
// GetGotifyPluginInfo returns gotify plugin info.
|
||||
func GetGotifyPluginInfo() plugin.Info {
|
||||
return plugin.Info{
|
||||
ModulePath: "github.com/gotify/server/plugin/example/echo",
|
||||
ModulePath: "github.com/gotify/server/v2/plugin/example/echo",
|
||||
Name: "test plugin",
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
func GetGotifyPluginInfo() plugin.Info {
|
||||
return plugin.Info{
|
||||
Name: "minimal plugin",
|
||||
ModulePath: "github.com/gotify/server/example/minimal",
|
||||
ModulePath: "github.com/gotify/server/v2/example/minimal",
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -16,9 +16,9 @@ import (
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/go-yaml/yaml"
|
||||
"github.com/gotify/server/auth"
|
||||
"github.com/gotify/server/model"
|
||||
"github.com/gotify/server/plugin/compat"
|
||||
"github.com/gotify/server/v2/auth"
|
||||
"github.com/gotify/server/v2/model"
|
||||
"github.com/gotify/server/v2/plugin/compat"
|
||||
)
|
||||
|
||||
// The Database interface for encapsulating database access.
|
||||
|
||||
@@ -13,12 +13,12 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/gotify/server/auth"
|
||||
"github.com/gotify/server/model"
|
||||
"github.com/gotify/server/plugin/compat"
|
||||
"github.com/gotify/server/plugin/testing/mock"
|
||||
"github.com/gotify/server/test"
|
||||
"github.com/gotify/server/test/testdb"
|
||||
"github.com/gotify/server/v2/auth"
|
||||
"github.com/gotify/server/v2/model"
|
||||
"github.com/gotify/server/v2/plugin/compat"
|
||||
"github.com/gotify/server/v2/plugin/testing/mock"
|
||||
"github.com/gotify/server/v2/test"
|
||||
"github.com/gotify/server/v2/test/testdb"
|
||||
|
||||
"github.com/jinzhu/gorm"
|
||||
|
||||
@@ -28,9 +28,9 @@ import (
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
const examplePluginPath = "github.com/gotify/server/plugin/example/echo"
|
||||
const examplePluginPath = "github.com/gotify/server/v2/plugin/example/echo"
|
||||
const mockPluginPath = mock.ModulePath
|
||||
const danglingPluginPath = "github.com/gotify/server/plugin/testing/removed"
|
||||
const danglingPluginPath = "github.com/gotify/server/v2/plugin/testing/removed"
|
||||
|
||||
type ManagerSuite struct {
|
||||
suite.Suite
|
||||
|
||||
@@ -3,8 +3,8 @@ package plugin
|
||||
import (
|
||||
"time"
|
||||
|
||||
"github.com/gotify/server/model"
|
||||
"github.com/gotify/server/plugin/compat"
|
||||
"github.com/gotify/server/v2/model"
|
||||
"github.com/gotify/server/v2/plugin/compat"
|
||||
)
|
||||
|
||||
type redirectToChannel struct {
|
||||
|
||||
@@ -6,8 +6,8 @@ import (
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
|
||||
"github.com/gotify/server/model"
|
||||
"github.com/gotify/server/test/testdb"
|
||||
"github.com/gotify/server/v2/model"
|
||||
"github.com/gotify/server/v2/test/testdb"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
@@ -9,7 +9,7 @@ import (
|
||||
// GetGotifyPluginInfo returns gotify plugin info
|
||||
func GetGotifyPluginInfo() plugin.Info {
|
||||
return plugin.Info{
|
||||
ModulePath: "github.com/gotify/server/plugin/testing/broken/noinstance",
|
||||
ModulePath: "github.com/gotify/server/v2/plugin/testing/broken/noinstance",
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ import (
|
||||
// GetGotifyPluginInfo returns gotify plugin info
|
||||
func GetGotifyPluginInfo() plugin.Info {
|
||||
return plugin.Info{
|
||||
ModulePath: "github.com/gotify/server/plugin/testing/broken/malformedconstructor",
|
||||
ModulePath: "github.com/gotify/server/v2/plugin/testing/broken/malformedconstructor",
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ import (
|
||||
// GetGotifyPluginInfo returns gotify plugin info
|
||||
func GetGotifyPluginInfo() plugin.Info {
|
||||
return plugin.Info{
|
||||
ModulePath: "github.com/gotify/server/plugin/testing/broken/noinstance",
|
||||
ModulePath: "github.com/gotify/server/v2/plugin/testing/broken/noinstance",
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ package main
|
||||
|
||||
// GetGotifyPluginInfo returns gotify plugin info
|
||||
func GetGotifyPluginInfo() string {
|
||||
return "github.com/gotify/server/plugin/testing/broken/unknowninfo"
|
||||
return "github.com/gotify/server/v2/plugin/testing/broken/unknowninfo"
|
||||
}
|
||||
|
||||
func main() {
|
||||
|
||||
@@ -6,11 +6,11 @@ import (
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
|
||||
"github.com/gotify/server/plugin/compat"
|
||||
"github.com/gotify/server/v2/plugin/compat"
|
||||
)
|
||||
|
||||
// ModulePath is for convenient access of the module path of this mock plugin
|
||||
const ModulePath = "github.com/gotify/server/plugin/testing/mock"
|
||||
const ModulePath = "github.com/gotify/server/v2/plugin/testing/mock"
|
||||
|
||||
// Name is for convenient access of the module path of the name of this mock plugin
|
||||
const Name = "mock plugin"
|
||||
|
||||
@@ -6,16 +6,16 @@ import (
|
||||
"github.com/gin-contrib/cors"
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/gotify/location"
|
||||
"github.com/gotify/server/api"
|
||||
"github.com/gotify/server/api/stream"
|
||||
"github.com/gotify/server/auth"
|
||||
"github.com/gotify/server/config"
|
||||
"github.com/gotify/server/database"
|
||||
"github.com/gotify/server/docs"
|
||||
"github.com/gotify/server/error"
|
||||
"github.com/gotify/server/model"
|
||||
"github.com/gotify/server/plugin"
|
||||
"github.com/gotify/server/ui"
|
||||
"github.com/gotify/server/v2/api"
|
||||
"github.com/gotify/server/v2/api/stream"
|
||||
"github.com/gotify/server/v2/auth"
|
||||
"github.com/gotify/server/v2/config"
|
||||
"github.com/gotify/server/v2/database"
|
||||
"github.com/gotify/server/v2/docs"
|
||||
"github.com/gotify/server/v2/error"
|
||||
"github.com/gotify/server/v2/model"
|
||||
"github.com/gotify/server/v2/plugin"
|
||||
"github.com/gotify/server/v2/ui"
|
||||
)
|
||||
|
||||
// Create creates the gin engine with all routes.
|
||||
|
||||
@@ -9,10 +9,10 @@ import (
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"github.com/gotify/server/config"
|
||||
"github.com/gotify/server/mode"
|
||||
"github.com/gotify/server/model"
|
||||
"github.com/gotify/server/test/testdb"
|
||||
"github.com/gotify/server/v2/config"
|
||||
"github.com/gotify/server/v2/mode"
|
||||
"github.com/gotify/server/v2/model"
|
||||
"github.com/gotify/server/v2/test/testdb"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/suite"
|
||||
)
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"net/http"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/gotify/server/config"
|
||||
"github.com/gotify/server/v2/config"
|
||||
"golang.org/x/crypto/acme/autocert"
|
||||
)
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
"net/http/httptest"
|
||||
"testing"
|
||||
|
||||
"github.com/gotify/server/test"
|
||||
"github.com/gotify/server/v2/test"
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ package test
|
||||
|
||||
import (
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/gotify/server/model"
|
||||
"github.com/gotify/server/v2/model"
|
||||
)
|
||||
|
||||
// WithUser fake an authentication for testing.
|
||||
|
||||
@@ -4,9 +4,9 @@ import (
|
||||
"testing"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/gotify/server/auth"
|
||||
"github.com/gotify/server/mode"
|
||||
"github.com/gotify/server/test"
|
||||
"github.com/gotify/server/v2/auth"
|
||||
"github.com/gotify/server/v2/mode"
|
||||
"github.com/gotify/server/v2/test"
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
|
||||
@@ -5,8 +5,8 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/gotify/server/database"
|
||||
"github.com/gotify/server/model"
|
||||
"github.com/gotify/server/v2/database"
|
||||
"github.com/gotify/server/v2/model"
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
|
||||
@@ -3,9 +3,9 @@ package testdb_test
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/gotify/server/mode"
|
||||
"github.com/gotify/server/model"
|
||||
"github.com/gotify/server/test/testdb"
|
||||
"github.com/gotify/server/v2/mode"
|
||||
"github.com/gotify/server/v2/model"
|
||||
"github.com/gotify/server/v2/test/testdb"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/suite"
|
||||
)
|
||||
|
||||
@@ -14,7 +14,7 @@ let gotify: GotifyTest;
|
||||
|
||||
beforeAll(async () => {
|
||||
const gotifyPluginDir = pluginSupported
|
||||
? await newPluginDir(['github.com/gotify/server/plugin/example/echo'])
|
||||
? await newPluginDir(['github.com/gotify/server/v2/plugin/example/echo'])
|
||||
: '';
|
||||
gotify = await newTest(gotifyPluginDir);
|
||||
page = gotify.page;
|
||||
@@ -118,7 +118,7 @@ describe('plugin', () => {
|
||||
it('has plugin info', async () => {
|
||||
await inDetailPage(1, async () => {
|
||||
expect(await pluginInfo('module-path')).toBe(
|
||||
'github.com/gotify/server/plugin/example/echo'
|
||||
'github.com/gotify/server/v2/plugin/example/echo'
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user