httptoolbox

package module
v0.0.0-...-b837bd8 Latest Latest
Warning

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

Go to latest
Published: May 15, 2020 License: Apache-2.0 Imports: 10 Imported by: 0

README

HTTP Toolbox

HTTP handlers for digging serverless services.

Deploy

There are examples for App Engine, Cloud Functions, Cloud Run and GCP Buildpacks.

The handlers can be security backdoor. Don't deploy without some security setting.

App Engine Go 1.11
$ gcloud app deploy app_go111.yaml 
App Engine Go 1.12
$ gcloud app deploy app_go112.yaml 
Cloud Run
# Use Cloud Build
$ gcloud builds submit -t gcr.io/${PROJECT_ID}/httptoolbox 
# or use GCP Buildpacks
$ pack build --builder gcr.io/buildpacks/builder -e GOOGLE_BUILDABLE=./cmd/main --publish gcr.io/${PROJECT_ID}/httptoolbox 
$ gcloud run deploy --image gcr.io/${PROJECT_ID}/httptoolbox 
$ gcloud run deploy --image gcr.io/${PROJECT_ID}/httptoolbox 
Cloud Functions
$ gcloud functions deploy ExecDmesg --trigger-http --runtime=go111
GCP Buildpacks for App
$ pack build --builder gcr.io/buildpacks/builder -e GOOGLE_BUILDABLE=./cmd/main go-httptoolbox-app
$ docker run -p 8080:8080 --rm go-httptoolbox-app 

You can use gcloud alpha builds submit --pack.

$ gcloud alpha builds submit --pack=builder=gcr.io/buildpacks/builder,env=GOOGLE_BUILDABLE=./cmd/main,image=gcr.io/${PROJECT_ID}/go-httptoolbox-app
GCP Buildpacks for Function
$ pack build --builder gcr.io/buildpacks/builder -e GOOGLE_FUNCTION_TARGET=DumpRequest go-httptoolbox-function

$ docker run -p 8080:8080 --rm go-httptoolbox-function 

You can use gcloud alpha builds submit --pack.

$ gcloud alpha builds submit --pack=builder=gcr.io/buildpacks/builder,env=GOOGLE_FUNCTION_TARGET=DumpRequest,image=gcr.io/${PROJECT_ID}/go-httptoolbox-function

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DumpRequest

func DumpRequest(w http.ResponseWriter, req *http.Request)

func Email

func Email(w http.ResponseWriter, r *http.Request)

func Exec

func Exec(w http.ResponseWriter, req *http.Request)

func ExecDmesg

func ExecDmesg(w http.ResponseWriter, _ *http.Request)

func GetEnvs

func GetEnvs(w http.ResponseWriter, req *http.Request)

func GetHeaders

func GetHeaders(w http.ResponseWriter, req *http.Request)

func Metadata

func Metadata(w http.ResponseWriter, r *http.Request)

func ReadContent

func ReadContent(w http.ResponseWriter, req *http.Request)

func TokenInfo

func TokenInfo(w http.ResponseWriter, r *http.Request)

func WriteEnvs

func WriteEnvs(w http.ResponseWriter, req *http.Request)

func WriteHeaders

func WriteHeaders(w http.ResponseWriter, req *http.Request)

Types

This section is empty.

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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