Documentation ¶
Index ¶
- Constants
- Variables
- func AnalyzeAccessDOTChain(mtype int, targetURI string, dc *objects.DChain) (code int, mvk []byte, mergeduri *string, star, plus bool, ...)
- func DistributeRO(routerEntity *objects.Entity, ro objects.RoutingObject, cl *Client)
- func ElaborateDChain(dc *objects.DChain) *objects.DChain
- func NewSnode() *snode
- func ResolveDotsInDChain(dc *objects.DChain, cache []objects.RoutingObject) bool
- type BWConfig
- type Client
- func (cl *Client) Destroy()
- func (cl *Client) List(m *Message, cb func(s string, ok bool))
- func (cl *Client) Persist(m *Message)
- func (cl *Client) Publish(m *Message)
- func (cl *Client) Query(m *Message, cb func(m *Message))
- func (cl *Client) Subscribe(m *Message, cb func(m *Message, id UniqueMessageID)) UniqueMessageID
- func (cl *Client) Unsubscribe(subid UniqueMessageID)
- type Message
- type ObjectResponse
- type StatusMessage
- type Terminus
- type UniqueMessageID
- type VerifyState
Constants ¶
const ( TypePublish = 0x01 TypePersist = 0x02 TypeSubscribe = 0x03 TypeTap = 0x04 TypeQuery = 0x05 TypeTapQuery = 0x06 TypeLS = 0x07 )
Variables ¶
Functions ¶
func AnalyzeAccessDOTChain ¶
func AnalyzeAccessDOTChain(mtype int, targetURI string, dc *objects.DChain) (code int, mvk []byte, mergeduri *string, star, plus bool, ps *objects.AccessDOTPermissionSet, originVK []byte)
AnalyzeAccessDotChain does what it says.
func DistributeRO ¶
func DistributeRO(routerEntity *objects.Entity, ro objects.RoutingObject, cl *Client, )
DistributeRO will store an RO in the various correct places, as well as publish it on the router's uri. NOTE: will need to make terminus treat this uri specially
func ResolveDotsInDChain ¶
func ResolveDotsInDChain(dc *objects.DChain, cache []objects.RoutingObject) bool
Types ¶
type BWConfig ¶
type BWConfig struct { Router struct { VK string SK string DB string LogPath string } Affinity struct { MVK []string } Native struct { ListenOn string } OOB struct { ListenOn string } DNSOverride struct { Set []string } }
BWConfig is the configuration for a router
func LoadConfig ¶
LoadConfig will load and return a configuration. If "" is specified for the filename, it will default to "bw2.ini" in the current directory
func (*BWConfig) GetDRVKcache ¶
func (*BWConfig) GetNamecache ¶
DNS override should allow name : mvk mvk : dr dr : host
func (*BWConfig) GetTargetcache ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
A handle to a queue that gets messages dispatched to it
func (*Client) Subscribe ¶
func (cl *Client) Subscribe(m *Message, cb func(m *Message, id UniqueMessageID)) UniqueMessageID
Subscribe should bind the given handler with the given topic returns the identifier used for Unsubscribe func (cl *Client) Subscribe(topic string, tap bool, meta interface{}) (uint32, bool) {
func (*Client) Unsubscribe ¶
func (cl *Client) Unsubscribe(subid UniqueMessageID)
Unsubscribe does what it says. For now the topic system is crude so this doesn't seem necessary to have the subid instead of topic but it will make sense when we are doing wildcards later.
type Message ¶
type Message struct { //Packed Encoded []byte //Primary data Type uint8 MessageID uint64 Consumers int MVK []byte TopicSuffix string Signature []byte RoutingObjects []objects.RoutingObject PayloadObjects []objects.PayloadObject //Derived data, not needed for TX message SigCoverEnd int OriginVK *[]byte Valid bool Topic string RXTime time.Time ExpireTime time.Time PrimaryAccessChain *objects.DChain MergedTopic *string UMid UniqueMessageID // contains filtered or unexported fields }
Message is the primary Bosswave message type that is passed all the way through
func LoadMessage ¶
func (*Message) Encode ¶
Encode generates the encoded array with signature. it assumes that everything is properly set up by the message factory that created this message object.
func (*Message) Verify ¶
func (m *Message) Verify() *StatusMessage
TODO remove the damn status message thing and just use an int A piece of critical documentation: There are a few "exceptions" to the obvious rules. a) A DOT granting a VK of all zeroes applies to anyone b) Any message concerning a topic of mvk/*/$/* is allowed as read only
without a DChain. This is used so that clients can discover "free" DOTs or means of acquiring DOTs.
c) A router exposes its DOTs and entities as
00..00/$/dot/to/<vk>/<hashes> 00..00/$/dot/from/<vk>/<hash> 00..00/$/dot/from/to/<vk>/<hash> 00..00/$/dot/<hash> 00..00/$/entity/<hash> these can be queried or subscribed to.
type ObjectResponse ¶
type ObjectResponse struct { UMid UniqueMessageID Objects []objects.PayloadObject }
type StatusMessage ¶
type StatusMessage struct { UMid UniqueMessageID Code int }
func (*StatusMessage) Ok ¶
func (s *StatusMessage) Ok() bool
type Terminus ¶
type Terminus struct {
// contains filtered or unexported fields
}
func CreateTerminus ¶
func CreateTerminus() *Terminus
func (*Terminus) AddSub ¶
func (tm *Terminus) AddSub(topic string, s subscription) UniqueMessageID
AddSub adds a subscription to terminus. It returns the unique message ID of the actual subscription in the tree. If it is not the same as the one in the given subscription, then the add was a noop. Note that means that the new callback in the added subscription WILL NOT BE CALLED upon new messages. i.e subscriptions must be unique within a client
func (*Terminus) CreateClient ¶
func (*Terminus) RMatchSubs ¶
type UniqueMessageID ¶
func UniqueMessageIDFromString ¶
func UniqueMessageIDFromString(s string) *UniqueMessageID
func (*UniqueMessageID) ToString ¶
func (umid *UniqueMessageID) ToString() string