storage

package
v0.24.0 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DeleteLogsRequest

type DeleteLogsRequest struct {
	Condition string
	// IDs is the list of Log IDs should be deleted.
	IDs []string
	// MarkOnly allows not to delete the records physically, but mark it for deletion
	MarkOnly bool
}

DeleteLogsRequest specifies the DeleteLogs parameters

type Log

type Log interface {
	// AppendRecords allows to insert records into the log by its ID
	AppendRecords(ctx context.Context, request *solaris.AppendRecordsRequest) (*solaris.AppendRecordsResult, error)
	// QueryRecords allows to retrieve records by the request. The function returns the selected records and the flag,
	// that more records potentially available for the read
	QueryRecords(ctx context.Context, request QueryRecordsRequest) ([]*solaris.Record, bool, error)
	// CountRecords count total number for records in the log and number of records after (before)
	// specified record ID which match the request condition. Returned values are (total, count, error).
	CountRecords(ctx context.Context, request QueryRecordsRequest) (uint64, uint64, error)
}

Log interface exposes an API for working with a Log records.

type LogHelper

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

func NewLogHelper

func NewLogHelper() *LogHelper

func (*LogHelper) AppendRecords

func (l *LogHelper) AppendRecords(ctx context.Context, request *solaris.AppendRecordsRequest) (*solaris.AppendRecordsResult, error)

func (*LogHelper) CountRecords added in v0.22.0

func (l *LogHelper) CountRecords(ctx context.Context, request QueryRecordsRequest) (uint64, uint64, error)

func (*LogHelper) QueryRecords

func (l *LogHelper) QueryRecords(ctx context.Context, request QueryRecordsRequest) ([]*solaris.Record, bool, error)

type Logs

type Logs interface {
	// CreateLog creates a new log and returns its descriptor with the new ID
	CreateLog(ctx context.Context, log *solaris.Log) (*solaris.Log, error)
	// GetLogByID returns Log by its ID. It returns the errors.ErrNotExist if the log is marked for delete,
	// or it doesn't exist
	GetLogByID(ctx context.Context, id string) (*solaris.Log, error)
	// UpdateLog update the Log object information. The Log is matched by the log ID
	UpdateLog(ctx context.Context, log *solaris.Log) (*solaris.Log, error)
	// QueryLogs returns the list of Log objects matched to the query request
	QueryLogs(ctx context.Context, qr QueryLogsRequest) (*solaris.QueryLogsResult, error)
	// DeleteLogs allows to either mark or delete logs permanently
	DeleteLogs(ctx context.Context, request DeleteLogsRequest) (*solaris.DeleteLogsResult, error)
}

Logs provides an interface to manage the logs meta-information

type QueryLogsRequest

type QueryLogsRequest struct {
	Condition string
	// IDs is the list of Log IDs should be selected. If the value is not empty, the Condition field is disregarded
	IDs []string
	// Deleted search between deleted
	Deleted bool
	Page    string
	Limit   int64
}

QueryLogsRequest is used for selecting list of known logs

type QueryRecordsRequest

type QueryRecordsRequest struct {
	// Condition defines the filtering constrains
	Condition string
	// LogID where records should be read
	LogID string
	// descending specifies that the result should be sorted in the descending order
	Descending bool
	// StartID provides the first record ID it can be read (inclusive)
	StartID string
	// limit contains the number of records to be returned
	Limit int64
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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