Documentation ¶
Index ¶
- func ComputeSizeByIDs(db gorp.SqlExecutor, itemIDs []string) (int64, error)
- func ComputeSizeByProjectKey(db gorp.SqlExecutor, projectKey string) (int64, error)
- func CountItemsToDelete(db gorp.SqlExecutor) (int64, error)
- func DeleteByID(db gorp.SqlExecutor, ids ...string) error
- func InitDBMapping(m *gorpmapper.Mapper)
- func Insert(ctx context.Context, m *gorpmapper.Mapper, db gorpmapper.SqlExecutorWithTx, ...) error
- func ListNodeRunByProject(db gorp.SqlExecutor, projectKey string) ([]int64, error)
- func LoadAll(ctx context.Context, m *gorpmapper.Mapper, db gorp.SqlExecutor, size int, ...) ([]sdk.CDNItem, error)
- func LoadAndLockByID(ctx context.Context, m *gorpmapper.Mapper, db gorpmapper.SqlExecutorWithTx, ...) (*sdk.CDNItem, error)
- func LoadByAPIRefHashAndType(ctx context.Context, m *gorpmapper.Mapper, db gorp.SqlExecutor, hash string, ...) (*sdk.CDNItem, error)
- func LoadByID(ctx context.Context, m *gorpmapper.Mapper, db gorp.SqlExecutor, id string, ...) (*sdk.CDNItem, error)
- func LoadByIDs(ctx context.Context, m *gorpmapper.Mapper, db gorp.SqlExecutor, ids []string, ...) ([]sdk.CDNItem, error)
- func LoadByJobRunID(ctx context.Context, m *gorpmapper.Mapper, db gorp.SqlExecutor, jobRunId int64, ...) ([]sdk.CDNItem, error)
- func LoadByRunJobID(ctx context.Context, m *gorpmapper.Mapper, db gorp.SqlExecutor, ...) ([]sdk.CDNItem, error)
- func LoadIDsToDelete(db gorp.SqlExecutor, offset int, limit int) ([]string, error)
- func LoadOldItemByStatusAndDuration(ctx context.Context, m *gorpmapper.Mapper, db gorp.SqlExecutor, status string, ...) ([]sdk.CDNItem, error)
- func LoadRunResultByRunID(ctx context.Context, m *gorpmapper.Mapper, db gorp.SqlExecutor, runID string) ([]sdk.CDNItem, error)
- func LoadWorkerCacheItemByProjectAndCacheTag(ctx context.Context, m *gorpmapper.Mapper, db gorp.SqlExecutor, projKey string, ...) (*sdk.CDNItem, error)
- func LoadWorkerCacheItemsByProjectAndCacheTag(ctx context.Context, m *gorpmapper.Mapper, db gorp.SqlExecutor, projKey string, ...) ([]sdk.CDNItem, error)
- func MarkToDeleteByRunIDs(db gorpmapper.SqlExecutorWithTx, runID int64) error
- func Update(ctx context.Context, m *gorpmapper.Mapper, db gorpmapper.SqlExecutorWithTx, ...) error
- type Stat
- type StatItemPercentil
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ComputeSizeByIDs ¶
func ComputeSizeByIDs(db gorp.SqlExecutor, itemIDs []string) (int64, error)
ComputeSizeByIDs returns the size used by givenn item IDs
func ComputeSizeByProjectKey ¶
func ComputeSizeByProjectKey(db gorp.SqlExecutor, projectKey string) (int64, error)
ComputeSizeByProjectKey returns the size used by a project
func CountItemsToDelete ¶
func CountItemsToDelete(db gorp.SqlExecutor) (int64, error)
func DeleteByID ¶
func DeleteByID(db gorp.SqlExecutor, ids ...string) error
func InitDBMapping ¶
func InitDBMapping(m *gorpmapper.Mapper)
func Insert ¶
func Insert(ctx context.Context, m *gorpmapper.Mapper, db gorpmapper.SqlExecutorWithTx, i *sdk.CDNItem) error
Insert in database.
func ListNodeRunByProject ¶
func ListNodeRunByProject(db gorp.SqlExecutor, projectKey string) ([]int64, error)
func LoadAll ¶
func LoadAll(ctx context.Context, m *gorpmapper.Mapper, db gorp.SqlExecutor, size int, opts ...gorpmapper.GetOptionFunc) ([]sdk.CDNItem, error)
func LoadAndLockByID ¶
func LoadAndLockByID(ctx context.Context, m *gorpmapper.Mapper, db gorpmapper.SqlExecutorWithTx, id string, opts ...gorpmapper.GetOptionFunc) (*sdk.CDNItem, error)
LoadAndLockByID returns an item from database for given id.
func LoadByAPIRefHashAndType ¶
func LoadByAPIRefHashAndType(ctx context.Context, m *gorpmapper.Mapper, db gorp.SqlExecutor, hash string, itemType sdk.CDNItemType, opts ...gorpmapper.GetOptionFunc) (*sdk.CDNItem, error)
LoadByAPIRefHashAndType load an item by his job id, step order and type
func LoadByID ¶
func LoadByID(ctx context.Context, m *gorpmapper.Mapper, db gorp.SqlExecutor, id string, opts ...gorpmapper.GetOptionFunc) (*sdk.CDNItem, error)
LoadByID returns an item from database for given id.
func LoadByIDs ¶
func LoadByIDs(ctx context.Context, m *gorpmapper.Mapper, db gorp.SqlExecutor, ids []string, opts ...gorpmapper.GetOptionFunc) ([]sdk.CDNItem, error)
LoadByIDs returns items from database for given ids.
func LoadByJobRunID ¶
func LoadByJobRunID(ctx context.Context, m *gorpmapper.Mapper, db gorp.SqlExecutor, jobRunId int64, itemTypes []string, opts ...gorpmapper.GetOptionFunc) ([]sdk.CDNItem, error)
LoadByJobRunID load an item by his job id and type DEPRECATED
func LoadByRunJobID ¶ added in v0.53.1
func LoadByRunJobID(ctx context.Context, m *gorpmapper.Mapper, db gorp.SqlExecutor, runJobID string, opts ...gorpmapper.GetOptionFunc) ([]sdk.CDNItem, error)
LoadByRunJobID load an item by his job id and type
func LoadIDsToDelete ¶
func LoadOldItemByStatusAndDuration ¶
func LoadOldItemByStatusAndDuration(ctx context.Context, m *gorpmapper.Mapper, db gorp.SqlExecutor, status string, duration int, opts ...gorpmapper.GetOptionFunc) ([]sdk.CDNItem, error)
func LoadRunResultByRunID ¶
func LoadRunResultByRunID(ctx context.Context, m *gorpmapper.Mapper, db gorp.SqlExecutor, runID string) ([]sdk.CDNItem, error)
func MarkToDeleteByRunIDs ¶
func MarkToDeleteByRunIDs(db gorpmapper.SqlExecutorWithTx, runID int64) error
func Update ¶
func Update(ctx context.Context, m *gorpmapper.Mapper, db gorpmapper.SqlExecutorWithTx, i *sdk.CDNItem) error
Update in database
Types ¶
type Stat ¶
func CountItems ¶
func CountItems(db gorp.SqlExecutor) (res []Stat, err error)
type StatItemPercentil ¶
type StatItemPercentil struct { Size int64 `db:"size"` Type string `db:"type"` Percentile int64 `db:"percentile"` }
func CountItemSizePercentil ¶
func CountItemSizePercentil(db gorp.SqlExecutor) ([]StatItemPercentil, error)
Click to show internal directories.
Click to hide internal directories.