model

package
v0.10.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 30, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package model defines the canonical configuration and operational state types for arca-router. These types are the single source of truth — all input formats (set commands, XML, YAML) are parsed into these types, and all output formats are serialized from them.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RoutingInstanceTableID added in v0.7.0

func RoutingInstanceTableID(name string, instance *RoutingInstance) (uint32, bool, error)

RoutingInstanceTableID derives the base VPP table ID for one routing instance.

func RoutingInstanceTablePlans added in v0.7.0

func RoutingInstanceTablePlans(instances map[string]*RoutingInstance) (map[string]RoutingInstanceTablePlan, error)

RoutingInstanceTablePlans derives VPP table plans for routing instances.

Types

type AddressFamily

type AddressFamily struct {
	Addresses []string `json:"addresses,omitempty"`
}

AddressFamily represents inet or inet6 address configuration.

func (*AddressFamily) Clone

func (a *AddressFamily) Clone() *AddressFamily

Clone returns a deep copy of the address family.

type BFDConfig added in v0.7.0

type BFDConfig struct {
	Profiles map[string]*BFDProfile `json:"profiles,omitempty"`
	Peers    map[string]*BFDPeer    `json:"peers,omitempty"`
}

BFDConfig represents Bidirectional Forwarding Detection configuration.

func (*BFDConfig) Clone added in v0.7.0

func (c *BFDConfig) Clone() *BFDConfig

Clone returns a deep copy of the BFD configuration.

type BFDPeer added in v0.7.0

type BFDPeer struct {
	LocalAddress     string `json:"local-address,omitempty"`
	Interface        string `json:"interface,omitempty"`
	VRF              string `json:"vrf,omitempty"`
	Multihop         bool   `json:"multihop,omitempty"`
	Profile          string `json:"profile,omitempty"`
	DetectMultiplier int    `json:"detect-multiplier,omitempty"`
	ReceiveInterval  int    `json:"receive-interval,omitempty"`
	TransmitInterval int    `json:"transmit-interval,omitempty"`
	EchoMode         bool   `json:"echo-mode,omitempty"`
	PassiveMode      bool   `json:"passive-mode,omitempty"`
	Shutdown         bool   `json:"shutdown,omitempty"`
}

BFDPeer represents one BFD peer session.

type BFDProfile added in v0.7.0

type BFDProfile struct {
	DetectMultiplier int  `json:"detect-multiplier,omitempty"`
	ReceiveInterval  int  `json:"receive-interval,omitempty"`
	TransmitInterval int  `json:"transmit-interval,omitempty"`
	EchoMode         bool `json:"echo-mode,omitempty"`
	PassiveMode      bool `json:"passive-mode,omitempty"`
}

BFDProfile represents reusable BFD timer and mode settings.

type BGPConfig

type BGPConfig struct {
	Groups map[string]*BGPGroup `json:"groups,omitempty"`
}

BGPConfig represents BGP configuration.

func (*BGPConfig) Clone

func (c *BGPConfig) Clone() *BGPConfig

Clone returns a deep copy of the BGP configuration.

type BGPGroup

type BGPGroup struct {
	Type      string                  `json:"type,omitempty"`
	Neighbors map[string]*BGPNeighbor `json:"neighbors,omitempty"`
	Import    string                  `json:"import,omitempty"`
	Export    string                  `json:"export,omitempty"`
}

BGPGroup represents a BGP peer group.

func (*BGPGroup) Clone

func (g *BGPGroup) Clone() *BGPGroup

Clone returns a deep copy of the BGP group.

type BGPNeighbor

type BGPNeighbor struct {
	PeerAS       uint32 `json:"peer-as"`
	Description  string `json:"description,omitempty"`
	LocalAddress string `json:"local-address,omitempty"`
	BFD          bool   `json:"bfd,omitempty"`
	BFDProfile   string `json:"bfd-profile,omitempty"`
}

BGPNeighbor represents a BGP peer.

type BGPPeerState

