Documentation
¶
Index ¶
- func InitializeConfig(ctx context.Context, storageProfileFile, apiKeysFile string, ...) error
- func InitializeConfigWithDependencies(ctx context.Context, storageProfileFile, apiKeysFile string, ...) error
- func LoadFileContentsWithReader(filename string, fileReader FileReader) ([]byte, error)
- func UnmarshalYAML(data []byte, v interface{}) error
- type APIKeyOrg
- type APIKeysConfig
- type DatabaseQueries
- type FileReader
- type OSFileReader
- type StorageProfile
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InitializeConfig ¶
func InitializeConfig(ctx context.Context, storageProfileFile, apiKeysFile string, qtx *configdb.Queries, replace bool) error
InitializeConfig loads and imports storage profiles and API keys
func InitializeConfigWithDependencies ¶
func InitializeConfigWithDependencies(ctx context.Context, storageProfileFile, apiKeysFile string, qtx DatabaseQueries, fileReader FileReader, replace bool) error
InitializeConfigWithDependencies loads and imports with injectable dependencies for testing
func LoadFileContentsWithReader ¶ added in v1.3.4
func LoadFileContentsWithReader(filename string, fileReader FileReader) ([]byte, error)
LoadFileContentsWithReader loads file contents using the provided FileReader
func UnmarshalYAML ¶ added in v1.3.4
UnmarshalYAML unmarshals YAML data into the provided interface
Types ¶
type DatabaseQueries ¶
type DatabaseQueries interface {
HasExistingStorageProfiles(ctx context.Context) (bool, error)
UpsertBucketConfiguration(ctx context.Context, arg configdb.UpsertBucketConfigurationParams) (configdb.BucketConfiguration, error)
UpsertOrganizationBucket(ctx context.Context, arg configdb.UpsertOrganizationBucketParams) error
UpsertOrganization(ctx context.Context, arg configdb.UpsertOrganizationParams) (configdb.Organization, error)
ClearOrganizationAPIKeyMappings(ctx context.Context) error
ClearOrganizationAPIKeys(ctx context.Context) error
UpsertOrganizationAPIKey(ctx context.Context, arg configdb.UpsertOrganizationAPIKeyParams) (configdb.OrganizationApiKey, error)
UpsertOrganizationAPIKeyMapping(ctx context.Context, arg configdb.UpsertOrganizationAPIKeyMappingParams) error
}
DatabaseQueries interface for testable database operations
type FileReader ¶
FileReader interface for testable file operations
type OSFileReader ¶
type OSFileReader struct{}
OSFileReader implements FileReader using OS operations
func (OSFileReader) Getenv ¶
func (r OSFileReader) Getenv(key string) string
type StorageProfile ¶
type StorageProfile struct {
OrganizationID uuid.UUID `yaml:"organization_id"`
InstanceNum int `yaml:"instance_num,omitempty"` // Defaults to 1 if not specified
CollectorName string `yaml:"collector_name,omitempty"` // Defaults to "default" if not specified
CloudProvider string `yaml:"cloud_provider"`
Region string `yaml:"region"`
Bucket string `yaml:"bucket"`
Role string `yaml:"role,omitempty"`
Endpoint string `yaml:"endpoint,omitempty"`
UsePathStyle bool `yaml:"use_path_style,omitempty"`
InsecureTLS bool `yaml:"insecure_tls,omitempty"`
}
StorageProfile represents the YAML structure for storage profile initialization
Click to show internal directories.
Click to hide internal directories.