meta

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2025 License: Apache-2.0 Imports: 6 Imported by: 1

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
	All() map[string]string
}

func FromGrpcContext

func FromGrpcContext(ctx context.Context) MetaReader

func FromServiceContext

func FromServiceContext(ctx context.Context) MetaReader

type Role

type Role struct {
	Name  string // 角色名
	Level int    // 角色级别
}

Jump to

Keyboard shortcuts

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