Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

github.com/vaikas/buildpackstuffhttp

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/vaikas/buildpackstuffhttp

  • v0.0.0-20201124223901-64b3be03e7bd
  • Source
  • Go
  • Socket score

Version published
Created
Source

Go HTTP handler function detection

This repo has some playthings that I used for learning buildpacks as well as how to use Go tools for doing inspection of source code in Go. Basic idea is to be able to use these tools to detect if a given Go source code is compatible with net.http.HandlerFunc. Rough idea being that we'll inspect the files and determine if we can autogen enough scaffolding to just inject the HTTP handler code in, and have the user just be able to write the handler code alone without having to spin up the web server for it.

Building

go-buildpack/bin/detect is a binary that has been built like this:

GOOS=linux GOARCH=amd64 go build ./cmd/detect/main.go && cp main ~/buildpack-go/go-buildpack/bin/detect

If you want to target a different arch / OS, you'd have to modify the GO* params as appropriate.

Supported function signatures

Basically, you just need to have a file that imports the net/http and has an externally visible (capitalized) function that implements the HTTP handler.

FAQs

Package last updated on 24 Nov 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc