Documentation ¶
Overview ¶
Package documentlog is a generated GoMock package.
Index ¶
- Variables
- type ConsistencyHashListStatistic
- type DocumentLog
- type DocumentQueue
- type LastConsistencyHashStatistic
- type LogSizeStatistic
- type MockDocumentLog
- func (m *MockDocumentLog) AddDocument(arg0 model.Document) error
- func (m *MockDocumentLog) AddDocumentContents(hash model.Hash, contents io.Reader) (*model.Document, error)
- func (m *MockDocumentLog) AddDocumentWithContents(timestamp time.Time, documentType string, contents io.Reader) (*model.Document, error)
- func (m *MockDocumentLog) Configure(store store.DocumentStore)
- func (m *MockDocumentLog) Documents() ([]model.DocumentDescriptor, error)
- func (m *MockDocumentLog) EXPECT() *MockDocumentLogMockRecorder
- func (m *MockDocumentLog) FindByContentsHash(hash model.Hash) ([]model.DocumentDescriptor, error)
- func (m *MockDocumentLog) GetDocument(hash model.Hash) (*model.DocumentDescriptor, error)
- func (m *MockDocumentLog) GetDocumentContents(hash model.Hash) (io.ReadCloser, error)
- func (m *MockDocumentLog) HasContentsForDocument(hash model.Hash) (bool, error)
- func (m *MockDocumentLog) Start()
- func (m *MockDocumentLog) Statistics() []stats.Statistic
- func (m *MockDocumentLog) Stop()
- func (m *MockDocumentLog) Subscribe(documentType string) DocumentQueue
- type MockDocumentLogMockRecorder
- func (mr *MockDocumentLogMockRecorder) AddDocument(arg0 interface{}) *gomock.Call
- func (mr *MockDocumentLogMockRecorder) AddDocumentContents(hash, contents interface{}) *gomock.Call
- func (mr *MockDocumentLogMockRecorder) AddDocumentWithContents(timestamp, documentType, contents interface{}) *gomock.Call
- func (mr *MockDocumentLogMockRecorder) Configure(store interface{}) *gomock.Call
- func (mr *MockDocumentLogMockRecorder) Documents() *gomock.Call
- func (mr *MockDocumentLogMockRecorder) FindByContentsHash(hash interface{}) *gomock.Call
- func (mr *MockDocumentLogMockRecorder) GetDocument(hash interface{}) *gomock.Call
- func (mr *MockDocumentLogMockRecorder) GetDocumentContents(hash interface{}) *gomock.Call
- func (mr *MockDocumentLogMockRecorder) HasContentsForDocument(hash interface{}) *gomock.Call
- func (mr *MockDocumentLogMockRecorder) Start() *gomock.Call
- func (mr *MockDocumentLogMockRecorder) Statistics() *gomock.Call
- func (mr *MockDocumentLogMockRecorder) Stop() *gomock.Call
- func (mr *MockDocumentLogMockRecorder) Subscribe(documentType interface{}) *gomock.Call
- type MockDocumentQueue
- type MockDocumentQueueMockRecorder
- type MockPublisher
- type MockPublisherMockRecorder
- type NumberOfDocumentsStatistic
- type Publisher
Constants ¶
This section is empty.
Variables ¶
var AdvertHashInterval = 2 * time.Second
var ErrMissingDocumentContents = errors.New("we don't have the contents for the document (yet)")
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 (d ConsistencyHashListStatistic) Name() string
func (ConsistencyHashListStatistic) String ¶
func (d ConsistencyHashListStatistic) String() 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 ¶
LastConsistencyHashStatistic holds the last consistency hash stored on the DocumentLog.
func (LastConsistencyHashStatistic) Name ¶
func (d LastConsistencyHashStatistic) Name() string
func (LastConsistencyHashStatistic) String ¶
func (d LastConsistencyHashStatistic) String() 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 ¶
func (m *MockDocumentLog) EXPECT() *MockDocumentLogMockRecorder
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) Statistics ¶
func (m *MockDocumentLog) Statistics() []stats.Statistic
Statistics 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 ¶
func (mr *MockDocumentLogMockRecorder) Start() *gomock.Call
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 ¶
func (mr *MockDocumentLogMockRecorder) Stop() *gomock.Call
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 ¶
func (m *MockDocumentQueue) EXPECT() *MockDocumentQueueMockRecorder
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 ¶
func (mr *MockDocumentQueueMockRecorder) Get() *gomock.Call
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
func (m *MockPublisher) EXPECT() *MockPublisherMockRecorder
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 (d NumberOfDocumentsStatistic) Name() string
func (NumberOfDocumentsStatistic) String ¶
func (d NumberOfDocumentsStatistic) String() 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.