Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Hooks ¶
type Hooks struct {
// OnHash is called when digest computation starts.
OnHash OnHashFunc
// OnStart is called when the build process starts.
OnStart OnStartFunc
// OnError is called when the build process encounters an error.
OnError OnErrorFunc
// OnComplete is called when the build process completes successfully.
OnComplete OnCompleteFunc
}
Hooks is a struct that contains hook functions.
type OnCompleteFunc ¶
type OnCompleteFunc func(name string, desc ocispec.Descriptor)
OnCompleteFunc defines the signature for the OnComplete hook function.
type OnErrorFunc ¶
OnErrorFunc defines the signature for the OnError hook function.
type OnHashFunc ¶ added in v0.2.3
OnHashFunc defines the signature for the OnHash hook function. Called when digest computation starts, wraps reader with progress tracking.
type OnStartFunc ¶
OnStartFunc defines the signature for the OnStart hook function.
type Option ¶
type Option func(*Hooks)
Option is a function type that can be used to customize a Hooks instance.
func WithOnComplete ¶
func WithOnComplete(f OnCompleteFunc) Option
WithOnComplete returns an Option that sets the OnComplete hook.
func WithOnError ¶
func WithOnError(f OnErrorFunc) Option
WithOnError returns an Option that sets the OnError hook.
func WithOnHash ¶ added in v0.2.3
func WithOnHash(f OnHashFunc) Option
WithOnHash returns an Option that sets the OnHash hook.
func WithOnStart ¶
func WithOnStart(f OnStartFunc) Option
WithOnStart returns an Option that sets the OnStart hook.