model

package
v0.0.0-...-fe92f36 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2021 License: Apache-2.0 Imports: 7 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	ListMetaID   = "io.k8s.apimachinery.pkg.apis.meta.v1.ListMeta"
	ObjectMetaID = "io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta"
)

Short handles for longer types

Variables

This section is empty.

Functions

func CamelLower

func CamelLower(s string) string

CamelLower returns the string with the word lowercased.

Types

type Constructor

type Constructor struct {
	Help string `json:"help"`
	// Args are the arguments this constructor takes.
	// Generated constructors only have one argument, `name`
	Args []Parameter `json:"args"`
}

Constructor creates new objects

type Group

type Group map[string]Version

Group represents a group, like "core" or "apps"

type IDs

type IDs map[string]map[string]string

IDs represents a group name -> group mapping constructed by

type Kind

type Kind struct {
	Help string `json:"help"`

	Group   string `json:"group"`
	Version string `json:"version"`

	// constructor
	New *Constructor `json:"new"`

	// modifiers
	Modifiers modifiers `json:"modifiers,omitempty"`
}

Kind represents both actual Kinds ("Deployment", "Version"), but also other parts of the API, like "Container" or "ServicePort".

func (Kind) APIVersion

func (k Kind) APIVersion() string

APIVersion constructs the full api path for a group

type Modifier

type Modifier struct {
	Help string `json:"help"`

	// Arg is the name of the functions argument
	Arg Parameter `json:"arg"`
	// Target is the jsonpath to the field that is modified
	Target string `json:"target"`

	// Type is the type of the modified value
	Type cloudformation.Type `json:"type"`
}

Modifier is a function that returns a patch to modify the value at `Target`

type Object

type Object struct {
	Help   string    `json:"help"`
	Fields modifiers `json:"fields"`
}

Object is the logical group for Modifiers that target fields of a nested object

type Parameter

type Parameter struct {
	Key     string      `json:"key"`
	Default interface{} `json:"default"`
}

Parameter is a function argument, with an optional default value

func (Parameter) String

func (p Parameter) String() string

type Resource

type Resource struct {
	Help string `json:"help"`

	Service string `json:"service"`

	// constructor
	New *Constructor `json:"new"`

	// modifiers
	Modifiers modifiers `json:"modifiers,omitempty"`
}

type Version

type Version struct {
	APIVersion string
	Kinds      map[string]Kind
}

Version represents a specific version of the API, like "apps/v1" or "core/v1"

func (Version) MarshalJSON

func (v Version) MarshalJSON() ([]byte, error)

MarshalJSON marsals wraps json.Marshal and adds the `_apiVersion` field

func (*Version) UnmarshalJSON

func (v *Version) UnmarshalJSON(d []byte) error

UnmarshalJSON wraps json.Unmarshal and decodes the "private" `_apiVersion` field

Jump to

Keyboard shortcuts

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