mirror of
https://github.com/hanzoai/tasks.git
synced 2026-11-03 03:56:04 +00:00
Full module path rebrand from Temporal to Hanzo Tasks: - go.mod module: github.com/hanzoai/tasks - All internal Go imports updated (1906 files) - cmd/server renamed to cmd/tasksd - Binary name: tasksd (was temporal-server) - Docker images: hanzoai/tasks (was temporalio/server) - README rewritten with Hanzo Tasks branding - LLM.md created with integration notes - Makefile, goreleaser, CI workflows updated - go.temporal.io/sdk and go.temporal.io/api imports preserved (separate repos) Fork of Temporal.io (MIT license).
36 lines
1.3 KiB
Go
36 lines
1.3 KiB
Go
package visibility
|
|
|
|
import (
|
|
"github.com/hanzoai/tasks/common/dynamicconfig"
|
|
"github.com/hanzoai/tasks/common/persistence/sql/sqlplugin/mysql"
|
|
"github.com/hanzoai/tasks/common/persistence/sql/sqlplugin/postgresql"
|
|
"github.com/hanzoai/tasks/common/persistence/sql/sqlplugin/sqlite"
|
|
)
|
|
|
|
const (
|
|
// SecondaryVisibilityWritingModeOff means do not write to advanced visibility store
|
|
SecondaryVisibilityWritingModeOff = "off"
|
|
// SecondaryVisibilityWritingModeOn means only write to advanced visibility store
|
|
SecondaryVisibilityWritingModeOn = "on"
|
|
// SecondaryVisibilityWritingModeDual means write to both normal visibility and advanced visibility store
|
|
SecondaryVisibilityWritingModeDual = "dual"
|
|
)
|
|
|
|
func AllowListForValidation(
|
|
storeNames []string,
|
|
allowList dynamicconfig.BoolPropertyFnWithNamespaceFilter,
|
|
) dynamicconfig.BoolPropertyFnWithNamespaceFilter {
|
|
if len(storeNames) == 0 {
|
|
return dynamicconfig.GetBoolPropertyFnFilteredByNamespace(false)
|
|
}
|
|
|
|
switch storeNames[0] {
|
|
case mysql.PluginName, postgresql.PluginName, postgresql.PluginNamePGX, sqlite.PluginName:
|
|
// Advanced visibility with SQL DB don't support list of values
|
|
return dynamicconfig.GetBoolPropertyFnFilteredByNamespace(false)
|
|
default:
|
|
// Otherwise (ES), check dynamic config
|
|
return allowList
|
|
}
|
|
}
|