Documentation
¶
Index ¶
Constants ¶
View Source
const DefaultServerURL = "https://nimbusgo.space"
DefaultServerURL is the default Nimbus Cloud API & OAuth server.
Variables ¶
This section is empty.
Functions ¶
func AuthFilePath ¶
AuthFilePath returns the absolute path to ~/.nimbus/auth.json.
func GetServerURL ¶
func GetServerURL() string
GetServerURL returns the configured Nimbus Cloud URL (checking NIMBUS_CLOUD_URL env var).
func SaveCredentials ¶
func SaveCredentials(creds *Credentials) error
SaveCredentials writes credentials to ~/.nimbus/auth.json with 0600 permissions.
Types ¶
type Credentials ¶
type Credentials struct {
AccessToken string `json:"access_token"`
RefreshToken string `json:"refresh_token,omitempty"`
Email string `json:"email"`
Name string `json:"name"`
Plan string `json:"plan"` // e.g. "free", "pro", "team", "enterprise"
HasSub bool `json:"has_subscription"`
ExpiresAt time.Time `json:"expires_at"`
ServerURL string `json:"server_url"`
}
Credentials represents authenticated developer credentials for Nimbus Cloud.
func FetchProfile ¶
func FetchProfile(creds *Credentials) (*Credentials, error)
FetchProfile queries the Nimbus Cloud API to verify the token and get the latest profile.
func LoadCredentials ¶
func LoadCredentials() (*Credentials, error)
LoadCredentials loads stored credentials from ~/.nimbus/auth.json.
func Login ¶
func Login(ctx *cli.Context, serverURL string) (*Credentials, error)
Login performs the browser-based OAuth authorization flow with Nimbus Cloud.
func (*Credentials) IsExpired ¶
func (c *Credentials) IsExpired() bool
IsExpired reports whether the access token has expired.
Click to show internal directories.
Click to hide internal directories.