Giter VIP home page Giter VIP logo

core-client-go's Introduction

core-client-go

A golang client for the github.com/datarhei/core API.


Quick Start

Example for retrieving a list of all processes:

import "github.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 {
    ...
}

API definitions

General

  • GET /api

    About() api.About

Config

  • GET /api/v3/config

    Config() (api.Config, error)
  • PUT /api/v3/config

    ConfigSet(config api.ConfigSet) error
  • GET /api/v3/config/reload

    ConfigReload() error

Disk filesystem

  • GET /api/v3/fs/disk

    DiskFSList(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

In-memory filesystem

  • GET /api/v3/fs/mem

    MemFSList(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

Log

  • GET /api/v3/log

    Log() ([]api.LogEvent, error)

Metadata

  • 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

Metrics

  • GET /api/v3/metrics

    MetricsList() ([]api.MetricsDescription, error)
  • POST /api/v3/metrics

    Metrics(query api.MetricsQuery) (api.MetricsResponse, error)

Process

  • GET /api/v3/process

    ProcessList(opts ProcessListOptions) ([]api.Process, error)
  • POST /api/v3/process

    ProcessAdd(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}/command

    ProcessCommand(id, command string) error
  • GET /api/v3/process/{id}/probe

    ProcessProbe(id string) (api.Probe, error)
  • GET /api/v3/process/{id}/config

    ProcessConfig(id string) (api.ProcessConfig, error)
  • GET /api/v3/process/{id}/report

    ProcessReport(id string) (api.ProcessReport, error)
  • GET /api/v3/process/{id}/state

    ProcessState(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

RTMP

  • GET /api/v3/rtmp

    RTMPChannels() ([]api.RTMPChannel, error)

SRT

  • GET /api/v3/srt

    SRTChannels() (api.SRTChannels, error)

Session

  • GET /api/v3/session

    Sessions(collectors []string) (api.SessionsSummary, error)
  • GET /api/v3/session/active

    SessionsActive(collectors []string) (api.SessionsActive, error)

Skills

  • GET /api/v3/skills

    Skills() (api.Skills, error)
  • GET /api/v3/skills/reload

    SkillsReload() error

Widget

  • GET /api/v3/widget

    WidgetProcess(id string) (api.WidgetProcess, error)

Versioning

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 "github.com/datarhei/core-client-go/v12".

The latest implementation is on the main branch.

Contributing

Found a mistake or misconduct? Create a issue or send a pull-request. Suggestions for improvement are welcome.

Licence

MIT

core-client-go's People

Contributors

ioppermann avatar jstabenow avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

te4g bentoti

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.