Documentation
¶
Index ¶
Constants ¶
const ( // ComponentsExtCodeKey is the ExtCode key for component imports ComponentsExtCodeKey = "__ksonnet/components" // ParamsExtCodeKey is the ExtCode key for importing environment parameters ParamsExtCodeKey = "__ksonnet/params" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AbsPath ¶
type AbsPath string
AbsPath is an advisory type that represents an absolute path. It is advisory in that it is not forced to be absolute, but rather, meant to indicate intent, and make code easier to read.
type ClusterSpec ¶
type ClusterSpec interface {
// contains filtered or unexported methods
}
ClusterSpec represents the API supported by some cluster. There are several ways to specify a cluster, including: querying the API server, reading an OpenAPI spec in some file, or consulting the OpenAPI spec released in a specific version of Kubernetes.
func ParseClusterSpec ¶
func ParseClusterSpec(specFlag string) (ClusterSpec, error)
ParseClusterSpec will parse a cluster spec flag and output a well-formed ClusterSpec object. For example, if the flag is `--version:v1.7.1`, then we will output a ClusterSpec representing the cluster specification associated with the `v1.7.1` build of Kubernetes.
type Environment ¶
Environment represents all fields of a ksonnet environment
type EnvironmentSpec ¶
EnvironmentSpec represents the contents in spec.json.
type Manager ¶
type Manager interface {
Root() AbsPath
LibPaths(envName string) (libPath, vendorPath, envLibPath, envComponentPath, envParamsPath AbsPath)
// Components API.
ComponentPaths() (AbsPaths, error)
CreateComponent(name string, text string, params param.Params, templateType prototype.TemplateType) error
// Params API.
SetComponentParams(component string, params param.Params) error
GetComponentParams(name string) (param.Params, error)
GetAllComponentParams() (map[string]param.Params, error)
// GetEnvironmentParams will take the name of an environment and return a
// mapping of parameters of the form:
// componentName => {param key => param val}
// i.e.: "nginx" => {"replicas" => 1, "name": "nginx"}
GetEnvironmentParams(name string) (map[string]param.Params, error)
SetEnvironmentParams(env, component string, params param.Params) error
// Environment API.
CreateEnvironment(name, uri, namespace string, spec ClusterSpec) error
DeleteEnvironment(name string) error
GetEnvironments() ([]*Environment, error)
GetEnvironment(name string) (*Environment, error)
SetEnvironment(name string, desired *Environment) error
// Spec API.
AppSpec() (*app.Spec, error)
// Dependency/registry API.
AddRegistry(name, protocol, uri, version string) (*registry.Spec, error)
GetRegistry(name string) (*registry.Spec, string, error)
GetPackage(registryName, libID string) (*parts.Spec, error)
CacheDependency(registryName, libID, libName, libVersion string) (*parts.Spec, error)
GetDependency(libName string) (*parts.Spec, error)
GetAllPrototypes() (prototype.SpecificationSchemas, error)
}
Manager abstracts over a ksonnet application's metadata, allowing users to do things like: create and delete environments; search for prototypes; vendor libraries; and other non-core-application tasks.