utils

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EXPIRE_KEY = "%s:expire_at"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ICache added in v0.0.3

type ICache interface {
	Set(string, interface{}, time.Duration) error
	Get(string) (interface{}, error)
}
var DefaultMemoryCache ICache = &memoryCache{
	data: make(map[string]interface{}),
}

type IJwtParser added in v0.0.3

type IJwtParser interface {
	ParseJwtToken(string, jwt.Claims, ...jwt.ParserOption) (*jwt.Token, error)
}

func NewJwtParse added in v0.0.3

func NewJwtParse(jwksUrl string, client IRequestClient, cache ICache) IJwtParser

type IRequestClient added in v0.0.3

type IRequestClient interface {
	Do(*http.Request) (*http.Response, error)
}
var DefaultClient IRequestClient = http.DefaultClient

type JwtParse added in v0.0.3

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

func (*JwtParse) ParseJwtToken added in v0.0.3

func (p *JwtParse) ParseJwtToken(token string, claims jwt.Claims, options ...jwt.ParserOption) (*jwt.Token, error)

type PublicKey added in v0.0.3

type PublicKey struct {
	Kid    string `json:"kid"`
	Public string `json:"public"`
}

type WrapResponseWriter

type WrapResponseWriter struct {
	gin.ResponseWriter
	ByteBuffer *bbpool.ByteBuffer
}

func (*WrapResponseWriter) Write

func (w *WrapResponseWriter) Write(data []byte) (int, error)

Jump to

Keyboard shortcuts

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