config

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ErrNotReadFile  = ConfigErr("can not read config file")
	ErrNotUnmarshal = ConfigErr("can not unmarshal config data")
)

Variables

This section is empty.

Functions

func ConfigFile

func ConfigFile() string

Types

type Account

type Account struct {
	AuthKey     string `yaml:"auth_key"`
	AccountPlan string `yaml:"account_plan"`
}

type Config

type Config struct {
	Account     Account     `yaml:"account"`
	DefaultLang DefaultLang `yaml:"default_lang"`
}

func LoadConfig

func LoadConfig() *Config

func ParseConfig

func ParseConfig(filepath string) (*Config, error)

func (*Config) AuthKey

func (c *Config) AuthKey() string

func (*Config) BaseURL

func (c *Config) BaseURL() string

func (*Config) DefaultLangs

func (c *Config) DefaultLangs() (string, string)

type ConfigErr

type ConfigErr string

func (ConfigErr) Error

func (c ConfigErr) Error() string

type DefaultLang

type DefaultLang struct {
	SourceLang string `yaml:"source_lang"`
	TargetLang string `yaml:"target_lang"`
}

Jump to

Keyboard shortcuts

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