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 ¶
- Variables
- func Init()
- func InitDB()
- 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 CredentialManager
- type DatabaseConfig
- 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
- type InitConfig
- type LogConfig
- type LumberConfig
- type ProfileConfig
- type ProfileManager
- type ZeroConfig
Constants ¶
This section is empty.
Variables ¶
var DB *gorm.DB
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 CredentialManager ¶ added in v0.4.1
type CredentialManager struct {
CredentialService *service.CredentialService
// contains filtered or unexported fields
}
var AuthManager *CredentialManager
func NewAuthManager ¶ added in v0.4.1
func NewAuthManager(profileFilePath ...string) *CredentialManager
func (*CredentialManager) LoadCredentialsById ¶ added in v0.4.1
func (cred *CredentialManager) LoadCredentialsById(credentialId uint64) (interface{}, error)
type DatabaseConfig ¶ added in v0.4.1
type DatabaseConfig struct {
Host string
Port string
User string
Password string
DBName string
SSLMode string
}
DatabaseConfig 데이터베이스 설정
func NewDatabaseConfig ¶ added in v0.4.1
func NewDatabaseConfig() *DatabaseConfig
NewDatabaseConfig 데이터베이스 설정 생성
func (*DatabaseConfig) GetDSN ¶ added in v0.4.1
func (c *DatabaseConfig) GetDSN() string
GetDSN 데이터베이스 연결 문자열 반환
type FileProfileManager ¶ added in v0.2.1
type FileProfileManager struct {
CredentialService *service.CredentialService
// contains filtered or unexported fields
}
func NewProfileManager ¶ added in v0.2.1
func NewProfileManager(profileFilePath ...string) *FileProfileManager
todo : profileopath -> credentialService 으로 변경 필요
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
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)
}