代码拉取完成,页面将自动刷新
package todos
// 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-swagger/go-swagger/client"
"github.com/go-swagger/go-swagger/strfmt"
)
// New creates a new todos API client.
func New(transport client.Transport, formats strfmt.Registry) *Client {
return &Client{transport: transport, formats: formats}
}
/*
Client for todos API
*/
type Client struct {
transport client.Transport
formats strfmt.Registry
}
/*AddOne add one API
*/
func (a *Client) AddOne(params AddOneParams, authInfo client.AuthInfoWriter) (*AddOneCreated, error) {
// TODO: Validate the params before sending
result, err := a.transport.Submit(&client.Operation{
ID: "addOne",
Params: ¶ms,
Reader: &AddOneReader{formats: a.formats},
AuthInfo: authInfo,
})
if err != nil {
return nil, err
}
return result.(*AddOneCreated), nil
}
/*DestroyOne destroy one API
*/
func (a *Client) DestroyOne(params DestroyOneParams, authInfo client.AuthInfoWriter) (*DestroyOneNoContent, error) {
// TODO: Validate the params before sending
result, err := a.transport.Submit(&client.Operation{
ID: "destroyOne",
Params: ¶ms,
Reader: &DestroyOneReader{formats: a.formats},
AuthInfo: authInfo,
})
if err != nil {
return nil, err
}
return result.(*DestroyOneNoContent), nil
}
/*Find find API
*/
func (a *Client) Find(params FindParams, authInfo client.AuthInfoWriter) (*FindOK, error) {
// TODO: Validate the params before sending
result, err := a.transport.Submit(&client.Operation{
ID: "find",
Params: ¶ms,
Reader: &FindReader{formats: a.formats},
AuthInfo: authInfo,
})
if err != nil {
return nil, err
}
return result.(*FindOK), nil
}
/*UpdateOne update one API
*/
func (a *Client) UpdateOne(params UpdateOneParams, authInfo client.AuthInfoWriter) (*UpdateOneOK, error) {
// TODO: Validate the params before sending
result, err := a.transport.Submit(&client.Operation{
ID: "updateOne",
Params: ¶ms,
Reader: &UpdateOneReader{formats: a.formats},
AuthInfo: authInfo,
})
if err != nil {
return nil, err
}
return result.(*UpdateOneOK), nil
}
// SetTransport changes the transport on the client
func (a *Client) SetTransport(transport client.Transport) {
a.transport = transport
}
// NewAPIError creates a new API error
func NewAPIError(opName string, response interface{}, code int) APIError {
return APIError{
OperationName: opName,
Response: response,
Code: code,
}
}
// APIError wraps an error model and captures the status code
type APIError struct {
OperationName string
Response interface{}
Code int
}
func (a APIError) Error() string {
return fmt.Sprintf("%s (status %d): %+v ", a.OperationName, a.Code, a.Response)
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。