Documentation ¶
Index ¶
- Constants
- Variables
- type CreateQuoteResult
- type DB
- func (db *DB) ActivateOutput(userID int64, outputChatID int64) (*Output, error)
- func (db *DB) Close()
- func (db *DB) CreateQuoteWithData(libraryID int64, text, mainSource string, tagNames []string, ...) (*CreateQuoteResult, error)
- func (db *DB) CreateSource(libraryID int64, name string) (*Source, error)
- func (db *DB) DEBUGCleanDB() error
- func (db *DB) DeactivateExpiredSources() ([]User, error)
- func (db *DB) DeactivateOutput(userID int64, outputChatID int64) (*Output, error)
- func (db *DB) DeactivateSource(userID int64) (*User, error)
- func (db *DB) DeleteLibraryToken(libraryID int64) (*Library, error)
- func (db *DB) DeleteOutput(userID int64, outputChatID int64) error
- func (db *DB) DeleteUserCurrentLibraryAndMigrateTo(userID, currLibraryID, newLibraryID int64) error
- func (db *DB) GetLibrary(libraryID int64) (*Library, error)
- func (db *DB) GetLibraryByUUID(UUID uuid.UUID) (*Library, error)
- func (db *DB) GetOrCreateOutput(userID int64, chatID int64, chatTitle string) (*Output, bool, error)
- func (db *DB) GetOrCreateUser(ID, ChatID int64, firstName string) (*User, bool, error)
- func (db *DB) GetOutput(userID int64, outputChatID int64) (*Output, error)
- func (db *DB) GetOutputs(userID int64) ([]Output, error)
- func (db *DB) GetSource(libraryID int64, name string) (*Source, error)
- func (db *DB) GetSourceByID(libraryID int64, sourceID int64) (*Source, error)
- func (db *DB) GetUser(ID int64) (*User, error)
- func (db *DB) Init() error
- func (db *DB) MergeUserCurrentLibraryAndMigrateTo(userID, currLibraryID, newLibraryID int64) error
- func (db *DB) QuerySources(p QuerySourcesParams) ([]Source, error)
- func (db *DB) SearchQuotes(libraryID int64, query string, limit int32) ([]QuoteSearchResult, error)
- func (db *DB) SetActiveSource(userID int64, activeSourceStr string, activeSourceExpireTime time.Time) (*User, error)
- func (db *DB) SetLibraryToken(libraryID int64, UUID uuid.UUID, expiresOn time.Time) (*Library, error)
- func (db *DB) SetSourceArticle(libraryID int64, sourceID int64, sourceData *SourceArticleData) (*Source, error)
- func (db *DB) SetSourceBook(libraryID int64, sourceID int64, sourceData *SourceBookData) (*Source, error)
- func (db *DB) SetSourcePerson(libraryID int64, sourceID int64, sourceData *SourcePersonData) (*Source, error)
- func (db *DB) SetSourceUnknown(libraryID int64, sourceID int64) (*Source, error)
- func (db *DB) SetUserStateChangingLibrary(userID int64, libraryID int64) (*User, error)
- func (db *DB) SetUserStateConfirmingLibraryChange(userID int64, libraryID int64, mode string) (*User, error)
- func (db *DB) SetUserStateEditingSource(userID int64, sourceID int64) (*User, error)
- func (db *DB) SetUserStateNormal(userID int64) (*User, error)
- func (db *DB) UpdateSource(libraryID int64, source *Source) (*Source, error)
- type Library
- type Output
- type QuerySourcesParams
- type QuoteSearchResult
- type Source
- type SourceArticleData
- type SourceBookData
- type SourceKind
- type SourcePersonData
- type StateChangingLibraryData
- type StateConfirmingLibraryChangeData
- type StateEditingSourceData
- type User
- type UserState
Constants ¶
View Source
const ChangeLibraryDeleteMode = "delete"
View Source
const ChangeLibraryMergeMode = "merge"
View Source
const SourceKindArticle = base.SourceKindArticle
View Source
const SourceKindBook = base.SourceKindBook
View Source
const SourceKindPerson = base.SourceKindPerson
View Source
const SourceKindUnknown = base.SourceKindUnknown
View Source
const UserStateChangingLibrary = base.UserStateChangingLibrary
View Source
const UserStateConfirmingLibraryChange = base.UserStateConfirmingLibraryChange
View Source
const UserStateEditingSource = base.UserStateEditingSource
View Source
const UserStateNormal = base.UserStateNormal
Variables ¶
View Source
var ErrNotFound = pgx.ErrNoRows
View Source
var VALID_SOURCE_KINDS []string = []string{"unknown", "book", "person", "article"}
Functions ¶
This section is empty.
Types ¶
type CreateQuoteResult ¶
type CreateQuoteResult = base.CreateQuoteRow
type DB ¶
func (*DB) ActivateOutput ¶
func (*DB) CreateQuoteWithData ¶
func (*DB) DEBUGCleanDB ¶
func (*DB) DeactivateExpiredSources ¶
func (*DB) DeactivateOutput ¶
func (*DB) DeleteUserCurrentLibraryAndMigrateTo ¶
func (*DB) GetOrCreateOutput ¶
func (*DB) GetOrCreateUser ¶
func (*DB) GetSourceByID ¶
func (*DB) MergeUserCurrentLibraryAndMigrateTo ¶
func (*DB) QuerySources ¶
func (db *DB) QuerySources(p QuerySourcesParams) ([]Source, error)
func (*DB) SearchQuotes ¶
func (*DB) SetActiveSource ¶
func (*DB) SetLibraryToken ¶
func (*DB) SetSourceArticle ¶
func (*DB) SetSourceBook ¶
func (*DB) SetSourcePerson ¶
func (*DB) SetSourceUnknown ¶
func (*DB) SetUserStateChangingLibrary ¶
func (*DB) SetUserStateConfirmingLibraryChange ¶
func (*DB) SetUserStateEditingSource ¶
type QuerySourcesParams ¶
type QuoteSearchResult ¶
type QuoteSearchResult = base.SearchQuotesRow
type SourceArticleData ¶
type SourceBookData ¶
type SourceKind ¶
type SourceKind = base.SourceKind
type SourcePersonData ¶
type SourcePersonData struct { LinkToInfo string `json:"linkToInfo,omitempty"` Title string `json:"title,omitempty"` BornOn time.Time `json:"bornOn,omitempty"` DeathOn time.Time `json:"deathOn,omitempty"` }
TODO: convert bornOn and deathOn to integers (only year is important)
type StateChangingLibraryData ¶
type StateChangingLibraryData struct {
LibraryID int64 `json:"libraryID"`
}
type StateEditingSourceData ¶
type StateEditingSourceData struct {
SourceID int64 `json:"sourceID"`
}
Click to show internal directories.
Click to hide internal directories.