Documentation ¶
Index ¶
- type Buffer
- type File
- type HTTPServer
- func (s *HTTPServer) DefaultRoute(handlers ...HandlerFunc)
- func (s *HTTPServer) Enable() bool
- func (s *HTTPServer) Init(cfg *configure.Configure) error
- func (s *HTTPServer) Initer(i InitFunc)
- func (s *HTTPServer) Logger() *zap.Logger
- func (s *HTTPServer) Name() string
- func (s *HTTPServer) OnShutdown(f ShutdownFunc)
- func (s *HTTPServer) Route(relativePath string, handlers ...HandlerFunc)
- func (s *HTTPServer) RouterGroup(relativePath string, handlers ...HandlerFunc) RouterGroup
- func (s *HTTPServer) Server() *http.Server
- func (s *HTTPServer) Shutdown()
- type HandlerFunc
- type HandlersChain
- type IRoutes
- type InitFunc
- type JSON
- type Message
- type PorxyOptions
- type Proxy
- type ProxyOption
- type Reader
- type Request
- func (r *Request) BindArgument(any interface{}) error
- func (r *Request) BindBody(any interface{}) error
- func (r *Request) Exit(code int, message ...string) bool
- func (r *Request) Finalize()
- func (r *Request) GetConfig() *configure.ModuleConfig
- func (r *Request) GetFormFile(key string) (multipart.File, *multipart.FileHeader, error)
- func (r *Request) GetModuleCtx(name string) interface{}
- func (r *Request) GetMultipartForm() (*multipart.Form, error)
- func (r *Request) GetURLParam(key string) string
- func (r *Request) Logger() *zap.Logger
- func (r *Request) NextHandler() bool
- func (r *Request) ProxyPass(address string, opts ...ProxyOption) bool
- func (r *Request) ResponseWriter() gin.ResponseWriter
- func (r *Request) SendBody()
- func (r *Request) SendBuffer(reader io.Reader, size int64) bool
- func (r *Request) SendFile(filename string) bool
- func (r *Request) SendHeaders()
- func (r *Request) SendJSON(m interface{}) bool
- func (r *Request) SendString(message string) bool
- func (r *Request) SetModuleCtx(name string, ctx interface{})
- func (r *Request) WithArgs(args string) ProxyOption
- func (r *Request) WithBody(body interface{}) ProxyOption
- func (r *Request) WithHeaders(headers map[string]string) ProxyOption
- func (r *Request) WithMethod(method string) ProxyOption
- func (r *Request) WithScheme(scheme string) ProxyOption
- func (r *Request) WithURI(uri string) ProxyOption
- type RouterGroup
- type ShutdownFunc
- type Variable
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HTTPServer ¶
type HTTPServer struct {
// contains filtered or unexported fields
}
func NewHTTPServer ¶
func NewHTTPServer(name ...string) *HTTPServer
func (*HTTPServer) DefaultRoute ¶
func (s *HTTPServer) DefaultRoute(handlers ...HandlerFunc)
func (*HTTPServer) Enable ¶
func (s *HTTPServer) Enable() bool
func (*HTTPServer) Initer ¶
func (s *HTTPServer) Initer(i InitFunc)
func (*HTTPServer) Logger ¶
func (s *HTTPServer) Logger() *zap.Logger
func (*HTTPServer) Name ¶
func (s *HTTPServer) Name() string
func (*HTTPServer) OnShutdown ¶
func (s *HTTPServer) OnShutdown(f ShutdownFunc)
func (*HTTPServer) Route ¶
func (s *HTTPServer) Route(relativePath string, handlers ...HandlerFunc)
func (*HTTPServer) RouterGroup ¶
func (s *HTTPServer) RouterGroup(relativePath string, handlers ...HandlerFunc) RouterGroup
func (*HTTPServer) Server ¶
func (s *HTTPServer) Server() *http.Server
func (*HTTPServer) Shutdown ¶
func (s *HTTPServer) Shutdown()
type HandlerFunc ¶
type HandlersChain ¶
type HandlersChain []HandlerFunc
type IRoutes ¶
type IRoutes interface {
Route(string, ...HandlerFunc)
}
type InitFunc ¶
type InitFunc func(*configure.ServerConfigure) error
type PorxyOptions ¶
type Proxy ¶
type Proxy struct {
// contains filtered or unexported fields
}
func NewProxy ¶
func NewProxy(options PorxyOptions) *Proxy
type ProxyOption ¶
type ProxyOption func(*PorxyOptions)
type Request ¶
type Request struct { Context *gin.Context Var *Variable // request Method string Scheme string Host string Uri string RawArgs string Args map[string]string HeadersIn map[string]string BodyReader io.ReadCloser // response Status int HeadersOut map[string]string // contains filtered or unexported fields }
func NewRequest ¶
func NewRequest(c *gin.Context, server *HTTPServer) *Request
func (*Request) BindArgument ¶
func (*Request) GetConfig ¶
func (r *Request) GetConfig() *configure.ModuleConfig
func (*Request) GetFormFile ¶
func (*Request) GetModuleCtx ¶
func (*Request) GetURLParam ¶
func (*Request) NextHandler ¶
func (*Request) ResponseWriter ¶
func (r *Request) ResponseWriter() gin.ResponseWriter
func (*Request) SendHeaders ¶
func (r *Request) SendHeaders()
func (*Request) SendString ¶
func (*Request) SetModuleCtx ¶
func (*Request) WithArgs ¶
func (r *Request) WithArgs(args string) ProxyOption
func (*Request) WithBody ¶
func (r *Request) WithBody(body interface{}) ProxyOption
func (*Request) WithHeaders ¶
func (r *Request) WithHeaders(headers map[string]string) ProxyOption
func (*Request) WithMethod ¶
func (r *Request) WithMethod(method string) ProxyOption
func (*Request) WithScheme ¶
func (r *Request) WithScheme(scheme string) ProxyOption
func (*Request) WithURI ¶
func (r *Request) WithURI(uri string) ProxyOption
type RouterGroup ¶
type RouterGroup interface { Group(string, ...HandlerFunc) RouterGroup IRoutes }
type ShutdownFunc ¶
type ShutdownFunc func()
Click to show internal directories.
Click to hide internal directories.