Documentation
¶
Index ¶
Constants ¶
View Source
const ( MetaKeyUserId = "Hd-User-Id" MetaKeyRoleValues = "Hd-Role-Values" MetaKeyRoleIds = "Hd-Role-Ids" MetaKeyPermIds = "Hd-Perm-Ids" )
DEPRECATED: compatible purpose
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Meta ¶
type Meta interface {
//GetAppId(ctx context.Context) string
//GetClient(ctx context.Context) string
//GetRelease(ctx context.Context) string
//GetUid(ctx context.Context) int64 // 获取用户的id
//GetTsn(ctx context.Context) string // 获取租户的sn
//GetTid(ctx context.Context) int64 // 获取租户的id
//GetRoleIds(ctx context.Context) []int64
//GetCaller(ctx context.Context) string
// DEPRECATED
OldGetRoles(ctx context.Context) []*Role
OldGetRoleValues(ctx context.Context) []string
OldGetRoleIds(ctx context.Context) []int64
OldGetPermIds(ctx context.Context) []int64
}
type MetaReader ¶
type MetaReader interface {
GetStringSlice(key string) []string
GetInt64Slice(key string) []int64
GetString(key string) string
GetInt64(key string) int64
}
func FromGrpcContext ¶
func FromGrpcContext(ctx context.Context) MetaReader
func FromServiceContext ¶
func FromServiceContext(ctx context.Context) MetaReader
Click to show internal directories.
Click to hide internal directories.