utils

package
v0.0.0-...-4aca82f Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2018 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AppHelpTemplate = `` /* 464-byte string literal not displayed */

AppHelpTemplate is a default malice plugin help template

Functions

func AskForConfirmation

func AskForConfirmation() bool

AskForConfirmation prompts user for yes/no response

func Assert

func Assert(err error)

Assert asserts there was no error, else log.Fatal

func CamelCase

func CamelCase(src string) string

CamelCase converts strings to their camel case equivalent

func GetHashType

func GetHashType(hash string) (string, error)

GetHashType returns the hash type (md5, sha1, sha256, sha512)

func GetSHA256

func GetSHA256(name string) string

GetSHA256 calculates a file's sha256sum

func Getopt

func Getopt(name, dfault string) string

Getopt reads environment variables. If not found will return a supplied default value

func RemoveDuplicates

func RemoveDuplicates(elements []string) []string

RemoveDuplicates removes duplicate items from a list

func RunCommand

func RunCommand(ctx context.Context, cmd string, args ...string) (string, error)

RunCommand runs cmd on file

func SliceContainsString

func SliceContainsString(a string, list []string) bool

SliceContainsString returns if slice contains substring

func StringInSlice

func StringInSlice(a string, list []string) bool

StringInSlice returns whether or not a string exists in a slice

func Unzip

func Unzip(archive, target string) error

Unzip unzips archive to target location

Types

This section is empty.

Jump to

Keyboard shortcuts

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