Documentation
¶
Index ¶
- Constants
- Variables
- type Constraint
- func (c *Constraint) AddRange(lowerBound Version, upperBound Version, lowerInclusive bool, ...)
- func (c Constraint) Contains(other Version) bool
- func (c Constraint) Difference(other Constraint) Constraint
- func (c Constraint) Encode() (string, error)
- func (c Constraint) Equal(other Constraint) bool
- func (c Constraint) FilterAndSort(versions []Version) []Version
- func (c Constraint) Intersect(other Constraint) Constraint
- func (c Constraint) Inverse() Constraint
- func (c Constraint) IsAny() bool
- func (c Constraint) IsEmpty() bool
- func (c Constraint) String() string
- func (c Constraint) Union(other Constraint) Constraint
- type ConstraintString
- type EnvSpec
- type Repo
- type SpecSheet
- type SpecSheetString
- type Version
- type VersionRange
- type VersionRangeString
Constants ¶
View Source
const FILETYPE_COMPRESS string = "application/gzip"
View Source
const FILETYPE_RAW string = "application/octet-stream"
View Source
const REPO_APT = "Apt"
View Source
const REPO_CLOSURE = "Closure"
View Source
const REPO_DOCKERHUB = "DockerHub"
View Source
const REPO_HUGGINGFACE = "HuggingFace"
View Source
const REPO_K8S = "k8s"
View Source
const REPO_PREFAB = "Prefab"
View Source
const REPO_PYPI = "PyPI"
Variables ¶
View Source
var AnyConstraint = Constraint{ Ranges: []VersionRange{{ LowerBound: nil, UpperBound: nil, LowerInclusive: false, UpperInclusive: false, }}, Raw: "any", }
Functions ¶
This section is empty.
Types ¶
type Constraint ¶ added in v0.2.2
type Constraint struct {
RepoType string
Ranges []VersionRange
Raw string
}
func NewConstraintFromVersionSubset ¶ added in v0.2.2
func NewConstraintFromVersionSubset(versions []Version, allVersions []Version) (c Constraint)
NewConstraintFromVersionSubset returns a minimal constraint that matches exactly the given versions out of the given set of all versions. Both slices must be sorted in ascending order
func SingleVersionConstraint ¶ added in v0.2.2
func SingleVersionConstraint(v Version) (c Constraint)
func (*Constraint) AddRange ¶ added in v0.2.2
func (c *Constraint) AddRange(lowerBound Version, upperBound Version, lowerInclusive bool, upperInclusive bool)
func (Constraint) Contains ¶ added in v0.2.2
func (c Constraint) Contains(other Version) bool
func (Constraint) Difference ¶ added in v0.2.2
func (c Constraint) Difference(other Constraint) Constraint
func (Constraint) Encode ¶ added in v0.2.2
func (c Constraint) Encode() (string, error)
func (Constraint) Equal ¶ added in v0.2.2
func (c Constraint) Equal(other Constraint) bool
func (Constraint) FilterAndSort ¶ added in v0.2.2
func (c Constraint) FilterAndSort(versions []Version) []Version
func (Constraint) Intersect ¶ added in v0.2.2
func (c Constraint) Intersect(other Constraint) Constraint
func (Constraint) Inverse ¶ added in v0.2.2
func (c Constraint) Inverse() Constraint
func (Constraint) IsAny ¶ added in v0.2.2
func (c Constraint) IsAny() bool
func (Constraint) IsEmpty ¶ added in v0.2.2
func (c Constraint) IsEmpty() bool
func (Constraint) String ¶ added in v0.2.2
func (c Constraint) String() string
func (Constraint) Union ¶ added in v0.2.2
func (c Constraint) Union(other Constraint) Constraint
type ConstraintString ¶ added in v0.2.2
type ConstraintString struct {
RepoType string `json:"repo_type"`
Ranges []VersionRangeString `json:"ranges"`
Raw string `json:"raw"`
}
type Repo ¶
type Repo interface {
// init repository parameters by deployment context
Init(context *dcontext.DeployContext) (err error)
// generate a Environemnt SpecSheet by repository parametes and the given name & specifier
// Should Init() the Repo before calling this function
GetEnvSpec() EnvSpec
// Finding 0 version is not an error, should return []Version{} and nil
// This function MUST NOT rely on deployment context
GetVersions(name string) (versions []Version, err error)
SelectVersion(versions []Version) (selected Version, err error)
// Finding 0 environment is not an error, should return []string{} and nil
// This function MUST NOT rely on deployment context
GetEnvs(name string, version Version) (envs []string, err error)
SelectEnv(envs []string, envSpec EnvSpec) (selected string, err error)
FilterEnv(envs []string) (selected []string)
// fabricate a prefab according to a SpecSheet, then save the prefab and blueprint to dstDir
// and return the path to prefab and blueprint
// This function MUST NOT rely on deployment context
Fabricate(name string, version Version, envs []string, dstDir string) (prefabPaths []string, blueprintPaths []string, fileType string, err error)
}
type SpecSheet ¶
type SpecSheetString ¶ added in v0.2.2
type SpecSheetString struct {
Type string
Name string
Version string
Env string
Specifier string
EnvSpec string
}
func (*SpecSheetString) Decode ¶ added in v0.2.2
func (s *SpecSheetString) Decode(raw []byte) error
func (*SpecSheetString) Encode ¶ added in v0.2.2
func (s *SpecSheetString) Encode() []byte
Click to show internal directories.
Click to hide internal directories.