env

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: May 17, 2024 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExceptionFailHandler added in v0.4.1

func ExceptionFailHandler(msg string, callerSkip ...int)

func ModifiableTestData

func ModifiableTestData(paths ...string) tdOpt

func TestData

func TestData(paths ...string) tdOpt

Types

type Environment

type Environment struct {
	vfs.VFS
	// contains filtered or unexported fields
}

func NewEnvironment

func NewEnvironment(opts ...Option) *Environment

func (*Environment) ApplyOption

func (e *Environment) ApplyOption(options accessio.Options) error

func (*Environment) ConfigContext

func (e *Environment) ConfigContext() config.Context

func (*Environment) CredentialsContext

func (e *Environment) CredentialsContext() credentials.Context

func (*Environment) Fail added in v0.4.1

func (e *Environment) Fail(msg string, callerSkip ...int)

func (*Environment) FailOnErr added in v0.4.1

func (e *Environment) FailOnErr(err error, msg string, callerSkip ...int)

func (*Environment) FileSystem

func (e *Environment) FileSystem() vfs.FileSystem

func (*Environment) GetEnvironment added in v0.4.1

func (e *Environment) GetEnvironment() *Environment

func (*Environment) GetFailHandler added in v0.4.1

func (e *Environment) GetFailHandler() FailHandler

func (*Environment) GetFilesystem added in v0.4.1

func (e *Environment) GetFilesystem() vfs.FileSystem

func (*Environment) OCIContext

func (e *Environment) OCIContext() oci.Context

func (*Environment) OCMContext

func (e *Environment) OCMContext() ocm.Context

func (*Environment) OptionHandler added in v0.5.0

func (e *Environment) OptionHandler() OptionHandler

func (*Environment) RSAKeyPair added in v0.4.1

func (e *Environment) RSAKeyPair(name ...string)

func (*Environment) ReadRSAKeyPair added in v0.4.1

func (e *Environment) ReadRSAKeyPair(name, path string)

func (*Environment) SetFailHandler added in v0.4.1

func (e *Environment) SetFailHandler(h ...FailHandler) *Environment

SetFailHandler sets an explicit fail handler or by default a fail handler throwing an exception is set.

type FailHandler added in v0.4.1

type FailHandler func(msg string, callerSkip ...int)

func (FailHandler) GetEnvironment added in v0.4.1

func (FailHandler) GetEnvironment() *Environment

func (FailHandler) GetFailHandler added in v0.4.1

func (f FailHandler) GetFailHandler() FailHandler

func (FailHandler) GetFilesystem added in v0.4.1

func (FailHandler) GetFilesystem() vfs.FileSystem

func (FailHandler) Mount added in v0.4.1

func (FailHandler) OCMContext added in v0.5.0

func (f FailHandler) OCMContext() ocm.Context

func (FailHandler) OptionHandler added in v0.5.0

func (f FailHandler) OptionHandler() OptionHandler

func (FailHandler) Propagate added in v0.5.0

func (FailHandler) Propagate(e *Environment)

type Option

type Option interface {
	OptionHandler() OptionHandler
}

Option is he option interface for env creations. An Option just provides an OptionHandler which is used by the env creation to get info (like getting the ocm context) or to do something (like fs mounting).

func FileSystem

func FileSystem(fs vfs.FileSystem, path ...string) Option

func OCMContext added in v0.5.0

func OCMContext(ctx ocm.Context) Option

func UseAsContextFileSystem added in v0.5.0

func UseAsContextFileSystem() Option

type OptionHandler added in v0.5.0

type OptionHandler interface {
	OCMContext() ocm.Context
	GetFilesystem() vfs.FileSystem
	GetFailHandler() FailHandler
	GetEnvironment() *Environment

	// Mount mounts a new filesystem to the actual env filesystem.
	Mount(fs *composefs.ComposedFileSystem) error

	// Propagate is called on final environment.
	Propagate(e *Environment)
}

OptionHandler is the interface for the option actions. This indirection (Option -> OptionHandler) is introduced to enable objects to be usable as env option (for example Environment) without the need to pollute its interface with the effective option methods defiuned by OptionHandler. This would make no sense, because an option typically does nothing but for a selected set of methods according to its intended functionality. Nevertheless, is has to implement all the interface methods.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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