Documentation ¶
Index ¶
- Variables
- func AddConfiguredClientCertToRequest(tlsConfig *tls.Config, options *types.Options) (*tls.Config, error)
- func CalculateContentLength(contentLength, bodyLength int64) int64
- func CleanStructFieldJSONTag(tag string) string
- func GenerateDNSVariables(domain string) map[string]interface{}
- func GenerateVariables(input interface{}, removeTrailingSlash bool, ...) map[string]interface{}
- func GenerateVariablesWithContextArgs(input *contextargs.Context, trailingSlash bool) map[string]interface{}
- func HeadersToString(headers http.Header) string
- func LimitBodyRead(r io.Reader) ([]byte, error)
- func NewLimitResponseBody(body io.ReadCloser) io.ReadCloser
- func NewLimitResponseBodyWithSize(body io.ReadCloser, size int64) io.ReadCloser
- type JsonFields
- type KnownVariable
- type LimitResponseBody
Constants ¶
This section is empty.
Variables ¶
var KnownVariables maputil.Map[KnownVariable, string]
KnownVariables are the variables that are known to input requests
var (
MaxBodyRead = int64(1 << 22) // 4MB using shift operator
)
Functions ¶
func AddConfiguredClientCertToRequest ¶
func AddConfiguredClientCertToRequest(tlsConfig *tls.Config, options *types.Options) (*tls.Config, error)
AddConfiguredClientCertToRequest adds the client certificate authentication to the tls.Config object and returns it
func CalculateContentLength ¶
CalculateContentLength calculates content-length of the http response
func CleanStructFieldJSONTag ¶
CleanStructFieldJSONTag cleans struct json tag field
func GenerateDNSVariables ¶
GenerateDNSVariables from a dns name This function is used by dns and ssl protocol to generate variables
func GenerateVariables ¶
func GenerateVariables(input interface{}, removeTrailingSlash bool, additionalVars map[string]interface{}) map[string]interface{}
GenerateVariables accepts string or *urlutil.URL object as input Returns the map of KnownVariables keys This function is used by http, headless, websocket, network and whois protocols to generate protocol variables
func GenerateVariablesWithContextArgs ¶
func GenerateVariablesWithContextArgs(input *contextargs.Context, trailingSlash bool) map[string]interface{}
GenerateVariables will create default variables with context args
func HeadersToString ¶
headersToString converts http headers to string
func LimitBodyRead ¶ added in v3.1.6
LimitBodyRead limits the body read to MaxBodyRead bytes.
func NewLimitResponseBody ¶ added in v3.1.6
func NewLimitResponseBody(body io.ReadCloser) io.ReadCloser
NewLimitResponseBody wraps response body with a limit reader. thus only allowing MaxBodyRead bytes to be read. i.e 4MB
func NewLimitResponseBodyWithSize ¶ added in v3.1.8
func NewLimitResponseBodyWithSize(body io.ReadCloser, size int64) io.ReadCloser
NewLimitResponseBody wraps response body with a limit reader. thus only allowing MaxBodyRead bytes to be read. i.e 4MB
Types ¶
type JsonFields ¶ added in v3.1.0
type JsonFields struct { Host string `json:"host,omitempty"` Path string `json:"path,omitempty"` Port string `json:"port,omitempty"` Ip string `json:"ip,omitempty"` Scheme string `json:"scheme,omitempty"` URL string `json:"url,omitempty"` }
JsonFields contains additional metadata fields for JSON output
func GetJsonFieldsFromMetaInput ¶ added in v3.1.0
func GetJsonFieldsFromMetaInput(ctx *contextargs.MetaInput) JsonFields
GetJsonFieldsFromMetaInput returns the json fields for the request
func GetJsonFieldsFromURL ¶ added in v3.1.0
func GetJsonFieldsFromURL(URL string) JsonFields
GetJsonFields returns the json fields for the request
type KnownVariable ¶
type KnownVariable uint16
const ( BaseURL KnownVariable = iota RootURL Hostname Host Port Path File Scheme Input Fqdn Rdn Dn Tld Sd )