kongplete
kongplete copied to clipboard
Allow kong mappers to define predictors
This allows predictors to be tied into Kong's Mappers, which can in turn be automatically attached to fields based on the field type or a type: tag. I didn't see another way to do this in kongplete, it looked like predictor attachment needed to be manually tagged in all cases.
The usage is pretty simple, if you already have a mapper just implement kongplete.PredictorProvider like:
func (_ *MyMapper) Predictor(flag *kong.Flag) complete.Predictor {
return complete.PredictSet("val1", "val2")
}
@WillAbides if you have a chance, would you mind taking a look at this?