glacier

package
v1.3.2 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2026 License: MIT Imports: 28 Imported by: 0

README

S3 Glacier

Parity grade: A · SDK aws-sdk-go-v2/service/glacier@v1.35.4 · last audited 2026-08-10 (f8ae77eb7c84189d9fca29cce357a9cfaf72fd9c)

Coverage

Metric Value
Operations audited 33 (33 ok)
Feature families 5 (5 ok)
Known gaps 2
Deferred items 0
Resource leaks clean
Known gaps
  • select_sql_subset: "VERIFIED 2026-08-10 against awsdocs/amazon-glacier-developer-guide's doc_source/s3-glacier-select-sql-reference*.md (the real SQL reference, shared verbatim with S3 Select except where a page says '(Amazon S3 Select only)'). Correct-as-is: JOINs/subqueries are genuinely unsupported by real Glacier Select too ('Amazon S3 Select and S3 Glacier Select queries currently do not support subqueries or joins' -- s3-glacier-select-sql-reference-select.md), so gopherstack's lack of joins is not a gap. Real gaps (real Glacier Select supports these, gopherstack does not): CAST (s3-glacier-select-sql-reference-conversion.md: 'Amazon S3 Select and S3 Glacier Select support the following conversion functions: CAST' -- no '(S3 Select only)' qualifier), NOT/BETWEEN/IN/LIKE operators and arithmetic (+ - * %) (s3-glacier-select-sql-reference-operators.md's Logical/Comparison/Pattern-Matching/Math Operators sections), and COALESCE/NULLIF (s3-glacier-select-sql-reference-conditional.md). Closing these is moderate: BETWEEN/IN/LIKE/NOT extend select_sql.go's existing predicate grammar (parsePredicate/selectPredicateMatches) without new architecture; arithmetic and CAST need a real scalar-expression evaluator (select_sql.go's WHERE/SELECT-list values are currently bare column refs or literals, not expressions) -- a bigger, structural addition. Parenthesized/nested-boolean grouping has NO citable evidence either way: the real SQL reference's exhaustive 'Scalar Expressions' grammar list (literal | column_reference | unary_op expr | expr binary_op expr | func_name | BETWEEN | LIKE) never includes a generic '( expression )' grouping form, unlike CAST/IN/COALESCE's function-call parens, so gopherstack's flat OR-of-AND WHERE clause (no parenthesized override) is left as-is rather than extended speculatively -- do not add parenthesized grouping without a citable source. NOT extending speculatively per this pass's instructions; not implemented this pass."
  • Vault Lock policy enforcement (gopherstack-ygfk) only evaluates Effect=Deny (Allow is a no-op -- no IAM baseline to grant against), ignores Principal (no per-request caller identity, gopherstack-cu4g), does not support the ResourceTag condition key (Glacier archives carry no tags here), and only gates DeleteArchive/DeleteVault (not UploadArchive/InitiateJob/other Vault-Lock-governable actions) -- see families: vault_lock_enforcement for the full disclosure. Vault ACCESS policies (SetVaultAccessPolicy) remain entirely unenforced -- their purpose is Principal-based access control, which needs the same caller-identity infrastructure gopherstack-cu4g is deciding, and is a different, larger gap than deletion protection.

