metadata

package
v0.10.2 Latest Latest
Warning

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

Go to latest
Published: May 11, 2018 License: Apache-2.0 Imports: 12 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() ([]component.Component, 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(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, module string) (map[string]param.Params, error)
	SetEnvironmentParams(env, component string, params param.Params) 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.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