builtin

package
v0.0.0-...-77e6e3b Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2024 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrUnsupportedFileExt = fmt.Errorf("unsupported file extension")
View Source
var Functions = map[string]interface{}{
	"get_timestamp":          getTimestamp,
	"sleep":                  sleep,
	"gen_random_string":      genRandomString,
	"max":                    math.Max,
	"md5":                    MD5,
	"parameterize":           loadFromCSV,
	"P":                      loadFromCSV,
	"environ":                os.Getenv,
	"ENV":                    os.Getenv,
	"load_ws_message":        loadMessage,
	"multipart_encoder":      multipartEncoder,
	"multipart_content_type": multipartContentType,
}

Functions

func ByteToFloat32

func ByteToFloat32(v []byte) float32

func ByteToFloat64

func ByteToFloat64(v []byte) float64

func Bytes2File

func Bytes2File(data []byte, filename string) error

func BytesToInt64

func BytesToInt64(bys []byte) (data int64)

func Contains

func Contains(s []string, e string) bool

func CreateFile

func CreateFile(filePath string, data string) error

func CreateFolder

func CreateFolder(folderPath string) error

func Dump2JSON

func Dump2JSON(data interface{}, path string) error

func Dump2YAML

func Dump2YAML(data interface{}, path string) error

func EnsureFolderExists

func EnsureFolderExists(folderPath string) error

func Float32ToByte

func Float32ToByte(v float32) []byte

func Float64ToByte

func Float64ToByte(v float64) []byte

func FormatResponse

func FormatResponse(raw interface{}) interface{}

func GetFileNameWithoutExtension

func GetFileNameWithoutExtension(path string) string

func GetRandomNumber

func GetRandomNumber(min, max int) int

func Int64ToBytes

func Int64ToBytes(n int64) []byte

func Interface2Float64

func Interface2Float64(i interface{}) (float64, error)

func Interface2String

func Interface2String(data interface{}) (res string)

func InterfaceType

func InterfaceType(raw interface{}) string

func IsFilePathExists

func IsFilePathExists(path string) bool

IsFilePathExists returns true if path exists and path is file

func IsFolderPathExists

func IsFolderPathExists(path string) bool

IsFolderPathExists returns true if path exists and path is folder

func IsPathExists

func IsPathExists(path string) bool

IsPathExists returns true if path exists, whether path is file or dir

func LoadFile

func LoadFile(path string, structObj interface{}) (err error)

LoadFile loads file content with file extension and assigns to structObj

func MD5

func MD5(str string) string

func ReadCmdLines

func ReadCmdLines(path string) ([]string, error)

func ReadFile

func ReadFile(path string) ([]byte, error)

func SplitInteger

func SplitInteger(m, n int) (ints []int)

func TypeNormalization

func TypeNormalization(raw interface{}) interface{}

Types

type TFormDataWriter

type TFormDataWriter struct {
	Writer  *multipart.Writer
	Payload *bytes.Buffer
}

Jump to

Keyboard shortcuts

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