documentlog

package
v0.16.0 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2021 License: GPL-3.0 Imports: 16 Imported by: 0

Documentation

Overview

Package documentlog is a generated GoMock package.

Index

Constants

This section is empty.

Variables

View Source
var AdvertHashInterval = 2 * time.Second
View Source
var ErrMissingDocumentContents = errors.New("we don't have the contents for the document (yet)")
View Source
var ErrUnknownDocument = errors.New("unknown document")

Functions

This section is empty.

Types

type ConsistencyHashListStatistic

type ConsistencyHashListStatistic struct {
	// Hashes contains all consistency hashes
	Hashes []string
}

ConsistencyHashListStatistic holds an ordered list of all consistency hashes on the Document Log.

func (ConsistencyHashListStatistic) Name

func (ConsistencyHashListStatistic) String

type DocumentLog

type DocumentLog interface {
	Publisher
	proto.HashSource
	stats.StatsProvider
	// Configure configures this DocumentLog. Must be called before Start().
	Configure(store store.DocumentStore)
	// Starts the document log.
	Start()
	// Stops the document log.
	Stop()
}

DocumentLog defines the API for the DocumentLog layer, used to store/retrieve chained documents.

func NewDocumentLog

func NewDocumentLog(protocol proto.Protocol) DocumentLog

type DocumentQueue

type DocumentQueue interface {
	// Get gets a document from the queue. It blocks until:
	// - There's a document to return
	// - The queue is closed by the producer
	// When the queue is closed this function an error and no document.
	Get() *model.Document
}

DocumentQueue is a blocking queue which allows callers to wait for documents to come in.

type LastConsistencyHashStatistic

type LastConsistencyHashStatistic struct {
	// Hash is the last consistency hash.
	Hash model.Hash
}

LastConsistencyHashStatistic holds the last consistency hash stored on the DocumentLog.

func (LastConsistencyHashStatistic) Name

func (LastConsistencyHashStatistic) String

type LogSizeStatistic

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

LogSizeStatistic holds the storage size of all stored document contents (in bytes).

func (LogSizeStatistic) Name

func (d LogSizeStatistic) Name() string

func (LogSizeStatistic) String

func (d LogSizeStatistic) String() string

type MockDocumentLog

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

MockDocumentLog is a mock of DocumentLog interface

func NewMockDocumentLog

func NewMockDocumentLog(ctrl *gomock.Controller) *MockDocumentLog

NewMockDocumentLog creates a new mock instance

func (*MockDocumentLog) AddDocument

func (m *MockDocumentLog) AddDocument(arg0 model.Document) error

AddDocument mocks base method

func (*MockDocumentLog) AddDocumentContents

func (m *MockDocumentLog) AddDocumentContents(hash model.Hash, contents io.Reader) (*model.Document, error)

AddDocumentContents mocks base method

func (*MockDocumentLog) AddDocumentWithContents

func (m *MockDocumentLog) AddDocumentWithContents(timestamp time.Time, documentType string, contents io.Reader) (*model.Document, error)

AddDocumentWithContents mocks base method

func (*MockDocumentLog) Configure

func (m *MockDocumentLog) Configure(store store.DocumentStore)

Configure mocks base method

func (*MockDocumentLog) Documents

func (m *MockDocumentLog) Documents() ([]model.DocumentDescriptor, error)

Documents mocks base method

func (*MockDocumentLog) EXPECT

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

func (*MockDocumentLog) FindByContentsHash added in v0.16.0

func (m *MockDocumentLog) FindByContentsHash(hash model.Hash) ([]model.DocumentDescriptor, error)

FindByContentsHash mocks base method

func (*MockDocumentLog) GetDocument

func (m *MockDocumentLog) GetDocument(hash model.Hash) (*model.DocumentDescriptor, error)

GetDocument mocks base method

func (*MockDocumentLog) GetDocumentContents

func (m *MockDocumentLog) GetDocumentContents(hash model.Hash) (io.ReadCloser, error)

GetDocumentContents mocks base method

func (*MockDocumentLog) HasContentsForDocument

func (m *MockDocumentLog) HasContentsForDocument(hash model.Hash) (bool, error)

HasContentsForDocument mocks base method

func (*MockDocumentLog) Start

func (m *MockDocumentLog) Start()

Start mocks base method

func (*MockDocumentLog) Statistics

func (m *MockDocumentLog) Statistics() []stats.Statistic

Statistics mocks base method

func (*MockDocumentLog) Stop

func (m *MockDocumentLog) Stop()

Stop mocks base method

func (*MockDocumentLog) Subscribe

func (m *MockDocumentLog) Subscribe(documentType string) DocumentQueue

Subscribe mocks base method

type MockDocumentLogMockRecorder

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

MockDocumentLogMockRecorder is the mock recorder for MockDocumentLog

func (*MockDocumentLogMockRecorder) AddDocument

func (mr *MockDocumentLogMockRecorder) AddDocument(arg0 interface{}) *gomock.Call

