Documentation
¶
Index ¶
- Constants
- Variables
- func Close() error
- func DeleleOneCallout(ctx context.Context, c *Callout) error
- func DeleteAbraxas(ctx context.Context, a *Abraxas) error
- func DeleteLink(ctx context.Context, l *Link) error
- func DeleteMedia(ctx context.Context, m *Media) error
- func Drop() error
- func ExportDB() (ret map[string]*bytes.Buffer, err error)
- func ExportDBToFiles(filepath string) ([]string, error)
- func ExportTable(table string) (*bytes.Buffer, error)
- func ExportTableToFile(filename, table string) error
- func InsertAbraxas(ctx context.Context, a *Abraxas) error
- func InsertAlias(ctx context.Context, alias *Alias) error
- func InsertCallout(ctx context.Context, c *Callout) error
- func InsertChannelStats(ctx context.Context, c *ChannelStats) error
- func InsertGroup(ctx context.Context, gid int64, title string) error
- func InsertLink(ctx context.Context, l *Link) error
- func InsertMedia(ctx context.Context, m *Media) error
- func InsertStatistics(ctx context.Context, val, kind int64) error
- func InsertStatisticsKind(ctx context.Context, k *StatisticsKind) (int64, error)
- func Migrate() error
- func MigrateDown() error
- func MigrateTo(version uint) error
- func Open(filename string) error
- func SearchRandomMedia(ctx context.Context, m *Media, term string) error
- func SelectAbraxoidesAbraxas(ctx context.Context, gid string) ([]string, error)
- func SelectAbraxoidesAbraxasKind(ctx context.Context, gid string) ([][]string, error)
- func SelectAlias(ctx context.Context, alias *Alias) error
- func SelectAllCallouts(ctx context.Context, gid string) ([]string, error)
- func SelectLinkByURL(ctx context.Context, l *Link) error
- func SelectOneAbraxasByAbraxas(ctx context.Context, a *Abraxas) error
- func SelectOneCallout(ctx context.Context, c *Callout) error
- func SelectOneGroup(ctx context.Context, g *Group) error
- func SelectOneMediaByData(ctx context.Context, m *Media) error
- func SelectOneMediaByRowID(ctx context.Context, m *Media) error
- func SelectRandomMedia(ctx context.Context, m *Media) error
- func SelectRandomMediaKind(ctx context.Context, m *Media) error
- func UpdateMediaScoreByRowID(ctx context.Context, m *Media) error
- type Abraxas
- type Alias
- type Callout
- type ChannelStats
- type ChannelStatsStats
- type Group
- type Link
- type Media
- func SearchMedia(ctx context.Context, gid int64, term string, offset int) ([]Media, error)
- func SelectAllMedia(ctx context.Context) ([]Media, error)
- func SelectAllMediaGroup(ctx context.Context, gid string) ([]Media, error)
- func SelectMediaBottom(ctx context.Context, gid int64, top int) ([]Media, error)
- func SelectMediaTop(ctx context.Context, gid int64, top int) ([]Media, error)
- type MediaFts
- type Statistics
- type StatisticsJoin
- type StatisticsKind
Constants ¶
View Source
const MaxMigrationVersion = 11
MaxMigrationVersion is the latest migration version (11 = FTS5 search)
View Source
const MaxMigrationVersionWithoutFTS5 = 10
MaxMigrationVersionWithoutFTS5 is the max version when FTS5 is unavailable
Variables ¶
Functions ¶
func ExportDBToFiles ¶
func ExportTableToFile ¶
func InsertChannelStats ¶
func InsertChannelStats(ctx context.Context, c *ChannelStats) error
func InsertStatisticsKind ¶
func InsertStatisticsKind(ctx context.Context, k *StatisticsKind) (int64, error)
func MigrateDown ¶
func MigrateDown() error
func SelectAbraxoidesAbraxas ¶
Types ¶
type ChannelStats ¶
func SelectChannelStats ¶
func SelectChannelStats(ctx context.Context, channel int64) ([]ChannelStats, error)
func SelectChannelStatsUser ¶
type ChannelStatsStats ¶
type ChannelStatsStats struct {
GID int64 `db:"gid"`
Min int `db:"min"`
Max int `db:"max"`
Sum int `db:"sum"`
Avg int `db:"avg"`
Count int `db:"count"`
}
func SelectChannelStatsStats ¶
func SelectChannelStatsStats(ctx context.Context, gid int64) (*ChannelStatsStats, error)
type Link ¶
func SearchLinks ¶
type Media ¶
type Media struct {
RowID int64 // NOTE: needed by callback queries
GID int64 `db:"gid"`
Data string `db:"data"`
Kind string `db:"kind"`
Description string `db:"description"`
Score int `db:"score"`
CreatedAt time.Time `db:"created_at"`
}
func SearchMedia ¶
func SelectAllMediaGroup ¶
func SelectMediaBottom ¶
type StatisticsJoin ¶
func SelectStatisticsLatest ¶
func SelectStatisticsLatest(ctx context.Context) ([]*StatisticsJoin, error)
type StatisticsKind ¶
func SelectStatisticKinds ¶
func SelectStatisticKinds(ctx context.Context) ([]*StatisticsKind, error)
Click to show internal directories.
Click to hide internal directories.