usecase

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2020 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewVersionCompatQueryResult

func NewVersionCompatQueryResult(config VersionCompatQueryResultConfig) *versionCompatQueryResult

Types

type Branch

type Branch interface {
	CreateBranch(branchName []byte) (*code_push.Branch, error)
	GetBranch(branchId []byte) (*code_push.Branch, error)
	DeleteBranch(branchId []byte) error
	GetBranchEncToken(branchId []byte) ([]byte, error)
}

type CtorConfig

type CtorConfig struct {
	DomainAdapter
	Logger log.Logger
}

type DomainAdapter

type DomainAdapter interface {
	Branch(branchId []byte) (*code_push.Branch, error)
	CreateBranch(branch *code_push.Branch) error
	DeleteBranch(branchId []byte) error
	IsBranchAvailable(branchId []byte) bool
	IsBranchNameExisted(branchName []byte) (bool, error)

	Env(envId []byte) (*code_push.Env, error)
	CreateEnv(env *code_push.Env) error
	DeleteEnv(envId []byte) error
	IsEnvAvailable(envId []byte) bool
	IsEnvNameExisted(branchId, envName []byte) (bool, error)

	Version(envId, appVersion []byte) (*code_push.Version, error)
	VersionsWithEnvId(envId []byte) (code_push.VersionList, error)
	CreateVersion(version *code_push.Version) error
	IsVersionAvailable(envId, appVersion []byte) (bool, error)
}

type Env

type Env interface {
	CreateEnv(branchId, envName []byte) (*code_push.Env, error)
	GetEnv(envId []byte) (*code_push.Env, error)
	DeleteEnv(envId []byte) error
	GetEnvEncToken(envId []byte) ([]byte, error)
}

type EnvVersionCollection

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

func NewEnvVersionCollection

func NewEnvVersionCollection(config EnvVersionCollectionConfig) (*EnvVersionCollection, error)

func (*EnvVersionCollection) GetVersion

func (e *EnvVersionCollection) GetVersion(appVersion *semver.SemVer) (*code_push.Version, error)

func (*EnvVersionCollection) ListVersions

func (e *EnvVersionCollection) ListVersions() (code_push.VersionList, error)

func (*EnvVersionCollection) ReleaseVersion

func (e *EnvVersionCollection) ReleaseVersion(params VersionReleaseParams) error

func (*EnvVersionCollection) VersionStrictCompatQuery

func (e *EnvVersionCollection) VersionStrictCompatQuery(appVersion *semver.SemVer) (VersionCompatQueryResult, error)

type EnvVersionCollectionConfig

type EnvVersionCollectionConfig struct {
	EnvId         []byte
	DomainAdapter DomainAdapter
}

type UseCase

type UseCase interface {
	Branch
	Env
	Version
}

func NewUseCase

func NewUseCase(config CtorConfig) UseCase

type Version

type Version interface {
	ReleaseVersion(params VersionReleaseParams) error
	GetVersion(envId, appVersion []byte) (*code_push.Version, error)
	ListVersions(envId []byte) (code_push.VersionList, error)
	VersionStrictCompatQuery(envId, appVersion []byte) (VersionCompatQueryResult, error)
}

type VersionCompatQueryResult

type VersionCompatQueryResult interface {
	AppVersion() []byte
	LatestAppVersion() []byte
	CanUpdateAppVersion() []byte
	MustUpdate() bool
}

type VersionCompatQueryResultConfig

type VersionCompatQueryResultConfig struct {
	AppVersion          *semver.SemVer
	LatestAppVersion    *semver.SemVer
	CanUpdateAppVersion *semver.SemVer
	MustUpdate          bool
}

type VersionReleaseParams

type VersionReleaseParams interface {
	EnvId() []byte
	AppVersion() []byte
	CompatAppVersion() []byte
	Changelog() []byte
	PackageFileKey() []byte
	MustUpdate() bool
}

Jump to

Keyboard shortcuts

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