aws

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: May 22, 2023 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Overview

Package aws contains the services for AWS.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HandleBase64

func HandleBase64(src []byte) []byte

HandleBase64 tries to decode the provided byte slice.

func HandleBase64String

func HandleBase64String(src *string) *string

HandleBase64String tries to decode the provided string behind the ptr.

Types

type Body

type Body struct {
	Data      []byte `json:"-" yaml:"-"`
	Formatted bool   `json:"-" yaml:"-"`
}

func (*Body) MarshalJSON

func (b *Body) MarshalJSON() ([]byte, error)

func (*Body) String

func (b *Body) String() string

func (*Body) UnmarshalJSON

func (b *Body) UnmarshalJSON(bytes []byte) error

func (*Body) UnmarshalYAML

func (b *Body) UnmarshalYAML(value *yaml.Node) error

type Headers added in v1.0.1

type Headers http.Header

func (*Headers) MarshalJSON added in v1.0.2

func (h *Headers) MarshalJSON() ([]byte, error)

func (*Headers) UnmarshalJSON added in v1.0.1

func (h *Headers) UnmarshalJSON(data []byte) error

func (*Headers) UnmarshalYAML added in v1.0.1

func (h *Headers) UnmarshalYAML(value *yaml.Node) error

type LambdaRequest

type LambdaRequest struct {
	// Host in the request.
	Host string `json:"host,omitempty" yaml:"host,omitempty"`
	// Headers of the request.
	Headers Headers `json:"headers,omitempty" yaml:"header,omitempty"`
	// Method from the request.
	Method string `json:"method,omitempty" yaml:"method,omitempty"`
	// URI from the request.
	URI string `json:"uri" yaml:"uri"`
	// Vars parsed from the path.
	Vars map[string]string `json:"vars" yaml:"vars"`
	// Body from the request
	Body []byte `json:"body" yaml:"body"`
}

LambdaRequest to be sent to the lambda.

type LambdaResponse

type LambdaResponse struct {
	// StatusCode for the http response.
	StatusCode int `json:"statusCode" yaml:"statusCode"`
	// Headers to be appended.
	Headers Headers `json:"headers" yaml:"headers"`
	// Body to be written.
	Body Body `json:"body" yaml:"body"`
}

LambdaResponse from the invocation.

type LambdaService

type LambdaService interface {
	// Invoke the lambda from the provided arn.ARN using the provided LambdaRequest.
	Invoke(ctx context.Context, arn arn.ARN, request *LambdaRequest) (*LambdaResponse, error)
}

LambdaService for invocation.

func NewLambdaService

func NewLambdaService(ctx context.Context) (LambdaService, error)

NewLambdaService from aws-sdk.

type SdkLambdaService

type SdkLambdaService func(ctx context.Context, params *lambda.InvokeInput, optFns ...func(*lambda.Options)) (
	*lambda.InvokeOutput, error,
)

func (SdkLambdaService) Invoke

func (s SdkLambdaService) Invoke(ctx context.Context, arn arn.ARN, request *LambdaRequest) (*LambdaResponse, error)

Jump to

Keyboard shortcuts

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