packer-cn/post-processor/yandex-import/artifact.go

46 lines
811 B
Go
Raw Normal View History

package yandeximport
import (
"fmt"
)
const BuilderId = "packer.post-processor.yandex-import"
type Artifact struct {
2020-07-21 18:01:30 -04:00
imageID string
sourceType string
sourceID string
// StateData should store data such as GeneratedData
// to be shared with post-processors
StateData map[string]interface{}
}
func (*Artifact) BuilderId() string {
return BuilderId
}
func (a *Artifact) Id() string {
2020-07-21 18:01:30 -04:00
return a.imageID
}
func (a *Artifact) Files() []string {
return nil
}
func (a *Artifact) String() string {
2020-07-21 18:01:30 -04:00
return fmt.Sprintf("Create image %v from source type %v with ID/URL %v", a.imageID, a.sourceType, a.sourceID)
}
2020-07-21 18:01:30 -04:00
func (a *Artifact) State(name string) interface{} {
if _, ok := a.StateData[name]; ok {
return a.StateData[name]
}
return nil
}
func (a *Artifact) Destroy() error {
return nil
}