Versions in this module Expand all Collapse all v0 v0.2.0 May 8, 2026 Changes in this version + const ScopeInvoiceRead + const ScopeInvoiceWrite + func HasAnyScope(token *Token, scopes ...string) bool + func HasScope(token *Token, scope string) bool v0.1.0 Mar 29, 2026 Changes in this version + var AllScopes = []string + var DefaultScopes = []string + func BuildAuthURL(cfg *config.Config, codeChallenge, state string, scopes []string) string + func GenerateCodeChallenge(verifier string) string + func GenerateCodeVerifier() (string, error) + func GenerateState() (string, error) + func OverrideTokenURL(u string) func() + func SaveToken(cfg *config.Config, token *Token) error + func StartCallbackServer(port int, state string) (string, error) + func StartCallbackServerAsync(port int, state string) (<-chan CallbackResult, error) + func TokenPath(cfg *config.Config) string + type CallbackResult struct + Code string + Err error + type Token struct + AccessToken string + ExpiresIn int + Expiry time.Time + RefreshToken string + Scopes []string + TokenType string + func ExchangeCode(ctx context.Context, cfg *config.Config, code, codeVerifier string) (*Token, error) + func GetValidToken(cfg *config.Config) (*Token, error) + func LoadToken(cfg *config.Config) (*Token, error) + func RefreshAccessToken(ctx context.Context, cfg *config.Config, token *Token) (*Token, error) + func (t *Token) IsExpired() bool + func (t *Token) SetExpiryFromExpiresIn()