Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var OKDoneErr = errors.New("route done")
View Source
var OKNotDoneErr = errors.New("not done")
Functions ¶
This section is empty.
Types ¶
type FailableHandler ¶
type FailableHandler func(w http.ResponseWriter, r *http.Request) error
FailableHandler is an http.HandlerFunc that returns an error. oneshot uses this error to determine when to exit.
type Route ¶
type Route struct {
Pattern string
Methods []string
HandlerFunc FailableHandler
DoneHandlerFunc http.HandlerFunc
MaxOK int64
MaxRequests int64
sync.Mutex
// contains filtered or unexported fields
}
func (*Route) RequestCount ¶
type Server ¶
type Server struct {
Host string
Port string
// Certfile is the public certificate that should be used for TLS
CertFile string
// Keyfile is the private key that should be used for TLS
KeyFile string
// Done signals when the server has shutdown regardless of value.
// Each route that finished will have an error message in the map.
// Routes that finish successfully will have an OKDoneErr error.
Done chan map[*Route]error
ErrorLog *log.Logger
InfoLog *log.Logger
HostAddresses []string
sync.Mutex
// contains filtered or unexported fields
}
func (*Server) HandleIcon ¶
func (s *Server) HandleIcon(w http.ResponseWriter, r *http.Request)
Click to show internal directories.
Click to hide internal directories.