option

package
v0.0.0-...-a5bca4c Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2017 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NormalizeBool

func NormalizeBool(value string) (bool, error)

func ParseOption

func ParseOption(arg string, lib *OptionLibrary) (string, bool, error)

Types

type BoolOptions

type BoolOptions struct {
	Opts    OptionMap      `json:"map"`
	Library *OptionLibrary `json:"-"`
}

func NewBoolOptions

func NewBoolOptions(lib *OptionLibrary) *BoolOptions

func (*BoolOptions) Apply

func (o *BoolOptions) Apply(n models.ConfigurationMap, changed ChangedFunc, data interface{}) int

func (*BoolOptions) DeepCopy

func (bo *BoolOptions) DeepCopy() *BoolOptions

func (*BoolOptions) Delete

func (o *BoolOptions) Delete(key string)

func (*BoolOptions) Dump

func (o *BoolOptions) Dump()

func (*BoolOptions) GetFmtList

func (o *BoolOptions) GetFmtList() string

func (*BoolOptions) GetFmtOpt

func (o *BoolOptions) GetFmtOpt(name string) string

GetFmtOpt returns #define name if option exists and is set to true in endpoint's Opts map or #undef name if option does not exist or exists but is set to false

func (*BoolOptions) GetModel

func (bo *BoolOptions) GetModel() *models.Configuration

func (*BoolOptions) InheritDefault

func (o *BoolOptions) InheritDefault(parent *BoolOptions, key string)

func (*BoolOptions) IsEnabled

func (o *BoolOptions) IsEnabled(key string) bool

func (*BoolOptions) Set

func (o *BoolOptions) Set(key string, value bool)

func (*BoolOptions) SetIfUnset

func (o *BoolOptions) SetIfUnset(key string, value bool)

func (*BoolOptions) Validate

func (o *BoolOptions) Validate(n models.ConfigurationMap) error

type ChangedFunc

type ChangedFunc func(key string, value bool, data interface{})

type Option

type Option struct {
	Define      string
	Description string
	Immutable   bool
}

type OptionLibrary

type OptionLibrary map[string]*Option

func (OptionLibrary) Define

func (l OptionLibrary) Define(name string) string

func (OptionLibrary) Lookup

func (l OptionLibrary) Lookup(name string) (string, *Option)

func (OptionLibrary) Validate

func (l OptionLibrary) Validate(name string) error

type OptionMap

type OptionMap map[string]bool

func (OptionMap) DeepCopy

func (om OptionMap) DeepCopy() OptionMap

Jump to

Keyboard shortcuts

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