common

package
v1.0.13 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2018 License: MIT Imports: 4 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

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