config

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Addr          string             `yaml:"addr"`
	Debug         bool               `yaml:"debug"`
	BaseURL       string             `yaml:"baseURL"`
	CacheDir      string             `yaml:"cacheDir"`
	ProxyDownload bool               `yaml:"proxyDownload"`
	Github        cache.GithubConfig `yaml:"github"`
}

Config of the server

func Parse

func Parse(fs *flag.FlagSet, args []string) (*Config, error)

Parse parses config from flags and file

func (*Config) CacheURLBase

func (c *Config) CacheURLBase() string

CacheURLBase the public base url for cache dir.

func (*Config) CacheURLPath

func (c *Config) CacheURLPath() string

CacheURLPath the url path of handling cache files.

func (*Config) ParseFile added in v1.0.0

func (c *Config) ParseFile(filename string) error

ParseFile parses config instance from yaml file

func (*Config) Validate added in v1.0.0

func (c *Config) Validate() error

Validate some config items.

Jump to

Keyboard shortcuts

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