Documentation ¶
Index ¶
- Constants
- func NewSimpleJSONResponse(obj interface{}) (http.Handler, error)
- func NewWriter(w http.ResponseWriter, stream io.Writer) http.ResponseWriter
- func RequestInvoke[T interface{}](invoker RequestInvoker, request *http.Request) (*T, int, error)
- func WithBuffer(maxSize int, in http.HandlerFunc) http.HandlerFunc
- func WithContentType(content string, in http.HandlerFunc) http.HandlerFunc
- func WithEncoding(in http.HandlerFunc) http.HandlerFunc
- func WithGZipEncoding(in http.HandlerFunc) http.HandlerFunc
- func WithIdentityEncoding(in http.HandlerFunc) http.HandlerFunc
- func WithNoContent(in http.HandlerFunc) http.HandlerFunc
- func WithTextContentType(in http.HandlerFunc) http.HandlerFunc
- type Buffer
- type Headers
- type PlainServer
- type RequestInvoker
- type Server
- type ServerRunner
Constants ¶
View Source
const ( EncodingAcceptHeader = "Accept-Encoding" EncodingResponseHeader = "Content-Encoding" )
View Source
const (
ContentLengthHeader = "Content-Length"
)
View Source
const ContentTypeHeader = "Content-Type"
Variables ¶
This section is empty.
Functions ¶
func NewSimpleJSONResponse ¶
NewSimpleJSONResponse returns handler which server static json on GET request
func NewWriter ¶
func NewWriter(w http.ResponseWriter, stream io.Writer) http.ResponseWriter
func RequestInvoke ¶
func RequestInvoke[T interface{}](invoker RequestInvoker, request *http.Request) (*T, int, error)
func WithBuffer ¶
func WithBuffer(maxSize int, in http.HandlerFunc) http.HandlerFunc
func WithContentType ¶
func WithContentType(content string, in http.HandlerFunc) http.HandlerFunc
func WithEncoding ¶
func WithEncoding(in http.HandlerFunc) http.HandlerFunc
func WithGZipEncoding ¶
func WithGZipEncoding(in http.HandlerFunc) http.HandlerFunc
func WithIdentityEncoding ¶
func WithIdentityEncoding(in http.HandlerFunc) http.HandlerFunc
func WithNoContent ¶
func WithNoContent(in http.HandlerFunc) http.HandlerFunc
func WithTextContentType ¶
func WithTextContentType(in http.HandlerFunc) http.HandlerFunc
Types ¶
type Headers ¶
func ParseHeaders ¶
type PlainServer ¶
type PlainServer interface { Server WithSSL(key, cert string) (Server, error) WithKeyfile(keyfile string) (Server, error) }
func NewServer ¶
func NewServer(server *http.Server) PlainServer
type RequestInvoker ¶
type Server ¶
type Server interface {
Start() (ServerRunner, error)
}
type ServerRunner ¶
type ServerRunner interface { Stop() Wait() error }
Click to show internal directories.
Click to hide internal directories.