aws

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2021 License: Apache-2.0 Imports: 12 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetS3CLient

func GetS3CLient(sdc *cells_sdk.SdkConfig, s3c *cells_sdk.S3Config) (*s3.S3, error)

GetS3CLient creates and configure a new S3 client at each request. TODO optimize

func NewAuthTransport

func NewAuthTransport(rt http.RoundTripper, sdkConfig *cells_sdk.SdkConfig, s3Config *cells_sdk.S3Config) http.RoundTripper

NewAuthTransport takes an http.RoundTripper and returns a new one that adds the JWT Auth header on each request (and optionally logs the additional cost of getting the JWT token)

Types

type DefaultLogger

type DefaultLogger struct {
}

DefaultLogger logs basic information about the http responses.

func (DefaultLogger) LogRequest

func (dl DefaultLogger) LogRequest(*http.Request)

LogRequest does nothing.

func (DefaultLogger) LogResponse

func (dl DefaultLogger) LogResponse(req *http.Request, res *http.Response, err error, duration time.Duration)

LogResponse logs path, host, status code and duration in milliseconds.

type HTTPLogger

type HTTPLogger interface {
	LogRequest(*http.Request)
	LogResponse(*http.Request, *http.Response, error, time.Duration)
}

HTTPLogger defines the interface to log http request and responses.

Jump to

Keyboard shortcuts

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