type BGPPeerState struct {
	PeerAddress    string    `json:"peer-address"`
	PeerAS         uint32    `json:"peer-as"`
	State          string    `json:"state"` // "Established", "Idle", "Connect", etc.
	UptimeSecs     uint64    `json:"uptime-secs,omitempty"`
	PrefixReceived uint32    `json:"prefix-received,omitempty"`
	PrefixSent     uint32    `json:"prefix-sent,omitempty"`
	LastUpdated    time.Time `json:"last-updated,omitempty"`
}

BGPPeerState holds live state for a single BGP peer.

type BGPState

type BGPState struct {
	RouterID  string          `json:"router-id,omitempty"`
	LocalAS   uint32          `json:"local-as,omitempty"`
	Neighbors []*BGPPeerState `json:"neighbors,omitempty"`
}

BGPState holds live BGP state.

type ChassisConfig added in v0.6.0

type ChassisConfig struct {
	Cluster *ClusterConfig `json:"cluster,omitempty"`
}

ChassisConfig holds chassis-level settings.

func (*ChassisConfig) Clone added in v0.6.0

func (c *ChassisConfig) Clone() *ChassisConfig

Clone returns a deep copy of the chassis configuration.

type ClassOfServiceConfig added in v0.6.0

type ClassOfServiceConfig struct {
	ForwardingClasses      map[string]*ForwardingClass       `json:"forwarding-classes,omitempty"`
	TrafficControlProfiles map[string]*TrafficControlProfile `json:"traffic-control-profiles,omitempty"`
	Interfaces             map[string]*CoSInterface          `json:"interfaces,omitempty"`
}

ClassOfServiceConfig represents QoS and traffic-control configuration.

func (*ClassOfServiceConfig) Clone added in v0.6.0

Clone returns a deep copy of the class-of-service configuration.

type ClusterConfig added in v0.6.0

type ClusterConfig struct {
	Enabled bool                    `json:"enabled,omitempty"`
	Nodes   map[string]*ClusterNode `json:"nodes,omitempty"`
	Sync    *ClusterSyncConfig      `json:"sync,omitempty"`
}

ClusterConfig holds multi-chassis clustering settings.

func (*ClusterConfig) Clone added in v0.6.0

func (c *ClusterConfig) Clone() *ClusterConfig

Clone returns a deep copy of the cluster configuration.

type ClusterNode added in v0.6.0

type ClusterNode struct {
	Address  string `json:"address,omitempty"`
	Priority int    `json:"priority,omitempty"`
}

ClusterNode represents one HA cluster node.

type ClusterSyncConfig added in v0.6.0

type ClusterSyncConfig struct {
	Etcd *EtcdSyncConfig `json:"etcd,omitempty"`
}

ClusterSyncConfig holds cluster synchronization settings.

func (*ClusterSyncConfig) Clone added in v0.6.0

Clone returns a deep copy of the cluster sync configuration.

type CoSInterface added in v0.6.0

type CoSInterface struct {
	OutputTrafficControlProfile string `json:"output-traffic-control-profile,omitempty"`
}

CoSInterface binds QoS profiles to interfaces.

type ConfigSnapshot

type ConfigSnapshot struct {
	Version   uint64        `json:"version"`
	Config    *RouterConfig `json:"config"`
	Hash      [32]byte      `json:"hash"`
	Author    string        `json:"author"`
	Message   string        `json:"message,omitempty"`
	CreatedAt time.Time     `json:"created_at"`
}

ConfigSnapshot is an immutable, versioned configuration snapshot.

func NewSnapshot

func NewSnapshot(cfg *RouterConfig, version uint64, author, message string) *ConfigSnapshot

NewSnapshot creates a new ConfigSnapshot from a RouterConfig.

func (*ConfigSnapshot) Clone

func (s *ConfigSnapshot) Clone() *ConfigSnapshot

Clone returns a deep copy of the snapshot.

type EVPNConfig added in v0.8.0

type EVPNConfig struct {
	VNIs map[int]*EVPNVNI `json:"vnis,omitempty"`
}

EVPNConfig represents EVPN/VXLAN overlay configuration.

func (*EVPNConfig) Clone added in v0.8.0

