img

package
v0.0.0-...-1c7d376 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2023 License: AGPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func R2Client

func R2Client(accountId, accessKeyId, accessKeySecret string) *s3.Client

func SignImageURL

func SignImageURL(imgURL string, config ...IMGConfig) string

SignImageURL signs an image URL with the given key and salt for imgproxy

func UploadFile

func UploadFile(file *multipart.FileHeader, directory string, filename string) (string, error)

UploadFile uploads a file to the R2 bucket and returns the file URL

Types

type IMGConfig

type IMGConfig struct {
	Width   int
	Height  int
	Quality int // 0-100
}

IMGConfig is a configuration for the imgproxy URL and image settings

Jump to

Keyboard shortcuts

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