dir

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2016 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ContainerExtension is the file extension checked for Containers.
	ContainerExtension = ".ctr"

	// ObjectsDir is the directory checked for arbitrary Kubernetes objects.
	ObjectsDir = "rs"
)

Variables

View Source
var (
	// RCExtension is the partial extension checked for RCs
	RCExtension = "rc"

	// PodExtension is the partial extension checked for Pods.
	PodExtension = "pod"

	// ObjectExtensions are the file extensions that objects should be checked for in
	ObjectExtensions = []string{"json", "yml", "yaml"}
)
View Source
var (
	// ErrInvalidType is returned when the entity.Type is unknown
	ErrInvalidType = errors.New("passed invalid type")
)

Functions

This section is empty.

Types

type FileInput

type FileInput struct {
	FileSource
}

FileInput produces Entities from objects stored at a given path of the filesystem using the Redspread convention.

func NewFileInput

func NewFileInput(path string) (*FileInput, error)

NewFileInput returns an Input based on a file system

func (*FileInput) Build

func (d *FileInput) Build() (entity.Entity, error)

Build creates an Entity by selecting the entity with the lowest type number and attaching higher objects recursively

func (FileInput) Path

func (d FileInput) Path() string

Path returns the location the fileInput was created

type FileSource

type FileSource string

FileSource provides access to Entities stored according to the Redspread file convention. Under this convention RC's are looked for in RCFile, Pods are looked for in PodFile, and anything with the extension ContainerExtension is considered a container.

func (FileSource) Entities

func (fs FileSource) Entities(t entity.Type, objects ...deploy.KubeObject) ([]entity.Entity, error)

Entities returns the entities of the requested type from the source. Errors if any invalid entities.

func (FileSource) Objects

func (fs FileSource) Objects() (objects []deploy.KubeObject, err error)

Objects returns the Kubernetes objects available from the source. Errors if any invalid objects.

Jump to

Keyboard shortcuts

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