util

package
v0.0.0-...-5652a87 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2017 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

提供一些实用函数

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AESKeyDecode

func AESKeyDecode(encodedAESKey string) (aesKey []byte, err error)

把长度为 43 的字符串 base64 decode 到 32 字节的 []byte

encodedAESKey 由 a-z,A-Z,0-9 组成, 一般在微信管理后台随机生成

func Bool

func Bool(v bool) *bool

Bool is a helper routine that allocates a new bool value to store v and returns a pointer to it.

func Float32

func Float32(v float32) *float32

Float32 is a helper routine that allocates a new float32 value to store v and returns a pointer to it.

func Float64

func Float64(v float64) *float64

Float64 is a helper routine that allocates a new float64 value to store v and returns a pointer to it.

func HttpResponseWriter

func HttpResponseWriter(w io.Writer) http.ResponseWriter

将 io.Writer 从语义上实现 http.ResponseWriter.

func Int

func Int(v int) *int

Int is a helper routine that allocates a new int value to store v and returns a pointer to it.

func Int32

func Int32(v int32) *int32

Int32 is a helper routine that allocates a new int32 value to store v and returns a pointer to it.

func Int64

func Int64(v int64) *int64

Int64 is a helper routine that allocates a new int64 value to store v and returns a pointer to it.

func String

func String(v string) *string

String is a helper routine that allocates a new string value to store v and returns a pointer to it.

func Uint32

func Uint32(v uint32) *uint32

Uint32 is a helper routine that allocates a new uint32 value to store v and returns a pointer to it.

func Uint64

func Uint64(v uint64) *uint64

Uint64 is a helper routine that allocates a new uint64 value to store v and returns a pointer to it.

func WXVersion

func WXVersion(userAgent string) (x, y, z, w int, err error)

获取微信客户端的版本.

userAgent: 微信内置浏览器的 User-Agent;
x, y, z, w:   如果微信版本为 5.3.1.2 则有 x==5, y==3, z==1, w==2
err:       错误信息

Types

This section is empty.

Jump to

Keyboard shortcuts

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