Documentation ¶
Index ¶
- Constants
- func IsRedirect(statusCode int) bool
- type Client
- type Config
- type IClient
- type Jar
- func (j *Jar) DecodeGOB(data []byte) error
- func (j *Jar) EncodeGOB() ([]byte, error)
- func (j *Jar) MarshalJSON() ([]byte, error)
- func (j *Jar) Middleware(next lava.HandlerFunc) lava.HandlerFunc
- func (j *Jar) Peek(key string) *fasthttp.Cookie
- func (j *Jar) PeekValue(key string) []byte
- func (j *Jar) ReleaseCookie(key string)
- func (j *Jar) String() string
- func (j *Jar) UnmarshalJSON(data []byte) error
- type Params
- type Request
- func (req *Request) AddHeader(key, value string) *Request
- func (req *Request) SetBackoff(backoff retry.Backoff) *Request
- func (req *Request) SetBody(body any) *Request
- func (req *Request) SetContentType(contentType string) *Request
- func (req *Request) SetHeader(key, value string) *Request
- func (req *Request) SetParam(key, val string) *Request
- func (req *Request) SetParams(params map[string]string) *Request
- func (req *Request) SetQuery(query map[string]string) *Request
- type RequestConfig
Constants ¶
View Source
const (
Name = "resty"
)
Variables ¶
This section is empty.
Functions ¶
func IsRedirect ¶
IsRedirect returns true if the status code indicates a redirect.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is the IClient implementation
type Config ¶
type Config struct { BaseUrl string `yaml:"base_url"` ServiceName string `yaml:"service_name"` DefaultHeader map[string]string `yaml:"default_header"` DefaultContentType string `yaml:"default_content_type"` DefaultRetryCount uint32 `yaml:"default_retry_count"` DefaultRetryInterval time.Duration `yaml:"default_retry_interval"` BasicToken string `yaml:"basic_token"` JwtToken string `yaml:"jwt_token"` EnableProxy bool `yaml:"enable_proxy"` EnableAuth bool `yaml:"enable_auth"` DialTimeout time.Duration `yaml:"dial_timeout"` ReadTimeout time.Duration `yaml:"read_timeout"` WriteTimeout time.Duration `yaml:"write_timeout"` MaxConnsPerHost int `yaml:"max_conns_per_host"` MaxIdleConnDuration time.Duration `yaml:"max_idle_conn_duration"` MaxIdemponentCallAttempts int `yaml:"max_idemponent_call_attempts"` ReadBufferSize int `yaml:"read_buffer_size"` WriteBufferSize int `yaml:"write_buffer_size"` MaxResponseBodySize int `yaml:"max_response_body_size"` }
func DefaultCfg ¶
func DefaultCfg() *Config
type Jar ¶
type Jar struct {
// contains filtered or unexported fields
}
func (*Jar) MarshalJSON ¶
func (*Jar) Middleware ¶
func (j *Jar) Middleware(next lava.HandlerFunc) lava.HandlerFunc
func (*Jar) ReleaseCookie ¶
func (*Jar) UnmarshalJSON ¶
type Request ¶
type Request struct {
// contains filtered or unexported fields
}
func NewRequest ¶
func NewRequest(cfg *RequestConfig) *Request
func (*Request) SetContentType ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.