func (functions *ScheduledFunctions) Contains(cronFunc *CronFunction) bool {
	for _, f := range *functions {
		if f.Function.Name == cronFunc.Name && f.Function.Schedule == cronFunc.Schedule {
			return true
		}
	}
	return false
}
Contains returns true if the ScheduledFunctions array contains the CronFunction
package types
import (
	"fmt"
	"log"
	"github.com/openfaas-incubator/connector-sdk/types"
	"gopkg.in/robfig/cron.v2"
)
type EntryID cron.EntryID
type Scheduler struct {
	main *cron.Cron
}
type ScheduledFunction struct {
	Function CronFunction
	ID EntryID
}
type ScheduledFunctions []ScheduledFunction
func (s *Scheduler) AddCronFunction(c CronFunction, invoker *types.Invoker) (ScheduledFunction, error) {
	eID, err := s.main.AddFunc(c.Schedule, func() {
		log.Print(fmt.Sprint("Executed function: ", c.Name))
		c.InvokeFunction(invoker)
	})
	return ScheduledFunction{c, EntryID(eID)}, err
}
func NewScheduler() *Scheduler {
	return &Scheduler{
		cron.New(),
	}
}
func (s *Scheduler) Start() {
	s.main.Start()
}
func (s *Scheduler) Remove(function ScheduledFunction) {
	s.main.Remove(cron.EntryID(function.ID))
}
func CheckSchedule(schedule string) bool {
	_, err := cron.Parse(schedule)
	return err == nil
}