util

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 12, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

提供一些实用函数

Index

Constants

This section is empty.

Variables

View Source
var BeijingLocation = time.FixedZone("Asia/Shanghai", 8*60*60)
View Source
var DefaultHttpClient *http.Client
View Source
var DefaultMediaHttpClient *http.Client

Functions

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 NonceStr

func NonceStr() string

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