memory

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2025 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewInMemory

func NewInMemory() chat.Store

Types

type InMemoryStore

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

func (*InMemoryStore) AddMember

func (s *InMemoryStore) AddMember(_ context.Context, chatID *commonpb.ChatId, member chat.Member) error

func (*InMemoryStore) AdvanceLastChatActivity

func (s *InMemoryStore) AdvanceLastChatActivity(ctx context.Context, chatID *commonpb.ChatId, ts time.Time) error

func (*InMemoryStore) CreateChat

func (s *InMemoryStore) CreateChat(_ context.Context, md *chatpb.Metadata) (*chatpb.Metadata, error)

func (*InMemoryStore) GetChatID

func (s *InMemoryStore) GetChatID(_ context.Context, roomID uint64) (*commonpb.ChatId, error)

func (*InMemoryStore) GetChatMetadata

func (s *InMemoryStore) GetChatMetadata(_ context.Context, chatID *commonpb.ChatId) (*chatpb.Metadata, error)

func (*InMemoryStore) GetChatMetadataBatched

func (s *InMemoryStore) GetChatMetadataBatched(ctx context.Context, chatIDs ...*commonpb.ChatId) ([]*chatpb.Metadata, error)

func (*InMemoryStore) GetChatsForUser

func (s *InMemoryStore) GetChatsForUser(_ context.Context, userID *commonpb.UserId, opts ...query.Option) ([]*commonpb.ChatId, error)

func (*InMemoryStore) GetMember

func (s *InMemoryStore) GetMember(_ context.Context, chatID *commonpb.ChatId, userID *commonpb.UserId) (*chat.Member, error)

func (*InMemoryStore) GetMembers

func (s *InMemoryStore) GetMembers(_ context.Context, chatID *commonpb.ChatId) ([]*chat.Member, error)

func (*InMemoryStore) HasSendPermission

func (s *InMemoryStore) HasSendPermission(_ context.Context, chatID *commonpb.ChatId, member *commonpb.UserId) (bool, error)

func (*InMemoryStore) IsMember

func (s *InMemoryStore) IsMember(_ context.Context, chatID *commonpb.ChatId, userID *commonpb.UserId) (bool, error)

func (*InMemoryStore) IsPushEnabled

func (s *InMemoryStore) IsPushEnabled(ctx context.Context, chatID *commonpb.ChatId, member *commonpb.UserId) (bool, error)

func (*InMemoryStore) IsUserMuted

func (s *InMemoryStore) IsUserMuted(_ context.Context, chatID *commonpb.ChatId, member *commonpb.UserId) (bool, error)

func (*InMemoryStore) RemoveMember

func (s *InMemoryStore) RemoveMember(_ context.Context, chatID *commonpb.ChatId, member *commonpb.UserId) error

func (*InMemoryStore) SetDisplayName

func (s *InMemoryStore) SetDisplayName(ctx context.Context, chatID *commonpb.ChatId, displayName string) error

func (*InMemoryStore) SetMessagingFee

func (s *InMemoryStore) SetMessagingFee(ctx context.Context, chatID *commonpb.ChatId, messagingFee *commonpb.PaymentAmount) error

func (*InMemoryStore) SetMuteState

func (s *InMemoryStore) SetMuteState(_ context.Context, chatID *commonpb.ChatId, member *commonpb.UserId, isMuted bool) error

func (*InMemoryStore) SetOpenStatus

func (s *InMemoryStore) SetOpenStatus(ctx context.Context, chatID *commonpb.ChatId, isOpen bool) error

func (*InMemoryStore) SetPushState

func (s *InMemoryStore) SetPushState(ctx context.Context, chatID *commonpb.ChatId, member *commonpb.UserId, isPushEnabled bool) error

func (*InMemoryStore) SetSendPermission

func (s *InMemoryStore) SetSendPermission(_ context.Context, chatID *commonpb.ChatId, member *commonpb.UserId, hasSendPermission bool) error

Jump to

Keyboard shortcuts

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