handler

package
v0.0.0-...-e5f25f2 Latest Latest
Warning

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

Go to latest
Published: May 30, 2025 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SwaggerAPIHandler

func SwaggerAPIHandler(w http.ResponseWriter, r *http.Request)

SwaggerAPIHandler provides the Swagger API specification file

func SwaggerAPIRedirectHandler

func SwaggerAPIRedirectHandler(w http.ResponseWriter, r *http.Request)

SwaggerAPIRedirectHandler is used to redirect from root (of the service) to the file which contains the service's API

Types

type Order

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

Order is used to expose the Order service's basic operations using the HTTP route handler methods which extend it.

func NewOrderHandler

func NewOrderHandler(repository repository.OrderRepository) Order

NewOrderHandler creates a new 'OrderHandler' which provides route handlers for the given OrderRepository's operations.

func (Order) DeleteNamespaceOrders

func (orderHandler Order) DeleteNamespaceOrders(w http.ResponseWriter, r *http.Request)

DeleteNamespaceOrders handles an http request for deleting all Orders from a namespace specified as a path variable.

func (Order) DeleteOrders

func (orderHandler Order) DeleteOrders(w http.ResponseWriter, r *http.Request)

DeleteOrders handles an http request for deleting all Orders from all namespaces.

func (Order) GetNamespaceOrders

func (orderHandler Order) GetNamespaceOrders(w http.ResponseWriter, r *http.Request)

GetNamespaceOrders handles an http request for retrieving all Orders from a namespace specified as a path variable. The orders list is marshalled in JSON format and sent to the `http.ResponseWriter`.

func (Order) GetOrders

func (orderHandler Order) GetOrders(w http.ResponseWriter, r *http.Request)

GetOrders handles an http request for retrieving all Orders from all namespaces. The orders list is marshalled in JSON format and sent to the `http.ResponseWriter`

func (Order) InsertOrder

func (orderHandler Order) InsertOrder(w http.ResponseWriter, r *http.Request)

InsertOrder handles an http request for creating an Order given in JSON format. The handler also validates the Order payload fields and handles duplicate entry or unexpected errors.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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