schema

package
v0.0.0-...-7b712e6 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2015 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Copyright 2015 Gravitational, Inc.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2015 Gravitational, Inc.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetParam

func SetParam(p Param, s kingpin.Settings)

Types

type BoolParam

type BoolParam struct {
	// contains filtered or unexported fields
}

func (*BoolParam) Args

func (p *BoolParam) Args() []string

func (*BoolParam) CLIName

func (p *BoolParam) CLIName() string

func (*BoolParam) Check

func (p *BoolParam) Check() string

func (*BoolParam) Default

func (p *BoolParam) Default() string

func (*BoolParam) Description

func (p *BoolParam) Description() string

func (*BoolParam) EnvName

func (p *BoolParam) EnvName() string

func (*BoolParam) EnvVars

func (p *BoolParam) EnvVars() (string, string)

func (*BoolParam) Name

func (p *BoolParam) Name() string

func (*BoolParam) New

func (p *BoolParam) New() Param

func (*BoolParam) Required

func (p *BoolParam) Required() bool

func (*BoolParam) Set

func (p *BoolParam) Set(s string) error

func (*BoolParam) String

func (p *BoolParam) String() string

func (*BoolParam) Vars

func (p *BoolParam) Vars() (string, string)

type Config

type Config struct {
	Params []Param
}

func ParseJSON

func ParseJSON(r io.Reader) (*Config, error)

func ParseVariablesJSON

func ParseVariablesJSON(r io.Reader) (*Config, error)

func (*Config) Args

func (c *Config) Args() []string

func (*Config) EnvVars

func (c *Config) EnvVars() map[string]string

func (*Config) ParseArgs

func (c *Config) ParseArgs(args []string) error

func (*Config) ParseEnv

func (c *Config) ParseEnv() error

func (*Config) ParseVars

func (c *Config) ParseVars(vars map[string]string) error

func (*Config) Vars

func (c *Config) Vars() map[string]string

type EnumParam

type EnumParam struct {
	// contains filtered or unexported fields
}

func (*EnumParam) Args

func (p *EnumParam) Args() []string

func (*EnumParam) CLIName

func (p *EnumParam) CLIName() string

func (*EnumParam) Check

func (p *EnumParam) Check() string

func (*EnumParam) Default

func (p *EnumParam) Default() string

func (*EnumParam) Description

func (p *EnumParam) Description() string

func (*EnumParam) EnvName

func (p *EnumParam) EnvName() string

func (*EnumParam) EnvVars

func (p *EnumParam) EnvVars() (string, string)

func (*EnumParam) Name

func (p *EnumParam) Name() string

func (*EnumParam) New

func (p *EnumParam) New() Param

func (*EnumParam) Required

func (p *EnumParam) Required() bool

func (*EnumParam) Set

func (p *EnumParam) Set(s string) error

func (*EnumParam) String

func (p *EnumParam) String() string

func (*EnumParam) Vars

func (p *EnumParam) Vars() (string, string)

type IntParam

type IntParam struct {
	// contains filtered or unexported fields
}

func (*IntParam) Args

func (p *IntParam) Args() []string

func (*IntParam) CLIName

func (p *IntParam) CLIName() string

func (*IntParam) Check

func (p *IntParam) Check() string

func (*IntParam) Default

func (p *IntParam) Default() string

func (*IntParam) Description

func (p *IntParam) Description() string

func (*IntParam) EnvName

func (p *IntParam) EnvName() string

func (*IntParam) EnvVars

func (p *IntParam) EnvVars() (string, string)

func (*IntParam) Name

func (p *IntParam) Name() string

func (*IntParam) New

func (p *IntParam) New() Param

func (*IntParam) Required

func (p *IntParam) Required() bool

func (*IntParam) Set

func (p *IntParam) Set(s string) error

func (*IntParam) String

func (p *IntParam) String() string

func (*IntParam) Vars

func (p *IntParam) Vars() (string, string)

type KVParam

type KVParam struct {
	// contains filtered or unexported fields
}

func (*KVParam) Args

func (p *KVParam) Args() []string

func (*KVParam) CLIName

func (p *KVParam) CLIName() string

func (*KVParam) Check

