Documentation ¶
Index ¶
- Constants
- Variables
- func AESDecrypt(key string, ct16 string) (text string, err error)
- func AESEncrypt(key, plaintext string) (text string, err error)
- func AesDecrypt(cryptedBase64 string, key []byte) ([]byte, error)
- func AesEncrypt(origData, key []byte) (string, error)
- func Base64Md5(params string) string
- func CurrentTZTime() string
- func CurrentTime() string
- func Filter(source []int64, filter func(int64) bool) []int64
- func FormatTime(t time.Time) string
- func GetNextId() uint64
- func GetProjectPath() string
- func HttpGetT(addr string, timeout int) (ret []byte, err error)
- func HttpPostJsonDataT(addr string, jsonDataBytes []byte, timeout int) (ret []byte, err error)
- func HttpPostT(ctx context.Context, addr string, data url.Values, timeout int) (ret []byte, err error)
- func Int(a int) *int
- func Int16(a int16) *int16
- func Int16Value(a *int16) int16
- func Int32(a int32) *int32
- func Int32Value(a *int32) int32
- func Int63nRange(min, max int64) int64
- func Int64(a int64) *int64
- func Int64Value(a *int64) int64
- func Int8(a int8) *int8
- func Int8Value(a *int8) int8
- func IntValue(a *int) int
- func Interface2Int64(inter interface{}) int64
- func Interface2String(value interface{}) string
- func Intersect(lists [][]string) []string
- func IsPrivateIPv4(ip net.IP) bool
- func IsProd() bool
- func LarkAlarm(ctx context.Context, hookID string, title string, text string) (err error)
- func LarkAlarmBase(ctx context.Context, hookID string, title string, text string) (err error)
- func LocalIp() (string, error)
- func MD5(params string) string
- func ObjToJson(obj interface{}) string
- func PKCS5Padding(plaintext []byte, blockSize int) []byte
- func PKCS5UnPadding(origData []byte) []byte
- func ParseTime(value string) time.Time
- func ParseTimeInLocation(value string, loc *time.Location) time.Time
- func ParseTimeTz(value string) time.Time
- func ParseTimeTzInLocation(value string, loc *time.Location) time.Time
- func PrivateIPv4() string
- func RandomInt(min, max int) int64
- func SliceToStringSet(s []string) *hashset.Set
- func SshCheck(ip, user, pwd string) bool
- func String(a string) *string
- func StringSliceDiff(s1, s2 []string) []string
- func StringSliceSplit(slice []string, singleLen int64) [][]string
- func StringValue(a *string) string
- func ToInt64SliceE(i interface{}) ([]int64, error)
- func ToStringSet(s string) *hashset.Set
- type LarkMsgResponse
Constants ¶
View Source
const ( LarkMsgType_Text = "text" //富文本 LarkMsgType_Post = "post" //富文本 LarkMsgType_Image = "image" //图片 LarkMsgTyp_Interactive = "interactive" //消息卡片 )
View Source
const AesKeyPepper = "bridgx"
View Source
const DefaultKey = "schedulx"
Variables ¶
View Source
var ( ErrEncryptFailed = errors.New("encrypt failed") ErrDecryptFailed = errors.New("decrypt failed") )
Functions ¶
func AESEncrypt ¶ added in v0.7.0
func AesEncrypt ¶ added in v0.7.0
func CurrentTZTime ¶ added in v0.4.0
func CurrentTZTime() string
func CurrentTime ¶
func CurrentTime() string
func FormatTime ¶ added in v0.4.0
func GetProjectPath ¶
func GetProjectPath() string
func HttpPostJsonDataT ¶
HttpPostJsonDataT 带超时的http post json string as data
func HttpPostT ¶
func HttpPostT(ctx context.Context, addr string, data url.Values, timeout int) (ret []byte, err error)
HttpPostT 带超时的http post
func Int16Value ¶ added in v0.5.0
func Int32Value ¶ added in v0.5.0
func Int63nRange ¶ added in v0.7.0
func Int64Value ¶ added in v0.5.0
func Interface2Int64 ¶
func Interface2Int64(inter interface{}) int64
func Interface2String ¶
func Interface2String(value interface{}) string
func IsPrivateIPv4 ¶
func LarkAlarmBase ¶
func PKCS5Padding ¶ added in v0.7.0
func PKCS5UnPadding ¶ added in v0.7.0
func ParseTimeInLocation ¶ added in v0.4.0
func ParseTimeTz ¶ added in v0.4.0
func ParseTimeTzInLocation ¶ added in v0.4.0
func PrivateIPv4 ¶
func PrivateIPv4() string
func SliceToStringSet ¶
func StringSliceDiff ¶ added in v0.7.0
StringSliceDiff s1-s2
func StringSliceSplit ¶
func StringValue ¶ added in v0.5.0
func ToInt64SliceE ¶
func ToStringSet ¶
Types ¶
type LarkMsgResponse ¶
type LarkMsgResponse struct { Code int64 `json:"code"` Msg string `json:"msg"` StatusCode int64 `json:"StatusCode"` StatusMessage string `json:"StatusMessage"` }
// err response
{ "code": 19002, "msg": "params error, msg_type need" }
// success response
{ "Extra": null, "StatusCode": 0, "StatusMessage": "success" }
Click to show internal directories.
Click to hide internal directories.