utils

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2022 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	AwsAccountNumber string
	AwsConfig        aws.Config
)
View Source
var (
	WarningLogger *log.Logger
	InfoLogger    *log.Logger
	ErrorLogger   *log.Logger
)

Functions

func DecodeAttackState

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

func EncodeAttackState

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

func GetterAsHandler

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

func InitializeAwsAccountAccess

func InitializeAwsAccountAccess()

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 RegisterCommonDiscoveryHandlers

func RegisterCommonDiscoveryHandlers()

func RegisterHttpHandler

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

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