config

package
v0.0.0-...-d1034c5 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2016 License: BSD-2-Clause Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ServiceConfig struct {
	Server           string  `name:"server" short:"s" description:"Nexus [tcp|ssl|ws|wss]://host[:port]"`
	User             string  `name:"user" short:"u" description:"Nexus username"`
	Password         string  `name:"pass" short:"p" description:"Nexus password"`
	Prefix           string  `name:"prefix" description:"Nexus listen prefix"`
	Pulls            int     `name:"pulls" description:"Number of concurrent nexus task pulls" default:"1"`
	PullTimeout      float64 `name:"pull-timeout" description:"Timeout for a nexus task to be pulled" default:"3600"`
	MaxThreads       int     `name:"max-threads" description:"Maximum number of threads running concurrently" default:"-1"`
	StatsPeriod      float64 `name:"stats-period" description:"Period in seconds for the service stats to be printed if debug is enabled" default:"300"`
	GracefulExitTime float64 `name:"graceful-exit" description:"Timeout for a graceful exit" default:"20"`
	LogLevel         string  `name:"log-level" description:"Log level (debug, info, warn, error, fatal, panic)" default:"info"`
}

Functions

func AddFlags

func AddFlags(category string, config interface{})

func Err

func Err() error

func NewService

func NewService() (*service.Service, error)

NewService creates a new nexus service from config If the config hasn't been parsed, it will be automatically parsed and return any error

func Parse

func Parse() error

func Parsed

func Parsed() bool

func SetAppName

func SetAppName(name string)

func SetEnvPrefix

func SetEnvPrefix(prefix string)

func SetFileName

func SetFileName(name string)

func SetFilePaths

func SetFilePaths(paths ...string)

Types

type Cfgo

type Cfgo struct {
	Name      string
	EnvPrefix string
	FileName  string
	FilePaths []string
	// contains filtered or unexported fields
}
var Config *Cfgo

type DefaultValue

type DefaultValue struct {
	Value string
}

type Flag

type Flag struct {
	Name        string
	Short       string
	Category    string
	Description string
	Default     *DefaultValue
	Value       reflect.Value
	// contains filtered or unexported fields
}

func (*Flag) CmdName

func (f *Flag) CmdName() string

func (*Flag) EnvName

func (f *Flag) EnvName() string

func (*Flag) PrintUsage

func (f *Flag) PrintUsage()

Jump to

Keyboard shortcuts

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