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: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	OkMessage       = "success"
	ErrInvalidID    = "invalid id"
	ErrInvalidJSON  = "invalid json"
	ErrNotFound     = "not found"
	ErrInternal     = "internal error"
	ErrInvalidToken = "invalid token"
)

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(
	productApp app.ProductApplication,
	categoryApp app.CategoryApplication,
	authSvc grpc.AuthService) *Router

func (*Router) CreateCategory

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

func (*Router) CreateProduct

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

func (*Router) GetProduct

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

func (*Router) UpdateProductDetail

func (r *Router) UpdateProductDetail(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