store

package
v0.0.0-...-1196ed7 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Store

type Store interface {
	StoreCurrentBlock(ctx context.Context, process string, height uint64) error
	CurrentBlock(ctx context.Context, process string) (uint64, error)

	StorePendingEvent(ctx context.Context, pendingEvent *types.GatewayEvent) error
	DeletePendingEvent(ctx context.Context, pendingEvent *types.GatewayEvent) error
	CleanOldPendingEvents(ctx context.Context, height uint64) error
	PendingEventsForOwner(ctx context.Context, owner common.Address) ([]*types.GatewayEvent, error)

	StoreEvent(ctx context.Context, event *types.GatewayEvent) error
	EventsFromTo(ctx context.Context, from, to uint64) ([]*types.GatewayEvent, error)
	FirstEvent(ctx context.Context) (*types.GatewayEvent, error)
	GetEvents(ctx context.Context, gatewayID types.ID, limit int, cursor string) ([]*types.GatewayEvent, string, error)
	GetEventsBetween(ctx context.Context, start, end time.Time) ([]*types.GatewayEvent, error)

	StoreHistory(ctx context.Context, history *types.GatewayHistory) error
	GetHistoryAt(ctx context.Context, id types.ID, at time.Time) (*types.GatewayHistory, error)

	Store(ctx context.Context, gateway *types.Gateway) error
	Delete(ctx context.Context, id types.ID) error
	Get(ctx context.Context, id types.ID) (*types.Gateway, error)
	GetByOwner(ctx context.Context, owner common.Address, limit int, cursor string) ([]*types.Gateway, string, error)
	GetAll(ctx context.Context) ([]*types.Gateway, error)

	GetRes3CountPerRes0(ctx context.Context) (map[h3light.Cell]map[h3light.Cell]uint64, error)
	GetCountInCellAtRes(ctx context.Context, cell h3light.Cell, res int) (map[h3light.Cell]uint64, error)
	GetInCell(ctx context.Context, cell h3light.Cell) ([]*types.Gateway, error)

	StoreGatewayOnboard(ctx context.Context, onboarder common.Address, gatewayID types.ID, owner common.Address, signature string, version uint8, localId string) error
	GetGatewayOnboardsByOwner(ctx context.Context, onboarder common.Address, owner common.Address, limit int, cursor string) ([]*models.GatewayOnboard, string, error)
	GetGatewayOnboardByGatewayID(ctx context.Context, gatewayID string) (*models.GatewayOnboard, error)

	PurgeExpiredOnboards(ctx context.Context, expiry time.Duration) error
}

func NewStore

func NewStore() (Store, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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