func PathGetSetter[K Context]()

in pkg/ottl/contexts/internal/ctxdatapoint/datapoint.go [18:87]


func PathGetSetter[K Context](path ottl.Path[K]) (ottl.GetSetter[K], error) {
	if path == nil {
		return nil, ctxerror.New("nil", "nil", Name, DocRef)
	}
	switch path.Name() {
	case "attributes":
		if path.Keys() == nil {
			return accessAttributes[K](), nil
		}
		return accessAttributesKey(path.Keys()), nil
	case "start_time_unix_nano":
		return accessStartTimeUnixNano[K](), nil
	case "time_unix_nano":
		return accessTimeUnixNano[K](), nil
	case "start_time":
		return accessStartTime[K](), nil
	case "time":
		return accessTime[K](), nil
	case "value_double":
		return accessDoubleValue[K](), nil
	case "value_int":
		return accessIntValue[K](), nil
	case "exemplars":
		return accessExemplars[K](), nil
	case "flags":
		return accessFlags[K](), nil
	case "count":
		return accessCount[K](), nil
	case "sum":
		return accessSum[K](), nil
	case "bucket_counts":
		return accessBucketCounts[K](), nil
	case "explicit_bounds":
		return accessExplicitBounds[K](), nil
	case "scale":
		return accessScale[K](), nil
	case "zero_count":
		return accessZeroCount[K](), nil
	case "positive":
		nextPath := path.Next()
		if nextPath != nil {
			switch nextPath.Name() {
			case "offset":
				return accessPositiveOffset[K](), nil
			case "bucket_counts":
				return accessPositiveBucketCounts[K](), nil
			default:
				return nil, ctxerror.New(nextPath.Name(), path.String(), Name, DocRef)
			}
		}
		return accessPositive[K](), nil
	case "negative":
		nextPath := path.Next()
		if nextPath != nil {
			switch nextPath.Name() {
			case "offset":
				return accessNegativeOffset[K](), nil
			case "bucket_counts":
				return accessNegativeBucketCounts[K](), nil
			default:
				return nil, ctxerror.New(nextPath.Name(), path.String(), Name, DocRef)
			}
		}
		return accessNegative[K](), nil
	case "quantile_values":
		return accessQuantileValues[K](), nil
	default:
		return nil, ctxerror.New(path.Name(), path.String(), Name, DocRef)
	}
}