handler

package
v1.8.0 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Delivery

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

Delivery implements rest interface for delivery.

func NewDelivery

func NewDelivery(deliveryService postmand.DeliveryService, logger *zap.Logger) *Delivery

NewDelivery creates a new Delivery.

func (Delivery) Create

func (d Delivery) Create(w http.ResponseWriter, r *http.Request)

Create delivery. Create godoc @Summary Add an delivery @Tags deliveries @Accept json @Produce json @Param delivery body postmand.Delivery true "Add delivery" @Success 201 {object} postmand.Delivery @Failure 400 {object} errorResponse @Failure 500 {object} errorResponse @Router /deliveries [post]

func (Delivery) Delete

func (d Delivery) Delete(w http.ResponseWriter, r *http.Request)

Delete delivery. Delete godoc @Summary Delete an delivery @Tags deliveries @Accept json @Produce json @Param delivery_id path string true "Delivery ID" @Success 204 "No Content" @Failure 404 {object} errorResponse @Failure 500 {object} errorResponse @Router /deliveries/{delivery_id} [delete]

func (Delivery) Get

func (d Delivery) Get(w http.ResponseWriter, r *http.Request)

Get delivery. Get godoc @Summary Show a delivery @Tags deliveries @Accept json @Produce json @Param delivery_id path string true "Delivery ID" @Success 200 {object} postmand.Delivery @Failure 404 {object} errorResponse @Failure 500 {object} errorResponse @Router /deliveries/{delivery_id} [get]

func (Delivery) List

func (d Delivery) List(w http.ResponseWriter, r *http.Request)

List deliveries. List godoc @Summary List deliveries @Tags deliveries @Accept json @Produce json @Param limit query int false "The limit indicates the maximum number of items to return" @Param offset query int false "The offset indicates the starting position of the query in relation to the complete set of unpaginated items" @Param webhook_id query string false "Filter by webhook_id field" @Param status query string false "Filter by status field" @Param created_at.gt query string false "Return results where the created_at field is greater than this value" @Param created_at.gte query string false "Return results where the created_at field is greater than or equal to this value" @Param created_at.lt query string false "Return results where the created_at field is less than this value" @Param created_at.lte query string false "Return results where the created_at field is less than or equal to this value" @Success 200 {object} deliveryList @Failure 500 {object} errorResponse @Router /deliveries [get]

type DeliveryAttempt

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

DeliveryAttempt implements rest interface for delivery attempt.

func NewDeliveryAttempt

func NewDeliveryAttempt(deliveryAttemptService postmand.DeliveryAttemptService, logger *zap.Logger) *DeliveryAttempt

NewDeliveryAttempt creates a new DeliveryAttempt.

func (DeliveryAttempt) Get

Get delivery attempt. Get godoc @Summary Show a delivery attempt @Tags delivery-attempts @Accept json @Produce json @Param delivery_attempt_id path string true "Delivery Attempt ID" @Success 200 {object} postmand.DeliveryAttempt @Failure 404 {object} errorResponse @Failure 500 {object} errorResponse @Router /delivery-attempts/{delivery_attempt_id} [get]

func (DeliveryAttempt) List

List delivery attempts. List godoc @Summary List delivery attempts @Tags delivery-attempts @Accept json @Produce json @Param limit query int false "The limit indicates the maximum number of items to return" @Param offset query int false "The offset indicates the starting position of the query in relation to the complete set of unpaginated items" @Param webhook_id query string false "Filter by webhook_id" @Param delivery_id query string false "Filter by delivery_id" @Param success query boolean false "Filter by success" @Param created_at.gt query string false "Return results where the created_at field is greater than this value" @Param created_at.gte query string false "Return results where the created_at field is greater than or equal to this value" @Param created_at.lt query string false "Return results where the created_at field is less than this value" @Param created_at.lte query string false "Return results where the created_at field is less than or equal to this value" @Success 200 {object} deliveryAttemptList @Failure 500 {object} errorResponse @Router /delivery-attempts [get]

type Ping

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

Ping implements interface for health check.

func NewPing

func NewPing(pingService postmand.PingService, logger *zap.Logger) *Ping

NewPing creates a new Ping.

func (Ping) Healthz

func (p Ping) Healthz(w http.ResponseWriter, r *http.Request)

Healthz returns health check response.

type Webhook

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

Webhook implements rest interface for webhook.

func NewWebhook

func NewWebhook(webhookService postmand.WebhookService, logger *zap.Logger) *Webhook

NewWebhook creates a new Webhook.

func (Webhook) Create

func (wh Webhook) Create(w http.ResponseWriter, r *http.Request)

Create webhook. Create godoc @Summary Add an webhook @Tags webhooks @Accept json @Produce json @Param webhook body postmand.Webhook true "Add webhook" @Success 201 {object} postmand.Webhook @Failure 400 {object} errorResponse @Failure 500 {object} errorResponse @Router /webhooks [post]

func (Webhook) Delete

func (wh Webhook) Delete(w http.ResponseWriter, r *http.Request)

Delete webhook. Delete godoc @Summary Delete an webhook @Tags webhooks @Accept json @Produce json @Param webhook_id path string true "Webhook ID" @Success 204 "No Content" @Failure 404 {object} errorResponse @Failure 500 {object} errorResponse @Router /webhooks/{webhook_id} [delete]

func (Webhook) Get

func (wh Webhook) Get(w http.ResponseWriter, r *http.Request)

Get webhook. Get godoc @Summary Show a webhook @Tags webhooks @Accept json @Produce json @Param webhook_id path string true "Webhook ID" @Success 200 {object} postmand.Webhook @Failure 404 {object} errorResponse @Failure 500 {object} errorResponse @Router /webhooks/{webhook_id} [get]

func (Webhook) List

func (wh Webhook) List(w http.ResponseWriter, r *http.Request)

List webhooks. List godoc @Summary List webhooks @Tags webhooks @Accept json @Produce json @Param limit query int false "The limit indicates the maximum number of items to return" @Param offset query int false "The offset indicates the starting position of the query in relation to the complete set of unpaginated items" @Param active query boolean false "Filter by active field" @Param created_at.gt query string false "Return results where the created_at field is greater than this value" @Param created_at.gte query string false "Return results where the created_at field is greater than or equal to this value" @Param created_at.lt query string false "Return results where the created_at field is less than this value" @Param created_at.lte query string false "Return results where the created_at field is less than or equal to this value" @Success 200 {object} webhookList @Failure 500 {object} errorResponse @Router /webhooks [get]

func (Webhook) Update

func (wh Webhook) Update(w http.ResponseWriter, r *http.Request)

Update webhook. Update godoc @Summary Update an webhook @Tags webhooks @Accept json @Produce json @Param webhook_id path string true "Webhook ID" @Param webhook body postmand.Webhook true "Update webhook" @Success 200 {object} postmand.Webhook @Failure 400 {object} errorResponse @Failure 404 {object} errorResponse @Failure 500 {object} errorResponse @Router /webhooks/{webhook_id} [put]

Jump to

Keyboard shortcuts

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