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, ...)
- type MainFunction
- type ResolvedDependency
- type ResolvedService
- type SystemManagerInfo
- 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, disableRegistration bool)
Used to start the program with the correct arguments and logging, with service discovery registration and all dependencies resolved
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
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 TuningStateCallbackFunction ¶
type TuningStateCallbackFunction func(tuningState *pb_systemmanager_messages.TuningState)
The function that is called when a new tuning state is recevied