Oh, replaced SQLiteMindflow with Mindflow interface.
This commit is contained in:
parent
8cbd8f143f
commit
f12ce11b7f
@ -9,7 +9,6 @@ import (
|
||||
"time"
|
||||
|
||||
"git.arav.su/Arav/dwelling-home/pkg/mindflow"
|
||||
"git.arav.su/Arav/dwelling-home/pkg/mindflow/database/sqlite"
|
||||
"git.arav.su/Arav/justcaptcha/pkg/captcha"
|
||||
"git.arav.su/Arav/justcaptcha/pkg/captcha/inmemdb"
|
||||
"git.arav.su/Arav/justcaptcha/pkg/dwcaptcha"
|
||||
@ -214,10 +213,10 @@ func (h *CaptchaApiHandlers) Image(w http.ResponseWriter, r *http.Request) {
|
||||
// Mindflow API ////////////////////////////////////////////////////////////////
|
||||
|
||||
type MindflowApiHandlers struct {
|
||||
db *sqlite.SQLiteMindflow
|
||||
db mindflow.Mindflow
|
||||
}
|
||||
|
||||
func NewMindflowApiHandlers(db *sqlite.SQLiteMindflow) *MindflowApiHandlers {
|
||||
func NewMindflowApiHandlers(db mindflow.Mindflow) *MindflowApiHandlers {
|
||||
return &MindflowApiHandlers{db: db}
|
||||
}
|
||||
|
||||
|
@ -82,7 +82,7 @@ type SQLiteMindflow struct {
|
||||
db *sql.DB
|
||||
}
|
||||
|
||||
func NewSQLiteMindflow(path string) (*SQLiteMindflow, error) {
|
||||
func NewSQLiteMindflow(path string) (mindflow.Mindflow, error) {
|
||||
db, err := sql.Open("sqlite3", dsn(path))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@ -121,7 +121,7 @@ func (s *SQLiteMindflow) New(post *mindflow.Post) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (s *SQLiteMindflow) Edit(post mindflow.Post) error {
|
||||
func (s *SQLiteMindflow) Edit(post *mindflow.Post) error {
|
||||
tx, err := s.db.Begin()
|
||||
if err != nil {
|
||||
return err
|
||||
|
Loading…
Reference in New Issue
Block a user