Documentation ¶
Index ¶
- Variables
- func AppendToFile(filename string, b []byte) error
- func Base64Decode(src string) ([]byte, error)
- func Base64Encode(src []byte) string
- func CloneMapInt64Int64(data map[int64]int64) map[int64]int64
- func CloneSliceInt64(datas []int64) []int64
- func ContainsKey(m map[string]interface{}, key string) bool
- func ContainsKeys(m map[string]interface{}, keys []string) bool
- func F64Str(num float64) string
- func FileExists(filename string) bool
- func GZipDecode(in []byte) ([]byte, error)
- func HmacSHA256(msg []byte, secretKey []byte) ([]byte, error)
- func HttpDelete(url string, headers map[string]string, body io.Reader) ([]byte, error)
- func HttpGet(url string, headers map[string]string, body io.Reader) ([]byte, error)
- func HttpGetAsync(url string, headers map[string]string, body io.Reader, ...)
- func HttpPost(url string, headers map[string]string, body io.Reader) ([]byte, error)
- func HttpPostAsync(url string, headers map[string]string, body io.Reader, ...)
- func HttpPut(url string, headers map[string]string, body io.Reader) ([]byte, error)
- func I64Str(num int64) string
- func Int64SliceContains(s []int64, data int64) bool
- func Int64SliceIndexFirst(s []int64, data int64) int
- func Int64SliceRemoveFirst(s []int64, data int64) []int64
- func Int64SliceRemoveSlice(s []int64, datas []int64) []int64
- func JsonMapGetInt64Value(data map[string]interface{}, key string) (int64, error)
- func JsonMapGetUIntValue(data map[string]interface{}, key string) (uint, error)
- func JsonMarshal(v interface{}) []byte
- func JsonToMap(s []byte) (map[string]interface{}, error)
- func JsonToObj(s []byte, out interface{}) error
- func MD5(b []byte) string
- func MapInt64Int64Keys(data map[int64]int64) []int64
- func MysqlAddIndex(db *gorm.DB, table interface{}, index string) error
- func MysqlCreateTable(db *gorm.DB, tableName string, table interface{}) error
- func MysqlHasTable(db *gorm.DB, tableName string) bool
- func MysqlInsertIgnore(db *gorm.DB, tableName string, datas interface{}) error
- func MysqlNew(dbName string) *gorm.DB
- func MysqlSelectSql(db *gorm.DB, sql string, out interface{}) error
- func NewWebsocket(url string, origin string) (*websocket.Conn, error)
- func PanicError(err error)
- func ReadFile(filename string) []byte
- func ReadJsonArrayFile(filename string) (interface{}, error)
- func ReadJsonMapFile(filename string) (map[string]interface{}, error)
- func RedisGet(client *redis.Client, key string) (string, error)
- func RedisNew(ip string, port string, password string) *redis.Client
- func RedisSet(client *redis.Client, key string, value string) error
- func Retry(f func() error, counts int, delay time.Duration) error
- func StrF64(s string) float64
- func StrI64(s string) int64
- func StrTime(s string) time.Time
- func StringSliceContains(datas []string, s string) bool
- func TimeAdd(t time.Time, d string) time.Time
- func TimeStr(t time.Time) string
- func TimeToTimestamp(t time.Time) int64
- func TimestampToTime(timestamp int64) time.Time
- func UIntSliceContains(s []uint, data uint) bool
- func UIntSliceIndexFirst(s []uint, data uint) int
- func UIntSliceRemoveFirst(s []uint, data uint) []uint
- func WebsocketReadBytes(conn *websocket.Conn) (data []byte, err error)
- func WebsocketReadString(conn *websocket.Conn) (data string, err error)
- func WebsocketWriteBytes(conn *websocket.Conn, data []byte) error
- func WebsocketWriteString(conn *websocket.Conn, data string) error
- func WriteCSVLine(filename string, datas ...string) error
- func WriteFile(filename string, datas []byte)
- func WriteJsonFile(filename string, obj interface{}) error
- type Int64Slice
Constants ¶
This section is empty.
Variables ¶
View Source
var DEAD_CODE = errors.New("DEAD_CODE")
View Source
var JSON_MAP_TRANS_ERROR = errors.New("JSON_MAP_TRANS_ERROR")
View Source
var MAP_KEY_NOT_FOUND_ERROR = errors.New("MAP_KEY_NOT_FOUND_ERROR")
View Source
var NOT_FOUND_ERROR = errors.New("NOT_FOUND_ERROR")
Functions ¶
func AppendToFile ¶
func Base64Decode ¶
func Base64Encode ¶
func CloneSliceInt64 ¶
func ContainsKey ¶
func ContainsKeys ¶
func FileExists ¶
func GZipDecode ¶
func HttpDelete ¶
func HttpGetAsync ¶
func HttpPostAsync ¶
func Int64SliceContains ¶
func Int64SliceIndexFirst ¶
func Int64SliceRemoveFirst ¶
func Int64SliceRemoveSlice ¶
func JsonMapGetInt64Value ¶
func JsonMapGetUIntValue ¶
func JsonMarshal ¶
func JsonMarshal(v interface{}) []byte
func MapInt64Int64Keys ¶
func MysqlCreateTable ¶
func MysqlInsertIgnore ¶
func PanicError ¶
func PanicError(err error)
func ReadJsonArrayFile ¶
func ReadJsonMapFile ¶
func StringSliceContains ¶
func TimeToTimestamp ¶
func TimestampToTime ¶
func UIntSliceContains ¶
func UIntSliceIndexFirst ¶
func UIntSliceRemoveFirst ¶
func WriteCSVLine ¶
func WriteJsonFile ¶
Types ¶
type Int64Slice ¶
type Int64Slice []int64
Int64原地排序 sort.Sort(Int64Slice(datas))
func (Int64Slice) Len ¶
func (p Int64Slice) Len() int
func (Int64Slice) Less ¶
func (p Int64Slice) Less(i, j int) bool
func (Int64Slice) Swap ¶
func (p Int64Slice) Swap(i, j int)
Click to show internal directories.
Click to hide internal directories.