Comments (13)
Did you modify any files from samples/helloworld?
What do you get when you type goapp version
?
from go-endpoints.
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.
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.
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.
I will install everything and try again. Thanks.
from go-endpoints.
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:
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.
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.
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.
go get -u ...
should update all of your packages :)
from go-endpoints.
The following is useful too.
An app that displays updates for the Go packages in your GOPATH
.
from go-endpoints.
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.
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.
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)
- Remove debugging HOT 1
- Parameters from URL path are not decoded. HOT 1
- Service should recover from panic and display an internal server error
- Error while go-getting: use of internal package not allowed HOT 5
- certExpirationTime always returns 0 HOT 12
- Unexpected configuration Error HOT 3
- GAE Cloud Endpoints API Explorer stopped working HOT 1
- Remove appengine/internal depedencies HOT 2
- Path parameters inconsistently handle JSON name overrides, "req[uired]" tag.
- Angular 2 + Go endpoints HOT 1
- Is this idiomatic? HOT 1
- Structures using custom types fail to set default values during validation. HOT 1
- Nested slices are not supported.
- Is it possible to get profile information in an id_token from Google? HOT 1
- Post requests for discovery document?
- Support x-www-form-urlencoded data in POST methods
- This project has open issues from a year ago, is this project reliable for production use? HOT 6
- Can not upload project
- Cloud Endpoints v1 is deprecated - any thoughts about migrating to v2? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from go-endpoints.