Documentation
¶
Index ¶
Constants ¶
View Source
const ( ProtocolMajor = 2 ProtocolMinor = 0 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConfigApplier ¶
type ConfigApplier interface {
Apply(ctx context.Context, snapshot ConfigSnapshot) error
}
type ConfigSnapshot ¶
type ConfigSnapshot struct {
AgentProtocolVersion ProtocolVersion `json:"agent_protocol_version"`
NodeID string `json:"node_id"`
ConfigVersion int `json:"config_version"`
ConfigHash string `json:"config_hash"`
Rules []RuleConfig `json:"rules"`
}
type MetricsPayload ¶
type MetricsPayload struct {
TCPConnections int64 `json:"tcp_connections"`
UDPPacketsPerSecond int64 `json:"udp_packets_per_second"`
BandwidthBps int64 `json:"bandwidth_bps"`
CPUPercent float64 `json:"cpu_percent"`
RAMUsedBytes uint64 `json:"ram_used_bytes"`
RAMTotalBytes uint64 `json:"ram_total_bytes"`
UploadBytes int64 `json:"upload_bytes"`
DownloadBytes int64 `json:"download_bytes"`
UptimeSeconds int64 `json:"uptime_seconds"`
BootTime string `json:"boot_time"`
AppliedConfigVersion int `json:"applied_config_version"`
Targets []TargetMetricsPayload `json:"targets"`
TrafficReportID string `json:"traffic_report_id,omitempty"`
TrafficDeltas []RuleTrafficDelta `json:"traffic_deltas,omitempty"`
}
type MetricsProvider ¶
type MetricsProvider interface {
AgentMetrics() MetricsPayload
}
type NodeRuntime ¶
type NodeRuntime struct {
// contains filtered or unexported fields
}
func NewMonitorRuntime ¶
func NewMonitorRuntime(config RuntimeConfig) *NodeRuntime
func NewNodeRuntime ¶
func NewNodeRuntime(config RuntimeConfig, applier ConfigApplier) *NodeRuntime
type ProtocolVersion ¶
func CurrentProtocolVersion ¶
func CurrentProtocolVersion() ProtocolVersion
func (ProtocolVersion) Accepts ¶
func (server ProtocolVersion) Accepts(agent ProtocolVersion) bool
type RuleConfig ¶
type RuleConfig struct {
ID string `json:"id"`
ConfigVersion int `json:"config_version"`
Enabled bool `json:"enabled"`
ForwardingType domain.ForwardingType `json:"forwarding_type"`
Protocol domain.Protocol `json:"protocol"`
NodeIDs []string `json:"node_ids,omitempty"`
NodeGroupIDs []string `json:"node_group_ids,omitempty"`
ListenIP string `json:"listen_ip"`
Port int `json:"port"`
MatchType string `json:"match_type"`
SNIHostname string `json:"sni_hostname,omitempty"`
ProxyProtocolIn string `json:"proxy_protocol_in"`
ProxyProtocolOut string `json:"proxy_protocol_out"`
Upstream RuleUpstreamConfig `json:"upstream"`
}
type RuleTrafficDelta ¶ added in v0.1.18
type RuleUpstreamConfig ¶
type RuleUpstreamConfig struct {
Type string `json:"type"`
Target *TargetEndpoint `json:"target,omitempty"`
TargetGroup []TargetPriorityBucket `json:"target_group,omitempty"`
}
type RuntimeConfig ¶
type RuntimeConfig struct {
AppName string
ControlPlaneURL string
AgentID string
RegistrationToken string
AgentCredential string
AgentCredentialFile string
ServiceName string
InstallDir string
LogLevel string
// contains filtered or unexported fields
}
func LoadRuntimeConfig ¶
func LoadRuntimeConfig() (RuntimeConfig, error)
func LoadRuntimeConfigFromArgs ¶
func LoadRuntimeConfigFromArgs(args []string) (RuntimeConfig, error)
type TargetEndpoint ¶
type TargetMetricsPayload ¶
type TargetMetricsPayload struct {
RuleID string `json:"rule_id"`
TargetID string `json:"target_id"`
TCPConnections int64 `json:"tcp_connections"`
UDPPacketsPerSecond int64 `json:"udp_packets_per_second"`
BandwidthBps int64 `json:"bandwidth_bps"`
UploadBytes int64 `json:"upload_bytes"`
DownloadBytes int64 `json:"download_bytes"`
LatencyMS int64 `json:"latency_ms"`
}
type TargetPriorityBucket ¶
type TargetPriorityBucket struct {
Priority int `json:"priority"`
Targets []TargetEndpoint `json:"targets"`
}
Click to show internal directories.
Click to hide internal directories.