I am trying to schedule few jobs dynamically by reading configuration from file like below
import (
"github.com/robfig/cron"
"fmt"
)
masterJobDetails :=// this is array of job from file
c := cron.New()
for k, v := range masterJobDetails {
fmt.Println(k, v.JobName)
c.AddFunc(v.CronExpression, v.JobName)//JobName is function name in string format which need to call on specific interval
}
c.Start()
c.AddFunc() expect cron expression and func() as input,Can i get second argument using reflect with v.JobName string value