1 Star 0 Fork 0

pengchengduan / goharbor-client

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
general_info.go 3.56 KB
一键复制 编辑 原始数据 按行查看 历史
pengchengduan 提交于 2024-02-01 17:28 . 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"
"github.com/go-openapi/validate"
)
// GeneralInfo general info
//
// swagger:model GeneralInfo
type GeneralInfo struct {
// The auth mode of current Harbor instance.
AuthMode *string `json:"auth_mode,omitempty"`
// The setting of auth proxy this is only available when Harbor relies on authproxy for authentication.
AuthproxySettings *AuthproxySetting `json:"authproxy_settings,omitempty"`
// The current time of the server.
// Format: date-time
CurrentTime *strfmt.DateTime `json:"current_time,omitempty"`
// The external URL of Harbor, with protocol.
ExternalURL *string `json:"external_url,omitempty"`
// The build version of Harbor.
HarborVersion *string `json:"harbor_version,omitempty"`
// Indicate whether there is a ca root cert file ready for download in the file system.
HasCaRoot *bool `json:"has_ca_root,omitempty"`
// The flag to indicate whether notification mechanism is enabled on Harbor instance.
NotificationEnable *bool `json:"notification_enable,omitempty"`
// Indicate who can create projects, it could be 'adminonly' or 'everyone'.
ProjectCreationRestriction *string `json:"project_creation_restriction,omitempty"`
// The flag to indicate whether Harbor is in readonly mode.
ReadOnly *bool `json:"read_only,omitempty"`
// The storage provider's name of Harbor registry
RegistryStorageProviderName *string `json:"registry_storage_provider_name,omitempty"`
// The url of registry against which the docker command should be issued.
RegistryURL *string `json:"registry_url,omitempty"`
// Indicate whether the Harbor instance enable user to register himself.
SelfRegistration *bool `json:"self_registration,omitempty"`
// If the Harbor instance is deployed with nested chartmuseum.
WithChartmuseum *bool `json:"with_chartmuseum,omitempty"`
// If the Harbor instance is deployed with nested notary.
WithNotary *bool `json:"with_notary,omitempty"`
}
// Validate validates this general info
func (m *GeneralInfo) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateAuthproxySettings(formats); err != nil {
res = append(res, err)
}
if err := m.validateCurrentTime(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *GeneralInfo) validateAuthproxySettings(formats strfmt.Registry) error {
if swag.IsZero(m.AuthproxySettings) { // not required
return nil
}
if m.AuthproxySettings != nil {
if err := m.AuthproxySettings.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("authproxy_settings")
}
return err
}
}
return nil
}
func (m *GeneralInfo) validateCurrentTime(formats strfmt.Registry) error {
if swag.IsZero(m.CurrentTime) { // not required
return nil
}
if err := validate.FormatOf("current_time", "body", "date-time", m.CurrentTime.String(), formats); err != nil {
return err
}
return nil
}
// MarshalBinary interface implementation
func (m *GeneralInfo) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *GeneralInfo) UnmarshalBinary(b []byte) error {
var res GeneralInfo
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}
1
https://gitee.com/pengchengduan/goharbor-client.git
git@gitee.com:pengchengduan/goharbor-client.git
pengchengduan
goharbor-client
goharbor-client
41c6882efe91

搜索帮助