config

package
v0.0.10 Latest Latest
Warning

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

Go to latest
Published: May 21, 2023 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DebugLevel = (LogLevel)(log.DebugLevel)
	InfoLevel  = (LogLevel)(log.InfoLevel)
	WarnLevel  = (LogLevel)(log.WarnLevel)
	ErrorLevel = (LogLevel)(log.ErrorLevel)
)

Variables

This section is empty.

Functions

func InitConfig

func InitConfig(v *viper.Viper) func()

func LogLevelDecodeHookFunc

func LogLevelDecodeHookFunc() mapstructure.DecodeHookFunc

Types

type CloudbuildOpts

type CloudbuildOpts struct {
	// General options:
	ConfigPath      string   `mapstructure:"config-path"`
	LogLevel        LogLevel `mapstructure:"log-level"`
	HTTPBindAddress net.IP   `mapstructure:"listen-ip"`
	HTTPBindPort    uint16   `mapstructure:"port"`

	// Database options:
	DatabaseDSN  string `mapstructure:"database-dsn"`
	DatabaseHost string `mapstructure:"database-host"`

	// Build options:
	BuildImage       string `mapstructure:"build-img"`
	SourceRepository string `mapstructure:"src-repo"`

	// Storage options:
	DownloadURL            string `mapstructure:"download-url"`
	StorageType            string `mapstructure:"storage-type"`
	StoragePath            string `mapstructure:"storage-path"`
	StorageS3Bucket        string `mapstructure:"s3-bucket"`
	StorageS3URL           string `mapstructure:"s3-url"`
	StorageS3HostImmutable bool   `mapstructure:"s3-url-immutable"`
	StorageS3AccessKey     string `mapstructure:"s3-access-key"`
	StorageS3SecretKey     string `mapstructure:"s3-secret-key"`

	Viper *viper.Viper
}

func NewOpts

func NewOpts(v *viper.Viper) *CloudbuildOpts

func (*CloudbuildOpts) BindAPIOpts

func (o *CloudbuildOpts) BindAPIOpts(c *cobra.Command)

func (*CloudbuildOpts) BindCliOpts

func (o *CloudbuildOpts) BindCliOpts(c *cobra.Command)

func (*CloudbuildOpts) BindDBOpts

func (o *CloudbuildOpts) BindDBOpts(c *cobra.Command)

func (*CloudbuildOpts) BindStorageOpts

func (o *CloudbuildOpts) BindStorageOpts(c *cobra.Command)

func (*CloudbuildOpts) BindWorkerOpts

func (o *CloudbuildOpts) BindWorkerOpts(c *cobra.Command)

func (*CloudbuildOpts) JSON

func (o *CloudbuildOpts) JSON() string

func (*CloudbuildOpts) Unmarshal

func (o *CloudbuildOpts) Unmarshal() error

type LogLevel

type LogLevel log.Level

func (*LogLevel) Level

func (ll *LogLevel) Level() log.Level

func (*LogLevel) Set

func (ll *LogLevel) Set(value string) error

func (*LogLevel) String

func (ll *LogLevel) String() string

func (*LogLevel) Type

func (ll *LogLevel) Type() string

Jump to

Keyboard shortcuts

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