Help us shape the future of Go! Take the 2026 Go Developer Survey

ociobjectstorage

package
v1.9.0 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2026 License: MIT Imports: 30 Imported by: 0

README

OCI Object Storage

Parity grade: B · SDK github.com/oracle/oci-go-sdk/v65@v65.126.2 · last audited 2026-10-25 (3490bdbb3)

Coverage

Metric Value
PARITY entries audited 45 (25 ok, 20 partial)
Feature families 7 (6 ok, 1 partial)
Known gaps 11
Deferred items 0
Resource leaks unknown
Known gaps
  • Resource principal and instance principal tokens (and delegation/session tokens) are not understood; only API-key signatures are verified.
  • Cross-region and cross-tenancy CopyObject, replication policies and replication sources are not implemented.
  • Customer-supplied (opc-sse-customer-*) and KMS keys are accepted but not applied; bucket reencrypt and ReencryptObject are not routed.
  • Private endpoints (/n/{ns}/pe) are not implemented.
  • The OCI Amazon S3 compatibility API and Swift API are out of scope.
  • Checksum headers opc-content-crc32c/sha256/sha384 and opc-checksum-algorithm are ignored; only MD5 is computed and verified.
  • Multipart: no minimum part size, no part overwrite conflicts, and the multipart md5 header is the only multipart checksum.
  • Restore completes one fixed hour after the request regardless of tier; the time-of-archival header is not returned.
  • Several error codes are unverified against the live service (see families.error_envelope).
  • Namespaces are single-tenant: only one namespace is served and no compartment or IAM policy checks apply.
  • Tag values and defined-tag namespaces are stored verbatim, not validated against a tag namespace.

More

Documentation

Index

Constants

View Source
const DefaultNamespace = "gopherstack"

DefaultNamespace is the tenancy namespace served unless overridden.

View Source
const DefaultPort = 8150

DefaultPort is the dedicated listener's default TCP port.

View Source
const (
	// Region is the fixed region baked into emulated OCIDs.
	Region = "us-ashburn-1"
)

Variables

View Source
var ErrNilAppContext = errors.New("ociobjectstorage: nil app context")

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

View Source
var ErrSnapshotNull = errors.New("ociobjectstorage: null entry in snapshot")

ErrSnapshotNull is returned when a snapshot contains a null bucket.

Functions

This section is empty.

Types

type APIError

type APIError struct {
	Code    string
	Message string
	Status  int
}

APIError is an OCI error response: HTTP status plus the `code` and `message` body fields.

func (*APIError) Error

func (e *APIError) Error() string

type BatchDeleted

type BatchDeleted struct {
	TimeLastModified time.Time `json:"timeLastModified"`
	ObjectName       string    `json:"objectName"`
}

BatchDeleted is a deleted BatchDeleteObjects entry.

type BatchFailure

type BatchFailure struct {
	ObjectName   string `json:"objectName"`
	ErrorMessage string `json:"errorMessage"`
	StatusCode   int    `json:"statusCode"`
}

BatchFailure is a failed BatchDeleteObjects entry.

type BatchItem

type BatchItem struct {
	ObjectName string `json:"objectName"`
	IfMatch    string `json:"ifMatch"`
}

BatchItem is one entry of a BatchDeleteObjects request.

type Bucket

type Bucket struct {
	TimeCreated         time.Time                 `json:"timeCreated"`
	DefinedTags         map[string]map[string]any `json:"definedTags,omitempty"`
	FreeformTags        map[string]string         `json:"freeformTags,omitempty"`
	Metadata            map[string]string         `json:"metadata,omitempty"`
	Objects             map[string][]*Object      `json:"objects"`
	Uploads             map[string]*Upload        `json:"uploads"`
	PARs                map[string]*PAR           `json:"pars"`
	Retention           map[string]*Retention     `json:"retention"`
	Lifecycle           *Lifecycle                `json:"lifecycle,omitempty"`
	Name                string                    `json:"name"`
	CompartmentID       string                    `json:"compartmentId"`
	CreatedBy           string                    `json:"createdBy"`
	Etag                string                    `json:"etag"`
	PublicAccessType    string                    `json:"publicAccessType"`
	StorageTier         string                    `json:"storageTier"`
	Versioning          string                    `json:"versioning"`
	AutoTiering         string                    `json:"autoTiering,omitempty"`
	KmsKeyID            string                    `json:"kmsKeyId,omitempty"`
	ID                  string                    `json:"id"`
	LifecycleEtag       string                    `json:"lifecycleEtag,omitempty"`
	ObjectEventsEnabled bool                      `json:"objectEventsEnabled"`
	IsBucketKeyEnabled  bool                      `json:"isBucketKeyEnabled"`
}

