middleware

package
v0.0.0-...-db28b0c Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2023 License: Unlicense Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ErrorHandler

func ErrorHandler(c *fiber.Ctx, err error) error

func HandleSendLog

func HandleSendLog(c *fiber.Ctx) (err error)

func NewCtx

func NewCtx(c *fiber.Ctx) error

func NewRelicHandle

func NewRelicHandle() fiber.Handler

New creates a new middleware handler

func NotFoundHandler

func NotFoundHandler(c *fiber.Ctx) error

func Recover

func Recover(c *fiber.Ctx) (err error)

func SetDB

func SetDB(c *fiber.Ctx) error

func ValidateAuth

func ValidateAuth(c *fiber.Ctx) error

Types

type Auth

type Auth struct {
	FiberCtx  *fiber.Ctx
	AppCtx    *app.Ctx
	Err       error
	ErrDetail interface{}
}

func (*Auth) ErrorHandler

func (auth *Auth) ErrorHandler() error

func (*Auth) GenerateSecureToken

func (auth *Auth) GenerateSecureToken(length int) string

func (*Auth) IsNeedValidate

func (auth *Auth) IsNeedValidate() bool

func (*Auth) RefreshToken

func (auth *Auth) RefreshToken() error

func (*Auth) SetUser

func (authCtx *Auth) SetUser() error

func (*Auth) Validate

func (auth *Auth) Validate() error

type Logger

type Logger struct {
	Slug         db.NullString          `json:"slug"`
	Host         db.NullString          `json:"host"`
	Email        db.NullString          `json:"email"`
	Method       db.NullString          `json:"method"`
	EndPoint     db.NullString          `json:"end_point"`
	Header       map[string]interface{} `json:"header"`
	Param        db.NullJSON            `json:"param"`
	BodyRequest  db.NullJSON            `json:"body_request"`
	RequestedAt  db.NullDateTime        `json:"request_at"`
	HttpStatus   db.NullInt64           `json:"http_status"`
	ErrorMsg     db.NullText            `json:"error_msg"`
	ErrorMessage db.NullJSON            `json:"error_message"`
	Trace        db.NullJSON            `json:"trace"`
}

type ResponseWriter

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

func (*ResponseWriter) Header

func (rw *ResponseWriter) Header() http.Header

Header implementation

func (*ResponseWriter) Write

func (rw *ResponseWriter) Write(p []byte) (int, error)

Write implementation

func (*ResponseWriter) WriteHeader

func (rw *ResponseWriter) WriteHeader(statusCode int)

WriteHeader implementation

Jump to

Keyboard shortcuts

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