simpleapi

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type App

type App struct {
	// contains filtered or unexported fields
}

func New

func New() *App

func (*App) AddHandler

func (s *App) AddHandler(path string, method string, handlers ...interface{}) error

func (*App) Endpoint

func (s *App) Endpoint(path string, handlerFuncs ...func(e *Endpoint) interface{})

func (*App) ListenAndServe

func (s *App) ListenAndServe(addr string) error

func (*App) ServeHTTP

func (s *App) ServeHTTP(w http.ResponseWriter, r *http.Request)

type Context

type Context struct {
	Request  *http.Request
	Response http.ResponseWriter
	// contains filtered or unexported fields
}

func (*Context) HTML

func (c *Context) HTML(status int, html string) error

func (*Context) JSON

func (c *Context) JSON(status int, data interface{}) error

func (*Context) Next

func (c *Context) Next() error

type Endpoint

type Endpoint struct {
	// contains filtered or unexported fields
}

func (*Endpoint) DELETE

func (e *Endpoint) DELETE() *Endpoint

func (*Endpoint) GET

func (e *Endpoint) GET() *Endpoint

func (*Endpoint) POST

func (e *Endpoint) POST() *Endpoint

func (*Endpoint) PUT

func (e *Endpoint) PUT() *Endpoint

func (*Endpoint) WithResponse

func (e *Endpoint) WithResponse(code int, response interface{}, description string) *Endpoint

func (*Endpoint) WithTag

func (e *Endpoint) WithTag(tag string) *Endpoint

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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