client

package
v2.0.8+incompatible Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2019 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ArchiveArchiverPath

func ArchiveArchiverPath() string

ArchiveArchiverPath returns the URL path to the archiver service archive HTTP endpoint.

func BuildArchivePayload

func BuildArchivePayload(archiverArchiveBody string) (*archiver.ArchivePayload, error)

BuildArchivePayload builds the payload for the archiver archive endpoint from CLI flags.

func BuildReadPayload

func BuildReadPayload(archiverReadID string) (*archiver.ReadPayload, error)

BuildReadPayload builds the payload for the archiver read endpoint from CLI flags.

func DecodeArchiveResponse

func DecodeArchiveResponse(decoder func(*http.Response) goahttp.Decoder, restoreBody bool) func(*http.Response) (interface{}, error)

DecodeArchiveResponse returns a decoder for responses returned by the archiver archive endpoint. restoreBody controls whether the response body should be restored after having been read.

func DecodeReadResponse

func DecodeReadResponse(decoder func(*http.Response) goahttp.Decoder, restoreBody bool) func(*http.Response) (interface{}, error)

DecodeReadResponse returns a decoder for responses returned by the archiver read endpoint. restoreBody controls whether the response body should be restored after having been read. DecodeReadResponse may return the following errors:

  • "not_found" (type *goa.ServiceError): http.StatusNotFound
  • "bad_request" (type *goa.ServiceError): http.StatusBadRequest
  • error: internal error

func EncodeArchiveRequest

func EncodeArchiveRequest(encoder func(*http.Request) goahttp.Encoder) func(*http.Request, interface{}) error

EncodeArchiveRequest returns an encoder for requests sent to the archiver archive server.

func NewArchiveMediaViewOK

func NewArchiveMediaViewOK(body *ArchiveResponseBody) *archiverviews.ArchiveMediaView

NewArchiveMediaViewOK builds a "archiver" service "archive" endpoint result from a HTTP "OK" response.

func NewReadArchiveMediaOK

func NewReadArchiveMediaOK(body *ReadResponseBody) *archiverviews.ArchiveMediaView

NewReadArchiveMediaOK builds a "archiver" service "read" endpoint result from a HTTP "OK" response.

func NewReadBadRequest

func NewReadBadRequest(body *ReadBadRequestResponseBody) *goa.ServiceError

NewReadBadRequest builds a archiver service read endpoint bad_request error.

func NewReadNotFound

func NewReadNotFound(body *ReadNotFoundResponseBody) *goa.ServiceError

NewReadNotFound builds a archiver service read endpoint not_found error.

func ReadArchiverPath

func ReadArchiverPath(id int) string

ReadArchiverPath returns the URL path to the archiver service read HTTP endpoint.

func ValidateReadBadRequestResponseBody

func ValidateReadBadRequestResponseBody(body *ReadBadRequestResponseBody) (err error)

ValidateReadBadRequestResponseBody runs the validations defined on read_bad_request_response_body

func ValidateReadNotFoundResponseBody

func ValidateReadNotFoundResponseBody(body *ReadNotFoundResponseBody) (err error)

ValidateReadNotFoundResponseBody runs the validations defined on read_not_found_response_body

Types

type ArchiveRequestBody

type ArchiveRequestBody struct {
	// HTTP status
	Status int `form:"status" json:"status" xml:"status"`
	// HTTP response body content
	Body string `form:"body" json:"body" xml:"body"`
}

ArchiveRequestBody is the type of the "archiver" service "archive" endpoint HTTP request body.

func NewArchiveRequestBody

func NewArchiveRequestBody(p *archiver.ArchivePayload) *ArchiveRequestBody

NewArchiveRequestBody builds the HTTP request body from the payload of the "archive" endpoint of the "archiver" service.

type ArchiveResponseBody

type ArchiveResponseBody struct {
	// The archive resouce href
	Href *string `form:"href,omitempty" json:"href,omitempty" xml:"href,omitempty"`
	// HTTP status
	Status *int `form:"status,omitempty" json:"status,omitempty" xml:"status,omitempty"`
	// HTTP response body content
	Body *string `form:"body,omitempty" json:"body,omitempty" xml:"body,omitempty"`
}

ArchiveResponseBody is the type of the "archiver" service "archive" endpoint HTTP response body.

type Client

