bgs

package
v0.0.0-...-0b883aa Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2019 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TYPE_CSV   string = "csv"
	TYPE_EXCEL        = "excel"
)

Variables

This section is empty.

Functions

func CheckStringInArray

func CheckStringInArray(search string, slices []string) bool

检测字符是否在数组中

func CsvOutputSequence

func CsvOutputSequence(t *Template) error

输出序列

func CsvReader

func CsvReader(t *Template) error

csv读取模板

func ExcelOutputSequence

func ExcelOutputSequence(t *Template) error

输出序列

func ExcelReader

func ExcelReader(t *Template) error

excel读取模板

Types

type Template

type Template struct {
	Head   []string
	Body   []string
	Config *TemplateConfig
	// 读取模板文件
	Reader TemplateReaderFunc
	// 输出模板生成的序列
	OutputSequence TemplateOutputSequenceFunc
	// contains filtered or unexported fields
}

模板文件

func New

func New(file *os.File) *Template

新建模板

func (*Template) GetFile

func (t *Template) GetFile() *os.File

获取模板文件

func (*Template) Run

func (t *Template) Run() error

运行模板

type TemplateConfig

type TemplateConfig struct {
	Prefix        string
	Count         uint64
	StartCount    uint64
	ExcludeIndexs []string
	OutputType    string
}

模板配置

func (*TemplateConfig) GetEndSequence

func (c *TemplateConfig) GetEndSequence() uint64

结束序列

func (*TemplateConfig) GetStartSequence

func (c *TemplateConfig) GetStartSequence() uint64

开始序列

type TemplateOutputSequenceFunc

type TemplateOutputSequenceFunc func(*Template) error

type TemplateReaderFunc

type TemplateReaderFunc func(*Template) error

Jump to

Keyboard shortcuts

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