s3storage

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2026 License: MIT Imports: 16 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DropHeaders = []string{
	"Access-Control-Allow-Origin",
	"Access-Control-Expose-Headers",
	"Content-Security-Policy",
	"Referrer-Policy",
	"Server",
	"Strict-Transport-Security",
	"X-Content-Type-Options",
	"X-Frame-Options",
	"X-Ratelimit-Limit",
	"X-Ratelimit-Remaining",
	"X-Ratelimit-Reset",
	"X-Ratelimit-Resource",
	"X-Ratelimit-Used",
	"X-Xss-Protection",
}

DropHeaders are the headers that are dropped before persisting the response to S3.

View Source
var Key = func(req *http.Request) string {
	return strings.TrimPrefix(req.URL.String(), "https://")
}

Key generates the S3 key from the URL.

Functions

This section is empty.

Types

type Storage

type Storage struct {
	Client *s3.Client
	Bucket string
	Prefix string
}

Storage implements the ghtransport.Storage interface backed by AWS S3.

func Must

func Must(client *s3.Client, bucket string, prefix ...string) *Storage

Must returns a new Storage for the given bucket and (optional) prefix, or panics.

func New

func New(client *s3.Client, bucket string, prefix ...string) (*Storage, error)

New returns a new Storage for the given bucket and (optional) prefix.

func (*Storage) Get

func (s *Storage) Get(ctx context.Context, req *http.Request) (*http.Response, error)

func (*Storage) Put

func (s *Storage) Put(ctx context.Context, resp *http.Response) error

Jump to

Keyboard shortcuts

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