util

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2021 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateCaptchaCodeBytes

func CreateCaptchaCodeBytes(SessionCaptcha string) []byte

func DecodeShareKey

func DecodeShareKey(ShareKey string) (UserID, ProductID uint64)

func EncodeShareKey

func EncodeShareKey(UserID, ProductID uint64) string

func GetFullPath

func GetFullPath(Request *http.Request) string

func GetFullUrl

func GetFullUrl(Request *http.Request) string

func GetHost

func GetHost(Request *http.Request) string

func GetIP

func GetIP(context *gweb.Context) string

func IsMobile

func IsMobile(context *gweb.Context) bool

func JSONToStruct

func JSONToStruct(body string, target interface{}) error

func RequestBodyToJSON

func RequestBodyToJSON(body io.ReadCloser, target interface{}) error

func Rounding45

func Rounding45(rounding float64, prec int) float64

func SignSha1

func SignSha1(m string) string

func StructToJSON

func StructToJSON(obj interface{}) string

func StructToMap

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

Types

type Hashids

type Hashids struct {
}

func (Hashids) DecodeShareKey

func (Hashids) DecodeShareKey(ShareKey string) uint64

func (Hashids) EncodeShareKey

func (Hashids) EncodeShareKey(UserID uint64) string

type Map

type Map map[string]string

func (Map) MarshalXML

func (m Map) MarshalXML(e *xml.Encoder, start xml.StartElement) error

func (*Map) UnmarshalXML

func (m *Map) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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