Documentation
¶
Index ¶
- func DeleteCredentialsForBucket(path string, bucketName string) error
- func SaveCredentialsForBucket(path string, bucketName string, creds S3Credentials) error
- func WriteCredentials(credentials CredentialsMap, subdir string) error
- func WriteProfiles(profile Profile) error
- func WriteSettings(settings Settings, subdir string) error
- type Config
- type CredentialsMap
- type HTTPClient
- type Profile
- type Response
- type S3Credentials
- type Settings
- type Token
- type TokenInterface
- type TokenMock
- type UserInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeleteCredentialsForBucket ¶
DeleteCredentialsForBucket deletes credentials for a specific bucket from the credentials file
func SaveCredentialsForBucket ¶
func SaveCredentialsForBucket(path string, bucketName string, creds S3Credentials) error
SaveCredentialsForBucket saves credentials for a specific bucket to the credentials file
func WriteCredentials ¶
func WriteCredentials(credentials CredentialsMap, subdir string) error
WriteCredentials writes the credentials map to the credentials file for a given profile
func WriteProfiles ¶
func WriteSettings ¶
Types ¶
type Config ¶
type Config struct {
Client HTTPClient
Out io.Writer
}
type CredentialsMap ¶
type CredentialsMap map[string]S3Credentials
CredentialsMap is a map of bucket names to their S3 credentials
func ReadCredentials ¶
func ReadCredentials(path string) (CredentialsMap, error)
ReadCredentials reads the credentials file for a given profile and returns a map of bucket names to credentials
type S3Credentials ¶
type S3Credentials struct {
S3AccessKey string `toml:"s3_access_key"`
S3SecretKey string `toml:"s3_secret_key"`
}
S3Credentials represents the S3 credentials for a specific bucket
func GetCredentialsForBucket ¶
func GetCredentialsForBucket(path string, bucketName string) (S3Credentials, bool, error)
GetCredentialsForBucket retrieves credentials for a specific bucket from the credentials file
type Settings ¶
type Settings struct {
Token string
UUID string
LastCheck time.Time
LastVulcanVersion string
AuthorizeMetricsCollection int
ClientId string
Email string
ContinuationToken string
S3AccessKey string
S3SecretKey string
S3Bucket string
// Resolved API generation for this profile, cached to avoid asking the SSO
// service on every invocation. Absent in settings files written by older
// CLI versions, which simply reads as a cache miss.
APIVersion string
APIVersionCheckedAt time.Time
APIVersionTokenHash string
APIVersionEpoch int
}
func ReadSettings ¶
func (Settings) APIVersionCache ¶
func (s Settings) APIVersionCache() apiversion.Cache
APIVersionCache reads the profile's cached API generation.
func (*Settings) SetAPIVersionCache ¶
func (s *Settings) SetAPIVersionCache(c apiversion.Cache)
SetAPIVersionCache records a freshly resolved API generation on the profile.