func (c *EVPNConfig) Clone() *EVPNConfig

Clone returns a deep copy of the EVPN configuration.

type EVPNVNI added in v0.8.0

type EVPNVNI struct {
	VNI                int      `json:"vni"`
	Type               string   `json:"type,omitempty"`
	BridgeDomain       string   `json:"bridge-domain,omitempty"`
	VLANID             int      `json:"vlan-id,omitempty"`
	RoutingInstance    string   `json:"routing-instance,omitempty"`
	RouteDistinguisher string   `json:"route-distinguisher,omitempty"`
	VRFTarget          string   `json:"vrf-target,omitempty"`
	VRFTargetImport    []string `json:"vrf-target-import,omitempty"`
	VRFTargetExport    []string `json:"vrf-target-export,omitempty"`
	SourceInterface    string   `json:"source-interface,omitempty"`
	SourceAddress      string   `json:"source-address,omitempty"`
	MulticastGroup     string   `json:"multicast-group,omitempty"`
	RemoteVTEP         string   `json:"remote-vtep,omitempty"`
}

EVPNVNI represents one L2 or L3 VXLAN network identifier.

func (*EVPNVNI) Clone added in v0.8.0

func (v *EVPNVNI) Clone() *EVPNVNI

Clone returns a deep copy of the EVPN VNI configuration.

type EtcdSyncConfig added in v0.6.0

type EtcdSyncConfig struct {
	Endpoints []string `json:"endpoints,omitempty"`
}

EtcdSyncConfig holds etcd-backed synchronization settings.

func (*EtcdSyncConfig) Clone added in v0.6.0

func (c *EtcdSyncConfig) Clone() *EtcdSyncConfig

Clone returns a deep copy of the etcd sync configuration.

type ForwardingClass added in v0.6.0

type ForwardingClass struct {
	Queue int `json:"queue"`
}

ForwardingClass maps a forwarding class to a queue.

type InterfaceConfig

type InterfaceConfig struct {
	Description string        `json:"description,omitempty"`
	Units       map[int]*Unit `json:"units,omitempty"`
}

InterfaceConfig represents a physical or logical interface.

func (*InterfaceConfig) Clone

func (c *InterfaceConfig) Clone() *InterfaceConfig

Clone returns a deep copy of the interface configuration.

type InterfaceCounters

type InterfaceCounters struct {
	RxPackets uint64 `json:"rx-packets"`
	TxPackets uint64 `json:"tx-packets"`
	RxBytes   uint64 `json:"rx-bytes"`
	TxBytes   uint64 `json:"tx-bytes"`
	RxErrors  uint64 `json:"rx-errors"`
	TxErrors  uint64 `json:"tx-errors"`
	Drops     uint64 `json:"drops"`
}

InterfaceCounters holds packet/byte counters for an interface.

type InterfaceQueues added in v0.6.0

type InterfaceQueues struct {
	Rx []InterfaceRxQueue `json:"rx,omitempty"`
	Tx []InterfaceTxQueue `json:"tx,omitempty"`
}

InterfaceQueues holds RX/TX queue placement for an interface.

type InterfaceRxQueue added in v0.6.0

type InterfaceRxQueue struct {
	QueueID  uint32 `json:"queue-id"`
	WorkerID uint32 `json:"worker-id"`
	Mode     string `json:"mode,omitempty"`
}

InterfaceRxQueue maps an RX queue to a VPP worker.

type InterfaceState

type InterfaceState struct {
	Name        string             `json:"name"`
	AdminStatus string             `json:"admin-status"` // "up" | "down"
	OperStatus  string             `json:"oper-status"`  // "up" | "down"
	Speed       uint64             `json:"speed,omitempty"`
	MTU         uint32             `json:"mtu,omitempty"`
	MAC         string             `json:"mac,omitempty"`
	QoSProfile  string             `json:"qos-profile,omitempty"`
	IPv4TableID uint32             `json:"ipv4-table-id,omitempty"`
	IPv6TableID uint32             `json:"ipv6-table-id,omitempty"`
	Counters    *InterfaceCounters `json:"counters,omitempty"`
	Queues      *InterfaceQueues   `json:"queues,omitempty"`
	LastChange  time.Time          `json:"last-change,omitempty"`
}

