aboutsummaryrefslogtreecommitdiff
path: root/weed/admin/handlers/task_config_interface.go
diff options
context:
space:
mode:
Diffstat (limited to 'weed/admin/handlers/task_config_interface.go')
-rw-r--r--weed/admin/handlers/task_config_interface.go25
1 files changed, 25 insertions, 0 deletions
diff --git a/weed/admin/handlers/task_config_interface.go b/weed/admin/handlers/task_config_interface.go
new file mode 100644
index 000000000..dd22c5250
--- /dev/null
+++ b/weed/admin/handlers/task_config_interface.go
@@ -0,0 +1,25 @@
+package handlers
+
+import (
+ "github.com/seaweedfs/seaweedfs/weed/admin/config"
+ "github.com/seaweedfs/seaweedfs/weed/pb/worker_pb"
+)
+
+// TaskConfig defines the interface that all task configuration types must implement
+type TaskConfig interface {
+ config.ConfigWithDefaults // Extends ConfigWithDefaults for type-safe schema operations
+
+ // Common methods from BaseConfig
+ IsEnabled() bool
+ SetEnabled(enabled bool)
+
+ // Protobuf serialization methods - no more map[string]interface{}!
+ ToTaskPolicy() *worker_pb.TaskPolicy
+ FromTaskPolicy(policy *worker_pb.TaskPolicy) error
+}
+
+// TaskConfigProvider defines the interface for creating specific task config types
+type TaskConfigProvider interface {
+ NewConfig() TaskConfig
+ GetTaskType() string
+}