server

package
v0.17.0 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2024 License: Apache-2.0 Imports: 5 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewHttpHandler

func NewHttpHandler(httpType HTTPType, method string, handler ...gin.HandlerFunc) func() IHandler

Types

type HTTPType

type HTTPType string
const (
	MethodGet    HTTPType = "GET"
	MethodPost   HTTPType = "POST"
	MethodPut    HTTPType = "PUT"
	MethodDelete HTTPType = "DELETE"
)

type Handler

type Handler struct {
	HttpType HTTPType
	Method   string
	Handler  []gin.HandlerFunc
}

func (*Handler) GetHandler

func (h *Handler) GetHandler() []gin.HandlerFunc

func (*Handler) GetHttpType

func (h *Handler) GetHttpType() HTTPType

func (*Handler) GetMethod

func (h *Handler) GetMethod() string

type HttpBuilder

type HttpBuilder interface {
	SetPort(port string) HttpBuilder
	SetStatics(statics map[string]string) HttpBuilder
	SetWriteTimeout(d time.Duration) HttpBuilder
	SetReadTimeout(d time.Duration) HttpBuilder
	SetLogger(logger log.Logger) HttpBuilder
	AddApiInterceptors(...gin.HandlerFunc) HttpBuilder
	AddRouterInterceptors(...gin.HandlerFunc) HttpBuilder
	AddSystemHandlers(...IHandler) HttpBuilder
	Build(lifecycle fx.Lifecycle) gin.IRouter
	SetDiscoveryServiceProvider(dsp discoveryService.DiscoveryServiceProvider) HttpBuilder
}

type IHandler

type IHandler interface {
	GetHttpType() HTTPType
	GetMethod() string
	GetHandler() []gin.HandlerFunc
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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