...

Package warehouse

import "edge-infra.dev/test/f2/x/warehouse"
Overview
Index

Overview ▾

Package warehouse implements a testing framework extension for working with Warehouse OCI packages and registries.

type Registry

Registry is a f2 extension that resolves to a in-memory registry for unit tests and a fully qualified URL to a remote registry for integration tests.

type Registry struct {
    // URL is the computed test repository URL used when publishing OCI packages
    // from tests. The package name will be appended to create the full URL.
    URL string
    // contains filtered or unexported fields
}

func FromContext

func FromContext(ctx fctx.Context) (*Registry, error)

FromContext attempts to fetch an instance of Registry from the test context and returns an error if it is not discovered.

func FromContextT

func FromContextT(ctx fctx.Context, t *testing.T) *Registry

FromContextT is a testing variant of FromContext that immediately fails the test if Registry isnt presnt in the testing context.

func New

func New(opts ...registry.Option) *Registry

New is a function that can forward options

func (*Registry) BindFlags

func (r *Registry) BindFlags(fs *flag.FlagSet)

BindFlags registers test flags for the framework extension.

func (*Registry) IntoContext

func (r *Registry) IntoContext(ctx fctx.Context) fctx.Context

IntoContext stores the framework extension in the test context.

func (*Registry) Push

func (r *Registry) Push(a oci.Artifact, pkgName, tag string, opts ...remote.Option) error

Push publishes the input OCI artifact to the resolved registry URL

func (*Registry) RegisterFns

func (r *Registry) RegisterFns(f f2.Framework)