sync

package
v0.0.0-...-e99c6c0 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2026 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InsertionPosition

func InsertionPosition(snapshot filter.Snapshot, desiredMarkers []string, targetMarker string) (int64, bool)

func ManagedOrderDrift

func ManagedOrderDrift(snapshot filter.Snapshot, desiredMarkers []string) (map[string]struct{}, bool)

func NextManagedOrderChange

func NextManagedOrderChange(snapshot filter.Snapshot, desiredMarkers []string) (string, int, bool, error)

func ObservedByMarker

func ObservedByMarker(snapshot filter.Snapshot, marker string) (filter.ObservedRule, int, bool)

func ObservedRule

func ObservedRule(observed filter.ObservedRule) filter.FirewallRule

func ReasonMessage

func ReasonMessage(code ReasonCode) string

func StatesEqual

func StatesEqual[T any](left, right []T, key func(T) string) bool

func SupportsManagedOrder

func SupportsManagedOrder(provider filter.Provider) bool

Types

type Desired

type Desired[T any, P any] struct {
	Value   T
	Payload P
	Err     error
}

type Item

type Item[P any] struct {
	Payload    P
	Status     Status
	ReasonCode ReasonCode
	Reason     string
}

func Diff

func Diff[T any, P any](desired []Desired[T, P], actual []T, key func(T) string, actualPayload func(T) P) []Item[P]

type Outcome

type Outcome string
const (
	OutcomeApplied Outcome = "applied"
	OutcomeSkipped Outcome = "skipped"
	OutcomeRemoved Outcome = "removed"
	OutcomeFailed  Outcome = "failed"
)

type ReasonCode

type ReasonCode string
const (
	ReasonInvalidPolicy       ReasonCode = "invalid_policy"
	ReasonAlreadyExists       ReasonCode = "already_exists_in_target"
	ReasonOnlyExistsInTarget  ReasonCode = "only_exists_in_target"
	ReasonManagedOnlyInTarget ReasonCode = "managed_only_exists_in_target"
	ReasonUnsafeRemoval       ReasonCode = "unsafe_managed_rule_removal"
	ReasonReadOnlyRule        ReasonCode = "read_only_rule"
)

type Status

type Status string
const (
	StatusReady    Status = "ready"
	StatusExisting Status = "existing"
	StatusRemove   Status = "remove"
	StatusBlocked  Status = "blocked"
)

Jump to

Keyboard shortcuts

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