user

package
v0.0.2-beta.3 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetContextMap added in v0.0.2

func GetContextMap(ctx context.Context) map[string]interface{}

GetContextMap 获得一些上游传入的系统上下文参数, Map 通用结构

Types

type IUser

type IUser interface {
	// GetUserID 若无实际触发人, 返回 -1
	GetUserID(ctx context.Context) int64
	// GetLocaleByUserID 获取指定 user 的 locale 信息
	GetLocaleByUserID(ctx context.Context, userID int64) (*structs.Locale, error)
	// GetLocaleByUserIDList 批量获取指定 user 列表的 locale 信息
	GetLocaleByUserIDList(ctx context.Context, userIDList []int64) ([]*structs.Locale, error)
}

func NewUser

func NewUser(s *structs.AppCtx) IUser

type User

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

func (*User) GetLocaleByUserID

func (u *User) GetLocaleByUserID(ctx context.Context, userID int64) (*structs.Locale, error)

func (*User) GetLocaleByUserIDList

func (u *User) GetLocaleByUserIDList(ctx context.Context, userIDList []int64) ([]*structs.Locale, error)

func (*User) GetUserID

func (u *User) GetUserID(ctx context.Context) int64

type UserContext

type UserContext = cStructs.UserContext

func GetContext

func GetContext(ctx context.Context) UserContext

GetContext 获得一些上游传入的系统上下文参数, 指定特定结构

Jump to

Keyboard shortcuts

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