1 Star 0 Fork 0

nanjo_fan / goharbor-client

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
search_result.go 1.56 KB
一键复制 编辑 原始数据 按行查看 历史
王帆 提交于 2023-02-13 08:49 . first commit
// Code generated by go-swagger; DO NOT EDIT.
package model
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// SearchResult The chart search result item
//
// swagger:model SearchResult
type SearchResult struct {
// chart
Chart *ChartVersion `json:"Chart,omitempty"`
// The chart name with repo name
Name string `json:"Name,omitempty"`
// The matched level
Score int64 `json:"Score,omitempty"`
}
// Validate validates this search result
func (m *SearchResult) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateChart(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *SearchResult) validateChart(formats strfmt.Registry) error {
if swag.IsZero(m.Chart) { // not required
return nil
}
if m.Chart != nil {
if err := m.Chart.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("Chart")
}
return err
}
}
return nil
}
// MarshalBinary interface implementation
func (m *SearchResult) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *SearchResult) UnmarshalBinary(b []byte) error {
var res SearchResult
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/nanjo-fan/goharbor-client.git
git@gitee.com:nanjo-fan/goharbor-client.git
nanjo-fan
goharbor-client
goharbor-client
v1.0.3

搜索帮助

344bd9b3 5694891 D2dac590 5694891