gozerocommon

package module
v0.1.14 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2024 License: GPL-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ClientIP = CtxKey("client_ip")
View Source
var CtxKeyJwtEntityId = "entityId"
View Source
var CtxKeyJwtUserId = "jwtUserId"
View Source
var DateFormat = "2006-01-02 15:04:05"
View Source
var DateFormatShort = "2006-01-02"

Functions

func GetCellIndex added in v0.1.4

func GetCellIndex(row, col int64) string

func GetClientIPFromCtx added in v0.1.12

func GetClientIPFromCtx(ctx context.Context) string

func GetClientIPFromMetadata added in v0.1.14

func GetClientIPFromMetadata(ctx context.Context) string

func GetUidFromCtx

func GetUidFromCtx(ctx context.Context) int64

func GetUidStringFromCtx added in v0.1.10

func GetUidStringFromCtx(ctx context.Context) string

func GetUserIdAndEntityIdFromCtx added in v0.1.6

func GetUserIdAndEntityIdFromCtx(ctx context.Context) (int64, string)

func Int64SliceToInterface

func Int64SliceToInterface(ids []int64) []interface{}

func ListInInt64 added in v0.1.3

func ListInInt64(list []int64, i int64) bool

ListInInt64 list in action

func Md5ByBytes

func Md5ByBytes(b []byte) string

func Md5ByString

func Md5ByString(str string) string

func Placeholders

func Placeholders(n int) string

func Response

func Response(w http.ResponseWriter, resp interface{}, err error)

Types

type Body

type Body struct {
	Code int         `json:"code"`
	Msg  string      `json:"msg"`
	Data interface{} `json:"data,omitempty"`
}

type CtxKey added in v0.1.12

type CtxKey string

type HashId

type HashId struct {
	// contains filtered or unexported fields
}

func (*HashId) IdToString

func (hi *HashId) IdToString(id int64) string

func (*HashId) New

func (hi *HashId) New(salt string, minLength int) *HashId

func (*HashId) StringToid

func (hi *HashId) StringToid(id string) int64

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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