cccontrolclient

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NatsReceive

func NatsReceive(m *nats.Msg) ([]lp.CCMessage, error)

Types

type CCControlClient

type CCControlClient interface {
	Init(natsCfg NatsConfig) error
	GetControls(hostname string) (*CCControlList, error)
	GetTopology(hostname string) (*CCControlTopology, error)
	GetControlValue(hostname, control string, device string, deviceID string) (string, error)
	SetControlValue(hostname, control string, device string, deviceID string, value string) error
	Close()
}

func NewCCControlClient

func NewCCControlClient(natsConfig NatsConfig) (CCControlClient, error)

type CCControlList

type CCControlList struct {
	Controls []CCControlListEntry `json:"controls"`
}

type CCControlListEntry

type CCControlListEntry struct {
	Category    string `json:"category"`
	Name        string `json:"name"`
	DeviceType  string `json:"device_type"`
	Description string `json:"description"`
	Methods     string `json:"methods"`
}

type CCControlTopology

type CCControlTopology struct {
	HWthreads []topo.HwthreadEntry `json:"hwthreads"`
	CpuInfo   topo.CpuInformation  `json:"cpu_info"`
}

type NatsConfig

type NatsConfig struct {
	Server         string `json:"server"`
	Port           uint16 `json:"port"`
	RequestSubject string `json:"requestSubject"`
	// TODO actually implement ReplySubject. Currently, we use NATS request/reply,
	// which by default uses subject `_INBOX.XXXXXXXXX` as reply subject.
	// However, this is difficult to restrict in terms of permissions.
	//ReplySubject   string `json:"replySubject"`
	User         string `json:"user"`
	Password     string `json:"password"`
	CredsFile    string `json:"credsFile"`
	NKeySeedFile string `json:"nkeySeedFile"`
}

Jump to

Keyboard shortcuts

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