Switch to using the dep tool and update all the dependencies
This commit is contained in:
+81
@@ -0,0 +1,81 @@
|
||||
// Copyright 2011 Google Inc. All rights reserved.
|
||||
// Use of this source code is governed by the Apache 2.0
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
// Package aetesting provides utilities for testing App Engine packages.
|
||||
// This is not for testing user applications.
|
||||
package aetesting
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"net/http"
|
||||
"reflect"
|
||||
"testing"
|
||||
|
||||
"github.com/golang/protobuf/proto"
|
||||
"golang.org/x/net/context"
|
||||
|
||||
"google.golang.org/appengine/internal"
|
||||
)
|
||||
|
||||
// FakeSingleContext returns a context whose Call invocations will be serviced
|
||||
// by f, which should be a function that has two arguments of the input and output
|
||||
// protocol buffer type, and one error return.
|
||||
func FakeSingleContext(t *testing.T, service, method string, f interface{}) context.Context {
|
||||
fv := reflect.ValueOf(f)
|
||||
if fv.Kind() != reflect.Func {
|
||||
t.Fatal("not a function")
|
||||
}
|
||||
ft := fv.Type()
|
||||
if ft.NumIn() != 2 || ft.NumOut() != 1 {
|
||||
t.Fatalf("f has %d in and %d out, want 2 in and 1 out", ft.NumIn(), ft.NumOut())
|
||||
}
|
||||
for i := 0; i < 2; i++ {
|
||||
at := ft.In(i)
|
||||
if !at.Implements(protoMessageType) {
|
||||
t.Fatalf("arg %d does not implement proto.Message", i)
|
||||
}
|
||||
}
|
||||
if ft.Out(0) != errorType {
|
||||
t.Fatalf("f's return is %v, want error", ft.Out(0))
|
||||
}
|
||||
s := &single{
|
||||
t: t,
|
||||
service: service,
|
||||
method: method,
|
||||
f: fv,
|
||||
}
|
||||
return internal.WithCallOverride(internal.ContextForTesting(&http.Request{}), s.call)
|
||||
}
|
||||
|
||||
var (
|
||||
protoMessageType = reflect.TypeOf((*proto.Message)(nil)).Elem()
|
||||
errorType = reflect.TypeOf((*error)(nil)).Elem()
|
||||
)
|
||||
|
||||
type single struct {
|
||||
t *testing.T
|
||||
service, method string
|
||||
f reflect.Value
|
||||
}
|
||||
|
||||
func (s *single) call(ctx context.Context, service, method string, in, out proto.Message) error {
|
||||
if service == "__go__" {
|
||||
if method == "GetNamespace" {
|
||||
return nil // always yield an empty namespace
|
||||
}
|
||||
return fmt.Errorf("Unknown API call /%s.%s", service, method)
|
||||
}
|
||||
if service != s.service || method != s.method {
|
||||
s.t.Fatalf("Unexpected call to /%s.%s", service, method)
|
||||
}
|
||||
ins := []reflect.Value{
|
||||
reflect.ValueOf(in),
|
||||
reflect.ValueOf(out),
|
||||
}
|
||||
outs := s.f.Call(ins)
|
||||
if outs[0].IsNil() {
|
||||
return nil
|
||||
}
|
||||
return outs[0].Interface().(error)
|
||||
}
|
||||
+8
-37
@@ -32,8 +32,7 @@ import (
|
||||
)
|
||||
|
||||
const (
|
||||
apiPath = "/rpc_http"
|
||||
defaultTicketSuffix = "/default.20150612t184001.0"
|
||||
apiPath = "/rpc_http"
|
||||
)
|
||||
|
||||
var (
|
||||
@@ -61,9 +60,6 @@ var (
|
||||
Dial: limitDial,
|
||||
},
|
||||
}
|
||||
|
||||
defaultTicketOnce sync.Once
|
||||
defaultTicket string
|
||||
)
|
||||
|
||||
func apiURL() *url.URL {
|
||||
@@ -270,24 +266,6 @@ func WithContext(parent netcontext.Context, req *http.Request) netcontext.Contex
|
||||
return withContext(parent, c)
|
||||
}
|
||||
|
||||
// DefaultTicket returns a ticket used for background context or dev_appserver.
|
||||
func DefaultTicket() string {
|
||||
defaultTicketOnce.Do(func() {
|
||||
if IsDevAppServer() {
|
||||
defaultTicket = "testapp" + defaultTicketSuffix
|
||||
return
|
||||
}
|
||||
appID := partitionlessAppID()
|
||||
escAppID := strings.Replace(strings.Replace(appID, ":", "_", -1), ".", "_", -1)
|
||||
majVersion := VersionID(nil)
|
||||
if i := strings.Index(majVersion, "."); i > 0 {
|
||||
majVersion = majVersion[:i]
|
||||
}
|
||||
defaultTicket = fmt.Sprintf("%s/%s.%s.%s", escAppID, ModuleName(nil), majVersion, InstanceID())
|
||||
})
|
||||
return defaultTicket
|
||||
}
|
||||
|
||||
func BackgroundContext() netcontext.Context {
|
||||
ctxs.Lock()
|
||||
defer ctxs.Unlock()
|
||||
@@ -297,7 +275,13 @@ func BackgroundContext() netcontext.Context {
|
||||
}
|
||||
|
||||
// Compute background security ticket.
|
||||
ticket := DefaultTicket()
|
||||
appID := partitionlessAppID()
|
||||
escAppID := strings.Replace(strings.Replace(appID, ":", "_", -1), ".", "_", -1)
|
||||
majVersion := VersionID(nil)
|
||||
if i := strings.Index(majVersion, "."); i > 0 {
|
||||
majVersion = majVersion[:i]
|
||||
}
|
||||
ticket := fmt.Sprintf("%s/%s.%s.%s", escAppID, ModuleName(nil), majVersion, InstanceID())
|
||||
|
||||
ctxs.bg = &context{
|
||||
req: &http.Request{
|
||||
@@ -491,16 +475,6 @@ func Call(ctx netcontext.Context, service, method string, in, out proto.Message)
|
||||
}
|
||||
|
||||
ticket := c.req.Header.Get(ticketHeader)
|
||||
// Use a test ticket under test environment.
|
||||
if ticket == "" {
|
||||
if appid := ctx.Value(&appIDOverrideKey); appid != nil {
|
||||
ticket = appid.(string) + defaultTicketSuffix
|
||||
}
|
||||
}
|
||||
// Fall back to use background ticket when the request ticket is not available in Flex or dev_appserver.
|
||||
if ticket == "" {
|
||||
ticket = DefaultTicket()
|
||||
}
|
||||
req := &remotepb.Request{
|
||||
ServiceName: &service,
|
||||
Method: &method,
|
||||
@@ -576,9 +550,6 @@ var logLevelName = map[int64]string{
|
||||
}
|
||||
|
||||
func logf(c *context, level int64, format string, args ...interface{}) {
|
||||
if c == nil {
|
||||
panic("not an App Engine context")
|
||||
}
|
||||
s := fmt.Sprintf(format, args...)
|
||||
s = strings.TrimRight(s, "\n") // Remove any trailing newline characters.
|
||||
c.addLogLine(&logpb.UserAppLogLine{
|
||||
|
||||
-30
@@ -5,8 +5,6 @@
|
||||
package internal
|
||||
|
||||
import (
|
||||
"os"
|
||||
|
||||
"github.com/golang/protobuf/proto"
|
||||
netcontext "golang.org/x/net/context"
|
||||
)
|
||||
@@ -86,31 +84,3 @@ func Logf(ctx netcontext.Context, level int64, format string, args ...interface{
|
||||
func NamespacedContext(ctx netcontext.Context, namespace string) netcontext.Context {
|
||||
return withNamespace(ctx, namespace)
|
||||
}
|
||||
|
||||
// SetTestEnv sets the env variables for testing background ticket in Flex.
|
||||
func SetTestEnv() func() {
|
||||
var environ = []struct {
|
||||
key, value string
|
||||
}{
|
||||
{"GAE_LONG_APP_ID", "my-app-id"},
|
||||
{"GAE_MINOR_VERSION", "067924799508853122"},
|
||||
{"GAE_MODULE_INSTANCE", "0"},
|
||||
{"GAE_MODULE_NAME", "default"},
|
||||
{"GAE_MODULE_VERSION", "20150612t184001"},
|
||||
}
|
||||
|
||||
for _, v := range environ {
|
||||
old := os.Getenv(v.key)
|
||||
os.Setenv(v.key, v.value)
|
||||
v.value = old
|
||||
}
|
||||
return func() { // Restore old environment after the test completes.
|
||||
for _, v := range environ {
|
||||
if v.value == "" {
|
||||
os.Unsetenv(v.key)
|
||||
continue
|
||||
}
|
||||
os.Setenv(v.key, v.value)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
// Copyright 2014 Google Inc. All rights reserved.
|
||||
// Use of this source code is governed by the Apache 2.0
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
// +build race
|
||||
|
||||
package internal
|
||||
|
||||
func init() { raceDetector = true }
|
||||
+467
@@ -0,0 +1,467 @@
|
||||
// Copyright 2014 Google Inc. All rights reserved.
|
||||
// Use of this source code is governed by the Apache 2.0
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
// +build !appengine
|
||||
|
||||
package internal
|
||||
|
||||
import (
|
||||
"bufio"
|
||||
"bytes"
|
||||
"fmt"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"net/http"
|
||||
"net/http/httptest"
|
||||
"net/url"
|
||||
"os"
|
||||
"os/exec"
|
||||
"strings"
|
||||
"sync/atomic"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/golang/protobuf/proto"
|
||||
netcontext "golang.org/x/net/context"
|
||||
|
||||
basepb "google.golang.org/appengine/internal/base"
|
||||
remotepb "google.golang.org/appengine/internal/remote_api"
|
||||
)
|
||||
|
||||
const testTicketHeader = "X-Magic-Ticket-Header"
|
||||
|
||||
func init() {
|
||||
ticketHeader = testTicketHeader
|
||||
}
|
||||
|
||||
type fakeAPIHandler struct {
|
||||
hang chan int // used for RunSlowly RPC
|
||||
|
||||
LogFlushes int32 // atomic
|
||||
}
|
||||
|
||||
func (f *fakeAPIHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
||||
writeResponse := func(res *remotepb.Response) {
|
||||
hresBody, err := proto.Marshal(res)
|
||||
if err != nil {
|
||||
http.Error(w, fmt.Sprintf("Failed encoding API response: %v", err), 500)
|
||||
return
|
||||
}
|
||||
w.Write(hresBody)
|
||||
}
|
||||
|
||||
if r.URL.Path != "/rpc_http" {
|
||||
http.NotFound(w, r)
|
||||
return
|
||||
}
|
||||
hreqBody, err := ioutil.ReadAll(r.Body)
|
||||
if err != nil {
|
||||
http.Error(w, fmt.Sprintf("Bad body: %v", err), 500)
|
||||
return
|
||||
}
|
||||
apiReq := &remotepb.Request{}
|
||||
if err := proto.Unmarshal(hreqBody, apiReq); err != nil {
|
||||
http.Error(w, fmt.Sprintf("Bad encoded API request: %v", err), 500)
|
||||
return
|
||||
}
|
||||
if *apiReq.RequestId != "s3cr3t" {
|
||||
writeResponse(&remotepb.Response{
|
||||
RpcError: &remotepb.RpcError{
|
||||
Code: proto.Int32(int32(remotepb.RpcError_SECURITY_VIOLATION)),
|
||||
Detail: proto.String("bad security ticket"),
|
||||
},
|
||||
})
|
||||
return
|
||||
}
|
||||
if got, want := r.Header.Get(dapperHeader), "trace-001"; got != want {
|
||||
writeResponse(&remotepb.Response{
|
||||
RpcError: &remotepb.RpcError{
|
||||
Code: proto.Int32(int32(remotepb.RpcError_BAD_REQUEST)),
|
||||
Detail: proto.String(fmt.Sprintf("trace info = %q, want %q", got, want)),
|
||||
},
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
service, method := *apiReq.ServiceName, *apiReq.Method
|
||||
var resOut proto.Message
|
||||
if service == "actordb" && method == "LookupActor" {
|
||||
req := &basepb.StringProto{}
|
||||
res := &basepb.StringProto{}
|
||||
if err := proto.Unmarshal(apiReq.Request, req); err != nil {
|
||||
http.Error(w, fmt.Sprintf("Bad encoded request: %v", err), 500)
|
||||
return
|
||||
}
|
||||
if *req.Value == "Doctor Who" {
|
||||
res.Value = proto.String("David Tennant")
|
||||
}
|
||||
resOut = res
|
||||
}
|
||||
if service == "errors" {
|
||||
switch method {
|
||||
case "Non200":
|
||||
http.Error(w, "I'm a little teapot.", 418)
|
||||
return
|
||||
case "ShortResponse":
|
||||
w.Header().Set("Content-Length", "100")
|
||||
w.Write([]byte("way too short"))
|
||||
return
|
||||
case "OverQuota":
|
||||
writeResponse(&remotepb.Response{
|
||||
RpcError: &remotepb.RpcError{
|
||||
Code: proto.Int32(int32(remotepb.RpcError_OVER_QUOTA)),
|
||||
Detail: proto.String("you are hogging the resources!"),
|
||||
},
|
||||
})
|
||||
return
|
||||
case "RunSlowly":
|
||||
// TestAPICallRPCFailure creates f.hang, but does not strobe it
|
||||
// until Call returns with remotepb.RpcError_CANCELLED.
|
||||
// This is here to force a happens-before relationship between
|
||||
// the httptest server handler and shutdown.
|
||||
<-f.hang
|
||||
resOut = &basepb.VoidProto{}
|
||||
}
|
||||
}
|
||||
if service == "logservice" && method == "Flush" {
|
||||
// Pretend log flushing is slow.
|
||||
time.Sleep(50 * time.Millisecond)
|
||||
atomic.AddInt32(&f.LogFlushes, 1)
|
||||
resOut = &basepb.VoidProto{}
|
||||
}
|
||||
|
||||
encOut, err := proto.Marshal(resOut)
|
||||
if err != nil {
|
||||
http.Error(w, fmt.Sprintf("Failed encoding response: %v", err), 500)
|
||||
return
|
||||
}
|
||||
writeResponse(&remotepb.Response{
|
||||
Response: encOut,
|
||||
})
|
||||
}
|
||||
|
||||
func setup() (f *fakeAPIHandler, c *context, cleanup func()) {
|
||||
f = &fakeAPIHandler{}
|
||||
srv := httptest.NewServer(f)
|
||||
u, err := url.Parse(srv.URL + apiPath)
|
||||
if err != nil {
|
||||
panic(fmt.Sprintf("url.Parse(%q): %v", srv.URL+apiPath, err))
|
||||
}
|
||||
return f, &context{
|
||||
req: &http.Request{
|
||||
Header: http.Header{
|
||||
ticketHeader: []string{"s3cr3t"},
|
||||
dapperHeader: []string{"trace-001"},
|
||||
},
|
||||
},
|
||||
apiURL: u,
|
||||
}, srv.Close
|
||||
}
|
||||
|
||||
func TestAPICall(t *testing.T) {
|
||||
_, c, cleanup := setup()
|
||||
defer cleanup()
|
||||
|
||||
req := &basepb.StringProto{
|
||||
Value: proto.String("Doctor Who"),
|
||||
}
|
||||
res := &basepb.StringProto{}
|
||||
err := Call(toContext(c), "actordb", "LookupActor", req, res)
|
||||
if err != nil {
|
||||
t.Fatalf("API call failed: %v", err)
|
||||
}
|
||||
if got, want := *res.Value, "David Tennant"; got != want {
|
||||
t.Errorf("Response is %q, want %q", got, want)
|
||||
}
|
||||
}
|
||||
|
||||
func TestAPICallRPCFailure(t *testing.T) {
|
||||
f, c, cleanup := setup()
|
||||
defer cleanup()
|
||||
|
||||
testCases := []struct {
|
||||
method string
|
||||
code remotepb.RpcError_ErrorCode
|
||||
}{
|
||||
{"Non200", remotepb.RpcError_UNKNOWN},
|
||||
{"ShortResponse", remotepb.RpcError_UNKNOWN},
|
||||
{"OverQuota", remotepb.RpcError_OVER_QUOTA},
|
||||
{"RunSlowly", remotepb.RpcError_CANCELLED},
|
||||
}
|
||||
f.hang = make(chan int) // only for RunSlowly
|
||||
for _, tc := range testCases {
|
||||
ctx, _ := netcontext.WithTimeout(toContext(c), 100*time.Millisecond)
|
||||
err := Call(ctx, "errors", tc.method, &basepb.VoidProto{}, &basepb.VoidProto{})
|
||||
ce, ok := err.(*CallError)
|
||||
if !ok {
|
||||
t.Errorf("%s: API call error is %T (%v), want *CallError", tc.method, err, err)
|
||||
continue
|
||||
}
|
||||
if ce.Code != int32(tc.code) {
|
||||
t.Errorf("%s: ce.Code = %d, want %d", tc.method, ce.Code, tc.code)
|
||||
}
|
||||
if tc.method == "RunSlowly" {
|
||||
f.hang <- 1 // release the HTTP handler
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestAPICallDialFailure(t *testing.T) {
|
||||
// See what happens if the API host is unresponsive.
|
||||
// This should time out quickly, not hang forever.
|
||||
_, c, cleanup := setup()
|
||||
defer cleanup()
|
||||
// Reset the URL to the production address so that dialing fails.
|
||||
c.apiURL = apiURL()
|
||||
|
||||
start := time.Now()
|
||||
err := Call(toContext(c), "foo", "bar", &basepb.VoidProto{}, &basepb.VoidProto{})
|
||||
const max = 1 * time.Second
|
||||
if taken := time.Since(start); taken > max {
|
||||
t.Errorf("Dial hang took too long: %v > %v", taken, max)
|
||||
}
|
||||
if err == nil {
|
||||
t.Error("Call did not fail")
|
||||
}
|
||||
}
|
||||
|
||||
func TestDelayedLogFlushing(t *testing.T) {
|
||||
f, c, cleanup := setup()
|
||||
defer cleanup()
|
||||
|
||||
http.HandleFunc("/quick_log", func(w http.ResponseWriter, r *http.Request) {
|
||||
logC := WithContext(netcontext.Background(), r)
|
||||
fromContext(logC).apiURL = c.apiURL // Otherwise it will try to use the default URL.
|
||||
Logf(logC, 1, "It's a lovely day.")
|
||||
w.WriteHeader(200)
|
||||
w.Write(make([]byte, 100<<10)) // write 100 KB to force HTTP flush
|
||||
})
|
||||
|
||||
r := &http.Request{
|
||||
Method: "GET",
|
||||
URL: &url.URL{
|
||||
Scheme: "http",
|
||||
Path: "/quick_log",
|
||||
},
|
||||
Header: c.req.Header,
|
||||
Body: ioutil.NopCloser(bytes.NewReader(nil)),
|
||||
}
|
||||
w := httptest.NewRecorder()
|
||||
|
||||
// Check that log flushing does not hold up the HTTP response.
|
||||
start := time.Now()
|
||||
handleHTTP(w, r)
|
||||
if d := time.Since(start); d > 10*time.Millisecond {
|
||||
t.Errorf("handleHTTP took %v, want under 10ms", d)
|
||||
}
|
||||
const hdr = "X-AppEngine-Log-Flush-Count"
|
||||
if h := w.HeaderMap.Get(hdr); h != "1" {
|
||||
t.Errorf("%s header = %q, want %q", hdr, h, "1")
|
||||
}
|
||||
if f := atomic.LoadInt32(&f.LogFlushes); f != 0 {
|
||||
t.Errorf("After HTTP response: f.LogFlushes = %d, want 0", f)
|
||||
}
|
||||
|
||||
// Check that the log flush eventually comes in.
|
||||
time.Sleep(100 * time.Millisecond)
|
||||
if f := atomic.LoadInt32(&f.LogFlushes); f != 1 {
|
||||
t.Errorf("After 100ms: f.LogFlushes = %d, want 1", f)
|
||||
}
|
||||
}
|
||||
|
||||
func TestRemoteAddr(t *testing.T) {
|
||||
var addr string
|
||||
http.HandleFunc("/remote_addr", func(w http.ResponseWriter, r *http.Request) {
|
||||
addr = r.RemoteAddr
|
||||
})
|
||||
|
||||
testCases := []struct {
|
||||
headers http.Header
|
||||
addr string
|
||||
}{
|
||||
{http.Header{"X-Appengine-User-Ip": []string{"10.5.2.1"}}, "10.5.2.1:80"},
|
||||
{http.Header{"X-Appengine-Remote-Addr": []string{"1.2.3.4"}}, "1.2.3.4:80"},
|
||||
{http.Header{"X-Appengine-Remote-Addr": []string{"1.2.3.4:8080"}}, "1.2.3.4:8080"},
|
||||
{
|
||||
http.Header{"X-Appengine-Remote-Addr": []string{"2401:fa00:9:1:7646:a0ff:fe90:ca66"}},
|
||||
"[2401:fa00:9:1:7646:a0ff:fe90:ca66]:80",
|
||||
},
|
||||
{
|
||||
http.Header{"X-Appengine-Remote-Addr": []string{"[::1]:http"}},
|
||||
"[::1]:http",
|
||||
},
|
||||
{http.Header{}, "127.0.0.1:80"},
|
||||
}
|
||||
|
||||
for _, tc := range testCases {
|
||||
r := &http.Request{
|
||||
Method: "GET",
|
||||
URL: &url.URL{Scheme: "http", Path: "/remote_addr"},
|
||||
Header: tc.headers,
|
||||
Body: ioutil.NopCloser(bytes.NewReader(nil)),
|
||||
}
|
||||
handleHTTP(httptest.NewRecorder(), r)
|
||||
if addr != tc.addr {
|
||||
t.Errorf("Header %v, got %q, want %q", tc.headers, addr, tc.addr)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestPanickingHandler(t *testing.T) {
|
||||
http.HandleFunc("/panic", func(http.ResponseWriter, *http.Request) {
|
||||
panic("whoops!")
|
||||
})
|
||||
r := &http.Request{
|
||||
Method: "GET",
|
||||
URL: &url.URL{Scheme: "http", Path: "/panic"},
|
||||
Body: ioutil.NopCloser(bytes.NewReader(nil)),
|
||||
}
|
||||
rec := httptest.NewRecorder()
|
||||
handleHTTP(rec, r)
|
||||
if rec.Code != 500 {
|
||||
t.Errorf("Panicking handler returned HTTP %d, want HTTP %d", rec.Code, 500)
|
||||
}
|
||||
}
|
||||
|
||||
var raceDetector = false
|
||||
|
||||
func TestAPICallAllocations(t *testing.T) {
|
||||
if raceDetector {
|
||||
t.Skip("not running under race detector")
|
||||
}
|
||||
|
||||
// Run the test API server in a subprocess so we aren't counting its allocations.
|
||||
u, cleanup := launchHelperProcess(t)
|
||||
defer cleanup()
|
||||
c := &context{
|
||||
req: &http.Request{
|
||||
Header: http.Header{
|
||||
ticketHeader: []string{"s3cr3t"},
|
||||
dapperHeader: []string{"trace-001"},
|
||||
},
|
||||
},
|
||||
apiURL: u,
|
||||
}
|
||||
|
||||
req := &basepb.StringProto{
|
||||
Value: proto.String("Doctor Who"),
|
||||
}
|
||||
res := &basepb.StringProto{}
|
||||
var apiErr error
|
||||
avg := testing.AllocsPerRun(100, func() {
|
||||
ctx, _ := netcontext.WithTimeout(toContext(c), 100*time.Millisecond)
|
||||
if err := Call(ctx, "actordb", "LookupActor", req, res); err != nil && apiErr == nil {
|
||||
apiErr = err // get the first error only
|
||||
}
|
||||
})
|
||||
if apiErr != nil {
|
||||
t.Errorf("API call failed: %v", apiErr)
|
||||
}
|
||||
|
||||
// Lots of room for improvement...
|
||||
// TODO(djd): Reduce maximum to 85 once the App Engine SDK is based on 1.6.
|
||||
const min, max float64 = 70, 90
|
||||
if avg < min || max < avg {
|
||||
t.Errorf("Allocations per API call = %g, want in [%g,%g]", avg, min, max)
|
||||
}
|
||||
}
|
||||
|
||||
func launchHelperProcess(t *testing.T) (apiURL *url.URL, cleanup func()) {
|
||||
cmd := exec.Command(os.Args[0], "-test.run=TestHelperProcess")
|
||||
cmd.Env = []string{"GO_WANT_HELPER_PROCESS=1"}
|
||||
stdin, err := cmd.StdinPipe()
|
||||
if err != nil {
|
||||
t.Fatalf("StdinPipe: %v", err)
|
||||
}
|
||||
stdout, err := cmd.StdoutPipe()
|
||||
if err != nil {
|
||||
t.Fatalf("StdoutPipe: %v", err)
|
||||
}
|
||||
if err := cmd.Start(); err != nil {
|
||||
t.Fatalf("Starting helper process: %v", err)
|
||||
}
|
||||
|
||||
scan := bufio.NewScanner(stdout)
|
||||
var u *url.URL
|
||||
for scan.Scan() {
|
||||
line := scan.Text()
|
||||
if hp := strings.TrimPrefix(line, helperProcessMagic); hp != line {
|
||||
var err error
|
||||
u, err = url.Parse(hp)
|
||||
if err != nil {
|
||||
t.Fatalf("Failed to parse %q: %v", hp, err)
|
||||
}
|
||||
break
|
||||
}
|
||||
}
|
||||
if err := scan.Err(); err != nil {
|
||||
t.Fatalf("Scanning helper process stdout: %v", err)
|
||||
}
|
||||
if u == nil {
|
||||
t.Fatal("Helper process never reported")
|
||||
}
|
||||
|
||||
return u, func() {
|
||||
stdin.Close()
|
||||
if err := cmd.Wait(); err != nil {
|
||||
t.Errorf("Helper process did not exit cleanly: %v", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const helperProcessMagic = "A lovely helper process is listening at "
|
||||
|
||||
// This isn't a real test. It's used as a helper process.
|
||||
func TestHelperProcess(*testing.T) {
|
||||
if os.Getenv("GO_WANT_HELPER_PROCESS") != "1" {
|
||||
return
|
||||
}
|
||||
defer os.Exit(0)
|
||||
|
||||
f := &fakeAPIHandler{}
|
||||
srv := httptest.NewServer(f)
|
||||
defer srv.Close()
|
||||
fmt.Println(helperProcessMagic + srv.URL + apiPath)
|
||||
|
||||
// Wait for stdin to be closed.
|
||||
io.Copy(ioutil.Discard, os.Stdin)
|
||||
}
|
||||
|
||||
func TestBackgroundContext(t *testing.T) {
|
||||
environ := []struct {
|
||||
key, value string
|
||||
}{
|
||||
{"GAE_LONG_APP_ID", "my-app-id"},
|
||||
{"GAE_MINOR_VERSION", "067924799508853122"},
|
||||
{"GAE_MODULE_INSTANCE", "0"},
|
||||
{"GAE_MODULE_NAME", "default"},
|
||||
{"GAE_MODULE_VERSION", "20150612t184001"},
|
||||
}
|
||||
for _, v := range environ {
|
||||
old := os.Getenv(v.key)
|
||||
os.Setenv(v.key, v.value)
|
||||
v.value = old
|
||||
}
|
||||
defer func() { // Restore old environment after the test completes.
|
||||
for _, v := range environ {
|
||||
if v.value == "" {
|
||||
os.Unsetenv(v.key)
|
||||
continue
|
||||
}
|
||||
os.Setenv(v.key, v.value)
|
||||
}
|
||||
}()
|
||||
|
||||
ctx, key := fromContext(BackgroundContext()), "X-Magic-Ticket-Header"
|
||||
if g, w := ctx.req.Header.Get(key), "my-app-id/default.20150612t184001.0"; g != w {
|
||||
t.Errorf("%v = %q, want %q", key, g, w)
|
||||
}
|
||||
|
||||
// Check that using the background context doesn't panic.
|
||||
req := &basepb.StringProto{
|
||||
Value: proto.String("Doctor Who"),
|
||||
}
|
||||
res := &basepb.StringProto{}
|
||||
Call(BackgroundContext(), "actordb", "LookupActor", req, res) // expected to fail
|
||||
}
|
||||
+34
@@ -0,0 +1,34 @@
|
||||
// Copyright 2011 Google Inc. All Rights Reserved.
|
||||
// Use of this source code is governed by the Apache 2.0
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package internal
|
||||
|
||||
import (
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestAppIDParsing(t *testing.T) {
|
||||
testCases := []struct {
|
||||
in string
|
||||
partition, domain, displayID string
|
||||
}{
|
||||
{"simple-app-id", "", "", "simple-app-id"},
|
||||
{"domain.com:domain-app-id", "", "domain.com", "domain-app-id"},
|
||||
{"part~partition-app-id", "part", "", "partition-app-id"},
|
||||
{"part~domain.com:display", "part", "domain.com", "display"},
|
||||
}
|
||||
|
||||
for _, tc := range testCases {
|
||||
part, dom, dis := parseFullAppID(tc.in)
|
||||
if part != tc.partition {
|
||||
t.Errorf("partition of %q: got %q, want %q", tc.in, part, tc.partition)
|
||||
}
|
||||
if dom != tc.domain {
|
||||
t.Errorf("domain of %q: got %q, want %q", tc.in, dom, tc.domain)
|
||||
}
|
||||
if dis != tc.displayID {
|
||||
t.Errorf("displayID of %q: got %q, want %q", tc.in, dis, tc.displayID)
|
||||
}
|
||||
}
|
||||
}
|
||||
+347
@@ -0,0 +1,347 @@
|
||||
// Code generated by protoc-gen-go.
|
||||
// source: google.golang.org/appengine/internal/blobstore/blobstore_service.proto
|
||||
// DO NOT EDIT!
|
||||
|
||||
/*
|
||||
Package blobstore is a generated protocol buffer package.
|
||||
|
||||
It is generated from these files:
|
||||
google.golang.org/appengine/internal/blobstore/blobstore_service.proto
|
||||
|
||||
It has these top-level messages:
|
||||
BlobstoreServiceError
|
||||
CreateUploadURLRequest
|
||||
CreateUploadURLResponse
|
||||
DeleteBlobRequest
|
||||
FetchDataRequest
|
||||
FetchDataResponse
|
||||
CloneBlobRequest
|
||||
CloneBlobResponse
|
||||
DecodeBlobKeyRequest
|
||||
DecodeBlobKeyResponse
|
||||
CreateEncodedGoogleStorageKeyRequest
|
||||
CreateEncodedGoogleStorageKeyResponse
|
||||
*/
|
||||
package blobstore
|
||||
|
||||
import proto "github.com/golang/protobuf/proto"
|
||||
import fmt "fmt"
|
||||
import math "math"
|
||||
|
||||
// Reference imports to suppress errors if they are not otherwise used.
|
||||
var _ = proto.Marshal
|
||||
var _ = fmt.Errorf
|
||||
var _ = math.Inf
|
||||
|
||||
type BlobstoreServiceError_ErrorCode int32
|
||||
|
||||
const (
|
||||
BlobstoreServiceError_OK BlobstoreServiceError_ErrorCode = 0
|
||||
BlobstoreServiceError_INTERNAL_ERROR BlobstoreServiceError_ErrorCode = 1
|
||||
BlobstoreServiceError_URL_TOO_LONG BlobstoreServiceError_ErrorCode = 2
|
||||
BlobstoreServiceError_PERMISSION_DENIED BlobstoreServiceError_ErrorCode = 3
|
||||
BlobstoreServiceError_BLOB_NOT_FOUND BlobstoreServiceError_ErrorCode = 4
|
||||
BlobstoreServiceError_DATA_INDEX_OUT_OF_RANGE BlobstoreServiceError_ErrorCode = 5
|
||||
BlobstoreServiceError_BLOB_FETCH_SIZE_TOO_LARGE BlobstoreServiceError_ErrorCode = 6
|
||||
BlobstoreServiceError_ARGUMENT_OUT_OF_RANGE BlobstoreServiceError_ErrorCode = 8
|
||||
BlobstoreServiceError_INVALID_BLOB_KEY BlobstoreServiceError_ErrorCode = 9
|
||||
)
|
||||
|
||||
var BlobstoreServiceError_ErrorCode_name = map[int32]string{
|
||||
0: "OK",
|
||||
1: "INTERNAL_ERROR",
|
||||
2: "URL_TOO_LONG",
|
||||
3: "PERMISSION_DENIED",
|
||||
4: "BLOB_NOT_FOUND",
|
||||
5: "DATA_INDEX_OUT_OF_RANGE",
|
||||
6: "BLOB_FETCH_SIZE_TOO_LARGE",
|
||||
8: "ARGUMENT_OUT_OF_RANGE",
|
||||
9: "INVALID_BLOB_KEY",
|
||||
}
|
||||
var BlobstoreServiceError_ErrorCode_value = map[string]int32{
|
||||
"OK": 0,
|
||||
"INTERNAL_ERROR": 1,
|
||||
"URL_TOO_LONG": 2,
|
||||
"PERMISSION_DENIED": 3,
|
||||
"BLOB_NOT_FOUND": 4,
|
||||
"DATA_INDEX_OUT_OF_RANGE": 5,
|
||||
"BLOB_FETCH_SIZE_TOO_LARGE": 6,
|
||||
"ARGUMENT_OUT_OF_RANGE": 8,
|
||||
"INVALID_BLOB_KEY": 9,
|
||||
}
|
||||
|
||||
func (x BlobstoreServiceError_ErrorCode) Enum() *BlobstoreServiceError_ErrorCode {
|
||||
p := new(BlobstoreServiceError_ErrorCode)
|
||||
*p = x
|
||||
return p
|
||||
}
|
||||
func (x BlobstoreServiceError_ErrorCode) String() string {
|
||||
return proto.EnumName(BlobstoreServiceError_ErrorCode_name, int32(x))
|
||||
}
|
||||
func (x *BlobstoreServiceError_ErrorCode) UnmarshalJSON(data []byte) error {
|
||||
value, err := proto.UnmarshalJSONEnum(BlobstoreServiceError_ErrorCode_value, data, "BlobstoreServiceError_ErrorCode")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
*x = BlobstoreServiceError_ErrorCode(value)
|
||||
return nil
|
||||
}
|
||||
|
||||
type BlobstoreServiceError struct {
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
}
|
||||
|
||||
func (m *BlobstoreServiceError) Reset() { *m = BlobstoreServiceError{} }
|
||||
func (m *BlobstoreServiceError) String() string { return proto.CompactTextString(m) }
|
||||
func (*BlobstoreServiceError) ProtoMessage() {}
|
||||
|
||||
type CreateUploadURLRequest struct {
|
||||
SuccessPath *string `protobuf:"bytes,1,req,name=success_path" json:"success_path,omitempty"`
|
||||
MaxUploadSizeBytes *int64 `protobuf:"varint,2,opt,name=max_upload_size_bytes" json:"max_upload_size_bytes,omitempty"`
|
||||
MaxUploadSizePerBlobBytes *int64 `protobuf:"varint,3,opt,name=max_upload_size_per_blob_bytes" json:"max_upload_size_per_blob_bytes,omitempty"`
|
||||
GsBucketName *string `protobuf:"bytes,4,opt,name=gs_bucket_name" json:"gs_bucket_name,omitempty"`
|
||||
UrlExpiryTimeSeconds *int32 `protobuf:"varint,5,opt,name=url_expiry_time_seconds" json:"url_expiry_time_seconds,omitempty"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
}
|
||||
|
||||
func (m *CreateUploadURLRequest) Reset() { *m = CreateUploadURLRequest{} }
|
||||
func (m *CreateUploadURLRequest) String() string { return proto.CompactTextString(m) }
|
||||
func (*CreateUploadURLRequest) ProtoMessage() {}
|
||||
|
||||
func (m *CreateUploadURLRequest) GetSuccessPath() string {
|
||||
if m != nil && m.SuccessPath != nil {
|
||||
return *m.SuccessPath
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *CreateUploadURLRequest) GetMaxUploadSizeBytes() int64 {
|
||||
if m != nil && m.MaxUploadSizeBytes != nil {
|
||||
return *m.MaxUploadSizeBytes
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (m *CreateUploadURLRequest) GetMaxUploadSizePerBlobBytes() int64 {
|
||||
if m != nil && m.MaxUploadSizePerBlobBytes != nil {
|
||||
return *m.MaxUploadSizePerBlobBytes
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (m *CreateUploadURLRequest) GetGsBucketName() string {
|
||||
if m != nil && m.GsBucketName != nil {
|
||||
return *m.GsBucketName
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *CreateUploadURLRequest) GetUrlExpiryTimeSeconds() int32 {
|
||||
if m != nil && m.UrlExpiryTimeSeconds != nil {
|
||||
return *m.UrlExpiryTimeSeconds
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
type CreateUploadURLResponse struct {
|
||||
Url *string `protobuf:"bytes,1,req,name=url" json:"url,omitempty"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
}
|
||||
|
||||
func (m *CreateUploadURLResponse) Reset() { *m = CreateUploadURLResponse{} }
|
||||
func (m *CreateUploadURLResponse) String() string { return proto.CompactTextString(m) }
|
||||
func (*CreateUploadURLResponse) ProtoMessage() {}
|
||||
|
||||
func (m *CreateUploadURLResponse) GetUrl() string {
|
||||
if m != nil && m.Url != nil {
|
||||
return *m.Url
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type DeleteBlobRequest struct {
|
||||
BlobKey []string `protobuf:"bytes,1,rep,name=blob_key" json:"blob_key,omitempty"`
|
||||
Token *string `protobuf:"bytes,2,opt,name=token" json:"token,omitempty"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
}
|
||||
|
||||
func (m *DeleteBlobRequest) Reset() { *m = DeleteBlobRequest{} }
|
||||
func (m *DeleteBlobRequest) String() string { return proto.CompactTextString(m) }
|
||||
func (*DeleteBlobRequest) ProtoMessage() {}
|
||||
|
||||
func (m *DeleteBlobRequest) GetBlobKey() []string {
|
||||
if m != nil {
|
||||
return m.BlobKey
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *DeleteBlobRequest) GetToken() string {
|
||||
if m != nil && m.Token != nil {
|
||||
return *m.Token
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type FetchDataRequest struct {
|
||||
BlobKey *string `protobuf:"bytes,1,req,name=blob_key" json:"blob_key,omitempty"`
|
||||
StartIndex *int64 `protobuf:"varint,2,req,name=start_index" json:"start_index,omitempty"`
|
||||
EndIndex *int64 `protobuf:"varint,3,req,name=end_index" json:"end_index,omitempty"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
}
|
||||
|
||||
func (m *FetchDataRequest) Reset() { *m = FetchDataRequest{} }
|
||||
func (m *FetchDataRequest) String() string { return proto.CompactTextString(m) }
|
||||
func (*FetchDataRequest) ProtoMessage() {}
|
||||
|
||||
func (m *FetchDataRequest) GetBlobKey() string {
|
||||
if m != nil && m.BlobKey != nil {
|
||||
return *m.BlobKey
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *FetchDataRequest) GetStartIndex() int64 {
|
||||
if m != nil && m.StartIndex != nil {
|
||||
return *m.StartIndex
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (m *FetchDataRequest) GetEndIndex() int64 {
|
||||
if m != nil && m.EndIndex != nil {
|
||||
return *m.EndIndex
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
type FetchDataResponse struct {
|
||||
Data []byte `protobuf:"bytes,1000,req,name=data" json:"data,omitempty"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
}
|
||||
|
||||
func (m *FetchDataResponse) Reset() { *m = FetchDataResponse{} }
|
||||
func (m *FetchDataResponse) String() string { return proto.CompactTextString(m) }
|
||||
func (*FetchDataResponse) ProtoMessage() {}
|
||||
|
||||
func (m *FetchDataResponse) GetData() []byte {
|
||||
if m != nil {
|
||||
return m.Data
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type CloneBlobRequest struct {
|
||||
BlobKey []byte `protobuf:"bytes,1,req,name=blob_key" json:"blob_key,omitempty"`
|
||||
MimeType []byte `protobuf:"bytes,2,req,name=mime_type" json:"mime_type,omitempty"`
|
||||
TargetAppId []byte `protobuf:"bytes,3,req,name=target_app_id" json:"target_app_id,omitempty"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
}
|
||||
|
||||
func (m *CloneBlobRequest) Reset() { *m = CloneBlobRequest{} }
|
||||
func (m *CloneBlobRequest) String() string { return proto.CompactTextString(m) }
|
||||
func (*CloneBlobRequest) ProtoMessage() {}
|
||||
|
||||
func (m *CloneBlobRequest) GetBlobKey() []byte {
|
||||
if m != nil {
|
||||
return m.BlobKey
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *CloneBlobRequest) GetMimeType() []byte {
|
||||
if m != nil {
|
||||
return m.MimeType
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *CloneBlobRequest) GetTargetAppId() []byte {
|
||||
if m != nil {
|
||||
return m.TargetAppId
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type CloneBlobResponse struct {
|
||||
BlobKey []byte `protobuf:"bytes,1,req,name=blob_key" json:"blob_key,omitempty"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
}
|
||||
|
||||
func (m *CloneBlobResponse) Reset() { *m = CloneBlobResponse{} }
|
||||
func (m *CloneBlobResponse) String() string { return proto.CompactTextString(m) }
|
||||
func (*CloneBlobResponse) ProtoMessage() {}
|
||||
|
||||
func (m *CloneBlobResponse) GetBlobKey() []byte {
|
||||
if m != nil {
|
||||
return m.BlobKey
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type DecodeBlobKeyRequest struct {
|
||||
BlobKey []string `protobuf:"bytes,1,rep,name=blob_key" json:"blob_key,omitempty"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
}
|
||||
|
||||
func (m *DecodeBlobKeyRequest) Reset() { *m = DecodeBlobKeyRequest{} }
|
||||
func (m *DecodeBlobKeyRequest) String() string { return proto.CompactTextString(m) }
|
||||
func (*DecodeBlobKeyRequest) ProtoMessage() {}
|
||||
|
||||
func (m *DecodeBlobKeyRequest) GetBlobKey() []string {
|
||||
if m != nil {
|
||||
return m.BlobKey
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type DecodeBlobKeyResponse struct {
|
||||
Decoded []string `protobuf:"bytes,1,rep,name=decoded" json:"decoded,omitempty"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
}
|
||||
|
||||
func (m *DecodeBlobKeyResponse) Reset() { *m = DecodeBlobKeyResponse{} }
|
||||
func (m *DecodeBlobKeyResponse) String() string { return proto.CompactTextString(m) }
|
||||
func (*DecodeBlobKeyResponse) ProtoMessage() {}
|
||||
|
||||
func (m *DecodeBlobKeyResponse) GetDecoded() []string {
|
||||
if m != nil {
|
||||
return m.Decoded
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type CreateEncodedGoogleStorageKeyRequest struct {
|
||||
Filename *string `protobuf:"bytes,1,req,name=filename" json:"filename,omitempty"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
}
|
||||
|
||||
func (m *CreateEncodedGoogleStorageKeyRequest) Reset() { *m = CreateEncodedGoogleStorageKeyRequest{} }
|
||||
func (m *CreateEncodedGoogleStorageKeyRequest) String() string { return proto.CompactTextString(m) }
|
||||
func (*CreateEncodedGoogleStorageKeyRequest) ProtoMessage() {}
|
||||
|
||||
func (m *CreateEncodedGoogleStorageKeyRequest) GetFilename() string {
|
||||
if m != nil && m.Filename != nil {
|
||||
return *m.Filename
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type CreateEncodedGoogleStorageKeyResponse struct {
|
||||
BlobKey *string `protobuf:"bytes,1,req,name=blob_key" json:"blob_key,omitempty"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
}
|
||||
|
||||
func (m *CreateEncodedGoogleStorageKeyResponse) Reset() { *m = CreateEncodedGoogleStorageKeyResponse{} }
|
||||
func (m *CreateEncodedGoogleStorageKeyResponse) String() string { return proto.CompactTextString(m) }
|
||||
func (*CreateEncodedGoogleStorageKeyResponse) ProtoMessage() {}
|
||||
|
||||
func (m *CreateEncodedGoogleStorageKeyResponse) GetBlobKey() string {
|
||||
if m != nil && m.BlobKey != nil {
|
||||
return *m.BlobKey
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func init() {
|
||||
}
|
||||
+71
@@ -0,0 +1,71 @@
|
||||
syntax = "proto2";
|
||||
option go_package = "blobstore";
|
||||
|
||||
package appengine;
|
||||
|
||||
message BlobstoreServiceError {
|
||||
enum ErrorCode {
|
||||
OK = 0;
|
||||
INTERNAL_ERROR = 1;
|
||||
URL_TOO_LONG = 2;
|
||||
PERMISSION_DENIED = 3;
|
||||
BLOB_NOT_FOUND = 4;
|
||||
DATA_INDEX_OUT_OF_RANGE = 5;
|
||||
BLOB_FETCH_SIZE_TOO_LARGE = 6;
|
||||
ARGUMENT_OUT_OF_RANGE = 8;
|
||||
INVALID_BLOB_KEY = 9;
|
||||
}
|
||||
}
|
||||
|
||||
message CreateUploadURLRequest {
|
||||
required string success_path = 1;
|
||||
optional int64 max_upload_size_bytes = 2;
|
||||
optional int64 max_upload_size_per_blob_bytes = 3;
|
||||
optional string gs_bucket_name = 4;
|
||||
optional int32 url_expiry_time_seconds = 5;
|
||||
}
|
||||
|
||||
message CreateUploadURLResponse {
|
||||
required string url = 1;
|
||||
}
|
||||
|
||||
message DeleteBlobRequest {
|
||||
repeated string blob_key = 1;
|
||||
optional string token = 2;
|
||||
}
|
||||
|
||||
message FetchDataRequest {
|
||||
required string blob_key = 1;
|
||||
required int64 start_index = 2;
|
||||
required int64 end_index = 3;
|
||||
}
|
||||
|
||||
message FetchDataResponse {
|
||||
required bytes data = 1000 [ctype = CORD];
|
||||
}
|
||||
|
||||
message CloneBlobRequest {
|
||||
required bytes blob_key = 1;
|
||||
required bytes mime_type = 2;
|
||||
required bytes target_app_id = 3;
|
||||
}
|
||||
|
||||
message CloneBlobResponse {
|
||||
required bytes blob_key = 1;
|
||||
}
|
||||
|
||||
message DecodeBlobKeyRequest {
|
||||
repeated string blob_key = 1;
|
||||
}
|
||||
|
||||
message DecodeBlobKeyResponse {
|
||||
repeated string decoded = 1;
|
||||
}
|
||||
|
||||
message CreateEncodedGoogleStorageKeyRequest {
|
||||
required string filename = 1;
|
||||
}
|
||||
|
||||
message CreateEncodedGoogleStorageKeyResponse {
|
||||
required string blob_key = 1;
|
||||
}
|
||||
+125
@@ -0,0 +1,125 @@
|
||||
// Code generated by protoc-gen-go.
|
||||
// source: google.golang.org/appengine/internal/capability/capability_service.proto
|
||||
// DO NOT EDIT!
|
||||
|
||||
/*
|
||||
Package capability is a generated protocol buffer package.
|
||||
|
||||
It is generated from these files:
|
||||
google.golang.org/appengine/internal/capability/capability_service.proto
|
||||
|
||||
It has these top-level messages:
|
||||
IsEnabledRequest
|
||||
IsEnabledResponse
|
||||
*/
|
||||
package capability
|
||||
|
||||
import proto "github.com/golang/protobuf/proto"
|
||||
import fmt "fmt"
|
||||
import math "math"
|
||||
|
||||
// Reference imports to suppress errors if they are not otherwise used.
|
||||
var _ = proto.Marshal
|
||||
var _ = fmt.Errorf
|
||||
var _ = math.Inf
|
||||
|
||||
type IsEnabledResponse_SummaryStatus int32
|
||||
|
||||
const (
|
||||
IsEnabledResponse_DEFAULT IsEnabledResponse_SummaryStatus = 0
|
||||
IsEnabledResponse_ENABLED IsEnabledResponse_SummaryStatus = 1
|
||||
IsEnabledResponse_SCHEDULED_FUTURE IsEnabledResponse_SummaryStatus = 2
|
||||
IsEnabledResponse_SCHEDULED_NOW IsEnabledResponse_SummaryStatus = 3
|
||||
IsEnabledResponse_DISABLED IsEnabledResponse_SummaryStatus = 4
|
||||
IsEnabledResponse_UNKNOWN IsEnabledResponse_SummaryStatus = 5
|
||||
)
|
||||
|
||||
var IsEnabledResponse_SummaryStatus_name = map[int32]string{
|
||||
0: "DEFAULT",
|
||||
1: "ENABLED",
|
||||
2: "SCHEDULED_FUTURE",
|
||||
3: "SCHEDULED_NOW",
|
||||
4: "DISABLED",
|
||||
5: "UNKNOWN",
|
||||
}
|
||||
var IsEnabledResponse_SummaryStatus_value = map[string]int32{
|
||||
"DEFAULT": 0,
|
||||
"ENABLED": 1,
|
||||
"SCHEDULED_FUTURE": 2,
|
||||
"SCHEDULED_NOW": 3,
|
||||
"DISABLED": 4,
|
||||
"UNKNOWN": 5,
|
||||
}
|
||||
|
||||
func (x IsEnabledResponse_SummaryStatus) Enum() *IsEnabledResponse_SummaryStatus {
|
||||
p := new(IsEnabledResponse_SummaryStatus)
|
||||
*p = x
|
||||
return p
|
||||
}
|
||||
func (x IsEnabledResponse_SummaryStatus) String() string {
|
||||
return proto.EnumName(IsEnabledResponse_SummaryStatus_name, int32(x))
|
||||
}
|
||||
func (x *IsEnabledResponse_SummaryStatus) UnmarshalJSON(data []byte) error {
|
||||
value, err := proto.UnmarshalJSONEnum(IsEnabledResponse_SummaryStatus_value, data, "IsEnabledResponse_SummaryStatus")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
*x = IsEnabledResponse_SummaryStatus(value)
|
||||
return nil
|
||||
}
|
||||
|
||||
type IsEnabledRequest struct {
|
||||
Package *string `protobuf:"bytes,1,req,name=package" json:"package,omitempty"`
|
||||
Capability []string `protobuf:"bytes,2,rep,name=capability" json:"capability,omitempty"`
|
||||
Call []string `protobuf:"bytes,3,rep,name=call" json:"call,omitempty"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
}
|
||||
|
||||
func (m *IsEnabledRequest) Reset() { *m = IsEnabledRequest{} }
|
||||
func (m *IsEnabledRequest) String() string { return proto.CompactTextString(m) }
|
||||
func (*IsEnabledRequest) ProtoMessage() {}
|
||||
|
||||
func (m *IsEnabledRequest) GetPackage() string {
|
||||
if m != nil && m.Package != nil {
|
||||
return *m.Package
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *IsEnabledRequest) GetCapability() []string {
|
||||
if m != nil {
|
||||
return m.Capability
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *IsEnabledRequest) GetCall() []string {
|
||||
if m != nil {
|
||||
return m.Call
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type IsEnabledResponse struct {
|
||||
SummaryStatus *IsEnabledResponse_SummaryStatus `protobuf:"varint,1,opt,name=summary_status,enum=appengine.IsEnabledResponse_SummaryStatus" json:"summary_status,omitempty"`
|
||||
TimeUntilScheduled *int64 `protobuf:"varint,2,opt,name=time_until_scheduled" json:"time_until_scheduled,omitempty"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
}
|
||||
|
||||
func (m *IsEnabledResponse) Reset() { *m = IsEnabledResponse{} }
|
||||
func (m *IsEnabledResponse) String() string { return proto.CompactTextString(m) }
|
||||
func (*IsEnabledResponse) ProtoMessage() {}
|
||||
|
||||
func (m *IsEnabledResponse) GetSummaryStatus() IsEnabledResponse_SummaryStatus {
|
||||
if m != nil && m.SummaryStatus != nil {
|
||||
return *m.SummaryStatus
|
||||
}
|
||||
return IsEnabledResponse_DEFAULT
|
||||
}
|
||||
|
||||
func (m *IsEnabledResponse) GetTimeUntilScheduled() int64 {
|
||||
if m != nil && m.TimeUntilScheduled != nil {
|
||||
return *m.TimeUntilScheduled
|
||||
}
|
||||
return 0
|
||||
}
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
syntax = "proto2";
|
||||
option go_package = "capability";
|
||||
|
||||
package appengine;
|
||||
|
||||
message IsEnabledRequest {
|
||||
required string package = 1;
|
||||
repeated string capability = 2;
|
||||
repeated string call = 3;
|
||||
}
|
||||
|
||||
message IsEnabledResponse {
|
||||
enum SummaryStatus {
|
||||
DEFAULT = 0;
|
||||
ENABLED = 1;
|
||||
SCHEDULED_FUTURE = 2;
|
||||
SCHEDULED_NOW = 3;
|
||||
DISABLED = 4;
|
||||
UNKNOWN = 5;
|
||||
}
|
||||
optional SummaryStatus summary_status = 1;
|
||||
|
||||
optional int64 time_until_scheduled = 2;
|
||||
}
|
||||
|
||||
service CapabilityService {
|
||||
rpc IsEnabled(IsEnabledRequest) returns (IsEnabledResponse) {};
|
||||
}
|
||||
+154
@@ -0,0 +1,154 @@
|
||||
// Code generated by protoc-gen-go.
|
||||
// source: google.golang.org/appengine/internal/channel/channel_service.proto
|
||||
// DO NOT EDIT!
|
||||
|
||||
/*
|
||||
Package channel is a generated protocol buffer package.
|
||||
|
||||
It is generated from these files:
|
||||
google.golang.org/appengine/internal/channel/channel_service.proto
|
||||
|
||||
It has these top-level messages:
|
||||
ChannelServiceError
|
||||
CreateChannelRequest
|
||||
CreateChannelResponse
|
||||
SendMessageRequest
|
||||
*/
|
||||
package channel
|
||||
|
||||
import proto "github.com/golang/protobuf/proto"
|
||||
import fmt "fmt"
|
||||
import math "math"
|
||||
|
||||
// Reference imports to suppress errors if they are not otherwise used.
|
||||
var _ = proto.Marshal
|
||||
var _ = fmt.Errorf
|
||||
var _ = math.Inf
|
||||
|
||||
type ChannelServiceError_ErrorCode int32
|
||||
|
||||
const (
|
||||
ChannelServiceError_OK ChannelServiceError_ErrorCode = 0
|
||||
ChannelServiceError_INTERNAL_ERROR ChannelServiceError_ErrorCode = 1
|
||||
ChannelServiceError_INVALID_CHANNEL_KEY ChannelServiceError_ErrorCode = 2
|
||||
ChannelServiceError_BAD_MESSAGE ChannelServiceError_ErrorCode = 3
|
||||
ChannelServiceError_INVALID_CHANNEL_TOKEN_DURATION ChannelServiceError_ErrorCode = 4
|
||||
ChannelServiceError_APPID_ALIAS_REQUIRED ChannelServiceError_ErrorCode = 5
|
||||
)
|
||||
|
||||
var ChannelServiceError_ErrorCode_name = map[int32]string{
|
||||
0: "OK",
|
||||
1: "INTERNAL_ERROR",
|
||||
2: "INVALID_CHANNEL_KEY",
|
||||
3: "BAD_MESSAGE",
|
||||
4: "INVALID_CHANNEL_TOKEN_DURATION",
|
||||
5: "APPID_ALIAS_REQUIRED",
|
||||
}
|
||||
var ChannelServiceError_ErrorCode_value = map[string]int32{
|
||||
"OK": 0,
|
||||
"INTERNAL_ERROR": 1,
|
||||
"INVALID_CHANNEL_KEY": 2,
|
||||
"BAD_MESSAGE": 3,
|
||||
"INVALID_CHANNEL_TOKEN_DURATION": 4,
|
||||
"APPID_ALIAS_REQUIRED": 5,
|
||||
}
|
||||
|
||||
func (x ChannelServiceError_ErrorCode) Enum() *ChannelServiceError_ErrorCode {
|
||||
p := new(ChannelServiceError_ErrorCode)
|
||||
*p = x
|
||||
return p
|
||||
}
|
||||
func (x ChannelServiceError_ErrorCode) String() string {
|
||||
return proto.EnumName(ChannelServiceError_ErrorCode_name, int32(x))
|
||||
}
|
||||
func (x *ChannelServiceError_ErrorCode) UnmarshalJSON(data []byte) error {
|
||||
value, err := proto.UnmarshalJSONEnum(ChannelServiceError_ErrorCode_value, data, "ChannelServiceError_ErrorCode")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
*x = ChannelServiceError_ErrorCode(value)
|
||||
return nil
|
||||
}
|
||||
|
||||
type ChannelServiceError struct {
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
}
|
||||
|
||||
func (m *ChannelServiceError) Reset() { *m = ChannelServiceError{} }
|
||||
func (m *ChannelServiceError) String() string { return proto.CompactTextString(m) }
|
||||
func (*ChannelServiceError) ProtoMessage() {}
|
||||
|
||||
type CreateChannelRequest struct {
|
||||
ApplicationKey *string `protobuf:"bytes,1,req,name=application_key" json:"application_key,omitempty"`
|
||||
DurationMinutes *int32 `protobuf:"varint,2,opt,name=duration_minutes" json:"duration_minutes,omitempty"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
}
|
||||
|
||||
func (m *CreateChannelRequest) Reset() { *m = CreateChannelRequest{} }
|
||||
func (m *CreateChannelRequest) String() string { return proto.CompactTextString(m) }
|
||||
func (*CreateChannelRequest) ProtoMessage() {}
|
||||
|
||||
func (m *CreateChannelRequest) GetApplicationKey() string {
|
||||
if m != nil && m.ApplicationKey != nil {
|
||||
return *m.ApplicationKey
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *CreateChannelRequest) GetDurationMinutes() int32 {
|
||||
if m != nil && m.DurationMinutes != nil {
|
||||
return *m.DurationMinutes
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
type CreateChannelResponse struct {
|
||||
Token *string `protobuf:"bytes,2,opt,name=token" json:"token,omitempty"`
|
||||
DurationMinutes *int32 `protobuf:"varint,3,opt,name=duration_minutes" json:"duration_minutes,omitempty"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
}
|
||||
|
||||
func (m *CreateChannelResponse) Reset() { *m = CreateChannelResponse{} }
|
||||
func (m *CreateChannelResponse) String() string { return proto.CompactTextString(m) }
|
||||
func (*CreateChannelResponse) ProtoMessage() {}
|
||||
|
||||
func (m *CreateChannelResponse) GetToken() string {
|
||||
if m != nil && m.Token != nil {
|
||||
return *m.Token
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *CreateChannelResponse) GetDurationMinutes() int32 {
|
||||
if m != nil && m.DurationMinutes != nil {
|
||||
return *m.DurationMinutes
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
type SendMessageRequest struct {
|
||||
ApplicationKey *string `protobuf:"bytes,1,req,name=application_key" json:"application_key,omitempty"`
|
||||
Message *string `protobuf:"bytes,2,req,name=message" json:"message,omitempty"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
}
|
||||
|
||||
func (m *SendMessageRequest) Reset() { *m = SendMessageRequest{} }
|
||||
func (m *SendMessageRequest) String() string { return proto.CompactTextString(m) }
|
||||
func (*SendMessageRequest) ProtoMessage() {}
|
||||
|
||||
func (m *SendMessageRequest) GetApplicationKey() string {
|
||||
if m != nil && m.ApplicationKey != nil {
|
||||
return *m.ApplicationKey
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *SendMessageRequest) GetMessage() string {
|
||||
if m != nil && m.Message != nil {
|
||||
return *m.Message
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func init() {
|
||||
}
|
||||
+30
@@ -0,0 +1,30 @@
|
||||
syntax = "proto2";
|
||||
option go_package = "channel";
|
||||
|
||||
package appengine;
|
||||
|
||||
message ChannelServiceError {
|
||||
enum ErrorCode {
|
||||
OK = 0;
|
||||
INTERNAL_ERROR = 1;
|
||||
INVALID_CHANNEL_KEY = 2;
|
||||
BAD_MESSAGE = 3;
|
||||
INVALID_CHANNEL_TOKEN_DURATION = 4;
|
||||
APPID_ALIAS_REQUIRED = 5;
|
||||
}
|
||||
}
|
||||
|
||||
message CreateChannelRequest {
|
||||
required string application_key = 1;
|
||||
optional int32 duration_minutes = 2;
|
||||
}
|
||||
|
||||
message CreateChannelResponse {
|
||||
optional string token = 2;
|
||||
optional int32 duration_minutes = 3;
|
||||
}
|
||||
|
||||
message SendMessageRequest {
|
||||
required string application_key = 1;
|
||||
required string message = 2;
|
||||
}
|
||||
+845
@@ -0,0 +1,845 @@
|
||||
// Code generated by protoc-gen-go.
|
||||
// source: google.golang.org/appengine/internal/image/images_service.proto
|
||||
// DO NOT EDIT!
|
||||
|
||||
/*
|
||||
Package image is a generated protocol buffer package.
|
||||
|
||||
It is generated from these files:
|
||||
google.golang.org/appengine/internal/image/images_service.proto
|
||||
|
||||
It has these top-level messages:
|
||||
ImagesServiceError
|
||||
ImagesServiceTransform
|
||||
Transform
|
||||
ImageData
|
||||
InputSettings
|
||||
OutputSettings
|
||||
ImagesTransformRequest
|
||||
ImagesTransformResponse
|
||||
CompositeImageOptions
|
||||
ImagesCanvas
|
||||
ImagesCompositeRequest
|
||||
ImagesCompositeResponse
|
||||
ImagesHistogramRequest
|
||||
ImagesHistogram
|
||||
ImagesHistogramResponse
|
||||
ImagesGetUrlBaseRequest
|
||||
ImagesGetUrlBaseResponse
|
||||
ImagesDeleteUrlBaseRequest
|
||||
ImagesDeleteUrlBaseResponse
|
||||
*/
|
||||
package image
|
||||
|
||||
import proto "github.com/golang/protobuf/proto"
|
||||
import fmt "fmt"
|
||||
import math "math"
|
||||
|
||||
// Reference imports to suppress errors if they are not otherwise used.
|
||||
var _ = proto.Marshal
|
||||
var _ = fmt.Errorf
|
||||
var _ = math.Inf
|
||||
|
||||
type ImagesServiceError_ErrorCode int32
|
||||
|
||||
const (
|
||||
ImagesServiceError_UNSPECIFIED_ERROR ImagesServiceError_ErrorCode = 1
|
||||
ImagesServiceError_BAD_TRANSFORM_DATA ImagesServiceError_ErrorCode = 2
|
||||
ImagesServiceError_NOT_IMAGE ImagesServiceError_ErrorCode = 3
|
||||
ImagesServiceError_BAD_IMAGE_DATA ImagesServiceError_ErrorCode = 4
|
||||
ImagesServiceError_IMAGE_TOO_LARGE ImagesServiceError_ErrorCode = 5
|
||||
ImagesServiceError_INVALID_BLOB_KEY ImagesServiceError_ErrorCode = 6
|
||||
ImagesServiceError_ACCESS_DENIED ImagesServiceError_ErrorCode = 7
|
||||
ImagesServiceError_OBJECT_NOT_FOUND ImagesServiceError_ErrorCode = 8
|
||||
)
|
||||
|
||||
var ImagesServiceError_ErrorCode_name = map[int32]string{
|
||||
1: "UNSPECIFIED_ERROR",
|
||||
2: "BAD_TRANSFORM_DATA",
|
||||
3: "NOT_IMAGE",
|
||||
4: "BAD_IMAGE_DATA",
|
||||
5: "IMAGE_TOO_LARGE",
|
||||
6: "INVALID_BLOB_KEY",
|
||||
7: "ACCESS_DENIED",
|
||||
8: "OBJECT_NOT_FOUND",
|
||||
}
|
||||
var ImagesServiceError_ErrorCode_value = map[string]int32{
|
||||
"UNSPECIFIED_ERROR": 1,
|
||||
"BAD_TRANSFORM_DATA": 2,
|
||||
"NOT_IMAGE": 3,
|
||||
"BAD_IMAGE_DATA": 4,
|
||||
"IMAGE_TOO_LARGE": 5,
|
||||
"INVALID_BLOB_KEY": 6,
|
||||
"ACCESS_DENIED": 7,
|
||||
"OBJECT_NOT_FOUND": 8,
|
||||
}
|
||||
|
||||
func (x ImagesServiceError_ErrorCode) Enum() *ImagesServiceError_ErrorCode {
|
||||
p := new(ImagesServiceError_ErrorCode)
|
||||
*p = x
|
||||
return p
|
||||
}
|
||||
func (x ImagesServiceError_ErrorCode) String() string {
|
||||
return proto.EnumName(ImagesServiceError_ErrorCode_name, int32(x))
|
||||
}
|
||||
func (x *ImagesServiceError_ErrorCode) UnmarshalJSON(data []byte) error {
|
||||
value, err := proto.UnmarshalJSONEnum(ImagesServiceError_ErrorCode_value, data, "ImagesServiceError_ErrorCode")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
*x = ImagesServiceError_ErrorCode(value)
|
||||
return nil
|
||||
}
|
||||
|
||||
type ImagesServiceTransform_Type int32
|
||||
|
||||
const (
|
||||
ImagesServiceTransform_RESIZE ImagesServiceTransform_Type = 1
|
||||
ImagesServiceTransform_ROTATE ImagesServiceTransform_Type = 2
|
||||
ImagesServiceTransform_HORIZONTAL_FLIP ImagesServiceTransform_Type = 3
|
||||
ImagesServiceTransform_VERTICAL_FLIP ImagesServiceTransform_Type = 4
|
||||
ImagesServiceTransform_CROP ImagesServiceTransform_Type = 5
|
||||
ImagesServiceTransform_IM_FEELING_LUCKY ImagesServiceTransform_Type = 6
|
||||
)
|
||||
|
||||
var ImagesServiceTransform_Type_name = map[int32]string{
|
||||
1: "RESIZE",
|
||||
2: "ROTATE",
|
||||
3: "HORIZONTAL_FLIP",
|
||||
4: "VERTICAL_FLIP",
|
||||
5: "CROP",
|
||||
6: "IM_FEELING_LUCKY",
|
||||
}
|
||||
var ImagesServiceTransform_Type_value = map[string]int32{
|
||||
"RESIZE": 1,
|
||||
"ROTATE": 2,
|
||||
"HORIZONTAL_FLIP": 3,
|
||||
"VERTICAL_FLIP": 4,
|
||||
"CROP": 5,
|
||||
"IM_FEELING_LUCKY": 6,
|
||||
}
|
||||
|
||||
func (x ImagesServiceTransform_Type) Enum() *ImagesServiceTransform_Type {
|
||||
p := new(ImagesServiceTransform_Type)
|
||||
*p = x
|
||||
return p
|
||||
}
|
||||
func (x ImagesServiceTransform_Type) String() string {
|
||||
return proto.EnumName(ImagesServiceTransform_Type_name, int32(x))
|
||||
}
|
||||
func (x *ImagesServiceTransform_Type) UnmarshalJSON(data []byte) error {
|
||||
value, err := proto.UnmarshalJSONEnum(ImagesServiceTransform_Type_value, data, "ImagesServiceTransform_Type")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
*x = ImagesServiceTransform_Type(value)
|
||||
return nil
|
||||
}
|
||||
|
||||
type InputSettings_ORIENTATION_CORRECTION_TYPE int32
|
||||
|
||||
const (
|
||||
InputSettings_UNCHANGED_ORIENTATION InputSettings_ORIENTATION_CORRECTION_TYPE = 0
|
||||
InputSettings_CORRECT_ORIENTATION InputSettings_ORIENTATION_CORRECTION_TYPE = 1
|
||||
)
|
||||
|
||||
var InputSettings_ORIENTATION_CORRECTION_TYPE_name = map[int32]string{
|
||||
0: "UNCHANGED_ORIENTATION",
|
||||
1: "CORRECT_ORIENTATION",
|
||||
}
|
||||
var InputSettings_ORIENTATION_CORRECTION_TYPE_value = map[string]int32{
|
||||
"UNCHANGED_ORIENTATION": 0,
|
||||
"CORRECT_ORIENTATION": 1,
|
||||
}
|
||||
|
||||
func (x InputSettings_ORIENTATION_CORRECTION_TYPE) Enum() *InputSettings_ORIENTATION_CORRECTION_TYPE {
|
||||
p := new(InputSettings_ORIENTATION_CORRECTION_TYPE)
|
||||
*p = x
|
||||
return p
|
||||
}
|
||||
func (x InputSettings_ORIENTATION_CORRECTION_TYPE) String() string {
|
||||
return proto.EnumName(InputSettings_ORIENTATION_CORRECTION_TYPE_name, int32(x))
|
||||
}
|
||||
func (x *InputSettings_ORIENTATION_CORRECTION_TYPE) UnmarshalJSON(data []byte) error {
|
||||
value, err := proto.UnmarshalJSONEnum(InputSettings_ORIENTATION_CORRECTION_TYPE_value, data, "InputSettings_ORIENTATION_CORRECTION_TYPE")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
*x = InputSettings_ORIENTATION_CORRECTION_TYPE(value)
|
||||
return nil
|
||||
}
|
||||
|
||||
type OutputSettings_MIME_TYPE int32
|
||||
|
||||
const (
|
||||
OutputSettings_PNG OutputSettings_MIME_TYPE = 0
|
||||
OutputSettings_JPEG OutputSettings_MIME_TYPE = 1
|
||||
OutputSettings_WEBP OutputSettings_MIME_TYPE = 2
|
||||
)
|
||||
|
||||
var OutputSettings_MIME_TYPE_name = map[int32]string{
|
||||
0: "PNG",
|
||||
1: "JPEG",
|
||||
2: "WEBP",
|
||||
}
|
||||
var OutputSettings_MIME_TYPE_value = map[string]int32{
|
||||
"PNG": 0,
|
||||
"JPEG": 1,
|
||||
"WEBP": 2,
|
||||
}
|
||||
|
||||
func (x OutputSettings_MIME_TYPE) Enum() *OutputSettings_MIME_TYPE {
|
||||
p := new(OutputSettings_MIME_TYPE)
|
||||
*p = x
|
||||
return p
|
||||
}
|
||||
func (x OutputSettings_MIME_TYPE) String() string {
|
||||
return proto.EnumName(OutputSettings_MIME_TYPE_name, int32(x))
|
||||
}
|
||||
func (x *OutputSettings_MIME_TYPE) UnmarshalJSON(data []byte) error {
|
||||
value, err := proto.UnmarshalJSONEnum(OutputSettings_MIME_TYPE_value, data, "OutputSettings_MIME_TYPE")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
*x = OutputSettings_MIME_TYPE(value)
|
||||
return nil
|
||||
}
|
||||
|
||||
type CompositeImageOptions_ANCHOR int32
|
||||
|
||||
const (
|
||||
CompositeImageOptions_TOP_LEFT CompositeImageOptions_ANCHOR = 0
|
||||
CompositeImageOptions_TOP CompositeImageOptions_ANCHOR = 1
|
||||
CompositeImageOptions_TOP_RIGHT CompositeImageOptions_ANCHOR = 2
|
||||
CompositeImageOptions_LEFT CompositeImageOptions_ANCHOR = 3
|
||||
CompositeImageOptions_CENTER CompositeImageOptions_ANCHOR = 4
|
||||
CompositeImageOptions_RIGHT CompositeImageOptions_ANCHOR = 5
|
||||
CompositeImageOptions_BOTTOM_LEFT CompositeImageOptions_ANCHOR = 6
|
||||
CompositeImageOptions_BOTTOM CompositeImageOptions_ANCHOR = 7
|
||||
CompositeImageOptions_BOTTOM_RIGHT CompositeImageOptions_ANCHOR = 8
|
||||
)
|
||||
|
||||
var CompositeImageOptions_ANCHOR_name = map[int32]string{
|
||||
0: "TOP_LEFT",
|
||||
1: "TOP",
|
||||
2: "TOP_RIGHT",
|
||||
3: "LEFT",
|
||||
4: "CENTER",
|
||||
5: "RIGHT",
|
||||
6: "BOTTOM_LEFT",
|
||||
7: "BOTTOM",
|
||||
8: "BOTTOM_RIGHT",
|
||||
}
|
||||
var CompositeImageOptions_ANCHOR_value = map[string]int32{
|
||||
"TOP_LEFT": 0,
|
||||
"TOP": 1,
|
||||
"TOP_RIGHT": 2,
|
||||
"LEFT": 3,
|
||||
"CENTER": 4,
|
||||
"RIGHT": 5,
|
||||
"BOTTOM_LEFT": 6,
|
||||
"BOTTOM": 7,
|
||||
"BOTTOM_RIGHT": 8,
|
||||
}
|
||||
|
||||
func (x CompositeImageOptions_ANCHOR) Enum() *CompositeImageOptions_ANCHOR {
|
||||
p := new(CompositeImageOptions_ANCHOR)
|
||||
*p = x
|
||||
return p
|
||||
}
|
||||
func (x CompositeImageOptions_ANCHOR) String() string {
|
||||
return proto.EnumName(CompositeImageOptions_ANCHOR_name, int32(x))
|
||||
}
|
||||
func (x *CompositeImageOptions_ANCHOR) UnmarshalJSON(data []byte) error {
|
||||
value, err := proto.UnmarshalJSONEnum(CompositeImageOptions_ANCHOR_value, data, "CompositeImageOptions_ANCHOR")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
*x = CompositeImageOptions_ANCHOR(value)
|
||||
return nil
|
||||
}
|
||||
|
||||
type ImagesServiceError struct {
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
}
|
||||
|
||||
func (m *ImagesServiceError) Reset() { *m = ImagesServiceError{} }
|
||||
func (m *ImagesServiceError) String() string { return proto.CompactTextString(m) }
|
||||
func (*ImagesServiceError) ProtoMessage() {}
|
||||
|
||||
type ImagesServiceTransform struct {
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
}
|
||||
|
||||
func (m *ImagesServiceTransform) Reset() { *m = ImagesServiceTransform{} }
|
||||
func (m *ImagesServiceTransform) String() string { return proto.CompactTextString(m) }
|
||||
func (*ImagesServiceTransform) ProtoMessage() {}
|
||||
|
||||
type Transform struct {
|
||||
Width *int32 `protobuf:"varint,1,opt,name=width" json:"width,omitempty"`
|
||||
Height *int32 `protobuf:"varint,2,opt,name=height" json:"height,omitempty"`
|
||||
CropToFit *bool `protobuf:"varint,11,opt,name=crop_to_fit,def=0" json:"crop_to_fit,omitempty"`
|
||||
CropOffsetX *float32 `protobuf:"fixed32,12,opt,name=crop_offset_x,def=0.5" json:"crop_offset_x,omitempty"`
|
||||
CropOffsetY *float32 `protobuf:"fixed32,13,opt,name=crop_offset_y,def=0.5" json:"crop_offset_y,omitempty"`
|
||||
Rotate *int32 `protobuf:"varint,3,opt,name=rotate,def=0" json:"rotate,omitempty"`
|
||||
HorizontalFlip *bool `protobuf:"varint,4,opt,name=horizontal_flip,def=0" json:"horizontal_flip,omitempty"`
|
||||
VerticalFlip *bool `protobuf:"varint,5,opt,name=vertical_flip,def=0" json:"vertical_flip,omitempty"`
|
||||
CropLeftX *float32 `protobuf:"fixed32,6,opt,name=crop_left_x,def=0" json:"crop_left_x,omitempty"`
|
||||
CropTopY *float32 `protobuf:"fixed32,7,opt,name=crop_top_y,def=0" json:"crop_top_y,omitempty"`
|
||||
CropRightX *float32 `protobuf:"fixed32,8,opt,name=crop_right_x,def=1" json:"crop_right_x,omitempty"`
|
||||
CropBottomY *float32 `protobuf:"fixed32,9,opt,name=crop_bottom_y,def=1" json:"crop_bottom_y,omitempty"`
|
||||
Autolevels *bool `protobuf:"varint,10,opt,name=autolevels,def=0" json:"autolevels,omitempty"`
|
||||
AllowStretch *bool `protobuf:"varint,14,opt,name=allow_stretch,def=0" json:"allow_stretch,omitempty"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
}
|
||||
|
||||
func (m *Transform) Reset() { *m = Transform{} }
|
||||
func (m *Transform) String() string { return proto.CompactTextString(m) }
|
||||
func (*Transform) ProtoMessage() {}
|
||||
|
||||
const Default_Transform_CropToFit bool = false
|
||||
const Default_Transform_CropOffsetX float32 = 0.5
|
||||
const Default_Transform_CropOffsetY float32 = 0.5
|
||||
const Default_Transform_Rotate int32 = 0
|
||||
const Default_Transform_HorizontalFlip bool = false
|
||||
const Default_Transform_VerticalFlip bool = false
|
||||
const Default_Transform_CropLeftX float32 = 0
|
||||
const Default_Transform_CropTopY float32 = 0
|
||||
const Default_Transform_CropRightX float32 = 1
|
||||
const Default_Transform_CropBottomY float32 = 1
|
||||
const Default_Transform_Autolevels bool = false
|
||||
const Default_Transform_AllowStretch bool = false
|
||||
|
||||
func (m *Transform) GetWidth() int32 {
|
||||
if m != nil && m.Width != nil {
|
||||
return *m.Width
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (m *Transform) GetHeight() int32 {
|
||||
if m != nil && m.Height != nil {
|
||||
return *m.Height
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (m *Transform) GetCropToFit() bool {
|
||||
if m != nil && m.CropToFit != nil {
|
||||
return *m.CropToFit
|
||||
}
|
||||
return Default_Transform_CropToFit
|
||||
}
|
||||
|
||||
func (m *Transform) GetCropOffsetX() float32 {
|
||||
if m != nil && m.CropOffsetX != nil {
|
||||
return *m.CropOffsetX
|
||||
}
|
||||
return Default_Transform_CropOffsetX
|
||||
}
|
||||
|
||||
func (m *Transform) GetCropOffsetY() float32 {
|
||||
if m != nil && m.CropOffsetY != nil {
|
||||
return *m.CropOffsetY
|
||||
}
|
||||
return Default_Transform_CropOffsetY
|
||||
}
|
||||
|
||||
func (m *Transform) GetRotate() int32 {
|
||||
if m != nil && m.Rotate != nil {
|
||||
return *m.Rotate
|
||||
}
|
||||
return Default_Transform_Rotate
|
||||
}
|
||||
|
||||
func (m *Transform) GetHorizontalFlip() bool {
|
||||
if m != nil && m.HorizontalFlip != nil {
|
||||
return *m.HorizontalFlip
|
||||
}
|
||||
return Default_Transform_HorizontalFlip
|
||||
}
|
||||
|
||||
func (m *Transform) GetVerticalFlip() bool {
|
||||
if m != nil && m.VerticalFlip != nil {
|
||||
return *m.VerticalFlip
|
||||
}
|
||||
return Default_Transform_VerticalFlip
|
||||
}
|
||||
|
||||
func (m *Transform) GetCropLeftX() float32 {
|
||||
if m != nil && m.CropLeftX != nil {
|
||||
return *m.CropLeftX
|
||||
}
|
||||
return Default_Transform_CropLeftX
|
||||
}
|
||||
|
||||
func (m *Transform) GetCropTopY() float32 {
|
||||
if m != nil && m.CropTopY != nil {
|
||||
return *m.CropTopY
|
||||
}
|
||||
return Default_Transform_CropTopY
|
||||
}
|
||||
|
||||
func (m *Transform) GetCropRightX() float32 {
|
||||
if m != nil && m.CropRightX != nil {
|
||||
return *m.CropRightX
|
||||
}
|
||||
return Default_Transform_CropRightX
|
||||
}
|
||||
|
||||
func (m *Transform) GetCropBottomY() float32 {
|
||||
if m != nil && m.CropBottomY != nil {
|
||||
return *m.CropBottomY
|
||||
}
|
||||
return Default_Transform_CropBottomY
|
||||
}
|
||||
|
||||
func (m *Transform) GetAutolevels() bool {
|
||||
if m != nil && m.Autolevels != nil {
|
||||
return *m.Autolevels
|
||||
}
|
||||
return Default_Transform_Autolevels
|
||||
}
|
||||
|
||||
func (m *Transform) GetAllowStretch() bool {
|
||||
if m != nil && m.AllowStretch != nil {
|
||||
return *m.AllowStretch
|
||||
}
|
||||
return Default_Transform_AllowStretch
|
||||
}
|
||||
|
||||
type ImageData struct {
|
||||
Content []byte `protobuf:"bytes,1,req,name=content" json:"content,omitempty"`
|
||||
BlobKey *string `protobuf:"bytes,2,opt,name=blob_key" json:"blob_key,omitempty"`
|
||||
Width *int32 `protobuf:"varint,3,opt,name=width" json:"width,omitempty"`
|
||||
Height *int32 `protobuf:"varint,4,opt,name=height" json:"height,omitempty"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
}
|
||||
|
||||
func (m *ImageData) Reset() { *m = ImageData{} }
|
||||
func (m *ImageData) String() string { return proto.CompactTextString(m) }
|
||||
func (*ImageData) ProtoMessage() {}
|
||||
|
||||
func (m *ImageData) GetContent() []byte {
|
||||
if m != nil {
|
||||
return m.Content
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *ImageData) GetBlobKey() string {
|
||||
if m != nil && m.BlobKey != nil {
|
||||
return *m.BlobKey
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *ImageData) GetWidth() int32 {
|
||||
if m != nil && m.Width != nil {
|
||||
return *m.Width
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (m *ImageData) GetHeight() int32 {
|
||||
if m != nil && m.Height != nil {
|
||||
return *m.Height
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
type InputSettings struct {
|
||||
CorrectExifOrientation *InputSettings_ORIENTATION_CORRECTION_TYPE `protobuf:"varint,1,opt,name=correct_exif_orientation,enum=appengine.InputSettings_ORIENTATION_CORRECTION_TYPE,def=0" json:"correct_exif_orientation,omitempty"`
|
||||
ParseMetadata *bool `protobuf:"varint,2,opt,name=parse_metadata,def=0" json:"parse_metadata,omitempty"`
|
||||
TransparentSubstitutionRgb *int32 `protobuf:"varint,3,opt,name=transparent_substitution_rgb" json:"transparent_substitution_rgb,omitempty"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
}
|
||||
|
||||
func (m *InputSettings) Reset() { *m = InputSettings{} }
|
||||
func (m *InputSettings) String() string { return proto.CompactTextString(m) }
|
||||
func (*InputSettings) ProtoMessage() {}
|
||||
|
||||
const Default_InputSettings_CorrectExifOrientation InputSettings_ORIENTATION_CORRECTION_TYPE = InputSettings_UNCHANGED_ORIENTATION
|
||||
const Default_InputSettings_ParseMetadata bool = false
|
||||
|
||||
func (m *InputSettings) GetCorrectExifOrientation() InputSettings_ORIENTATION_CORRECTION_TYPE {
|
||||
if m != nil && m.CorrectExifOrientation != nil {
|
||||
return *m.CorrectExifOrientation
|
||||
}
|
||||
return Default_InputSettings_CorrectExifOrientation
|
||||
}
|
||||
|
||||
func (m *InputSettings) GetParseMetadata() bool {
|
||||
if m != nil && m.ParseMetadata != nil {
|
||||
return *m.ParseMetadata
|
||||
}
|
||||
return Default_InputSettings_ParseMetadata
|
||||
}
|
||||
|
||||
func (m *InputSettings) GetTransparentSubstitutionRgb() int32 {
|
||||
if m != nil && m.TransparentSubstitutionRgb != nil {
|
||||
return *m.TransparentSubstitutionRgb
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
type OutputSettings struct {
|
||||
MimeType *OutputSettings_MIME_TYPE `protobuf:"varint,1,opt,name=mime_type,enum=appengine.OutputSettings_MIME_TYPE,def=0" json:"mime_type,omitempty"`
|
||||
Quality *int32 `protobuf:"varint,2,opt,name=quality" json:"quality,omitempty"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
}
|
||||
|
||||
func (m *OutputSettings) Reset() { *m = OutputSettings{} }
|
||||
func (m *OutputSettings) String() string { return proto.CompactTextString(m) }
|
||||
func (*OutputSettings) ProtoMessage() {}
|
||||
|
||||
const Default_OutputSettings_MimeType OutputSettings_MIME_TYPE = OutputSettings_PNG
|
||||
|
||||
func (m *OutputSettings) GetMimeType() OutputSettings_MIME_TYPE {
|
||||
if m != nil && m.MimeType != nil {
|
||||
return *m.MimeType
|
||||
}
|
||||
return Default_OutputSettings_MimeType
|
||||
}
|
||||
|
||||
func (m *OutputSettings) GetQuality() int32 {
|
||||
if m != nil && m.Quality != nil {
|
||||
return *m.Quality
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
type ImagesTransformRequest struct {
|
||||
Image *ImageData `protobuf:"bytes,1,req,name=image" json:"image,omitempty"`
|
||||
Transform []*Transform `protobuf:"bytes,2,rep,name=transform" json:"transform,omitempty"`
|
||||
Output *OutputSettings `protobuf:"bytes,3,req,name=output" json:"output,omitempty"`
|
||||
Input *InputSettings `protobuf:"bytes,4,opt,name=input" json:"input,omitempty"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
}
|
||||
|
||||
func (m *ImagesTransformRequest) Reset() { *m = ImagesTransformRequest{} }
|
||||
func (m *ImagesTransformRequest) String() string { return proto.CompactTextString(m) }
|
||||
func (*ImagesTransformRequest) ProtoMessage() {}
|
||||
|
||||
func (m *ImagesTransformRequest) GetImage() *ImageData {
|
||||
if m != nil {
|
||||
return m.Image
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *ImagesTransformRequest) GetTransform() []*Transform {
|
||||
if m != nil {
|
||||
return m.Transform
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *ImagesTransformRequest) GetOutput() *OutputSettings {
|
||||
if m != nil {
|
||||
return m.Output
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *ImagesTransformRequest) GetInput() *InputSettings {
|
||||
if m != nil {
|
||||
return m.Input
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type ImagesTransformResponse struct {
|
||||
Image *ImageData `protobuf:"bytes,1,req,name=image" json:"image,omitempty"`
|
||||
SourceMetadata *string `protobuf:"bytes,2,opt,name=source_metadata" json:"source_metadata,omitempty"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
}
|
||||
|
||||
func (m *ImagesTransformResponse) Reset() { *m = ImagesTransformResponse{} }
|
||||
func (m *ImagesTransformResponse) String() string { return proto.CompactTextString(m) }
|
||||
func (*ImagesTransformResponse) ProtoMessage() {}
|
||||
|
||||
func (m *ImagesTransformResponse) GetImage() *ImageData {
|
||||
if m != nil {
|
||||
return m.Image
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *ImagesTransformResponse) GetSourceMetadata() string {
|
||||
if m != nil && m.SourceMetadata != nil {
|
||||
return *m.SourceMetadata
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type CompositeImageOptions struct {
|
||||
SourceIndex *int32 `protobuf:"varint,1,req,name=source_index" json:"source_index,omitempty"`
|
||||
XOffset *int32 `protobuf:"varint,2,req,name=x_offset" json:"x_offset,omitempty"`
|
||||
YOffset *int32 `protobuf:"varint,3,req,name=y_offset" json:"y_offset,omitempty"`
|
||||
Opacity *float32 `protobuf:"fixed32,4,req,name=opacity" json:"opacity,omitempty"`
|
||||
Anchor *CompositeImageOptions_ANCHOR `protobuf:"varint,5,req,name=anchor,enum=appengine.CompositeImageOptions_ANCHOR" json:"anchor,omitempty"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
}
|
||||
|
||||
func (m *CompositeImageOptions) Reset() { *m = CompositeImageOptions{} }
|
||||
func (m *CompositeImageOptions) String() string { return proto.CompactTextString(m) }
|
||||
func (*CompositeImageOptions) ProtoMessage() {}
|
||||
|
||||
func (m *CompositeImageOptions) GetSourceIndex() int32 {
|
||||
if m != nil && m.SourceIndex != nil {
|
||||
return *m.SourceIndex
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (m *CompositeImageOptions) GetXOffset() int32 {
|
||||
if m != nil && m.XOffset != nil {
|
||||
return *m.XOffset
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (m *CompositeImageOptions) GetYOffset() int32 {
|
||||
if m != nil && m.YOffset != nil {
|
||||
return *m.YOffset
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (m *CompositeImageOptions) GetOpacity() float32 {
|
||||
if m != nil && m.Opacity != nil {
|
||||
return *m.Opacity
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (m *CompositeImageOptions) GetAnchor() CompositeImageOptions_ANCHOR {
|
||||
if m != nil && m.Anchor != nil {
|
||||
return *m.Anchor
|
||||
}
|
||||
return CompositeImageOptions_TOP_LEFT
|
||||
}
|
||||
|
||||
type ImagesCanvas struct {
|
||||
Width *int32 `protobuf:"varint,1,req,name=width" json:"width,omitempty"`
|
||||
Height *int32 `protobuf:"varint,2,req,name=height" json:"height,omitempty"`
|
||||
Output *OutputSettings `protobuf:"bytes,3,req,name=output" json:"output,omitempty"`
|
||||
Color *int32 `protobuf:"varint,4,opt,name=color,def=-1" json:"color,omitempty"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
}
|
||||
|
||||
func (m *ImagesCanvas) Reset() { *m = ImagesCanvas{} }
|
||||
func (m *ImagesCanvas) String() string { return proto.CompactTextString(m) }
|
||||
func (*ImagesCanvas) ProtoMessage() {}
|
||||
|
||||
const Default_ImagesCanvas_Color int32 = -1
|
||||
|
||||
func (m *ImagesCanvas) GetWidth() int32 {
|
||||
if m != nil && m.Width != nil {
|
||||
return *m.Width
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (m *ImagesCanvas) GetHeight() int32 {
|
||||
if m != nil && m.Height != nil {
|
||||
return *m.Height
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (m *ImagesCanvas) GetOutput() *OutputSettings {
|
||||
if m != nil {
|
||||
return m.Output
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *ImagesCanvas) GetColor() int32 {
|
||||
if m != nil && m.Color != nil {
|
||||
return *m.Color
|
||||
}
|
||||
return Default_ImagesCanvas_Color
|
||||
}
|
||||
|
||||
type ImagesCompositeRequest struct {
|
||||
Image []*ImageData `protobuf:"bytes,1,rep,name=image" json:"image,omitempty"`
|
||||
Options []*CompositeImageOptions `protobuf:"bytes,2,rep,name=options" json:"options,omitempty"`
|
||||
Canvas *ImagesCanvas `protobuf:"bytes,3,req,name=canvas" json:"canvas,omitempty"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
}
|
||||
|
||||
func (m *ImagesCompositeRequest) Reset() { *m = ImagesCompositeRequest{} }
|
||||
func (m *ImagesCompositeRequest) String() string { return proto.CompactTextString(m) }
|
||||
func (*ImagesCompositeRequest) ProtoMessage() {}
|
||||
|
||||
func (m *ImagesCompositeRequest) GetImage() []*ImageData {
|
||||
if m != nil {
|
||||
return m.Image
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *ImagesCompositeRequest) GetOptions() []*CompositeImageOptions {
|
||||
if m != nil {
|
||||
return m.Options
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *ImagesCompositeRequest) GetCanvas() *ImagesCanvas {
|
||||
if m != nil {
|
||||
return m.Canvas
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type ImagesCompositeResponse struct {
|
||||
Image *ImageData `protobuf:"bytes,1,req,name=image" json:"image,omitempty"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
}
|
||||
|
||||
func (m *ImagesCompositeResponse) Reset() { *m = ImagesCompositeResponse{} }
|
||||
func (m *ImagesCompositeResponse) String() string { return proto.CompactTextString(m) }
|
||||
func (*ImagesCompositeResponse) ProtoMessage() {}
|
||||
|
||||
func (m *ImagesCompositeResponse) GetImage() *ImageData {
|
||||
if m != nil {
|
||||
return m.Image
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type ImagesHistogramRequest struct {
|
||||
Image *ImageData `protobuf:"bytes,1,req,name=image" json:"image,omitempty"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
}
|
||||
|
||||
func (m *ImagesHistogramRequest) Reset() { *m = ImagesHistogramRequest{} }
|
||||
func (m *ImagesHistogramRequest) String() string { return proto.CompactTextString(m) }
|
||||
func (*ImagesHistogramRequest) ProtoMessage() {}
|
||||
|
||||
func (m *ImagesHistogramRequest) GetImage() *ImageData {
|
||||
if m != nil {
|
||||
return m.Image
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type ImagesHistogram struct {
|
||||
Red []int32 `protobuf:"varint,1,rep,name=red" json:"red,omitempty"`
|
||||
Green []int32 `protobuf:"varint,2,rep,name=green" json:"green,omitempty"`
|
||||
Blue []int32 `protobuf:"varint,3,rep,name=blue" json:"blue,omitempty"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
}
|
||||
|
||||
func (m *ImagesHistogram) Reset() { *m = ImagesHistogram{} }
|
||||
func (m *ImagesHistogram) String() string { return proto.CompactTextString(m) }
|
||||
func (*ImagesHistogram) ProtoMessage() {}
|
||||
|
||||
func (m *ImagesHistogram) GetRed() []int32 {
|
||||
if m != nil {
|
||||
return m.Red
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *ImagesHistogram) GetGreen() []int32 {
|
||||
if m != nil {
|
||||
return m.Green
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *ImagesHistogram) GetBlue() []int32 {
|
||||
if m != nil {
|
||||
return m.Blue
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type ImagesHistogramResponse struct {
|
||||
Histogram *ImagesHistogram `protobuf:"bytes,1,req,name=histogram" json:"histogram,omitempty"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
}
|
||||
|
||||
func (m *ImagesHistogramResponse) Reset() { *m = ImagesHistogramResponse{} }
|
||||
func (m *ImagesHistogramResponse) String() string { return proto.CompactTextString(m) }
|
||||
func (*ImagesHistogramResponse) ProtoMessage() {}
|
||||
|
||||
func (m *ImagesHistogramResponse) GetHistogram() *ImagesHistogram {
|
||||
if m != nil {
|
||||
return m.Histogram
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type ImagesGetUrlBaseRequest struct {
|
||||
BlobKey *string `protobuf:"bytes,1,req,name=blob_key" json:"blob_key,omitempty"`
|
||||
CreateSecureUrl *bool `protobuf:"varint,2,opt,name=create_secure_url,def=0" json:"create_secure_url,omitempty"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
}
|
||||
|
||||
func (m *ImagesGetUrlBaseRequest) Reset() { *m = ImagesGetUrlBaseRequest{} }
|
||||
func (m *ImagesGetUrlBaseRequest) String() string { return proto.CompactTextString(m) }
|
||||
func (*ImagesGetUrlBaseRequest) ProtoMessage() {}
|
||||
|
||||
const Default_ImagesGetUrlBaseRequest_CreateSecureUrl bool = false
|
||||
|
||||
func (m *ImagesGetUrlBaseRequest) GetBlobKey() string {
|
||||
if m != nil && m.BlobKey != nil {
|
||||
return *m.BlobKey
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *ImagesGetUrlBaseRequest) GetCreateSecureUrl() bool {
|
||||
if m != nil && m.CreateSecureUrl != nil {
|
||||
return *m.CreateSecureUrl
|
||||
}
|
||||
return Default_ImagesGetUrlBaseRequest_CreateSecureUrl
|
||||
}
|
||||
|
||||
type ImagesGetUrlBaseResponse struct {
|
||||
Url *string `protobuf:"bytes,1,req,name=url" json:"url,omitempty"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
}
|
||||
|
||||
func (m *ImagesGetUrlBaseResponse) Reset() { *m = ImagesGetUrlBaseResponse{} }
|
||||
func (m *ImagesGetUrlBaseResponse) String() string { return proto.CompactTextString(m) }
|
||||
func (*ImagesGetUrlBaseResponse) ProtoMessage() {}
|
||||
|
||||
func (m *ImagesGetUrlBaseResponse) GetUrl() string {
|
||||
if m != nil && m.Url != nil {
|
||||
return *m.Url
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type ImagesDeleteUrlBaseRequest struct {
|
||||
BlobKey *string `protobuf:"bytes,1,req,name=blob_key" json:"blob_key,omitempty"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
}
|
||||
|
||||
func (m *ImagesDeleteUrlBaseRequest) Reset() { *m = ImagesDeleteUrlBaseRequest{} }
|
||||
func (m *ImagesDeleteUrlBaseRequest) String() string { return proto.CompactTextString(m) }
|
||||
func (*ImagesDeleteUrlBaseRequest) ProtoMessage() {}
|
||||
|
||||
func (m *ImagesDeleteUrlBaseRequest) GetBlobKey() string {
|
||||
if m != nil && m.BlobKey != nil {
|
||||
return *m.BlobKey
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type ImagesDeleteUrlBaseResponse struct {
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
}
|
||||
|
||||
func (m *ImagesDeleteUrlBaseResponse) Reset() { *m = ImagesDeleteUrlBaseResponse{} }
|
||||
func (m *ImagesDeleteUrlBaseResponse) String() string { return proto.CompactTextString(m) }
|
||||
func (*ImagesDeleteUrlBaseResponse) ProtoMessage() {}
|
||||
|
||||
func init() {
|
||||
}
|
||||
+162
@@ -0,0 +1,162 @@
|
||||
syntax = "proto2";
|
||||
option go_package = "image";
|
||||
|
||||
package appengine;
|
||||
|
||||
message ImagesServiceError {
|
||||
enum ErrorCode {
|
||||
UNSPECIFIED_ERROR = 1;
|
||||
BAD_TRANSFORM_DATA = 2;
|
||||
NOT_IMAGE = 3;
|
||||
BAD_IMAGE_DATA = 4;
|
||||
IMAGE_TOO_LARGE = 5;
|
||||
INVALID_BLOB_KEY = 6;
|
||||
ACCESS_DENIED = 7;
|
||||
OBJECT_NOT_FOUND = 8;
|
||||
}
|
||||
}
|
||||
|
||||
message ImagesServiceTransform {
|
||||
enum Type {
|
||||
RESIZE = 1;
|
||||
ROTATE = 2;
|
||||
HORIZONTAL_FLIP = 3;
|
||||
VERTICAL_FLIP = 4;
|
||||
CROP = 5;
|
||||
IM_FEELING_LUCKY = 6;
|
||||
}
|
||||
}
|
||||
|
||||
message Transform {
|
||||
optional int32 width = 1;
|
||||
optional int32 height = 2;
|
||||
optional bool crop_to_fit = 11 [default = false];
|
||||
optional float crop_offset_x = 12 [default = 0.5];
|
||||
optional float crop_offset_y = 13 [default = 0.5];
|
||||
|
||||
optional int32 rotate = 3 [default = 0];
|
||||
|
||||
optional bool horizontal_flip = 4 [default = false];
|
||||
|
||||
optional bool vertical_flip = 5 [default = false];
|
||||
|
||||
optional float crop_left_x = 6 [default = 0.0];
|
||||
optional float crop_top_y = 7 [default = 0.0];
|
||||
optional float crop_right_x = 8 [default = 1.0];
|
||||
optional float crop_bottom_y = 9 [default = 1.0];
|
||||
|
||||
optional bool autolevels = 10 [default = false];
|
||||
|
||||
optional bool allow_stretch = 14 [default = false];
|
||||
}
|
||||
|
||||
message ImageData {
|
||||
required bytes content = 1 [ctype=CORD];
|
||||
optional string blob_key = 2;
|
||||
|
||||
optional int32 width = 3;
|
||||
optional int32 height = 4;
|
||||
}
|
||||
|
||||
message InputSettings {
|
||||
enum ORIENTATION_CORRECTION_TYPE {
|
||||
UNCHANGED_ORIENTATION = 0;
|
||||
CORRECT_ORIENTATION = 1;
|
||||
}
|
||||
optional ORIENTATION_CORRECTION_TYPE correct_exif_orientation = 1
|
||||
[default=UNCHANGED_ORIENTATION];
|
||||
optional bool parse_metadata = 2 [default=false];
|
||||
optional int32 transparent_substitution_rgb = 3;
|
||||
}
|
||||
|
||||
message OutputSettings {
|
||||
enum MIME_TYPE {
|
||||
PNG = 0;
|
||||
JPEG = 1;
|
||||
WEBP = 2;
|
||||
}
|
||||
|
||||
optional MIME_TYPE mime_type = 1 [default=PNG];
|
||||
optional int32 quality = 2;
|
||||
}
|
||||
|
||||
message ImagesTransformRequest {
|
||||
required ImageData image = 1;
|
||||
repeated Transform transform = 2;
|
||||
required OutputSettings output = 3;
|
||||
optional InputSettings input = 4;
|
||||
}
|
||||
|
||||
message ImagesTransformResponse {
|
||||
required ImageData image = 1;
|
||||
optional string source_metadata = 2;
|
||||
}
|
||||
|
||||
message CompositeImageOptions {
|
||||
required int32 source_index = 1;
|
||||
required int32 x_offset = 2;
|
||||
required int32 y_offset = 3;
|
||||
required float opacity = 4;
|
||||
|
||||
enum ANCHOR {
|
||||
TOP_LEFT = 0;
|
||||
TOP = 1;
|
||||
TOP_RIGHT = 2;
|
||||
LEFT = 3;
|
||||
CENTER = 4;
|
||||
RIGHT = 5;
|
||||
BOTTOM_LEFT = 6;
|
||||
BOTTOM = 7;
|
||||
BOTTOM_RIGHT = 8;
|
||||
}
|
||||
|
||||
required ANCHOR anchor = 5;
|
||||
}
|
||||
|
||||
message ImagesCanvas {
|
||||
required int32 width = 1;
|
||||
required int32 height = 2;
|
||||
required OutputSettings output = 3;
|
||||
optional int32 color = 4 [default=-1];
|
||||
}
|
||||
|
||||
message ImagesCompositeRequest {
|
||||
repeated ImageData image = 1;
|
||||
repeated CompositeImageOptions options = 2;
|
||||
required ImagesCanvas canvas = 3;
|
||||
}
|
||||
|
||||
message ImagesCompositeResponse {
|
||||
required ImageData image = 1;
|
||||
}
|
||||
|
||||
message ImagesHistogramRequest {
|
||||
required ImageData image = 1;
|
||||
}
|
||||
|
||||
message ImagesHistogram {
|
||||
repeated int32 red = 1;
|
||||
repeated int32 green = 2;
|
||||
repeated int32 blue = 3;
|
||||
}
|
||||
|
||||
message ImagesHistogramResponse {
|
||||
required ImagesHistogram histogram = 1;
|
||||
}
|
||||
|
||||
message ImagesGetUrlBaseRequest {
|
||||
required string blob_key = 1;
|
||||
|
||||
optional bool create_secure_url = 2 [default = false];
|
||||
}
|
||||
|
||||
message ImagesGetUrlBaseResponse {
|
||||
required string url = 1;
|
||||
}
|
||||
|
||||
message ImagesDeleteUrlBaseRequest {
|
||||
required string blob_key = 1;
|
||||
}
|
||||
|
||||
message ImagesDeleteUrlBaseResponse {
|
||||
}
|
||||
+60
@@ -0,0 +1,60 @@
|
||||
// Copyright 2014 Google Inc. All rights reserved.
|
||||
// Use of this source code is governed by the Apache 2.0
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
// +build !appengine
|
||||
|
||||
package internal
|
||||
|
||||
import (
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"net/http"
|
||||
"net/http/httptest"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestInstallingHealthChecker(t *testing.T) {
|
||||
try := func(desc string, mux *http.ServeMux, wantCode int, wantBody string) {
|
||||
installHealthChecker(mux)
|
||||
srv := httptest.NewServer(mux)
|
||||
defer srv.Close()
|
||||
|
||||
resp, err := http.Get(srv.URL + "/_ah/health")
|
||||
if err != nil {
|
||||
t.Errorf("%s: http.Get: %v", desc, err)
|
||||
return
|
||||
}
|
||||
defer resp.Body.Close()
|
||||
body, err := ioutil.ReadAll(resp.Body)
|
||||
if err != nil {
|
||||
t.Errorf("%s: reading body: %v", desc, err)
|
||||
return
|
||||
}
|
||||
|
||||
if resp.StatusCode != wantCode {
|
||||
t.Errorf("%s: got HTTP %d, want %d", desc, resp.StatusCode, wantCode)
|
||||
return
|
||||
}
|
||||
if wantBody != "" && string(body) != wantBody {
|
||||
t.Errorf("%s: got HTTP body %q, want %q", desc, body, wantBody)
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
// If there's no handlers, or only a root handler, a health checker should be installed.
|
||||
try("empty mux", http.NewServeMux(), 200, "ok")
|
||||
mux := http.NewServeMux()
|
||||
mux.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
|
||||
io.WriteString(w, "root handler")
|
||||
})
|
||||
try("mux with root handler", mux, 200, "ok")
|
||||
|
||||
// If there's a custom health check handler, one should not be installed.
|
||||
mux = http.NewServeMux()
|
||||
mux.HandleFunc("/_ah/health", func(w http.ResponseWriter, r *http.Request) {
|
||||
w.WriteHeader(418)
|
||||
io.WriteString(w, "I'm short and stout!")
|
||||
})
|
||||
try("mux with custom health checker", mux, 418, "I'm short and stout!")
|
||||
}
|
||||
+229
@@ -0,0 +1,229 @@
|
||||
// Code generated by protoc-gen-go.
|
||||
// source: google.golang.org/appengine/internal/mail/mail_service.proto
|
||||
// DO NOT EDIT!
|
||||
|
||||
/*
|
||||
Package mail is a generated protocol buffer package.
|
||||
|
||||
It is generated from these files:
|
||||
google.golang.org/appengine/internal/mail/mail_service.proto
|
||||
|
||||
It has these top-level messages:
|
||||
MailServiceError
|
||||
MailAttachment
|
||||
MailHeader
|
||||
MailMessage
|
||||
*/
|
||||
package mail
|
||||
|
||||
import proto "github.com/golang/protobuf/proto"
|
||||
import fmt "fmt"
|
||||
import math "math"
|
||||
|
||||
// Reference imports to suppress errors if they are not otherwise used.
|
||||
var _ = proto.Marshal
|
||||
var _ = fmt.Errorf
|
||||
var _ = math.Inf
|
||||
|
||||
type MailServiceError_ErrorCode int32
|
||||
|
||||
const (
|
||||
MailServiceError_OK MailServiceError_ErrorCode = 0
|
||||
MailServiceError_INTERNAL_ERROR MailServiceError_ErrorCode = 1
|
||||
MailServiceError_BAD_REQUEST MailServiceError_ErrorCode = 2
|
||||
MailServiceError_UNAUTHORIZED_SENDER MailServiceError_ErrorCode = 3
|
||||
MailServiceError_INVALID_ATTACHMENT_TYPE MailServiceError_ErrorCode = 4
|
||||
MailServiceError_INVALID_HEADER_NAME MailServiceError_ErrorCode = 5
|
||||
MailServiceError_INVALID_CONTENT_ID MailServiceError_ErrorCode = 6
|
||||
)
|
||||
|
||||
var MailServiceError_ErrorCode_name = map[int32]string{
|
||||
0: "OK",
|
||||
1: "INTERNAL_ERROR",
|
||||
2: "BAD_REQUEST",
|
||||
3: "UNAUTHORIZED_SENDER",
|
||||
4: "INVALID_ATTACHMENT_TYPE",
|
||||
5: "INVALID_HEADER_NAME",
|
||||
6: "INVALID_CONTENT_ID",
|
||||
}
|
||||
var MailServiceError_ErrorCode_value = map[string]int32{
|
||||
"OK": 0,
|
||||
"INTERNAL_ERROR": 1,
|
||||
"BAD_REQUEST": 2,
|
||||
"UNAUTHORIZED_SENDER": 3,
|
||||
"INVALID_ATTACHMENT_TYPE": 4,
|
||||
"INVALID_HEADER_NAME": 5,
|
||||
"INVALID_CONTENT_ID": 6,
|
||||
}
|
||||
|
||||
func (x MailServiceError_ErrorCode) Enum() *MailServiceError_ErrorCode {
|
||||
p := new(MailServiceError_ErrorCode)
|
||||
*p = x
|
||||
return p
|
||||
}
|
||||
func (x MailServiceError_ErrorCode) String() string {
|
||||
return proto.EnumName(MailServiceError_ErrorCode_name, int32(x))
|
||||
}
|
||||
func (x *MailServiceError_ErrorCode) UnmarshalJSON(data []byte) error {
|
||||
value, err := proto.UnmarshalJSONEnum(MailServiceError_ErrorCode_value, data, "MailServiceError_ErrorCode")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
*x = MailServiceError_ErrorCode(value)
|
||||
return nil
|
||||
}
|
||||
|
||||
type MailServiceError struct {
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
}
|
||||
|
||||
func (m *MailServiceError) Reset() { *m = MailServiceError{} }
|
||||
func (m *MailServiceError) String() string { return proto.CompactTextString(m) }
|
||||
func (*MailServiceError) ProtoMessage() {}
|
||||
|
||||
type MailAttachment struct {
|
||||
FileName *string `protobuf:"bytes,1,req,name=FileName" json:"FileName,omitempty"`
|
||||
Data []byte `protobuf:"bytes,2,req,name=Data" json:"Data,omitempty"`
|
||||
ContentID *string `protobuf:"bytes,3,opt,name=ContentID" json:"ContentID,omitempty"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
}
|
||||
|
||||
func (m *MailAttachment) Reset() { *m = MailAttachment{} }
|
||||
func (m *MailAttachment) String() string { return proto.CompactTextString(m) }
|
||||
func (*MailAttachment) ProtoMessage() {}
|
||||
|
||||
func (m *MailAttachment) GetFileName() string {
|
||||
if m != nil && m.FileName != nil {
|
||||
return *m.FileName
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *MailAttachment) GetData() []byte {
|
||||
if m != nil {
|
||||
return m.Data
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *MailAttachment) GetContentID() string {
|
||||
if m != nil && m.ContentID != nil {
|
||||
return *m.ContentID
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type MailHeader struct {
|
||||
Name *string `protobuf:"bytes,1,req,name=name" json:"name,omitempty"`
|
||||
Value *string `protobuf:"bytes,2,req,name=value" json:"value,omitempty"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
}
|
||||
|
||||
func (m *MailHeader) Reset() { *m = MailHeader{} }
|
||||
func (m *MailHeader) String() string { return proto.CompactTextString(m) }
|
||||
func (*MailHeader) ProtoMessage() {}
|
||||
|
||||
func (m *MailHeader) GetName() string {
|
||||
if m != nil && m.Name != nil {
|
||||
return *m.Name
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *MailHeader) GetValue() string {
|
||||
if m != nil && m.Value != nil {
|
||||
return *m.Value
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type MailMessage struct {
|
||||
Sender *string `protobuf:"bytes,1,req,name=Sender" json:"Sender,omitempty"`
|
||||
ReplyTo *string `protobuf:"bytes,2,opt,name=ReplyTo" json:"ReplyTo,omitempty"`
|
||||
To []string `protobuf:"bytes,3,rep,name=To" json:"To,omitempty"`
|
||||
Cc []string `protobuf:"bytes,4,rep,name=Cc" json:"Cc,omitempty"`
|
||||
Bcc []string `protobuf:"bytes,5,rep,name=Bcc" json:"Bcc,omitempty"`
|
||||
Subject *string `protobuf:"bytes,6,req,name=Subject" json:"Subject,omitempty"`
|
||||
TextBody *string `protobuf:"bytes,7,opt,name=TextBody" json:"TextBody,omitempty"`
|
||||
HtmlBody *string `protobuf:"bytes,8,opt,name=HtmlBody" json:"HtmlBody,omitempty"`
|
||||
Attachment []*MailAttachment `protobuf:"bytes,9,rep,name=Attachment" json:"Attachment,omitempty"`
|
||||
Header []*MailHeader `protobuf:"bytes,10,rep,name=Header" json:"Header,omitempty"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
}
|
||||
|
||||
func (m *MailMessage) Reset() { *m = MailMessage{} }
|
||||
func (m *MailMessage) String() string { return proto.CompactTextString(m) }
|
||||
func (*MailMessage) ProtoMessage() {}
|
||||
|
||||
func (m *MailMessage) GetSender() string {
|
||||
if m != nil && m.Sender != nil {
|
||||
return *m.Sender
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *MailMessage) GetReplyTo() string {
|
||||
if m != nil && m.ReplyTo != nil {
|
||||
return *m.ReplyTo
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *MailMessage) GetTo() []string {
|
||||
if m != nil {
|
||||
return m.To
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *MailMessage) GetCc() []string {
|
||||
if m != nil {
|
||||
return m.Cc
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *MailMessage) GetBcc() []string {
|
||||
if m != nil {
|
||||
return m.Bcc
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *MailMessage) GetSubject() string {
|
||||
if m != nil && m.Subject != nil {
|
||||
return *m.Subject
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *MailMessage) GetTextBody() string {
|
||||
if m != nil && m.TextBody != nil {
|
||||
return *m.TextBody
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *MailMessage) GetHtmlBody() string {
|
||||
if m != nil && m.HtmlBody != nil {
|
||||
return *m.HtmlBody
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *MailMessage) GetAttachment() []*MailAttachment {
|
||||
if m != nil {
|
||||
return m.Attachment
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *MailMessage) GetHeader() []*MailHeader {
|
||||
if m != nil {
|
||||
return m.Header
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func init() {
|
||||
}
|
||||
+45
@@ -0,0 +1,45 @@
|
||||
syntax = "proto2";
|
||||
option go_package = "mail";
|
||||
|
||||
package appengine;
|
||||
|
||||
message MailServiceError {
|
||||
enum ErrorCode {
|
||||
OK = 0;
|
||||
INTERNAL_ERROR = 1;
|
||||
BAD_REQUEST = 2;
|
||||
UNAUTHORIZED_SENDER = 3;
|
||||
INVALID_ATTACHMENT_TYPE = 4;
|
||||
INVALID_HEADER_NAME = 5;
|
||||
INVALID_CONTENT_ID = 6;
|
||||
}
|
||||
}
|
||||
|
||||
message MailAttachment {
|
||||
required string FileName = 1;
|
||||
required bytes Data = 2;
|
||||
optional string ContentID = 3;
|
||||
}
|
||||
|
||||
message MailHeader {
|
||||
required string name = 1;
|
||||
required string value = 2;
|
||||
}
|
||||
|
||||
message MailMessage {
|
||||
required string Sender = 1;
|
||||
optional string ReplyTo = 2;
|
||||
|
||||
repeated string To = 3;
|
||||
repeated string Cc = 4;
|
||||
repeated string Bcc = 5;
|
||||
|
||||
required string Subject = 6;
|
||||
|
||||
optional string TextBody = 7;
|
||||
optional string HtmlBody = 8;
|
||||
|
||||
repeated MailAttachment Attachment = 9;
|
||||
|
||||
repeated MailHeader Header = 10;
|
||||
}
|
||||
+1
-5
@@ -22,11 +22,7 @@ func Main() {
|
||||
port = s
|
||||
}
|
||||
|
||||
host := ""
|
||||
if IsDevAppServer() {
|
||||
host = "127.0.0.1"
|
||||
}
|
||||
if err := http.ListenAndServe(host+":"+port, http.HandlerFunc(handleHTTP)); err != nil {
|
||||
if err := http.ListenAndServe(":"+port, http.HandlerFunc(handleHTTP)); err != nil {
|
||||
log.Fatalf("http.ListenAndServe: %v", err)
|
||||
}
|
||||
}
|
||||
|
||||
+938
@@ -0,0 +1,938 @@
|
||||
// Code generated by protoc-gen-go.
|
||||
// source: google.golang.org/appengine/internal/memcache/memcache_service.proto
|
||||
// DO NOT EDIT!
|
||||
|
||||
/*
|
||||
Package memcache is a generated protocol buffer package.
|
||||
|
||||
It is generated from these files:
|
||||
google.golang.org/appengine/internal/memcache/memcache_service.proto
|
||||
|
||||
It has these top-level messages:
|
||||
MemcacheServiceError
|
||||
AppOverride
|
||||
MemcacheGetRequest
|
||||
MemcacheGetResponse
|
||||
MemcacheSetRequest
|
||||
MemcacheSetResponse
|
||||
MemcacheDeleteRequest
|
||||
MemcacheDeleteResponse
|
||||
MemcacheIncrementRequest
|
||||
MemcacheIncrementResponse
|
||||
MemcacheBatchIncrementRequest
|
||||
MemcacheBatchIncrementResponse
|
||||
MemcacheFlushRequest
|
||||
MemcacheFlushResponse
|
||||
MemcacheStatsRequest
|
||||
MergedNamespaceStats
|
||||
MemcacheStatsResponse
|
||||
MemcacheGrabTailRequest
|
||||
MemcacheGrabTailResponse
|
||||
*/
|
||||
package memcache
|
||||
|
||||
import proto "github.com/golang/protobuf/proto"
|
||||
import fmt "fmt"
|
||||
import math "math"
|
||||
|
||||
// Reference imports to suppress errors if they are not otherwise used.
|
||||
var _ = proto.Marshal
|
||||
var _ = fmt.Errorf
|
||||
var _ = math.Inf
|
||||
|
||||
type MemcacheServiceError_ErrorCode int32
|
||||
|
||||
const (
|
||||
MemcacheServiceError_OK MemcacheServiceError_ErrorCode = 0
|
||||
MemcacheServiceError_UNSPECIFIED_ERROR MemcacheServiceError_ErrorCode = 1
|
||||
MemcacheServiceError_NAMESPACE_NOT_SET MemcacheServiceError_ErrorCode = 2
|
||||
MemcacheServiceError_PERMISSION_DENIED MemcacheServiceError_ErrorCode = 3
|
||||
MemcacheServiceError_INVALID_VALUE MemcacheServiceError_ErrorCode = 6
|
||||
)
|
||||
|
||||
var MemcacheServiceError_ErrorCode_name = map[int32]string{
|
||||
0: "OK",
|
||||
1: "UNSPECIFIED_ERROR",
|
||||
2: "NAMESPACE_NOT_SET",
|
||||
3: "PERMISSION_DENIED",
|
||||
6: "INVALID_VALUE",
|
||||
}
|
||||
var MemcacheServiceError_ErrorCode_value = map[string]int32{
|
||||
"OK": 0,
|
||||
"UNSPECIFIED_ERROR": 1,
|
||||
"NAMESPACE_NOT_SET": 2,
|
||||
"PERMISSION_DENIED": 3,
|
||||
"INVALID_VALUE": 6,
|
||||
}
|
||||
|
||||
func (x MemcacheServiceError_ErrorCode) Enum() *MemcacheServiceError_ErrorCode {
|
||||
p := new(MemcacheServiceError_ErrorCode)
|
||||
*p = x
|
||||
return p
|
||||
}
|
||||
func (x MemcacheServiceError_ErrorCode) String() string {
|
||||
return proto.EnumName(MemcacheServiceError_ErrorCode_name, int32(x))
|
||||
}
|
||||
func (x *MemcacheServiceError_ErrorCode) UnmarshalJSON(data []byte) error {
|
||||
value, err := proto.UnmarshalJSONEnum(MemcacheServiceError_ErrorCode_value, data, "MemcacheServiceError_ErrorCode")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
*x = MemcacheServiceError_ErrorCode(value)
|
||||
return nil
|
||||
}
|
||||
|
||||
type MemcacheSetRequest_SetPolicy int32
|
||||
|
||||
const (
|
||||
MemcacheSetRequest_SET MemcacheSetRequest_SetPolicy = 1
|
||||
MemcacheSetRequest_ADD MemcacheSetRequest_SetPolicy = 2
|
||||
MemcacheSetRequest_REPLACE MemcacheSetRequest_SetPolicy = 3
|
||||
MemcacheSetRequest_CAS MemcacheSetRequest_SetPolicy = 4
|
||||
)
|
||||
|
||||
var MemcacheSetRequest_SetPolicy_name = map[int32]string{
|
||||
1: "SET",
|
||||
2: "ADD",
|
||||
3: "REPLACE",
|
||||
4: "CAS",
|
||||
}
|
||||
var MemcacheSetRequest_SetPolicy_value = map[string]int32{
|
||||
"SET": 1,
|
||||
"ADD": 2,
|
||||
"REPLACE": 3,
|
||||
"CAS": 4,
|
||||
}
|
||||
|
||||
func (x MemcacheSetRequest_SetPolicy) Enum() *MemcacheSetRequest_SetPolicy {
|
||||
p := new(MemcacheSetRequest_SetPolicy)
|
||||
*p = x
|
||||
return p
|
||||
}
|
||||
func (x MemcacheSetRequest_SetPolicy) String() string {
|
||||
return proto.EnumName(MemcacheSetRequest_SetPolicy_name, int32(x))
|
||||
}
|
||||
func (x *MemcacheSetRequest_SetPolicy) UnmarshalJSON(data []byte) error {
|
||||
value, err := proto.UnmarshalJSONEnum(MemcacheSetRequest_SetPolicy_value, data, "MemcacheSetRequest_SetPolicy")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
*x = MemcacheSetRequest_SetPolicy(value)
|
||||
return nil
|
||||
}
|
||||
|
||||
type MemcacheSetResponse_SetStatusCode int32
|
||||
|
||||
const (
|
||||
MemcacheSetResponse_STORED MemcacheSetResponse_SetStatusCode = 1
|
||||
MemcacheSetResponse_NOT_STORED MemcacheSetResponse_SetStatusCode = 2
|
||||
MemcacheSetResponse_ERROR MemcacheSetResponse_SetStatusCode = 3
|
||||
MemcacheSetResponse_EXISTS MemcacheSetResponse_SetStatusCode = 4
|
||||
)
|
||||
|
||||
var MemcacheSetResponse_SetStatusCode_name = map[int32]string{
|
||||
1: "STORED",
|
||||
2: "NOT_STORED",
|
||||
3: "ERROR",
|
||||
4: "EXISTS",
|
||||
}
|
||||
var MemcacheSetResponse_SetStatusCode_value = map[string]int32{
|
||||
"STORED": 1,
|
||||
"NOT_STORED": 2,
|
||||
"ERROR": 3,
|
||||
"EXISTS": 4,
|
||||
}
|
||||
|
||||
func (x MemcacheSetResponse_SetStatusCode) Enum() *MemcacheSetResponse_SetStatusCode {
|
||||
p := new(MemcacheSetResponse_SetStatusCode)
|
||||
*p = x
|
||||
return p
|
||||
}
|
||||
func (x MemcacheSetResponse_SetStatusCode) String() string {
|
||||
return proto.EnumName(MemcacheSetResponse_SetStatusCode_name, int32(x))
|
||||
}
|
||||
func (x *MemcacheSetResponse_SetStatusCode) UnmarshalJSON(data []byte) error {
|
||||
value, err := proto.UnmarshalJSONEnum(MemcacheSetResponse_SetStatusCode_value, data, "MemcacheSetResponse_SetStatusCode")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
*x = MemcacheSetResponse_SetStatusCode(value)
|
||||
return nil
|
||||
}
|
||||
|
||||
type MemcacheDeleteResponse_DeleteStatusCode int32
|
||||
|
||||
const (
|
||||
MemcacheDeleteResponse_DELETED MemcacheDeleteResponse_DeleteStatusCode = 1
|
||||
MemcacheDeleteResponse_NOT_FOUND MemcacheDeleteResponse_DeleteStatusCode = 2
|
||||
)
|
||||
|
||||
var MemcacheDeleteResponse_DeleteStatusCode_name = map[int32]string{
|
||||
1: "DELETED",
|
||||
2: "NOT_FOUND",
|
||||
}
|
||||
var MemcacheDeleteResponse_DeleteStatusCode_value = map[string]int32{
|
||||
"DELETED": 1,
|
||||
"NOT_FOUND": 2,
|
||||
}
|
||||
|
||||
func (x MemcacheDeleteResponse_DeleteStatusCode) Enum() *MemcacheDeleteResponse_DeleteStatusCode {
|
||||
p := new(MemcacheDeleteResponse_DeleteStatusCode)
|
||||
*p = x
|
||||
return p
|
||||
}
|
||||
func (x MemcacheDeleteResponse_DeleteStatusCode) String() string {
|
||||
return proto.EnumName(MemcacheDeleteResponse_DeleteStatusCode_name, int32(x))
|
||||
}
|
||||
func (x *MemcacheDeleteResponse_DeleteStatusCode) UnmarshalJSON(data []byte) error {
|
||||
value, err := proto.UnmarshalJSONEnum(MemcacheDeleteResponse_DeleteStatusCode_value, data, "MemcacheDeleteResponse_DeleteStatusCode")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
*x = MemcacheDeleteResponse_DeleteStatusCode(value)
|
||||
return nil
|
||||
}
|
||||
|
||||
type MemcacheIncrementRequest_Direction int32
|
||||
|
||||
const (
|
||||
MemcacheIncrementRequest_INCREMENT MemcacheIncrementRequest_Direction = 1
|
||||
MemcacheIncrementRequest_DECREMENT MemcacheIncrementRequest_Direction = 2
|
||||
)
|
||||
|
||||
var MemcacheIncrementRequest_Direction_name = map[int32]string{
|
||||
1: "INCREMENT",
|
||||
2: "DECREMENT",
|
||||
}
|
||||
var MemcacheIncrementRequest_Direction_value = map[string]int32{
|
||||
"INCREMENT": 1,
|
||||
"DECREMENT": 2,
|
||||
}
|
||||
|
||||
func (x MemcacheIncrementRequest_Direction) Enum() *MemcacheIncrementRequest_Direction {
|
||||
p := new(MemcacheIncrementRequest_Direction)
|
||||
*p = x
|
||||
return p
|
||||
}
|
||||
func (x MemcacheIncrementRequest_Direction) String() string {
|
||||
return proto.EnumName(MemcacheIncrementRequest_Direction_name, int32(x))
|
||||
}
|
||||
func (x *MemcacheIncrementRequest_Direction) UnmarshalJSON(data []byte) error {
|
||||
value, err := proto.UnmarshalJSONEnum(MemcacheIncrementRequest_Direction_value, data, "MemcacheIncrementRequest_Direction")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
*x = MemcacheIncrementRequest_Direction(value)
|
||||
return nil
|
||||
}
|
||||
|
||||
type MemcacheIncrementResponse_IncrementStatusCode int32
|
||||
|
||||
const (
|
||||
MemcacheIncrementResponse_OK MemcacheIncrementResponse_IncrementStatusCode = 1
|
||||
MemcacheIncrementResponse_NOT_CHANGED MemcacheIncrementResponse_IncrementStatusCode = 2
|
||||
MemcacheIncrementResponse_ERROR MemcacheIncrementResponse_IncrementStatusCode = 3
|
||||
)
|
||||
|
||||
var MemcacheIncrementResponse_IncrementStatusCode_name = map[int32]string{
|
||||
1: "OK",
|
||||
2: "NOT_CHANGED",
|
||||
3: "ERROR",
|
||||
}
|
||||
var MemcacheIncrementResponse_IncrementStatusCode_value = map[string]int32{
|
||||
"OK": 1,
|
||||
"NOT_CHANGED": 2,
|
||||
"ERROR": 3,
|
||||
}
|
||||
|
||||
func (x MemcacheIncrementResponse_IncrementStatusCode) Enum() *MemcacheIncrementResponse_IncrementStatusCode {
|
||||
p := new(MemcacheIncrementResponse_IncrementStatusCode)
|
||||
*p = x
|
||||
return p
|
||||
}
|
||||
func (x MemcacheIncrementResponse_IncrementStatusCode) String() string {
|
||||
return proto.EnumName(MemcacheIncrementResponse_IncrementStatusCode_name, int32(x))
|
||||
}
|
||||
func (x *MemcacheIncrementResponse_IncrementStatusCode) UnmarshalJSON(data []byte) error {
|
||||
value, err := proto.UnmarshalJSONEnum(MemcacheIncrementResponse_IncrementStatusCode_value, data, "MemcacheIncrementResponse_IncrementStatusCode")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
*x = MemcacheIncrementResponse_IncrementStatusCode(value)
|
||||
return nil
|
||||
}
|
||||
|
||||
type MemcacheServiceError struct {
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
}
|
||||
|
||||
func (m *MemcacheServiceError) Reset() { *m = MemcacheServiceError{} }
|
||||
func (m *MemcacheServiceError) String() string { return proto.CompactTextString(m) }
|
||||
func (*MemcacheServiceError) ProtoMessage() {}
|
||||
|
||||
type AppOverride struct {
|
||||
AppId *string `protobuf:"bytes,1,req,name=app_id" json:"app_id,omitempty"`
|
||||
NumMemcachegBackends *int32 `protobuf:"varint,2,opt,name=num_memcacheg_backends" json:"num_memcacheg_backends,omitempty"`
|
||||
IgnoreShardlock *bool `protobuf:"varint,3,opt,name=ignore_shardlock" json:"ignore_shardlock,omitempty"`
|
||||
MemcachePoolHint *string `protobuf:"bytes,4,opt,name=memcache_pool_hint" json:"memcache_pool_hint,omitempty"`
|
||||
MemcacheShardingStrategy []byte `protobuf:"bytes,5,opt,name=memcache_sharding_strategy" json:"memcache_sharding_strategy,omitempty"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
}
|
||||
|
||||
func (m *AppOverride) Reset() { *m = AppOverride{} }
|
||||
func (m *AppOverride) String() string { return proto.CompactTextString(m) }
|
||||
func (*AppOverride) ProtoMessage() {}
|
||||
|
||||
func (m *AppOverride) GetAppId() string {
|
||||
if m != nil && m.AppId != nil {
|
||||
return *m.AppId
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *AppOverride) GetNumMemcachegBackends() int32 {
|
||||
if m != nil && m.NumMemcachegBackends != nil {
|
||||
return *m.NumMemcachegBackends
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (m *AppOverride) GetIgnoreShardlock() bool {
|
||||
if m != nil && m.IgnoreShardlock != nil {
|
||||
return *m.IgnoreShardlock
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func (m *AppOverride) GetMemcachePoolHint() string {
|
||||
if m != nil && m.MemcachePoolHint != nil {
|
||||
return *m.MemcachePoolHint
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *AppOverride) GetMemcacheShardingStrategy() []byte {
|
||||
if m != nil {
|
||||
return m.MemcacheShardingStrategy
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type MemcacheGetRequest struct {
|
||||
Key [][]byte `protobuf:"bytes,1,rep,name=key" json:"key,omitempty"`
|
||||
NameSpace *string `protobuf:"bytes,2,opt,name=name_space,def=" json:"name_space,omitempty"`
|
||||
ForCas *bool `protobuf:"varint,4,opt,name=for_cas" json:"for_cas,omitempty"`
|
||||
Override *AppOverride `protobuf:"bytes,5,opt,name=override" json:"override,omitempty"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
}
|
||||
|
||||
func (m *MemcacheGetRequest) Reset() { *m = MemcacheGetRequest{} }
|
||||
func (m *MemcacheGetRequest) String() string { return proto.CompactTextString(m) }
|
||||
func (*MemcacheGetRequest) ProtoMessage() {}
|
||||
|
||||
func (m *MemcacheGetRequest) GetKey() [][]byte {
|
||||
if m != nil {
|
||||
return m.Key
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *MemcacheGetRequest) GetNameSpace() string {
|
||||
if m != nil && m.NameSpace != nil {
|
||||
return *m.NameSpace
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *MemcacheGetRequest) GetForCas() bool {
|
||||
if m != nil && m.ForCas != nil {
|
||||
return *m.ForCas
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func (m *MemcacheGetRequest) GetOverride() *AppOverride {
|
||||
if m != nil {
|
||||
return m.Override
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type MemcacheGetResponse struct {
|
||||
Item []*MemcacheGetResponse_Item `protobuf:"group,1,rep,name=Item" json:"item,omitempty"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
}
|
||||
|
||||
func (m *MemcacheGetResponse) Reset() { *m = MemcacheGetResponse{} }
|
||||
func (m *MemcacheGetResponse) String() string { return proto.CompactTextString(m) }
|
||||
func (*MemcacheGetResponse) ProtoMessage() {}
|
||||
|
||||
func (m *MemcacheGetResponse) GetItem() []*MemcacheGetResponse_Item {
|
||||
if m != nil {
|
||||
return m.Item
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type MemcacheGetResponse_Item struct {
|
||||
Key []byte `protobuf:"bytes,2,req,name=key" json:"key,omitempty"`
|
||||
Value []byte `protobuf:"bytes,3,req,name=value" json:"value,omitempty"`
|
||||
Flags *uint32 `protobuf:"fixed32,4,opt,name=flags" json:"flags,omitempty"`
|
||||
CasId *uint64 `protobuf:"fixed64,5,opt,name=cas_id" json:"cas_id,omitempty"`
|
||||
ExpiresInSeconds *int32 `protobuf:"varint,6,opt,name=expires_in_seconds" json:"expires_in_seconds,omitempty"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
}
|
||||
|
||||
func (m *MemcacheGetResponse_Item) Reset() { *m = MemcacheGetResponse_Item{} }
|
||||
func (m *MemcacheGetResponse_Item) String() string { return proto.CompactTextString(m) }
|
||||
func (*MemcacheGetResponse_Item) ProtoMessage() {}
|
||||
|
||||
func (m *MemcacheGetResponse_Item) GetKey() []byte {
|
||||
if m != nil {
|
||||
return m.Key
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *MemcacheGetResponse_Item) GetValue() []byte {
|
||||
if m != nil {
|
||||
return m.Value
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *MemcacheGetResponse_Item) GetFlags() uint32 {
|
||||
if m != nil && m.Flags != nil {
|
||||
return *m.Flags
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (m *MemcacheGetResponse_Item) GetCasId() uint64 {
|
||||
if m != nil && m.CasId != nil {
|
||||
return *m.CasId
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (m *MemcacheGetResponse_Item) GetExpiresInSeconds() int32 {
|
||||
if m != nil && m.ExpiresInSeconds != nil {
|
||||
return *m.ExpiresInSeconds
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
type MemcacheSetRequest struct {
|
||||
Item []*MemcacheSetRequest_Item `protobuf:"group,1,rep,name=Item" json:"item,omitempty"`
|
||||
NameSpace *string `protobuf:"bytes,7,opt,name=name_space,def=" json:"name_space,omitempty"`
|
||||
Override *AppOverride `protobuf:"bytes,10,opt,name=override" json:"override,omitempty"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
}
|
||||
|
||||
func (m *MemcacheSetRequest) Reset() { *m = MemcacheSetRequest{} }
|
||||
func (m *MemcacheSetRequest) String() string { return proto.CompactTextString(m) }
|
||||
func (*MemcacheSetRequest) ProtoMessage() {}
|
||||
|
||||
func (m *MemcacheSetRequest) GetItem() []*MemcacheSetRequest_Item {
|
||||
if m != nil {
|
||||
return m.Item
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *MemcacheSetRequest) GetNameSpace() string {
|
||||
if m != nil && m.NameSpace != nil {
|
||||
return *m.NameSpace
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *MemcacheSetRequest) GetOverride() *AppOverride {
|
||||
if m != nil {
|
||||
return m.Override
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type MemcacheSetRequest_Item struct {
|
||||
Key []byte `protobuf:"bytes,2,req,name=key" json:"key,omitempty"`
|
||||
Value []byte `protobuf:"bytes,3,req,name=value" json:"value,omitempty"`
|
||||
Flags *uint32 `protobuf:"fixed32,4,opt,name=flags" json:"flags,omitempty"`
|
||||
SetPolicy *MemcacheSetRequest_SetPolicy `protobuf:"varint,5,opt,name=set_policy,enum=appengine.MemcacheSetRequest_SetPolicy,def=1" json:"set_policy,omitempty"`
|
||||
ExpirationTime *uint32 `protobuf:"fixed32,6,opt,name=expiration_time,def=0" json:"expiration_time,omitempty"`
|
||||
CasId *uint64 `protobuf:"fixed64,8,opt,name=cas_id" json:"cas_id,omitempty"`
|
||||
ForCas *bool `protobuf:"varint,9,opt,name=for_cas" json:"for_cas,omitempty"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
}
|
||||
|
||||
func (m *MemcacheSetRequest_Item) Reset() { *m = MemcacheSetRequest_Item{} }
|
||||
func (m *MemcacheSetRequest_Item) String() string { return proto.CompactTextString(m) }
|
||||
func (*MemcacheSetRequest_Item) ProtoMessage() {}
|
||||
|
||||
const Default_MemcacheSetRequest_Item_SetPolicy MemcacheSetRequest_SetPolicy = MemcacheSetRequest_SET
|
||||
const Default_MemcacheSetRequest_Item_ExpirationTime uint32 = 0
|
||||
|
||||
func (m *MemcacheSetRequest_Item) GetKey() []byte {
|
||||
if m != nil {
|
||||
return m.Key
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *MemcacheSetRequest_Item) GetValue() []byte {
|
||||
if m != nil {
|
||||
return m.Value
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *MemcacheSetRequest_Item) GetFlags() uint32 {
|
||||
if m != nil && m.Flags != nil {
|
||||
return *m.Flags
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (m *MemcacheSetRequest_Item) GetSetPolicy() MemcacheSetRequest_SetPolicy {
|
||||
if m != nil && m.SetPolicy != nil {
|
||||
return *m.SetPolicy
|
||||
}
|
||||
return Default_MemcacheSetRequest_Item_SetPolicy
|
||||
}
|
||||
|
||||
func (m *MemcacheSetRequest_Item) GetExpirationTime() uint32 {
|
||||
if m != nil && m.ExpirationTime != nil {
|
||||
return *m.ExpirationTime
|
||||
}
|
||||
return Default_MemcacheSetRequest_Item_ExpirationTime
|
||||
}
|
||||
|
||||
func (m *MemcacheSetRequest_Item) GetCasId() uint64 {
|
||||
if m != nil && m.CasId != nil {
|
||||
return *m.CasId
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (m *MemcacheSetRequest_Item) GetForCas() bool {
|
||||
if m != nil && m.ForCas != nil {
|
||||
return *m.ForCas
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
type MemcacheSetResponse struct {
|
||||
SetStatus []MemcacheSetResponse_SetStatusCode `protobuf:"varint,1,rep,name=set_status,enum=appengine.MemcacheSetResponse_SetStatusCode" json:"set_status,omitempty"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
}
|
||||
|
||||
func (m *MemcacheSetResponse) Reset() { *m = MemcacheSetResponse{} }
|
||||
func (m *MemcacheSetResponse) String() string { return proto.CompactTextString(m) }
|
||||
func (*MemcacheSetResponse) ProtoMessage() {}
|
||||
|
||||
func (m *MemcacheSetResponse) GetSetStatus() []MemcacheSetResponse_SetStatusCode {
|
||||
if m != nil {
|
||||
return m.SetStatus
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type MemcacheDeleteRequest struct {
|
||||
Item []*MemcacheDeleteRequest_Item `protobuf:"group,1,rep,name=Item" json:"item,omitempty"`
|
||||
NameSpace *string `protobuf:"bytes,4,opt,name=name_space,def=" json:"name_space,omitempty"`
|
||||
Override *AppOverride `protobuf:"bytes,5,opt,name=override" json:"override,omitempty"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
}
|
||||
|
||||
func (m *MemcacheDeleteRequest) Reset() { *m = MemcacheDeleteRequest{} }
|
||||
func (m *MemcacheDeleteRequest) String() string { return proto.CompactTextString(m) }
|
||||
func (*MemcacheDeleteRequest) ProtoMessage() {}
|
||||
|
||||
func (m *MemcacheDeleteRequest) GetItem() []*MemcacheDeleteRequest_Item {
|
||||
if m != nil {
|
||||
return m.Item
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *MemcacheDeleteRequest) GetNameSpace() string {
|
||||
if m != nil && m.NameSpace != nil {
|
||||
return *m.NameSpace
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *MemcacheDeleteRequest) GetOverride() *AppOverride {
|
||||
if m != nil {
|
||||
return m.Override
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type MemcacheDeleteRequest_Item struct {
|
||||
Key []byte `protobuf:"bytes,2,req,name=key" json:"key,omitempty"`
|
||||
DeleteTime *uint32 `protobuf:"fixed32,3,opt,name=delete_time,def=0" json:"delete_time,omitempty"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
}
|
||||
|
||||
func (m *MemcacheDeleteRequest_Item) Reset() { *m = MemcacheDeleteRequest_Item{} }
|
||||
func (m *MemcacheDeleteRequest_Item) String() string { return proto.CompactTextString(m) }
|
||||
func (*MemcacheDeleteRequest_Item) ProtoMessage() {}
|
||||
|
||||
const Default_MemcacheDeleteRequest_Item_DeleteTime uint32 = 0
|
||||
|
||||
func (m *MemcacheDeleteRequest_Item) GetKey() []byte {
|
||||
if m != nil {
|
||||
return m.Key
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *MemcacheDeleteRequest_Item) GetDeleteTime() uint32 {
|
||||
if m != nil && m.DeleteTime != nil {
|
||||
return *m.DeleteTime
|
||||
}
|
||||
return Default_MemcacheDeleteRequest_Item_DeleteTime
|
||||
}
|
||||
|
||||
type MemcacheDeleteResponse struct {
|
||||
DeleteStatus []MemcacheDeleteResponse_DeleteStatusCode `protobuf:"varint,1,rep,name=delete_status,enum=appengine.MemcacheDeleteResponse_DeleteStatusCode" json:"delete_status,omitempty"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
}
|
||||
|
||||
func (m *MemcacheDeleteResponse) Reset() { *m = MemcacheDeleteResponse{} }
|
||||
func (m *MemcacheDeleteResponse) String() string { return proto.CompactTextString(m) }
|
||||
func (*MemcacheDeleteResponse) ProtoMessage() {}
|
||||
|
||||
func (m *MemcacheDeleteResponse) GetDeleteStatus() []MemcacheDeleteResponse_DeleteStatusCode {
|
||||
if m != nil {
|
||||
return m.DeleteStatus
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type MemcacheIncrementRequest struct {
|
||||
Key []byte `protobuf:"bytes,1,req,name=key" json:"key,omitempty"`
|
||||
NameSpace *string `protobuf:"bytes,4,opt,name=name_space,def=" json:"name_space,omitempty"`
|
||||
Delta *uint64 `protobuf:"varint,2,opt,name=delta,def=1" json:"delta,omitempty"`
|
||||
Direction *MemcacheIncrementRequest_Direction `protobuf:"varint,3,opt,name=direction,enum=appengine.MemcacheIncrementRequest_Direction,def=1" json:"direction,omitempty"`
|
||||
InitialValue *uint64 `protobuf:"varint,5,opt,name=initial_value" json:"initial_value,omitempty"`
|
||||
InitialFlags *uint32 `protobuf:"fixed32,6,opt,name=initial_flags" json:"initial_flags,omitempty"`
|
||||
Override *AppOverride `protobuf:"bytes,7,opt,name=override" json:"override,omitempty"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
}
|
||||
|
||||
func (m *MemcacheIncrementRequest) Reset() { *m = MemcacheIncrementRequest{} }
|
||||
func (m *MemcacheIncrementRequest) String() string { return proto.CompactTextString(m) }
|
||||
func (*MemcacheIncrementRequest) ProtoMessage() {}
|
||||
|
||||
const Default_MemcacheIncrementRequest_Delta uint64 = 1
|
||||
const Default_MemcacheIncrementRequest_Direction MemcacheIncrementRequest_Direction = MemcacheIncrementRequest_INCREMENT
|
||||
|
||||
func (m *MemcacheIncrementRequest) GetKey() []byte {
|
||||
if m != nil {
|
||||
return m.Key
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *MemcacheIncrementRequest) GetNameSpace() string {
|
||||
if m != nil && m.NameSpace != nil {
|
||||
return *m.NameSpace
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *MemcacheIncrementRequest) GetDelta() uint64 {
|
||||
if m != nil && m.Delta != nil {
|
||||
return *m.Delta
|
||||
}
|
||||
return Default_MemcacheIncrementRequest_Delta
|
||||
}
|
||||
|
||||
func (m *MemcacheIncrementRequest) GetDirection() MemcacheIncrementRequest_Direction {
|
||||
if m != nil && m.Direction != nil {
|
||||
return *m.Direction
|
||||
}
|
||||
return Default_MemcacheIncrementRequest_Direction
|
||||
}
|
||||
|
||||
func (m *MemcacheIncrementRequest) GetInitialValue() uint64 {
|
||||
if m != nil && m.InitialValue != nil {
|
||||
return *m.InitialValue
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (m *MemcacheIncrementRequest) GetInitialFlags() uint32 {
|
||||
if m != nil && m.InitialFlags != nil {
|
||||
return *m.InitialFlags
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (m *MemcacheIncrementRequest) GetOverride() *AppOverride {
|
||||
if m != nil {
|
||||
return m.Override
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type MemcacheIncrementResponse struct {
|
||||
NewValue *uint64 `protobuf:"varint,1,opt,name=new_value" json:"new_value,omitempty"`
|
||||
IncrementStatus *MemcacheIncrementResponse_IncrementStatusCode `protobuf:"varint,2,opt,name=increment_status,enum=appengine.MemcacheIncrementResponse_IncrementStatusCode" json:"increment_status,omitempty"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
}
|
||||
|
||||
func (m *MemcacheIncrementResponse) Reset() { *m = MemcacheIncrementResponse{} }
|
||||
func (m *MemcacheIncrementResponse) String() string { return proto.CompactTextString(m) }
|
||||
func (*MemcacheIncrementResponse) ProtoMessage() {}
|
||||
|
||||
func (m *MemcacheIncrementResponse) GetNewValue() uint64 {
|
||||
if m != nil && m.NewValue != nil {
|
||||
return *m.NewValue
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (m *MemcacheIncrementResponse) GetIncrementStatus() MemcacheIncrementResponse_IncrementStatusCode {
|
||||
if m != nil && m.IncrementStatus != nil {
|
||||
return *m.IncrementStatus
|
||||
}
|
||||
return MemcacheIncrementResponse_OK
|
||||
}
|
||||
|
||||
type MemcacheBatchIncrementRequest struct {
|
||||
NameSpace *string `protobuf:"bytes,1,opt,name=name_space,def=" json:"name_space,omitempty"`
|
||||
Item []*MemcacheIncrementRequest `protobuf:"bytes,2,rep,name=item" json:"item,omitempty"`
|
||||
Override *AppOverride `protobuf:"bytes,3,opt,name=override" json:"override,omitempty"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
}
|
||||
|
||||
func (m *MemcacheBatchIncrementRequest) Reset() { *m = MemcacheBatchIncrementRequest{} }
|
||||
func (m *MemcacheBatchIncrementRequest) String() string { return proto.CompactTextString(m) }
|
||||
func (*MemcacheBatchIncrementRequest) ProtoMessage() {}
|
||||
|
||||
func (m *MemcacheBatchIncrementRequest) GetNameSpace() string {
|
||||
if m != nil && m.NameSpace != nil {
|
||||
return *m.NameSpace
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *MemcacheBatchIncrementRequest) GetItem() []*MemcacheIncrementRequest {
|
||||
if m != nil {
|
||||
return m.Item
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *MemcacheBatchIncrementRequest) GetOverride() *AppOverride {
|
||||
if m != nil {
|
||||
return m.Override
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type MemcacheBatchIncrementResponse struct {
|
||||
Item []*MemcacheIncrementResponse `protobuf:"bytes,1,rep,name=item" json:"item,omitempty"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
}
|
||||
|
||||
func (m *MemcacheBatchIncrementResponse) Reset() { *m = MemcacheBatchIncrementResponse{} }
|
||||
func (m *MemcacheBatchIncrementResponse) String() string { return proto.CompactTextString(m) }
|
||||
func (*MemcacheBatchIncrementResponse) ProtoMessage() {}
|
||||
|
||||
func (m *MemcacheBatchIncrementResponse) GetItem() []*MemcacheIncrementResponse {
|
||||
if m != nil {
|
||||
return m.Item
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type MemcacheFlushRequest struct {
|
||||
Override *AppOverride `protobuf:"bytes,1,opt,name=override" json:"override,omitempty"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
}
|
||||
|
||||
func (m *MemcacheFlushRequest) Reset() { *m = MemcacheFlushRequest{} }
|
||||
func (m *MemcacheFlushRequest) String() string { return proto.CompactTextString(m) }
|
||||
func (*MemcacheFlushRequest) ProtoMessage() {}
|
||||
|
||||
func (m *MemcacheFlushRequest) GetOverride() *AppOverride {
|
||||
if m != nil {
|
||||
return m.Override
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type MemcacheFlushResponse struct {
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
}
|
||||
|
||||
func (m *MemcacheFlushResponse) Reset() { *m = MemcacheFlushResponse{} }
|
||||
func (m *MemcacheFlushResponse) String() string { return proto.CompactTextString(m) }
|
||||
func (*MemcacheFlushResponse) ProtoMessage() {}
|
||||
|
||||
type MemcacheStatsRequest struct {
|
||||
Override *AppOverride `protobuf:"bytes,1,opt,name=override" json:"override,omitempty"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
}
|
||||
|
||||
func (m *MemcacheStatsRequest) Reset() { *m = MemcacheStatsRequest{} }
|
||||
func (m *MemcacheStatsRequest) String() string { return proto.CompactTextString(m) }
|
||||
func (*MemcacheStatsRequest) ProtoMessage() {}
|
||||
|
||||
func (m *MemcacheStatsRequest) GetOverride() *AppOverride {
|
||||
if m != nil {
|
||||
return m.Override
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type MergedNamespaceStats struct {
|
||||
Hits *uint64 `protobuf:"varint,1,req,name=hits" json:"hits,omitempty"`
|
||||
Misses *uint64 `protobuf:"varint,2,req,name=misses" json:"misses,omitempty"`
|
||||
ByteHits *uint64 `protobuf:"varint,3,req,name=byte_hits" json:"byte_hits,omitempty"`
|
||||
Items *uint64 `protobuf:"varint,4,req,name=items" json:"items,omitempty"`
|
||||
Bytes *uint64 `protobuf:"varint,5,req,name=bytes" json:"bytes,omitempty"`
|
||||
OldestItemAge *uint32 `protobuf:"fixed32,6,req,name=oldest_item_age" json:"oldest_item_age,omitempty"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
}
|
||||
|
||||
func (m *MergedNamespaceStats) Reset() { *m = MergedNamespaceStats{} }
|
||||
func (m *MergedNamespaceStats) String() string { return proto.CompactTextString(m) }
|
||||
func (*MergedNamespaceStats) ProtoMessage() {}
|
||||
|
||||
func (m *MergedNamespaceStats) GetHits() uint64 {
|
||||
if m != nil && m.Hits != nil {
|
||||
return *m.Hits
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (m *MergedNamespaceStats) GetMisses() uint64 {
|
||||
if m != nil && m.Misses != nil {
|
||||
return *m.Misses
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (m *MergedNamespaceStats) GetByteHits() uint64 {
|
||||
if m != nil && m.ByteHits != nil {
|
||||
return *m.ByteHits
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (m *MergedNamespaceStats) GetItems() uint64 {
|
||||
if m != nil && m.Items != nil {
|
||||
return *m.Items
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (m *MergedNamespaceStats) GetBytes() uint64 {
|
||||
if m != nil && m.Bytes != nil {
|
||||
return *m.Bytes
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (m *MergedNamespaceStats) GetOldestItemAge() uint32 {
|
||||
if m != nil && m.OldestItemAge != nil {
|
||||
return *m.OldestItemAge
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
type MemcacheStatsResponse struct {
|
||||
Stats *MergedNamespaceStats `protobuf:"bytes,1,opt,name=stats" json:"stats,omitempty"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
}
|
||||
|
||||
func (m *MemcacheStatsResponse) Reset() { *m = MemcacheStatsResponse{} }
|
||||
func (m *MemcacheStatsResponse) String() string { return proto.CompactTextString(m) }
|
||||
func (*MemcacheStatsResponse) ProtoMessage() {}
|
||||
|
||||
func (m *MemcacheStatsResponse) GetStats() *MergedNamespaceStats {
|
||||
if m != nil {
|
||||
return m.Stats
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type MemcacheGrabTailRequest struct {
|
||||
ItemCount *int32 `protobuf:"varint,1,req,name=item_count" json:"item_count,omitempty"`
|
||||
NameSpace *string `protobuf:"bytes,2,opt,name=name_space,def=" json:"name_space,omitempty"`
|
||||
Override *AppOverride `protobuf:"bytes,3,opt,name=override" json:"override,omitempty"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
}
|
||||
|
||||
func (m *MemcacheGrabTailRequest) Reset() { *m = MemcacheGrabTailRequest{} }
|
||||
func (m *MemcacheGrabTailRequest) String() string { return proto.CompactTextString(m) }
|
||||
func (*MemcacheGrabTailRequest) ProtoMessage() {}
|
||||
|
||||
func (m *MemcacheGrabTailRequest) GetItemCount() int32 {
|
||||
if m != nil && m.ItemCount != nil {
|
||||
return *m.ItemCount
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (m *MemcacheGrabTailRequest) GetNameSpace() string {
|
||||
if m != nil && m.NameSpace != nil {
|
||||
return *m.NameSpace
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *MemcacheGrabTailRequest) GetOverride() *AppOverride {
|
||||
if m != nil {
|
||||
return m.Override
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type MemcacheGrabTailResponse struct {
|
||||
Item []*MemcacheGrabTailResponse_Item `protobuf:"group,1,rep,name=Item" json:"item,omitempty"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
}
|
||||
|
||||
func (m *MemcacheGrabTailResponse) Reset() { *m = MemcacheGrabTailResponse{} }
|
||||
func (m *MemcacheGrabTailResponse) String() string { return proto.CompactTextString(m) }
|
||||
func (*MemcacheGrabTailResponse) ProtoMessage() {}
|
||||
|
||||
func (m *MemcacheGrabTailResponse) GetItem() []*MemcacheGrabTailResponse_Item {
|
||||
if m != nil {
|
||||
return m.Item
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type MemcacheGrabTailResponse_Item struct {
|
||||
Value []byte `protobuf:"bytes,2,req,name=value" json:"value,omitempty"`
|
||||
Flags *uint32 `protobuf:"fixed32,3,opt,name=flags" json:"flags,omitempty"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
}
|
||||
|
||||
func (m *MemcacheGrabTailResponse_Item) Reset() { *m = MemcacheGrabTailResponse_Item{} }
|
||||
func (m *MemcacheGrabTailResponse_Item) String() string { return proto.CompactTextString(m) }
|
||||
func (*MemcacheGrabTailResponse_Item) ProtoMessage() {}
|
||||
|
||||
func (m *MemcacheGrabTailResponse_Item) GetValue() []byte {
|
||||
if m != nil {
|
||||
return m.Value
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *MemcacheGrabTailResponse_Item) GetFlags() uint32 {
|
||||
if m != nil && m.Flags != nil {
|
||||
return *m.Flags
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func init() {
|
||||
}
|
||||
+165
@@ -0,0 +1,165 @@
|
||||
syntax = "proto2";
|
||||
option go_package = "memcache";
|
||||
|
||||
package appengine;
|
||||
|
||||
message MemcacheServiceError {
|
||||
enum ErrorCode {
|
||||
OK = 0;
|
||||
UNSPECIFIED_ERROR = 1;
|
||||
NAMESPACE_NOT_SET = 2;
|
||||
PERMISSION_DENIED = 3;
|
||||
INVALID_VALUE = 6;
|
||||
}
|
||||
}
|
||||
|
||||
message AppOverride {
|
||||
required string app_id = 1;
|
||||
|
||||
optional int32 num_memcacheg_backends = 2 [deprecated=true];
|
||||
optional bool ignore_shardlock = 3 [deprecated=true];
|
||||
optional string memcache_pool_hint = 4 [deprecated=true];
|
||||
optional bytes memcache_sharding_strategy = 5 [deprecated=true];
|
||||
}
|
||||
|
||||
message MemcacheGetRequest {
|
||||
repeated bytes key = 1;
|
||||
optional string name_space = 2 [default = ""];
|
||||
optional bool for_cas = 4;
|
||||
optional AppOverride override = 5;
|
||||
}
|
||||
|
||||
message MemcacheGetResponse {
|
||||
repeated group Item = 1 {
|
||||
required bytes key = 2;
|
||||
required bytes value = 3;
|
||||
optional fixed32 flags = 4;
|
||||
optional fixed64 cas_id = 5;
|
||||
optional int32 expires_in_seconds = 6;
|
||||
}
|
||||
}
|
||||
|
||||
message MemcacheSetRequest {
|
||||
enum SetPolicy {
|
||||
SET = 1;
|
||||
ADD = 2;
|
||||
REPLACE = 3;
|
||||
CAS = 4;
|
||||
}
|
||||
repeated group Item = 1 {
|
||||
required bytes key = 2;
|
||||
required bytes value = 3;
|
||||
|
||||
optional fixed32 flags = 4;
|
||||
optional SetPolicy set_policy = 5 [default = SET];
|
||||
optional fixed32 expiration_time = 6 [default = 0];
|
||||
|
||||
optional fixed64 cas_id = 8;
|
||||
optional bool for_cas = 9;
|
||||
}
|
||||
optional string name_space = 7 [default = ""];
|
||||
optional AppOverride override = 10;
|
||||
}
|
||||
|
||||
message MemcacheSetResponse {
|
||||
enum SetStatusCode {
|
||||
STORED = 1;
|
||||
NOT_STORED = 2;
|
||||
ERROR = 3;
|
||||
EXISTS = 4;
|
||||
}
|
||||
repeated SetStatusCode set_status = 1;
|
||||
}
|
||||
|
||||
message MemcacheDeleteRequest {
|
||||
repeated group Item = 1 {
|
||||
required bytes key = 2;
|
||||
optional fixed32 delete_time = 3 [default = 0];
|
||||
}
|
||||
optional string name_space = 4 [default = ""];
|
||||
optional AppOverride override = 5;
|
||||
}
|
||||
|
||||
message MemcacheDeleteResponse {
|
||||
enum DeleteStatusCode {
|
||||
DELETED = 1;
|
||||
NOT_FOUND = 2;
|
||||
}
|
||||
repeated DeleteStatusCode delete_status = 1;
|
||||
}
|
||||
|
||||
message MemcacheIncrementRequest {
|
||||
enum Direction {
|
||||
INCREMENT = 1;
|
||||
DECREMENT = 2;
|
||||
}
|
||||
required bytes key = 1;
|
||||
optional string name_space = 4 [default = ""];
|
||||
|
||||
optional uint64 delta = 2 [default = 1];
|
||||
optional Direction direction = 3 [default = INCREMENT];
|
||||
|
||||
optional uint64 initial_value = 5;
|
||||
optional fixed32 initial_flags = 6;
|
||||
optional AppOverride override = 7;
|
||||
}
|
||||
|
||||
message MemcacheIncrementResponse {
|
||||
enum IncrementStatusCode {
|
||||
OK = 1;
|
||||
NOT_CHANGED = 2;
|
||||
ERROR = 3;
|
||||
}
|
||||
|
||||
optional uint64 new_value = 1;
|
||||
optional IncrementStatusCode increment_status = 2;
|
||||
}
|
||||
|
||||
message MemcacheBatchIncrementRequest {
|
||||
optional string name_space = 1 [default = ""];
|
||||
repeated MemcacheIncrementRequest item = 2;
|
||||
optional AppOverride override = 3;
|
||||
}
|
||||
|
||||
message MemcacheBatchIncrementResponse {
|
||||
repeated MemcacheIncrementResponse item = 1;
|
||||
}
|
||||
|
||||
message MemcacheFlushRequest {
|
||||
optional AppOverride override = 1;
|
||||
}
|
||||
|
||||
message MemcacheFlushResponse {
|
||||
}
|
||||
|
||||
message MemcacheStatsRequest {
|
||||
optional AppOverride override = 1;
|
||||
}
|
||||
|
||||
message MergedNamespaceStats {
|
||||
required uint64 hits = 1;
|
||||
required uint64 misses = 2;
|
||||
required uint64 byte_hits = 3;
|
||||
|
||||
required uint64 items = 4;
|
||||
required uint64 bytes = 5;
|
||||
|
||||
required fixed32 oldest_item_age = 6;
|
||||
}
|
||||
|
||||
message MemcacheStatsResponse {
|
||||
optional MergedNamespaceStats stats = 1;
|
||||
}
|
||||
|
||||
message MemcacheGrabTailRequest {
|
||||
required int32 item_count = 1;
|
||||
optional string name_space = 2 [default = ""];
|
||||
optional AppOverride override = 3;
|
||||
}
|
||||
|
||||
message MemcacheGrabTailResponse {
|
||||
repeated group Item = 1 {
|
||||
required bytes value = 2;
|
||||
optional fixed32 flags = 3;
|
||||
}
|
||||
}
|
||||
+58
@@ -0,0 +1,58 @@
|
||||
// Copyright 2014 Google Inc. All rights reserved.
|
||||
// Use of this source code is governed by the Apache 2.0
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
// +build !appengine
|
||||
|
||||
package internal
|
||||
|
||||
import (
|
||||
"sync"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
netcontext "golang.org/x/net/context"
|
||||
|
||||
basepb "google.golang.org/appengine/internal/base"
|
||||
)
|
||||
|
||||
func TestDialLimit(t *testing.T) {
|
||||
// Fill up semaphore with false acquisitions to permit only two TCP connections at a time.
|
||||
// We don't replace limitSem because that results in a data race when net/http lazily closes connections.
|
||||
nFake := cap(limitSem) - 2
|
||||
for i := 0; i < nFake; i++ {
|
||||
limitSem <- 1
|
||||
}
|
||||
defer func() {
|
||||
for i := 0; i < nFake; i++ {
|
||||
<-limitSem
|
||||
}
|
||||
}()
|
||||
|
||||
f, c, cleanup := setup() // setup is in api_test.go
|
||||
defer cleanup()
|
||||
f.hang = make(chan int)
|
||||
|
||||
// If we make two RunSlowly RPCs (which will wait for f.hang to be strobed),
|
||||
// then the simple Non200 RPC should hang.
|
||||
var wg sync.WaitGroup
|
||||
wg.Add(2)
|
||||
for i := 0; i < 2; i++ {
|
||||
go func() {
|
||||
defer wg.Done()
|
||||
Call(toContext(c), "errors", "RunSlowly", &basepb.VoidProto{}, &basepb.VoidProto{})
|
||||
}()
|
||||
}
|
||||
time.Sleep(50 * time.Millisecond) // let those two RPCs start
|
||||
|
||||
ctx, _ := netcontext.WithTimeout(toContext(c), 50*time.Millisecond)
|
||||
err := Call(ctx, "errors", "Non200", &basepb.VoidProto{}, &basepb.VoidProto{})
|
||||
if err != errTimeout {
|
||||
t.Errorf("Non200 RPC returned with err %v, want errTimeout", err)
|
||||
}
|
||||
|
||||
// Drain the two RunSlowly calls.
|
||||
f.hang <- 1
|
||||
f.hang <- 1
|
||||
wg.Wait()
|
||||
}
|
||||
+2127
File diff suppressed because it is too large
Load Diff
+388
@@ -0,0 +1,388 @@
|
||||
syntax = "proto2";
|
||||
option go_package = "search";
|
||||
|
||||
package search;
|
||||
|
||||
message Scope {
|
||||
enum Type {
|
||||
USER_BY_CANONICAL_ID = 1;
|
||||
USER_BY_EMAIL = 2;
|
||||
GROUP_BY_CANONICAL_ID = 3;
|
||||
GROUP_BY_EMAIL = 4;
|
||||
GROUP_BY_DOMAIN = 5;
|
||||
ALL_USERS = 6;
|
||||
ALL_AUTHENTICATED_USERS = 7;
|
||||
}
|
||||
|
||||
optional Type type = 1;
|
||||
optional string value = 2;
|
||||
}
|
||||
|
||||
message Entry {
|
||||
enum Permission {
|
||||
READ = 1;
|
||||
WRITE = 2;
|
||||
FULL_CONTROL = 3;
|
||||
}
|
||||
|
||||
optional Scope scope = 1;
|
||||
optional Permission permission = 2;
|
||||
optional string display_name = 3;
|
||||
}
|
||||
|
||||
message AccessControlList {
|
||||
optional string owner = 1;
|
||||
repeated Entry entries = 2;
|
||||
}
|
||||
|
||||
message FieldValue {
|
||||
enum ContentType {
|
||||
TEXT = 0;
|
||||
HTML = 1;
|
||||
ATOM = 2;
|
||||
DATE = 3;
|
||||
NUMBER = 4;
|
||||
GEO = 5;
|
||||
}
|
||||
|
||||
optional ContentType type = 1 [default = TEXT];
|
||||
|
||||
optional string language = 2 [default = "en"];
|
||||
|
||||
optional string string_value = 3;
|
||||
|
||||
optional group Geo = 4 {
|
||||
required double lat = 5;
|
||||
required double lng = 6;
|
||||
}
|
||||
}
|
||||
|
||||
message Field {
|
||||
required string name = 1;
|
||||
required FieldValue value = 2;
|
||||
}
|
||||
|
||||
message FieldTypes {
|
||||
required string name = 1;
|
||||
repeated FieldValue.ContentType type = 2;
|
||||
}
|
||||
|
||||
message IndexShardSettings {
|
||||
repeated int32 prev_num_shards = 1;
|
||||
required int32 num_shards = 2 [default=1];
|
||||
repeated int32 prev_num_shards_search_false = 3;
|
||||
optional string local_replica = 4 [default = ""];
|
||||
}
|
||||
|
||||
message FacetValue {
|
||||
enum ContentType {
|
||||
ATOM = 2;
|
||||
NUMBER = 4;
|
||||
}
|
||||
|
||||
optional ContentType type = 1 [default = ATOM];
|
||||
optional string string_value = 3;
|
||||
}
|
||||
|
||||
message Facet {
|
||||
required string name = 1;
|
||||
required FacetValue value = 2;
|
||||
}
|
||||
|
||||
message DocumentMetadata {
|
||||
optional int64 version = 1;
|
||||
optional int64 committed_st_version = 2;
|
||||
}
|
||||
|
||||
message Document {
|
||||
optional string id = 1;
|
||||
optional string language = 2 [default = "en"];
|
||||
repeated Field field = 3;
|
||||
optional int32 order_id = 4;
|
||||
|
||||
enum Storage {
|
||||
DISK = 0;
|
||||
}
|
||||
|
||||
optional Storage storage = 5 [default = DISK];
|
||||
repeated Facet facet = 8;
|
||||
}
|
||||
|
||||
message SearchServiceError {
|
||||
enum ErrorCode {
|
||||
OK = 0;
|
||||
INVALID_REQUEST = 1;
|
||||
TRANSIENT_ERROR = 2;
|
||||
INTERNAL_ERROR = 3;
|
||||
PERMISSION_DENIED = 4;
|
||||
TIMEOUT = 5;
|
||||
CONCURRENT_TRANSACTION = 6;
|
||||
}
|
||||
}
|
||||
|
||||
message RequestStatus {
|
||||
required SearchServiceError.ErrorCode code = 1;
|
||||
optional string error_detail = 2;
|
||||
optional int32 canonical_code = 3;
|
||||
}
|
||||
|
||||
message IndexSpec {
|
||||
required string name = 1;
|
||||
|
||||
enum Consistency {
|
||||
GLOBAL = 0;
|
||||
PER_DOCUMENT = 1;
|
||||
}
|
||||
optional Consistency consistency = 2 [default = PER_DOCUMENT];
|
||||
|
||||
optional string namespace = 3;
|
||||
optional int32 version = 4;
|
||||
|
||||
enum Source {
|
||||
SEARCH = 0;
|
||||
DATASTORE = 1;
|
||||
CLOUD_STORAGE = 2;
|
||||
}
|
||||
optional Source source = 5 [default = SEARCH];
|
||||
|
||||
enum Mode {
|
||||
PRIORITY = 0;
|
||||
BACKGROUND = 1;
|
||||
}
|
||||
optional Mode mode = 6 [default = PRIORITY];
|
||||
}
|
||||
|
||||
message IndexMetadata {
|
||||
required IndexSpec index_spec = 1;
|
||||
|
||||
repeated FieldTypes field = 2;
|
||||
|
||||
message Storage {
|
||||
optional int64 amount_used = 1;
|
||||
optional int64 limit = 2;
|
||||
}
|
||||
optional Storage storage = 3;
|
||||
}
|
||||
|
||||
message IndexDocumentParams {
|
||||
repeated Document document = 1;
|
||||
|
||||
enum Freshness {
|
||||
SYNCHRONOUSLY = 0;
|
||||
WHEN_CONVENIENT = 1;
|
||||
}
|
||||
optional Freshness freshness = 2 [default = SYNCHRONOUSLY, deprecated=true];
|
||||
|
||||
required IndexSpec index_spec = 3;
|
||||
}
|
||||
|
||||
message IndexDocumentRequest {
|
||||
required IndexDocumentParams params = 1;
|
||||
|
||||
optional bytes app_id = 3;
|
||||
}
|
||||
|
||||
message IndexDocumentResponse {
|
||||
repeated RequestStatus status = 1;
|
||||
|
||||
repeated string doc_id = 2;
|
||||
}
|
||||
|
||||
message DeleteDocumentParams {
|
||||
repeated string doc_id = 1;
|
||||
|
||||
required IndexSpec index_spec = 2;
|
||||
}
|
||||
|
||||
message DeleteDocumentRequest {
|
||||
required DeleteDocumentParams params = 1;
|
||||
|
||||
optional bytes app_id = 3;
|
||||
}
|
||||
|
||||
message DeleteDocumentResponse {
|
||||
repeated RequestStatus status = 1;
|
||||
}
|
||||
|
||||
message ListDocumentsParams {
|
||||
required IndexSpec index_spec = 1;
|
||||
optional string start_doc_id = 2;
|
||||
optional bool include_start_doc = 3 [default = true];
|
||||
optional int32 limit = 4 [default = 100];
|
||||
optional bool keys_only = 5;
|
||||
}
|
||||
|
||||
message ListDocumentsRequest {
|
||||
required ListDocumentsParams params = 1;
|
||||
|
||||
optional bytes app_id = 2;
|
||||
}
|
||||
|
||||
message ListDocumentsResponse {
|
||||
required RequestStatus status = 1;
|
||||
|
||||
repeated Document document = 2;
|
||||
}
|
||||
|
||||
message ListIndexesParams {
|
||||
optional bool fetch_schema = 1;
|
||||
optional int32 limit = 2 [default = 20];
|
||||
optional string namespace = 3;
|
||||
optional string start_index_name = 4;
|
||||
optional bool include_start_index = 5 [default = true];
|
||||
optional string index_name_prefix = 6;
|
||||
optional int32 offset = 7;
|
||||
optional IndexSpec.Source source = 8 [default = SEARCH];
|
||||
}
|
||||
|
||||
message ListIndexesRequest {
|
||||
required ListIndexesParams params = 1;
|
||||
|
||||
optional bytes app_id = 3;
|
||||
}
|
||||
|
||||
message ListIndexesResponse {
|
||||
required RequestStatus status = 1;
|
||||
repeated IndexMetadata index_metadata = 2;
|
||||
}
|
||||
|
||||
message DeleteSchemaParams {
|
||||
optional IndexSpec.Source source = 1 [default = SEARCH];
|
||||
repeated IndexSpec index_spec = 2;
|
||||
}
|
||||
|
||||
message DeleteSchemaRequest {
|
||||
required DeleteSchemaParams params = 1;
|
||||
|
||||
optional bytes app_id = 3;
|
||||
}
|
||||
|
||||
message DeleteSchemaResponse {
|
||||
repeated RequestStatus status = 1;
|
||||
}
|
||||
|
||||
message SortSpec {
|
||||
required string sort_expression = 1;
|
||||
optional bool sort_descending = 2 [default = true];
|
||||
optional string default_value_text = 4;
|
||||
optional double default_value_numeric = 5;
|
||||
}
|
||||
|
||||
message ScorerSpec {
|
||||
enum Scorer {
|
||||
RESCORING_MATCH_SCORER = 0;
|
||||
MATCH_SCORER = 2;
|
||||
}
|
||||
optional Scorer scorer = 1 [default = MATCH_SCORER];
|
||||
|
||||
optional int32 limit = 2 [default = 1000];
|
||||
optional string match_scorer_parameters = 9;
|
||||
}
|
||||
|
||||
message FieldSpec {
|
||||
repeated string name = 1;
|
||||
|
||||
repeated group Expression = 2 {
|
||||
required string name = 3;
|
||||
required string expression = 4;
|
||||
}
|
||||
}
|
||||
|
||||
message FacetRange {
|
||||
optional string name = 1;
|
||||
optional string start = 2;
|
||||
optional string end = 3;
|
||||
}
|
||||
|
||||
message FacetRequestParam {
|
||||
optional int32 value_limit = 1;
|
||||
repeated FacetRange range = 2;
|
||||
repeated string value_constraint = 3;
|
||||
}
|
||||
|
||||
message FacetAutoDetectParam {
|
||||
optional int32 value_limit = 1 [default = 10];
|
||||
}
|
||||
|
||||
message FacetRequest {
|
||||
required string name = 1;
|
||||
optional FacetRequestParam params = 2;
|
||||
}
|
||||
|
||||
message FacetRefinement {
|
||||
required string name = 1;
|
||||
optional string value = 2;
|
||||
|
||||
message Range {
|
||||
optional string start = 1;
|
||||
optional string end = 2;
|
||||
}
|
||||
optional Range range = 3;
|
||||
}
|
||||
|
||||
message SearchParams {
|
||||
required IndexSpec index_spec = 1;
|
||||
required string query = 2;
|
||||
optional string cursor = 4;
|
||||
optional int32 offset = 11;
|
||||
|
||||
enum CursorType {
|
||||
NONE = 0;
|
||||
SINGLE = 1;
|
||||
PER_RESULT = 2;
|
||||
}
|
||||
optional CursorType cursor_type = 5 [default = NONE];
|
||||
|
||||
optional int32 limit = 6 [default = 20];
|
||||
optional int32 matched_count_accuracy = 7;
|
||||
repeated SortSpec sort_spec = 8;
|
||||
optional ScorerSpec scorer_spec = 9;
|
||||
optional FieldSpec field_spec = 10;
|
||||
optional bool keys_only = 12;
|
||||
|
||||
enum ParsingMode {
|
||||
STRICT = 0;
|
||||
RELAXED = 1;
|
||||
}
|
||||
optional ParsingMode parsing_mode = 13 [default = STRICT];
|
||||
|
||||
optional int32 auto_discover_facet_count = 15 [default = 0];
|
||||
repeated FacetRequest include_facet = 16;
|
||||
repeated FacetRefinement facet_refinement = 17;
|
||||
optional FacetAutoDetectParam facet_auto_detect_param = 18;
|
||||
optional int32 facet_depth = 19 [default=1000];
|
||||
}
|
||||
|
||||
message SearchRequest {
|
||||
required SearchParams params = 1;
|
||||
|
||||
optional bytes app_id = 3;
|
||||
}
|
||||
|
||||
message FacetResultValue {
|
||||
required string name = 1;
|
||||
required int32 count = 2;
|
||||
required FacetRefinement refinement = 3;
|
||||
}
|
||||
|
||||
message FacetResult {
|
||||
required string name = 1;
|
||||
repeated FacetResultValue value = 2;
|
||||
}
|
||||
|
||||
message SearchResult {
|
||||
required Document document = 1;
|
||||
repeated Field expression = 4;
|
||||
repeated double score = 2;
|
||||
optional string cursor = 3;
|
||||
}
|
||||
|
||||
message SearchResponse {
|
||||
repeated SearchResult result = 1;
|
||||
required int64 matched_count = 2;
|
||||
required RequestStatus status = 3;
|
||||
optional string cursor = 4;
|
||||
repeated FacetResult facet_result = 5;
|
||||
|
||||
extensions 1000 to 9999;
|
||||
}
|
||||
+1858
File diff suppressed because it is too large
Load Diff
+460
@@ -0,0 +1,460 @@
|
||||
syntax = "proto2";
|
||||
option go_package = "socket";
|
||||
|
||||
package appengine;
|
||||
|
||||
message RemoteSocketServiceError {
|
||||
enum ErrorCode {
|
||||
SYSTEM_ERROR = 1;
|
||||
GAI_ERROR = 2;
|
||||
FAILURE = 4;
|
||||
PERMISSION_DENIED = 5;
|
||||
INVALID_REQUEST = 6;
|
||||
SOCKET_CLOSED = 7;
|
||||
}
|
||||
|
||||
enum SystemError {
|
||||
option allow_alias = true;
|
||||
|
||||
SYS_SUCCESS = 0;
|
||||
SYS_EPERM = 1;
|
||||
SYS_ENOENT = 2;
|
||||
SYS_ESRCH = 3;
|
||||
SYS_EINTR = 4;
|
||||
SYS_EIO = 5;
|
||||
SYS_ENXIO = 6;
|
||||
SYS_E2BIG = 7;
|
||||
SYS_ENOEXEC = 8;
|
||||
SYS_EBADF = 9;
|
||||
SYS_ECHILD = 10;
|
||||
SYS_EAGAIN = 11;
|
||||
SYS_EWOULDBLOCK = 11;
|
||||
SYS_ENOMEM = 12;
|
||||
SYS_EACCES = 13;
|
||||
SYS_EFAULT = 14;
|
||||
SYS_ENOTBLK = 15;
|
||||
SYS_EBUSY = 16;
|
||||
SYS_EEXIST = 17;
|
||||
SYS_EXDEV = 18;
|
||||
SYS_ENODEV = 19;
|
||||
SYS_ENOTDIR = 20;
|
||||
SYS_EISDIR = 21;
|
||||
SYS_EINVAL = 22;
|
||||
SYS_ENFILE = 23;
|
||||
SYS_EMFILE = 24;
|
||||
SYS_ENOTTY = 25;
|
||||
SYS_ETXTBSY = 26;
|
||||
SYS_EFBIG = 27;
|
||||
SYS_ENOSPC = 28;
|
||||
SYS_ESPIPE = 29;
|
||||
SYS_EROFS = 30;
|
||||
SYS_EMLINK = 31;
|
||||
SYS_EPIPE = 32;
|
||||
SYS_EDOM = 33;
|
||||
SYS_ERANGE = 34;
|
||||
SYS_EDEADLK = 35;
|
||||
SYS_EDEADLOCK = 35;
|
||||
SYS_ENAMETOOLONG = 36;
|
||||
SYS_ENOLCK = 37;
|
||||
SYS_ENOSYS = 38;
|
||||
SYS_ENOTEMPTY = 39;
|
||||
SYS_ELOOP = 40;
|
||||
SYS_ENOMSG = 42;
|
||||
SYS_EIDRM = 43;
|
||||
SYS_ECHRNG = 44;
|
||||
SYS_EL2NSYNC = 45;
|
||||
SYS_EL3HLT = 46;
|
||||
SYS_EL3RST = 47;
|
||||
SYS_ELNRNG = 48;
|
||||
SYS_EUNATCH = 49;
|
||||
SYS_ENOCSI = 50;
|
||||
SYS_EL2HLT = 51;
|
||||
SYS_EBADE = 52;
|
||||
SYS_EBADR = 53;
|
||||
SYS_EXFULL = 54;
|
||||
SYS_ENOANO = 55;
|
||||
SYS_EBADRQC = 56;
|
||||
SYS_EBADSLT = 57;
|
||||
SYS_EBFONT = 59;
|
||||
SYS_ENOSTR = 60;
|
||||
SYS_ENODATA = 61;
|
||||
SYS_ETIME = 62;
|
||||
SYS_ENOSR = 63;
|
||||
SYS_ENONET = 64;
|
||||
SYS_ENOPKG = 65;
|
||||
SYS_EREMOTE = 66;
|
||||
SYS_ENOLINK = 67;
|
||||
SYS_EADV = 68;
|
||||
SYS_ESRMNT = 69;
|
||||
SYS_ECOMM = 70;
|
||||
SYS_EPROTO = 71;
|
||||
SYS_EMULTIHOP = 72;
|
||||
SYS_EDOTDOT = 73;
|
||||
SYS_EBADMSG = 74;
|
||||
SYS_EOVERFLOW = 75;
|
||||
SYS_ENOTUNIQ = 76;
|
||||
SYS_EBADFD = 77;
|
||||
SYS_EREMCHG = 78;
|
||||
SYS_ELIBACC = 79;
|
||||
SYS_ELIBBAD = 80;
|
||||
SYS_ELIBSCN = 81;
|
||||
SYS_ELIBMAX = 82;
|
||||
SYS_ELIBEXEC = 83;
|
||||
SYS_EILSEQ = 84;
|
||||
SYS_ERESTART = 85;
|
||||
SYS_ESTRPIPE = 86;
|
||||
SYS_EUSERS = 87;
|
||||
SYS_ENOTSOCK = 88;
|
||||
SYS_EDESTADDRREQ = 89;
|
||||
SYS_EMSGSIZE = 90;
|
||||
SYS_EPROTOTYPE = 91;
|
||||
SYS_ENOPROTOOPT = 92;
|
||||
SYS_EPROTONOSUPPORT = 93;
|
||||
SYS_ESOCKTNOSUPPORT = 94;
|
||||
SYS_EOPNOTSUPP = 95;
|
||||
SYS_ENOTSUP = 95;
|
||||
SYS_EPFNOSUPPORT = 96;
|
||||
SYS_EAFNOSUPPORT = 97;
|
||||
SYS_EADDRINUSE = 98;
|
||||
SYS_EADDRNOTAVAIL = 99;
|
||||
SYS_ENETDOWN = 100;
|
||||
SYS_ENETUNREACH = 101;
|
||||
SYS_ENETRESET = 102;
|
||||
SYS_ECONNABORTED = 103;
|
||||
SYS_ECONNRESET = 104;
|
||||
SYS_ENOBUFS = 105;
|
||||
SYS_EISCONN = 106;
|
||||
SYS_ENOTCONN = 107;
|
||||
SYS_ESHUTDOWN = 108;
|
||||
SYS_ETOOMANYREFS = 109;
|
||||
SYS_ETIMEDOUT = 110;
|
||||
SYS_ECONNREFUSED = 111;
|
||||
SYS_EHOSTDOWN = 112;
|
||||
SYS_EHOSTUNREACH = 113;
|
||||
SYS_EALREADY = 114;
|
||||
SYS_EINPROGRESS = 115;
|
||||
SYS_ESTALE = 116;
|
||||
SYS_EUCLEAN = 117;
|
||||
SYS_ENOTNAM = 118;
|
||||
SYS_ENAVAIL = 119;
|
||||
SYS_EISNAM = 120;
|
||||
SYS_EREMOTEIO = 121;
|
||||
SYS_EDQUOT = 122;
|
||||
SYS_ENOMEDIUM = 123;
|
||||
SYS_EMEDIUMTYPE = 124;
|
||||
SYS_ECANCELED = 125;
|
||||
SYS_ENOKEY = 126;
|
||||
SYS_EKEYEXPIRED = 127;
|
||||
SYS_EKEYREVOKED = 128;
|
||||
SYS_EKEYREJECTED = 129;
|
||||
SYS_EOWNERDEAD = 130;
|
||||
SYS_ENOTRECOVERABLE = 131;
|
||||
SYS_ERFKILL = 132;
|
||||
}
|
||||
|
||||
optional int32 system_error = 1 [default=0];
|
||||
optional string error_detail = 2;
|
||||
}
|
||||
|
||||
message AddressPort {
|
||||
required int32 port = 1;
|
||||
optional bytes packed_address = 2;
|
||||
|
||||
optional string hostname_hint = 3;
|
||||
}
|
||||
|
||||
|
||||
|
||||
message CreateSocketRequest {
|
||||
enum SocketFamily {
|
||||
IPv4 = 1;
|
||||
IPv6 = 2;
|
||||
}
|
||||
|
||||
enum SocketProtocol {
|
||||
TCP = 1;
|
||||
UDP = 2;
|
||||
}
|
||||
|
||||
required SocketFamily family = 1;
|
||||
required SocketProtocol protocol = 2;
|
||||
|
||||
repeated SocketOption socket_options = 3;
|
||||
|
||||
optional AddressPort proxy_external_ip = 4;
|
||||
|
||||
optional int32 listen_backlog = 5 [default=0];
|
||||
|
||||
optional AddressPort remote_ip = 6;
|
||||
|
||||
optional string app_id = 9;
|
||||
|
||||
optional int64 project_id = 10;
|
||||
}
|
||||
|
||||
message CreateSocketReply {
|
||||
optional string socket_descriptor = 1;
|
||||
|
||||
optional AddressPort server_address = 3;
|
||||
|
||||
optional AddressPort proxy_external_ip = 4;
|
||||
|
||||
extensions 1000 to max;
|
||||
}
|
||||
|
||||
|
||||
|
||||
message BindRequest {
|
||||
required string socket_descriptor = 1;
|
||||
required AddressPort proxy_external_ip = 2;
|
||||
}
|
||||
|
||||
message BindReply {
|
||||
optional AddressPort proxy_external_ip = 1;
|
||||
}
|
||||
|
||||
|
||||
|
||||
message GetSocketNameRequest {
|
||||
required string socket_descriptor = 1;
|
||||
}
|
||||
|
||||
message GetSocketNameReply {
|
||||
optional AddressPort proxy_external_ip = 2;
|
||||
}
|
||||
|
||||
|
||||
|
||||
message GetPeerNameRequest {
|
||||
required string socket_descriptor = 1;
|
||||
}
|
||||
|
||||
message GetPeerNameReply {
|
||||
optional AddressPort peer_ip = 2;
|
||||
}
|
||||
|
||||
|
||||
message SocketOption {
|
||||
|
||||
enum SocketOptionLevel {
|
||||
SOCKET_SOL_IP = 0;
|
||||
SOCKET_SOL_SOCKET = 1;
|
||||
SOCKET_SOL_TCP = 6;
|
||||
SOCKET_SOL_UDP = 17;
|
||||
}
|
||||
|
||||
enum SocketOptionName {
|
||||
option allow_alias = true;
|
||||
|
||||
SOCKET_SO_DEBUG = 1;
|
||||
SOCKET_SO_REUSEADDR = 2;
|
||||
SOCKET_SO_TYPE = 3;
|
||||
SOCKET_SO_ERROR = 4;
|
||||
SOCKET_SO_DONTROUTE = 5;
|
||||
SOCKET_SO_BROADCAST = 6;
|
||||
SOCKET_SO_SNDBUF = 7;
|
||||
SOCKET_SO_RCVBUF = 8;
|
||||
SOCKET_SO_KEEPALIVE = 9;
|
||||
SOCKET_SO_OOBINLINE = 10;
|
||||
SOCKET_SO_LINGER = 13;
|
||||
SOCKET_SO_RCVTIMEO = 20;
|
||||
SOCKET_SO_SNDTIMEO = 21;
|
||||
|
||||
SOCKET_IP_TOS = 1;
|
||||
SOCKET_IP_TTL = 2;
|
||||
SOCKET_IP_HDRINCL = 3;
|
||||
SOCKET_IP_OPTIONS = 4;
|
||||
|
||||
SOCKET_TCP_NODELAY = 1;
|
||||
SOCKET_TCP_MAXSEG = 2;
|
||||
SOCKET_TCP_CORK = 3;
|
||||
SOCKET_TCP_KEEPIDLE = 4;
|
||||
SOCKET_TCP_KEEPINTVL = 5;
|
||||
SOCKET_TCP_KEEPCNT = 6;
|
||||
SOCKET_TCP_SYNCNT = 7;
|
||||
SOCKET_TCP_LINGER2 = 8;
|
||||
SOCKET_TCP_DEFER_ACCEPT = 9;
|
||||
SOCKET_TCP_WINDOW_CLAMP = 10;
|
||||
SOCKET_TCP_INFO = 11;
|
||||
SOCKET_TCP_QUICKACK = 12;
|
||||
}
|
||||
|
||||
required SocketOptionLevel level = 1;
|
||||
required SocketOptionName option = 2;
|
||||
required bytes value = 3;
|
||||
}
|
||||
|
||||
|
||||
message SetSocketOptionsRequest {
|
||||
required string socket_descriptor = 1;
|
||||
repeated SocketOption options = 2;
|
||||
}
|
||||
|
||||
message SetSocketOptionsReply {
|
||||
}
|
||||
|
||||
message GetSocketOptionsRequest {
|
||||
required string socket_descriptor = 1;
|
||||
repeated SocketOption options = 2;
|
||||
}
|
||||
|
||||
message GetSocketOptionsReply {
|
||||
repeated SocketOption options = 2;
|
||||
}
|
||||
|
||||
|
||||
message ConnectRequest {
|
||||
required string socket_descriptor = 1;
|
||||
required AddressPort remote_ip = 2;
|
||||
optional double timeout_seconds = 3 [default=-1];
|
||||
}
|
||||
|
||||
message ConnectReply {
|
||||
optional AddressPort proxy_external_ip = 1;
|
||||
|
||||
extensions 1000 to max;
|
||||
}
|
||||
|
||||
|
||||
message ListenRequest {
|
||||
required string socket_descriptor = 1;
|
||||
required int32 backlog = 2;
|
||||
}
|
||||
|
||||
message ListenReply {
|
||||
}
|
||||
|
||||
|
||||
message AcceptRequest {
|
||||
required string socket_descriptor = 1;
|
||||
optional double timeout_seconds = 2 [default=-1];
|
||||
}
|
||||
|
||||
message AcceptReply {
|
||||
optional bytes new_socket_descriptor = 2;
|
||||
optional AddressPort remote_address = 3;
|
||||
}
|
||||
|
||||
|
||||
|
||||
message ShutDownRequest {
|
||||
enum How {
|
||||
SOCKET_SHUT_RD = 1;
|
||||
SOCKET_SHUT_WR = 2;
|
||||
SOCKET_SHUT_RDWR = 3;
|
||||
}
|
||||
required string socket_descriptor = 1;
|
||||
required How how = 2;
|
||||
required int64 send_offset = 3;
|
||||
}
|
||||
|
||||
message ShutDownReply {
|
||||
}
|
||||
|
||||
|
||||
|
||||
message CloseRequest {
|
||||
required string socket_descriptor = 1;
|
||||
optional int64 send_offset = 2 [default=-1];
|
||||
}
|
||||
|
||||
message CloseReply {
|
||||
}
|
||||
|
||||
|
||||
|
||||
message SendRequest {
|
||||
required string socket_descriptor = 1;
|
||||
required bytes data = 2 [ctype=CORD];
|
||||
required int64 stream_offset = 3;
|
||||
optional int32 flags = 4 [default=0];
|
||||
optional AddressPort send_to = 5;
|
||||
optional double timeout_seconds = 6 [default=-1];
|
||||
}
|
||||
|
||||
message SendReply {
|
||||
optional int32 data_sent = 1;
|
||||
}
|
||||
|
||||
|
||||
message ReceiveRequest {
|
||||
enum Flags {
|
||||
MSG_OOB = 1;
|
||||
MSG_PEEK = 2;
|
||||
}
|
||||
required string socket_descriptor = 1;
|
||||
required int32 data_size = 2;
|
||||
optional int32 flags = 3 [default=0];
|
||||
optional double timeout_seconds = 5 [default=-1];
|
||||
}
|
||||
|
||||
message ReceiveReply {
|
||||
optional int64 stream_offset = 2;
|
||||
optional bytes data = 3 [ctype=CORD];
|
||||
optional AddressPort received_from = 4;
|
||||
optional int32 buffer_size = 5;
|
||||
}
|
||||
|
||||
|
||||
|
||||
message PollEvent {
|
||||
|
||||
enum PollEventFlag {
|
||||
SOCKET_POLLNONE = 0;
|
||||
SOCKET_POLLIN = 1;
|
||||
SOCKET_POLLPRI = 2;
|
||||
SOCKET_POLLOUT = 4;
|
||||
SOCKET_POLLERR = 8;
|
||||
SOCKET_POLLHUP = 16;
|
||||
SOCKET_POLLNVAL = 32;
|
||||
SOCKET_POLLRDNORM = 64;
|
||||
SOCKET_POLLRDBAND = 128;
|
||||
SOCKET_POLLWRNORM = 256;
|
||||
SOCKET_POLLWRBAND = 512;
|
||||
SOCKET_POLLMSG = 1024;
|
||||
SOCKET_POLLREMOVE = 4096;
|
||||
SOCKET_POLLRDHUP = 8192;
|
||||
};
|
||||
|
||||
required string socket_descriptor = 1;
|
||||
required int32 requested_events = 2;
|
||||
required int32 observed_events = 3;
|
||||
}
|
||||
|
||||
message PollRequest {
|
||||
repeated PollEvent events = 1;
|
||||
optional double timeout_seconds = 2 [default=-1];
|
||||
}
|
||||
|
||||
message PollReply {
|
||||
repeated PollEvent events = 2;
|
||||
}
|
||||
|
||||
message ResolveRequest {
|
||||
required string name = 1;
|
||||
repeated CreateSocketRequest.SocketFamily address_families = 2;
|
||||
}
|
||||
|
||||
message ResolveReply {
|
||||
enum ErrorCode {
|
||||
SOCKET_EAI_ADDRFAMILY = 1;
|
||||
SOCKET_EAI_AGAIN = 2;
|
||||
SOCKET_EAI_BADFLAGS = 3;
|
||||
SOCKET_EAI_FAIL = 4;
|
||||
SOCKET_EAI_FAMILY = 5;
|
||||
SOCKET_EAI_MEMORY = 6;
|
||||
SOCKET_EAI_NODATA = 7;
|
||||
SOCKET_EAI_NONAME = 8;
|
||||
SOCKET_EAI_SERVICE = 9;
|
||||
SOCKET_EAI_SOCKTYPE = 10;
|
||||
SOCKET_EAI_SYSTEM = 11;
|
||||
SOCKET_EAI_BADHINTS = 12;
|
||||
SOCKET_EAI_PROTOCOL = 13;
|
||||
SOCKET_EAI_OVERFLOW = 14;
|
||||
SOCKET_EAI_MAX = 15;
|
||||
};
|
||||
|
||||
repeated bytes packed_address = 2;
|
||||
optional string canonical_name = 3;
|
||||
repeated string aliases = 4;
|
||||
}
|
||||
+198
@@ -0,0 +1,198 @@
|
||||
// Code generated by protoc-gen-go.
|
||||
// source: google.golang.org/appengine/internal/system/system_service.proto
|
||||
// DO NOT EDIT!
|
||||
|
||||
/*
|
||||
Package system is a generated protocol buffer package.
|
||||
|
||||
It is generated from these files:
|
||||
google.golang.org/appengine/internal/system/system_service.proto
|
||||
|
||||
It has these top-level messages:
|
||||
SystemServiceError
|
||||
SystemStat
|
||||
GetSystemStatsRequest
|
||||
GetSystemStatsResponse
|
||||
StartBackgroundRequestRequest
|
||||
StartBackgroundRequestResponse
|
||||
*/
|
||||
package system
|
||||
|
||||
import proto "github.com/golang/protobuf/proto"
|
||||
import fmt "fmt"
|
||||
import math "math"
|
||||
|
||||
// Reference imports to suppress errors if they are not otherwise used.
|
||||
var _ = proto.Marshal
|
||||
var _ = fmt.Errorf
|
||||
var _ = math.Inf
|
||||
|
||||
type SystemServiceError_ErrorCode int32
|
||||
|
||||
const (
|
||||
SystemServiceError_OK SystemServiceError_ErrorCode = 0
|
||||
SystemServiceError_INTERNAL_ERROR SystemServiceError_ErrorCode = 1
|
||||
SystemServiceError_BACKEND_REQUIRED SystemServiceError_ErrorCode = 2
|
||||
SystemServiceError_LIMIT_REACHED SystemServiceError_ErrorCode = 3
|
||||
)
|
||||
|
||||
var SystemServiceError_ErrorCode_name = map[int32]string{
|
||||
0: "OK",
|
||||
1: "INTERNAL_ERROR",
|
||||
2: "BACKEND_REQUIRED",
|
||||
3: "LIMIT_REACHED",
|
||||
}
|
||||
var SystemServiceError_ErrorCode_value = map[string]int32{
|
||||
"OK": 0,
|
||||
"INTERNAL_ERROR": 1,
|
||||
"BACKEND_REQUIRED": 2,
|
||||
"LIMIT_REACHED": 3,
|
||||
}
|
||||
|
||||
func (x SystemServiceError_ErrorCode) Enum() *SystemServiceError_ErrorCode {
|
||||
p := new(SystemServiceError_ErrorCode)
|
||||
*p = x
|
||||
return p
|
||||
}
|
||||
func (x SystemServiceError_ErrorCode) String() string {
|
||||
return proto.EnumName(SystemServiceError_ErrorCode_name, int32(x))
|
||||
}
|
||||
func (x *SystemServiceError_ErrorCode) UnmarshalJSON(data []byte) error {
|
||||
value, err := proto.UnmarshalJSONEnum(SystemServiceError_ErrorCode_value, data, "SystemServiceError_ErrorCode")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
*x = SystemServiceError_ErrorCode(value)
|
||||
return nil
|
||||
}
|
||||
|
||||
type SystemServiceError struct {
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
}
|
||||
|
||||
func (m *SystemServiceError) Reset() { *m = SystemServiceError{} }
|
||||
func (m *SystemServiceError) String() string { return proto.CompactTextString(m) }
|
||||
func (*SystemServiceError) ProtoMessage() {}
|
||||
|
||||
type SystemStat struct {
|
||||
// Instaneous value of this stat.
|
||||
Current *float64 `protobuf:"fixed64,1,opt,name=current" json:"current,omitempty"`
|
||||
// Average over time, if this stat has an instaneous value.
|
||||
Average1M *float64 `protobuf:"fixed64,3,opt,name=average1m" json:"average1m,omitempty"`
|
||||
Average10M *float64 `protobuf:"fixed64,4,opt,name=average10m" json:"average10m,omitempty"`
|
||||
// Total value, if the stat accumulates over time.
|
||||
Total *float64 `protobuf:"fixed64,2,opt,name=total" json:"total,omitempty"`
|
||||
// Rate over time, if this stat accumulates.
|
||||
Rate1M *float64 `protobuf:"fixed64,5,opt,name=rate1m" json:"rate1m,omitempty"`
|
||||
Rate10M *float64 `protobuf:"fixed64,6,opt,name=rate10m" json:"rate10m,omitempty"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
}
|
||||
|
||||
func (m *SystemStat) Reset() { *m = SystemStat{} }
|
||||
func (m *SystemStat) String() string { return proto.CompactTextString(m) }
|
||||
func (*SystemStat) ProtoMessage() {}
|
||||
|
||||
func (m *SystemStat) GetCurrent() float64 {
|
||||
if m != nil && m.Current != nil {
|
||||
return *m.Current
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (m *SystemStat) GetAverage1M() float64 {
|
||||
if m != nil && m.Average1M != nil {
|
||||
return *m.Average1M
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (m *SystemStat) GetAverage10M() float64 {
|
||||
if m != nil && m.Average10M != nil {
|
||||
return *m.Average10M
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (m *SystemStat) GetTotal() float64 {
|
||||
if m != nil && m.Total != nil {
|
||||
return *m.Total
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (m *SystemStat) GetRate1M() float64 {
|
||||
if m != nil && m.Rate1M != nil {
|
||||
return *m.Rate1M
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (m *SystemStat) GetRate10M() float64 {
|
||||
if m != nil && m.Rate10M != nil {
|
||||
return *m.Rate10M
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
type GetSystemStatsRequest struct {
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
}
|
||||
|
||||
func (m *GetSystemStatsRequest) Reset() { *m = GetSystemStatsRequest{} }
|
||||
func (m *GetSystemStatsRequest) String() string { return proto.CompactTextString(m) }
|
||||
func (*GetSystemStatsRequest) ProtoMessage() {}
|
||||
|
||||
type GetSystemStatsResponse struct {
|
||||
// CPU used by this instance, in mcycles.
|
||||
Cpu *SystemStat `protobuf:"bytes,1,opt,name=cpu" json:"cpu,omitempty"`
|
||||
// Physical memory (RAM) used by this instance, in megabytes.
|
||||
Memory *SystemStat `protobuf:"bytes,2,opt,name=memory" json:"memory,omitempty"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
}
|
||||
|
||||
func (m *GetSystemStatsResponse) Reset() { *m = GetSystemStatsResponse{} }
|
||||
func (m *GetSystemStatsResponse) String() string { return proto.CompactTextString(m) }
|
||||
func (*GetSystemStatsResponse) ProtoMessage() {}
|
||||
|
||||
func (m *GetSystemStatsResponse) GetCpu() *SystemStat {
|
||||
if m != nil {
|
||||
return m.Cpu
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *GetSystemStatsResponse) GetMemory() *SystemStat {
|
||||
if m != nil {
|
||||
return m.Memory
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type StartBackgroundRequestRequest struct {
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
}
|
||||
|
||||
func (m *StartBackgroundRequestRequest) Reset() { *m = StartBackgroundRequestRequest{} }
|
||||
func (m *StartBackgroundRequestRequest) String() string { return proto.CompactTextString(m) }
|
||||
func (*StartBackgroundRequestRequest) ProtoMessage() {}
|
||||
|
||||
type StartBackgroundRequestResponse struct {
|
||||
// Every /_ah/background request will have an X-AppEngine-BackgroundRequest
|
||||
// header, whose value will be equal to this parameter, the request_id.
|
||||
RequestId *string `protobuf:"bytes,1,opt,name=request_id" json:"request_id,omitempty"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
}
|
||||
|
||||
func (m *StartBackgroundRequestResponse) Reset() { *m = StartBackgroundRequestResponse{} }
|
||||
func (m *StartBackgroundRequestResponse) String() string { return proto.CompactTextString(m) }
|
||||
func (*StartBackgroundRequestResponse) ProtoMessage() {}
|
||||
|
||||
func (m *StartBackgroundRequestResponse) GetRequestId() string {
|
||||
if m != nil && m.RequestId != nil {
|
||||
return *m.RequestId
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func init() {
|
||||
}
|
||||
+49
@@ -0,0 +1,49 @@
|
||||
syntax = "proto2";
|
||||
option go_package = "system";
|
||||
|
||||
package appengine;
|
||||
|
||||
message SystemServiceError {
|
||||
enum ErrorCode {
|
||||
OK = 0;
|
||||
INTERNAL_ERROR = 1;
|
||||
BACKEND_REQUIRED = 2;
|
||||
LIMIT_REACHED = 3;
|
||||
}
|
||||
}
|
||||
|
||||
message SystemStat {
|
||||
// Instaneous value of this stat.
|
||||
optional double current = 1;
|
||||
|
||||
// Average over time, if this stat has an instaneous value.
|
||||
optional double average1m = 3;
|
||||
optional double average10m = 4;
|
||||
|
||||
// Total value, if the stat accumulates over time.
|
||||
optional double total = 2;
|
||||
|
||||
// Rate over time, if this stat accumulates.
|
||||
optional double rate1m = 5;
|
||||
optional double rate10m = 6;
|
||||
}
|
||||
|
||||
message GetSystemStatsRequest {
|
||||
}
|
||||
|
||||
message GetSystemStatsResponse {
|
||||
// CPU used by this instance, in mcycles.
|
||||
optional SystemStat cpu = 1;
|
||||
|
||||
// Physical memory (RAM) used by this instance, in megabytes.
|
||||
optional SystemStat memory = 2;
|
||||
}
|
||||
|
||||
message StartBackgroundRequestRequest {
|
||||
}
|
||||
|
||||
message StartBackgroundRequestResponse {
|
||||
// Every /_ah/background request will have an X-AppEngine-BackgroundRequest
|
||||
// header, whose value will be equal to this parameter, the request_id.
|
||||
optional string request_id = 1;
|
||||
}
|
||||
+1888
File diff suppressed because it is too large
Load Diff
+342
@@ -0,0 +1,342 @@
|
||||
syntax = "proto2";
|
||||
option go_package = "taskqueue";
|
||||
|
||||
import "google.golang.org/appengine/internal/datastore/datastore_v3.proto";
|
||||
|
||||
package appengine;
|
||||
|
||||
message TaskQueueServiceError {
|
||||
enum ErrorCode {
|
||||
OK = 0;
|
||||
UNKNOWN_QUEUE = 1;
|
||||
TRANSIENT_ERROR = 2;
|
||||
INTERNAL_ERROR = 3;
|
||||
TASK_TOO_LARGE = 4;
|
||||
INVALID_TASK_NAME = 5;
|
||||
INVALID_QUEUE_NAME = 6;
|
||||
INVALID_URL = 7;
|
||||
INVALID_QUEUE_RATE = 8;
|
||||
PERMISSION_DENIED = 9;
|
||||
TASK_ALREADY_EXISTS = 10;
|
||||
TOMBSTONED_TASK = 11;
|
||||
INVALID_ETA = 12;
|
||||
INVALID_REQUEST = 13;
|
||||
UNKNOWN_TASK = 14;
|
||||
TOMBSTONED_QUEUE = 15;
|
||||
DUPLICATE_TASK_NAME = 16;
|
||||
SKIPPED = 17;
|
||||
TOO_MANY_TASKS = 18;
|
||||
INVALID_PAYLOAD = 19;
|
||||
INVALID_RETRY_PARAMETERS = 20;
|
||||
INVALID_QUEUE_MODE = 21;
|
||||
ACL_LOOKUP_ERROR = 22;
|
||||
TRANSACTIONAL_REQUEST_TOO_LARGE = 23;
|
||||
INCORRECT_CREATOR_NAME = 24;
|
||||
TASK_LEASE_EXPIRED = 25;
|
||||
QUEUE_PAUSED = 26;
|
||||
INVALID_TAG = 27;
|
||||
|
||||
// Reserved range for the Datastore error codes.
|
||||
// Original Datastore error code is shifted by DATASTORE_ERROR offset.
|
||||
DATASTORE_ERROR = 10000;
|
||||
}
|
||||
}
|
||||
|
||||
message TaskPayload {
|
||||
extensions 10 to max;
|
||||
option message_set_wire_format = true;
|
||||
}
|
||||
|
||||
message TaskQueueRetryParameters {
|
||||
optional int32 retry_limit = 1;
|
||||
optional int64 age_limit_sec = 2;
|
||||
|
||||
optional double min_backoff_sec = 3 [default = 0.1];
|
||||
optional double max_backoff_sec = 4 [default = 3600];
|
||||
optional int32 max_doublings = 5 [default = 16];
|
||||
}
|
||||
|
||||
message TaskQueueAcl {
|
||||
repeated bytes user_email = 1;
|
||||
repeated bytes writer_email = 2;
|
||||
}
|
||||
|
||||
message TaskQueueHttpHeader {
|
||||
required bytes key = 1;
|
||||
required bytes value = 2;
|
||||
}
|
||||
|
||||
message TaskQueueMode {
|
||||
enum Mode {
|
||||
PUSH = 0;
|
||||
PULL = 1;
|
||||
}
|
||||
}
|
||||
|
||||
message TaskQueueAddRequest {
|
||||
required bytes queue_name = 1;
|
||||
required bytes task_name = 2;
|
||||
required int64 eta_usec = 3;
|
||||
|
||||
enum RequestMethod {
|
||||
GET = 1;
|
||||
POST = 2;
|
||||
HEAD = 3;
|
||||
PUT = 4;
|
||||
DELETE = 5;
|
||||
}
|
||||
optional RequestMethod method = 5 [default=POST];
|
||||
|
||||
optional bytes url = 4;
|
||||
|
||||
repeated group Header = 6 {
|
||||
required bytes key = 7;
|
||||
required bytes value = 8;
|
||||
}
|
||||
|
||||
optional bytes body = 9 [ctype=CORD];
|
||||
optional Transaction transaction = 10;
|
||||
optional bytes app_id = 11;
|
||||
|
||||
optional group CronTimetable = 12 {
|
||||
required bytes schedule = 13;
|
||||
required bytes timezone = 14;
|
||||
}
|
||||
|
||||
optional bytes description = 15;
|
||||
optional TaskPayload payload = 16;
|
||||
optional TaskQueueRetryParameters retry_parameters = 17;
|
||||
optional TaskQueueMode.Mode mode = 18 [default=PUSH];
|
||||
optional bytes tag = 19;
|
||||
}
|
||||
|
||||
message TaskQueueAddResponse {
|
||||
optional bytes chosen_task_name = 1;
|
||||
}
|
||||
|
||||
message TaskQueueBulkAddRequest {
|
||||
repeated TaskQueueAddRequest add_request = 1;
|
||||
}
|
||||
|
||||
message TaskQueueBulkAddResponse {
|
||||
repeated group TaskResult = 1 {
|
||||
required TaskQueueServiceError.ErrorCode result = 2;
|
||||
optional bytes chosen_task_name = 3;
|
||||
}
|
||||
}
|
||||
|
||||
message TaskQueueDeleteRequest {
|
||||
required bytes queue_name = 1;
|
||||
repeated bytes task_name = 2;
|
||||
optional bytes app_id = 3;
|
||||
}
|
||||
|
||||
message TaskQueueDeleteResponse {
|
||||
repeated TaskQueueServiceError.ErrorCode result = 3;
|
||||
}
|
||||
|
||||
message TaskQueueForceRunRequest {
|
||||
optional bytes app_id = 1;
|
||||
required bytes queue_name = 2;
|
||||
required bytes task_name = 3;
|
||||
}
|
||||
|
||||
message TaskQueueForceRunResponse {
|
||||
required TaskQueueServiceError.ErrorCode result = 3;
|
||||
}
|
||||
|
||||
message TaskQueueUpdateQueueRequest {
|
||||
optional bytes app_id = 1;
|
||||
required bytes queue_name = 2;
|
||||
required double bucket_refill_per_second = 3;
|
||||
required int32 bucket_capacity = 4;
|
||||
optional string user_specified_rate = 5;
|
||||
optional TaskQueueRetryParameters retry_parameters = 6;
|
||||
optional int32 max_concurrent_requests = 7;
|
||||
optional TaskQueueMode.Mode mode = 8 [default = PUSH];
|
||||
optional TaskQueueAcl acl = 9;
|
||||
repeated TaskQueueHttpHeader header_override = 10;
|
||||
}
|
||||
|
||||
message TaskQueueUpdateQueueResponse {
|
||||
}
|
||||
|
||||
message TaskQueueFetchQueuesRequest {
|
||||
optional bytes app_id = 1;
|
||||
required int32 max_rows = 2;
|
||||
}
|
||||
|
||||
message TaskQueueFetchQueuesResponse {
|
||||
repeated group Queue = 1 {
|
||||
required bytes queue_name = 2;
|
||||
required double bucket_refill_per_second = 3;
|
||||
required double bucket_capacity = 4;
|
||||
optional string user_specified_rate = 5;
|
||||
required bool paused = 6 [default=false];
|
||||
optional TaskQueueRetryParameters retry_parameters = 7;
|
||||
optional int32 max_concurrent_requests = 8;
|
||||
optional TaskQueueMode.Mode mode = 9 [default = PUSH];
|
||||
optional TaskQueueAcl acl = 10;
|
||||
repeated TaskQueueHttpHeader header_override = 11;
|
||||
optional string creator_name = 12 [ctype=CORD, default="apphosting"];
|
||||
}
|
||||
}
|
||||
|
||||
message TaskQueueFetchQueueStatsRequest {
|
||||
optional bytes app_id = 1;
|
||||
repeated bytes queue_name = 2;
|
||||
optional int32 max_num_tasks = 3 [default = 0];
|
||||
}
|
||||
|
||||
message TaskQueueScannerQueueInfo {
|
||||
required int64 executed_last_minute = 1;
|
||||
required int64 executed_last_hour = 2;
|
||||
required double sampling_duration_seconds = 3;
|
||||
optional int32 requests_in_flight = 4;
|
||||
optional double enforced_rate = 5;
|
||||
}
|
||||
|
||||
message TaskQueueFetchQueueStatsResponse {
|
||||
repeated group QueueStats = 1 {
|
||||
required int32 num_tasks = 2;
|
||||
required int64 oldest_eta_usec = 3;
|
||||
optional TaskQueueScannerQueueInfo scanner_info = 4;
|
||||
}
|
||||
}
|
||||
message TaskQueuePauseQueueRequest {
|
||||
required bytes app_id = 1;
|
||||
required bytes queue_name = 2;
|
||||
required bool pause = 3;
|
||||
}
|
||||
|
||||
message TaskQueuePauseQueueResponse {
|
||||
}
|
||||
|
||||
message TaskQueuePurgeQueueRequest {
|
||||
optional bytes app_id = 1;
|
||||
required bytes queue_name = 2;
|
||||
}
|
||||
|
||||
message TaskQueuePurgeQueueResponse {
|
||||
}
|
||||
|
||||
message TaskQueueDeleteQueueRequest {
|
||||
required bytes app_id = 1;
|
||||
required bytes queue_name = 2;
|
||||
}
|
||||
|
||||
message TaskQueueDeleteQueueResponse {
|
||||
}
|
||||
|
||||
message TaskQueueDeleteGroupRequest {
|
||||
required bytes app_id = 1;
|
||||
}
|
||||
|
||||
message TaskQueueDeleteGroupResponse {
|
||||
}
|
||||
|
||||
message TaskQueueQueryTasksRequest {
|
||||
optional bytes app_id = 1;
|
||||
required bytes queue_name = 2;
|
||||
|
||||
optional bytes start_task_name = 3;
|
||||
optional int64 start_eta_usec = 4;
|
||||
optional bytes start_tag = 6;
|
||||
optional int32 max_rows = 5 [default = 1];
|
||||
}
|
||||
|
||||
message TaskQueueQueryTasksResponse {
|
||||
repeated group Task = 1 {
|
||||
required bytes task_name = 2;
|
||||
required int64 eta_usec = 3;
|
||||
optional bytes url = 4;
|
||||
|
||||
enum RequestMethod {
|
||||
GET = 1;
|
||||
POST = 2;
|
||||
HEAD = 3;
|
||||
PUT = 4;
|
||||
DELETE = 5;
|
||||
}
|
||||
optional RequestMethod method = 5;
|
||||
|
||||
optional int32 retry_count = 6 [default=0];
|
||||
|
||||
repeated group Header = 7 {
|
||||
required bytes key = 8;
|
||||
required bytes value = 9;
|
||||
}
|
||||
|
||||
optional int32 body_size = 10;
|
||||
optional bytes body = 11 [ctype=CORD];
|
||||
required int64 creation_time_usec = 12;
|
||||
|
||||
optional group CronTimetable = 13 {
|
||||
required bytes schedule = 14;
|
||||
required bytes timezone = 15;
|
||||
}
|
||||
|
||||
optional group RunLog = 16 {
|
||||
required int64 dispatched_usec = 17;
|
||||
required int64 lag_usec = 18;
|
||||
required int64 elapsed_usec = 19;
|
||||
optional int64 response_code = 20;
|
||||
optional string retry_reason = 27;
|
||||
}
|
||||
|
||||
optional bytes description = 21;
|
||||
optional TaskPayload payload = 22;
|
||||
optional TaskQueueRetryParameters retry_parameters = 23;
|
||||
optional int64 first_try_usec = 24;
|
||||
optional bytes tag = 25;
|
||||
optional int32 execution_count = 26 [default=0];
|
||||
}
|
||||
}
|
||||
|
||||
message TaskQueueFetchTaskRequest {
|
||||
optional bytes app_id = 1;
|
||||
required bytes queue_name = 2;
|
||||
required bytes task_name = 3;
|
||||
}
|
||||
|
||||
message TaskQueueFetchTaskResponse {
|
||||
required TaskQueueQueryTasksResponse task = 1;
|
||||
}
|
||||
|
||||
message TaskQueueUpdateStorageLimitRequest {
|
||||
required bytes app_id = 1;
|
||||
required int64 limit = 2;
|
||||
}
|
||||
|
||||
message TaskQueueUpdateStorageLimitResponse {
|
||||
required int64 new_limit = 1;
|
||||
}
|
||||
|
||||
message TaskQueueQueryAndOwnTasksRequest {
|
||||
required bytes queue_name = 1;
|
||||
required double lease_seconds = 2;
|
||||
required int64 max_tasks = 3;
|
||||
optional bool group_by_tag = 4 [default=false];
|
||||
optional bytes tag = 5;
|
||||
}
|
||||
|
||||
message TaskQueueQueryAndOwnTasksResponse {
|
||||
repeated group Task = 1 {
|
||||
required bytes task_name = 2;
|
||||
required int64 eta_usec = 3;
|
||||
optional int32 retry_count = 4 [default=0];
|
||||
optional bytes body = 5 [ctype=CORD];
|
||||
optional bytes tag = 6;
|
||||
}
|
||||
}
|
||||
|
||||
message TaskQueueModifyTaskLeaseRequest {
|
||||
required bytes queue_name = 1;
|
||||
required bytes task_name = 2;
|
||||
required int64 eta_usec = 3;
|
||||
required double lease_seconds = 4;
|
||||
}
|
||||
|
||||
message TaskQueueModifyTaskLeaseResponse {
|
||||
required int64 updated_eta_usec = 1;
|
||||
}
|
||||
+355
@@ -0,0 +1,355 @@
|
||||
// Code generated by protoc-gen-go.
|
||||
// source: google.golang.org/appengine/internal/urlfetch/urlfetch_service.proto
|
||||
// DO NOT EDIT!
|
||||
|
||||
/*
|
||||
Package urlfetch is a generated protocol buffer package.
|
||||
|
||||
It is generated from these files:
|
||||
google.golang.org/appengine/internal/urlfetch/urlfetch_service.proto
|
||||
|
||||
It has these top-level messages:
|
||||
URLFetchServiceError
|
||||
URLFetchRequest
|
||||
URLFetchResponse
|
||||
*/
|
||||
package urlfetch
|
||||
|
||||
import proto "github.com/golang/protobuf/proto"
|
||||
import fmt "fmt"
|
||||
import math "math"
|
||||
|
||||
// Reference imports to suppress errors if they are not otherwise used.
|
||||
var _ = proto.Marshal
|
||||
var _ = fmt.Errorf
|
||||
var _ = math.Inf
|
||||
|
||||
type URLFetchServiceError_ErrorCode int32
|
||||
|
||||
const (
|
||||
URLFetchServiceError_OK URLFetchServiceError_ErrorCode = 0
|
||||
URLFetchServiceError_INVALID_URL URLFetchServiceError_ErrorCode = 1
|
||||
URLFetchServiceError_FETCH_ERROR URLFetchServiceError_ErrorCode = 2
|
||||
URLFetchServiceError_UNSPECIFIED_ERROR URLFetchServiceError_ErrorCode = 3
|
||||
URLFetchServiceError_RESPONSE_TOO_LARGE URLFetchServiceError_ErrorCode = 4
|
||||
URLFetchServiceError_DEADLINE_EXCEEDED URLFetchServiceError_ErrorCode = 5
|
||||
URLFetchServiceError_SSL_CERTIFICATE_ERROR URLFetchServiceError_ErrorCode = 6
|
||||
URLFetchServiceError_DNS_ERROR URLFetchServiceError_ErrorCode = 7
|
||||
URLFetchServiceError_CLOSED URLFetchServiceError_ErrorCode = 8
|
||||
URLFetchServiceError_INTERNAL_TRANSIENT_ERROR URLFetchServiceError_ErrorCode = 9
|
||||
URLFetchServiceError_TOO_MANY_REDIRECTS URLFetchServiceError_ErrorCode = 10
|
||||
URLFetchServiceError_MALFORMED_REPLY URLFetchServiceError_ErrorCode = 11
|
||||
URLFetchServiceError_CONNECTION_ERROR URLFetchServiceError_ErrorCode = 12
|
||||
)
|
||||
|
||||
var URLFetchServiceError_ErrorCode_name = map[int32]string{
|
||||
0: "OK",
|
||||
1: "INVALID_URL",
|
||||
2: "FETCH_ERROR",
|
||||
3: "UNSPECIFIED_ERROR",
|
||||
4: "RESPONSE_TOO_LARGE",
|
||||
5: "DEADLINE_EXCEEDED",
|
||||
6: "SSL_CERTIFICATE_ERROR",
|
||||
7: "DNS_ERROR",
|
||||
8: "CLOSED",
|
||||
9: "INTERNAL_TRANSIENT_ERROR",
|
||||
10: "TOO_MANY_REDIRECTS",
|
||||
11: "MALFORMED_REPLY",
|
||||
12: "CONNECTION_ERROR",
|
||||
}
|
||||
var URLFetchServiceError_ErrorCode_value = map[string]int32{
|
||||
"OK": 0,
|
||||
"INVALID_URL": 1,
|
||||
"FETCH_ERROR": 2,
|
||||
"UNSPECIFIED_ERROR": 3,
|
||||
"RESPONSE_TOO_LARGE": 4,
|
||||
"DEADLINE_EXCEEDED": 5,
|
||||
"SSL_CERTIFICATE_ERROR": 6,
|
||||
"DNS_ERROR": 7,
|
||||
"CLOSED": 8,
|
||||
"INTERNAL_TRANSIENT_ERROR": 9,
|
||||
"TOO_MANY_REDIRECTS": 10,
|
||||
"MALFORMED_REPLY": 11,
|
||||
"CONNECTION_ERROR": 12,
|
||||
}
|
||||
|
||||
func (x URLFetchServiceError_ErrorCode) Enum() *URLFetchServiceError_ErrorCode {
|
||||
p := new(URLFetchServiceError_ErrorCode)
|
||||
*p = x
|
||||
return p
|
||||
}
|
||||
func (x URLFetchServiceError_ErrorCode) String() string {
|
||||
return proto.EnumName(URLFetchServiceError_ErrorCode_name, int32(x))
|
||||
}
|
||||
func (x *URLFetchServiceError_ErrorCode) UnmarshalJSON(data []byte) error {
|
||||
value, err := proto.UnmarshalJSONEnum(URLFetchServiceError_ErrorCode_value, data, "URLFetchServiceError_ErrorCode")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
*x = URLFetchServiceError_ErrorCode(value)
|
||||
return nil
|
||||
}
|
||||
|
||||
type URLFetchRequest_RequestMethod int32
|
||||
|
||||
const (
|
||||
URLFetchRequest_GET URLFetchRequest_RequestMethod = 1
|
||||
URLFetchRequest_POST URLFetchRequest_RequestMethod = 2
|
||||
URLFetchRequest_HEAD URLFetchRequest_RequestMethod = 3
|
||||
URLFetchRequest_PUT URLFetchRequest_RequestMethod = 4
|
||||
URLFetchRequest_DELETE URLFetchRequest_RequestMethod = 5
|
||||
URLFetchRequest_PATCH URLFetchRequest_RequestMethod = 6
|
||||
)
|
||||
|
||||
var URLFetchRequest_RequestMethod_name = map[int32]string{
|
||||
1: "GET",
|
||||
2: "POST",
|
||||
3: "HEAD",
|
||||
4: "PUT",
|
||||
5: "DELETE",
|
||||
6: "PATCH",
|
||||
}
|
||||
var URLFetchRequest_RequestMethod_value = map[string]int32{
|
||||
"GET": 1,
|
||||
"POST": 2,
|
||||
"HEAD": 3,
|
||||
"PUT": 4,
|
||||
"DELETE": 5,
|
||||
"PATCH": 6,
|
||||
}
|
||||
|
||||
func (x URLFetchRequest_RequestMethod) Enum() *URLFetchRequest_RequestMethod {
|
||||
p := new(URLFetchRequest_RequestMethod)
|
||||
*p = x
|
||||
return p
|
||||
}
|
||||
func (x URLFetchRequest_RequestMethod) String() string {
|
||||
return proto.EnumName(URLFetchRequest_RequestMethod_name, int32(x))
|
||||
}
|
||||
func (x *URLFetchRequest_RequestMethod) UnmarshalJSON(data []byte) error {
|
||||
value, err := proto.UnmarshalJSONEnum(URLFetchRequest_RequestMethod_value, data, "URLFetchRequest_RequestMethod")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
*x = URLFetchRequest_RequestMethod(value)
|
||||
return nil
|
||||
}
|
||||
|
||||
type URLFetchServiceError struct {
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
}
|
||||
|
||||
func (m *URLFetchServiceError) Reset() { *m = URLFetchServiceError{} }
|
||||
func (m *URLFetchServiceError) String() string { return proto.CompactTextString(m) }
|
||||
func (*URLFetchServiceError) ProtoMessage() {}
|
||||
|
||||
type URLFetchRequest struct {
|
||||
Method *URLFetchRequest_RequestMethod `protobuf:"varint,1,req,name=Method,enum=appengine.URLFetchRequest_RequestMethod" json:"Method,omitempty"`
|
||||
Url *string `protobuf:"bytes,2,req,name=Url" json:"Url,omitempty"`
|
||||
Header []*URLFetchRequest_Header `protobuf:"group,3,rep,name=Header" json:"header,omitempty"`
|
||||
Payload []byte `protobuf:"bytes,6,opt,name=Payload" json:"Payload,omitempty"`
|
||||
FollowRedirects *bool `protobuf:"varint,7,opt,name=FollowRedirects,def=1" json:"FollowRedirects,omitempty"`
|
||||
Deadline *float64 `protobuf:"fixed64,8,opt,name=Deadline" json:"Deadline,omitempty"`
|
||||
MustValidateServerCertificate *bool `protobuf:"varint,9,opt,name=MustValidateServerCertificate,def=1" json:"MustValidateServerCertificate,omitempty"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
}
|
||||
|
||||
func (m *URLFetchRequest) Reset() { *m = URLFetchRequest{} }
|
||||
func (m *URLFetchRequest) String() string { return proto.CompactTextString(m) }
|
||||
func (*URLFetchRequest) ProtoMessage() {}
|
||||
|
||||
const Default_URLFetchRequest_FollowRedirects bool = true
|
||||
const Default_URLFetchRequest_MustValidateServerCertificate bool = true
|
||||
|
||||
func (m *URLFetchRequest) GetMethod() URLFetchRequest_RequestMethod {
|
||||
if m != nil && m.Method != nil {
|
||||
return *m.Method
|
||||
}
|
||||
return URLFetchRequest_GET
|
||||
}
|
||||
|
||||
func (m *URLFetchRequest) GetUrl() string {
|
||||
if m != nil && m.Url != nil {
|
||||
return *m.Url
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *URLFetchRequest) GetHeader() []*URLFetchRequest_Header {
|
||||
if m != nil {
|
||||
return m.Header
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *URLFetchRequest) GetPayload() []byte {
|
||||
if m != nil {
|
||||
return m.Payload
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *URLFetchRequest) GetFollowRedirects() bool {
|
||||
if m != nil && m.FollowRedirects != nil {
|
||||
return *m.FollowRedirects
|
||||
}
|
||||
return Default_URLFetchRequest_FollowRedirects
|
||||
}
|
||||
|
||||
func (m *URLFetchRequest) GetDeadline() float64 {
|
||||
if m != nil && m.Deadline != nil {
|
||||
return *m.Deadline
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (m *URLFetchRequest) GetMustValidateServerCertificate() bool {
|
||||
if m != nil && m.MustValidateServerCertificate != nil {
|
||||
return *m.MustValidateServerCertificate
|
||||
}
|
||||
return Default_URLFetchRequest_MustValidateServerCertificate
|
||||
}
|
||||
|
||||
type URLFetchRequest_Header struct {
|
||||
Key *string `protobuf:"bytes,4,req,name=Key" json:"Key,omitempty"`
|
||||
Value *string `protobuf:"bytes,5,req,name=Value" json:"Value,omitempty"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
}
|
||||
|
||||
func (m *URLFetchRequest_Header) Reset() { *m = URLFetchRequest_Header{} }
|
||||
func (m *URLFetchRequest_Header) String() string { return proto.CompactTextString(m) }
|
||||
func (*URLFetchRequest_Header) ProtoMessage() {}
|
||||
|
||||
func (m *URLFetchRequest_Header) GetKey() string {
|
||||
if m != nil && m.Key != nil {
|
||||
return *m.Key
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *URLFetchRequest_Header) GetValue() string {
|
||||
if m != nil && m.Value != nil {
|
||||
return *m.Value
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type URLFetchResponse struct {
|
||||
Content []byte `protobuf:"bytes,1,opt,name=Content" json:"Content,omitempty"`
|
||||
StatusCode *int32 `protobuf:"varint,2,req,name=StatusCode" json:"StatusCode,omitempty"`
|
||||
Header []*URLFetchResponse_Header `protobuf:"group,3,rep,name=Header" json:"header,omitempty"`
|
||||
ContentWasTruncated *bool `protobuf:"varint,6,opt,name=ContentWasTruncated,def=0" json:"ContentWasTruncated,omitempty"`
|
||||
ExternalBytesSent *int64 `protobuf:"varint,7,opt,name=ExternalBytesSent" json:"ExternalBytesSent,omitempty"`
|
||||
ExternalBytesReceived *int64 `protobuf:"varint,8,opt,name=ExternalBytesReceived" json:"ExternalBytesReceived,omitempty"`
|
||||
FinalUrl *string `protobuf:"bytes,9,opt,name=FinalUrl" json:"FinalUrl,omitempty"`
|
||||
ApiCpuMilliseconds *int64 `protobuf:"varint,10,opt,name=ApiCpuMilliseconds,def=0" json:"ApiCpuMilliseconds,omitempty"`
|
||||
ApiBytesSent *int64 `protobuf:"varint,11,opt,name=ApiBytesSent,def=0" json:"ApiBytesSent,omitempty"`
|
||||
ApiBytesReceived *int64 `protobuf:"varint,12,opt,name=ApiBytesReceived,def=0" json:"ApiBytesReceived,omitempty"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
}
|
||||
|
||||
func (m *URLFetchResponse) Reset() { *m = URLFetchResponse{} }
|
||||
func (m *URLFetchResponse) String() string { return proto.CompactTextString(m) }
|
||||
func (*URLFetchResponse) ProtoMessage() {}
|
||||
|
||||
const Default_URLFetchResponse_ContentWasTruncated bool = false
|
||||
const Default_URLFetchResponse_ApiCpuMilliseconds int64 = 0
|
||||
const Default_URLFetchResponse_ApiBytesSent int64 = 0
|
||||
const Default_URLFetchResponse_ApiBytesReceived int64 = 0
|
||||
|
||||
func (m *URLFetchResponse) GetContent() []byte {
|
||||
if m != nil {
|
||||
return m.Content
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *URLFetchResponse) GetStatusCode() int32 {
|
||||
if m != nil && m.StatusCode != nil {
|
||||
return *m.StatusCode
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (m *URLFetchResponse) GetHeader() []*URLFetchResponse_Header {
|
||||
if m != nil {
|
||||
return m.Header
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *URLFetchResponse) GetContentWasTruncated() bool {
|
||||
if m != nil && m.ContentWasTruncated != nil {
|
||||
return *m.ContentWasTruncated
|
||||
}
|
||||
return Default_URLFetchResponse_ContentWasTruncated
|
||||
}
|
||||
|
||||
func (m *URLFetchResponse) GetExternalBytesSent() int64 {
|
||||
if m != nil && m.ExternalBytesSent != nil {
|
||||
return *m.ExternalBytesSent
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (m *URLFetchResponse) GetExternalBytesReceived() int64 {
|
||||
if m != nil && m.ExternalBytesReceived != nil {
|
||||
return *m.ExternalBytesReceived
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (m *URLFetchResponse) GetFinalUrl() string {
|
||||
if m != nil && m.FinalUrl != nil {
|
||||
return *m.FinalUrl
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *URLFetchResponse) GetApiCpuMilliseconds() int64 {
|
||||
if m != nil && m.ApiCpuMilliseconds != nil {
|
||||
return *m.ApiCpuMilliseconds
|
||||
}
|
||||
return Default_URLFetchResponse_ApiCpuMilliseconds
|
||||
}
|
||||
|
||||
func (m *URLFetchResponse) GetApiBytesSent() int64 {
|
||||
if m != nil && m.ApiBytesSent != nil {
|
||||
return *m.ApiBytesSent
|
||||
}
|
||||
return Default_URLFetchResponse_ApiBytesSent
|
||||
}
|
||||
|
||||
func (m *URLFetchResponse) GetApiBytesReceived() int64 {
|
||||
if m != nil && m.ApiBytesReceived != nil {
|
||||
return *m.ApiBytesReceived
|
||||
}
|
||||
return Default_URLFetchResponse_ApiBytesReceived
|
||||
}
|
||||
|
||||
type URLFetchResponse_Header struct {
|
||||
Key *string `protobuf:"bytes,4,req,name=Key" json:"Key,omitempty"`
|
||||
Value *string `protobuf:"bytes,5,req,name=Value" json:"Value,omitempty"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
}
|
||||
|
||||
func (m *URLFetchResponse_Header) Reset() { *m = URLFetchResponse_Header{} }
|
||||
func (m *URLFetchResponse_Header) String() string { return proto.CompactTextString(m) }
|
||||
func (*URLFetchResponse_Header) ProtoMessage() {}
|
||||
|
||||
func (m *URLFetchResponse_Header) GetKey() string {
|
||||
if m != nil && m.Key != nil {
|
||||
return *m.Key
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *URLFetchResponse_Header) GetValue() string {
|
||||
if m != nil && m.Value != nil {
|
||||
return *m.Value
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func init() {
|
||||
}
|
||||
+64
@@ -0,0 +1,64 @@
|
||||
syntax = "proto2";
|
||||
option go_package = "urlfetch";
|
||||
|
||||
package appengine;
|
||||
|
||||
message URLFetchServiceError {
|
||||
enum ErrorCode {
|
||||
OK = 0;
|
||||
INVALID_URL = 1;
|
||||
FETCH_ERROR = 2;
|
||||
UNSPECIFIED_ERROR = 3;
|
||||
RESPONSE_TOO_LARGE = 4;
|
||||
DEADLINE_EXCEEDED = 5;
|
||||
SSL_CERTIFICATE_ERROR = 6;
|
||||
DNS_ERROR = 7;
|
||||
CLOSED = 8;
|
||||
INTERNAL_TRANSIENT_ERROR = 9;
|
||||
TOO_MANY_REDIRECTS = 10;
|
||||
MALFORMED_REPLY = 11;
|
||||
CONNECTION_ERROR = 12;
|
||||
}
|
||||
}
|
||||
|
||||
message URLFetchRequest {
|
||||
enum RequestMethod {
|
||||
GET = 1;
|
||||
POST = 2;
|
||||
HEAD = 3;
|
||||
PUT = 4;
|
||||
DELETE = 5;
|
||||
PATCH = 6;
|
||||
}
|
||||
required RequestMethod Method = 1;
|
||||
required string Url = 2;
|
||||
repeated group Header = 3 {
|
||||
required string Key = 4;
|
||||
required string Value = 5;
|
||||
}
|
||||
optional bytes Payload = 6 [ctype=CORD];
|
||||
|
||||
optional bool FollowRedirects = 7 [default=true];
|
||||
|
||||
optional double Deadline = 8;
|
||||
|
||||
optional bool MustValidateServerCertificate = 9 [default=true];
|
||||
}
|
||||
|
||||
message URLFetchResponse {
|
||||
optional bytes Content = 1;
|
||||
required int32 StatusCode = 2;
|
||||
repeated group Header = 3 {
|
||||
required string Key = 4;
|
||||
required string Value = 5;
|
||||
}
|
||||
optional bool ContentWasTruncated = 6 [default=false];
|
||||
optional int64 ExternalBytesSent = 7;
|
||||
optional int64 ExternalBytesReceived = 8;
|
||||
|
||||
optional string FinalUrl = 9;
|
||||
|
||||
optional int64 ApiCpuMilliseconds = 10 [default=0];
|
||||
optional int64 ApiBytesSent = 11 [default=0];
|
||||
optional int64 ApiBytesReceived = 12 [default=0];
|
||||
}
|
||||
+289
@@ -0,0 +1,289 @@
|
||||
// Code generated by protoc-gen-go.
|
||||
// source: google.golang.org/appengine/internal/user/user_service.proto
|
||||
// DO NOT EDIT!
|
||||
|
||||
/*
|
||||
Package user is a generated protocol buffer package.
|
||||
|
||||
It is generated from these files:
|
||||
google.golang.org/appengine/internal/user/user_service.proto
|
||||
|
||||
It has these top-level messages:
|
||||
UserServiceError
|
||||
CreateLoginURLRequest
|
||||
CreateLoginURLResponse
|
||||
CreateLogoutURLRequest
|
||||
CreateLogoutURLResponse
|
||||
GetOAuthUserRequest
|
||||
GetOAuthUserResponse
|
||||
CheckOAuthSignatureRequest
|
||||
CheckOAuthSignatureResponse
|
||||
*/
|
||||
package user
|
||||
|
||||
import proto "github.com/golang/protobuf/proto"
|
||||
import fmt "fmt"
|
||||
import math "math"
|
||||
|
||||
// Reference imports to suppress errors if they are not otherwise used.
|
||||
var _ = proto.Marshal
|
||||
var _ = fmt.Errorf
|
||||
var _ = math.Inf
|
||||
|
||||
type UserServiceError_ErrorCode int32
|
||||
|
||||
const (
|
||||
UserServiceError_OK UserServiceError_ErrorCode = 0
|
||||
UserServiceError_REDIRECT_URL_TOO_LONG UserServiceError_ErrorCode = 1
|
||||
UserServiceError_NOT_ALLOWED UserServiceError_ErrorCode = 2
|
||||
UserServiceError_OAUTH_INVALID_TOKEN UserServiceError_ErrorCode = 3
|
||||
UserServiceError_OAUTH_INVALID_REQUEST UserServiceError_ErrorCode = 4
|
||||
UserServiceError_OAUTH_ERROR UserServiceError_ErrorCode = 5
|
||||
)
|
||||
|
||||
var UserServiceError_ErrorCode_name = map[int32]string{
|
||||
0: "OK",
|
||||
1: "REDIRECT_URL_TOO_LONG",
|
||||
2: "NOT_ALLOWED",
|
||||
3: "OAUTH_INVALID_TOKEN",
|
||||
4: "OAUTH_INVALID_REQUEST",
|
||||
5: "OAUTH_ERROR",
|
||||
}
|
||||
var UserServiceError_ErrorCode_value = map[string]int32{
|
||||
"OK": 0,
|
||||
"REDIRECT_URL_TOO_LONG": 1,
|
||||
"NOT_ALLOWED": 2,
|
||||
"OAUTH_INVALID_TOKEN": 3,
|
||||
"OAUTH_INVALID_REQUEST": 4,
|
||||
"OAUTH_ERROR": 5,
|
||||
}
|
||||
|
||||
func (x UserServiceError_ErrorCode) Enum() *UserServiceError_ErrorCode {
|
||||
p := new(UserServiceError_ErrorCode)
|
||||
*p = x
|
||||
return p
|
||||
}
|
||||
func (x UserServiceError_ErrorCode) String() string {
|
||||
return proto.EnumName(UserServiceError_ErrorCode_name, int32(x))
|
||||
}
|
||||
func (x *UserServiceError_ErrorCode) UnmarshalJSON(data []byte) error {
|
||||
value, err := proto.UnmarshalJSONEnum(UserServiceError_ErrorCode_value, data, "UserServiceError_ErrorCode")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
*x = UserServiceError_ErrorCode(value)
|
||||
return nil
|
||||
}
|
||||
|
||||
type UserServiceError struct {
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
}
|
||||
|
||||
func (m *UserServiceError) Reset() { *m = UserServiceError{} }
|
||||
func (m *UserServiceError) String() string { return proto.CompactTextString(m) }
|
||||
func (*UserServiceError) ProtoMessage() {}
|
||||
|
||||
type CreateLoginURLRequest struct {
|
||||
DestinationUrl *string `protobuf:"bytes,1,req,name=destination_url" json:"destination_url,omitempty"`
|
||||
AuthDomain *string `protobuf:"bytes,2,opt,name=auth_domain" json:"auth_domain,omitempty"`
|
||||
FederatedIdentity *string `protobuf:"bytes,3,opt,name=federated_identity,def=" json:"federated_identity,omitempty"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
}
|
||||
|
||||
func (m *CreateLoginURLRequest) Reset() { *m = CreateLoginURLRequest{} }
|
||||
func (m *CreateLoginURLRequest) String() string { return proto.CompactTextString(m) }
|
||||
func (*CreateLoginURLRequest) ProtoMessage() {}
|
||||
|
||||
func (m *CreateLoginURLRequest) GetDestinationUrl() string {
|
||||
if m != nil && m.DestinationUrl != nil {
|
||||
return *m.DestinationUrl
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *CreateLoginURLRequest) GetAuthDomain() string {
|
||||
if m != nil && m.AuthDomain != nil {
|
||||
return *m.AuthDomain
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *CreateLoginURLRequest) GetFederatedIdentity() string {
|
||||
if m != nil && m.FederatedIdentity != nil {
|
||||
return *m.FederatedIdentity
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type CreateLoginURLResponse struct {
|
||||
LoginUrl *string `protobuf:"bytes,1,req,name=login_url" json:"login_url,omitempty"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
}
|
||||
|
||||
func (m *CreateLoginURLResponse) Reset() { *m = CreateLoginURLResponse{} }
|
||||
func (m *CreateLoginURLResponse) String() string { return proto.CompactTextString(m) }
|
||||
func (*CreateLoginURLResponse) ProtoMessage() {}
|
||||
|
||||
func (m *CreateLoginURLResponse) GetLoginUrl() string {
|
||||
if m != nil && m.LoginUrl != nil {
|
||||
return *m.LoginUrl
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type CreateLogoutURLRequest struct {
|
||||
DestinationUrl *string `protobuf:"bytes,1,req,name=destination_url" json:"destination_url,omitempty"`
|
||||
AuthDomain *string `protobuf:"bytes,2,opt,name=auth_domain" json:"auth_domain,omitempty"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
}
|
||||
|
||||
func (m *CreateLogoutURLRequest) Reset() { *m = CreateLogoutURLRequest{} }
|
||||
func (m *CreateLogoutURLRequest) String() string { return proto.CompactTextString(m) }
|
||||
func (*CreateLogoutURLRequest) ProtoMessage() {}
|
||||
|
||||
func (m *CreateLogoutURLRequest) GetDestinationUrl() string {
|
||||
if m != nil && m.DestinationUrl != nil {
|
||||
return *m.DestinationUrl
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *CreateLogoutURLRequest) GetAuthDomain() string {
|
||||
if m != nil && m.AuthDomain != nil {
|
||||
return *m.AuthDomain
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type CreateLogoutURLResponse struct {
|
||||
LogoutUrl *string `protobuf:"bytes,1,req,name=logout_url" json:"logout_url,omitempty"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
}
|
||||
|
||||
func (m *CreateLogoutURLResponse) Reset() { *m = CreateLogoutURLResponse{} }
|
||||
func (m *CreateLogoutURLResponse) String() string { return proto.CompactTextString(m) }
|
||||
func (*CreateLogoutURLResponse) ProtoMessage() {}
|
||||
|
||||
func (m *CreateLogoutURLResponse) GetLogoutUrl() string {
|
||||
if m != nil && m.LogoutUrl != nil {
|
||||
return *m.LogoutUrl
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type GetOAuthUserRequest struct {
|
||||
Scope *string `protobuf:"bytes,1,opt,name=scope" json:"scope,omitempty"`
|
||||
Scopes []string `protobuf:"bytes,2,rep,name=scopes" json:"scopes,omitempty"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
}
|
||||
|
||||
func (m *GetOAuthUserRequest) Reset() { *m = GetOAuthUserRequest{} }
|
||||
func (m *GetOAuthUserRequest) String() string { return proto.CompactTextString(m) }
|
||||
func (*GetOAuthUserRequest) ProtoMessage() {}
|
||||
|
||||
func (m *GetOAuthUserRequest) GetScope() string {
|
||||
if m != nil && m.Scope != nil {
|
||||
return *m.Scope
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *GetOAuthUserRequest) GetScopes() []string {
|
||||
if m != nil {
|
||||
return m.Scopes
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type GetOAuthUserResponse struct {
|
||||
Email *string `protobuf:"bytes,1,req,name=email" json:"email,omitempty"`
|
||||
UserId *string `protobuf:"bytes,2,req,name=user_id" json:"user_id,omitempty"`
|
||||
AuthDomain *string `protobuf:"bytes,3,req,name=auth_domain" json:"auth_domain,omitempty"`
|
||||
UserOrganization *string `protobuf:"bytes,4,opt,name=user_organization,def=" json:"user_organization,omitempty"`
|
||||
IsAdmin *bool `protobuf:"varint,5,opt,name=is_admin,def=0" json:"is_admin,omitempty"`
|
||||
ClientId *string `protobuf:"bytes,6,opt,name=client_id,def=" json:"client_id,omitempty"`
|
||||
Scopes []string `protobuf:"bytes,7,rep,name=scopes" json:"scopes,omitempty"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
}
|
||||
|
||||
func (m *GetOAuthUserResponse) Reset() { *m = GetOAuthUserResponse{} }
|
||||
func (m *GetOAuthUserResponse) String() string { return proto.CompactTextString(m) }
|
||||
func (*GetOAuthUserResponse) ProtoMessage() {}
|
||||
|
||||
const Default_GetOAuthUserResponse_IsAdmin bool = false
|
||||
|
||||
func (m *GetOAuthUserResponse) GetEmail() string {
|
||||
if m != nil && m.Email != nil {
|
||||
return *m.Email
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *GetOAuthUserResponse) GetUserId() string {
|
||||
if m != nil && m.UserId != nil {
|
||||
return *m.UserId
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *GetOAuthUserResponse) GetAuthDomain() string {
|
||||
if m != nil && m.AuthDomain != nil {
|
||||
return *m.AuthDomain
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *GetOAuthUserResponse) GetUserOrganization() string {
|
||||
if m != nil && m.UserOrganization != nil {
|
||||
return *m.UserOrganization
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *GetOAuthUserResponse) GetIsAdmin() bool {
|
||||
if m != nil && m.IsAdmin != nil {
|
||||
return *m.IsAdmin
|
||||
}
|
||||
return Default_GetOAuthUserResponse_IsAdmin
|
||||
}
|
||||
|
||||
func (m *GetOAuthUserResponse) GetClientId() string {
|
||||
if m != nil && m.ClientId != nil {
|
||||
return *m.ClientId
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *GetOAuthUserResponse) GetScopes() []string {
|
||||
if m != nil {
|
||||
return m.Scopes
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type CheckOAuthSignatureRequest struct {
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
}
|
||||
|
||||
func (m *CheckOAuthSignatureRequest) Reset() { *m = CheckOAuthSignatureRequest{} }
|
||||
func (m *CheckOAuthSignatureRequest) String() string { return proto.CompactTextString(m) }
|
||||
func (*CheckOAuthSignatureRequest) ProtoMessage() {}
|
||||
|
||||
type CheckOAuthSignatureResponse struct {
|
||||
OauthConsumerKey *string `protobuf:"bytes,1,req,name=oauth_consumer_key" json:"oauth_consumer_key,omitempty"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
}
|
||||
|
||||
func (m *CheckOAuthSignatureResponse) Reset() { *m = CheckOAuthSignatureResponse{} }
|
||||
func (m *CheckOAuthSignatureResponse) String() string { return proto.CompactTextString(m) }
|
||||
func (*CheckOAuthSignatureResponse) ProtoMessage() {}
|
||||
|
||||
func (m *CheckOAuthSignatureResponse) GetOauthConsumerKey() string {
|
||||
if m != nil && m.OauthConsumerKey != nil {
|
||||
return *m.OauthConsumerKey
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func init() {
|
||||
}
|
||||
+58
@@ -0,0 +1,58 @@
|
||||
syntax = "proto2";
|
||||
option go_package = "user";
|
||||
|
||||
package appengine;
|
||||
|
||||
message UserServiceError {
|
||||
enum ErrorCode {
|
||||
OK = 0;
|
||||
REDIRECT_URL_TOO_LONG = 1;
|
||||
NOT_ALLOWED = 2;
|
||||
OAUTH_INVALID_TOKEN = 3;
|
||||
OAUTH_INVALID_REQUEST = 4;
|
||||
OAUTH_ERROR = 5;
|
||||
}
|
||||
}
|
||||
|
||||
message CreateLoginURLRequest {
|
||||
required string destination_url = 1;
|
||||
optional string auth_domain = 2;
|
||||
optional string federated_identity = 3 [default = ""];
|
||||
}
|
||||
|
||||
message CreateLoginURLResponse {
|
||||
required string login_url = 1;
|
||||
}
|
||||
|
||||
message CreateLogoutURLRequest {
|
||||
required string destination_url = 1;
|
||||
optional string auth_domain = 2;
|
||||
}
|
||||
|
||||
message CreateLogoutURLResponse {
|
||||
required string logout_url = 1;
|
||||
}
|
||||
|
||||
message GetOAuthUserRequest {
|
||||
optional string scope = 1;
|
||||
|
||||
repeated string scopes = 2;
|
||||
}
|
||||
|
||||
message GetOAuthUserResponse {
|
||||
required string email = 1;
|
||||
required string user_id = 2;
|
||||
required string auth_domain = 3;
|
||||
optional string user_organization = 4 [default = ""];
|
||||
optional bool is_admin = 5 [default = false];
|
||||
optional string client_id = 6 [default = ""];
|
||||
|
||||
repeated string scopes = 7;
|
||||
}
|
||||
|
||||
message CheckOAuthSignatureRequest {
|
||||
}
|
||||
|
||||
message CheckOAuthSignatureResponse {
|
||||
required string oauth_consumer_key = 1;
|
||||
}
|
||||
+427
@@ -0,0 +1,427 @@
|
||||
// Code generated by protoc-gen-go.
|
||||
// source: google.golang.org/appengine/internal/xmpp/xmpp_service.proto
|
||||
// DO NOT EDIT!
|
||||
|
||||
/*
|
||||
Package xmpp is a generated protocol buffer package.
|
||||
|
||||
It is generated from these files:
|
||||
google.golang.org/appengine/internal/xmpp/xmpp_service.proto
|
||||
|
||||
It has these top-level messages:
|
||||
XmppServiceError
|
||||
PresenceRequest
|
||||
PresenceResponse
|
||||
BulkPresenceRequest
|
||||
BulkPresenceResponse
|
||||
XmppMessageRequest
|
||||
XmppMessageResponse
|
||||
XmppSendPresenceRequest
|
||||
XmppSendPresenceResponse
|
||||
XmppInviteRequest
|
||||
XmppInviteResponse
|
||||
*/
|
||||
package xmpp
|
||||
|
||||
import proto "github.com/golang/protobuf/proto"
|
||||
import fmt "fmt"
|
||||
import math "math"
|
||||
|
||||
// Reference imports to suppress errors if they are not otherwise used.
|
||||
var _ = proto.Marshal
|
||||
var _ = fmt.Errorf
|
||||
var _ = math.Inf
|
||||
|
||||
type XmppServiceError_ErrorCode int32
|
||||
|
||||
const (
|
||||
XmppServiceError_UNSPECIFIED_ERROR XmppServiceError_ErrorCode = 1
|
||||
XmppServiceError_INVALID_JID XmppServiceError_ErrorCode = 2
|
||||
XmppServiceError_NO_BODY XmppServiceError_ErrorCode = 3
|
||||
XmppServiceError_INVALID_XML XmppServiceError_ErrorCode = 4
|
||||
XmppServiceError_INVALID_TYPE XmppServiceError_ErrorCode = 5
|
||||
XmppServiceError_INVALID_SHOW XmppServiceError_ErrorCode = 6
|
||||
XmppServiceError_EXCEEDED_MAX_SIZE XmppServiceError_ErrorCode = 7
|
||||
XmppServiceError_APPID_ALIAS_REQUIRED XmppServiceError_ErrorCode = 8
|
||||
XmppServiceError_NONDEFAULT_MODULE XmppServiceError_ErrorCode = 9
|
||||
)
|
||||
|
||||
var XmppServiceError_ErrorCode_name = map[int32]string{
|
||||
1: "UNSPECIFIED_ERROR",
|
||||
2: "INVALID_JID",
|
||||
3: "NO_BODY",
|
||||
4: "INVALID_XML",
|
||||
5: "INVALID_TYPE",
|
||||
6: "INVALID_SHOW",
|
||||
7: "EXCEEDED_MAX_SIZE",
|
||||
8: "APPID_ALIAS_REQUIRED",
|
||||
9: "NONDEFAULT_MODULE",
|
||||
}
|
||||
var XmppServiceError_ErrorCode_value = map[string]int32{
|
||||
"UNSPECIFIED_ERROR": 1,
|
||||
"INVALID_JID": 2,
|
||||
"NO_BODY": 3,
|
||||
"INVALID_XML": 4,
|
||||
"INVALID_TYPE": 5,
|
||||
"INVALID_SHOW": 6,
|
||||
"EXCEEDED_MAX_SIZE": 7,
|
||||
"APPID_ALIAS_REQUIRED": 8,
|
||||
"NONDEFAULT_MODULE": 9,
|
||||
}
|
||||
|
||||
func (x XmppServiceError_ErrorCode) Enum() *XmppServiceError_ErrorCode {
|
||||
p := new(XmppServiceError_ErrorCode)
|
||||
*p = x
|
||||
return p
|
||||
}
|
||||
func (x XmppServiceError_ErrorCode) String() string {
|
||||
return proto.EnumName(XmppServiceError_ErrorCode_name, int32(x))
|
||||
}
|
||||
func (x *XmppServiceError_ErrorCode) UnmarshalJSON(data []byte) error {
|
||||
value, err := proto.UnmarshalJSONEnum(XmppServiceError_ErrorCode_value, data, "XmppServiceError_ErrorCode")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
*x = XmppServiceError_ErrorCode(value)
|
||||
return nil
|
||||
}
|
||||
|
||||
type PresenceResponse_SHOW int32
|
||||
|
||||
const (
|
||||
PresenceResponse_NORMAL PresenceResponse_SHOW = 0
|
||||
PresenceResponse_AWAY PresenceResponse_SHOW = 1
|
||||
PresenceResponse_DO_NOT_DISTURB PresenceResponse_SHOW = 2
|
||||
PresenceResponse_CHAT PresenceResponse_SHOW = 3
|
||||
PresenceResponse_EXTENDED_AWAY PresenceResponse_SHOW = 4
|
||||
)
|
||||
|
||||
var PresenceResponse_SHOW_name = map[int32]string{
|
||||
0: "NORMAL",
|
||||
1: "AWAY",
|
||||
2: "DO_NOT_DISTURB",
|
||||
3: "CHAT",
|
||||
4: "EXTENDED_AWAY",
|
||||
}
|
||||
var PresenceResponse_SHOW_value = map[string]int32{
|
||||
"NORMAL": 0,
|
||||
"AWAY": 1,
|
||||
"DO_NOT_DISTURB": 2,
|
||||
"CHAT": 3,
|
||||
"EXTENDED_AWAY": 4,
|
||||
}
|
||||
|
||||
func (x PresenceResponse_SHOW) Enum() *PresenceResponse_SHOW {
|
||||
p := new(PresenceResponse_SHOW)
|
||||
*p = x
|
||||
return p
|
||||
}
|
||||
func (x PresenceResponse_SHOW) String() string {
|
||||
return proto.EnumName(PresenceResponse_SHOW_name, int32(x))
|
||||
}
|
||||
func (x *PresenceResponse_SHOW) UnmarshalJSON(data []byte) error {
|
||||
value, err := proto.UnmarshalJSONEnum(PresenceResponse_SHOW_value, data, "PresenceResponse_SHOW")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
*x = PresenceResponse_SHOW(value)
|
||||
return nil
|
||||
}
|
||||
|
||||
type XmppMessageResponse_XmppMessageStatus int32
|
||||
|
||||
const (
|
||||
XmppMessageResponse_NO_ERROR XmppMessageResponse_XmppMessageStatus = 0
|
||||
XmppMessageResponse_INVALID_JID XmppMessageResponse_XmppMessageStatus = 1
|
||||
XmppMessageResponse_OTHER_ERROR XmppMessageResponse_XmppMessageStatus = 2
|
||||
)
|
||||
|
||||
var XmppMessageResponse_XmppMessageStatus_name = map[int32]string{
|
||||
0: "NO_ERROR",
|
||||
1: "INVALID_JID",
|
||||
2: "OTHER_ERROR",
|
||||
}
|
||||
var XmppMessageResponse_XmppMessageStatus_value = map[string]int32{
|
||||
"NO_ERROR": 0,
|
||||
"INVALID_JID": 1,
|
||||
"OTHER_ERROR": 2,
|
||||
}
|
||||
|
||||
func (x XmppMessageResponse_XmppMessageStatus) Enum() *XmppMessageResponse_XmppMessageStatus {
|
||||
p := new(XmppMessageResponse_XmppMessageStatus)
|
||||
*p = x
|
||||
return p
|
||||
}
|
||||
func (x XmppMessageResponse_XmppMessageStatus) String() string {
|
||||
return proto.EnumName(XmppMessageResponse_XmppMessageStatus_name, int32(x))
|
||||
}
|
||||
func (x *XmppMessageResponse_XmppMessageStatus) UnmarshalJSON(data []byte) error {
|
||||
value, err := proto.UnmarshalJSONEnum(XmppMessageResponse_XmppMessageStatus_value, data, "XmppMessageResponse_XmppMessageStatus")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
*x = XmppMessageResponse_XmppMessageStatus(value)
|
||||
return nil
|
||||
}
|
||||
|
||||
type XmppServiceError struct {
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
}
|
||||
|
||||
func (m *XmppServiceError) Reset() { *m = XmppServiceError{} }
|
||||
func (m *XmppServiceError) String() string { return proto.CompactTextString(m) }
|
||||
func (*XmppServiceError) ProtoMessage() {}
|
||||
|
||||
type PresenceRequest struct {
|
||||
Jid *string `protobuf:"bytes,1,req,name=jid" json:"jid,omitempty"`
|
||||
FromJid *string `protobuf:"bytes,2,opt,name=from_jid" json:"from_jid,omitempty"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
}
|
||||
|
||||
func (m *PresenceRequest) Reset() { *m = PresenceRequest{} }
|
||||
func (m *PresenceRequest) String() string { return proto.CompactTextString(m) }
|
||||
func (*PresenceRequest) ProtoMessage() {}
|
||||
|
||||
func (m *PresenceRequest) GetJid() string {
|
||||
if m != nil && m.Jid != nil {
|
||||
return *m.Jid
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *PresenceRequest) GetFromJid() string {
|
||||
if m != nil && m.FromJid != nil {
|
||||
return *m.FromJid
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type PresenceResponse struct {
|
||||
IsAvailable *bool `protobuf:"varint,1,req,name=is_available" json:"is_available,omitempty"`
|
||||
Presence *PresenceResponse_SHOW `protobuf:"varint,2,opt,name=presence,enum=appengine.PresenceResponse_SHOW" json:"presence,omitempty"`
|
||||
Valid *bool `protobuf:"varint,3,opt,name=valid" json:"valid,omitempty"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
}
|
||||
|
||||
func (m *PresenceResponse) Reset() { *m = PresenceResponse{} }
|
||||
func (m *PresenceResponse) String() string { return proto.CompactTextString(m) }
|
||||
func (*PresenceResponse) ProtoMessage() {}
|
||||
|
||||
func (m *PresenceResponse) GetIsAvailable() bool {
|
||||
if m != nil && m.IsAvailable != nil {
|
||||
return *m.IsAvailable
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func (m *PresenceResponse) GetPresence() PresenceResponse_SHOW {
|
||||
if m != nil && m.Presence != nil {
|
||||
return *m.Presence
|
||||
}
|
||||
return PresenceResponse_NORMAL
|
||||
}
|
||||
|
||||
func (m *PresenceResponse) GetValid() bool {
|
||||
if m != nil && m.Valid != nil {
|
||||
return *m.Valid
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
type BulkPresenceRequest struct {
|
||||
Jid []string `protobuf:"bytes,1,rep,name=jid" json:"jid,omitempty"`
|
||||
FromJid *string `protobuf:"bytes,2,opt,name=from_jid" json:"from_jid,omitempty"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
}
|
||||
|
||||
func (m *BulkPresenceRequest) Reset() { *m = BulkPresenceRequest{} }
|
||||
func (m *BulkPresenceRequest) String() string { return proto.CompactTextString(m) }
|
||||
func (*BulkPresenceRequest) ProtoMessage() {}
|
||||
|
||||
func (m *BulkPresenceRequest) GetJid() []string {
|
||||
if m != nil {
|
||||
return m.Jid
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *BulkPresenceRequest) GetFromJid() string {
|
||||
if m != nil && m.FromJid != nil {
|
||||
return *m.FromJid
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type BulkPresenceResponse struct {
|
||||
PresenceResponse []*PresenceResponse `protobuf:"bytes,1,rep,name=presence_response" json:"presence_response,omitempty"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
}
|
||||
|
||||
func (m *BulkPresenceResponse) Reset() { *m = BulkPresenceResponse{} }
|
||||
func (m *BulkPresenceResponse) String() string { return proto.CompactTextString(m) }
|
||||
func (*BulkPresenceResponse) ProtoMessage() {}
|
||||
|
||||
func (m *BulkPresenceResponse) GetPresenceResponse() []*PresenceResponse {
|
||||
if m != nil {
|
||||
return m.PresenceResponse
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type XmppMessageRequest struct {
|
||||
Jid []string `protobuf:"bytes,1,rep,name=jid" json:"jid,omitempty"`
|
||||
Body *string `protobuf:"bytes,2,req,name=body" json:"body,omitempty"`
|
||||
RawXml *bool `protobuf:"varint,3,opt,name=raw_xml,def=0" json:"raw_xml,omitempty"`
|
||||
Type *string `protobuf:"bytes,4,opt,name=type,def=chat" json:"type,omitempty"`
|
||||
FromJid *string `protobuf:"bytes,5,opt,name=from_jid" json:"from_jid,omitempty"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
}
|
||||
|
||||
func (m *XmppMessageRequest) Reset() { *m = XmppMessageRequest{} }
|
||||
func (m *XmppMessageRequest) String() string { return proto.CompactTextString(m) }
|
||||
func (*XmppMessageRequest) ProtoMessage() {}
|
||||
|
||||
const Default_XmppMessageRequest_RawXml bool = false
|
||||
const Default_XmppMessageRequest_Type string = "chat"
|
||||
|
||||
func (m *XmppMessageRequest) GetJid() []string {
|
||||
if m != nil {
|
||||
return m.Jid
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *XmppMessageRequest) GetBody() string {
|
||||
if m != nil && m.Body != nil {
|
||||
return *m.Body
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *XmppMessageRequest) GetRawXml() bool {
|
||||
if m != nil && m.RawXml != nil {
|
||||
return *m.RawXml
|
||||
}
|
||||
return Default_XmppMessageRequest_RawXml
|
||||
}
|
||||
|
||||
func (m *XmppMessageRequest) GetType() string {
|
||||
if m != nil && m.Type != nil {
|
||||
return *m.Type
|
||||
}
|
||||
return Default_XmppMessageRequest_Type
|
||||
}
|
||||
|
||||
func (m *XmppMessageRequest) GetFromJid() string {
|
||||
if m != nil && m.FromJid != nil {
|
||||
return *m.FromJid
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type XmppMessageResponse struct {
|
||||
Status []XmppMessageResponse_XmppMessageStatus `protobuf:"varint,1,rep,name=status,enum=appengine.XmppMessageResponse_XmppMessageStatus" json:"status,omitempty"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
}
|
||||
|
||||
func (m *XmppMessageResponse) Reset() { *m = XmppMessageResponse{} }
|
||||
func (m *XmppMessageResponse) String() string { return proto.CompactTextString(m) }
|
||||
func (*XmppMessageResponse) ProtoMessage() {}
|
||||
|
||||
func (m *XmppMessageResponse) GetStatus() []XmppMessageResponse_XmppMessageStatus {
|
||||
if m != nil {
|
||||
return m.Status
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type XmppSendPresenceRequest struct {
|
||||
Jid *string `protobuf:"bytes,1,req,name=jid" json:"jid,omitempty"`
|
||||
Type *string `protobuf:"bytes,2,opt,name=type" json:"type,omitempty"`
|
||||
Show *string `protobuf:"bytes,3,opt,name=show" json:"show,omitempty"`
|
||||
Status *string `protobuf:"bytes,4,opt,name=status" json:"status,omitempty"`
|
||||
FromJid *string `protobuf:"bytes,5,opt,name=from_jid" json:"from_jid,omitempty"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
}
|
||||
|
||||
func (m *XmppSendPresenceRequest) Reset() { *m = XmppSendPresenceRequest{} }
|
||||
func (m *XmppSendPresenceRequest) String() string { return proto.CompactTextString(m) }
|
||||
func (*XmppSendPresenceRequest) ProtoMessage() {}
|
||||
|
||||
func (m *XmppSendPresenceRequest) GetJid() string {
|
||||
if m != nil && m.Jid != nil {
|
||||
return *m.Jid
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *XmppSendPresenceRequest) GetType() string {
|
||||
if m != nil && m.Type != nil {
|
||||
return *m.Type
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *XmppSendPresenceRequest) GetShow() string {
|
||||
if m != nil && m.Show != nil {
|
||||
return *m.Show
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *XmppSendPresenceRequest) GetStatus() string {
|
||||
if m != nil && m.Status != nil {
|
||||
return *m.Status
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *XmppSendPresenceRequest) GetFromJid() string {
|
||||
if m != nil && m.FromJid != nil {
|
||||
return *m.FromJid
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type XmppSendPresenceResponse struct {
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
}
|
||||
|
||||
func (m *XmppSendPresenceResponse) Reset() { *m = XmppSendPresenceResponse{} }
|
||||
func (m *XmppSendPresenceResponse) String() string { return proto.CompactTextString(m) }
|
||||
func (*XmppSendPresenceResponse) ProtoMessage() {}
|
||||
|
||||
type XmppInviteRequest struct {
|
||||
Jid *string `protobuf:"bytes,1,req,name=jid" json:"jid,omitempty"`
|
||||
FromJid *string `protobuf:"bytes,2,opt,name=from_jid" json:"from_jid,omitempty"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
}
|
||||
|
||||
func (m *XmppInviteRequest) Reset() { *m = XmppInviteRequest{} }
|
||||
func (m *XmppInviteRequest) String() string { return proto.CompactTextString(m) }
|
||||
func (*XmppInviteRequest) ProtoMessage() {}
|
||||
|
||||
func (m *XmppInviteRequest) GetJid() string {
|
||||
if m != nil && m.Jid != nil {
|
||||
return *m.Jid
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *XmppInviteRequest) GetFromJid() string {
|
||||
if m != nil && m.FromJid != nil {
|
||||
return *m.FromJid
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
type XmppInviteResponse struct {
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
}
|
||||
|
||||
func (m *XmppInviteResponse) Reset() { *m = XmppInviteResponse{} }
|
||||
func (m *XmppInviteResponse) String() string { return proto.CompactTextString(m) }
|
||||
func (*XmppInviteResponse) ProtoMessage() {}
|
||||
|
||||
func init() {
|
||||
}
|
||||
+83
@@ -0,0 +1,83 @@
|
||||
syntax = "proto2";
|
||||
option go_package = "xmpp";
|
||||
|
||||
package appengine;
|
||||
|
||||
message XmppServiceError {
|
||||
enum ErrorCode {
|
||||
UNSPECIFIED_ERROR = 1;
|
||||
INVALID_JID = 2;
|
||||
NO_BODY = 3;
|
||||
INVALID_XML = 4;
|
||||
INVALID_TYPE = 5;
|
||||
INVALID_SHOW = 6;
|
||||
EXCEEDED_MAX_SIZE = 7;
|
||||
APPID_ALIAS_REQUIRED = 8;
|
||||
NONDEFAULT_MODULE = 9;
|
||||
}
|
||||
}
|
||||
|
||||
message PresenceRequest {
|
||||
required string jid = 1;
|
||||
optional string from_jid = 2;
|
||||
}
|
||||
|
||||
message PresenceResponse {
|
||||
enum SHOW {
|
||||
NORMAL = 0;
|
||||
AWAY = 1;
|
||||
DO_NOT_DISTURB = 2;
|
||||
CHAT = 3;
|
||||
EXTENDED_AWAY = 4;
|
||||
}
|
||||
|
||||
required bool is_available = 1;
|
||||
optional SHOW presence = 2;
|
||||
optional bool valid = 3;
|
||||
}
|
||||
|
||||
message BulkPresenceRequest {
|
||||
repeated string jid = 1;
|
||||
optional string from_jid = 2;
|
||||
}
|
||||
|
||||
message BulkPresenceResponse {
|
||||
repeated PresenceResponse presence_response = 1;
|
||||
}
|
||||
|
||||
message XmppMessageRequest {
|
||||
repeated string jid = 1;
|
||||
required string body = 2;
|
||||
optional bool raw_xml = 3 [ default = false ];
|
||||
optional string type = 4 [ default = "chat" ];
|
||||
optional string from_jid = 5;
|
||||
}
|
||||
|
||||
message XmppMessageResponse {
|
||||
enum XmppMessageStatus {
|
||||
NO_ERROR = 0;
|
||||
INVALID_JID = 1;
|
||||
OTHER_ERROR = 2;
|
||||
}
|
||||
|
||||
repeated XmppMessageStatus status = 1;
|
||||
}
|
||||
|
||||
message XmppSendPresenceRequest {
|
||||
required string jid = 1;
|
||||
optional string type = 2;
|
||||
optional string show = 3;
|
||||
optional string status = 4;
|
||||
optional string from_jid = 5;
|
||||
}
|
||||
|
||||
message XmppSendPresenceResponse {
|
||||
}
|
||||
|
||||
message XmppInviteRequest {
|
||||
required string jid = 1;
|
||||
optional string from_jid = 2;
|
||||
}
|
||||
|
||||
message XmppInviteResponse {
|
||||
}
|
||||
Reference in New Issue
Block a user