Example #1
0
func getAlgorithmParams(config *pb.Algorithm) (leaseLength, refreshInterval time.Duration) {
	return time.Duration(config.GetLeaseLength()) * time.Second, time.Duration(config.GetRefreshInterval()) * time.Second
}
Example #2
0
func GetAlgorithm(config *pb.Algorithm) Algorithm {
	return algorithms[config.GetKind()](config)
}