Documentation ¶
Index ¶
- Variables
- func CheckFor(app string) error
- func Chunk(slices []string, chunkSize int) (chunks [][]string)
- func ChunkInt32(slices []int32, chunkSize int) (chunks [][]int32)
- func ChunkInt64(slices []int64, chunkSize int) (chunks [][]int64)
- func ContextValue(ctx context.Context, out proto.Message) error
- func CreateZipWithPasswordFromFile(password, zipPath, filename string) error
- func CreateZipWithPasswordFromFolder(password, zipPath, folder string) error
- func Err(code codes.Code, msg string) error
- func Hash(keys ...interface{}) string
- func HashRecord(items ...interface{}) string
- func I32Contains(s []int32, e int32) bool
- func I64Contains(s []int64, e int64) bool
- func IntContains(s []int, e int) bool
- func MakeContext(sec int, claims proto.Message) (context.Context, context.CancelFunc)
- func MergeStructs(in ...interface{}) (map[string]interface{}, error)
- func ParseContext(ctx context.Context, out proto.Message) error
- func RandStringRunes(n int) string
- func SendReqGet(url string, headers map[string]string, opts ...HttpOption) (int, []byte, error)deprecated
- func SendReqPost(url string, headers map[string]string, body []byte, opts ...HttpOption) (int, []byte, error)deprecated
- func SendReqPostWithRetry(url string, headers map[string]string, body []byte, opts ...HttpOption) (int, []byte, error)
- func SendReqPut(url string, headers map[string]string, body []byte, opts ...HttpOption) (int, []byte, error)deprecated
- func StrContains(s []string, e string) bool
- func ToMs(timestamp int64) int64
- func ToNs(timestamp int64) int64
- func UniqInt32(intSlice []int32) []int32
- func UniqInt64(intSlice []int64) []int64
- func ZipExtract(password, zipPath string) error
- type HttpOption
- type Retry
Constants ¶
This section is empty.
Variables ¶
View Source
var (
E_timeout = errors.New("request_timeout")
)
Functions ¶
func ChunkInt32 ¶
func ChunkInt64 ¶
func ContextValue ¶
ContextValue func
func CreateZipWithPasswordFromFile ¶
zip -P password F.zip F
func CreateZipWithPasswordFromFolder ¶
zip -P password -r F.zip F
func HashRecord ¶
func HashRecord(items ...interface{}) string
func I32Contains ¶
func I64Contains ¶
func IntContains ¶
func MakeContext ¶
func MergeStructs ¶
func ParseContext ¶
ParseContext func is new method replace ContextValue high performance, using smaller resource replace json marshall to proto marshall can support older
func RandStringRunes ¶
func SendReqGet
deprecated
Deprecated: SendReqGet send http get
move to example
code, body, err := httpclient.New(url).WithMethod("GET").WithHeader(map[string]string{ "content-type": "application/json", }),
WithTimeout(time.Second)
func SendReqPost
deprecated
func SendReqPost(url string, headers map[string]string, body []byte, opts ...HttpOption) (int, []byte, error)
Deprecated: SendReqPost send http post
move to example
code, body, err := httpclient.New(url).WithMethod("POST").WithHeader(map[string]string{ "content-type": "application/json", }),
WithTimeout(time.Second),
WithBody(map[string]any{ "userId": 1, "id": 1, "title": "sunt aut facere repellat provident occaecati excepturi optio reprehenderit", }))
func SendReqPostWithRetry ¶
func SendReqPostWithRetry(url string, headers map[string]string, body []byte, opts ...HttpOption) (int, []byte, error)
SendReqPostWithRetry send http post
func SendReqPut
deprecated
func SendReqPut(url string, headers map[string]string, body []byte, opts ...HttpOption) (int, []byte, error)
Deprecated: SendReqPut send http put
move to example
code, body, err := httpclient.New(url).WithMethod("PUT").WithHeader(map[string]string{ "content-type": "application/json", }),
WithTimeout(time.Second),
WithBody(map[string]any{ "userId": 1, "id": 1, "title": "sunt aut facere repellat provident occaecati excepturi optio reprehenderit", }))
func StrContains ¶
func ZipExtract ¶
unzip -P your-password zipfile.zip
Types ¶
type HttpOption ¶
Click to show internal directories.
Click to hide internal directories.