websvc

package module
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoPrivilege = errors.New("fobidden")
)

Functions

func Auth

func Auth[TSES interface{}](cfg *AuthenticatorConfigure, handler func(*gin.Context, TSES) (int, interface{}, error), privilege string) gin.HandlerFunc

func AuthD

func AuthD[TSES interface{}, TDATA interface{}](cfg *AuthenticatorConfigure, handler func(*gin.Context, TSES, TDATA) (int, interface{}, error), privilege string) gin.HandlerFunc

func AuthQ

func AuthQ[TSES interface{}](cfg *AuthenticatorConfigure, handler func(*gin.Context, TSES, map[string]string) (int, interface{}, error), privilege string) gin.HandlerFunc

func AuthQD

func AuthQD[TSES interface{}, TDATA interface{}](cfg *AuthenticatorConfigure, handler func(*gin.Context, TSES, map[string]string, TDATA) (int, interface{}, error), privilege string) gin.HandlerFunc

func Handler added in v0.0.2

func Handler(handler func(*gin.Context) (int, interface{}, error)) gin.HandlerFunc

func HandlerD added in v0.0.2

func HandlerD[TDATA interface{}](handler func(*gin.Context, TDATA) (int, interface{}, error)) gin.HandlerFunc

func HandlerQ added in v0.0.2

func HandlerQ(handler func(*gin.Context, map[string]string) (int, interface{}, error)) gin.HandlerFunc

func HandlerQD added in v0.0.2

func HandlerQD[TDATA interface{}](handler func(*gin.Context, map[string]string, TDATA) (int, interface{}, error)) gin.HandlerFunc

func Task

func Task(name, addr string, initializer func(*gin.Engine)) service.ServiceTask

Types

type AuthenticatorConfigure

type AuthenticatorConfigure struct {
	QueryToken     func(context.Context, string) (interface{}, string, error)
	CheckPrivilege func(context.Context, string, interface{}, string) error
	RefreshToken   func(context.Context, string, interface{}) error
	TsTolerance    int64
}

type Response

type Response struct {
	ContentType string
	Body        []byte
}

Jump to

Keyboard shortcuts

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