redis

package
v0.0.0-...-8c28d06 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2019 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client represents Redis client

func New

func New(addr, pass string, port int) (*Client, error)

New instantiates new Redis client

func (*Client) AppendMessage

func (s *Client) AppendMessage(id string, m *goch.Message) error

AppendMessage adds new message

func (*Client) Get

func (s *Client) Get(id string) (*goch.Chat, error)

Get retrieves chat from Client

func (*Client) GetRecent

func (s *Client) GetRecent(id string, n int64) ([]goch.Message, uint64, error)

GetRecent returns list of recent messages, and sequence until last message

func (*Client) GetUnreadCount

func (s *Client) GetUnreadCount(uid string, id string) uint64

GetUnreadCount returns number of unread messages

func (*Client) ListChannels

func (s *Client) ListChannels() ([]string, error)

ListChannels returns list of all channels

func (*Client) Save

func (s *Client) Save(ct *goch.Chat) error

Save saves new chat

func (*Client) UpdateLastClientSeq

func (s *Client) UpdateLastClientSeq(uid string, id string, seq uint64)

UpdateLastClientSeq updates client's last seen message

Jump to

Keyboard shortcuts

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