Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AuthMode ¶
type AuthMode string
AuthMode identifies which credential strategy the profile uses.
type BceCredentials ¶
type BceCredentials = auth.BceCredentials
BceCredentials is an alias so callers don't need to import bce-sdk-go/auth directly.
type Configuration ¶
Configuration is the top-level structure persisted to ~/.bce/config.json.
func Load ¶
func Load() (*Configuration, error)
Load reads the configuration file. Returns an empty config if the file does not exist.
func (*Configuration) GetProfile ¶
func (cfg *Configuration) GetProfile(name string) *Profile
GetProfile looks up a profile by name. If name is empty the current profile is used.
func (*Configuration) SetProfile ¶
func (cfg *Configuration) SetProfile(p Profile)
SetProfile upserts a profile into the configuration.
type FlagOverrides ¶
type FlagOverrides struct {
Region string
Endpoint string
Scheme string // "http" or "https"; empty means auto-detect from product metadata
Language string
Output string
Query string
DryRun bool
Debug bool
NoColor bool
Timeout int // request timeout in seconds; 0 means use default (15s)
TotalCount int // --total-count: cap on total items returned across pages; 0 = unlimited
Pager bool // --pager: enable auto-pagination and aggregate all pages
}
FlagOverrides carries per-invocation values from global flags that take precedence over the active profile.
type Profile ¶
type Profile struct {
Name string `json:"name"`
Mode AuthMode `json:"mode"`
AccessKeyId string `json:"access_key_id,omitempty"`
SecretAccessKey string `json:"secret_access_key,omitempty"`
SecurityToken string `json:"security_token,omitempty"`
Region string `json:"region,omitempty"`
Endpoint string `json:"endpoint,omitempty"`
Language string `json:"language,omitempty"`
}
Profile holds all credential and preference settings for one named configuration.
func (*Profile) Credentials ¶
func (p *Profile) Credentials() (*auth.BceCredentials, error)
Credentials returns BCE credentials for the profile's auth mode.