log

package
v0.0.0-...-2300135 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Collection

type Collection struct {
	ID                              string
	RecordCompactionOffsetPosition  int64
	RecordEnumerationOffsetPosition int64
}

type DBTX

type DBTX interface {
	Exec(context.Context, string, ...interface{}) (pgconn.CommandTag, error)
	Query(context.Context, string, ...interface{}) (pgx.Rows, error)
	QueryRow(context.Context, string, ...interface{}) pgx.Row
	CopyFrom(ctx context.Context, tableName pgx.Identifier, columnNames []string, rowSrc pgx.CopyFromSource) (int64, error)
}

type GetAllCollectionsToCompactRow

type GetAllCollectionsToCompactRow struct {
	CollectionID string
	Offset       int64
	Timestamp    int64
	Rank         int64
}

type GetRecordsForCollectionParams

type GetRecordsForCollectionParams struct {
	CollectionID string
	Offset       int64
	Limit        int32
	Timestamp    int64
}

type InsertCollectionParams

type InsertCollectionParams struct {
	ID                              string
	RecordEnumerationOffsetPosition int64
	RecordCompactionOffsetPosition  int64
}

type InsertRecordParams

type InsertRecordParams struct {
	CollectionID string
	Offset       int64
	Record       []byte
	Timestamp    int64
}

type Queries

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

func New

func New(db DBTX) *Queries

func (*Queries) DeleteCollection

func (q *Queries) DeleteCollection(ctx context.Context, collectionIds []string) error

func (*Queries) DeleteRecords

func (q *Queries) DeleteRecords(ctx context.Context, collectionIds []string) error

func (*Queries) GetAllCollections

func (q *Queries) GetAllCollections(ctx context.Context) ([]string, error)

func (*Queries) GetAllCollectionsToCompact

func (q *Queries) GetAllCollectionsToCompact(ctx context.Context, minCompactionSize int64) ([]GetAllCollectionsToCompactRow, error)

func (*Queries) GetCollectionForUpdate

func (q *Queries) GetCollectionForUpdate(ctx context.Context, id string) (Collection, error)

func (*Queries) GetLastCompactedOffset

func (q *Queries) GetLastCompactedOffset(ctx context.Context, id string) (int64, error)

func (*Queries) GetRecordsForCollection

func (q *Queries) GetRecordsForCollection(ctx context.Context, arg GetRecordsForCollectionParams) ([]RecordLog, error)

func (*Queries) GetTotalUncompactedRecordsCount

func (q *Queries) GetTotalUncompactedRecordsCount(ctx context.Context) (int64, error)

func (*Queries) InsertCollection

func (q *Queries) InsertCollection(ctx context.Context, arg InsertCollectionParams) (Collection, error)

func (*Queries) InsertRecord

func (q *Queries) InsertRecord(ctx context.Context, arg []InsertRecordParams) (int64, error)

func (*Queries) PurgeRecords

func (q *Queries) PurgeRecords(ctx context.Context) error

func (*Queries) UpdateCollectionCompactionOffsetPosition

func (q *Queries) UpdateCollectionCompactionOffsetPosition(ctx context.Context, arg UpdateCollectionCompactionOffsetPositionParams) error

func (*Queries) UpdateCollectionEnumerationOffsetPosition

func (q *Queries) UpdateCollectionEnumerationOffsetPosition(ctx context.Context, arg UpdateCollectionEnumerationOffsetPositionParams) error

func (*Queries) WithTx

func (q *Queries) WithTx(tx pgx.Tx) *Queries

type RecordLog

type RecordLog struct {
	Offset       int64
	CollectionID string
	Timestamp    int64
	Record       []byte
}

type UpdateCollectionCompactionOffsetPositionParams

type UpdateCollectionCompactionOffsetPositionParams struct {
	ID                             string
	RecordCompactionOffsetPosition int64
}

type UpdateCollectionEnumerationOffsetPositionParams

type UpdateCollectionEnumerationOffsetPositionParams struct {
	ID                              string
	RecordEnumerationOffsetPosition int64
}

Jump to

Keyboard shortcuts

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