internal

package
v2.2.1 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package internal provides some internal functionalities for the library.

Index

Constants

This section is empty.

Variables

This section is empty.

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 Env added in v2.2.0

type Env struct {
	RabbitMQAddr    string `envconfig:"RABBITMQ_ADDR" default:"localhost:5672"`
	RabbitMQUser    string `envconfig:"RABBITMQ_USER" default:"guest"`
	RabbitMQPass    string `envconfig:"RABBITMQ_PASSWORD" default:"guest"`
	RabbitMQVirtual string `envconfig:"RABBITMQ_VH" default:"harego"`
}

Env contains the environment variables required to run the application. nolint:govet // unlikely to have a lot of these objects.

func GetEnv added in v2.2.0

func GetEnv() (*Env, error)

GetEnv returns the environment variables required to run the application.

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