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.
23 lines
602 B
Go
23 lines
602 B
Go
package target
|
|
|
|
const TargetNameContainer TargetName = "org.osbuild.container"
|
|
|
|
type ContainerTargetOptions struct {
|
|
Filename string `json:"filename"`
|
|
Reference string `json:"reference"`
|
|
|
|
Username string `json:"username,omitempty"`
|
|
Password string `json:"password,omitempty"`
|
|
|
|
TlsVerify *bool `json:"tls_verify,omitempty"`
|
|
}
|
|
|
|
func (ContainerTargetOptions) isTargetOptions() {}
|
|
|
|
func NewContainerTarget(options *ContainerTargetOptions) *Target {
|
|
return newTarget(TargetNameContainer, options)
|
|
}
|
|
|
|
func NewContainerTargetResult() *TargetResult {
|
|
return newTargetResult(TargetNameContainer, nil)
|
|
}
|