invokectx

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2021 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

userctx, 用户上下文

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewContext

func NewContext(ctx context.Context, u *User) context.Context

NewContext returns a new Context that carries value u.

Types

type User

type User struct {
	Id       int64  // 用户id
	Username string // 用户名
	Locale   string // 当前用户语言环境
}

当前调用人.

func FromContext

func FromContext(ctx context.Context) (*User, bool)

FromContext returns the User value stored in ctx, if any.

Jump to

Keyboard shortcuts

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