fiberserver

package
v0.0.7-alpha Latest Latest
Warning

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

Go to latest
Published: May 30, 2022 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(config Config) server.Server

Types

type Config

type Config struct {
	JwtSigningKey string
	AppName       string
	JSONEncoder   utils.JSONMarshal
}

type Context

type Context struct {
	*fiber.Ctx
	MetaData *entities.Meta
}

func (*Context) BaseUrl

func (c *Context) BaseUrl() string

func (*Context) BodyParser

func (c *Context) BodyParser(v interface{}) error

func (*Context) Context

func (c *Context) Context() context.Context

func (*Context) Cookie

func (c *Context) Cookie(v *server.Cookie)

func (*Context) Cookies

func (c *Context) Cookies(key string, defaultValue ...string) string

func (*Context) File

func (c *Context) File(name string) (*multipart.FileHeader, error)

func (*Context) Header

func (c *Context) Header(key string, vals ...string) string

func (*Context) Hostname

func (c *Context) Hostname() string

func (*Context) Json

func (c *Context) Json(v interface{}) error

func (*Context) Locals

func (c *Context) Locals(key string, value ...interface{}) (val interface{})

func (*Context) Logger

func (c *Context) Logger() logger.Logger

func (*Context) Messages

func (c *Context) Messages(ms ...*entities.Messages) *entities.Messages

func (*Context) Meta

func (c *Context) Meta(metas ...*entities.Meta) *entities.Meta

func (*Context) Method

func (c *Context) Method() string

func (*Context) Next

func (c *Context) Next() error

func (*Context) OriginalURL

func (c *Context) OriginalURL() string

func (*Context) Param

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

func (*Context) ParamInt

func (c *Context) ParamInt(key string, values ...int) int

func (*Context) Path

func (c *Context) Path() string

func (*Context) Post

func (c *Context) Post(posts ...*entities.Post) *entities.Post

func (*Context) Query

func (c *Context) Query(key string, values ...string) string

func (*Context) QueryInt

func (c *Context) QueryInt(key string, values ...int) int

func (*Context) Redirect

func (c *Context) Redirect(path string) error

func (*Context) RedirectToRoute

func (c *Context) RedirectToRoute(name string, params ...map[string]interface{}) error

func (*Context) Render

func (c *Context) Render(fn func(meta *entities.Meta, wr *bufio.Writer)) error

func (*Context) RequestID

func (c *Context) RequestID() string

func (*Context) Response

func (c *Context) Response() server.Response

func (*Context) RouteName

func (c *Context) RouteName() string

func (*Context) Send

func (c *Context) Send(data []byte) error

func (*Context) SendString

func (c *Context) SendString(data string) error

func (*Context) Status

func (c *Context) Status(v int) server.Context

func (*Context) User

func (c *Context) User() *entities.User

func (*Context) WithError

func (c *Context) WithError(msg string, err error)

type Group

type Group struct {
	*fiber.App
	FGroup *fiber.Group
	// contains filtered or unexported fields
}

func (*Group) Delete

func (g *Group) Delete(path string, handler server.Handler, authConfigs ...*server.AuthConfig)

func (*Group) Get

func (g *Group) Get(path string, handler server.Handler, authConfigs ...*server.AuthConfig)

func (*Group) Group

func (g *Group) Group(prefix string, handlers ...server.Handler) server.Group

func (*Group) Head

func (g *Group) Head(path string, handler server.Handler, authConfigs ...*server.AuthConfig)

func (*Group) Options

func (g *Group) Options(path string, handler server.Handler, authConfigs ...*server.AuthConfig)

func (*Group) Patch

func (g *Group) Patch(path string, handler server.Handler, authConfigs ...*server.AuthConfig)

func (*Group) Post

func (g *Group) Post(path string, handler server.Handler, authConfigs ...*server.AuthConfig)

func (*Group) Put

func (g *Group) Put(path string, handler server.Handler, authConfigs ...*server.AuthConfig)

func (*Group) Use

func (g *Group) Use(handler server.Handler)

type Response

type Response struct {
	*fasthttp.Response
}

func (*Response) Header

func (r *Response) Header(key string, vals ...string) string

type Route

type Route struct {
	*fiber.Route
}

func (*Route) Method

func (r *Route) Method() string

func (*Route) Name

func (r *Route) Name() string

func (*Route) Path

func (r *Route) Path() string

type Server

type Server struct {
	*fiber.App
	// contains filtered or unexported fields
}

func (*Server) Delete

func (s *Server) Delete(path string, handler server.Handler, authConfigs ...*server.AuthConfig)

func (*Server) Get

func (s *Server) Get(path string, handler server.Handler, authConfigs ...*server.AuthConfig)

func (*Server) Group

func (s *Server) Group(prefix string, handlers ...server.Handler) server.Group

func (*Server) Head

func (s *Server) Head(path string, handler server.Handler, authConfigs ...*server.AuthConfig)

func (*Server) Listen

func (s *Server) Listen(address string)

func (*Server) Options

func (s *Server) Options(path string, handler server.Handler, authConfigs ...*server.AuthConfig)

func (*Server) Patch

func (s *Server) Patch(path string, handler server.Handler, authConfigs ...*server.AuthConfig)

func (*Server) Post

func (s *Server) Post(path string, handler server.Handler, authConfigs ...*server.AuthConfig)

func (*Server) Put

func (s *Server) Put(path string, handler server.Handler, authConfigs ...*server.AuthConfig)

func (*Server) Register

func (s *Server) Register(register func(ss server.Server)) server.Server

func (*Server) Static

func (s *Server) Static(prefix, root string, configs ...server.StaticConfig)

func (*Server) Test

func (s *Server) Test(req *http.Request, msTimeout ...int) (resp *http.Response, err error)

func (*Server) Use

func (s *Server) Use(handlers ...server.Handler)

func (*Server) UsePrefix

func (s *Server) UsePrefix(prefix string, handlers ...server.Handler)

Jump to

Keyboard shortcuts

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