Documentation ¶
Overview ¶
Copyright 2023 The Cloud-Barista Authors.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
- func Init()
- func NewDynamoDBClient(accesskey, secretkey, region string) (*dynamodb.Client, error)
- func NewDynamoDBClientWithEndpoint(accesskey, secretkey, region string, endpoint string) (*dynamodb.Client, error)
- func NewFireStoreClient(credentialsJson, projectID, databaseID string) (*firestore.Client, error)
- func NewFireStoreClientWithDatabase(credentialsFile, projectID, databaseID string) (*firestore.Client, error)
- func NewGCPClient(credentialsJson string) (*storage.Client, error)
- func NewNCPMongoDBClient(username, password, host string, port int) (*mongo.Client, error)
- func NewS3Client(accesskey, secretkey, region string) (*s3.Client, error)
- func NewS3ClientWithEndpoint(accesskey, secretkey, region string, endpoint string) (*s3.Client, error)
- type ConfigManager
- func (cm *ConfigManager) CreateConfig(configData map[string]interface{}) error
- func (cm *ConfigManager) DeleteConfig() error
- func (cm *ConfigManager) GetDefaultCredentials(provider string) (interface{}, error)
- func (cm *ConfigManager) ReadConfig() (map[string]interface{}, error)
- func (cm *ConfigManager) UpdateConfig(updatedData map[string]interface{}) error
- type FileProfileManager
- func (fpm *FileProfileManager) CreateProfile(profileName string, credentials models.ProfileCredentials) error
- func (fpm *FileProfileManager) DeleteProfile(profileName string) error
- func (fpm *FileProfileManager) LoadAllProfiles() (map[string]models.ProfileCredentials, error)
- func (fpm *FileProfileManager) LoadCredentialsByProfile(profileName string, provider string) (interface{}, error)
- func (fpm *FileProfileManager) SaveAllProfiles(profiles map[string]models.ProfileCredentials) error
- func (fpm *FileProfileManager) UpdateProfile(profileName string, credentials models.ProfileCredentials) error
- func (fpm *FileProfileManager) ValidateProfiles() error
- type InitConfig
- type LogConfig
- type LumberConfig
- type ProfileConfig
- type ProfileManager
- type ZeroConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewDynamoDBClient ¶
func NewFireStoreClient ¶
func NewNCPMongoDBClient ¶
Types ¶
type ConfigManager ¶ added in v0.2.1
type ConfigManager struct { DefaultProfile string ProfileManager ProfileManager // contains filtered or unexported fields }
ConfigManager structure definition
func NewConfigManager ¶ added in v0.2.1
func NewConfigManager(configPath string) (*ConfigManager, error)
NewConfigManager loads the config from the specified path
func (*ConfigManager) CreateConfig ¶ added in v0.2.1
func (cm *ConfigManager) CreateConfig(configData map[string]interface{}) error
CreateConfig creates a new config.json file with the given data
func (*ConfigManager) DeleteConfig ¶ added in v0.2.1
func (cm *ConfigManager) DeleteConfig() error
DeleteConfig deletes the config.json file
func (*ConfigManager) GetDefaultCredentials ¶ added in v0.2.1
func (cm *ConfigManager) GetDefaultCredentials(provider string) (interface{}, error)
GetDefaultCredentials returns the default profile credentials
func (*ConfigManager) ReadConfig ¶ added in v0.2.1
func (cm *ConfigManager) ReadConfig() (map[string]interface{}, error)
ReadConfig reads the config.json file and returns the data
func (*ConfigManager) UpdateConfig ¶ added in v0.2.1
func (cm *ConfigManager) UpdateConfig(updatedData map[string]interface{}) error
UpdateConfig updates the config.json file with the given data
type FileProfileManager ¶ added in v0.2.1
type FileProfileManager struct {
// contains filtered or unexported fields
}
func NewProfileManager ¶ added in v0.2.1
func NewProfileManager(profileFilePath ...string) *FileProfileManager
func NewProfileManagerDefault ¶ added in v0.2.1
func NewProfileManagerDefault() *FileProfileManager
func (*FileProfileManager) CreateProfile ¶ added in v0.2.1
func (fpm *FileProfileManager) CreateProfile(profileName string, credentials models.ProfileCredentials) error
C profile by name
func (*FileProfileManager) DeleteProfile ¶ added in v0.2.1
func (fpm *FileProfileManager) DeleteProfile(profileName string) error
D profile by name
func (*FileProfileManager) LoadAllProfiles ¶ added in v0.2.1
func (fpm *FileProfileManager) LoadAllProfiles() (map[string]models.ProfileCredentials, error)
R profiles
func (*FileProfileManager) LoadCredentialsByProfile ¶ added in v0.2.1
func (fpm *FileProfileManager) LoadCredentialsByProfile(profileName string, provider string) (interface{}, error)
R profile by name
func (*FileProfileManager) SaveAllProfiles ¶ added in v0.2.1
func (fpm *FileProfileManager) SaveAllProfiles(profiles map[string]models.ProfileCredentials) error
Save File with profiles
func (*FileProfileManager) UpdateProfile ¶ added in v0.2.1
func (fpm *FileProfileManager) UpdateProfile(profileName string, credentials models.ProfileCredentials) error
U profile by name
func (*FileProfileManager) ValidateProfiles ¶ added in v0.2.1
func (fpm *FileProfileManager) ValidateProfiles() error
ValidateProfiles checks that at least one profile exists, each profile has at least one credential, and that all provided credentials have non-empty required fields.
type InitConfig ¶ added in v0.2.1
type InitConfig struct { Profile ProfileConfig `mapstructure:"profile"` Logger LogConfig `mapstructure:"log"` }
var Settings InitConfig
type LogConfig ¶ added in v0.2.1
type LogConfig struct { ZeroConfig `mapstructure:",squash"` File LumberConfig `mapstructure:",squash"` }
type LumberConfig ¶ added in v0.2.1
type ProfileConfig ¶ added in v0.2.1
type ProfileConfig struct {
Default string `mapstructure:"default"`
}
type ProfileManager ¶ added in v0.2.1
type ProfileManager interface { LoadAllProfiles() (map[string]models.ProfileCredentials, error) SaveAllProfiles(profiles map[string]models.ProfileCredentials) error CreateProfile(profileName string, credentials models.ProfileCredentials) error UpdateProfile(profileName string, credentials models.ProfileCredentials) error DeleteProfile(profileName string) error LoadCredentialsByProfile(profileName string, provider string) (interface{}, error) }