lib

package
v0.0.0-...-f5505c5 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2017 License: MIT Imports: 6 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Use

func Use(h http.HandlerFunc, middlewares ...Middleware) http.HandlerFunc

Use ...

Types

type BaseModel

type BaseModel struct {
	ID        uint       `json:"id" gorm:"primary_key"`
	CreatedAt *time.Time `json:"createdAt, omitempty"`
	UpdatedAt *time.Time `json:"updatedAt, omitempty"`
	DeletedAt *time.Time `json:"deletedAt, omitempty" sql:"index"`
}

BaseModel ...

type Middleware

type Middleware func(h http.HandlerFunc) http.HandlerFunc

Middleware ...

type MiddlewareFunc

type MiddlewareFunc func(h http.HandlerFunc) http.HandlerFunc

MiddlewareFunc ...

type Request

type Request struct {
	Request        *http.Request
	ResponseWriter http.ResponseWriter
}

Request ...

func (*Request) GetJSONBody

func (r *Request) GetJSONBody(model interface{})

GetJSONBody ...

func (*Request) GetVarID

func (r *Request) GetVarID() (int, error)

GetVarID ...

type Response

type Response struct {
	ResponseWriter http.ResponseWriter
}

Response ...

func (*Response) SendBadRequest

func (r *Response) SendBadRequest(message string)

SendBadRequest ...

func (*Response) SendCreated

func (r *Response) SendCreated(body interface{})

SendCreated ...

func (*Response) SendNoContent

func (r *Response) SendNoContent()

SendNoContent ...

func (*Response) SendNotFound

func (r *Response) SendNotFound()

SendNotFound ...

func (*Response) SendNotImplemented

func (r *Response) SendNotImplemented()

SendNotImplemented ...

func (*Response) SendOK

func (r *Response) SendOK(body interface{})

SendOK ...

Jump to

Keyboard shortcuts

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