Skip to content

feat: Add a go plugin to add geo query string to URL - #295

Open
mateustd-ciandt wants to merge 13 commits into
GoogleCloudPlatform:mainfrom
mateustd-ciandt:go-plugin-add-geo-query
Open

feat: Add a go plugin to add geo query string to URL#295
mateustd-ciandt wants to merge 13 commits into
GoogleCloudPlatform:mainfrom
mateustd-ciandt:go-plugin-add-geo-query

Conversation

@mateustd-ciandt

Copy link
Copy Markdown
Contributor

Adding a new GO plugin in order to modulate content based on the country value.
This value is added as a query string name value pair in the URL.
The query string value is also available in the normal GCP logs.

C++ version PR: #289
Rust version PR: #294

@mateustd-ciandt
mateustd-ciandt marked this pull request as ready for review December 1, 2025 14:20
@mateustd-ciandt
mateustd-ciandt requested a review from a team as a code owner December 1, 2025 14:20
@snippet-bot

snippet-bot Bot commented Dec 1, 2025

Copy link
Copy Markdown

Here is the summary of changes.

You are about to add 1 region tag.

This comment is generated by snippet-bot.
If you find problems with this result, please file an issue at:
https://github.com/googleapis/repo-automation-bots/issues.
To update this comment, add snippet-bot:force-run label or use the checkbox below:

  • Refresh this comment

@mpwarres

Copy link
Copy Markdown
Collaborator

See comment #289 (comment) , the plugin should access geo information via the GetProperty() API, in anticipation of attribute support for geo info to be added in Q1.

@mpwarres mpwarres left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM mod comment. Thanks!

Comment thread plugins/samples/add_geo_query/plugin.go Outdated
}

func (ctx *httpContext) addCountryParameter(path, countryValue string) string {
var builder strings.Builder

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggest using the Go net/url package for query param manipulation, as is already done in a number of other Go examples: https://github.com/search?q=repo%3AGoogleCloudPlatform%2Fservice-extensions+net%2Furl&type=code

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done! Thanks!

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