More

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrVaultNotFound is returned when a vault does not exist.
	ErrVaultNotFound = errors.New("ResourceNotFoundException: Vault not found")
	// ErrArchiveNotFound is returned when an archive does not exist.
	ErrArchiveNotFound = errors.New("ResourceNotFoundException: Archive not found")
	// ErrJobNotFound is returned when a job does not exist.
	ErrJobNotFound = errors.New("ResourceNotFoundException: Job not found")
	// ErrUploadNotFound is returned when a multipart upload does not exist.
	ErrUploadNotFound = errors.New("ResourceNotFoundException: Multipart upload not found")
	// ErrResourceInUse is returned when creating a vault that already exists.
	ErrResourceInUse = errors.New("ResourceInUseException: vault already exists")
	// ErrValidation is returned when an invalid parameter is supplied.
	ErrValidation = errors.New("InvalidParameterValueException: invalid parameter")
	// ErrVaultNotEmpty is returned when deleting a vault that still has archives.
	ErrVaultNotEmpty = errors.New("ConflictException: Vault not empty")
	// ErrLockConflict is returned when a vault lock is already in progress.
	ErrLockConflict = errors.New("InvalidParameterValueException: Vault lock already in progress")
	// ErrLockAlreadyLocked is returned when attempting to initiate a lock on an already-locked vault.
	ErrLockAlreadyLocked = errors.New("InvalidParameterValueException: Vault is already locked")
	// ErrTooManyTags is returned when adding tags would exceed the per-vault limit.
	ErrTooManyTags = errors.New("InvalidParameterValueException: too many tags on vault")
	// ErrProvisionedCapacityLimit is returned when trying to purchase more than 2 capacity units.
	ErrProvisionedCapacityLimit = errors.New("LimitExceededException: maximum 2 provisioned capacity units per account")
	// ErrInvalidTag is returned when a tag key or value fails validation.
	ErrInvalidTag = errors.New("InvalidParameterValueException: invalid tag key or value")
	// ErrMissingParameter is returned when a required parameter is omitted entirely
	// (as opposed to ErrValidation, which covers a parameter that was supplied but is
	// malformed/out-of-range) -- maps to AWS's distinct MissingParameterValueException.
	ErrMissingParameter = errors.New("MissingParameterValueException: required parameter missing")
	// ErrVaultLockDenied is returned when a vault lock policy's Deny statement
	// matches the requested operation. See vault_lock_policy_eval.go.
	ErrVaultLockDenied = errors.New("AccessDeniedException: denied by vault lock policy")
)

Sentinel errors for Glacier backend operations.

View Source
var (
	// ErrDescriptionTooLong is returned when an archive description exceeds maxDescriptionLen.
	ErrDescriptionTooLong = errors.New("description too long")
	// ErrDescriptionChar is returned when an archive description contains a non-printable character.
	ErrDescriptionChar = errors.New("description contains invalid character")
	// ErrLimitOutOfRange is returned when a ?limit query param is out of the allowed range.
	ErrLimitOutOfRange = errors.New("limit out of range")
	// ErrInvalidStrategy is returned when a DataRetrievalPolicy strategy is not recognised.
	ErrInvalidStrategy = errors.New("invalid data retrieval strategy")
	// ErrBytesPerHourRequired is returned when BytesPerHour strategy omits the BytesPerHour value.
	ErrBytesPerHourRequired = errors.New(
		"BytesPerHour strategy requires a positive BytesPerHour value",
	)
	// ErrInvalidVaultName is returned when a vault name contains invalid characters.
	ErrInvalidVaultName = errors.New("invalid vault name")
	// ErrJobNotComplete is returned when GetJobOutput is called on an incomplete job.
	ErrJobNotComplete = errors.New("job output is not yet available")
)

Handler-level sentinel errors used as wrapping targets to satisfy err113.

View Source
var ErrNilAppContext = errors.New("glacier: nil AppContext")

ErrNilAppContext is returned when Init is called with a nil AppContext.

View Source
var ErrSelectExpression = errors.New("select expression")

ErrSelectExpression is the wrapping sentinel for SQL parse errors surfaced from a select job's Expression (used to satisfy err113 rather than dynamic errors.New calls).

Functions

This section is empty.

Types

type Archive

type Archive struct {
	ArchiveID      string `json:"archiveID"`
	Description    string `json:"description,omitempty"`
	CreationDate   string `json:"creationDate"`
	SHA256TreeHash string `json:"sha256TreeHash,omitempty"`
	Size           int64  `json:"size"`
}

Archive stores metadata for a single archive uploaded to a vault.

type ExportedVault

type ExportedVault = Vault

ExportedVault is a compatibility alias used by the dashboard package.

type Handler

type Handler struct {
	Backend       StorageBackend
	AccountID     string
	DefaultRegion string
}

Handler is the HTTP handler for the Glacier REST API.

func NewHandler

func NewHandler(backend StorageBackend) *Handler

NewHandler creates a new Glacier handler.

func (*Handler) ChaosOperations

func (h *Handler) ChaosOperations() []string

ChaosOperations returns all operations that can be fault-injected.

func (*Handler) ChaosRegions

