util

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2018 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenShortId

func GenShortId() (string, error)

func GetReqID

func GetReqID(c *gin.Context) string

func RandInts

func RandInts(from, to, size int) []int

RandInts returns a random integer array with the specified from, to and size.

func RandString

func RandString(n int) string

RandString returns a fixed length random string.

func SendResponse

func SendResponse(c *gin.Context, err error, data interface{})

Types

type Response

type Response struct {
	Code    int         `json:"code"`
	Message string      `json:"message"`
	Data    interface{} `json:"data"`
}

Jump to

Keyboard shortcuts

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