mate

package module
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Context

type Context struct {
	Response *Response
	Request  *Request
}

func NewContext

func NewContext(w http.ResponseWriter, r *http.Request) *Context

func (*Context) BindBody

func (c *Context) BindBody(data interface{}) error

func (*Context) Error

func (c *Context) Error(status int, err error)

func (*Context) GetPathValue

func (c *Context) GetPathValue(key string) string

func (*Context) GetQueryParam

func (c *Context) GetQueryParam(key string) string

func (*Context) JSON

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

func (*Context) Status

func (c *Context) Status(status int)

func (*Context) Text

func (c *Context) Text(status int, text string)

type Group added in v0.0.6

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

func (*Group) Delete added in v0.0.6

func (g *Group) Delete(path string, handler HandlerFunc)

func (*Group) Get added in v0.0.6

func (g *Group) Get(path string, handler HandlerFunc)

func (*Group) Patch added in v0.0.6

func (g *Group) Patch(path string, handler HandlerFunc)

func (*Group) Post added in v0.0.6

func (g *Group) Post(path string, handler HandlerFunc)

func (*Group) Put added in v0.0.6

func (g *Group) Put(path string, handler HandlerFunc)

type HandlerFunc

type HandlerFunc func(c *Context)

func LoggingMiddleware

func LoggingMiddleware(next HandlerFunc) HandlerFunc

type Middleware

type Middleware func(HandlerFunc) HandlerFunc

type Request

type Request struct {
	*http.Request
}

func (*Request) BindBody

func (r *Request) BindBody(data interface{}) error

func (*Request) GetPathValue

func (r *Request) GetPathValue(key string) string

func (*Request) GetQueryParam

func (r *Request) GetQueryParam(key string) string

type Response

type Response struct {
	http.ResponseWriter
}

func (*Response) Error

func (r *Response) Error(status int, err error)

func (*Response) JSON

func (r *Response) JSON(status int, data interface{})

func (*Response) Status

func (r *Response) Status(status int)

func (*Response) Text

func (r *Response) Text(status int, message string)

type Router

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

func NewRouter

func NewRouter() *Router

func (*Router) Delete

func (s *Router) Delete(path string, handler func(c *Context))

func (*Router) Get

func (r *Router) Get(path string, handler func(c *Context))

func (*Router) Patch

func (s *Router) Patch(path string, handler func(c *Context))

func (*Router) Post

func (s *Router) Post(path string, handler func(c *Context))

func (*Router) Put

func (s *Router) Put(path string, handler func(c *Context))

func (*Router) Routes

func (s *Router) Routes() *http.ServeMux

func (*Router) ServeHTTP

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

type SecureCookie

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

func NewSecureCookie

func NewSecureCookie(key string) *SecureCookie

func (*SecureCookie) ClearCookie

func (sc *SecureCookie) ClearCookie(w http.ResponseWriter, name string)

func (*SecureCookie) GetEncryptedCookie

func (sc *SecureCookie) GetEncryptedCookie(req *http.Request, name string) (string, error)

func (*SecureCookie) HasCookie

func (sc *SecureCookie) HasCookie(req *http.Request, name string) bool

func (*SecureCookie) SetEncryptedCookie

func (sc *SecureCookie) SetEncryptedCookie(w http.ResponseWriter, name, value string, expiry time.Duration) error

type Server

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

func New

func New() *Server

func (*Server) Delete

func (s *Server) Delete(path string, handler HandlerFunc)

func (*Server) Get

func (s *Server) Get(path string, handler HandlerFunc)

func (*Server) Group added in v0.0.6

func (s *Server) Group(path string, group func(r *Group))

func (*Server) Patch added in v0.0.6

func (s *Server) Patch(path string, handler HandlerFunc)

func (*Server) Post

func (s *Server) Post(path string, handler HandlerFunc)

func (*Server) Put

func (s *Server) Put(path string, handler HandlerFunc)

func (*Server) ServeHTTP

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

func (*Server) Start

func (s *Server) Start(port string)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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