Documentation ¶
Index ¶
- Constants
- func Fail(data interface{}) []byte
- func GetAuthorityId(value string) (int64, error)
- func GetEmail(value string) (string, error)
- func GetName(value string) (string, error)
- func GetUID(value string) (uuid.UUID, error)
- func GetUserID(value string) (int64, error)
- func MustAuthorityId(value string) int64
- func MustEmail(value string) string
- func MustName(value string) string
- func MustUID(value string) uuid.UUID
- func MustUserID(value string) int64
- func NewCodeError(code int, msg string) error
- func NewDefaultError(msg string) error
- func NewError(code int, msg string, err error) error
- func NewRawError(code int, err error) error
- func Result(code int, data interface{}, msg string) []byte
- func Success(data interface{}) []byte
- func TryAuthorityId(value string, defaultVal ...int64) int64
- func TryEmail(value string, defaultVal ...string) string
- func TryName(value string, defaultVal ...string) string
- func TryUID(value string) uuid.UUID
- func TryUserID(value string, defaultVal ...int64) int64
- type AccessKeyPageSearch
- type AccessKeyReq
- type AccessKeyUpdateReq
- type BaseClaims
- type CodeError
- type CustomClaims
- type JwtReq
- type JwtUser
- type OneidConf
- type Response
- func FailWithDetailed(data interface{}, message string) *Response
- func FailWithError(data error) *Response
- func FailWithMessage(message string) *Response
- func Failed() *Response
- func Ok() *Response
- func OkWithData(data interface{}) *Response
- func OkWithDetailed(data interface{}, message string) *Response
- func OkWithMessage(message string) *Response
- func Res(code int, data interface{}, msg string) *Response
- type SysCaptchaResponse
Constants ¶
View Source
const ( ID = "ID" UID = "UID" Name = "NAME" Email = "EMAIL" AuthorityId = "AUTHORITY_ID" )
View Source
const ( ERROR = 7 SUCCESS = 0 )
Variables ¶
This section is empty.
Functions ¶
func GetAuthorityId ¶
func MustAuthorityId ¶
func MustUserID ¶
func NewCodeError ¶
func NewDefaultError ¶
func NewRawError ¶
func TryAuthorityId ¶
Types ¶
type AccessKeyPageSearch ¶
type AccessKeyPageSearch struct { //APIConsumerID *int64 ` json:"api_consumer_id" form:"api_consumer_id" query:"api_consumer_id"` Subject string `json:"subject" form:"subject" query:"subject" binding:"required"` Type *int32 `json:"type" form:"type" query:"type" ` // 0: 用户(admin), 1: 应用 Nickname *string `json:"nickname" form:"nickname" query:"nickname"` }
type AccessKeyReq ¶
type AccessKeyReq struct { AccessKeyUpdateReq Subject *string `json:"subject" form:"subject" query:"subject" binding:"required"` // consumer-name(appid) mapping to APIConsumerID Type *int32 `json:"type" form:"type" query:"type" binding:"required"` // 0: 用户(admin), 1: 应用 KeyID *string `json:"key_id" form:"key_id" query:"key_id"` // use for Type=0 EncodedKeySecret *string `json:"key_secret" form:"key_secret" query:"key_secret"` // use for Type=0 }
type AccessKeyUpdateReq ¶
type AccessKeyUpdateReq struct { ID int64 `json:"id" form:"id" query:"id"` //APIConsumerID int64 ` json:"api_consumer_id" form:"api_consumer_id" query:"api_consumer_id" binding:"required"` Enabled *bool `json:"enabled" form:"enabled" query:"enabled" binding:"required"` Nickname *string `json:"nickname" form:"nickname" query:"nickname"` Gender *string `json:"gender" form:"gender" query:"gender"` Cover *string `json:"cover" form:"cover" query:"cover"` Phone *string `json:"phone" form:"phone" query:"phone"` Email *string `json:"email" form:"email" query:"email"` UrlPatterns []string `json:"urlPatterns" form:"urlPatterns" query:"urlPatterns" binding:"required"` }
type BaseClaims ¶
type CustomClaims ¶
type CustomClaims struct { BaseClaims BufferTime int64 jwt.RegisteredClaims }
CustomClaims Custom claims structure
type JwtReq ¶
type JwtReq struct { KeyID string `json:"access_key" form:"access_key" query:"access_key" binding:"required"` EncodedKeySecret string `json:"security_key" form:"security_key" query:"security_key" binding:"required"` Subject string `json:"subject" form:"subject" query:"subject" binding:"required"` // appid Value *string `json:"value" form:"value" query:"value"` //需要被签名的内容 Captcha string `json:"captcha"` // 验证码 CaptchaId string `json:"captchaId"` // 验证码ID }
type JwtUser ¶
type JwtUser struct { Id int64 `json:"id"` Uuid uuid.UUID `json:"uuid"` Name string `json:"name"` Email string `json:"email"` AuthorityId int64 `json:"authorityId"` }
func UserUnMarshal ¶
func (*JwtUser) UserMarshal ¶
type OneidConf ¶
type OneidConf struct { AuthenticationUrl string `` // kong /* 139-byte string literal not displayed */ AccessKeyId string `mapstructure:"access-key-id" yaml:"access-key-id" json:"access-key-id" form:"access-key-id" query:"access-key-id"` // ak AccessKeySecret string `` // sk /* 133-byte string literal not displayed */ Subject string `mapstructure:"subject" yaml:"subject" json:"subject" form:"subject" query:"subject"` // consumer name }
type Response ¶
type Response struct { Code int `json:"code"` Data interface{} `json:"data"` Msg string `json:"msg"` }
func FailWithDetailed ¶
func FailWithError ¶
func FailWithMessage ¶
func OkWithData ¶
func OkWithData(data interface{}) *Response
func OkWithDetailed ¶
func OkWithMessage ¶
type SysCaptchaResponse ¶
Click to show internal directories.
Click to hide internal directories.