Documentation ¶
Index ¶
- Variables
- func Abs(n int64) int64
- func AnyToDecimal(num string, n int) int
- func AvgFloat64(i []float64) float64
- func Azimuth(lon1, lat1, lon2, lat2 float64) float64
- func Bd09ToMercator(lng, lat float64) (float64, float64)
- func Bd09ToTile(lng, lat float64, zoom int) (int, int)
- func Bd2Wgs(lon, lat float64) (float64, float64)
- func Bd2gcj(lon, lat float64) (float64, float64)
- func ColFloat64(raw, fields, oper string) (ret float64)
- func CsvWriteALL(data [][]string, wfile string, comma rune) error
- func CsvWriteFile(data [][]string, wfile string, comma string) error
- func DayLastRange(f string) (ret []string)
- func DecimalToAny(num, n int) string
- func Degrees(d float64) float64
- func DiffSqrtMeanFloat64(a []float64) []float64
- func FileCopy(src, dest string) error
- func FileHash(htype string, fname string) ([]byte, error)
- func FileLinesCount(filename string, delim byte) int
- func FileMD5(fname string) ([]byte, error)
- func FilePatternLinesCount(fexp string, delim byte) (count int, detail map[string]int)
- func FileSHA1(fname string) ([]byte, error)
- func FileSize(fname string) int64
- func Gcj2Wgs(lon, lat float64) (float64, float64)
- func Gcj2bd(lon, lat float64) (float64, float64)
- func GetFTPFiles(ftptype, addr, user, pwd, pasv, localfileprefix string, pattern []string, ...) (files map[string]string, err error)
- func ID15to18(id string) string
- func IDisPattern(id string) bool
- func IDisValid(id string) bool
- func IDsumY(id string) string
- func InitAddr()
- func Ip2long(ip net.IP) uint32
- func IsClockwise(latlngs [][]float64) bool
- func IsDirsExist(paths []string, isCreate bool) (err error)
- func IsFilesExist(paths []string) (err error)
- func Long2ip(ip uint32) net.IP
- func MaxFloat64(i []float64) float64
- func MeanFloat64(i []float64) float64
- func MercatorToBd09(x, y float64) (float64, float64)
- func MinFloat64(i []float64) float64
- func ParsrLS(s string) (fileInfo []string)
- func PointAt(lon, lat, dist, azimuth float64) (float64, float64)
- func PointDistHaversine(lon1, lat1, lon2, lat2 float64) float64
- func PointDistance(lon1, lat1, lon2, lat2 float64) float64
- func PointMid(lon1, lat1, lon2, lat2 float64) (float64, float64)
- func PointRound6(x, y float64) (float64, float64)
- func PointRound7(x, y float64) (float64, float64)
- func PointRound8(x, y float64) (float64, float64)
- func Radians(r float64) float64
- func Round(x float64, prec int) float64
- func Sqlldr(timeflag, userid, data, control, baddir string) (rows, badrows int, err error)
- func StdDevFloat64(a []float64) float64
- func StringReverse(s string) string
- func StringToFloat64(raw, fields string) (dat []float64)
- func StringsIntersect(s1, s2 []string) []string
- func StringsMinus(s1, s2 []string) []string
- func StringsReverse(s []string) []string
- func StringsUnion(s1, s2 []string) []string
- func StringsUniq(s1 []string) []string
- func SubString(str string, begin, length int) (substr string)
- func SumFloat64(s []float64) (sum float64)
- func Tile2Wgs(x, y, z int) (lat, lng float64)
- func TileImage(lng, lat float64, z int, deg int) (x, y, px, py int)
- func TimeExtend(t time.Time, s int, d time.Duration) (r []time.Time)
- func TimeFormat(f string, t ...time.Time) (ret []string)
- func TimeParse(s string) (t time.Time, err error)
- func TimeRule(s string, t time.Time, sum int) (ret []time.Time)
- func TimeSplit(b, e time.Time, d time.Duration) (r []time.Time)
- func TimeTrunc(s string, t time.Time) time.Time
- func Unzip(fname, oname string) error
- func Wgs2Tile(lng, lat float64, z int) (x, y int)
- func Wgs2bd(lon, lat float64) (float64, float64)
- func Wgs2gcj(lon, lat float64) (float64, float64)
- func ZipDeCompress(fname string) (retRaw map[string][]byte, err error)
- type Crypto
- type Geo
- func (g Geo) Box() []float64
- func (g Geo) CoordsJSON() (s string, err error)
- func (g Geo) Copy() Geo
- func (g Geo) FlipCoordinates()
- func (g Geo) Gcj2bd()
- func (g Geo) GeoJSON() (s string, err error)
- func (g Geo) Lines() []Line
- func (g Geo) PointFunc(f func(lon, lat float64) (float64, float64))
- func (g Geo) PointRound6()
- func (g Geo) PointRound7()
- func (g Geo) PointRound8()
- func (g Geo) Points() []Point
- func (g Geo) String() (wkt string)
- func (g Geo) ToWKT() (wkt string)
- func (g Geo) Wgs2bd()
- func (g Geo) Wgs2gcj()
- type Hash
- type IDCard
- type Line
- type MapAPI
- func (m MapAPI) AmapGeoCode(address string) (poi Poi)
- func (m *MapAPI) AmapGeoCodeALL(addrsMap map[string]string, poolsize int) (addrsAll map[string]Poi)
- func (m MapAPI) BdmapGeoCode(address string) (poi Poi)
- func (m *MapAPI) BdmapGeoCodeALL(addrsMap map[string]string, poolsize int) (addrsAll map[string]Poi)
- func (m MapAPI) BmapMocator(mocator string) string
- type Poi
- type Point
- type SSftp
- type XFtp
- func (c *XFtp) Connect() (err error)
- func (c *XFtp) ConnectAndDownload() (files map[string]string, err error)
- func (c XFtp) DownloadFiles(files []string) (dat map[string]string, err error)
- func (c XFtp) DownloadFilesMap(files map[string]string) (dat map[string]string, err error)
- func (c XFtp) FileList(CMD string) (ftpfiles []string)
- func (c XFtp) InfoList() (ftpfiles []string)
- func (c XFtp) Logout() error
- func (c XFtp) MKdir(path string)
- func (c XFtp) NameList() (ftpfiles []string)
- func (c XFtp) Size(path string) int64
- func (c *XFtp) UploadFiles(files map[string]string, useLineMode bool) (retInfo map[string]error)
- type XSFtp
- func (c *XSFtp) Cmd(cmd string) (stdout, stderr string)
- func (c *XSFtp) Connect() (err error)
- func (c *XSFtp) ConnectAndDownload() (files map[string]string, err error)
- func (c *XSFtp) DownloadFiles(files []string) (dat map[string]string, err error)
- func (c *XSFtp) DownloadFilesMap(files map[string]string) (dat map[string]string, err error)
- func (c XSFtp) FileExist(filepath string) (bool, error)
- func (c XSFtp) IsDir(path string) bool
- func (c XSFtp) IsFile(path string) bool
- func (c XSFtp) Logout() error
- func (c *XSFtp) NameList() (ftpfiles []string)
- func (c XSFtp) RemoveFile(remoteFile string) error
- func (c XSFtp) Size(path string) int64
- func (c *XSFtp) UploadFiles(files map[string]string) (retInfo map[string]error)
Constants ¶
This section is empty.
Variables ¶
var ChinaAddr map[string]string
Functions ¶
func AvgFloat64 ¶
func Bd09ToMercator ¶
Bd09ToMercator 百度经纬度坐标转墨卡托坐标
func ColFloat64 ¶
func CsvWriteALL ¶
CsvWriteALL 生成CSV
func CsvWriteFile ¶
CsvWriteALL 生成CSV
func DiffSqrtMeanFloat64 ¶
func FilePatternLinesCount ¶
FilePatternLinesCount 匹配文件行数计算
func GetFTPFiles ¶
func GetFTPFiles(ftptype, addr, user, pwd, pasv, localfileprefix string, pattern []string, expectfiles []string) (files map[string]string, err error)
GetFTPFiles 获取 FTP/SFTP 匹配的文件
func MaxFloat64 ¶
func MeanFloat64 ¶
func MercatorToBd09 ¶
MercatorToBd09 墨卡托坐标转百度经纬度坐标
func MinFloat64 ¶
func PointDistHaversine ¶
PointDistHaversine (in meter) Haversine_formula
func PointDistance ¶
PointDistance (in meter) Spherical_law_of_cosines
func StdDevFloat64 ¶
func StringToFloat64 ¶
func StringsIntersect ¶
StringsIntersect 交集 s1∩s2 去重
func StringsReverse ¶
StringsReverse reverses an array of string
func SumFloat64 ¶
Types ¶
type IDCard ¶
type IDCard struct { ID string Gender string Age string Birthdate string Province string City string District string }
* 身份证15位编码规则:dddddd yymmdd xx p * 身份证18位编码规则:dddddd yyyymmdd xx p y * dddddd: 地区编码 * yymmdd: 出生年(两位年)月日,如:910215 * yyyymmdd: 出生年(四位年)月日,如:19910215 * xx: 顺序编码,系统产生,无法确定 * p: 性别,奇数为男,偶数为女 * y: 校验码,该位数值可通过前17位计算获得 * * 前17位号码加权因子为 Wi = [ 7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2 ] * 验证位 Y = [ 1, 0, 10, 9, 8, 7, 6, 5, 4, 3, 2 ] * 如果验证码恰好是10,为了保证身份证是十八位,那么第十八位将用X来代替 * 校验位计算: Y_P = mod( ∑(Ai×Wi),11 ) * i为身份证号码1...17 位; Y_P为校验码Y所在校验码数组位置
type MapAPI ¶
type MapAPI struct { AK string LimitCity string SM sync.Map // contains filtered or unexported fields }
func (MapAPI) AmapGeoCode ¶
AmapGeoCode 高德解析地址为经纬度
func (*MapAPI) AmapGeoCodeALL ¶
AmapGeoCodeALL 高德解析地址为经纬度
func (MapAPI) BdmapGeoCode ¶
BdmapGeoCode 百度解析地址为经纬度
type XFtp ¶
type XFtp struct { Addr string User string Pwd string PASV string FilePattern []string LocalFilePrefix string Conn *ftp4go.FTP }
func (*XFtp) ConnectAndDownload ¶
func (XFtp) DownloadFiles ¶
func (XFtp) DownloadFilesMap ¶
type XSFtp ¶
type XSFtp struct { Addr string User string Pwd string FilePattern []string LocalFilePrefix string SSH *ssh.Client SFTP *sftp.Client }
func (*XSFtp) ConnectAndDownload ¶
func (*XSFtp) DownloadFiles ¶
func (*XSFtp) DownloadFilesMap ¶
func (*XSFtp) NameList ¶
------------------------------------------------------------------------------