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

          func (*ExportImportDB) CompleteImportFile

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

          func (*ExportImportDB) CreateNewFilesAndFailOld

          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

            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

              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

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

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

                    UpdateConfig updates an existing ExportImporter.

                    Source Files