packer-cn/builder/oneandone/artifact.go

42 lines
727 B
Go
Raw Normal View History

2016-11-13 17:34:36 -05:00
package oneandone
import (
"fmt"
)
type Artifact struct {
snapshotId string
snapshotName string
// StateData should store data such as GeneratedData
// to be shared with post-processors
StateData map[string]interface{}
2016-11-13 17:34:36 -05:00
}
func (*Artifact) BuilderId() string {
return BuilderId
}
func (a *Artifact) Files() []string {
return []string{}
}
func (*Artifact) Id() string {
return "Null"
}
func (a *Artifact) String() string {
2016-11-15 18:17:30 -05:00
if a.snapshotId == "" {
return "No image has been created."
}
2016-11-13 17:34:36 -05:00
return fmt.Sprintf("A snapshot was created: '%v', '%v'", a.snapshotId, a.snapshotName)
}
func (a *Artifact) State(name string) interface{} {
return a.StateData[name]
2016-11-13 17:34:36 -05:00
}
func (a *Artifact) Destroy() error {
return nil
}