metadata

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2018 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// ComponentsExtCodeKey is the ExtCode key for component imports
	ComponentsExtCodeKey = "__ksonnet/components"
	// EnvExtCodeKey is the ExtCode key for importing environment metadata
	EnvExtCodeKey = "__ksonnet/environments"
	// ParamsExtCodeKey is the ExtCode key for importing component parameters
	ParamsExtCodeKey = "__ksonnet/params"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Manager

type Manager interface {
	// App returns the object for the application.
	App() (app.App, error)
	Root() string
	LibPaths() (envPath, vendorPath string)
	EnvPaths(env string) (libPath, mainPath, paramsPath string, err error)

	// Components API.
	ComponentPaths() ([]string, error)
	GetAllComponents() ([]string, error)
	CreateComponent(name string, text string, params param.Params, templateType prototype.TemplateType) error
	DeleteComponent(name string) error

	// Params API.
	SetComponentParams(component string, params param.Params) error
	GetComponentParams(name string) (param.Params, error)
	GetAllComponentParams(cwd string) (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, nsName string) (map[string]param.Params, error)
	SetEnvironmentParams(env, component string, params param.Params) error

	// Environment API.
	CreateEnvironment(name, uri, namespace, spec string) error
	DeleteEnvironment(name string) error
	GetEnvironments() (map[string]env.Env, error)
	GetEnvironment(name string) (*env.Env, error)
	SetEnvironment(name, desiredName string) error
	GetDestination(envName string) (env.Destination, 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.

func Find

func Find(path string) (Manager, error)

Find will recursively search the current directory and its parents for a `.ksonnet` folder, which marks the application root. Returns error if there is no application root.

func Init

func Init(name, rootPath string, k8sSpecFlag, serverURI, namespace *string) (Manager, error)

Init will generate the directory tree for a ksonnet project.

Directories

Path Synopsis
app
mocks
Code generated by mockery v1.0.0
Code generated by mockery v1.0.0

Jump to

Keyboard shortcuts

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