cache

package
v3.3.1-alpha.3 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

type Cache struct {
	SubscriptionStatusMap sync.Map
	// contains filtered or unexported fields
}

func NewCache

func NewCache(user *user.User, friend *friend.Friend) *Cache

func (*Cache) BatchGetUserNameAndFaceURL

func (c *Cache) BatchGetUserNameAndFaceURL(ctx context.Context, userIDs ...string) (map[string]UserInfo, error)

func (*Cache) GetAllConversations

func (c *Cache) GetAllConversations() (conversations []*model_struct.LocalConversation)

func (*Cache) GetAllHasUnreadMessageConversations

func (c *Cache) GetAllHasUnreadMessageConversations() (conversations []*model_struct.LocalConversation)

func (*Cache) GetConversation

func (c *Cache) GetConversation(conversationID string) model_struct.LocalConversation

func (*Cache) GetUserNameAndFaceURL

func (c *Cache) GetUserNameAndFaceURL(ctx context.Context, userID string) (faceURL, name string, err error)

func (*Cache) Update

func (c *Cache) Update(userID, faceURL, nickname string)

func (*Cache) UpdateConversation

func (c *Cache) UpdateConversation(conversation model_struct.LocalConversation)

func (*Cache) UpdateConversations

func (c *Cache) UpdateConversations(conversations []*model_struct.LocalConversation)

func (*Cache) UpdateStatus

func (c *Cache) UpdateStatus(userID string, statusMap *userPb.OnlineStatus)

type UserInfo

type UserInfo struct {
	Nickname string
	FaceURL  string
}

Jump to

Keyboard shortcuts

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