oauth

package
v0.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 4, 2026 License: MIT Imports: 1 Imported by: 0

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

func (t *Token) IsExpired() bool

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.

Directories

Path Synopsis
Package hyper provides functions to handle Hyper device flow authentication.
Package hyper provides functions to handle Hyper device flow authentication.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL