Documentation ¶
Index ¶
- func AnnotateFlags(cmd *cobra.Command, generators map[string]Generator)
- func EnsureFlagsValid(cmd *cobra.Command, generators map[string]Generator, generatorInUse string) error
- func GetBool(params map[string]string, key string, defValue bool) (bool, error)
- func IsZero(i interface{}) bool
- func MakeLabels(labels map[string]string) string
- func MakeParams(cmd *cobra.Command, params []GeneratorParam) map[string]interface{}
- func MakeProtocols(protocols map[string]string) string
- func ParseLabels(labelSpec interface{}) (map[string]string, error)
- func ParseProtocols(protocols interface{}) (map[string]string, error)
- func ValidateParams(paramSpec []GeneratorParam, params map[string]interface{}) error
- type Generator
- type GeneratorFunc
- type GeneratorParam
- type StructuredGenerator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AnnotateFlags ¶
AnnotateFlags annotates all flags that are used by generators.
func EnsureFlagsValid ¶
func EnsureFlagsValid(cmd *cobra.Command, generators map[string]Generator, generatorInUse string) error
EnsureFlagsValid ensures that no invalid flags are being used against a
func MakeLabels ¶
func MakeParams ¶
func MakeParams(cmd *cobra.Command, params []GeneratorParam) map[string]interface{}
MakeParams is a utility that creates generator parameters from a command line
func MakeProtocols ¶
func ParseLabels ¶
ParseLabels turns a string representation of a label set into a map[string]string
func ParseProtocols ¶
func ValidateParams ¶
func ValidateParams(paramSpec []GeneratorParam, params map[string]interface{}) error
ValidateParams ensures that all required params are present in the params map
Types ¶
type Generator ¶
type Generator interface { // Generate creates an API object given a set of parameters Generate(params map[string]interface{}) (runtime.Object, error) // ParamNames returns the list of parameters that this generator uses ParamNames() []GeneratorParam }
Generator is an interface for things that can generate API objects from input parameters. One example is the "expose" generator that is capable of exposing new replication controllers and services, among other things.
type GeneratorFunc ¶
GeneratorFunc returns the generators for the provided command
type GeneratorParam ¶
GeneratorParam is a parameter for a generator TODO: facilitate structured json generator input schemes
type StructuredGenerator ¶
type StructuredGenerator interface { // StructuredGenerator creates an API object using pre-configured parameters StructuredGenerate() (runtime.Object, error) }
StructuredGenerator is an interface for things that can generate API objects not using parameter injection