Documentation ¶
Index ¶
- type CloudStorageBucket
- type FirestorePostsRepository
- func (s *FirestorePostsRepository) GetByExternalSourceUrl(ctx context.Context, url string) (domain.Post, bool, error)
- func (s FirestorePostsRepository) GetChatPosts(ctx context.Context, chatid domain.ChatId) ([]domain.Post, error)
- func (s *FirestorePostsRepository) GetLastWeekPosts(ctx context.Context, chatid int64) ([]domain.Post, error)
- func (s *FirestorePostsRepository) GetPostById(ctx context.Context, mediaId string) (domain.Post, bool, error)
- func (s *FirestorePostsRepository) UpsertPost(ctx context.Context, p domain.Post) error
- type PostModel
- type PubSubTopic
- type ReactionModel
- type TelegramMessenger
- func (b TelegramMessenger) Delete(chatId domain.ChatId, messageId domain.MessageId) error
- func (m TelegramMessenger) ReplyWithText(chatId domain.ChatId, replyToMessageId domain.MessageId, text string) (int, error)
- func (m TelegramMessenger) SendText(chatID domain.ChatId, text string) (int, error)
- func (b TelegramMessenger) SendVideo(chatId domain.ChatId, videoId string, caption string, payload io.Reader) (int, error)
- type UserRefModel
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CloudStorageBucket ¶
type CloudStorageBucket struct {
// contains filtered or unexported fields
}
func NewCloudStoreBucketClient ¶
func NewCloudStoreBucketClient(ctx context.Context, projectId string, videoFilesBucketUrl string) *CloudStorageBucket
type FirestorePostsRepository ¶
type FirestorePostsRepository struct {
// contains filtered or unexported fields
}
func NewFirestorePostsRepository ¶
func NewFirestorePostsRepository(client *firestore.Client) *FirestorePostsRepository
func (*FirestorePostsRepository) GetByExternalSourceUrl ¶
func (s *FirestorePostsRepository) GetByExternalSourceUrl(ctx context.Context, url string) (domain.Post, bool, error)
AK TODO this won't work if different chats posted the same link This will also fail if message was posted twice
func (FirestorePostsRepository) GetChatPosts ¶
func (*FirestorePostsRepository) GetLastWeekPosts ¶
func (*FirestorePostsRepository) GetPostById ¶
func (*FirestorePostsRepository) UpsertPost ¶
type PostModel ¶
type PostModel struct { Id string `firestore:"-"` Type string `firestore:"type"` OriginalMessageId int `firestore:"original_message_id,omitempty"` ExternalSourceUrl string `firestore:"external_source_url,omitempty"` Reactions []ReactionModel `firestore:"reactions"` PostedOn time.Time `firestore:"posted_on"` ChatId int64 `firestore:"chat_id"` Poster UserRefModel `firestore:"poster"` }
func MapPostToModel ¶
type PubSubTopic ¶
type PubSubTopic struct {
// contains filtered or unexported fields
}
func NewPubSubTopicClient ¶
func (*PubSubTopic) PublishUrl ¶
type ReactionModel ¶
type ReactionModel struct { ReactToMessageId int `firestore:"react_to_message_id"` Text string `firestore:"text"` PostedOn time.Time `firestore:"posted_on"` Reactor UserRefModel `firestore:"reactor"` }
func MapReactionToModel ¶
func MapReactionToModel(r domain.Reaction) ReactionModel
type TelegramMessenger ¶
type TelegramMessenger struct {
// contains filtered or unexported fields
}
func NewMessenger ¶
func NewMessenger(token string) *TelegramMessenger
func (TelegramMessenger) ReplyWithText ¶
type UserRefModel ¶
type UserRefModel struct { DisplayName string `firestore:"user_name"` Id int64 `firestore:"user_id"` }
func MapUserRefToModel ¶
func MapUserRefToModel(ur domain.UserRef) UserRefModel
Click to show internal directories.
Click to hide internal directories.