sam

package
v1.12.0 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2025 License: Apache-2.0 Imports: 22 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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