func (h *Handler) ChaosRegions() []string

ChaosRegions returns all regions this Glacier instance handles.

func (*Handler) ChaosServiceName

func (h *Handler) ChaosServiceName() string

ChaosServiceName returns the lowercase AWS service name for fault rule matching.

func (*Handler) ExtractOperation

func (h *Handler) ExtractOperation(c *echo.Context) string

ExtractOperation extracts the Glacier operation name from the request.

func (*Handler) ExtractResource

func (h *Handler) ExtractResource(c *echo.Context) string

ExtractResource extracts the vault name or resource ID from the URL path.

func (*Handler) GetSupportedOperations

func (h *Handler) GetSupportedOperations() []string

GetSupportedOperations returns the list of supported Glacier operations.

func (*Handler) Handler

func (h *Handler) Handler() echo.HandlerFunc

Handler returns the Echo handler function for Glacier requests.

func (*Handler) MatchPriority

func (h *Handler) MatchPriority() int

MatchPriority returns the routing priority.

func (*Handler) Name

func (h *Handler) Name() string

Name returns the service name.

func (*Handler) Reset

func (h *Handler) Reset()

Reset clears all backend state and the handler-level archive data store.

func (*Handler) Restore

func (h *Handler) Restore(ctx context.Context, data []byte) error

Restore implements persistence.Persistable by delegating to the backend.

func (*Handler) RouteMatcher

func (h *Handler) RouteMatcher() service.Matcher

RouteMatcher returns a function that matches Glacier REST API requests. Glacier uses paths like /{accountId}/vaults/... where accountId is "-" or a real account ID.

func (*Handler) Snapshot

func (h *Handler) Snapshot(ctx context.Context) []byte

Snapshot implements persistence.Persistable by delegating to the backend.

type InMemoryBackend

type InMemoryBackend struct {
	// contains filtered or unexported fields
}

InMemoryBackend is the in-memory backend for Glacier.

vaults, jobs, multipartUploads, and vaultLocks are *store.Table[T], registered once on registry -- see store_setup.go for the Phase 3.3 pkgs/store conversion this follows. Archives stay nested inline on Vault rather than their own table (see the Vault doc comment in models.go). multipartParts, provisionedCapacity, dataRetrievalPolicies, and archiveData remain plain maps because their values are slice/string-typed (not *T) with no identity field of their own to key a Table by.

func NewInMemoryBackend

func NewInMemoryBackend() *InMemoryBackend

NewInMemoryBackend creates a new in-memory Glacier backend.

func (*InMemoryBackend) AbortMultipartUpload

func (b *InMemoryBackend) AbortMultipartUpload(accountID, region, vaultName, uploadID string) error

AbortMultipartUpload cancels an in-progress multipart upload.

func (*InMemoryBackend) AbortVaultLock

func (b *InMemoryBackend) AbortVaultLock(accountID, region, vaultName string) error

AbortVaultLock removes an in-progress vault lock.

func (*InMemoryBackend) AddArchiveInternal

func (b *InMemoryBackend) AddArchiveInternal(accountID, region, vaultName string, a *Archive)

AddArchiveInternal adds an archive directly to the backend for testing. It does not update the vault's NumberOfArchives or SizeInBytes counters; callers that need accounting to be correct should update the vault via AddVaultInternal.

It is a no-op if the vault does not already exist: Archives is stored inline on Vault (see models.go), so there is no vault-less orphan slot to write into -- and, just as before this conversion, every other archive- reading path (ListArchives, DeleteArchive, InitiateJob, ...) already requires the vault to exist first, so a pre-conversion "orphan" archive entry was equally unreachable.

func (*InMemoryBackend) AddJobInternal

func (b *InMemoryBackend) AddJobInternal(accountID, region, vaultName string, j *Job)

AddJobInternal adds a job directly to the backend for testing. VaultARN is always recomputed from the accountID/region/vaultName parameters -- see the AddVaultInternal doc comment for why.

func (*InMemoryBackend) AddMultipartUploadInternal

func (b *InMemoryBackend) AddMultipartUploadInternal(accountID, region, vaultName string, up *MultipartUpload)

