nxcli: github.com/jaracil/nxcli/demos/go/sugar/config Index | Files

package config

import "github.com/jaracil/nxcli/demos/go/sugar/config"

Index

Package Files

config.go flag.go util.go

Variables

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"`
}

func AddFlags Uses

func AddFlags(category string, config interface{})

func Err Uses

func Err() error

func NewService Uses

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 Uses

func Parse() error

func Parsed Uses

func Parsed() bool

func SetAppName Uses

func SetAppName(name string)

func SetEnvPrefix Uses

func SetEnvPrefix(prefix string)

func SetFileName Uses

func SetFileName(name string)

func SetFilePaths Uses

func SetFilePaths(paths ...string)

type Cfgo Uses

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

type DefaultValue Uses

type DefaultValue struct {
    Value string
}

type Flag Uses

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

func (*Flag) CmdName Uses

func (f *Flag) CmdName() string

func (*Flag) EnvName Uses

func (f *Flag) EnvName() string

func (*Flag) PrintUsage Uses

func (f *Flag) PrintUsage()

Package config imports 13 packages (graph). Updated 2016-07-21. Refresh now. Tools for package owners. This is an inactive package (no imports and no commits in at least two years).