rdbprojectionbase

package
v1.3.24 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const DEFAULT_TABLE = "projections"

Variables

This section is empty.

Functions

This section is empty.

Types

type Base

type Base struct {
	projection_usecase.Base
	// contains filtered or unexported fields
}

Base is a bas for projection which keeps track of last handled event height using relational database. It implements Id() and GetLastHandledEventHeight() of projection interface.

func NewRDbBase

func NewRDbBase(rdbHandle *rdb.Handle, projectionId string) *Base

Create a new Base using table name in the RDb to keep the projection handling records

func NewRDbBaseWithOptions

func NewRDbBaseWithOptions(rdbHandle *rdb.Handle, projectionId string, options Options) *Base

func (*Base) GetLastHandledEventHeight

func (base *Base) GetLastHandledEventHeight() (*int64, error)

Implements projection.GetLastHandledEventHeight()

func (*Base) UpdateLastHandledEventHeight

func (base *Base) UpdateLastHandledEventHeight(rdbHandle *rdb.Handle, height int64) error

type Options

type Options struct {
	// Customize table name in the RDb to keep the projection block handling records
	MaybeTable *string
}

type Store

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

Store is an implementation of the RDbStore

func NewStore

func NewStore(table string) *Store

func (*Store) GetLastHandledEventHeight

func (impl *Store) GetLastHandledEventHeight(rdbHandle *rdb.Handle, projectionId string) (*int64, error)

GetLastHandledEventHeight returns the last handled event height, nil if no event has been handled

func (*Store) UpdateLastHandledEventHeight

func (impl *Store) UpdateLastHandledEventHeight(rdbHandle *rdb.Handle, projectionId string, height int64) error

UpdateLastHandledEventHeight update last handled event height of projection id to provided height

Jump to

Keyboard shortcuts

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