github.com/kata-containers/runtime@v0.0.0-20210505125100-04f29832a923/virtcontainers/pkg/firecracker/client/models/boot_source.go (about) 1 // Code generated by go-swagger; DO NOT EDIT. 2 3 package models 4 5 // This file was generated by the swagger tool. 6 // Editing this file might prove futile when you re-run the swagger generate command 7 8 import ( 9 strfmt "github.com/go-openapi/strfmt" 10 11 "github.com/go-openapi/errors" 12 "github.com/go-openapi/swag" 13 "github.com/go-openapi/validate" 14 ) 15 16 // BootSource Boot source descriptor. 17 // swagger:model BootSource 18 type BootSource struct { 19 20 // Kernel boot arguments 21 BootArgs string `json:"boot_args,omitempty"` 22 23 // Host level path to the initrd image used to boot the guest 24 InitrdPath string `json:"initrd_path,omitempty"` 25 26 // Host level path to the kernel image used to boot the guest 27 // Required: true 28 KernelImagePath *string `json:"kernel_image_path"` 29 } 30 31 // Validate validates this boot source 32 func (m *BootSource) Validate(formats strfmt.Registry) error { 33 var res []error 34 35 if err := m.validateKernelImagePath(formats); err != nil { 36 res = append(res, err) 37 } 38 39 if len(res) > 0 { 40 return errors.CompositeValidationError(res...) 41 } 42 return nil 43 } 44 45 func (m *BootSource) validateKernelImagePath(formats strfmt.Registry) error { 46 47 if err := validate.Required("kernel_image_path", "body", m.KernelImagePath); err != nil { 48 return err 49 } 50 51 return nil 52 } 53 54 // MarshalBinary interface implementation 55 func (m *BootSource) MarshalBinary() ([]byte, error) { 56 if m == nil { 57 return nil, nil 58 } 59 return swag.WriteJSON(m) 60 } 61 62 // UnmarshalBinary interface implementation 63 func (m *BootSource) UnmarshalBinary(b []byte) error { 64 var res BootSource 65 if err := swag.ReadJSON(b, &res); err != nil { 66 return err 67 } 68 *m = res 69 return nil 70 }