Skip to content
Snippets Groups Projects
Select Git revision
  • 6b24b1dbd795f51345adc7a55229fdd87d9ef084
  • main default protected
  • trading_hours
  • refactor_trading_hours
  • audit_cleaning_cater_for_non_struct_fields
  • remove-info-logs
  • sl-refactor
  • 18-use-scan-for-param-values
  • 17-order-search-results
  • 4-simplify-framework-2
  • 1-http-error
  • v1.297.0
  • v1.296.0
  • v1.295.0
  • v1.294.0
  • v1.293.0
  • v1.292.0
  • v1.291.0
  • v1.290.0
  • v1.289.0
  • v1.288.0
  • v1.287.0
  • v1.286.0
  • v1.285.0
  • v1.284.0
  • v1.283.0
  • v1.282.0
  • v1.281.0
  • v1.280.0
  • v1.279.0
  • v1.278.0
31 results

cron.go

Blame
  • cron.go 647 B
    package handler_utils
    
    import (
    	"gitlab.bob.co.za/bob-public-utils/bobgroup-go-utils/errors"
    )
    
    // ValidateCronHandlers checks that all handlers are correctly defined using one of the supported handler types
    // return updated handlers (with additional information -> N/A for cron)
    func ValidateCronHandlers(handlers map[string]func() error) (map[string]func() error, error) {
    	countHandler := 0
    	for cronName, cronFunc := range handlers {
    		if cronName == "" {
    			return nil, errors.Errorf("blank handlerName")
    		}
    		if cronFunc == nil {
    			return nil, errors.Errorf("nil handler on %s", cronName)
    		}
    		countHandler++
    	}
    	return handlers, nil
    }