database

package
v0.24.0 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package database is a database interface for export importing.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ExportImportDB

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

ExportImportDB contains database methods for managing with export-import configs.

func New

func New(db *database.DB) *ExportImportDB

func (*ExportImportDB) ActiveConfigs

func (db *ExportImportDB) ActiveConfigs(ctx context.Context) ([]*model.ExportImport, error)

ActiveConfigs returns the active export import configurations.

func (*ExportImportDB) AddConfig

func (db *ExportImportDB) AddConfig(ctx context.Context, ei *model.ExportImport) error

AddConfig saves a new ExportImport configuration.

func (*ExportImportDB) AddImportFilePublicKey

func (db *ExportImportDB) AddImportFilePublicKey(ctx context.Context, ifpk *model.ImportFilePublicKey) error

func (*ExportImportDB) AllPublicKeys added in v0.24.0

func (db *ExportImportDB) AllPublicKeys(ctx context.Context, ei *model.ExportImport) ([]*model.ImportFilePublicKey, error)

func (*ExportImportDB) AllowedKeys

func (*ExportImportDB) CompleteImportFile

func (db *ExportImportDB) CompleteImportFile(ctx context.Context, ef *model.ImportFile, status string) error

func (*ExportImportDB) CreateNewFilesAndFailOld added in v0.17.0

func (db *ExportImportDB) CreateNewFilesAndFailOld(ctx context.Context, ei *model.ExportImport, filenames []string) (int, int, error)

CreateNewFilesAndFailOld creates all the specified files named, returning the number of created files, and the number moved to an failed state.

func (*ExportImportDB) ExpireImportFilePublicKey

func (db *ExportImportDB) ExpireImportFilePublicKey(ctx context.Context, ifpk *model.ImportFilePublicKey) error

func (*ExportImportDB) GetAllImportFiles added in v0.17.0

func (db *ExportImportDB) GetAllImportFiles(ctx context.Context, lockDuration time.Duration, ei *model.ExportImport) ([]*model.ImportFile, error)

GetAllImportFiles returns all input files for a config, regardless of their state. This function is used for testing.

func (*ExportImportDB) GetConfig added in v0.12.1

func (db *ExportImportDB) GetConfig(ctx context.Context, id int64) (*model.ExportImport, error)

GetConfig gets the configuration for the given id.

func (*ExportImportDB) GetOpenImportFiles

func (db *ExportImportDB) GetOpenImportFiles(ctx context.Context, lockDuration, retryRate time.Duration, ei *model.ExportImport) ([]*model.ImportFile, error)

func (*ExportImportDB) LeaseImportFile

func (db *ExportImportDB) LeaseImportFile(ctx context.Context, lockDuration time.Duration, ef *model.ImportFile) error

func (*ExportImportDB) ListConfigs added in v0.12.1

func (db *ExportImportDB) ListConfigs(ctx context.Context) ([]*model.ExportImport, error)

ListConfigs lists all configs (active and inactive). This is a utility method for the admin console.

func (*ExportImportDB) SavePublicKeyTimestamps added in v0.24.0

func (db *ExportImportDB) SavePublicKeyTimestamps(ctx context.Context, ifpk *model.ImportFilePublicKey) error

func (*ExportImportDB) UpdateConfig added in v0.12.1

func (db *ExportImportDB) UpdateConfig(ctx context.Context, c *model.ExportImport) error

UpdateConfig updates an existing ExportImporter.

Jump to

Keyboard shortcuts

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