Documentation
¶
Index ¶
- Constants
- Variables
- func GetNumOfChildQualifiers(qualifier Qualifier) int
- type Qualifier
- type QualifierMapping
- type QualifierMappingService
- type QualifierMappingServiceImpl
- func (impl QualifierMappingServiceImpl) CreateQualifierMappings(qualifierMappings []*QualifierMapping, tx *pg.Tx) ([]*QualifierMapping, error)
- func (impl QualifierMappingServiceImpl) DeleteAllQualifierMappings(resourceType ResourceType, auditLog sql.AuditLog, tx *pg.Tx) error
- func (impl QualifierMappingServiceImpl) DeleteByIdentifierKeyValue(resourceType ResourceType, identifierKey int, identifierValue int, ...) error
- func (impl QualifierMappingServiceImpl) GetQualifierMappings(resourceType ResourceType, scope *Scope, resourceIds []int) ([]*QualifierMapping, error)
- type QualifiersMappingRepository
- type QualifiersMappingRepositoryImpl
- func (repo *QualifiersMappingRepositoryImpl) CreateQualifierMappings(qualifierMappings []*QualifierMapping, tx *pg.Tx) ([]*QualifierMapping, error)
- func (repo *QualifiersMappingRepositoryImpl) DeleteAllQualifierMappings(resourceType ResourceType, auditLog sql.AuditLog, tx *pg.Tx) error
- func (repo *QualifiersMappingRepositoryImpl) DeleteByResourceTypeIdentifierKeyAndValue(resourceType ResourceType, identifierKey int, identifierValue int, ...) error
- func (repo *QualifiersMappingRepositoryImpl) GetDbConnection() *pg.DB
- func (repo *QualifiersMappingRepositoryImpl) GetQualifierMappings(resourceType ResourceType, scope *Scope, ...) ([]*QualifierMapping, error)
- type ResourceType
- type Scope
- type SystemMetadata
- type SystemVariableName
Constants ¶
View Source
const ( Variable ResourceType = 0 Filter = 1 ImageDigest = 2 ImageDigestResourceId = -1 // for ImageDigest resource id will is constant unlike filter and variables InfraProfile = 3 )
Variables ¶
View Source
var CompoundQualifiers []Qualifier
View Source
var SystemVariables = []SystemVariableName{ DevtronNamespace, DevtronClusterName, DevtronEnvName, DevtronImageTag, DevtronAppName, DevtronImage, }
Functions ¶
func GetNumOfChildQualifiers ¶
Types ¶
type QualifierMapping ¶
type QualifierMapping struct {
Id int `sql:"id,pk"`
ResourceId int `sql:"resource_id"`
ResourceType ResourceType `sql:"resource_type"`
QualifierId int `sql:"qualifier_id"`
IdentifierKey int `sql:"identifier_key"`
IdentifierValueInt int `sql:"identifier_value_int"`
Active bool `sql:"active"`
IdentifierValueString string `sql:"identifier_value_string"`
ParentIdentifier int `sql:"parent_identifier"`
CompositeKey string `sql:"-"`
// Data string `sql:"-"`
// VariableData *VariableData
sql.AuditLog
// contains filtered or unexported fields
}
type QualifierMappingService ¶
type QualifierMappingService interface {
CreateQualifierMappings(qualifierMappings []*QualifierMapping, tx *pg.Tx) ([]*QualifierMapping, error)
GetQualifierMappings(resourceType ResourceType, scope *Scope, resourceIds []int) ([]*QualifierMapping, error)
DeleteAllQualifierMappings(resourceType ResourceType, auditLog sql.AuditLog, tx *pg.Tx) error
DeleteByIdentifierKeyValue(resourceType ResourceType, identifierKey int, identifierValue int, auditLog sql.AuditLog, tx *pg.Tx) error
}
type QualifierMappingServiceImpl ¶
type QualifierMappingServiceImpl struct {
// contains filtered or unexported fields
}
func NewQualifierMappingServiceImpl ¶
func NewQualifierMappingServiceImpl(logger *zap.SugaredLogger, qualifierMappingRepository QualifiersMappingRepository, devtronResourceSearchableKeyService devtronResource.DevtronResourceSearchableKeyService) (*QualifierMappingServiceImpl, error)
func (QualifierMappingServiceImpl) CreateQualifierMappings ¶
func (impl QualifierMappingServiceImpl) CreateQualifierMappings(qualifierMappings []*QualifierMapping, tx *pg.Tx) ([]*QualifierMapping, error)
func (QualifierMappingServiceImpl) DeleteAllQualifierMappings ¶
func (impl QualifierMappingServiceImpl) DeleteAllQualifierMappings(resourceType ResourceType, auditLog sql.AuditLog, tx *pg.Tx) error
func (QualifierMappingServiceImpl) DeleteByIdentifierKeyValue ¶ added in v0.6.28
func (impl QualifierMappingServiceImpl) DeleteByIdentifierKeyValue(resourceType ResourceType, identifierKey int, identifierValue int, auditLog sql.AuditLog, tx *pg.Tx) error
func (QualifierMappingServiceImpl) GetQualifierMappings ¶
func (impl QualifierMappingServiceImpl) GetQualifierMappings(resourceType ResourceType, scope *Scope, resourceIds []int) ([]*QualifierMapping, error)
type QualifiersMappingRepository ¶
type QualifiersMappingRepository interface {
//transaction util funcs
sql.TransactionWrapper
CreateQualifierMappings(qualifierMappings []*QualifierMapping, tx *pg.Tx) ([]*QualifierMapping, error)
GetQualifierMappings(resourceType ResourceType, scope *Scope, searchableIdMap map[bean.DevtronResourceSearchableKeyName]int, resourceIds []int) ([]*QualifierMapping, error)
DeleteAllQualifierMappings(ResourceType, sql.AuditLog, *pg.Tx) error
DeleteByResourceTypeIdentifierKeyAndValue(resourceType ResourceType, identifierKey int, identifierValue int, auditLog sql.AuditLog, tx *pg.Tx) error
GetDbConnection() *pg.DB
}
type QualifiersMappingRepositoryImpl ¶
type QualifiersMappingRepositoryImpl struct {
*sql.TransactionUtilImpl
// contains filtered or unexported fields
}
func NewQualifiersMappingRepositoryImpl ¶
func NewQualifiersMappingRepositoryImpl(dbConnection *pg.DB, logger *zap.SugaredLogger) (*QualifiersMappingRepositoryImpl, error)
func (*QualifiersMappingRepositoryImpl) CreateQualifierMappings ¶
func (repo *QualifiersMappingRepositoryImpl) CreateQualifierMappings(qualifierMappings []*QualifierMapping, tx *pg.Tx) ([]*QualifierMapping, error)
func (*QualifiersMappingRepositoryImpl) DeleteAllQualifierMappings ¶
func (repo *QualifiersMappingRepositoryImpl) DeleteAllQualifierMappings(resourceType ResourceType, auditLog sql.AuditLog, tx *pg.Tx) error
func (*QualifiersMappingRepositoryImpl) DeleteByResourceTypeIdentifierKeyAndValue ¶ added in v0.6.28
func (repo *QualifiersMappingRepositoryImpl) DeleteByResourceTypeIdentifierKeyAndValue(resourceType ResourceType, identifierKey int, identifierValue int, auditLog sql.AuditLog, tx *pg.Tx) error
func (*QualifiersMappingRepositoryImpl) GetDbConnection ¶ added in v0.6.28
func (repo *QualifiersMappingRepositoryImpl) GetDbConnection() *pg.DB
func (*QualifiersMappingRepositoryImpl) GetQualifierMappings ¶
func (repo *QualifiersMappingRepositoryImpl) GetQualifierMappings(resourceType ResourceType, scope *Scope, searchableIdMap map[bean.DevtronResourceSearchableKeyName]int, resourceIds []int) ([]*QualifierMapping, error)
type ResourceType ¶
type ResourceType int
type Scope ¶
type Scope struct {
AppId int `json:"appId"`
EnvId int `json:"envId"`
ClusterId int `json:"clusterId"`
PipelineId int `json:"pipelineId"`
SystemMetadata *SystemMetadata `json:"-"`
}
type SystemMetadata ¶
type SystemMetadata struct {
EnvironmentName string
ClusterName string
Namespace string
ImageTag string
Image string
AppName string
}
func (*SystemMetadata) GetDataFromSystemVariable ¶
func (metadata *SystemMetadata) GetDataFromSystemVariable(variable SystemVariableName) string
type SystemVariableName ¶
type SystemVariableName string
const ( DevtronNamespace SystemVariableName = "DEVTRON_NAMESPACE" DevtronClusterName SystemVariableName = "DEVTRON_CLUSTER_NAME" DevtronEnvName SystemVariableName = "DEVTRON_ENV_NAME" DevtronImageTag SystemVariableName = "DEVTRON_IMAGE_TAG" DevtronImage SystemVariableName = "DEVTRON_IMAGE" DevtronAppName SystemVariableName = "DEVTRON_APP_NAME" )
Source Files
¶
Click to show internal directories.
Click to hide internal directories.