Bucket is a bucket with all its contents.

type BucketWire

type BucketWire struct {
	TimeCreated               time.Time                 `json:"timeCreated"`
	Metadata                  map[string]string         `json:"metadata,omitempty"`
	FreeformTags              map[string]string         `json:"freeformTags"`
	DefinedTags               map[string]map[string]any `json:"definedTags"`
	ApproximateCount          *int64                    `json:"approximateCount,omitempty"`
	ApproximateSize           *int64                    `json:"approximateSize,omitempty"`
	Namespace                 string                    `json:"namespace"`
	Name                      string                    `json:"name"`
	CompartmentID             string                    `json:"compartmentId"`
	CreatedBy                 string                    `json:"createdBy"`
	Etag                      string                    `json:"etag"`
	PublicAccessType          string                    `json:"publicAccessType"`
	StorageTier               string                    `json:"storageTier"`
	KmsKeyID                  *string                   `json:"kmsKeyId"`
	ObjectLifecyclePolicyEtag *string                   `json:"objectLifecyclePolicyEtag"`
	ID                        string                    `json:"id"`
	Versioning                string                    `json:"versioning"`
	AutoTiering               string                    `json:"autoTiering,omitempty"`
	ObjectEventsEnabled       bool                      `json:"objectEventsEnabled"`
	IsBucketKeyEnabled        bool                      `json:"isBucketKeyEnabled"`
	ReplicationEnabled        bool                      `json:"replicationEnabled"`
	IsReadOnly                bool                      `json:"isReadOnly"`
}

BucketWire is the Bucket / BucketSummary JSON body.

type CommitInput

type CommitInput struct {
	PartsToCommit  []CommitPart `json:"partsToCommit"`
	PartsToExclude []int        `json:"partsToExclude"`
}

CommitInput is the CommitMultipartUploadDetails payload.

type CommitPart

type CommitPart struct {
	Etag    string `json:"etag"`
	PartNum int    `json:"partNum"`
}

CommitPart names a part to include in the final object.

type ConfigProvider

type ConfigProvider interface {
	GetOCIObjectStorageSettings() Settings
}

ConfigProvider extracts Object Storage configuration from the AppContext Config.

type CopyInput

type CopyInput struct {
	DestinationMetadata map[string]string `json:"destinationObjectMetadata"`
	SourceObjectName    string            `json:"sourceObjectName"`
	DestinationRegion   string            `json:"destinationRegion"`
	DestinationNS       string            `json:"destinationNamespace"`
	DestinationBucket   string            `json:"destinationBucket"`
	DestinationObject   string            `json:"destinationObjectName"`
	SourceIfMatch       string            `json:"sourceObjectIfMatchETag"`
	SourceVersionID     string            `json:"sourceVersionId"`
	DestIfMatch         string            `json:"destinationObjectIfMatchETag"`
	DestIfNoneMatch     string            `json:"destinationObjectIfNoneMatchETag"`
	DestinationTier     string            `json:"destinationObjectStorageTier"`
}

CopyInput is the CopyObjectDetails payload.

type CreateBucketInput

