Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type Backend ¶
type Backend interface {
IsPortGuarded(ctx context.Context, port uint16) (bool, error)
InsertPending(ctx context.Context, ip net.IP, port uint16, window time.Duration) error
Stats(ctx context.Context) (Counters, error)
FlushAuthorizations(ctx context.Context) (FlushResult, error)
// работает только в режиме отладки
VerifyPending(ctx context.Context, ip net.IP, port uint16) error
}
type Counters ¶
type Counters struct {
Allowed uint64 `json:"allowed"`
Dropped uint64 `json:"dropped"`
SYNAllowed uint64 `json:"syn_allowed"`
SYNDropped uint64 `json:"syn_dropped"`
ActiveFlowHits uint64 `json:"active_flow_hits"`
PendingPromotions uint64 `json:"pending_promotions"`
PendingExpiredCleanups uint64 `json:"pending_expired_cleanups"`
IPPortAuthHits uint64 `json:"ip_port_auth_hits"`
NonGuardedPortAllowed uint64 `json:"non_guarded_port_allowed"`
GuardedPortDropped uint64 `json:"guarded_port_dropped"`
}
Counters — “сырые” счетчики из BPF.
type FlushResult ¶ added in v0.0.3
type FlushResult struct {
PendingEntriesRemoved uint64 `json:"pending_entries_removed"`
ActiveFlowsRemoved uint64 `json:"active_flows_removed"`
}
FlushResult описывает, сколько записей, связанных с разрешениями времени выполнения, было удалено.
type RuntimeConfigurator ¶ added in v0.0.3
type RuntimeConfigurator interface {
ConfigureRuntime(backend Backend, window time.Duration) error
}
RuntimeConfigurator updates filter runtime dependencies without recreating use case.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func (*Service) BlockAll ¶ added in v0.0.3
func (s *Service) BlockAll(ctx context.Context) (FlushResult, error)
BlockAll блогирует все активные разрешения выданные в системе.
func (*Service) ConfigureRuntime ¶ added in v0.0.3
ConfigureRuntime заменяет бэкенд и окно, используемые Allow/Stats во время выполнения.
Click to show internal directories.
Click to hide internal directories.