AddMultipartUploadInternal adds an in-progress multipart upload directly to the backend for testing. VaultARN is always recomputed from the accountID/region/vaultName parameters -- see the AddVaultInternal doc comment for why.

func (*InMemoryBackend) AddTagsToVault

func (b *InMemoryBackend) AddTagsToVault(accountID, region, vaultName string, tags map[string]string) error

AddTagsToVault adds or updates tags on a vault.

func (*InMemoryBackend) AddVaultInternal

func (b *InMemoryBackend) AddVaultInternal(accountID, region string, v *Vault)

AddVaultInternal adds a vault directly to the backend for testing.

VaultARN, AccountID, and Region are always (re)computed from the accountID and region parameters rather than trusted from v, mirroring how CreateVault derives them: they are what key and index the vault in the vaults *store.Table, so an untrusted/stale value here would silently misfile (or collide with) the entry -- see the "Watch mutating-key" note in store_setup.go's package doc.

func (*InMemoryBackend) CompleteMultipartUpload

func (b *InMemoryBackend) CompleteMultipartUpload(
	accountID, region, vaultName, uploadID, checksum string,
	archiveSize int64,
) (*Archive, error)

CompleteMultipartUpload finalises a multipart upload and creates an archive.

func (*InMemoryBackend) CompleteVaultLock

func (b *InMemoryBackend) CompleteVaultLock(accountID, region, vaultName, lockID string) error

CompleteVaultLock completes and seals a vault lock.

func (*InMemoryBackend) CreateVault

func (b *InMemoryBackend) CreateVault(accountID, region, vaultName string) (*Vault, error)

CreateVault creates a new Glacier vault.

func (*InMemoryBackend) DeleteArchive

func (b *InMemoryBackend) DeleteArchive(accountID, region, vaultName, archiveID string) error

DeleteArchive deletes an archive from a vault.

func (*InMemoryBackend) DeleteVault

func (b *InMemoryBackend) DeleteVault(accountID, region, vaultName string) error

DeleteVault deletes a vault.

func (*InMemoryBackend) DeleteVaultAccessPolicy

func (b *InMemoryBackend) DeleteVaultAccessPolicy(accountID, region, vaultName string) error

DeleteVaultAccessPolicy deletes the access policy for a vault.

func (*InMemoryBackend) DeleteVaultNotifications

func (b *InMemoryBackend) DeleteVaultNotifications(accountID, region, vaultName string) error

DeleteVaultNotifications deletes the notification configuration for a vault.

func (*InMemoryBackend) DescribeJob

func (b *InMemoryBackend) DescribeJob(accountID, region, vaultName, jobID string) (*Job, error)

DescribeJob returns metadata for a job.

func (*InMemoryBackend) DescribeVault

func (b *InMemoryBackend) DescribeVault(accountID, region, vaultName string) (*Vault, error)

DescribeVault returns vault metadata.

func (*InMemoryBackend) GetArchiveData

func (b *InMemoryBackend) GetArchiveData(archiveID string) ([]byte, bool)

GetArchiveData returns the data for an archive.

func (*InMemoryBackend) GetDataRetrievalPolicy

func (b *InMemoryBackend) GetDataRetrievalPolicy(accountID string) string

GetDataRetrievalPolicy returns the data retrieval policy for the account.

func (*InMemoryBackend) GetVaultAccessPolicy

func (b *InMemoryBackend) GetVaultAccessPolicy(accountID, region, vaultName string) (string, error)

GetVaultAccessPolicy returns the access policy for a vault.

func (*InMemoryBackend) GetVaultLock

func (b *InMemoryBackend) GetVaultLock(accountID, region, vaultName string) (*VaultLock, error)

GetVaultLock returns the vault lock state. If no lock has been initiated, the returned VaultLock has State "Unlocked".

func (*InMemoryBackend) GetVaultNotifications

func (b *InMemoryBackend) GetVaultNotifications(accountID, region, vaultName string) (string, []string, error)

GetVaultNotifications returns the notification configuration for a vault.

func (*InMemoryBackend) InitiateJob

func (b *InMemoryBackend) InitiateJob(accountID, region, vaultName string, req *initiateJobRequest) (*Job, error)

InitiateJob creates a new retrieval or inventory job.

