Documentation ¶
Index ¶
- func ExceptionFailHandler(msg string, callerSkip ...int)
- func ModifiableTestData(paths ...string) tdOpt
- func TestData(paths ...string) tdOpt
- type DefaultOptionHandler
- func (o DefaultOptionHandler) GetEnvironment() *Environment
- func (o DefaultOptionHandler) GetFailHandler() FailHandler
- func (o DefaultOptionHandler) GetFilesystem() vfs.FileSystem
- func (DefaultOptionHandler) Mount(*composefs.ComposedFileSystem) error
- func (o DefaultOptionHandler) OCMContext() ocm.Context
- func (o DefaultOptionHandler) Propagate(e *Environment)
- type Environment
- func (e *Environment) ApplyOption(options accessio.Options) error
- func (e *Environment) ConfigContext() config.Context
- func (e *Environment) CredentialsContext() credentials.Context
- func (e *Environment) Fail(msg string, callerSkip ...int)
- func (e *Environment) FailOnErr(err error, msg string, callerSkip ...int)
- func (e *Environment) FileSystem() vfs.FileSystem
- func (e *Environment) GetEnvironment() *Environment
- func (e *Environment) GetFailHandler() FailHandler
- func (e *Environment) GetFilesystem() vfs.FileSystem
- func (e *Environment) OCIContext() oci.Context
- func (e *Environment) OCMContext() ocm.Context
- func (e *Environment) OptionHandler() OptionHandler
- func (e *Environment) RSAKeyPair(name ...string)
- func (e *Environment) ReadRSAKeyPair(name, path string)
- func (e *Environment) SetFailHandler(h ...FailHandler) *Environment
- type FailHandler
- func (FailHandler) GetEnvironment() *Environment
- func (f FailHandler) GetFailHandler() FailHandler
- func (FailHandler) GetFilesystem() vfs.FileSystem
- func (FailHandler) Mount(*composefs.ComposedFileSystem) error
- func (f FailHandler) OCMContext() ocm.Context
- func (f FailHandler) OptionHandler() OptionHandler
- func (FailHandler) Propagate(e *Environment)
- type Option
- func FileSystem(fs vfs.FileSystem, path ...string) Option
- func ModifiableProjectTestData(source string, dest ...string) Option
- func ModifiableProjectTestDataForCaller(dest ...string) Option
- func OCMContext(ctx ocm.Context) Option
- func ProjectTestData(source string, dest ...string) Option
- func ProjectTestDataForCaller(dest ...string) Option
- func UseAsContextFileSystem() Option
- type OptionHandler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExceptionFailHandler ¶ added in v0.4.1
func ModifiableTestData ¶
func ModifiableTestData(paths ...string) tdOpt
Types ¶
type DefaultOptionHandler ¶ added in v0.12.0
type DefaultOptionHandler struct{}
func (DefaultOptionHandler) GetEnvironment ¶ added in v0.12.0
func (o DefaultOptionHandler) GetEnvironment() *Environment
func (DefaultOptionHandler) GetFailHandler ¶ added in v0.12.0
func (o DefaultOptionHandler) GetFailHandler() FailHandler
func (DefaultOptionHandler) GetFilesystem ¶ added in v0.12.0
func (o DefaultOptionHandler) GetFilesystem() vfs.FileSystem
func (DefaultOptionHandler) Mount ¶ added in v0.12.0
func (DefaultOptionHandler) Mount(*composefs.ComposedFileSystem) error
func (DefaultOptionHandler) OCMContext ¶ added in v0.12.0
func (o DefaultOptionHandler) OCMContext() ocm.Context
func (DefaultOptionHandler) Propagate ¶ added in v0.12.0
func (o DefaultOptionHandler) Propagate(e *Environment)
type Environment ¶
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
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) Mount(*composefs.ComposedFileSystem) error
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 ModifiableProjectTestData ¶ added in v0.11.0
func ModifiableProjectTestDataForCaller ¶ added in v0.11.0
func OCMContext ¶ added in v0.5.0
func ProjectTestData ¶ added in v0.11.0
func ProjectTestDataForCaller ¶ added in v0.11.0
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.