client

package
v0.0.0-...-b9360c4 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2023 License: BSD-3-Clause Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildSeenPayload

func BuildSeenPayload(notificationsSeenBody string, notificationsSeenAuth string) (*notifications.SeenPayload, error)

BuildSeenPayload builds the payload for the notifications seen endpoint from CLI flags.

func DecodeListenResponse

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

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

  • "forbidden" (type *goa.ServiceError): http.StatusForbidden
  • "not-found" (type *goa.ServiceError): http.StatusNotFound
  • "bad-request" (type *goa.ServiceError): http.StatusBadRequest
  • "unauthorized" (type notifications.Unauthorized): http.StatusUnauthorized
  • error: internal error

func DecodeSeenResponse

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

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

  • "forbidden" (type *goa.ServiceError): http.StatusForbidden
  • "not-found" (type *goa.ServiceError): http.StatusNotFound
  • "bad-request" (type *goa.ServiceError): http.StatusBadRequest
  • "unauthorized" (type notifications.Unauthorized): http.StatusUnauthorized
  • error: internal error

func EncodeSeenRequest

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

EncodeSeenRequest returns an encoder for requests sent to the notifications seen server.

func ListenNotificationsPath

func ListenNotificationsPath() string

ListenNotificationsPath returns the URL path to the notifications service listen HTTP endpoint.

func NewListenBadRequest

func NewListenBadRequest(body *ListenBadRequestResponseBody) *goa.ServiceError

NewListenBadRequest builds a notifications service listen endpoint bad-request error.

func NewListenForbidden

func NewListenForbidden(body *ListenForbiddenResponseBody) *goa.ServiceError

NewListenForbidden builds a notifications service listen endpoint forbidden error.

func NewListenNotFound

func NewListenNotFound(body *ListenNotFoundResponseBody) *goa.ServiceError

NewListenNotFound builds a notifications service listen endpoint not-found error.

func NewListenUnauthorized

func NewListenUnauthorized(body ListenUnauthorizedResponseBody) notifications.Unauthorized

NewListenUnauthorized builds a notifications service listen endpoint unauthorized error.

func NewSeenBadRequest

func NewSeenBadRequest(body *SeenBadRequestResponseBody) *goa.ServiceError

NewSeenBadRequest builds a notifications service seen endpoint bad-request error.

func NewSeenForbidden

func NewSeenForbidden(body *SeenForbiddenResponseBody) *goa.ServiceError

NewSeenForbidden builds a notifications service seen endpoint forbidden error.

func NewSeenNotFound

func NewSeenNotFound(body *SeenNotFoundResponseBody) *goa.ServiceError

NewSeenNotFound builds a notifications service seen endpoint not-found error.

func NewSeenUnauthorized

NewSeenUnauthorized builds a notifications service seen endpoint unauthorized error.

func SeenNotificationsPath

func SeenNotificationsPath() string

SeenNotificationsPath returns the URL path to the notifications service seen HTTP endpoint.

func ValidateListenBadRequestResponseBody

func ValidateListenBadRequestResponseBody(body *ListenBadRequestResponseBody) (err error)

ValidateListenBadRequestResponseBody runs the validations defined on listen_bad-request_response_body

func ValidateListenForbiddenResponseBody

func ValidateListenForbiddenResponseBody(body *ListenForbiddenResponseBody) (err error)

ValidateListenForbiddenResponseBody runs the validations defined on listen_forbidden_response_body

func ValidateListenNotFoundResponseBody

func ValidateListenNotFoundResponseBody(body *ListenNotFoundResponseBody) (err error)

ValidateListenNotFoundResponseBody runs the validations defined on listen_not-found_response_body

func ValidateSeenBadRequestResponseBody

func ValidateSeenBadRequestResponseBody(body *SeenBadRequestResponseBody) (err error)

ValidateSeenBadRequestResponseBody runs the validations defined on seen_bad-request_response_body

func ValidateSeenForbiddenResponseBody

func ValidateSeenForbiddenResponseBody(body *SeenForbiddenResponseBody) (err error)

ValidateSeenForbiddenResponseBody runs the validations defined on seen_forbidden_response_body

func ValidateSeenNotFoundResponseBody

func ValidateSeenNotFoundResponseBody(body *SeenNotFoundResponseBody) (err error)

ValidateSeenNotFoundResponseBody runs the validations defined on seen_not-found_response_body

Types

type Client

