rest

package
v0.0.0-...-315b7b0 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2019 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DELETE

func DELETE(route string, handler interface{}) interfaces.TransportOption

func EnableCORS

func EnableCORS() interfaces.TransportOption

func GET

func GET(route string, handler interface{}) interfaces.TransportOption

func POST

func POST(route string, handler interface{}) interfaces.TransportOption

func PUT

func PUT(route string, handler interface{}) interfaces.TransportOption

func WithHandler

func WithHandler(mode, route string, handler interface{}) interfaces.TransportOption

func WithLogger

func WithLogger(logger *logrus.Logger) interfaces.TransportOption

func WithMiddleware

func WithMiddleware(middleware interface{}) interfaces.TransportOption

func WithPort

func WithPort(port int) interfaces.TransportOption

func WithStaticFilesFolder

func WithStaticFilesFolder(route, folder string) interfaces.TransportOption

Types

type Rest

type Rest struct {
	*logrus.Logger
	// contains filtered or unexported fields
}

Rest Server

func New

func New(options ...interfaces.TransportOption) (*Rest, error)

func (*Rest) Handler

func (r *Rest) Handler(mode, route string, handler interface{}) error

func (*Rest) Middleware

func (r *Rest) Middleware(middleware interface{}) error

func (*Rest) Port

func (r *Rest) Port() int

func (*Rest) Router

func (r *Rest) Router() (interface{}, error)

func (*Rest) Run

func (r *Rest) Run() error

func (*Rest) StaticFilesFolder

func (r *Rest) StaticFilesFolder(uri, folder string) error

func (*Rest) Stop

func (r *Rest) Stop() error

func (*Rest) WithLogger

func (r *Rest) WithLogger(logger *logrus.Logger) error

Jump to

Keyboard shortcuts

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