backend

package
v0.0.0-...-57186e4 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2020 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	All       = "all"
	Active    = "active"
	Completed = "completed"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Backend

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

func New

func New() *Backend

func (*Backend) Add

func (b *Backend) Add(text string)

func (*Backend) ChangeFilter

func (b *Backend) ChangeFilter(f string)

func (*Backend) Complete

func (b *Backend) Complete(id int)

func (*Backend) Count

func (b *Backend) Count() int

func (*Backend) Delete

func (b *Backend) Delete(id int)

func (*Backend) DeleteCompleted

func (b *Backend) DeleteCompleted()

func (*Backend) Each

func (b *Backend) Each(fnc func(i *Item))

func (*Backend) Filter

func (b *Backend) Filter() string

func (*Backend) IsEmpty

func (b *Backend) IsEmpty() bool

func (*Backend) Subscribe

func (b *Backend) Subscribe(cb func())

func (*Backend) ToggleAll

func (b *Backend) ToggleAll()

func (*Backend) ToggleComplete

func (b *Backend) ToggleComplete(id int)

type Item

type Item struct {
	ID        int
	Text      string
	Completed bool
}

Jump to

Keyboard shortcuts

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