update deps

This commit is contained in:
Yuzuki616
2024-11-23 02:16:36 +09:00
parent ffcbec4ede
commit 8eb5c97ccd
3 changed files with 15 additions and 20 deletions

View File

@@ -7,7 +7,6 @@ import (
"Ratte/trigger"
"github.com/Yuzuki616/Ratte-Interface/core"
"github.com/Yuzuki616/Ratte-Interface/panel"
"github.com/Yuzuki616/Ratte-Interface/plugin"
log "github.com/sirupsen/logrus"
"github.com/spf13/cobra"
"os"
@@ -33,8 +32,8 @@ func init() {
}
var (
cores map[string]*plugin.Client[core.Core]
panels map[string]*plugin.Client[panel.Panel]
cores map[string]*core.PluginClient
panels map[string]*panel.PluginClient
acmes map[string]*acme.Acme
handlers []*handler.Handler
triggers []*trigger.Trigger
@@ -51,16 +50,13 @@ func runHandle(_ *cobra.Command, _ []string) {
log.Info("Init core plugin...")
// new cores
cores = make(map[string]*plugin.Client[core.Core], len(c.Core))
cores = make(map[string]*core.PluginClient, len(c.Core))
for _, co := range c.Core {
c, err := plugin.NewClient[core.Core](&plugin.Config{
Type: plugin.CoreType,
Cmd: exec.Command(co.Path),
})
c, err := core.NewClient(nil, exec.Command(co.Path))
if err != nil {
log.WithError(err).WithField("core", co.Name).Fatal("New core failed")
}
err = c.Caller().Start(co.DataPath, co.Config)
err = c.Start(co.DataPath, co.Config)
if err != nil {
log.WithError(err).WithField("core", co.Name).Fatal("Start core failed")
}
@@ -70,12 +66,9 @@ func runHandle(_ *cobra.Command, _ []string) {
log.Info("Init panel plugin...")
// new panels
panels = make(map[string]*plugin.Client[panel.Panel], len(c.Panel))
panels = make(map[string]*panel.PluginClient, len(c.Panel))
for _, p := range c.Panel {
pn, err := plugin.NewClient[panel.Panel](&plugin.Config{
Type: plugin.PanelType,
Cmd: exec.Command(p.Path),
})
pn, err := panel.NewClient(nil, exec.Command(p.Path))
if err != nil {
log.WithError(err).WithField("panel", p.Name).Fatal("New panel failed")
}
@@ -104,12 +97,12 @@ func runHandle(_ *cobra.Command, _ []string) {
var pl panel.Panel
var ac *acme.Acme
if c, ok := cores[nd.Options.Core]; ok {
co = c.Caller()
co = c
} else {
log.WithField("core", nd.Options.Core).Fatal("Couldn't find core")
}
if p, ok := panels[nd.Options.Panel]; ok {
pl = p.Caller()
pl = p
} else {
log.WithField("panel", nd.Options.Panel).Fatal("Couldn't find panel")
}

4
go.mod
View File

@@ -5,10 +5,11 @@ go 1.22.0
toolchain go1.23.1
require (
github.com/Yuzuki616/Ratte-Interface v0.0.0-20241025203935-a64517afc32b
github.com/Yuzuki616/Ratte-Interface v0.0.0-20241122170215-57da39558e5a
github.com/fsnotify/fsnotify v1.7.0
github.com/go-acme/lego/v4 v4.18.0
github.com/goccy/go-json v0.10.3
github.com/hashicorp/go-plugin v1.6.1
github.com/orcaman/concurrent-map/v2 v2.0.1
github.com/robfig/cron/v3 v3.0.1
github.com/sirupsen/logrus v1.9.3
@@ -93,7 +94,6 @@ require (
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
github.com/hashicorp/go-hclog v1.6.3 // indirect
github.com/hashicorp/go-multierror v1.1.1 // indirect
github.com/hashicorp/go-plugin v1.6.1 // indirect
github.com/hashicorp/go-retryablehttp v0.7.7 // indirect
github.com/hashicorp/go-uuid v1.0.3 // indirect
github.com/hashicorp/yamux v0.1.1 // indirect

6
go.sum
View File

@@ -64,8 +64,10 @@ github.com/HdrHistogram/hdrhistogram-go v1.1.2/go.mod h1:yDgFjdqOqDEKOvasDdhWNXY
github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU=
github.com/OpenDNS/vegadns2client v0.0.0-20180418235048-a3fa4a771d87 h1:xPMsUicZ3iosVPSIP7bW5EcGUzjiiMl1OYTe14y/R24=
github.com/OpenDNS/vegadns2client v0.0.0-20180418235048-a3fa4a771d87/go.mod h1:iGLljf5n9GjT6kc0HBvyI1nOKnGQbNB66VzSNbK5iks=
github.com/Yuzuki616/Ratte-Interface v0.0.0-20241025203935-a64517afc32b h1:ipw6740pMlWCAxhoINURmXw+JwIOI+MhgRVx2eiReas=
github.com/Yuzuki616/Ratte-Interface v0.0.0-20241025203935-a64517afc32b/go.mod h1:oW6wbZfawdudu9VbTy2YIWoMNpfttYX8qcsM19oXCCI=
github.com/Yuzuki616/Ratte-Interface v0.0.0-20241118194538-facf11a8e444 h1:WNPpKp/RH5fYtcjtPvRueDMZeZdnv2ZoWyQ41ITeAD0=
github.com/Yuzuki616/Ratte-Interface v0.0.0-20241118194538-facf11a8e444/go.mod h1:oW6wbZfawdudu9VbTy2YIWoMNpfttYX8qcsM19oXCCI=
github.com/Yuzuki616/Ratte-Interface v0.0.0-20241122170215-57da39558e5a h1:kG4UIW63SqKhWaRyNBqKtaOnO9mF2GV6E/Grv/kBlX8=
github.com/Yuzuki616/Ratte-Interface v0.0.0-20241122170215-57da39558e5a/go.mod h1:oW6wbZfawdudu9VbTy2YIWoMNpfttYX8qcsM19oXCCI=
github.com/ajstarks/svgo v0.0.0-20180226025133-644b8db467af/go.mod h1:K08gAheRH3/J6wwsYMMT4xOr94bZjxIelGM0+d/wbFw=
github.com/akamai/AkamaiOPEN-edgegrid-golang v1.2.2 h1:F1j7z+/DKEsYqZNoxC6wvfmaiDneLsQOFQmuq9NADSY=
github.com/akamai/AkamaiOPEN-edgegrid-golang v1.2.2/go.mod h1:QlXr/TrICfQ/ANa76sLeQyhAJyNR9sEcfNuZBkY9jgY=