Documentation ¶
Index ¶
Constants ¶
View Source
const HeaderToken = "x-token"
Variables ¶
View Source
var ( ErrAddressNil = errors.New("address is nil") ErrAddressInvalid = errors.New("invalid address") ErrCertRootInvalid = errors.New("root ca is invalid") ErrCertPrivInvalid = errors.New("private key is invalid") ErrCertPubInvalid = errors.New("public key is invalid") ErrUnableDial = errors.New("unable to dial") ErrUnableListen = errors.New("unable to listen") ErrIllegalState = errors.New("illegal state") ErrBackboneNotFound = errors.New("backbone is not found") ErrBackboneInvalid = errors.New("backbone is invalid") ErrBackboneClosed = errors.New("backbone is closed") ErrPacketInvalid = errors.New("packet is invalid") )
Functions ¶
This section is empty.
Types ¶
type BackboneAddress ¶
func NewWebsocketAddress ¶
func NewWebsocketAddress( token string, networkAddress, path string, secured bool, rootCAPath, privKeyPath, pubKeyPath string, ) BackboneAddress
type BackboneHandler ¶
func NewBackboneHandler ¶
func NewBackboneHandler(onCreate func(b Backbone), onClosed func(b Backbone)) BackboneHandler
type PacketHandler ¶
func NewPacketHandler ¶
func NewPacketHandler(onReceive func(backboneId common.Id, packet Packet)) PacketHandler
type PacketType ¶
type PacketType int
const ( PacketTypeUnknown PacketType = iota PacketTypeOpen PacketTypeOpenAckSuccess PacketTypeOpenAckFailed PacketTypeEdgeCreate PacketTypeEdgeCreateAckSuccess PacketTypeEdgeCreateAckFailed PacketTypeEdgeClose PacketTypeMessage )
type Registry ¶
type Registry interface { SetAddress(address BackboneAddress) error SetPacketHandler(handler PacketHandler) error SetBackboneHandler(handler BackboneHandler) error Start() error IsRunning() bool Listen() error Dial() error Shutdown(ctx context.Context) error GetAll() ([]Backbone, error) GetById(backboneId common.Id) (Backbone, error) Send(backboneId common.Id, packet Packet) error }
func NewRegistry ¶
Click to show internal directories.
Click to hide internal directories.