redis

package
v1.0.3-beta Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2023 License: LGPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type NonceStorage

type NonceStorage struct {
	Client *redis.Client
}

func NewNonceStorage

func NewNonceStorage(client *redis.Client) NonceStorage

func (*NonceStorage) GetNonce

func (r *NonceStorage) GetNonce(signerAddress string) (uint64, error)

GetNonce returns the saved nonce for the given signer address. While signer address will generally be a go-ethereum/common.Address, no verification happens at the redis storage level. Any string can be used for the signerAddress.

func (*NonceStorage) SetNonce

func (r *NonceStorage) SetNonce(signerAddress string, nonce uint64) error

SetNonce saves the given nonce value with the given signer address. Any string can be used for the signer address, and no nonce verification takes place.

type Options

type Options = redis.Options

type SchemaStorage

type SchemaStorage struct {
	Client *redis.Client
}

func NewSchemaStorage

func NewSchemaStorage(client *redis.Client) SchemaStorage

func (*SchemaStorage) GetSchema

func (r *SchemaStorage) GetSchema(componentName string) ([]byte, error)

func (*SchemaStorage) SetSchema

func (r *SchemaStorage) SetSchema(componentName string, schemaData []byte) error

type Storage

type Storage struct {
	Namespace string
	Client    *redis.Client
	Log       zerolog.Logger
	Nonce     NonceStorage
	Schema    SchemaStorage
}

func NewRedisStorage

func NewRedisStorage(options Options, namespace string) Storage

func (*Storage) Close

func (r *Storage) Close() error

Jump to

Keyboard shortcuts

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