debian-forge-composer/internal/target/vmware_target.go
Tomas Hozza 93fd5e3821 target: ensure that each used target has NewXXXTargetResult defined
Ensure that `UnmarshalTargetResultOptions()` is called only when there
are any options to unmarshal in the JSON object.

Since results of some Targets don't have any options defined, mark
`TargetResult.Options` as optional in the JSON tag.
2022-07-01 18:55:01 +01:00

23 lines
620 B
Go

package target
const TargetNameVMWare TargetName = "org.osbuild.vmware"
type VMWareTargetOptions struct {
Filename string `json:"filename"`
Host string `json:"host"`
Username string `json:"username"`
Password string `json:"password"`
Datacenter string `json:"datacenter"`
Cluster string `json:"cluster"`
Datastore string `json:"datastore"`
}
func (VMWareTargetOptions) isTargetOptions() {}
func NewVMWareTarget(options *VMWareTargetOptions) *Target {
return newTarget(TargetNameVMWare, options)
}
func NewVMWareTargetResult() *TargetResult {
return newTargetResult(TargetNameVMWare, nil)
}