internal

package
v2.0.0-alpha.2 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2023 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 DirectoryContentsWriter

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

DirectoryContentsWriter is used write the contents of a directory to the given io.Writer

func NewDirectoryContentsWriter

func NewDirectoryContentsWriter(format log.DirectoryContentFormatter, writer io.Writer) DirectoryContentsWriter

NewDirectoryContentsWriter returns a new DirectoryContentsWriter initialized and ready to be used

func (DirectoryContentsWriter) Write

func (d DirectoryContentsWriter) Write(title, path string) error

Write all the file contents to the writer

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

type ExecDOption func(handler ExecDWriter) ExecDWriter

Option is a function for configuring an ExitHandler instance.

func WithExecDOutputWriter

func WithExecDOutputWriter(writer io.Writer) ExecDOption

WithExecDOutputWriter creates an Option that configures the writer.

type ExecDWriter

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

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

func NewExecDWriter

func NewExecDWriter(options ...ExecDOption) ExecDWriter

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

func (ExecDWriter) Write

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 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 PlainDirectoryContentFormatter

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

func NewPlainDirectoryContentFormatter

func NewPlainDirectoryContentFormatter() *PlainDirectoryContentFormatter

NewPlainDirectoryContentFormatter returns a formatter applies no formatting

The returned formatter operates as such:

Title -> returns string followed by `:\n`
File  -> returns file name relative to the root followed by `\n`

func (*PlainDirectoryContentFormatter) File

func (*PlainDirectoryContentFormatter) RootPath

func (p *PlainDirectoryContentFormatter) RootPath(path string)

func (*PlainDirectoryContentFormatter) Title

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