Documentation ¶
Index ¶
- type BaseLayer
- func (l *BaseLayer) IsNexusAnnounced(nexus nexusHelper.Nexus) bool
- func (l *BaseLayer) RegisterLayerEvent(fn OnLayerEventFn, layerName string)
- func (l *BaseLayer) RevokeNexus(belowNexus nexusHelper.Nexus)
- func (l *BaseLayer) SendLayerEvent(nexus nexusHelper.Nexus, status string)
- func (l *BaseLayer) SetOnAnnounce(o OnAnnounceFn)
- func (l *BaseLayer) SetOnLayerEvent(o OnLayerEventFn)
- func (l *BaseLayer) SetOnRevoke(o OnRevokeFn)
- func (l *BaseLayer) TrackNexus(nexus nexusHelper.Nexus, belowNexus nexusHelper.Nexus)
- func (l *BaseLayer) TrackNexusAnnounced(nexus nexusHelper.Nexus)
- func (l *BaseLayer) TrackNexusRevoked(nexus nexusHelper.Nexus)
- func (l *BaseLayer) UntrackNexus(nexus nexusHelper.Nexus, belowNexus nexusHelper.Nexus)
- type Layer
- type NexusMap
- type NexusStringMap
- type NexusUuidMap
- type OnAnnounceFn
- type OnLayerEventFn
- type OnRevokeFn
- type UnknownNexus
- func (u UnknownNexus) GetDownwardNexusList() []nexus.Nexus
- func (u UnknownNexus) InitiateClose()
- func (u UnknownNexus) IsEqual(n nexus.Nexus) bool
- func (u UnknownNexus) Name() string
- func (u UnknownNexus) OnBinMessage(belowNexus nexus.Nexus, msg []byte)
- func (u UnknownNexus) OnMessage(belowNexus nexus.Nexus, msg base.MoneysocketMessage)
- func (u UnknownNexus) Send(msg base.MoneysocketMessage) error
- func (u UnknownNexus) SendBin(msg []byte) error
- func (u UnknownNexus) SetOnBinMessage(messageBinFunc nexus.OnBinMessage)
- func (u UnknownNexus) SetOnMessage(messageFunc nexus.OnMessage)
- func (u UnknownNexus) SharedSeed() *beacon.SharedSeed
- func (u UnknownNexus) Uuid() uuid.UUID
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BaseLayer ¶
type BaseLayer struct { LayerName string OnLayerEvent OnLayerEventFn OnAnnounce OnAnnounceFn OnRevoke OnRevokeFn Nexuses NexusMap Announced NexusMap BelowNexuses NexusMap NexusByBelow NexusUuidMap BelowByNexus NexusUuidMap }
func NewBaseLayer ¶
func NewBaseLayer() BaseLayer
create a new base layer, note you still have to call register_above nexus
func (*BaseLayer) IsNexusAnnounced ¶
func (l *BaseLayer) IsNexusAnnounced(nexus nexusHelper.Nexus) bool
func (*BaseLayer) RegisterLayerEvent ¶
func (l *BaseLayer) RegisterLayerEvent(fn OnLayerEventFn, layerName string)
func (*BaseLayer) RevokeNexus ¶
func (l *BaseLayer) RevokeNexus(belowNexus nexusHelper.Nexus)
func (*BaseLayer) SendLayerEvent ¶
func (l *BaseLayer) SendLayerEvent(nexus nexusHelper.Nexus, status string)
func (*BaseLayer) SetOnAnnounce ¶
func (l *BaseLayer) SetOnAnnounce(o OnAnnounceFn)
func (*BaseLayer) SetOnLayerEvent ¶
func (l *BaseLayer) SetOnLayerEvent(o OnLayerEventFn)
func (*BaseLayer) SetOnRevoke ¶
func (l *BaseLayer) SetOnRevoke(o OnRevokeFn)
func (*BaseLayer) TrackNexus ¶
func (l *BaseLayer) TrackNexus(nexus nexusHelper.Nexus, belowNexus nexusHelper.Nexus)
func (*BaseLayer) TrackNexusAnnounced ¶
func (l *BaseLayer) TrackNexusAnnounced(nexus nexusHelper.Nexus)
func (*BaseLayer) TrackNexusRevoked ¶
func (l *BaseLayer) TrackNexusRevoked(nexus nexusHelper.Nexus)
func (*BaseLayer) UntrackNexus ¶
func (l *BaseLayer) UntrackNexus(nexus nexusHelper.Nexus, belowNexus nexusHelper.Nexus)
type Layer ¶
type Layer interface { // set on layer event SetOnLayerEvent(o OnLayerEventFn) // set on announce event SetOnAnnounce(o OnAnnounceFn) // set on revoke event SetOnRevoke(o OnAnnounceFn) // register above layer events with current layer // must be done here since announce nexus // is not available form base layer RegisterAboveLayer(belowLayer Layer) // register layer event with nexuses RegisterLayerEvent(fn OnLayerEventFn, layerName string) // announce nexusHelper AnnounceNexus(belowNexus nexusHelper.Nexus) // track nexusHelper events TrackNexus(nexus nexusHelper.Nexus, belowNexus nexusHelper.Nexus) // remove tracker from nexusHelper events UntrackNexus(nexus nexusHelper.Nexus, belowNexus nexusHelper.Nexus) // track that a nexus has been announced TrackNexusAnnounced(nexus nexusHelper.Nexus) // check wether or not a nexus has been announced IsNexusAnnounced(nexus nexusHelper.Nexus) bool // revoke a nexus RevokeNexus(belowNexus nexusHelper.Nexus) }
type NexusMap ¶
type NexusMap struct {
// contains filtered or unexported fields
}
nexus map that enforces TODO this should get replaced with a string map
type NexusStringMap ¶
type NexusStringMap struct {
// contains filtered or unexported fields
}
nexus map that enforces types
func (*NexusStringMap) Delete ¶
func (num *NexusStringMap) Delete(key string)
delete an item from a map
func (*NexusStringMap) Get ¶
func (num *NexusStringMap) Get(key string) (nexusHelper.Nexus, bool)
get a nexus from the map, don't check for key presence
func (*NexusStringMap) Range ¶
func (num *NexusStringMap) Range(f func(key string, value nexusHelper.Nexus) bool)
func (*NexusStringMap) Store ¶
func (num *NexusStringMap) Store(key string, nexus nexusHelper.Nexus)
idempotently add an idea to map
type NexusUuidMap ¶
type NexusUuidMap struct {
// contains filtered or unexported fields
}
nexus map that enforces types
func (*NexusUuidMap) Delete ¶
func (num *NexusUuidMap) Delete(nexusUuid uuid.UUID)
delete an item from a map
type OnAnnounceFn ¶
type OnAnnounceFn = func(nexus nexusHelper.Nexus)
type OnLayerEventFn ¶
type OnLayerEventFn = func(layerName string, nexus nexusHelper.Nexus, event string)
type OnRevokeFn ¶
type OnRevokeFn = func(nexus nexusHelper.Nexus)
type UnknownNexus ¶
type UnknownNexus struct{}
a non-existent nexus that allows us to avoid returning a null value
func NewUnknownNexus ¶
func NewUnknownNexus() UnknownNexus
func (UnknownNexus) GetDownwardNexusList ¶
func (u UnknownNexus) GetDownwardNexusList() []nexus.Nexus
func (UnknownNexus) InitiateClose ¶
func (u UnknownNexus) InitiateClose()
func (UnknownNexus) Name ¶
func (u UnknownNexus) Name() string
func (UnknownNexus) OnBinMessage ¶
func (u UnknownNexus) OnBinMessage(belowNexus nexus.Nexus, msg []byte)
func (UnknownNexus) OnMessage ¶
func (u UnknownNexus) OnMessage(belowNexus nexus.Nexus, msg base.MoneysocketMessage)
func (UnknownNexus) Send ¶
func (u UnknownNexus) Send(msg base.MoneysocketMessage) error
func (UnknownNexus) SendBin ¶
func (u UnknownNexus) SendBin(msg []byte) error
func (UnknownNexus) SetOnBinMessage ¶
func (u UnknownNexus) SetOnBinMessage(messageBinFunc nexus.OnBinMessage)
func (UnknownNexus) SetOnMessage ¶
func (u UnknownNexus) SetOnMessage(messageFunc nexus.OnMessage)
func (UnknownNexus) SharedSeed ¶
func (u UnknownNexus) SharedSeed() *beacon.SharedSeed
Click to show internal directories.
Click to hide internal directories.