constants

package
v2.1.2+incompatible Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2019 License: Apache-2.0 Imports: 1 Imported by: 13

Documentation

Overview

Common vars and constants, shared by many parts of the bagman library.

Index

Constants

View Source
const (
	APTrustNamespace        = "urn:mace:aptrust.org"
	ReceiveBucketPrefix     = "aptrust.receiving."
	ReceiveTestBucketPrefix = "aptrust.receiving.test."
	RestoreBucketPrefix     = "aptrust.restore."
	S3DateFormat            = "2006-01-02T15:04:05.000Z"
	// All S3 urls begin with this.
	S3UriPrefix = "https://s3.amazonaws.com/"
)
View Source
const (
	StatusStarted   = "Started"
	StatusPending   = "Pending"
	StatusSuccess   = "Success"
	StatusFailed    = "Failed"
	StatusCancelled = "Cancelled"
)

Status enumerations match values defined in https://github.com/APTrust/fluctus/blob/develop/config/application.rb

View Source
const (
	StageRequested     = "Requested"
	StageReceive       = "Receive"
	StageFetch         = "Fetch"
	StageUnpack        = "Unpack" // TODO: Delete if we're no longer using this.
	StageValidate      = "Validate"
	StageStore         = "Store"
	StageRecord        = "Record"
	StageCleanup       = "Cleanup"
	StageResolve       = "Resolve"
	StagePackage       = "Package"
	StageRestoring     = "Restoring"
	StageAvailableInS3 = "Available in S3"
)

Stage enumerations match values defined in https://github.com/APTrust/fluctus/blob/develop/config/application.rb

View Source
const (
	ActionIngest         = "Ingest"
	ActionFixityCheck    = "Fixity Check"
	ActionGlacierRestore = "Glacier Restore"
	ActionRestore        = "Restore"
	ActionDelete         = "Delete"
	ActionDPN            = "DPN"
)
View Source
const (
	StorageStandard      = "Standard"
	StorageGlacierVA     = "Glacier-VA"
	StorageGlacierOH     = "Glacier-OH"
	StorageGlacierOR     = "Glacier-OR"
	StorageGlacierDeepVA = "Glacier-Deep-VA"
	StorageGlacierDeepOH = "Glacier-Deep-OH"
	StorageGlacierDeepOR = "Glacier-Deep-OR"
)
View Source
const (
	DPNTaskSync        = "sync"
	DPNTaskIngest      = "ingest"
	DPNTaskReplication = "replication"
	DPNTaskRestore     = "restore"
	DPNTaskFixity      = "fixity"
)

DPN task types

View Source
const (
	AlgMd5    = "md5"
	AlgSha256 = "sha256"
)
View Source
const (
	IdTypeStorageURL = "url"
	IdTypeBagAndPath = "bag/filepath"
)
View Source
const (
	AWSVirginia = "us-east-1"
	AWSOhio     = "us-east-2"
	AWSOregon   = "us-west-2"
)

