helper

package
v0.0.0-...-6ef2de5 Latest Latest
Warning

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

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

Documentation

Overview

Package table produces a string that represents slice of structs data in a text table

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AsciiTable

func AsciiTable(slice interface{}) string

AsciiTable formats slice of structs data and returns the resulting string.(Using standard ascii characters)

func Checkdir

func Checkdir(files string) bool

func IsDir

func IsDir(path string) (os.FileInfo, bool)

判断所给路径是否为文件夹

func IsExists

func IsExists(path string) (os.FileInfo, bool)

判断路径是否存在

func IsFile

func IsFile(path string) (os.FileInfo, bool)

判断所给路径是否为文件

func JsonRead

func JsonRead(filename string) []byte

func JsonWrite

func JsonWrite(data []byte, filename string)

func Output

func Output(slice interface{})

Output formats slice of structs data and writes to standard output.(Using box drawing characters)

func OutputA

func OutputA(slice interface{})

OutputA formats slice of structs data and writes to standard output.(Using standard ascii characters)

func StringLength

func StringLength(r []rune) int

StringLength string display length

func Table

func Table(slice interface{}) string

Table formats slice of structs data and returns the resulting string.(Using box drawing characters)

Types

type Csv

type Csv struct {
	Writer *csv.Writer
	// contains filtered or unexported fields
}

func (*Csv) CsvWrite

func (c *Csv) CsvWrite(Name string, content map[string]string, writenum int) bool

type Mysql

type Mysql struct {
	DB *sql.DB
}

func GetMysqlInstance

func GetMysqlInstance() *Mysql

func (*Mysql) CreateTable

func (m *Mysql) CreateTable(name string, fields map[string]string) bool

func (*Mysql) MysqlWrite

func (m *Mysql) MysqlWrite(Name string, content map[string]string) bool

Jump to

Keyboard shortcuts

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