config

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadConfig

func LoadConfig(fileName string) (*viper.Viper, error)

Types

type ColorConfig

type ColorConfig struct {
	DefaultBackgroundColor string `mapstructure:"default_background_color"`
	DefaultTextColor       string `mapstructure:"default_text_color"`
}

type Config

type Config struct {
	Server *ServerConfig `mapstructure:"server"`
	Image  *ImageConfig  `mapstructure:"image"`
}

func ParseConfig

func ParseConfig(cfgFile *viper.Viper) (*Config, error)

type ImageConfig

type ImageConfig struct {
	DefaultFormat string       `mapstructure:"default_format"`
	Size          *SizeConfig  `mapstructure:"size"`
	Color         *ColorConfig `mapstructure:"color"`
}

type ServerConfig

type ServerConfig struct {
	Addr string `mapstructure:"addr"`
}

type SizeConfig

type SizeConfig struct {
	MinSize   string `mapstructure:"min_size"`
	MaxSize   string `mapstructure:"max_size"`
	SizeClamp bool   `mapstructure:"size_clamp"`
}

Jump to

Keyboard shortcuts

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