client

package
v0.0.0-...-dcb615a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 17, 2016 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultTimeout = 30 * time.Second

DefaultTimeout the default request timeout

Functions

func APIKeyAuth

func APIKeyAuth(name, in, value string) runtime.ClientAuthInfoWriter

APIKeyAuth provides an API key auth info writer

func BasicAuth

func BasicAuth(username, password string) runtime.ClientAuthInfoWriter

BasicAuth provides a basic auth info writer

func BearerToken

func BearerToken(token string) runtime.ClientAuthInfoWriter

BearerToken provides a header based oauth2 bearer access token auth info writer

Types

type Runtime

type Runtime struct {
	DefaultMediaType      string
	DefaultAuthentication runtime.ClientAuthInfoWriter
	Consumers             map[string]runtime.Consumer
	Producers             map[string]runtime.Producer

	Transport http.RoundTripper
	Jar       http.CookieJar
	//Spec      *spec.Document
	Host     string
	BasePath string
	Formats  strfmt.Registry
	Debug    bool
	Context  context.Context
	// contains filtered or unexported fields
}

Runtime represents an API client that uses the transport to make http requests based on a swagger specification.

func New

func New(host, basePath string, schemes []string) *Runtime

New creates a new default runtime for a swagger api runtime.Client

func (*Runtime) Submit

func (r *Runtime) Submit(operation *runtime.ClientOperation) (interface{}, error)

Submit a request and when there is a body on success it will turn that into the result all other things are turned into an api error for swagger which retains the status code

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL