cache

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2020 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CommentContext = r.CreateContext(r.State{Comments{}})
View Source
var StoriesContext = r.CreateContext(r.State{Stories{}})

Functions

func Cache

func Cache(p r.Properties) r.Element

Types

type CommentItem

type CommentItem struct {
	Comment     *hnclient.Comment
	Loading     bool
	Error       error
	LastUpdated time.Time
}

type Comments

type Comments struct {
	Cache  map[int]CommentItem
	Update func(id int, item CommentItem)
}

type Stories

type Stories struct {
	Cache  map[int]StoryItem
	Update func(id int, item StoryItem)
}

func (*Stories) Get

func (c *Stories) Get(id int) StoryItem

type StoryItem

type StoryItem struct {
	Story       *hnclient.Story
	Loading     bool
	Error       error
	LastUpdated time.Time
}

Jump to

Keyboard shortcuts

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