Documentation
¶
Index ¶
- Constants
- Variables
- type GridDataFormatter
- type GridDataInput
- type GridDataInputSpec
- type GridDataOutput
- type GridDataOutputSpec
- type GridDataWriter
- func NewCascadeWriter(name, outputType, filePath string, formatters map[string]GridDataFormatter) GridDataWriter
- func NewConsoleWriter(formatter GridDataFormatter, pw PlainGridDataWriter) GridDataWriter
- func NewPlainWriter(name, path string, formatter GridDataFormatter, writer PlainGridDataWriter) GridDataWriter
- type MsgGridDataInput
- type PlainGridDataFormatter
- type PlainGridDataWriter
Constants ¶
View Source
const ( OutputTypeAll = "all" OutputTypeCsv = "csv" //OutputTypeXlsx = "xlsx" OutputTypeJson = "json" )
View Source
const ( GridOutputOptionFilePath = "" GridOutputOptionFormat = "Format" GridOutputDescSuffix = ".output_grid_data.desc" )
Variables ¶
View Source
var (
ErrorValueRestoreFailed = errors.New("value restore failed")
)
View Source
var (
MGridDataInput = app_msg.Apply(&MsgGridDataInput{}).(*MsgGridDataInput)
)
View Source
var ( OutputTypes = []string{ OutputTypeAll, OutputTypeCsv, OutputTypeJson, } )
Functions ¶
This section is empty.
Types ¶
type GridDataFormatter ¶
type GridDataFormatter interface {
Format(v interface{}, col, row int) interface{}
}
var (
DefaultGridDataFormatter GridDataFormatter = &PlainGridDataFormatter{}
)
type GridDataInput ¶
type GridDataInput interface {
SetFilePath(filePath string)
FilePath() string
EachRow(f func(col []interface{}, rowIndex int) error) error
Open(ctl app_control.Control) error
Spec() GridDataInputSpec
Debug() interface{}
}
func NewInput ¶
func NewInput(recipe interface{}, name string) GridDataInput
type GridDataInputSpec ¶
type GridDataInputSpec interface {
Name() string
Desc() app_msg.Message
Doc(ui app_ui.UI) *dc_recipe.DocGridDataInput
}
func NewInputSpec ¶
func NewInputSpec(recipe interface{}, name string) GridDataInputSpec
type GridDataOutput ¶
type GridDataOutput interface {
mo_multi.MultiValue
Row(column []interface{})
SetFormatter(outType string, formatter GridDataFormatter)
Open(c app_control.Control) error
Close()
Spec() GridDataOutputSpec
Debug() interface{}
FilePath() string
}
func NewOutput ¶
func NewOutput(recipe interface{}, name string) GridDataOutput
type GridDataOutputSpec ¶
type GridDataOutputSpec interface {
Name() string
Desc() app_msg.Message
Doc(ui app_ui.UI) *dc_recipe.DocGridDataOutput
}
func NewOutputSpec ¶
func NewOutputSpec(recipe interface{}, name string) GridDataOutputSpec
type GridDataWriter ¶
type GridDataWriter interface {
Name() string
Row(column []interface{})
Open(c app_control.Control) error
Close()
}
func NewCascadeWriter ¶
func NewCascadeWriter(name, outputType, filePath string, formatters map[string]GridDataFormatter) GridDataWriter
func NewConsoleWriter ¶
func NewConsoleWriter(formatter GridDataFormatter, pw PlainGridDataWriter) GridDataWriter
func NewPlainWriter ¶
func NewPlainWriter(name, path string, formatter GridDataFormatter, writer PlainGridDataWriter) GridDataWriter
type MsgGridDataInput ¶
type PlainGridDataFormatter ¶
type PlainGridDataFormatter struct {
}
func (PlainGridDataFormatter) Format ¶
func (z PlainGridDataFormatter) Format(v interface{}, col, row int) interface{}
type PlainGridDataWriter ¶
type PlainGridDataWriter interface {
// Data type file suffix starts with . (e.g. `.json`, or `.csv`)
FileSuffix() string
// Write a row
WriteRow(l esl.Logger, w io.Writer, formatter GridDataFormatter, row int, column []interface{}) error
}
func NewCsvWriter ¶
func NewCsvWriter() PlainGridDataWriter
func NewJsonWriter ¶
func NewJsonWriter() PlainGridDataWriter
Click to show internal directories.
Click to hide internal directories.