Package options provides a shared interface to common probe options.



    This section is empty.


    This section is empty.


    This section is empty.


    type AdditionalLabel

    type AdditionalLabel struct {
    	Key string
    	Value           string // static value
    	TargetLabelKey  string // from target
    	TargetLabelType TargetLabelType
    	// This map will allow for quick label lookup for a target. It will be
    	// updated by the probe while updating targets.
    	LabelForTarget map[string]string
    	// contains filtered or unexported fields

      AdditionalLabel encapsulates additional labels to attach to probe results.

      func (*AdditionalLabel) KeyValueForTarget

      func (al *AdditionalLabel) KeyValueForTarget(targetName string) (key, val string)

        KeyValueForTarget returns key, value pair for the given target.

        func (*AdditionalLabel) UpdateForTarget

        func (al *AdditionalLabel) UpdateForTarget(tname string, tLabels map[string]string)

          UpdateForTarget updates target-based label's value.

          type Options

          type Options struct {
          	Targets             targets.Targets
          	Interval, Timeout   time.Duration
          	Logger              *logger.Logger
          	ProbeConf           interface{} // Probe-type specific config
          	LatencyDist         *metrics.Distribution
          	LatencyUnit         time.Duration
          	Validators          []*validators.Validator
          	SourceIP            net.IP
          	IPVersion           int
          	StatsExportInterval time.Duration
          	LogMetrics          func(*metrics.EventMetrics)
          	AdditionalLabels    []*AdditionalLabel

            Options encapsulates common probe options.

            func BuildProbeOptions

            func BuildProbeOptions(p *configpb.ProbeDef, ldLister endpoint.Lister, globalTargetsOpts *targetspb.GlobalTargetsOptions, l *logger.Logger) (*Options, error)

              BuildProbeOptions builds probe's options using the provided config and some global params.

              func DefaultOptions

              func DefaultOptions() *Options

                DefaultOptions returns default options, capturing default values for the various fields.

                type TargetLabelType

                type TargetLabelType int

                  TargetLabelType for target based additional labels

                  const (
                  	NotTargetLabel TargetLabelType = iota

                    TargetLabelType enum values.