Documentation ¶
Index ¶
- Constants
- type ClientFactory
- type Config
- func (c *Config) Add(protocol string, factory interface{})
- func (c *Config) Delete(protocol string)
- func (c *Config) Get(name string) ServerFactory
- func (c *Config) Load(core Core, protocol string) (server protocol.Server, err error)
- func (c *Config) LoadAll(core Core) (serverMap ServerMap, streamServerMap StreamServerMap, err error)
- func (c *Config) SetAltHeader(target, altHeader string)
- type Core
- type ServerFactory
- type ServerMap
- type StreamServerFactory
- type StreamServerMap
Constants ¶
View Source
const ( // must be the same with the ALPN nextProto values HTTP1 = "http/1.1" HTTP2 = "h2" // HTTP3Draft29 is the ALPN protocol negotiated during the TLS handshake, for QUIC draft 29. HTTP3Draft29 = "h3-29" // HTTP3 is the ALPN protocol negotiated during the TLS handshake, for QUIC v1 and v2. HTTP3 = "h3" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClientFactory ¶ added in v0.2.0
type ClientFactory interface {
NewHostClient() (hc client.HostClient, err error)
}
type Config ¶
type Config struct {
// contains filtered or unexported fields
}
func (*Config) Get ¶
func (c *Config) Get(name string) ServerFactory
func (*Config) LoadAll ¶
func (c *Config) LoadAll(core Core) (serverMap ServerMap, streamServerMap StreamServerMap, err error)
func (*Config) SetAltHeader ¶ added in v0.5.0
SetAltHeader will set response header "Alt-Svc" for the target protocol, altHeader will be the value of the header. Protocols other than the target protocol will carry the altHeader in the request header.
type Core ¶
type Core interface { // IsRunning Check whether engine is running or not IsRunning() bool // A RequestContext pool ready for protocol server impl GetCtxPool() *sync.Pool // Business logic entrance // After pre-read works, protocol server may call this method // to introduce the middlewares and handlers ServeHTTP(c context.Context, ctx *app.RequestContext) // GetTracer for tracing requirement GetTracer() tracer.Controller }
Core is the core interface that promises to be provided for the protocol layer extensions
type ServerFactory ¶
type StreamServerFactory ¶ added in v0.5.0
type StreamServerFactory interface {
New(core Core) (server protocol.StreamServer, err error)
}
type StreamServerMap ¶ added in v0.5.0
type StreamServerMap map[string]protocol.StreamServer
Click to show internal directories.
Click to hide internal directories.