httpadapter

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetSourceEvent

func GetSourceEvent(ctx context.Context) any

func NewBase64WriteCloser

func NewBase64WriteCloser(field *string) io.WriteCloser

func WithSourceEvent

func WithSourceEvent(ctx context.Context, event any) context.Context

Types

type APIGwV1RequestAdapter

type APIGwV1RequestAdapter events.APIGatewayProxyRequest

func (APIGwV1RequestAdapter) ConsumeHeader

func (adapter APIGwV1RequestAdapter) ConsumeHeader(consumer HeaderConsumer)

func (APIGwV1RequestAdapter) ConsumeTrailer

func (adapter APIGwV1RequestAdapter) ConsumeTrailer(consumer HeaderConsumer)

func (APIGwV1RequestAdapter) GetBody

func (adapter APIGwV1RequestAdapter) GetBody() io.ReadCloser

func (APIGwV1RequestAdapter) GetMethod

func (adapter APIGwV1RequestAdapter) GetMethod() string

func (APIGwV1RequestAdapter) GetProto

func (adapter APIGwV1RequestAdapter) GetProto() string

func (APIGwV1RequestAdapter) GetRemoteAddr

func (adapter APIGwV1RequestAdapter) GetRemoteAddr() string

func (APIGwV1RequestAdapter) GetURI

func (adapter APIGwV1RequestAdapter) GetURI() string

type APIGwV1ResponseAdapter

type APIGwV1ResponseAdapter events.APIGatewayProxyResponse

func (*APIGwV1ResponseAdapter) AddHeader

func (adapter *APIGwV1ResponseAdapter) AddHeader(k string, v string)

func (*APIGwV1ResponseAdapter) AddTrailer

func (adapter *APIGwV1ResponseAdapter) AddTrailer(k string, v string)

func (*APIGwV1ResponseAdapter) GetBodyWriter

func (adapter *APIGwV1ResponseAdapter) GetBodyWriter() io.WriteCloser

func (*APIGwV1ResponseAdapter) SetHeader

func (adapter *APIGwV1ResponseAdapter) SetHeader(k string, v []string)

func (*APIGwV1ResponseAdapter) SetStatusCode

func (adapter *APIGwV1ResponseAdapter) SetStatusCode(status int)

func (*APIGwV1ResponseAdapter) SetTrailer

func (adapter *APIGwV1ResponseAdapter) SetTrailer(k string, v []string)

type APIGwV2RequestAdapter

type APIGwV2RequestAdapter events.APIGatewayV2HTTPRequest

func (APIGwV2RequestAdapter) ConsumeHeader

func (adapter APIGwV2RequestAdapter) ConsumeHeader(consumer HeaderConsumer)

func (APIGwV2RequestAdapter) ConsumeTrailer

func (adapter APIGwV2RequestAdapter) ConsumeTrailer(consumer HeaderConsumer)

func (APIGwV2RequestAdapter) GetBody

func (adapter APIGwV2RequestAdapter) GetBody() io.ReadCloser

func (APIGwV2RequestAdapter) GetMethod

func (adapter APIGwV2RequestAdapter) GetMethod() string

func (APIGwV2RequestAdapter) GetProto

func (adapter APIGwV2RequestAdapter) GetProto() string

func (APIGwV2RequestAdapter) GetRemoteAddr

func (adapter APIGwV2RequestAdapter) GetRemoteAddr() string

func (APIGwV2RequestAdapter) GetURI

func (adapter APIGwV2RequestAdapter) GetURI() string

type APIGwV2ResponseAdapter

type APIGwV2ResponseAdapter events.APIGatewayV2HTTPResponse

func (*APIGwV2ResponseAdapter) AddHeader

func (adapter *APIGwV2ResponseAdapter) AddHeader(k string, v string)

func (*APIGwV2ResponseAdapter) AddTrailer

func (adapter *APIGwV2ResponseAdapter) AddTrailer(k string, v string)

func (*APIGwV2ResponseAdapter) GetBodyWriter

func (adapter *APIGwV2ResponseAdapter) GetBodyWriter() io.WriteCloser

func (*APIGwV2ResponseAdapter) SetHeader

func (adapter *APIGwV2ResponseAdapter) SetHeader(k string, v []string)

func (*APIGwV2ResponseAdapter) SetStatusCode

func (adapter *APIGwV2ResponseAdapter) SetStatusCode(status int)

func (*APIGwV2ResponseAdapter) SetTrailer

func (adapter *APIGwV2ResponseAdapter) SetTrailer(k string, v []string)

type AdapterFunc

type AdapterFunc func(ctx context.Context, req RequestAdapter, res ResponseAdapter) error

func NewVanillaAdapter

func NewVanillaAdapter(delegate http.Handler) AdapterFunc

type FunctionURLRequestAdapter

type FunctionURLRequestAdapter events.LambdaFunctionURLRequest

func (FunctionURLRequestAdapter) ConsumeHeader

func (adapter FunctionURLRequestAdapter) ConsumeHeader(consumer HeaderConsumer)

func (FunctionURLRequestAdapter) ConsumeTrailer

func (adapter FunctionURLRequestAdapter) ConsumeTrailer(consumer HeaderConsumer)

func (FunctionURLRequestAdapter) GetBody

func (adapter FunctionURLRequestAdapter) GetBody() io.ReadCloser

func (FunctionURLRequestAdapter) GetMethod

func (adapter FunctionURLRequestAdapter) GetMethod() string

func (FunctionURLRequestAdapter) GetProto

func (adapter FunctionURLRequestAdapter) GetProto() string

func (FunctionURLRequestAdapter) GetRemoteAddr

func (adapter FunctionURLRequestAdapter) GetRemoteAddr() string

func (FunctionURLRequestAdapter) GetURI

func (adapter FunctionURLRequestAdapter) GetURI() string

type FunctionURLResponseAdapter

type FunctionURLResponseAdapter events.LambdaFunctionURLResponse

func (*FunctionURLResponseAdapter) AddHeader

func (adapter *FunctionURLResponseAdapter) AddHeader(k string, v string)

func (*FunctionURLResponseAdapter) AddTrailer

func (adapter *FunctionURLResponseAdapter) AddTrailer(k string, v string)

func (*FunctionURLResponseAdapter) GetBodyWriter

func (adapter *FunctionURLResponseAdapter) GetBodyWriter() io.WriteCloser

func (*FunctionURLResponseAdapter) SetHeader

func (adapter *FunctionURLResponseAdapter) SetHeader(k string, v []string)

func (*FunctionURLResponseAdapter) SetStatusCode

func (adapter *FunctionURLResponseAdapter) SetStatusCode(status int)

func (*FunctionURLResponseAdapter) SetTrailer

func (adapter *FunctionURLResponseAdapter) SetTrailer(k string, v []string)

type HeaderConsumer

type HeaderConsumer interface {
	Add(string, string)
	Set(string, string)
}

type RequestAdapter

type RequestAdapter interface {
	GetMethod() string
	GetURI() string
	GetProto() string
	GetRemoteAddr() string
	ConsumeHeader(consumer HeaderConsumer)
	ConsumeTrailer(consumer HeaderConsumer)
	GetBody() io.ReadCloser
}

type ResponseAdapter

type ResponseAdapter interface {
	SetStatusCode(int)
	SetHeader(string, []string)
	AddHeader(string, string)
	SetTrailer(string, []string)
	AddTrailer(string, string)
	GetBodyWriter() io.WriteCloser
}

Jump to

Keyboard shortcuts

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