mirror of
https://github.com/documize/community.git
synced 2025-08-02 03:55:24 +02:00
Continued MySQL/PostgreSQL store provider refactoring
Refactored, renamed, removed storage related code. Basic smoke test passed for PostgreSQL whilst fully working on MySQL variants as per usual.
This commit is contained in:
parent
b455e5eaf5
commit
97beb3f4d3
81 changed files with 1454 additions and 1497 deletions
|
@ -14,8 +14,8 @@ package gemini
|
|||
import (
|
||||
"strings"
|
||||
|
||||
"github.com/documize/community/domain"
|
||||
"github.com/documize/community/domain/section/provider"
|
||||
"github.com/documize/community/domain/store"
|
||||
)
|
||||
|
||||
// the HTML that is rendered by this section.
|
||||
|
@ -87,7 +87,7 @@ type geminiConfig struct {
|
|||
Filter map[string]interface{} `json:"filter"`
|
||||
}
|
||||
|
||||
func (c *geminiConfig) Clean(ctx *provider.Context, store *domain.Store) {
|
||||
func (c *geminiConfig) Clean(ctx *provider.Context, store *store.Store) {
|
||||
if ctx != nil {
|
||||
sec, err := getSecrets(ctx, store)
|
||||
if err == nil {
|
||||
|
@ -103,7 +103,7 @@ func (c *geminiConfig) Clean(ctx *provider.Context, store *domain.Store) {
|
|||
c.URL = strings.TrimSpace(c.URL)
|
||||
}
|
||||
|
||||
func (c *geminiConfig) SaveSecrets(ctx *provider.Context, store *domain.Store) {
|
||||
func (c *geminiConfig) SaveSecrets(ctx *provider.Context, store *store.Store) {
|
||||
var sec secrets
|
||||
sec.APIKey = strings.TrimSpace(c.APIKey)
|
||||
sec.Username = strings.TrimSpace(c.Username)
|
||||
|
@ -117,7 +117,7 @@ type secrets struct {
|
|||
APIKey string `json:"apikey"`
|
||||
}
|
||||
|
||||
func getSecrets(ctx *provider.Context, store *domain.Store) (sec secrets, err error) {
|
||||
func getSecrets(ctx *provider.Context, store *store.Store) (sec secrets, err error) {
|
||||
err = ctx.UnmarshalSecrets(&sec, store)
|
||||
return
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue