Help us shape the future of Go! Take the 2026 Go Developer Survey

build

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2026 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildModelConfig

func BuildModelConfig(modelConfig *buildconfig.Model, layers []ocispec.Descriptor) (modelspec.Model, error)

BuildModelConfig builds the model config.

Types

type Builder

type Builder interface {
	// BuildLayer builds the layer blob from the given file path.
	BuildLayer(ctx context.Context, mediaType, workDir, path, destPath string, hooks hooks.Hooks) (ocispec.Descriptor, error)

	// BuildConfig builds the config blob of the artifact.
	BuildConfig(ctx context.Context, config modelspec.Model, hooks hooks.Hooks) (ocispec.Descriptor, error)

	// BuildManifest builds the manifest blob of the artifact.
	BuildManifest(ctx context.Context, layers []ocispec.Descriptor, config ocispec.Descriptor, annotations map[string]string, hooks hooks.Hooks) (ocispec.Descriptor, error)
}

Builder is an interface for building artifacts.

func NewBuilder

func NewBuilder(outputType OutputType, store storage.Storage, repo, tag string, opts ...Option) (Builder, error)

NewBuilder creates a new builder instance.

type Option

type Option func(*config)

func WithInsecure

func WithInsecure(insecure bool) Option

func WithInterceptor

func WithInterceptor(interceptor interceptor.Interceptor) Option

func WithPlainHTTP

func WithPlainHTTP(plainHTTP bool) Option

type OutputStrategy

type OutputStrategy interface {
	// OutputLayer outputs the layer blob to the storage (local or remote).
	OutputLayer(ctx context.Context, mediaType, relPath, destPath, digest string, size int64, reader io.Reader, hooks hooks.Hooks) (ocispec.Descriptor, error)

	// OutputConfig outputs the config blob to the storage (local or remote).
	OutputConfig(ctx context.Context, mediaType, digest string, size int64, reader io.Reader, hooks hooks.Hooks) (ocispec.Descriptor, error)

	// OutputManifest outputs the manifest blob to the storage (local or remote).
	OutputManifest(ctx context.Context, mediaType, digest string, size int64, reader io.Reader, hooks hooks.Hooks) (ocispec.Descriptor, error)
}

func NewLocalOutput

func NewLocalOutput(cfg *config, store storage.Storage, repo, tag string) (OutputStrategy, error)

func NewRemoteOutput

func NewRemoteOutput(cfg *config, repo, tag string) (OutputStrategy, error)

type OutputType

type OutputType string

OutputType defines the type of output to generate.

const (
	// OutputTypeLocal indicates that the output should be stored locally in modctl local storage.
	OutputTypeLocal OutputType = "local"
	// OutputTypeRemote indicates that the output should be pushed to a remote registry directly.
	OutputTypeRemote OutputType = "remote"
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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