asset

package
v0.2.0 Latest Latest
Warning

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

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

Documentation

Overview

Package asset defines the asset dependencies and implements the graph engine.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateUserProvidedAsset added in v0.2.0

func GenerateUserProvidedAsset(inputName string, question *survey.Question, envVarName string) (string, error)

GenerateUserProvidedAsset queries for input from the user.

func GenerateUserProvidedAssetForPath added in v0.2.0

func GenerateUserProvidedAssetForPath(inputName string, question *survey.Question, envVarName, pathEnvVarName string) (string, error)

GenerateUserProvidedAssetForPath queries for input from the user. The input can be read from a file specified in an environment variable.

func PersistToFile added in v0.2.0

func PersistToFile(asset WritableAsset, directory string) error

PersistToFile writes all of the files of the specified asset into the specified directory.

Types

type Asset

type Asset interface {
	// Dependencies returns the assets upon which this asset directly depends.
	Dependencies() []Asset

	// Generate generates this asset given the states of its parent assets.
	Generate(Parents) error

	// Name returns the human-friendly name of the asset.
	Name() string
}

Asset used to install OpenShift.

type Content

type Content struct {
	Name string // the path on disk for this content.
	Data []byte
}

Content is a generated portion of an Asset.

type File added in v0.2.0

type File struct {
	// Filename is the name of the file.
	Filename string
	// Data is the contents of the file.
	Data []byte
}

File is a file for an Asset.

type Parents added in v0.2.0

type Parents map[reflect.Type]Asset

Parents is the collection of assets upon which another asset is directly dependent.

func (Parents) Add added in v0.2.0

func (p Parents) Add(assets ...Asset)

Add adds the specified assets to the parents collection.

func (Parents) Get added in v0.2.0

func (p Parents) Get(assets ...Asset)

Get populates the state of the specified assets with the state stored in the parents collection.

type State

type State struct {
	Contents []Content
}

State is the state of an Asset.

func (*State) PersistToFile

func (s *State) PersistToFile(directory string) error

PersistToFile persists the data in the State to files. Each Content entry that has a non-empty Name will be persisted to a file with that name.

type Store

type Store interface {
	// Fetch retrieves the state of the given asset, generating it and its
	// dependencies if necessary.
	Fetch(Asset) error
}

Store is a store for the states of assets.

type StoreImpl

type StoreImpl struct {
	// contains filtered or unexported fields
}

StoreImpl is the implementation of Store.

func (*StoreImpl) Fetch

func (s *StoreImpl) Fetch(asset Asset) error

Fetch retrieves the state of the given asset, generating it and its dependencies if necessary.

func (*StoreImpl) GetStateAsset added in v0.2.0

func (s *StoreImpl) GetStateAsset(asset Asset) (bool, error)

GetStateAsset renders the asset object arguments from the state file contents also returns a boolean indicating whether the object was found in the state file or not

func (*StoreImpl) Load added in v0.2.0

func (s *StoreImpl) Load(dir string) error

Load retrieves the state from the state file present in the given directory and returns the assets map

func (*StoreImpl) Save added in v0.2.0

func (s *StoreImpl) Save(dir string) error

Save dumps the entire state map into a file

type WritableAsset added in v0.2.0

type WritableAsset interface {
	Asset

	// Files returns the files to write.
	Files() []*File
}

WritableAsset is an Asset that has files that can be written to disk.

Directories

Path Synopsis
Package cluster contains asset targets that generates the terraform file, prepare the infra, and bootstrap the cluster.
Package cluster contains asset targets that generates the terraform file, prepare the infra, and bootstrap the cluster.
content
Package content contains the contents of files and systemd units to be added to Ignition configs.
Package content contains the contents of files and systemd units to be added to Ignition configs.
Package installconfig generates the install config assets based on its dependencies.
Package installconfig generates the install config assets based on its dependencies.
Package kubeconfig defines and generates the kubeconfig assets.
Package kubeconfig defines and generates the kubeconfig assets.
Package manifests deals with creating manifests for all manifests to be installed for the cluster
Package manifests deals with creating manifests for all manifests to be installed for the cluster
Package tls defines and generates the tls assets based on its dependencies.
Package tls defines and generates the tls assets based on its dependencies.

Jump to

Keyboard shortcuts

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