session

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2026 License: MIT Imports: 9 Imported by: 0

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