store

package
v0.20.0 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2026 License: LGPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultStoreDirName = ".worldcli"
)

Variables

This section is empty.

Functions

func GetStoreDir

func GetStoreDir() (string, error)

GetStoreDir returns the default store directory path (~/.worldcli).

func PutCredential

func PutCredential(c Credential) error

PutCredential writes the credential into the store directory.

func SetupStoreDir

func SetupStoreDir() (string, error)

SetupStoreDir initializes the store directory and returns its path. This is the only place ~/.worldcli is created, so its mode cannot depend on which caller ran first.

Types

type Credential

type Credential struct {
	JWT string `json:"jwt"`
}

Credential is the cached Argus token. Only the JWT is stored; identity and expiry are claims inside it. Commands that call remote services read it from here rather than reimplementing the file layout.

func GetCredential

func GetCredential() (Credential, error)

GetCredential reads the cached credential. A missing file surfaces as an os.IsNotExist error, which callers treat as "not signed in".

Jump to

Keyboard shortcuts

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