token

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2026 License: MIT Imports: 7 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 (
	// ErrProfileNotFound is returned when a requested profile file does not exist.
	ErrProfileNotFound = errors.New("profile not found")
	// ErrProfileExists is returned when writing an existing profile without force.
	ErrProfileExists = errors.New("profile already exists")
)

Functions

func Delete

func Delete(name string) error

Delete removes a token profile and ignores missing files.

func Dir

func Dir() (string, error)

Dir returns the directory used for profile token files.

func ProfilePath

func ProfilePath(name string) (string, error)

ProfilePath returns the JSON file path for a validated profile name.

func ValidateProfileName

func ValidateProfileName(name string) error

ValidateProfileName returns an error unless name is a safe profile identifier.

func Write

func Write(name string, token Token, force bool) error

Write persists a token profile, refusing to overwrite unless force is true.

Types

type Token

type Token struct {
	Token          string `json:"token"`
	APIURL         string `json:"api_url"`
	AgentName      string `json:"agent_name"`
	Team           string `json:"team"`
	TeamSlug       string `json:"team_slug"`
	CreatedByEmail string `json:"created_by_email"`
	CreatedAt      string `json:"created_at"`
}

Token stores the persisted credentials and profile metadata.

func Read

func Read(name string) (Token, error)

Read loads a token profile unless DISBUG_TOKEN provides an environment override.

Jump to

Keyboard shortcuts

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