func (*InMemoryBackend) InitiateMultipartUpload

func (b *InMemoryBackend) InitiateMultipartUpload(
	accountID, region, vaultName, description string,
	partSize int64,
) (*MultipartUpload, error)

InitiateMultipartUpload begins a multipart upload for a vault.

func (*InMemoryBackend) ListArchives

func (b *InMemoryBackend) ListArchives(accountID, region, vaultName string) ([]*Archive, error)

ListArchives returns all archives for the given vault.

func (*InMemoryBackend) ListJobs

func (b *InMemoryBackend) ListJobs(accountID, region, vaultName string) ([]*Job, error)

ListJobs returns all jobs for the given vault. Returns ErrVaultNotFound if the vault does not exist.

func (*InMemoryBackend) ListMultipartUploads

func (b *InMemoryBackend) ListMultipartUploads(accountID, region, vaultName string) []*MultipartUpload

ListMultipartUploads returns all in-progress multipart uploads for a vault.

func (*InMemoryBackend) ListParts

func (b *InMemoryBackend) ListParts(
	accountID, region, vaultName, uploadID string,
) (*ListPartsOutput, error)

ListParts returns the parts for an in-progress multipart upload.

func (*InMemoryBackend) ListProvisionedCapacity

func (b *InMemoryBackend) ListProvisionedCapacity(accountID string) []*ProvisionedCapacity

ListProvisionedCapacity returns all non-expired provisioned capacity units for an account.

func (*InMemoryBackend) ListTagsForVault

func (b *InMemoryBackend) ListTagsForVault(accountID, region, vaultName string) (map[string]string, error)

ListTagsForVault returns all tags for a vault.

func (*InMemoryBackend) ListVaults

func (b *InMemoryBackend) ListVaults(accountID, region string) []*Vault

ListVaults returns all vaults for the given account and region.

func (*InMemoryBackend) PurchaseProvisionedCapacity

func (b *InMemoryBackend) PurchaseProvisionedCapacity(accountID string) (*ProvisionedCapacity, error)

PurchaseProvisionedCapacity adds a provisioned capacity unit for an account. Returns ErrProvisionedCapacityLimit if the account already has 2 active units.

func (*InMemoryBackend) RemoveTagsFromVault

func (b *InMemoryBackend) RemoveTagsFromVault(accountID, region, vaultName string, tagKeys []string) error

RemoveTagsFromVault removes tags from a vault.

func (*InMemoryBackend) Reset

func (b *InMemoryBackend) Reset()

Reset clears all backend state, resetting to an empty store.

archiveData is deliberately NOT cleared here, matching the pre-conversion behaviour: raw archive bytes have always leaked across Reset() calls (they were never part of any of the maps this method used to reinitialise).

func (*InMemoryBackend) Restore

func (b *InMemoryBackend) Restore(ctx context.Context, data []byte) error

Restore loads backend state from a JSON snapshot.

func (*InMemoryBackend) SetDataRetrievalPolicy

func (b *InMemoryBackend) SetDataRetrievalPolicy(accountID string, policy []byte)

SetDataRetrievalPolicy stores the data retrieval policy for the account.

func (*InMemoryBackend) SetJobInventorySize

func (b *InMemoryBackend) SetJobInventorySize(accountID, region, vaultName, jobID string, size int64)

SetJobInventorySize stores the computed inventory size on the job. No-op if the job does not exist.

func (*InMemoryBackend) SetS3Backend added in v1.3.1

func (b *InMemoryBackend) SetS3Backend(s3 S3Accessor)

SetS3Backend wires the S3 backend used to deliver completed Select jobs' real OutputLocation output.

func (*InMemoryBackend) SetVaultAccessPolicy

func (b *InMemoryBackend) SetVaultAccessPolicy(accountID, region, vaultName, policy string) error

SetVaultAccessPolicy sets the access policy for a vault.

func (*InMemoryBackend) SetVaultLock

func (b *InMemoryBackend) SetVaultLock(accountID, region, vaultName, policy, lockID string) error

SetVaultLock stores a vault lock policy (used by InitiateVaultLock). The policy is validated as a well-formed vault lock policy document (see vault_lock_policy_eval.go), so a malformed policy is rejected here rather than silently never being enforced by DeleteArchive/DeleteVault.

