Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildModelConfig ¶ added in v0.0.5
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 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 WithInterceptor ¶
func WithInterceptor(interceptor interceptor.Interceptor) Option
func WithPlainHTTP ¶
type OutputStrategy ¶
type OutputStrategy interface { // OutputLayer outputs the layer blob to the storage (local or remote). OutputLayer(ctx context.Context, mediaType, relPath, 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" )
Click to show internal directories.
Click to hide internal directories.