Documentation ¶
Overview ¶
utilities.go For utility/helper functions to support from the main package
Index ¶
- func Base64Encode(data []byte) (string, error)
- func Base64EncodeCertificate(certPath string) (string, error)
- func DumpRequestToFile(req *http.Request, filename string) error
- func GetImageContentType(filePath string) string
- func PrettyPrintStruct(v interface{}) string
- func UnmarshalJSONData(data []byte, out interface{}) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Base64Encode ¶
Base64Encode encodes the provided data into a base64 string and provides details about the encoding process.
func Base64EncodeCertificate ¶
func DumpRequestToFile ¶
DumpRequestToFile dumps the given request to a specified file.
func GetImageContentType ¶
GetImageContentType determines the content type based on file extension
func PrettyPrintStruct ¶
func PrettyPrintStruct(v interface{}) string
// Print request headers for troubleshooting
func PrintRequestHeaders(req *http.Request) { fmt.Println("Request Headers:") for name, values := range req.Header { // Each value is a slice of strings since headers can be repeated. for _, value := range values { fmt.Printf("%s: %s\n", name, value) } } }
PrettyPrintStruct prints the structure in a pretty format
func UnmarshalJSONData ¶
UnmarshalJSONData unmarshals binary data into the given output structure.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.