user

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package user 定义通用的 user 逻辑.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetIdentityInfo

func GetIdentityInfo(r *http.Request) (apistructs.IdentityInfo, error)

GetIdentityInfo 从 http.Request 中获取用户 ID && Internal-Client

return: IdentityInfo, error

func GetOrgID

func GetOrgID(r *http.Request) (uint64, error)

GetOrgID 从 http request 的 header 中读取 org id.

Types

type ID

type ID string

ID 定义 user id.

func GetUserID

func GetUserID(r *http.Request) (ID, error)

GetUserID 从 http request 的 header 中读取 user id.

func (ID) Invalid

func (i ID) Invalid() bool

Invalid 返回 user id 是否有效.

func (ID) String

func (i ID) String() string

String 返回 user id 字符串类型.

Jump to

Keyboard shortcuts

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