Documentation
¶
Index ¶
- Variables
- type SQLiteStore
- func (s *SQLiteStore) Clear(_ context.Context) error
- func (s *SQLiteStore) Close() error
- func (s *SQLiteStore) Create(_ context.Context, post *downcache.Post) (*downcache.Post, error)
- func (s *SQLiteStore) DBPath() string
- func (s *SQLiteStore) Delete(_ context.Context, postType, slug string) error
- func (s *SQLiteStore) Get(_ context.Context, postType, slug string) (*downcache.Post, error)
- func (s *SQLiteStore) GetTaxonomies(_ context.Context) ([]string, error)
- func (s *SQLiteStore) GetTaxonomyTerms(_ context.Context, taxonomy string) ([]string, error)
- func (s *SQLiteStore) Init() error
- func (s *SQLiteStore) Search(_ context.Context, opts downcache.FilterOptions) ([]*downcache.Post, error)
- func (s *SQLiteStore) Update(_ context.Context, oldType, oldSlug string, post *downcache.Post) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrPostNotFound = errors.New("post not found")
Functions ¶
This section is empty.
Types ¶
type SQLiteStore ¶
type SQLiteStore struct {
// contains filtered or unexported fields
}
SQLiteStore is a SQLite implementation of the downcache.CacheStore interface.
func NewSQLiteStore ¶
func NewSQLiteStore(db *sql.DB, dbPath, tableName string) *SQLiteStore
NewSQLiteStore creates a new SQLiteStore instance.
func (*SQLiteStore) Close ¶
func (s *SQLiteStore) Close() error
func (*SQLiteStore) DBPath ¶
func (s *SQLiteStore) DBPath() string
func (*SQLiteStore) Delete ¶
func (s *SQLiteStore) Delete(_ context.Context, postType, slug string) error
func (*SQLiteStore) GetTaxonomies ¶
func (s *SQLiteStore) GetTaxonomies(_ context.Context) ([]string, error)
func (*SQLiteStore) GetTaxonomyTerms ¶
func (*SQLiteStore) Init ¶
func (s *SQLiteStore) Init() error
Init initializes the SQLiteStore, creating the necessary tables or indexes if they do not exist.
func (*SQLiteStore) Search ¶
func (s *SQLiteStore) Search(_ context.Context, opts downcache.FilterOptions) ([]*downcache.Post, error)
func (*SQLiteStore) Update ¶
func (s *SQLiteStore) Update(_ context.Context, oldType, oldSlug string, post *downcache.Post) error
Update updates an existing post in the database TODO: Use the oldType and oldSlug parameters to update the post via post_id and then update the post_id to the new post_id if the post_type or slug has changed.
Click to show internal directories.
Click to hide internal directories.