asset

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2018 License: Apache-2.0 Imports: 6 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 GetDataByFilename

func GetDataByFilename(a Asset, parents map[Asset]*State, filename string) ([]byte, error)

GetDataByFilename searches the file in the asset.State.Contents, and returns its data. filename is the base name of the file.

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 dependent assets.
	Generate(map[Asset]*State) (*State, 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 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) (*State, 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) (*State, error)

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

type UserProvided

type UserProvided struct {
	AssetName      string
	Question       *survey.Question
	EnvVarName     string
	PathEnvVarName string
}

UserProvided generates an asset that is supplied by a user.

func (*UserProvided) Dependencies

func (a *UserProvided) Dependencies() []Asset

Dependencies returns no dependencies.

func (*UserProvided) Generate

func (a *UserProvided) Generate(map[Asset]*State) (*State, error)

Generate queries for input from the user.

func (*UserProvided) Name

func (a *UserProvided) Name() string

Name returns the human-friendly name of the asset.

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 metadata contains asset targets that generates the metadata.yaml
Package metadata contains asset targets that generates the metadata.yaml
Package stock defines a stock type that holds that holds the instantiated assets.
Package stock defines a stock type that holds that holds the instantiated assets.
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