Documentation ¶
Overview ¶
Package badgerauthmigration helps move to badgerauth from sqlauth.
Index ¶
- Variables
- type Config
- type KV
- func (kv *KV) Close() (err error)
- func (*KV) DeleteUnused(context.Context, time.Duration, int, int) (int64, int64, map[string]int64, error)
- func (kv *KV) Get(ctx context.Context, keyHash authdb.KeyHash) (record *authdb.Record, err error)
- func (kv *KV) MigrateToLatest(ctx context.Context) error
- func (kv *KV) PingDB(ctx context.Context) (err error)
- func (kv *KV) Put(ctx context.Context, keyHash authdb.KeyHash, record *authdb.Record) (err error)
- func (kv *KV) Run(ctx context.Context) error
Constants ¶
This section is empty.
Variables ¶
View Source
var Error = errs.Class("badgerauthmigration")
Error is the default error class for the badgerauthmigration package.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { MigrationSelectSize int `user:"true" help:"page size while performing migration" default:"1000"` SourceSQLAuthKVBackend string `user:"true" help:"source key/value store backend (must be sqlauth) url" default:""` }
Config represents config for KV.
type KV ¶
type KV struct {
// contains filtered or unexported fields
}
KV is an implementation of the KV interface that helps move from sqlauth to badgerauth backend by incorporating both, implementing migration and proxying requests to both backends to avoid downtime.
func (*KV) DeleteUnused ¶
func (*KV) DeleteUnused(context.Context, time.Duration, int, int) (int64, int64, map[string]int64, error)
DeleteUnused is not implemented.
func (*KV) Get ¶
Get retrieves the record from the key/value store. It returns nil if the key does not exist. If the record is invalid, the error contains why.
func (*KV) MigrateToLatest ¶
MigrateToLatest migrates all existing records at passed sqlauth to the new badgerauth backend.
Click to show internal directories.
Click to hide internal directories.