Documentation
¶
Index ¶
- func AddBottomLabel(fileName string, dstFileName string, label string) error
- func AddDefaultVersion(filename string, dstFileName string) error
- func AddLabel(img *image.RGBA, label string, x, y int)
- func CheckCommand(cmd string) bool
- func CreateDir(dir string) (string, error)
- func CreateDirFromFilename(destination string, s string) (string, error)
- func CreateFileWithDir(destination string) (string, error)
- func EncodeFileToBase64(filename string) (string, error)
- func ExtractAllSubnets(text string) ([]*net.IPNet, error)
- func FileExists(path string) bool
- func FileType(path string) (string, error)
- func Float64ToTime(f float64) time.Time
- func FormatCN(cn string) string
- func FormatInt(n int) string
- func FormatInt64(n int64) string
- func GetHash(data []byte) string
- func GetMimeType(s string) (string, error)
- func HasBOM(fileName string) bool
- func IpTo24Net(ip net.IP) *net.IPNet
- func IpToUint32(ip net.IP) uint32
- func IsSelfSigned(cert *x509.Certificate) bool
- func LeftTrucate(s string, max int) string
- func MoveFile(sourcePath, destPath string) error
- func ParseCertificatePEM(pemData string) (*x509.Certificate, error)
- func RandSleep()
- func RemoveFolder(path string) error
- func SafeFileName(s string) string
- func ShuffleLabeledIPs(ips []LabeledIP)
- func ShuffleStr(slice []string)
- func SliceHasInt(slice []int, item int) bool
- func SliceHasStr(slice []string, item string) bool
- func SliceHasUInt(slice []uint, item uint) bool
- func SliceHasUInt16(slice []uint16, item uint16) bool
- func SubnetHosts(cidr string) ([]net.IP, error)
- func SubnetToUint32(subNet net.IPNet) uint32
- func TempFileName(base_path, prefix, suffix string) string
- func UniqueIntSlice(slice []int) []int
- func Unzip(src, dest string) error
- type LabeledIP
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddDefaultVersion ¶
func CheckCommand ¶
func CreateDir ¶
CreateDir creates a directory if it does not exist, returning the final normalized directory as a result.
func CreateDirFromFilename ¶
func CreateFileWithDir ¶
CreateFileWithDir creates a file, relative to a directory, returning the final normalized path as a result.
func EncodeFileToBase64 ¶
func Float64ToTime ¶
Float64ToTime takes a float64 as number of seconds since unix epoch and returns time.Time
example field where this is used (expires field):
https://chromedevtools.github.io/devtools-protocol/tot/Network/#type-Cookie
func FormatInt64 ¶
func GetMimeType ¶
func IpToUint32 ¶
func IsSelfSigned ¶
func IsSelfSigned(cert *x509.Certificate) bool
IsSelfSigned checks if a certificate is self-signed
func LeftTrucate ¶
LeftTrucate a string if its more than max
func ParseCertificatePEM ¶
func ParseCertificatePEM(pemData string) (*x509.Certificate, error)
func RemoveFolder ¶
func SafeFileName ¶
SafeFileName takes a string and returns a string safe to use as a file name.
func SliceHasInt ¶
SliceHasInt checks if a slice has an int
func SliceHasStr ¶
SliceHasStr checks if a slice has a string
func SliceHasUInt ¶
SliceHasInt checks if a slice has an int
func SliceHasUInt16 ¶
SliceHasInt checks if a slice has an int
func SubnetToUint32 ¶
func TempFileName ¶
func UniqueIntSlice ¶
UniqueIntSlice returns a slice of unique ints