Documentation ¶
Index ¶
- type Labeler
- func (l Labeler) Emit(ctx context.Context, msg string) error
- func (l Labeler) Labels() map[string]string
- func (l Labeler) SendLogAsCustomMessage(ctx context.Context, msg string) error
- func (l Labeler) With(keyValues ...string) MessageEmitter
- func (l Labeler) WithMapLabels(labels map[string]string) MessageEmitter
- type MessageEmitter
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) SendLogAsCustomMessage ¶
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 }
Click to show internal directories.
Click to hide internal directories.