utils

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bool

func Bool(i bool) *bool

func DecodeAttackState

func DecodeAttackState[T any](attackState attack_kit_api.AttackState, result *T) error

func EncodeAttackState

func EncodeAttackState[T any](attackState T) (attack_kit_api.AttackState, error)

func GetterAsHandler

func GetterAsHandler[T any](handler func() T) func(w http.ResponseWriter, r *http.Request, body []byte)

func LogRequest

func LogRequest(next func(w http.ResponseWriter, r *http.Request, body []byte)) http.HandlerFunc

func PanicRecovery

func PanicRecovery(next func(w http.ResponseWriter, r *http.Request)) http.HandlerFunc

func RegisterHttpHandler

func RegisterHttpHandler(path string, handler func(w http.ResponseWriter, r *http.Request, body []byte))

func String

func String(i string) *string

func Strings

func Strings(ss []string) []*string

func ToError

func ToError(title string, err error) attack_kit_api.AttackKitError

func WriteAttackState

func WriteAttackState[T any](w http.ResponseWriter, state T)

func WriteBody

func WriteBody(w http.ResponseWriter, response any)

Types

This section is empty.

Jump to

Keyboard shortcuts

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