creds

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2026 License: Apache-2.0 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

View Source
const StaleLockAge = 45 * time.Second

StaleLockAge is how old a credentials lock may be before it is treated as abandoned. Must exceed the session refresh HTTP budget so a live refresh is not interrupted.

Variables

View Source
var ErrNotFound = errors.New("no stored credentials; run daco login")

Functions

func DefaultPath

func DefaultPath() (string, error)

Types

type FileStore

type FileStore struct {
	Path string
}

func (FileStore) Clear

func (s FileStore) Clear() error

func (FileStore) Load

func (s FileStore) Load() (Session, error)

func (FileStore) Save

func (s FileStore) Save(session Session) error

Save writes credentials. Callers that already hold WithLock should use SaveUnlocked.

func (FileStore) SaveUnlocked

func (s FileStore) SaveUnlocked(session Session) error

func (FileStore) WithLock

func (s FileStore) WithLock(fn func() error) error

WithLock serializes credential read/write across processes for the duration of fn.

type Session

type Session struct {
	ClientID       string    `json:"clientId"`
	AccessToken    string    `json:"accessToken"`
	RefreshToken   string    `json:"refreshToken"`
	OrganizationID string    `json:"organizationId"`
	UserID         string    `json:"userId"`
	UserEmail      string    `json:"userEmail"`
	ExpiresAt      time.Time `json:"expiresAt"`
	AuthAPI        string    `json:"authApi"`
	BaseURL        string    `json:"baseUrl,omitempty"`
}

Jump to

Keyboard shortcuts

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