Documentation ¶
Overview ¶
This file is autogenerated from https://github.com/immesys/bw2_pid/blob/master/allocations.yaml
Index ¶
- Constants
- Variables
- func IsEveryoneVK(vk []byte) bool
- func NewObjectError(oid int, msg string) error
- func PONumDotForm(ponum int) string
- func PONumFromDotForm(dotform string) (int, error)
- func ReadExactly(s *bufio.Reader, to []byte) error
- type AccessDOTPermissionSet
- type BossWaveObject
- type DChain
- func (ro *DChain) AugmentBy(d *DOT)
- func (ro *DChain) CheckAccessGrants(curTime *time.Time, ADPS *AccessDOTPermissionSet, mvk []byte, suffix string, ...) int
- func (ro *DChain) CheckAllSigs() bool
- func (ro *DChain) ConvertToDChainHash() (*DChain, error)
- func (ro *DChain) GetAccessURIPermString() string
- func (ro *DChain) GetAccessURISuffix() (string, error)
- func (ro *DChain) GetChainHash() []byte
- func (ro *DChain) GetContent() []byte
- func (ro *DChain) GetDOT(num int) *DOT
- func (ro *DChain) GetDotHash(num int) []byte
- func (ro *DChain) GetGiverVK() []byte
- func (ro *DChain) GetMVK() []byte
- func (ro *DChain) GetRONum() int
- func (ro *DChain) GetReceiverVK() []byte
- func (ro *DChain) GetTTL() int
- func (ro *DChain) IsAccess() bool
- func (ro *DChain) IsElaborated() bool
- func (ro *DChain) IsPayloadObject() bool
- func (ro *DChain) NumHashes() int
- func (ro *DChain) SetDOT(num int, d *DOT)
- func (ro *DChain) UnElaborate()
- func (ro *DChain) WriteToStream(s io.Writer, fullObjNum bool) error
- type DOT
- func (ro *DOT) AddRevoker(rvk []byte)
- func (ro *DOT) Encode(sk []byte)
- func (ro *DOT) GetAccessURIMVK() []byte
- func (ro *DOT) GetAccessURISuffix() string
- func (ro *DOT) GetComment() string
- func (ro *DOT) GetContact() string
- func (ro *DOT) GetContent() []byte
- func (ro *DOT) GetCreated() *time.Time
- func (ro *DOT) GetExpiry() *time.Time
- func (ro *DOT) GetGiverVK() []byte
- func (ro *DOT) GetHash() []byte
- func (ro *DOT) GetPermString() string
- func (ro *DOT) GetPermissionSet() *AccessDOTPermissionSet
- func (ro *DOT) GetRONum() int
- func (ro *DOT) GetReceiverVK() []byte
- func (ro *DOT) GetRevokers() [][]byte
- func (ro *DOT) GetTTL() int
- func (ro *DOT) IsAccess() bool
- func (ro *DOT) IsPayloadObject() bool
- func (ro *DOT) OverrideSetSignatureValid()
- func (ro *DOT) SetAccessURI(mvk []byte, suffix string)
- func (ro *DOT) SetCanConsume(normal bool, plus bool, star bool)
- func (ro *DOT) SetCanList(value bool)
- func (ro *DOT) SetCanPublish(value bool)
- func (ro *DOT) SetCanTap(normal bool, plus bool, star bool)
- func (ro *DOT) SetComment(v string)
- func (ro *DOT) SetContact(v string)
- func (ro *DOT) SetCreation(time time.Time)
- func (ro *DOT) SetCreationToNow()
- func (ro *DOT) SetExpireFromNow(delta time.Duration)
- func (ro *DOT) SetExpiry(time time.Time)
- func (ro *DOT) SetPermString(v string) bool
- func (ro *DOT) SetPermission(key string, value string)
- func (ro *DOT) SetTTL(v int)
- func (ro *DOT) SigValid() bool
- func (ro *DOT) String() string
- func (ro *DOT) WriteToStream(s io.Writer, fullObjNum bool) error
- type Entity
- func (ro *Entity) AddRevoker(rvk []byte)
- func (ro *Entity) Encode()
- func (ro *Entity) FullString() string
- func (ro *Entity) GetComment() string
- func (ro *Entity) GetContact() string
- func (ro *Entity) GetContent() []byte
- func (ro *Entity) GetCreated() *time.Time
- func (ro *Entity) GetExpiry() *time.Time
- func (ro *Entity) GetRONum() int
- func (ro *Entity) GetRevokers() [][]byte
- func (ro *Entity) GetSK() []byte
- func (ro *Entity) GetSigningBlob() []byte
- func (ro *Entity) GetVK() []byte
- func (ro *Entity) IsPayloadObject() bool
- func (ro *Entity) OverrideSetSignatureValid()
- func (ro *Entity) SetCreationToNow()
- func (ro *Entity) SetExpiry(t time.Time)
- func (ro *Entity) SetSK(sk []byte)
- func (ro *Entity) SetVK(vk []byte)
- func (ro *Entity) SigValid() bool
- func (ro *Entity) StringKey() string
- func (ro *Entity) WriteToStream(s io.Writer, fullObjNum bool) error
- type Expiry
- type Frame
- func (f *Frame) AddHeader(k string, v string)
- func (f *Frame) AddHeaderB(k string, v []byte)
- func (f *Frame) AddPayloadObject(po PayloadObject)
- func (f *Frame) AddRoutingObject(ro RoutingObject)
- func (f *Frame) GetAllHeaders(k string) []string
- func (f *Frame) GetAllHeadersB(k string) [][]byte
- func (f *Frame) GetAllPOs() []PayloadObject
- func (f *Frame) GetAllROs() []RoutingObject
- func (f *Frame) GetFirstHeader(k string) (string, bool)
- func (f *Frame) GetFirstHeaderB(k string) ([]byte, bool)
- func (f *Frame) ParseFirstHeaderAsBool(k string, def bool) (bool, bool, *string)
- func (f *Frame) ParseFirstHeaderAsInt(k string, def int) (int, bool, *string)
- func (f *Frame) WriteToStream(s *bufio.Writer)
- type GenericPO
- type Header
- type ObjectError
- type OriginVK
- type POEntry
- type PayloadObject
- type PublishLimits
- type ROEntry
- type Revocation
- func (ro *Revocation) Encode(sk []byte)
- func (ro *Revocation) GetContent() []byte
- func (ro *Revocation) GetHash() []byte
- func (ro *Revocation) GetRONum() int
- func (ro *Revocation) GetTarget() []byte
- func (ro *Revocation) GetVK() []byte
- func (ro *Revocation) IsPayloadObject() bool
- func (ro *Revocation) IsValidFor(obj RoutingObject) bool
- func (ro *Revocation) SigValid() bool
- func (ro *Revocation) WriteToStream(s io.Writer, fullObjNum bool) error
- type RoutingObject
- func LoadRoutingObject(ronum int, content []byte) (RoutingObject, error)
- func NewDChain(ronum int, content []byte) (rv RoutingObject, err error)
- func NewDOT(ronum int, content []byte) (rv RoutingObject, err error)
- func NewEntity(ronum int, content []byte) (rv RoutingObject, err error)
- func NewExpiry(ronum int, content []byte) (rv RoutingObject, err error)
- func NewOriginVK(ronum int, content []byte) (RoutingObject, error)
- func NewRevocation(ronum int, content []byte) (rv RoutingObject, err error)
Constants ¶
const ( ROAccessDChainHash = 0x01 ROPermissionDChainHash = 0x11 ROAccessDChain = 0x02 ROPermissionDChain = 0x12 ROAccessDOT = 0x20 ROPermissionDOT = 0x21 ROEntity = 0x30 ROEntityWKey = 0x32 ROOriginVK = 0x31 ROExpiry = 0x40 RORevocation = 0x50 )
const ( CmdHello = "helo" CmdPublish = "publ" CmdSubscribe = "subs" CmdPersist = "pers" CmdList = "list" CmdQuery = "quer" CmdTapSubscribe = "tsub" CmdTapQuery = "tque" CmdPutDot = "putd" CmdPutEntity = "pute" CmdPutChain = "putc" CmdMakeDot = "makd" CmdMakeEntity = "make" CmdMakeChain = "makc" CmdBuildChain = "bldc" CmdAddPrefDot = "adpd" CmdAddPrefChain = "adpc" CmdDelPrefDot = "dlpd" CmdDelPrefChain = "dlpc" CmdSetEntity = "sete" CmdResponse = "resp" CmdResult = "rslt" )
const PODFBWRoutingObject = `0.0.0.0`
const PODFBinary = `0.0.0.0`
const PODFBinaryActuation = `1.0.1.0`
const PODFBlob = `1.0.0.0`
const PODFCapnP = `3.0.0.0`
const PODFDouble = `1.0.2.0`
const PODFFMDIntentString = `64.0.1.1`
const PODFHamiltonBase = `2.0.4.0`
const PODFHamiltonTelemetry = `2.0.4.64`
const PODFJSON = `65.0.0.0`
const PODFMaskBWRoutingObject = `0.0.0.0/8`
const PODFMaskBinary = `0.0.0.0/4`
const PODFMaskBinaryActuation = `1.0.1.0/32`
const PODFMaskBlob = `1.0.0.0/8`
const PODFMaskCapnP = `3.0.0.0/8`
const PODFMaskDouble = `1.0.2.0/32`
const PODFMaskFMDIntentString = `64.0.1.1/32`
const PODFMaskHamiltonBase = `2.0.4.0/24`
const PODFMaskHamiltonTelemetry = `2.0.4.64/26`
const PODFMaskJSON = `65.0.0.0/8`
const PODFMaskMsgPack = `2.0.0.0/8`
const PODFMaskSMetadata = `2.0.3.1/32`
const PODFMaskSpawnpointConfig = `67.0.2.0/32`
const PODFMaskSpawnpointHeartbeat = `67.0.2.1/32`
const PODFMaskSpawnpointLog = `2.0.2.0/32`
const PODFMaskString = `64.0.1.0/32`
const PODFMaskText = `64.0.0.0/4`
const PODFMaskXML = `66.0.0.0/8`
const PODFMaskYAML = `67.0.0.0/8`
const PODFMsgPack = `2.0.0.0`
const PODFSMetadata = `2.0.3.1`
const PODFSpawnpointConfig = `67.0.2.0`
const PODFSpawnpointHeartbeat = `67.0.2.1`
const PODFSpawnpointLog = `2.0.2.0`
const PODFString = `64.0.1.0`
const PODFText = `64.0.0.0`
const PODFXML = `66.0.0.0`
const PODFYAML = `67.0.0.0`
const POMaskBWRoutingObject = 8
const POMaskBinary = 4
const POMaskBinaryActuation = 32
const POMaskBlob = 8
const POMaskCapnP = 8
const POMaskDouble = 32
const POMaskFMDIntentString = 32
const POMaskHamiltonBase = 24
const POMaskHamiltonTelemetry = 26
const POMaskJSON = 8
const POMaskMsgPack = 8
const POMaskSMetadata = 32
const POMaskSpawnpointConfig = 32
const POMaskSpawnpointHeartbeat = 32
const POMaskSpawnpointLog = 32
const POMaskString = 32
const POMaskText = 4
const POMaskXML = 8
const POMaskYAML = 8
const PONumBWRoutingObject = 0
BWRoutingObject (0.0.0.0/8): Bosswave Routing Object This class and schema block is reserved for bosswave routing objects represented using the full PID.
const PONumBinary = 0
Binary (0.0.0.0/4): Binary protocols This is a superclass for classes that are generally unreadable in their plain form and require translation.
const PONumBinaryActuation = 16777472
BinaryActuation (1.0.1.0/32): Binary actuation This payload object is one byte long, 0x00 for off, 0x01 for on.
const PONumBlob = 16777216
Blob (1.0.0.0/8): Blob This is a class for schemas that do not use a public encoding format. In general it should be avoided. Schemas below this should include the key "readme" with a url to a description of the schema that is sufficiently detailed to allow for a developer to reverse engineer the protocol if required.
const PONumCapnP = 50331648
CapnP (3.0.0.0/8): Captain Proto This class is for captain proto interfaces. Schemas below this should include the key "schema" with a url to their .capnp file
const PONumDouble = 16777728
Double (1.0.2.0/32): Double This payload is an 8 byte long IEEE 754 double floating point value encoded in little endian. This should only be used if the semantic meaning is obvious in the context, otherwise a PID with a more specific semantic meaning should be used.
const PONumFMDIntentString = 1073742081
FMDIntentString (64.0.1.1/32): FMD Intent String A plain string used as an intent for the follow-me display service.
const PONumHamiltonBase = 33555456
HamiltonBase (2.0.4.0/24): Hamilton Messages This is the base class for messages used with the Hamilton motes. The only key guaranteed is "#" that contains a uint16 representation of the serial of the mote the message is destined for or originated from.
const PONumHamiltonTelemetry = 33555520
HamiltonTelemetry (2.0.4.64/26): Hamilton Telemetry This object contains a "#" field for the serial number, as well as possibly containing an "A" field with a list of X, Y, and Z accelerometer values. A "T" field containing the temperature as an integer in degrees C multiplied by 10000, and an "L" field containing the illumination in Lux.
const PONumJSON = 1090519040
JSON (65.0.0.0/8): JSON This class is for schemas that are represented in JSON
const PONumMsgPack = 33554432
MsgPack (2.0.0.0/8): MsgPack This class is for schemas that are represented in MsgPack
const PONumSMetadata = 33555201
SMetadata (2.0.3.1/32): Simple Metadata entry This contains a simple "val" string and "ts" int64 metadata entry. The key is determined by the URI. Other information MAY be present in the msgpacked object. The timestamp is used for merging metadata entries.
const PONumSpawnpointConfig = 1124073984
SpawnpointConfig (67.0.2.0/32): SpawnPoint config A configuration file for SpawnPoint (github.com/immesys/spawnpoint)
const PONumSpawnpointHeartbeat = 1124073985
SpawnpointHeartbeat (67.0.2.1/32): SpawnPoint heartbeat A heartbeat message from spawnpoint
const PONumSpawnpointLog = 33554944
SpawnpointLog (2.0.2.0/32): Spawnpoint stdout This contains stdout data from a spawnpoint container. It is a msgpacked dictionary that contains a "service" key, a "time" key (unix nano timestamp) and a "contents" key and a "spalias" key.
const PONumString = 1073742080
String (64.0.1.0/32): String A plain string with no rigid semantic meaning. This can be thought of as a print statement. Anything that has semantic meaning like a process log should use a different schema.
const PONumText = 1073741824
Text (64.0.0.0/4): Human readable text This is a superclass for classes that are moderately understandable if they are read directly in their binary form. Generally these are protocols that were designed specifically to be human readable.
const PONumXML = 1107296256
XML (66.0.0.0/8): XML This class is for schemas that are represented in XML
const PONumYAML = 1124073472
YAML (67.0.0.0/8): YAML This class is for schemas that are represented in YAML
const SaneObjectSize = 16 * 1024 * 1024
We allocate buffers for objects. Lets not get too exciteable about how big an object we are willing to accept
Variables ¶
var RoutingObjectConstructor = map[int]func(ronum int, content []byte) (RoutingObject, error){ ROAccessDChain: NewDChain, ROAccessDChainHash: NewDChain, ROPermissionDChain: NewDChain, ROPermissionDChainHash: NewDChain, ROAccessDOT: NewDOT, ROPermissionDOT: NewDOT, ROEntity: NewEntity, ROOriginVK: NewOriginVK, ROExpiry: NewExpiry, RORevocation: NewRevocation, }
RoutingObjectConstruct allows you to map a ROnum into a constructor that takes a binary representation and returns a Routing Object
Functions ¶
func NewObjectError ¶
NewObjectError constructs an ObjectError
func PONumDotForm ¶
func PONumFromDotForm ¶
Types ¶
type AccessDOTPermissionSet ¶
type AccessDOTPermissionSet struct { CanPublish bool CanConsume bool CanConsumePlus bool CanConsumeStar bool CanTap bool CanTapPlus bool CanTapStar bool CanList bool }
func DecodeADPS ¶
func DecodeADPS(raw []byte) *AccessDOTPermissionSet
func GetADPSFromPermString ¶
func GetADPSFromPermString(v string) *AccessDOTPermissionSet
func (*AccessDOTPermissionSet) Encode ¶
func (ps *AccessDOTPermissionSet) Encode() []byte
This is not the encoding used on the wire, but it is used on the BC
func (*AccessDOTPermissionSet) GetPermString ¶
func (ps *AccessDOTPermissionSet) GetPermString() string
func (*AccessDOTPermissionSet) IsSubsetOf ¶
func (ps *AccessDOTPermissionSet) IsSubsetOf(rhs *AccessDOTPermissionSet) bool
func (*AccessDOTPermissionSet) ReduceBy ¶
func (ps *AccessDOTPermissionSet) ReduceBy(rhs *AccessDOTPermissionSet)
type BossWaveObject ¶
type BossWaveObject interface {
IsPayloadObject() bool
}
func LoadBosswaveObject ¶
func LoadBosswaveObject(s io.Reader) (BossWaveObject, error)
LoadBosswaveObject loads an object from a reader. all objects will need to have the full length header
type DChain ¶
type DChain struct {
// contains filtered or unexported fields
}
DChain is a list of DOT hashes
func CreateDChain ¶
CreateDChain creates a dot chain from the given DOTs. The DOTs must have the hash field populated
func (*DChain) AugmentBy ¶
AugmentBy fills the given dot into the right position in the chain assuming it is referred to at all
func (*DChain) CheckAccessGrants ¶
func (ro *DChain) CheckAccessGrants(curTime *time.Time, ADPS *AccessDOTPermissionSet, mvk []byte, suffix string, getDOT func([]byte) *DOT, getEntity func([]byte) *Entity, getRevocations func([]byte) []*Revocation) int
CheckAccessGrants is supposed to verify absolutely everything it can. As a quirk, it is written to use external state so it can be used for BC and statedb work. It fails if absoulutely ANYTHING is out of order. it checks
- all DOT sigs,
- Revocations on srcvk, dstvk, dothash
- all dots are access
- dots are tail-to-tail
- dot expiry against curTimeNs
- TTL
- all dots grant on MVK
- final chain gives superset of ADPS and Suffix
- all entity sigs
- entity expiry against curTimeNs
- given URI suffix is well formed
- the origin of the dchain is the mvk - this might be contentious
it is my hope that if this method gives the okay, there is nothing (save for unknown revocations) that could be wrong if curTimeNs is nil, the current system time will be used if any of the state functions cannot find, it should return nil if status is BWStatusOkay, everything is A-OK, if it is BWStatusOkayAsResolved it MIGHT be ok it is up to the caller to determine if they need to know that the entities are unexpired. Otherwise any entity that fails to resolve is not an error but may have been expired and we don't know. DOTs must be resolvable so we know they are not expired.
func (*DChain) CheckAllSigs ¶
func (*DChain) ConvertToDChainHash ¶
ConvertToDChainHash creates a hash RO from a dchain RO that may or may not be fully elaborated. Note that there are shared resources in the result
func (*DChain) GetAccessURIPermString ¶
func (*DChain) GetAccessURISuffix ¶
func (*DChain) GetChainHash ¶
GetChainHash returns the hash of the chain
func (*DChain) GetContent ¶
GetContent returns the serialised content for this object
func (*DChain) GetDOT ¶
GetDOT returns the DOT at the given index if it has been stored in the chain, otherwise nil
func (*DChain) GetDotHash ¶
GetDotHash returns the dot hash at the specific index
func (*DChain) GetGiverVK ¶
func (*DChain) GetReceiverVK ¶
func (*DChain) IsElaborated ¶
IsElaborated returns true if the dot hashes are populated
func (*DChain) IsPayloadObject ¶
func (*DChain) UnElaborate ¶
func (ro *DChain) UnElaborate()
type DOT ¶
type DOT struct {
// contains filtered or unexported fields
}
DOT is a declaration of trust. This is a shared object that implements both an access dot and a permission dot
func CreateDOT ¶
CreateDOT is used to create a DOT from scratch. The DOT is incomplete until Encode() is called later.
func (*DOT) AddRevoker ¶
func (*DOT) Encode ¶
Encode will work out the content of the DOT based on the fields that have been set, and sign it with the given sk (must match the vk)
func (*DOT) GetAccessURIMVK ¶
GetAccessURIMVK gets the mvk if this is an access DOT
func (*DOT) GetAccessURISuffix ¶
GetAccessURISuffix returns the suffix if this is an access DOT
func (*DOT) GetComment ¶
func (*DOT) GetContact ¶
func (*DOT) GetContent ¶
GetContent returns the binary representation of the DOT if Encode has been called
func (*DOT) GetCreated ¶
func (*DOT) GetGiverVK ¶
GetGiverVK returns the verifying key of the entity that created this DOT
func (*DOT) GetHash ¶
GetHash returns the dot hash or panics if it has not been set by encoding/reading from stream etc.
func (*DOT) GetPermString ¶
GetPermString gets the human readable permission string for an access dot
func (*DOT) GetPermissionSet ¶
func (ro *DOT) GetPermissionSet() *AccessDOTPermissionSet
func (*DOT) GetReceiverVK ¶
GetReceiverVK gets the verifying key of the entity that is the recipient of trust in this DOT
func (*DOT) GetRevokers ¶
func (*DOT) IsPayloadObject ¶
func (*DOT) OverrideSetSignatureValid ¶
func (ro *DOT) OverrideSetSignatureValid()
OverrideSetSigValid sets this dots signature as valid without checking it this is used if the DOT is known good (say from the store)
func (*DOT) SetAccessURI ¶
SetAccessURI sets the URI of an Access DOT
func (*DOT) SetCanConsume ¶
SetCanConsume sets the consume privileges on an access dot
func (*DOT) SetCanList ¶
SetCanList sets the list capability on an access DOT
func (*DOT) SetCanPublish ¶
SetCanPublish sets the publish capability on an access DOT
func (*DOT) SetComment ¶
func (*DOT) SetContact ¶
func (*DOT) SetCreation ¶
SetCreation sets the creation timestamp on the DOT
func (*DOT) SetCreationToNow ¶
func (ro *DOT) SetCreationToNow()
SetCreationToNow sets the creation timestamp to the current time
func (*DOT) SetExpireFromNow ¶
SetExpireFromNow is a convenience function that sets the creation time to now, and sets the expiry to the given delta from the creation time
func (*DOT) SetPermString ¶
SetPermString sets the permissions of this (access) dot. it returns true on success, false if the string is bad or this was not an access dot
func (*DOT) SetPermission ¶
SetPermission sets the given key in a Permission DOT's table
func (*DOT) SigValid ¶
SigValid returns if the DOT's signature is valid. This only checks the signature on the first call, so the content must not change after encoding for this to be valid. As a plus it also verifies that the topic is sane
type Entity ¶
type Entity struct {
// contains filtered or unexported fields
}
func CreateLightEntity ¶
func CreateNewEntity ¶
func (*Entity) AddRevoker ¶
func (*Entity) FullString ¶
func (*Entity) GetComment ¶
func (*Entity) GetContact ¶
func (*Entity) GetContent ¶
func (*Entity) GetCreated ¶
func (*Entity) GetRevokers ¶
func (*Entity) GetSigningBlob ¶
GetSigningBlob returns the full entity, including the private key
func (*Entity) IsPayloadObject ¶
func (*Entity) OverrideSetSignatureValid ¶
func (ro *Entity) OverrideSetSignatureValid()
func (*Entity) SetCreationToNow ¶
func (ro *Entity) SetCreationToNow()
type Expiry ¶
type Expiry struct {
// contains filtered or unexported fields
}
func CreateNewExpiry ¶
func CreateNewExpiryFromNow ¶
func (*Expiry) GetContent ¶
func (*Expiry) IsPayloadObject ¶
type Frame ¶
func CreateFrame ¶
func (*Frame) AddHeaderB ¶
func (*Frame) AddPayloadObject ¶
func (f *Frame) AddPayloadObject(po PayloadObject)
func (*Frame) AddRoutingObject ¶
func (f *Frame) AddRoutingObject(ro RoutingObject)
func (*Frame) GetAllHeaders ¶
func (*Frame) GetAllHeadersB ¶
func (*Frame) GetAllPOs ¶
func (f *Frame) GetAllPOs() []PayloadObject
func (*Frame) GetAllROs ¶
func (f *Frame) GetAllROs() []RoutingObject
func (*Frame) ParseFirstHeaderAsBool ¶
func (*Frame) ParseFirstHeaderAsInt ¶
func (*Frame) WriteToStream ¶
type GenericPO ¶
type GenericPO struct {
// contains filtered or unexported fields
}
func (*GenericPO) GetContent ¶
type ObjectError ¶
ObjectError is thrown by object parsing function
func (ObjectError) Error ¶
func (oe ObjectError) Error() string
type OriginVK ¶
type OriginVK struct {
// contains filtered or unexported fields
}
func CreateOriginVK ¶
func (*OriginVK) GetContent ¶
func (*OriginVK) IsPayloadObject ¶
type PayloadObject ¶
PayloadObject is the interface that is common among all objects that appear in the payload block
func CreateOpaquePayloadObject ¶
func CreateOpaquePayloadObject(ponum int, content []byte) (PayloadObject, error)
func CreateOpaquePayloadObjectDF ¶
func CreateOpaquePayloadObjectDF(dotform string, content []byte) (PayloadObject, error)
func LoadPayloadObject ¶
func LoadPayloadObject(ponum int, content []byte) (PayloadObject, error)
type PublishLimits ¶
PublishLimits is an option found in an AccessDOT that governs the resources that may be used by messages authorised via the DOT
type ROEntry ¶
type ROEntry struct { RO RoutingObject RONum string Length string }
type Revocation ¶
type Revocation struct {
// contains filtered or unexported fields
}
func (*Revocation) Encode ¶
func (ro *Revocation) Encode(sk []byte)
func (*Revocation) GetContent ¶
func (ro *Revocation) GetContent() []byte
func (*Revocation) GetHash ¶
func (ro *Revocation) GetHash() []byte
func (*Revocation) GetRONum ¶
func (ro *Revocation) GetRONum() int
func (*Revocation) GetTarget ¶
func (ro *Revocation) GetTarget() []byte
func (*Revocation) GetVK ¶
func (ro *Revocation) GetVK() []byte
func (*Revocation) IsPayloadObject ¶
func (ro *Revocation) IsPayloadObject() bool
func (*Revocation) IsValidFor ¶
func (ro *Revocation) IsValidFor(obj RoutingObject) bool
This does not recurse. E.g. for a dot this would return false even if valid for src/dstvk... this is because you have to check the entities seperately anyway to fully factor in the entities DRVKs
func (*Revocation) SigValid ¶
func (ro *Revocation) SigValid() bool
func (*Revocation) WriteToStream ¶
func (ro *Revocation) WriteToStream(s io.Writer, fullObjNum bool) error
type RoutingObject ¶
type RoutingObject interface { GetRONum() int GetContent() []byte WriteToStream(w io.Writer, fullObjNum bool) error IsPayloadObject() bool }
RoutingObject is the interface that is common among all objects that appear in the routing object block
func LoadRoutingObject ¶
func LoadRoutingObject(ronum int, content []byte) (RoutingObject, error)
LoadRoutingObject takes the ronum and the content and returns the object
func NewDChain ¶
func NewDChain(ronum int, content []byte) (rv RoutingObject, err error)
NewDChain deserialises a DChain from a byte array
func NewDOT ¶
func NewDOT(ronum int, content []byte) (rv RoutingObject, err error)
NewDOT constructs a DOT from its packed form
func NewOriginVK ¶
func NewOriginVK(ronum int, content []byte) (RoutingObject, error)
func NewRevocation ¶
func NewRevocation(ronum int, content []byte) (rv RoutingObject, err error)