signer

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MultipartPartObjectKey

func MultipartPartObjectKey(key, uploadID string, partNumber int32) string

MultipartPartObjectKey returns the storage key for a specific part of a multipart upload.

Types

type MultipartPart

type MultipartPart struct {
	PartNumber int32
	ETag       string
}

MultipartPart represents a part in a multipart upload.

func NormalizedMultipartParts

func NormalizedMultipartParts(parts []MultipartPart) []MultipartPart

NormalizedMultipartParts sorts parts by their part number.

type SignOptions

type SignOptions struct {
	ExpiresIn time.Duration
	Method    string
}

SignOptions contains optional parameters for signing.

type Signer

type Signer interface {
	// SignURL signs a URL for the given resource (usually for Get or Put).
	SignURL(ctx context.Context, bucket, key string, opts SignOptions) (string, error)

	// SignDownloadPart signs a URL for downloading a specific byte range.
	SignDownloadPart(ctx context.Context, bucket, key string, start int64, end int64, opts SignOptions) (string, error)

	// InitMultipartUpload initializes a multipart upload and returns an upload ID.
	InitMultipartUpload(ctx context.Context, bucket, key string) (string, error)

	// SignMultipartPart signs a URL for uploading a specific part of a multipart upload.
	SignMultipartPart(ctx context.Context, bucket, key, uploadID string, partNumber int32) (string, error)

	// CompleteMultipartUpload finalizes a multipart upload.
	CompleteMultipartUpload(ctx context.Context, bucket, key, uploadID string, parts []MultipartPart) error
}

Signer is the interface for cloud-specific URL signing and multipart operations.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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