type CreateBucketInput struct {
	Metadata            map[string]string         `json:"metadata"`
	FreeformTags        map[string]string         `json:"freeformTags"`
	DefinedTags         map[string]map[string]any `json:"definedTags"`
	ObjectEventsEnabled *bool                     `json:"objectEventsEnabled"`
	IsBucketKeyEnabled  *bool                     `json:"isBucketKeyEnabled"`
	Name                string                    `json:"name"`
	CompartmentID       string                    `json:"compartmentId"`
	PublicAccessType    string                    `json:"publicAccessType"`
	StorageTier         string                    `json:"storageTier"`
	KmsKeyID            string                    `json:"kmsKeyId"`
	Versioning          string                    `json:"versioning"`
	AutoTiering         string                    `json:"autoTiering"`
}

CreateBucketInput is the CreateBucketDetails payload.

type CreatePARInput

type CreatePARInput struct {
	TimeExpires         time.Time `json:"timeExpires"`
	Name                string    `json:"name"`
	AccessType          string    `json:"accessType"`
	ObjectName          string    `json:"objectName"`
	BucketListingAction string    `json:"bucketListingAction"`
}

CreatePARInput is the CreatePreauthenticatedRequestDetails payload.

type CreateUploadInput

type CreateUploadInput struct {
	Metadata           map[string]string `json:"metadata"`
	Object             string            `json:"object"`
	ContentType        string            `json:"contentType"`
	ContentLanguage    string            `json:"contentLanguage"`
	ContentEncoding    string            `json:"contentEncoding"`
	ContentDisposition string            `json:"contentDisposition"`
	CacheControl       string            `json:"cacheControl"`
	StorageTier        string            `json:"storageTier"`
}

CreateUploadInput is the CreateMultipartUploadDetails payload.

type DeleteResult

type DeleteResult struct {
	LastModified   time.Time
	VersionID      string
	IsDeleteMarker bool
}

DeleteResult describes the outcome of DeleteObject.

type Duration

type Duration struct {
	TimeUnit   string `json:"timeUnit"`
	TimeAmount int64  `json:"timeAmount"`
}

Duration is the OCI Duration shape.

type Handler

type Handler struct {
	Backend *InMemoryBackend

	Port        int
	EnforceAuth bool
	// contains filtered or unexported fields
}

Handler serves the OCI Object Storage API 20160918.

func NewHandler

func NewHandler(backend *InMemoryBackend) *Handler

NewHandler creates a Handler; callers override Port and EnforceAuth from Settings.

func (*Handler) ExtractOperation

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

ExtractOperation returns the operation name for metrics.

func (*Handler) ExtractResource

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

ExtractResource returns bucket[/object] for metrics.

func (*Handler) GetSupportedOperations

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

GetSupportedOperations lists the supported operations.

func (*Handler) Handler

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

Handler returns the Echo handler for all Object Storage requests.

func (*Handler) MatchPriority

func (h *Handler) MatchPriority() int

MatchPriority is irrelevant because RouteMatcher never matches.

func (*Handler) Name

func (h *Handler) Name() string

Name returns the service name.

func (*Handler) Reset

func (h *Handler) Reset()

Reset clears all in-memory state.

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 never matches: Object Storage runs on its own listener.

func (*Handler) Shutdown

func (h *Handler) Shutdown(ctx context.Context)

Shutdown stops the listener and the lifecycle sweeper.

func (*Handler) Snapshot

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

Snapshot implements persistence.Persistable by delegating to the backend.

func (*Handler) StartWorker

func (h *Handler) StartWorker(ctx context.Context) error

StartWorker binds the dedicated listener synchronously so a port conflict is returned to the caller, then starts the lifecycle sweeper.

type InMemoryBackend

type InMemoryBackend struct {
	Auth *ociauth.Registry
	// contains filtered or unexported fields
}

InMemoryBackend holds every bucket under one lock.

func NewInMemoryBackend

func NewInMemoryBackend() *InMemoryBackend

NewInMemoryBackend creates an empty backend serving the default namespace.

func (*InMemoryBackend) AbortUpload

func (b *InMemoryBackend) AbortUpload(ns, bucket, object, id string) error

AbortUpload discards an upload.

func (*InMemoryBackend) AllBuckets

func (b *InMemoryBackend) AllBuckets() []*BucketWire

