ginserver

package
v1.5.7 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2025 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Controller

type Controller interface {
	Prefix() string
	Middlewares() []gin.HandlerFunc
	Routers() []Router
}

type GinHttp2Server

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

func NewHttp2

func NewHttp2(opts ...Option) *GinHttp2Server

func (*GinHttp2Server) Do

func (h2 *GinHttp2Server) Do(key string, fn func() (any, error)) (v any, err error, shared bool)

func (*GinHttp2Server) Name

func (h2 *GinHttp2Server) Name() string

func (*GinHttp2Server) Start

func (h2 *GinHttp2Server) Start(ctx context.Context) error

func (*GinHttp2Server) Stop

func (h2 *GinHttp2Server) Stop(ctx context.Context) error

type GinHttpServer

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

func NewHttp

func NewHttp(opts ...Option) *GinHttpServer

func (*GinHttpServer) Do

func (h *GinHttpServer) Do(key string, fn func() (any, error)) (v any, err error, shared bool)

func (*GinHttpServer) Name

func (h *GinHttpServer) Name() string

func (*GinHttpServer) Start

func (h *GinHttpServer) Start(ctx context.Context) error

func (*GinHttpServer) Stop

func (h *GinHttpServer) Stop(ctx context.Context) error

type Option

type Option func(opt *option)

func WithDELETE

func WithDELETE(path string, hs ...gin.HandlerFunc) Option

func WithGET

func WithGET(path string, hs ...gin.HandlerFunc) Option

func WithHandlers

func WithHandlers(handles ...Controller) Option

func WithMiddleware

func WithMiddleware(handles ...gin.HandlerFunc) Option

func WithName

func WithName(name string) Option

func WithPOST

func WithPOST(path string, hs ...gin.HandlerFunc) Option

func WithPUT

func WithPUT(path string, hs ...gin.HandlerFunc) Option

func WithPort

func WithPort(port string) Option

func WithTLS

func WithTLS(cert, key string) Option

func WithValidator

func WithValidator(v ...validation.Validation) Option

type Router

type Router struct {
	Method string
	Path   string
	Handle []gin.HandlerFunc
}

func NewRouter

func NewRouter(method, path string, handles ...gin.HandlerFunc) Router

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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