Documentation
¶
Index ¶
- Constants
- func DefaultHTTPServerSettings(in *http.Server, _ context.Context) error
- func Download(ctx context.Context, client *http.Client, format string, args ...interface{}) ([]byte, error)
- func InitConfiguration(cmd *cobra.Command) error
- func Insecure(in *tls.Config)
- func NewError(code int, format string, args ...any) error
- func NewSimpleJSONResponse(obj interface{}) (http.Handler, error)
- func NewWriter(w http.ResponseWriter, stream io.Writer) http.ResponseWriter
- func RoundTripper(mods ...mod.Mod[*http.Transport]) http.RoundTripper
- func RoundTripperWithShortTransport(mods ...mod.Mod[*http.Transport]) http.RoundTripper
- func Transport(mods ...mod.Mod[*http.Transport]) http.RoundTripper
- 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 WithRootCA(ca *x509.CertPool) mod.Mod[*tls.Config]
- func WithServeMux(mods ...util.Mod[http.ServeMux]) util.ModEP1[http.Server, context.Context]
- func WithTLSConfigFetcher(fetcher util.TLSConfigFetcher) util.ModEP1[http.Server, context.Context]
- func WithTLSConfigFetcherGen(gen func() util.TLSConfigFetcher) util.ModEP1[http.Server, context.Context]
- func WithTextContentType(in http.HandlerFunc) http.HandlerFunc
- func WithTransportTLS(mods ...mod.Mod[*tls.Config]) mod.Mod[*http.Transport]
- func WrapError(code int, err error) error
- type Buffer
- type Error
- type Headers
- type Server
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 InitConfiguration ¶
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 RoundTripper ¶
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 WithServeMux ¶
func WithTLSConfigFetcher ¶
func WithTLSConfigFetcherGen ¶
func WithTextContentType ¶
func WithTextContentType(in http.HandlerFunc) http.HandlerFunc
func WithTransportTLS ¶
Types ¶
type Headers ¶
func ParseHeaders ¶
Click to show internal directories.
Click to hide internal directories.