Documentation
¶
Index ¶
- Constants
- type ConfigApplier
- type ConfigApplyError
- type ConfigApplyErrorDetail
- type ConfigSnapshot
- type HealthResultPayload
- type MetricsPayload
- type MetricsProvider
- type MonitorConfigSnapshot
- type MonitorHealthCheck
- type MonitorHealthTarget
- type NodeRuntime
- type ProtocolVersion
- type RuleConfig
- type RuleTrafficDelta
- type RuleUpstreamConfig
- type RuntimeConfig
- type TargetEndpoint
- type TargetMetricsPayload
- type TargetPriorityBucket
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 ConfigApplyError ¶ added in v0.1.19
type ConfigApplyError struct {
Message string
Errors []ConfigApplyErrorDetail
}
func (ConfigApplyError) Error ¶ added in v0.1.19
func (err ConfigApplyError) Error() string
type ConfigApplyErrorDetail ¶ added in v0.1.19
type ConfigApplyErrorDetail struct {
Code string `json:"code"`
RuleIDs []string `json:"rule_ids"`
Protocol domain.Protocol `json:"protocol"`
ListenIP string `json:"listen_ip"`
Port int `json:"port"`
Message string `json:"message"`
}
func StructuredApplyErrors ¶ added in v0.1.19
func StructuredApplyErrors(err error) []ConfigApplyErrorDetail
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 HealthResultPayload ¶ added in v0.1.19
type HealthResultPayload struct {
HealthCheckID string `json:"health_check_id"`
HealthCheckTargetID string `json:"health_check_target_id"`
TargetID string `json:"target_id"`
Status string `json:"status"`
LatencyMS int `json:"latency_ms,omitempty"`
ErrorMessage string `json:"error_message,omitempty"`
ObservedAt string `json:"observed_at"`
}
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 MonitorConfigSnapshot ¶ added in v0.1.19
type MonitorConfigSnapshot struct {
MonitorID string `json:"monitor_id"`
ConfigVersion int `json:"config_version"`
GeneratedAtUTC string `json:"generated_at"`
HealthChecks []MonitorHealthCheck `json:"health_checks"`
}
type MonitorHealthCheck ¶ added in v0.1.19
type MonitorHealthTarget ¶ added in v0.1.19
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.