Documentation ¶
Index ¶
- type DataBinder
- type DataManager
- func (d *DataManager) HasData() bool
- func (d *DataManager) HasDataProvider() bool
- func (d *DataManager) LoadData(ctx context.Context, owner DataManagerI)
- func (d *DataManager) RangeData(f func(int, interface{}) bool)
- func (d *DataManager) ResetData()
- func (d *DataManager) SetData(data interface{})
- func (d *DataManager) SetDataProvider(b DataBinder)
- type DataManagerEmbedder
- type DataManagerI
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DataBinder ¶
type DataBinder interface { // A DataBinder must be a control so that we can serialize it ID() string // BindData is called by the data manager to get the data for the control during draw time BindData(ctx context.Context, s DataManagerI) }
type DataManager ¶
type DataManager struct {
// contains filtered or unexported fields
}
DataManager is an object designed to be embedded in a control that will help manage the data binding process.
func (*DataManager) HasData ¶ added in v0.2.0
func (d *DataManager) HasData() bool
func (*DataManager) HasDataProvider ¶
func (d *DataManager) HasDataProvider() bool
func (*DataManager) LoadData ¶ added in v0.2.0
func (d *DataManager) LoadData(ctx context.Context, owner DataManagerI)
LoadData tells the data binder to load data by calling SetData on the given object. The object should be the embedder of the DataManager
func (*DataManager) RangeData ¶
func (d *DataManager) RangeData(f func(int, interface{}) bool)
RangeData will call the given function for each item in the data. The function should return true to continue, and false to end early.
func (*DataManager) ResetData ¶
func (d *DataManager) ResetData()
ResetData is called by controls that use a data binder to unload the data after it is used.
func (*DataManager) SetData ¶
func (d *DataManager) SetData(data interface{})
Call SetData to set the data of a control that uses a data binder. You MUST call it with a slice of some kind of data.
func (*DataManager) SetDataProvider ¶
func (d *DataManager) SetDataProvider(b DataBinder)
type DataManagerEmbedder ¶ added in v0.2.0
type DataManagerEmbedder interface { SetDataProvider(b DataBinder) // SetData should be passed a slice of data items SetData(interface{}) LoadData(ctx context.Context, owner DataManagerI) ResetData() }
DataManagerEmbedder is the interface to include in embedded control interfaces Currently go does not allow interface conflicts, but that is scheduled to change
type DataManagerI ¶
type DataManagerI interface { page.ControlI DataManagerEmbedder }
A DataManagerI is the interface for the owner (the embedder) of the DataManager