Documentation
¶
Index ¶
- Variables
- func FormatText(text string, entities []telego.MessageEntity) string
- func RandomString(n int) string
- func ReleaseRequestResources(request *fasthttp.Request, response *fasthttp.Response)
- func Request(Link string, params RequestParams) (*fasthttp.Request, *fasthttp.Response, error)
- func ResizeSticker(input []byte) (*os.File, error)
- func ResizeThumbnail(thumbnail *os.File) error
- type FastHTTPCaller
- type RequestParams
- type RetryCaller
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultFastHTTPCaller = &FastHTTPCaller{ Client: &fasthttp.Client{ ReadBufferSize: 16 * 1024, MaxConnsPerHost: 1024, }, }
View Source
var ErrMaxRetryAttempts = errors.New("max retry attempts reached")
Functions ¶
func FormatText ¶
func FormatText(text string, entities []telego.MessageEntity) string
func RandomString ¶
func ReleaseRequestResources ¶
func ResizeThumbnail ¶
Types ¶
type FastHTTPCaller ¶
func (FastHTTPCaller) Call ¶
func (a FastHTTPCaller) Call(url string, params RequestParams) (*fasthttp.Request, *fasthttp.Response, error)
type RequestParams ¶
type RequestParams struct {
Method string // "GET", "OPTIONS" or "POST"
Redirects int // Number of redirects to follow
Proxy bool // Use proxy for the request
Headers map[string]string // Common headers for both GET and POST
Query map[string]string // Query parameters for GET
BodyString []string // Body of the request for POST
}
type RetryCaller ¶
type RetryCaller struct {
Caller *FastHTTPCaller
MaxAttempts int
ExponentBase float64
StartDelay time.Duration
MaxDelay time.Duration
}
func (*RetryCaller) Request ¶
func (r *RetryCaller) Request(url string, params RequestParams) (*fasthttp.Request, *fasthttp.Response, error)
Click to show internal directories.
Click to hide internal directories.