port

package
v0.0.0-...-7a6fcb1 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2021 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HandlerFromMux

func HandlerFromMux(si ServerInterface, e *gin.Engine) http.Handler

Types

type HTTPServer

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

func NewHTTPServer

func NewHTTPServer(orderService order.Service, payService pay.Service, topUpService topup.Service, refundService refund.Service) *HTTPServer

func (*HTTPServer) AddOrder

func (h *HTTPServer) AddOrder() func(ctx *gin.Context)

func (*HTTPServer) AddRefund

func (h *HTTPServer) AddRefund() func(ctx *gin.Context)

func (*HTTPServer) AddTopUp

func (h *HTTPServer) AddTopUp() func(ctx *gin.Context)

func (*HTTPServer) GetHealthStatus

func (h *HTTPServer) GetHealthStatus() func(ctx *gin.Context)

func (*HTTPServer) GetOrder

func (h *HTTPServer) GetOrder() func(ctx *gin.Context)

func (*HTTPServer) PayOrder

func (h *HTTPServer) PayOrder() func(ctx *gin.Context)

func (*HTTPServer) RespondWithError

func (*HTTPServer) RespondWithError(ctx *gin.Context, err error)

func (*HTTPServer) RespondWithOK

func (*HTTPServer) RespondWithOK(ctx *gin.Context, resp interface{})

type ServerInterface

type ServerInterface interface {
	// GET /health
	GetHealthStatus() func(*gin.Context)

	// GET /v1/order/:id
	GetOrder() func(*gin.Context)
	// POST /v1/order/
	AddOrder() func(*gin.Context)
	// POST /v1/order/:id/pay
	PayOrder() func(*gin.Context)
	// POST /v1/order/:id/refund
	AddRefund() func(*gin.Context)

	// POST /v1/user/{id}/topup
	AddTopUp() func(*gin.Context)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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