Documentation ¶
Index ¶
Constants ¶
View Source
const ( DefaultOfflineText = "sorry, server is offline!" NotSetOfflineText = "why you come here?" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type OfflineServer ¶
type OfflineServer struct {
// contains filtered or unexported fields
}
func (*OfflineServer) IsOffline ¶
func (server *OfflineServer) IsOffline() bool
func (*OfflineServer) ServeHTTP ¶
func (server *OfflineServer) ServeHTTP(w http.ResponseWriter, req *http.Request)
ServeHTTP makes the httprouter implement the http.Handler interface.
func (*OfflineServer) SetOffline ¶
func (server *OfflineServer) SetOffline(offline bool, offlineText string, offlineUrl string)
type Server ¶
type Server interface { //ServeHTTP make sure request can be handled correctly ServeHTTP(w http.ResponseWriter, req *http.Request) //SetOffline set server offline config SetOffline(offline bool, offlineText string, offlineUrl string) //IsOffline check server is set offline state IsOffline() bool }
func NewOfflineServer ¶
func NewOfflineServer() Server
Click to show internal directories.
Click to hide internal directories.