store

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2020 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CardState

type CardState interface {
	CardName(id int) string
	CardLabelsStr(id int) string
	Description(id int) string
	CardComments(id int) []string
}

CardState describes the interface required for the selected card component

type HeaderState

type HeaderState interface {
	HeaderTitle() string
	HeaderSubtitle() string
}

HeaderState describes the interface required for the header component

type ListsState

type ListsState interface {
	ListsLen() int
	SingleListState
}

ListsState describes the interface required for the ListContainer component

type SingleListState

type SingleListState interface {
	ListName(idx int) string
	ListCardsIds(idx int) []int
	CardState
}

SingleListState describes the interface required for the list component

type State

type State interface {
	ViewState
}

State describes the interface required for the gui

type Store added in v0.1.2

type Store struct {
	State
	// contains filtered or unexported fields
}

Store makes State safe for concurrent use

func NewStore

func NewStore(state State) *Store

NewStore returns a new instate of Store

func (*Store) BeginRead added in v0.1.2

func (s *Store) BeginRead()

BeginRead acquires a read lock

func (*Store) BeginWrite added in v0.1.2

func (s *Store) BeginWrite()

BeginWrite acquires a write lock

func (*Store) EndRead added in v0.1.2

func (s *Store) EndRead()

EndRead releases a read lock

func (*Store) EndWrite added in v0.1.2

func (s *Store) EndWrite(changed bool)

EndWrite releases a write lock and calls `stateChangedFunc` if necessary

func (*Store) SetStateChangedFunc added in v0.1.2

func (s *Store) SetStateChangedFunc(f func())

SetStateChangedFunc configures a callback on state changes, called after unlocking write lock. Used to hook gui re=-draw to state changes.

type ViewState

type ViewState interface {
	HeaderState
	ListsState
}

ViewState describes the interface required for the view component

Jump to

Keyboard shortcuts

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