Documentation
¶
Index ¶
- Constants
- func InitDB(dbPath string) (*sql.DB, error)
- type CertificateQuerier
- type CertificateValidation
- type DBTX
- type DatabaseQuerier
- type FuzzyCacheMetadatum
- type FuzzyCacheStructure
- 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) GetCertificateValidationByHostname(ctx context.Context, hostname 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) GetZoomLevel(ctx context.Context, domain string) (float64, error)
- func (q *Queries) GetZoomLevelWithDefault(ctx context.Context, domain string) (interface{}, error)
- func (q *Queries) ListCertificateValidations(ctx context.Context) ([]CertificateValidation, 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 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 = `` /* 254-byte string literal not displayed */
View Source
const GetCertificateValidationByHostname = `` /* 264-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 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 ListCertificateValidations = `` /* 225-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 CertificateQuerier ¶ added in v0.13.0
type CertificateQuerier interface {
ListCertificateValidations(ctx context.Context) ([]CertificateValidation, error)
GetCertificateValidation(ctx context.Context, hostname string, certificateHash string) (CertificateValidation, error)
GetCertificateValidationByHostname(ctx context.Context, hostname string) (CertificateValidation, error)
StoreCertificateValidation(ctx context.Context, hostname string, certificateHash string, userDecision string, expiresAt sql.NullTime) error
DeleteCertificateValidation(ctx context.Context, hostname string, certificateHash string) error
DeleteExpiredCertificateValidations(ctx context.Context) error
}
CertificateQuerier defines the interface for certificate validation-related database operations
type CertificateValidation ¶ added in v0.7.0
type DatabaseQuerier ¶
type DatabaseQuerier interface {
ZoomQuerier
HistoryQuerier
CertificateQuerier
}
DatabaseQuerier combines all database operation interfaces
type FuzzyCacheMetadatum ¶ added in v0.13.0
type FuzzyCacheStructure ¶ added in v0.13.0
type HistoryQuerier ¶
type HistoryQuerier interface {
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)
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)
GetCertificateValidationByHostname(ctx context.Context, hostname 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)
// 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)
ListCertificateValidations(ctx context.Context) ([]CertificateValidation, 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) GetCertificateValidationByHostname ¶ added in v0.12.0
func (*Queries) GetHistory ¶
func (*Queries) GetHistoryEntry ¶ added in v0.11.0
func (*Queries) GetHistoryWithOffset ¶ added in v0.8.0
func (*Queries) GetZoomLevel ¶
Get zoom level for a specific domain
func (*Queries) GetZoomLevelWithDefault ¶
Get zoom level for domain with default fallback
func (*Queries) ListCertificateValidations ¶ added in v0.13.0
func (q *Queries) ListCertificateValidations(ctx context.Context) ([]CertificateValidation, error)
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 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
ListZoomLevels(ctx context.Context) ([]ZoomLevel, error)
}
ZoomQuerier defines the interface for zoom-related database operations
Source Files
¶
Click to show internal directories.
Click to hide internal directories.