app

package
v0.0.0-...-12cc501 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2024 License: MIT Imports: 16 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
	MemoryStorage MemoryStorageConfig
}

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"`
}

type MemoryStorageConfig

type MemoryStorageConfig struct {
	WorldsFilePath string `default:"init/storage/inmemory/worlds.yml"`
}

Jump to

Keyboard shortcuts

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