internal

package
v2.0.0-alpha.3 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2023 License: Apache-2.0 Imports: 13 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
)
View Source
const ModeExecutable = 0100

Variables

This section is empty.

Functions

func Marshal

func Marshal(v interface{}) ([]byte, error)

func MatchTOML

func MatchTOML(expected interface{}) types.GomegaMatcher

Types

type EntryWriter

type EntryWriter struct{}

func (EntryWriter) Write

func (e EntryWriter) Write(source string, destination string) error

type EnvironmentWriter

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

EnvironmentWriter is an implementation of the libcnb.EnvironmentWriter interface.

func NewEnvironmentWriter

func NewEnvironmentWriter(options ...EnvironmentWriterOption) EnvironmentWriter

NewEnvironmentWriter creates a new instance that writes to the filesystem and writes to the default log.Logger.

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 EnvironmentWriterOption

type EnvironmentWriterOption func(writer EnvironmentWriter) EnvironmentWriter

EnvironmentWriterOption is a function for configuring a EnvironmentWriter instance.

func WithEnvironmentWriterLogger

func WithEnvironmentWriterLogger(logger log.Logger) EnvironmentWriterOption

WithEnvironmentWriterLogger creates an EnvironmentWriterOption that configures the logger.

type ExitHandler

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

ExitHandler is an implementation of the libcnb.ExitHandler interface.

func NewExitHandler

func NewExitHandler(options ...ExitHandlerOption) ExitHandler

NewExitHandler creates a new instance that calls os.Exit and writes to the default log.Logger and 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 ExitHandlerOption

type ExitHandlerOption func(handler ExitHandler) ExitHandler

ExitHandlerOption is a function for configuring an ExitHandler instance.

func WithExitHandlerExitFunc

func WithExitHandlerExitFunc(exitFunc func(int)) ExitHandlerOption

WithExitHandler creates an ExitHandlerOption that configures the exit function.

func WithExitHandlerLogger

func WithExitHandlerLogger(logger log.Logger) ExitHandlerOption

WithExitHandlerLogger creates an ExitHandlerOption that configures the logger.

func WithExitHandlerWriter

func WithExitHandlerWriter(writer io.Writer) ExitHandlerOption

WithExitHandlerWriter creates an ExitHandlerOption that configures the writer.

type TOMLWriter

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

TOMLWriter is an implementation of the libcnb.TOMLWriter interface.

func NewTOMLWriter

func NewTOMLWriter(options ...TOMLWriterOption) TOMLWriter

NewTOMLWriter creates a new instance that writes to the filesystem and writes to the default log.Logger.

func (TOMLWriter) Write

func (t 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.

type TOMLWriterOption

type TOMLWriterOption func(writer TOMLWriter) TOMLWriter

TOMLWriterOption is a function for configuring a TOMLWriter instance.

func WithTOMLWriterLogger

func WithTOMLWriterLogger(logger log.Logger) TOMLWriterOption

WithTOMLWriterLogger creates an TOMLWriterOption that configures the logger.

Jump to

Keyboard shortcuts

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