logentry

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2022 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrDataNotFound = errors.New("data not found")

ErrDataNotFound is returned when data is not found.

Functions

This section is empty.

Types

type EntryIterator

type EntryIterator interface {
	// TotalItems returns the total number of items as a result of the query.
	TotalItems() (int, error)
	// Next returns the next log entry or an ErrNotFound error if there are no more items.
	Next() (*command.LeafEntry, error)
	// Close closes the iterator.
	Close() error
}

EntryIterator defines the query results iterator for log entry queries.

type EntryStatus

type EntryStatus string

EntryStatus defines valid values for log entry status.

const (

	// EntryStatusSuccess defines "success" status.
	EntryStatusSuccess EntryStatus = "success"

	// EntryStatusFailed defines "failed" status.
	EntryStatusFailed EntryStatus = "failed"
)

type LogEntry

type LogEntry struct {
	Index     int               `json:"index"`
	LeafEntry command.LeafEntry `json:"leafEntry"`
	LogURL    string            `json:"logUrl"`
	Status    EntryStatus       `json:"status"`
}

LogEntry consists of index with log and leaf entry.

type Option

type Option func(opts *Store)

Option is an option for log entry store.

type Store

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

Store is db implementation of log entry store.

func New

func New(provider storage.Provider, opts ...Option) (*Store, error)

New creates db implementation of log entries.

func (*Store) FailLogEntriesFrom

func (s *Store) FailLogEntriesFrom(logURL string, start uint64) error

FailLogEntriesFrom updates all log entries from start (until end) and tags them with status=failure.

func (*Store) GetFailedLogEntries

func (s *Store) GetFailedLogEntries(logURL string) (EntryIterator, error)

GetFailedLogEntries retrieves failed log entries.

func (*Store) GetLogEntries

func (s *Store) GetLogEntries(logURL string) (EntryIterator, error)

GetLogEntries retrieves log entries.

func (*Store) GetLogEntriesFrom

func (s *Store) GetLogEntriesFrom(logURL string, start uint64) (EntryIterator, error)

GetLogEntriesFrom retrieves log entries from index start.

func (*Store) StoreLogEntries

func (s *Store) StoreLogEntries(logURL string, start, end uint64, entries []command.LeafEntry) error

StoreLogEntries stores log entries.

Jump to

Keyboard shortcuts

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