port

package
v0.0.0-...-363facf Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2021 License: Apache-2.0 Imports: 15 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(userService user.Service, topUpService topup.Service, payService pay.Service, idemService idem.Service, transactionService transaction.Service) *HTTPServer

func (*HTTPServer) AddUser

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

func (*HTTPServer) CancelPay

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

func (*HTTPServer) CancelTopUp

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

func (*HTTPServer) CommitPay

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

func (*HTTPServer) CommitTopUp

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

func (*HTTPServer) End

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

func (*HTTPServer) GetHealthStatus

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

func (*HTTPServer) GetTransactionByUserID

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

FixMe: Temporary for demo, delete this file later

func (*HTTPServer) GetUserByID

func (h *HTTPServer) GetUserByID() 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{})

func (*HTTPServer) Start

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

func (*HTTPServer) Test

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

func (*HTTPServer) TryExternalPay

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

func (*HTTPServer) TryPay

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

func (*HTTPServer) TryTopUp

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

func (*HTTPServer) UpdateUser

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

type ServerInterface

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

	//  GET /v1/user/:id
	GetUserByID() func(*gin.Context)
	//  POST /v1/user
	AddUser() func(*gin.Context)
	//  POST /v1/user/:id
	UpdateUser() func(*gin.Context)

	// POST /v1/topup/try
	TryTopUp() func(*gin.Context)
	// POST /v1/topup/commit
	CommitTopUp() func(*gin.Context)
	// POST /v1/topup/cancel
	CancelTopUp() func(*gin.Context)

	// POST /v1/pay/try
	TryPay() func(*gin.Context)
	// POST /v1/pay/tryExternal
	TryExternalPay() func(ctx *gin.Context)
	// POST /v1/pay/commit
	CommitPay() func(*gin.Context)
	// POST /v1/pay/cancel
	CancelPay() func(*gin.Context)

	// POST /v1/idem/start
	Start() func(*gin.Context)
	// POST /v1/idem/end
	End() func(*gin.Context)
	// POST /v1/idem/test
	Test() func(*gin.Context)

	// FixMe: Temporary for demo, delete later
	// GET /v1/transaction/:userId
	GetTransactionByUserID() func(*gin.Context)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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