Documentation
¶
Index ¶
- Constants
- Variables
- func IsMethodValid(method string) bool
- func IsStatusCodeValid(status int) bool
- func IsSuccess(status int) bool
- func LogDebug(r *http.Request) *zerolog.Event
- func LogError(r *http.Request) *zerolog.Event
- func LogInfo(r *http.Request) *zerolog.Event
- func LogWarn(r *http.Request) *zerolog.Event
- func ReadAllBody(resp *http.Response) (b []byte, release func([]byte), err error)
- type AcceptContentType
- type ContentType
- type InterceptFunc
- type InterceptedTransport
- type ModifyResponseFunc
- type ModifyResponseWriter
- func (w *ModifyResponseWriter) Flush()
- func (w *ModifyResponseWriter) Header() http.Header
- func (w *ModifyResponseWriter) Hijack() (net.Conn, *bufio.ReadWriter, error)
- func (w *ModifyResponseWriter) Size() int
- func (w *ModifyResponseWriter) StatusCode() int
- func (w *ModifyResponseWriter) Unwrap() http.ResponseWriter
- func (w *ModifyResponseWriter) Write(b []byte) (int, error)
- func (w *ModifyResponseWriter) WriteHeader(code int)
Constants ¶
View Source
const ( ContentTypeJSON = ContentType("application/json") ContentTypeTextPlain = ContentType("text/plain") ContentTypeTextHTML = ContentType("text/html") ContentTypeTextMarkdown = ContentType("text/markdown") ContentTypeTextXML = ContentType("text/xml") ContentTypeXHTML = ContentType("application/xhtml+xml") )
Variables ¶
View Source
var ErrRequestIntercepted = errors.New("docker request intercepted")
Functions ¶
func IsMethodValid ¶ added in v0.4.0
func IsStatusCodeValid ¶ added in v0.4.0
Types ¶
type AcceptContentType ¶ added in v0.4.0
type AcceptContentType []ContentType
func GetAccept ¶ added in v0.4.0
func GetAccept(h http.Header) AcceptContentType
func (AcceptContentType) AcceptHTML ¶ added in v0.4.0
func (act AcceptContentType) AcceptHTML() bool
func (AcceptContentType) AcceptJSON ¶ added in v0.4.0
func (act AcceptContentType) AcceptJSON() bool
func (AcceptContentType) AcceptMarkdown ¶ added in v0.4.0
func (act AcceptContentType) AcceptMarkdown() bool
func (AcceptContentType) AcceptPlainText ¶ added in v0.4.0
func (act AcceptContentType) AcceptPlainText() bool
func (AcceptContentType) IsEmpty ¶ added in v0.4.0
func (act AcceptContentType) IsEmpty() bool
type ContentType ¶ added in v0.4.0
type ContentType string
func GetContentType ¶ added in v0.4.0
func GetContentType(h http.Header) ContentType
func (ContentType) IsHTML ¶ added in v0.4.0
func (ct ContentType) IsHTML() bool
func (ContentType) IsJSON ¶ added in v0.4.0
func (ct ContentType) IsJSON() bool
func (ContentType) IsPlainText ¶ added in v0.4.0
func (ct ContentType) IsPlainText() bool
type InterceptFunc ¶ added in v0.7.0
type InterceptedTransport ¶ added in v0.7.0
type InterceptedTransport struct {
// contains filtered or unexported fields
}
InterceptedTransport wraps an http.RoundTripper to intercept Docker responses
func NewInterceptedTransport ¶ added in v0.7.0
func NewInterceptedTransport(transport http.RoundTripper, intercept InterceptFunc) *InterceptedTransport
type ModifyResponseFunc ¶ added in v0.4.0
type ModifyResponseWriter ¶ added in v0.4.0
type ModifyResponseWriter struct {
// contains filtered or unexported fields
}
func NewModifyResponseWriter ¶ added in v0.4.0
func NewModifyResponseWriter(w http.ResponseWriter, r *http.Request, f ModifyResponseFunc) *ModifyResponseWriter
func (*ModifyResponseWriter) Flush ¶ added in v0.4.0
func (w *ModifyResponseWriter) Flush()
Flush sends any buffered data to the client.
func (*ModifyResponseWriter) Header ¶ added in v0.4.0
func (w *ModifyResponseWriter) Header() http.Header
func (*ModifyResponseWriter) Hijack ¶ added in v0.4.0
func (w *ModifyResponseWriter) Hijack() (net.Conn, *bufio.ReadWriter, error)
Hijack hijacks the connection.
func (*ModifyResponseWriter) Size ¶ added in v0.4.0
func (w *ModifyResponseWriter) Size() int
func (*ModifyResponseWriter) StatusCode ¶ added in v0.4.0
func (w *ModifyResponseWriter) StatusCode() int
func (*ModifyResponseWriter) Unwrap ¶ added in v0.4.0
func (w *ModifyResponseWriter) Unwrap() http.ResponseWriter
func (*ModifyResponseWriter) Write ¶ added in v0.4.0
func (w *ModifyResponseWriter) Write(b []byte) (int, error)
func (*ModifyResponseWriter) WriteHeader ¶ added in v0.4.0
func (w *ModifyResponseWriter) WriteHeader(code int)
Source Files
¶
Click to show internal directories.
Click to hide internal directories.