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

mock

package
v1.3.2 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2025 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	SampleArtifactUri = "registry.acme-rockets.io/software/net-monitor@sha256:60043cf45eaebc4c0867fea485a039b598f52fd09fd5b07b0b2d2f88fad9d74e"
	SampleDigest      = digest.Digest("sha256:60043cf45eaebc4c0867fea485a039b598f52fd09fd5b07b0b2d2f88fad9d74e")
	ZeroDigest        = digest.Digest("sha256:0000000000000000000000000000000000000000000000000000000000000000")
	Annotations       = map[string]string{"key": "value"}
	ImageDescriptor   = ocispec.Descriptor{
		MediaType:   "application/vnd.docker.distribution.manifest.v2+json",
		Digest:      SampleDigest,
		Size:        528,
		Annotations: Annotations,
	}
	SigManfiestDescriptor = ocispec.Descriptor{
		MediaType:   "application/vnd.oci.image.manifest.v1+json",
		Digest:      SampleDigest,
		Size:        300,
		Annotations: Annotations,
	}
	TestImageDescriptor = ocispec.Descriptor{
		MediaType:   "application/vnd.docker.distribution.manifest.v2+json",
		Digest:      digest.Digest("sha256:fe7e9333395060c2f5e63cf36a38fba10176f183b4163a5794e081a480abba5f"),
		Size:        942,
		Annotations: nil,
	}
	JwsSigEnvDescriptor = ocispec.Descriptor{
		MediaType:   "application/jose+json",
		Digest:      SampleDigest,
		Size:        100,
		Annotations: Annotations,
	}
	PluginExtendedCriticalAttribute = signature.Attribute{
		Key:      "SomeKey",
		Critical: true,
		Value:    "SomeValue",
	}
	MetadataSigEnvDescriptor = ocispec.Descriptor{
		MediaType:   "application/vnd.docker.distribution.manifest.v2+json",
		Digest:      digest.Digest("sha256:5a07385af4e6b6af81b0ebfd435aedccdfa3507f0609c658209e1aba57159b2b"),
		Size:        942,
		Annotations: map[string]string{"io.wabbit-networks.buildId": "123", "io.wabbit-networks.buildTime": "1672944615"},
	}
)
View Source
var MockCaCompatiblePluginVerSigEnv_0_0_9 []byte
View Source
var MockCaCompatiblePluginVerSigEnv_1_0_0 []byte
View Source
var MockCaCompatiblePluginVerSigEnv_1_0_0_alpha []byte
View Source
var MockCaCompatiblePluginVerSigEnv_1_0_0_alpha_beta []byte
View Source
var MockCaExpiredSigEnv []byte
View Source
var MockCaIncompatiblePluginVerSigEnv_1_0_1 []byte
View Source
var MockCaIncompatiblePluginVerSigEnv_1_0_9 []byte
View Source
var MockCaIncompatiblePluginVerSigEnv_1_1_0_alpha []byte
View Source
var MockCaIncompatiblePluginVerSigEnv_1_2_3 []byte
View Source
var MockCaInvalidSigEnv []byte
View Source
var MockCaPluginSigEnv []byte // extended attributes are "SomeKey":"SomeValue", "io.cncf.notary.verificationPlugin":"plugin-name"
View Source
var MockCaValidSigEnv []byte
View Source
var MockSaExpiredSigEnv []byte
View Source
var MockSaInvalidSigEnv []byte
View Source
var MockSaPluginSigEnv []byte // extended attributes are "SomeKey":"SomeValue", "io.cncf.notary.verificationPlugin":"plugin-name"
View Source
var MockSaValidSigEnv []byte
View Source
var MockSigEnvWithMetadata []byte

Functions

This section is empty.

Types

type PluginManager

type PluginManager struct {
	PluginCapabilities          []plugin.Capability
	GetPluginError              error
	PluginRunnerLoadError       error
	PluginRunnerExecuteResponse interface{}
	PluginRunnerExecuteError    error
}

func (PluginManager) Get

func (pm PluginManager) Get(ctx context.Context, name string) (plugin.Plugin, error)

func (PluginManager) List

func (pm PluginManager) List(ctx context.Context) ([]string, error)

type PluginMock

type PluginMock struct {
	Metadata        plugin.GetMetadataResponse
	ExecuteResponse interface{}
	ExecuteError    error
}

func (*PluginMock) DescribeKey

func (*PluginMock) GenerateEnvelope

func (*PluginMock) GenerateSignature

func (*PluginMock) GetMetadata

func (*PluginMock) VerifySignature

type Repository

type Repository struct {
	ResolveResponse            ocispec.Descriptor
	ResolveError               error
	ListSignaturesResponse     []ocispec.Descriptor
	ListSignaturesError        error
	FetchSignatureBlobResponse []byte
	FetchSignatureBlobError    error
	MissMatchDigest            bool
	ExceededNumOfSignatures    bool
	PushSignatureError         error
}

func NewRepository

func NewRepository() Repository

func (Repository) FetchSignatureBlob

func (t Repository) FetchSignatureBlob(ctx context.Context, desc ocispec.Descriptor) ([]byte, ocispec.Descriptor, error)

func (Repository) ListSignatures

func (t Repository) ListSignatures(ctx context.Context, desc ocispec.Descriptor, fn func(signatureManifests []ocispec.Descriptor) error) error

func (Repository) PushSignature

func (t Repository) PushSignature(ctx context.Context, mediaType string, blob []byte, subject ocispec.Descriptor, annotations map[string]string) (blobDesc, manifestDesc ocispec.Descriptor, err error)

func (Repository) Resolve

func (t Repository) Resolve(ctx context.Context, reference string) (ocispec.Descriptor, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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