item

package
v0.54.1 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2024 License: BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Index

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

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

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

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 LoadIDsToDelete(db gorp.SqlExecutor, offset int, limit int) ([]string, error)

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 LoadWorkerCacheItemByProjectAndCacheTag

func LoadWorkerCacheItemByProjectAndCacheTag(ctx context.Context, m *gorpmapper.Mapper, db gorp.SqlExecutor, projKey string, cacheTag string) (*sdk.CDNItem, error)

func LoadWorkerCacheItemsByProjectAndCacheTag

func LoadWorkerCacheItemsByProjectAndCacheTag(ctx context.Context, m *gorpmapper.Mapper, db gorp.SqlExecutor, projKey string, cacheTag string) ([]sdk.CDNItem, error)

func MarkToDeleteByRunIDs

func MarkToDeleteByRunIDs(db gorpmapper.SqlExecutorWithTx, runID int64) error

func Update

Update in database

Types

type Stat

type Stat struct {
	Status string `db:"status"`
	Type   string `db:"type"`
	Number int64  `db:"number"`
}

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)

Jump to

Keyboard shortcuts

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