1 Star 0 Fork 0

pengchengduan / goharbor-client

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
registry_client.go 13.52 KB
一键复制 编辑 原始数据 按行查看 历史
pengchengduan 提交于 2024-02-01 17:28 . first commit
// Code generated by go-swagger; DO NOT EDIT.
package registry
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"fmt"
"github.com/go-openapi/runtime"
"github.com/go-openapi/strfmt"
)
// New creates a new registry API client.
func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService {
return &Client{transport: transport, formats: formats}
}
/*
Client for registry API
*/
type Client struct {
transport runtime.ClientTransport
formats strfmt.Registry
}
// ClientService is the interface for Client methods
type ClientService interface {
CreateRegistry(params *CreateRegistryParams, authInfo runtime.ClientAuthInfoWriter) (*CreateRegistryCreated, error)
DeleteRegistry(params *DeleteRegistryParams, authInfo runtime.ClientAuthInfoWriter) (*DeleteRegistryOK, error)
GetRegistry(params *GetRegistryParams, authInfo runtime.ClientAuthInfoWriter) (*GetRegistryOK, error)
GetRegistryInfo(params *GetRegistryInfoParams, authInfo runtime.ClientAuthInfoWriter) (*GetRegistryInfoOK, error)
ListRegistries(params *ListRegistriesParams, authInfo runtime.ClientAuthInfoWriter) (*ListRegistriesOK, error)
ListRegistryProviderInfos(params *ListRegistryProviderInfosParams, authInfo runtime.ClientAuthInfoWriter) (*ListRegistryProviderInfosOK, error)
ListRegistryProviderTypes(params *ListRegistryProviderTypesParams, authInfo runtime.ClientAuthInfoWriter) (*ListRegistryProviderTypesOK, error)
PingRegistry(params *PingRegistryParams, authInfo runtime.ClientAuthInfoWriter) (*PingRegistryOK, error)
UpdateRegistry(params *UpdateRegistryParams, authInfo runtime.ClientAuthInfoWriter) (*UpdateRegistryOK, error)
SetTransport(transport runtime.ClientTransport)
}
/*
CreateRegistry creates a registry
Create a registry
*/
func (a *Client) CreateRegistry(params *CreateRegistryParams, authInfo runtime.ClientAuthInfoWriter) (*CreateRegistryCreated, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewCreateRegistryParams()
}
result, err := a.transport.Submit(&runtime.ClientOperation{
ID: "createRegistry",
Method: "POST",
PathPattern: "/registries",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"http", "https"},
Params: params,
Reader: &CreateRegistryReader{formats: a.formats},
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
})
if err != nil {
return nil, err
}
success, ok := result.(*CreateRegistryCreated)
if ok {
return success, nil
}
// unexpected success response
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for createRegistry: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
DeleteRegistry deletes the specific registry
Delete the specific registry
*/
func (a *Client) DeleteRegistry(params *DeleteRegistryParams, authInfo runtime.ClientAuthInfoWriter) (*DeleteRegistryOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewDeleteRegistryParams()
}
result, err := a.transport.Submit(&runtime.ClientOperation{
ID: "deleteRegistry",
Method: "DELETE",
PathPattern: "/registries/{id}",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"http", "https"},
Params: params,
Reader: &DeleteRegistryReader{formats: a.formats},
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
})
if err != nil {
return nil, err
}
success, ok := result.(*DeleteRegistryOK)
if ok {
return success, nil
}
// unexpected success response
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for deleteRegistry: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
GetRegistry gets the specific registry
Get the specific registry
*/
func (a *Client) GetRegistry(params *GetRegistryParams, authInfo runtime.ClientAuthInfoWriter) (*GetRegistryOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewGetRegistryParams()
}
result, err := a.transport.Submit(&runtime.ClientOperation{
ID: "getRegistry",
Method: "GET",
PathPattern: "/registries/{id}",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"http", "https"},
Params: params,
Reader: &GetRegistryReader{formats: a.formats},
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
})
if err != nil {
return nil, err
}
success, ok := result.(*GetRegistryOK)
if ok {
return success, nil
}
// unexpected success response
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for getRegistry: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
GetRegistryInfo gets the registry info
Get the registry info
*/
func (a *Client) GetRegistryInfo(params *GetRegistryInfoParams, authInfo runtime.ClientAuthInfoWriter) (*GetRegistryInfoOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewGetRegistryInfoParams()
}
result, err := a.transport.Submit(&runtime.ClientOperation{
ID: "getRegistryInfo",
Method: "GET",
PathPattern: "/registries/{id}/info",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"http", "https"},
Params: params,
Reader: &GetRegistryInfoReader{formats: a.formats},
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
})
if err != nil {
return nil, err
}
success, ok := result.(*GetRegistryInfoOK)
if ok {
return success, nil
}
// unexpected success response
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for getRegistryInfo: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
ListRegistries lists the registries
List the registries
*/
func (a *Client) ListRegistries(params *ListRegistriesParams, authInfo runtime.ClientAuthInfoWriter) (*ListRegistriesOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewListRegistriesParams()
}
result, err := a.transport.Submit(&runtime.ClientOperation{
ID: "listRegistries",
Method: "GET",
PathPattern: "/registries",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"http", "https"},
Params: params,
Reader: &ListRegistriesReader{formats: a.formats},
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
})
if err != nil {
return nil, err
}
success, ok := result.(*ListRegistriesOK)
if ok {
return success, nil
}
// unexpected success response
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for listRegistries: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
ListRegistryProviderInfos lists all registered registry provider information
List all registered registry provider information
*/
func (a *Client) ListRegistryProviderInfos(params *ListRegistryProviderInfosParams, authInfo runtime.ClientAuthInfoWriter) (*ListRegistryProviderInfosOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewListRegistryProviderInfosParams()
}
result, err := a.transport.Submit(&runtime.ClientOperation{
ID: "listRegistryProviderInfos",
Method: "GET",
PathPattern: "/replication/adapterinfos",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"http", "https"},
Params: params,
Reader: &ListRegistryProviderInfosReader{formats: a.formats},
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
})
if err != nil {
return nil, err
}
success, ok := result.(*ListRegistryProviderInfosOK)
if ok {
return success, nil
}
// unexpected success response
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for listRegistryProviderInfos: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
ListRegistryProviderTypes lists registry adapters
List registry adapters
*/
func (a *Client) ListRegistryProviderTypes(params *ListRegistryProviderTypesParams, authInfo runtime.ClientAuthInfoWriter) (*ListRegistryProviderTypesOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewListRegistryProviderTypesParams()
}
result, err := a.transport.Submit(&runtime.ClientOperation{
ID: "listRegistryProviderTypes",
Method: "GET",
PathPattern: "/replication/adapters",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"http", "https"},
Params: params,
Reader: &ListRegistryProviderTypesReader{formats: a.formats},
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
})
if err != nil {
return nil, err
}
success, ok := result.(*ListRegistryProviderTypesOK)
if ok {
return success, nil
}
// unexpected success response
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for listRegistryProviderTypes: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
PingRegistry checks status of a registry
Check status of a registry
*/
func (a *Client) PingRegistry(params *PingRegistryParams, authInfo runtime.ClientAuthInfoWriter) (*PingRegistryOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewPingRegistryParams()
}
result, err := a.transport.Submit(&runtime.ClientOperation{
ID: "pingRegistry",
Method: "POST",
PathPattern: "/registries/ping",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"http", "https"},
Params: params,
Reader: &PingRegistryReader{formats: a.formats},
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
})
if err != nil {
return nil, err
}
success, ok := result.(*PingRegistryOK)
if ok {
return success, nil
}
// unexpected success response
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for pingRegistry: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
UpdateRegistry updates the registry
Update the registry
*/
func (a *Client) UpdateRegistry(params *UpdateRegistryParams, authInfo runtime.ClientAuthInfoWriter) (*UpdateRegistryOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewUpdateRegistryParams()
}
result, err := a.transport.Submit(&runtime.ClientOperation{
ID: "updateRegistry",
Method: "PUT",
PathPattern: "/registries/{id}",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"http", "https"},
Params: params,
Reader: &UpdateRegistryReader{formats: a.formats},
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
})
if err != nil {
return nil, err
}
success, ok := result.(*UpdateRegistryOK)
if ok {
return success, nil
}
// unexpected success response
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for updateRegistry: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
// SetTransport changes the transport on the client
func (a *Client) SetTransport(transport runtime.ClientTransport) {
a.transport = transport
}
1
https://gitee.com/pengchengduan/goharbor-client.git
git@gitee.com:pengchengduan/goharbor-client.git
pengchengduan
goharbor-client
goharbor-client
41c6882efe91

搜索帮助