package testonly

import "github.com/google/monologue/storage/testonly"

Package testonly contains fakes for use in tests that interact with storage.

Index

Types

type FakeRootsReader

type FakeRootsReader struct {
	// RootSetChan is returned by WatchRoots.
	RootSetChan chan storage.RootSetID
	// RootCerts maps RootSetIDs to sets of certificates. It is used by ReadRoots.
	RootSetCerts map[storage.RootSetID][]*x509.Certificate
}

FakeRootsReader returns preset values in order to fulfill the storage.RootsReader interface.

func (*FakeRootsReader) ReadRoots

func (f *FakeRootsReader) ReadRoots(ctx context.Context, rootSet storage.RootSetID) ([]*x509.Certificate, error)

ReadRoots returns FakeRootsReader.RootSetCerts[rootSet].

func (*FakeRootsReader) WatchRoots

func (f *FakeRootsReader) WatchRoots(ctx context.Context, l *ctlog.Log) (<-chan storage.RootSetID, error)

WatchRoots returns FakeRootsReader.RootSetChan.

Source Files

roots.go

Version
v0.0.0-20230315160450-1dc62842925e (latest)
Published
Mar 15, 2023
Platform
linux/amd64
Imports
4 packages
Last checked
1 day ago

Tools for package owners.