data

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2019 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DataBinder

type DataBinder interface {
	BindData(ctx context.Context, s DataManagerI)
}

type DataManager

type DataManager struct {
	Data interface{}
	// 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) GetData

func (d *DataManager) GetData(ctx context.Context, owner DataManagerI)

GetData 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) HasDataProvider

func (d *DataManager) HasDataProvider() bool

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()

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 DataManagerI

type DataManagerI interface {
	page.ControlI
	SetDataProvider(b DataBinder)
	// SetData should be passed a slice of data items
	SetData(interface{})
	GetData(ctx context.Context, owner DataManagerI)
	ResetData()
}

A DataManagerI is the interface for the owner (the embedder) of the DataManager

Jump to

Keyboard shortcuts

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