imageTagging

package
v1.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 20, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const CommentKey = "comment"
View Source
const DuplicateTagsInAppError = "cannot create duplicate tags in the same app"
View Source
const TagsKey = "tags"

Variables

Functions

This section is empty.

Types

type ImageTaggingService

type ImageTaggingService interface {
	// GetTagsData returns the following fields in response Object
	// ImageReleaseTags -> this will get the tags of the artifact,
	// AppReleaseTags -> all the tags of the given appId,
	// imageComment -> comment of the given artifactId,
	// ProdEnvExists -> implies the existence of prod environment in any workflow of given ciPipelineId or its child ciPipelineRequest's
	GetTagsData(ciPipelineId, appId, artifactId int, externalCi bool) (*types.ImageTaggingResponseDTO, error)
	CreateOrUpdateImageTagging(ciPipelineId, appId, artifactId, userId int, imageTaggingRequest *types.ImageTaggingRequestDTO) (*types.ImageTaggingResponseDTO, error)
	GetProdEnvFromParentAndLinkedWorkflow(ciPipelineId int) (bool, error)
	GetProdEnvByCdPipelineId(pipelineId int) (bool, error)
	// ValidateImageTaggingRequest validates the requested payload
	ValidateImageTaggingRequest(imageTaggingRequest *types.ImageTaggingRequestDTO, appId, artifactId int) (bool, error)
	// GetTagsDataMapByAppId this will fetch a map of artifact vs []tags for given appId
	GetTagsDataMapByAppId(appId int) (map[int][]*repository.ImageTag, error)
	// GetImageCommentsDataMapByArtifactIds this will fetch a map of artifact vs imageComment for given artifactIds
	GetImageCommentsDataMapByArtifactIds(artifactIds []int) (map[int]*repository.ImageComment, error)
	IsHardDeleteHidden() bool
	FindProdEnvExists(externalCi bool, pipelineIds []int) (bool, error)
}

type ImageTaggingServiceImpl

type ImageTaggingServiceImpl struct {
	// contains filtered or unexported fields
}

func NewImageTaggingServiceImpl

func NewImageTaggingServiceImpl(imageTaggingRepo repository.ImageTaggingRepository,
	imageTaggingReadService read.ImageTaggingReadService,
	ciPipelineRepository pipelineConfig.CiPipelineRepository,
	cdPipelineRepository pipelineConfig.PipelineRepository,
	environmentRepository repository3.EnvironmentRepository,
	logger *zap.SugaredLogger) *ImageTaggingServiceImpl

func (*ImageTaggingServiceImpl) CreateOrUpdateImageTagging

func (impl *ImageTaggingServiceImpl) CreateOrUpdateImageTagging(ciPipelineId, appId, artifactId, userId int, imageTaggingRequest *types.ImageTaggingRequestDTO) (*types.ImageTaggingResponseDTO, error)

func (*ImageTaggingServiceImpl) FindProdEnvExists

func (impl *ImageTaggingServiceImpl) FindProdEnvExists(externalCi bool, pipelineIds []int) (bool, error)

FindProdEnvExists returns true if the given ciPipelineIds has at least one prod env as a child TODO: should be a part of environmentReadService

func (*ImageTaggingServiceImpl) GetImageCommentsDataMapByArtifactIds

func (impl *ImageTaggingServiceImpl) GetImageCommentsDataMapByArtifactIds(artifactIds []int) (map[int]*repository.ImageComment, error)

func (*ImageTaggingServiceImpl) GetProdEnvByCdPipelineId

func (impl *ImageTaggingServiceImpl) GetProdEnvByCdPipelineId(pipelineId int) (bool, error)

GetProdEnvByCdPipelineId returns true if the given cdPipelineId has at least one prod env as a child TODO: should be a part of cdPipelineReadService

func (*ImageTaggingServiceImpl) GetProdEnvFromParentAndLinkedWorkflow

func (impl *ImageTaggingServiceImpl) GetProdEnvFromParentAndLinkedWorkflow(ciPipelineId int) (bool, error)

GetProdEnvFromParentAndLinkedWorkflow returns true if the given ciPipelineId has at least one prod env as a child TODO: should be a part of ciPipelineReadService

func (*ImageTaggingServiceImpl) GetTagsData

func (impl *ImageTaggingServiceImpl) GetTagsData(ciPipelineId, appId, artifactId int, externalCi bool) (*types.ImageTaggingResponseDTO, error)

GetTagsData returns the following fields in reponse Object ImageReleaseTags -> this will get the tags of the artifact, AppReleaseTags -> all the tags of the given appId, imageComment -> comment of the given artifactId, ProdEnvExists -> implies the existence of prod environment in any workflow of given ciPipelineId or its child ciPipelineRequest's

func (*ImageTaggingServiceImpl) GetTagsDataMapByAppId

func (impl *ImageTaggingServiceImpl) GetTagsDataMapByAppId(appId int) (map[int][]*repository.ImageTag, error)

GetTagsDataMapByAppId this will fetch a map of artifact vs []tags for given appId

func (*ImageTaggingServiceImpl) IsHardDeleteHidden

func (impl *ImageTaggingServiceImpl) IsHardDeleteHidden() bool

func (*ImageTaggingServiceImpl) ValidateImageTaggingRequest

func (impl *ImageTaggingServiceImpl) ValidateImageTaggingRequest(imageTaggingRequest *types.ImageTaggingRequestDTO, appId, artifactId int) (bool, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL