event

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2019 License: Apache-2.0 Imports: 15 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Controller

type Controller interface {
	Generator
	Run(stopCh <-chan struct{})
	Stop()
}

Controller api

func NewEventController

func NewEventController(client *client.Client,
	shareInformer sharedinformer.PolicyInformer) Controller

NewEventController to generate a new event controller

type Generator

type Generator interface {
	Add(infoList ...*Info)
}

Generator to generate event

type Info

type Info struct {
	Kind      string
	Name      string
	Namespace string
	Reason    string
	Message   string
}

Info defines the event details

func NewEvent

func NewEvent(rkind string, rnamespace string, rname string, reason Reason, message MsgKey, args ...interface{}) *Info

NewEvent returns a new event

type MsgKey

type MsgKey int

MsgKey is an identified to determine the preset message formats

const (
	FResourcePolcy MsgKey = iota
	FProcessRule
	SPolicyApply
	SRulesApply
	FPolicyApplyBlockCreate
	FPolicyApplyBlockUpdate
	FPolicyBlockResourceUpdate
)

Message id for pre-defined messages

func (MsgKey) String

func (k MsgKey) String() string

type Reason

type Reason int

Reason types of Event Reasons

const (
	//PolicyViolation there is a violation of policy
	PolicyViolation Reason = iota
	//PolicyApplied policy applied
	PolicyApplied
	//RequestBlocked the request to create/update the resource was blocked( generated from admission-controller)
	RequestBlocked
)

func (Reason) String

func (r Reason) String() string

Jump to

Keyboard shortcuts

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