custmsg

package
v0.3.1-beholder Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Labeler

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

func NewLabeler

func NewLabeler() Labeler

func (Labeler) Emit

func (l Labeler) Emit(ctx context.Context, msg string) error

func (Labeler) Labels

func (l Labeler) Labels() map[string]string

func (Labeler) SendLogAsCustomMessage

func (l Labeler) SendLogAsCustomMessage(ctx context.Context, msg string) error

SendLogAsCustomMessage emits a BaseMessage With msg and labels as data. any key in labels that is not part of orderedLabelKeys will not be transmitted

func (Labeler) With

func (l Labeler) With(keyValues ...string) MessageEmitter

With adds multiple key-value pairs to the CustomMessageLabeler for transmission With SendLogAsCustomMessage

func (Labeler) WithMapLabels

func (l Labeler) WithMapLabels(labels map[string]string) MessageEmitter

WithMapLabels adds multiple key-value pairs to the CustomMessageLabeler for transmission With SendLogAsCustomMessage

type MessageEmitter

type MessageEmitter interface {
	// Emit sends a message to the labeler's destination.
	Emit(context.Context, string) error

	// WithMapLabels sets the labels for the message to be emitted.  Labels are cumulative.
	WithMapLabels(map[string]string) MessageEmitter

	// With adds multiple key-value pairs to the emission.
	With(keyValues ...string) MessageEmitter

	// Labels returns a view of the current labels.
	Labels() map[string]string
}

Jump to

Keyboard shortcuts

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