lambada

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 31, 2020 License: MIT Imports: 9 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.

README

lambada

A pipe for HTTP(s) traffics based on serverless functions.

+-------------------------------------------------------+  
|  This application can tranfer HTTP(s) traffics ONLY!  |  
+-------------------------------------------------------+  
Lambda
  1. Create a aws lambda function with Runtime set to Go 1.x.
  2. In the Code tab of your created lambda function, upload source from zipped binary file built from cmd/server/lambda.
  3. Set Handler to the name of your built binary file name.
  4. Add LBD_KEY and LBD_USER environment variables in lambda functions/
  5. Create an api-gateway connected to your function when receiving POST request.
  6. Find server url from api-gateway.
Client
  1. Build binary from cmd/client
  2. Generate a CA key pair. (You can use openssl or v2ctl)
  3. Edit config.yaml to your own settings.

Documentation

Index

Constants

View Source
const (
	MethodGet uint8 = iota
	MethodHead
	MethodPost
	MethodPut
	MethodPatch
	MethodDelete
	MethodConnect
	MethodOptions
	MethodTrace
	MethodUnknown
)

Variables

This section is empty.

Functions

func DecodeMethod

func DecodeMethod(method uint8) string

func EncodeMethod

func EncodeMethod(method string) uint8

Types

type Request

type Request struct {
	URLLength    uint16
	URL          []byte
	Method       uint8
	HeaderLength uint16
	Header       []byte
	Body         []byte
}

func NewRequest

func NewRequest(httpReq *http.Request) (*Request, error)

func NewRequestFromReader

func NewRequestFromReader(r io.Reader) (*Request, error)

func (*Request) Encode

func (req *Request) Encode() (*bytes.Buffer, error)

func (*Request) HttpRequest

func (req *Request) HttpRequest() (*http.Request, error)

type Response

type Response struct {
	StatusCode   int16
	StatusLength uint8
	Status       []byte
	HeaderLength uint16
	Header       []byte
	Body         []byte
}

func NewResponse

func NewResponse(httpResp *http.Response) (*Response, error)

func NewResponseFromReader

func NewResponseFromReader(r io.Reader) (*Response, error)

func (*Response) Encode

func (resp *Response) Encode() (*bytes.Buffer, error)

func (*Response) HttpResponse

func (resp *Response) HttpResponse() (*http.Response, error)

Directories

Path Synopsis
cmd
client command
server/lambda command

Jump to

Keyboard shortcuts

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