policies

package
v0.29.0 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2023 License: MPL-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PolicyData

type PolicyData struct {
	ID                 string
	Datasets           map[string]bool
	GroupIds           map[string]bool
	Name               string
	Backend            string
	Version            int32
	Data               interface{}
	State              PolicyState
	BackendErr         string
	LastScrapeBytes    int64
	LastScrapeTS       time.Time
	PreviousPolicyData *PolicyData
}

func (*PolicyData) GetDatasetIDs

func (d *PolicyData) GetDatasetIDs() []string

type PolicyRepo

type PolicyRepo interface {
	Exists(policyID string) bool
	Get(policyID string) (PolicyData, error)
	Remove(policyID string) error
	Update(data PolicyData) error
	GetAll() ([]PolicyData, error)
	GetByName(policyName string) (PolicyData, error)
	EnsureDataset(policyID string, datasetID string) error
	RemoveDataset(policyID string, datasetID string) (bool, error)
	EnsureGroupID(policyID string, agentGroupID string) error
}

func NewMemRepo

func NewMemRepo(logger *zap.Logger) (PolicyRepo, error)

type PolicyState

type PolicyState int
const (
	Unknown PolicyState = iota
	Running
	FailedToApply
	Offline
	NoTapMatch
)

func (*PolicyState) Scan

func (s *PolicyState) Scan(value interface{}) error

func (PolicyState) String

func (s PolicyState) String() string

func (PolicyState) Value

func (s PolicyState) Value() (driver.Value, error)

Jump to

Keyboard shortcuts

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