Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ProviderSet = wire.NewSet(NewAuth)
Functions ¶
func FromContextAssertUserType ¶ added in v0.0.6
Types ¶
type Auth ¶
type Auth struct {
// contains filtered or unexported fields
}
func (*Auth) GenerateToken ¶
func (a *Auth) GenerateToken(id int64, claimsType ClaimsType, userType UserType, transferMetadata *TransferMetadata, expire time.Duration) (string, error)
type Claims ¶
type Claims struct { InternalID int64 `json:"iid"` Type ClaimsType `json:"ct"` UserType UserType `json:"ut"` TransferMetadata *TransferMetadata `json:"tm,omitempty"` jwtv4.RegisteredClaims }
type ClaimsType ¶
type ClaimsType int
const ( ClaimsTypeUnspecified ClaimsType = iota ClaimsTypeAccessToken ClaimsTypeRefreshToken ClaimsTypeUploadToken ClaimsTypeDownloadToken )
type TransferMetadata ¶
Click to show internal directories.
Click to hide internal directories.