logic

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2025 License: AGPL-3.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LatestVersionLogic added in v0.3.0

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

func NewLatestVersionLogic added in v0.3.0

func NewLatestVersionLogic(
	logger *zap.Logger,
	latestVersionRepo *repo.LatestVersion,
	verComparator *vercomp.VersionComparator,
) *LatestVersionLogic

func (*LatestVersionLogic) GetLatestAlphaVersion added in v0.3.0

func (l *LatestVersionLogic) GetLatestAlphaVersion(ctx context.Context, resID string) (*ent.Version, error)

func (*LatestVersionLogic) GetLatestBetaVersion added in v0.3.0

func (l *LatestVersionLogic) GetLatestBetaVersion(ctx context.Context, resID string) (*ent.Version, error)

func (*LatestVersionLogic) GetLatestStableVersion added in v0.3.0

func (l *LatestVersionLogic) GetLatestStableVersion(ctx context.Context, resID string) (*ent.Version, error)

func (*LatestVersionLogic) UpdateLatestVersion added in v0.3.0

func (l *LatestVersionLogic) UpdateLatestVersion(ctx context.Context, tx *ent.Tx, resID string, channel latestversion.Channel, ver *ent.Version) error

type ResourceLogic

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

func NewResourceLogic

func NewResourceLogic(logger *zap.Logger, resourceRepo *repo.Resource) *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)

type StorageLogic

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

func NewStorageLogic

func NewStorageLogic(logger *zap.Logger, storageRepo *repo.Storage) *StorageLogic

func (*StorageLogic) BuildVersionPatchStorageDirPath added in v0.3.0

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

func (*StorageLogic) BuildVersionPatchStoragePath added in v0.3.0

func (l *StorageLogic) BuildVersionPatchStoragePath(resID string, verID, oldVerID 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 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, resID string, channel version.Channel, latestVerID int) error

func (*StorageLogic) CreateFullUpdateStorage added in v0.3.0

func (l *StorageLogic) CreateFullUpdateStorage(ctx context.Context, tx *ent.Tx, verID int, os, arch, fullUpdatePath, packageSHA256, resourcePath string, 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, os, arch, incrementalUpdatePath, packageSHA256 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) SetPackageSHA256 added in v0.4.0

func (l *StorageLogic) SetPackageSHA256(ctx context.Context, storageID int, sha256 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,
	storageRepo *repo.Storage,
	latestVersionLogic *LatestVersionLogic,
	storageLogic *StorageLogic,
	rdb *redis.Client,
	sync *redsync.Redsync,
	cacheGroup *cache.VersionCacheGroup,
	distributeLogic *dispense.DistributeLogic,
) *VersionLogic

func (*VersionLogic) Create

func (l *VersionLogic) Create(ctx context.Context, param CreateVersionParam) (*ent.Version, error)

func (*VersionLogic) CreateIncrementalUpdatePackage added in v0.3.0

func (l *VersionLogic) CreateIncrementalUpdatePackage(ctx context.Context, info ActualUpdateProcessInfo) (UpdatePackage, error)

func (*VersionLogic) CreateVersion added in v0.3.0

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

func (*VersionLogic) ExistNameWithOSAndArch added in v0.4.0

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

func (*VersionLogic) GetCacheGroup added in v0.3.0

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

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) GetIncrementalUpdatePackage added in v0.4.0

func (l *VersionLogic) GetIncrementalUpdatePackage(ctx context.Context, info ActualUpdateProcessInfo) (UpdatePackage, error)

func (*VersionLogic) GetLatestAlphaVersion added in v0.3.0

func (l *VersionLogic) GetLatestAlphaVersion(ctx context.Context, resID string) (*ent.Version, error)

func (*VersionLogic) GetLatestBetaVersion added in v0.3.0

func (l *VersionLogic) GetLatestBetaVersion(ctx context.Context, resID string) (*ent.Version, error)

func (*VersionLogic) GetLatestStableVersion added in v0.3.0

func (l *VersionLogic) GetLatestStableVersion(ctx context.Context, resID string) (*ent.Version, 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 ProcessUpdateParam) (*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) StorePatchInfo added in v0.3.0

func (l *VersionLogic) StorePatchInfo(ctx context.Context, cacheKey string, p UpdatePackage, e string) 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