bingo

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

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

Go to latest
Published: Nov 28, 2018 License: MIT Imports: 12 Imported by: 0

README

bingo

bingo is a toolkit for building microservices . It is meant to be used along with https://goji.io

It is currently a work in progress

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BoundParam

func BoundParam(ctx context.Context, name string) string

BoundParam returns the bound parameter with the given name. Wraps around goji's pat.Param

func Close

func Close(closer io.Closer, log log.Logger)

Close an io.Closer object by handling it's error. Example:

h, err := app.Init(env)
defer utils.Close(h, conf.Config.Log())

func JSONW

func JSONW(w http.ResponseWriter, status int, l log.Logger, data interface{})

JSONW writes JSON response to the given writer

func PrintBanner

func PrintBanner(a ...interface{})

PrintBanner prints the banner

func PrintError

func PrintError(a ...interface{})

PrintError prints the error

func PrintName

func PrintName(str string)

PrintName prints the app name

func ReadBody

func ReadBody(request *http.Request, des interface{}, msg string) error

ReadBody decodes request.Body into the destination.

Warning: des should be a pointer

func Run

func Run(addr string, timeout time.Duration, h http.Handler)

Run gracefully starts the http server

Types

type Handler

type Handler struct {
	// contains filtered or unexported fields
}

Handler encapsulates the handlers

func Wrap

func Wrap(h http.Handler) *Handler

Wrap wraps http.Handler with the bingo Handler

func (*Handler) AddCloser

func (h *Handler) AddCloser(c io.Closer) *Handler

AddCloser adds a closer

func (*Handler) Close

func (h *Handler) Close() error

Close cleans up any resources

func (*Handler) ServeHTTP

func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request)

Directories

Path Synopsis
Package infra contains the infrastructural services for the application Infrastructural services focuses on the “plumbing” requirements of an application; e.g.
Package infra contains the infrastructural services for the application Infrastructural services focuses on the “plumbing” requirements of an application; e.g.
aws
aws/ses
Package ses provides the library to communicate to ses service
Package ses provides the library to communicate to ses service
aws/sns
Package sns provides the library to communicate to sns service
Package sns provides the library to communicate to sns service
log
Package log provides provides a minimal interface for structured logging
Package log provides provides a minimal interface for structured logging
metrics
Package metrics provides utilities for capturing counters gauges and histograms from various services written with bingo
Package metrics provides utilities for capturing counters gauges and histograms from various services written with bingo
mysql
Package mysql provides the library to communicate to mysql
Package mysql provides the library to communicate to mysql
postgresql
Package postgresql provides the library to communicate to postgresql
Package postgresql provides the library to communicate to postgresql
redis
Package redis provides the library to communicate to redis
Package redis provides the library to communicate to redis
solr
Package solr provides the library to communicate to solr
Package solr provides the library to communicate to solr
sqs
Package middleware contains middlewares to aid the development of micro-services
Package middleware contains middlewares to aid the development of micro-services
jwt
Package mux is a wrapper over goji.Mux It adds a predefined list of middlewares to muxes and sub-muxes that would be created via the New() and Sub() functions e.g.
Package mux is a wrapper over goji.Mux It adds a predefined list of middlewares to muxes and sub-muxes that would be created via the New() and Sub() functions e.g.

Jump to

Keyboard shortcuts

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