Documentation
¶
Index ¶
- Constants
- Variables
- type APIError
- type BatchDeleted
- type BatchFailure
- type BatchItem
- type Bucket
- type BucketWire
- type CommitInput
- type CommitPart
- type ConfigProvider
- type CopyInput
- type CreateBucketInput
- type CreatePARInput
- type CreateUploadInput
- type DeleteResult
- type Duration
- type Handler
- func (h *Handler) ExtractOperation(c *echo.Context) string
- func (h *Handler) ExtractResource(c *echo.Context) string
- func (h *Handler) GetSupportedOperations() []string
- func (h *Handler) Handler() echo.HandlerFunc
- func (h *Handler) MatchPriority() int
- func (h *Handler) Name() string
- func (h *Handler) Reset()
- func (h *Handler) Restore(ctx context.Context, data []byte) error
- func (h *Handler) RouteMatcher() service.Matcher
- func (h *Handler) Shutdown(ctx context.Context)
- func (h *Handler) Snapshot(ctx context.Context) []byte
- func (h *Handler) StartWorker(ctx context.Context) error
- type InMemoryBackend
- func (b *InMemoryBackend) AbortUpload(ns, bucket, object, id string) error
- func (b *InMemoryBackend) AllBuckets() []*BucketWire
- func (b *InMemoryBackend) AuthorizePAR(token, ns, bucket, object string, use PARAccess) error
- func (b *InMemoryBackend) BatchDelete(ns, bucket string, items []BatchItem) ([]BatchDeleted, []BatchFailure, error)
- func (b *InMemoryBackend) CommitUpload(ns, bucket, object, id string, in CommitInput, pre Preconds) (ObjectInfo, error)
- func (b *InMemoryBackend) CopyObject(ns, bucket string, in CopyInput) (string, error)
- func (b *InMemoryBackend) CreateBucket(ns string, in CreateBucketInput, user string) (*BucketWire, error)
- func (b *InMemoryBackend) CreatePAR(ns, bucket string, in CreatePARInput) (PARWire, error)
- func (b *InMemoryBackend) CreateRetention(ns, bucket string, in RetentionInput) (RetentionWire, error)
- func (b *InMemoryBackend) CreateUpload(ns, bucket string, in CreateUploadInput, pre Preconds) (*Upload, error)
- func (b *InMemoryBackend) DeleteBucket(ns, name string, pre Preconds) error
- func (b *InMemoryBackend) DeleteLifecycle(ns, bucket string, pre Preconds) error
- func (b *InMemoryBackend) DeleteObject(ns, bucket, name, versionID, ifMatch string) (DeleteResult, error)
- func (b *InMemoryBackend) DeletePAR(ns, bucket, id string) error
- func (b *InMemoryBackend) DeleteRetention(ns, bucket, id string, pre Preconds) error
- func (b *InMemoryBackend) DeleteWorkRequest(id string) error
- func (b *InMemoryBackend) GetBucket(ns, name string, fields []string, pre Preconds) (*BucketWire, error)
- func (b *InMemoryBackend) GetLifecycle(ns, bucket string) (LifecycleWire, string, error)
- func (b *InMemoryBackend) GetObject(ns, bucket, name, versionID string, pre Preconds, body bool) (ObjectInfo, error)
- func (b *InMemoryBackend) GetPAR(ns, bucket, id string) (PARWire, error)
- func (b *InMemoryBackend) GetRetention(ns, bucket, id string) (RetentionWire, error)
- func (b *InMemoryBackend) GetWorkRequest(id string) (WorkRequestWire, error)
- func (b *InMemoryBackend) ListBuckets(ns, compartment, token string, limit int) (page.Page[*BucketWire], error)
- func (b *InMemoryBackend) ListObjectVersions(ns, bucket string, opt ListOptions) (page.Page[ObjectInfo], []string, error)
- func (b *InMemoryBackend) ListObjects(ns, bucket string, opt ListOptions) ([]ObjectInfo, []string, string, error)
- func (b *InMemoryBackend) ListPARs(ns, bucket, prefix, token string, limit int) (page.Page[PARWire], error)
- func (b *InMemoryBackend) ListParts(ns, bucket, object, id, token string, limit int) (page.Page[PartSummary], error)
- func (b *InMemoryBackend) ListRetention(ns, bucket, token string) (page.Page[RetentionWire], error)
- func (b *InMemoryBackend) ListUploads(ns, bucket, token string, limit int) (page.Page[UploadWire], error)
- func (b *InMemoryBackend) ListWorkRequests(compartment, token string, limit int) (page.Page[WorkRequestWire], error)
- func (b *InMemoryBackend) Namespace() string
- func (b *InMemoryBackend) NamespaceMetadata(ns string) (nsMetaWire, error)
- func (b *InMemoryBackend) PutLifecycle(ns, bucket string, items []LifecycleRule, pre Preconds) (LifecycleWire, string, error)
- func (b *InMemoryBackend) PutObject(ns, bucket, name string, data []byte, meta ObjectMeta, pre Preconds, ...) (ObjectInfo, error)
- func (b *InMemoryBackend) RenameObject(ns, bucket string, in RenameInput) (ObjectInfo, error)
- func (b *InMemoryBackend) Reset()
- func (b *InMemoryBackend) Restore(ctx context.Context, data []byte) error
- func (b *InMemoryBackend) RestoreObjects(ns, bucket, name, versionID string, hours int) error
- func (b *InMemoryBackend) SetClock(now func() time.Time)
- func (b *InMemoryBackend) SetNamespace(ns string)
- func (b *InMemoryBackend) Snapshot(ctx context.Context) []byte
- func (b *InMemoryBackend) SweepLifecycle() int
- func (b *InMemoryBackend) UpdateBucket(ns, name string, in UpdateBucketInput, pre Preconds) (*BucketWire, error)
- func (b *InMemoryBackend) UpdateNamespaceMetadata(ns string, in nsMetaWire) (nsMetaWire, error)
- func (b *InMemoryBackend) UpdateRetention(ns, bucket, id string, in RetentionInput, pre Preconds) (RetentionWire, error)
- func (b *InMemoryBackend) UpdateStorageTier(ns, bucket, name, versionID, tier string) error
- func (b *InMemoryBackend) UploadPart(ns, bucket, object, id string, num int, data []byte, contentMD5 string) (string, string, error)
- type Lifecycle
- type LifecycleRule
- type LifecycleWire
- type ListOptions
- type NameFilter
- type Object
- type ObjectInfo
- type ObjectMeta
- type PAR
- type PARAccess
- type PARWire
- type Part
- type PartSummary
- type Preconds
- type Provider
- type RenameInput
- type Retention
- type RetentionInput
- type RetentionWire
- type Settings
- type UpdateBucketInput
- type Upload
- type UploadWire
- type WorkRequest
- type WorkRequestResource
- type WorkRequestWire
Constants ¶
const DefaultNamespace = "gopherstack"
DefaultNamespace is the tenancy namespace served unless overridden.
const DefaultPort = 8150
DefaultPort is the dedicated listener's default TCP port.
const (
// Region is the fixed region baked into emulated OCIDs.
Region = "us-ashburn-1"
)
Variables ¶
var ErrNilAppContext = errors.New("ociobjectstorage: nil app context")
ErrNilAppContext is returned when Init is called with a nil AppContext.
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 ¶
APIError is an OCI error response: HTTP status plus the `code` and `message` body fields.
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 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 ¶
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 ¶
DeleteResult describes the outcome of DeleteObject.
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 ¶
ExtractOperation returns the operation name for metrics.
func (*Handler) ExtractResource ¶
ExtractResource returns bucket[/object] for metrics.
func (*Handler) GetSupportedOperations ¶
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 ¶
MatchPriority is irrelevant because RouteMatcher never matches.
func (*Handler) RouteMatcher ¶
RouteMatcher never matches: Object Storage runs on its own listener.
type InMemoryBackend ¶
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) 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 ¶
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 ¶
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 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 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 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 ¶
func (p *Provider) Init(ctx *service.AppContext) (service.Registerable, error)
Init creates the backend and handler; the port is bound in StartWorker.
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.