migrate_cache

package
v0.0.0-...-fdc8e6b Latest Latest
Warning

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

Go to latest
Published: May 13, 2022 License: Unlicense Imports: 10 Imported by: 0

Documentation

Overview

Migrate from bolt to badger

Index

Constants

View Source
const (
	MIGRATION_FINISHED     = "it has finished"
	MIGRATION_NOT_FINISHED = "not finished"
)
View Source
const MIN_RECACHE_TTL = time.Duration(1) * time.Minute

Variables

View Source
var ErrCompactionFinished = errors.New("compaction has finished")

Functions

This section is empty.

Types

type MigrateCache

type MigrateCache struct {
	*MigrateCacheConfig
}

func NewMigrateCache

func NewMigrateCache(cfg *MigrateCacheConfig) (*MigrateCache, error)

func (*MigrateCache) Close

func (mc *MigrateCache) Close()

func (*MigrateCache) Flush

func (mc *MigrateCache) Flush() error

func (*MigrateCache) GetMigrationStatus

func (mc *MigrateCache) GetMigrationStatus() (finished bool, keyMarker string)

func (*MigrateCache) Insert

func (mc *MigrateCache) Insert(key string, value []byte) error

func (*MigrateCache) InsertTTL

func (mc *MigrateCache) InsertTTL(key string, value []byte, ttl time.Duration) error

func (*MigrateCache) Len

func (mc *MigrateCache) Len() uint

func (*MigrateCache) Migrate

func (mc *MigrateCache) Migrate()

func (*MigrateCache) Name

func (mc *MigrateCache) Name() string

func (*MigrateCache) Remove

func (mc *MigrateCache) Remove(key string) error

func (*MigrateCache) Retrieve

func (mc *MigrateCache) Retrieve(key string) ([]byte, error)

func (*MigrateCache) SetMigrationStatus

func (mc *MigrateCache) SetMigrationStatus(finished bool, keyMarker string) error

func (*MigrateCache) Size

func (mc *MigrateCache) Size() uint64

func (*MigrateCache) Start

func (mc *MigrateCache) Start()

func (*MigrateCache) Stop

func (mc *MigrateCache) Stop()

func (*MigrateCache) TTL

func (mc *MigrateCache) TTL(key string) (time.Duration, error)

Probably won't be used too much

type MigrateCacheConfig

type MigrateCacheConfig struct {
	cache.CacheConfig
	bolt_cache.BoltCacheConfig
	badger_cache.BadgerCacheConfig
	OldCache *bolt_cache.BoltCache
	NewCache *badger_cache.BadgerCache
	// contains filtered or unexported fields
}

func (*MigrateCacheConfig) RegisterFlags

func (c *MigrateCacheConfig) RegisterFlags(f *flag.FlagSet, cacheID string)

Jump to

Keyboard shortcuts

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