Documentation ¶
Index ¶
- Variables
- func Init()
- type DBArticle
- type DBChat
- type DBFeed
- type IArticleRepository
- type IChatRepository
- type IFeedRepository
- type MocksArticleRepository
- func (m *MocksArticleRepository) Create(feedId string, title string, source string, author string, link string, ...) *DBArticle
- func (m *MocksArticleRepository) Delete(uuid string) bool
- func (m *MocksArticleRepository) GetAll() []*DBArticle
- func (m *MocksArticleRepository) GetByChatAndTime(chatId string) []*DBArticle
- func (m *MocksArticleRepository) GetByFeedId(uuid string) []*DBArticle
- func (m *MocksArticleRepository) GetByTitle(title string) *DBArticle
- func (m *MocksArticleRepository) GetOne(uuid string) *DBArticle
- type MocksChatRepository
- func (m *MocksChatRepository) Create(telegramChatId string, telegramUserId string, telegramThreadId string, ...) *DBChat
- func (m *MocksChatRepository) Delete(uuid string) bool
- func (m *MocksChatRepository) GetAll() []*DBChat
- func (m *MocksChatRepository) GetByChatId(uuid string) []string
- func (m *MocksChatRepository) GetByTelegramChatId(chatId string) *DBChat
- func (m *MocksChatRepository) GetByTelegramChatIdAndThreadId(chatId string, threadId string) *DBChat
- func (m *MocksChatRepository) GetOne(uuid string) *DBChat
- func (m *MocksChatRepository) UpdateParsed(uuid string) bool
- func (m *MocksChatRepository) UpdateTags(uuid string, tags []string) bool
- type MocksFeedRepository
- func (m *MocksFeedRepository) Create(url string) *DBFeed
- func (m *MocksFeedRepository) Delete(uuid string) bool
- func (m *MocksFeedRepository) DisableFeed(feedId string) bool
- func (m *MocksFeedRepository) GetAll() []*DBFeed
- func (m *MocksFeedRepository) GetAllActive() []*DBFeed
- func (m *MocksFeedRepository) GetByChatId(uuid string) []*DBFeed
- func (m *MocksFeedRepository) GetOne(uuid string) *DBFeed
- func (m *MocksFeedRepository) LinkChatAndFeed(feedId string, chatId string) bool
- func (m *MocksFeedRepository) UnLinkChatAndFeed(feedId string, chatId string) bool
- type SArticleRepository
- func (rep *SArticleRepository) Create(feedId string, title string, source string, author string, link string, ...) *DBArticle
- func (rep *SArticleRepository) Delete(uuid string) bool
- func (rep *SArticleRepository) GetAll() []*DBArticle
- func (rep *SArticleRepository) GetByChatAndTime(chatId string) []*DBArticle
- func (rep *SArticleRepository) GetByFeedId(uuid string) []*DBArticle
- func (rep *SArticleRepository) GetByTitle(title string) *DBArticle
- func (rep *SArticleRepository) GetOne(uuid string) *DBArticle
- type SChatRepository
- func (rep *SChatRepository) Create(telegramChatId string, telegramUserId string, telegramThreadId string, ...) *DBChat
- func (rep *SChatRepository) Delete(uuid string) bool
- func (rep *SChatRepository) GetAll() []*DBChat
- func (rep *SChatRepository) GetByTelegramChatId(chatId string) *DBChat
- func (rep *SChatRepository) GetByTelegramChatIdAndThreadId(chatId string, threadId string) *DBChat
- func (rep *SChatRepository) GetOne(uuid string) *DBChat
- func (rep *SChatRepository) UpdateParsed(uuid string) bool
- func (rep *SChatRepository) UpdateTags(uuid string, tags []string) bool
- type SFeedRepository
- func (rep *SFeedRepository) Create(url string) *DBFeed
- func (rep *SFeedRepository) Delete(uuid string) bool
- func (rep *SFeedRepository) DisableFeed(feedId string) bool
- func (rep *SFeedRepository) GetAll() []*DBFeed
- func (rep *SFeedRepository) GetAllActive() []*DBFeed
- func (rep *SFeedRepository) GetByChatId(uuid string) []*DBFeed
- func (rep *SFeedRepository) GetOne(uuid string) *DBFeed
- func (rep *SFeedRepository) LinkChatAndFeed(feedId string, chatId string) bool
- func (rep *SFeedRepository) UnLinkChatAndFeed(feedId string, chatId string) bool
Constants ¶
This section is empty.
Variables ¶
var ( Chat IChatRepository Feed IFeedRepository Article IArticleRepository )
Functions ¶
Types ¶
type DBArticle ¶ added in v1.0.3
type DBChat ¶ added in v1.1.0
type DBChat struct { Id string `db:"id"` TelegramChatId string `db:"telegram_chat_id"` TelegramUserId *string `db:"telegram_user_id, omitempty"` TelegramThreadId *string `db:"telegram_thread_id, omitempty"` Tags []string `db:"tags"` CreatedAt time.Time `db:"created_at"` UpdatedAt time.Time `db:"updated_at"` LastTimeParsed *time.Time `db:"last_time_parsed"` }
type DBFeed ¶ added in v1.0.3
type IArticleRepository ¶ added in v0.12.0
type IArticleRepository interface { GetAll() []*DBArticle GetOne(uuid string) *DBArticle GetByTitle(title string) *DBArticle GetByFeedId(uuid string) []*DBArticle Create(feedId string, title string, source string, author string, link string, tags []string) *DBArticle Delete(uuid string) bool GetByChatAndTime(chatId string) []*DBArticle }
type IChatRepository ¶ added in v0.11.0
type IChatRepository interface { GetAll() []*DBChat GetOne(uuid string) *DBChat GetByTelegramChatId(chatId string) *DBChat GetByTelegramChatIdAndThreadId(chatId string, threadId string) *DBChat Create(telegramChatId string, telegramUserId string, telegramThreadId string, tags []string) *DBChat Delete(uuid string) bool UpdateTags(uuid string, tags []string) bool UpdateParsed(uuid string) bool }
type IFeedRepository ¶ added in v1.0.3
type IFeedRepository interface { GetAll() []*DBFeed GetAllActive() []*DBFeed GetOne(uuid string) *DBFeed Create(url string) *DBFeed Delete(uuid string) bool GetByChatId(uuid string) []*DBFeed LinkChatAndFeed(feedId string, chatId string) bool UnLinkChatAndFeed(feedId string, chatId string) bool DisableFeed(feedId string) bool }
type MocksArticleRepository ¶ added in v1.0.3
func (*MocksArticleRepository) Delete ¶ added in v1.0.3
func (m *MocksArticleRepository) Delete(uuid string) bool
func (*MocksArticleRepository) GetAll ¶ added in v1.0.3
func (m *MocksArticleRepository) GetAll() []*DBArticle
func (*MocksArticleRepository) GetByChatAndTime ¶ added in v1.2.0
func (m *MocksArticleRepository) GetByChatAndTime(chatId string) []*DBArticle
func (*MocksArticleRepository) GetByFeedId ¶ added in v1.0.3
func (m *MocksArticleRepository) GetByFeedId(uuid string) []*DBArticle
func (*MocksArticleRepository) GetByTitle ¶ added in v1.0.3
func (m *MocksArticleRepository) GetByTitle(title string) *DBArticle
func (*MocksArticleRepository) GetOne ¶ added in v1.0.3
func (m *MocksArticleRepository) GetOne(uuid string) *DBArticle
type MocksChatRepository ¶ added in v1.1.0
func (*MocksChatRepository) Delete ¶ added in v1.1.0
func (m *MocksChatRepository) Delete(uuid string) bool
func (*MocksChatRepository) GetAll ¶ added in v1.1.0
func (m *MocksChatRepository) GetAll() []*DBChat
func (*MocksChatRepository) GetByChatId ¶ added in v1.1.0
func (m *MocksChatRepository) GetByChatId(uuid string) []string
func (*MocksChatRepository) GetByTelegramChatId ¶ added in v1.3.0
func (m *MocksChatRepository) GetByTelegramChatId(chatId string) *DBChat
func (*MocksChatRepository) GetByTelegramChatIdAndThreadId ¶ added in v1.5.3
func (m *MocksChatRepository) GetByTelegramChatIdAndThreadId(chatId string, threadId string) *DBChat
func (*MocksChatRepository) GetOne ¶ added in v1.1.0
func (m *MocksChatRepository) GetOne(uuid string) *DBChat
func (*MocksChatRepository) UpdateParsed ¶ added in v1.2.0
func (m *MocksChatRepository) UpdateParsed(uuid string) bool
func (*MocksChatRepository) UpdateTags ¶ added in v1.1.0
func (m *MocksChatRepository) UpdateTags(uuid string, tags []string) bool
type MocksFeedRepository ¶ added in v1.0.3
MOCKS
func (*MocksFeedRepository) Create ¶ added in v1.0.3
func (m *MocksFeedRepository) Create(url string) *DBFeed
func (*MocksFeedRepository) Delete ¶ added in v1.0.3
func (m *MocksFeedRepository) Delete(uuid string) bool
func (*MocksFeedRepository) DisableFeed ¶ added in v1.4.0
func (m *MocksFeedRepository) DisableFeed(feedId string) bool
func (*MocksFeedRepository) GetAll ¶ added in v1.0.3
func (m *MocksFeedRepository) GetAll() []*DBFeed
func (*MocksFeedRepository) GetAllActive ¶ added in v1.4.0
func (m *MocksFeedRepository) GetAllActive() []*DBFeed
func (*MocksFeedRepository) GetByChatId ¶ added in v1.1.0
func (m *MocksFeedRepository) GetByChatId(uuid string) []*DBFeed
func (*MocksFeedRepository) GetOne ¶ added in v1.0.3
func (m *MocksFeedRepository) GetOne(uuid string) *DBFeed
func (*MocksFeedRepository) LinkChatAndFeed ¶ added in v1.1.0
func (m *MocksFeedRepository) LinkChatAndFeed(feedId string, chatId string) bool
func (*MocksFeedRepository) UnLinkChatAndFeed ¶ added in v1.1.0
func (m *MocksFeedRepository) UnLinkChatAndFeed(feedId string, chatId string) bool
type SArticleRepository ¶ added in v1.0.3
type SArticleRepository struct {
// contains filtered or unexported fields
}
func (*SArticleRepository) Create ¶ added in v1.0.3
func (rep *SArticleRepository) Create(feedId string, title string, source string, author string, link string, tags []string) *DBArticle
Create one article
func (*SArticleRepository) Delete ¶ added in v1.0.3
func (rep *SArticleRepository) Delete(uuid string) bool
Delete one article from the db
func (*SArticleRepository) GetAll ¶ added in v1.0.3
func (rep *SArticleRepository) GetAll() []*DBArticle
Return all Article in the DB
func (*SArticleRepository) GetByChatAndTime ¶ added in v1.2.0
func (rep *SArticleRepository) GetByChatAndTime(chatId string) []*DBArticle
Retrieve new Article based on chat last time parsed
func (*SArticleRepository) GetByFeedId ¶ added in v1.0.3
func (rep *SArticleRepository) GetByFeedId(uuid string) []*DBArticle
Return one article link to a feed
func (*SArticleRepository) GetByTitle ¶ added in v1.0.3
func (rep *SArticleRepository) GetByTitle(title string) *DBArticle
Return one Article by it's title
func (*SArticleRepository) GetOne ¶ added in v1.0.3
func (rep *SArticleRepository) GetOne(uuid string) *DBArticle
Return one Article, nil if not found
type SChatRepository ¶ added in v1.0.3
type SChatRepository struct {
// contains filtered or unexported fields
}
func (*SChatRepository) Create ¶ added in v1.0.3
func (rep *SChatRepository) Create( telegramChatId string, telegramUserId string, telegramThreadId string, tags []string, ) *DBChat
Create one chat
func (*SChatRepository) Delete ¶ added in v1.0.3
func (rep *SChatRepository) Delete(uuid string) bool
Delete one chat from the db
func (*SChatRepository) GetAll ¶ added in v1.0.3
func (rep *SChatRepository) GetAll() []*DBChat
Return all Chats in the DB
func (*SChatRepository) GetByTelegramChatId ¶ added in v1.3.0
func (rep *SChatRepository) GetByTelegramChatId(chatId string) *DBChat
Return one chat, nil if not found
func (*SChatRepository) GetByTelegramChatIdAndThreadId ¶ added in v1.5.3
func (rep *SChatRepository) GetByTelegramChatIdAndThreadId(chatId string, threadId string) *DBChat
Return one chat by it's id and thread id, nil if not found
func (*SChatRepository) GetOne ¶ added in v1.0.3
func (rep *SChatRepository) GetOne(uuid string) *DBChat
Return one chat, nil if not found
func (*SChatRepository) UpdateParsed ¶ added in v1.2.0
func (rep *SChatRepository) UpdateParsed(uuid string) bool
Update the parsed time
func (*SChatRepository) UpdateTags ¶ added in v1.1.0
func (rep *SChatRepository) UpdateTags(uuid string, tags []string) bool
Appends tags to chat
type SFeedRepository ¶ added in v1.0.3
type SFeedRepository struct {
// contains filtered or unexported fields
}
func (*SFeedRepository) Create ¶ added in v1.0.3
func (rep *SFeedRepository) Create(url string) *DBFeed
Create one feed
func (*SFeedRepository) Delete ¶ added in v1.0.3
func (rep *SFeedRepository) Delete(uuid string) bool
Delete one feed from the db
func (*SFeedRepository) DisableFeed ¶ added in v1.4.0
func (rep *SFeedRepository) DisableFeed(feedId string) bool
func (*SFeedRepository) GetAll ¶ added in v1.0.3
func (rep *SFeedRepository) GetAll() []*DBFeed
Return all Feeds in the DB
func (*SFeedRepository) GetAllActive ¶ added in v1.4.0
func (rep *SFeedRepository) GetAllActive() []*DBFeed
Return only active feeds
func (*SFeedRepository) GetByChatId ¶ added in v1.1.0
func (rep *SFeedRepository) GetByChatId(uuid string) []*DBFeed
Return all Feeds in the DB
func (*SFeedRepository) GetOne ¶ added in v1.0.3
func (rep *SFeedRepository) GetOne(uuid string) *DBFeed
Return one feed, nil if not found
func (*SFeedRepository) LinkChatAndFeed ¶ added in v1.1.0
func (rep *SFeedRepository) LinkChatAndFeed(feedId string, chatId string) bool
Subscribed chat to a feed
func (*SFeedRepository) UnLinkChatAndFeed ¶ added in v1.1.0
func (rep *SFeedRepository) UnLinkChatAndFeed(feedId string, chatId string) bool
Delete one feed from the db