internal

package
v6.7.3-0...-1f455d7 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2020 License: Apache-2.0, Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrForbidden = ForbiddenError{}
View Source
var ErrUnauthorized = errors.New("not authorized")

Functions

This section is empty.

Types

type Connection

type Connection interface {
	URL() string
	HTTPClient() *http.Client

	Send(request Request, response *Response) error
	SendHTTPRequest(request *http.Request, returnResponseBody bool, response *Response) error
	ConnectToEventStream(request Request) (*sse.EventSource, error)
}

Deprecated. Use HTTPAgent instead

func NewConnection

func NewConnection(apiURL string, httpClient *http.Client, tracing bool) Connection

Deprecated

type ForbiddenError

type ForbiddenError struct {
	Reason string
	// contains filtered or unexported fields
}

func (ForbiddenError) Error

func (e ForbiddenError) Error() string

type HTTPAgent

type HTTPAgent interface {
	Send(request Request) (http.Response, error)
}

func NewHTTPAgent

func NewHTTPAgent(apiURL string, httpClient *http.Client, tracing bool) HTTPAgent

type Request

type Request struct {
	RequestName        string
	Params             rata.Params
	Query              url.Values
	Header             http.Header
	Body               io.Reader
	ReturnResponseBody bool
}

type ResourceNotFoundError

type ResourceNotFoundError jsonapi.ErrorsPayload

func (ResourceNotFoundError) Error

func (e ResourceNotFoundError) Error() string

type Response

type Response struct {
	Result  interface{}
	Headers *http.Header
	Created bool
}

type UnexpectedResponseError

type UnexpectedResponseError struct {
	StatusCode int
	Status     string
	Body       string
	// contains filtered or unexported fields
}

func (UnexpectedResponseError) Error

func (e UnexpectedResponseError) Error() string

Directories

Path Synopsis
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

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