repo

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2026 License: AGPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

This section is empty.

Types

type RawQuery added in v0.5.0

type RawQuery struct {
	*Repo
}

func NewRawQuery added in v0.5.0

func NewRawQuery(db *Repo) *RawQuery

func (*RawQuery) GetReadyToPurgeInfo added in v0.5.1

func (r *RawQuery) GetReadyToPurgeInfo(resourceId string) ([]model.ResourcePurgeInfo, error)

func (*RawQuery) GetSpecifiedLatestVersion added in v0.5.0

func (r *RawQuery) GetSpecifiedLatestVersion(resourceId, os, arch string) ([]model.LatestVersionInfo, error)

type Repo

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

func NewRepo added in v0.3.0

func NewRepo(db *ent.Client, dx *sqlx.DB) *Repo

func (*Repo) WithTx

func (r *Repo) WithTx(ctx context.Context, fn func(tx *ent.Tx) error) error

type Resource

type Resource struct {
	*Repo
}

func NewResource

func NewResource(db *Repo) *Resource

func (*Resource) CheckResourceExistsByID

func (r *Resource) CheckResourceExistsByID(ctx context.Context, id string) (bool, error)

func (*Resource) CreateResource

func (r *Resource) CreateResource(ctx context.Context, resID, name, description, updateType string) (*ent.Resource, error)

func (*Resource) FindUpdateTypeById added in v0.5.1

func (r *Resource) FindUpdateTypeById(ctx context.Context, id string) (*ent.Resource, error)

func (*Resource) GetFullResource added in v0.5.1

func (r *Resource) GetFullResource(ctx context.Context) ([]*ent.Resource, error)

type Storage

type Storage struct {
	*Repo
}

func NewStorage

func NewStorage(db *Repo) *Storage

func (*Storage) CheckStorageExist added in v0.3.0

func (r *Storage) CheckStorageExist(ctx context.Context, verID int, os, arch string) (bool, error)

func (*Storage) CreateFullUpdateStorage added in v0.3.0

func (r *Storage) CreateFullUpdateStorage(ctx context.Context, verID int,
	os, arch, path, hash string, fileType types.FileType,
	size int64,
	fileHashes map[string]string,
) (*ent.Storage, error)

func (*Storage) CreateIncrementalUpdateStorage added in v0.3.0

func (r *Storage) CreateIncrementalUpdateStorage(ctx context.Context, tx *ent.Tx,
	verID, oldVerID int, filetype string, filesize int64,
	os, arch, updatePath, hashes string,
) (*ent.Storage, error)

func (*Storage) GetFullUpdateStorage added in v0.3.0

func (r *Storage) GetFullUpdateStorage(ctx context.Context, verID int, os, arch string) (*ent.Storage, error)

func (*Storage) GetIncrementalUpdateStorage added in v0.4.0

func (r *Storage) GetIncrementalUpdateStorage(ctx context.Context, verID, oldVerID int, os, arch string) (*ent.Storage, error)

func (*Storage) PurgeStorageInfo added in v0.5.1

func (r *Storage) PurgeStorageInfo(ctx context.Context, storageId int) error

func (*Storage) UpdateStoragePackageHash added in v0.5.2

func (r *Storage) UpdateStoragePackageHash(ctx context.Context, id int, hash string) error

type Version

type Version struct {
	*Repo
}

func NewVersion

func NewVersion(db *Repo) *Version

func (*Version) CreateVersion

func (r *Version) CreateVersion(ctx context.Context, resID string, channel version.Channel, name string, number uint64) (*ent.Version, error)

func (*Version) GetMaxNumberVersion added in v0.3.0

func (r *Version) GetMaxNumberVersion(ctx context.Context, resID string) (*ent.Version, error)

func (*Version) GetVersionByName

func (r *Version) GetVersionByName(ctx context.Context, resID, name string) (*ent.Version, error)

func (*Version) UpdateVersionCustomData added in v0.4.0

func (r *Version) UpdateVersionCustomData(ctx context.Context, verID int, customData string) error

func (*Version) UpdateVersionReleaseNote added in v0.4.0

func (r *Version) UpdateVersionReleaseNote(ctx context.Context, verID int, releaseNote string) error

Jump to

Keyboard shortcuts

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