feat(api): doc folders curd implemention
This commit is contained in:
@@ -2,7 +2,6 @@ package logger
|
||||
|
||||
import (
|
||||
"io"
|
||||
"os"
|
||||
|
||||
"octopus"
|
||||
"octopus/internal/config"
|
||||
@@ -17,11 +16,11 @@ func Setup() {
|
||||
zerolog.ErrorStackMarshaler = pkgerrors.MarshalStack
|
||||
|
||||
writers := []io.Writer{}
|
||||
if config.Get().IsLocal {
|
||||
writers = append(writers, zerolog.NewConsoleWriter())
|
||||
} else {
|
||||
writers = append(writers, os.Stderr)
|
||||
}
|
||||
// if config.Get().IsLocal {
|
||||
writers = append(writers, zerolog.NewConsoleWriter())
|
||||
// } else {
|
||||
// writers = append(writers, os.Stderr)
|
||||
// }
|
||||
if dsn := cfg.Sentry.DSN; dsn != "" {
|
||||
sentryWriter, err := NewSentryWriter(
|
||||
cfg.Sentry.DSN,
|
||||
|
||||
@@ -83,3 +83,20 @@ func (m *StorageMinio) DeleteObject(ctx context.Context, objectName string) (err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// MoveObject implements ObjectStorage
|
||||
func (m *StorageMinio) DeleteObjects(ctx context.Context, objectNames []string) []minio.RemoveObjectError {
|
||||
objs := make(chan minio.ObjectInfo, len(objectNames))
|
||||
for _, objectName := range objectNames {
|
||||
objs <- minio.ObjectInfo{Key: objectName}
|
||||
}
|
||||
errCh := m.client.RemoveObjects(ctx, m.bucket, objs, minio.RemoveObjectsOptions{})
|
||||
|
||||
var errors []minio.RemoveObjectError
|
||||
for err := range errCh {
|
||||
if err.Err != nil {
|
||||
errors = append(errors, err)
|
||||
}
|
||||
}
|
||||
return errors
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user