Пример #1
0
func RegisterHandlers() {
	// Simple Request/Response with context.Context
	handler.Handle("/ping", handlePing)

	// App Engine Datastore
	handler.Handle("/datastore/put", handleDatastorePut)
	handler.Handle("/datastore/get", handleDatastoreGet)

	// Google Cloud Storage
	handler.Handle("/storage/put", handleStoragePut)
	handler.Handle("/storage/get", handleStorageGet)

	// Using context.Context to control top level request timeouts
	// while invoking multiple sub-requests.
	handler.Handle("/slow/get", handleSlowGet)
	handler.Handle("/subrequests/serial", handleSerialSubrequests)
	handler.Handle("/subrequests/concurrent", handleConcurrentSubrequests)
}
Пример #2
0
// App Engine Managed VMs Custom Runtimes must implement the App Engine
// lifecycle handlers.
// https://cloud.google.com/appengine/docs/managed-vms/custom-runtimes
func registerLifecycleEventHandlers() {
	handler.Handle("/_ah/start", okHandler)
	handler.Handle("/_ah/stop", okHandler)
	handler.Handle("/_ah/health", okHandler)
}