Giter VIP home page Giter VIP logo

gohttpcheck's Introduction

Go HTTP Checker

Build

git clone https://github.com/stobbsm/gohttpcheck
cd gohttpcheck
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags '-extldflags "-static" -w'

Binary is called gohttpcheck. It is static, and can be included in any docker container to facilitate health checks when they otherwise aren't available.

Usage

gohttpcheck http://<HOST>:<PORT>/{ENDPOINT}

Where:

  • HOST = either the IP or resolvable hostname to connect to
  • PORT = the port number if non-standard
  • ENDPOINT = optional, the path to check

All Messages are printed to Stderr. Exit code 1 means it was unsuccessful. Exit code 0 means it was successful.

If not successful, the error is printed on Stderr. If successful, you will get a message of status: <HTTP STATUS CODE>, where HTTP STATUS CODE is usually going to be 200.

Caveats

The scope of this simple application is to check http endpoints only, not https, used inside of containers. It does not and will not support https. It may work for now, but I can't garuntee it will work forever.

TODO:

  • Create actions workflow to create releases based on the main branch.
  • The created binary is still to large, and since it really just need to make a TCP call and get the statuscode from the initial set of headers, I will eventually make this use a raw TCP call.

gohttpcheck's People

Contributors

stobbsm avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.