Back to godoc.org

Package json_client

v0.0.0-...-fdd7ea7
Latest Go to latest

The latest major version is .

Published: Jul 21, 2020 | License: Apache-2.0 | Module: code.cloudfoundry.org/cf-networking-helpers

Index

type Client

type Client struct {
	Logger      lager.Logger
	HttpClient  HttpClient
	Url         string
	Marshaler   marshal.Marshaler
	Unmarshaler marshal.Unmarshaler
}

func (*Client) Do

func (c *Client) Do(method, route string, reqData, respData interface{}, token string) error

type HttpClient

type HttpClient interface {
	Do(*http.Request) (*http.Response, error)
}

go:generate counterfeiter -o ../fakes/http_client.go --fake-name HTTPClient . HttpClient

type HttpResponseCodeError

type HttpResponseCodeError struct {
	StatusCode int
	Message    string
}

func (*HttpResponseCodeError) Error

func (h *HttpResponseCodeError) Error() string

type JsonClient

type JsonClient interface {
	Do(method, route string, reqData, respData interface{}, token string) error
}

go:generate counterfeiter -o ../fakes/json_client.go --fake-name JSONClient . JsonClient

func New

func New(logger lager.Logger, httpClient HttpClient, baseURL string) JsonClient

Package Files

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier