Documentation
¶
Index ¶
- Constants
- func HeaderString(h http.Header) string
- func HeaderTo(h http.Header, s any) (err error)
- func IsEmpty(s string) bool
- func Marshal(v any, omitempty bool) (s string, omit bool)
- func OmitEmpty(flags []string) bool
- func UrlJoin(s ...any) string
- type Client
- func (o *Client) Copy() *Client
- func (o *Client) Delete(url string) *Performer
- func (o *Client) Get(url string) *Performer
- func (o *Client) Post(url string) *Performer
- func (o *Client) Put(url string) *Performer
- func (o *Client) Request(method string, url string) *Performer
- func (o *Client) Timeout() time.Duration
- func (o *Client) Transport() *http.Transport
- func (o *Client) Url(url string) string
- func (o *Client) WithAppendPath(path string) *Client
- func (o *Client) WithBase(base string) *Client
- func (o *Client) WithPath(path string) *Client
- func (o *Client) WithProxy(proxy string) *Client
- func (o *Client) WithProxyUrl(url *url.URL) *Client
- func (o *Client) WithProxyUrlLegacy(url *url.URL) *Client
- func (o *Client) WithTimeout(timeout time.Duration) *Client
- func (o *Client) WithTrace(trace func(Responce)) *Client
- func (o *Client) WithTransport(transport *http.Transport) *Client
- type Format
- type Performer
- func (o *Performer) Auth(v string) *Performer
- func (o *Performer) AuthBearer(token string) *Performer
- func (o *Performer) Body(body []byte) *Performer
- func (o *Performer) ContentType(v string) *Performer
- func (o *Performer) ContentTypeJson() *Performer
- func (o *Performer) Do() (r Responce)
- func (o *Performer) Header(name string, value any) *Performer
- func (o *Performer) Headers(s any) *Performer
- func (o *Performer) Json(v any) *Performer
- func (o *Performer) Param(name string, value any) *Performer
- func (o *Performer) Params(s any) *Performer
- func (o *Performer) Trace(trace func(Responce)) *Performer
- type Request
- type Responce
- func (o *Responce) BodyExists() bool
- func (o *Responce) Format(f Format) string
- func (o *Responce) HeaderExists(key string) bool
- func (o *Responce) HeaderFloat64(key string) (float64, error)
- func (o *Responce) HeaderInt64(key string) (int64, error)
- func (o *Responce) HeaderString() string
- func (o *Responce) HeaderTo(v any) error
- func (o *Responce) HeaderValue(key string) string
- func (o *Responce) Json(v any) error
- func (o *Responce) Ok() bool
- func (o *Responce) RefineError(text string, err error)
- func (o *Responce) Text() string
- func (o *Responce) Title() string
- type Tracer
Constants ¶
View Source
const ( UrlTag string = "url" HeaderTag string = "http" )
Variables ¶
This section is empty.
Functions ¶
func HeaderString ¶ added in v0.2.18
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) WithAppendPath ¶ added in v0.2.26
func (*Client) WithProxyUrlLegacy ¶ added in v0.3.13
type Performer ¶
type Performer struct {
Request Request
// contains filtered or unexported fields
}
func (*Performer) AuthBearer ¶
func (*Performer) ContentType ¶
func (*Performer) ContentTypeJson ¶
type Request ¶
func (*Request) BodyString ¶
func (*Request) HeaderString ¶
func (*Request) ParamsString ¶
type Responce ¶
type Responce struct {
Request Request
Time time.Duration
Status string
StatusCode int
Header http.Header
Body []byte
Error error
}
func (*Responce) BodyExists ¶ added in v0.2.24
func (*Responce) HeaderExists ¶ added in v0.2.18
func (*Responce) HeaderFloat64 ¶ added in v0.2.18
func (*Responce) HeaderInt64 ¶ added in v0.2.18
func (*Responce) HeaderString ¶ added in v0.2.18
func (*Responce) HeaderValue ¶ added in v0.2.18
func (*Responce) RefineError ¶
type Tracer ¶
type Tracer struct {
// contains filtered or unexported fields
}
func (*Tracer) WithFormat ¶ added in v0.2.17
func (*Tracer) WithFormatError ¶ added in v0.2.92
Click to show internal directories.
Click to hide internal directories.