Documentation ¶
Index ¶
- Constants
- func GetTuningFloat(key string, tuningState *pb_systemmanager_messages.TuningState) (float32, error)
- func GetTuningInt(key string, tuningState *pb_systemmanager_messages.TuningState) (int, error)
- func GetTuningString(key string, tuningState *pb_systemmanager_messages.TuningState) (string, error)
- func Run(main MainFunction, onTuningState TuningStateCallbackFunction, ...)
- func SendRequestToSystemManager(message *pb_systemmanager_messages.SystemManagerMessage) (*pb_systemmanager_messages.SystemManagerMessage, error)
- type MainFunction
- type ResolvedDependency
- type ResolvedService
- func (service ResolvedService) GetDependencyAddress(serviceName string, outputName string) (string, error)
- func (service ResolvedService) GetOutputAddress(outputName string) (string, error)
- func (service ResolvedService) GetOutputAddressList() []output
- func (service ResolvedService) GetResolvedDependencies() []ResolvedDependency
- type SystemManagerInfo
- type TerminationFunction
- type TuningStateCallbackFunction
Constants ¶
const SERVER_ADDR = "tcp://localhost:1337"
Variables ¶
This section is empty.
Functions ¶
func GetTuningFloat ¶ added in v2.2.0
func GetTuningFloat(key string, tuningState *pb_systemmanager_messages.TuningState) (float32, error)
Utility function to easily read values from the tuning state
func GetTuningInt ¶ added in v2.2.0
func GetTuningInt(key string, tuningState *pb_systemmanager_messages.TuningState) (int, error)
Utility function to easily read values from the tuning state
func GetTuningString ¶ added in v2.2.0
func GetTuningString(key string, tuningState *pb_systemmanager_messages.TuningState) (string, error)
Utility function to easily read values from the tuning state
func Run ¶
func Run(main MainFunction, onTuningState TuningStateCallbackFunction, onTerminate TerminationFunction, disableRegistration bool)
Used to start the program with the correct arguments and logging, with service discovery registration and all dependencies resolved
func SendRequestToSystemManager ¶ added in v2.8.0
func SendRequestToSystemManager(message *pb_systemmanager_messages.SystemManagerMessage) (*pb_systemmanager_messages.SystemManagerMessage, error)
Types ¶
type MainFunction ¶
type MainFunction func(serviceInformation ResolvedService, sysmanInformation SystemManagerInfo, initialTuningState *pb_systemmanager_messages.TuningState) error
The main function to run
type ResolvedDependency ¶
type ResolvedDependency struct { ServiceName string // the name of the service that this service depends on OutputName string // the name of the output that this service needs from the dependency Address string // the address of the output that this service needs from the dependency }
A resolved dependency, which will be given back to the service
type ResolvedService ¶
type ResolvedService struct { Name string // the name of the service Pid int // the pid of the service Dependencies []ResolvedDependency // the dependencies of the service, already resolved Outputs []output // the outputs of this service }
func (ResolvedService) GetDependencyAddress ¶
func (service ResolvedService) GetDependencyAddress(serviceName string, outputName string) (string, error)
Utiliy function to get the address of a dependency
func (ResolvedService) GetOutputAddress ¶
func (service ResolvedService) GetOutputAddress(outputName string) (string, error)
Utility function to get the address of your own output
func (ResolvedService) GetOutputAddressList ¶ added in v2.11.0
func (service ResolvedService) GetOutputAddressList() []output
Utility function that returns a list of output addresses
func (ResolvedService) GetResolvedDependencies ¶ added in v2.11.0
func (service ResolvedService) GetResolvedDependencies() []ResolvedDependency
Utility function that returns a list of dependency endpoints
type SystemManagerInfo ¶ added in v2.1.0
type SystemManagerInfo struct { RepReqAddress string // the req/rep address of the system manager BroadcastAddress string // the public broadcast address of the system manager }
Information about the system manager. This struct has useful methods implemented to repeat the same operations on the dependencies.
func (SystemManagerInfo) GetAllServices ¶ added in v2.1.0
func (sysman SystemManagerInfo) GetAllServices() (*pb_systemmanager_messages.ServiceList, error)
Utility function to get a list of all services running on the system manager
type TerminationFunction ¶ added in v2.11.0
The function to call when the service is terminated or interrupted
type TuningStateCallbackFunction ¶
type TuningStateCallbackFunction func(tuningState *pb_systemmanager_messages.TuningState)
The function that is called when a new tuning state is recevied