cfg

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Server = newServerConfiguration()

Functions

This section is empty.

Types

type Configuration

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

func New

func New() *Configuration

func (*Configuration) BindStruct

func (c *Configuration) BindStruct(key string, dst any) error

func (*Configuration) Load

func (c *Configuration) Load()

func (*Configuration) MustLoad

func (c *Configuration) MustLoad()

func (*Configuration) Path

func (c *Configuration) Path() string

func (*Configuration) Reload

func (c *Configuration) Reload()

func (*Configuration) SetPath

func (c *Configuration) SetPath(path string)

type ServerConfiguration

type ServerConfiguration struct {
	Configuration

	ListenAddr    string `koanf:"listen_addr"`
	Port          int    `koanf:"port" default:"9000"`
	TimeFormat    string `koanf:"time_format" default:"2006-01-02 15:04:05"`
	LogTimeFormat string `koanf:"log_time_format" default:"2006-01-02 15:04:05.000"`
	WorkDir       string `koanf:"work_dir"`
	Log           string `koanf:"log"`
	AccessLog     string `koanf:"access_log"`
}

func (*ServerConfiguration) DbPath

func (c *ServerConfiguration) DbPath() string

func (*ServerConfiguration) Load

func (c *ServerConfiguration) Load()

func (*ServerConfiguration) MustLoad

func (c *ServerConfiguration) MustLoad()

func (*ServerConfiguration) Reload

func (c *ServerConfiguration) Reload()

Jump to

Keyboard shortcuts

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