stall

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2024 License: Apache-2.0, MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Rate at which staller will report on wasted time to the given telemetry instance
	StallerReportInterval = time.Second * 30
)

Variables

This section is empty.

Functions

This section is empty.

Types

type HttpStaller

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

Represents a single open connection to the honeypot actively being stalled

func NewHttpStaller

func NewHttpStaller(opts *HttpStallerOptions) *HttpStaller

func (*HttpStaller) BindToPool

func (s *HttpStaller) BindToPool(deregisterChan chan stall.Staller)

func (*HttpStaller) Close

func (s *HttpStaller) Close()

func (*HttpStaller) GetContentType

func (s *HttpStaller) GetContentType() string

func (*HttpStaller) GetElapsedTime

func (s *HttpStaller) GetElapsedTime() time.Duration

func (*HttpStaller) GetGroupIdentifier

func (s *HttpStaller) GetGroupIdentifier() string

func (*HttpStaller) GetIdentifier

func (s *HttpStaller) GetIdentifier() uint64

func (*HttpStaller) GetRemainingTimeToReport

func (s *HttpStaller) GetRemainingTimeToReport() time.Duration

func (*HttpStaller) Halt

func (s *HttpStaller) Halt()

func (*HttpStaller) PushDataToClient

func (s *HttpStaller) PushDataToClient(ctx context.Context, w *bufio.Writer, data []byte) (bool, error)

func (*HttpStaller) StallContextBuffer

func (s *HttpStaller) StallContextBuffer(ctx *fiber.Ctx) error

StallBuffer stalls the buffer by writing a chunk of data every N milliseconds

type HttpStallerFactory

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

func NewHttpStallerFactory

func NewHttpStallerFactory(
	config *config.Config,
	pool *stall.StallerPool,
	timeoutWatcher *metrics.TimeoutWatcher,
	telemetry *metrics.Telemetry,
	secretsGeneratorCollection *secrets.SecretGeneratorCollection,
	configGeneratorCollection *generator.ConfigGeneratorCollection,
	logger *logging.HttpAccessLogger,
) *HttpStallerFactory

func (*HttpStallerFactory) FromFiberContext

func (f *HttpStallerFactory) FromFiberContext(c *fiber.Ctx) (*HttpStaller, error)

type HttpStallerOptions

type HttpStallerOptions struct {
	ContentType  string
	Request      *fiber.Ctx
	Generator    generator.Generator
	TransferRate time.Duration
	Timeout      time.Duration
	OnTimeout    func(*HttpStaller)
	OnClose      func(*HttpStaller)
	Telemetry    *metrics.Telemetry
}

Jump to

Keyboard shortcuts

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