store

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2019 License: BSD-2-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Commander

type Commander struct {
	sync.Mutex
	Data *rp.Command
	// contains filtered or unexported fields
}

Commander must implement a DataItem

func (*Commander) AddListener

func (c *Commander) AddListener(fn fyne.DataItemFunc) fyne.ListenerHandle

AddListener registers listener function

func (*Commander) DeleteListener

func (c *Commander) DeleteListener(handle fyne.ListenerHandle)

DeleteListener removes a listener

func (*Commander) Refresh

func (c *Commander) Refresh()

Refresh will trigger all the listeners for this DataItem in a goroutine

func (*Commander) String

func (c *Commander) String() string

String to implement DataItem

type CommanderMap

type CommanderMap struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

CommanderMap map by commanderID of commanderOrder listeners implements fyne.DataMap

func (*CommanderMap) AddCommandListener

func (c *CommanderMap) AddCommandListener(command *rp.Command, fn fyne.DataItemFunc) fyne.ListenerHandle

AddCommandListener gets the commnand out of the map, and attaches the listener

func (*CommanderMap) AddListener

func (c *CommanderMap) AddListener(fn fyne.DataMapFunc) fyne.ListenerHandle

AddListener adds a listener for the whole commanderMap

func (*CommanderMap) DeleteListener

func (c *CommanderMap) DeleteListener(handle fyne.ListenerHandle)

DeleteListener removes a commanderMap listener

func (*CommanderMap) Get

func (c *CommanderMap) Get(s string) (fyne.DataItem, bool)

Get gets an item out of the commanderMap

func (*CommanderMap) Refresh

func (c *CommanderMap) Refresh(command *rp.Command)

Refresh on the commanderMap calls refresh on each current entry

func (*CommanderMap) Reload

func (c *CommanderMap) Reload(data []*rp.Command)

Reload resets the whole map from the commander array Note that it may get a whole new set of ptr data that overwrites the existing set, so listeners are preserved in this case

type Store

type Store struct {
	CommanderMap CommanderMap
}

Store is a UI application store that things can listen in on

func NewStore

func NewStore() *Store

NewStore returns a clean new store

Jump to

Keyboard shortcuts

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