AllBuckets lists every bucket of the namespace across compartments, sorted by name.

func (*InMemoryBackend) AuthorizePAR

func (b *InMemoryBackend) AuthorizePAR(token, ns, bucket, object string, use PARAccess) error

AuthorizePAR checks token against the bucket/object/use; every failure is the same opaque 404.

func (*InMemoryBackend) BatchDelete

func (b *InMemoryBackend) BatchDelete(ns, bucket string, items []BatchItem) ([]BatchDeleted, []BatchFailure, error)

BatchDelete deletes several objects, reporting per-object outcomes.

func (*InMemoryBackend) CommitUpload

func (b *InMemoryBackend) CommitUpload(
	ns, bucket, object, id string, in CommitInput, pre Preconds,
) (ObjectInfo, error)

CommitUpload assembles the parts into an object.

func (*InMemoryBackend) CopyObject

func (b *InMemoryBackend) CopyObject(ns, bucket string, in CopyInput) (string, error)

CopyObject copies an object and returns a (completed) work request id.

func (*InMemoryBackend) CreateBucket

func (b *InMemoryBackend) CreateBucket(ns string, in CreateBucketInput, user string) (*BucketWire, error)

CreateBucket creates a bucket.

func (*InMemoryBackend) CreatePAR

func (b *InMemoryBackend) CreatePAR(ns, bucket string, in CreatePARInput) (PARWire, error)

CreatePAR creates a pre-authenticated request; the returned wire includes the accessUri.

func (*InMemoryBackend) CreateRetention

func (b *InMemoryBackend) CreateRetention(ns, bucket string, in RetentionInput) (RetentionWire, error)

CreateRetention adds a retention rule.

func (*InMemoryBackend) CreateUpload

func (b *InMemoryBackend) CreateUpload(ns, bucket string, in CreateUploadInput, pre Preconds) (*Upload, error)

CreateUpload starts a multipart upload.

func (*InMemoryBackend) DeleteBucket

func (b *InMemoryBackend) DeleteBucket(ns, name string, pre Preconds) error

DeleteBucket removes an empty bucket.

func (*InMemoryBackend) DeleteLifecycle

func (b *InMemoryBackend) DeleteLifecycle(ns, bucket string, pre Preconds) error

DeleteLifecycle removes the lifecycle policy.

func (*InMemoryBackend) DeleteObject

func (b *InMemoryBackend) DeleteObject(ns, bucket, name, versionID, ifMatch string) (DeleteResult, error)

DeleteObject deletes an object or one version of it.

func (*InMemoryBackend) DeletePAR

func (b *InMemoryBackend) DeletePAR(ns, bucket, id string) error

DeletePAR revokes a PAR.

func (*InMemoryBackend) DeleteRetention

func (b *InMemoryBackend) DeleteRetention(ns, bucket, id string, pre Preconds) error

DeleteRetention removes a rule unless it is locked.

func (*InMemoryBackend) DeleteWorkRequest

func (b *InMemoryBackend) DeleteWorkRequest(id string) error

DeleteWorkRequest cancels a work request; finished ones cannot be canceled.

func (*InMemoryBackend) GetBucket

func (b *InMemoryBackend) GetBucket(ns, name string, fields []string, pre Preconds) (*BucketWire, error)

GetBucket returns a bucket; fields may include approximateCount, approximateSize, autoTiering.

func (*InMemoryBackend) GetLifecycle

func (b *InMemoryBackend) GetLifecycle(ns, bucket string) (LifecycleWire, string, error)

GetLifecycle returns the lifecycle policy.

func (*InMemoryBackend) GetObject

func (b *InMemoryBackend) GetObject(
	ns, bucket, name, versionID string, pre Preconds, body bool,
) (ObjectInfo, error)

GetObject reads an object (or only its headers when body is false).

func (*InMemoryBackend) GetPAR

func (b *InMemoryBackend) GetPAR(ns, bucket, id string) (PARWire, error)

GetPAR returns a PAR (without its accessUri, which is only shown at creation).

func (*InMemoryBackend) GetRetention

