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