algorithm package - go.knocknote.io/octillery/algorithm - Go Packages (original) (raw)
This section is empty.
This section is empty.
func Register(name string, algorithmFactory func() ShardingAlgorithm)
Register register sharding algorithm with name
ShardingAlgorithm is a algorithm for assign sharding target.
octillery currently supports modulo and hashmap. If use the other new algorithm, implement the following interface as plugin ( new_algorithm.go ) and call algorithm.Register("algorithm_name", &NewAlgorithmStructure{}). Also, new_algorithm.go file should put inside go.knocknote.io/octillery/algorithm directory.
LoadShardingAlgorithm load algorithm by name