Documentation
¶
Index ¶
- Constants
- type Option
- type Server
- func (server *Server) Event() chan uint8
- func (server *Server) Port() (int, error)
- func (server *Server) Ready() bool
- func (server *Server) Restart() error
- func (server *Server) Start() error
- func (server *Server) Stop() error
- func (server *Server) With(middlewares ...func(ctx *gin.Context)) *Server
Constants ¶
View Source
const ( // CREATED the server instance was created CREATED = uint8(iota) // STARTING the server instance is starting STARTING // READY the server instance is ready READY // RESTARTING the server instance is restarting RESTARTING // CLOSED the server instance was stopped CLOSED )
View Source
const ( // CLOSE close signal CLOSE = uint8(iota) // RESTART restart signal RESTART // ERROR error signal ERROR )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Option ¶
type Option struct {
Port int `json:"port,omitempty"`
Host string `json:"host,omitempty"`
Timeout time.Duration `json:"timeout,omitempty"`
Root string `json:"root,omitempty"` // API Root
Allows []string `json:"allows,omitempty"` // CORS Domains
}
Option the http server opiton
Click to show internal directories.
Click to hide internal directories.