storage

package
v0.0.0-...-72e5503 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2018 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EnqueueChanUuids

func EnqueueChanUuids(channelName, channelId string, isDel bool, uuids []string)

func EnqueueMsg

func EnqueueMsg(channel, msg, uuid string, ts, msgId int64)

func FetchHistory

func FetchHistory(channel string, ts int64) (result []interface{}, err error)

func FetchUuidsAboutChannel

func FetchUuidsAboutChannel(channelId string) []string

func Init

func Init()

func Serv

func Serv()

Types

type Cache

type Cache struct {
	// contains filtered or unexported fields
}
var (
	MsgCache *Cache
)

func NewCache

func NewCache(maxSize int) *Cache

func (*Cache) GetRange

func (this *Cache) GetRange(channel string, ts int64) []interface{}

func (*Cache) Store

func (this *Cache) Store(mt *MsgTuple) error

type ChanUuidsTuple

type ChanUuidsTuple struct {
	ChannelId   string
	ChannelName string
	Uuids       []string
	IsDel       bool
}

type MongoStorage

type MongoStorage struct {
}

type MsgTuple

type MsgTuple struct {
	Channel string `json:"channel"`
	Msg     string `json:"msg"`
	Ts      int64  `json:"ts"`
	Uuid    string `json:"uuid"`
	MsgId   int64  `json:"msgid"`
}

Jump to

Keyboard shortcuts

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