pager

package
v1.0.29 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2017 License: BSD-3-Clause, BSD-3-Clause Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type InboxEntry added in v1.0.19

type InboxEntry interface {
	GetMtime() gregor1.Time
	GetConvID() chat1.ConversationID
}

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 []InboxEntry, 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

func (InboxPagerFields) GetConvID added in v1.0.19

func (i InboxPagerFields) GetConvID() chat1.ConversationID

func (InboxPagerFields) GetMtime added in v1.0.19

func (i InboxPagerFields) GetMtime() gregor1.Time

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