Documentation ¶
Index ¶
- Variables
- func SelectColumnsByRange(rng target.Range, sources [][]string) ([]string, error)
- func SelectColumnsByTarget(tgt *target.Target, sources [][]string) ([]string, error)
- type Cache
- type CacheBuilder
- type Index
- type IndexLoader
- type Item
- type Joiner
- type KeyFunc
- type Location
- type RelationJoiner
- type ScannedItem
- type SelectItem
- type SelectItemList
- type Selector
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrInvalidKey = errors.New("InvalidKey")
View Source
var ErrInvalidRange = errors.New("InvalidRange")
View Source
var ErrNewKeyFailure = errors.New("NewKeyFailure")
Functions ¶
func SelectColumnsByRange ¶
Types ¶
type CacheBuilder ¶
func NewCacheBuilder ¶
func NewCacheBuilder(dataList []io.ReadSeeker, locationList []Location, delimiter string, limit, indexCacheSize int) CacheBuilder
type Index ¶
type Index interface { KeyFunc() KeyFunc Get(key string) ([]Item, bool) Read(item Item) (ScannedItem, error) Scan(ctx context.Context) <-chan ScannedItem AllItems(ctx context.Context) <-chan Item }
Index is an in-memory word-to-lines index. This is read-only, underlying data source (file) must be also read-only.
type IndexLoader ¶ added in v0.2.2
func NewIndexLoader ¶ added in v0.2.2
func NewIndexLoader(data async.ReadSeeker, indexCacheSize int) IndexLoader
type Joiner ¶
type Joiner interface {
Join(ctx context.Context, key *joinkey.JoinKey) <-chan SelectItemList
}
func New ¶
func New(relJoiner RelationJoiner) Joiner
type Location ¶
type RelationJoiner ¶
type RelationJoiner interface { // FullJoin links records with cross join. FullJoin(ctx context.Context, rel *joinkey.Relation) <-chan SelectItemList // Join links given rows and the other records. // Fallback to FullJoin if rowC is nil. Join(ctx context.Context, rel *joinkey.Relation, rowC <-chan SelectItemList) <-chan SelectItemList }
func NewRelationJoiner ¶
func NewRelationJoiner(cache Cache) RelationJoiner
type ScannedItem ¶
func NewScannedItem ¶
func NewScannedItem( line string, item Item, ) ScannedItem
type SelectItem ¶
func NewSelectItem ¶
func NewSelectItem( source int, item Item, ) SelectItem
type SelectItemList ¶
type SelectItemList map[int]SelectItem
func (SelectItemList) Clone ¶
func (s SelectItemList) Clone() SelectItemList
func (SelectItemList) Keys ¶
func (s SelectItemList) Keys() []int
func (SelectItemList) Set ¶
func (s SelectItemList) Set(item SelectItem)
func (SelectItemList) Sorted ¶
func (s SelectItemList) Sorted() []SelectItem
type Selector ¶
type Selector interface { // Select forms selected items into a line depending on the target. // items specify the data sources, target is columns to be selected. Select(tgt *target.Target, items []SelectItem) (string, error) }
func NewSelector ¶
Click to show internal directories.
Click to hide internal directories.