store

package
v1.2.14-prerelease07 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package store is a generated GoMock package.

Index

Constants

This section is empty.

Variables

View Source
var (
	// SeparatorToken is used to separate entries written to blobstore
	SeparatorToken = []byte("\r\n")
	// Timeout is the timeout used for blobstore requests
	Timeout = time.Second * 10
)

Functions

This section is empty.

Types

type ExecutionWriter

type ExecutionWriter interface {
	Add(interface{}) error
	Flush() error
	FlushedKeys() *Keys
}

ExecutionWriter is used to write entities (FixOutputEntity or ScanOutputEntity) to blobstore

func NewBlobstoreWriter

func NewBlobstoreWriter(
	uuid string,
	extension Extension,
	client blobstore.Client,
	flushThreshold int,
) ExecutionWriter

NewBlobstoreWriter constructs a new blobstore writer

type Extension

type Extension string

Extension is the type which indicates the file extension type

const (
	// SkippedExtension is the extension for files which contain skips
	SkippedExtension Extension = "skipped"
	// FailedExtension is the extension for files which contain failures
	FailedExtension Extension = "failed"
	// FixedExtension is the extension for files which contain fixes
	FixedExtension Extension = "fixed"
	// CorruptedExtension is the extension for files which contain corruptions
	CorruptedExtension Extension = "corrupted"
)

type FixOutputEntity

type FixOutputEntity struct {
	Execution interface{}
	Input     ScanOutputEntity
	Result    invariant.ManagerFixResult
}

FixOutputEntity represents a single execution that should be durably recorded by fix. It contains the ScanOutputEntity that was given as input to fix.

type Keys

type Keys struct {
	UUID      string
	MinPage   int
	MaxPage   int
	Extension Extension
}

Keys indicate the keys which were uploaded during a scan or fix. Keys are constructed as uuid_page.extension. MinPage and MaxPage are both inclusive and pages are sequential, meaning from this struct all pages can be deterministically constructed.

type MockExecutionWriter

type MockExecutionWriter struct {
	// contains filtered or unexported fields
}

MockExecutionWriter is a mock of ExecutionWriter interface.

func NewMockExecutionWriter

func NewMockExecutionWriter(ctrl *gomock.Controller) *MockExecutionWriter

NewMockExecutionWriter creates a new mock instance.

func (*MockExecutionWriter) Add

func (m *MockExecutionWriter) Add(arg0 interface{}) error

Add mocks base method.

func (*MockExecutionWriter) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockExecutionWriter) Flush

func (m *MockExecutionWriter) Flush() error

Flush mocks base method.

func (*MockExecutionWriter) FlushedKeys

func (m *MockExecutionWriter) FlushedKeys() *Keys

FlushedKeys mocks base method.

type MockExecutionWriterMockRecorder

type MockExecutionWriterMockRecorder struct {
	// contains filtered or unexported fields
}

MockExecutionWriterMockRecorder is the mock recorder for MockExecutionWriter.

func (*MockExecutionWriterMockRecorder) Add

func (mr *MockExecutionWriterMockRecorder) Add(arg0 interface{}) *gomock.Call

Add indicates an expected call of Add.

func (*MockExecutionWriterMockRecorder) Flush

Flush indicates an expected call of Flush.

func (*MockExecutionWriterMockRecorder) FlushedKeys

func (mr *MockExecutionWriterMockRecorder) FlushedKeys() *gomock.Call

FlushedKeys indicates an expected call of FlushedKeys.

type MockScanOutputIterator

type MockScanOutputIterator struct {
	// contains filtered or unexported fields
}

MockScanOutputIterator is a mock of ScanOutputIterator interface.

func NewMockScanOutputIterator

func NewMockScanOutputIterator(ctrl *gomock.Controller) *MockScanOutputIterator

NewMockScanOutputIterator creates a new mock instance.

func (*MockScanOutputIterator) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockScanOutputIterator) HasNext

func (m *MockScanOutputIterator) HasNext() bool

HasNext mocks base method.

func (*MockScanOutputIterator) Next

Next mocks base method.

type MockScanOutputIteratorMockRecorder

type MockScanOutputIteratorMockRecorder struct {
	// contains filtered or unexported fields
}

MockScanOutputIteratorMockRecorder is the mock recorder for MockScanOutputIterator.

func (*MockScanOutputIteratorMockRecorder) HasNext

HasNext indicates an expected call of HasNext.

func (*MockScanOutputIteratorMockRecorder) Next

Next indicates an expected call of Next.

type ScanOutputEntity

type ScanOutputEntity struct {
	Execution interface{}
	Result    invariant.ManagerCheckResult
}

ScanOutputEntity represents a single execution that should be durably recorded by Scan.

type ScanOutputIterator

type ScanOutputIterator interface {
	// Next returns the next ScanOutputEntity found. Any error reading from underlying store
	// or converting store entry to ScanOutputEntity will result in an error after which iterator cannot be used.
	Next() (*ScanOutputEntity, error)
	// HasNext indicates if the iterator has a next element. If HasNext is true it is
	// guaranteed that Next will return a nil error and non-nil ScanOutputEntity.
	HasNext() bool
}

ScanOutputIterator gets ScanOutputEntities from underlying store

func NewBlobstoreIterator

func NewBlobstoreIterator(
	ctx context.Context,
	client blobstore.Client,
	keys Keys,
	entity entity.Entity,
) ScanOutputIterator

NewBlobstoreIterator constructs a new iterator backed by blobstore.

Jump to

Keyboard shortcuts

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