objectstorage

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package objectstorage provides structures for interacting with an S3-compatible storage system.

Package objectstorage provides structures and methods for managing objects in a cloud storage system, such as AWS S3.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CopyObjectResult

type CopyObjectResult struct {
	IsCopied  bool   // Indicates whether the object was successfully copied.
	ObjectKey string // ObjectKey is the unique identifier for the copied object.
}

CopyObjectResult represents the result of a copy operation within the storage. It includes the success status and the key of the copied object.

type GetObjectResult

type GetObjectResult struct {
	ContentBody   io.ReadCloser // Stream for reading the object's content.
	ContentLength int64         // Length of the object content in bytes.
	ContentType   string        // MIME type of the object.
	ETag          string        // ETag is an identifier for a specific version of the object.
	LastModified  time.Time     // Timestamp of when the object was last modified.
}

GetObjectResult contains the result of a request to retrieve an object from storage. It provides access to the object's content and metadata such as content type, size, and modification time.

type GetPresignedPutUrlResult

type GetPresignedPutUrlResult struct {
	TTL          time.Duration
	PresignedUrl string
	CreatedAt    time.Time
}

GetPresignedPutUrlResult contains a presigned URL for direct object upload.

type GetPresignedUrlResult

type GetPresignedUrlResult struct {
	TTL          time.Duration // TTL indicates how long the presigned URL is valid.
	PresignedUrl string        // PresignedUrl is the URL for direct object access.
	LastModified time.Time     // Timestamp of when the object was last modified.
}

GetPresignedUrlResult contains a presigned URL for accessing an object. It includes the URL, its validity duration, and the last modification time of the object.

type HeadObjectResult

type HeadObjectResult struct {
	ContentLength int64
	ContentType   string
	ETag          string
	LastModified  time.Time
}

HeadObjectResult contains metadata for an object without its body.

type ListObjectResult

type ListObjectResult struct {
	Objects     []S3Object // Objects is a list of objects retrieved from the storage.
	ObjectCount int        // ObjectCount is the total number of objects in the list.
}

ListObjectResult contains the results of a listing operation in the storage. It holds a collection of objects and the total count of objects listed.

func (*ListObjectResult) AppendOneObject

func (r *ListObjectResult) AppendOneObject(contentBody S3Object) *ListObjectResult

AppendOneObject adds a single S3Object to the Objects slice of a ListObjectResult and returns the modified result. This method allows for incremental addition of objects to the result set.

type PresignedPutObjectInput

type PresignedPutObjectInput struct {
	Bucket               string        // Bucket specifies the target bucket.
	Key                  string        // Key specifies the object key to upload.
	ContentType          string        // ContentType is the required MIME type for the upload.
	TTL                  time.Duration // TTL controls how long the URL remains valid.
	ServerSideEncryption string        // ServerSideEncryption requests bucket-side encryption such as AES256.
}

PresignedPutObjectInput contains the parameters for creating a time-bound direct-upload URL.

type PutObjectInput

type PutObjectInput struct {
	Bucket       string                // Bucket specifies the name of the bucket where the object will be stored.
	Source       io.Reader             // Source is the reader interface that provides the object's content.
	TargetPath   string                // TargetPath specifies the full path where the object should be stored within the bucket.
	Acl          types.ObjectCannedACL // Acl defines the canned access control list setting for the uploaded object.
	MimeType     string                // MimeType specifies the MIME type of the object being uploaded.
	CacheControl string                // CacheControl specifies the HTTP Cache-Control header to persist with the object.
	DisableACL   bool                  // DisableACL omits the ACL field entirely for buckets that do not allow object ACLs.
}

PutObjectInput contains the parameters for uploading an object to a storage bucket. It includes the bucket's name, a reader interface to read the content from, the target path within the bucket, access control settings, and the MIME type of the object.

type PutObjectResult

type PutObjectResult struct {
	IsUploaded bool   // Indicates whether the upload was successful.
	ETag       string // ETag is an identifier for a specific version of the uploaded object.
	ObjectKey  string // ObjectKey is the unique identifier for the object in the storage.
}

PutObjectResult encapsulates the outcome of an object upload operation. It includes status of the upload and identifiers such as ETag and object key.

type S3Object

type S3Object struct {
	Key          string    // Key is the unique identifier for the object within the storage.
	LastModified time.Time // Timestamp of when the object was last modified.
	Size         int64     // Size of the object in bytes.
}

S3Object represents a single object within S3 or similar storage systems. It includes essential details such as the key, size, and last modification time of the object.

Jump to

Keyboard shortcuts

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