service

package
v0.1.22 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 25, 2020 License: MIT Imports: 7 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(endpoint string) (c *Client, err error)

Establish a connection using the ZeroMQ API device

func (*Client) AvailableEvents

func (c *Client) AvailableEvents(id string) (*pb.EventsResponse, error)

Request all events that a service can raise TODO: v2 -> use Request

func (*Client) CancelJob

func (c *Client) CancelJob(id, jobId string) (*pb.JobResponse, error)

Request cancel for a job that's running or queued on a service TODO: v2 -> use JobRequest

func (*Client) GetActiveJob

func (c *Client) GetActiveJob(id string) (*pb.JobResponse, error)

Request the active job of a service TODO: v2 -> use Request

func (*Client) GetConfiguration

func (c *Client) GetConfiguration(id string) (*pb.ConfigurationResponse, error)

Request the configuration of a service TODO: v2 -> use Request

func (*Client) GetJob

func (c *Client) GetJob(id, jobId string) (*pb.JobResponse, error)

Request information about a job that's running or queued TODO: v2 -> use JobRequest

func (*Client) GetJobs

func (c *Client) GetJobs(id string) (*pb.JobsResponse, error)

Request all jobs running or queued on a service TODO: v2 -> use Request

func (*Client) GetModule

func (c *Client) GetModule(id string) (*pb.ModuleResponse, error)

Request information about a single module TODO: v2 -> use Request

func (*Client) GetModules

func (c *Client) GetModules(id string) (*pb.ModulesResponse, error)

Request all modules registered with the service TODO: v2 -> use Request

func (*Client) GetProperties

func (c *Client) GetProperties(id string, keys []string) (*pb.PropertiesResponse, error)

Request a list of properties from a service

func (*Client) GetProperty

func (c *Client) GetProperty(id, key string) (*pb.PropertyResponse, error)

Request a single property from a service

func (*Client) GetSettings

func (c *Client) GetSettings(id string) (*pb.SettingsResponse, error)

Request the settings of a service TODO: v2 -> use Request

func (*Client) GetStatus

func (c *Client) GetStatus(id string) (*pb.StatusResponse, error)

Request the status of a service TODO: v2 -> use Request or StatusRequest

func (*Client) SetProperties

func (c *Client) SetProperties(id string, properties map[string]string) (*pb.PropertiesResponse, error)

Request a change of multiple properties by a service

func (*Client) SetProperty

func (c *Client) SetProperty(id, key, value string) (*pb.PropertyResponse, error)

Request a change of a single property by a service

func (*Client) SubmitJob

func (c *Client) SubmitJob(id, jobName, jobValue string, jobProperties map[string]string) (*pb.JobResponse, error)

Request a job submit to a service TODO: v2 -> use JobRequest

type Handler

type Handler struct {
	// contains filtered or unexported fields
}

func NewHandler

func NewHandler() *Handler

func (*Handler) AddCallback

func (h *Handler) AddCallback(name string, callback HandlerCallback)

func (*Handler) Shutdown

func (h *Handler) Shutdown(msgBody string) ([]byte, error)

func (*Handler) Start

func (h *Handler) Start(endpoint, service string) error

func (*Handler) Stop

func (h *Handler) Stop() error

type HandlerCallback

type HandlerCallback interface {
	Execute(msgBody string) ([]byte, error)
}

type Job

type Job interface {
	GetName() string
	GetPriority() int
	Start() error
	Stop() error
	Cancel() error
	Pause() error
	Resume() error
}

type JobQueue

type JobQueue struct {
	// contains filtered or unexported fields
}

func NewJobQueue

func NewJobQueue() *JobQueue

func (*JobQueue) Start

func (h *JobQueue) Start() error

func (*JobQueue) Stop

func (h *JobQueue) Stop() error

type Service

type Service struct {
	// contains filtered or unexported fields
}

func NewService

func NewService(serviceName, endpoint string) *Service

func (*Service) RegisterCallback

func (s *Service) RegisterCallback(name string, callback HandlerCallback)

func (*Service) RegisterJob

func (s *Service) RegisterJob(job *Job)

func (*Service) Run

func (s *Service) Run() (err error)

func (*Service) Shutdown

func (s *Service) Shutdown() (err error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL