sam

package
v1.9.4 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2024 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(args []string)

Types

type Config

type Config struct {
	Port     int
	Endpoint string
	Region   string
}

func (*Config) Init

func (c *Config) Init()

type Function

type Function struct {
	lambda.FunctionConfiguration
	Authorizer string //name of lambda function that act as authorizer

}

type Globals

type Globals struct {
	Function *Function `json:",omitempty"`
}

type Options

type Options struct {
	Port        int
	Region      string
	TemplateURL string
}

type Properties

type Properties struct {
	CodeUri string `json:",omitempty"`
	Events  map[string]*Resource
	Path    string `json:",omitempty"`
	Method  string `json:",omitempty"`
	*Function
}

func (*Properties) CodeURL

func (p *Properties) CodeURL(baseURL string) string

type ProxyResponse

type ProxyResponse struct {
	StatusCode int

	bytes.Buffer
	// contains filtered or unexported fields
}

func NewWriter

func NewWriter() *ProxyResponse

NewWriter creates a writer

func (*ProxyResponse) Header

func (w *ProxyResponse) Header() http.Header

func (*ProxyResponse) Update

func (w *ProxyResponse) Update(writer http.ResponseWriter)

func (*ProxyResponse) Write

func (w *ProxyResponse) Write(d []byte) (int, error)

func (*ProxyResponse) WriteHeader

func (w *ProxyResponse) WriteHeader(statusCode int)

type Resource

type Resource struct {
	Type       string     `json:",omitempty"`
	Function   *Function  `json:",omitempty"`
	Properties Properties `json:",omitempty"`
}

type Service

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

func New

func New(tmpl *Template, cfg *Config) (*Service, error)

func (*Service) Shutdown

func (s *Service) Shutdown(ctx context.Context) error

func (*Service) Start

func (s *Service) Start()

type Template

type Template struct {
	Resources map[string]*Resource
	Globals   *Globals
}

func NewTemplateWithURL

func NewTemplateWithURL(ctx context.Context, URL string) (*Template, error)

func (*Template) Init

func (t *Template) Init() error

func (*Template) LambdaConfig

func (t *Template) LambdaConfig() (*lambda.Config, error)

func (*Template) Routes

func (t *Template) Routes() (gateway.Routes, error)

Routes returns gateway routes with lambda info

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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