README

echo.apib

Echo middleware to help you generate API Blueprint for your Go web services

Expand ▾ Collapse ▴

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddParam

func AddParam(name string, typ string, ex string, desc string, req bool)

func ApibGenerator

func ApibGenerator(next echo.HandlerFunc) echo.HandlerFunc

func Flush

func Flush()

func Group

func Group(group string)

func Name

func Name(name string)

func Record

func Record()

func Store

func Store()

Types

type Call

type Call struct {
	Group    string
	Name     string
	Request  Request
	Response Response
}

type Param

type Param struct {
	Name        string
	Example     string
	Description string
	Type        string
	Required    bool
}

type Request

type Request struct {
	URI        string
	Method     string
	Headers    map[string]string
	Params     map[string][]string
	Body       string
	PathParams map[string]string
	FormParams map[string]string
}

type Resource

type Resource struct {
	Name        string
	URI         string
	Call        Call
	Params      map[string][]string
	ExtraParams []*Param
	Attributes  map[string]string
}

type Resources

type Resources []Resource

type Response

type Response struct {
	Headers    map[string]string
	Body       string
	StatusCode int
}

type Writer

type Writer struct {
	http.ResponseWriter
	// contains filtered or unexported fields
}

func NewWriter

func NewWriter(res http.ResponseWriter) *Writer

func (*Writer) Body

func (aw *Writer) Body() string

func (*Writer) Header

func (aw *Writer) Header() http.Header

func (*Writer) Write

func (aw *Writer) Write(b []byte) (int, error)

func (*Writer) WriteHeader

func (aw *Writer) WriteHeader(code int)