A golang client for the .com/datarhei/core
API.
Example for retrieving a list of all processes:
import ".com/datarhei/core-client-go/v16"
client, err := coreclient.New(coreclient.Config{
Address: "https://example.com:8080",
Username: "foo",
Password: "bar",
})
if err != nil {
...
}
processes, err := client.ProcessList(coreclient.ProcessListOptions{})
if err != nil {
...
}
GET
/apiAbout() api.About
GET
/api/v3/configConfig() (api.Config, error)
PUT
/api/v3/configConfigSet(config api.ConfigSet) error
GET
/api/v3/config/reloadConfigReload() error
GET
/api/v3/fs/diskDiskFSList(sort, order string) ([]api.FileInfo, error)
HEAD
/api/v3/fs/disk/{path}DiskFSHasFile(path string) bool
GET
/api/v3/fs/disk/{path}DiskFSGetFile(path string) (io.ReadCloser, error)
DELETE
/api/v3/fs/disk/{path}DiskFSDeleteFile(path string) error
PUT
/api/v3/fs/disk/{path}DiskFSAddFile(path string, data io.Reader) error
GET
/api/v3/fs/memMemFSList(sort, order string) ([]api.FileInfo, error)
HEAD
/api/v3/fs/mem/{path}MemFSHasFile(path string) bool
GET
/api/v3/fs/mem/{path}MemFSGetFile(path string) (io.ReadCloser, error)
DELETE
/api/v3/fs/mem/{path}MemFSDeleteFile(path string) error
PUT
/api/v3/fs/mem/{path}MemFSAddFile(path string, data io.Reader) error
GET
/api/v3/logLog() ([]api.LogEvent, error)
GET
/api/v3/metadata/{key}Metadata(id, key string) (api.Metadata, error)
PUT
/api/v3/metadata/{key}MetadataSet(id, key string, metadata api.Metadata) error
GET
/api/v3/metricsMetricsList() ([]api.MetricsDescription, error)
POST
/api/v3/metricsMetrics(query api.MetricsQuery) (api.MetricsResponse, error)
GET
/api/v3/processProcessList(opts ProcessListOptions) ([]api.Process, error)
POST
/api/v3/processProcessAdd(p api.ProcessConfig) error
GET
/api/v3/process/{id}Process(id string, filter []string) (api.Process, error)
PUT
/api/v3/process/{id}ProcessUpdate(id string, p api.ProcessConfig) error
DELETE
/api/v3/process/{id}ProcessDelete(id string) error
PUT
/api/v3/process/{id}/commandProcessCommand(id, command string) error
GET
/api/v3/process/{id}/probeProcessProbe(id string) (api.Probe, error)
GET
/api/v3/process/{id}/configProcessConfig(id string) (api.ProcessConfig, error)
GET
/api/v3/process/{id}/reportProcessReport(id string) (api.ProcessReport, error)
GET
/api/v3/process/{id}/stateProcessState(id string) (api.ProcessState, error)
GET
/api/v3/process/{id}/metadata/{key}ProcessMetadata(id, key string) (api.Metadata, error)
PUT
/api/v3/process/{id}/metadata/{key}ProcessMetadataSet(id, key string, metadata api.Metadata) error
GET
/api/v3/rtmpRTMPChannels() ([]api.RTMPChannel, error)
GET
/api/v3/srtSRTChannels() (api.SRTChannels, error)
GET
/api/v3/sessionSessions(collectors []string) (api.SessionsSummary, error)
GET
/api/v3/session/activeSessionsActive(collectors []string) (api.SessionsActive, error)
GET
/api/v3/skillsSkills() (api.Skills, error)
GET
/api/v3/skills/reloadSkillsReload() error
GET
/api/v3/widgetWidgetProcess(id string) (api.WidgetProcess, error)
The version of this module is according to which version of the datarhei Core API you want to connect to. Check the branches to find out which other versions are implemented. If you want to connect to an API version 12, you have to import the client module of the version 12, i.e. import ".com/datarhei/core-client-go/v12"
.
The latest implementation is on the main
branch.
Found a mistake or misconduct? Create a issue or send a pull-request. Suggestions for improvement are welcome.