route

package
v0.0.0-...-65546df Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const AuthKey = "auth"
View Source
const CountKey = "count"

Variables

View Source
var Private = ginx.V{Key: AuthKey, Val: 0}

Private metadata means that api needs to be user authenticated

View Source
var Public = ginx.V{Key: AuthKey, Val: 1}

Public means that api no need to be authenticated

Functions

func CountLimit

func CountLimit(limit int, duration time.Duration) ginx.V

CountLimit metadata means that api need to rate limit by number of requests

func GetTokenInfo

func GetTokenInfo(ctx *gin.Context) (*token.Token, bool, error)

GetTokenInfo returns token information from context

func MustGetTokenInfo

func MustGetTokenInfo(ctx *gin.Context) *token.Token

MustGetTokenInfo returns token information from context, panic if err != nil

func SetTokenInfo

func SetTokenInfo(ctx *gin.Context, token *token.Token)

SetTokenInfo stores token information into context

Types

This section is empty.

Jump to

Keyboard shortcuts

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