da_griddata

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2021 License: MIT Imports: 25 Imported by: 0

Documentation

Index

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)
)

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 MsgGridDataInput struct {
	ErrorUnableToRead app_msg.Message
}

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

Jump to

Keyboard shortcuts

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