Documentation
¶
Overview ¶
Package httpclient is a client of the webhooks' HTTP API
Index ¶
- type Client
- func (c *Client) CreateWebhook(ctx context.Context, meta schema.WebhookMeta) (*schema.WebhookToken, error)
- func (c *Client) DeleteCall(ctx context.Context, id uint64) (*schema.Call, error)
- func (c *Client) DeleteWebhook(ctx context.Context, id uint64) (*schema.Webhook, error)
- func (c *Client) GetCall(ctx context.Context, id uint64) (*schema.Call, error)
- func (c *Client) GetWebhook(ctx context.Context, id uint64) (*schema.Webhook, error)
- func (c *Client) Hook(ctx context.Context, token, method, contentType string, body io.Reader, ...) (*schema.HookResponse, error)
- func (c *Client) ListCalls(ctx context.Context, req schema.CallListRequest) (*schema.CallList, error)
- func (c *Client) ListWebhooks(ctx context.Context, req schema.WebhookListRequest) (*schema.WebhookList, error)
- func (c *Client) TestCall(ctx context.Context, test schema.TestRequest) (*schema.Call, error)
- func (c *Client) UpdateWebhook(ctx context.Context, id uint64, change schema.WebhookRequest) (*schema.Webhook, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
Client is a client of the webhooks' HTTP API, which wraps the base HTTP client, with typed methods for its requests
func New ¶
New returns a client of the webhooks' API, at the URL, which is the server's API endpoint, such as http://localhost:8084/api, with the options
func (*Client) CreateWebhook ¶
func (c *Client) CreateWebhook(ctx context.Context, meta schema.WebhookMeta) (*schema.WebhookToken, error)
CreateWebhook creates the webhook, and returns it, with its token, and its URL, when the server has a public endpoint, which aren't returned again
func (*Client) DeleteCall ¶ added in v1.7.4
DeleteCall deletes the call with the serial number, and returns it, as it was
func (*Client) DeleteWebhook ¶
DeleteWebhook deletes the webhook with the serial number, and its calls, and returns it, as it was
func (*Client) GetWebhook ¶
GetWebhook returns the webhook with the serial number
func (*Client) Hook ¶
func (c *Client) Hook(ctx context.Context, token, method, contentType string, body io.Reader, header http.Header) (*schema.HookResponse, error)
Hook calls the URL of the webhook with the token, as its service does, with the method, the body, of its content type, which is sent as it is, and the headers, such as a signature, and returns the response: the call which was kept, or whether it was a delivery which was sent again. The token isn't in the client's log, its traces, nor its errors.
func (*Client) ListCalls ¶
func (c *Client) ListCalls(ctx context.Context, req schema.CallListRequest) (*schema.CallList, error)
ListCalls returns the calls, oldest first, or newest, as the request selects, after the call with its serial number, and since its time, and how many there are
func (*Client) ListWebhooks ¶
func (c *Client) ListWebhooks(ctx context.Context, req schema.WebhookListRequest) (*schema.WebhookList, error)
ListWebhooks returns the webhooks, newest first, as the request selects, and how many there are