pkg

package
v0.3.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 23, 2022 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	UserAgent = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.114 Safari/537.36"
)

Variables

This section is empty.

Functions

func FileCreate

func FileCreate(content bytes.Buffer, name string)

func FileMonitoringById

func FileMonitoringById(ctx context.Context, filePth string, id string, group string, hookfn func(context.Context, string, string, []byte))

func GetCurrentPath

func GetCurrentPath() string

GetCurrentPath 获取当前路径,比如:E:/abc/data/test

func GetFileSize

func GetFileSize(filename string) int64

GetFileSize 获取文件大小

func GetLocalHost

func GetLocalHost() string

GetLocalHost 获取局域网ip地址

func GetLocation

func GetLocation(ctx context.Context, ip string) string

GetLocation 获取外网ip地址

func PathCreate

func PathCreate(dir string) error

func PathExist

func PathExist(addr string) bool

PathExist 判断目录是否存在

func Round

func Round(f float64, n int) float64

func SaveUploadedFile

func SaveUploadedFile(file *multipart.FileHeader, dst string) error

SaveUploadedFile uploads the form file to specific dst.

Types

type LocationResp

type LocationResp struct {
	Status      string  `json:"status"` // success
	Country     string  `json:"country"`
	CountryCode string  `json:"countryCode"`
	Region      string  `json:"region"`
	RegionName  string  `json:"regionName"`
	City        string  `json:"city"`
	Zip         string  `json:"zip"`
	Lat         float64 `json:"lat"`
	Lon         float64 `json:"lon"`
	Timezone    string  `json:"timezone"`
	Isp         string  `json:"isp"`
	Org         string  `json:"org"`
	As          string  `json:"as"`
	Query       string  `json:"query"`
}

type ReplaceHelper

type ReplaceHelper struct {
	Root    string //路径
	OldText string //需要替换的文本
	NewText string //新的文本
}

func (*ReplaceHelper) DoWork

func (h *ReplaceHelper) DoWork() error

Directories

Path Synopsis
Package utils @Description: Operation with rsa encryption
Package utils @Description: Operation with rsa encryption

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL