storage

package
v0.0.0-...-2ab9c96 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2020 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultTimeout = 5 * time.Second
View Source
const KeyFormat = "lock-account-%s"
View Source
const TTL = 10 * time.Second

Variables

This section is empty.

Functions

This section is empty.

Types

type MongoClient

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

func NewMongoClient

func NewMongoClient(collection *mongo.Collection) *MongoClient

func (*MongoClient) All

func (cli *MongoClient) All(ctx context.Context, aID account.ID) ([]*movement.Movement, error)

func (*MongoClient) Create

func (cli *MongoClient) Create(ctx context.Context, m *movement.Movement) error

func (*MongoClient) Last

func (cli *MongoClient) Last(ctx context.Context, id account.ID) (*movement.Movement, error)

type RedisClient

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

func NewRedisClient

func NewRedisClient(redis *redis.Client) *RedisClient

func (*RedisClient) Lock

func (cli *RedisClient) Lock(ctx context.Context, id account.ID, key string) error

func (*RedisClient) Unlock

func (cli *RedisClient) Unlock(ctx context.Context, id account.ID, key string) error

Jump to

Keyboard shortcuts

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