func (p *KVParam) Check() string

func (*KVParam) Default

func (p *KVParam) Default() string

func (*KVParam) Description

func (p *KVParam) Description() string

func (*KVParam) EnvName

func (p *KVParam) EnvName() string

func (*KVParam) EnvVars

func (p *KVParam) EnvVars() (string, string)

func (*KVParam) Name

func (p *KVParam) Name() string

func (*KVParam) New

func (p *KVParam) New() Param

func (*KVParam) Required

func (p *KVParam) Required() bool

func (*KVParam) Set

func (p *KVParam) Set(s string) error

func (*KVParam) String

func (p *KVParam) String() string

func (*KVParam) Vars

func (p *KVParam) Vars() (string, string)

type ListParam

type ListParam struct {
	// contains filtered or unexported fields
}

func (*ListParam) Args

func (p *ListParam) Args() []string

func (*ListParam) CLIName

func (p *ListParam) CLIName() string

func (*ListParam) Check

func (p *ListParam) Check() string

func (*ListParam) Default

func (p *ListParam) Default() string

func (*ListParam) Description

func (p *ListParam) Description() string

func (*ListParam) EnvName

func (p *ListParam) EnvName() string

func (*ListParam) EnvVars

func (p *ListParam) EnvVars() (string, string)

func (*ListParam) Name

func (p *ListParam) Name() string

func (*ListParam) New

func (p *ListParam) New() Param

func (*ListParam) Required

func (p *ListParam) Required() bool

func (*ListParam) Set

func (p *ListParam) Set(s string) error

func (*ListParam) String

func (p *ListParam) String() string

func (*ListParam) Vars

func (p *ListParam) Vars() (string, string)

type Param

type Param interface {
	Name() string
	CLIName() string
	Description() string
	Check() string
	Required() bool
	Default() string

	// New returns a new instance of the param identical to this
	New() Param

	// Set is required to set parameters from command line string
	Set(string) error
	// String is required to output value to command line string
	String() string

	// Args returns argument strings in cli format
	Args() []string

	// Values returns a tuple with environment variable name and value
	EnvVars() (string, string)

	// Vars returns a tuple with the variable name and value
	Vars() (string, string)

	EnvName() string
}

type PathParam

type PathParam struct {
	// contains filtered or unexported fields
}

func (*PathParam) Args

func (p *PathParam) Args() []string

func (*PathParam) CLIName

func (p *PathParam) CLIName() string

func (*PathParam) Check

func (p *PathParam) Check() string

func (*PathParam) Default

func (p *PathParam) Default() string

func (*PathParam) Description

func (p *PathParam) Description() string

func (*PathParam) EnvName

func (p *PathParam) EnvName() string

func (*PathParam) EnvVars

func (p *PathParam) EnvVars() (string, string)

func (*PathParam) Name

func (p *PathParam) Name() string

func (*PathParam) New

func (p *PathParam) New() Param

func (*PathParam) Required

func (p *PathParam) Required() bool

func (*PathParam) Set

func (p *PathParam) Set(s string) error

func (*PathParam) String

func (p *PathParam) String() string

func (*PathParam) Vars

func (p *PathParam) Vars() (string, string)

type StringParam

type StringParam struct {
	// contains filtered or unexported fields
}

func (*StringParam) Args

func (p *StringParam) Args() []string

func (*StringParam) CLIName

func (p *StringParam) CLIName() string

func (*StringParam) Check

func (p *StringParam) Check() string

func (*StringParam) Default

func (p *StringParam) Default() string

func (*StringParam) Description

func (p *StringParam) Description() string

func (*StringParam) EnvName

func (p *StringParam) EnvName() string

func (*StringParam) EnvVars

func (p *StringParam) EnvVars() (string, string)

func (*StringParam) Name

func (p *StringParam) Name() string

func (*StringParam) New

func (p *StringParam) New() Param

func (*StringParam) Required

func (p *StringParam) Required() bool

func (*StringParam) Set

func (p *StringParam) Set(s string) error

func (*StringParam) String

func (p *StringParam) String() string

func (*StringParam) Vars

func (p *StringParam) Vars() (string, string)

Jump to

Keyboard shortcuts

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