http

package
v0.0.0-...-6006f0b Latest Latest
Warning

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

Go to latest
Published: May 15, 2022 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Authorization = "Authorization"
	ContentType   = "Content-Type"
	AmzTarget     = "X-Amz-Target"
)

Variables

This section is empty.

Functions

func NewChiMux

func NewChiMux(moto MotoService, sqs SqsService, proxy Proxy) *chi.Mux

func ServiceFromRequest

func ServiceFromRequest(request *http.Request) string

Types

type ContextKey

type ContextKey string

type MotoService

type MotoService interface {
	SaveRequest(ctx context.Context, request domain.MotoRequest) error
}

type Proxy

type Proxy struct {
	// contains filtered or unexported fields
}

func NewProxy

func NewProxy(cfg *settings.Config) Proxy

type SqsResponse

type SqsResponse struct {
	// contains filtered or unexported fields
}

func NewSqsResponse

func NewSqsResponse(service SqsService, w http.ResponseWriter, payload string) SqsResponse

func (SqsResponse) Header

func (s SqsResponse) Header() http.Header

func (SqsResponse) ReadFrom

func (s SqsResponse) ReadFrom(r io.Reader) (int64, error)

ReadFrom is necessary because response is being decorated; otherwise io.Copy will throw a short read error

func (SqsResponse) Write

func (s SqsResponse) Write(bytes []byte) (int, error)

func (*SqsResponse) WriteHeader

func (s *SqsResponse) WriteHeader(statusCode int)

type SqsService

type SqsService interface {
	ParseAction(string) string
	SaveAttributes(string) error
	DecorateAttributes(string, []byte) ([]byte, error)
}

Jump to

Keyboard shortcuts

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