consumer

package
v0.2.5 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AssociationHandler

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

func NewAssociationHandler

func NewAssociationHandler(associator appconsumer.Associator) *AssociationHandler

func (*AssociationHandler) AttachAuth

func (h *AssociationHandler) AttachAuth(c *fiber.Ctx) error

AttachAuth godoc @Summary Attach an auth to a consumer @Description Associates an auth credential with a consumer (idempotent). @Tags consumers @Produce json @Security BearerAuth @Param gateway_id path string true "Gateway id" format(uuid) @Param id path string true "Consumer id" format(uuid) @Param auth_id path string true "Auth id" format(uuid) @Success 204 "No Content" @Failure 400 {object} helpers.ErrorBody @Failure 401 {object} helpers.ErrorBody @Failure 404 {object} helpers.ErrorBody @Router /v1/gateways/{gateway_id}/consumers/{id}/auths/{auth_id} [post]

func (*AssociationHandler) AttachPolicy

func (h *AssociationHandler) AttachPolicy(c *fiber.Ctx) error

AttachPolicy godoc @Summary Attach a policy to a consumer @Description Associates a policy with a consumer (idempotent). Editing the policy later affects every consumer it is attached to. @Tags consumers @Produce json @Security BearerAuth @Param gateway_id path string true "Gateway id" format(uuid) @Param id path string true "Consumer id" format(uuid) @Param policy_id path string true "Policy id" format(uuid) @Success 204 "No Content" @Failure 400 {object} helpers.ErrorBody @Failure 401 {object} helpers.ErrorBody @Failure 404 {object} helpers.ErrorBody @Router /v1/gateways/{gateway_id}/consumers/{id}/policies/{policy_id} [post]

func (*AssociationHandler) AttachRegistry

func (h *AssociationHandler) AttachRegistry(c *fiber.Ctx) error

AttachRegistry godoc @Summary Attach a registry to a consumer @Description Associates a registry with a consumer (idempotent). The optional body sets the registry weight for weighted load balancing. @Tags consumers @Accept json @Produce json @Security BearerAuth @Param gateway_id path string true "Gateway id" format(uuid) @Param id path string true "Consumer id" format(uuid) @Param registry_id path string true "Registry id" format(uuid) @Param body body request.AttachRegistryRequest false "Optional registry weight" @Success 204 "No Content" @Failure 400 {object} helpers.ErrorBody @Failure 401 {object} helpers.ErrorBody @Failure 404 {object} helpers.ErrorBody @Router /v1/gateways/{gateway_id}/consumers/{id}/registries/{registry_id} [post]

func (*AssociationHandler) AttachRole

func (h *AssociationHandler) AttachRole(c *fiber.Ctx) error

AttachRole godoc @Summary Attach a role to a consumer @Description Associates a role with a role_based consumer (idempotent). Returns 409 for inline consumers. @Tags consumers @Produce json @Security BearerAuth @Param gateway_id path string true "Gateway id" format(uuid) @Param id path string true "Consumer id" format(uuid) @Param role_id path string true "Role id" format(uuid) @Success 204 "No Content" @Failure 400 {object} helpers.ErrorBody @Failure 401 {object} helpers.ErrorBody @Failure 404 {object} helpers.ErrorBody @Failure 409 {object} helpers.ErrorBody @Router /v1/gateways/{gateway_id}/consumers/{id}/roles/{role_id} [post]

func (*AssociationHandler) DetachAuth

func (h *AssociationHandler) DetachAuth(c *fiber.Ctx) error

DetachAuth godoc @Summary Detach an auth from a consumer @Description Removes the association between an auth credential and a consumer (idempotent). @Tags consumers @Produce json @Security BearerAuth @Param gateway_id path string true "Gateway id" format(uuid) @Param id path string true "Consumer id" format(uuid) @Param auth_id path string true "Auth id" format(uuid) @Success 204 "No Content" @Failure 400 {object} helpers.ErrorBody @Failure 401 {object} helpers.ErrorBody @Failure 404 {object} helpers.ErrorBody @Router /v1/gateways/{gateway_id}/consumers/{id}/auths/{auth_id} [delete]

func (*AssociationHandler) DetachPolicy

func (h *AssociationHandler) DetachPolicy(c *fiber.Ctx) error

DetachPolicy godoc @Summary Detach a policy from a consumer @Description Removes the association between a policy and a consumer (idempotent). @Tags consumers @Produce json @Security BearerAuth @Param gateway_id path string true "Gateway id" format(uuid) @Param id path string true "Consumer id" format(uuid) @Param policy_id path string true "Policy id" format(uuid) @Success 204 "No Content" @Failure 400 {object} helpers.ErrorBody @Failure 401 {object} helpers.ErrorBody @Failure 404 {object} helpers.ErrorBody @Router /v1/gateways/{gateway_id}/consumers/{id}/policies/{policy_id} [delete]

func (*AssociationHandler) DetachRegistry

func (h *AssociationHandler) DetachRegistry(c *fiber.Ctx) error

DetachRegistry godoc @Summary Detach a registry from a consumer @Description Removes the association between a registry and a consumer (idempotent). @Tags consumers @Produce json @Security BearerAuth @Param gateway_id path string true "Gateway id" format(uuid) @Param id path string true "Consumer id" format(uuid) @Param registry_id path string true "Registry id" format(uuid) @Success 204 "No Content" @Failure 400 {object} helpers.ErrorBody @Failure 401 {object} helpers.ErrorBody @Failure 404 {object} helpers.ErrorBody @Router /v1/gateways/{gateway_id}/consumers/{id}/registries/{registry_id} [delete]

