internal

package
v2.1.2 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package internal provides some internal functionalities for the library.

Index

Constants

View Source
const (
	RabbitMQAddrName    = "rabbitmq_addr"
	RabbitMQUserName    = "rabbitmq_user"
	RabbitMQPassName    = "rabbitmq_password"
	RabbitMQVirtualName = "rabbitmq_vh"
)

Argument names.

Variables

View Source
var (
	RabbitMQAddr    string
	RabbitMQUser    string
	RabbitMQPass    string
	RabbitMQVirtual string
)

Environment variables.

Functions

func GetRandomName

func GetRandomName() string

GetRandomName generates a random name from the list of adjectives and surnames in this package formatted as "adjective_surname".

Types

type Sink added in v2.1.0

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

Sink represents a logging implementation to be used with the logr.Logger implementation.

func NewSink added in v2.1.0

func NewSink(l logger) *Sink

NewSink returns a Sink for using as the logr.Logger's sink.

func (*Sink) Enabled added in v2.1.0

func (s *Sink) Enabled(int) bool

Enabled tests whether this LogSink is enabled at the specified V-level. For example, commandline flags might be used to set the logging verbosity and disable some info logs.

func (*Sink) Error added in v2.1.0

func (s *Sink) Error(err error, msg string, kvs ...any)

Error logs an error, with the given message and key/value pairs as context. See Logger.Error for more details.

func (*Sink) Info added in v2.1.0

func (s *Sink) Info(_ int, msg string, kvs ...any)

Info logs a non-error message with the given key/value pairs as context. The level argument is provided for optional logging. This method will only be called when Enabled(level) is true. See Logger.Info for more details.

func (*Sink) Init added in v2.1.0

func (s *Sink) Init(logr.RuntimeInfo)

Init receives optional information about the logr library for LogSink implementations that need it.

func (*Sink) WithName added in v2.1.0

func (s *Sink) WithName(string) logr.LogSink

WithName returns a new LogSink with the specified name appended. See Logger.WithName for more details.

func (*Sink) WithValues added in v2.1.0

func (s *Sink) WithValues(kv ...any) logr.LogSink

WithValues returns a new LogSink with additional key/value pairs. See Logger.WithValues for more details.

Jump to

Keyboard shortcuts

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