servers

package
v1.6.7 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2019 License: MIT Imports: 1 Imported by: 0

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

Jump to

Keyboard shortcuts

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