common

package
v0.0.0-...-3eef760 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2022 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Trace   *log.Logger
	Info    *log.Logger
	Warning *log.Logger
	Error   *log.Logger
)

Package level variables, which are pointer to log.Logger.

Functions

func CheckStrEmpty

func CheckStrEmpty(str string) bool

CheckStrEmpty .... check if input string is empty

func ConvertMapToString

func ConvertMapToString(m map[string]string) string

ConvertMapToString ... convert map to string

func ConvertStringToMap

func ConvertStringToMap(str string) map[string]string

ConvertStringToMap .... convert string to map

func ErrorResponse

func ErrorResponse(c *gin.Context, code int, err string)

ErrorResponse .... use ErrorResponse to handle error

func StrToTime

func StrToTime(input string) time.Time

StrToTime .... convert input string format of time to time

func UUIDGen

func UUIDGen(str string) string

UUIDGen .... based on input string to generate uuid

Types

type ConfigProperties

type ConfigProperties map[string]string

ConfigProperties -- is key string, value is string

func ReadPropertiesFile

func ReadPropertiesFile(filename string) (ConfigProperties, error)

ReadPropertiesFile --- read config from properties file

type Level

type Level int

Level holds the log level.

const (
	// UNSPECIFIED logs nothing
	UNSPECIFIED Level = iota // 0 :
	// TRACE logs everything
	TRACE // 1
	// INFO logs Info, Warnings and Errors
	INFO // 2
	// WARNING logs Warning and Errors
	WARNING // 3
	// ERROR just logs Errors
	ERROR // 4
)

Jump to

Keyboard shortcuts

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