InterfaceState holds live interface counters and status.

type InterfaceTxQueue added in v0.6.0

type InterfaceTxQueue struct {
	QueueID uint32   `json:"queue-id"`
	Shared  bool     `json:"shared,omitempty"`
	Threads []uint32 `json:"threads,omitempty"`
}

InterfaceTxQueue maps a TX queue to VPP worker threads.

type MPLSConfig added in v0.6.0

type MPLSConfig struct {
	Interfaces []string `json:"interfaces,omitempty"`
}

MPLSConfig represents MPLS forwarding configuration.

func (*MPLSConfig) Clone added in v0.6.0

func (c *MPLSConfig) Clone() *MPLSConfig

Clone returns a deep copy of the MPLS configuration.

type NETCONFSSHConfig

type NETCONFSSHConfig struct {
	Enabled       bool   `json:"enabled,omitempty"`
	EnabledSet    bool   `json:"-"`
	ListenAddress string `json:"listen-address,omitempty"`
	Port          int    `json:"port,omitempty"`
}

NETCONFSSHConfig holds NETCONF SSH settings.

type NETCONFSecurityConfig

type NETCONFSecurityConfig struct {
	SSH *NETCONFSSHConfig `json:"ssh,omitempty"`
}

NETCONFSecurityConfig holds NETCONF server security settings.

func (*NETCONFSecurityConfig) Clone

Clone returns a deep copy of the NETCONF security configuration.

type OSPFArea

type OSPFArea struct {
	Interfaces map[string]*OSPFInterface `json:"interfaces,omitempty"`
}

OSPFArea represents an OSPF area.

func (*OSPFArea) Clone

func (a *OSPFArea) Clone() *OSPFArea

Clone returns a deep copy of the OSPF area.

type OSPFConfig

type OSPFConfig struct {
	RouterID string               `json:"router-id,omitempty"`
	Areas    map[string]*OSPFArea `json:"areas,omitempty"`
}

OSPFConfig represents OSPF configuration.

func (*OSPFConfig) Clone

func (c *OSPFConfig) Clone() *OSPFConfig

Clone returns a deep copy of the OSPF configuration.

type OSPFInterface

type OSPFInterface struct {
	Passive    bool   `json:"passive,omitempty"`
	Metric     int    `json:"metric,omitempty"`
	Priority   *int   `json:"priority,omitempty"`
	BFD        bool   `json:"bfd,omitempty"`
	BFDProfile string `json:"bfd-profile,omitempty"`
}

OSPFInterface represents OSPF per-interface settings.

type OSPFNeighborState

type OSPFNeighborState struct {
	NeighborID string `json:"neighbor-id"`
	Address    string `json:"address"`
	State      string `json:"state"` // "Full", "2-Way", etc.
	Interface  string `json:"interface"`
	AreaID     string `json:"area-id"`
}

OSPFNeighborState holds live state for a single OSPF neighbor.

type OSPFState

type OSPFState struct {
	RouterID  string               `json:"router-id,omitempty"`
	Neighbors []*OSPFNeighborState `json:"neighbors,omitempty"`
}

OSPFState holds live OSPF state.

type OperationalState

type OperationalState struct {
	Interfaces map[string]*InterfaceState `json:"interfaces,omitempty"`
	BGP        *BGPState                  `json:"bgp,omitempty"`
	OSPF       *OSPFState                 `json:"ospf,omitempty"`
	Routes     []*RouteEntry              `json:"routes,omitempty"`
	System     *SystemState               `json:"system,omitempty"`
}

OperationalState holds live state collected from VPP, FRR, and the kernel.

type PolicyActions

type PolicyActions struct {
	Accept          *bool   `json:"accept,omitempty"`
	LocalPreference *uint32 `json:"local-preference,omitempty"`
	Community       string  `json:"community,omitempty"`
}

PolicyActions represents policy actions.

func (*PolicyActions) Clone

