utils

package
v0.1.8 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var UtilFile = NewFile()

Functions

This section is empty.

Types

type File

type File struct {
}

func NewFile

func NewFile() *File

func (*File) CreateFile

func (f *File) CreateFile(filename string) error

create file

func (*File) GetFileLines

func (f *File) GetFileLines(filename string) (fileLine int64, err error)

get file lines params : filename return : fileLine, error

func (*File) PathExists

func (f *File) PathExists(path string) (bool, error)

file or path is exists

type Misc

type Misc struct {
}

func NewMisc

func NewMisc() *Misc

func (*Misc) FormatUnixTime

func (misc *Misc) FormatUnixTime(unixTime int64) string

格式化 unix 时间戳

func (*Misc) HttpGet

func (misc *Misc) HttpGet(queryUrl string, queryValues map[string]string, headerValues map[string]string, timeout int) (body string, code int, err error)

http get request

func (*Misc) HttpPost

func (misc *Misc) HttpPost(queryUrl string, queryValues map[string]string, headerValues map[string]string, timeout int) (body string, code int, err error)

http post request

func (*Misc) MapIntersect

func (misc *Misc) MapIntersect(defaultMap map[string]interface{}, inputMap map[string]interface{}) map[string]interface{}

map Intersect

func (*Misc) RandString

func (m *Misc) RandString(strlen int) string

rand string

Jump to

Keyboard shortcuts

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