Documentation ¶
Index ¶
- Constants
- Variables
- func AgentSubject() observer.Subject
- func NewTiedSubj(tied observer.Subject) observer.Subject
- func SetupAgentSubject()
- func SetupContext()
- func SetupDnsResolver(ctx context.Context) error
- func SetupLogger() error
- func SetupMetrics(ctx context.Context) error
- func WhenSetupTelemtryServer(ctx context.Context, f func(*server.APIServer) error) error
- type AgentMetrics
- type AgentSubjectClosed
- type DomainAddressQuerier
- type DomainAddressQuerierCacheWrapper
- type DomainAddresses
- type FqdnRulesStrategy
- type NetlinkError
- type NetlinkEventSource
- type NetlinkUpdates
- type SGClient
- type SyncStatusError
- type SyncStatusEventSource
- type SyncStatusValue
Constants ¶
View Source
const ( // ExitOnSuccess do exit when we succeeded to apply netfilter config; def-val=false ExitOnSuccess config.ValueT[bool] = "exit-on-success" // ContinueOnFailure (default = true) // when 'true' it means if something fails it internally restarts all workloads after some tomeout // when 'false' if something fails the app exits with code 1 ContinueOnFailure config.ValueT[bool] = "continue-on-failure" // ContinueAfterTimeout (default = '10s' ) // if 'continue-on-failure'=true then we use this value to do timeout befor restart ContinueAfterTimeout config.ValueT[time.Duration] = "continue-after-timeout" // AppLoggerLevel log level [optional] AppLoggerLevel config.ValueT[string] = "logger/level" // AppGracefulShutdown [optional] AppGracefulShutdown config.ValueT[time.Duration] = "graceful-schutdown" // NetNS network namespace NetNS config.ValueT[string] = "netns" // NetlinkWatcherLinger netlingk watched linger duration, min(1s) NetlinkWatcherLinger config.ValueT[time.Duration] = "netlink/watcher/linger" // BaseRulesOutNets represents always list open networks for outgoing requests BaseRulesOutNets config.ValueT[[]config.NetCIDR] = "base-rules/networks" // FqdnStrategy use strategy to build SG-FQDN rules (DNS|NDPI|Combine); DNS is default FqdnStrategy config.ValueT[FqdnRulesStrategy] = "fqdn-rules/strategy" // DnsNameservers IP list of trusted nameservers; default = ["8.8.8.8"] DnsNameservers config.ValueT[[]config.IP] = "dns/nameservers" // DnsProto tcp or udp protp we shoud use; default = udp DnsProto config.ValueT[string] = "dns/proto" // DnsPort use port to ask nameserver(s); default = 53 DnsPort config.ValueT[uint16] = "dns/port" // DnsRetries on failure retries count; default=3 DnsRetries config.ValueT[uint8] = "dns/retries" // DnsRetriesTmo timeout before retry; default=1s DnsRetriesTmo config.ValueT[time.Duration] = "dns/retry-timeout" // DnsDialDuration dial max duration; default = 3s DnsDialDuration config.ValueT[time.Duration] = "dns/dial-duration" // DnsWriteDuration packet write max duration; default = 5s DnsWriteDuration config.ValueT[time.Duration] = "dns/write-duration" // DnsReadDuration response wait+read max duration; default = 5s DnsReadDuration config.ValueT[time.Duration] = "dns/read-duration" // ServicesDefDialDuration default dial duraton to conect a service [optional] ServicesDefDialDuration config.ValueT[time.Duration] = "extapi/svc/def-daial-duration" //SGroupsAddress service address [mandatory] SGroupsAddress config.ValueT[string] = "extapi/svc/sgroups/address" //SGroupsDialDuration sgroups service dial duration [optional] SGroupsDialDuration config.ValueT[time.Duration] = "extapi/svc/sgroups/dial-duration" //SGroupsSyncStatusInterval interval(duration) backend 'sync-status' check [mandatory] SGroupsSyncStatusInterval config.ValueT[time.Duration] = "extapi/svc/sgroups/sync-status/interval" //SGroupsSyncStatusPush use push model of 'sync-status' SGroupsSyncStatusPush config.ValueT[bool] = "extapi/svc/sgroups/sync-status/push" // TelemetryEndpoint server endpoint TelemetryEndpoint config.ValueT[string] = "telemetry/endpoint" // MetricsEnable enable api metrics MetricsEnable config.ValueT[bool] = "telemetry/metrics/enable" // HealthcheckEnable enables|disables health check handler HealthcheckEnable config.ValueT[bool] = "telemetry/healthcheck/enable" // UserAgent UserAgent config.ValueT[string] = "telemetry/useragent" // ProfileEnable available at /debug/pprof/index ProfileEnable config.ValueT[bool] = "telemetry/profile/enable" )
View Source
const ( // HcSyncStatus - HcSyncStatus hcIndicator = 1 << iota // HcNetConfWatcher - HcNetConfWatcher // HcDnsRefresher - HcDnsRefresher // HcNftApplier - HcNftApplier )
View Source
const ( // ESrcDNS - ESrcDNS = "dns" // ESrcNetWatcher - ESrcNetWatcher = "net-watcher" // ESrcSgBakend - ESrcSgBakend = "sgroups-svc" )
Variables ¶
View Source
var ConfigFile string
ConfigFile file with actual app config
View Source
var ( // ErrDomainAddressQuerierCacheClosed - ErrDomainAddressQuerierCacheClosed = errors.New("dns address querier cache is closed") )
Functions ¶
Types ¶
type AgentMetrics ¶
type AgentMetrics struct {
// contains filtered or unexported fields
}
func (*AgentMetrics) ObserveApplyConfig ¶
func (am *AgentMetrics) ObserveApplyConfig()
ObserveApplyConfig -
func (*AgentMetrics) ObserveError ¶
func (am *AgentMetrics) ObserveError(errSource string)
ObserveError -
type DomainAddressQuerier ¶
type DomainAddressQuerier interface { A(ctx context.Context, domain string) DomainAddresses AAAA(ctx context.Context, domain string) DomainAddresses }
DomainAddressQuerier -
func NewDomainAddressQuerier ¶
func NewDomainAddressQuerier(ctx context.Context) (DomainAddressQuerier, error)
NewDomainAddressQuerier -
type DomainAddressQuerierCacheWrapper ¶
type DomainAddressQuerierCacheWrapper interface { A(ctx context.Context, domain string) DomainAddresses AAAA(ctx context.Context, domain string) DomainAddresses Close() error }
DomainAddressQuerierCacheWrapper -
func NewDomainAddressQuerierCache ¶
func NewDomainAddressQuerierCache(o DomainAddressQuerier) DomainAddressQuerierCacheWrapper
NewDomainAddressQuerierCache -
type DomainAddresses ¶
DomainAddresses -
type FqdnRulesStrategy ¶
type FqdnRulesStrategy string
const ( // FqdnRulesStartegyDNS - FqdnRulesStartegyDNS FqdnRulesStrategy = "dns" // FqdnRulesStartegyNDPI - FqdnRulesStartegyNDPI FqdnRulesStrategy = "ndpi" // FqdnRulesStartegyCombine - FqdnRulesStartegyCombine FqdnRulesStrategy = "combine" )
func (FqdnRulesStrategy) Variants ¶
func (FqdnRulesStrategy) Variants() []FqdnRulesStrategy
Variants -
type NetlinkEventSource ¶
type NetlinkEventSource struct { Subject observer.Subject nl.NetlinkWatcher // contains filtered or unexported fields }
NetlinkEventSource -
type NetlinkUpdates ¶
type NetlinkUpdates struct { Updates []nl.WatcherMsg observer.EventType }
NetlinkUpdates -
type SyncStatusError ¶
SyncStatusError -
type SyncStatusEventSource ¶
type SyncStatusEventSource struct { Subject observer.Subject SGClient SGClient CheckInterval time.Duration UsePushModel bool }
SyncStatusEventSource -
type SyncStatusValue ¶
type SyncStatusValue struct { model.SyncStatus observer.EventType }
SyncStatusValue -
Source Files ¶
Click to show internal directories.
Click to hide internal directories.