diff --git a/go.mod b/go.mod index 57bd5494..3d644faa 100644 --- a/go.mod +++ b/go.mod @@ -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 diff --git a/go.sum b/go.sum index a062d3f2..ec96a23f 100644 --- a/go.sum +++ b/go.sum @@ -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= diff --git a/vendor/github.com/datarhei/core-client-go/v16/api/config.go b/vendor/github.com/datarhei/core-client-go/v16/api/config.go index 0c359301..bf2df4e2 100644 --- a/vendor/github.com/datarhei/core-client-go/v16/api/config.go +++ b/vendor/github.com/datarhei/core-client-go/v16/api/config.go @@ -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"` } diff --git a/vendor/github.com/datarhei/core-client-go/v16/client.go b/vendor/github.com/datarhei/core-client-go/v16/client.go index dac5fb0c..75946964 100644 --- a/vendor/github.com/datarhei/core-client-go/v16/client.go +++ b/vendor/github.com/datarhei/core-client-go/v16/client.go @@ -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": { { diff --git a/vendor/github.com/datarhei/core-client-go/v16/cluster_node.go b/vendor/github.com/datarhei/core-client-go/v16/cluster_node.go new file mode 100644 index 00000000..a7726748 --- /dev/null +++ b/vendor/github.com/datarhei/core-client-go/v16/cluster_node.go @@ -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 +} diff --git a/vendor/github.com/datarhei/core-client-go/v16/session.go b/vendor/github.com/datarhei/core-client-go/v16/session.go index 11c40d46..21ed4ec0 100644 --- a/vendor/github.com/datarhei/core-client-go/v16/session.go +++ b/vendor/github.com/datarhei/core-client-go/v16/session.go @@ -55,5 +55,5 @@ func (r *restclient) SessionToken(name string, req []api.SessionTokenRequest) ([ err = json.Unmarshal(data, &tokens) - return tokens, nil + return tokens, err } diff --git a/vendor/modules.txt b/vendor/modules.txt index f7d59b7e..04ffbf0d 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -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