Documentation ¶
Index ¶
- func Asset(name string) ([]byte, error)
- func AssetDir(name string) ([]string, error)
- func AssetInfo(name string) (os.FileInfo, error)
- func AssetNames() []string
- func MustAsset(name string) []byte
- func RestoreAsset(dir, name string) error
- func RestoreAssets(dir, name string) error
- type AdditionalResources
- type Codegen
- type ConfigMap
- type ConfigMapData
- type Customizations
- type ModelFile
- type ModelFiles
- type ModelMetadata
- type ModelSpec
- type Port
- type ResourceBody
- type ResourceOutput
- type SchemaProperty
- type Secret
- type Service
- type Shortname
- type SpecResource
- type SpecSchema
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Asset ¶
Asset loads and returns the asset for the given name. It returns an error if the asset could not be found or could not be loaded.
func AssetDir ¶
AssetDir returns the file names below a certain directory embedded in the file by go-bindata. For example if you run go-bindata on data/... and data contains the following hierarchy:
data/ foo.txt img/ a.png b.png
then AssetDir("data") would return []string{"foo.txt", "img"} AssetDir("data/img") would return []string{"a.png", "b.png"} AssetDir("foo.txt") and AssetDir("notexist") would return an error AssetDir("") will return []string{"data"}.
func AssetInfo ¶
AssetInfo loads and returns the asset info for the given name. It returns an error if the asset could not be found or could not be loaded.
func MustAsset ¶
MustAsset is like Asset but panics when Asset would return an error. It simplifies safe initialization of global variables.
func RestoreAsset ¶
RestoreAsset restores an asset under the given directory
func RestoreAssets ¶
RestoreAssets restores an asset under the given directory recursively
Types ¶
type AdditionalResources ¶
type AdditionalResources struct { Services []Service `yaml:"services",json:"services"` ConfigMaps []ConfigMap `yaml:"configMaps",json:"configMaps"` Secrets []Secret `yaml:"secrets",json:"secrets"` }
AdditionalResources defines what is created after the fact
func (AdditionalResources) ConfigMapCount ¶
func (a AdditionalResources) ConfigMapCount() int
ConfigMapCount is the amount of configmaps
func (AdditionalResources) SecretCount ¶
func (a AdditionalResources) SecretCount() int
SecretCount is the amount of secrets
func (AdditionalResources) ServiceCount ¶
func (a AdditionalResources) ServiceCount() int
ServiceCount is the amount of services
type Codegen ¶
Codegen hold the base contructs
type ConfigMap ¶
type ConfigMap struct { Name string `yaml:"name",json:"name"` Data []ConfigMapData `yaml:"data",json:"data"` }
ConfigMap defines what you can mutate in a configmap object
type ConfigMapData ¶
type ConfigMapData struct { Key string `yaml:"key",json:"key"` Value string `yaml:"value",json:"value"` }
ConfigMapData defines what the data is in a CM.
type Customizations ¶
type Customizations struct { Package string `yaml:"package",json:"package"` Add string `yaml:"add",json:"add"` Update string `yaml:"update",json:"update"` Delete string `yaml:"delete",json:"delete"` }
Customizations returns the able customizations
type ModelFile ¶
type ModelFile struct { APIVersion string `yaml:"apiVersion",json:"apiVersion"` Kind string `yaml:"kind",json:"kind"` Metadata ModelMetadata `yaml:"metadata",json:"metadata"` Spec ModelSpec `yaml:"spec",json:"spec"` }
ModelFile parses the model files for each service
type ModelFiles ¶
type ModelFiles struct { APIVersion string `yaml:"apiVersion",json:"apiVersion"` Kind string `yaml:"kind",json:"kind"` Items []ModelFile `yaml:"items",json:"items"` }
ModelFiles returns all model files in a list format
type ModelMetadata ¶
type ModelMetadata struct {
Name string `yaml:"name",json:"name"`
}
ModelMetadata stores any specific metadata about the model
type ModelSpec ¶
type ModelSpec struct { Kind string `yaml:"kind",json:"kind"` Type string `yaml:"type",json:"type"` Queue bool `yaml:"queue",json:"queue"` UseCloudFormation bool `yaml:"useCloudFormation",json:"useCloudFormation"` Resource SpecResource `yaml:"resource",json:"resource"` Body ResourceBody `yaml:"body",json:"body"` Output ResourceOutput `yaml:"output",json:"output"` AdditionalResources AdditionalResources `yaml:"additionalResources",json:"additionalResources"` Customizations Customizations `yaml:"customizations",json:"customizations"` IsCustomized bool }
ModelSpec defines the core of how the resource is structured
func (ModelSpec) PluralName ¶
PluralName returns the plural version of the name
type Port ¶
type Port struct { Port string `yaml:"port",json:"port"` Protocol string `yaml:"protocol",json:"protcol"` }
Port defines the ServicePorts
type ResourceBody ¶
type ResourceBody struct {
Schema SpecSchema `yaml:"schema",json:"schema"`
}
ResourceBody defines the body of the object
type ResourceOutput ¶
type ResourceOutput struct {
Schema SpecSchema `yaml:"schema",json:"schema"`
}
ResourceOutput defines the body of the object
type SchemaProperty ¶
type SchemaProperty struct { Key string `yaml:"key",json:"key"` Type string `yaml:"type",json:"type"` Description string `yaml:"description",json:"description"` StructKey string `yaml:"structKey",json:"structKey"` TemplateKey string `yaml:"templateKey",json:"templateKey"` Templatized bool `yaml:"templatized",json:"templatized"` Template string `yaml:"template",json:"template"` Properties []SchemaProperty `yaml:"properties",json:"properties"` }
SchemaProperty is the definition for the full properties
func (SchemaProperty) TypeOfObject ¶
func (s SchemaProperty) TypeOfObject(kind string) string
TypeOfObject returns the Type of Object it is
type Service ¶
type Service struct { Name string `yaml:"name",json:"name"` Type string `yaml:"type",json:"type"` ExternalName string `yaml:"externalName",json:"externalName"` Ports []Port `yaml:"ports",json:"ports"` }
Service defines what you can mutate in a service object
func (Service) NameToLowerCamel ¶
NameToLowerCamel will lowercase the name for variables in golang
type Shortname ¶
type Shortname struct {
Name string `yaml:"name",json"name"`
}
Shortname defines the shortnames the crd will listen to
type SpecResource ¶
type SpecResource struct { Name string `yaml:"name",json:"name"` Plural string `yaml:"plural",json:"plural"` Shortnames []Shortname `yaml:"shortNames",json:"shortNames"` }
SpecResource defines how the CRD is populated
type SpecSchema ¶
type SpecSchema struct { Type string `yaml:"type",json:"type"` Properties []SchemaProperty `yaml:"properties",json:"properties"` KeyMapping map[string][]SchemaProperty }
SpecSchema defines how the object is defined in types.go and the CFT