sqllog

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2020 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RowsToEvents

func RowsToEvents(rows *sql.Rows) (int64, int64, []*server.Event, error)

Types

type Dialect

type Dialect interface {
	ListCurrent(ctx context.Context, prefix string, limit int64, includeDeleted bool) (*sql.Rows, error)
	List(ctx context.Context, prefix, startKey string, limit, revision int64, includeDeleted bool) (*sql.Rows, error)
	Count(ctx context.Context, prefix string) (int64, int64, error)
	CurrentRevision(ctx context.Context) (int64, error)
	After(ctx context.Context, prefix string, rev, limit int64) (*sql.Rows, error)
	Insert(ctx context.Context, key string, create, delete bool, createRevision, previousRevision int64, ttl int64, value, prevValue []byte) (int64, error)
	GetRevision(ctx context.Context, revision int64) (*sql.Rows, error)
	DeleteRevision(ctx context.Context, revision int64) error
	GetCompactRevision(ctx context.Context) (int64, error)
	SetCompactRevision(ctx context.Context, revision int64) error
	Compact(ctx context.Context, revision int64) (int64, error)
	Fill(ctx context.Context, revision int64) error
	IsFill(key string) bool
	BeginTx(ctx context.Context, opts *sql.TxOptions) (*generic.Tx, error)
}

type SQLLog

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

func New

func New(d Dialect) *SQLLog

func (*SQLLog) After

func (s *SQLLog) After(ctx context.Context, prefix string, revision, limit int64) (int64, []*server.Event, error)

func (*SQLLog) Append

func (s *SQLLog) Append(ctx context.Context, event *server.Event) (int64, error)

func (*SQLLog) Count

func (s *SQLLog) Count(ctx context.Context, prefix string) (int64, int64, error)

func (*SQLLog) CurrentRevision

func (s *SQLLog) CurrentRevision(ctx context.Context) (int64, error)

func (*SQLLog) List

func (s *SQLLog) List(ctx context.Context, prefix, startKey string, limit, revision int64, includeDeleted bool) (int64, []*server.Event, error)

func (*SQLLog) Start

func (s *SQLLog) Start(ctx context.Context) (err error)

func (*SQLLog) Watch

func (s *SQLLog) Watch(ctx context.Context, prefix string) <-chan []*server.Event

Jump to

Keyboard shortcuts

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