github.com/argoproj/argo-events@v1.9.1/eventsources/sources/generic/validate.go (about)

     1  package generic
     2  
     3  import (
     4  	"context"
     5  	"fmt"
     6  )
     7  
     8  func (el *EventListener) ValidateEventSource(ctx context.Context) error {
     9  	if el == nil {
    10  		return fmt.Errorf("event listener can't be nil")
    11  	}
    12  	if el.GenericEventSource.URL == "" {
    13  		return fmt.Errorf("server url can't be empty")
    14  	}
    15  	if el.GenericEventSource.Config == "" {
    16  		return fmt.Errorf("config can't be empty")
    17  	}
    18  	return nil
    19  }