messageswitch

package
v0.0.17 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2023 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotHavingMessageSwitchServiceRecord = errors.New("cannot reach message switch service")

ErrNotHavingMessageSwitchServiceRecord indicate service record cannot be reach.

View Source
var ErrNotSupportedOperation = errors.New("request operation is not support")

ErrNotSupportedOperation indicate service is not support given request.

Functions

This section is empty.

Types

type ErrDestinationServiceIdentNotFound

type ErrDestinationServiceIdentNotFound int

ErrDestinationServiceIdentNotFound indicate given destination service ident reference to non-existed service.

func (ErrDestinationServiceIdentNotFound) Error

type ErrDestinationServiceIdentOutOfRange

type ErrDestinationServiceIdentOutOfRange int

ErrDestinationServiceIdentOutOfRange indicate given destination service ident not in the valid range.

func (ErrDestinationServiceIdentOutOfRange) Error

type ErrRelayLinksUnreachable

type ErrRelayLinksUnreachable int

ErrRelayLinksUnreachable indicate all relay providers in given service ident not reachable.

func (ErrRelayLinksUnreachable) Error

func (e ErrRelayLinksUnreachable) Error() string

type ErrSourceServiceIdentNotFound

type ErrSourceServiceIdentNotFound int

ErrSourceServiceIdentNotFound indicate given source service ident reference to non-existed service.

func (ErrSourceServiceIdentNotFound) Error

type ErrSourceServiceIdentOutOfRange

type ErrSourceServiceIdentOutOfRange int

ErrSourceServiceIdentOutOfRange indicate given source service ident not in the valid range.

func (ErrSourceServiceIdentOutOfRange) Error

type MessageSwitch

type MessageSwitch struct {
	qabalwrap.ServiceBase
	// contains filtered or unexported fields
}

MessageSwitch provide message switching services.

func NewMessageSwitch

func NewMessageSwitch(
	spanEmitter *qabalwrap.TraceEmitter,
	stateStore *qabalwrap.StateStore,
	diag *qabalwrap.DiagnosisEmitter,
	textIdent, dnCountry, dnOrganization string,
	primarySwitch bool) (s *MessageSwitch, err error)

NewMessageSwitch create new instance of MessageSwitch.

func (*MessageSwitch) AddServiceProvider

func (s *MessageSwitch) AddServiceProvider(textIdent string, serviceProvider qabalwrap.ServiceProvider) (err error)

AddServiceProvider associate given service provider into message switch instance. Must only invoke at setup stage.

func (*MessageSwitch) ReceiveMessage

func (s *MessageSwitch) ReceiveMessage(spanEmitter *qabalwrap.TraceEmitter, m *qabalwrap.EnvelopedMessage) (err error)

ReceiveMessage deliver message into this instance of service provider. The message should decypted before pass into this method.

func (*MessageSwitch) Setup

func (s *MessageSwitch) Setup(
	serviceInstIdent qabalwrap.ServiceInstanceIdentifier,
	diagnosisEmitter *qabalwrap.DiagnosisEmitter,
	certProvider qabalwrap.CertificateProvider) (err error)

Setup prepare provider for operation. Should only invoke at maintenance thread in setup stage.

func (*MessageSwitch) Start

func (s *MessageSwitch) Start(ctx context.Context, waitGroup *sync.WaitGroup, spanEmitter *qabalwrap.TraceEmitter) (err error)

func (*MessageSwitch) Stop

func (s *MessageSwitch) Stop()

type ServiceReference

type ServiceReference struct {
	UniqueIdent uuid.UUID             `json:"u"`
	SerialIdent int                   `json:"i"`
	TextIdent   string                `json:"t"`
	PublicKey   keybinary.ByteArray32 `json:"p"`
	PrivateKey  keybinary.ByteArray32 `json:"s"`
}

ServiceReference contains service identification and access keys.

func (*ServiceReference) IsNormalSerialIdent

func (ref *ServiceReference) IsNormalSerialIdent() bool

IsNormalSerialIdent check if serial identifier value is located within assignable range.

Jump to

Keyboard shortcuts

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