func (p *PolicyActions) Clone() *PolicyActions

Clone returns a deep copy of the policy actions.

type PolicyConfig

type PolicyConfig struct {
	PrefixLists      map[string]*PrefixList      `json:"prefix-lists,omitempty"`
	PolicyStatements map[string]*PolicyStatement `json:"policy-statements,omitempty"`
}

PolicyConfig holds policy-options.

func (*PolicyConfig) Clone

func (c *PolicyConfig) Clone() *PolicyConfig

Clone returns a deep copy of the policy configuration.

type PolicyMatchConditions

type PolicyMatchConditions struct {
	PrefixLists []string `json:"prefix-lists,omitempty"`
	Protocol    string   `json:"protocol,omitempty"`
	Neighbor    string   `json:"neighbor,omitempty"`
	ASPath      string   `json:"as-path,omitempty"`
}

PolicyMatchConditions represents match conditions.

func (*PolicyMatchConditions) Clone

Clone returns a deep copy of the policy match conditions.

type PolicyStatement

type PolicyStatement struct {
	Terms []*PolicyTerm `json:"terms,omitempty"`
}

PolicyStatement represents a named policy-statement.

func (*PolicyStatement) Clone

func (p *PolicyStatement) Clone() *PolicyStatement

Clone returns a deep copy of the policy statement.

type PolicyTerm

type PolicyTerm struct {
	Name string                 `json:"name"`
	From *PolicyMatchConditions `json:"from,omitempty"`
	Then *PolicyActions         `json:"then,omitempty"`
}

PolicyTerm represents a single term in a policy-statement.

func (*PolicyTerm) Clone

func (p *PolicyTerm) Clone() *PolicyTerm

Clone returns a deep copy of the policy term.

type PrefixList

type PrefixList struct {
	Prefixes []string `json:"prefixes,omitempty"`
}

PrefixList represents a named prefix-list.

func (*PrefixList) Clone

func (p *PrefixList) Clone() *PrefixList

Clone returns a deep copy of the prefix list.

type PrometheusConfig added in v0.6.0

type PrometheusConfig struct {
	Enabled       bool   `json:"enabled,omitempty"`
	ListenAddress string `json:"listen-address,omitempty"`
	Port          int    `json:"port,omitempty"`
}

PrometheusConfig holds Prometheus metrics service settings.

func (*PrometheusConfig) Clone added in v0.6.0

func (c *PrometheusConfig) Clone() *PrometheusConfig

Clone returns a deep copy of the Prometheus configuration.

type ProtocolsConfig

type ProtocolsConfig struct {
	BFD   *BFDConfig  `json:"bfd,omitempty"`
	BGP   *BGPConfig  `json:"bgp,omitempty"`
	EVPN  *EVPNConfig `json:"evpn,omitempty"`
	OSPF  *OSPFConfig `json:"ospf,omitempty"`
	OSPF3 *OSPFConfig `json:"ospf3,omitempty"`
	MPLS  *MPLSConfig `json:"mpls,omitempty"`
	VRRP  *VRRPConfig `json:"vrrp,omitempty"`
}

ProtocolsConfig holds routing protocol configurations.

func (*ProtocolsConfig) Clone

func (c *ProtocolsConfig) Clone() *ProtocolsConfig

Clone returns a deep copy of the protocol configuration.

type RateLimitConfig

type RateLimitConfig struct {
	PerIP   int `json:"per-ip,omitempty"`
	PerUser int `json:"per-user,omitempty"`
}

RateLimitConfig holds rate limiting settings.

type RouteEntry

type RouteEntry struct {
	Prefix     string `json:"prefix"`
	NextHop    string `json:"next-hop"`
	Protocol   string `json:"protocol"` // "bgp", "ospf", "static", "connected"
	Metric     uint32 `json:"metric,omitempty"`
	Preference uint32 `json:"preference,omitempty"`
	Interface  string `json:"interface,omitempty"`
	Active     bool   `json:"active"`
}

RouteEntry represents a single entry in the routing table.

type RouterConfig

