server

package
v0.0.0-...-1c24166 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2024 License: MIT Imports: 17 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Context

type Context struct {
	*gin.Context
}

func (*Context) GetError

func (c *Context) GetError() error

func (*Context) SetError

func (c *Context) SetError(err error)

func (*Context) ShouldBind

func (c *Context) ShouldBind(v any) error

func (*Context) ShouldBindQuery

func (c *Context) ShouldBindQuery(v any) error

func (*Context) ShouldBindUri

func (c *Context) ShouldBindUri(v any) error

type HandlerFunc

type HandlerFunc func(*Context)

type InitHttpServerFunc

type InitHttpServerFunc func(r *Server) error

type Option

type Option func(*Options)

func Addr

func Addr(s string) Option

func InitHttpServer

func InitHttpServer(f InitHttpServerFunc) Option

func Mode

func Mode(s string) Option

func Name

func Name(s string) Option

func Registry

func Registry(r registry.Registry) Option

func Tracing

func Tracing(b bool) Option

type Options

type Options struct {
	Name           string
	Addr           string
	InitHttpServer InitHttpServerFunc
	Mode           string
	Tracing        bool
	Registry       registry.Registry
}

type Server

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

func NewServer

func NewServer(opts ...Option) *Server

func (*Server) AnyEx

func (s *Server) AnyEx(path string, handlers ...HandlerFunc) *Server

func (*Server) DeleteEx

func (s *Server) DeleteEx(path string, handlers ...HandlerFunc) *Server

func (*Server) GetEx

func (s *Server) GetEx(path string, handlers ...HandlerFunc) *Server

func (*Server) HandleEx

func (s *Server) HandleEx(method, path string, handlers ...HandlerFunc) *Server

func (*Server) HeadEx

func (s *Server) HeadEx(path string, handlers ...HandlerFunc) *Server

func (*Server) Init

func (s *Server) Init(opts ...Option)

func (*Server) MatchEx

func (s *Server) MatchEx(methods []string, path string, handlers ...HandlerFunc) *Server

func (*Server) OptionsEx

func (s *Server) OptionsEx(path string, handlers ...HandlerFunc) *Server

func (*Server) PatchEx

func (s *Server) PatchEx(path string, handlers ...HandlerFunc) *Server

func (*Server) PostEx

func (s *Server) PostEx(path string, handlers ...HandlerFunc) *Server

func (*Server) PutEx

func (s *Server) PutEx(path string, handlers ...HandlerFunc) *Server

func (*Server) Start

func (s *Server) Start() error

func (*Server) Stop

func (s *Server) Stop() error

func (*Server) UseEx

func (s *Server) UseEx(middlewares ...HandlerFunc)

Directories

Path Synopsis
middleware

Jump to

Keyboard shortcuts

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