separator

package
v0.0.0-...-2a2d870 Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2016 License: BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Overview

Package separator implements github.com/the-anna-project/clg.Service and provides functionality to provide a separator stored as peer value of a specific information peer. When this CLG is being executed, it uses the context to identify itself. The context contains information about the CLGs behaviour ID, which is used to lookup a mapping pointing to an information peer ID. This information peer ID is used to lookup the actual information peer and its associated value, which is the separator. In case there is no mapping for the current behaviour ID, a new separator will be made up and a new information peer as well as the necessary index mapping. In any case a separator will be returned.

Index

Constants

View Source
const (
	// NamespaceBehaviourID represents the namespace being used to map a specific
	// behaviour ID to a specific information ID using the index service.
	NamespaceBehaviourID = "behaviour-id"
	// NamespaceInformationID represents the namespace being used to map a
	// specific behaviour ID to a specific information ID using the index service.
	NamespaceInformationID = "information-id"
	// NamespaceSeparator represents the namespace being used to map a specific
	// behaviour ID to a specific information ID using the index service.
	NamespaceSeparator = "separator"
)

Variables

This section is empty.

Functions

func IsInvalidBehaviourID

func IsInvalidBehaviourID(err error) bool

IsInvalidBehaviourID asserts invalidBehaviourIDError.

func IsInvalidConfig

func IsInvalidConfig(err error) bool

IsInvalidConfig asserts invalidConfigError.

Types

type Service

type Service struct {
	// contains filtered or unexported fields
}

func NewService

func NewService(config ServiceConfig) (*Service, error)

NewService creates a new configured CLG service.

func (*Service) Action

func (s *Service) Action() interface{}

func (*Service) Boot

func (s *Service) Boot()

func (*Service) Metadata

func (s *Service) Metadata() map[string]string

func (*Service) Shutdown

func (s *Service) Shutdown()

type ServiceConfig

type ServiceConfig struct {
	// Dependencies.
	IDService      id.Service
	IndexService   index.Service
	PeerCollection *peer.Collection
	RandomService  random.Service
}

ServiceConfig represents the configuration used to create a new CLG service.

func DefaultServiceConfig

func DefaultServiceConfig() ServiceConfig

DefaultServiceConfig provides a default configuration to create a new CLG service by best effort.

Jump to

Keyboard shortcuts

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