spannerauthmigration

package
v1.77.0 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: AGPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

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) Close

func (s *Storage) Close() (err error)

Close closes the database.

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

func (s *Storage) HealthCheck(ctx context.Context) (err error)

HealthCheck attempts to do a database roundtrip and returns an error if it can't.

func (*Storage) MigrateToLatest

func (s *Storage) MigrateToLatest(ctx context.Context) error

MigrateToLatest migrates existing records from the source to destination backends.

func (*Storage) Put

func (s *Storage) Put(ctx context.Context, keyHash authdb.KeyHash, record *authdb.Record) (err error)

Put stores the record, writing it to both source and destination backends.

func (*Storage) Run

func (s *Storage) Run(ctx context.Context) error

Run runs the server and associated servers.

Jump to

Keyboard shortcuts

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