datatable

package
v12.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 29, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CommitTableBuilder

type CommitTableBuilder struct {
	// contains filtered or unexported fields
}

CommitTableBuilder collects data about commits in Git repositories in the same way that our Gherkin tables describing commits in repos are organized.

func NewCommitTableBuilder

func NewCommitTableBuilder() CommitTableBuilder

NewCommitTableBuilder provides a fully initialized instance of CommitTableBuilder.

func (*CommitTableBuilder) Add

func (self *CommitTableBuilder) Add(commit git.Commit, location string)

Add registers the given commit from the given location into this table.

func (*CommitTableBuilder) AddMany

func (self *CommitTableBuilder) AddMany(commits []git.Commit, location string)

AddMany registers the given commits from the given location into this table.

func (*CommitTableBuilder) Table

func (self *CommitTableBuilder) Table(fields []string) DataTable

Table provides the data accumulated by this CommitTableBuilder as a DataTable.

type DataTable

type DataTable struct {
	// table data organized as rows and columns
	Cells [][]string `exhaustruct:"optional"`
}

DataTable allows comparing user-generated data with Gherkin tables. The zero value is an empty DataTable.

func FromGherkin

func FromGherkin(table *messages.PickleStepArgument_PickleTable) DataTable

FromGherkin provides a DataTable instance populated with data from the given Gherkin table.

func (*DataTable) AddRow

func (self *DataTable) AddRow(elements ...string)

AddRow adds the given row of table data to this table.

func (*DataTable) EqualDataTable

func (self *DataTable) EqualDataTable(other DataTable) (diff string, errorCount int)

EqualDataTable compares this DataTable instance to the given DataTable. If both are equal it returns an empty string, otherwise a diff printable on the console.

func (*DataTable) EqualGherkin

func (self *DataTable) EqualGherkin(other *messages.PickleStepArgument_PickleTable) (diff string, errorCount int)

EqualGherkin compares this DataTable instance to the given Gherkin self. If both are equal it returns an empty string, otherwise a diff printable on the console.

func (*DataTable) Expand

func (self *DataTable) Expand(localRepo runner, remoteRepo runner, initialDevSHAs map[string]gitdomain.SHA, initialOriginSHAs map[string]gitdomain.SHA) DataTable

Expand returns a new DataTable instance with the placeholders in this datatable replaced with the given values.

func (*DataTable) RemoveText

func (self *DataTable) RemoveText(text string)

RemoveText deletes the given text from each cell.

func (*DataTable) Sort

func (self *DataTable) Sort()

Sorted provides a new DataTable that contains the content of this DataTable sorted by the first column.

func (*DataTable) String

func (self *DataTable) String() string

String provides the data in this DataTable instance formatted in Gherkin self format.

type TagTableBuilder

type TagTableBuilder struct {
	// contains filtered or unexported fields
}

TagTableBuilder collects data about tags in Git repositories in the same way that our Gherkin tables describing tags in repos are organized.

func NewTagTableBuilder

func NewTagTableBuilder() TagTableBuilder

NewTagTableBuilder provides a fully initialized instance of TagTableBuilder.

func (*TagTableBuilder) Add

func (self *TagTableBuilder) Add(tag, location string)

Add registers the given tag from the given location into this table.

func (*TagTableBuilder) AddMany

func (self *TagTableBuilder) AddMany(tags []string, location string)

AddMany registers the given tags from the given location into this table.

func (*TagTableBuilder) Table

func (self *TagTableBuilder) Table() DataTable

Table provides the data accumulated by this TagTableBuilder as a DataTable.

Jump to

Keyboard shortcuts

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