config

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultListenAddress = "0.0.0.0:8080"
	DefaultTLS           = false
	DefaultDomain        = "localhost"
	DefaultBinary        = "bin"
)

Variables

View Source
var (
	ErrRepositoryRequired      = errors.New("repository is required")
	ErrRepositoryOwnerRequired = errors.New("repository owner is required")
	ErrHostnameRequired        = errors.New("hostname is required")
	ErrListenAddressRequired   = errors.New("listen address is required")
	ErrDomainRequired          = errors.New("domain is required")
	ErrBinaryRequired          = errors.New("binary is required")
)

Functions

This section is empty.

Types

type Config

type Config struct {
	GithubToken     string `mapstructure:"github_token"`
	Repository      string `mapstructure:"repository"`
	RepositoryOwner string `mapstructure:"repository_owner"`
	Hostname        string `mapstructure:"hostname"`
	ListenAddress   string `mapstructure:"listen_address"`
	TLS             bool   `mapstructure:"tls"`
	Domain          string `mapstructure:"domain"`
	Binary          string `mapstructure:"binary"`
}

Config is dynamically sourced from various files and environment variables.

func New

func New() *Config

func (*Config) DefaultConfigDir

func (c *Config) DefaultConfigDir() (string, error)

func (*Config) DefaultConfigFile

func (c *Config) DefaultConfigFile() string

func (*Config) DefaultConfigPath

func (c *Config) DefaultConfigPath() (string, error)

func (*Config) DefaultLogFile

func (c *Config) DefaultLogFile() string

func (*Config) DefaultLogPath

func (c *Config) DefaultLogPath() (string, error)

func (*Config) GetConfigFile

func (c *Config) GetConfigFile() string

func (*Config) GetLogFile

func (c *Config) GetLogFile() string

func (*Config) GlobalRequiredFlags

func (c *Config) GlobalRequiredFlags(_ *cobra.Command) error

func (*Config) RootPersistentFlags

func (c *Config) RootPersistentFlags(flags *pflag.FlagSet)

func (*Config) SetConfigFile

func (c *Config) SetConfigFile(file string)

func (*Config) SetLogFile

func (c *Config) SetLogFile(file string)

func (*Config) Validate

func (c *Config) Validate() error

Jump to

Keyboard shortcuts

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