Skip to content

Conversation

MarcusNoble
Copy link
Contributor

Description

Fixes #25
Make the QueryString available within function.

How Has This Been Tested?

Manually tested against the following function:

package function

import (
	"github.com/openfaas-incubator/go-function-sdk"
)

// Handle a function invocation
func Handle(req handler.Request) (handler.Response, error) {
	return handler.Response{
		Body:       []byte(req.QueryString),
		StatusCode: http.StatusOK,
	}, err
}

How are existing users impacted? What migration steps/scripts do we need?

Checklist:

I have:

  • updated the documentation and/or roadmap (if required)
  • read the CONTRIBUTION guide
  • signed-off my commits with git commit -s
  • added unit tests

Signed-off-by: Marcus Noble <m.noble@elsevier.com>
@derek derek bot added the new-contributor label Jul 2, 2019
@alexellis alexellis requested a review from viveksyngh July 6, 2019 09:33
@viveksyngh
Copy link
Contributor

viveksyngh commented Jul 6, 2019

This changes looks good to be me and I tried running in my local it worked fine.

But I think one change is very necessary in every template handler.go file to alias github.com/openfaas-incubator/go-function-sdk as handler. Because we are using that alias but it is not there.

@alexellis alexellis merged commit e383076 into openfaas:master Jul 6, 2019
@alexellis
Copy link
Member

Vivek, thank you for the review I will now merge.

@alexellis
Copy link
Member

alexellis commented Jul 6, 2019

Please feel free to raise an issue to cover your suggestion.

Marcus thanks very much too!

@viveksyngh
Copy link
Contributor

I will raise the PR for that.

Copy link
Contributor

@viveksyngh viveksyngh left a comment

Choose a reason for hiding this comment

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

LGTM

@MarcusNoble MarcusNoble deleted the fix/querystring branch July 8, 2019 06:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

go-http template query string not available in function
3 participants