type RouterConfig struct {
	System           *SystemConfig               `json:"system,omitempty"`
	Chassis          *ChassisConfig              `json:"chassis,omitempty"`
	Interfaces       map[string]*InterfaceConfig `json:"interfaces,omitempty"`
	Protocols        *ProtocolsConfig            `json:"protocols,omitempty"`
	Routing          *RoutingConfig              `json:"routing-options,omitempty"`
	RoutingInstances map[string]*RoutingInstance `json:"routing-instances,omitempty"`
	Policy           *PolicyConfig               `json:"policy-options,omitempty"`
	ClassOfService   *ClassOfServiceConfig       `json:"class-of-service,omitempty"`
	Security         *SecurityConfig             `json:"security,omitempty"`
}

RouterConfig represents the complete, normalized router configuration. This is the primary data structure — not text. Diff, merge, and validate operations work directly on this struct.

func FromLegacyConfig

func FromLegacyConfig(old *config.Config) *RouterConfig

FromLegacyConfig converts the legacy pkg/config.Config to the new internal model. This adapter enables incremental migration — existing parsers continue to produce the old type, and this function bridges to the new canonical model.

func NewRouterConfig

func NewRouterConfig() *RouterConfig

NewRouterConfig creates an empty RouterConfig with initialized maps.

func (*RouterConfig) Clone

func (c *RouterConfig) Clone() *RouterConfig

Clone returns a deep copy of the router configuration.

func (*RouterConfig) ResolveRouterID

func (c *RouterConfig) ResolveRouterID(protocol string) string

ResolveRouterID returns the effective router-id for a given protocol, applying the Junos-style fallback: protocol-specific → global routing-options.

func (*RouterConfig) ToLegacyConfig

func (c *RouterConfig) ToLegacyConfig() *config.Config

ToLegacyConfig converts the new internal model back to the legacy pkg/config.Config. This is used during the migration period when some subsystems still expect the old type.

func (*RouterConfig) Validate

func (c *RouterConfig) Validate() error

Validate checks the RouterConfig for semantic correctness.

type RoutingConfig

type RoutingConfig struct {
	AutonomousSystem uint32         `json:"autonomous-system,omitempty"`
	RouterID         string         `json:"router-id,omitempty"`
	StaticRoutes     []*StaticRoute `json:"static-routes,omitempty"`
}

RoutingConfig holds routing options.

func (*RoutingConfig) Clone

func (c *RoutingConfig) Clone() *RoutingConfig

Clone returns a deep copy of the routing configuration.

type RoutingInstance added in v0.6.0

type RoutingInstance struct {
	InstanceType       string   `json:"instance-type,omitempty"`
	RouteDistinguisher string   `json:"route-distinguisher,omitempty"`
	VRFTarget          string   `json:"vrf-target,omitempty"`
	VRFTargetImport    []string `json:"vrf-target-import,omitempty"`
	VRFTargetExport    []string `json:"vrf-target-export,omitempty"`
	VRFImport          []string `json:"vrf-import,omitempty"`
	VRFExport          []string `json:"vrf-export,omitempty"`
	Interfaces         []string `json:"interfaces,omitempty"`
}

RoutingInstance represents a routing instance, initially focused on VRF/L3VPN.

func (*RoutingInstance) Clone added in v0.6.0

func (c *RoutingInstance) Clone() *RoutingInstance

Clone returns a deep copy of the routing instance.

type RoutingInstanceTablePlan added in v0.7.0

type RoutingInstanceTablePlan struct {
	Name       string
	TableID    uint32
	Interfaces []string
}

RoutingInstanceTablePlan describes the deterministic VPP table plan for a routing instance.

type SNMPConfig added in v0.6.0

type SNMPConfig struct {
	Enabled       bool   `json:"enabled,omitempty"`
	ListenAddress string `json:"listen-address,omitempty"`
	Port          int    `json:"port,omitempty"`
	Community     string `json:"community,omitempty"`
}

SNMPConfig holds read-only SNMP service settings.

func (*SNMPConfig) Clone added in v0.6.0

func (c *SNMPConfig) Clone() *SNMPConfig

