Documentation
¶
Index ¶
- Constants
- func DeserializeConfig(reader *ByteReader, cfg *Config)
- func DeserializeContributor(reader *ByteReader, contributor *Contributor)
- func DeserializeDevice(reader *ByteReader, dev *Device)
- func DeserializeExchange(reader *ByteReader, exchange *Exchange)
- func DeserializeInterface(reader *ByteReader, iface *Interface)
- func DeserializeInterfaceV1(reader *ByteReader, iface *Interface)
- func DeserializeInterfaceV2(reader *ByteReader, iface *Interface)
- func DeserializeLink(reader *ByteReader, link *Link)
- func DeserializeLocation(reader *ByteReader, loc *Location)
- func DeserializeMulticastGroup(reader *ByteReader, multicastgroup *MulticastGroup)
- func DeserializeProgramConfig(reader *ByteReader, programconfig *ProgramConfig)
- func DeserializeProgramVersion(reader *ByteReader, programversion *ProgramVersion)
- func DeserializeUser(reader *ByteReader, user *User)
- func ToLineProtocol(measurement string, s any, ts time.Time, additionalTags map[string]string) (string, error)
- type AccountType
- type ByteReader
- func (br *ByteReader) ReadF64() float64
- func (br *ByteReader) ReadIPv4() [4]byte
- func (br *ByteReader) ReadIPv4Slice() [][4]byte
- func (br *ByteReader) ReadNetworkV4() [5]byte
- func (br *ByteReader) ReadNetworkV4Slice() [][5]byte
- func (br *ByteReader) ReadPubkey() [32]byte
- func (br *ByteReader) ReadPubkeySlice() [][32]byte
- func (br *ByteReader) ReadString() string
- func (br *ByteReader) ReadU128() Uint128
- func (br *ByteReader) ReadU16() uint16
- func (br *ByteReader) ReadU32() uint32
- func (br *ByteReader) ReadU64() uint64
- func (br *ByteReader) ReadU8() uint8
- func (br *ByteReader) Remaining() uint32
- type Client
- type Config
- type Contributor
- type ContributorStatus
- type CyoaType
- type Device
- type DeviceDeviceType
- type DeviceStatus
- type Exchange
- type ExchangeStatus
- type Interface
- type InterfaceCYOA
- type InterfaceDIA
- type InterfaceStatus
- type InterfaceType
- type Link
- type LinkLinkType
- type LinkStatus
- type Location
- type LocationStatus
- type LoopbackType
- type MulticastGroup
- type MulticastGroupStatus
- type ProgramConfig
- type ProgramData
- type ProgramDataProvider
- type ProgramVersion
- type RPCClient
- type RoutingMode
- type Uint128
- type User
- type UserStatus
- type UserUserType
Constants ¶
View Source
const ( UserTypeIBRL = iota UserTypeIBRLWithAllocatedIP UserTypeEdgeFiltering UserTypeMulticast )
View Source
const CurrentInterfaceVersion = 2
Variables ¶
This section is empty.
Functions ¶
func DeserializeConfig ¶
func DeserializeConfig(reader *ByteReader, cfg *Config)
func DeserializeContributor ¶ added in v0.7.2
func DeserializeContributor(reader *ByteReader, contributor *Contributor)
func DeserializeDevice ¶
func DeserializeDevice(reader *ByteReader, dev *Device)
func DeserializeExchange ¶
func DeserializeExchange(reader *ByteReader, exchange *Exchange)
func DeserializeInterface ¶
func DeserializeInterface(reader *ByteReader, iface *Interface)
func DeserializeInterfaceV1 ¶ added in v0.7.2
func DeserializeInterfaceV1(reader *ByteReader, iface *Interface)
func DeserializeInterfaceV2 ¶ added in v0.7.2
func DeserializeInterfaceV2(reader *ByteReader, iface *Interface)
func DeserializeLink ¶
func DeserializeLink(reader *ByteReader, link *Link)
func DeserializeLocation ¶
func DeserializeLocation(reader *ByteReader, loc *Location)
func DeserializeMulticastGroup ¶
func DeserializeMulticastGroup(reader *ByteReader, multicastgroup *MulticastGroup)
func DeserializeProgramConfig ¶ added in v0.6.3
func DeserializeProgramConfig(reader *ByteReader, programconfig *ProgramConfig)
func DeserializeProgramVersion ¶ added in v0.6.3
func DeserializeProgramVersion(reader *ByteReader, programversion *ProgramVersion)
func DeserializeUser ¶
func DeserializeUser(reader *ByteReader, user *User)
func ToLineProtocol ¶ added in v0.7.2
func ToLineProtocol(measurement string, s any, ts time.Time, additionalTags map[string]string) (string, error)
ToLineProtocol converts a struct to InfluxDB line protocol format via struct tags. The tag format is `influx:"tag|field[,name][,option...]"` where `option` can be `pubkey`, `ip`, or `cidr`:
- The `pubkey` option encodes a [32]byte field as a base58 string.
- The `ip` option formats a [4]uint8 field as a dotted-decimal IP address.
- The `cidr` option formats a slice of [5]uint8 (first 4 bytes are the IP, 5th byte is the mask) as comma-separated list of CIDR strings.
Types ¶
type AccountType ¶
type AccountType uint8
const ( GlobalState AccountType = iota + 1 ConfigType LocationType ExchangeType DeviceType LinkType UserType MulticastGroupType ProgramConfigType ContributorType AccessPassType )
type ByteReader ¶
type ByteReader struct {
// contains filtered or unexported fields
}
func NewByteReader ¶
func NewByteReader(data []byte) *ByteReader
func (*ByteReader) ReadF64 ¶
func (br *ByteReader) ReadF64() float64
func (*ByteReader) ReadIPv4 ¶
func (br *ByteReader) ReadIPv4() [4]byte
func (*ByteReader) ReadIPv4Slice ¶
func (br *ByteReader) ReadIPv4Slice() [][4]byte
func (*ByteReader) ReadNetworkV4 ¶
func (br *ByteReader) ReadNetworkV4() [5]byte
func (*ByteReader) ReadNetworkV4Slice ¶
func (br *ByteReader) ReadNetworkV4Slice() [][5]byte
func (*ByteReader) ReadPubkey ¶
func (br *ByteReader) ReadPubkey() [32]byte
func (*ByteReader) ReadPubkeySlice ¶
func (br *ByteReader) ReadPubkeySlice() [][32]byte
func (*ByteReader) ReadString ¶
func (br *ByteReader) ReadString() string
func (*ByteReader) ReadU128 ¶
func (br *ByteReader) ReadU128() Uint128
func (*ByteReader) ReadU16 ¶
func (br *ByteReader) ReadU16() uint16
func (*ByteReader) ReadU32 ¶
func (br *ByteReader) ReadU32() uint32
func (*ByteReader) ReadU64 ¶
func (br *ByteReader) ReadU64() uint64
func (*ByteReader) ReadU8 ¶
func (br *ByteReader) ReadU8() uint8
func (*ByteReader) Remaining ¶
func (br *ByteReader) Remaining() uint32
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) GetProgramData ¶
func (c *Client) GetProgramData(ctx context.Context) (*ProgramData, error)
type Contributor ¶ added in v0.7.2
type Contributor struct {
AccountType AccountType
Owner [32]uint8 `influx:"tag,owner,pubkey"`
Index Uint128 `influx:"-"`
BumpSeed uint8 `influx:"-"`
Status ContributorStatus `influx:"tag,status"`
Code string `influx:"tag,code"`
Name string `influx:"tag,name"`
ReferenceCount uint32 `influx:"field,reference_count"`
PubKey [32]byte `influx:"tag,pubkey,pubkey"`
}
func (Contributor) MarshalJSON ¶ added in v0.7.2
func (c Contributor) MarshalJSON() ([]byte, error)
type ContributorStatus ¶ added in v0.7.2
type ContributorStatus uint8
const ( ContributorStatusPending ContributorStatus = iota ContributorStatusActivated ContributorStatusSuspended ContributorStatusDeleted )
func (ContributorStatus) MarshalJSON ¶ added in v0.7.2
func (s ContributorStatus) MarshalJSON() ([]byte, error)
func (ContributorStatus) String ¶ added in v0.7.2
func (s ContributorStatus) String() string
type Device ¶
type Device struct {
AccountType AccountType
Owner [32]uint8 `influx:"tag,owner,pubkey"`
Index Uint128 `influx:"-"`
Bump_seed uint8 `influx:"-"`
LocationPubKey [32]uint8 `influx:"tag,location_pubkey,pubkey"`
ExchangePubKey [32]uint8 `influx:"tag,exchange_pubkey,pubkey"`
DeviceType DeviceDeviceType `influx:"tag,device_type"`
PublicIp [4]uint8 `influx:"tag,public_ip,ip"`
Status DeviceStatus `influx:"tag,status"`
Code string `influx:"tag,code"`
DzPrefixes [][5]uint8 `influx:"field,dz_prefixes,cidr"`
MetricsPublisherPubKey [32]uint8 `influx:"tag,metrics_publisher_pubkey,pubkey"`
ContributorPubKey [32]byte `influx:"tag,contributor_pubkey,pubkey"`
MgmtVrf string `influx:"field,mgmt_vrf"`
Interfaces []Interface `influx:"-"`
ReferenceCount uint32 `influx:"field,reference_count"`
UsersCount uint16 `influx:"field,users_count"`
MaxUsers uint16 `influx:"field,max_users"`
PubKey [32]byte `influx:"tag,pubkey,pubkey"`
}
func (Device) MarshalJSON ¶ added in v0.7.2
type DeviceDeviceType ¶ added in v0.7.2
type DeviceDeviceType uint8
const ( DeviceDeviceTypeHybrid DeviceDeviceType = iota DeviceDeviceTypeTransit DeviceDeviceTypeEdge )
func (DeviceDeviceType) String ¶ added in v0.7.2
func (d DeviceDeviceType) String() string
type DeviceStatus ¶
type DeviceStatus uint8
const ( DeviceStatusPending DeviceStatus = iota DeviceStatusActivated DeviceStatusSuspended DeviceStatusDeleted DeviceStatusRejected )
func (DeviceStatus) MarshalJSON ¶ added in v0.7.2
func (d DeviceStatus) MarshalJSON() ([]byte, error)
func (DeviceStatus) String ¶ added in v0.7.2
func (d DeviceStatus) String() string
type Exchange ¶
type Exchange struct {
AccountType AccountType
Owner [32]uint8 `influx:"tag,owner,pubkey"`
Index Uint128 `influx:"-"`
Bump_seed uint8 `influx:"-"`
Lat float64 `influx:"field,lat"`
Lng float64 `influx:"field,lng"`
BgpCommunity uint16 `influx:"field,bgp_community"`
Unused uint16 `influx:"-"`
Status ExchangeStatus `influx:"tag,status"`
Code string `influx:"tag,code"`
Name string `influx:"tag,name"`
PubKey [32]byte `influx:"tag,pubkey,pubkey"`
}
type ExchangeStatus ¶
type ExchangeStatus uint8
const ( ExchangeStatusPending ExchangeStatus = iota ExchangeStatusActivated ExchangeStatusSuspended ExchangeStatusDeleted )
func (ExchangeStatus) String ¶ added in v0.7.2
func (e ExchangeStatus) String() string
type Interface ¶
type Interface struct {
Version uint8
Status InterfaceStatus
Name string
InterfaceType InterfaceType
InterfaceCYOA InterfaceCYOA
InterfaceDIA InterfaceDIA
LoopbackType LoopbackType
Bandwidth uint64
Cir uint64
Mtu uint16
RoutingMode RoutingMode
VlanId uint16
IpNet [5]uint8
NodeSegmentIdx uint16
UserTunnelEndpoint bool
}
func (Interface) MarshalJSON ¶ added in v0.7.2
type InterfaceCYOA ¶ added in v0.7.2
type InterfaceCYOA uint8
const ( InterfaceCYOANone InterfaceCYOA = iota InterfaceCYOAGREOverDIA InterfaceCYOAGREOverFabric InterfaceCYOAGREOverPrivatePeering InterfaceCYOAGREOverPublicPeering InterfaceCYOAGREOverCable )
func (InterfaceCYOA) MarshalJSON ¶ added in v0.7.2
func (l InterfaceCYOA) MarshalJSON() ([]byte, error)
func (InterfaceCYOA) String ¶ added in v0.7.2
func (l InterfaceCYOA) String() string
type InterfaceDIA ¶ added in v0.7.2
type InterfaceDIA uint8
const ( InterfaceDIANone InterfaceDIA = iota InterfaceDIADIA )
func (InterfaceDIA) MarshalJSON ¶ added in v0.7.2
func (l InterfaceDIA) MarshalJSON() ([]byte, error)
func (InterfaceDIA) String ¶ added in v0.7.2
func (l InterfaceDIA) String() string
type InterfaceStatus ¶ added in v0.5.3
type InterfaceStatus uint8
const ( InterfaceStatusInvalid InterfaceStatus = iota InterfaceStatusUnmanaged InterfaceStatusPending InterfaceStatusActivated InterfaceStatusDeleting InterfaceStatusRejecting InterfaceStatusUnlinked )
func (InterfaceStatus) MarshalJSON ¶ added in v0.7.2
func (i InterfaceStatus) MarshalJSON() ([]byte, error)
func (InterfaceStatus) String ¶ added in v0.7.2
func (i InterfaceStatus) String() string
type InterfaceType ¶
type InterfaceType uint8
const ( InterfaceTypeInvalid InterfaceType = iota InterfaceTypeLoopback InterfaceTypePhysical )
func (InterfaceType) MarshalJSON ¶ added in v0.7.2
func (i InterfaceType) MarshalJSON() ([]byte, error)
func (InterfaceType) String ¶ added in v0.7.2
func (i InterfaceType) String() string
type Link ¶
type Link struct {
AccountType AccountType
Owner [32]uint8 `influx:"tag,owner,pubkey"`
Index Uint128 `influx:"-"`
Bump_seed uint8 `influx:"-"`
SideAPubKey [32]uint8 `influx:"tag,side_a_pubkey,pubkey"`
SideZPubKey [32]uint8 `influx:"tag,side_z_pubkey,pubkey"`
LinkType LinkLinkType `influx:"tag,link_type"`
Bandwidth uint64 `influx:"field,bandwidth"`
Mtu uint32 `influx:"field,mtu"`
DelayNs uint64 `influx:"field,delay_ns"`
JitterNs uint64 `influx:"field,jitter_ns"`
TunnelId uint16 `influx:"tag,tunnel_id"`
TunnelNet [5]uint8 `influx:"tag,tunnel_net,cidr"`
Status LinkStatus `influx:"tag,status"`
Code string `influx:"tag,code"`
ContributorPubKey [32]uint8 `influx:"tag,contributor_pubkey,pubkey"`
SideAIfaceName string `influx:"tag,side_a_iface_name"`
SideZIfaceName string `influx:"tag,side_z_iface_name"`
DelayOverrideNs uint64 `influx:"field,delay_override_ns"`
PubKey [32]byte `influx:"tag,pubkey,pubkey"`
}
func (Link) MarshalJSON ¶ added in v0.7.2
type LinkLinkType ¶
type LinkLinkType uint8
const ( LinkLinkTypeWAN LinkLinkType = 1 LinkLinkTypeDZX LinkLinkType = 127 )
func (LinkLinkType) MarshalJSON ¶ added in v0.7.2
func (l LinkLinkType) MarshalJSON() ([]byte, error)
func (LinkLinkType) String ¶ added in v0.7.2
func (l LinkLinkType) String() string
type LinkStatus ¶
type LinkStatus uint8
const ( LinkStatusPending LinkStatus = iota LinkStatusActivated LinkStatusSuspended LinkStatusDeleted LinkStatusRejected LinkStatusRequested LinkStatusHardDrained LinkStatusSoftDrained )
func (LinkStatus) MarshalJSON ¶ added in v0.7.2
func (l LinkStatus) MarshalJSON() ([]byte, error)
func (LinkStatus) String ¶ added in v0.7.2
func (l LinkStatus) String() string
type LocationStatus ¶
type LocationStatus uint8
const ( LocationStatusPending LocationStatus = iota LocationStatusActivated LocationStatusSuspended LocationStatusDeleted )
type LoopbackType ¶
type LoopbackType uint8
const ( LoopbackTypeNone LoopbackType = iota LoopbackTypeVpnv4 LoopbackTypeIpv4 LoopbackTypePimRpAddr LoopbackTypeReserved )
func (LoopbackType) MarshalJSON ¶ added in v0.7.2
func (l LoopbackType) MarshalJSON() ([]byte, error)
func (LoopbackType) String ¶ added in v0.7.2
func (l LoopbackType) String() string
type MulticastGroup ¶
type MulticastGroupStatus ¶
type MulticastGroupStatus uint8
const ( MulticastGroupStatusPending MulticastGroupStatus = iota MulticastGroupStatusActivated MulticastGroupStatusSuspended MulticastGroupStatusDeleted )
type ProgramConfig ¶ added in v0.6.3
type ProgramConfig struct {
AccountType AccountType
BumpSeed uint8
Version ProgramVersion
}
type ProgramData ¶
type ProgramData struct {
Config Config
Locations []Location
Exchanges []Exchange
Contributors []Contributor
Devices []Device
Links []Link
Users []User
MulticastGroups []MulticastGroup
ProgramConfig ProgramConfig
}
type ProgramDataProvider ¶ added in v0.7.2
type ProgramDataProvider interface {
GetProgramData(ctx context.Context) (*ProgramData, error)
}
type ProgramVersion ¶ added in v0.6.3
type RPCClient ¶
type RPCClient interface {
GetProgramAccounts(context.Context, solana.PublicKey) (rpc.GetProgramAccountsResult, error)
}
RPCClient is an interface for interacting with the Solana RPC server.
type RoutingMode ¶ added in v0.7.2
type RoutingMode uint8
const ( RoutingModeStatic RoutingMode = iota RoutingModeBGP )
func (RoutingMode) MarshalJSON ¶ added in v0.7.2
func (l RoutingMode) MarshalJSON() ([]byte, error)
func (RoutingMode) String ¶ added in v0.7.2
func (l RoutingMode) String() string
type User ¶
type User struct {
AccountType AccountType
Owner [32]uint8
Index Uint128
Bump_seed uint8
UserType UserUserType
TenantPubKey [32]uint8
DevicePubKey [32]uint8
CyoaType CyoaType
ClientIp [4]uint8
DzIp [4]uint8
TunnelId uint16
TunnelNet [5]uint8
Status UserStatus
Publishers [][32]uint8
Subscribers [][32]uint8
PubKey [32]byte
}
func (User) MarshalJSON ¶ added in v0.7.2
type UserStatus ¶
type UserStatus uint8
const ( UserStatusPending UserStatus = iota UserStatusActivated UserStatusSuspended UserStatusDeleted UserStatusRejected UserStatusPendingBan UserStatusBanned UserStatusUpdating )
func (UserStatus) MarshalJSON ¶ added in v0.7.2
func (u UserStatus) MarshalJSON() ([]byte, error)
func (UserStatus) String ¶ added in v0.7.2
func (u UserStatus) String() string
type UserUserType ¶
type UserUserType uint8
func (UserUserType) MarshalJSON ¶ added in v0.7.2
func (u UserUserType) MarshalJSON() ([]byte, error)
func (UserUserType) String ¶ added in v0.7.2
func (u UserUserType) String() string
Click to show internal directories.
Click to hide internal directories.