本文整理匯總了Golang中github.com/go-openapi/runtime.ClientRequest.SetTimeout方法的典型用法代碼示例。如果您正苦於以下問題:Golang ClientRequest.SetTimeout方法的具體用法?Golang ClientRequest.SetTimeout怎麽用?Golang ClientRequest.SetTimeout使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類github.com/go-openapi/runtime.ClientRequest
的用法示例。
在下文中一共展示了ClientRequest.SetTimeout方法的11個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: WriteToRequest
// WriteToRequest writes these params to a swagger request
func (o *PostNodesIdentifierWorkflowsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
r.SetTimeout(o.timeout)
var res []error
if err := r.SetBodyParam(o.Body); err != nil {
return err
}
// path param identifier
if err := r.SetPathParam("identifier", o.Identifier); err != nil {
return err
}
// query param name
qrName := o.Name
qName := qrName
if qName != "" {
if err := r.SetQueryParam("name", qName); err != nil {
return err
}
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
示例2: WriteToRequest
// WriteToRequest writes these params to a swagger request
func (o *GetCatalogsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
r.SetTimeout(o.timeout)
var res []error
if o.Query != nil {
// query param query
var qrQuery string
if o.Query != nil {
qrQuery = *o.Query
}
qQuery := qrQuery
if qQuery != "" {
if err := r.SetQueryParam("query", qQuery); err != nil {
return err
}
}
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
示例3: WriteToRequest
// WriteToRequest writes these params to a swagger request
func (o *GetLookupsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
r.SetTimeout(o.timeout)
var res []error
if o.Q != nil {
// query param q
var qrQ string
if o.Q != nil {
qrQ = *o.Q
}
qQ := qrQ
if qQ != "" {
if err := r.SetQueryParam("q", qQ); err != nil {
return err
}
}
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
示例4: WriteToRequest
// WriteToRequest writes these params to a swagger request
func (o *GetObmsLibraryParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
r.SetTimeout(o.timeout)
var res []error
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
示例5: WriteToRequest
// WriteToRequest writes these params to a swagger request
func (o *PostLookupsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
r.SetTimeout(o.timeout)
var res []error
if err := r.SetBodyParam(o.Content); err != nil {
return err
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
示例6: WriteToRequest
// WriteToRequest writes these params to a swagger request
func (o *GetWorkflowsLibraryInjectableNameParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
r.SetTimeout(o.timeout)
var res []error
// path param injectableName
if err := r.SetPathParam("injectableName", o.InjectableName); err != nil {
return err
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
示例7: WriteToRequest
// WriteToRequest writes these params to a swagger request
func (o *GetNodesIdentifierObmIdentifyParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
r.SetTimeout(o.timeout)
var res []error
// path param identifier
if err := r.SetPathParam("identifier", o.Identifier); err != nil {
return err
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
示例8: WriteToRequest
// WriteToRequest writes these params to a swagger request
func (o *GetDhcpLeaseMacParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
r.SetTimeout(o.timeout)
var res []error
// path param mac
if err := r.SetPathParam("mac", o.Mac); err != nil {
return err
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
示例9: WriteToRequest
// WriteToRequest writes these params to a swagger request
func (o *DeleteNodesMacaddressDhcpWhitelistParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
r.SetTimeout(o.timeout)
var res []error
// path param macaddress
if err := r.SetPathParam("macaddress", o.Macaddress); err != nil {
return err
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
示例10: WriteToRequest
// WriteToRequest writes these params to a swagger request
func (o *DeleteFilesFileidentifierParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
r.SetTimeout(o.timeout)
var res []error
// path param fileidentifier
if err := r.SetPathParam("fileidentifier", o.Fileidentifier); err != nil {
return err
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
示例11: WriteToRequest
// WriteToRequest writes these params to a swagger request
func (o *DeleteLookupsIDParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
r.SetTimeout(o.timeout)
var res []error
// path param id
if err := r.SetPathParam("id", o.ID); err != nil {
return err
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}