logic

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2025 License: AGPL-3.0 Imports: 37 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

func InitAsynqServer added in v0.5.0

func InitAsynqServer(l *zap.Logger, v *VersionLogic) *asynq.Server

Types

type ResourceLogic

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

func NewResourceLogic

func NewResourceLogic(
	logger *zap.Logger,
	resourceRepo *repo.Resource,
	cg *cache.MultiCacheGroup,
) *ResourceLogic

func (*ResourceLogic) Create

func (l *ResourceLogic) Create(ctx context.Context, param CreateResourceParam) (*ent.Resource, error)

func (*ResourceLogic) Exists added in v0.2.0

func (l *ResourceLogic) Exists(ctx context.Context, id string) (bool, error)

func (*ResourceLogic) FindUpdateTypeById added in v0.5.1

func (l *ResourceLogic) FindUpdateTypeById(ctx context.Context, id string) (types.Update, error)

type StorageLogic

type StorageLogic struct {
	RootDir string
	OSSDir  string
	// contains filtered or unexported fields
}

func NewStorageLogic

func NewStorageLogic(
	logger *zap.Logger,
	storageRepo *repo.Storage,
	resourceRepo *repo.Resource,
	rawQuery *repo.RawQuery,
) *StorageLogic

func (*StorageLogic) BuildVersionPatchStorageDirPath added in v0.3.0

func (l *StorageLogic) BuildVersionPatchStorageDirPath(resID string, verID int, os, arch string) string

func (*StorageLogic) BuildVersionResourceStorageDirPath added in v0.3.0

func (l *StorageLogic) BuildVersionResourceStorageDirPath(resID string, verID int, os, arch string) string

func (*StorageLogic) BuildVersionResourceStoragePath added in v0.3.0

func (l *StorageLogic) BuildVersionResourceStoragePath(resID string, verID int, os, arch, filename string) string

func (*StorageLogic) BuildVersionStorageDirPath added in v0.3.0

func (l *StorageLogic) BuildVersionStorageDirPath(resID string, verID int, os, arch string) string

func (*StorageLogic) CheckStorageExist added in v0.3.0

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

func (*StorageLogic) ClearOldStorages added in v0.3.1

func (l *StorageLogic) ClearOldStorages(ctx context.Context) error

func (*StorageLogic) CreateFullUpdateStorage added in v0.3.0

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

func (*StorageLogic) CreateIncrementalUpdateStorage added in v0.3.0

func (l *StorageLogic) CreateIncrementalUpdateStorage(ctx context.Context, tx *ent.Tx,
	target, current int, filetype string, filesize int64,
	os, arch, path, hashes string,
) (*ent.Storage, error)

func (*StorageLogic) GetFullUpdateStorage added in v0.3.0

func (l *StorageLogic) GetFullUpdateStorage(ctx context.Context, versionId int, os, arch string) (*ent.Storage, error)

func (*StorageLogic) GetIncrementalUpdateStorage added in v0.4.0

func (l *StorageLogic) GetIncrementalUpdateStorage(ctx context.Context, targerVerID, currentVerID int, os, arch string) (*ent.Storage, error)

func (*StorageLogic) UpdateStoragePackageHash added in v0.5.2

func (l *StorageLogic) UpdateStoragePackageHash(ctx context.Context, id int, hash string) error

type VersionLogic

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

func NewVersionLogic

func NewVersionLogic(
	logger *zap.Logger,
	repo *repo.Repo,
	versionRepo *repo.Version,
	rawQuery *repo.RawQuery,
	verComparator *vercomp.VersionComparator,
	distributeLogic *dispense.DistributeLogic,
	resourceLogic *ResourceLogic,
	storageLogic *StorageLogic,
	rdb *redis.Client,
	sync *redsync.Redsync,
	taskQueue *tasks.TaskQueue,
	cacheGroup *cache.MultiCacheGroup,
) *VersionLogic

func (*VersionLogic) CreatePreSignedUrl added in v0.5.0

func (l *VersionLogic) CreatePreSignedUrl(ctx context.Context, param CreateVersionParam) (*oss.SignaturePolicyToken, error)

func (*VersionLogic) CreateVersion added in v0.3.0

func (l *VersionLogic) CreateVersion(ctx context.Context, resourceId, channel, name string) (*ent.Version, error)

func (*VersionLogic) DoProcessStorage added in v0.5.2

func (l *VersionLogic) DoProcessStorage(ctx context.Context,
	resourceId string, versionId int,
	versionName, channel, system, arch, dest string,
	fileType types.FileType,
	hashes map[string]string,
) error

func (*VersionLogic) ExistNameWithOSAndArch added in v0.4.0

func (l *VersionLogic) ExistNameWithOSAndArch(ctx context.Context, param ExistVersionNameWithOSAndArchParam) (bool, error)

func (*VersionLogic) GenerateIncrementalPackage added in v0.5.0

func (l *VersionLogic) GenerateIncrementalPackage(ctx context.Context, resourceId string, target, current int, system, arch string) error

func (*VersionLogic) GetCacheGroup added in v0.3.0

func (l *VersionLogic) GetCacheGroup() *cache.MultiCacheGroup

func (*VersionLogic) GetDistributeLocation added in v0.4.1

func (l *VersionLogic) GetDistributeLocation(ctx context.Context, rk string) (string, error)

func (*VersionLogic) GetDistributeURL added in v0.4.1

func (l *VersionLogic) GetDistributeURL(info *DistributeInfo) (string, error)

func (*VersionLogic) GetMultiLatestVersionInfo added in v0.5.0

func (l *VersionLogic) GetMultiLatestVersionInfo(resourceId, os, arch, channel string) (*LatestVersionInfo, error)

func (*VersionLogic) GetRedisClient added in v0.4.0

func (l *VersionLogic) GetRedisClient() *redis.Client

func (*VersionLogic) GetUpdateInfo added in v0.3.0

func (l *VersionLogic) GetUpdateInfo(ctx context.Context, param UpdateRequestParam) (*UpdateInfo, error)

func (*VersionLogic) GetVersionByName added in v0.4.0

func (l *VersionLogic) GetVersionByName(ctx context.Context, param GetVersionByNameParam) (*ent.Version, error)

func (*VersionLogic) GetVersionChannel added in v0.3.0

func (l *VersionLogic) GetVersionChannel(channel string) version.Channel

func (*VersionLogic) GetVersionNumber added in v0.3.0

func (l *VersionLogic) GetVersionNumber(ctx context.Context, resID string) (uint64, error)

func (*VersionLogic) LoadStoreNewVersionTx added in v0.5.0

func (l *VersionLogic) LoadStoreNewVersionTx(ctx context.Context, resourceId, versionName, channel string) (*ent.Version, error)

func (*VersionLogic) ProcessCreateVersionCallback added in v0.5.0

func (l *VersionLogic) ProcessCreateVersionCallback(ctx context.Context, param CreateVersionCallBackParam) error

func (*VersionLogic) UpdateCustomData added in v0.4.0

func (l *VersionLogic) UpdateCustomData(ctx context.Context, param UpdateReleaseNoteSummaryParam) error

func (*VersionLogic) UpdateReleaseNote added in v0.4.0

func (l *VersionLogic) UpdateReleaseNote(ctx context.Context, param UpdateReleaseNoteDetailParam) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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