-
Notifications
You must be signed in to change notification settings - Fork 301
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add subcommands to modify env vars using Job API #1944
Conversation
f73af90
to
6f970a1
Compare
378080a
to
18e32fb
Compare
af657d5
to
f79499a
Compare
a851f9c
to
2628f58
Compare
I'd lean towards |
0b57802
to
d80e6eb
Compare
c55e724
to
ca8dea2
Compare
ca8dea2
to
6d6bf54
Compare
// do implements the common bits of an API call. req is serialised to JSON and | ||
// passed as the request body if not nil. The method is called, with the token | ||
// added in the Authorization header. The response is deserialised, either into | ||
// the object passed into resp if the status is 200 OK, otherwise into an error. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🥇
dec := json.NewDecoder(hresp.Body) | ||
|
||
if hresp.StatusCode != 200 { | ||
var er ErrorResponse |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want to put the status code in the ErrReponse
? I guess it's YAGNI right now, and whoever needs it should be able to do it relatively easily.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, one for later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀 LGTM
This is the "client half" of #1943. It adds a client for the socket-based current-job API, and three new subcommands that exercise the Get, Update, and Delete methods:
Edit 1: renamed "delete" to "unset"