func (b *InMemoryBackend) GetRetention(ns, bucket, id string) (RetentionWire, error)

GetRetention returns one retention rule.

func (*InMemoryBackend) GetWorkRequest

func (b *InMemoryBackend) GetWorkRequest(id string) (WorkRequestWire, error)

GetWorkRequest returns a work request.

func (*InMemoryBackend) ListBuckets

func (b *InMemoryBackend) ListBuckets(ns, compartment, token string, limit int) (page.Page[*BucketWire], error)

ListBuckets lists buckets in a compartment.

func (*InMemoryBackend) ListObjectVersions

func (b *InMemoryBackend) ListObjectVersions(
	ns, bucket string, opt ListOptions,
) (page.Page[ObjectInfo], []string, error)

ListObjectVersions lists every version and delete marker, newest first per name.

func (*InMemoryBackend) ListObjects

func (b *InMemoryBackend) ListObjects(ns, bucket string, opt ListOptions) ([]ObjectInfo, []string, string, error)

ListObjects lists live objects (names only are guaranteed meaningful for fields=name).

func (*InMemoryBackend) ListPARs

func (b *InMemoryBackend) ListPARs(ns, bucket, prefix, token string, limit int) (page.Page[PARWire], error)

ListPARs lists PARs ordered by creation time.

func (*InMemoryBackend) ListParts

func (b *InMemoryBackend) ListParts(ns, bucket, object, id, token string, limit int) (page.Page[PartSummary], error)

ListParts lists uploaded parts in part-number order.

func (*InMemoryBackend) ListRetention

func (b *InMemoryBackend) ListRetention(ns, bucket, token string) (page.Page[RetentionWire], error)

ListRetention lists retention rules.

func (*InMemoryBackend) ListUploads

func (b *InMemoryBackend) ListUploads(ns, bucket, token string, limit int) (page.Page[UploadWire], error)

ListUploads lists in-flight uploads ordered by object name then id.

func (*InMemoryBackend) ListWorkRequests

func (b *InMemoryBackend) ListWorkRequests(compartment, token string, limit int) (page.Page[WorkRequestWire], error)

ListWorkRequests lists work requests in a compartment.

func (*InMemoryBackend) Namespace

func (b *InMemoryBackend) Namespace() string

Namespace returns the served namespace.

func (*InMemoryBackend) NamespaceMetadata

func (b *InMemoryBackend) NamespaceMetadata(ns string) (nsMetaWire, error)

NamespaceMetadata returns the namespace's default compartments.

func (*InMemoryBackend) PutLifecycle

func (b *InMemoryBackend) PutLifecycle(
	ns, bucket string,
	items []LifecycleRule,
	pre Preconds,
) (LifecycleWire, string, error)

PutLifecycle replaces the bucket's lifecycle policy and returns it with the policy etag.

func (*InMemoryBackend) PutObject

func (b *InMemoryBackend) PutObject(
	ns, bucket, name string, data []byte, meta ObjectMeta, pre Preconds, contentMD5 string,
) (ObjectInfo, error)

PutObject stores an object; contentMD5 is the optional base64 Content-MD5 request header.

func (*InMemoryBackend) RenameObject

func (b *InMemoryBackend) RenameObject(ns, bucket string, in RenameInput) (ObjectInfo, error)

RenameObject moves an object to a new name within its bucket.

func (*InMemoryBackend) Reset

func (b *InMemoryBackend) Reset()

Reset clears all state.

func (*InMemoryBackend) Restore

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

Restore loads backend state from a snapshot.

func (*InMemoryBackend) RestoreObjects

func (b *InMemoryBackend) RestoreObjects(ns, bucket, name, versionID string, hours int) error

RestoreObjects begins restoring an archived object.

func (*InMemoryBackend) SetClock

func (b *InMemoryBackend) SetClock(now func() time.Time)

SetClock injects the time source used for expiry, restore and lifecycle decisions.

func (*InMemoryBackend) SetNamespace

func (b *InMemoryBackend) SetNamespace(ns string)

SetNamespace overrides the single tenancy namespace this backend serves.

func (*InMemoryBackend) Snapshot

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

Snapshot serialises the backend state, including registered API keys.

func (*InMemoryBackend) SweepLifecycle

func (b *InMemoryBackend) SweepLifecycle() int

SweepLifecycle applies every enabled lifecycle rule using the backend clock and returns the actions taken.

func (*InMemoryBackend) UpdateBucket

func (b *InMemoryBackend) UpdateBucket(ns, name string, in UpdateBucketInput, pre Preconds) (*BucketWire, error)

UpdateBucket applies a partial update.

func (*InMemoryBackend) UpdateNamespaceMetadata

func (b *InMemoryBackend) UpdateNamespaceMetadata(ns string, in nsMetaWire) (nsMetaWire, error)

UpdateNamespaceMetadata sets the default S3 / Swift compartments.

func (*InMemoryBackend) UpdateRetention

func (b *InMemoryBackend) UpdateRetention(
	ns, bucket, id string,
	in RetentionInput,
	pre Preconds,
) (RetentionWire, error)

UpdateRetention modifies a rule; a locked rule can only be lengthened.

func (*InMemoryBackend) UpdateStorageTier

func (b *InMemoryBackend) UpdateStorageTier(ns, bucket, name, versionID, tier string) error

UpdateStorageTier changes an object's tier.

func (*InMemoryBackend) UploadPart

func (b *InMemoryBackend) UploadPart(
	ns, bucket, object, id string, num int, data []byte, contentMD5 string,
) (string, string, error)

UploadPart stores one part and returns its etag and md5.

type Lifecycle

type Lifecycle struct {
	TimeCreated time.Time       `json:"timeCreated"`
	Items       []LifecycleRule `json:"items"`
}

Lifecycle is a bucket's lifecycle policy.

type LifecycleRule

type LifecycleRule struct {
	ObjectNameFilter *NameFilter `json:"objectNameFilter,omitempty"`
	Target           *string     `json:"target,omitempty"`
	Name             string      `json:"name"`
	Action           string      `json:"action"`
	TimeUnit         string      `json:"timeUnit"`
	TimeAmount       int64       `json:"timeAmount"`
	IsEnabled        bool        `json:"isEnabled"`
}

LifecycleRule is one object lifecycle rule.

type LifecycleWire

type LifecycleWire struct {
	TimeCreated time.Time       `json:"timeCreated"`
	Items       []LifecycleRule `json:"items"`
}

LifecycleWire is the ObjectLifecyclePolicy body.

type ListOptions

type ListOptions struct {
	Prefix, Start, End, StartAfter, Delimiter, Page string
	Limit                                           int
}

ListOptions are the ListObjects / ListObjectVersions query parameters.

type NameFilter

type NameFilter struct {
	InclusionPatterns []string `json:"inclusionPatterns,omitempty"`
	ExclusionPatterns []string `json:"exclusionPatterns,omitempty"`
	InclusionPrefixes []string `json:"inclusionPrefixes,omitempty"`
}

NameFilter restricts a lifecycle rule to matching object names.

type Object

type Object struct {
	TimeCreated    time.Time  `json:"timeCreated"`
	TimeModified   time.Time  `json:"timeModified"`
	RestoreReadyAt time.Time  `json:"restoreReadyAt"`
	RestoreExpiry  time.Time  `json:"restoreExpiry"`
	Meta           ObjectMeta `json:"meta"`
	Name           string     `json:"name"`
	VersionID      string     `json:"versionId"`
	Etag           string     `json:"etag"`
	MD5            string     `json:"md5"`
	MultipartMD5   string     `json:"multipartMd5,omitempty"`
	Data           []byte     `json:"data"`
	IsDeleteMarker bool       `json:"isDeleteMarker"`
}

Object is one stored version of an object (or a delete marker).

type ObjectInfo

type ObjectInfo struct {
	Archival string
	Object
}

ObjectInfo is an object version plus its archival state evaluated at read time.

type ObjectMeta

