s3

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package s3 provides a imageserver.Server implementation that gets the Image from an S3 URL.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewS3Server

func NewS3Server(awsRegion, awsAccessKey, awsSecretKey, awsS3Bucket string) (imageserver.Server, error)

NewS3Server takes AWS Region, AccessKey, SecretKey, and S3 Bucket name, and returns a Server or an error.

If the values for Region, AccessKey, or SecretKey are not provided they are read from the well-known environment variable names they are typically stored.

Types

type Server

type Server struct {
	Session    *aws.Config
	BucketName string
}

Server is a imageserver.Server implementation that gets the Image from an S3 URL.

It parses the "source" param as a bucket-relative URL, then does a HEAD followed by a GET request for the item. It returns an error if there are any problems.

func (*Server) Get

func (srv *Server) Get(params imageserver.Params) (*imageserver.Image, error)

Get implements imageserver.Server.

Jump to

Keyboard shortcuts

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