mocks

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: May 2, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TestSubjectWithDigest = "localhost:5000/net-monitor:v1@sha256:b556844e6e59451caf4429eb1de50aa7c50e4b1cc985f9f5893affe4b73f9935"
	SbomArtifactType      = "application/spdx+json"
	SignatureArtifactType = "application/vnd.cncf.notary.signature"
)

Variables

This section is empty.

Functions

func CreateNewTestStoreForNestedSbom

func CreateNewTestStoreForNestedSbom() referrerstore.ReferrerStore

Types

type MemoryTestStore added in v1.1.0

type MemoryTestStore struct {
	Subjects  map[digest.Digest]*ocispecs.SubjectDescriptor
	Referrers map[digest.Digest][]ocispecs.ReferenceDescriptor
	Manifests map[digest.Digest]ocispecs.ReferenceManifest
	Blobs     map[digest.Digest][]byte
}

func (*MemoryTestStore) GetBlobContent added in v1.1.0

func (store *MemoryTestStore) GetBlobContent(_ context.Context, _ common.Reference, digest digest.Digest) ([]byte, error)

func (*MemoryTestStore) GetConfig added in v1.1.0

func (store *MemoryTestStore) GetConfig() *config.StoreConfig

func (*MemoryTestStore) GetReferenceManifest added in v1.1.0

func (*MemoryTestStore) GetSubjectDescriptor added in v1.1.0

func (store *MemoryTestStore) GetSubjectDescriptor(_ context.Context, subjectReference common.Reference) (*ocispecs.SubjectDescriptor, error)

func (*MemoryTestStore) ListReferrers added in v1.1.0

func (*MemoryTestStore) Name added in v1.1.0

func (store *MemoryTestStore) Name() string

type TestStore

type TestStore struct {
	References   []ocispecs.ReferenceDescriptor
	ResolveMap   map[string]digest.Digest
	ExtraSubject string
}

func (*TestStore) GetBlobContent

func (s *TestStore) GetBlobContent(_ context.Context, _ common.Reference, _ digest.Digest) ([]byte, error)

func (*TestStore) GetConfig

func (s *TestStore) GetConfig() *config.StoreConfig

func (*TestStore) GetSubjectDescriptor

func (s *TestStore) GetSubjectDescriptor(_ context.Context, subjectReference common.Reference) (*ocispecs.SubjectDescriptor, error)

func (*TestStore) Name

func (s *TestStore) Name() string

Jump to

Keyboard shortcuts

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