Documentation ¶
Index ¶
- Constants
- Variables
- type ActionResponse
- type BlobStorageConfig
- type GvkLevelFilter
- type ModuleActionAuditLog
- type ModuleActionAuditLogRepository
- type ModuleActionAuditLogRepositoryImpl
- type ModuleActionRequestDto
- type ModuleCacheService
- type ModuleCacheServiceImpl
- type ModuleConfigDto
- type ModuleCronService
- type ModuleCronServiceImpl
- type ModuleEnableRequestDto
- type ModuleEnvConfig
- type ModuleInfoDto
- type ModuleName
- type ModuleResourceStatusDto
- type ModuleService
- type ModuleServiceHelper
- type ModuleServiceHelperImpl
- type ModuleServiceImpl
- func (impl ModuleServiceImpl) EnableModule(moduleName, version string) (*ActionResponse, error)
- func (impl ModuleServiceImpl) GetAllModuleInfo() ([]ModuleInfoDto, error)
- func (impl ModuleServiceImpl) GetModuleConfig(name string) (*ModuleConfigDto, error)
- func (impl ModuleServiceImpl) GetModuleInfo(name string) (*ModuleInfoDto, error)
- func (impl ModuleServiceImpl) HandleModuleAction(userId int32, moduleName string, moduleActionRequest *ModuleActionRequestDto) (*ActionResponse, error)
- type ModuleStatus
- type ResourceFilter
- type ResourceIdentifier
Constants ¶
View Source
const ( CLAIR_V4 = "V4" CLAIR_V2 = "V2" TRIVY_V1 = "V1" )
View Source
const BlobStorage = "blob-storage"
View Source
const INSTALLER_MODULES_HELM_KEY = "installer.modules"
View Source
const (
MODULE_TYPE_SECURITY string = "security"
)
Variables ¶
View Source
var SupportedModuleNamesListFirstReleaseExcludingCicd = []string{ModuleNameArgoCd, ModuleNameSecurityClair, ModuleNameNotification, ModuleNameMonitoringGrafana}
Functions ¶
This section is empty.
Types ¶
type ActionResponse ¶
type ActionResponse struct {
Success bool `json:"success"`
}
type BlobStorageConfig ¶ added in v0.6.0
type BlobStorageConfig struct {
Enabled bool `env:"BLOB_STORAGE_ENABLED" envDefault:"false"`
}
type GvkLevelFilter ¶ added in v0.6.10
type GvkLevelFilter struct { Gvk *schema.GroupVersionKind `json:"gvk"` ResourceIdentifier *ResourceIdentifier `json:"filter"` }
type ModuleActionAuditLog ¶
type ModuleActionAuditLog struct { Id int `sql:"id,pk"` ModuleName string `sql:"module_name, notnull"` Action string `sql:"action,notnull"` Version string `sql:"version,notnull"` CreatedOn time.Time `sql:"created_on,notnull"` CreatedBy int32 `sql:"created_by,notnull"` // contains filtered or unexported fields }
type ModuleActionAuditLogRepository ¶
type ModuleActionAuditLogRepository interface {
Save(moduleActionAuditLog *ModuleActionAuditLog) error
}
type ModuleActionAuditLogRepositoryImpl ¶
type ModuleActionAuditLogRepositoryImpl struct {
// contains filtered or unexported fields
}
func NewModuleActionAuditLogRepositoryImpl ¶
func NewModuleActionAuditLogRepositoryImpl(dbConnection *pg.DB) *ModuleActionAuditLogRepositoryImpl
func (ModuleActionAuditLogRepositoryImpl) Save ¶
func (impl ModuleActionAuditLogRepositoryImpl) Save(moduleActionAuditLog *ModuleActionAuditLog) error
type ModuleActionRequestDto ¶
type ModuleCacheService ¶
type ModuleCacheService interface { }
type ModuleCacheServiceImpl ¶
type ModuleCacheServiceImpl struct { K8sUtil *k8s.K8sServiceImpl // contains filtered or unexported fields }
func NewModuleCacheServiceImpl ¶
func NewModuleCacheServiceImpl(logger *zap.SugaredLogger, K8sUtil *k8s.K8sServiceImpl, moduleEnvConfig *ModuleEnvConfig, serverEnvConfig *serverEnvConfig.ServerEnvConfig, serverDataStore *serverDataStore.ServerDataStore, moduleRepository moduleRepo.ModuleRepository, teamService team.TeamService) *ModuleCacheServiceImpl
type ModuleConfigDto ¶ added in v0.6.0
type ModuleConfigDto struct {
Enabled bool `json:"enabled"`
}
type ModuleCronService ¶
type ModuleCronService interface {
HandleModuleStatusIfNotInProgress(moduleName string)
}
type ModuleCronServiceImpl ¶
type ModuleCronServiceImpl struct {
// contains filtered or unexported fields
}
func NewModuleCronServiceImpl ¶
func NewModuleCronServiceImpl(logger *zap.SugaredLogger, moduleEnvConfig *ModuleEnvConfig, moduleRepository moduleRepo.ModuleRepository, serverEnvConfig *serverEnvConfig.ServerEnvConfig, helmAppService client.HelmAppService, moduleServiceHelper ModuleServiceHelper, moduleResourceStatusRepository moduleRepo.ModuleResourceStatusRepository, moduleDataStore *moduleDataStore.ModuleDataStore, cronLogger *cron2.CronLoggerImpl) (*ModuleCronServiceImpl, error)
func (*ModuleCronServiceImpl) HandleModuleStatusIfNotInProgress ¶ added in v0.6.10
func (impl *ModuleCronServiceImpl) HandleModuleStatusIfNotInProgress(moduleName string)
type ModuleEnableRequestDto ¶ added in v0.6.18
type ModuleEnableRequestDto struct {
Version string `json:"version,notnull"`
}
type ModuleEnvConfig ¶
type ModuleEnvConfig struct {
ModuleStatusHandlingCronDurationInMin int `env:"MODULE_STATUS_HANDLING_CRON_DURATION_MIN" envDefault:"3"` // default 3 minutes
}
func ParseModuleEnvConfig ¶
func ParseModuleEnvConfig() (*ModuleEnvConfig, error)
type ModuleInfoDto ¶
type ModuleInfoDto struct { Name string `json:"name,notnull"` Status string `json:"status,notnull" validate:"oneof=notInstalled installed installing installFailed timeout"` ModuleResourcesStatus []*ModuleResourceStatusDto `json:"moduleResourcesStatus"` Enabled bool `json:"enabled"` Moduletype string `json:"moduleType,omitempty"` }
type ModuleName ¶ added in v0.5.3
type ModuleName = string
const ( ModuleNameCicd ModuleName = "cicd" ModuleNameArgoCd ModuleName = "argo-cd" ModuleNameSecurityClair ModuleName = "security.clair" ModuleNameNotification ModuleName = "notifier" ModuleNameMonitoringGrafana ModuleName = "monitoring.grafana" ModuleNameSecurityTrivy ModuleName = "security.trivy" )
type ModuleResourceStatusDto ¶ added in v0.6.10
type ModuleService ¶
type ModuleService interface { GetModuleInfo(name string) (*ModuleInfoDto, error) GetModuleConfig(name string) (*ModuleConfigDto, error) HandleModuleAction(userId int32, moduleName string, moduleActionRequest *ModuleActionRequestDto) (*ActionResponse, error) GetAllModuleInfo() ([]ModuleInfoDto, error) EnableModule(moduleName, version string) (*ActionResponse, error) }
type ModuleServiceHelper ¶ added in v0.6.10
type ModuleServiceHelperImpl ¶ added in v0.6.10
type ModuleServiceHelperImpl struct {
// contains filtered or unexported fields
}
func NewModuleServiceHelperImpl ¶ added in v0.6.10
func NewModuleServiceHelperImpl(serverEnvConfig *serverEnvConfig.ServerEnvConfig) *ModuleServiceHelperImpl
func (ModuleServiceHelperImpl) GetModuleMetadata ¶ added in v0.6.10
func (impl ModuleServiceHelperImpl) GetModuleMetadata(moduleName string) ([]byte, error)
type ModuleServiceImpl ¶
type ModuleServiceImpl struct {
// contains filtered or unexported fields
}
func NewModuleServiceImpl ¶
func NewModuleServiceImpl(logger *zap.SugaredLogger, serverEnvConfig *serverEnvConfig.ServerEnvConfig, moduleRepository moduleRepo.ModuleRepository, moduleActionAuditLogRepository ModuleActionAuditLogRepository, helmAppService client.HelmAppService, serverDataStore *serverDataStore.ServerDataStore, serverCacheService server.ServerCacheService, moduleCacheService ModuleCacheService, moduleCronService ModuleCronService, moduleServiceHelper ModuleServiceHelper, moduleResourceStatusRepository moduleRepo.ModuleResourceStatusRepository, scantoolMetaDataRepository security.ScanToolMetadataRepository) *ModuleServiceImpl
func (ModuleServiceImpl) EnableModule ¶ added in v0.6.18
func (impl ModuleServiceImpl) EnableModule(moduleName, version string) (*ActionResponse, error)
func (ModuleServiceImpl) GetAllModuleInfo ¶ added in v0.6.17
func (impl ModuleServiceImpl) GetAllModuleInfo() ([]ModuleInfoDto, error)
func (ModuleServiceImpl) GetModuleConfig ¶ added in v0.6.0
func (impl ModuleServiceImpl) GetModuleConfig(name string) (*ModuleConfigDto, error)
func (ModuleServiceImpl) GetModuleInfo ¶
func (impl ModuleServiceImpl) GetModuleInfo(name string) (*ModuleInfoDto, error)
func (ModuleServiceImpl) HandleModuleAction ¶
func (impl ModuleServiceImpl) HandleModuleAction(userId int32, moduleName string, moduleActionRequest *ModuleActionRequestDto) (*ActionResponse, error)
type ModuleStatus ¶
type ModuleStatus = string
const ( ModuleStatusNotInstalled ModuleStatus = "notInstalled" ModuleStatusInstalled ModuleStatus = "installed" ModuleStatusInstalling ModuleStatus = "installing" ModuleStatusInstallFailed ModuleStatus = "installFailed" ModuleStatusTimeout ModuleStatus = "timeout" )
type ResourceFilter ¶ added in v0.6.10
type ResourceFilter struct { GlobalFilter *ResourceIdentifier `json:"globalFilter,omitempty"` GvkLevelFilters []*GvkLevelFilter `json:"gvkLevelFilters,omitempty"` }
type ResourceIdentifier ¶ added in v0.6.10
Source Files ¶
Click to show internal directories.
Click to hide internal directories.