Documentation

Overview

    Package model is a model abstraction of export import configuration and status.

    Index

    Constants

    View Source
    const (
    	ImportFileOpen     = "OPEN"
    	ImportFilePending  = "PENDING"
    	ImportFileComplete = "COMPLETE"
    	ImportFileFailed   = "FAILED"
    )

    Variables

    This section is empty.

    Functions

    This section is empty.

    Types

    type ExportImport

    type ExportImport struct {
    	ID         int64
    	IndexFile  string
    	ExportRoot string
    	Region     string
    	From       time.Time
    	Thru       *time.Time
    }

      ExportImport represents the configuration of a set of export files to be imported into this server, by pointing at the index file and remote root directory.

      func (*ExportImport) Active

      func (ei *ExportImport) Active() bool

        Active returns true if the ExportImport configuration is currently active based on From and Thru times.

        func (*ExportImport) Validate

        func (ei *ExportImport) Validate() error

          Validate checks the contents of an ExportImport file. This is a utility function for the admin console.

          type ImportFile

          type ImportFile struct {
          	ID             int64
          	ExportImportID int64
          	ZipFilename    string
          	DiscoveredAt   time.Time
          	ProcessedAt    *time.Time
          	Status         string
          	Retries        uint
          }

            ImportFile represents an individual export file that is scheduled for, or has been attempted or imported into the system.

            func (*ImportFile) ShouldTry

            func (f *ImportFile) ShouldTry(retryRate time.Duration) bool

              ShouldTry performs some introspection on an import file from the DB, and returns true if that file should be tried for download.

              type ImportFilePublicKey

              type ImportFilePublicKey struct {
              	ExportImportID int64
              	KeyID          string
              	KeyVersion     string
              	PublicKeyPEM   string
              	From           time.Time
              	Thru           *time.Time
              }

                ImportFilePublicKey represents a possible signing key for export files being imported into this system. A given ExportImportID can have more than one associated key, and more than one that is currently valid.

                func (*ImportFilePublicKey) PublicKey

                func (pk *ImportFilePublicKey) PublicKey() (*ecdsa.PublicKey, error)