Documentation ¶
Index ¶
- Variables
- type Storage
- func (s *Storage) Close() (err error)
- func (s *Storage) Get(ctx context.Context, keyHash authdb.KeyHash) (record *authdb.Record, err error)
- func (s *Storage) HealthCheck(ctx context.Context) (err error)
- func (s *Storage) MigrateToLatest(ctx context.Context) error
- func (s *Storage) Put(ctx context.Context, keyHash authdb.KeyHash, record *authdb.Record) (err error)
- func (s *Storage) Run(ctx context.Context) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // Error is a class of spannerauthmigration errors. Error = errs.Class("spannerauthmigration") )
Functions ¶
This section is empty.
Types ¶
type Storage ¶
type Storage struct {
// contains filtered or unexported fields
}
Storage is an implementation of the Storage interface for migrating from badgerauth source backend to the spannerauth destination backend. It proxies requests to avoid downtime.
func New ¶
func New(log *zap.Logger, src *badgerauth.Node, dst *spannerauth.CloudDatabase) *Storage
New constructs a new Storage.
func (*Storage) Get ¶
func (s *Storage) Get(ctx context.Context, keyHash authdb.KeyHash) (record *authdb.Record, err error)
Get gets the record, retrieving it from the source backend if it doesn't exist in the destination backend.
func (*Storage) HealthCheck ¶
HealthCheck attempts to do a database roundtrip and returns an error if it can't.
func (*Storage) MigrateToLatest ¶
MigrateToLatest migrates existing records from the source to destination backends.
Click to show internal directories.
Click to hide internal directories.