http

package
v0.0.0-...-0c44e78 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	OkMessage           = "success"
	ErrInvalidID        = "invalid id"
	ErrInvalidJSON      = "invalid json"
	ErrForbidden        = "forbidden"
	ErrInternal         = "internal error"
	ErrInvalidToken     = "invalid token"
	ErrProductNotFound  = "product not found"
	ErrProductNotEnough = "product not enough"
)

Functions

func NewEngine

func NewEngine(config config.HTTP) *gin.Engine

Types

type Router

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

func NewRouter

func NewRouter(app app.Application, authSvc grpc.AuthService) *Router

func (*Router) CreatePurchase

func (r *Router) CreatePurchase(c *gin.Context)

type Server

type Server struct {
	Engine *gin.Engine
	Router *Router
	// contains filtered or unexported fields
}

func NewHTTPServer

func NewHTTPServer(config config.HTTP, logger logger.Logger, engine *gin.Engine, router *Router) *Server

func (*Server) GracefulStop

func (srv *Server) GracefulStop(ctx context.Context) error

func (*Server) InitRoutes

func (srv *Server) InitRoutes()

func (*Server) Run

func (srv *Server) Run() error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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