func (*InMemoryBackend) SetVaultNotifications

func (b *InMemoryBackend) SetVaultNotifications(accountID, region, vaultName, snsTopic string, events []string) error

SetVaultNotifications sets the notification configuration for a vault.

func (*InMemoryBackend) Snapshot

func (b *InMemoryBackend) Snapshot(ctx context.Context) []byte

Snapshot serialises the backend state to JSON.

func (*InMemoryBackend) UploadArchive

func (b *InMemoryBackend) UploadArchive(
	accountID, region, vaultName, description, checksum string,
	size int64, data []byte,
) (*Archive, error)

UploadArchive uploads an archive to a vault.

func (*InMemoryBackend) UploadMultipartPart

func (b *InMemoryBackend) UploadMultipartPart(
	accountID, region, vaultName, uploadID, rangeHeader, checksum string,
) error

UploadMultipartPart records a part for an in-progress multipart upload.

type Job

type Job struct {

	// OutputLocation/SelectParameters are only set for Select jobs -- internal state,
	// echoed back on DescribeJob/ListJobs, and used by handleSelectJobOutput to
	// actually execute the query against the archive (see select.go).
	SelectParameters *selectParametersDTO `json:"selectParameters,omitempty"`
	OutputLocation   *outputLocationDTO   `json:"outputLocation,omitempty"`
	// SHA256TreeHash is the tree hash of the *retrieved range*; per AWS it is only
	// populated once the job has Completed (null while InProgress). For whole-archive
	// retrievals it equals ArchiveSHA256TreeHash.
	SHA256TreeHash string `json:"sha256TreeHash,omitempty"`
	SNSTopic       string `json:"snsTopic,omitempty"`
	Action         string `json:"action"`
	ArchiveID      string `json:"archiveID,omitempty"`
	// ArchiveDescription is the description of the archive being retrieved, copied
	// from the Archive at InitiateJob time. It is not part of the DescribeJob wire
	// response (AWS has no such field there); it exists solely so GetJobOutput can
	// echo it back via the X-Amz-Archive-Description response header, matching
	// real Glacier's GetJobOutputOutput.ArchiveDescription.
	ArchiveDescription string `json:"archiveDescription,omitempty"`
	InventoryFormat    string `json:"inventoryFormat,omitempty"`
	StatusCode         string `json:"statusCode"`
	StatusMessage      string `json:"statusMessage,omitempty"`
	CreationDate       string `json:"creationDate"`
	CompletionDate     string `json:"completionDate,omitempty"`
	Tier               string `json:"tier,omitempty"`
	JobID              string `json:"jobID"`
	// ArchiveSHA256TreeHash is the tree hash of the entire archive, present as soon
	// as the archive-retrieval job is created (it is archive metadata, not
	// job-completion-dependent) -- distinct from SHA256TreeHash on the real wire.
	ArchiveSHA256TreeHash string `json:"archiveSHA256TreeHash,omitempty"`
	JobDescription        string `json:"jobDescription,omitempty"`
	RetrievalByteRange    string `json:"retrievalByteRange,omitempty"`
	// InventoryRetrievalStartDate/EndDate/Limit/Marker hold the (optional)
	// InventoryRetrievalParameters supplied at InitiateJob time for InventoryRetrieval
	// jobs -- internal state, echoed back on DescribeJob/ListJobs via
	// inventoryRetrievalJobDescriptionResponse, and used by handleInventoryJobOutput
	// to filter/paginate the returned inventory (see inventory_retrieval.go).
	InventoryRetrievalStartDate string `json:"inventoryRetrievalStartDate,omitempty"`
	InventoryRetrievalEndDate   string `json:"inventoryRetrievalEndDate,omitempty"`
	InventoryRetrievalLimit     string `json:"inventoryRetrievalLimit,omitempty"`
	InventoryRetrievalMarker    string `json:"inventoryRetrievalMarker,omitempty"`
	VaultName                   string `json:"vaultName"`
	VaultARN                    string `json:"vaultARN"`
	// JobOutputPath is the s3:// URI a Select job's OutputLocation results are
	// written to, echoed on InitiateJob (x-amz-job-output-path header) and
	// DescribeJob/ListJobs.
	JobOutputPath        string `json:"jobOutputPath,omitempty"`
	ArchiveSizeInBytes   int64  `json:"archiveSizeInBytes,omitempty"`
	InventorySizeInBytes int64  `json:"inventorySizeInBytes,omitempty"`
	// SelectOutputWritten marks that this Select job's real S3 output-location
	// objects (job.txt/results/result_manifest.txt, see select_output.go) have
	// already been written, matching real AWS's "written once, never updated"
	// job.txt semantics. Internal state, not part of the DescribeJob wire response;
	// persisted so a restored job never re-writes (and potentially duplicates)
	// output after a snapshot round trip.
	SelectOutputWritten bool `json:"selectOutputWritten,omitempty"`
	Completed           bool `json:"completed"`
	// contains filtered or unexported fields
}

