Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConcurrentPool ¶
type ConcurrentPool struct {
// contains filtered or unexported fields
}
ConcurrentPool allows execute a few http requests in parallel, in case all pools is busy request goes to queue
func NewConcurrentPool ¶
func NewConcurrentPool(size int, timeout time.Duration, logger *zap.SugaredLogger) *ConcurrentPool
NewConcurrentPool Creates instance of ConcurrentPool
func (*ConcurrentPool) DefineHeaders ¶
func (s *ConcurrentPool) DefineHeaders(setHeaders SetHeaders)
DefineHeaders defines custom headers to all requests
func (*ConcurrentPool) IsEmptyPool ¶
func (s *ConcurrentPool) IsEmptyPool() bool
IsEmptyPool returns true if no requests in all pools
func (*ConcurrentPool) Request ¶
func (s *ConcurrentPool) Request(req HttpRequest)
Request sends http request get or post
type HttpRequest ¶
type HttpRequest struct { Method string Url string Payload *string PoolNum int // number of pool where it requested CallBack ResponseCallback }
type ResponseCallback ¶
type SetHeaders ¶
Click to show internal directories.
Click to hide internal directories.