common

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: May 17, 2018 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExecuteShellCommand added in v1.0.3

func ExecuteShellCommand(command string) error

func SetOutboundSNAT added in v1.0.3

func SetOutboundSNAT(subnet string) error

Types

type Service

type Service struct {
	Name    string
	Version string
	Options map[string]interface{}
	ErrChan chan error
	Store   store.KeyValueStore
}

Service implements behavior common to all services.

func NewService

func NewService(name, version string, store store.KeyValueStore) (*Service, error)

NewService creates a new Service object.

func (*Service) GetOption

func (service *Service) GetOption(key string) interface{}

GetOption gets the option value for the given key.

func (*Service) Initialize

func (service *Service) Initialize(config *ServiceConfig) error

Initialize initializes the service.

func (*Service) SetOption

func (service *Service) SetOption(key string, value interface{})

SetOption sets the option value for the given key.

func (*Service) Uninitialize

func (service *Service) Uninitialize()

Uninitialize cleans up the service.

type ServiceAPI

type ServiceAPI interface {
	Start(*ServiceConfig) error
	Stop()
	GetOption(string) interface{}
	SetOption(string, interface{})
}

ServiceAPI defines base interface.

type ServiceConfig

type ServiceConfig struct {
	Name     string
	Version  string
	Listener *acn.Listener
	ErrChan  chan error
	Store    store.KeyValueStore
}

ServiceConfig specifies common configuration.

Jump to

Keyboard shortcuts

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