Documentation ¶
Index ¶
- Constants
- Variables
- func DiscardCloseBody(r *http.Response) error
- func DurationOr(a, b time.Duration) time.Duration
- func If(condition bool, a, b string) string
- func IsJSONBytes(b []byte) bool
- func JoinURL(base *url.URL, target string) (string, error)
- func LogRequest(r *http.Request, verbose string)
- func LogResponse(r *http.Response, verbose string)
- func MaybeURL(out string) (string, bool)
- func ReadCloseBody(r *http.Response) ([]byte, error)
- type FixURIConfig
- type FixURIConfigFn
- type FixURIConfigFns
- type FixURIResult
- type Rest
- type Rsp
- type URL
Constants ¶
View Source
const ContentTypeJSON = "application/json; charset=utf-8"
Variables ¶
Functions ¶
func DiscardCloseBody ¶
func LogRequest ¶
func LogResponse ¶
Types ¶
type FixURIConfig ¶
type FixURIConfigFn ¶
type FixURIConfigFn func(*FixURIConfig)
func WithAuth ¶
func WithAuth(v string) FixURIConfigFn
func WithDefaultHost ¶
func WithDefaultHost(v string) FixURIConfigFn
func WithDefaultPort ¶
func WithDefaultPort(v int) FixURIConfigFn
func WithDefaultScheme ¶
func WithDefaultScheme(v string) FixURIConfigFn
func WithFatalErr ¶
func WithFatalErr(v bool) FixURIConfigFn
type FixURIConfigFns ¶
type FixURIConfigFns []FixURIConfigFn
func (FixURIConfigFns) Create ¶
func (fns FixURIConfigFns) Create() *FixURIConfig
type FixURIResult ¶
func FixURI ¶
func FixURI(uri string, fns ...FixURIConfigFn) (rr FixURIResult)
func (FixURIResult) OK ¶
func (r FixURIResult) OK() bool
type Rest ¶
Click to show internal directories.
Click to hide internal directories.