Define a generic Artifact object for now

This commit is contained in:
Ettore Di Giacinto 2019-11-08 19:57:04 +01:00
parent b2d305bb8d
commit 4ea8f26878
No known key found for this signature in database
GPG Key ID: 1ADA699B145A2D1C
2 changed files with 21 additions and 2 deletions

View File

@ -15,4 +15,23 @@
package compiler
type Artifact struct{}
type Artifact interface {
GetPath() string
SetPath(string)
}
type PackageArtifact struct {
Path string
}
func NewPackageArtifact(path string) Artifact {
return &PackageArtifact{Path: path}
}
func (a *PackageArtifact) GetPath() string {
return a.Path
}
func (a *PackageArtifact) SetPath(p string) {
a.Path = p
}

View File

@ -41,7 +41,7 @@ func NewLuetCompiler(backend CompilerBackend, t pkg.Tree) Compiler {
}
}
func (cs *LuetCompiler) Compile(p CompilationSpec) (*Artifact, error) {
func (cs *LuetCompiler) Compile(p CompilationSpec) (Artifact, error) {
// - If image is not set, we read a base_image. Then we will build one image from it to kick-off our build based
// on how we compute the resolvable tree.