component

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: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Create

func Create(fs afero.Fs, root, name, text string, params param.Params, templateType prototype.TemplateType) (string, error)

Create creates a component.

func GenParamsContent

func GenParamsContent() []byte

GenParamsContent is the default content for params.libsonnet.

func MakePaths

func MakePaths(fs afero.Fs, ksApp app.App, root, env string) ([]string, error)

MakePaths creates a slice of component paths

func MakePathsByNamespace

func MakePathsByNamespace(fs afero.Fs, ksApp app.App, root, env string) (map[Namespace][]string, error)

MakePathsByNamespace creates a map of component paths categorized by namespace.

func Path

func Path(fs afero.Fs, root, name string) (string, error)

Path returns returns the file system path for a component.

Types

type Namespace

type Namespace struct {
	// Path is the path of the component namespace.
	Path string
	// contains filtered or unexported fields
}

Namespace is a component namespace.

func ExtractNamespacedComponent

func ExtractNamespacedComponent(fs afero.Fs, root, path string) (Namespace, string)

ExtractNamespacedComponent extracts a namespace and a component from a path.

func Namespaces

func Namespaces(fs afero.Fs, root string) ([]Namespace, error)

Namespaces returns all component namespaces

func NewNamespace

func NewNamespace(fs afero.Fs, root, name string) Namespace

NewNamespace creates an an instance of Namespace.

func (*Namespace) ComponentPaths

func (n *Namespace) ComponentPaths() ([]string, error)

ComponentPaths are the absolute paths to all the components in a namespace.

func (*Namespace) Components

func (n *Namespace) Components() ([]string, error)

Components returns the components in a namespace.

func (*Namespace) Dir

func (n *Namespace) Dir() string

Dir is the absolute directory for a namespace.

func (*Namespace) ParamsPath

func (n *Namespace) ParamsPath() string

ParamsPath generates the path to params.libsonnet for a namespace.

Jump to

Keyboard shortcuts

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