services

package
v0.0.0-...-475e089 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2017 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConfigService

type ConfigService struct {
	common.Service

	StartDelay time.Duration // Duration to delay prior to starting the service
	LogFunc    func(string)  // Destination for logging
	// contains filtered or unexported fields
}

ConfigService manages asset, device and connectivity configuration state

func (*ConfigService) Serve

func (svc *ConfigService) Serve()

Serve is called by this service's supervisor—it should not be called directly. Exiting or panicing from this function will force the supervisor to attempt to restart.

func (*ConfigService) State

func (svc *ConfigService) State() int

State returns the state of service

func (*ConfigService) Stop

func (svc *ConfigService) Stop()

Stop is called by a supervisor to signal that the service should be stopped. Every effort should be made to clean up resources and put the service in a state in which it could be restarted.

type IntegrationsService

type IntegrationsService struct {
	common.Service

	StartDelay time.Duration // Duration to delay prior to starting the service
	LogFunc    func(string)  // Destination for logging
	// contains filtered or unexported fields
}

IntegrationsService is responsible for maintaining connections to one or more integrated service implementations as found in the /integrations folder and defined in connections.json

Ops (operations) Integrations receive machine operational and sensor telemetry data State Integrations receive information regarding the state and health of the Nimble Device

func (*IntegrationsService) Serve

func (svc *IntegrationsService) Serve()

Serve is called by this service's supervisor—it should not be called directly. Exiting or panicing from this function will force the supervisor to attempt to restart.

func (*IntegrationsService) State

func (svc *IntegrationsService) State() int

State returns the state of service

func (*IntegrationsService) Stop

func (svc *IntegrationsService) Stop()

Stop is called by a supervisor to signal that the service should be stopped. Every effort should be made to clean up resources and put the service in a state in which it could be restarted.

type StateService

type StateService struct {
	common.Service

	StartDelay time.Duration // Duration to delay prior to starting the service
	LogFunc    func(string)  // Destination for logging
	// contains filtered or unexported fields
}

StateService is responsible for reporting the status of the Nimble (field) Device to one or more integrated service implementations (/integrations). Three explicit data points are reported: percentage of (RAM) consumed, percentage of disk consumed, and the load factor for the last minute. Implicitly, the existence of this record at a particular time interval indicates the Device was running at that moment.

func (*StateService) Serve

func (svc *StateService) Serve()

Serve is called by this service's supervisor—it should not be called directly. Exiting or panicing from this function will force the supervisor to attempt to restart.

func (*StateService) State

func (svc *StateService) State() int

State returns the state of service

func (*StateService) Stop

func (svc *StateService) Stop()

Stop is called by a supervisor to signal that the service should be stopped. Every effort should be made to clean up resources and put the service in a state in which it could be restarted.

type TestService

type TestService struct {
	common.Service

	StartDelay time.Duration // Duration to delay prior to starting the service
	LogFunc    func(string)  // Destination for logging
	// contains filtered or unexported fields
}

TestService provides an example of how services should be coded.

func (*TestService) Serve

func (svc *TestService) Serve()

Serve is called by this service's supervisor—it should not be called directly. Exiting or panicing from this function will force the supervisor to attempt to restart.

func (*TestService) State

func (svc *TestService) State() int

State returns the state of service

func (*TestService) Stop

func (svc *TestService) Stop()

Stop is called by a supervisor to signal that the service should be stopped. Every effort should be made to clean up resources and put the service in a state in which it could be restarted.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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