rp_model

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: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StatusTagSuccess = "success"
	StatusTagFailure = "failure"
	StatusTagSkip    = "skip"
)

Variables

View Source
var (
	ErrorWriterIsNotReady = errors.New("writer is not ready")
)

Functions

This section is empty.

Types

type Report

type Report interface {
	Open(opts ...ReportOpt) error
	Spec() Spec
	Rows() int64

	// Close report, close should not raise exception when the report already closed.
	Close()
}

type ReportOpt

type ReportOpt func(o *ReportOpts) *ReportOpts

func ColumnModel

func ColumnModel(model rp_column.Column) ReportOpt

func HiddenColumns

func HiddenColumns(col ...string) ReportOpt

func NoConsoleOutput

func NoConsoleOutput() ReportOpt

func ShowAllColumns

func ShowAllColumns(enabled bool) ReportOpt

func Suffix

func Suffix(suffix string) ReportOpt

type ReportOpts

type ReportOpts struct {
	HiddenColumns   map[string]bool
	ShowAllColumns  bool
	ReportSuffix    string
	NoConsoleOutput bool
	ColumnModel     rp_column.Column
}

func (*ReportOpts) IsHiddenColumn

func (z *ReportOpts) IsHiddenColumn(name string) bool

type RowReport

type RowReport interface {
	Report
	OpenNew(opts ...ReportOpt) (r RowReport, err error)
	Row(row interface{})
	SetModel(row interface{}, opts ...ReportOpt)
}

type Spec

type Spec interface {
	Name() string
	Model() interface{}
	Desc() app_msg.Message
	Columns() []string
	ColumnDesc(col string) app_msg.Message
	Options() []ReportOpt

	Doc(ui app_ui.UI) *dc_recipe.Report
}

type TransactionReport

type TransactionReport interface {
	Report
	OpenNew(opts ...ReportOpt) (r TransactionReport, err error)
	Success(input interface{}, result interface{})
	Failure(err error, input interface{})
	Skip(reason app_msg.Message, input interface{})
	SetModel(input interface{}, result interface{}, opts ...ReportOpt)
}

type TransactionRow

type TransactionRow struct {
	Status    string      `json:"status"`
	StatusTag string      `json:"status_tag"`
	Reason    string      `json:"reason"`
	Input     interface{} `json:"input"`
	Result    interface{} `json:"result"`
}

Jump to

Keyboard shortcuts

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