chore: downgrade go version 1.20

This commit is contained in:
loveuer
2024-12-27 11:13:28 +08:00
parent e5ae2efcef
commit 5c9d91ff63
11 changed files with 66 additions and 216 deletions

View File

@ -2,7 +2,6 @@ package db
import (
"context"
"io"
"ultone/internal/opt"
"ultone/internal/tool"
@ -21,10 +20,9 @@ const (
)
type Client struct {
ctx context.Context
cli *gorm.DB
dbType DBType
cfgSqlite *cfgSqlite
ctx context.Context
cli *gorm.DB
dbType DBType
}
func (c *Client) Type() DBType {
@ -52,17 +50,3 @@ func (c *Client) Close() {
d, _ := c.cli.DB()
d.Close()
}
// Dump
// Only for sqlite with mem mode to dump data to bytes(io.Reader)
func (c *Client) Dump() (reader io.ReadSeekCloser, ok bool) {
if c.dbType != DBTypeSqlite {
return nil, false
}
if c.cfgSqlite.fsType != "mem" {
return nil, false
}
return c.cfgSqlite.memDump.Dump(), true
}