tokencache

package
v3.0.0-rc40 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Delete

func Delete(contextName string) error

func Exists

func Exists(contextName string) bool

func FmtFilename

func FmtFilename(contextName string) string

func GetAll

func GetAll() map[string]Entry

func ModTime

func ModTime(contextName string) (time.Time, error)

func ReconnectError

func ReconnectError(srcErr error, contextName string) error

ReconnectError says a cached token could not be used, and names the command that renews it.

That command is always ox, whichever program is reporting: only ox manages the client contexts, so an om reading a context whose token expired is fixed with ox too.

func Save

func Save(contextName string, token Entry) error

Types

type Entry

type Entry struct {
	AccessTokenExpire   time.Time          `json:"access_expired_at"`
	AccessToken         string             `json:"access_token"`
	AccessTokenDuration *duration.Duration `json:"access_token_duration,omitempty"`
	RefreshTokenExpire  time.Time          `json:"refresh_expired_at"`
	RefreshToken        string             `json:"refresh_token"`
}

func GetLast

func GetLast() (string, Entry)

func Load

func Load(contextName string) (*Entry, error)

Jump to

Keyboard shortcuts

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