goutils

package module
v0.0.0-...-36ff2a2 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2020 License: MIT Imports: 11 Imported by: 0

README

goutils

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Dump

func Dump(v interface{})

func ExtractReqBody

func ExtractReqBody(r *http.Request, i interface{}) error

ExtractReqBody extracts the body from the request and parse it, max body size 10000bytes

func Fdump

func Fdump(w io.Writer, v interface{})

func InitLogger

func InitLogger(level string)

func JsonBytesToInterface

func JsonBytesToInterface(b []byte) (map[string]interface{}, error)

func JsonBytesToType

func JsonBytesToType(b []byte, v interface{}) error

func JsonFileToInterface

func JsonFileToInterface(path string) (map[string]interface{}, error)

func JsonFileToType

func JsonFileToType(path string, v interface{}) error

func JsonStringToInterface

func JsonStringToInterface(s string) (map[string]interface{}, error)

func JsonStringToType

func JsonStringToType(s string, v interface{}) error

func Log

func Log(s string)

func PrintError

func PrintError(err error)

func ReadFileBytes

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

func ReadFileString

func ReadFileString(path string) (string, error)

func SendResError

func SendResError(w http.ResponseWriter, reason string) error

func SendResOk

func SendResOk(w http.ResponseWriter) error

func StructToMap

func StructToMap(v interface{}) (map[string]interface{}, error)

StructToMap uses the tag structs

func ToJsonBytes

func ToJsonBytes(v interface{}) ([]byte, error)

func ToJsonBytesIndent

func ToJsonBytesIndent(v interface{}) ([]byte, error)

func ToJsonString

func ToJsonString(v interface{}) (string, error)

func ToJsonStringIndent

func ToJsonStringIndent(v interface{}) (string, error)

func Warn

func Warn(s string)

Types

type LogType

type LogType int
const (
	DEBUG   LogType = 0
	WARNING LogType = 1
	ERROR   LogType = 2
)

Directories

Path Synopsis
firebase module
lnd module

Jump to

Keyboard shortcuts

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