s3sign

package
v1.11.0 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2026 License: MIT Imports: 8 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package s3sign builds SigV4 presigned URLs for S3 GET requests, offline and with the standard library only: the secret key never leaves the machine.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EncodePath

func EncodePath(path string) string

EncodePath encodes a decoded path for SigV4 and the URL: each segment on its own, the slashes kept and never collapsed.

func PathStyle

func PathStyle(bucket, key string) string

PathStyle is the path of `key` in `bucket` on a path-style endpoint: "/bucket/key".

func PresignGet

func PresignGet(r Request) (string, error)

PresignGet returns the presigned GET URL. Only the host header is signed and the payload is UNSIGNED-PAYLOAD, like the AWS SDKs do for presigned URLs.

Types

type Request

type Request struct {
	// Endpoint is the scheme and host (and port), e.g. https://eu.cubestorage.io.
	Endpoint string
	Region   string
	// Path is the decoded request path, e.g. "/photos/a/report.pdf". It is encoded per
	// segment as S3 does: slashes are kept, everything but A-Z a-z 0-9 - . _ ~ is %XX.
	Path      string
	AccessKey string
	SecretKey string
	Expires   time.Duration
	Now       time.Time
}

Request is what a presigned GET signs.

Jump to

Keyboard shortcuts

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