comms

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2022 License: MIT Imports: 7 Imported by: 1

Documentation

Index

Constants

View Source
const (
	Exporter = 1 << iota
	Configurator
	Runner
)
View Source
const (
	LogRequestType = iota + 1
	RegisterRequestType
	RegisterResponseType
	StartRequestType
	TerminateRequestType
	ExportRequestType
	ExportResponseType
	ConfigureRequestType
	ValidateRequestType
	ValidateResponseType
	PeriodRequestType
	PeriodResponseType
)
View Source
const (
	MajorVersion = 1
	MinorVersion = 2
)
View Source
const JSONType = uint32(1)
View Source
const NonRequiredID = 0
View Source
const Version = "1.0"

Variables

This section is empty.

Functions

func GetPluginVersionMessage added in v1.0.0

func GetPluginVersionMessage() string

func GetRequestName

func GetRequestName(reqType uint32) string

func ImplementsConfigurator

func ImplementsConfigurator(in uint32) bool

func ImplementsExporter

func ImplementsExporter(in uint32) bool

func ImplementsRunner

func ImplementsRunner(in uint32) bool

func PrintVersion added in v1.0.0

func PrintVersion(pluginName, copyrightMessage string, pluginVersion int)

func Read

func Read(conn net.Conn) (dataType uint32, requestData []byte, err error)

func Write

func Write(conn net.Conn, in interface{}) (err error)

Types

type Common

type Common struct {
	Id   uint32 `json:"id"`
	Type uint32 `json:"type"`
}

type ConfigureRequest

type ConfigureRequest struct {
	Common
	GlobalOptions  *plugin.GlobalOptions `json:"global_options"`
	PrivateOptions interface{}           `json:"private_options,omitempty"`
}

type ExportRequest

type ExportRequest struct {
	Common
	Key    string   `json:"key"`
	Params []string `json:"parameters,omitempty"`
}

type ExportResponse

type ExportResponse struct {
	Common
	Value interface{} `json:"value,omitempty"`
	Error string      `json:"error,omitempty"`
}

type LogRequest

type LogRequest struct {
	Common
	Severity uint32 `json:"severity"`
	Message  string `json:"message"`
}

type RegisterRequest

type RegisterRequest struct {
	Common
	Version string `json:"version"`
}

type RegisterResponse

type RegisterResponse struct {
	Common
	Name       string   `json:"name"`
	Metrics    []string `json:"metrics,omitempty"`
	Interfaces uint32   `json:"interfaces,omitempty"`
	Error      string   `json:"error,omitempty"`
}

type StartRequest

type StartRequest struct {
	Common
}

type TerminateRequest

type TerminateRequest struct {
	Common
}

type ValidateRequest

type ValidateRequest struct {
	Common
	PrivateOptions interface{} `json:"private_options,omitempty"`
}

type ValidateResponse

type ValidateResponse struct {
	Common
	Error string `json:"error,omitempty"`
}

Jump to

Keyboard shortcuts

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