config

package
v0.0.0-...-8da6f21 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2023 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Addr              *string
	ReadHeaderTimeout *time.Duration
	Logger            Logger
	Storage           storage.Storage
	RateLimit         int
}

config is an implementation of the Config interface.

func New

func New() *Config

New returns a new config struct.

type Log

type Log struct {
	*log.Logger
}

Log is a wrapper around log.Logger.

func NewLog

func NewLog() *Log

NewLog returns a new Log using log.New.

func (*Log) Debug

func (l *Log) Debug(msg string, args ...interface{})

Debug logs a debug message.

func (*Log) Error

func (l *Log) Error(msg string, args ...interface{})

Error logs an error message.

func (*Log) Info

func (l *Log) Info(msg string, args ...interface{})

Info logs an info message.

func (*Log) Warn

func (l *Log) Warn(msg string, args ...interface{})

Warn logs a warning message.

type Logger

type Logger interface {
	Debug(string, ...interface{})
	Info(string, ...interface{})
	Warn(string, ...interface{})
	Error(string, ...interface{})
}

Logger is an interface for logging.

type Slog

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

Slog is a wrapper around slog.Logger.

func NewSlog

func NewSlog() *Slog

NewSlog returns a new Slog using slog.NewJSONHandler.

func (*Slog) Debug

func (srv *Slog) Debug(msg string, args ...interface{})

Debug logs a debug message.

func (*Slog) Error

func (srv *Slog) Error(msg string, args ...interface{})

Error logs an error message.

func (*Slog) Info

func (srv *Slog) Info(msg string, args ...interface{})

Info logs an info message.

func (*Slog) Warn

func (srv *Slog) Warn(msg string, args ...interface{})

Warn logs a warning message.

Jump to

Keyboard shortcuts

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