session

package
v0.5.14 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2026 License: MIT Imports: 9 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrSessionNotFound = errors.New("session not found")
	ErrInvalidBackend  = errors.New("invalid token backend")
)

Functions

This section is empty.

Types

type Backend

type Backend string
const (
	ServiceName            = "internctl"
	BackendAuto    Backend = "auto"
	BackendKeyring Backend = "keyring"
	BackendFile    Backend = "file"
)

func ParseBackend

func ParseBackend(value string) (Backend, error)

type Data

type Data struct {
	AccessToken  string    `json:"access_token"`
	RefreshToken string    `json:"refresh_token"`
	TokenType    string    `json:"token_type"`
	ExpiresAt    time.Time `json:"expires_at"`
}

type Manager

type Manager struct {
	// contains filtered or unexported fields
}

func NewManager

func NewManager(configDir string) *Manager

func (*Manager) Delete

func (m *Manager) Delete(profile string, backend Backend) error

func (*Manager) Exists

func (m *Manager) Exists(profile string) (bool, error)

func (*Manager) Load

func (m *Manager) Load(profile string, backend Backend) (Data, Backend, error)

func (*Manager) Save

func (m *Manager) Save(profile string, preferred Backend, data Data) (Backend, error)

Jump to

Keyboard shortcuts

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