Documentation ¶
Index ¶
- Constants
- type Account
- type Credentials
- type FS
- type PulumiWorkspace
- type Workspace
- func (w *Workspace) DeleteAccount(backendURL string) error
- func (w *Workspace) DeleteAllAccounts() error
- func (w *Workspace) GetAccount(backendURL string) (*Account, error)
- func (w *Workspace) GetBackendConfigDefaultOrg(backendURL, username string) (string, error)
- func (w *Workspace) GetCurrentAccount(shared bool) (*Account, bool, error)
- func (w *Workspace) GetCurrentCloudURL(account *Account) string
- func (w *Workspace) SetBackendConfigDefaultOrg(backendURL, defaultOrg string) error
- func (w *Workspace) SetCurrentAccount(account Account, shared bool) error
Constants ¶
const PulumiBackendURLEnvVar = "PULUMI_BACKEND_URL"
PulumiBackendURLEnvVar is an environment variable which can be used to set the backend that will be used instead of the currently logged in backend or the current projects backend.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Account ¶
type Account struct { workspace.Account // The URL of the account's backend. BackendURL string // The default org for the backend. DefaultOrg string }
Account holds details about a Pulumi account.
type Credentials ¶
type Credentials struct {
Current string `json:"name"` // The account to use for login. Accounts are stored in Pulumi creds.
}
Credentials hold the information necessary for authenticating Pulumi Cloud API requests.
type FS ¶
type PulumiWorkspace ¶
type PulumiWorkspace interface { DeleteAccount(backendURL string) error DeleteAllAccounts() error SetBackendConfigDefaultOrg(backendURL, defaultOrg string) error GetPulumiConfig() (workspace.PulumiConfig, error) GetPulumiPath(elem ...string) (string, error) GetStoredCredentials() (workspace.Credentials, error) StoreAccount(key string, account workspace.Account, current bool) error GetAccount(key string) (workspace.Account, error) }
func DefaultPulumiWorkspace ¶
func DefaultPulumiWorkspace() PulumiWorkspace
type Workspace ¶
type Workspace struct {
// contains filtered or unexported fields
}
func New ¶
func New(fs FS, pulumi PulumiWorkspace) *Workspace
func (*Workspace) DeleteAccount ¶
DeleteAccount logs out of the given backend. If the backend is the current account, then the current account is cleared.
func (*Workspace) DeleteAllAccounts ¶
DeleteAllAccounts logs out of all accounts.
func (*Workspace) GetAccount ¶
GetAccount returns an account underneath a given key.
Note that the account may not be fully populated: it may only have a valid AccessToken. In that case, it is up to the caller to fill in the username and last validation time.
func (*Workspace) GetBackendConfigDefaultOrg ¶
func (*Workspace) GetCurrentAccount ¶
GetCurrentAccount returns information about the currently logged-in account.