auth

package
v0.0.0-...-d80f745 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func User

func User(a *Auth) rest.Middleware

func UserWeb

func UserWeb(a *Auth) rest.Middleware

http接口认证中间件 并且注入uid

func UserWebOptional

func UserWebOptional(a *Auth) rest.Middleware

可选登录接口

Types

type Auth

type Auth struct {
	accessv1.AccessServiceClient
}

func MustAuther

func MustAuther(c xconf.Discovery) *Auth

func New

func New(c *Config) (*Auth, error)

func NewFromConn

func NewFromConn(conn zrpc.Client) *Auth

func (*Auth) User

func (a *Auth) User(ctx context.Context, r *http.Request) (uid uint64, sessId string, err error)

func (*Auth) UserWeb

func (a *Auth) UserWeb(ctx context.Context, r *http.Request) (uid uint64, sessId string, err error)

type Config

type Config struct {
	Addr string
}

Jump to

Keyboard shortcuts

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