Documentation ¶
Index ¶
- func AllAllowedNetworkObjects() []object.Object
- func AllObjectType() []object.Type
- func AllQueryOptions() []query.Option
- func GetQuery() *query.Name
- func Intersect(a, b Interval) bool
- func Signature() signature.Sig
- func UpdateValidity(validSince, validUntil, oldValidSince, oldValidUntil int64, ...) (int64, int64)
- type Assertion
- func (a *Assertion) AddSig(sig signature.Sig)
- func (a *Assertion) AddSigInMarshaller()
- func (a *Assertion) AllSigs() []signature.Sig
- func (a *Assertion) Begin() string
- func (a *Assertion) CompareTo(assertion *Assertion) int
- func (a *Assertion) Copy(context, subjectZone string) *Assertion
- func (a *Assertion) DeleteAllSigs()
- func (a *Assertion) DeleteSig(i int)
- func (a *Assertion) DontAddSigInMarshaller()
- func (a *Assertion) End() string
- func (a *Assertion) EqualContextZoneName(assertion *Assertion) bool
- func (a *Assertion) FQDN() string
- func (a *Assertion) GetContext() string
- func (a *Assertion) GetSubjectZone() string
- func (a *Assertion) Hash() string
- func (a *Assertion) IsConsistent() bool
- func (a *Assertion) MarshalCBOR(w *cbor.CBORWriter) error
- func (a *Assertion) NeededKeys(keysNeeded map[signature.MetaData]bool)
- func (a *Assertion) RemoveContextAndSubjectZone()
- func (a *Assertion) SetContext(ctx string)
- func (a *Assertion) SetSubjectZone(zone string)
- func (a *Assertion) SetValidSince(validSince int64)
- func (a *Assertion) SetValidUntil(validUntil int64)
- func (a *Assertion) Sigs(keySpace keys.KeySpaceID) []signature.Sig
- func (a *Assertion) Sort()
- func (a *Assertion) String() string
- func (a *Assertion) UnmarshalMap(m map[int]interface{}) error
- func (a *Assertion) UpdateValidity(validSince, validUntil int64, maxValidity time.Duration)
- func (a *Assertion) ValidSince() int64
- func (a *Assertion) ValidUntil() int64
- type BloomFilter
- func (b BloomFilter) Add(name, zone, context string, t object.Type) error
- func (b BloomFilter) CompareTo(bloomFilter BloomFilter) int
- func (b BloomFilter) Contains(name, zone, context string, t object.Type) (bool, error)
- func (b BloomFilter) MarshalCBOR(w *cbor.CBORWriter) error
- func (b *BloomFilter) UnmarshalArray(in []interface{}) error
- type BloomFilterAlgo
- type Hasher
- type Interval
- type Notification
- type NotificationType
- type Pshard
- func (s *Pshard) AddAssertion(a *Assertion) error
- func (s *Pshard) AddSig(sig signature.Sig)
- func (s *Pshard) AddSigInMarshaller()
- func (s *Pshard) AllSigs() []signature.Sig
- func (s *Pshard) Begin() string
- func (s *Pshard) CompareTo(pshard *Pshard) int
- func (s *Pshard) Copy(context, subjectZone string) *Pshard
- func (s *Pshard) DeleteAllSigs()
- func (s *Pshard) DeleteSig(i int)
- func (s *Pshard) DontAddSigInMarshaller()
- func (s *Pshard) End() string
- func (s *Pshard) GetContext() string
- func (s *Pshard) GetSubjectZone() string
- func (s *Pshard) Hash() string
- func (s *Pshard) InRange(subjectName string) bool
- func (s *Pshard) IsConsistent() bool
- func (s *Pshard) IsNonexistent(q *query.Name) (bool, error)
- func (s *Pshard) MarshalCBOR(w *cbor.CBORWriter) error
- func (s *Pshard) NeededKeys(keysNeeded map[signature.MetaData]bool)
- func (s *Pshard) SetValidSince(validSince int64)
- func (s *Pshard) SetValidUntil(validUntil int64)
- func (s *Pshard) Sigs(keySpace keys.KeySpaceID) []signature.Sig
- func (s *Pshard) Sort()
- func (s *Pshard) String() string
- func (s *Pshard) UnmarshalMap(m map[int]interface{}) error
- func (s *Pshard) UpdateValidity(validSince, validUntil int64, maxValidity time.Duration)
- func (s *Pshard) ValidSince() int64
- func (s *Pshard) ValidUntil() int64
- type Query
- type Section
- type Shard
- func (s *Shard) AddCtxAndZoneToContent()
- func (s *Shard) AddSig(sig signature.Sig)
- func (s *Shard) AddSigInMarshaller()
- func (s *Shard) AllSigs() []signature.Sig
- func (s *Shard) Begin() string
- func (s *Shard) CompareTo(shard *Shard) int
- func (s *Shard) Copy(context, subjectZone string) *Shard
- func (s *Shard) DeleteAllSigs()
- func (s *Shard) DeleteSig(i int)
- func (s *Shard) DontAddSigInMarshaller()
- func (s *Shard) End() string
- func (s *Shard) GetContext() string
- func (s *Shard) GetSubjectZone() string
- func (s *Shard) Hash() string
- func (s *Shard) InRange(subjectName string) bool
- func (s *Shard) IsConsistent() bool
- func (s *Shard) MarshalCBOR(w *cbor.CBORWriter) error
- func (s *Shard) NeededKeys(keysNeeded map[signature.MetaData]bool)
- func (s *Shard) RemoveCtxAndZoneFromContent()
- func (s *Shard) SetValidSince(validSince int64)
- func (s *Shard) SetValidUntil(validUntil int64)
- func (s *Shard) Sigs(keySpace keys.KeySpaceID) []signature.Sig
- func (s *Shard) Sort()
- func (s *Shard) String() string
- func (s *Shard) UnmarshalMap(m map[int]interface{}) error
- func (s *Shard) UpdateValidity(validSince, validUntil int64, maxValidity time.Duration)
- func (s *Shard) ValidSince() int64
- func (s *Shard) ValidUntil() int64
- type StringInterval
- type TotalInterval
- type WithSig
- type WithSigForward
- type Zone
- func (z *Zone) AddCtxAndZoneToContent()
- func (z *Zone) AddSig(sig signature.Sig)
- func (z *Zone) AddSigInMarshaller()
- func (z *Zone) AllSigs() []signature.Sig
- func (z *Zone) Begin() string
- func (z *Zone) CompareTo(zone *Zone) int
- func (z *Zone) DeleteAllSigs()
- func (z *Zone) DeleteSig(i int)
- func (z *Zone) DontAddSigInMarshaller()
- func (z *Zone) End() string
- func (z *Zone) GetContext() string
- func (z *Zone) GetSubjectZone() string
- func (z *Zone) Hash() string
- func (z *Zone) IsConsistent() bool
- func (z *Zone) MarshalCBOR(w *cbor.CBORWriter) error
- func (z *Zone) NeededKeys(keysNeeded map[signature.MetaData]bool)
- func (z *Zone) RemoveCtxAndZoneFromContent()
- func (z *Zone) SetValidSince(validSince int64)
- func (z *Zone) SetValidUntil(validUntil int64)
- func (z *Zone) Sigs(keySpace keys.KeySpaceID) []signature.Sig
- func (z *Zone) Sort()
- func (z *Zone) String() string
- func (z *Zone) UnmarshalMap(m map[int]interface{}) error
- func (z *Zone) UpdateValidity(validSince, validUntil int64, maxValidity time.Duration)
- func (z *Zone) ValidSince() int64
- func (z *Zone) ValidUntil() int64
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AllAllowedNetworkObjects ¶
AllAllowedNetworkObjects returns a list of objects that are allowed for network subjectAddresses; with valid content
func AllQueryOptions ¶
AllQueryOptions returns all query options
Types ¶
type Assertion ¶
type Assertion struct { Signatures []signature.Sig SubjectName string SubjectZone string Context string Content []object.Object // contains filtered or unexported fields }
Assertion contains information about the assertion.
func GetAssertion ¶
func GetAssertion() *Assertion
GetAssertion returns an assertion containing all objects types that is valid.
func (*Assertion) AddSigInMarshaller ¶
func (a *Assertion) AddSigInMarshaller()
func (*Assertion) CompareTo ¶
CompareTo compares two assertions and returns 0 if they are equal, 1 if a is greater than assertion and -1 if a is smaller than assertion
func (*Assertion) Copy ¶
Copy creates a copy of the assertion with the given context and subjectZone values
func (*Assertion) DeleteAllSigs ¶
func (a *Assertion) DeleteAllSigs()
DeleteAllSigs deletes all signature
func (*Assertion) DontAddSigInMarshaller ¶
func (a *Assertion) DontAddSigInMarshaller()
func (*Assertion) EqualContextZoneName ¶
EqualContextZoneName return true if the given assertion has the same context, subjectZone, subjectName.
func (*Assertion) GetContext ¶
GetContext returns the context of the assertion
func (*Assertion) GetSubjectZone ¶
GetSubjectZone returns the zone of the assertion
func (*Assertion) Hash ¶
Hash returns a string containing all information uniquely identifying an assertion.
func (*Assertion) IsConsistent ¶
IsConsistent returns true. Assertion is always consistent.
func (*Assertion) MarshalCBOR ¶
func (a *Assertion) MarshalCBOR(w *cbor.CBORWriter) error
MarshalCBOR implements the CBORMarshaler interface.
func (*Assertion) NeededKeys ¶
NeededKeys adds to keysNeeded key meta data which is necessary to verify all a's signatures.
func (*Assertion) RemoveContextAndSubjectZone ¶
func (a *Assertion) RemoveContextAndSubjectZone()
func (*Assertion) SetContext ¶
func (*Assertion) SetSubjectZone ¶
func (*Assertion) SetValidSince ¶
SetValidSince sets the validSince time
func (*Assertion) SetValidUntil ¶
SetValidUntil sets the validUntil time
func (*Assertion) Sigs ¶
func (a *Assertion) Sigs(keySpace keys.KeySpaceID) []signature.Sig
Sigs returns a's signatures in keyspace
func (*Assertion) Sort ¶
func (a *Assertion) Sort()
Sort sorts the content of the assertion lexicographically.
func (*Assertion) UnmarshalMap ¶
UnmarshalMap provides functionality to unmarshal a map read in by CBOR.
func (*Assertion) UpdateValidity ¶
UpdateValidity updates the validity of this assertion if the validity period is extended. It makes sure that the validity is never larger than maxValidity
func (*Assertion) ValidSince ¶
ValidSince returns the earliest validSince date of all contained signatures
func (*Assertion) ValidUntil ¶
ValidUntil returns the latest validUntil date of all contained signatures
type BloomFilter ¶
type BloomFilter struct { Algorithm BloomFilterAlgo Hash algorithmTypes.Hash Filter bitarray.BitArray }
BloomFilter is a probabilistic datastructure for membership queries.
func GetBloomFilter ¶
func GetBloomFilter() BloomFilter
Datastructure returns a datastructure object with valid content
func (BloomFilter) Add ¶
func (b BloomFilter) Add(name, zone, context string, t object.Type) error
Add sets the corresponding bits to 1 in the bloom filter based on BloomFilterAlgo and the hash function defined in b.
func (BloomFilter) CompareTo ¶
func (b BloomFilter) CompareTo(bloomFilter BloomFilter) int
CompareTo compares two BloomFilters and returns 0 if they are equal, 1 if b is greater than bloomFilter and -1 if b is smaller than bloomFilter
func (BloomFilter) Contains ¶
Contains returns true if a might be part of the set represented by the bloom filter. It returns false if a is certainly not part of the set.
func (BloomFilter) MarshalCBOR ¶
func (b BloomFilter) MarshalCBOR(w *cbor.CBORWriter) error
MarshalCBOR implements a CBORMarshaler.
func (*BloomFilter) UnmarshalArray ¶
func (b *BloomFilter) UnmarshalArray(in []interface{}) error
UnmarshalArray takes in a CBOR decoded array and populates the object.
type BloomFilterAlgo ¶
type BloomFilterAlgo int
BloomFilterAlgo enumerates several ways how to add an assertion to the bloom filter.
const ( BloomKM12 BloomFilterAlgo = iota + 1 BloomKM16 BloomKM20 BloomKM24 )
func (BloomFilterAlgo) MarshalJSON ¶
func (r BloomFilterAlgo) MarshalJSON() ([]byte, error)
MarshalJSON is generated so BloomFilterAlgo satisfies json.Marshaler.
func (BloomFilterAlgo) NumberOfHashes ¶
func (b BloomFilterAlgo) NumberOfHashes() int
NumberOfHashes determines how many bits in the bloom filter are set in an addition and checked on a lookup.
func (BloomFilterAlgo) String ¶
func (i BloomFilterAlgo) String() string
func (*BloomFilterAlgo) UnmarshalJSON ¶
func (r *BloomFilterAlgo) UnmarshalJSON(data []byte) error
UnmarshalJSON is generated so BloomFilterAlgo satisfies json.Unmarshaler.
type Hasher ¶
type Hasher interface { //Hash must return a string uniquely identifying the object //It must hold for all objects that o1 == o2 iff o1.Hash() == o2.Hash() Hash() string }
Hasher can be implemented by objects that are not natively hashable. For an object to be a map key (or a part thereof), it must be hashable.
type Interval ¶
type Interval interface { //Begin of the interval Begin() string //End of the interval End() string }
Interval defines an interval over strings
type Notification ¶
type Notification struct { Token token.Token Type NotificationType Data string }
Notification contains information about the notification
func GetNotification ¶
func GetNotification() *Notification
Notification returns a notification with all fields set
func NotificationNoData ¶
func NotificationNoData() *Notification
NotificationNoData returns a notification with all fields set except data.
func (*Notification) CompareTo ¶
func (n *Notification) CompareTo(notification *Notification) int
CompareTo compares two notifications and returns 0 if they are equal, 1 if n is greater than notification and -1 if n is smaller than notification
func (*Notification) MarshalCBOR ¶
func (n *Notification) MarshalCBOR(w *cbor.CBORWriter) error
MarshalCBOR implements the CBORMarshaler interface.
func (*Notification) Sort ¶
func (n *Notification) Sort()
Sort sorts the content of the notification lexicographically.
func (*Notification) String ¶
func (n *Notification) String() string
String implements Stringer interface
func (*Notification) UnmarshalMap ¶
func (n *Notification) UnmarshalMap(m map[int]interface{}) error
UnmarshalMap unpacks a CBOR unmarshaled map to this object.
type NotificationType ¶
type NotificationType int
NotificationType defines the type of a notification section
const ( NTHeartbeat NotificationType = 100 NTCapHashNotKnown NotificationType = 399 NTBadMessage NotificationType = 400 NTRcvInconsistentMsg NotificationType = 403 NTNoAssertionsExist NotificationType = 404 NTMsgTooLarge NotificationType = 413 NTUnspecServerErr NotificationType = 500 NTServerNotCapable NotificationType = 501 NTNoAssertionAvail NotificationType = 504 )
func (NotificationType) String ¶
func (i NotificationType) String() string
type Pshard ¶
type Pshard struct { Signatures []signature.Sig SubjectZone string Context string RangeFrom string RangeTo string BloomFilter BloomFilter // contains filtered or unexported fields }
Pshard contains information about a pshard
func GetPshard ¶
func GetPshard() *Pshard
GetPshard returns a shard containing an assertion with all object types that is valid.
func (*Pshard) AddAssertion ¶
AddAssertion adds a to the s' Bloom filter. An error is returned, if a is not within s' range or if they have a different context or zone.
func (*Pshard) AddSigInMarshaller ¶
func (s *Pshard) AddSigInMarshaller()
func (*Pshard) CompareTo ¶
CompareTo compares two pshards and returns 0 if they are equal, 1 if s is greater than pshard and -1 if s is smaller than pshard
func (*Pshard) Copy ¶
Copy creates a copy of the shard with the given context and subjectZone values. The contained assertions are not modified
func (*Pshard) DontAddSigInMarshaller ¶
func (s *Pshard) DontAddSigInMarshaller()
func (*Pshard) GetContext ¶
GetContext returns the context of the pshard
func (*Pshard) GetSubjectZone ¶
GetSubjectZone returns the zone of the pshard
func (*Pshard) Hash ¶
Hash returns a string containing all information uniquely identifying a pshard.
func (*Pshard) IsConsistent ¶
IsConsistent returns true if all contained assertions have no subjectZone and context and are within the shards range.
func (*Pshard) IsNonexistent ¶
IsNonexistent returns true if all types of q do not exist. An error is returned, when q is not within the pshard's range or if its context and zone does not match the pshard.
func (*Pshard) MarshalCBOR ¶
func (s *Pshard) MarshalCBOR(w *cbor.CBORWriter) error
func (*Pshard) NeededKeys ¶
NeededKeys adds to keysNeeded key meta data which is necessary to verify all s's signatures.
func (*Pshard) SetValidSince ¶
SetValidSince sets the validSince time
func (*Pshard) SetValidUntil ¶
SetValidUntil sets the validUntil time
func (*Pshard) Sigs ¶
func (s *Pshard) Sigs(keySpace keys.KeySpaceID) []signature.Sig
Sigs returns s's signatures in keyspace
func (*Pshard) Sort ¶
func (s *Pshard) Sort()
Sort sorts the content of the pshard lexicographically.
func (*Pshard) UnmarshalMap ¶
UnmarshalMap decodes the output from the CBOR decoder into this struct.
func (*Pshard) UpdateValidity ¶
UpdateValidity updates the validity of this pshard if the validity period is extended. It makes sure that the validity is never larger than maxValidity
func (*Pshard) ValidSince ¶
ValidSince returns the earliest validSince date of all contained signatures
func (*Pshard) ValidUntil ¶
ValidUntil returns the latest validUntil date of all contained signatures
type Query ¶
Query is the interface for a query section. In the current implementation it can be a query or an addressQuery
type Section ¶
type Section interface { Sort() String() string MarshalCBOR(w *cbor.CBORWriter) error UnmarshalMap(m map[int]interface{}) error }
Section can be either an Assertion, Shard, Zone, Query, Notification, AddressAssertion, AddressZone, AddressQuery section
type Shard ¶
type Shard struct { Signatures []signature.Sig SubjectZone string Context string RangeFrom string RangeTo string Content []*Assertion // contains filtered or unexported fields }
Shard contains information about the shard
func GetShard ¶
func GetShard() *Shard
GetShard returns a shard containing an assertion with all object types that is valid.
func (*Shard) AddCtxAndZoneToContent ¶
func (s *Shard) AddCtxAndZoneToContent()
func (*Shard) AddSigInMarshaller ¶
func (s *Shard) AddSigInMarshaller()
func (*Shard) CompareTo ¶
CompareTo compares two shards and returns 0 if they are equal, 1 if s is greater than shard and -1 if s is smaller than shard
func (*Shard) Copy ¶
Copy creates a copy of the shard with the given context and subjectZone values. The contained assertions are not modified
func (*Shard) DontAddSigInMarshaller ¶
func (s *Shard) DontAddSigInMarshaller()
func (*Shard) GetContext ¶
GetContext returns the context of the shard
func (*Shard) GetSubjectZone ¶
GetSubjectZone returns the zone of the shard
func (*Shard) IsConsistent ¶
IsConsistent returns true if all contained assertions have no subjectZone and context and are within the shards range.
func (*Shard) MarshalCBOR ¶
func (s *Shard) MarshalCBOR(w *cbor.CBORWriter) error
MarshalCBOR implements the CBORMarshaler interface.
func (*Shard) NeededKeys ¶
NeededKeys adds to keysNeeded key meta data which is necessary to verify all s's signatures.
func (*Shard) RemoveCtxAndZoneFromContent ¶
func (s *Shard) RemoveCtxAndZoneFromContent()
func (*Shard) SetValidSince ¶
SetValidSince sets the validSince time
func (*Shard) SetValidUntil ¶
SetValidUntil sets the validUntil time
func (*Shard) Sigs ¶
func (s *Shard) Sigs(keySpace keys.KeySpaceID) []signature.Sig
Sigs returns s's signatures in keyspace
func (*Shard) UnmarshalMap ¶
UnmarshalMap converts a CBOR decoded map to this Shard.
func (*Shard) UpdateValidity ¶
UpdateValidity updates the validity of this shard if the validity period is extended. It makes sure that the validity is never larger than maxValidity
func (*Shard) ValidSince ¶
ValidSince returns the earliest validSince date of all contained signatures
func (*Shard) ValidUntil ¶
ValidUntil returns the latest validUntil date of all contained signatures
type StringInterval ¶
type StringInterval struct {
Name string
}
StringInterval implements Interval for a single string value
func (StringInterval) Begin ¶
func (s StringInterval) Begin() string
Begin defines the start of a StringInterval namespace
func (StringInterval) End ¶
func (s StringInterval) End() string
End defines the end of a StringInterval namespace
type TotalInterval ¶
type TotalInterval struct{}
TotalInterval is an interval over the whole namespace
func (TotalInterval) Begin ¶
func (t TotalInterval) Begin() string
Begin defines the start of the total namespace
func (TotalInterval) End ¶
func (t TotalInterval) End() string
End defines the end of the total namespace
type WithSig ¶
type WithSig interface { Section AllSigs() []signature.Sig Sigs(keyspace keys.KeySpaceID) []signature.Sig AddSig(sig signature.Sig) DeleteSig(index int) DeleteAllSigs() GetContext() string GetSubjectZone() string UpdateValidity(validSince, validUntil int64, maxValidity time.Duration) ValidSince() int64 SetValidSince(int64) ValidUntil() int64 SetValidUntil(int64) Hash() string IsConsistent() bool NeededKeys(map[signature.MetaData]bool) AddSigInMarshaller() DontAddSigInMarshaller() }
WithSig is an interface for a section protected by a signature. In the current implementation it can be an Assertion, Shard, Zone, AddressAssertion, AddressZone
type WithSigForward ¶
WithSigForward can be either an Assertion, Shard or Zone
type Zone ¶
type Zone struct { Signatures []signature.Sig SubjectZone string Context string Content []*Assertion // contains filtered or unexported fields }
Zone contains information about the zone
func GetZone ¶
func GetZone() *Zone
GetZone returns an zone containing a shard, assertion with all object types and a pshard. The zone is valid.
func (*Zone) AddCtxAndZoneToContent ¶
func (z *Zone) AddCtxAndZoneToContent()
func (*Zone) AddSigInMarshaller ¶
func (z *Zone) AddSigInMarshaller()
func (*Zone) CompareTo ¶
CompareTo compares two zones and returns 0 if they are equal, 1 if z is greater than zone and -1 if z is smaller than zone
func (*Zone) DontAddSigInMarshaller ¶
func (z *Zone) DontAddSigInMarshaller()
func (*Zone) GetContext ¶
GetContext returns the context of the zone
func (*Zone) GetSubjectZone ¶
GetSubjectZone returns the zone of the zone
func (*Zone) IsConsistent ¶
IsConsistent returns true if all contained assertions and shards are consistent
func (*Zone) MarshalCBOR ¶
func (z *Zone) MarshalCBOR(w *cbor.CBORWriter) error
MarshalCBOR implements the CBORMarshaler interface.
func (*Zone) NeededKeys ¶
NeededKeys adds to keysNeeded key meta data which is necessary to verify all z's signatures.
func (*Zone) RemoveCtxAndZoneFromContent ¶
func (z *Zone) RemoveCtxAndZoneFromContent()
func (*Zone) SetValidSince ¶
SetValidSince sets the validSince time
func (*Zone) SetValidUntil ¶
SetValidUntil sets the validUntil time
func (*Zone) Sigs ¶
func (z *Zone) Sigs(keySpace keys.KeySpaceID) []signature.Sig
Sigs returns z's signatures in keyspace
func (*Zone) UnmarshalMap ¶
UnmarshalMap decodes the output from the CBOR decoder into this struct.
func (*Zone) UpdateValidity ¶
UpdateValidity updates the validity of this zone if the validity period is extended. It makes sure that the validity is never larger than maxValidity
func (*Zone) ValidSince ¶
ValidSince returns the earliest validSince date of all contained signatures
func (*Zone) ValidUntil ¶
ValidUntil returns the latest validUntil date of all contained signatures