rest

package
v0.0.0-...-990aa43 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MyCustomLogger

func MyCustomLogger() gin.HandlerFunc

func RunAPI

func RunAPI(address string) error

func RunAPIWithHandler

func RunAPIWithHandler(address string, h HandlerInterface) error

func RunMockAPI

func RunMockAPI(address string) error

Types

type Handler

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

func (*Handler) AddUser

func (h *Handler) AddUser(c *gin.Context)

func (*Handler) Charge

func (h *Handler) Charge(c *gin.Context)

func (*Handler) GetMainPage

func (h *Handler) GetMainPage(c *gin.Context)

func (*Handler) GetOrders

func (h *Handler) GetOrders(c *gin.Context)

func (*Handler) GetProducts

func (h *Handler) GetProducts(c *gin.Context)

func (*Handler) GetPromos

func (h *Handler) GetPromos(c *gin.Context)

func (*Handler) SignIn

func (h *Handler) SignIn(c *gin.Context)

func (*Handler) SignOut

func (h *Handler) SignOut(c *gin.Context)

type HandlerInterface

type HandlerInterface interface {
	GetProducts(c *gin.Context)
	GetPromos(c *gin.Context)
	AddUser(c *gin.Context)
	SignIn(c *gin.Context)
	SignOut(c *gin.Context)
	GetOrders(c *gin.Context)
	Charge(c *gin.Context)
}

func NewHandler

func NewHandler() (HandlerInterface, error)

type MockHandler

type MockHandler struct {
}

func NewMockHandler

func NewMockHandler() *MockHandler

func (*MockHandler) AddUser

func (mh *MockHandler) AddUser(c *gin.Context)

func (*MockHandler) Charge

func (mh *MockHandler) Charge(c *gin.Context)

func (*MockHandler) GetMainPage

func (mh *MockHandler) GetMainPage(c *gin.Context)

func (*MockHandler) GetOrders

func (mh *MockHandler) GetOrders(c *gin.Context)

func (*MockHandler) GetProducts

func (mh *MockHandler) GetProducts(c *gin.Context)

func (*MockHandler) GetPromos

func (mh *MockHandler) GetPromos(c *gin.Context)

func (*MockHandler) SignIn

func (mh *MockHandler) SignIn(c *gin.Context)

func (*MockHandler) SignOut

func (mh *MockHandler) SignOut(c *gin.Context)

Jump to

Keyboard shortcuts

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