Documentation ¶
Index ¶
- func InstallSupportOptionsWatchDog(dog func(cc *SupportOptions))
- func WriteFile(fname string, data []byte) (err error)
- type ExportOption
- type ExportSupportConfig
- func (cfg *ExportSupportConfig) BoolVar(p *bool, name string, value bool, usage string, updates ...func())
- func (cfg *ExportSupportConfig) ExportFlag() parser.ExportTags
- func (cfg *ExportSupportConfig) HasSetFlag() bool
- func (cfg *ExportSupportConfig) Int64OptionsVar(p *int64, name string, value int64, usage string, opts []int64, ...)
- func (cfg *ExportSupportConfig) Int64Var(p *int64, name string, value int64, usage string, updates ...func())
- func (cfg *ExportSupportConfig) OutpathData() string
- func (cfg *ExportSupportConfig) OutpathType() string
- func (cfg *ExportSupportConfig) SetFlagSet(set *pflag.FlagSet)
- func (cfg *ExportSupportConfig) StringSliceVar(p *[]string, name string, value []string, usage string, updates ...func())
- func (cfg *ExportSupportConfig) StringVar(p *string, name string, value string, usage string, updates ...func())
- type SupportOption
- func WithCheckOptions(v func() error) SupportOption
- func WithExportData(v func(sheet *parser.XlsxSheet, opts *ExportOption) (err error)) SupportOption
- func WithExportDefine(v func(sheet *parser.XlsxSheet, opts *ExportOption) (err error)) SupportOption
- func WithExportMergeData(v func(sheets []*parser.XlsxSheet, opts *ExportOption) (err error)) SupportOption
- func WithExportMergeDefine(v func(sheets []*parser.XlsxSheet, opts *ExportOption) (err error)) SupportOption
- type SupportOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InstallSupportOptionsWatchDog ¶
func InstallSupportOptionsWatchDog(dog func(cc *SupportOptions))
InstallSupportOptionsWatchDog install watch dog
Types ¶
type ExportOption ¶
type ExportOption struct { // 当前输出路径 Outpath string // Type 路径 TypePath string // Data 路径 DataPath string // 导出标记 ExportFlag parser.ExportTags }
type ExportSupportConfig ¶
type ExportSupportConfig struct { // Language 导出名字 Language string // 导出选项 Opts *SupportOptions // contains filtered or unexported fields }
ExportSupport 导出生成支持的配置项
func NewExportConfig ¶
func NewExportConfig(language string, opts ...SupportOption) *ExportSupportConfig
func (*ExportSupportConfig) BoolVar ¶
func (cfg *ExportSupportConfig) BoolVar(p *bool, name string, value bool, usage string, updates ...func())
BoolVar defines a bool flag with specified name, default value, and usage string. The argument p points to a bool variable in which to store the value of the flag.
func (*ExportSupportConfig) ExportFlag ¶
func (cfg *ExportSupportConfig) ExportFlag() parser.ExportTags
func (*ExportSupportConfig) HasSetFlag ¶
func (cfg *ExportSupportConfig) HasSetFlag() bool
func (*ExportSupportConfig) Int64OptionsVar ¶
func (*ExportSupportConfig) Int64Var ¶
func (cfg *ExportSupportConfig) Int64Var(p *int64, name string, value int64, usage string, updates ...func())
Int64Var defines an int64 flag with specified name, default value, and usage string. The argument p points to an int64 variable in which to store the value of the flag.
func (*ExportSupportConfig) OutpathData ¶
func (cfg *ExportSupportConfig) OutpathData() string
数据导出目录
func (*ExportSupportConfig) OutpathType ¶
func (cfg *ExportSupportConfig) OutpathType() string
类型导出目录
func (*ExportSupportConfig) SetFlagSet ¶
func (cfg *ExportSupportConfig) SetFlagSet(set *pflag.FlagSet)
func (*ExportSupportConfig) StringSliceVar ¶
func (cfg *ExportSupportConfig) StringSliceVar(p *[]string, name string, value []string, usage string, updates ...func())
StringSliceVar defines a string flag with specified name, default value, and usage string. The argument p points to a []string variable in which to store the value of the flag. Compared to StringArray flags, StringSlice flags take comma-separated value as arguments and split them accordingly. For example:
--ss="v1,v2" --ss="v3"
will result in
[]string{"v1", "v2", "v3"}
func (*ExportSupportConfig) StringVar ¶
func (cfg *ExportSupportConfig) StringVar(p *string, name string, value string, usage string, updates ...func())
StringVar defines a string flag with specified name, default value, and usage string. The argument p points to a string variable in which to store the value of the flag.
type SupportOption ¶
type SupportOption func(cc *SupportOptions) SupportOption
SupportOption option define
func WithExportData ¶
func WithExportData(v func(sheet *parser.XlsxSheet, opts *ExportOption) (err error)) SupportOption
导出数据文件
func WithExportDefine ¶
func WithExportDefine(v func(sheet *parser.XlsxSheet, opts *ExportOption) (err error)) SupportOption
导出类型文件
func WithExportMergeData ¶
func WithExportMergeData(v func(sheets []*parser.XlsxSheet, opts *ExportOption) (err error)) SupportOption
合并导出数据
func WithExportMergeDefine ¶
func WithExportMergeDefine(v func(sheets []*parser.XlsxSheet, opts *ExportOption) (err error)) SupportOption
合并导出类型
type SupportOptions ¶
type SupportOptions struct { // 导出类型文件 ExportDefine func(sheet *parser.XlsxSheet, opts *ExportOption) (err error) // 合并导出类型 ExportMergeDefine func(sheets []*parser.XlsxSheet, opts *ExportOption) (err error) // 导出数据文件 ExportData func(sheet *parser.XlsxSheet, opts *ExportOption) (err error) // 合并导出数据 ExportMergeData func(sheets []*parser.XlsxSheet, opts *ExportOption) (err error) // 检测配置 CheckOptions func() error }
ServerOption
func NewSupportOptions ¶
func NewSupportOptions(opts ...SupportOption) *SupportOptions
NewSupportOptions create options instance.
func (*SupportOptions) ApplyOption ¶
func (cc *SupportOptions) ApplyOption(opts ...SupportOption)
ApplyOption modify options
func (*SupportOptions) GetSetOption ¶
func (cc *SupportOptions) GetSetOption(opt SupportOption) SupportOption
GetSetOption modify and get last option
func (*SupportOptions) SetOption ¶
func (cc *SupportOptions) SetOption(opt SupportOption)
SetOption modify options