You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Rather than following command line prompts, allow restish to be used in a non-interactive mode where users can pass flags to streamline API configuration and modification.
Background
Our team uses restish to expose proprietary APIs through a CLI written in Golang. Behind the scenes, we configure APIs through restish and wrap the inputs and outputs to conform to our desired user experience. By having restish in a non-interactive format, it will streamline our API onboarding and reconfiguration process where we have to guess what output will be returned, as well as guess where the user's restish.json file is located so we don't have to modify it directly.
The text was updated successfully, but these errors were encountered:
danielgtaylor#238
Pass in []string which replaces the os.Args[], io.Writers to optionally redirect Stdout and Stderr, and optionally pass in an authentication token override.
I've submitted a pull request which adds an restish/embedded package that allows restish to be imported as a library.
It allows for setting a different appname (separate config from restish installed on system), sending an authorization token prefix and token in the function call (new handler added in cli/auth.go), and optionally passsing in io.Writers to redirect cli.Stdout and cli.Stderr.
I didn't write any tests for it but I got a branch of my fork working in another CLI app once I fixed the imports.
github.com/loicalleyne/restish@embedtest
Description
Rather than following command line prompts, allow restish to be used in a non-interactive mode where users can pass flags to streamline API configuration and modification.
Background
Our team uses restish to expose proprietary APIs through a CLI written in Golang. Behind the scenes, we configure APIs through restish and wrap the inputs and outputs to conform to our desired user experience. By having restish in a non-interactive format, it will streamline our API onboarding and reconfiguration process where we have to guess what output will be returned, as well as guess where the user's
restish.json
file is located so we don't have to modify it directly.The text was updated successfully, but these errors were encountered: