chore: enable use-any from revive

Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
This commit is contained in:
Matthieu MOREL
2025-01-17 07:51:57 +01:00
parent 5b1738abf8
commit cbba3bdde7
139 changed files with 798 additions and 799 deletions

View File

@@ -85,7 +85,7 @@ func newFileSystemBR(jobName string, requestorType string, client client.Client,
return fs
}
func (fs *fileSystemBR) Init(ctx context.Context, param interface{}) error {
func (fs *fileSystemBR) Init(ctx context.Context, param any) error {
initParam := param.(*FSBRInitParam)
var err error
@@ -164,7 +164,7 @@ func (fs *fileSystemBR) close(ctx context.Context) {
}
}
func (fs *fileSystemBR) StartBackup(source AccessPoint, uploaderConfig map[string]string, param interface{}) error {
func (fs *fileSystemBR) StartBackup(source AccessPoint, uploaderConfig map[string]string, param any) error {
if !fs.initialized {
return errors.New("file system data path is not initialized")
}

View File

@@ -104,7 +104,7 @@ func newMicroServiceBRWatcher(client client.Client, kubeClient kubernetes.Interf
return ms
}
func (ms *microServiceBRWatcher) Init(ctx context.Context, param interface{}) error {
func (ms *microServiceBRWatcher) Init(ctx context.Context, param any) error {
eventInformer, err := ms.mgr.GetCache().GetInformer(ctx, &v1.Event{})
if err != nil {
return errors.Wrap(err, "error getting event informer")
@@ -117,7 +117,7 @@ func (ms *microServiceBRWatcher) Init(ctx context.Context, param interface{}) er
eventHandler, err := eventInformer.AddEventHandler(
cache.ResourceEventHandlerFuncs{
AddFunc: func(obj interface{}) {
AddFunc: func(obj any) {
evt := obj.(*v1.Event)
if evt.InvolvedObject.Namespace != ms.namespace || evt.InvolvedObject.Name != ms.associatedObject {
return
@@ -125,7 +125,7 @@ func (ms *microServiceBRWatcher) Init(ctx context.Context, param interface{}) er
ms.eventCh <- evt
},
UpdateFunc: func(_, obj interface{}) {
UpdateFunc: func(_, obj any) {
evt := obj.(*v1.Event)
if evt.InvolvedObject.Namespace != ms.namespace || evt.InvolvedObject.Name != ms.associatedObject {
return
@@ -141,7 +141,7 @@ func (ms *microServiceBRWatcher) Init(ctx context.Context, param interface{}) er
podHandler, err := podInformer.AddEventHandler(
cache.ResourceEventHandlerFuncs{
UpdateFunc: func(_, obj interface{}) {
UpdateFunc: func(_, obj any) {
pod := obj.(*v1.Pod)
if pod.Namespace != ms.namespace || pod.Name != ms.thisPod {
return
@@ -213,7 +213,7 @@ func (ms *microServiceBRWatcher) close() {
}
}
func (ms *microServiceBRWatcher) StartBackup(source AccessPoint, uploaderConfig map[string]string, param interface{}) error {
func (ms *microServiceBRWatcher) StartBackup(source AccessPoint, uploaderConfig map[string]string, param any) error {
ms.log.Infof("Start watching backup ms for source %v", source.ByPath)
ms.startWatch()

View File

@@ -59,10 +59,10 @@ type AccessPoint struct {
// AsyncBR is the interface for asynchronous data path methods
type AsyncBR interface {
// Init initializes an asynchronous data path instance
Init(ctx context.Context, param interface{}) error
Init(ctx context.Context, param any) error
// StartBackup starts an asynchronous data path instance for backup
StartBackup(source AccessPoint, dataMoverConfig map[string]string, param interface{}) error
StartBackup(source AccessPoint, dataMoverConfig map[string]string, param any) error
// StartRestore starts an asynchronous data path instance for restore
StartRestore(snapshotID string, target AccessPoint, dataMoverConfig map[string]string) error