Job stores state for a single Glacier retrieval or inventory job.

type ListPartsOutput

type ListPartsOutput struct {
	Marker             *string         `json:"Marker,omitempty"`
	MultipartUploadID  string          `json:"MultipartUploadId"`
	VaultARN           string          `json:"VaultARN"`
	ArchiveDescription string          `json:"ArchiveDescription,omitempty"`
	CreationDate       string          `json:"CreationDate"`
	Parts              []MultipartPart `json:"Parts"`
	PartSizeInBytes    int64           `json:"PartSizeInBytes"`
}

ListPartsOutput is the response for ListParts.

type MultipartPart

type MultipartPart struct {
	RangeInBytes   string `json:"RangeInBytes"`
	SHA256TreeHash string `json:"SHA256TreeHash,omitempty"`
}

MultipartPart holds metadata for a single uploaded part.

type MultipartUpload

type MultipartUpload struct {
	MultipartUploadID  string `json:"MultipartUploadId"`
	VaultARN           string `json:"VaultARN"`
	ArchiveDescription string `json:"ArchiveDescription,omitempty"`
	CreationDate       string `json:"CreationDate"`
	PartSizeInBytes    int64  `json:"PartSizeInBytes"`
}

MultipartUpload holds metadata for an in-progress multipart upload.

type Provider

type Provider struct{}

Provider implements service.Provider for the Glacier service.

func (*Provider) Init

Init initializes the Glacier service backend and handler.

func (*Provider) Name

func (p *Provider) Name() string

Name returns the provider name.

type ProvisionedCapacity

type ProvisionedCapacity struct {
	CapacityID     string `json:"CapacityId"`
	StartDate      string `json:"StartDate"`
	ExpirationDate string `json:"ExpirationDate"`
}

ProvisionedCapacity holds a single provisioned capacity unit.

type S3Accessor added in v1.3.1

type S3Accessor interface {
	PutObject(ctx context.Context, in *s3sdk.PutObjectInput) (*s3sdk.PutObjectOutput, error)
}

S3Accessor is the subset of S3 operations a Select job needs to write its real OutputLocation output. Satisfied by the in-process S3 backend, wired in cli.go's wireGlacierS3 alongside the other cross-service S3 write-back integrations (DynamoDB, MGN, SageMaker).

type StorageBackend

