helper

package
v0.0.0-...-ff80121 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Filling

func Filling(data interface{}, model interface{}) error

Filling filling a model from submitted data data 提交过来的数据结构体 model 定义表模型的数据结构体 相当于是在合并两个结构体(data 必须是 model 的子集)

func GetRootPath

func GetRootPath() string

GetRootPath Get abs path of the project

func JsonDecode

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

JsonEncode decode json bytes to data. use it instead of json.Unmarshal

func JsonEncode

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

JsonEncode encode data to json bytes. use it instead of json.Marshal

func LocTime

func LocTime() time.Time

LocTime get local time

func NewRedisPool

func NewRedisPool(url, password string, redisDb int) *redis.Pool

create new redis pool @see https://git-books.github.io/books/go-web-programme/?p=05.6.md

Types

This section is empty.

Jump to

Keyboard shortcuts

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