utils

package
v0.0.0-...-42acfb7 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

This section is empty.

Types

type Config

type Config struct {
	Dev         bool   `env:"DEV" envDefault:"true"`
	Debug       bool   `env:"DEBUG" envDefault:"true"`
	LogLevel    string `env:"LOG_LEVEL" envDefault:"info"`
	TraceEnable bool   `env:"TRACE_ENABLE" envDefault:"false"`
	TraceUrl    string `env:"TRACE_URL"`
}

func NewConfig

func NewConfig() (*Config, error)

type Logger

type Logger interface {
	Debugf(template string, args ...interface{})
	Debugw(template string, keysAndValues ...interface{})
	Infof(template string, args ...interface{})
	Infow(template string, keysAndValues ...interface{})
	Warnf(template string, args ...interface{})
	Warnw(template string, keysAndValues ...interface{})
	Errorf(template string, args ...interface{})
	Errorw(template string, keysAndValues ...interface{})
}

func NewLogger

func NewLogger(cfg *Config) Logger

type Tracer

type Tracer interface {
	Tracer(name string, options ...oteltrace.TracerOption) oteltrace.Tracer
	SpanFromContext(ctx context.Context) oteltrace.Span
	Enable() bool
}

func NewTracer

func NewTracer(cfg *Config) (Tracer, error)

Jump to

Keyboard shortcuts

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