AWS Regions (the ones we're using for storage)

View Source
const (
	PAYLOAD_FILE     = "payload_file"
	PAYLOAD_MANIFEST = "payload_manifest"
	TAG_MANIFEST     = "tag_manifest"
	TAG_FILE         = "tag_file"
)

GenericFile types. GenericFile.IngestFileType

View Source
const (
	// The process of assigning access rights.
	// For APTrust, access can be "restricted", "institution" or "consortia".
	// This is not part of the LOC standard, and LOC has no analog for
	// this event. APTrust has been using this event since the repository's
	// inception. In the old system, it was access_assignment.
	EventAccessAssignment = "access assignment"

	// The process whereby a repository actively obtains an object.
	EventCapture = "capture"

	// The process of coding data to save storage space or transmission time.
	EventCompression = "compression"

	// The act of creating a new object.
	EventCreation = "creation"

	// The process of removing an object from the inventory of a repository.
	EventDeaccession = "deaccession"

	// The process of reversing the effects of compression.
	EventDecompression = "decompression"

	//The process of converting encrypted data to plain text.
	EventDecryption = "decryption"

	// The process of removing an object from repository storage.
	EventDeletion = "deletion"

	// The process by which a message digest ("hash") is created.
	// This was fixity_generation in the first iteration of APTrust's
	// software.
	EventDigestCalculation = "message digest calculation"

	// The process of verifying that an object has not been changed in a given period.
	EventFixityCheck = "fixity check"

	// The process of assigning an identifier to an object or file.
	// This one is not in the LOC spec, but APTrust has been using
	// it since the repository's inception, and there is no LOC analog.
	EventIdentifierAssignment = "identifier assignment"

	// The process of adding objects to a preservation repository.
	// Was "ingest" in the first iteration of the repository.
	EventIngestion = "ingestion"

	// A transformation of an object creating a version in a more contemporary format.
	EventMigration = "migration"

	// A transformation of an object creating a version more conducive to preservation.
	EventNormalization = "normalization"

	// The process of creating a copy of an object that is, bit-wise, identical to the original.
	EventReplication = "replication"

	// The process of determining that a decrypted digital signature matches an expected value.
	EventSignatureValidation = "digital signature validation"

	// The process of comparing an object with a standard and noting compliance or exceptions.
	EventValidation = "validation"

	// The process of scanning a file for malicious programs.
	EventVirusCheck = "virus check"
)

PREMIS Event types as defined by the Library of Congress at http://id.loc.gov/search/?q=&q=cs%3Ahttp%3A%2F%2Fid.loc.gov%2Fvocabulary%2Fpreservation%2FeventType#

View Source
const APTrustSystemUser = "system@aptrust.org"

APTrustSystemUser is the APTrust system user in Pharos.

View Source
const OutcomeFailure = "Failure"
View Source
const OutcomeSuccess = "Success"

Event outcomes

View Source
const S3LargeFileSize = 100 * 1024 * 1024 // 100MB

S3LargeFileSize is the largest file size we'll allow Amazon's S3 chunked uploader to handle. If a file is larger than this, we'll chunk it ourselves, so that jackass AWS library doesn't try to read the whole thing into memory.

Variables

View Source
var APTrustFileNamePattern = regexp.MustCompile("^([A-Za-z0-9])$|^([A-Za-z0-9\\._][A-Za-z0-9\\.\\-_%]+)$")

APTrustFileNamePattern matches a valid APTrust file name, according to the spec at https://sites.google.com/a/aptrust.org/member-wiki/basic-operations/bagging This regex says a valid file name can be exactly one alpha-numeric character, or 2+ characters, beginning with alpha-numerics or dot or underscore, followed by alphanumerics, dots, underscores, dashes and percent signs.

View Source
var AccessRights []string = []string{
	"consortia",
	"institution",
	"restricted",
}

List of valid APTrust IntellectualObject AccessRights.

View Source
var ChecksumAlgorithms = []string{AlgMd5, AlgSha256}

GlacierStandardOptions lists all of the Glacier Deep Archive storage options (excludes Glacier standard options).

GlacierStandardOptions lists all of the standard Glacier storage options (NOT Glacier Deep Archive).

View Source
var MultipartSuffix = regexp.MustCompile("\\.b\\d+\\.of\\d+$")

The tar files that make up multipart bags include a suffix that follows this pattern. For example, after stripping off the .tar suffix, you'll have a name like "my_bag.b04.of12"

View Source
var PermissivePattern = regexp.MustCompile("[^\\a\\f\\t\\n\\r\\v]+")

Permissive matches anything that does not contain ASCII bells, form-feeds, tabs, newlines, carriage returns or vertical tabs.

Not that even when we use this permissive pattern, our validator will still reject file names that appear to contain UTF-8 control characters. See Util.ContainsControlCharacter() and util.LooksLikeEscapedControl().

View Source
var PosixFileNamePattern = regexp.MustCompile("^[A-Za-z0-9\\._\\-]+$")

PosixFileNamePattern matches valid POSIX filenames.

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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