Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Token ¶
type Token struct {
AccessToken string `json:"access_token"`
RefreshToken string `json:"refresh_token"`
ExpiresIn int `json:"expires_in"`
ExpiresAt int64 `json:"expires_at"`
}
Token represents an OAuth2 token.
func (*Token) IsExpired ¶
IsExpired checks if the token is expired or about to expire (within 10% of its lifetime).
func (*Token) SetExpiresAt ¶
func (t *Token) SetExpiresAt()
SetExpiresAt calculates and sets the ExpiresAt field based on the current time and ExpiresIn.
func (*Token) SetExpiresIn ¶
func (t *Token) SetExpiresIn()
SetExpiresIn calculates and sets the ExpiresIn field based on the ExpiresAt field.
Click to show internal directories.
Click to hide internal directories.