actions

package
v2.0.0-beta.4 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2024 License: Apache-2.0, BSD-3-Clause, Apache-2.0 Imports: 9 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SendActionEvents

func SendActionEvents(op dyngo.Operation, actions map[string]any)

SendActionEvents sends the relevant actions to the operation's data listener. It returns true if at least one of those actions require interrupting the request handler When SDKError is not nil, this error is sent to the op with EmitData so that the invoked SDK can return it

Types

type Action

type Action interface {
	EmitData(op dyngo.Operation)
}

Action is a generic interface that represents any WAF action

func NewBlockAction

func NewBlockAction(params map[string]any) []Action

NewBlockAction creates an action for the "block_request" action type

func NewRedirectAction

func NewRedirectAction(params map[string]any) []Action

NewRedirectAction creates an action for the "redirect_request" action type

func NewStackTraceAction

func NewStackTraceAction(params map[string]any) []Action

NewStackTraceAction creates an action for the "stacktrace" action type

type BlockGRPC

type BlockGRPC struct {
	GRPCWrapper
}

BlockGRPC are actions that interact with a GRPC request flow

func (*BlockGRPC) EmitData

func (a *BlockGRPC) EmitData(op dyngo.Operation)

type BlockHTTP

type BlockHTTP struct {
	http.Handler
}

BlockHTTP are actions that interact with an HTTP request flow

func (*BlockHTTP) EmitData

func (a *BlockHTTP) EmitData(op dyngo.Operation)

type GRPCWrapper

type GRPCWrapper func() (uint32, error)

GRPCWrapper is an opaque prototype abstraction for a gRPC handler (to avoid importing grpc) that returns a status code and an error

type StackTraceAction

type StackTraceAction struct {
	Event *stacktrace.Event
}

StackTraceAction are actions that generate a stacktrace

func (*StackTraceAction) EmitData

func (a *StackTraceAction) EmitData(op dyngo.Operation)

Jump to

Keyboard shortcuts

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