Documentation
¶
Index ¶
- Constants
- type Headers
- type PriorityEntry
- type Reporter
- type ReporterManager
- type RequestQueue
- func (rq *RequestQueue) Delete(url string, data interface{}, priority int, due time.Time)
- func (rq *RequestQueue) DeleteWithHeaders(url string, data interface{}, priority int, due time.Time, headers Headers)
- func (rq *RequestQueue) Patch(url string, data interface{}, priority int, due time.Time)
- func (rq *RequestQueue) PatchWithHeaders(url string, data interface{}, priority int, due time.Time, headers Headers)
- func (rq *RequestQueue) Post(url string, data interface{}, priority int, due time.Time)
- func (rq *RequestQueue) PostChunk(ctx context.Context, url string, data interface{}, priority int)
- func (rq *RequestQueue) PostWithHeaders(url string, data interface{}, priority int, due time.Time, headers Headers)
- func (rq *RequestQueue) Put(url string, data interface{}, priority int, due time.Time)
- func (rq *RequestQueue) Requeue(entry PriorityEntry) error
- type Session
- func (session *Session) CheckSession(ctx context.Context) bool
- func (session *Session) Delete(url string, rawBody interface{}, timeout time.Duration) ([]byte, int, error)
- func (session *Session) Get(url string, timeout time.Duration) ([]byte, int, error)
- func (session *Session) MultipartRequest(url string, body io.Reader, contentType string, contentLength int64, ...) ([]byte, int, error)
- func (session *Session) Patch(url string, rawBody interface{}, timeout time.Duration) ([]byte, int, error)
- func (session *Session) Post(url string, rawBody interface{}, timeout time.Duration) ([]byte, int, error)
- func (session *Session) Put(url string, rawBody interface{}, timeout time.Duration) ([]byte, int, error)
- func (session *Session) Request(method, url string, rawBody interface{}, timeout time.Duration) ([]byte, int, error)
- func (session *Session) RequestWithHeaders(method, url string, rawBody interface{}, timeout time.Duration, ...) ([]byte, int, error)
Constants ¶
View Source
const ( RetryLimit = 5 MaxQueueSize = 10 * 60 * 60 // 10 entries/second * 1h )
View Source
const (
MaxRetryTimeout = 3 * 24 * time.Hour
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PriorityEntry ¶
type PriorityEntry struct {
// contains filtered or unexported fields
}
queue //
type Reporter ¶
type Reporter struct {
// contains filtered or unexported fields
}
reporter //
func NewReporter ¶
type ReporterManager ¶
type ReporterManager struct {
// contains filtered or unexported fields
}
ReporterManager manages the lifecycle of multiple reporter goroutines
func StartReporters ¶
func StartReporters(session *Session, ctxManager *agent.ContextManager) *ReporterManager
type RequestQueue ¶
type RequestQueue struct {
// contains filtered or unexported fields
}
var (
Rqueue *RequestQueue
)
func (*RequestQueue) Delete ¶
func (rq *RequestQueue) Delete(url string, data interface{}, priority int, due time.Time)
func (*RequestQueue) DeleteWithHeaders ¶
func (*RequestQueue) Patch ¶
func (rq *RequestQueue) Patch(url string, data interface{}, priority int, due time.Time)
func (*RequestQueue) PatchWithHeaders ¶
func (*RequestQueue) Post ¶
func (rq *RequestQueue) Post(url string, data interface{}, priority int, due time.Time)
func (*RequestQueue) PostChunk ¶ added in v2.3.1
func (rq *RequestQueue) PostChunk(ctx context.Context, url string, data interface{}, priority int)
PostChunk enqueues a chunk, throttling the command while the queue is full and dropping past ctx/maxWait.
func (*RequestQueue) PostWithHeaders ¶
func (*RequestQueue) Put ¶
func (rq *RequestQueue) Put(url string, data interface{}, priority int, due time.Time)
func (*RequestQueue) Requeue ¶
func (rq *RequestQueue) Requeue(entry PriorityEntry) error
Requeue re-enqueues an entry under cond.L and signals waiting reporters.
type Session ¶
func InitSession ¶
func InitSession() *Session
func (*Session) MultipartRequest ¶
func (session *Session) MultipartRequest(url string, body io.Reader, contentType string, contentLength int64, timeout time.Duration) ([]byte, int, error)
MultipartRequest issues a POST with a multipart body. Pass contentLength=-1 to force chunked transfer; pass an exact byte count to use identity TE (avoids per-write chunk header overhead). Overwrites req.ContentLength unconditionally because http.NewRequest auto-fills it for bytes/strings readers, which would defeat a caller's -1 chunked opt-in.
Click to show internal directories.
Click to hide internal directories.