diff --git a/abstract/shard_strategy.go b/abstract/shard_strategy.go new file mode 100644 index 0000000..26535ed --- /dev/null +++ b/abstract/shard_strategy.go @@ -0,0 +1,16 @@ +// Package abstract ... +// +// Description : abstract ... +// +// Author : go_developer@163.com<白茶清欢> +// +// Date : 2025-06-21 15:20 +package abstract + +// IShardStrategy 自定义数据分片策略 +type IShardStrategy interface { + // ShardField 按照哪些字段分表 + ShardField() []string + // Calculate 计算分片值 + Calculate(inputData map[string]any) (int, error) +}