type ObjectMeta struct {
	Metadata           map[string]string `json:"metadata,omitempty"`
	ContentType        string            `json:"contentType,omitempty"`
	ContentLanguage    string            `json:"contentLanguage,omitempty"`
	ContentEncoding    string            `json:"contentEncoding,omitempty"`
	ContentDisposition string            `json:"contentDisposition,omitempty"`
	CacheControl       string            `json:"cacheControl,omitempty"`
	StorageTier        string            `json:"storageTier,omitempty"`
}

ObjectMeta is the user-settable metadata of an object.

type PAR

type PAR struct {
	TimeCreated         time.Time `json:"timeCreated"`
	TimeExpires         time.Time `json:"timeExpires"`
	ID                  string    `json:"id"`
	Name                string    `json:"name"`
	Token               string    `json:"token"`
	AccessType          string    `json:"accessType"`
	ObjectName          string    `json:"objectName"`
	BucketListingAction string    `json:"bucketListingAction"`
}

PAR is a pre-authenticated request.

type PARAccess

type PARAccess int

PARAccess is what a PAR token is being used for.

const (
	PARRead PARAccess = iota
	PARWrite
	PARList
)

PAR usage kinds.

type PARWire

type PARWire struct {
	TimeExpires         time.Time `json:"timeExpires"`
	TimeCreated         time.Time `json:"timeCreated"`
	ObjectName          *string   `json:"objectName"`
	AccessURI           string    `json:"accessUri,omitempty"`
	ID                  string    `json:"id"`
	Name                string    `json:"name"`
	AccessType          string    `json:"accessType"`
	BucketListingAction string    `json:"bucketListingAction,omitempty"`
}

PARWire is the PreauthenticatedRequest / PreauthenticatedRequestSummary body.

type Part

type Part struct {
	Etag string `json:"etag"`
	MD5  string `json:"md5"`
	Data []byte `json:"data"`
}

Part is one uploaded multipart part.

type PartSummary

type PartSummary struct {
	Etag       string `json:"etag"`
	MD5        string `json:"md5"`
	Size       int64  `json:"size"`
	PartNumber int    `json:"partNumber"`
}

PartSummary is a ListMultipartUploadParts item.

type Preconds

type Preconds struct {
	IfMatch     string
	IfNoneMatch string
}

Preconds are the If-Match / If-None-Match request headers.

type Provider

type Provider struct{}

Provider implements service.Provider for OCI Object Storage. It runs on its own listener (see Handler.StartWorker) and never matches on the shared AWS router.

func (*Provider) Init

Init creates the backend and handler; the port is bound in StartWorker.

func (*Provider) Name

func (p *Provider) Name() string

Name returns the service provider name.

type RenameInput

type RenameInput struct {
	SourceName   string `json:"sourceName"`
	NewName      string `json:"newName"`
	SrcIfMatch   string `json:"srcObjIfMatchETag"`
	NewIfMatch   string `json:"newObjIfMatchETag"`
	NewIfNoMatch string `json:"newObjIfNoneMatchETag"`
}

RenameInput is the RenameObjectDetails payload.

type Retention

type Retention struct {
	TimeCreated    time.Time  `json:"timeCreated"`
	TimeModified   time.Time  `json:"timeModified"`
	TimeRuleLocked *time.Time `json:"timeRuleLocked,omitempty"`
	ID             string     `json:"id"`
	DisplayName    string     `json:"displayName"`
	Etag           string     `json:"etag"`
	Unit           string     `json:"unit,omitempty"`
	Amount         int64      `json:"amount"`
	HasDuration    bool       `json:"hasDuration"`
}

Retention is a bucket retention rule.

type RetentionInput

type RetentionInput struct {
	TimeRuleLocked *time.Time `json:"timeRuleLocked"`
	Duration       *Duration  `json:"duration"`
	DisplayName    string     `json:"displayName"`
}

RetentionInput is Create/UpdateRetentionRuleDetails.

type RetentionWire