func (*AssociationHandler) DetachRole

func (h *AssociationHandler) DetachRole(c *fiber.Ctx) error

DetachRole godoc @Summary Detach a role from a consumer @Description Removes the association between a role and a consumer (idempotent). @Tags consumers @Produce json @Security BearerAuth @Param gateway_id path string true "Gateway id" format(uuid) @Param id path string true "Consumer id" format(uuid) @Param role_id path string true "Role id" format(uuid) @Success 204 "No Content" @Failure 400 {object} helpers.ErrorBody @Failure 401 {object} helpers.ErrorBody @Failure 404 {object} helpers.ErrorBody @Router /v1/gateways/{gateway_id}/consumers/{id}/roles/{role_id} [delete]

type CreateConsumerHandler

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

func NewCreateConsumerHandler

func NewCreateConsumerHandler(creator appconsumer.Creator) *CreateConsumerHandler

func (*CreateConsumerHandler) Handle

func (h *CreateConsumerHandler) Handle(c *fiber.Ctx) error

Handle godoc @Summary Create a consumer @Description Creates a new consumer in a gateway. @Tags consumers @Accept json @Produce json @Security BearerAuth @Param gateway_id path string true "Gateway id" format(uuid) @Param body body request.CreateConsumerRequest true "Consumer to create" @Success 201 {object} response.ConsumerResponse @Failure 400 {object} helpers.ErrorBody @Failure 401 {object} helpers.ErrorBody @Failure 404 {object} helpers.ErrorBody @Failure 409 {object} helpers.ErrorBody @Router /v1/gateways/{gateway_id}/consumers [post]

type DeleteConsumerHandler

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

func NewDeleteConsumerHandler

func NewDeleteConsumerHandler(deleter appconsumer.Deleter) *DeleteConsumerHandler

func (*DeleteConsumerHandler) Handle

func (h *DeleteConsumerHandler) Handle(c *fiber.Ctx) error

Handle godoc @Summary Delete a consumer @Description Deletes a consumer from a gateway. @Tags consumers @Produce json @Security BearerAuth @Param gateway_id path string true "Gateway id" format(uuid) @Param id path string true "Consumer id" format(uuid) @Success 204 "No Content" @Failure 400 {object} helpers.ErrorBody @Failure 401 {object} helpers.ErrorBody @Failure 404 {object} helpers.ErrorBody @Failure 409 {object} helpers.ErrorBody @Router /v1/gateways/{gateway_id}/consumers/{id} [delete]

type GetConsumerHandler

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

func NewGetConsumerHandler

func NewGetConsumerHandler(finder appconsumer.Finder) *GetConsumerHandler

func (*GetConsumerHandler) Handle

func (h *GetConsumerHandler) Handle(c *fiber.Ctx) error

Handle godoc @Summary Get a consumer @Description Returns a single consumer by id. @Tags consumers @Produce json @Security BearerAuth @Param gateway_id path string true "Gateway id" format(uuid) @Param id path string true "Consumer id" format(uuid) @Success 200 {object} response.ConsumerResponse @Failure 400 {object} helpers.ErrorBody @Failure 401 {object} helpers.ErrorBody @Failure 404 {object} helpers.ErrorBody @Router /v1/gateways/{gateway_id}/consumers/{id} [get]

type ListConsumerHandler

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

func NewListConsumerHandler

func NewListConsumerHandler(finder appconsumer.Finder) *ListConsumerHandler

func (*ListConsumerHandler) Handle

func (h *ListConsumerHandler) Handle(c *fiber.Ctx) error

Handle godoc @Summary List consumers @Description Returns a paginated list of consumers in a gateway. @Tags consumers @Produce json @Security BearerAuth @Param gateway_id path string true "Gateway id" format(uuid) @Param name query string false "Filter by name (substring match)" @Param page query int false "Page number (1-based)" @Param size query int false "Page size" @Success 200 {object} response.ListConsumerResponse @Failure 400 {object} helpers.ErrorBody @Failure 401 {object} helpers.ErrorBody @Router /v1/gateways/{gateway_id}/consumers [get]

type UpdateConsumerHandler

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

func NewUpdateConsumerHandler

func NewUpdateConsumerHandler(updater appconsumer.Updater) *UpdateConsumerHandler

func (*UpdateConsumerHandler) Handle

func (h *UpdateConsumerHandler) Handle(c *fiber.Ctx) error

Handle godoc @Summary Update a consumer @Description Updates an existing consumer. @Tags consumers @Accept json @Produce json @Security BearerAuth @Param gateway_id path string true "Gateway id" format(uuid) @Param id path string true "Consumer id" format(uuid) @Param body body request.UpdateConsumerRequest true "Consumer fields to update" @Success 200 {object} response.ConsumerResponse @Failure 400 {object} helpers.ErrorBody @Failure 401 {object} helpers.ErrorBody @Failure 404 {object} helpers.ErrorBody @Failure 409 {object} helpers.ErrorBody @Router /v1/gateways/{gateway_id}/consumers/{id} [put]

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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