gf

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2023 License: Apache-2.0 Imports: 6 Imported by: 4

README

gf

介绍

使用Go编写的文件管理模块

软件架构

软件架构说明

安装教程
  1. xxxx
  2. xxxx
  3. xxxx
使用说明
  1. xxxx
  2. xxxx
  3. xxxx
参与贡献
  1. Fork 本仓库
  2. 新建 Feat_xxx 分支
  3. 提交代码
  4. 新建 Pull Request
特技
  1. 使用 Readme_XXX.md 来支持不同的语言,例如 Readme_en.md, Readme_zh.md
  2. Gitee 官方博客 blog.gitee.com
  3. 你可以 https://gitee.com/explore 这个地址来了解 Gitee 上的优秀开源项目
  4. GVP 全称是 Gitee 最有价值开源项目,是综合评定出的优秀开源项目
  5. Gitee 官方提供的使用手册 https://gitee.com/help
  6. Gitee 封面人物是一档用来展示 Gitee 会员风采的栏目 https://gitee.com/gitee-stars/

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Version

func Version()

Types

type FileApi

type FileApi struct {
	FileName string // 需要操作的文件名
	// contains filtered or unexported fields
}

func (*FileApi) DeleteFile

func (fi *FileApi) DeleteFile(file string) error

DeleteFile 删除文件

func (*FileApi) EchoAdd

func (fi *FileApi) EchoAdd(text, filename string, wrap bool) error

EchoAdd 写入文本到文件中,当文件已存在则覆盖,当文件不存在则创建,默认权限: 0666

func (*FileApi) Exists

func (fi *FileApi) Exists(path string) error

Exists 判断路径是否存在

func (*FileApi) IsDir

func (fi *FileApi) IsDir(path string) (bool, error)

IsDir 判断是否属于文件夹

func (*FileApi) IsFile

func (fi *FileApi) IsFile(path string) (err error)

IsFile 判断是否属于文件

func (*FileApi) Mkdir

func (fi *FileApi) Mkdir(dir string, mode fs.FileMode) error

Mkdir 递归创建文件夹(dir 文件夹路径 mode 创建模式,例如: 0777)

func (*FileApi) ReadLine

func (fi *FileApi) ReadLine(line int) (string, error)

ReadLine 读取指定行

func (*FileApi) ReadOnlyAll

func (fi *FileApi) ReadOnlyAll() (string, error)

ReadOnlyAll 以只读方式读取文件所有内容

func (*FileApi) WriteTxtAppend

func (fi *FileApi) WriteTxtAppend(text, filename string, wrap bool) error

WriteTxtAppend 追加方式写入文本(wrap: 是否在末尾追加换行符)

type ReadScreen

type ReadScreen struct {
	Str string // 字符串内容
}

func (ReadScreen) Line

func (r ReadScreen) Line(n int) error

Line 筛选文本内容指定列

Jump to

Keyboard shortcuts

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