Example #1
0
func example() {
	var ctx context.Context
	// [START intro]
	if !capability.Enabled(ctx, "datastore_v3", "write") {
		// Datastore is in read-only mode.
	}
	// [END intro]
}
Example #2
0
// [START datastore_lookup]
func handler(w http.ResponseWriter, r *http.Request) {
	ctx := appengine.NewContext(r)
	if !capability.Enabled(ctx, "datastore_v3", "*") {
		http.Error(w, "This service is currently unavailable.", 503)
		return
	}
	// do Datastore lookup ...
}