db

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2021 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	DbRootDir           string
	ListingURL          string
	ValidateByHashOnGet bool
}

type Curator

type Curator struct {
	// contains filtered or unexported fields
}

func NewCurator

func NewCurator(cfg Config) Curator

func (*Curator) Delete

func (c *Curator) Delete() error

Delete removes the DB and metadata file for this specific schema.

func (*Curator) GetStore

func (c *Curator) GetStore() (db.StoreReader, error)

func (*Curator) ImportFrom

func (c *Curator) ImportFrom(dbArchivePath string) error

ImportFrom takes a DB archive file and imports it into the final DB location.

func (*Curator) IsUpdateAvailable

func (c *Curator) IsUpdateAvailable() (bool, *curation.ListingEntry, error)

IsUpdateAvailable indicates if there is a new update available as a boolean, and returns the latest listing information available for this schema.

func (*Curator) Status

func (c *Curator) Status() Status

func (*Curator) Update

func (c *Curator) Update() (bool, error)

Update the existing DB, returning an indication if any action was taken.

func (*Curator) UpdateTo

func (c *Curator) UpdateTo(listing *curation.ListingEntry, downloadProgress, importProgress *progress.Manual, stage *progress.Stage) error

UpdateTo updates the existing DB with the specific other version provided from a listing entry.

func (*Curator) Validate

func (c *Curator) Validate() error

Validate checks the current database to ensure file integrity and if it can be used by this version of the application.

type Status

type Status struct {
	Age                   time.Time
	CurrentSchemaVersion  int
	RequiredSchemaVersion int
	Location              string
	Err                   error
}

Jump to

Keyboard shortcuts

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