Clone returns a deep copy of the SNMP configuration.

type SecurityConfig

type SecurityConfig struct {
	NETCONF   *NETCONFSecurityConfig `json:"netconf,omitempty"`
	Users     map[string]*UserConfig `json:"users,omitempty"`
	RateLimit *RateLimitConfig       `json:"rate-limit,omitempty"`
}

SecurityConfig holds security settings.

func (*SecurityConfig) Clone

func (c *SecurityConfig) Clone() *SecurityConfig

Clone returns a deep copy of the security configuration.

type StaticRoute

type StaticRoute struct {
	Prefix      string `json:"prefix"`
	NextHop     string `json:"next-hop"`
	Distance    int    `json:"distance,omitempty"`
	BFD         bool   `json:"bfd,omitempty"`
	BFDProfile  string `json:"bfd-profile,omitempty"`
	BFDSource   string `json:"bfd-source,omitempty"`
	BFDMultihop bool   `json:"bfd-multihop,omitempty"`
}

StaticRoute represents a static route entry.

type SystemConfig

type SystemConfig struct {
	HostName string                `json:"host-name,omitempty"`
	Services *SystemServicesConfig `json:"services,omitempty"`
}

SystemConfig holds system-level settings.

func (*SystemConfig) Clone added in v0.6.0

func (c *SystemConfig) Clone() *SystemConfig

Clone returns a deep copy of the system configuration.

type SystemServicesConfig added in v0.6.0

type SystemServicesConfig struct {
	WebUI      *WebUIConfig      `json:"web-ui,omitempty"`
	Prometheus *PrometheusConfig `json:"prometheus,omitempty"`
	SNMP       *SNMPConfig       `json:"snmp,omitempty"`
}

SystemServicesConfig holds system service settings.

func (*SystemServicesConfig) Clone added in v0.6.0

Clone returns a deep copy of the system services configuration.

type SystemState

type SystemState struct {
	Hostname  string    `json:"hostname"`
	Uptime    uint64    `json:"uptime-secs"`
	StartedAt time.Time `json:"started-at"`
}

SystemState holds live system state.

type TrafficControlProfile added in v0.6.0

type TrafficControlProfile struct {
	ShapingRate  uint64 `json:"shaping-rate,omitempty"`
	SchedulerMap string `json:"scheduler-map,omitempty"`
}

TrafficControlProfile represents shaping and scheduler settings.

type Unit

type Unit struct {
	Family map[string]*AddressFamily `json:"family,omitempty"`
}

Unit represents a logical sub-interface.

func (*Unit) Clone

func (u *Unit) Clone() *Unit

Clone returns a deep copy of the interface unit.

type UserConfig

type UserConfig struct {
	Password string `json:"password,omitempty"`
	Role     string `json:"role,omitempty"`
	SSHKey   string `json:"ssh-key,omitempty"`
}

UserConfig represents a user account.

type VRRPConfig added in v0.6.0

type VRRPConfig struct {
	Groups map[string]*VRRPGroup `json:"groups,omitempty"`
}

VRRPConfig represents VRRP groups.

func (*VRRPConfig) Clone added in v0.6.0

func (c *VRRPConfig) Clone() *VRRPConfig

Clone returns a deep copy of the VRRP configuration.

type VRRPGroup added in v0.6.0

type VRRPGroup struct {
	Interface      string `json:"interface,omitempty"`
	VirtualAddress string `json:"virtual-address,omitempty"`
	Priority       int    `json:"priority,omitempty"`
	Preempt        bool   `json:"preempt,omitempty"`
}

VRRPGroup represents a VRRP group.

type WebUIConfig added in v0.6.0

type WebUIConfig struct {
	Enabled       bool   `json:"enabled,omitempty"`
	ListenAddress string `json:"listen-address,omitempty"`
	Port          int    `json:"port,omitempty"`
}

WebUIConfig holds browser UI service settings.

func (*WebUIConfig) Clone added in v0.6.0

func (c *WebUIConfig) Clone() *WebUIConfig

Clone returns a deep copy of the Web UI configuration.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL