repository

package
v0.7.4 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuditType

type AuditType int
const CommentType AuditType = 1
const TagType AuditType = 0

type ImageComment

type ImageComment struct {
	TableName  struct{} `sql:"image_comments" json:"-"  pg:",discard_unknown_columns"`
	Id         int      `sql:"id,pk" json:"id"`
	Comment    string   `sql:"comment" json:"comment"`
	ArtifactId int      `sql:"artifact_id" json:"artifactId"`
	UserId     int      `sql:"user_id" json:"-"` //currently not sending userId in json response
}

type ImageTag

type ImageTag struct {
	TableName  struct{} `sql:"release_tags" json:"-"  pg:",discard_unknown_columns"`
	Id         int      `sql:"id,pk" json:"id"`
	TagName    string   `sql:"tag_name" json:"tagName"`
	AppId      int      `sql:"app_id" json:"appId"`
	ArtifactId int      `sql:"artifact_id" json:"artifactId"`
	Deleted    bool     `sql:"deleted" json:"deleted"` //this flag is to check soft delete
}

type ImageTaggingAction

type ImageTaggingAction int
const ActionEdit ImageTaggingAction = 1

this action is only allowed for imageComments

const ActionHardDelete ImageTaggingAction = 3
const ActionSave ImageTaggingAction = 0
const ActionSoftDelete ImageTaggingAction = 2

type ImageTaggingAudit

type ImageTaggingAudit struct {
	TableName  struct{}           `sql:"image_tagging_audit" json:"-"  pg:",discard_unknown_columns"`
	Id         int                `sql:"id,pk"`
	Data       string             `sql:"data"`
	DataType   AuditType          `sql:"data_type"`
	ArtifactId int                `sql:"artifact_id"`
	UpdatedOn  time.Time          `sql:"updated_on"`
	UpdatedBy  int                `sql:"updated_by"`
	Action     ImageTaggingAction `sql:"action"`
}

type ImageTaggingRepository

type ImageTaggingRepository interface {
	//transaction util funcs
	sql.TransactionWrapper
	SaveAuditLogsInBulk(tx *pg.Tx, imageTaggingAudit []*ImageTaggingAudit) error
	SaveReleaseTagsInBulk(tx *pg.Tx, imageTags []*ImageTag) error
	SaveImageComment(tx *pg.Tx, imageComment *ImageComment) error
	GetTagsByAppId(appId int) ([]*ImageTag, error)
	GetTagsByArtifactId(artifactId int) ([]*ImageTag, error)
	GetImageComment(artifactId int) (ImageComment, error)
	GetImageCommentsByArtifactIds(artifactIds []int) ([]*ImageComment, error)
	UpdateReleaseTagInBulk(tx *pg.Tx, imageTags []*ImageTag) error
	UpdateImageComment(tx *pg.Tx, imageComment *ImageComment) error
	DeleteReleaseTagInBulk(tx *pg.Tx, imageTags []*ImageTag) error
}

type ImageTaggingRepositoryImpl

type ImageTaggingRepositoryImpl struct {
	*sql.TransactionUtilImpl
	// contains filtered or unexported fields
}

func NewImageTaggingRepositoryImpl

func NewImageTaggingRepositoryImpl(db *pg.DB, TransactionUtilImpl *sql.TransactionUtilImpl) *ImageTaggingRepositoryImpl

func (*ImageTaggingRepositoryImpl) DeleteReleaseTagInBulk

func (impl *ImageTaggingRepositoryImpl) DeleteReleaseTagInBulk(tx *pg.Tx, imageTags []*ImageTag) error

func (*ImageTaggingRepositoryImpl) GetImageComment

func (impl *ImageTaggingRepositoryImpl) GetImageComment(artifactId int) (ImageComment, error)

func (*ImageTaggingRepositoryImpl) GetImageCommentsByArtifactIds

func (impl *ImageTaggingRepositoryImpl) GetImageCommentsByArtifactIds(artifactIds []int) ([]*ImageComment, error)

func (*ImageTaggingRepositoryImpl) GetTagsByAppId

func (impl *ImageTaggingRepositoryImpl) GetTagsByAppId(appId int) ([]*ImageTag, error)

func (*ImageTaggingRepositoryImpl) GetTagsByArtifactId

func (impl *ImageTaggingRepositoryImpl) GetTagsByArtifactId(artifactId int) ([]*ImageTag, error)

func (*ImageTaggingRepositoryImpl) SaveAuditLogsInBulk

func (impl *ImageTaggingRepositoryImpl) SaveAuditLogsInBulk(tx *pg.Tx, imageTaggingAudit []*ImageTaggingAudit) error

func (*ImageTaggingRepositoryImpl) SaveImageComment

func (impl *ImageTaggingRepositoryImpl) SaveImageComment(tx *pg.Tx, imageComment *ImageComment) error

func (*ImageTaggingRepositoryImpl) SaveReleaseTagsInBulk

func (impl *ImageTaggingRepositoryImpl) SaveReleaseTagsInBulk(tx *pg.Tx, imageTags []*ImageTag) error

func (*ImageTaggingRepositoryImpl) UpdateImageComment

func (impl *ImageTaggingRepositoryImpl) UpdateImageComment(tx *pg.Tx, imageComment *ImageComment) error

func (*ImageTaggingRepositoryImpl) UpdateReleaseTagInBulk

func (impl *ImageTaggingRepositoryImpl) UpdateReleaseTagInBulk(tx *pg.Tx, imageTags []*ImageTag) error

this will update the provided release tag

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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