type Client struct {
	// Archive Doer is the HTTP client used to make requests to the archive
	// endpoint.
	ArchiveDoer goahttp.Doer

	// Read Doer is the HTTP client used to make requests to the read endpoint.
	ReadDoer goahttp.Doer

	// RestoreResponseBody controls whether the response bodies are reset after
	// decoding so they can be read again.
	RestoreResponseBody bool
	// contains filtered or unexported fields
}

Client lists the archiver service endpoint HTTP clients.

func NewClient

func NewClient(
	scheme string,
	host string,
	doer goahttp.Doer,
	enc func(*http.Request) goahttp.Encoder,
	dec func(*http.Response) goahttp.Decoder,
	restoreBody bool,
) *Client

NewClient instantiates HTTP clients for all the archiver service servers.

func (*Client) Archive

func (c *Client) Archive() endpoint.Endpoint

Archive returns an endpoint that makes HTTP requests to the archiver service archive server.

func (*Client) BuildArchiveRequest

func (c *Client) BuildArchiveRequest(ctx context.Context, v interface{}) (*http.Request, error)

BuildArchiveRequest instantiates a HTTP request object with method and path set to call the "archiver" service "archive" endpoint

func (*Client) BuildReadRequest

func (c *Client) BuildReadRequest(ctx context.Context, v interface{}) (*http.Request, error)

BuildReadRequest instantiates a HTTP request object with method and path set to call the "archiver" service "read" endpoint

func (*Client) Read

func (c *Client) Read() endpoint.Endpoint

Read returns an endpoint that makes HTTP requests to the archiver service read server.

type ReadBadRequestResponseBody

type ReadBadRequestResponseBody struct {
	// Name is the name of this class of errors.
	Name *string `form:"name,omitempty" json:"name,omitempty" xml:"name,omitempty"`
	// ID is a unique identifier for this particular occurrence of the problem.
	ID *string `form:"id,omitempty" json:"id,omitempty" xml:"id,omitempty"`
	// Message is a human-readable explanation specific to this occurrence of the
	// problem.
	Message *string `form:"message,omitempty" json:"message,omitempty" xml:"message,omitempty"`
	// Is the error temporary?
	Temporary *bool `form:"temporary,omitempty" json:"temporary,omitempty" xml:"temporary,omitempty"`
	// Is the error a timeout?
	Timeout *bool `form:"timeout,omitempty" json:"timeout,omitempty" xml:"timeout,omitempty"`
	// Is the error a server-side fault?
	Fault *bool `form:"fault,omitempty" json:"fault,omitempty" xml:"fault,omitempty"`
}

ReadBadRequestResponseBody is the type of the "archiver" service "read" endpoint HTTP response body for the "bad_request" error.

type ReadNotFoundResponseBody

type ReadNotFoundResponseBody struct {
	// Name is the name of this class of errors.
	Name *string `form:"name,omitempty" json:"name,omitempty" xml:"name,omitempty"`
	// ID is a unique identifier for this particular occurrence of the problem.
	ID *string `form:"id,omitempty" json:"id,omitempty" xml:"id,omitempty"`
	// Message is a human-readable explanation specific to this occurrence of the
	// problem.
	Message *string `form:"message,omitempty" json:"message,omitempty" xml:"message,omitempty"`
	// Is the error temporary?
	Temporary *bool `form:"temporary,omitempty" json:"temporary,omitempty" xml:"temporary,omitempty"`
	// Is the error a timeout?
	Timeout *bool `form:"timeout,omitempty" json:"timeout,omitempty" xml:"timeout,omitempty"`
	// Is the error a server-side fault?
	Fault *bool `form:"fault,omitempty" json:"fault,omitempty" xml:"fault,omitempty"`
}

ReadNotFoundResponseBody is the type of the "archiver" service "read" endpoint HTTP response body for the "not_found" error.

type ReadResponseBody

type ReadResponseBody struct {
	// The archive resouce href
	Href *string `form:"href,omitempty" json:"href,omitempty" xml:"href,omitempty"`
	// HTTP status
	Status *int `form:"status,omitempty" json:"status,omitempty" xml:"status,omitempty"`
	// HTTP response body content
	Body *string `form:"body,omitempty" json:"body,omitempty" xml:"body,omitempty"`
}

ReadResponseBody is the type of the "archiver" service "read" endpoint HTTP response body.

Jump to

Keyboard shortcuts

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