type StorageBackend interface {
	CreateVault(accountID, region, vaultName string) (*Vault, error)
	DescribeVault(accountID, region, vaultName string) (*Vault, error)
	DeleteVault(accountID, region, vaultName string) error
	ListVaults(accountID, region string) []*Vault

	UploadArchive(accountID, region, vaultName, description, checksum string, size int64, data []byte) (*Archive, error)
	DeleteArchive(accountID, region, vaultName, archiveID string) error
	ListArchives(accountID, region, vaultName string) ([]*Archive, error)
	GetArchiveData(archiveID string) ([]byte, bool)

	InitiateJob(accountID, region, vaultName string, req *initiateJobRequest) (*Job, error)
	DescribeJob(accountID, region, vaultName, jobID string) (*Job, error)
	ListJobs(accountID, region, vaultName string) ([]*Job, error)

	SetVaultNotifications(accountID, region, vaultName, snsTopic string, events []string) error
	GetVaultNotifications(accountID, region, vaultName string) (string, []string, error)
	DeleteVaultNotifications(accountID, region, vaultName string) error

	SetVaultAccessPolicy(accountID, region, vaultName, policy string) error
	GetVaultAccessPolicy(accountID, region, vaultName string) (string, error)
	DeleteVaultAccessPolicy(accountID, region, vaultName string) error

	AddTagsToVault(accountID, region, vaultName string, tags map[string]string) error
	ListTagsForVault(accountID, region, vaultName string) (map[string]string, error)
	RemoveTagsFromVault(accountID, region, vaultName string, tagKeys []string) error

	// Multipart upload operations.
	InitiateMultipartUpload(accountID, region, vaultName, description string, partSize int64) (*MultipartUpload, error)
	UploadMultipartPart(accountID, region, vaultName, uploadID, rangeHeader, checksum string) error
	CompleteMultipartUpload(
		accountID, region, vaultName, uploadID, checksum string,
		archiveSize int64,
	) (*Archive, error)
	AbortMultipartUpload(accountID, region, vaultName, uploadID string) error
	ListMultipartUploads(accountID, region, vaultName string) []*MultipartUpload
	ListParts(accountID, region, vaultName, uploadID string) (*ListPartsOutput, error)

	// Vault lock operations.
	GetVaultLock(accountID, region, vaultName string) (*VaultLock, error)
	SetVaultLock(accountID, region, vaultName, policy, lockID string) error
	AbortVaultLock(accountID, region, vaultName string) error
	CompleteVaultLock(accountID, region, vaultName, lockID string) error

	// Data retrieval policy operations.
	GetDataRetrievalPolicy(accountID string) string
	SetDataRetrievalPolicy(accountID string, policy []byte)

	// Provisioned capacity operations.
	ListProvisionedCapacity(accountID string) []*ProvisionedCapacity
	PurchaseProvisionedCapacity(accountID string) (*ProvisionedCapacity, error)

	// SetJobInventorySize persists the computed InventorySizeInBytes on a completed
	// inventory-retrieval job so that subsequent DescribeJob calls return it.
	SetJobInventorySize(accountID, region, vaultName, jobID string, size int64)

	Reset()
}

StorageBackend is the interface for the Glacier backend.

type Vault

type Vault struct {
	Tags                 map[string]string   `json:"tags,omitempty"`
	Archives             map[string]*Archive `json:"archives,omitempty"`
	AccessPolicy         string              `json:"accessPolicy,omitempty"`
	NotificationSNSTopic string              `json:"notificationSNSTopic,omitempty"`
	VaultARN             string              `json:"vaultARN"`
	VaultName            string              `json:"vaultName"`
	AccountID            string              `json:"accountID"`
	Region               string              `json:"region"`
	CreationDate         string              `json:"creationDate"`
	LastInventoryDate    string              `json:"lastInventoryDate,omitempty"`
	NotificationEvents   []string            `json:"notificationEvents,omitempty"`
	NumberOfArchives     int64               `json:"numberOfArchives"`
	SizeInBytes          int64               `json:"sizeInBytes"`
}

Vault stores all metadata and state for a single Glacier vault.

AccountID and Region are not part of any AWS wire response (those are built from explicit response DTOs in handler.go) but are needed, alongside VaultARN, to key and index Vault in the *store.Table[Vault]/store.Index pkgs/store conversion -- see store_setup.go. Archives is nested state kept INLINE on Vault (rather than its own store.Table) because every access site scopes archives by vault and Archive itself carries no natural cross-vault identity field to key a flat table by.

type VaultLock

type VaultLock struct {
	VaultARN       string `json:"vaultARN"`
	Policy         string `json:"Policy"`
	LockID         string `json:"LockId,omitempty"`
	State          string `json:"State"`
	CreationDate   string `json:"CreationDate,omitempty"`
	ExpirationDate string `json:"ExpirationDate,omitempty"`
}

VaultLock holds the state of a vault lock policy.

VaultARN is not part of any AWS wire response (getVaultLockResponse is a separate, explicit DTO in handler.go) but is needed to key VaultLock in the *store.Table[VaultLock] pkgs/store conversion -- see store_setup.go.

Jump to

Keyboard shortcuts

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