datastore

package
v0.0.0-...-42ea651 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const NotFound = StoreError("not found")

Variables

This section is empty.

Functions

This section is empty.

Types

type DataStore

type DataStore interface {
	GetSize(ctx context.Context) (int64, error)
	GetDocList(cursor uint64, count int64, ctx context.Context) ([]string, uint64, error)
	SetDocument(key string, doc *canvas.Canvas, ctx context.Context) error
	GetDocument(key string, ctx context.Context) (*canvas.Canvas, error)
	DeleteDocument(key string, ctx context.Context) error
}

type RedisDataStore

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

func New

func New(options *RedisOptions, ctx context.Context) (*RedisDataStore, error)

New creates a new RedisDataStore instance and check the connectivity to the Redis instance.

func (*RedisDataStore) DeleteDocument

func (s *RedisDataStore) DeleteDocument(key string, ctx context.Context) error

func (*RedisDataStore) GetDocList

func (s *RedisDataStore) GetDocList(cursor uint64, count int64, ctx context.Context) ([]string, uint64, error)

func (*RedisDataStore) GetDocument

func (s *RedisDataStore) GetDocument(key string, ctx context.Context) (*canvas.Canvas, error)

func (*RedisDataStore) GetSize

func (s *RedisDataStore) GetSize(ctx context.Context) (int64, error)

func (*RedisDataStore) SetDocument

func (s *RedisDataStore) SetDocument(key string, doc *canvas.Canvas, ctx context.Context) error

type RedisOptions

type RedisOptions struct {
	redis.Options
}

type StoreError

type StoreError string

func (StoreError) Error

func (s StoreError) Error() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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