Help us shape the future of Go! Take the 2026 Go Developer Survey

common

package
v1.7.20 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2026 License: MIT Imports: 6 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
	Logger      *zap.Logger
}

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
	Server      server
	ChannelMode string
	TLSSettings tls.TlsSettings
	Logger      *zap.Logger
}

ServiceConfig specifies common configuration.

Jump to

Keyboard shortcuts

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