Documentation ¶
Index ¶
Constants ¶
const ( ConfigDir = ".up" ConfigFile = "config.json" )
Location of up config file.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cloud ¶
type Cloud struct { // Default indicates the default profile. Default string `json:"default"` // Profiles contain sets of credentials for communicating with Upbound // Cloud. Key is name of the profile. Profiles map[string]Profile `json:"profiles,omitempty"` }
Cloud contains configuration information for Upbound Cloud.
type Config ¶
type Config struct {
Cloud Cloud `json:"cloud"`
}
Config is format for the up configuration file.
func (*Config) AddOrUpdateCloudProfile ¶
AddOrUpdateCloudProfile adds or updates a cloud profile to the Config.
func (*Config) GetCloudProfile ¶
GetCloudProfile gets a profile with a given identifier. If a profile does not exist for the given identifier an error will be returned. Multiple profiles should never exist for the same identifier, but in the case that they do, the first will be returned.
func (*Config) GetDefaultCloudProfile ¶
GetDefaultCloudProfile gets the default cloud profile or returns an error if default is not set or default profile does not exist.
func (*Config) SetDefaultCloudProfile ¶
SetDefaultCloudProfile sets the default profile for communicating with Upbound Cloud. Setting a default profile that does not exist will return an error.
type FSSource ¶
type FSSource struct {
// contains filtered or unexported fields
}
FSSource provides a filesystem source for interacting with a Config.
func NewFSSource ¶
func NewFSSource(modifiers ...FSSourceModifier) (*FSSource, error)
NewFSSource constructs a new FSSource.
func (*FSSource) UpdateConfig ¶
UpdateConfig updates the Config in the filesystem.
type FSSourceModifier ¶
type FSSourceModifier func(*FSSource)
FSSourceModifier modifies an FSSource.
type Profile ¶
type Profile struct { // ID is either a username, email, or token. ID string `json:"id"` // Type is the type of the profile. Type ProfileType `json:"type"` // Session is a session token used to authenticate to Upbound Cloud. Session string `json:"session,omitempty"` // Account is the default account to use when this profile is selected. Account string `json:"account,omitempty"` }
A Profile is a set of credentials
type ProfileType ¶
type ProfileType string
ProfileType is a type of Upbound Cloud profile.
const ( UserProfileType ProfileType = "user" TokenProfileType ProfileType = "token" )
Types of profiles.