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 ¶
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 ¶
IsInvalidBehaviourID asserts invalidBehaviourIDError.
func IsInvalidConfig ¶
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.
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.