Documentation ¶
Index ¶
- Variables
- func FetchConfig() ([]models.CoreConfig, error)
- func FetchSSMParams() ([]models.SSMParameters, error)
- func StoreConfig(config []models.CoreConfig) ([]models.CoreConfig, error)
- type Datastore
- type GormDatastore
- func (g GormDatastore) AddToAudit(operation application.AuditLine, owner string) error
- func (g GormDatastore) FetchAllApplicationStatus() ([]models.Deployment, error)
- func (g GormDatastore) FetchAllApplicationStatusByDeployment(deploymentid uint) ([]models.Application, error)
- func (g GormDatastore) FetchAllInstalledMarketplaceApplications() ([]*types.InstalledMarketplaceApplication, error)
- func (g GormDatastore) FetchCoreParams() ([]models.CoreConfig, error)
- func (g GormDatastore) FetchDeploymentIDByApplicationName(deploymentName string) (uint, error)
- func (g GormDatastore) FetchDeploymentIDByName(deploymentID string) (uint, error)
- func (g GormDatastore) FetchDeploymentNames() ([]string, error)
- func (g GormDatastore) FetchSSMParams() ([]models.SSMParameters, error)
- func (g GormDatastore) FindLastAuditLineByOperation(operation application.AuditLine) (models.Audit, error)
- func (g GormDatastore) GetInstalledMarketplaceApplication(appName string, deploymentName string) (*types.InstalledMarketplaceApplication, error)
- func (g GormDatastore) RemoveApplicationByName(deploymentName string, applicationName string) error
- func (g GormDatastore) RemoveDeploymentByName(name string) error
- func (g GormDatastore) RemoveInstalledMarketplaceApplication(appName string, deploymentName string) error
- func (g GormDatastore) StoreDeployment(model models.Deployment) (uint, error)
- func (g GormDatastore) StoreInstalledMarketplaceApplication(application *types.InstalledMarketplaceApplication) error
- func (g GormDatastore) StoreSSMParams(p []config.SSMParameter, owner string) error
- func (g GormDatastore) UpdateApplicationStatus(deploymentID uint, targetAppName string, displayName string, newStatus string) error
- func (g GormDatastore) UpdateInstalledMarketplaceApplication(application *types.InstalledMarketplaceApplication) error
Constants ¶
This section is empty.
Variables ¶
var DB *gorm.DB
Functions ¶
func FetchConfig ¶
func FetchConfig() ([]models.CoreConfig, error)
FetchConfig retrieves all configuration records from the database. It returns a slice of CoreConfig models and an error. The error is non-nil if any issues occur during the database operation.
Example usage:
configs, err := FetchConfig() if err != nil { // Handle the error }
Returns:
([]models.CoreConfig, error) : A slice of CoreConfig models and an error (if any)
func FetchSSMParams ¶
func FetchSSMParams() ([]models.SSMParameters, error)
func StoreConfig ¶
func StoreConfig(config []models.CoreConfig) ([]models.CoreConfig, error)
StoreConfig stores the given configuration in the database. It uses a transaction to ensure all operations are atomic. If any of the operations fail, it will rollback the transaction and return an error. In case of a conflict on the key field, it updates the existing record's value field with the new value.
The function accepts a slice of CoreConfig models and returns the updated configurations and an error. The error is non-nil if any issues occur during the database operation.
Example usage:
updatedConfigs, err := StoreConfig(configs) if err != nil { // Handle the error }
Parameters:
config : A slice of CoreConfig models to be stored in the database
Returns:
([]models.CoreConfig, error) : A slice of updated CoreConfig models and error (if any)
Types ¶
type Datastore ¶
type Datastore interface { FetchCoreParams() ([]models.CoreConfig, error) FetchSSMParams() ([]models.SSMParameters, error) StoreSSMParams(p []config.SSMParameter, owner string) error StoreDeployment(p models.Deployment) (uint, error) UpdateApplicationStatus(deploymentid uint, application string, displayName string, status string) error FetchDeploymentIDByName(deploymentname string) (uint, error) FetchAllApplicationStatus() ([]models.Deployment, error) FetchAllApplicationStatusByDeployment(deploymentid uint) ([]models.Application, error) AddToAudit(operation application.AuditLine, owner string) error FindLastAuditLineByOperation(operation application.AuditLine) (models.Audit, error) FetchDeploymentNames() ([]string, error) RemoveDeploymentByName(name string) error RemoveApplicationByName(deploymentName string, applicationName string) error FetchDeploymentIDByApplicationName(deploymentName string) (uint, error) StoreInstalledMarketplaceApplication(application *types.InstalledMarketplaceApplication) error GetInstalledMarketplaceApplication(appName string, displayName string) (*types.InstalledMarketplaceApplication, error) FetchAllInstalledMarketplaceApplications() ([]*types.InstalledMarketplaceApplication, error) RemoveInstalledMarketplaceApplication(appName string, deploymentName string) error UpdateInstalledMarketplaceApplication(application *types.InstalledMarketplaceApplication) error }
func NewGormDatastore ¶
type GormDatastore ¶
type GormDatastore struct {
// contains filtered or unexported fields
}
func (GormDatastore) AddToAudit ¶
func (g GormDatastore) AddToAudit(operation application.AuditLine, owner string) error
func (GormDatastore) FetchAllApplicationStatus ¶
func (g GormDatastore) FetchAllApplicationStatus() ([]models.Deployment, error)
func (GormDatastore) FetchAllApplicationStatusByDeployment ¶
func (g GormDatastore) FetchAllApplicationStatusByDeployment(deploymentid uint) ([]models.Application, error)
func (GormDatastore) FetchAllInstalledMarketplaceApplications ¶
func (g GormDatastore) FetchAllInstalledMarketplaceApplications() ([]*types.InstalledMarketplaceApplication, error)
func (GormDatastore) FetchCoreParams ¶
func (g GormDatastore) FetchCoreParams() ([]models.CoreConfig, error)
func (GormDatastore) FetchDeploymentIDByApplicationName ¶
func (g GormDatastore) FetchDeploymentIDByApplicationName(deploymentName string) (uint, error)
func (GormDatastore) FetchDeploymentIDByName ¶
func (g GormDatastore) FetchDeploymentIDByName(deploymentID string) (uint, error)
func (GormDatastore) FetchDeploymentNames ¶
func (g GormDatastore) FetchDeploymentNames() ([]string, error)
func (GormDatastore) FetchSSMParams ¶
func (g GormDatastore) FetchSSMParams() ([]models.SSMParameters, error)
func (GormDatastore) FindLastAuditLineByOperation ¶
func (g GormDatastore) FindLastAuditLineByOperation(operation application.AuditLine) (models.Audit, error)
func (GormDatastore) GetInstalledMarketplaceApplication ¶
func (g GormDatastore) GetInstalledMarketplaceApplication(appName string, deploymentName string) (*types.InstalledMarketplaceApplication, error)
func (GormDatastore) RemoveApplicationByName ¶
func (g GormDatastore) RemoveApplicationByName(deploymentName string, applicationName string) error
func (GormDatastore) RemoveDeploymentByName ¶
func (g GormDatastore) RemoveDeploymentByName(name string) error
func (GormDatastore) RemoveInstalledMarketplaceApplication ¶
func (g GormDatastore) RemoveInstalledMarketplaceApplication(appName string, deploymentName string) error
func (GormDatastore) StoreDeployment ¶
func (g GormDatastore) StoreDeployment(model models.Deployment) (uint, error)
func (GormDatastore) StoreInstalledMarketplaceApplication ¶
func (g GormDatastore) StoreInstalledMarketplaceApplication(application *types.InstalledMarketplaceApplication) error
func (GormDatastore) StoreSSMParams ¶
func (g GormDatastore) StoreSSMParams(p []config.SSMParameter, owner string) error
func (GormDatastore) UpdateApplicationStatus ¶
func (GormDatastore) UpdateInstalledMarketplaceApplication ¶
func (g GormDatastore) UpdateInstalledMarketplaceApplication(application *types.InstalledMarketplaceApplication) error