Documentation ¶
Index ¶
Constants ¶
const ( Active = Status(iota) Stale NumTypes )
const NO_NDF = "Contacted server does not have an ndf to give"
NO_NDF is a string that the permissioning server responds with when a member of the network requests an NDF from it but the NDF is not yet available.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AddressSpace ¶ added in v0.0.4
type Gateway ¶
type Gateway struct { ID []byte `json:"Id"` Address string TlsCertificate string `json:"Tls_certificate"` Bin region.GeoBin }
Gateway contains the connection and identity information of a gateway on the network.
type NetworkDefinition ¶
type NetworkDefinition struct { Timestamp time.Time Gateways []Gateway Nodes []Node Registration Registration Notification Notification UDB UDB `json:"Udb"` E2E Group `json:"E2e"` CMIX Group `json:"Cmix"` AddressSpace []AddressSpace ClientVersion string // Ids that bypass rate limiting WhitelistedIds []string // Ips that bypass rate limiting WhitelistedIpAddresses []string // Details on how gateways will rate limit clients RateLimits RateLimiting }
NetworkDefinition structure hold connection and network information. It matches the JSON structure generated in Terraform.
func Unmarshal ¶ added in v0.0.4
func Unmarshal(data []byte) (*NetworkDefinition, error)
Unmarshal parses the JSON encoded data and returns the resulting NetworkDefinition.
func (*NetworkDefinition) DeepCopy ¶ added in v0.0.4
func (ndf *NetworkDefinition) DeepCopy() *NetworkDefinition
DeepCopy returns a deep copy of the NDF. Note that this function is intentionally verbose so that tests will fail if this function is not updated when the NetworkDefinition is modified.
func (*NetworkDefinition) Marshal ¶
func (ndf *NetworkDefinition) Marshal() (data []byte, err error)
Marshal returns the JSON encoding of the NDF.
func (*NetworkDefinition) Serialize ¶
func (ndf *NetworkDefinition) Serialize() []byte
Serialize serializes the NetworkDefinition into a byte slice.
func (*NetworkDefinition) StripNdf ¶
func (ndf *NetworkDefinition) StripNdf() *NetworkDefinition
StripNdf returns a stripped down copy of the NetworkDefinition to be used by Clients.
type Node ¶
type Node struct { ID []byte `json:"Id"` Address string TlsCertificate string `json:"Tls_certificate"` Ed25519 []byte Status }
Node contains the connection and identity information of a node on the network.
type Notification ¶
Notification contains the connection information for the notification bot.
type RateLimiting ¶ added in v0.0.4
RateLimiting contains details on how to rate limit clients.
type Registration ¶
type Registration struct { Address string ClientRegistrationAddress string TlsCertificate string `json:"Tls_certificate"` EllipticPubKey string }
Registration contains the connection information for the permissioning server.
type UDB ¶
type UDB struct { ID []byte `json:"Id"` Cert string `json:"Cert"` Address string `json:"Address"` DhPubKey []byte `json:"DhPubKey"` ChannelSigningPubKeyEd25519 []byte `json:"ChannelSigningPubKeyEd25519"` }
UDB contains the ID, public key in PEM format, address, and DH public key for user discovery.