pager

package
v1.0.18 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2016 License: BSD-3-Clause, BSD-3-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 InboxPager

type InboxPager struct {
	Pager
}

inboxPager provides a convenient interface to pager for the inbox use case

func NewInboxPager

func NewInboxPager() InboxPager

func (InboxPager) MakePage

func (p InboxPager) MakePage(res []chat1.Conversation, reqed int) (*chat1.Pagination, error)

type InboxPagerFields

type InboxPagerFields struct {
	Mtime  gregor1.Time         `codec:"M"`
	ConvID chat1.ConversationID `codec:"C"`
}

inboxPagerFields is the info that gives a total ordering on the inbox

type Message

type Message interface {
	GetMessageID() chat1.MessageID
}

type Pager

type Pager struct {
	// contains filtered or unexported fields
}

pager provides the getPage and makePage functions for implementing paging in the chat1 protocol

func NewPager

func NewPager() Pager

func (Pager) GetPage

func (p Pager) GetPage(getcond func(bool) string, page *chat1.Pagination,
	pivot interface{}) (string, bool, error)

func (Pager) MakePage

func (p Pager) MakePage(length, reqed int, next interface{}, prev interface{}) (*chat1.Pagination, error)

type ThreadPager

type ThreadPager struct {
	Pager
}

threadPager provides a covenient interface to pager for the thread use case

func NewThreadPager

func NewThreadPager() ThreadPager

func (ThreadPager) MakeIndex

func (p ThreadPager) MakeIndex(msg Message) ([]byte, error)

func (ThreadPager) MakePage

func (p ThreadPager) MakePage(res []Message, reqed int) (*chat1.Pagination, error)

Jump to

Keyboard shortcuts

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