audit

package
v0.0.0-...-d31a008 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PublishEvent

func PublishEvent(e AuditEvent)

PublishEvent method is the only way to publish audit event

Types

type AuditBroadcaster

type AuditBroadcaster struct {
	EventHandlers []AuditEventHandler
}

AuditBroadcaster is only reciever of AuditEvent channel this is broadcast of the event copy to EventHandlers when audit event received

func (*AuditBroadcaster) Start

func (b *AuditBroadcaster) Start()

type AuditEvent

type AuditEvent interface {
	GetMessage() string
	EventAt() time.Time
	GetType() AuditType
}

type AuditEventHandler

type AuditEventHandler interface {
	// Start audit event handler loop
	Start(ch <-chan AuditEvent)
}

AuditEventHandler can processing received audit event

type AuditType

type AuditType string
const (
	AuditTypeCreateKubernetesResource AuditType = "create_k8s_resource"
	AuditTypeRegisterClaim            AuditType = "register_claim"
	AuditTypeAcceptClaim              AuditType = "accept_claim"
	AuditTypeRejectClaim              AuditType = "reject_claim"
	AuditTypeExpireClaim              AuditType = "expire_claim"
	AuditTypeCleanup                  AuditType = "cleanup"
)

AuditType

type KubernetesEventHandler

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

func NewKubernetesEventHandler

func NewKubernetesEventHandler(client kubernetes.Interface) (KubernetesEventHandler, error)

func (*KubernetesEventHandler) Start

func (h *KubernetesEventHandler) Start(event <-chan AuditEvent)

type LogHandler

type LogHandler struct {
	LogWriter io.Writer
}

func NewLogHandler

func NewLogHandler(w io.Writer) *LogHandler

func (*LogHandler) Start

func (h *LogHandler) Start(ch <-chan AuditEvent)

type SlackHandler

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

func NewSlackHandler

func NewSlackHandler() *SlackHandler

func (*SlackHandler) Start

func (h *SlackHandler) Start(event <-chan AuditEvent)

Jump to

Keyboard shortcuts

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