gotenableutils

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ErrFatal

func ErrFatal(err error)

ErrFatal is a convenience function for error handling

func JSONToIface

func JSONToIface(jsonData []byte) interface{}

JSONToIface unmarshals JSON data to an interface

func JSONToStruct

func JSONToStruct(jsonData []byte, model interface{})

JSONToStruct unmarshals JSON to struct

func PPrintJSON

func PPrintJSON(jsonData []byte)

PPrintJSON pretty prints JSON data

func RequestDump

func RequestDump(req *http.Request, body bool, logLevel string)

RequestDump logs the entire HTTP request for debugging

func ResponseDump

func ResponseDump(resp *http.Response, body bool, logLevel string)

ResponseDump logs entire HTTP response for debugging

func StructToJSON

func StructToJSON(structData interface{}) *bytes.Buffer

StructToJSON marshals struct data to JSON

func UserInput

func UserInput(prompt string, echo bool) string

UserInput captures user input and has configurable echo

Types

This section is empty.

Jump to

Keyboard shortcuts

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