queue

package
v0.0.0-...-ae72c4d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 19, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrTooMany error = errors.New("too many requests")
View Source
var ErrTooManyRequests error = errors.New("too many requests")

Functions

This section is empty.

Types

type HeaderTransformer

type HeaderTransformer func(http.Header)

func (HeaderTransformer) ToRequestEditor

func (h HeaderTransformer) ToRequestEditor() RequestEditor

type Pop

type Pop func(ctx context.Context) (serialized []byte, e error)

func (Pop) ToRequestSource

func (p Pop) ToRequestSource(m RequestMetaSource) RequestSource

type PopKey

type PopKey[K any] func(ctx context.Context, key K) (serialized []byte, e error)

func (PopKey[K]) ToPop

func (k PopKey[K]) ToPop(key K) Pop

type PopSeed

type PopSeed[T any] func(ctx context.Context) (seed T, e error)

type PopSeedKey

type PopSeedKey[K, T any] func(ctx context.Context, key K) (seed T, e error)

func (PopSeedKey[K, T]) ToPopSeed

func (k PopSeedKey[K, T]) ToPopSeed(key K) PopSeed[T]

type Push

type Push[T any] func(ctx context.Context, seed T) error

func (Push[T]) SkipIfTooMany

func (p Push[T]) SkipIfTooMany(ctx context.Context, seed T, tooMany bool) error

func (Push[T]) WithLimit

func (p Push[T]) WithLimit(limit PushLimit) Push[T]

type PushKey

type PushKey[K, T any] func(ctx context.Context, key K, seed T) error

func (PushKey[K, T]) ToPush

func (k PushKey[K, T]) ToPush(key K) Push[T]

type PushLimit

type PushLimit func(ctx context.Context) (tooMany bool, e error)

type PushLimitKey

type PushLimitKey[K any] func(ctx context.Context, key K) (tooMany bool, e error)

func (PushLimitKey[K]) ToPushLimit

func (l PushLimitKey[K]) ToPushLimit(key K) PushLimit

type PushRequest

type PushRequest func(ctx context.Context, serialized []byte) error

func (PushRequest) SkipIfTooMany

func (r PushRequest) SkipIfTooMany(ctx context.Context, serialized []byte, tooMany bool) error

func (PushRequest) WithLimit

func (r PushRequest) WithLimit(pl PushLimit) PushRequest

type PushRequestKey

type PushRequestKey[K any] func(ctx context.Context, key K, serialized []byte) error

func (PushRequestKey[K]) ToPushRequest

func (k PushRequestKey[K]) ToPushRequest(key K) PushRequest

type QueueLength

type QueueLength func(ctx context.Context) (length int64, e error)

func (QueueLength) ToPushLimit

func (l QueueLength) ToPushLimit(checker func(length int64) (tooMany bool)) PushLimit

type QueueLengthKey

type QueueLengthKey[K any] func(ctx context.Context, key K) (length int64, e error)

func (QueueLengthKey[K]) ToQueueLength

func (k QueueLengthKey[K]) ToQueueLength(key K) QueueLength

type RequestEditor

type RequestEditor func(original *http.Request) (edited *http.Request)

func (RequestEditor) Join

type RequestInfo

type RequestInfo struct {
	// contains filtered or unexported fields
}

func RequestInfoEmptyNew

func RequestInfoEmptyNew(trustedMethod string) RequestInfo

func (RequestInfo) ToRequest

func (i RequestInfo) ToRequest(ctx context.Context, body io.Reader) (*http.Request, error)

func (RequestInfo) WithUrl

func (i RequestInfo) WithUrl(trustedUrl string) RequestInfo

type RequestMetaSource

type RequestMetaSource func() RequestInfo

func (RequestMetaSource) ToRequestSource

func (m RequestMetaSource) ToRequestSource(pop Pop) RequestSource

type RequestSender

type RequestSender func(context.Context, *http.Request) error

func (RequestSender) ToSerializedRequestSender

func (s RequestSender) ToSerializedRequestSender(de SerializedRequestParser) SerializedRequestSender

type RequestSource

type RequestSource func(ctx context.Context) (*http.Request, error)

func (RequestSource) ToSender

func (s RequestSource) ToSender(rs RequestSender) Sender

func (RequestSource) WithEditor

func (s RequestSource) WithEditor(editor RequestEditor) RequestSource

type Sender

type Sender func(context.Context) error

type SerializedRequestParser

type SerializedRequestParser func(serialized []byte) (*http.Request, error)

type SerializedRequestSender

type SerializedRequestSender func(ctx context.Context, request []byte) error

func (SerializedRequestSender) ToSender

func (s SerializedRequestSender) ToSender(pop Pop) Sender

type UrlTransformer

type UrlTransformer func(original *url.URL) (neo *url.URL)

func (UrlTransformer) ToRequestEditor

func (u UrlTransformer) ToRequestEditor() RequestEditor

Directories

Path Synopsis
external

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL