Documentation ¶
Index ¶
- func CORSMiddleware() gin.HandlerFunc
- func GetRouter(mgr process.IManager) (*gin.Engine, error)
- func SetDebugMode(debug bool)
- func Spawn(mgr process.IManager, lgr logger.ILogger, config *Config) (*process.Process, error)
- type Config
- type Dispatcher
- type DispatcherProc
- type Document
- type ErrorDocument
- type IServer
- type Server
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CORSMiddleware ¶
func CORSMiddleware() gin.HandlerFunc
func SetDebugMode ¶
func SetDebugMode(debug bool)
Types ¶
type Config ¶
type Config struct { Addr string `json:"address"` Cert string `json:"cert_file"` Key string `json:"key_file"` UseTLS bool `json:"use_tls"` LogFile string `json:"log_file"` // contains filtered or unexported fields }
func NewDefaultConfig ¶
func NewDefaultConfig() *Config
type Dispatcher ¶
type Dispatcher struct {
// contains filtered or unexported fields
}
func NewDefaultDispatcher ¶
func NewDefaultDispatcher() *Dispatcher
func NewDispatcher ¶
func NewDispatcher(lgr logger.ILogger, config *Config) *Dispatcher
func (*Dispatcher) GetRouter ¶
func (d *Dispatcher) GetRouter() *gin.Engine
func (*Dispatcher) Start ¶
func (d *Dispatcher) Start()
func (*Dispatcher) Stop ¶
func (d *Dispatcher) Stop()
type DispatcherProc ¶
func NewDispatcherProc ¶
func NewDispatcherProc(lgr logger.ILogger, config *Config) *DispatcherProc
func (*DispatcherProc) Action ¶
func (p *DispatcherProc) Action(state **process.State)
type Document ¶
type Document struct { Data interface{} `json:"data,omitempty"` Count int64 `json:"count"` Error *ErrorDocument `json:"error,omitempty"` Elapsed string `json:"elapsed_time,omitempty"` // contains filtered or unexported fields }
nolint:govet
func NewDocument ¶
func NewErrorDocument ¶
func (*Document) SetError ¶
func (d *Document) SetError(err *ErrorDocument)
type ErrorDocument ¶
func NewError ¶
func NewError(status int, msg string) *ErrorDocument
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func NewDefaultServer ¶
func NewDefaultServer() *Server
func (*Server) ListenAndServe ¶
func (*Server) ListenAndServeTLS ¶
func (*Server) SetTLSConfig ¶
Click to show internal directories.
Click to hide internal directories.