Documentation
¶
Overview ¶
Package basics Time : 2022/7/26 11:11 Author : xushiyin contact : yuqingxushiyin@gmail.com
Package basics Time : 2021/5/7 10:22 上午 Author : xushiyin contact : yuqingxushiyin@gmail.com
Package basics Time : 2022/8/4 10:10 Author : xushiyin contact : yuqingxushiyin@gmail.com
Package basics Time : 2022/7/26 10:15 Author : xushiyin contact : yuqingxushiyin@gmail.com description : Go语言官方库:os、io/iouti(弃用)、bufio涵盖了文件操作的所有场景 os库中的方法对文件都是直接的IO操作,频繁的IO操作会增加CPU的中断频率,所以我们可以使用内存缓存区来减少IO操作, 在写字节到硬盘前使用内存缓存,当内存缓存区的容量到达一定数值时在写内存数据buffer到硬盘
Package basics Time : 2022/8/6 16:50 Author : xushiyin contact : yuqingxushiyin@gmail.com
Package basics Time : 2021/5/7 8:48 下午 Author : xushiyin contact : yuqingxushiyin@gmail.com
Package basics Time : 2021/5/7 9:26 上午 Author : xushiyin contact : yuqingxushiyin@gmail.com
Package basics Time : 2021/5/7 8:57 下午 Author : xushiyin contact : yuqingxushiyin@gmail.com
Package basics Time : 2022/8/7 17:18 Author : xushiyin contact : yuqingxushiyin@gmail.com
Package basics Time : 2022/7/26 17:13 Author : xushiyin contact : yuqingxushiyin@gmail.com
Index ¶
- func CreateFile(fileName string) (*os.File, error)
- func CreateTables(db *sqlx.DB, schemes string) error
- func DeleteCustomer(customer Customer) error
- func DialWithTimeout(network, address string, timeout time.Duration) (net.Conn, error)
- func EntrancePipeline()
- func Fibonacci(ch chan int, done chan struct{})
- func FileChMod(fileName string, mode os.FileMode) error
- func FileChown(fileName string, uid, gid int) error
- func GetConnection() (database *sql.DB, err error)
- func GetFileInfo(fileName string) (os.FileInfo, error)
- func GetIntTwoSlice(rows int, cols int) [][]int
- func GetSqliteConn(dbFile string) (db *sqlx.DB, err error)
- func InsertCustomer(customer Customer) (sql.Result, error)
- func InsertPerson(db *sqlx.DB, persons []*Person) error
- func InsertPlace(db *sqlx.DB, places []*Place) error
- func ReadBytes(fileName string, size int) ([]byte, error)
- func ReadFileAll(fileName string) ([]byte, error)
- func ReadLine(fileName string) ([]byte, error)
- func ReadScanWord(fileName string, size int) ([]byte, error)
- func RmFile(fileName string) error
- func StrSliceJoin(list []string, sep string) string
- func Tar(src string, writers ...io.Writer) error
- func UnZipFiles(zipName string) error
- func Untar(dst string, r io.Reader) error
- func UpdateCustomer(customer Customer) error
- func WriteAll(fileName string, content []byte) error
- func WriteAt(fileName string, content []byte, offset int64) error
- func WriteBuffer(fileName string, content []byte) error
- func WriteLine(fileName string, content []byte) error
- func WriteLine2(fileName string, content []byte) error
- func ZipFiles(zipName string, zFiles []FileBody) error
- type Customer
- type FileBody
- type Person
- type Place
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeleteCustomer ¶
DeleteCustomer method with parameter customer
func DialWithTimeout ¶
func EntrancePipeline ¶
func EntrancePipeline()
func GetConnection ¶
GetConnection method which returns sql.DB
func GetIntTwoSlice ¶
func ReadFileAll ¶
func StrSliceJoin ¶
func Tar ¶
Tar takes a source and variable writers and walks 'source' writing each file found to the tar writer; the purpose for accepting multiple writers is to allow for multiple outputs (for example a file, or md5 hash)
func UnZipFiles ¶
func Untar ¶
Untar takes a destination path and a reader; a tar reader loops over the tarfile creating the file structure at 'dst' along the way, and writing any files
func UpdateCustomer ¶
UpdateCustomer method with parameter customer