storage

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2019 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bolt

type Bolt struct {
	*None
	// contains filtered or unexported fields
}

func (*Bolt) Get

func (b *Bolt) Get(ctx context.Context, indices []int) (wordsList [][]*ktkn.Word, ok bool, err error)

func (*Bolt) Set

func (b *Bolt) Set(ctx context.Context, indices []int, wordsList [][]*ktkn.Word) error

type CloudStorageClient

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

func (*CloudStorageClient) Get

func (b *CloudStorageClient) Get(ctx context.Context, indices []int) ([][]*ktkn.Word, bool, error)

func (*CloudStorageClient) SaveWordsList

func (b *CloudStorageClient) SaveWordsList(ctx context.Context, indices []int, wordsList [][]*ktkn.Word) (err error)

type FireStore

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

func NewFireStore

func NewFireStore(ctx context.Context, filePath string, rootCollectionName string, projectId string) (_ *FireStore, err error)

func (*FireStore) Get

func (f *FireStore) Get(ctx context.Context, indices []int) ([][]*ktkn.Word, bool, error)

func (*FireStore) ResetProgress

func (f *FireStore) ResetProgress(ctx context.Context) error

func (*FireStore) Set

func (f *FireStore) Set(ctx context.Context, indices []int, wordsList [][]*ktkn.Word) error

func (*FireStore) Start

func (f *FireStore) Start(ctx context.Context, indices []int) error

type Memory

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

func NewMemory

func NewMemory() *Memory

func NewMemoryWithOtherStorage

func NewMemoryWithOtherStorage(storage Storage) *Memory

func (*Memory) Get

func (m *Memory) Get(ctx context.Context, indices []int) ([][]*ktkn.Word, bool, error)

func (*Memory) ResetProgress

func (m *Memory) ResetProgress(ctx context.Context) error

func (*Memory) Set

func (m *Memory) Set(ctx context.Context, indices []int, wordsList [][]*ktkn.Word) error

func (*Memory) Start

func (m *Memory) Start(ctx context.Context, indices []int) error

type MemoryCache

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

func (MemoryCache) Get

func (mc MemoryCache) Get(key string) ([][]*ktkn.Word, bool)

func (MemoryCache) Set

func (mc MemoryCache) Set(key string, wordsList [][]*ktkn.Word)

type None

type None struct{}

func (*None) Get

func (e *None) Get(ctx context.Context, indices []int) ([][]*ktkn.Word, bool, error)

func (*None) ResetProgress

func (e *None) ResetProgress(ctx context.Context) error

func (*None) Set

func (e *None) Set(ctx context.Context, indices []int, wordsList [][]*ktkn.Word) error

func (*None) Start

func (e *None) Start(ctx context.Context, indices []int) error

type Storage

type Storage interface {
	Start(ctx context.Context, indices []int) error
	ResetProgress(ctx context.Context) error
	Set(ctx context.Context, indices []int, wordsList [][]*ktkn.Word) error
	Get(ctx context.Context, indices []int) ([][]*ktkn.Word, bool, error)
}

func NewBolt

func NewBolt(dbPath string) (Storage, error)

type Type

type Type string
var BoltType Type = "bolt"
var GCPType Type = "gcp"
var MemoryType Type = "memory"

func GetStorageTypes

func GetStorageTypes() []Type

Jump to

Keyboard shortcuts

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