Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type PromotedChat ¶
type PromotedChat struct { ChatID *commonpb.ChatId Score int Topic string CreatedAt time.Time UpdatedAt time.Time }
PromotedChat represents a promoted chat entity.
func (*PromotedChat) Clone ¶
func (pc *PromotedChat) Clone() *PromotedChat
Clone creates a deep copy of the PromotedChat.
type Server ¶
type Server struct { promotedpb.UnimplementedPromotedServer // contains filtered or unexported fields }
Server implements the Promoted service.
func (*Server) GetPromotedChats ¶
func (s *Server) GetPromotedChats(ctx context.Context, req *promotedpb.GetPromotedChatsRequest) (*promotedpb.GetPromotedChatsResponse, error)
GetPromotedChats handles the GetPromotedChats RPC.
type Store ¶
type Store interface { // GetPromotedChats retrieves promoted chats by topic. GetPromotedChats(ctx context.Context, topic string) ([]*PromotedChat, error) // PromoteChat promotes a chat (or updates the score if it already exists). PromoteChat(ctx context.Context, chatID *commonpb.ChatId, topic string, score int) error // DemoteChat demotes a chat (remove it from the promoted list for the topic). DemoteChat(ctx context.Context, chatID *commonpb.ChatId, topic string) error }
Store defines the interface for Promoted Chat storage.
Click to show internal directories.
Click to hide internal directories.