httputils

package
v3.2.7-fix1 Latest Latest
Warning

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

Go to latest
Published: May 20, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetInteractshURLSFromEvent

func GetInteractshURLSFromEvent(event map[string]interface{}) []string

if template contains more than 1 request and matchers require requestcondition from both requests , then we need to request for event from interactsh even if current request doesnot use interactsh url in it

Types

type StopAtFirstMatchHandler

type StopAtFirstMatchHandler[T comparable] struct {

	// Result Channel
	ResultChan chan T
	// contains filtered or unexported fields
}

StopAtFirstMatchHandler is a handler that executes request and stops on first match

func NewBlockingSPMHandler

func NewBlockingSPMHandler[T comparable](ctx context.Context, size int, maxResults int, spm bool) *StopAtFirstMatchHandler[T]

NewBlockingSPMHandler creates a new stop at first match handler

func NewNonBlockingSPMHandler

func NewNonBlockingSPMHandler[T comparable](ctx context.Context, maxResults int, spm bool) *StopAtFirstMatchHandler[T]

NewNonBlockingSPMHandler creates a new stop at first match handler

func (*StopAtFirstMatchHandler[T]) Acquire

func (h *StopAtFirstMatchHandler[T]) Acquire()

Acquire acquires a new work

func (*StopAtFirstMatchHandler[T]) Cancel

func (h *StopAtFirstMatchHandler[T]) Cancel()

Cancel cancels spm context

func (*StopAtFirstMatchHandler[T]) Cancelled

func (h *StopAtFirstMatchHandler[T]) Cancelled() bool

Cancelled returns true if the context is cancelled

func (*StopAtFirstMatchHandler[T]) CombinedResults

func (h *StopAtFirstMatchHandler[T]) CombinedResults() []T

CombinedResults returns the combined results

func (*StopAtFirstMatchHandler[T]) Done

func (h *StopAtFirstMatchHandler[T]) Done() <-chan struct{}

Done returns a channel with the context done signal when stop at first match is detected

func (*StopAtFirstMatchHandler[T]) FoundFirstMatch

func (h *StopAtFirstMatchHandler[T]) FoundFirstMatch() bool

FoundFirstMatch returns true if first match was found in stop at first match mode

func (*StopAtFirstMatchHandler[T]) MatchCallback

func (h *StopAtFirstMatchHandler[T]) MatchCallback(fn func())

MatchCallback is called when a match is found input fn should be the callback that is intended to be called if stop at first is enabled and other conditions are met if it does not meet above conditions, use of this function is discouraged

func (*StopAtFirstMatchHandler[T]) Release

func (h *StopAtFirstMatchHandler[T]) Release()

Release releases a work

func (*StopAtFirstMatchHandler[T]) Resize

func (h *StopAtFirstMatchHandler[T]) Resize(ctx context.Context, size int) error

func (*StopAtFirstMatchHandler[T]) SetOnResultCallback

func (h *StopAtFirstMatchHandler[T]) SetOnResultCallback(fn func(T))

SetOnResult callback this is not thread safe

func (*StopAtFirstMatchHandler[T]) Size

func (h *StopAtFirstMatchHandler[T]) Size() int

func (*StopAtFirstMatchHandler[T]) Trigger

func (h *StopAtFirstMatchHandler[T]) Trigger()

Trigger triggers the stop at first match handler and stops the execution of existing requests

func (*StopAtFirstMatchHandler[T]) Wait

func (h *StopAtFirstMatchHandler[T]) Wait()

Wait waits for all work to be done

type WorkPoolType

type WorkPoolType uint

WorkPoolType is the type of work pool to use

const (
	// Blocking blocks addition of new work when the pool is full
	Blocking WorkPoolType = iota
	// NonBlocking does not block addition of new work when the pool is full
	NonBlocking
)

Jump to

Keyboard shortcuts

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