internal

package
v1.30.3 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ErrorStatusCode is the status code returned for error.
	ErrorStatusCode = 1

	// FailStatusCode is the status code returned for fail.
	FailStatusCode = 100

	// PassStatusCode is the status code returned for pass.
	PassStatusCode = 0
)

Variables

This section is empty.

Functions

func MatchTOML

func MatchTOML(expected interface{}) types.GomegaMatcher

Types

type ConfigMap

type ConfigMap map[string]string

ConfigMap represents a file-based projection of a collection of key-value pairs.

func NewConfigMapFromPath

func NewConfigMapFromPath(path string) (ConfigMap, error)

NewConfigMapFromPath creates a new ConfigMap from the files located within a given path.

type DirectoryContents

type DirectoryContents struct {
	Path string
}

DirectoryContents is used to generate a collection of the names of all files within a directory.

func (DirectoryContents) Get

func (d DirectoryContents) Get() ([]string, error)

Get returns the names of all files within a directory

type EnvironmentWriter

type EnvironmentWriter struct{}

EnvironmentWriter is a type used to write an environment to file filesystem.

func (EnvironmentWriter) Write

func (w EnvironmentWriter) Write(path string, environment map[string]string) error

Write creates the path directory, and creates a new file for each key with the value as the contents of each file.

type ExecDOption added in v1.24.0

type ExecDOption func(handler ExecDWriter) ExecDWriter

Option is a function for configuring an ExitHandler instance.

func WithExecDOutputWriter added in v1.24.0

func WithExecDOutputWriter(writer io.Writer) ExecDOption

WithExecDOutputWriter creates an Option that configures the writer.

type ExecDWriter added in v1.24.0

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

ExecDWriter is a type used to write TOML files to fd3.

func NewExecDWriter added in v1.24.0

func NewExecDWriter(options ...ExecDOption) ExecDWriter

NewExitHandler creates a new instance that calls os.Exit and writes to os.stderr.

func (ExecDWriter) Write added in v1.24.0

func (e ExecDWriter) Write(value map[string]string) error

Write outputs the value serialized in TOML format to the appropriate writer.

type ExitHandler

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

ExitHandler is the default implementation of the libcnb.ExitHandler interface.

func NewExitHandler

func NewExitHandler(options ...Option) ExitHandler

NewExitHandler creates a new instance that calls os.Exit and writes to os.stderr.

func (ExitHandler) Error

func (e ExitHandler) Error(err error)

func (ExitHandler) Fail

func (e ExitHandler) Fail()

func (ExitHandler) Pass

func (e ExitHandler) Pass()

type LayerAPI5 added in v1.21.0

type LayerAPI5 struct {

	// Build indicates that a layer should be used for builds.
	Build bool `toml:"build"`

	// Cache indicates that a layer should be cached.
	Cache bool `toml:"cache"`

	// Launch indicates that a layer should be used for launch.
	Launch bool `toml:"launch"`

	// Metadata is the metadata associated with the layer.
	Metadata map[string]interface{} `toml:"metadata"`
}

LayerAPI5 is used for backwards compatibility with serialization/deserialization of the layer toml

type Option

type Option func(handler ExitHandler) ExitHandler

Option is a function for configuring an ExitHandler instance.

func WithExitHandlerExitFunc

func WithExitHandlerExitFunc(exitFunc func(int)) Option

WithExitHandler creates an Option that configures the exit function.

func WithExitHandlerWriter

func WithExitHandlerWriter(writer io.Writer) Option

WithExitHandlerWriter creates an Option that configures the writer.

type TOMLWriter

type TOMLWriter struct{}

TOMLWriter is a type used to write TOML files to the filesystem.

func (TOMLWriter) Write

func (TOMLWriter) Write(path string, value interface{}) error

Write creates the path's parent directories, and creates a new file or truncates an existing file and then marshals the value to the file.

Jump to

Keyboard shortcuts

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