diff options
Diffstat (limited to 'table/table.go')
-rw-r--r-- | table/table.go | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/table/table.go b/table/table.go index f54766c8..08637522 100644 --- a/table/table.go +++ b/table/table.go @@ -400,3 +400,24 @@ func (t *Table) Select(option ...TableSelectOption) (*Table, error) { destinations: dsts, }, nil } + +type TableInfo struct { + NumDestination int + NumPath int + NumAccepted int +} + +func (t *Table) Info(id string) *TableInfo { + var numD, numP int + for _, d := range t.destinations { + ps := d.GetKnownPathList(id) + if len(ps) > 0 { + numD += 1 + numP += len(ps) + } + } + return &TableInfo{ + NumDestination: numD, + NumPath: numP, + } +} |