Merge lp://staging/~jameinel/goose/user-agent into lp://staging/goose

Proposed by John A Meinel
Status: Merged
Approved by: John A Meinel
Approved revision: 70
Merged at revision: 67
Proposed branch: lp://staging/~jameinel/goose/user-agent
Merge into: lp://staging/goose
Diff against target: 216 lines (+134/-22)
4 files modified
http/client.go (+24/-22)
http/client_test.go (+73/-0)
version.go (+23/-0)
version_test.go (+14/-0)
To merge this branch: bzr merge lp://staging/~jameinel/goose/user-agent
Reviewer Review Type Date Requested Status
Dimiter Naydenov (community) Approve
Review via email: mp+146814@code.staging.launchpad.net

Commit message

http/client.go,version.go: Add User-agent: goose header

This changes the User-Agent supplied by goose from being a generic "Go http package" to stating it is goose and what version.

Along with that change, it adds a goose.Version to the package, and goose.VersionNumber.

I didn't try to do the complex work that juju-core/version/Version does. I didn't need a lot of version number parsing, so it made more sense to enter the version as integers, and have it build the string trivially.

Description of the change

http/client.go,version.go: Add User-agent: goose header

This changes the User-Agent supplied by goose from being a generic "Go http package" to stating it is goose and what version.

Along with that change, it adds a goose.Version to the package, and goose.VersionNumber.

I didn't try to do the complex work that juju-core/version/Version does. I didn't need a lot of version number parsing, so it made more sense to enter the version as integers, and have it build the string trivially.

Thinking about it, would we want a way for juju-core to register its version as well and report it in the user-agent? It might be more useful than just the goose client library version.

To post a comment you must log in.
Revision history for this message
Dimiter Naydenov (dimitern) wrote :

Looks good and I like it how it simplifies a few things in headers generation.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches