go-ml.dev/pkg/base@v0.0.0-20200610162856-60c38abac71b/tables/any.go (about)

     1  package tables
     2  
     3  /*
     4  AnyData represents both tables and lazy-streams as common data source type.
     5  Any one of them can be used as Table or Lazy stream via this interface.
     6  Although, if it's matter, user can decided to use real form of the data by IsLazy selector.
     7  */
     8  type AnyData interface {
     9  	// IsLazy specifies is it lazy datasource or a table
    10  	IsLazy() bool
    11  	// Use it as lazy datasource
    12  	Lazy() Lazy
    13  	// Use it as a table, if it's really lazy and collect returns an error panic will occur
    14  	Table() *Table
    15  	// Use it as a table, if it's a lazy data source it will be collected to a table
    16  	Collect() (*Table, error)
    17  }