Skip to content

Conversation

@andrewbaxter
Copy link

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")
}

@andrewbaxter
Copy link
Author

@WillAbides if you have a chance, would you mind taking a look at this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants