Update dependencies

This commit is contained in:
Ingo Oppermann 2023-07-10 11:11:47 +02:00
parent 71b613371a
commit 34404a76d2
No known key found for this signature in database
GPG Key ID: 2AB32426E9DD229E
7 changed files with 107 additions and 6 deletions

2
go.mod
View File

@ -9,7 +9,7 @@ require (
github.com/atrox/haikunatorgo/v2 v2.0.1
github.com/caddyserver/certmagic v0.18.2
github.com/casbin/casbin/v2 v2.71.1
github.com/datarhei/core-client-go/v16 v16.11.1-0.20230707144101-ac4b18eafa83
github.com/datarhei/core-client-go/v16 v16.11.1-0.20230710090938-bfcb7f5f7b3e
github.com/datarhei/gosrt v0.5.2
github.com/datarhei/joy4 v0.0.0-20230505074825-fde05957445a
github.com/fujiwara/shapeio v1.0.0

4
go.sum
View File

@ -46,8 +46,8 @@ github.com/circonus-labs/circonusllhist v0.1.3/go.mod h1:kMXHVDlOchFAehlya5ePtbp
github.com/cpuguy83/go-md2man/v2 v2.0.2 h1:p1EgwI/C7NhT0JmVkwCD2ZBK8j4aeHQX2pMHHBfMQ6w=
github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/datarhei/core-client-go/v16 v16.11.1-0.20230707144101-ac4b18eafa83 h1:Lg1MPmGxXV1GttviBxoDqIosxPU6vkVyWf0plhvpUvc=
github.com/datarhei/core-client-go/v16 v16.11.1-0.20230707144101-ac4b18eafa83/go.mod h1:3eKfwhPKoW7faTn+luShRVNMqcIskvlIKjRJ7ShjyL8=
github.com/datarhei/core-client-go/v16 v16.11.1-0.20230710090938-bfcb7f5f7b3e h1:PUBHatfuW/qclTFQ062QtxlDEsqH3HlIjqI3vUOKR3c=
github.com/datarhei/core-client-go/v16 v16.11.1-0.20230710090938-bfcb7f5f7b3e/go.mod h1:3eKfwhPKoW7faTn+luShRVNMqcIskvlIKjRJ7ShjyL8=
github.com/datarhei/gosrt v0.5.2 h1:eagqZwEIiGPNJW0rLep3gwceObyaZ17+iKRc+l4VEpc=
github.com/datarhei/gosrt v0.5.2/go.mod h1:0308GQhAu5hxe2KYdbss901aKceSSKXnwCr8Vs++eiw=
github.com/datarhei/joy4 v0.0.0-20230505074825-fde05957445a h1:Tf4DSHY1xruBglr+yYP5Wct7czM86GKMYgbXH8a7OFo=

View File

@ -459,13 +459,15 @@ type ConfigV3 struct {
} `json:"resources"`
Cluster struct {
Enable bool `json:"enable"`
Debug bool `json:"debug"`
Address string `json:"address"` // ip:port
Peers []string `json:"peers"`
StartupTimeout int64 `json:"startup_timeout_sec" format:"int64"` // seconds
SyncInterval int64 `json:"sync_interval_sec" format:"int64"` // seconds
NodeRecoverTimeout int64 `json:"node_recover_timeout_sec" format:"int64"` // seconds
EmergencyLeaderTimeout int64 `json:"emergency_leader_timeout_sec" format:"int64"` // seconds
Debug struct {
DisableFFmpegCheck bool `json:"disable_ffmpeg_check"`
} `json:"debug"`
} `json:"cluster"`
}

View File