type Client struct {
	// Listen Doer is the HTTP client used to make requests to the listen endpoint.
	ListenDoer goahttp.Doer

	// Seen Doer is the HTTP client used to make requests to the seen endpoint.
	SeenDoer goahttp.Doer

	// CORS Doer is the HTTP client used to make requests to the  endpoint.
	CORSDoer 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 notifications 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,
	dialer goahttp.Dialer,
	cfn *ConnConfigurer,
) *Client

NewClient instantiates HTTP clients for all the notifications service servers.

func (*Client) BuildListenRequest

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

BuildListenRequest instantiates a HTTP request object with method and path set to call the "notifications" service "listen" endpoint

func (*Client) BuildSeenRequest

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

BuildSeenRequest instantiates a HTTP request object with method and path set to call the "notifications" service "seen" endpoint

func (*Client) Listen

func (c *Client) Listen() goa.Endpoint

Listen returns an endpoint that makes HTTP requests to the notifications service listen server.

func (*Client) Seen

func (c *Client) Seen() goa.Endpoint

Seen returns an endpoint that makes HTTP requests to the notifications service seen server.

type ConnConfigurer

type ConnConfigurer struct {
	ListenFn goahttp.ConnConfigureFunc
}

ConnConfigurer holds the websocket connection configurer functions for the streaming endpoints in "notifications" service.

func NewConnConfigurer

func NewConnConfigurer(fn goahttp.ConnConfigureFunc) *ConnConfigurer

NewConnConfigurer initializes the websocket connection configurer function with fn for all the streaming endpoints in "notifications" service.

type ListenBadRequestResponseBody

type ListenBadRequestResponseBody 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"`
}

ListenBadRequestResponseBody is the type of the "notifications" service "listen" endpoint HTTP response body for the "bad-request" error.

type ListenClientStream

type ListenClientStream struct {
	// contains filtered or unexported fields
}

ListenClientStream implements the notifications.ListenClientStream interface.

func (*ListenClientStream) Close

func (s *ListenClientStream) Close() error

Close closes the "listen" endpoint websocket connection.

func (*ListenClientStream) Recv

func (s *ListenClientStream) Recv() (map[string]interface{}, error)

Recv reads instances of "map[string]interface{}" from the "listen" endpoint websocket connection.

func (*ListenClientStream) Send

func (s *ListenClientStream) Send(v map[string]interface{}) error

Send streams instances of "map[string]interface{}" to the "listen" endpoint websocket connection.

type ListenForbiddenResponseBody

type ListenForbiddenResponseBody 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"`
}

ListenForbiddenResponseBody is the type of the "notifications" service "listen" endpoint HTTP response body for the "forbidden" error.

type ListenNotFoundResponseBody

type ListenNotFoundResponseBody 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"`
}

ListenNotFoundResponseBody is the type of the "notifications" service "listen" endpoint HTTP response body for the "not-found" error.

type ListenUnauthorizedResponseBody

type ListenUnauthorizedResponseBody string

ListenUnauthorizedResponseBody is the type of the "notifications" service "listen" endpoint HTTP response body for the "unauthorized" error.

type SeenBadRequestResponseBody

type SeenBadRequestResponseBody 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"`
}

SeenBadRequestResponseBody is the type of the "notifications" service "seen" endpoint HTTP response body for the "bad-request" error.

type SeenForbiddenResponseBody

type SeenForbiddenResponseBody 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"`
}

SeenForbiddenResponseBody is the type of the "notifications" service "seen" endpoint HTTP response body for the "forbidden" error.

type SeenNotFoundResponseBody

type SeenNotFoundResponseBody 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"`
}

SeenNotFoundResponseBody is the type of the "notifications" service "seen" endpoint HTTP response body for the "not-found" error.

type SeenRequestBody

type SeenRequestBody struct {
	Ids []int64 `form:"ids" json:"ids" xml:"ids"`
}

SeenRequestBody is the type of the "notifications" service "seen" endpoint HTTP request body.

func NewSeenRequestBody

func NewSeenRequestBody(p *notifications.SeenPayload) *SeenRequestBody

NewSeenRequestBody builds the HTTP request body from the payload of the "seen" endpoint of the "notifications" service.

type SeenUnauthorizedResponseBody

type SeenUnauthorizedResponseBody string

SeenUnauthorizedResponseBody is the type of the "notifications" service "seen" endpoint HTTP response body for the "unauthorized" error.

Jump to

Keyboard shortcuts

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