file

package
v0.0.0-...-6231a78 Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2023 License: MIT Imports: 12 Imported by: 0

README

file

文件

实现

  • 文件末尾追加内容
  • 下载文件(缺省下载目录为临时文件夹)
  • 文件 MD5
  • 文件本地线上比较
  • CSV 文件读数据
  • Json 文件初始化 v 值
  • v 值保存到 Json 文件

Documentation

Overview

文件相关

Index

Constants

This section is empty.

Variables

View Source
var TmpFileNamePrefix string = "goTmpFile"

临时文件前缀

Functions

func AbsPath

func AbsPath(filePath string) string

文件绝对路径

func AppendContent

func AppendContent(filePath, content string) error

文件末尾追加内容

func CSVRead

func CSVRead(filePath string) ([][]string, error)

CSV 文件读数据

func Download

func Download(url string, tmpFilePath string) (string, error)

下载文件(缺省下载目录为临时文件夹)

func JsonInitValue

func JsonInitValue(filePath string, v interface{}) error

Json 文件初始化 v 值

func JsonSaveValue

func JsonSaveValue(filePath string, v interface{}) error

func LocalOnline

func LocalOnline(localFilePath, url string) (bool, error)

文件本地线上比较

func MD5

func MD5(filePath string) (string, error)

文件 MD5

func TmpDel

func TmpDel(filePath string)

删除临时文件

func TomlInitValue

func TomlInitValue(filePath string, v interface{})

从 toml 文件初始化 v 值

Types

This section is empty.

Jump to

Keyboard shortcuts

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