Documentation
¶
Index ¶
- Constants
- func InitDB(dbPath string) (*sql.DB, error)
- func InitDBWithConfig(dbPath string, cfg *config.Config) (*sql.DB, error)
- type CertificateValidation
- type DBTX
- type DatabaseQuerier
- type History
- type HistoryQuerier
- type Querier
- type Queries
- func (q *Queries) AddOrUpdateHistory(ctx context.Context, url string, title sql.NullString) error
- func (q *Queries) CleanupOldZoomLevels(ctx context.Context, dollar_1 sql.NullString) error
- func (q *Queries) DeleteCertificateValidation(ctx context.Context, hostname string, certificateHash string) error
- func (q *Queries) DeleteExpiredCertificateValidations(ctx context.Context) error
- func (q *Queries) DeleteHistory(ctx context.Context, id int64) error
- func (q *Queries) DeleteZoomLevel(ctx context.Context, domain string) error
- func (q *Queries) GetCertificateValidation(ctx context.Context, hostname string, certificateHash string) (CertificateValidation, error)
- func (q *Queries) GetHistory(ctx context.Context, limit int64) ([]History, error)
- func (q *Queries) GetHistoryEntry(ctx context.Context, url string) (History, error)
- func (q *Queries) GetHistoryWithOffset(ctx context.Context, limit int64, offset int64) ([]History, error)
- func (q *Queries) GetShortcuts(ctx context.Context) ([]Shortcut, error)
- func (q *Queries) GetZoomLevel(ctx context.Context, domain string) (float64, error)
- func (q *Queries) GetZoomLevelWithDefault(ctx context.Context, domain string) (interface{}, error)
- func (q *Queries) ListZoomLevels(ctx context.Context) ([]ZoomLevel, error)
- func (q *Queries) SearchHistory(ctx context.Context, column1 sql.NullString, column2 sql.NullString, ...) ([]History, error)
- func (q *Queries) SetZoomLevel(ctx context.Context, domain string, zoomFactor float64) error
- func (q *Queries) StoreCertificateValidation(ctx context.Context, hostname string, certificateHash string, ...) error
- func (q *Queries) UpdateHistoryFavicon(ctx context.Context, faviconUrl sql.NullString, url string) error
- func (q *Queries) WithTx(tx *sql.Tx) *Queries
- type Shortcut
- type ShortcutQuerier
- type ZoomLevel
- type ZoomQuerier
Constants ¶
View Source
const AddOrUpdateHistory = `` /* 215-byte string literal not displayed */
View Source
const CleanupOldZoomLevels = `-- name: CleanupOldZoomLevels :exec
DELETE FROM zoom_levels WHERE updated_at < datetime('now', '-' || ? || ' days')
`
View Source
const DeleteCertificateValidation = `-- name: DeleteCertificateValidation :exec
DELETE FROM certificate_validations
WHERE hostname = ? AND certificate_hash = ?
`
View Source
const DeleteExpiredCertificateValidations = `` /* 151-byte string literal not displayed */
View Source
const DeleteHistory = `-- name: DeleteHistory :exec
DELETE FROM history
WHERE id = ?
`
View Source
const DeleteZoomLevel = `-- name: DeleteZoomLevel :exec
DELETE FROM zoom_levels WHERE domain = ?
`
View Source
const GetCertificateValidation = `` /* 256-byte string literal not displayed */
View Source
const GetHistory = `` /* 148-byte string literal not displayed */
View Source
const GetHistoryEntry = `` /* 139-byte string literal not displayed */
View Source
const GetHistoryWithOffset = `` /* 167-byte string literal not displayed */
View Source
const GetShortcuts = `-- name: GetShortcuts :many
SELECT id, shortcut, url_template, description, created_at
FROM shortcuts
ORDER BY shortcut
`
View Source
const GetZoomLevel = `-- name: GetZoomLevel :one
SELECT zoom_factor FROM zoom_levels WHERE domain = ? LIMIT 1
`
View Source
const GetZoomLevelWithDefault = `` /* 148-byte string literal not displayed */
View Source
const ListZoomLevels = `-- name: ListZoomLevels :many
SELECT domain, zoom_factor, updated_at FROM zoom_levels ORDER BY updated_at DESC
`
View Source
const SearchHistory = `` /* 231-byte string literal not displayed */
View Source
const SetZoomLevel = `` /* 233-byte string literal not displayed */
View Source
const StoreCertificateValidation = `` /* 165-byte string literal not displayed */
View Source
const UpdateHistoryFavicon = `-- name: UpdateHistoryFavicon :exec
UPDATE history
SET favicon_url = ?
WHERE url = ?
`
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CertificateValidation ¶ added in v0.7.0
type DatabaseQuerier ¶
type DatabaseQuerier interface {
ZoomQuerier
HistoryQuerier
ShortcutQuerier
}
DatabaseQuerier combines all database operation interfaces
type HistoryQuerier ¶
type HistoryQuerier interface {
GetHistory(ctx context.Context, limit int64) ([]History, error)
GetHistoryWithOffset(ctx context.Context, limit int64, offset int64) ([]History, error)
SearchHistory(ctx context.Context, column1 sql.NullString, column2 sql.NullString, limit int64) ([]History, error)
AddOrUpdateHistory(ctx context.Context, url string, title sql.NullString) error
UpdateHistoryFavicon(ctx context.Context, faviconUrl sql.NullString, url string) error
DeleteHistory(ctx context.Context, id int64) error
}
HistoryQuerier defines the interface for history-related database operations
type Querier ¶
type Querier interface {
AddOrUpdateHistory(ctx context.Context, url string, title sql.NullString) error
// Cleanup zoom level entries older than specified days
CleanupOldZoomLevels(ctx context.Context, dollar_1 sql.NullString) error
DeleteCertificateValidation(ctx context.Context, hostname string, certificateHash string) error
DeleteExpiredCertificateValidations(ctx context.Context) error
DeleteHistory(ctx context.Context, id int64) error
// Delete zoom level setting for a domain
DeleteZoomLevel(ctx context.Context, domain string) error
GetCertificateValidation(ctx context.Context, hostname string, certificateHash string) (CertificateValidation, error)
GetHistory(ctx context.Context, limit int64) ([]History, error)
GetHistoryEntry(ctx context.Context, url string) (History, error)
GetHistoryWithOffset(ctx context.Context, limit int64, offset int64) ([]History, error)
GetShortcuts(ctx context.Context) ([]Shortcut, error)
// Get zoom level for a specific domain
GetZoomLevel(ctx context.Context, domain string) (float64, error)
// Get zoom level for domain with default fallback
GetZoomLevelWithDefault(ctx context.Context, domain string) (interface{}, error)
// List all zoom level settings ordered by most recently updated
ListZoomLevels(ctx context.Context) ([]ZoomLevel, error)
SearchHistory(ctx context.Context, column1 sql.NullString, column2 sql.NullString, limit int64) ([]History, error)
// Set or update zoom level for a domain with validation
SetZoomLevel(ctx context.Context, domain string, zoomFactor float64) error
StoreCertificateValidation(ctx context.Context, hostname string, certificateHash string, userDecision string, expiresAt sql.NullTime) error
UpdateHistoryFavicon(ctx context.Context, faviconUrl sql.NullString, url string) error
}
type Queries ¶
type Queries struct {
// contains filtered or unexported fields
}
func (*Queries) AddOrUpdateHistory ¶
func (*Queries) CleanupOldZoomLevels ¶
Cleanup zoom level entries older than specified days
func (*Queries) DeleteCertificateValidation ¶ added in v0.7.0
func (*Queries) DeleteExpiredCertificateValidations ¶ added in v0.7.0
func (*Queries) DeleteHistory ¶ added in v0.8.0
func (*Queries) DeleteZoomLevel ¶
Delete zoom level setting for a domain
func (*Queries) GetCertificateValidation ¶ added in v0.7.0
func (*Queries) GetHistory ¶
func (*Queries) GetHistoryEntry ¶ added in v0.11.0
func (*Queries) GetHistoryWithOffset ¶ added in v0.8.0
func (*Queries) GetShortcuts ¶
func (*Queries) GetZoomLevel ¶
Get zoom level for a specific domain
func (*Queries) GetZoomLevelWithDefault ¶
Get zoom level for domain with default fallback
func (*Queries) ListZoomLevels ¶
List all zoom level settings ordered by most recently updated
func (*Queries) SearchHistory ¶
func (q *Queries) SearchHistory(ctx context.Context, column1 sql.NullString, column2 sql.NullString, limit int64) ([]History, error)
func (*Queries) SetZoomLevel ¶
Set or update zoom level for a domain with validation
func (*Queries) StoreCertificateValidation ¶ added in v0.7.0
func (*Queries) UpdateHistoryFavicon ¶ added in v0.5.0
type ShortcutQuerier ¶
ShortcutQuerier defines the interface for shortcut-related database operations
type ZoomQuerier ¶
type ZoomQuerier interface {
GetZoomLevel(ctx context.Context, domain string) (float64, error)
SetZoomLevel(ctx context.Context, domain string, zoomLevel float64) error
DeleteZoomLevel(ctx context.Context, domain string) error
}
ZoomQuerier defines the interface for zoom-related database operations
Source Files
¶
Click to show internal directories.
Click to hide internal directories.