Documentation
¶
Index ¶
- Constants
- func AbsInt32(n int32) int32
- func Base62Increment(s string) string
- func BubbleSort(list []int32) []int32
- func Compress(s string) string
- func DateFromNow() string
- func DateFromTimeStamp(timestamp int64) string
- func DateTimeFromNow() string
- func DateTimeFromTimeStamp(timestamp int64) (string, string)
- func Decode62To10(str string) int64
- func Encode10To62(num int64) string
- func FloatToStr(f float64) string
- func Get(url string) (response string)
- func GetStringEnd(str string) string
- func GetWeek() (y, w int)
- func Int32Sum(int32arr []int32) int32
- func Int32SumParallel(numbers []int32) int32
- func Int32ToStr(n int32) string
- func Int64ToStr(n int64) string
- func IntArrEq(a, b []int) bool
- func IntToStr(n int) string
- func MD5Encryption(str string) string
- func Max(vals ...int64) int64
- func MaxNum(arr []int64) (max int64, maxIndex int)
- func Min(vals ...int64) int64
- func MinNum(arr []int64) (min int64, minIndex int)
- func Post(url string, data interface{}, contentType string) (content string)
- func QuickSort(list []int32, left int32, right int32)
- func RecoverPanic()
- func RemoveSliInt(slice []int32, elem int32) []int32
- func RemoveSliStr(slice []string, elem string) []string
- func Removeduplicate(a interface{}) (ret []interface{})
- func RemoveduplicateMap(DataArr []int32) []int32
- func RoundingFour(value float64) float64
- func RoundingSeven(value float64) float64
- func RoundingTwo(value float64) float64
- func SearchSliFlt(slice []float64, elem float64) bool
- func SearchSliInt(slice []int, elem int) bool
- func SearchSliInt32(slice []int32, elem int32) bool
- func SearchSliInt64(slice []int64, elem int64) bool
- func SearchSliStr(slice []string, elem string) bool
- func SendGameEventToTG(TgbotChatID int, TgbotToken, game, env, reson string)
- func SendTextToTelegramChat(chatId int, text string, Token string) (string, error)
- func SendToTG(TgbotChatID int, TgbotToken, env, reson string)
- func SliceMaxFloat64(l []float64) (max float64)
- func SliceMinFloat64(l []float64) (min float64)
- func Str2Int(str string) int
- func Str2int32(str string) (int32, error)
- func Str2int64(str string) int64
- func TenMinutesTask()
- func TimeFromNow() string
- func TimeFromTimeStamp(timestamp int64) string
- func TimeNowStr() string
- func TimeStamptoDateTime(timestamp int64) string
- func TimestrToTimestamp(time_str string, flag int) int64
- type Aes
- type Queue
- func (q *Queue) Back() interface{}
- func (q *Queue) Begin() *QueueNode
- func (q *Queue) Clear()
- func (q *Queue) End() *QueueNode
- func (q *Queue) Front() interface{}
- func (q *Queue) Init()
- func (q *Queue) PopFront() interface{}
- func (q *Queue) PushBack(elem interface{})
- func (q *Queue) Range(callback func(v interface{}) bool)
- func (q *Queue) Remove(ele interface{}) bool
- func (q *Queue) SetCapactiy(c uint32) uint32
- func (q *Queue) ShowSelf()
- func (q *Queue) Size() uint32
- type QueueNode
- type Ticker
- type TickerManager
- type WorkPool
Constants ¶
const ( DateLayout = "2006-01-02" TimeLayout = "15:04:05" DateTimeLayout = "2006-01-02 15:04:05" )
Variables ¶
This section is empty.
Functions ¶
func DateFromTimeStamp ¶
透過time.Now().Unix()出來的秒數轉為 "2006-01-02"
func DateTimeFromTimeStamp ¶ added in v0.0.6
透過time.Now().Unix()出來的秒數轉為 "2006-01-02" "15:04:05"
func Int32SumParallel ¶
func Post ¶
发送POST请求 url:请求地址, data:POST请求提交的数据,contentType:请求体格式, 如:application/json content:请求放回的内容
func RecoverPanic ¶ added in v0.0.3
func RecoverPanic()
func RemoveSliInt ¶
RemoveSliInt - 移除slice中的某個元素(int)
func RemoveSliStr ¶
RemoveSliStr - 移除slice中的某個元素(str)
func Removeduplicate ¶
func Removeduplicate(a interface{}) (ret []interface{})
func SearchSliFlt ¶
SearchSliFlt - 檢查silce中有沒有此元素(float64)
func SearchSliInt ¶
SearchSliInt - 檢查silce中有沒有此元素(int)
func SearchSliInt32 ¶
SearchSliInt32 - 檢查silce中有沒有此元素(int32)
func SearchSliInt64 ¶
SearchSliInt64 - 檢查silce中有沒有此元素(int64)
func SearchSliStr ¶
SearchSliStr - 檢查silce中有沒有此元素(str)
func SendGameEventToTG ¶ added in v0.0.12
func SendTextToTelegramChat ¶
SendTextToTelegramChat -發送訊息到TelegramChat
func SliceMaxFloat64 ¶
func SliceMinFloat64 ¶
func TimeFromTimeStamp ¶ added in v0.0.6
透過time.Now().Unix()出來的秒數轉為 "15:04:05"
Types ¶
type Aes ¶ added in v0.0.15
func (*Aes) PKCS7Padding ¶ added in v0.0.15
func (*Aes) PKCS7UnPadding ¶ added in v0.0.15
type Queue ¶
type Queue struct {
// contains filtered or unexported fields
}
func CreateQueue ¶
func CreateQueue() *Queue
func (*Queue) SetCapactiy ¶
一開始就要設置, 如果已經有了內容, 則只能設置為和當前容量一樣大小
type Ticker ¶
type Ticker struct {
// contains filtered or unexported fields
}
Ticker 定義一個Ticker,用於時間控制
type TickerManager ¶
type TickerManager struct {
// contains filtered or unexported fields
}
TickerManager 封裝一個tick的管理類,避免每次都要寫一大堆
func (*TickerManager) ClearTicker ¶
func (tm *TickerManager) ClearTicker(id uint64)
ClearTicker 清除tick, 停止tick
type WorkPool ¶ added in v0.0.4
type WorkPool struct {
Pool *ants.Pool
}
func NewWorkPool ¶ added in v0.0.4
NewWorkPool - 建立一個工作池 poolsize:要有多少線呈 return WorkPool
func (*WorkPool) ChangePoolSize ¶ added in v0.0.8
ChangePoolSize - 修改一個工作池 poolsize:要改多少線呈
func (*WorkPool) NewWorkPoolWithFunc ¶ added in v0.0.4
func (wp *WorkPool) NewWorkPoolWithFunc(poolsize int, poolfunc func(interface{})) (*ants.PoolWithFunc, error)
NewWorkPool - 建立WorkPool poolsize:要有多少線呈 return PoolWithFunc
func (*WorkPool) SubmitTask ¶ added in v0.0.4
SubmitTask - 提交一個工作到WorkPool task : 要做事的funtion