Documentation ¶
Index ¶
- Constants
- type DataStore
- type RedisDataStore
- func (s *RedisDataStore) DeleteDocument(key string, ctx context.Context) error
- func (s *RedisDataStore) GetDocList(cursor uint64, count int64, ctx context.Context) ([]string, uint64, error)
- func (s *RedisDataStore) GetDocument(key string, ctx context.Context) (*canvas.Canvas, error)
- func (s *RedisDataStore) GetSize(ctx context.Context) (int64, error)
- func (s *RedisDataStore) SetDocument(key string, doc *canvas.Canvas, ctx context.Context) error
- type RedisOptions
- type StoreError
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 (*RedisDataStore) GetDocument ¶
func (*RedisDataStore) GetSize ¶
func (s *RedisDataStore) GetSize(ctx context.Context) (int64, error)
func (*RedisDataStore) SetDocument ¶
type RedisOptions ¶
type RedisOptions struct {
redis.Options
}
type StoreError ¶
type StoreError string
func (StoreError) Error ¶
func (s StoreError) Error() string
Click to show internal directories.
Click to hide internal directories.