Documentation ¶
Overview ¶
Package database is a database interface for export importing.
Index ¶
- type ExportImportDB
- func (db *ExportImportDB) ActiveConfigs(ctx context.Context) ([]*model.ExportImport, error)
- func (db *ExportImportDB) AddConfig(ctx context.Context, ei *model.ExportImport) error
- func (db *ExportImportDB) AddImportFilePublicKey(ctx context.Context, ifpk *model.ImportFilePublicKey) error
- func (db *ExportImportDB) AllowedKeys(ctx context.Context, ei *model.ExportImport) ([]*model.ImportFilePublicKey, error)
- func (db *ExportImportDB) CompleteImportFile(ctx context.Context, ef *model.ImportFile, status string) error
- func (db *ExportImportDB) CreateNewFilesAndFailOld(ctx context.Context, ei *model.ExportImport, filenames []string) (int, int, error)
- func (db *ExportImportDB) ExpireImportFilePublicKey(ctx context.Context, ifpk *model.ImportFilePublicKey) error
- func (db *ExportImportDB) GetAllImportFiles(ctx context.Context, lockDuration time.Duration, ei *model.ExportImport) ([]*model.ImportFile, error)
- func (db *ExportImportDB) GetConfig(ctx context.Context, id int64) (*model.ExportImport, error)
- func (db *ExportImportDB) GetOpenImportFiles(ctx context.Context, lockDuration, retryRate time.Duration, ...) ([]*model.ImportFile, error)
- func (db *ExportImportDB) LeaseImportFile(ctx context.Context, lockDuration time.Duration, ef *model.ImportFile) error
- func (db *ExportImportDB) ListConfigs(ctx context.Context) ([]*model.ExportImport, error)
- func (db *ExportImportDB) UpdateConfig(ctx context.Context, c *model.ExportImport) error
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
}
func New ¶
func New(db *database.DB) *ExportImportDB
func (*ExportImportDB) ActiveConfigs ¶
func (db *ExportImportDB) ActiveConfigs(ctx context.Context) ([]*model.ExportImport, error)
func (*ExportImportDB) AddConfig ¶
func (db *ExportImportDB) AddConfig(ctx context.Context, ei *model.ExportImport) error
func (*ExportImportDB) AddImportFilePublicKey ¶
func (db *ExportImportDB) AddImportFilePublicKey(ctx context.Context, ifpk *model.ImportFilePublicKey) error
func (*ExportImportDB) AllowedKeys ¶
func (db *ExportImportDB) AllowedKeys(ctx context.Context, ei *model.ExportImport) ([]*model.ImportFilePublicKey, error)
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)
func (*ExportImportDB) UpdateConfig ¶ added in v0.12.1
func (db *ExportImportDB) UpdateConfig(ctx context.Context, c *model.ExportImport) error
UpdateConfig updates an existing ExportImporter.
Click to show internal directories.
Click to hide internal directories.