restokit

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

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

Go to latest
Published: Feb 20, 2019 License: MIT Imports: 11 Imported by: 0

README

restokit

fasthttp + fasthttprouter + middleware + codegen

Documentation

Index

Constants

View Source
const Version = "1.0.0"

Variables

This section is empty.

Functions

func TeardownHTTP

func TeardownHTTP(r *Restokit) error

TeardownHTTP for cleanup of test scaffolding

Types

type Restokit

type Restokit struct {
	Router    *fasthttprouter.Router
	Server    *fasthttp.Server
	Listener  net.Listener
	Logger    *logrus.Entry
	ShortName string
	AppName   string

	HealthCheck    fasthttp.RequestHandler
	ReadinessCheck fasthttp.RequestHandler
	// contains filtered or unexported fields
}

Restokit is the REST framework common building block. The system involves simple codegen tricks.

func NewRestokit

func NewRestokit(addr string) *Restokit

NewRestokit creates a new restokit with the specified address

func ScaffoldHTTP

func ScaffoldHTTP() (*Restokit, *http.Client)

ScaffoldHTTP creates an in-memory listener restokit with http client.

func (*Restokit) AddGlobalMiddleware

func (r *Restokit) AddGlobalMiddleware(fn Middleware)

AddGlobalMiddleware to the middleware stack. Only works before starting.

func (*Restokit) Start

func (r *Restokit) Start() error

Start starts the server as built.

Directories

Path Synopsis
cmd
api
Package api is for API routes.
Package api is for API routes.

Jump to

Keyboard shortcuts

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