validation

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2022 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cell

type Cell struct {
	Valid    bool     `json:"valid"`
	Feedback Feedback `json:"feedback"`
}

type Collector

type Collector func(level FeedbackLevel, msg string)

type Container

type Container struct {
	Feedback `json:"feedback"`
}

func (*Container) Collect

func (vc *Container) Collect(level FeedbackLevel, msg string)

func (*Container) Flush

func (vc *Container) Flush() Feedback

type Feedback

type Feedback []FeedbackEntry

type FeedbackEntry

type FeedbackEntry struct {
	Level FeedbackLevel `json:"level"`
	Msg   string        `json:"msg"`
}

type FeedbackLevel

type FeedbackLevel string
const (
	FeedbackLevelValid   FeedbackLevel = "valid"
	FeedbackLevelWarning FeedbackLevel = "warning"
	FeedbackLevelError   FeedbackLevel = "error"
)

type Row

type Row struct {
	Valid    bool                      `json:"valid"`
	Cells    map[table.ColumnName]Cell `json:"cells"`
	Feedback Feedback                  `json:"feedback"`
}

func (*Row) AddFeedback

func (r *Row) AddFeedback(level FeedbackLevel, msg string)

func (Row) CellsAreValid

func (r Row) CellsAreValid() bool

type Rows

type Rows []*Row

type Table

type Table struct {
	Valid    bool     `json:"valid"`
	Rows     Rows     `json:"rows"`
	Feedback Feedback `json:"feedback"`
}

func (Table) RowsAreValid added in v0.2.0

func (t Table) RowsAreValid() bool

Jump to

Keyboard shortcuts

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