hooks

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2025 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Hooks

type Hooks struct {
	// 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.

func NewHooks

func NewHooks(opts ...Option) Hooks

NewHooks creates a new Hooks instance with optional function parameters.

type OnCompleteFunc

type OnCompleteFunc func(name string, desc ocispec.Descriptor)

OnCompleteFunc defines the signature for the OnComplete hook function.

type OnErrorFunc

type OnErrorFunc func(name string, err error)

OnErrorFunc defines the signature for the OnError hook function.

type OnStartFunc

type OnStartFunc func(name string, size int64, reader io.Reader) io.Reader

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 WithOnStart

func WithOnStart(f OnStartFunc) Option

WithOnStart returns an Option that sets the OnStart hook.

Jump to

Keyboard shortcuts

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