model

package
v1.17.0 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

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
	Traveler   bool
	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 added in v0.17.0

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) Active added in v0.24.0

func (pk *ImportFilePublicKey) Active() bool

func (*ImportFilePublicKey) Future added in v0.24.0

func (pk *ImportFilePublicKey) Future() bool

func (*ImportFilePublicKey) PublicKey

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

func (*ImportFilePublicKey) Revoke added in v0.24.0

func (pk *ImportFilePublicKey) Revoke()

Jump to

Keyboard shortcuts

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