type RetentionWire struct {
	TimeCreated    time.Time  `json:"timeCreated"`
	TimeModified   time.Time  `json:"timeModified"`
	TimeRuleLocked *time.Time `json:"timeRuleLocked,omitempty"`
	Duration       *Duration  `json:"duration,omitempty"`
	ID             string     `json:"id"`
	DisplayName    string     `json:"displayName"`
	Etag           string     `json:"etag"`
}

RetentionWire is the RetentionRule body.

type Settings

type Settings struct {
	Namespace string `` //nolint:lll // config struct tags are intentionally verbose
	/* 193-byte string literal not displayed */
	Port int `` //nolint:lll // config struct tags are intentionally verbose
	/* 202-byte string literal not displayed */
	EnforceAuth bool `` //nolint:lll // config struct tags are intentionally verbose
	/* 236-byte string literal not displayed */
}

Settings holds service-level configuration, embedded in the root CLI command as CLI.OCIObjectStorage.

func DefaultSettings

func DefaultSettings() Settings

DefaultSettings returns the settings used when no ConfigProvider is available.

type UpdateBucketInput

type UpdateBucketInput struct {
	Metadata            map[string]string         `json:"metadata"`
	FreeformTags        map[string]string         `json:"freeformTags"`
	DefinedTags         map[string]map[string]any `json:"definedTags"`
	ObjectEventsEnabled *bool                     `json:"objectEventsEnabled"`
	IsBucketKeyEnabled  *bool                     `json:"isBucketKeyEnabled"`
	Name                string                    `json:"name"`
	PublicAccessType    string                    `json:"publicAccessType"`
	KmsKeyID            string                    `json:"kmsKeyId"`
	Versioning          string                    `json:"versioning"`
	AutoTiering         string                    `json:"autoTiering"`
	CompartmentID       string                    `json:"compartmentId"`
}

UpdateBucketInput is the UpdateBucketDetails payload; nil/empty fields are left unchanged.

type Upload

type Upload struct {
	TimeCreated time.Time    `json:"timeCreated"`
	Parts       map[int]Part `json:"parts"`
	ID          string       `json:"id"`
	Object      string       `json:"object"`
	Meta        ObjectMeta   `json:"meta"`
}

Upload is an in-flight multipart upload.

type UploadWire

type UploadWire struct {
	TimeCreated time.Time `json:"timeCreated"`
	Namespace   string    `json:"namespace"`
	Bucket      string    `json:"bucket"`
	Object      string    `json:"object"`
	UploadID    string    `json:"uploadId"`
	StorageTier string    `json:"storageTier,omitempty"`
}

UploadWire is the MultipartUpload JSON body.

func UploadInfo

func UploadInfo(ns, bucket string, u *Upload) UploadWire

UploadInfo returns the wire form of a freshly created upload.

type WorkRequest

type WorkRequest struct {
	TimeAccepted  time.Time `json:"timeAccepted"`
	TimeFinished  time.Time `json:"timeFinished"`
	ID            string    `json:"id"`
	OperationType string    `json:"operationType"`
	Status        string    `json:"status"`
	CompartmentID string    `json:"compartmentId"`
	EntityURI     string    `json:"entityUri"`
}

WorkRequest records an asynchronous operation (copy); the emulator completes it synchronously.

type WorkRequestResource

type WorkRequestResource struct {
	EntityType string `json:"entityType"`
	ActionType string `json:"actionType"`
	EntityURI  string `json:"entityUri"`
}

WorkRequestResource is an entity touched by a work request.

type WorkRequestWire

type WorkRequestWire struct {
	TimeAccepted    time.Time             `json:"timeAccepted"`
	TimeStarted     time.Time             `json:"timeStarted"`
	TimeFinished    time.Time             `json:"timeFinished"`
	OperationType   string                `json:"operationType"`
	Status          string                `json:"status"`
	ID              string                `json:"id"`
	CompartmentID   string                `json:"compartmentId"`
	Resources       []WorkRequestResource `json:"resources"`
	PercentComplete float32               `json:"percentComplete"`
}

WorkRequestWire is the WorkRequest / WorkRequestSummary body.

Jump to

Keyboard shortcuts

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