cache_converter

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: 18 Imported by: 0

Documentation

Overview

cache_converter is the go between to migrate to/from v3/4 To read the source data, it needs to loop through all it's keys For this reason, it will likely only ever support Redis (on v3) and BoltCache on v4

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CacheConverter

type CacheConverter struct {
	Cfg      Config
	Cachesv4 struct {
		UUID     cache.Cache
		UserData cache.Cache
	}
	Cachesv3 struct {
		UUID     legacy_storage.Storage
		UserData legacy_storage.Storage
	}
	Now time.Time
}

func New

func New(cfg Config) (*CacheConverter, error)

func (*CacheConverter) MigrateUUIDV3toV4

func (cc *CacheConverter) MigrateUUIDV3toV4()

V3 -> V4

func (*CacheConverter) MigrateUUIDV4toV3

func (cc *CacheConverter) MigrateUUIDV4toV3()

V4 -> V3

func (*CacheConverter) MigrateUserDataV3toV4

func (cc *CacheConverter) MigrateUserDataV3toV4()

V3 -> V4

func (*CacheConverter) MigrateUserDataV4toV3

func (cc *CacheConverter) MigrateUserDataV4toV3()

V4 -> V3

type CacheInsertProcessor

type CacheInsertProcessor func(string, []byte, time.Duration) error

type Config

type Config struct {
	Logger log.Logger
	MinTTL time.Duration

	CacheUUIDv4     *cache_config.Config `yaml:"cache_uuid"`
	CacheUserDatav4 *cache_config.Config `yaml:"cache_userdata"`

	CacheUUIDv3     *RedisConfig `yaml:"cachev3_uuid"`
	CacheUserDatav3 *RedisConfig `yaml:"cachev3_userdata"`
}

func (*Config) RegisterFlags

func (c *Config) RegisterFlags(f *flag.FlagSet)

type IteratingProcessor

type IteratingProcessor func(k string, v []byte, ttl time.Duration)

type RedisConfig

type RedisConfig radix.RedisConfig

func (*RedisConfig) RegisterFlags

func (rc *RedisConfig) RegisterFlags(f *flag.FlagSet, cacheID string)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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