Documentation
¶
Index ¶
Constants ¶
View Source
const (
DefaultStoreDirName = ".worldcli"
)
Variables ¶
This section is empty.
Functions ¶
func GetStoreDir ¶
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 ¶
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".
Click to show internal directories.
Click to hide internal directories.