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(source string, dest ...string) Option
- func OCMContext(ctx ocm.Context) Option
- func ProjectTestData(source string, dest ...string) Option
- func ProjectTestDataForCaller(source string, dest ...string) Option
- func UseAsContextFileSystem() Option
- type OptionHandler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExceptionFailHandler ¶
func ModifiableTestData ¶
func ModifiableTestData(paths ...string) tdOpt
Types ¶
type DefaultOptionHandler ¶
type DefaultOptionHandler struct{}
func (DefaultOptionHandler) GetEnvironment ¶
func (o DefaultOptionHandler) GetEnvironment() *Environment
func (DefaultOptionHandler) GetFailHandler ¶
func (o DefaultOptionHandler) GetFailHandler() FailHandler
func (DefaultOptionHandler) GetFilesystem ¶
func (o DefaultOptionHandler) GetFilesystem() vfs.FileSystem
func (DefaultOptionHandler) Mount ¶
func (DefaultOptionHandler) Mount(*composefs.ComposedFileSystem) error
func (DefaultOptionHandler) OCMContext ¶
func (o DefaultOptionHandler) OCMContext() ocm.Context
func (DefaultOptionHandler) Propagate ¶
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 ¶
func (e *Environment) Fail(msg string, callerSkip ...int)
func (*Environment) FailOnErr ¶
func (e *Environment) FailOnErr(err error, msg string, callerSkip ...int)
func (*Environment) FileSystem ¶
func (e *Environment) FileSystem() vfs.FileSystem
func (*Environment) GetEnvironment ¶
func (e *Environment) GetEnvironment() *Environment
func (*Environment) GetFailHandler ¶
func (e *Environment) GetFailHandler() FailHandler
func (*Environment) GetFilesystem ¶
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 ¶
func (e *Environment) OptionHandler() OptionHandler
func (*Environment) RSAKeyPair ¶
func (e *Environment) RSAKeyPair(name ...string)
func (*Environment) ReadRSAKeyPair ¶
func (e *Environment) ReadRSAKeyPair(name, path string)
func (*Environment) SetFailHandler ¶
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 ¶
func (FailHandler) GetEnvironment ¶
func (FailHandler) GetEnvironment() *Environment
func (FailHandler) GetFailHandler ¶
func (f FailHandler) GetFailHandler() FailHandler
func (FailHandler) GetFilesystem ¶
func (FailHandler) GetFilesystem() vfs.FileSystem
func (FailHandler) Mount ¶
func (FailHandler) Mount(*composefs.ComposedFileSystem) error
func (FailHandler) OCMContext ¶
func (f FailHandler) OCMContext() ocm.Context
func (FailHandler) OptionHandler ¶
func (f FailHandler) OptionHandler() OptionHandler
func (FailHandler) Propagate ¶
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 ¶
func ProjectTestData ¶
func UseAsContextFileSystem ¶
func UseAsContextFileSystem() Option
type OptionHandler ¶
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.