utils

package
v3.2.5 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2024 License: MIT Imports: 15 Imported by: 10

Documentation

Index

Constants

View Source
const (
	// TemplatesRepoURL is the URL for files in nuclei-templates repository
	TemplatesRepoURL = "https://cloud.projectdiscovery.io/public/"
)

Variables

View Source
var (
	HttpSchemes = []string{"https", "http"}
)

Functions

func GetInputLivenessChecker added in v3.2.0

func GetInputLivenessChecker(client *httpx.HTTPX) types.InputLivenessProbe

GetInputLivenessChecker returns a new input liveness checker using provided httpx client

func IsBlank

func IsBlank(value string) bool

func IsURL

func IsURL(input string) bool

IsURL tests a string to determine if it is a well-structured url or not.

func ProbeURL

func ProbeURL(input string, httpxclient *httpx.HTTPX) string

probeURL probes the scheme for a URL. first HTTPS is tried and if any errors occur http is tried. If none succeeds, probing is abandoned for such URLs.

func ReaderFromPathOrURL added in v3.2.1

func ReaderFromPathOrURL(templatePath string, catalog catalog.Catalog) (io.ReadCloser, error)

ReadFromPathOrURL reads and returns the contents of a file or url.

func StringSliceContains

func StringSliceContains(slice []string, item string) bool

StringSliceContains checks if a string slice contains a string.

func TemplatePathURL

func TemplatePathURL(fullPath, templateId string) (string, string)

TemplatePathURL returns the Path and URL for the provided template

func TransformIndex

func TransformIndex[T any](arr []T, index int) int

TransformIndex transforms user given index (start from 1) to array index (start from 0) in safe way without panic i.e negative index or index out of range

func UnwrapError

func UnwrapError(err error) error

Types

type InsertionOrderedStringMap

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

func NewEmptyInsertionOrderedStringMap

func NewEmptyInsertionOrderedStringMap(size int) *InsertionOrderedStringMap

func NewInsertionOrderedStringMap

func NewInsertionOrderedStringMap(stringMap map[string]interface{}) *InsertionOrderedStringMap

func (*InsertionOrderedStringMap) ForEach

func (insertionOrderedStringMap *InsertionOrderedStringMap) ForEach(fn func(key string, data interface{}))

func (*InsertionOrderedStringMap) Len

func (insertionOrderedStringMap *InsertionOrderedStringMap) Len() int

func (*InsertionOrderedStringMap) Set

func (insertionOrderedStringMap *InsertionOrderedStringMap) Set(key string, value interface{})

func (*InsertionOrderedStringMap) UnmarshalJSON

func (insertionOrderedStringMap *InsertionOrderedStringMap) UnmarshalJSON(data []byte) error

func (*InsertionOrderedStringMap) UnmarshalYAML

func (insertionOrderedStringMap *InsertionOrderedStringMap) UnmarshalYAML(unmarshal func(interface{}) error) error

Directories

Path Synopsis
Package monitor implements a goroutine based monitoring for detecting stuck scanner processes and dumping stack and other relevant information for investigation.
Package monitor implements a goroutine based monitoring for detecting stuck scanner processes and dumping stack and other relevant information for investigation.
Package stats provides a storage mechanism for storing and display vital statistics of the engine at various durations.
Package stats provides a storage mechanism for storing and display vital statistics of the engine at various durations.

Jump to

Keyboard shortcuts

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