@ -104,6 +104,12 @@ type RestClient interface {
ClusterSnapshot() (io.ReadCloser, error) // GET /v3/cluster/snapshot
ClusterLeave() error // PUT /v3/cluster/leave
ClusterNodeList() ([]api.ClusterNode, error) // GET /v3/cluster/node
ClusterNode(id string) (api.ClusterNode, error) // GET /v3/cluster/node/{id}
ClusterNodeFiles(id string) (api.ClusterNodeFiles, error) // GET /v3/cluster/node/{id}/files
ClusterNodeProcessList(id string, opts ProcessListOptions) ([]api.Process, error) // GET /v3/cluster/node/{id}/process
ClusterNodeVersion(id string) (api.Version, error) // GET /v3/cluster/node/{id}/version
ClusterDBProcessList() ([]api.Process, error) // GET /v3/cluster/db/process
ClusterDBProcess(id ProcessID) (api.Process, error) // GET /v3/cluster/db/process/{id}
ClusterDBUserList() ([]api.IAMUser, error) // GET /v3/cluster/db/user
@ -389,6 +395,26 @@ func New(config Config) (RestClient, error) {
path: mustNewGlob("/v3/cluster/process/*/probe"),
constraint: mustNewConstraint("^16.14.0"),
},
{
path: mustNewGlob("/v3/cluster/node"),
constraint: mustNewConstraint("^16.14.0"),
},
{
path: mustNewGlob("/v3/cluster/node/*"),
constraint: mustNewConstraint("^16.14.0"),
},
{
path: mustNewGlob("/v3/cluster/node/*/files"),
constraint: mustNewConstraint("^16.14.0"),
},
{
path: mustNewGlob("/v3/cluster/node/*/process"),
constraint: mustNewConstraint("^16.14.0"),
},
{
path: mustNewGlob("/v3/cluster/node/*/version"),
constraint: mustNewConstraint("^16.14.0"),
},
},
"POST": {
{

View File

@ -0,0 +1,73 @@
package coreclient
import (
"encoding/json"
"net/url"
"github.com/datarhei/core-client-go/v16/api"
)
func (r *restclient) ClusterNodeList() ([]api.ClusterNode, error) {
var nodes []api.ClusterNode
data, err := r.call("GET", "/v3/cluster/node", nil, nil, "", nil)
if err != nil {
return nodes, err
}
err = json.Unmarshal(data, &nodes)
return nodes, err
}
func (r *restclient) ClusterNode(id string) (api.ClusterNode, error) {
var node api.ClusterNode
data, err := r.call("GET", "/v3/cluster/node/"+url.PathEscape(id), nil, nil, "", nil)
if err != nil {
return node, err
}
err = json.Unmarshal(data, &node)
return node, err
}
func (r *restclient) ClusterNodeFiles(id string) (api.ClusterNodeFiles, error) {
var files api.ClusterNodeFiles
data, err := r.call("GET", "/v3/cluster/node/"+url.PathEscape(id)+"/files", nil, nil, "", nil)
if err != nil {
return files, err
}
err = json.Unmarshal(data, &files)
return files, err
}
func (r *restclient) ClusterNodeProcessList(id string, opts ProcessListOptions) ([]api.Process, error) {
var processes []api.Process
data, err := r.call("GET", "/v3/cluster/node/"+url.PathEscape(id)+"/process", opts.Query(), nil, "", nil)
if err != nil {
return processes, err
}
err = json.Unmarshal(data, &processes)
return processes, err
}
func (r *restclient) ClusterNodeVersion(id string) (api.Version, error) {
var version api.Version
data, err := r.call("GET", "/v3/cluster/node/"+url.PathEscape(id)+"/version", nil, nil, "", nil)
if err != nil {
return version, err
}
err = json.Unmarshal(data, &version)
return version, err
}

View File

@ -55,5 +55,5 @@ func (r *restclient) SessionToken(name string, req []api.SessionTokenRequest) ([
err = json.Unmarshal(data, &tokens)
return tokens, nil
return tokens, err
}

2
vendor/modules.txt vendored
View File

@ -78,7 +78,7 @@ github.com/cespare/xxhash/v2
# github.com/cpuguy83/go-md2man/v2 v2.0.2
## explicit; go 1.11
github.com/cpuguy83/go-md2man/v2/md2man
# github.com/datarhei/core-client-go/v16 v16.11.1-0.20230707144101-ac4b18eafa83
# github.com/datarhei/core-client-go/v16 v16.11.1-0.20230710090938-bfcb7f5f7b3e
## explicit; go 1.18
github.com/datarhei/core-client-go/v16
github.com/datarhei/core-client-go/v16/api