Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 1437a5bf5c | |||
| 84a2a1a0f7 | |||
| 9a25302222 | |||
| 30475356fd |
+1
-1
@@ -16,7 +16,7 @@
|
||||
/debug
|
||||
/swirl
|
||||
/data
|
||||
/__debug_bin*
|
||||
__debug_bin*
|
||||
|
||||
# node
|
||||
node_modules
|
||||
|
||||
+3
-3
@@ -3,9 +3,9 @@ package api
|
||||
import (
|
||||
"github.com/cuigh/auxo/data"
|
||||
"github.com/cuigh/auxo/net/web"
|
||||
"github.com/cuigh/swirl/biz"
|
||||
"github.com/cuigh/swirl/dao"
|
||||
"github.com/cuigh/swirl/misc"
|
||||
"github.com/lafriks/swirl2/biz"
|
||||
"github.com/lafriks/swirl2/dao"
|
||||
"github.com/lafriks/swirl2/misc"
|
||||
)
|
||||
|
||||
// ChartHandler encapsulates chart related handlers.
|
||||
|
||||
+2
-2
@@ -3,8 +3,8 @@ package api
|
||||
import (
|
||||
"github.com/cuigh/auxo/data"
|
||||
"github.com/cuigh/auxo/net/web"
|
||||
"github.com/cuigh/swirl/biz"
|
||||
"github.com/cuigh/swirl/misc"
|
||||
"github.com/lafriks/swirl2/biz"
|
||||
"github.com/lafriks/swirl2/misc"
|
||||
)
|
||||
|
||||
// ConfigHandler encapsulates config related handlers.
|
||||
|
||||
+2
-2
@@ -7,10 +7,10 @@ import (
|
||||
"github.com/cuigh/auxo/data"
|
||||
"github.com/cuigh/auxo/log"
|
||||
"github.com/cuigh/auxo/net/web"
|
||||
"github.com/cuigh/swirl/biz"
|
||||
"github.com/cuigh/swirl/misc"
|
||||
"github.com/gobwas/ws"
|
||||
"github.com/gobwas/ws/wsutil"
|
||||
"github.com/lafriks/swirl2/biz"
|
||||
"github.com/lafriks/swirl2/misc"
|
||||
)
|
||||
|
||||
// ContainerHandler encapsulates container related handlers.
|
||||
|
||||
+3
-3
@@ -7,9 +7,9 @@ import (
|
||||
"github.com/cuigh/auxo/errors"
|
||||
"github.com/cuigh/auxo/ext/times"
|
||||
"github.com/cuigh/auxo/net/web"
|
||||
"github.com/cuigh/swirl/biz"
|
||||
"github.com/cuigh/swirl/dao"
|
||||
"github.com/cuigh/swirl/misc"
|
||||
"github.com/lafriks/swirl2/biz"
|
||||
"github.com/lafriks/swirl2/dao"
|
||||
"github.com/lafriks/swirl2/misc"
|
||||
)
|
||||
|
||||
// DashboardHandler encapsulates dashboard related handlers.
|
||||
|
||||
+3
-3
@@ -3,9 +3,9 @@ package api
|
||||
import (
|
||||
"github.com/cuigh/auxo/data"
|
||||
"github.com/cuigh/auxo/net/web"
|
||||
"github.com/cuigh/swirl/biz"
|
||||
"github.com/cuigh/swirl/dao"
|
||||
"github.com/cuigh/swirl/misc"
|
||||
"github.com/lafriks/swirl2/biz"
|
||||
"github.com/lafriks/swirl2/dao"
|
||||
"github.com/lafriks/swirl2/misc"
|
||||
)
|
||||
|
||||
// EventHandler encapsulates event related handlers.
|
||||
|
||||
+2
-2
@@ -3,8 +3,8 @@ package api
|
||||
import (
|
||||
"github.com/cuigh/auxo/data"
|
||||
"github.com/cuigh/auxo/net/web"
|
||||
"github.com/cuigh/swirl/biz"
|
||||
"github.com/cuigh/swirl/misc"
|
||||
"github.com/lafriks/swirl2/biz"
|
||||
"github.com/lafriks/swirl2/misc"
|
||||
)
|
||||
|
||||
// ImageHandler encapsulates image related handlers.
|
||||
|
||||
+2
-2
@@ -3,8 +3,8 @@ package api
|
||||
import (
|
||||
"github.com/cuigh/auxo/data"
|
||||
"github.com/cuigh/auxo/net/web"
|
||||
"github.com/cuigh/swirl/biz"
|
||||
"github.com/cuigh/swirl/misc"
|
||||
"github.com/lafriks/swirl2/biz"
|
||||
"github.com/lafriks/swirl2/misc"
|
||||
)
|
||||
|
||||
// NetworkHandler encapsulates network related handlers.
|
||||
|
||||
+2
-2
@@ -4,8 +4,8 @@ import (
|
||||
"github.com/cuigh/auxo/data"
|
||||
"github.com/cuigh/auxo/net/web"
|
||||
"github.com/cuigh/auxo/util/cast"
|
||||
"github.com/cuigh/swirl/biz"
|
||||
"github.com/cuigh/swirl/misc"
|
||||
"github.com/lafriks/swirl2/biz"
|
||||
"github.com/lafriks/swirl2/misc"
|
||||
)
|
||||
|
||||
// NodeHandler encapsulates node related handlers.
|
||||
|
||||
+3
-3
@@ -2,9 +2,9 @@ package api
|
||||
|
||||
import (
|
||||
"github.com/cuigh/auxo/net/web"
|
||||
"github.com/cuigh/swirl/biz"
|
||||
"github.com/cuigh/swirl/dao"
|
||||
"github.com/cuigh/swirl/misc"
|
||||
"github.com/lafriks/swirl2/biz"
|
||||
"github.com/lafriks/swirl2/dao"
|
||||
"github.com/lafriks/swirl2/misc"
|
||||
)
|
||||
|
||||
// RegistryHandler encapsulates registry related handlers.
|
||||
|
||||
+3
-3
@@ -2,9 +2,9 @@ package api
|
||||
|
||||
import (
|
||||
"github.com/cuigh/auxo/net/web"
|
||||
"github.com/cuigh/swirl/biz"
|
||||
"github.com/cuigh/swirl/dao"
|
||||
"github.com/cuigh/swirl/misc"
|
||||
"github.com/lafriks/swirl2/biz"
|
||||
"github.com/lafriks/swirl2/dao"
|
||||
"github.com/lafriks/swirl2/misc"
|
||||
)
|
||||
|
||||
// RoleHandler encapsulates role related handlers.
|
||||
|
||||
+2
-2
@@ -3,8 +3,8 @@ package api
|
||||
import (
|
||||
"github.com/cuigh/auxo/data"
|
||||
"github.com/cuigh/auxo/net/web"
|
||||
"github.com/cuigh/swirl/biz"
|
||||
"github.com/cuigh/swirl/misc"
|
||||
"github.com/lafriks/swirl2/biz"
|
||||
"github.com/lafriks/swirl2/misc"
|
||||
)
|
||||
|
||||
// SecretHandler encapsulates secret related handlers.
|
||||
|
||||
+2
-2
@@ -5,8 +5,8 @@ import (
|
||||
|
||||
"github.com/cuigh/auxo/data"
|
||||
"github.com/cuigh/auxo/net/web"
|
||||
"github.com/cuigh/swirl/biz"
|
||||
"github.com/cuigh/swirl/misc"
|
||||
"github.com/lafriks/swirl2/biz"
|
||||
"github.com/lafriks/swirl2/misc"
|
||||
)
|
||||
|
||||
// ServiceHandler encapsulates service related handlers.
|
||||
|
||||
+2
-2
@@ -4,8 +4,8 @@ import (
|
||||
"encoding/json"
|
||||
|
||||
"github.com/cuigh/auxo/net/web"
|
||||
"github.com/cuigh/swirl/biz"
|
||||
"github.com/cuigh/swirl/misc"
|
||||
"github.com/lafriks/swirl2/biz"
|
||||
"github.com/lafriks/swirl2/misc"
|
||||
)
|
||||
|
||||
// SettingHandler encapsulates setting related handlers.
|
||||
|
||||
+4
-4
@@ -4,10 +4,10 @@ import (
|
||||
"io"
|
||||
|
||||
"github.com/cuigh/auxo/net/web"
|
||||
"github.com/cuigh/swirl/biz"
|
||||
"github.com/cuigh/swirl/dao"
|
||||
"github.com/cuigh/swirl/docker/compose"
|
||||
"github.com/cuigh/swirl/misc"
|
||||
"github.com/lafriks/swirl2/biz"
|
||||
"github.com/lafriks/swirl2/dao"
|
||||
"github.com/lafriks/swirl2/docker/compose"
|
||||
"github.com/lafriks/swirl2/misc"
|
||||
)
|
||||
|
||||
// StackHandler encapsulates stack related handlers.
|
||||
|
||||
+4
-4
@@ -7,10 +7,10 @@ import (
|
||||
"github.com/cuigh/auxo/data"
|
||||
"github.com/cuigh/auxo/errors"
|
||||
"github.com/cuigh/auxo/net/web"
|
||||
"github.com/cuigh/swirl/biz"
|
||||
"github.com/cuigh/swirl/dao"
|
||||
"github.com/cuigh/swirl/docker"
|
||||
"github.com/cuigh/swirl/misc"
|
||||
"github.com/lafriks/swirl2/biz"
|
||||
"github.com/lafriks/swirl2/dao"
|
||||
"github.com/lafriks/swirl2/docker"
|
||||
"github.com/lafriks/swirl2/misc"
|
||||
)
|
||||
|
||||
// SystemHandler encapsulates system related handlers.
|
||||
|
||||
+2
-2
@@ -5,8 +5,8 @@ import (
|
||||
|
||||
"github.com/cuigh/auxo/data"
|
||||
"github.com/cuigh/auxo/net/web"
|
||||
"github.com/cuigh/swirl/biz"
|
||||
"github.com/cuigh/swirl/misc"
|
||||
"github.com/lafriks/swirl2/biz"
|
||||
"github.com/lafriks/swirl2/misc"
|
||||
)
|
||||
|
||||
// TaskHandler encapsulates node related handlers.
|
||||
|
||||
+4
-4
@@ -3,10 +3,10 @@ package api
|
||||
import (
|
||||
"github.com/cuigh/auxo/data"
|
||||
"github.com/cuigh/auxo/net/web"
|
||||
"github.com/cuigh/swirl/biz"
|
||||
"github.com/cuigh/swirl/dao"
|
||||
"github.com/cuigh/swirl/misc"
|
||||
"github.com/cuigh/swirl/security"
|
||||
"github.com/lafriks/swirl2/biz"
|
||||
"github.com/lafriks/swirl2/dao"
|
||||
"github.com/lafriks/swirl2/misc"
|
||||
"github.com/lafriks/swirl2/security"
|
||||
)
|
||||
|
||||
// UserHandler encapsulates user related handlers.
|
||||
|
||||
+2
-2
@@ -3,8 +3,8 @@ package api
|
||||
import (
|
||||
"github.com/cuigh/auxo/data"
|
||||
"github.com/cuigh/auxo/net/web"
|
||||
"github.com/cuigh/swirl/biz"
|
||||
"github.com/cuigh/swirl/misc"
|
||||
"github.com/lafriks/swirl2/biz"
|
||||
"github.com/lafriks/swirl2/misc"
|
||||
)
|
||||
|
||||
// VolumeHandler encapsulates volume related handlers.
|
||||
|
||||
@@ -0,0 +1,68 @@
|
||||
package swirl2
|
||||
|
||||
import (
|
||||
"azugo.io/azugo"
|
||||
"azugo.io/azugo/server"
|
||||
"azugo.io/opentelemetry"
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
// App is the Swirlapplication instance.
|
||||
type App struct {
|
||||
*azugo.App
|
||||
|
||||
config *Configuration
|
||||
}
|
||||
|
||||
// New returns a new application instance.
|
||||
func New(cmd *cobra.Command, configPath, version string) (*App, error) {
|
||||
config := NewConfiguration()
|
||||
config.SetConfigFile(configPath)
|
||||
|
||||
a, err := server.New(cmd, server.Options{
|
||||
AppName: "Swirl",
|
||||
AppVer: version,
|
||||
Configuration: config,
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
a.RouterOptions().CORS.SetHeaders("Accept", "Content-Type", "Authorization")
|
||||
|
||||
tel, err := opentelemetry.Use(a, config.Telemetry)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if err := a.AddTask(tel); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
app := &App{
|
||||
App: a,
|
||||
config: config,
|
||||
}
|
||||
|
||||
err = app.InitServices()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return app, nil
|
||||
}
|
||||
|
||||
func (a *App) InitServices() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// Config returns application configuration.
|
||||
//
|
||||
// Panics if configuration is not loaded.
|
||||
func (a *App) Config() *Configuration {
|
||||
if a.config == nil || !a.config.Ready() {
|
||||
panic("configuration is not loaded")
|
||||
}
|
||||
|
||||
return a.config
|
||||
}
|
||||
+1
-1
@@ -12,7 +12,7 @@ import (
|
||||
"github.com/cuigh/auxo/app/ioc"
|
||||
"github.com/cuigh/auxo/data"
|
||||
"github.com/cuigh/auxo/net/web"
|
||||
"github.com/cuigh/swirl/dao"
|
||||
"github.com/lafriks/swirl2/dao"
|
||||
"go.mongodb.org/mongo-driver/bson/primitive"
|
||||
)
|
||||
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@ import (
|
||||
"context"
|
||||
|
||||
"github.com/cuigh/auxo/net/web"
|
||||
"github.com/cuigh/swirl/dao"
|
||||
"github.com/lafriks/swirl2/dao"
|
||||
)
|
||||
|
||||
type ChartBiz interface {
|
||||
|
||||
+1
-1
@@ -5,8 +5,8 @@ import (
|
||||
|
||||
"github.com/cuigh/auxo/data"
|
||||
"github.com/cuigh/auxo/net/web"
|
||||
"github.com/cuigh/swirl/docker"
|
||||
"github.com/docker/docker/api/types/swarm"
|
||||
"github.com/lafriks/swirl2/docker"
|
||||
)
|
||||
|
||||
type ConfigBiz interface {
|
||||
|
||||
+1
-1
@@ -6,10 +6,10 @@ import (
|
||||
|
||||
"github.com/cuigh/auxo/data"
|
||||
"github.com/cuigh/auxo/net/web"
|
||||
"github.com/cuigh/swirl/docker"
|
||||
"github.com/docker/docker/api/types"
|
||||
"github.com/docker/docker/api/types/container"
|
||||
"github.com/docker/docker/api/types/mount"
|
||||
"github.com/lafriks/swirl2/docker"
|
||||
)
|
||||
|
||||
type ContainerBiz interface {
|
||||
|
||||
+1
-1
@@ -9,8 +9,8 @@ import (
|
||||
"github.com/cuigh/auxo/errors"
|
||||
"github.com/cuigh/auxo/log"
|
||||
"github.com/cuigh/auxo/net/web"
|
||||
"github.com/cuigh/swirl/dao"
|
||||
"github.com/jinzhu/copier"
|
||||
"github.com/lafriks/swirl2/dao"
|
||||
)
|
||||
|
||||
var builtins = []*dao.Chart{
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@ import (
|
||||
"github.com/cuigh/auxo/ext/times"
|
||||
"github.com/cuigh/auxo/log"
|
||||
"github.com/cuigh/auxo/net/web"
|
||||
"github.com/cuigh/swirl/dao"
|
||||
"github.com/lafriks/swirl2/dao"
|
||||
"go.mongodb.org/mongo-driver/bson/primitive"
|
||||
)
|
||||
|
||||
|
||||
+1
-1
@@ -6,8 +6,8 @@ import (
|
||||
|
||||
"github.com/cuigh/auxo/data"
|
||||
"github.com/cuigh/auxo/net/web"
|
||||
"github.com/cuigh/swirl/docker"
|
||||
"github.com/docker/docker/api/types/image"
|
||||
"github.com/lafriks/swirl2/docker"
|
||||
)
|
||||
|
||||
type ImageBiz interface {
|
||||
|
||||
+1
-1
@@ -10,7 +10,7 @@ import (
|
||||
"github.com/cuigh/auxo/ext/times"
|
||||
"github.com/cuigh/auxo/util/cast"
|
||||
"github.com/cuigh/auxo/util/lazy"
|
||||
"github.com/cuigh/swirl/misc"
|
||||
"github.com/lafriks/swirl2/misc"
|
||||
client "github.com/prometheus/client_golang/api"
|
||||
papi "github.com/prometheus/client_golang/api/prometheus/v1"
|
||||
"github.com/prometheus/common/model"
|
||||
|
||||
+1
-1
@@ -5,8 +5,8 @@ import (
|
||||
|
||||
"github.com/cuigh/auxo/data"
|
||||
"github.com/cuigh/auxo/net/web"
|
||||
"github.com/cuigh/swirl/docker"
|
||||
"github.com/docker/docker/api/types/network"
|
||||
"github.com/lafriks/swirl2/docker"
|
||||
)
|
||||
|
||||
type NetworkBiz interface {
|
||||
|
||||
+1
-1
@@ -6,8 +6,8 @@ import (
|
||||
|
||||
"github.com/cuigh/auxo/data"
|
||||
"github.com/cuigh/auxo/net/web"
|
||||
"github.com/cuigh/swirl/docker"
|
||||
"github.com/docker/docker/api/types/swarm"
|
||||
"github.com/lafriks/swirl2/docker"
|
||||
)
|
||||
|
||||
type NodeBiz interface {
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user