common

package
v1.15.22 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2024 License: MIT Imports: 5 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
	ChannelMode string
}

Service implements behavior common to all services.

func NewService

func NewService(name, version, channelMode 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 {
	Init(*ServiceConfig) error
	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
	ChannelMode string
	TlsSettings tls.TlsSettings
}

ServiceConfig specifies common configuration.

Jump to

Keyboard shortcuts

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