mirror of
https://github.com/krau/SaveAny-Bot.git
synced 2026-09-04 23:26:39 +08:00
feat: refactor database dialect handling and add stubs for unsupported features
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
//go:build no_minio
|
||||
|
||||
package minio
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"io"
|
||||
"path"
|
||||
"strings"
|
||||
|
||||
config "github.com/krau/SaveAny-Bot/config/storage"
|
||||
storenum "github.com/krau/SaveAny-Bot/pkg/enums/storage"
|
||||
)
|
||||
|
||||
type Minio struct {
|
||||
}
|
||||
|
||||
func (m *Minio) Init(_ context.Context, _ config.StorageConfig) error {
|
||||
return fmt.Errorf("minio storage is not supported in this build")
|
||||
}
|
||||
|
||||
func (m *Minio) Type() storenum.StorageType {
|
||||
return storenum.Minio
|
||||
}
|
||||
|
||||
func (m *Minio) Name() string {
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *Minio) JoinStoragePath(p string) string {
|
||||
return strings.TrimPrefix(path.Join("", p), "/")
|
||||
}
|
||||
|
||||
func (m *Minio) Save(_ context.Context, _ io.Reader, _ string) error {
|
||||
return fmt.Errorf("minio storage is not supported in this build")
|
||||
}
|
||||
|
||||
func (m *Minio) Exists(_ context.Context, _ string) bool {
|
||||
return false
|
||||
}
|
||||
Reference in New Issue
Block a user