datagateway

package
v0.0.0-...-8c998e4 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2023 License: BSD-3-Clause Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const EnsRedisKey = "demo:ens"

Use Redis Hash Map to store entity.ENS, with ID as field (sub-key)

View Source
const PoolFactoryRedisKey = "demo:poolfactory"

Variables

This section is empty.

Functions

func HandleRedisErr

func HandleRedisErr(err error, action, key string) error

wraps it with superwather.ErrRecordNotFound.

Types

type DebugDataGateway

type DebugDataGateway interface {
	WriteLogs() []WriteLog
}

type MockDataGatewayENS

type MockDataGatewayENS struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func (*MockDataGatewayENS) DelENS

func (s *MockDataGatewayENS) DelENS(ctx context.Context, ens *entity.ENS) error

func (*MockDataGatewayENS) GetENS

func (s *MockDataGatewayENS) GetENS(ctx context.Context, ensID string) (*entity.ENS, error)

func (*MockDataGatewayENS) GetENSes

func (s *MockDataGatewayENS) GetENSes(context.Context) ([]*entity.ENS, error)

func (*MockDataGatewayENS) SetENS

func (s *MockDataGatewayENS) SetENS(ctx context.Context, ens *entity.ENS) error

func (*MockDataGatewayENS) WriteLogs

func (s *MockDataGatewayENS) WriteLogs() []WriteLog

type MockDataGatewayPoolFactory

type MockDataGatewayPoolFactory struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func (*MockDataGatewayPoolFactory) DelPool

func (*MockDataGatewayPoolFactory) GetPool

func (*MockDataGatewayPoolFactory) GetPools

func (*MockDataGatewayPoolFactory) SetPool

func (*MockDataGatewayPoolFactory) WriteLogs

func (s *MockDataGatewayPoolFactory) WriteLogs() []WriteLog

type RedisClient

type RedisClient interface {
	Set(context.Context, string, interface{}, time.Duration) *redis.StatusCmd
	Get(ctx context.Context, key string) *redis.StringCmd
	Close() error
}

type RepositoryENS

type RepositoryENS interface {
	SetENS(context.Context, *entity.ENS) error
	GetENS(context.Context, string) (*entity.ENS, error)
	GetENSes(context.Context) ([]*entity.ENS, error)
	DelENS(context.Context, *entity.ENS) error
}

func NewEnsDataGateway

func NewEnsDataGateway(redisCli *redis.Client) RepositoryENS

func NewMockDataGatewayENS

func NewMockDataGatewayENS() RepositoryENS

type RepositoryPoolFactory

func NewDataGatewayPoolFactory

func NewDataGatewayPoolFactory(redisCli *redis.Client) RepositoryPoolFactory

func NewMockDataGatewayPoolFactory

func NewMockDataGatewayPoolFactory() RepositoryPoolFactory

type WriteLog

type WriteLog string

func (WriteLog) Unmarshal

func (s WriteLog) Unmarshal() (string, string, uint64, common.Hash, error)

For demotest code

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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