route

package
v0.19.4 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2024 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Authorize

func Authorize(notAuth bool, handler fiber.Handler) fiber.Handler

func CheckAccessToken

func CheckAccessToken(accessToken string) (uid types.Uid, isValid bool)

CheckAccessToken check access token valid

func ErrorResponse

func ErrorResponse(ctx *fiber.Ctx, text string) error

func GetAccessToken

func GetAccessToken(req *http.Request) string

GetAccessToken Get API key from an HTTP request.

func GetIntParam

func GetIntParam(ctx *fiber.Ctx, name string) int64

func GetTopic

func GetTopic(ctx *fiber.Ctx) string

func GetUid

func GetUid(ctx *fiber.Ctx) types.Uid

func WebService

func WebService(app *fiber.App, group string, rs ...*Router)

Types

type Option

type Option func(r *Router)

func WithNotAuth

func WithNotAuth() Option

type Router

type Router struct {
	Method        string
	Path          string
	Function      fiber.Handler
	Documentation string
	NotAuth       bool
}

func Route

func Route(method string, path string, function fiber.Handler, options ...Option) *Router

Jump to

Keyboard shortcuts

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