Skip to content
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 the app engine support #3

Open
wants to merge 21 commits into
base: master
Choose a base branch
from

Conversation

miko-code
Copy link

Hey ,
As you can see in this therd raygun doesn't work on app engine becouse you cant use http.clinet insted you need to use url fetch.

 func (c *Client) CreateError(message string, ctx ...interface{}) 

In order yo use urlfetch you need to pass it appengin context .

   if len(ctx) > 0 {
    switch v := ctx[0].(type) {
    case gcontext.Context:
        c.submitAppEngine(post, v)
    default:
        c.submit(post)
    }
   } else {
    c.submit(post)

   }

If you don't pass anything it`s still work with the submit method.

func (c *Client) submitAppEngine(post postData, ctx gcontext.Context) 

this method will send the data to raygun .

Im not sure that's the best solution but lets work together to solve this issue

@fundead
Copy link

fundead commented Jul 13, 2015

Hi there,

Apologies for the delay in looking at this, just have time now. Looks like we have some build breaks on Travis:

0.06s$ go test -v ./...
raygun4go.go:46:2: cannot find package "golang.org/x/net/context" in any of:
    /home/travis/.gimme/versions/go1.2.2.linux.amd64/src/pkg/golang.org/x/net/context (from $GOROOT)
    /home/travis/gopath/src/golang.org/x/net/context (from $GOPATH)
raygun4go.go:47:2: cannot find package "google.golang.org/appengine/urlfetch" in any of:
    /home/travis/.gimme/versions/go1.2.2.linux.amd64/src/pkg/google.golang.org/appengine/urlfetch (from $GOROOT)
    /home/travis/gopath/src/google.golang.org/appengine/urlfetch (from $GOPATH)

Aside from the errors, the proposed imports for the appengine package may not be so appropriate for a common library such as this - GAE would certainly be a popular target and we definitely want to support this out of the box, however raygun4go can be run on other environments which are not that PaaS. For this reason if we could avoid taking a hard dependency on appengine that would be great. The dependency introduces maintenance issues which we must take into account.

In our other providers we usually reference common functionality then create a specific implementation package for each platform - for instance https://github.com/MindscapeHQ/raygun4net and https://github.com/MindscapeHQ/raygun4java, the latter of which has a custom RaygunServletClient instead of the default RaygunClient.

Alternatively perhaps exposing a function in raygun4go.go to accept a custom SendError routine which the consuming project then injects with a custom submit() function may be more flexible, but it would be nice if this could work out of the box of course.

@miko-code
Copy link
Author

Hi ,
I reformat the code to work with app engine only , it works well :)
So now we have a fork that we can use on appengin.
I have some issue to configure the travis file and app engine can you please help me with that .

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.

None yet

3 participants