Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AppConfig ¶
type AppConfig struct { ShutdownTimeout time.Duration `mapstructure:"shutdown-timeout"` Logging *LoggingConfig `mapstructure:"logging"` Server *ServerConfig `mapstructure:"server"` Router *RouterConfig `mapstructure:"router"` Store *StoreConfig `mapstructure:"store"` Tokenizer *TokenizerConfig `mapstructure:"tokenizer"` }
type BoltStoreConfig ¶
type HashidTokenizerConfig ¶
type LoggingConfig ¶
type LoggingConfig struct { // Path to log output file; empty = os.Stdout FilePath string `mapstructure:"path"` // logging levels: panic, fatal, error, warn / warning, info, debug, trace Level string `mapstructure:"level"` // supported logging formats: text, json Format string `mapstructure:"format"` }
logging:
path: "./log/shurl.log" level: debug format: text
type MemStoreConfig ¶ added in v0.0.2
type MemStoreConfig struct {
FilePath string `mapstructure:"path"`
}
type RouterConfig ¶
type RouterConfig struct {
WebPath string `mapstructure:"web-path"`
}
router:
web-path: "web"
type ServerConfig ¶
type ServerConfig struct { // Address string `mapstructure:"addr"` Host string `mapstructure:"host"` Port int `mapstructure:"port"` Timeout time.Duration `mapstructure:"timeout"` }
server:
addr: "0.0.0.0:8443" timeout: 3s
type StoreConfig ¶
type StoreConfig struct { Bolt *BoltStoreConfig `mapstructure:"bolt"` Mem *MemStoreConfig `mapstructure:"mem"` }
store:
bolt: path: "links.db" timeout: 1s
type TokenizerConfig ¶
type TokenizerConfig struct {
Hashid *HashidTokenizerConfig `mapstructure:"hashid"`
}
tokenizer:
hashid: salt: "ecafbaf0-1bcc-11ec-9621-0242ac130002" min-length: 5 alphabet: "0123456789_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
Click to show internal directories.
Click to hide internal directories.