utils

package
v0.3.4 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	BasePath string
)
View Source
var (
	LogPath string
)

Functions

func AppendStorageContent

func AppendStorageContent(app string, fileName string, content string) error

func CamelToSnake

func CamelToSnake(s string) string

*

  • 驼峰转蛇形
  • @description XxYy to xx_yy, XxYY to xx_y_y
  • @param {string} s 需要转换的字符串
  • @return {string} *

func GetStorageContent

func GetStorageContent(app string, fileName string) (string, error)

func GetStorageJSON

func GetStorageJSON(app string, fileName string, v interface{}) error

func GetStructFieldName

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

func GetStructFieldNameToSnake

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

func Logger

func Logger(name string) *log.Logger

func MD5

func MD5(s string) string

func ParseIP

func ParseIP(s string) (net.IP, int)

func PathExists

func PathExists(path string) bool

func SetStorageContent

func SetStorageContent(app string, fileName string, content string) error

func SnakeToCamel

func SnakeToCamel(s string) string

*

  • 蛇形转驼峰
  • @description xx_yy to XxYx, xx_y_y to XxYY
  • @param {string} s 要转换的字符串
  • @return {string} *

func StructCopyFields

func StructCopyFields(a interface{}, b interface{}, fields ...string) error

func StructToMap

func StructToMap(obj interface{}) map[string]interface{}

func StructToMapWithLowerKey

func StructToMapWithLowerKey(obj interface{}) map[string]interface{}

Types

This section is empty.

Jump to

Keyboard shortcuts

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