user

package
v0.0.0-...-3337c03 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AnonymousCenter

type AnonymousCenter interface {
	Center

	LoginAndGetToken(ctx context.Context, userName string) (token string, expires int64, err error)
	Login(ctx context.Context, userName string) (outCtx context.Context, err error)
}

func NewAnonymousCenter

func NewAnonymousCenter(secKey string, expireDuration time.Duration) AnonymousCenter

type Center

type Center interface {
	ExtractUserInfoFromGRPCContext(ctx context.Context) (userInfo *Info, err error)
	NewToken(userInfo *Info) (string, error)
}

type Info

type Info struct {
	ID       uint64
	UserName string
}

Jump to

Keyboard shortcuts

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