AddDocument indicates an expected call of AddDocument

func (*MockDocumentLogMockRecorder) AddDocumentContents

func (mr *MockDocumentLogMockRecorder) AddDocumentContents(hash, contents interface{}) *gomock.Call

AddDocumentContents indicates an expected call of AddDocumentContents

func (*MockDocumentLogMockRecorder) AddDocumentWithContents

func (mr *MockDocumentLogMockRecorder) AddDocumentWithContents(timestamp, documentType, contents interface{}) *gomock.Call

AddDocumentWithContents indicates an expected call of AddDocumentWithContents

func (*MockDocumentLogMockRecorder) Configure

func (mr *MockDocumentLogMockRecorder) Configure(store interface{}) *gomock.Call

Configure indicates an expected call of Configure

func (*MockDocumentLogMockRecorder) Documents

func (mr *MockDocumentLogMockRecorder) Documents() *gomock.Call

Documents indicates an expected call of Documents

func (*MockDocumentLogMockRecorder) FindByContentsHash added in v0.16.0

func (mr *MockDocumentLogMockRecorder) FindByContentsHash(hash interface{}) *gomock.Call

FindByContentsHash indicates an expected call of FindByContentsHash

func (*MockDocumentLogMockRecorder) GetDocument

func (mr *MockDocumentLogMockRecorder) GetDocument(hash interface{}) *gomock.Call

GetDocument indicates an expected call of GetDocument

func (*MockDocumentLogMockRecorder) GetDocumentContents

func (mr *MockDocumentLogMockRecorder) GetDocumentContents(hash interface{}) *gomock.Call

GetDocumentContents indicates an expected call of GetDocumentContents

func (*MockDocumentLogMockRecorder) HasContentsForDocument

func (mr *MockDocumentLogMockRecorder) HasContentsForDocument(hash interface{}) *gomock.Call

HasContentsForDocument indicates an expected call of HasContentsForDocument

func (*MockDocumentLogMockRecorder) Start

Start indicates an expected call of Start

func (*MockDocumentLogMockRecorder) Statistics

func (mr *MockDocumentLogMockRecorder) Statistics() *gomock.Call

Statistics indicates an expected call of Statistics

func (*MockDocumentLogMockRecorder) Stop

Stop indicates an expected call of Stop

func (*MockDocumentLogMockRecorder) Subscribe

func (mr *MockDocumentLogMockRecorder) Subscribe(documentType interface{}) *gomock.Call

Subscribe indicates an expected call of Subscribe

type MockDocumentQueue

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

MockDocumentQueue is a mock of DocumentQueue interface

func NewMockDocumentQueue

func NewMockDocumentQueue(ctrl *gomock.Controller) *MockDocumentQueue

NewMockDocumentQueue creates a new mock instance

func (*MockDocumentQueue) EXPECT

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

func (*MockDocumentQueue) Get

func (m *MockDocumentQueue) Get() *model.Document

Get mocks base method

type MockDocumentQueueMockRecorder

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

MockDocumentQueueMockRecorder is the mock recorder for MockDocumentQueue

func (*MockDocumentQueueMockRecorder) Get

Get indicates an expected call of Get

type MockPublisher added in v0.16.0

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

MockPublisher is a mock of Publisher interface

func NewMockPublisher added in v0.16.0

func NewMockPublisher(ctrl *gomock.Controller) *MockPublisher

NewMockPublisher creates a new mock instance

func (*MockPublisher) EXPECT added in v0.16.0

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

func (*MockPublisher) Subscribe added in v0.16.0

func (m *MockPublisher) Subscribe(documentType string) DocumentQueue

Subscribe mocks base method

type MockPublisherMockRecorder added in v0.16.0

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

MockPublisherMockRecorder is the mock recorder for MockPublisher

func (*MockPublisherMockRecorder) Subscribe added in v0.16.0

func (mr *MockPublisherMockRecorder) Subscribe(documentType interface{}) *gomock.Call

Subscribe indicates an expected call of Subscribe

type NumberOfDocumentsStatistic

type NumberOfDocumentsStatistic struct {
	NumberOfDocuments int
}

NumberOfDocumentsStatistic holds the number of documents stored on the DocumentLog.

func (NumberOfDocumentsStatistic) Name

func (NumberOfDocumentsStatistic) String

type Publisher

type Publisher interface {
	// Subscribe creates a subscription for incoming documents with the specified type. It can be read from using the
	// returned DocumentQueue. There can be multiple subscribers for the same document type. The returned queue MUST
	// read from since it has an internal buffer which blocks the producer (the DocumentLog) when full.
	Subscribe(documentType string) DocumentQueue // TODO: Subscribe is a bad name when returning a blocking queue
}

Publisher is a PubSub interface for documents on the document log.

Directories

Path Synopsis
Package store is a generated GoMock package.
Package store is a generated GoMock package.

Jump to

Keyboard shortcuts

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