Documentation ¶
Index ¶
- Variables
- func PassportWithChangePassword(ctx context.Context, password string, accountId string) error
- func PassportWithChangeStatus(ctx context.Context, status PassportStatus, accountId string) error
- func PassportWithExist(ctx context.Context, account string) (bool, error)
- func PassportWithRegister(ctx context.Context, account, password string) (string, error)
- func PassportWithRemove(ctx context.Context, accountId string) error
- func TokenWithRevokeByAccountId(ctx context.Context, id string) error
- func TokenWithRevokeByToken(ctx context.Context, token Token) error
- func TokenWithVerify(ctx context.Context, token Token) error
- type Passport
- type PassportAuthMethod
- type PassportStatus
- type Token
Constants ¶
This section is empty.
Variables ¶
View Source
var ( AccessTokenExpiresIn = 10 * time.Minute RefreshTokenExpiresIn = 120 * time.Minute )
View Source
var ErrPassportNoAccount = errors.New("no account")
Functions ¶
func PassportWithChangeStatus ¶
func PassportWithChangeStatus(ctx context.Context, status PassportStatus, accountId string) error
func PassportWithRegister ¶
Types ¶
type Passport ¶
type Passport struct { Id string `json:"id"` Account string `json:"account"` Code string `json:"code"` Email string `json:"email"` Phone string `json:"phone"` Status int32 `json:"status"` CreateTimestamp time.Time `json:"create_timestamp"` }
func PassportWithAuth ¶
type PassportAuthMethod ¶
type PassportAuthMethod int8
const ( PASSWORD PassportAuthMethod = iota SMS )
type Token ¶
func TokenWithApply ¶
Click to show internal directories.
Click to hide internal directories.