Giter Club home page Giter Club logo

Comments (13)

gmlewis avatar gmlewis commented on August 18, 2024

Did you modify any files from samples/helloworld?
What do you get when you type goapp version?

from go-endpoints.

IndianGuru avatar IndianGuru commented on August 18, 2024

No. I have not modified any of the files. My goapp version is go version go1.4.2 (appengine-1.9.26) windows/386

from go-endpoints.

gmlewis avatar gmlewis commented on August 18, 2024

I just ran the example on my Windows box using windows/amd64, and it worked:

C:\Users\gmlewis\go\src\github.com\GoogleCloudPlatform\go-endpoints\samples\helloworld>d:\Downloads\go_appengine\goapp serve
INFO     2015-09-19 07:15:40,085 devappserver2.py:763] Skipping SDK update check.
WARNING  2015-09-19 07:15:40,266 simple_search_stub.py:1126] Could not read search indexes from d:\tmp\appengine.hello-world\search_indexes
INFO     2015-09-19 07:15:40,309 api_server.py:205] Starting API server at: http://localhost:54890
INFO     2015-09-19 07:15:40,318 dispatcher.py:197] Starting module "default" running at: http://localhost:8080
INFO     2015-09-19 07:15:40,328 admin_server.py:118] Starting admin server at: http://localhost:8000
INFO     2015-09-19 07:15:47,104 module.py:809] default: "GET / HTTP/1.1" 200 1333

and in another window:

$ bat localhost:8080
GET / HTTP/1.1
Host: localhost:8080
Accept: application/json
Accept-Encoding: gzip, deflate
User-Agent: bat/0.1.0



HTTP/1.1 200 OK
Server : Development/2.0
Date : Sat, 19 Sep 2015 14:15:47 GMT
Content-Length : 1333
Content-Type : text/html
Etag : "LTUwNDg4ODY2MA=="
Expires : Fri, 01 Jan 1990 00:00:00 GMT
Cache-Control : no-cache


<!doctype html>
...

So it looks like either this is a windows/386 issue or something is not right on your system.
I'll now try windows/386.

from go-endpoints.

gmlewis avatar gmlewis commented on August 18, 2024

I just tested the windows/386 version, and it worked for me too, so I think something may be wrong with your installation or with your Windows box. Can you please try re-installing and/or try another Windows box?

C:\Users\gmlewis\go\src\github.com\GoogleCloudPlatform\go-endpoints\samples\helloworld>d:\Downloads\go_appengine\goapp version
go version go1.4.2 (appengine-1.9.26) windows/386

C:\Users\gmlewis\go\src\github.com\GoogleCloudPlatform\go-endpoints\samples\helloworld>d:\Downloads\go_appengine\goapp serve
INFO     2015-09-19 07:23:43,361 devappserver2.py:763] Skipping SDK update check.
INFO     2015-09-19 07:23:43,864 api_server.py:205] Starting API server at: http://localhost:54955
INFO     2015-09-19 07:23:43,872 dispatcher.py:197] Starting module "default" running at: http://localhost:8080
INFO     2015-09-19 07:23:43,882 admin_server.py:118] Starting admin server at: http://localhost:8000
INFO     2015-09-19 07:23:49,349 module.py:809] default: "GET / HTTP/1.1" 200 1333

from go-endpoints.

IndianGuru avatar IndianGuru commented on August 18, 2024

I will install everything and try again. Thanks.

from go-endpoints.

IndianGuru avatar IndianGuru commented on August 18, 2024

I re-installed everything on my Windows 7 32-bit box (I have been using Go on this box since 2013 and have never ever faced any problems).

I still get the same 2 errors.

Here's my configuration:

GOARCH=386
GOOS=windows
GOPATH=G:\go_projects\go
GOROOT=G:\go
Path=G:\Python27;G:\go\bin;G:\go_projects\go\bin;G:\go_appengine;G:\Google\Cloud_ SDK\google-cloud-sdk\bin;

Go Workspace:

clipboard01

