Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Attribute ¶
type Attribute byte
Attribute is a byte identifying what aspect of a Subject a Fact describes
type EmptyValue ¶
type EmptyValue struct{}
EmptyValue is used to represent facts of AttributeUnknown with a zero length value, which indicate just that a remote peer is alive and talking to us
func (EmptyValue) Bytes ¶
func (v EmptyValue) Bytes() []byte
Bytes always returns an empty slice for EmptyValue
func (EmptyValue) String ¶
func (v EmptyValue) String() string
type Fact ¶
Fact represents a single piece of information about a subject, with an associated expiration time
func SortedCopy ¶
SortedCopy makes a copy of the list and then sorts it "naturally"
type IPNetValue ¶
IPNetValue represents some IP+Mask as an Attribute of a Subject
func ParseCidrV4 ¶
func ParseCidrV4(data []byte) (*IPNetValue, error)
ParseCidrV4 parses a bytes value as an IPv4 address and CIDR prefix
func ParseCidrV6 ¶
func ParseCidrV6(data []byte) (*IPNetValue, error)
ParseCidrV6 parses a bytes value as an IPv6 address and CIDR prefix
func (IPNetValue) Bytes ¶
func (ipn IPNetValue) Bytes() []byte
Bytes gives the binary representation of the ip and cidr prefix
func (IPNetValue) String ¶
func (ipn IPNetValue) String() string
type IPPortValue ¶
IPPortValue represents an IP:port pair as an Attribute of a Subject
func ParseEndpointV4 ¶
func ParseEndpointV4(data []byte) (*IPPortValue, error)
ParseEndpointV4 parses a bytes value as an IPv4 address and port pair
func ParseEndpointV6 ¶
func ParseEndpointV6(data []byte) (*IPPortValue, error)
ParseEndpointV6 parses a bytes value as an IPv6 address and port pair
func (*IPPortValue) Bytes ¶
func (ipp *IPPortValue) Bytes() []byte
Bytes returns the normalized binary representation
func (*IPPortValue) String ¶
func (ipp *IPPortValue) String() string
type Key ¶
type Key struct {
// contains filtered or unexported fields
}
Key is a comparable version of the subject, attribute, and value of a Fact
type OnWire ¶
type OnWire struct {
// contains filtered or unexported fields
}
OnWire is the intermediate representation of fact packet on the wire
func Deserialize ¶
Deserialize tries to turn a packet from the wire into the intermediate structure
type PeerSubject ¶
PeerSubject is a subject that is a peer identified via its public key
func ParsePeerSubject ¶
func ParsePeerSubject(data []byte) (*PeerSubject, error)
ParsePeerSubject parses bytes from the wire into a peer subject object
func (*PeerSubject) Bytes ¶
func (s *PeerSubject) Bytes() []byte
Bytes gives the binary representation of a peer's public key