violation

package
v1.6.3 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Event

type Event struct {
	Name string
	UID  string
}

type EventClient

type EventClient interface {
	// Run watches for PolicyViolation Events
	Run(stopper chan struct{}) error
}

EventClient to watch for PolicyViolations in the cluster

type Listener

type Listener = func(PolicyViolation)

type Policy

type Policy struct {
	Name     string
	Rule     string
	Message  string
	Category string
	Severity string
}

type PolicyViolation

type PolicyViolation struct {
	Resource  Resource
	Policy    Policy
	Event     Event
	Timestamp time.Time
	Updated   bool
}

type Publisher

type Publisher struct {
	// contains filtered or unexported fields
}

func NewPublisher

func NewPublisher() *Publisher

NewPublisher constructure for EventPublisher

func (*Publisher) GetListener

func (p *Publisher) GetListener() []Listener

func (*Publisher) Publish

func (p *Publisher) Publish(event PolicyViolation)

func (*Publisher) RegisterListener

func (p *Publisher) RegisterListener(listener Listener)

type Resource

type Resource struct {
	Kind      string
	Name      string
	Namespace string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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