recorder

package
v0.2.2-beta Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2021 License: Apache-2.0 Imports: 11 Imported by: 1

Documentation

Overview

Package recorder implements a simple library for sending event to k8s

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EventSink

type EventSink interface {
	record.EventSink
}

EventSink is a simple wrapper

type Logger

type Logger interface {
	Errorf(format string, args ...interface{})
	Infof(format string, args ...interface{})
}

Logger is hmm... for logging.

type NoOpLogger

type NoOpLogger struct{}

NoOpLogger is used when no logger is provided

func (NoOpLogger) Errorf

func (n NoOpLogger) Errorf(format string, args ...interface{})

Errorf does nothing

func (NoOpLogger) Infof

func (n NoOpLogger) Infof(format string, args ...interface{})

Infof does nothing

type SimpleRecorder

type SimpleRecorder struct {
	sync.WaitGroup
	// contains filtered or unexported fields
}

SimpleRecorder is simple goroutine based recorder for events

func New

func New(sink record.EventSink, scheme *runtime.Scheme, source v1.EventSource, lg Logger) *SimpleRecorder

New is a simple constructor for SimpleRecorder

func (*SimpleRecorder) Eventf

func (sr *SimpleRecorder) Eventf(object runtime.Object, eventtype, reason, messageFmt string, args ...interface{})

Eventf generate events with for formatted message

func (*SimpleRecorder) LabeledEventf

func (sr *SimpleRecorder) LabeledEventf(object runtime.Object, labels map[string]string, eventtype, reason, messageFmt string, args ...interface{})

LabeledEventf generate events with for formatted message and labels

Jump to

Keyboard shortcuts

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