app

package
v0.0.0-...-91bd612 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidLogFormat = errors.New("unknown log format, valid values are 'text' or 'json'")
	ErrInvalidLogLevel  = errors.New("unknown log level, valid values are 'trace', 'debug', 'info', 'warn', 'error', 'fatal' or 'panic'")
)

Functions

func ConfigureLogger

func ConfigureLogger(cfg LogConfig) error

Types

type Config

type Config struct {
	Port string `default:"8080"`
	Log  LogConfig
}

func ReadConfig

func ReadConfig() (*Config, error)

type Instance

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

func New

func New(config *Config) *Instance

func (*Instance) Start

func (i *Instance) Start(ctx context.Context) error

func (*Instance) Stop

func (i *Instance) Stop(ctx context.Context) error

type LogConfig

type LogConfig struct {
	Level     string `default:"info"`
	Formatter string `default:"json"`
}

Jump to

Keyboard shortcuts

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