generate

package
v0.19.0-beta.1 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2020 License: Apache-2.0 Imports: 8 Imported by: 23

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AnnotateFlags

func AnnotateFlags(cmd *cobra.Command, generators map[string]Generator)

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 GetBool

func GetBool(params map[string]string, key string, defValue bool) (bool, error)

func IsZero

func IsZero(i interface{}) bool

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 MakeProtocols(protocols map[string]string) string

func ParseLabels

func ParseLabels(labelSpec interface{}) (map[string]string, error)

ParseLabels turns a string representation of a label set into a map[string]string

func ParseProtocols

func ParseProtocols(protocols interface{}) (map[string]string, error)

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

type GeneratorFunc func(cmdName string) map[string]Generator

GeneratorFunc returns the generators for the provided command

type GeneratorParam

type GeneratorParam struct {
	Name     string
	Required bool
}

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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