restokit

package
v0.0.0-...-9fca49a Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2017 License: BSD-2-Clause Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

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

	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
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