Documentation
¶
Index ¶
- type ChannelCount
- type DB
- func (db *DB) DeleteByBookmarkID(ctx context.Context, userID int, bookmarkID string) error
- func (db *DB) DeleteVideo(ctx context.Context, userID int, id uuid.UUID) error
- func (db *DB) GetByYouTubeID(ctx context.Context, userID int, youtubeID string) (*Video, error)
- func (db *DB) GetKarakeepAPIKey(ctx context.Context, userID int) (string, error)
- func (db *DB) GetModelPreference(ctx context.Context, userID int) (provider, model string, err error)
- func (db *DB) GetOrCreateFeedToken(ctx context.Context, userID int) (string, error)
- func (db *DB) GetOrCreateUser(ctx context.Context, login, displayName string) (int, error)
- func (db *DB) GetOrCreateWebhookToken(ctx context.Context, userID int) (string, error)
- func (db *DB) GetPrimaryUser(ctx context.Context) (id int, login string, err error)
- func (db *DB) GetStats(ctx context.Context, userID int) (*VideoStats, error)
- func (db *DB) GetSummaryPrompts(ctx context.Context, userID int) (medium, deep *string, err error)
- func (db *DB) GetUserByFeedToken(ctx context.Context, token string) (int, error)
- func (db *DB) GetUserByWebhookToken(ctx context.Context, token string) (int, error)
- func (db *DB) GetVideo(ctx context.Context, userID int, id uuid.UUID) (*Video, error)
- func (db *DB) InsertVideo(ctx context.Context, v *Video) error
- func (db *DB) ListFailedVideos(ctx context.Context, userID int) ([]Video, error)
- func (db *DB) ListNoCaptionsVideos(ctx context.Context, userID int) ([]Video, error)
- func (db *DB) ListRecent(ctx context.Context, userID int, filters ListFilters, limit, offset int) ([]Video, int, error)
- func (db *DB) ListVideosWithoutMetadata(ctx context.Context, userID int) ([]Video, error)
- func (db *DB) SearchVideos(ctx context.Context, userID int, embedding []float32, threshold float64, ...) ([]VideoMatch, error)
- func (db *DB) SetKarakeepAPIKey(ctx context.Context, userID int, apiKey string) error
- func (db *DB) SetModelPreference(ctx context.Context, userID int, provider, model string) error
- func (db *DB) SetSummaryPrompt(ctx context.Context, userID int, level, prompt string) error
- func (db *DB) TextSearchVideos(ctx context.Context, userID int, query string, limit int) ([]VideoMatch, error)
- func (db *DB) UpdateBookmarkID(ctx context.Context, id uuid.UUID, bookmarkID string) error
- func (db *DB) UpdateVideoMetadata(ctx context.Context, id uuid.UUID, title, channel, language string, ...) error
- func (db *DB) UpdateVideoStatus(ctx context.Context, id uuid.UUID, status, errorMsg string) error
- func (db *DB) UpdateVideoSummary(ctx context.Context, id uuid.UUID, summary string, detailLevel string, ...) error
- func (db *DB) UpdateVideoTranscript(ctx context.Context, id uuid.UUID, transcript, title, channel, language string, ...) error
- type DailyCount
- type ListFilters
- type TopicCount
- type Video
- type VideoMatch
- type VideoStats
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChannelCount ¶
type DB ¶
DB wraps meltkit's DB to allow defining storage methods in this package.
func (*DB) DeleteByBookmarkID ¶
func (*DB) DeleteVideo ¶
func (*DB) GetByYouTubeID ¶
func (*DB) GetKarakeepAPIKey ¶
GetKarakeepAPIKey retrieves the Karakeep API key for a user. Returns empty string if not set.
func (*DB) GetModelPreference ¶
func (db *DB) GetModelPreference(ctx context.Context, userID int) (provider, model string, err error)
GetModelPreference returns the user's preferred summary model (provider + model ID). Empty means use default.
func (*DB) GetOrCreateFeedToken ¶ added in v1.1.0
GetOrCreateFeedToken returns the user's feed token, generating one if it doesn't exist.
func (*DB) GetOrCreateUser ¶
func (*DB) GetOrCreateWebhookToken ¶
GetOrCreateWebhookToken returns the user's webhook token, generating one if it doesn't exist.
func (*DB) GetPrimaryUser ¶
func (*DB) GetSummaryPrompts ¶
GetSummaryPrompts returns the user's custom summary prompts. Nil means use default.
func (*DB) GetUserByFeedToken ¶ added in v1.1.0
GetUserByFeedToken looks up a user ID by feed token. Returns pgx.ErrNoRows if not found.
func (*DB) GetUserByWebhookToken ¶
GetUserByWebhookToken looks up a user ID by webhook token. Returns pgx.ErrNoRows if not found.
func (*DB) ListFailedVideos ¶
func (*DB) ListNoCaptionsVideos ¶
func (*DB) ListRecent ¶
func (*DB) ListVideosWithoutMetadata ¶
func (*DB) SearchVideos ¶
func (*DB) SetKarakeepAPIKey ¶
SetKarakeepAPIKey stores an encrypted Karakeep API key for a user.
func (*DB) SetModelPreference ¶
SetModelPreference sets the user's preferred summary model. Empty values reset to default (NULL).
func (*DB) SetSummaryPrompt ¶
SetSummaryPrompt sets a custom summary prompt for the given level. Empty string resets to default (NULL).
func (*DB) TextSearchVideos ¶
func (*DB) UpdateBookmarkID ¶
func (*DB) UpdateVideoMetadata ¶
func (*DB) UpdateVideoStatus ¶
func (*DB) UpdateVideoSummary ¶
type DailyCount ¶
type ListFilters ¶
type TopicCount ¶
type Video ¶
type Video struct {
ID uuid.UUID `json:"id"`
UserID int `json:"user_id"`
KarakeepBookmarkID string `json:"karakeep_bookmark_id,omitempty"`
YouTubeID string `json:"youtube_id"`
Title string `json:"title"`
Channel string `json:"channel"`
DurationSeconds int `json:"duration_seconds,omitempty"`
Language string `json:"language,omitempty"`
Transcript string `json:"transcript,omitempty"`
Summary string `json:"summary,omitempty"`
DetailLevel string `json:"detail_level"`
SummaryProvider string `json:"summary_provider,omitempty"`
SummaryModel string `json:"summary_model,omitempty"`
SummaryInputTokens int `json:"summary_input_tokens,omitempty"`
SummaryOutputTokens int `json:"summary_output_tokens,omitempty"`
Metadata json.RawMessage `json:"metadata"`
Status string `json:"status"`
ErrorMessage string `json:"error_message,omitempty"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
type VideoMatch ¶
type VideoMatch struct {
ID uuid.UUID `json:"id"`
YouTubeID string `json:"youtube_id"`
Title string `json:"title"`
Channel string `json:"channel"`
Summary string `json:"summary"`
Metadata json.RawMessage `json:"metadata"`
Similarity float64 `json:"similarity"`
CreatedAt time.Time `json:"created_at"`
}
type VideoStats ¶
type VideoStats struct {
TotalCount int `json:"total_count"`
TotalDurationSeconds int64 `json:"total_duration_seconds"`
ByStatus map[string]int `json:"by_status"`
ByChannel []ChannelCount `json:"by_channel"`
TopTopics []TopicCount `json:"top_topics"`
DailyActivity []DailyCount `json:"daily_activity"`
}