Documentation ¶
Index ¶
- Constants
- func InitPeerMeta() map[string]string
- type HttpMux
- type ListableMux
- func (mux *ListableMux) Handle(pattern string, handler http.Handler)
- func (mux *ListableMux) HandleFunc(pattern string, handler func(http.ResponseWriter, *http.Request))
- func (mux *ListableMux) Handler(r *http.Request) (h http.Handler, pattern string)
- func (mux *ListableMux) Patterns() (patterns []string)
- func (mux *ListableMux) ServeHTTP(w http.ResponseWriter, r *http.Request)
- type PatternsProvider
- type RawServer
- type Server
- type ServerOption
- type ServerOptions
- type ServerType
Constants ¶
const ( NodeMetaPID = "PID" NodeMetaParentPID = "parentPID" NodeMetaMetrics = "metrics" NodeMetaStartTag = "start" NodeMetaHostName = "hostname" )
Variables ¶
This section is empty.
Functions ¶
func InitPeerMeta ¶
Types ¶
type ListableMux ¶
type ListableMux struct {
// contains filtered or unexported fields
}
ListableMux is a simple rewrite of http.ServeMux with accessor to the list of registered patterns
func NewListableMux ¶
func NewListableMux() *ListableMux
NewListableMux allocates and returns a new ListableMux.
func (*ListableMux) Handle ¶
func (mux *ListableMux) Handle(pattern string, handler http.Handler)
Handle registers the handler for the given pattern. If a handler already exists for pattern, Handle panics.
func (*ListableMux) HandleFunc ¶
func (mux *ListableMux) HandleFunc(pattern string, handler func(http.ResponseWriter, *http.Request))
HandleFunc registers the handler function for the given pattern.
func (*ListableMux) Handler ¶
Handler returns the handler to use for the given request, consulting r.Method, r.Host, and r.URL.Path. It always returns a non-nil handler. If the path is not in its canonical form, the handler will be an internally-generated handler that redirects to the canonical path. If the host contains a port, it is ignored when matching handlers.
The path and host are used unchanged for CONNECT requests.
Handler also returns the registered pattern that matches the request or, in the case of internally-generated redirects, the pattern that will match after following the redirect.
If there is no registered handler that applies to the request, Handler returns a “page not found” handler and an empty pattern.
func (*ListableMux) Patterns ¶
func (mux *ListableMux) Patterns() (patterns []string)
Patterns list registered patterns using the internal lock on the mux.m map
func (*ListableMux) ServeHTTP ¶
func (mux *ListableMux) ServeHTTP(w http.ResponseWriter, r *http.Request)
ServeHTTP dispatches the request to the handler whose pattern most closely matches the request URL.
type PatternsProvider ¶
type PatternsProvider interface {
Patterns() []string
}
type Server ¶
type ServerOption ¶
type ServerOption func(*ServerOptions)
ServerOption is a function to set ServerOptions
func AfterServe ¶
func AfterServe(f func() error) ServerOption
func AfterStop ¶
func AfterStop(f func() error) ServerOption
func BeforeServe ¶
func BeforeServe(f func() error) ServerOption
BeforeServe executes function before starting the server
func BeforeStop ¶
func BeforeStop(f func() error) ServerOption
func OnServeError ¶
func OnServeError(f func(error)) ServerOption
type ServerOptions ¶
type ServerOptions struct { Context context.Context Listener *net.Listener // Before and After funcs BeforeServe []func() error AfterServe []func() error BeforeStop []func() error AfterStop []func() error // contains filtered or unexported fields }
ServiceOptions stores all options for a pydio service
type ServerType ¶
type ServerType int8
const ( ServerType_GRPC ServerType = iota ServerType_HTTP ServerType_GENERIC ServerType_FORK )
Directories ¶
Path | Synopsis |
---|---|
Package servercontext performs context values read/write, generally through server or client wrappers
|
Package servercontext performs context values read/write, generally through server or client wrappers |