Documentation ¶
Overview ¶
Migrate from bolt to badger
Index ¶
- Constants
- Variables
- type MigrateCache
- func (mc *MigrateCache) Close()
- func (mc *MigrateCache) Flush() error
- func (mc *MigrateCache) GetMigrationStatus() (finished bool, keyMarker string)
- func (mc *MigrateCache) Insert(key string, value []byte) error
- func (mc *MigrateCache) InsertTTL(key string, value []byte, ttl time.Duration) error
- func (mc *MigrateCache) Len() uint
- func (mc *MigrateCache) Migrate()
- func (mc *MigrateCache) Name() string
- func (mc *MigrateCache) Remove(key string) error
- func (mc *MigrateCache) Retrieve(key string) ([]byte, error)
- func (mc *MigrateCache) SetMigrationStatus(finished bool, keyMarker string) error
- func (mc *MigrateCache) Size() uint64
- func (mc *MigrateCache) Start()
- func (mc *MigrateCache) Stop()
- func (mc *MigrateCache) TTL(key string) (time.Duration, error)
- type MigrateCacheConfig
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) 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) 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()
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)
Click to show internal directories.
Click to hide internal directories.