Documentation
¶
Index ¶
- type DefinedStream
- type FastHTTPContext
- func (c *FastHTTPContext) AddResponseHeader(name string, value string)
- func (c *FastHTTPContext) AddTiming(name string, desc string, d time.Duration)
- func (c *FastHTTPContext) AddTimingInformational(name string, desc string)
- func (c *FastHTTPContext) DoRedirect(location string, code int)
- func (c *FastHTTPContext) GetBody() io.Reader
- func (c *FastHTTPContext) GetConnectionTime() time.Time
- func (c *FastHTTPContext) GetExtraHeaders() map[string]string
- func (c *FastHTTPContext) GetHost() string
- func (c *FastHTTPContext) GetPath() string
- func (c *FastHTTPContext) GetProtocol() string
- func (c *FastHTTPContext) GetRequestHeader(name string) string
- func (c *FastHTTPContext) GetRequestTime() time.Time
- func (c *FastHTTPContext) GetResponseHeader(name string) string
- func (c *FastHTTPContext) GetTLSCipher() uint16
- func (c *FastHTTPContext) GetTLSServerName() string
- func (c *FastHTTPContext) GetTLSVersion() uint16
- func (c *FastHTTPContext) IsGet() bool
- func (c *FastHTTPContext) IsHead() bool
- func (c *FastHTTPContext) IsOptions() bool
- func (c *FastHTTPContext) IsPost() bool
- func (c *FastHTTPContext) ServeBytes(content []byte)
- func (c *FastHTTPContext) ServeStream(stream Stream)
- func (c *FastHTTPContext) SetResponseCode(code int)
- func (c *FastHTTPContext) SetResponseHeader(name string, value string)
- type FastHTTPRequestServer
- type FileStream
- type NetHTTPContext
- func (c *NetHTTPContext) AddResponseHeader(name string, value string)
- func (c *NetHTTPContext) AddTiming(name string, desc string, d time.Duration)
- func (c *NetHTTPContext) AddTimingInformational(name string, desc string)
- func (c *NetHTTPContext) DoRedirect(location string, code int)
- func (c *NetHTTPContext) GetBody() io.Reader
- func (c *NetHTTPContext) GetConnectionTime() time.Time
- func (c *NetHTTPContext) GetExtraHeaders() map[string]string
- func (c *NetHTTPContext) GetHost() string
- func (c *NetHTTPContext) GetPath() string
- func (c *NetHTTPContext) GetProtocol() string
- func (c *NetHTTPContext) GetRequestHeader(name string) string
- func (c *NetHTTPContext) GetRequestTime() time.Time
- func (c *NetHTTPContext) GetResponseHeader(name string) string
- func (c *NetHTTPContext) GetTLSCipher() uint16
- func (c *NetHTTPContext) GetTLSServerName() string
- func (c *NetHTTPContext) GetTLSVersion() uint16
- func (c *NetHTTPContext) IsGet() bool
- func (c *NetHTTPContext) IsHead() bool
- func (c *NetHTTPContext) IsOptions() bool
- func (c *NetHTTPContext) IsPost() bool
- func (c *NetHTTPContext) ServeBytes(content []byte)
- func (c *NetHTTPContext) ServeStream(stream Stream)
- func (c *NetHTTPContext) SetResponseCode(code int)
- func (c *NetHTTPContext) SetResponseHeader(name string, value string)
- type NetHTTPRequestServer
- type RequestContext
- type RequestHandler
- type SeekableStream
- type Server
- type Stream
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DefinedStream ¶
type DefinedStream interface {
SeekableStream
Size() int64
ModTime() time.Time
}
func NewStreamFromFile ¶
func NewStreamFromFile(file *os.File) DefinedStream
type FastHTTPContext ¶
type FastHTTPContext struct {
// contains filtered or unexported fields
}
func NewRequestContextFromFastHttp ¶
func NewRequestContextFromFastHttp(server *Server, ctx *fasthttp.RequestCtx) *FastHTTPContext
func (*FastHTTPContext) AddResponseHeader ¶
func (c *FastHTTPContext) AddResponseHeader(name string, value string)
func (*FastHTTPContext) AddTiming ¶
func (c *FastHTTPContext) AddTiming(name string, desc string, d time.Duration)
func (*FastHTTPContext) AddTimingInformational ¶
func (c *FastHTTPContext) AddTimingInformational(name string, desc string)
func (*FastHTTPContext) DoRedirect ¶
func (c *FastHTTPContext) DoRedirect(location string, code int)
func (*FastHTTPContext) GetBody ¶
func (c *FastHTTPContext) GetBody() io.Reader
func (*FastHTTPContext) GetConnectionTime ¶
func (c *FastHTTPContext) GetConnectionTime() time.Time
func (*FastHTTPContext) GetExtraHeaders ¶
func (c *FastHTTPContext) GetExtraHeaders() map[string]string
func (*FastHTTPContext) GetHost ¶
func (c *FastHTTPContext) GetHost() string
func (*FastHTTPContext) GetPath ¶
func (c *FastHTTPContext) GetPath() string
func (*FastHTTPContext) GetProtocol ¶
func (c *FastHTTPContext) GetProtocol() string
func (*FastHTTPContext) GetRequestHeader ¶
func (c *FastHTTPContext) GetRequestHeader(name string) string
func (*FastHTTPContext) GetRequestTime ¶
func (c *FastHTTPContext) GetRequestTime() time.Time
func (*FastHTTPContext) GetResponseHeader ¶
func (c *FastHTTPContext) GetResponseHeader(name string) string
func (*FastHTTPContext) GetTLSCipher ¶
func (c *FastHTTPContext) GetTLSCipher() uint16
func (*FastHTTPContext) GetTLSServerName ¶
func (c *FastHTTPContext) GetTLSServerName() string
func (*FastHTTPContext) GetTLSVersion ¶
func (c *FastHTTPContext) GetTLSVersion() uint16
func (*FastHTTPContext) IsGet ¶
func (c *FastHTTPContext) IsGet() bool
func (*FastHTTPContext) IsHead ¶
func (c *FastHTTPContext) IsHead() bool
func (*FastHTTPContext) IsOptions ¶
func (c *FastHTTPContext) IsOptions() bool
func (*FastHTTPContext) IsPost ¶
func (c *FastHTTPContext) IsPost() bool
func (*FastHTTPContext) ServeBytes ¶
func (c *FastHTTPContext) ServeBytes(content []byte)
func (*FastHTTPContext) ServeStream ¶
func (c *FastHTTPContext) ServeStream(stream Stream)
func (*FastHTTPContext) SetResponseCode ¶
func (c *FastHTTPContext) SetResponseCode(code int)
func (*FastHTTPContext) SetResponseHeader ¶
func (c *FastHTTPContext) SetResponseHeader(name string, value string)
type FastHTTPRequestServer ¶
type FastHTTPRequestServer func(ctx *fasthttp.RequestCtx) RequestContext
type FileStream ¶
type FileStream struct {
// contains filtered or unexported fields
}
func (*FileStream) Close ¶
func (fs *FileStream) Close() error
func (*FileStream) ModTime ¶
func (fs *FileStream) ModTime() time.Time
func (*FileStream) Size ¶
func (fs *FileStream) Size() int64
type NetHTTPContext ¶
type NetHTTPContext struct {
// contains filtered or unexported fields
}
func NewRequestContextFromHttp ¶
func NewRequestContextFromHttp(server *Server, w http.ResponseWriter, r *http.Request) *NetHTTPContext
func (*NetHTTPContext) AddResponseHeader ¶
func (c *NetHTTPContext) AddResponseHeader(name string, value string)
func (*NetHTTPContext) AddTiming ¶
func (c *NetHTTPContext) AddTiming(name string, desc string, d time.Duration)
func (*NetHTTPContext) AddTimingInformational ¶
func (c *NetHTTPContext) AddTimingInformational(name string, desc string)
func (*NetHTTPContext) DoRedirect ¶
func (c *NetHTTPContext) DoRedirect(location string, code int)
func (*NetHTTPContext) GetBody ¶
func (c *NetHTTPContext) GetBody() io.Reader
func (*NetHTTPContext) GetConnectionTime ¶
func (c *NetHTTPContext) GetConnectionTime() time.Time
func (*NetHTTPContext) GetExtraHeaders ¶
func (c *NetHTTPContext) GetExtraHeaders() map[string]string
func (*NetHTTPContext) GetHost ¶
func (c *NetHTTPContext) GetHost() string
func (*NetHTTPContext) GetPath ¶
func (c *NetHTTPContext) GetPath() string
func (*NetHTTPContext) GetProtocol ¶
func (c *NetHTTPContext) GetProtocol() string
func (*NetHTTPContext) GetRequestHeader ¶
func (c *NetHTTPContext) GetRequestHeader(name string) string
func (*NetHTTPContext) GetRequestTime ¶
func (c *NetHTTPContext) GetRequestTime() time.Time
func (*NetHTTPContext) GetResponseHeader ¶
func (c *NetHTTPContext) GetResponseHeader(name string) string
func (*NetHTTPContext) GetTLSCipher ¶
func (c *NetHTTPContext) GetTLSCipher() uint16
func (*NetHTTPContext) GetTLSServerName ¶
func (c *NetHTTPContext) GetTLSServerName() string
func (*NetHTTPContext) GetTLSVersion ¶
func (c *NetHTTPContext) GetTLSVersion() uint16
func (*NetHTTPContext) IsGet ¶
func (c *NetHTTPContext) IsGet() bool
func (*NetHTTPContext) IsHead ¶
func (c *NetHTTPContext) IsHead() bool
func (*NetHTTPContext) IsOptions ¶
func (c *NetHTTPContext) IsOptions() bool
func (*NetHTTPContext) IsPost ¶
func (c *NetHTTPContext) IsPost() bool
func (*NetHTTPContext) ServeBytes ¶
func (c *NetHTTPContext) ServeBytes(content []byte)
func (*NetHTTPContext) ServeStream ¶
func (c *NetHTTPContext) ServeStream(stream Stream)
func (*NetHTTPContext) SetResponseCode ¶
func (c *NetHTTPContext) SetResponseCode(code int)
func (*NetHTTPContext) SetResponseHeader ¶
func (c *NetHTTPContext) SetResponseHeader(name string, value string)
type NetHTTPRequestServer ¶
type NetHTTPRequestServer func(w http.ResponseWriter, r *http.Request) RequestContext
type RequestContext ¶
type RequestContext interface {
GetPath() string
GetConnectionTime() time.Time
GetRequestTime() time.Time
GetTLSServerName() string
GetBody() io.Reader
GetHost() string
GetProtocol() string
GetTLSVersion() uint16
GetTLSCipher() uint16
GetRequestHeader(name string) string
GetResponseHeader(name string) string
AddResponseHeader(name string, value string)
SetResponseHeader(name string, value string)
ServeStream(stream Stream)
ServeBytes(content []byte)
SetResponseCode(code int)
DoRedirect(location string, code int)
IsGet() bool
IsPost() bool
IsOptions() bool
IsHead() bool
GetExtraHeaders() map[string]string
AddTiming(name string, desc string, d time.Duration)
AddTimingInformational(name string, desc string)
}
type RequestHandler ¶
type RequestHandler func(ctx RequestContext)
type SeekableStream ¶
type Server ¶
type Server struct {
ListenAddress string
TLSConfig *tlsutils.Configuration
UseFastHTTP bool
EnableHTTP2 bool
FastHTTPRequestServer FastHTTPRequestServer
NetHTTPRequestServer NetHTTPRequestServer
EnableHTTP3 bool
Debug bool
Handler RequestHandler
ReadTimeout time.Duration
WriteTimeout time.Duration
IdleTimeout time.Duration
// contains filtered or unexported fields
}
func (*Server) AddExtraHeader ¶
func (*Server) GetExtraHeaders ¶
Click to show internal directories.
Click to hide internal directories.