metadata

package
v0.0.0-...-2169ce8 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2017 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

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 AbsPaths

type AbsPaths []string

AbsPaths is a slice of `AbsPath`.

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

type Environment struct {
	Path string
	Name string
	URI  string
}

Environment represents all fields of a ksonnet environment

type EnvironmentSpec

type EnvironmentSpec struct {
	URI string `json:"uri"`
}

EnvironmentSpec represents the contents in spec.json.

type Manager

type Manager interface {
	Root() AbsPath
	ComponentPaths() (AbsPaths, error)
	CreateComponent(name string, text string, templateType prototype.TemplateType) error
	LibPaths(envName string) (libPath, envLibPath AbsPath)
	CreateEnvironment(name, uri string, spec ClusterSpec) error
	DeleteEnvironment(name string) error
	GetEnvironments() ([]*Environment, error)
	GetEnvironment(name string) (*Environment, error)
	SetEnvironment(name string, desired *Environment) 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 AbsPath) (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(rootPath AbsPath, spec ClusterSpec, serverURI *string) (Manager, error)

Init will retrieve a cluster API specification, generate a capabilities-compliant version of ksonnet-lib, and then generate the directory tree for an application.

Jump to

Keyboard shortcuts

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