_utils

package
v0.7.20 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2023 License: BSD-3-Clause Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddHit

func AddHit(w http.ResponseWriter, r *http.Request,
	service, mode string, hLog *log.Logger)

AddHit ...

func BadRequest

func BadRequest(w http.ResponseWriter, r *http.Request)

BadRequest ...

func CreateCustomErrorLogFile

func CreateCustomErrorLogFile(f string) *os.File

CreateCustomErrorLogFile ...

func DownloadFile

func DownloadFile(filePath string, url string) (err error)

DownloadFile ...

func ErrorResponse

func ErrorResponse(w http.ResponseWriter, msg string)

ErrorResponse ...

func GenericCommand

func GenericCommand(args []string) (err error)

GenericCommand ...

func GenericCommandSH

func GenericCommandSH(comm string) (chunk []byte, err error)

GenericCommandSH ...

func GetIP

func GetIP(r *http.Request) string

GetIP ...

func GetRandomInt

func GetRandomInt(min, max int) int

GetRandomInt [min, max] both included

func LoadJSONConfig

func LoadJSONConfig(configjson []byte, c interface{})

LoadJSONConfig ...

func LoadJSONFile

func LoadJSONFile(filePath string, data interface{})

LoadJSONFile ...

func MakeGetRequest

func MakeGetRequest(w http.ResponseWriter, url string, d interface{})

MakeGetRequest ...

func NewHitsFile

func NewHitsFile(f string) *log.Logger

CreateCustomHitsLogFile ...

func PrettyPrintStruct

func PrettyPrintStruct(s interface{})

PrettyPrintStruct ...

func RemoveProtocolFromURL

func RemoveProtocolFromURL(url string) string

RemoveProtocolFromURL ...

func SendJSONToClient

func SendJSONToClient(w http.ResponseWriter, d interface{}, status int)

SendJSONToClient ...

func SendXMLToClient

func SendXMLToClient(w http.ResponseWriter, d interface{}, status int)

SendXMLToClient ...

func SliceContainsString

func SliceContainsString(str string, slice []string) bool

SliceContainsString ... returns true/false

func ToFixedFloat64

func ToFixedFloat64(untruncated float64, precision int) float64

ToFixedFloat64 (untruncated, num) -> untruncated.toFixed(num)

func WriteFile

func WriteFile(filePath string, content string)

WriteFile ...

func WriteJSONtoFile

func WriteJSONtoFile(filePath string, d interface{})

WriteJSONtoFile ...

Types

This section is empty.

Jump to

Keyboard shortcuts

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