Versions:
Go - go version go1.5.1 windows/386
Python - 2.7.8
goapp - go version go1.4.2 (appengine-1.9.26) windows/386

As suggested by Jason Buberel:

Google Cloud SDK 0.9.78

bq 2.0.18
bq-win 2.0.18
core 2015.09.11
core-win 2015.08.10
gcloud 2015.09.11
gsutil 4.15
gsutil-win 4.13
windows-ssh-tools 2015.06.02

Unluckily, I don't have another Windows box and can't reinstall Windows on the existing one.

I am stuck, I guess :)

from go-endpoints.

IndianGuru avatar IndianGuru commented on August 18, 2024

I just re-solved the issue!

The error "panic: endpoints: "GreetingService" has no exported methods of suitable type" made me look at the code of service.go for 3 days -
https://github.com/GoogleCloudPlatform/go-endpoints/blob/master/endpoints/service.go

I had already installed endpoints in April of this year. So was the problem being created since I had an earlier version of service.go?

It made sense to update the same.

The documentation says:

Add “-u” param to get an updated version, i.e.

go get -u github.com/GoogleCloudPlatform/go-endpoints/endpoints
Now, you’ll see a couple errors, which is OK, don’t worry!

That's it! The problem got resolved.

Does golang have something that keeps all packages/libraries up-to-date?

from go-endpoints.

gmlewis avatar gmlewis commented on August 18, 2024

I'm glad you found the problem. There are a number of 3rd-party vendoring solutions, but I don't know of anything that updates all your packages. That actually sounds like a potentially dangerous operation anyway.

from go-endpoints.

broady avatar broady commented on August 18, 2024

go get -u ... should update all of your packages :)

from go-endpoints.

IndianGuru avatar IndianGuru commented on August 18, 2024

The following is useful too.

An app that displays updates for the Go packages in your GOPATH.

from go-endpoints.

aneshas avatar aneshas commented on August 18, 2024
package posts

import (
    "log"

    "appengine"
    "appengine/datastore"

    "github.com/GoogleCloudPlatform/go-endpoints/endpoints"
)

type Post struct {
    UID      string
    Text     string
    Username string
    Avatar   string
    Favorite bool
}

type Posts struct {
    Posts []Post
}

type PostAPI struct{}

func init() {
    _, err := endpoints.RegisterService(&PostAPI{}, "posts", "v1", "Posts API", true)
    if err != nil {
        log.Fatalf("Error: %v", err)
    }
    endpoints.HandleHTTP()
}

func (p *PostAPI) List(c appengine.Context) (*Posts, error) {
    var posts []Post

    _, err := datastore.NewQuery("Post").GetAll(c, &posts)
    if err != nil {
        return nil, err
    }

    return &Posts{posts}, nil
}

Getting the same error on linux machine, driving me crazy, I'm running go 1.5, goapp version is go version go1.4.2 (appengine-1.9.25) linux/amd64

Tried -u option when getting endpoints package, even tried deleting them manually, and still the same error. Running out of options...

from go-endpoints.

aneshas avatar aneshas commented on August 18, 2024

and if I change func (p *PostAPI) List(c appengine.Context) (*Posts, error) to func (p *PostAPI) List(c context.Context) (*Posts, error) - the line datastore.NewQuery("Post").GetAll(c, &posts) throws:

/tmp/tmpiQTn0Tappengine-go-bin/posts.go:40: cannot use c (type context.Context) as type "appengine".Context in argument to "appengine/datastore".NewQuery("Post").GetAll:
        context.Context does not implement "appengine".Context (missing Call method)

I am really not sure which Conext to use, the one from appengine package, the one from golang.org/x/net/context, I've even seen endpoints.Context which does not exist currently, endpoints documentation is really inconsistent regarding the Context usage.

from go-endpoints.

aneshas avatar aneshas commented on August 18, 2024

Got it working by using google.golang.org/appengine/datastore with context.Context instead of appengine/datastore but not sure what is the difference ?

from go-endpoints.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.