1 Star 1 Fork 0

FlexLB / flexlb-client-go

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
readyz_parameters.go 3.88 KB
一键复制 编辑 原始数据 按行查看 历史
王耀辉 提交于 2022-04-21 11:13 . add license
// Copyright (c) 2022 Yaohui Wang (yaohuiwang@outlook.com)
// FlexLB is licensed under Mulan PubL v2.
// You can use this software according to the terms and conditions of the Mulan PubL v2.
// You may obtain a copy of Mulan PubL v2 at:
// http://license.coscl.org.cn/MulanPubL-2.0
// THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
// EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
// MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
// See the Mulan PubL v2 for more details.
// Code generated by go-swagger; DO NOT EDIT.
package service
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"net/http"
"time"
"github.com/go-openapi/errors"
"github.com/go-openapi/runtime"
cr "github.com/go-openapi/runtime/client"
"github.com/go-openapi/strfmt"
)
// NewReadyzParams creates a new ReadyzParams object,
// with the default timeout for this client.
//
// Default values are not hydrated, since defaults are normally applied by the API server side.
//
// To enforce default values in parameter, use SetDefaults or WithDefaults.
func NewReadyzParams() *ReadyzParams {
return &ReadyzParams{
timeout: cr.DefaultTimeout,
}
}
// NewReadyzParamsWithTimeout creates a new ReadyzParams object
// with the ability to set a timeout on a request.
func NewReadyzParamsWithTimeout(timeout time.Duration) *ReadyzParams {
return &ReadyzParams{
timeout: timeout,
}
}
// NewReadyzParamsWithContext creates a new ReadyzParams object
// with the ability to set a context for a request.
func NewReadyzParamsWithContext(ctx context.Context) *ReadyzParams {
return &ReadyzParams{
Context: ctx,
}
}
// NewReadyzParamsWithHTTPClient creates a new ReadyzParams object
// with the ability to set a custom HTTPClient for a request.
func NewReadyzParamsWithHTTPClient(client *http.Client) *ReadyzParams {
return &ReadyzParams{
HTTPClient: client,
}
}
/* ReadyzParams contains all the parameters to send to the API endpoint
for the readyz operation.
Typically these are written to a http.Request.
*/
type ReadyzParams struct {
timeout time.Duration
Context context.Context
HTTPClient *http.Client
}
// WithDefaults hydrates default values in the readyz params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *ReadyzParams) WithDefaults() *ReadyzParams {
o.SetDefaults()
return o
}
// SetDefaults hydrates default values in the readyz params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *ReadyzParams) SetDefaults() {
// no default values defined for this parameter
}
// WithTimeout adds the timeout to the readyz params
func (o *ReadyzParams) WithTimeout(timeout time.Duration) *ReadyzParams {
o.SetTimeout(timeout)
return o
}
// SetTimeout adds the timeout to the readyz params
func (o *ReadyzParams) SetTimeout(timeout time.Duration) {
o.timeout = timeout
}
// WithContext adds the context to the readyz params
func (o *ReadyzParams) WithContext(ctx context.Context) *ReadyzParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the readyz params
func (o *ReadyzParams) SetContext(ctx context.Context) {
o.Context = ctx
}
// WithHTTPClient adds the HTTPClient to the readyz params
func (o *ReadyzParams) WithHTTPClient(client *http.Client) *ReadyzParams {
o.SetHTTPClient(client)
return o
}
// SetHTTPClient adds the HTTPClient to the readyz params
func (o *ReadyzParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
}
// WriteToRequest writes these params to a swagger request
func (o *ReadyzParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
if err := r.SetTimeout(o.timeout); err != nil {
return err
}
var res []error
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
Go
1
https://gitee.com/flexlb/flexlb-client-go.git
git@gitee.com:flexlb/flexlb-client-go.git
flexlb
flexlb-client-go
flexlb-client-go
v0.4.2

搜索帮助