reconcile merge

Signed-off-by: Huamin Chen <hchen@redhat.com>
This commit is contained in:
Huamin Chen
2019-01-15 16:20:41 +00:00
parent 85b8415024
commit e46099a504
2425 changed files with 271763 additions and 40453 deletions

View File

@ -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)
}

671
vendor/google.golang.org/appengine/internal/api.go generated vendored Normal file
View File

@ -0,0 +1,671 @@
// 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.
// +build !appengine
package internal
import (
"bytes"
"errors"
"fmt"
"io/ioutil"
"log"
"net"
"net/http"
"net/url"
"os"
"runtime"
"strconv"
"strings"
"sync"
"sync/atomic"
"time"
"github.com/golang/protobuf/proto"
netcontext "golang.org/x/net/context"
basepb "google.golang.org/appengine/internal/base"
logpb "google.golang.org/appengine/internal/log"
remotepb "google.golang.org/appengine/internal/remote_api"
)
const (
apiPath = "/rpc_http"
defaultTicketSuffix = "/default.20150612t184001.0"
)
var (
// Incoming headers.
ticketHeader = http.CanonicalHeaderKey("X-AppEngine-API-Ticket")
dapperHeader = http.CanonicalHeaderKey("X-Google-DapperTraceInfo")
traceHeader = http.CanonicalHeaderKey("X-Cloud-Trace-Context")
curNamespaceHeader = http.CanonicalHeaderKey("X-AppEngine-Current-Namespace")
userIPHeader = http.CanonicalHeaderKey("X-AppEngine-User-IP")
remoteAddrHeader = http.CanonicalHeaderKey("X-AppEngine-Remote-Addr")
// Outgoing headers.
apiEndpointHeader = http.CanonicalHeaderKey("X-Google-RPC-Service-Endpoint")
apiEndpointHeaderValue = []string{"app-engine-apis"}
apiMethodHeader = http.CanonicalHeaderKey("X-Google-RPC-Service-Method")
apiMethodHeaderValue = []string{"/VMRemoteAPI.CallRemoteAPI"}
apiDeadlineHeader = http.CanonicalHeaderKey("X-Google-RPC-Service-Deadline")
apiContentType = http.CanonicalHeaderKey("Content-Type")
apiContentTypeValue = []string{"application/octet-stream"}
logFlushHeader = http.CanonicalHeaderKey("X-AppEngine-Log-Flush-Count")
apiHTTPClient = &http.Client{
Transport: &http.Transport{
Proxy: http.ProxyFromEnvironment,
Dial: limitDial,
},
}
defaultTicketOnce sync.Once
defaultTicket string
backgroundContextOnce sync.Once
backgroundContext netcontext.Context
)
func apiURL() *url.URL {
host, port := "appengine.googleapis.internal", "10001"
if h := os.Getenv("API_HOST"); h != "" {
host = h
}
if p := os.Getenv("API_PORT"); p != "" {
port = p
}
return &url.URL{
Scheme: "http",
Host: host + ":" + port,
Path: apiPath,
}
}
func handleHTTP(w http.ResponseWriter, r *http.Request) {
c := &context{
req: r,
outHeader: w.Header(),
apiURL: apiURL(),
}
r = r.WithContext(withContext(r.Context(), c))
c.req = r
stopFlushing := make(chan int)
// Patch up RemoteAddr so it looks reasonable.
if addr := r.Header.Get(userIPHeader); addr != "" {
r.RemoteAddr = addr
} else if addr = r.Header.Get(remoteAddrHeader); addr != "" {
r.RemoteAddr = addr
} else {
// Should not normally reach here, but pick a sensible default anyway.
r.RemoteAddr = "127.0.0.1"
}
// The address in the headers will most likely be of these forms:
// 123.123.123.123
// 2001:db8::1
// net/http.Request.RemoteAddr is specified to be in "IP:port" form.
if _, _, err := net.SplitHostPort(r.RemoteAddr); err != nil {
// Assume the remote address is only a host; add a default port.
r.RemoteAddr = net.JoinHostPort(r.RemoteAddr, "80")
}
// Start goroutine responsible for flushing app logs.
// This is done after adding c to ctx.m (and stopped before removing it)
// because flushing logs requires making an API call.
go c.logFlusher(stopFlushing)
executeRequestSafely(c, r)
c.outHeader = nil // make sure header changes aren't respected any more
stopFlushing <- 1 // any logging beyond this point will be dropped
// Flush any pending logs asynchronously.
c.pendingLogs.Lock()
flushes := c.pendingLogs.flushes
if len(c.pendingLogs.lines) > 0 {
flushes++
}
c.pendingLogs.Unlock()
flushed := make(chan struct{})
go func() {
defer close(flushed)
// Force a log flush, because with very short requests we
// may not ever flush logs.
c.flushLog(true)
}()
w.Header().Set(logFlushHeader, strconv.Itoa(flushes))
// Avoid nil Write call if c.Write is never called.
if c.outCode != 0 {
w.WriteHeader(c.outCode)
}
if c.outBody != nil {
w.Write(c.outBody)
}
// Wait for the last flush to complete before returning,
// otherwise the security ticket will not be valid.
<-flushed
}
func executeRequestSafely(c *context, r *http.Request) {
defer func() {
if x := recover(); x != nil {
logf(c, 4, "%s", renderPanic(x)) // 4 == critical
c.outCode = 500
}
}()
http.DefaultServeMux.ServeHTTP(c, r)
}
func renderPanic(x interface{}) string {
buf := make([]byte, 16<<10) // 16 KB should be plenty
buf = buf[:runtime.Stack(buf, false)]
// Remove the first few stack frames:
// this func
// the recover closure in the caller
// That will root the stack trace at the site of the panic.
const (
skipStart = "internal.renderPanic"
skipFrames = 2
)
start := bytes.Index(buf, []byte(skipStart))
p := start
for i := 0; i < skipFrames*2 && p+1 < len(buf); i++ {
p = bytes.IndexByte(buf[p+1:], '\n') + p + 1
if p < 0 {
break
}
}
if p >= 0 {
// buf[start:p+1] is the block to remove.
// Copy buf[p+1:] over buf[start:] and shrink buf.
copy(buf[start:], buf[p+1:])
buf = buf[:len(buf)-(p+1-start)]
}
// Add panic heading.
head := fmt.Sprintf("panic: %v\n\n", x)
if len(head) > len(buf) {
// Extremely unlikely to happen.
return head
}
copy(buf[len(head):], buf)
copy(buf, head)
return string(buf)
}
// context represents the context of an in-flight HTTP request.
// It implements the appengine.Context and http.ResponseWriter interfaces.
type context struct {
req *http.Request
outCode int
outHeader http.Header
outBody []byte
pendingLogs struct {
sync.Mutex
lines []*logpb.UserAppLogLine
flushes int
}
apiURL *url.URL
}
var contextKey = "holds a *context"
// jointContext joins two contexts in a superficial way.
// It takes values and timeouts from a base context, and only values from another context.
type jointContext struct {
base netcontext.Context
valuesOnly netcontext.Context
}
func (c jointContext) Deadline() (time.Time, bool) {
return c.base.Deadline()
}
func (c jointContext) Done() <-chan struct{} {
return c.base.Done()
}
func (c jointContext) Err() error {
return c.base.Err()
}
func (c jointContext) Value(key interface{}) interface{} {
if val := c.base.Value(key); val != nil {
return val
}
return c.valuesOnly.Value(key)
}
// fromContext returns the App Engine context or nil if ctx is not
// derived from an App Engine context.
func fromContext(ctx netcontext.Context) *context {
c, _ := ctx.Value(&contextKey).(*context)
return c
}
func withContext(parent netcontext.Context, c *context) netcontext.Context {
ctx := netcontext.WithValue(parent, &contextKey, c)
if ns := c.req.Header.Get(curNamespaceHeader); ns != "" {
ctx = withNamespace(ctx, ns)
}
return ctx
}
func toContext(c *context) netcontext.Context {
return withContext(netcontext.Background(), c)
}
func IncomingHeaders(ctx netcontext.Context) http.Header {
if c := fromContext(ctx); c != nil {
return c.req.Header
}
return nil
}
func ReqContext(req *http.Request) netcontext.Context {
return req.Context()
}
func WithContext(parent netcontext.Context, req *http.Request) netcontext.Context {
return jointContext{
base: parent,
valuesOnly: req.Context(),
}
}
// 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 {
backgroundContextOnce.Do(func() {
// Compute background security ticket.
ticket := DefaultTicket()
c := &context{
req: &http.Request{
Header: http.Header{
ticketHeader: []string{ticket},
},
},
apiURL: apiURL(),
}
backgroundContext = toContext(c)
// TODO(dsymonds): Wire up the shutdown handler to do a final flush.
go c.logFlusher(make(chan int))
})
return backgroundContext
}
// RegisterTestRequest registers the HTTP request req for testing, such that
// any API calls are sent to the provided URL. It returns a closure to delete
// the registration.
// It should only be used by aetest package.
func RegisterTestRequest(req *http.Request, apiURL *url.URL, decorate func(netcontext.Context) netcontext.Context) (*http.Request, func()) {
c := &context{
req: req,
apiURL: apiURL,
}
ctx := withContext(decorate(req.Context()), c)
req = req.WithContext(ctx)
c.req = req
return req, func() {}
}
var errTimeout = &CallError{
Detail: "Deadline exceeded",
Code: int32(remotepb.RpcError_CANCELLED),
Timeout: true,
}
func (c *context) Header() http.Header { return c.outHeader }
// Copied from $GOROOT/src/pkg/net/http/transfer.go. Some response status
// codes do not permit a response body (nor response entity headers such as
// Content-Length, Content-Type, etc).
func bodyAllowedForStatus(status int) bool {
switch {
case status >= 100 && status <= 199:
return false
case status == 204:
return false
case status == 304:
return false
}
return true
}
func (c *context) Write(b []byte) (int, error) {
if c.outCode == 0 {
c.WriteHeader(http.StatusOK)
}
if len(b) > 0 && !bodyAllowedForStatus(c.outCode) {
return 0, http.ErrBodyNotAllowed
}
c.outBody = append(c.outBody, b...)
return len(b), nil
}
func (c *context) WriteHeader(code int) {
if c.outCode != 0 {
logf(c, 3, "WriteHeader called multiple times on request.") // error level
return
}
c.outCode = code
}
func (c *context) post(body []byte, timeout time.Duration) (b []byte, err error) {
hreq := &http.Request{
Method: "POST",
URL: c.apiURL,
Header: http.Header{
apiEndpointHeader: apiEndpointHeaderValue,
apiMethodHeader: apiMethodHeaderValue,
apiContentType: apiContentTypeValue,
apiDeadlineHeader: []string{strconv.FormatFloat(timeout.Seconds(), 'f', -1, 64)},
},
Body: ioutil.NopCloser(bytes.NewReader(body)),
ContentLength: int64(len(body)),
Host: c.apiURL.Host,
}
if info := c.req.Header.Get(dapperHeader); info != "" {
hreq.Header.Set(dapperHeader, info)
}
if info := c.req.Header.Get(traceHeader); info != "" {
hreq.Header.Set(traceHeader, info)
}
tr := apiHTTPClient.Transport.(*http.Transport)
var timedOut int32 // atomic; set to 1 if timed out
t := time.AfterFunc(timeout, func() {
atomic.StoreInt32(&timedOut, 1)
tr.CancelRequest(hreq)
})
defer t.Stop()
defer func() {
// Check if timeout was exceeded.
if atomic.LoadInt32(&timedOut) != 0 {
err = errTimeout
}
}()
hresp, err := apiHTTPClient.Do(hreq)
if err != nil {
return nil, &CallError{
Detail: fmt.Sprintf("service bridge HTTP failed: %v", err),
Code: int32(remotepb.RpcError_UNKNOWN),
}
}
defer hresp.Body.Close()
hrespBody, err := ioutil.ReadAll(hresp.Body)
if hresp.StatusCode != 200 {
return nil, &CallError{
Detail: fmt.Sprintf("service bridge returned HTTP %d (%q)", hresp.StatusCode, hrespBody),
Code: int32(remotepb.RpcError_UNKNOWN),
}
}
if err != nil {
return nil, &CallError{
Detail: fmt.Sprintf("service bridge response bad: %v", err),
Code: int32(remotepb.RpcError_UNKNOWN),
}
}
return hrespBody, nil
}
func Call(ctx netcontext.Context, service, method string, in, out proto.Message) error {
if ns := NamespaceFromContext(ctx); ns != "" {
if fn, ok := NamespaceMods[service]; ok {
fn(in, ns)
}
}
if f, ctx, ok := callOverrideFromContext(ctx); ok {
return f(ctx, service, method, in, out)
}
// Handle already-done contexts quickly.
select {
case <-ctx.Done():
return ctx.Err()
default:
}
c := fromContext(ctx)
if c == nil {
// Give a good error message rather than a panic lower down.
return errNotAppEngineContext
}
// Apply transaction modifications if we're in a transaction.
if t := transactionFromContext(ctx); t != nil {
if t.finished {
return errors.New("transaction context has expired")
}
applyTransaction(in, &t.transaction)
}
// Default RPC timeout is 60s.
timeout := 60 * time.Second
if deadline, ok := ctx.Deadline(); ok {
timeout = deadline.Sub(time.Now())
}
data, err := proto.Marshal(in)
if err != nil {
return err
}
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,
Request: data,
RequestId: &ticket,
}
hreqBody, err := proto.Marshal(req)
if err != nil {
return err
}
hrespBody, err := c.post(hreqBody, timeout)
if err != nil {
return err
}
res := &remotepb.Response{}
if err := proto.Unmarshal(hrespBody, res); err != nil {
return err
}
if res.RpcError != nil {
ce := &CallError{
Detail: res.RpcError.GetDetail(),
Code: *res.RpcError.Code,
}
switch remotepb.RpcError_ErrorCode(ce.Code) {
case remotepb.RpcError_CANCELLED, remotepb.RpcError_DEADLINE_EXCEEDED:
ce.Timeout = true
}
return ce
}
if res.ApplicationError != nil {
return &APIError{
Service: *req.ServiceName,
Detail: res.ApplicationError.GetDetail(),
Code: *res.ApplicationError.Code,
}
}
if res.Exception != nil || res.JavaException != nil {
// This shouldn't happen, but let's be defensive.
return &CallError{
Detail: "service bridge returned exception",
Code: int32(remotepb.RpcError_UNKNOWN),
}
}
return proto.Unmarshal(res.Response, out)
}
func (c *context) Request() *http.Request {
return c.req
}
func (c *context) addLogLine(ll *logpb.UserAppLogLine) {
// Truncate long log lines.
// TODO(dsymonds): Check if this is still necessary.
const lim = 8 << 10
if len(*ll.Message) > lim {
suffix := fmt.Sprintf("...(length %d)", len(*ll.Message))
ll.Message = proto.String((*ll.Message)[:lim-len(suffix)] + suffix)
}
c.pendingLogs.Lock()
c.pendingLogs.lines = append(c.pendingLogs.lines, ll)
c.pendingLogs.Unlock()
}
var logLevelName = map[int64]string{
0: "DEBUG",
1: "INFO",
2: "WARNING",
3: "ERROR",
4: "CRITICAL",
}
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{
TimestampUsec: proto.Int64(time.Now().UnixNano() / 1e3),
Level: &level,
Message: &s,
})
// Only duplicate log to stderr if not running on App Engine second generation
if !IsSecondGen() {
log.Print(logLevelName[level] + ": " + s)
}
}
// flushLog attempts to flush any pending logs to the appserver.
// It should not be called concurrently.
func (c *context) flushLog(force bool) (flushed bool) {
c.pendingLogs.Lock()
// Grab up to 30 MB. We can get away with up to 32 MB, but let's be cautious.
n, rem := 0, 30<<20
for ; n < len(c.pendingLogs.lines); n++ {
ll := c.pendingLogs.lines[n]
// Each log line will require about 3 bytes of overhead.
nb := proto.Size(ll) + 3
if nb > rem {
break
}
rem -= nb
}
lines := c.pendingLogs.lines[:n]
c.pendingLogs.lines = c.pendingLogs.lines[n:]
c.pendingLogs.Unlock()
if len(lines) == 0 && !force {
// Nothing to flush.
return false
}
rescueLogs := false
defer func() {
if rescueLogs {
c.pendingLogs.Lock()
c.pendingLogs.lines = append(lines, c.pendingLogs.lines...)
c.pendingLogs.Unlock()
}
}()
buf, err := proto.Marshal(&logpb.UserAppLogGroup{
LogLine: lines,
})
if err != nil {
log.Printf("internal.flushLog: marshaling UserAppLogGroup: %v", err)
rescueLogs = true
return false
}
req := &logpb.FlushRequest{
Logs: buf,
}
res := &basepb.VoidProto{}
c.pendingLogs.Lock()
c.pendingLogs.flushes++
c.pendingLogs.Unlock()
if err := Call(toContext(c), "logservice", "Flush", req, res); err != nil {
log.Printf("internal.flushLog: Flush RPC: %v", err)
rescueLogs = true
return false
}
return true
}
const (
// Log flushing parameters.
flushInterval = 1 * time.Second
forceFlushInterval = 60 * time.Second
)
func (c *context) logFlusher(stop <-chan int) {
lastFlush := time.Now()
tick := time.NewTicker(flushInterval)
for {
select {
case <-stop:
// Request finished.
tick.Stop()
return
case <-tick.C:
force := time.Now().Sub(lastFlush) > forceFlushInterval
if c.flushLog(force) {
lastFlush = time.Now()
}
}
}
}
func ContextForTesting(req *http.Request) netcontext.Context {
return toContext(&context{req: req})
}

View File

@ -0,0 +1,169 @@
// Copyright 2015 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 (
"errors"
"fmt"
"net/http"
"time"
"appengine"
"appengine_internal"
basepb "appengine_internal/base"
"github.com/golang/protobuf/proto"
netcontext "golang.org/x/net/context"
)
var contextKey = "holds an appengine.Context"
// fromContext returns the App Engine context or nil if ctx is not
// derived from an App Engine context.
func fromContext(ctx netcontext.Context) appengine.Context {
c, _ := ctx.Value(&contextKey).(appengine.Context)
return c
}
// This is only for classic App Engine adapters.
func ClassicContextFromContext(ctx netcontext.Context) (appengine.Context, error) {
c := fromContext(ctx)
if c == nil {
return nil, errNotAppEngineContext
}
return c, nil
}
func withContext(parent netcontext.Context, c appengine.Context) netcontext.Context {
ctx := netcontext.WithValue(parent, &contextKey, c)
s := &basepb.StringProto{}
c.Call("__go__", "GetNamespace", &basepb.VoidProto{}, s, nil)
if ns := s.GetValue(); ns != "" {
ctx = NamespacedContext(ctx, ns)
}
return ctx
}
func IncomingHeaders(ctx netcontext.Context) http.Header {
if c := fromContext(ctx); c != nil {
if req, ok := c.Request().(*http.Request); ok {
return req.Header
}
}
return nil
}
func ReqContext(req *http.Request) netcontext.Context {
return WithContext(netcontext.Background(), req)
}
func WithContext(parent netcontext.Context, req *http.Request) netcontext.Context {
c := appengine.NewContext(req)
return withContext(parent, c)
}
type testingContext struct {
appengine.Context
req *http.Request
}
func (t *testingContext) FullyQualifiedAppID() string { return "dev~testcontext" }
func (t *testingContext) Call(service, method string, _, _ appengine_internal.ProtoMessage, _ *appengine_internal.CallOptions) error {
if service == "__go__" && method == "GetNamespace" {
return nil
}
return fmt.Errorf("testingContext: unsupported Call")
}
func (t *testingContext) Request() interface{} { return t.req }
func ContextForTesting(req *http.Request) netcontext.Context {
return withContext(netcontext.Background(), &testingContext{req: req})
}
func Call(ctx netcontext.Context, service, method string, in, out proto.Message) error {
if ns := NamespaceFromContext(ctx); ns != "" {
if fn, ok := NamespaceMods[service]; ok {
fn(in, ns)
}
}
if f, ctx, ok := callOverrideFromContext(ctx); ok {
return f(ctx, service, method, in, out)
}
// Handle already-done contexts quickly.
select {
case <-ctx.Done():
return ctx.Err()
default:
}
c := fromContext(ctx)
if c == nil {
// Give a good error message rather than a panic lower down.
return errNotAppEngineContext
}
// Apply transaction modifications if we're in a transaction.
if t := transactionFromContext(ctx); t != nil {
if t.finished {
return errors.New("transaction context has expired")
}
applyTransaction(in, &t.transaction)
}
var opts *appengine_internal.CallOptions
if d, ok := ctx.Deadline(); ok {
opts = &appengine_internal.CallOptions{
Timeout: d.Sub(time.Now()),
}
}
err := c.Call(service, method, in, out, opts)
switch v := err.(type) {
case *appengine_internal.APIError:
return &APIError{
Service: v.Service,
Detail: v.Detail,
Code: v.Code,
}
case *appengine_internal.CallError:
return &CallError{
Detail: v.Detail,
Code: v.Code,
Timeout: v.Timeout,
}
}
return err
}
func handleHTTP(w http.ResponseWriter, r *http.Request) {
panic("handleHTTP called; this should be impossible")
}
func logf(c appengine.Context, level int64, format string, args ...interface{}) {
var fn func(format string, args ...interface{})
switch level {
case 0:
fn = c.Debugf
case 1:
fn = c.Infof
case 2:
fn = c.Warningf
case 3:
fn = c.Errorf
case 4:
fn = c.Criticalf
default:
// This shouldn't happen.
fn = c.Criticalf
}
fn(format, args...)
}

View File

@ -0,0 +1,123 @@
// Copyright 2015 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 (
"errors"
"os"
"github.com/golang/protobuf/proto"
netcontext "golang.org/x/net/context"
)
var errNotAppEngineContext = errors.New("not an App Engine context")
type CallOverrideFunc func(ctx netcontext.Context, service, method string, in, out proto.Message) error
var callOverrideKey = "holds []CallOverrideFunc"
func WithCallOverride(ctx netcontext.Context, f CallOverrideFunc) netcontext.Context {
// We avoid appending to any existing call override
// so we don't risk overwriting a popped stack below.
var cofs []CallOverrideFunc
if uf, ok := ctx.Value(&callOverrideKey).([]CallOverrideFunc); ok {
cofs = append(cofs, uf...)
}
cofs = append(cofs, f)
return netcontext.WithValue(ctx, &callOverrideKey, cofs)
}
func callOverrideFromContext(ctx netcontext.Context) (CallOverrideFunc, netcontext.Context, bool) {
cofs, _ := ctx.Value(&callOverrideKey).([]CallOverrideFunc)
if len(cofs) == 0 {
return nil, nil, false
}
// We found a list of overrides; grab the last, and reconstitute a
// context that will hide it.
f := cofs[len(cofs)-1]
ctx = netcontext.WithValue(ctx, &callOverrideKey, cofs[:len(cofs)-1])
return f, ctx, true
}
type logOverrideFunc func(level int64, format string, args ...interface{})
var logOverrideKey = "holds a logOverrideFunc"
func WithLogOverride(ctx netcontext.Context, f logOverrideFunc) netcontext.Context {
return netcontext.WithValue(ctx, &logOverrideKey, f)
}
var appIDOverrideKey = "holds a string, being the full app ID"
func WithAppIDOverride(ctx netcontext.Context, appID string) netcontext.Context {
return netcontext.WithValue(ctx, &appIDOverrideKey, appID)
}
var namespaceKey = "holds the namespace string"
func withNamespace(ctx netcontext.Context, ns string) netcontext.Context {
return netcontext.WithValue(ctx, &namespaceKey, ns)
}
func NamespaceFromContext(ctx netcontext.Context) string {
// If there's no namespace, return the empty string.
ns, _ := ctx.Value(&namespaceKey).(string)
return ns
}
// FullyQualifiedAppID returns the fully-qualified application ID.
// This may contain a partition prefix (e.g. "s~" for High Replication apps),
// or a domain prefix (e.g. "example.com:").
func FullyQualifiedAppID(ctx netcontext.Context) string {
if id, ok := ctx.Value(&appIDOverrideKey).(string); ok {
return id
}
return fullyQualifiedAppID(ctx)
}
func Logf(ctx netcontext.Context, level int64, format string, args ...interface{}) {
if f, ok := ctx.Value(&logOverrideKey).(logOverrideFunc); ok {
f(level, format, args...)
return
}
c := fromContext(ctx)
if c == nil {
panic(errNotAppEngineContext)
}
logf(c, level, format, args...)
}
// NamespacedContext wraps a Context to support namespaces.
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)
}
}
}

View File

@ -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 }

500
vendor/google.golang.org/appengine/internal/api_test.go generated vendored Normal file
View File

@ -0,0 +1,500 @@
// 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" && *apiReq.RequestId != DefaultTicket() {
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 TestAPICallTicketUnavailable(t *testing.T) {
resetEnv := SetTestEnv()
defer resetEnv()
_, c, cleanup := setup()
defer cleanup()
c.req.Header.Set(ticketHeader, "")
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("/slow_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)
time.Sleep(1200 * time.Millisecond)
w.Write(make([]byte, 100<<10)) // write 100 KB to force HTTP flush
})
r := &http.Request{
Method: "GET",
URL: &url.URL{
Scheme: "http",
Path: "/slow_log",
},
Header: c.req.Header,
Body: ioutil.NopCloser(bytes.NewReader(nil)),
}
w := httptest.NewRecorder()
handled := make(chan struct{})
go func() {
defer close(handled)
handleHTTP(w, r)
}()
// Check that the log flush eventually comes in.
time.Sleep(1200 * time.Millisecond)
if f := atomic.LoadInt32(&f.LogFlushes); f != 1 {
t.Errorf("After 1.2s: f.LogFlushes = %d, want 1", f)
}
<-handled
const hdr = "X-AppEngine-Log-Flush-Count"
if got, want := w.HeaderMap.Get(hdr), "1"; got != want {
t.Errorf("%s header = %q, want %q", hdr, got, want)
}
if got, want := atomic.LoadInt32(&f.LogFlushes), int32(2); got != want {
t.Errorf("After HTTP response: f.LogFlushes = %d, want %d", got, want)
}
}
func TestLogFlushing(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()
handleHTTP(w, r)
const hdr = "X-AppEngine-Log-Flush-Count"
if got, want := w.HeaderMap.Get(hdr), "1"; got != want {
t.Errorf("%s header = %q, want %q", hdr, got, want)
}
if got, want := atomic.LoadInt32(&f.LogFlushes), int32(1); got != want {
t.Errorf("After HTTP response: f.LogFlushes = %d, want %d", got, want)
}
}
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...
const min, max float64 = 60, 85
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) {
resetEnv := SetTestEnv()
defer resetEnv()
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
}

28
vendor/google.golang.org/appengine/internal/app_id.go generated vendored Normal file
View File

@ -0,0 +1,28 @@
// 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 (
"strings"
)
func parseFullAppID(appid string) (partition, domain, displayID string) {
if i := strings.Index(appid, "~"); i != -1 {
partition, appid = appid[:i], appid[i+1:]
}
if i := strings.Index(appid, ":"); i != -1 {
domain, appid = appid[:i], appid[i+1:]
}
return partition, domain, appid
}
// appID returns "appid" or "domain.com:appid".
func appID(fullAppID string) string {
_, dom, dis := parseFullAppID(fullAppID)
if dom != "" {
return dom + ":" + dis
}
return dis
}

View File

@ -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)
}
}
}

View File

@ -0,0 +1,611 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: google.golang.org/appengine/internal/app_identity/app_identity_service.proto
package app_identity
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
// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
type AppIdentityServiceError_ErrorCode int32
const (
AppIdentityServiceError_SUCCESS AppIdentityServiceError_ErrorCode = 0
AppIdentityServiceError_UNKNOWN_SCOPE AppIdentityServiceError_ErrorCode = 9
AppIdentityServiceError_BLOB_TOO_LARGE AppIdentityServiceError_ErrorCode = 1000
AppIdentityServiceError_DEADLINE_EXCEEDED AppIdentityServiceError_ErrorCode = 1001
AppIdentityServiceError_NOT_A_VALID_APP AppIdentityServiceError_ErrorCode = 1002
AppIdentityServiceError_UNKNOWN_ERROR AppIdentityServiceError_ErrorCode = 1003
AppIdentityServiceError_NOT_ALLOWED AppIdentityServiceError_ErrorCode = 1005
AppIdentityServiceError_NOT_IMPLEMENTED AppIdentityServiceError_ErrorCode = 1006
)
var AppIdentityServiceError_ErrorCode_name = map[int32]string{
0: "SUCCESS",
9: "UNKNOWN_SCOPE",
1000: "BLOB_TOO_LARGE",
1001: "DEADLINE_EXCEEDED",
1002: "NOT_A_VALID_APP",
1003: "UNKNOWN_ERROR",
1005: "NOT_ALLOWED",
1006: "NOT_IMPLEMENTED",
}
var AppIdentityServiceError_ErrorCode_value = map[string]int32{
"SUCCESS": 0,
"UNKNOWN_SCOPE": 9,
"BLOB_TOO_LARGE": 1000,
"DEADLINE_EXCEEDED": 1001,
"NOT_A_VALID_APP": 1002,
"UNKNOWN_ERROR": 1003,
"NOT_ALLOWED": 1005,
"NOT_IMPLEMENTED": 1006,
}
func (x AppIdentityServiceError_ErrorCode) Enum() *AppIdentityServiceError_ErrorCode {
p := new(AppIdentityServiceError_ErrorCode)
*p = x
return p
}
func (x AppIdentityServiceError_ErrorCode) String() string {
return proto.EnumName(AppIdentityServiceError_ErrorCode_name, int32(x))
}
func (x *AppIdentityServiceError_ErrorCode) UnmarshalJSON(data []byte) error {
value, err := proto.UnmarshalJSONEnum(AppIdentityServiceError_ErrorCode_value, data, "AppIdentityServiceError_ErrorCode")
if err != nil {
return err
}
*x = AppIdentityServiceError_ErrorCode(value)
return nil
}
func (AppIdentityServiceError_ErrorCode) EnumDescriptor() ([]byte, []int) {
return fileDescriptor_app_identity_service_08a6e3f74b04cfa4, []int{0, 0}
}
type AppIdentityServiceError struct {
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *AppIdentityServiceError) Reset() { *m = AppIdentityServiceError{} }
func (m *AppIdentityServiceError) String() string { return proto.CompactTextString(m) }
func (*AppIdentityServiceError) ProtoMessage() {}
func (*AppIdentityServiceError) Descriptor() ([]byte, []int) {
return fileDescriptor_app_identity_service_08a6e3f74b04cfa4, []int{0}
}
func (m *AppIdentityServiceError) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_AppIdentityServiceError.Unmarshal(m, b)
}
func (m *AppIdentityServiceError) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_AppIdentityServiceError.Marshal(b, m, deterministic)
}
func (dst *AppIdentityServiceError) XXX_Merge(src proto.Message) {
xxx_messageInfo_AppIdentityServiceError.Merge(dst, src)
}
func (m *AppIdentityServiceError) XXX_Size() int {
return xxx_messageInfo_AppIdentityServiceError.Size(m)
}
func (m *AppIdentityServiceError) XXX_DiscardUnknown() {
xxx_messageInfo_AppIdentityServiceError.DiscardUnknown(m)
}
var xxx_messageInfo_AppIdentityServiceError proto.InternalMessageInfo
type SignForAppRequest struct {
BytesToSign []byte `protobuf:"bytes,1,opt,name=bytes_to_sign,json=bytesToSign" json:"bytes_to_sign,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *SignForAppRequest) Reset() { *m = SignForAppRequest{} }
func (m *SignForAppRequest) String() string { return proto.CompactTextString(m) }
func (*SignForAppRequest) ProtoMessage() {}
func (*SignForAppRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_app_identity_service_08a6e3f74b04cfa4, []int{1}
}
func (m *SignForAppRequest) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_SignForAppRequest.Unmarshal(m, b)
}
func (m *SignForAppRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_SignForAppRequest.Marshal(b, m, deterministic)
}
func (dst *SignForAppRequest) XXX_Merge(src proto.Message) {
xxx_messageInfo_SignForAppRequest.Merge(dst, src)
}
func (m *SignForAppRequest) XXX_Size() int {
return xxx_messageInfo_SignForAppRequest.Size(m)
}
func (m *SignForAppRequest) XXX_DiscardUnknown() {
xxx_messageInfo_SignForAppRequest.DiscardUnknown(m)
}
var xxx_messageInfo_SignForAppRequest proto.InternalMessageInfo
func (m *SignForAppRequest) GetBytesToSign() []byte {
if m != nil {
return m.BytesToSign
}
return nil
}
type SignForAppResponse struct {
KeyName *string `protobuf:"bytes,1,opt,name=key_name,json=keyName" json:"key_name,omitempty"`
SignatureBytes []byte `protobuf:"bytes,2,opt,name=signature_bytes,json=signatureBytes" json:"signature_bytes,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *SignForAppResponse) Reset() { *m = SignForAppResponse{} }
func (m *SignForAppResponse) String() string { return proto.CompactTextString(m) }
func (*SignForAppResponse) ProtoMessage() {}
func (*SignForAppResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_app_identity_service_08a6e3f74b04cfa4, []int{2}
}
func (m *SignForAppResponse) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_SignForAppResponse.Unmarshal(m, b)
}
func (m *SignForAppResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_SignForAppResponse.Marshal(b, m, deterministic)
}
func (dst *SignForAppResponse) XXX_Merge(src proto.Message) {
xxx_messageInfo_SignForAppResponse.Merge(dst, src)
}
func (m *SignForAppResponse) XXX_Size() int {
return xxx_messageInfo_SignForAppResponse.Size(m)
}
func (m *SignForAppResponse) XXX_DiscardUnknown() {
xxx_messageInfo_SignForAppResponse.DiscardUnknown(m)
}
var xxx_messageInfo_SignForAppResponse proto.InternalMessageInfo
func (m *SignForAppResponse) GetKeyName() string {
if m != nil && m.KeyName != nil {
return *m.KeyName
}
return ""
}
func (m *SignForAppResponse) GetSignatureBytes() []byte {
if m != nil {
return m.SignatureBytes
}
return nil
}
type GetPublicCertificateForAppRequest struct {
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *GetPublicCertificateForAppRequest) Reset() { *m = GetPublicCertificateForAppRequest{} }
func (m *GetPublicCertificateForAppRequest) String() string { return proto.CompactTextString(m) }
func (*GetPublicCertificateForAppRequest) ProtoMessage() {}
func (*GetPublicCertificateForAppRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_app_identity_service_08a6e3f74b04cfa4, []int{3}
}
func (m *GetPublicCertificateForAppRequest) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_GetPublicCertificateForAppRequest.Unmarshal(m, b)
}
func (m *GetPublicCertificateForAppRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_GetPublicCertificateForAppRequest.Marshal(b, m, deterministic)
}
func (dst *GetPublicCertificateForAppRequest) XXX_Merge(src proto.Message) {
xxx_messageInfo_GetPublicCertificateForAppRequest.Merge(dst, src)
}
func (m *GetPublicCertificateForAppRequest) XXX_Size() int {
return xxx_messageInfo_GetPublicCertificateForAppRequest.Size(m)
}
func (m *GetPublicCertificateForAppRequest) XXX_DiscardUnknown() {
xxx_messageInfo_GetPublicCertificateForAppRequest.DiscardUnknown(m)
}
var xxx_messageInfo_GetPublicCertificateForAppRequest proto.InternalMessageInfo
type PublicCertificate struct {
KeyName *string `protobuf:"bytes,1,opt,name=key_name,json=keyName" json:"key_name,omitempty"`
X509CertificatePem *string `protobuf:"bytes,2,opt,name=x509_certificate_pem,json=x509CertificatePem" json:"x509_certificate_pem,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *PublicCertificate) Reset() { *m = PublicCertificate{} }
func (m *PublicCertificate) String() string { return proto.CompactTextString(m) }
func (*PublicCertificate) ProtoMessage() {}
func (*PublicCertificate) Descriptor() ([]byte, []int) {
return fileDescriptor_app_identity_service_08a6e3f74b04cfa4, []int{4}
}
func (m *PublicCertificate) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_PublicCertificate.Unmarshal(m, b)
}
func (m *PublicCertificate) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_PublicCertificate.Marshal(b, m, deterministic)
}
func (dst *PublicCertificate) XXX_Merge(src proto.Message) {
xxx_messageInfo_PublicCertificate.Merge(dst, src)
}
func (m *PublicCertificate) XXX_Size() int {
return xxx_messageInfo_PublicCertificate.Size(m)
}
func (m *PublicCertificate) XXX_DiscardUnknown() {
xxx_messageInfo_PublicCertificate.DiscardUnknown(m)
}
var xxx_messageInfo_PublicCertificate proto.InternalMessageInfo
func (m *PublicCertificate) GetKeyName() string {
if m != nil && m.KeyName != nil {
return *m.KeyName
}
return ""
}
func (m *PublicCertificate) GetX509CertificatePem() string {
if m != nil && m.X509CertificatePem != nil {
return *m.X509CertificatePem
}
return ""
}
type GetPublicCertificateForAppResponse struct {
PublicCertificateList []*PublicCertificate `protobuf:"bytes,1,rep,name=public_certificate_list,json=publicCertificateList" json:"public_certificate_list,omitempty"`
MaxClientCacheTimeInSecond *int64 `protobuf:"varint,2,opt,name=max_client_cache_time_in_second,json=maxClientCacheTimeInSecond" json:"max_client_cache_time_in_second,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *GetPublicCertificateForAppResponse) Reset() { *m = GetPublicCertificateForAppResponse{} }
func (m *GetPublicCertificateForAppResponse) String() string { return proto.CompactTextString(m) }
func (*GetPublicCertificateForAppResponse) ProtoMessage() {}
func (*GetPublicCertificateForAppResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_app_identity_service_08a6e3f74b04cfa4, []int{5}
}
func (m *GetPublicCertificateForAppResponse) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_GetPublicCertificateForAppResponse.Unmarshal(m, b)
}
func (m *GetPublicCertificateForAppResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_GetPublicCertificateForAppResponse.Marshal(b, m, deterministic)
}
func (dst *GetPublicCertificateForAppResponse) XXX_Merge(src proto.Message) {
xxx_messageInfo_GetPublicCertificateForAppResponse.Merge(dst, src)
}
func (m *GetPublicCertificateForAppResponse) XXX_Size() int {
return xxx_messageInfo_GetPublicCertificateForAppResponse.Size(m)
}
func (m *GetPublicCertificateForAppResponse) XXX_DiscardUnknown() {
xxx_messageInfo_GetPublicCertificateForAppResponse.DiscardUnknown(m)
}
var xxx_messageInfo_GetPublicCertificateForAppResponse proto.InternalMessageInfo
func (m *GetPublicCertificateForAppResponse) GetPublicCertificateList() []*PublicCertificate {
if m != nil {
return m.PublicCertificateList
}
return nil
}
func (m *GetPublicCertificateForAppResponse) GetMaxClientCacheTimeInSecond() int64 {
if m != nil && m.MaxClientCacheTimeInSecond != nil {
return *m.MaxClientCacheTimeInSecond
}
return 0
}
type GetServiceAccountNameRequest struct {
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *GetServiceAccountNameRequest) Reset() { *m = GetServiceAccountNameRequest{} }
func (m *GetServiceAccountNameRequest) String() string { return proto.CompactTextString(m) }
func (*GetServiceAccountNameRequest) ProtoMessage() {}
func (*GetServiceAccountNameRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_app_identity_service_08a6e3f74b04cfa4, []int{6}
}
func (m *GetServiceAccountNameRequest) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_GetServiceAccountNameRequest.Unmarshal(m, b)
}
func (m *GetServiceAccountNameRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_GetServiceAccountNameRequest.Marshal(b, m, deterministic)
}
func (dst *GetServiceAccountNameRequest) XXX_Merge(src proto.Message) {
xxx_messageInfo_GetServiceAccountNameRequest.Merge(dst, src)
}
func (m *GetServiceAccountNameRequest) XXX_Size() int {
return xxx_messageInfo_GetServiceAccountNameRequest.Size(m)
}
func (m *GetServiceAccountNameRequest) XXX_DiscardUnknown() {
xxx_messageInfo_GetServiceAccountNameRequest.DiscardUnknown(m)
}
var xxx_messageInfo_GetServiceAccountNameRequest proto.InternalMessageInfo
type GetServiceAccountNameResponse struct {
ServiceAccountName *string `protobuf:"bytes,1,opt,name=service_account_name,json=serviceAccountName" json:"service_account_name,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *GetServiceAccountNameResponse) Reset() { *m = GetServiceAccountNameResponse{} }
func (m *GetServiceAccountNameResponse) String() string { return proto.CompactTextString(m) }
func (*GetServiceAccountNameResponse) ProtoMessage() {}
func (*GetServiceAccountNameResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_app_identity_service_08a6e3f74b04cfa4, []int{7}
}
func (m *GetServiceAccountNameResponse) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_GetServiceAccountNameResponse.Unmarshal(m, b)
}
func (m *GetServiceAccountNameResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_GetServiceAccountNameResponse.Marshal(b, m, deterministic)
}
func (dst *GetServiceAccountNameResponse) XXX_Merge(src proto.Message) {
xxx_messageInfo_GetServiceAccountNameResponse.Merge(dst, src)
}
func (m *GetServiceAccountNameResponse) XXX_Size() int {
return xxx_messageInfo_GetServiceAccountNameResponse.Size(m)
}
func (m *GetServiceAccountNameResponse) XXX_DiscardUnknown() {
xxx_messageInfo_GetServiceAccountNameResponse.DiscardUnknown(m)
}
var xxx_messageInfo_GetServiceAccountNameResponse proto.InternalMessageInfo
func (m *GetServiceAccountNameResponse) GetServiceAccountName() string {
if m != nil && m.ServiceAccountName != nil {
return *m.ServiceAccountName
}
return ""
}
type GetAccessTokenRequest struct {
Scope []string `protobuf:"bytes,1,rep,name=scope" json:"scope,omitempty"`
ServiceAccountId *int64 `protobuf:"varint,2,opt,name=service_account_id,json=serviceAccountId" json:"service_account_id,omitempty"`
ServiceAccountName *string `protobuf:"bytes,3,opt,name=service_account_name,json=serviceAccountName" json:"service_account_name,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *GetAccessTokenRequest) Reset() { *m = GetAccessTokenRequest{} }
func (m *GetAccessTokenRequest) String() string { return proto.CompactTextString(m) }
func (*GetAccessTokenRequest) ProtoMessage() {}
func (*GetAccessTokenRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_app_identity_service_08a6e3f74b04cfa4, []int{8}
}
func (m *GetAccessTokenRequest) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_GetAccessTokenRequest.Unmarshal(m, b)
}
func (m *GetAccessTokenRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_GetAccessTokenRequest.Marshal(b, m, deterministic)
}
func (dst *GetAccessTokenRequest) XXX_Merge(src proto.Message) {
xxx_messageInfo_GetAccessTokenRequest.Merge(dst, src)
}
func (m *GetAccessTokenRequest) XXX_Size() int {
return xxx_messageInfo_GetAccessTokenRequest.Size(m)
}
func (m *GetAccessTokenRequest) XXX_DiscardUnknown() {
xxx_messageInfo_GetAccessTokenRequest.DiscardUnknown(m)
}
var xxx_messageInfo_GetAccessTokenRequest proto.InternalMessageInfo
func (m *GetAccessTokenRequest) GetScope() []string {
if m != nil {
return m.Scope
}
return nil
}
func (m *GetAccessTokenRequest) GetServiceAccountId() int64 {
if m != nil && m.ServiceAccountId != nil {
return *m.ServiceAccountId
}
return 0
}
func (m *GetAccessTokenRequest) GetServiceAccountName() string {
if m != nil && m.ServiceAccountName != nil {
return *m.ServiceAccountName
}
return ""
}
type GetAccessTokenResponse struct {
AccessToken *string `protobuf:"bytes,1,opt,name=access_token,json=accessToken" json:"access_token,omitempty"`
ExpirationTime *int64 `protobuf:"varint,2,opt,name=expiration_time,json=expirationTime" json:"expiration_time,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *GetAccessTokenResponse) Reset() { *m = GetAccessTokenResponse{} }
func (m *GetAccessTokenResponse) String() string { return proto.CompactTextString(m) }
func (*GetAccessTokenResponse) ProtoMessage() {}
func (*GetAccessTokenResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_app_identity_service_08a6e3f74b04cfa4, []int{9}
}
func (m *GetAccessTokenResponse) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_GetAccessTokenResponse.Unmarshal(m, b)
}
func (m *GetAccessTokenResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_GetAccessTokenResponse.Marshal(b, m, deterministic)
}
func (dst *GetAccessTokenResponse) XXX_Merge(src proto.Message) {
xxx_messageInfo_GetAccessTokenResponse.Merge(dst, src)
}
func (m *GetAccessTokenResponse) XXX_Size() int {
return xxx_messageInfo_GetAccessTokenResponse.Size(m)
}
func (m *GetAccessTokenResponse) XXX_DiscardUnknown() {
xxx_messageInfo_GetAccessTokenResponse.DiscardUnknown(m)
}
var xxx_messageInfo_GetAccessTokenResponse proto.InternalMessageInfo
func (m *GetAccessTokenResponse) GetAccessToken() string {
if m != nil && m.AccessToken != nil {
return *m.AccessToken
}
return ""
}
func (m *GetAccessTokenResponse) GetExpirationTime() int64 {
if m != nil && m.ExpirationTime != nil {
return *m.ExpirationTime
}
return 0
}
type GetDefaultGcsBucketNameRequest struct {
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *GetDefaultGcsBucketNameRequest) Reset() { *m = GetDefaultGcsBucketNameRequest{} }
func (m *GetDefaultGcsBucketNameRequest) String() string { return proto.CompactTextString(m) }
func (*GetDefaultGcsBucketNameRequest) ProtoMessage() {}
func (*GetDefaultGcsBucketNameRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_app_identity_service_08a6e3f74b04cfa4, []int{10}
}
func (m *GetDefaultGcsBucketNameRequest) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_GetDefaultGcsBucketNameRequest.Unmarshal(m, b)
}
func (m *GetDefaultGcsBucketNameRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_GetDefaultGcsBucketNameRequest.Marshal(b, m, deterministic)
}
func (dst *GetDefaultGcsBucketNameRequest) XXX_Merge(src proto.Message) {
xxx_messageInfo_GetDefaultGcsBucketNameRequest.Merge(dst, src)
}
func (m *GetDefaultGcsBucketNameRequest) XXX_Size() int {
return xxx_messageInfo_GetDefaultGcsBucketNameRequest.Size(m)
}
func (m *GetDefaultGcsBucketNameRequest) XXX_DiscardUnknown() {
xxx_messageInfo_GetDefaultGcsBucketNameRequest.DiscardUnknown(m)
}
var xxx_messageInfo_GetDefaultGcsBucketNameRequest proto.InternalMessageInfo
type GetDefaultGcsBucketNameResponse struct {
DefaultGcsBucketName *string `protobuf:"bytes,1,opt,name=default_gcs_bucket_name,json=defaultGcsBucketName" json:"default_gcs_bucket_name,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *GetDefaultGcsBucketNameResponse) Reset() { *m = GetDefaultGcsBucketNameResponse{} }
func (m *GetDefaultGcsBucketNameResponse) String() string { return proto.CompactTextString(m) }
func (*GetDefaultGcsBucketNameResponse) ProtoMessage() {}
func (*GetDefaultGcsBucketNameResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_app_identity_service_08a6e3f74b04cfa4, []int{11}
}
func (m *GetDefaultGcsBucketNameResponse) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_GetDefaultGcsBucketNameResponse.Unmarshal(m, b)
}
func (m *GetDefaultGcsBucketNameResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_GetDefaultGcsBucketNameResponse.Marshal(b, m, deterministic)
}
func (dst *GetDefaultGcsBucketNameResponse) XXX_Merge(src proto.Message) {
xxx_messageInfo_GetDefaultGcsBucketNameResponse.Merge(dst, src)
}
func (m *GetDefaultGcsBucketNameResponse) XXX_Size() int {
return xxx_messageInfo_GetDefaultGcsBucketNameResponse.Size(m)
}
func (m *GetDefaultGcsBucketNameResponse) XXX_DiscardUnknown() {
xxx_messageInfo_GetDefaultGcsBucketNameResponse.DiscardUnknown(m)
}
var xxx_messageInfo_GetDefaultGcsBucketNameResponse proto.InternalMessageInfo
func (m *GetDefaultGcsBucketNameResponse) GetDefaultGcsBucketName() string {
if m != nil && m.DefaultGcsBucketName != nil {
return *m.DefaultGcsBucketName
}
return ""
}
func init() {
proto.RegisterType((*AppIdentityServiceError)(nil), "appengine.AppIdentityServiceError")
proto.RegisterType((*SignForAppRequest)(nil), "appengine.SignForAppRequest")
proto.RegisterType((*SignForAppResponse)(nil), "appengine.SignForAppResponse")
proto.RegisterType((*GetPublicCertificateForAppRequest)(nil), "appengine.GetPublicCertificateForAppRequest")
proto.RegisterType((*PublicCertificate)(nil), "appengine.PublicCertificate")
proto.RegisterType((*GetPublicCertificateForAppResponse)(nil), "appengine.GetPublicCertificateForAppResponse")
proto.RegisterType((*GetServiceAccountNameRequest)(nil), "appengine.GetServiceAccountNameRequest")
proto.RegisterType((*GetServiceAccountNameResponse)(nil), "appengine.GetServiceAccountNameResponse")
proto.RegisterType((*GetAccessTokenRequest)(nil), "appengine.GetAccessTokenRequest")
proto.RegisterType((*GetAccessTokenResponse)(nil), "appengine.GetAccessTokenResponse")
proto.RegisterType((*GetDefaultGcsBucketNameRequest)(nil), "appengine.GetDefaultGcsBucketNameRequest")
proto.RegisterType((*GetDefaultGcsBucketNameResponse)(nil), "appengine.GetDefaultGcsBucketNameResponse")
}
func init() {
proto.RegisterFile("google.golang.org/appengine/internal/app_identity/app_identity_service.proto", fileDescriptor_app_identity_service_08a6e3f74b04cfa4)
}
var fileDescriptor_app_identity_service_08a6e3f74b04cfa4 = []byte{
// 676 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x54, 0xdb, 0x6e, 0xda, 0x58,
0x14, 0x1d, 0x26, 0x1a, 0x31, 0x6c, 0x12, 0x62, 0xce, 0x90, 0xcb, 0x8c, 0x32, 0xb9, 0x78, 0x1e,
0x26, 0x0f, 0x15, 0x89, 0x2a, 0x45, 0x55, 0x1f, 0x8d, 0xed, 0x22, 0x54, 0x07, 0x53, 0x43, 0x9a,
0xa8, 0x2f, 0xa7, 0xce, 0x61, 0xc7, 0x3d, 0x02, 0x9f, 0xe3, 0xda, 0x87, 0x0a, 0x3e, 0xa2, 0x3f,
0xd2, 0x9f, 0xe8, 0x5b, 0xbf, 0xa5, 0x17, 0xb5, 0xdf, 0x50, 0xd9, 0x38, 0x5c, 0x92, 0x92, 0x37,
0xbc, 0xf6, 0x5a, 0xcb, 0x6b, 0x2f, 0x6d, 0x0c, 0x4e, 0x20, 0x65, 0x30, 0xc4, 0x7a, 0x20, 0x87,
0xbe, 0x08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 0xd6, 0xff, 0x85, 0xbc,
0x51, 0x79, 0xb5, 0xbe, 0xf8, 0xc9, 0xfa, 0x19, 0x00, 0x00, 0xff, 0xff, 0x37, 0x4c, 0x56, 0x38,
0xf3, 0x04, 0x00, 0x00,
}

View File

@ -0,0 +1,64 @@
syntax = "proto2";
option go_package = "app_identity";
package appengine;
message AppIdentityServiceError {
enum ErrorCode {
SUCCESS = 0;
UNKNOWN_SCOPE = 9;
BLOB_TOO_LARGE = 1000;
DEADLINE_EXCEEDED = 1001;
NOT_A_VALID_APP = 1002;
UNKNOWN_ERROR = 1003;
NOT_ALLOWED = 1005;
NOT_IMPLEMENTED = 1006;
}
}
message SignForAppRequest {
optional bytes bytes_to_sign = 1;
}
message SignForAppResponse {
optional string key_name = 1;
optional bytes signature_bytes = 2;
}
message GetPublicCertificateForAppRequest {
}
message PublicCertificate {
optional string key_name = 1;
optional string x509_certificate_pem = 2;
}
message GetPublicCertificateForAppResponse {
repeated PublicCertificate public_certificate_list = 1;
optional int64 max_client_cache_time_in_second = 2;
}
message GetServiceAccountNameRequest {
}
message GetServiceAccountNameResponse {
optional string service_account_name = 1;
}
message GetAccessTokenRequest {
repeated string scope = 1;
optional int64 service_account_id = 2;
optional string service_account_name = 3;
}
message GetAccessTokenResponse {
optional string access_token = 1;
optional int64 expiration_time = 2;
}
message GetDefaultGcsBucketNameRequest {
}
message GetDefaultGcsBucketNameResponse {
optional string default_gcs_bucket_name = 1;
}

View File

@ -0,0 +1,308 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: google.golang.org/appengine/internal/base/api_base.proto
package base
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
// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
type StringProto struct {
Value *string `protobuf:"bytes,1,req,name=value" json:"value,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *StringProto) Reset() { *m = StringProto{} }
func (m *StringProto) String() string { return proto.CompactTextString(m) }
func (*StringProto) ProtoMessage() {}
func (*StringProto) Descriptor() ([]byte, []int) {
return fileDescriptor_api_base_9d49f8792e0c1140, []int{0}
}
func (m *StringProto) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_StringProto.Unmarshal(m, b)
}
func (m *StringProto) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_StringProto.Marshal(b, m, deterministic)
}
func (dst *StringProto) XXX_Merge(src proto.Message) {
xxx_messageInfo_StringProto.Merge(dst, src)
}
func (m *StringProto) XXX_Size() int {
return xxx_messageInfo_StringProto.Size(m)
}
func (m *StringProto) XXX_DiscardUnknown() {
xxx_messageInfo_StringProto.DiscardUnknown(m)
}
var xxx_messageInfo_StringProto proto.InternalMessageInfo
func (m *StringProto) GetValue() string {
if m != nil && m.Value != nil {
return *m.Value
}
return ""
}
type Integer32Proto struct {
Value *int32 `protobuf:"varint,1,req,name=value" json:"value,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *Integer32Proto) Reset() { *m = Integer32Proto{} }
func (m *Integer32Proto) String() string { return proto.CompactTextString(m) }
func (*Integer32Proto) ProtoMessage() {}
func (*Integer32Proto) Descriptor() ([]byte, []int) {
return fileDescriptor_api_base_9d49f8792e0c1140, []int{1}
}
func (m *Integer32Proto) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_Integer32Proto.Unmarshal(m, b)
}
func (m *Integer32Proto) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_Integer32Proto.Marshal(b, m, deterministic)
}
func (dst *Integer32Proto) XXX_Merge(src proto.Message) {
xxx_messageInfo_Integer32Proto.Merge(dst, src)
}
func (m *Integer32Proto) XXX_Size() int {
return xxx_messageInfo_Integer32Proto.Size(m)
}
func (m *Integer32Proto) XXX_DiscardUnknown() {
xxx_messageInfo_Integer32Proto.DiscardUnknown(m)
}
var xxx_messageInfo_Integer32Proto proto.InternalMessageInfo
func (m *Integer32Proto) GetValue() int32 {
if m != nil && m.Value != nil {
return *m.Value
}
return 0
}
type Integer64Proto struct {
Value *int64 `protobuf:"varint,1,req,name=value" json:"value,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *Integer64Proto) Reset() { *m = Integer64Proto{} }
func (m *Integer64Proto) String() string { return proto.CompactTextString(m) }
func (*Integer64Proto) ProtoMessage() {}
func (*Integer64Proto) Descriptor() ([]byte, []int) {
return fileDescriptor_api_base_9d49f8792e0c1140, []int{2}
}
func (m *Integer64Proto) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_Integer64Proto.Unmarshal(m, b)
}
func (m *Integer64Proto) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_Integer64Proto.Marshal(b, m, deterministic)
}
func (dst *Integer64Proto) XXX_Merge(src proto.Message) {
xxx_messageInfo_Integer64Proto.Merge(dst, src)
}
func (m *Integer64Proto) XXX_Size() int {
return xxx_messageInfo_Integer64Proto.Size(m)
}
func (m *Integer64Proto) XXX_DiscardUnknown() {
xxx_messageInfo_Integer64Proto.DiscardUnknown(m)
}
var xxx_messageInfo_Integer64Proto proto.InternalMessageInfo
func (m *Integer64Proto) GetValue() int64 {
if m != nil && m.Value != nil {
return *m.Value
}
return 0
}
type BoolProto struct {
Value *bool `protobuf:"varint,1,req,name=value" json:"value,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *BoolProto) Reset() { *m = BoolProto{} }
func (m *BoolProto) String() string { return proto.CompactTextString(m) }
func (*BoolProto) ProtoMessage() {}
func (*BoolProto) Descriptor() ([]byte, []int) {
return fileDescriptor_api_base_9d49f8792e0c1140, []int{3}
}
func (m *BoolProto) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_BoolProto.Unmarshal(m, b)
}
func (m *BoolProto) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_BoolProto.Marshal(b, m, deterministic)
}
func (dst *BoolProto) XXX_Merge(src proto.Message) {
xxx_messageInfo_BoolProto.Merge(dst, src)
}
func (m *BoolProto) XXX_Size() int {
return xxx_messageInfo_BoolProto.Size(m)
}
func (m *BoolProto) XXX_DiscardUnknown() {
xxx_messageInfo_BoolProto.DiscardUnknown(m)
}
var xxx_messageInfo_BoolProto proto.InternalMessageInfo
func (m *BoolProto) GetValue() bool {
if m != nil && m.Value != nil {
return *m.Value
}
return false
}
type DoubleProto struct {
Value *float64 `protobuf:"fixed64,1,req,name=value" json:"value,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *DoubleProto) Reset() { *m = DoubleProto{} }
func (m *DoubleProto) String() string { return proto.CompactTextString(m) }
func (*DoubleProto) ProtoMessage() {}
func (*DoubleProto) Descriptor() ([]byte, []int) {
return fileDescriptor_api_base_9d49f8792e0c1140, []int{4}
}
func (m *DoubleProto) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_DoubleProto.Unmarshal(m, b)
}
func (m *DoubleProto) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_DoubleProto.Marshal(b, m, deterministic)
}
func (dst *DoubleProto) XXX_Merge(src proto.Message) {
xxx_messageInfo_DoubleProto.Merge(dst, src)
}
func (m *DoubleProto) XXX_Size() int {
return xxx_messageInfo_DoubleProto.Size(m)
}
func (m *DoubleProto) XXX_DiscardUnknown() {
xxx_messageInfo_DoubleProto.DiscardUnknown(m)
}
var xxx_messageInfo_DoubleProto proto.InternalMessageInfo
func (m *DoubleProto) GetValue() float64 {
if m != nil && m.Value != nil {
return *m.Value
}
return 0
}
type BytesProto struct {
Value []byte `protobuf:"bytes,1,req,name=value" json:"value,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *BytesProto) Reset() { *m = BytesProto{} }
func (m *BytesProto) String() string { return proto.CompactTextString(m) }
func (*BytesProto) ProtoMessage() {}
func (*BytesProto) Descriptor() ([]byte, []int) {
return fileDescriptor_api_base_9d49f8792e0c1140, []int{5}
}
func (m *BytesProto) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_BytesProto.Unmarshal(m, b)
}
func (m *BytesProto) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_BytesProto.Marshal(b, m, deterministic)
}
func (dst *BytesProto) XXX_Merge(src proto.Message) {
xxx_messageInfo_BytesProto.Merge(dst, src)
}
func (m *BytesProto) XXX_Size() int {
return xxx_messageInfo_BytesProto.Size(m)
}
func (m *BytesProto) XXX_DiscardUnknown() {
xxx_messageInfo_BytesProto.DiscardUnknown(m)
}
var xxx_messageInfo_BytesProto proto.InternalMessageInfo
func (m *BytesProto) GetValue() []byte {
if m != nil {
return m.Value
}
return nil
}
type VoidProto struct {
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *VoidProto) Reset() { *m = VoidProto{} }
func (m *VoidProto) String() string { return proto.CompactTextString(m) }
func (*VoidProto) ProtoMessage() {}
func (*VoidProto) Descriptor() ([]byte, []int) {
return fileDescriptor_api_base_9d49f8792e0c1140, []int{6}
}
func (m *VoidProto) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_VoidProto.Unmarshal(m, b)
}
func (m *VoidProto) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_VoidProto.Marshal(b, m, deterministic)
}
func (dst *VoidProto) XXX_Merge(src proto.Message) {
xxx_messageInfo_VoidProto.Merge(dst, src)
}
func (m *VoidProto) XXX_Size() int {
return xxx_messageInfo_VoidProto.Size(m)
}
func (m *VoidProto) XXX_DiscardUnknown() {
xxx_messageInfo_VoidProto.DiscardUnknown(m)
}
var xxx_messageInfo_VoidProto proto.InternalMessageInfo
func init() {
proto.RegisterType((*StringProto)(nil), "appengine.base.StringProto")
proto.RegisterType((*Integer32Proto)(nil), "appengine.base.Integer32Proto")
proto.RegisterType((*Integer64Proto)(nil), "appengine.base.Integer64Proto")
proto.RegisterType((*BoolProto)(nil), "appengine.base.BoolProto")
proto.RegisterType((*DoubleProto)(nil), "appengine.base.DoubleProto")
proto.RegisterType((*BytesProto)(nil), "appengine.base.BytesProto")
proto.RegisterType((*VoidProto)(nil), "appengine.base.VoidProto")
}
func init() {
proto.RegisterFile("google.golang.org/appengine/internal/base/api_base.proto", fileDescriptor_api_base_9d49f8792e0c1140)
}
var fileDescriptor_api_base_9d49f8792e0c1140 = []byte{
// 199 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0xcf, 0x3f, 0x4b, 0xc6, 0x30,
0x10, 0x06, 0x70, 0x5a, 0xad, 0xb4, 0x57, 0xe9, 0x20, 0x0e, 0x1d, 0xb5, 0x05, 0x71, 0x4a, 0x40,
0x45, 0x9c, 0x83, 0x8b, 0x9b, 0x28, 0x38, 0xb8, 0x48, 0x8a, 0xc7, 0x11, 0x08, 0xb9, 0x90, 0xa6,
0x82, 0xdf, 0x5e, 0xda, 0xd2, 0xfa, 0xc2, 0x9b, 0xed, 0xfe, 0xfc, 0xe0, 0xe1, 0x81, 0x27, 0x62,
0x26, 0x8b, 0x82, 0xd8, 0x6a, 0x47, 0x82, 0x03, 0x49, 0xed, 0x3d, 0x3a, 0x32, 0x0e, 0xa5, 0x71,
0x11, 0x83, 0xd3, 0x56, 0x0e, 0x7a, 0x44, 0xa9, 0xbd, 0xf9, 0x9a, 0x07, 0xe1, 0x03, 0x47, 0xbe,
0x68, 0x76, 0x27, 0xe6, 0x6b, 0xd7, 0x43, 0xfd, 0x1e, 0x83, 0x71, 0xf4, 0xba, 0xbc, 0x2f, 0xa1,
0xf8, 0xd1, 0x76, 0xc2, 0x36, 0xbb, 0xca, 0x6f, 0xab, 0xb7, 0x75, 0xe9, 0x6e, 0xa0, 0x79, 0x71,
0x11, 0x09, 0xc3, 0xfd, 0x5d, 0xc2, 0x15, 0xc7, 0xee, 0xf1, 0x21, 0xe1, 0x4e, 0x36, 0x77, 0x0d,
0x95, 0x62, 0xb6, 0x09, 0x52, 0x6e, 0xa4, 0x87, 0xfa, 0x99, 0xa7, 0xc1, 0x62, 0x02, 0x65, 0xff,
0x79, 0xa0, 0x7e, 0x23, 0x8e, 0xab, 0x69, 0x0f, 0xcd, 0xb9, 0xca, 0xcb, 0xdd, 0xd5, 0x50, 0x7d,
0xb0, 0xf9, 0x5e, 0x98, 0x3a, 0xfb, 0x3c, 0x9d, 0x9b, 0xff, 0x05, 0x00, 0x00, 0xff, 0xff, 0xba,
0x37, 0x25, 0xea, 0x44, 0x01, 0x00, 0x00,
}

View File

@ -0,0 +1,33 @@
// Built-in base types for API calls. Primarily useful as return types.
syntax = "proto2";
option go_package = "base";
package appengine.base;
message StringProto {
required string value = 1;
}
message Integer32Proto {
required int32 value = 1;
}
message Integer64Proto {
required int64 value = 1;
}
message BoolProto {
required bool value = 1;
}
message DoubleProto {
required double value = 1;
}
message BytesProto {
required bytes value = 1 [ctype=CORD];
}
message VoidProto {
}

View File

@ -0,0 +1,666 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: google.golang.org/appengine/internal/blobstore/blobstore_service.proto
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
// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
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
}
func (BlobstoreServiceError_ErrorCode) EnumDescriptor() ([]byte, []int) {
return fileDescriptor_blobstore_service_3604fb6033ea2e2e, []int{0, 0}
}
type BlobstoreServiceError struct {
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *BlobstoreServiceError) Reset() { *m = BlobstoreServiceError{} }
func (m *BlobstoreServiceError) String() string { return proto.CompactTextString(m) }
func (*BlobstoreServiceError) ProtoMessage() {}
func (*BlobstoreServiceError) Descriptor() ([]byte, []int) {
return fileDescriptor_blobstore_service_3604fb6033ea2e2e, []int{0}
}
func (m *BlobstoreServiceError) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_BlobstoreServiceError.Unmarshal(m, b)
}
func (m *BlobstoreServiceError) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_BlobstoreServiceError.Marshal(b, m, deterministic)
}
func (dst *BlobstoreServiceError) XXX_Merge(src proto.Message) {
xxx_messageInfo_BlobstoreServiceError.Merge(dst, src)
}
func (m *BlobstoreServiceError) XXX_Size() int {
return xxx_messageInfo_BlobstoreServiceError.Size(m)
}
func (m *BlobstoreServiceError) XXX_DiscardUnknown() {
xxx_messageInfo_BlobstoreServiceError.DiscardUnknown(m)
}
var xxx_messageInfo_BlobstoreServiceError proto.InternalMessageInfo
type CreateUploadURLRequest struct {
SuccessPath *string `protobuf:"bytes,1,req,name=success_path,json=successPath" json:"success_path,omitempty"`
MaxUploadSizeBytes *int64 `protobuf:"varint,2,opt,name=max_upload_size_bytes,json=maxUploadSizeBytes" json:"max_upload_size_bytes,omitempty"`
MaxUploadSizePerBlobBytes *int64 `protobuf:"varint,3,opt,name=max_upload_size_per_blob_bytes,json=maxUploadSizePerBlobBytes" json:"max_upload_size_per_blob_bytes,omitempty"`
GsBucketName *string `protobuf:"bytes,4,opt,name=gs_bucket_name,json=gsBucketName" json:"gs_bucket_name,omitempty"`
UrlExpiryTimeSeconds *int32 `protobuf:"varint,5,opt,name=url_expiry_time_seconds,json=urlExpiryTimeSeconds" json:"url_expiry_time_seconds,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *CreateUploadURLRequest) Reset() { *m = CreateUploadURLRequest{} }
func (m *CreateUploadURLRequest) String() string { return proto.CompactTextString(m) }
func (*CreateUploadURLRequest) ProtoMessage() {}
func (*CreateUploadURLRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_blobstore_service_3604fb6033ea2e2e, []int{1}
}
func (m *CreateUploadURLRequest) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_CreateUploadURLRequest.Unmarshal(m, b)
}
func (m *CreateUploadURLRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_CreateUploadURLRequest.Marshal(b, m, deterministic)
}
func (dst *CreateUploadURLRequest) XXX_Merge(src proto.Message) {
xxx_messageInfo_CreateUploadURLRequest.Merge(dst, src)
}
func (m *CreateUploadURLRequest) XXX_Size() int {
return xxx_messageInfo_CreateUploadURLRequest.Size(m)
}
func (m *CreateUploadURLRequest) XXX_DiscardUnknown() {
xxx_messageInfo_CreateUploadURLRequest.DiscardUnknown(m)
}
var xxx_messageInfo_CreateUploadURLRequest proto.InternalMessageInfo
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_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *CreateUploadURLResponse) Reset() { *m = CreateUploadURLResponse{} }
func (m *CreateUploadURLResponse) String() string { return proto.CompactTextString(m) }
func (*CreateUploadURLResponse) ProtoMessage() {}
func (*CreateUploadURLResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_blobstore_service_3604fb6033ea2e2e, []int{2}
}
func (m *CreateUploadURLResponse) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_CreateUploadURLResponse.Unmarshal(m, b)
}
func (m *CreateUploadURLResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_CreateUploadURLResponse.Marshal(b, m, deterministic)
}
func (dst *CreateUploadURLResponse) XXX_Merge(src proto.Message) {
xxx_messageInfo_CreateUploadURLResponse.Merge(dst, src)
}
func (m *CreateUploadURLResponse) XXX_Size() int {
return xxx_messageInfo_CreateUploadURLResponse.Size(m)
}
func (m *CreateUploadURLResponse) XXX_DiscardUnknown() {
xxx_messageInfo_CreateUploadURLResponse.DiscardUnknown(m)
}
var xxx_messageInfo_CreateUploadURLResponse proto.InternalMessageInfo
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=blobKey" json:"blob_key,omitempty"`
Token *string `protobuf:"bytes,2,opt,name=token" json:"token,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *DeleteBlobRequest) Reset() { *m = DeleteBlobRequest{} }
func (m *DeleteBlobRequest) String() string { return proto.CompactTextString(m) }
func (*DeleteBlobRequest) ProtoMessage() {}
func (*DeleteBlobRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_blobstore_service_3604fb6033ea2e2e, []int{3}
}
func (m *DeleteBlobRequest) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_DeleteBlobRequest.Unmarshal(m, b)
}
func (m *DeleteBlobRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_DeleteBlobRequest.Marshal(b, m, deterministic)
}
func (dst *DeleteBlobRequest) XXX_Merge(src proto.Message) {
xxx_messageInfo_DeleteBlobRequest.Merge(dst, src)
}
func (m *DeleteBlobRequest) XXX_Size() int {
return xxx_messageInfo_DeleteBlobRequest.Size(m)
}
func (m *DeleteBlobRequest) XXX_DiscardUnknown() {
xxx_messageInfo_DeleteBlobRequest.DiscardUnknown(m)
}
var xxx_messageInfo_DeleteBlobRequest proto.InternalMessageInfo
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=blobKey" json:"blob_key,omitempty"`
StartIndex *int64 `protobuf:"varint,2,req,name=start_index,json=startIndex" json:"start_index,omitempty"`
EndIndex *int64 `protobuf:"varint,3,req,name=end_index,json=endIndex" json:"end_index,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *FetchDataRequest) Reset() { *m = FetchDataRequest{} }
func (m *FetchDataRequest) String() string { return proto.CompactTextString(m) }
func (*FetchDataRequest) ProtoMessage() {}
func (*FetchDataRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_blobstore_service_3604fb6033ea2e2e, []int{4}
}
func (m *FetchDataRequest) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_FetchDataRequest.Unmarshal(m, b)
}
func (m *FetchDataRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_FetchDataRequest.Marshal(b, m, deterministic)
}
func (dst *FetchDataRequest) XXX_Merge(src proto.Message) {
xxx_messageInfo_FetchDataRequest.Merge(dst, src)
}
func (m *FetchDataRequest) XXX_Size() int {
return xxx_messageInfo_FetchDataRequest.Size(m)
}
func (m *FetchDataRequest) XXX_DiscardUnknown() {
xxx_messageInfo_FetchDataRequest.DiscardUnknown(m)
}
var xxx_messageInfo_FetchDataRequest proto.InternalMessageInfo
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_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *FetchDataResponse) Reset() { *m = FetchDataResponse{} }
func (m *FetchDataResponse) String() string { return proto.CompactTextString(m) }
func (*FetchDataResponse) ProtoMessage() {}
func (*FetchDataResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_blobstore_service_3604fb6033ea2e2e, []int{5}
}
func (m *FetchDataResponse) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_FetchDataResponse.Unmarshal(m, b)
}
func (m *FetchDataResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_FetchDataResponse.Marshal(b, m, deterministic)
}
func (dst *FetchDataResponse) XXX_Merge(src proto.Message) {
xxx_messageInfo_FetchDataResponse.Merge(dst, src)
}
func (m *FetchDataResponse) XXX_Size() int {
return xxx_messageInfo_FetchDataResponse.Size(m)
}
func (m *FetchDataResponse) XXX_DiscardUnknown() {
xxx_messageInfo_FetchDataResponse.DiscardUnknown(m)
}
var xxx_messageInfo_FetchDataResponse proto.InternalMessageInfo
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=blobKey" json:"blob_key,omitempty"`
MimeType []byte `protobuf:"bytes,2,req,name=mime_type,json=mimeType" json:"mime_type,omitempty"`
TargetAppId []byte `protobuf:"bytes,3,req,name=target_app_id,json=targetAppId" json:"target_app_id,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *CloneBlobRequest) Reset() { *m = CloneBlobRequest{} }
func (m *CloneBlobRequest) String() string { return proto.CompactTextString(m) }
func (*CloneBlobRequest) ProtoMessage() {}
func (*CloneBlobRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_blobstore_service_3604fb6033ea2e2e, []int{6}
}
func (m *CloneBlobRequest) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_CloneBlobRequest.Unmarshal(m, b)
}
func (m *CloneBlobRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_CloneBlobRequest.Marshal(b, m, deterministic)
}
func (dst *CloneBlobRequest) XXX_Merge(src proto.Message) {
xxx_messageInfo_CloneBlobRequest.Merge(dst, src)
}
func (m *CloneBlobRequest) XXX_Size() int {
return xxx_messageInfo_CloneBlobRequest.Size(m)
}
func (m *CloneBlobRequest) XXX_DiscardUnknown() {
xxx_messageInfo_CloneBlobRequest.DiscardUnknown(m)
}
var xxx_messageInfo_CloneBlobRequest proto.InternalMessageInfo
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=blobKey" json:"blob_key,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *CloneBlobResponse) Reset() { *m = CloneBlobResponse{} }
func (m *CloneBlobResponse) String() string { return proto.CompactTextString(m) }
func (*CloneBlobResponse) ProtoMessage() {}
func (*CloneBlobResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_blobstore_service_3604fb6033ea2e2e, []int{7}
}
func (m *CloneBlobResponse) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_CloneBlobResponse.Unmarshal(m, b)
}
func (m *CloneBlobResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_CloneBlobResponse.Marshal(b, m, deterministic)
}
func (dst *CloneBlobResponse) XXX_Merge(src proto.Message) {
xxx_messageInfo_CloneBlobResponse.Merge(dst, src)
}
func (m *CloneBlobResponse) XXX_Size() int {
return xxx_messageInfo_CloneBlobResponse.Size(m)
}
func (m *CloneBlobResponse) XXX_DiscardUnknown() {
xxx_messageInfo_CloneBlobResponse.DiscardUnknown(m)
}
var xxx_messageInfo_CloneBlobResponse proto.InternalMessageInfo
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=blobKey" json:"blob_key,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *DecodeBlobKeyRequest) Reset() { *m = DecodeBlobKeyRequest{} }
func (m *DecodeBlobKeyRequest) String() string { return proto.CompactTextString(m) }
func (*DecodeBlobKeyRequest) ProtoMessage() {}
func (*DecodeBlobKeyRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_blobstore_service_3604fb6033ea2e2e, []int{8}
}
func (m *DecodeBlobKeyRequest) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_DecodeBlobKeyRequest.Unmarshal(m, b)
}
func (m *DecodeBlobKeyRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_DecodeBlobKeyRequest.Marshal(b, m, deterministic)
}
func (dst *DecodeBlobKeyRequest) XXX_Merge(src proto.Message) {
xxx_messageInfo_DecodeBlobKeyRequest.Merge(dst, src)
}
func (m *DecodeBlobKeyRequest) XXX_Size() int {
return xxx_messageInfo_DecodeBlobKeyRequest.Size(m)
}
func (m *DecodeBlobKeyRequest) XXX_DiscardUnknown() {
xxx_messageInfo_DecodeBlobKeyRequest.DiscardUnknown(m)
}
var xxx_messageInfo_DecodeBlobKeyRequest proto.InternalMessageInfo
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_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *DecodeBlobKeyResponse) Reset() { *m = DecodeBlobKeyResponse{} }
func (m *DecodeBlobKeyResponse) String() string { return proto.CompactTextString(m) }
func (*DecodeBlobKeyResponse) ProtoMessage() {}
func (*DecodeBlobKeyResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_blobstore_service_3604fb6033ea2e2e, []int{9}
}
func (m *DecodeBlobKeyResponse) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_DecodeBlobKeyResponse.Unmarshal(m, b)
}
func (m *DecodeBlobKeyResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_DecodeBlobKeyResponse.Marshal(b, m, deterministic)
}
func (dst *DecodeBlobKeyResponse) XXX_Merge(src proto.Message) {
xxx_messageInfo_DecodeBlobKeyResponse.Merge(dst, src)
}
func (m *DecodeBlobKeyResponse) XXX_Size() int {
return xxx_messageInfo_DecodeBlobKeyResponse.Size(m)
}
func (m *DecodeBlobKeyResponse) XXX_DiscardUnknown() {
xxx_messageInfo_DecodeBlobKeyResponse.DiscardUnknown(m)
}
var xxx_messageInfo_DecodeBlobKeyResponse proto.InternalMessageInfo
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_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *CreateEncodedGoogleStorageKeyRequest) Reset() { *m = CreateEncodedGoogleStorageKeyRequest{} }
func (m *CreateEncodedGoogleStorageKeyRequest) String() string { return proto.CompactTextString(m) }
func (*CreateEncodedGoogleStorageKeyRequest) ProtoMessage() {}
func (*CreateEncodedGoogleStorageKeyRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_blobstore_service_3604fb6033ea2e2e, []int{10}
}
func (m *CreateEncodedGoogleStorageKeyRequest) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_CreateEncodedGoogleStorageKeyRequest.Unmarshal(m, b)
}
func (m *CreateEncodedGoogleStorageKeyRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_CreateEncodedGoogleStorageKeyRequest.Marshal(b, m, deterministic)
}
func (dst *CreateEncodedGoogleStorageKeyRequest) XXX_Merge(src proto.Message) {
xxx_messageInfo_CreateEncodedGoogleStorageKeyRequest.Merge(dst, src)
}
func (m *CreateEncodedGoogleStorageKeyRequest) XXX_Size() int {
return xxx_messageInfo_CreateEncodedGoogleStorageKeyRequest.Size(m)
}
func (m *CreateEncodedGoogleStorageKeyRequest) XXX_DiscardUnknown() {
xxx_messageInfo_CreateEncodedGoogleStorageKeyRequest.DiscardUnknown(m)
}
var xxx_messageInfo_CreateEncodedGoogleStorageKeyRequest proto.InternalMessageInfo
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=blobKey" json:"blob_key,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *CreateEncodedGoogleStorageKeyResponse) Reset() { *m = CreateEncodedGoogleStorageKeyResponse{} }
func (m *CreateEncodedGoogleStorageKeyResponse) String() string { return proto.CompactTextString(m) }
func (*CreateEncodedGoogleStorageKeyResponse) ProtoMessage() {}
func (*CreateEncodedGoogleStorageKeyResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_blobstore_service_3604fb6033ea2e2e, []int{11}
}
func (m *CreateEncodedGoogleStorageKeyResponse) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_CreateEncodedGoogleStorageKeyResponse.Unmarshal(m, b)
}
func (m *CreateEncodedGoogleStorageKeyResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_CreateEncodedGoogleStorageKeyResponse.Marshal(b, m, deterministic)
}
func (dst *CreateEncodedGoogleStorageKeyResponse) XXX_Merge(src proto.Message) {
xxx_messageInfo_CreateEncodedGoogleStorageKeyResponse.Merge(dst, src)
}
func (m *CreateEncodedGoogleStorageKeyResponse) XXX_Size() int {
return xxx_messageInfo_CreateEncodedGoogleStorageKeyResponse.Size(m)
}
func (m *CreateEncodedGoogleStorageKeyResponse) XXX_DiscardUnknown() {
xxx_messageInfo_CreateEncodedGoogleStorageKeyResponse.DiscardUnknown(m)
}
var xxx_messageInfo_CreateEncodedGoogleStorageKeyResponse proto.InternalMessageInfo
func (m *CreateEncodedGoogleStorageKeyResponse) GetBlobKey() string {
if m != nil && m.BlobKey != nil {
return *m.BlobKey
}
return ""
}
func init() {
proto.RegisterType((*BlobstoreServiceError)(nil), "appengine.BlobstoreServiceError")
proto.RegisterType((*CreateUploadURLRequest)(nil), "appengine.CreateUploadURLRequest")
proto.RegisterType((*CreateUploadURLResponse)(nil), "appengine.CreateUploadURLResponse")
proto.RegisterType((*DeleteBlobRequest)(nil), "appengine.DeleteBlobRequest")
proto.RegisterType((*FetchDataRequest)(nil), "appengine.FetchDataRequest")
proto.RegisterType((*FetchDataResponse)(nil), "appengine.FetchDataResponse")
proto.RegisterType((*CloneBlobRequest)(nil), "appengine.CloneBlobRequest")
proto.RegisterType((*CloneBlobResponse)(nil), "appengine.CloneBlobResponse")
proto.RegisterType((*DecodeBlobKeyRequest)(nil), "appengine.DecodeBlobKeyRequest")
proto.RegisterType((*DecodeBlobKeyResponse)(nil), "appengine.DecodeBlobKeyResponse")
proto.RegisterType((*CreateEncodedGoogleStorageKeyRequest)(nil), "appengine.CreateEncodedGoogleStorageKeyRequest")
proto.RegisterType((*CreateEncodedGoogleStorageKeyResponse)(nil), "appengine.CreateEncodedGoogleStorageKeyResponse")
}
func init() {
proto.RegisterFile("google.golang.org/appengine/internal/blobstore/blobstore_service.proto", fileDescriptor_blobstore_service_3604fb6033ea2e2e)
}
var fileDescriptor_blobstore_service_3604fb6033ea2e2e = []byte{
// 737 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x54, 0xe1, 0x6e, 0xe3, 0x44,
0x10, 0xc6, 0x4e, 0x7b, 0x8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, 0x5c, 0xf1, 0xd1, 0xdf,
0x07, 0x63, 0x73, 0x32, 0xf0, 0xcc, 0xbe, 0x41, 0x35, 0xe0, 0x94, 0x60, 0x5f, 0x15, 0xa2, 0xfc,
0x48, 0x7f, 0xe6, 0x64, 0xf0, 0x6c, 0xed, 0x0c, 0xac, 0x75, 0x33, 0x68, 0xb5, 0xad, 0x50, 0x1b,
0x1b, 0xd0, 0x7e, 0x03, 0x24, 0xdb, 0x0a, 0x89, 0x03, 0x9f, 0x2b, 0x2e, 0x33, 0x54, 0x8c, 0x57,
0x15, 0xcb, 0x53, 0x6d, 0x6d, 0x40, 0x0f, 0x5b, 0xd0, 0xad, 0xaa, 0x30, 0x75, 0xce, 0xe1, 0x68,
0xa7, 0x5e, 0xe7, 0xee, 0xc3, 0x05, 0x9d, 0x4b, 0x38, 0xf6, 0x71, 0x25, 0x52, 0x2d, 0xb8, 0xc6,
0xed, 0xa7, 0x77, 0xe0, 0x5c, 0xc2, 0xf0, 0x3d, 0x49, 0x57, 0x66, 0x04, 0x07, 0xa9, 0x26, 0xd2,
0x47, 0x49, 0x17, 0x3a, 0x1e, 0xbc, 0x6a, 0xdf, 0x44, 0x50, 0x6a, 0x60, 0xa6, 0x3f, 0x9d, 0x85,
0x12, 0x92, 0x67, 0xb8, 0x53, 0xf5, 0x4b, 0xe8, 0xff, 0x96, 0x17, 0xa8, 0x9f, 0x64, 0xbb, 0xb4,
0xa7, 0xd8, 0xf1, 0xe0, 0xbb, 0x4f, 0xe4, 0xf8, 0x40, 0xb7, 0xcf, 0xd6, 0xbd, 0xc3, 0x37, 0xd6,
0xd3, 0x07, 0xf6, 0x6f, 0x00, 0x00, 0x00, 0xff, 0xff, 0xc1, 0xfb, 0x81, 0x94, 0xfb, 0x04, 0x00,
0x00,
}

View File

@ -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;
}

View File

@ -0,0 +1,203 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: google.golang.org/appengine/internal/capability/capability_service.proto
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
// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
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
}
func (IsEnabledResponse_SummaryStatus) EnumDescriptor() ([]byte, []int) {
return fileDescriptor_capability_service_030277ff00db7e72, []int{1, 0}
}
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_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *IsEnabledRequest) Reset() { *m = IsEnabledRequest{} }
func (m *IsEnabledRequest) String() string { return proto.CompactTextString(m) }
func (*IsEnabledRequest) ProtoMessage() {}
func (*IsEnabledRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_capability_service_030277ff00db7e72, []int{0}
}
func (m *IsEnabledRequest) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_IsEnabledRequest.Unmarshal(m, b)
}
func (m *IsEnabledRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_IsEnabledRequest.Marshal(b, m, deterministic)
}
func (dst *IsEnabledRequest) XXX_Merge(src proto.Message) {
xxx_messageInfo_IsEnabledRequest.Merge(dst, src)
}
func (m *IsEnabledRequest) XXX_Size() int {
return xxx_messageInfo_IsEnabledRequest.Size(m)
}
func (m *IsEnabledRequest) XXX_DiscardUnknown() {
xxx_messageInfo_IsEnabledRequest.DiscardUnknown(m)
}
var xxx_messageInfo_IsEnabledRequest proto.InternalMessageInfo
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,json=summaryStatus,enum=appengine.IsEnabledResponse_SummaryStatus" json:"summary_status,omitempty"`
TimeUntilScheduled *int64 `protobuf:"varint,2,opt,name=time_until_scheduled,json=timeUntilScheduled" json:"time_until_scheduled,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *IsEnabledResponse) Reset() { *m = IsEnabledResponse{} }
func (m *IsEnabledResponse) String() string { return proto.CompactTextString(m) }
func (*IsEnabledResponse) ProtoMessage() {}
func (*IsEnabledResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_capability_service_030277ff00db7e72, []int{1}
}
func (m *IsEnabledResponse) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_IsEnabledResponse.Unmarshal(m, b)
}
func (m *IsEnabledResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_IsEnabledResponse.Marshal(b, m, deterministic)
}
func (dst *IsEnabledResponse) XXX_Merge(src proto.Message) {
xxx_messageInfo_IsEnabledResponse.Merge(dst, src)
}
func (m *IsEnabledResponse) XXX_Size() int {
return xxx_messageInfo_IsEnabledResponse.Size(m)
}
func (m *IsEnabledResponse) XXX_DiscardUnknown() {
xxx_messageInfo_IsEnabledResponse.DiscardUnknown(m)
}
var xxx_messageInfo_IsEnabledResponse proto.InternalMessageInfo
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
}
func init() {
proto.RegisterType((*IsEnabledRequest)(nil), "appengine.IsEnabledRequest")
proto.RegisterType((*IsEnabledResponse)(nil), "appengine.IsEnabledResponse")
}
func init() {
proto.RegisterFile("google.golang.org/appengine/internal/capability/capability_service.proto", fileDescriptor_capability_service_030277ff00db7e72)
}
var fileDescriptor_capability_service_030277ff00db7e72 = []byte{
// 359 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x91, 0xd1, 0x8a, 0x9b, 0x40,
0x14, 0x86, 0xa3, 0xa6, 0xa4, 0x9e, 0x26, 0xc1, 0x0c, 0xb9, 0x90, 0xb6, 0x14, 0xf1, 0x4a, 0x7a,
0x61, 0x4a, 0xde, 0x20, 0x89, 0x86, 0x84, 0x06, 0x43, 0x35, 0x12, 0x28, 0x14, 0x3b, 0x31, 0x83,
0x95, 0x8e, 0xa3, 0xeb, 0x8c, 0x0b, 0x79, 0x82, 0x7d, 0xed, 0x45, 0x43, 0x8c, 0xcb, 0x2e, 0x7b,
0x77, 0xce, 0xf9, 0xf9, 0xfe, 0x99, 0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
0x7a, 0x11, 0xee, 0x0e, 0x5a, 0xaf, 0x6e, 0x5c, 0x6f, 0xb1, 0xdc, 0xb9, 0x8e, 0x26, 0xa1, 0x29,
0x68, 0xc1, 0x6a, 0xe3, 0x3a, 0xe1, 0xce, 0x75, 0xa2, 0x75, 0x78, 0x08, 0x7d, 0x57, 0x93, 0xd1,
0x04, 0x46, 0xf7, 0xa9, 0xb7, 0x3f, 0x6a, 0x0a, 0x1a, 0xc2, 0x47, 0x67, 0x1b, 0x5c, 0xb1, 0x7e,
0xed, 0x11, 0x7a, 0x3f, 0xbd, 0xfd, 0xd1, 0xd3, 0x3e, 0xcc, 0xff, 0xc0, 0x64, 0xd5, 0xde, 0x2a,
0xb8, 0x26, 0x82, 0x36, 0xa0, 0xb6, 0x7b, 0xa2, 0x2f, 0x6f, 0x6f, 0xdf, 0xc4, 0xf2, 0xf9, 0xeb,
0x7b, 0xa7, 0x31, 0x7b, 0xcb, 0xe1, 0xef, 0x4e, 0x14, 0xcf, 0x01, 0x00, 0x00, 0xff, 0xff, 0xc0,
0x03, 0x26, 0x25, 0x2e, 0x02, 0x00, 0x00,
}

View File

@ -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) {};
}

View File

@ -0,0 +1,273 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: google.golang.org/appengine/internal/channel/channel_service.proto
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
// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
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
}
func (ChannelServiceError_ErrorCode) EnumDescriptor() ([]byte, []int) {
return fileDescriptor_channel_service_a8d15e05b34664a9, []int{0, 0}
}
type ChannelServiceError struct {
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *ChannelServiceError) Reset() { *m = ChannelServiceError{} }
func (m *ChannelServiceError) String() string { return proto.CompactTextString(m) }
func (*ChannelServiceError) ProtoMessage() {}
func (*ChannelServiceError) Descriptor() ([]byte, []int) {
return fileDescriptor_channel_service_a8d15e05b34664a9, []int{0}
}
func (m *ChannelServiceError) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_ChannelServiceError.Unmarshal(m, b)
}
func (m *ChannelServiceError) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_ChannelServiceError.Marshal(b, m, deterministic)
}
func (dst *ChannelServiceError) XXX_Merge(src proto.Message) {
xxx_messageInfo_ChannelServiceError.Merge(dst, src)
}
func (m *ChannelServiceError) XXX_Size() int {
return xxx_messageInfo_ChannelServiceError.Size(m)
}
func (m *ChannelServiceError) XXX_DiscardUnknown() {
xxx_messageInfo_ChannelServiceError.DiscardUnknown(m)
}
var xxx_messageInfo_ChannelServiceError proto.InternalMessageInfo
type CreateChannelRequest struct {
ApplicationKey *string `protobuf:"bytes,1,req,name=application_key,json=applicationKey" json:"application_key,omitempty"`
DurationMinutes *int32 `protobuf:"varint,2,opt,name=duration_minutes,json=durationMinutes" json:"duration_minutes,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *CreateChannelRequest) Reset() { *m = CreateChannelRequest{} }
func (m *CreateChannelRequest) String() string { return proto.CompactTextString(m) }
func (*CreateChannelRequest) ProtoMessage() {}
func (*CreateChannelRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_channel_service_a8d15e05b34664a9, []int{1}
}
func (m *CreateChannelRequest) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_CreateChannelRequest.Unmarshal(m, b)
}
func (m *CreateChannelRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_CreateChannelRequest.Marshal(b, m, deterministic)
}
func (dst *CreateChannelRequest) XXX_Merge(src proto.Message) {
xxx_messageInfo_CreateChannelRequest.Merge(dst, src)
}
func (m *CreateChannelRequest) XXX_Size() int {
return xxx_messageInfo_CreateChannelRequest.Size(m)
}
func (m *CreateChannelRequest) XXX_DiscardUnknown() {
xxx_messageInfo_CreateChannelRequest.DiscardUnknown(m)
}
var xxx_messageInfo_CreateChannelRequest proto.InternalMessageInfo
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=durationMinutes" json:"duration_minutes,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *CreateChannelResponse) Reset() { *m = CreateChannelResponse{} }
func (m *CreateChannelResponse) String() string { return proto.CompactTextString(m) }
func (*CreateChannelResponse) ProtoMessage() {}
func (*CreateChannelResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_channel_service_a8d15e05b34664a9, []int{2}
}
func (m *CreateChannelResponse) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_CreateChannelResponse.Unmarshal(m, b)
}
func (m *CreateChannelResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_CreateChannelResponse.Marshal(b, m, deterministic)
}
func (dst *CreateChannelResponse) XXX_Merge(src proto.Message) {
xxx_messageInfo_CreateChannelResponse.Merge(dst, src)
}
func (m *CreateChannelResponse) XXX_Size() int {
return xxx_messageInfo_CreateChannelResponse.Size(m)
}
func (m *CreateChannelResponse) XXX_DiscardUnknown() {
xxx_messageInfo_CreateChannelResponse.DiscardUnknown(m)
}
var xxx_messageInfo_CreateChannelResponse proto.InternalMessageInfo
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=applicationKey" json:"application_key,omitempty"`
Message *string `protobuf:"bytes,2,req,name=message" json:"message,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *SendMessageRequest) Reset() { *m = SendMessageRequest{} }
func (m *SendMessageRequest) String() string { return proto.CompactTextString(m) }
func (*SendMessageRequest) ProtoMessage() {}
func (*SendMessageRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_channel_service_a8d15e05b34664a9, []int{3}
}
func (m *SendMessageRequest) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_SendMessageRequest.Unmarshal(m, b)
}
func (m *SendMessageRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_SendMessageRequest.Marshal(b, m, deterministic)
}
func (dst *SendMessageRequest) XXX_Merge(src proto.Message) {
xxx_messageInfo_SendMessageRequest.Merge(dst, src)
}
func (m *SendMessageRequest) XXX_Size() int {
return xxx_messageInfo_SendMessageRequest.Size(m)
}
func (m *SendMessageRequest) XXX_DiscardUnknown() {
xxx_messageInfo_SendMessageRequest.DiscardUnknown(m)
}
var xxx_messageInfo_SendMessageRequest proto.InternalMessageInfo
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() {
proto.RegisterType((*ChannelServiceError)(nil), "appengine.ChannelServiceError")
proto.RegisterType((*CreateChannelRequest)(nil), "appengine.CreateChannelRequest")
proto.RegisterType((*CreateChannelResponse)(nil), "appengine.CreateChannelResponse")
proto.RegisterType((*SendMessageRequest)(nil), "appengine.SendMessageRequest")
}
func init() {
proto.RegisterFile("google.golang.org/appengine/internal/channel/channel_service.proto", fileDescriptor_channel_service_a8d15e05b34664a9)
}
var fileDescriptor_channel_service_a8d15e05b34664a9 = []byte{
// 355 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x91, 0xcd, 0xee, 0xd2, 0x40,
0x14, 0xc5, 0x6d, 0xff, 0x22, 0xe9, 0x35, 0x81, 0x66, 0xc0, 0xd8, 0x95, 0x21, 0xdd, 0x88, 0x1b,
0x78, 0x86, 0xa1, 0x9d, 0x68, 0xd3, 0xd2, 0xe2, 0x14, 0xfc, 0xda, 0x4c, 0x26, 0x70, 0x53, 0x2b,
0x65, 0xa6, 0x4e, 0x8b, 0x09, 0x4f, 0xe1, 0x63, 0xf8, 0x9a, 0x26, 0x14, 0x88, 0x21, 0x6c, 0x5c,
0xcd, 0x9c, 0x93, 0xdf, 0x39, 0x33, 0x37, 0x17, 0x16, 0x85, 0xd6, 0x45, 0x85, 0xb3, 0x42, 0x57,
0x52, 0x15, 0x33, 0x6d, 0x8a, 0xb9, 0xac, 0x6b, 0x54, 0x45, 0xa9, 0x70, 0x5e, 0xaa, 0x16, 0x8d,
0x92, 0xd5, 0x7c, 0xfb, 0x5d, 0x2a, 0x85, 0xb7, 0x53, 0x34, 0x68, 0x7e, 0x95, 0x5b, 0x9c, 0xd5,
0x46, 0xb7, 0x9a, 0x38, 0xb7, 0x84, 0xff, 0xc7, 0x82, 0x51, 0xd0, 0x41, 0x79, 0xc7, 0x30, 0x63,
0xb4, 0xf1, 0x7f, 0x5b, 0xe0, 0x9c, 0x6f, 0x81, 0xde, 0x21, 0x79, 0x01, 0x76, 0x16, 0xbb, 0xcf,
0x08, 0x81,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0x45, 0x3d, 0xfb, 0x0c, 0x5c, 0xe5, 0xc2,
0xf9, 0xd6, 0xbf, 0x2c, 0xfb, 0x6f, 0x00, 0x00, 0x00, 0xff, 0xff, 0xe9, 0x0a, 0x77, 0x06, 0x23,
0x02, 0x00, 0x00,
}

View File

@ -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;
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,551 @@
syntax = "proto2";
option go_package = "datastore";
package appengine;
message Action{}
message PropertyValue {
optional int64 int64Value = 1;
optional bool booleanValue = 2;
optional string stringValue = 3;
optional double doubleValue = 4;
optional group PointValue = 5 {
required double x = 6;
required double y = 7;
}
optional group UserValue = 8 {
required string email = 9;
required string auth_domain = 10;
optional string nickname = 11;
optional string federated_identity = 21;
optional string federated_provider = 22;
}
optional group ReferenceValue = 12 {
required string app = 13;
optional string name_space = 20;
repeated group PathElement = 14 {
required string type = 15;
optional int64 id = 16;
optional string name = 17;
}
}
}
message Property {
enum Meaning {
NO_MEANING = 0;
BLOB = 14;
TEXT = 15;
BYTESTRING = 16;
ATOM_CATEGORY = 1;
ATOM_LINK = 2;
ATOM_TITLE = 3;
ATOM_CONTENT = 4;
ATOM_SUMMARY = 5;
ATOM_AUTHOR = 6;
GD_WHEN = 7;
GD_EMAIL = 8;
GEORSS_POINT = 9;
GD_IM = 10;
GD_PHONENUMBER = 11;
GD_POSTALADDRESS = 12;
GD_RATING = 13;
BLOBKEY = 17;
ENTITY_PROTO = 19;
INDEX_VALUE = 18;
};
optional Meaning meaning = 1 [default = NO_MEANING];
optional string meaning_uri = 2;
required string name = 3;
required PropertyValue value = 5;
required bool multiple = 4;
optional bool searchable = 6 [default=false];
enum FtsTokenizationOption {
HTML = 1;
ATOM = 2;
}
optional FtsTokenizationOption fts_tokenization_option = 8;
optional string locale = 9 [default = "en"];
}
message Path {
repeated group Element = 1 {
required string type = 2;
optional int64 id = 3;
optional string name = 4;
}
}
message Reference {
required string app = 13;
optional string name_space = 20;
required Path path = 14;
}
message User {
required string email = 1;
required string auth_domain = 2;
optional string nickname = 3;
optional string federated_identity = 6;
optional string federated_provider = 7;
}
message EntityProto {
required Reference key = 13;
required Path entity_group = 16;
optional User owner = 17;
enum Kind {
GD_CONTACT = 1;
GD_EVENT = 2;
GD_MESSAGE = 3;
}
optional Kind kind = 4;
optional string kind_uri = 5;
repeated Property property = 14;
repeated Property raw_property = 15;
optional int32 rank = 18;
}
message CompositeProperty {
required int64 index_id = 1;
repeated string value = 2;
}
message Index {
required string entity_type = 1;
required bool ancestor = 5;
repeated group Property = 2 {
required string name = 3;
enum Direction {
ASCENDING = 1;
DESCENDING = 2;
}
optional Direction direction = 4 [default = ASCENDING];
}
}
message CompositeIndex {
required string app_id = 1;
required int64 id = 2;
required Index definition = 3;
enum State {
WRITE_ONLY = 1;
READ_WRITE = 2;
DELETED = 3;
ERROR = 4;
}
required State state = 4;
optional bool only_use_if_required = 6 [default = false];
}
message IndexPostfix {
message IndexValue {
required string property_name = 1;
required PropertyValue value = 2;
}
repeated IndexValue index_value = 1;
optional Reference key = 2;
optional bool before = 3 [default=true];
}
message IndexPosition {
optional string key = 1;
optional bool before = 2 [default=true];
}
message Snapshot {
enum Status {
INACTIVE = 0;
ACTIVE = 1;
}
required int64 ts = 1;
}
message InternalHeader {
optional string qos = 1;
}
message Transaction {
optional InternalHeader header = 4;
required fixed64 handle = 1;
required string app = 2;
optional bool mark_changes = 3 [default = false];
}
message Query {
optional InternalHeader header = 39;
required string app = 1;
optional string name_space = 29;
optional string kind = 3;
optional Reference ancestor = 17;
repeated group Filter = 4 {
enum Operator {
LESS_THAN = 1;
LESS_THAN_OR_EQUAL = 2;
GREATER_THAN = 3;
GREATER_THAN_OR_EQUAL = 4;
EQUAL = 5;
IN = 6;
EXISTS = 7;
}
required Operator op = 6;
repeated Property property = 14;
}
optional string search_query = 8;
repeated group Order = 9 {
enum Direction {
ASCENDING = 1;
DESCENDING = 2;
}
required string property = 10;
optional Direction direction = 11 [default = ASCENDING];
}
enum Hint {
ORDER_FIRST = 1;
ANCESTOR_FIRST = 2;
FILTER_FIRST = 3;
}
optional Hint hint = 18;
optional int32 count = 23;
optional int32 offset = 12 [default = 0];
optional int32 limit = 16;
optional CompiledCursor compiled_cursor = 30;
optional CompiledCursor end_compiled_cursor = 31;
repeated CompositeIndex composite_index = 19;
optional bool require_perfect_plan = 20 [default = false];
optional bool keys_only = 21 [default = false];
optional Transaction transaction = 22;
optional bool compile = 25 [default = false];
optional int64 failover_ms = 26;
optional bool strong = 32;
repeated string property_name = 33;
repeated string group_by_property_name = 34;
optional bool distinct = 24;
optional int64 min_safe_time_seconds = 35;
repeated string safe_replica_name = 36;
optional bool persist_offset = 37 [default=false];
}
message CompiledQuery {
required group PrimaryScan = 1 {
optional string index_name = 2;
optional string start_key = 3;
optional bool start_inclusive = 4;
optional string end_key = 5;
optional bool end_inclusive = 6;
repeated string start_postfix_value = 22;
repeated string end_postfix_value = 23;
optional int64 end_unapplied_log_timestamp_us = 19;
}
repeated group MergeJoinScan = 7 {
required string index_name = 8;
repeated string prefix_value = 9;
optional bool value_prefix = 20 [default=false];
}
optional Index index_def = 21;
optional int32 offset = 10 [default = 0];
optional int32 limit = 11;
required bool keys_only = 12;
repeated string property_name = 24;
optional int32 distinct_infix_size = 25;
optional group EntityFilter = 13 {
optional bool distinct = 14 [default=false];
optional string kind = 17;
optional Reference ancestor = 18;
}
}
message CompiledCursor {
optional group Position = 2 {
optional string start_key = 27;
repeated group IndexValue = 29 {
optional string property = 30;
required PropertyValue value = 31;
}
optional Reference key = 32;
optional bool start_inclusive = 28 [default=true];
}
}
message Cursor {
required fixed64 cursor = 1;
optional string app = 2;
}
message Error {
enum ErrorCode {
BAD_REQUEST = 1;
CONCURRENT_TRANSACTION = 2;
INTERNAL_ERROR = 3;
NEED_INDEX = 4;
TIMEOUT = 5;
PERMISSION_DENIED = 6;
BIGTABLE_ERROR = 7;
COMMITTED_BUT_STILL_APPLYING = 8;
CAPABILITY_DISABLED = 9;
TRY_ALTERNATE_BACKEND = 10;
SAFE_TIME_TOO_OLD = 11;
}
}
message Cost {
optional int32 index_writes = 1;
optional int32 index_write_bytes = 2;
optional int32 entity_writes = 3;
optional int32 entity_write_bytes = 4;
optional group CommitCost = 5 {
optional int32 requested_entity_puts = 6;
optional int32 requested_entity_deletes = 7;
};
optional int32 approximate_storage_delta = 8;
optional int32 id_sequence_updates = 9;
}
message GetRequest {
optional InternalHeader header = 6;
repeated Reference key = 1;
optional Transaction transaction = 2;
optional int64 failover_ms = 3;
optional bool strong = 4;
optional bool allow_deferred = 5 [default=false];
}
message GetResponse {
repeated group Entity = 1 {
optional EntityProto entity = 2;
optional Reference key = 4;
optional int64 version = 3;
}
repeated Reference deferred = 5;
optional bool in_order = 6 [default=true];
}
message PutRequest {
optional InternalHeader header = 11;
repeated EntityProto entity = 1;
optional Transaction transaction = 2;
repeated CompositeIndex composite_index = 3;
optional bool trusted = 4 [default = false];
optional bool force = 7 [default = false];
optional bool mark_changes = 8 [default = false];
repeated Snapshot snapshot = 9;
enum AutoIdPolicy {
CURRENT = 0;
SEQUENTIAL = 1;
}
optional AutoIdPolicy auto_id_policy = 10 [default = CURRENT];
}
message PutResponse {
repeated Reference key = 1;
optional Cost cost = 2;
repeated int64 version = 3;
}
message TouchRequest {
optional InternalHeader header = 10;
repeated Reference key = 1;
repeated CompositeIndex composite_index = 2;
optional bool force = 3 [default = false];
repeated Snapshot snapshot = 9;
}
message TouchResponse {
optional Cost cost = 1;
}
message DeleteRequest {
optional InternalHeader header = 10;
repeated Reference key = 6;
optional Transaction transaction = 5;
optional bool trusted = 4 [default = false];
optional bool force = 7 [default = false];
optional bool mark_changes = 8 [default = false];
repeated Snapshot snapshot = 9;
}
message DeleteResponse {
optional Cost cost = 1;
repeated int64 version = 3;
}
message NextRequest {
optional InternalHeader header = 5;
required Cursor cursor = 1;
optional int32 count = 2;
optional int32 offset = 4 [default = 0];
optional bool compile = 3 [default = false];
}
message QueryResult {
optional Cursor cursor = 1;
repeated EntityProto result = 2;
optional int32 skipped_results = 7;
required bool more_results = 3;
optional bool keys_only = 4;
optional bool index_only = 9;
optional bool small_ops = 10;
optional CompiledQuery compiled_query = 5;
optional CompiledCursor compiled_cursor = 6;
repeated CompositeIndex index = 8;
repeated int64 version = 11;
}
message AllocateIdsRequest {
optional InternalHeader header = 4;
optional Reference model_key = 1;
optional int64 size = 2;
optional int64 max = 3;
repeated Reference reserve = 5;
}
message AllocateIdsResponse {
required int64 start = 1;
required int64 end = 2;
optional Cost cost = 3;
}
message CompositeIndices {
repeated CompositeIndex index = 1;
}
message AddActionsRequest {
optional InternalHeader header = 3;
required Transaction transaction = 1;
repeated Action action = 2;
}
message AddActionsResponse {
}
message BeginTransactionRequest {
optional InternalHeader header = 3;
required string app = 1;
optional bool allow_multiple_eg = 2 [default = false];
optional string database_id = 4;
enum TransactionMode {
UNKNOWN = 0;
READ_ONLY = 1;
READ_WRITE = 2;
}
optional TransactionMode mode = 5 [default = UNKNOWN];
optional Transaction previous_transaction = 7;
}
message CommitResponse {
optional Cost cost = 1;
repeated group Version = 3 {
required Reference root_entity_key = 4;
required int64 version = 5;
}
}

View File

@ -0,0 +1,55 @@
// 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 (
"os"
netcontext "golang.org/x/net/context"
)
var (
// This is set to true in identity_classic.go, which is behind the appengine build tag.
// The appengine build tag is set for the first generation runtimes (<= Go 1.9) but not
// the second generation runtimes (>= Go 1.11), so this indicates whether we're on a
// first-gen runtime. See IsStandard below for the second-gen check.
appengineStandard bool
// This is set to true in identity_flex.go, which is behind the appenginevm build tag.
appengineFlex bool
)
// AppID is the implementation of the wrapper function of the same name in
// ../identity.go. See that file for commentary.
func AppID(c netcontext.Context) string {
return appID(FullyQualifiedAppID(c))
}
// IsStandard is the implementation of the wrapper function of the same name in
// ../appengine.go. See that file for commentary.
func IsStandard() bool {
// appengineStandard will be true for first-gen runtimes (<= Go 1.9) but not
// second-gen (>= Go 1.11).
return appengineStandard || IsSecondGen()
}
// IsStandard is the implementation of the wrapper function of the same name in
// ../appengine.go. See that file for commentary.
func IsSecondGen() bool {
// Second-gen runtimes set $GAE_ENV so we use that to check if we're on a second-gen runtime.
return os.Getenv("GAE_ENV") == "standard"
}
// IsFlex is the implementation of the wrapper function of the same name in
// ../appengine.go. See that file for commentary.
func IsFlex() bool {
return appengineFlex
}
// IsAppEngine is the implementation of the wrapper function of the same name in
// ../appengine.go. See that file for commentary.
func IsAppEngine() bool {
return IsStandard() || IsFlex()
}

View File

@ -0,0 +1,61 @@
// Copyright 2015 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 (
"appengine"
netcontext "golang.org/x/net/context"
)
func init() {
appengineStandard = true
}
func DefaultVersionHostname(ctx netcontext.Context) string {
c := fromContext(ctx)
if c == nil {
panic(errNotAppEngineContext)
}
return appengine.DefaultVersionHostname(c)
}
func Datacenter(_ netcontext.Context) string { return appengine.Datacenter() }
func ServerSoftware() string { return appengine.ServerSoftware() }
func InstanceID() string { return appengine.InstanceID() }
func IsDevAppServer() bool { return appengine.IsDevAppServer() }
func RequestID(ctx netcontext.Context) string {
c := fromContext(ctx)
if c == nil {
panic(errNotAppEngineContext)
}
return appengine.RequestID(c)
}
func ModuleName(ctx netcontext.Context) string {
c := fromContext(ctx)
if c == nil {
panic(errNotAppEngineContext)
}
return appengine.ModuleName(c)
}
func VersionID(ctx netcontext.Context) string {
c := fromContext(ctx)
if c == nil {
panic(errNotAppEngineContext)
}
return appengine.VersionID(c)
}
func fullyQualifiedAppID(ctx netcontext.Context) string {
c := fromContext(ctx)
if c == nil {
panic(errNotAppEngineContext)
}
return c.FullyQualifiedAppID()
}

View File

@ -0,0 +1,11 @@
// Copyright 2018 Google LLC. 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 appenginevm
package internal
func init() {
appengineFlex = true
}

View File

@ -0,0 +1,134 @@
// 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.
// +build !appengine
package internal
import (
"log"
"net/http"
"os"
"strings"
netcontext "golang.org/x/net/context"
)
// These functions are implementations of the wrapper functions
// in ../appengine/identity.go. See that file for commentary.
const (
hDefaultVersionHostname = "X-AppEngine-Default-Version-Hostname"
hRequestLogId = "X-AppEngine-Request-Log-Id"
hDatacenter = "X-AppEngine-Datacenter"
)
func ctxHeaders(ctx netcontext.Context) http.Header {
c := fromContext(ctx)
if c == nil {
return nil
}
return c.Request().Header
}
func DefaultVersionHostname(ctx netcontext.Context) string {
return ctxHeaders(ctx).Get(hDefaultVersionHostname)
}
func RequestID(ctx netcontext.Context) string {
return ctxHeaders(ctx).Get(hRequestLogId)
}
func Datacenter(ctx netcontext.Context) string {
if dc := ctxHeaders(ctx).Get(hDatacenter); dc != "" {
return dc
}
// If the header isn't set, read zone from the metadata service.
// It has the format projects/[NUMERIC_PROJECT_ID]/zones/[ZONE]
zone, err := getMetadata("instance/zone")
if err != nil {
log.Printf("Datacenter: %v", err)
return ""
}
parts := strings.Split(string(zone), "/")
if len(parts) == 0 {
return ""
}
return parts[len(parts)-1]
}
func ServerSoftware() string {
// TODO(dsymonds): Remove fallback when we've verified this.
if s := os.Getenv("SERVER_SOFTWARE"); s != "" {
return s
}
if s := os.Getenv("GAE_ENV"); s != "" {
return s
}
return "Google App Engine/1.x.x"
}
// TODO(dsymonds): Remove the metadata fetches.
func ModuleName(_ netcontext.Context) string {
if s := os.Getenv("GAE_MODULE_NAME"); s != "" {
return s
}
if s := os.Getenv("GAE_SERVICE"); s != "" {
return s
}
return string(mustGetMetadata("instance/attributes/gae_backend_name"))
}
func VersionID(_ netcontext.Context) string {
if s1, s2 := os.Getenv("GAE_MODULE_VERSION"), os.Getenv("GAE_MINOR_VERSION"); s1 != "" && s2 != "" {
return s1 + "." + s2
}
if s1, s2 := os.Getenv("GAE_VERSION"), os.Getenv("GAE_DEPLOYMENT_ID"); s1 != "" && s2 != "" {
return s1 + "." + s2
}
return string(mustGetMetadata("instance/attributes/gae_backend_version")) + "." + string(mustGetMetadata("instance/attributes/gae_backend_minor_version"))
}
func InstanceID() string {
if s := os.Getenv("GAE_MODULE_INSTANCE"); s != "" {
return s
}
if s := os.Getenv("GAE_INSTANCE"); s != "" {
return s
}
return string(mustGetMetadata("instance/attributes/gae_backend_instance"))
}
func partitionlessAppID() string {
// gae_project has everything except the partition prefix.
if appID := os.Getenv("GAE_LONG_APP_ID"); appID != "" {
return appID
}
if project := os.Getenv("GOOGLE_CLOUD_PROJECT"); project != "" {
return project
}
return string(mustGetMetadata("instance/attributes/gae_project"))
}
func fullyQualifiedAppID(_ netcontext.Context) string {
if s := os.Getenv("GAE_APPLICATION"); s != "" {
return s
}
appID := partitionlessAppID()
part := os.Getenv("GAE_PARTITION")
if part == "" {
part = string(mustGetMetadata("instance/attributes/gae_partition"))
}
if part != "" {
appID = part + "~" + appID
}
return appID
}
func IsDevAppServer() bool {
return os.Getenv("RUN_WITH_DEVAPPSERVER") != ""
}

File diff suppressed because it is too large Load Diff

View File

@ -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 {
}

110
vendor/google.golang.org/appengine/internal/internal.go generated vendored Normal file
View File

@ -0,0 +1,110 @@
// 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 provides support for package appengine.
//
// Programs should not use this package directly. Its API is not stable.
// Use packages appengine and appengine/* instead.
package internal
import (
"fmt"
"github.com/golang/protobuf/proto"
remotepb "google.golang.org/appengine/internal/remote_api"
)
// errorCodeMaps is a map of service name to the error code map for the service.
var errorCodeMaps = make(map[string]map[int32]string)
// RegisterErrorCodeMap is called from API implementations to register their
// error code map. This should only be called from init functions.
func RegisterErrorCodeMap(service string, m map[int32]string) {
errorCodeMaps[service] = m
}
type timeoutCodeKey struct {
service string
code int32
}
// timeoutCodes is the set of service+code pairs that represent timeouts.
var timeoutCodes = make(map[timeoutCodeKey]bool)
func RegisterTimeoutErrorCode(service string, code int32) {
timeoutCodes[timeoutCodeKey{service, code}] = true
}
// APIError is the type returned by appengine.Context's Call method
// when an API call fails in an API-specific way. This may be, for instance,
// a taskqueue API call failing with TaskQueueServiceError::UNKNOWN_QUEUE.
type APIError struct {
Service string
Detail string
Code int32 // API-specific error code
}
func (e *APIError) Error() string {
if e.Code == 0 {
if e.Detail == "" {
return "APIError <empty>"
}
return e.Detail
}
s := fmt.Sprintf("API error %d", e.Code)
if m, ok := errorCodeMaps[e.Service]; ok {
s += " (" + e.Service + ": " + m[e.Code] + ")"
} else {
// Shouldn't happen, but provide a bit more detail if it does.
s = e.Service + " " + s
}
if e.Detail != "" {
s += ": " + e.Detail
}
return s
}
func (e *APIError) IsTimeout() bool {
return timeoutCodes[timeoutCodeKey{e.Service, e.Code}]
}
// CallError is the type returned by appengine.Context's Call method when an
// API call fails in a generic way, such as RpcError::CAPABILITY_DISABLED.
type CallError struct {
Detail string
Code int32
// TODO: Remove this if we get a distinguishable error code.
Timeout bool
}
func (e *CallError) Error() string {
var msg string
switch remotepb.RpcError_ErrorCode(e.Code) {
case remotepb.RpcError_UNKNOWN:
return e.Detail
case remotepb.RpcError_OVER_QUOTA:
msg = "Over quota"
case remotepb.RpcError_CAPABILITY_DISABLED:
msg = "Capability disabled"
case remotepb.RpcError_CANCELLED:
msg = "Canceled"
default:
msg = fmt.Sprintf("Call error %d", e.Code)
}
s := msg + ": " + e.Detail
if e.Timeout {
s += " (timeout)"
}
return s
}
func (e *CallError) IsTimeout() bool {
return e.Timeout
}
// NamespaceMods is a map from API service to a function that will mutate an RPC request to attach a namespace.
// The function should be prepared to be called on the same message more than once; it should only modify the
// RPC request the first time.
var NamespaceMods = make(map[string]func(m proto.Message, namespace string))

View File

@ -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!")
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,150 @@
syntax = "proto2";
option go_package = "log";
package appengine;
message LogServiceError {
enum ErrorCode {
OK = 0;
INVALID_REQUEST = 1;
STORAGE_ERROR = 2;
}
}
message UserAppLogLine {
required int64 timestamp_usec = 1;
required int64 level = 2;
required string message = 3;
}
message UserAppLogGroup {
repeated UserAppLogLine log_line = 2;
}
message FlushRequest {
optional bytes logs = 1;
}
message SetStatusRequest {
required string status = 1;
}
message LogOffset {
optional bytes request_id = 1;
}
message LogLine {
required int64 time = 1;
required int32 level = 2;
required string log_message = 3;
}
message RequestLog {
required string app_id = 1;
optional string module_id = 37 [default="default"];
required string version_id = 2;
required bytes request_id = 3;
optional LogOffset offset = 35;
required string ip = 4;
optional string nickname = 5;
required int64 start_time = 6;
required int64 end_time = 7;
required int64 latency = 8;
required int64 mcycles = 9;
required string method = 10;
required string resource = 11;
required string http_version = 12;
required int32 status = 13;
required int64 response_size = 14;
optional string referrer = 15;
optional string user_agent = 16;
required string url_map_entry = 17;
required string combined = 18;
optional int64 api_mcycles = 19;
optional string host = 20;
optional double cost = 21;
optional string task_queue_name = 22;
optional string task_name = 23;
optional bool was_loading_request = 24;
optional int64 pending_time = 25;
optional int32 replica_index = 26 [default = -1];
optional bool finished = 27 [default = true];
optional bytes clone_key = 28;
repeated LogLine line = 29;
optional bool lines_incomplete = 36;
optional bytes app_engine_release = 38;
optional int32 exit_reason = 30;
optional bool was_throttled_for_time = 31;
optional bool was_throttled_for_requests = 32;
optional int64 throttled_time = 33;
optional bytes server_name = 34;
}
message LogModuleVersion {
optional string module_id = 1 [default="default"];
optional string version_id = 2;
}
message LogReadRequest {
required string app_id = 1;
repeated string version_id = 2;
repeated LogModuleVersion module_version = 19;
optional int64 start_time = 3;
optional int64 end_time = 4;
optional LogOffset offset = 5;
repeated bytes request_id = 6;
optional int32 minimum_log_level = 7;
optional bool include_incomplete = 8;
optional int64 count = 9;
optional string combined_log_regex = 14;
optional string host_regex = 15;
optional int32 replica_index = 16;
optional bool include_app_logs = 10;
optional int32 app_logs_per_request = 17;
optional bool include_host = 11;
optional bool include_all = 12;
optional bool cache_iterator = 13;
optional int32 num_shards = 18;
}
message LogReadResponse {
repeated RequestLog log = 1;
optional LogOffset offset = 2;
optional int64 last_end_time = 3;
}
message LogUsageRecord {
optional string version_id = 1;
optional int32 start_time = 2;
optional int32 end_time = 3;
optional int64 count = 4;
optional int64 total_size = 5;
optional int32 records = 6;
}
message LogUsageRequest {
required string app_id = 1;
repeated string version_id = 2;
optional int32 start_time = 3;
optional int32 end_time = 4;
optional uint32 resolution_hours = 5 [default = 1];
optional bool combine_versions = 6;
optional int32 usage_version = 7;
optional bool versions_only = 8;
}
message LogUsageResponse {
repeated LogUsageRecord usage = 1;
optional LogUsageRecord summary = 2;
}

View File

@ -0,0 +1,355 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: google.golang.org/appengine/internal/mail/mail_service.proto
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
// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
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
}
func (MailServiceError_ErrorCode) EnumDescriptor() ([]byte, []int) {
return fileDescriptor_mail_service_78722be3c4c01d17, []int{0, 0}
}
type MailServiceError struct {
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *MailServiceError) Reset() { *m = MailServiceError{} }
func (m *MailServiceError) String() string { return proto.CompactTextString(m) }
func (*MailServiceError) ProtoMessage() {}
func (*MailServiceError) Descriptor() ([]byte, []int) {
return fileDescriptor_mail_service_78722be3c4c01d17, []int{0}
}
func (m *MailServiceError) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_MailServiceError.Unmarshal(m, b)
}
func (m *MailServiceError) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_MailServiceError.Marshal(b, m, deterministic)
}
func (dst *MailServiceError) XXX_Merge(src proto.Message) {
xxx_messageInfo_MailServiceError.Merge(dst, src)
}
func (m *MailServiceError) XXX_Size() int {
return xxx_messageInfo_MailServiceError.Size(m)
}
func (m *MailServiceError) XXX_DiscardUnknown() {
xxx_messageInfo_MailServiceError.DiscardUnknown(m)
}
var xxx_messageInfo_MailServiceError proto.InternalMessageInfo
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_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *MailAttachment) Reset() { *m = MailAttachment{} }
func (m *MailAttachment) String() string { return proto.CompactTextString(m) }
func (*MailAttachment) ProtoMessage() {}
func (*MailAttachment) Descriptor() ([]byte, []int) {
return fileDescriptor_mail_service_78722be3c4c01d17, []int{1}
}
func (m *MailAttachment) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_MailAttachment.Unmarshal(m, b)
}
func (m *MailAttachment) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_MailAttachment.Marshal(b, m, deterministic)
}
func (dst *MailAttachment) XXX_Merge(src proto.Message) {
xxx_messageInfo_MailAttachment.Merge(dst, src)
}
func (m *MailAttachment) XXX_Size() int {
return xxx_messageInfo_MailAttachment.Size(m)
}
func (m *MailAttachment) XXX_DiscardUnknown() {
xxx_messageInfo_MailAttachment.DiscardUnknown(m)
}
var xxx_messageInfo_MailAttachment proto.InternalMessageInfo
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_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *MailHeader) Reset() { *m = MailHeader{} }
func (m *MailHeader) String() string { return proto.CompactTextString(m) }
func (*MailHeader) ProtoMessage() {}
func (*MailHeader) Descriptor() ([]byte, []int) {
return fileDescriptor_mail_service_78722be3c4c01d17, []int{2}
}
func (m *MailHeader) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_MailHeader.Unmarshal(m, b)
}
func (m *MailHeader) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_MailHeader.Marshal(b, m, deterministic)
}
func (dst *MailHeader) XXX_Merge(src proto.Message) {
xxx_messageInfo_MailHeader.Merge(dst, src)
}
func (m *MailHeader) XXX_Size() int {
return xxx_messageInfo_MailHeader.Size(m)
}
func (m *MailHeader) XXX_DiscardUnknown() {
xxx_messageInfo_MailHeader.DiscardUnknown(m)
}
var xxx_messageInfo_MailHeader proto.InternalMessageInfo
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_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *MailMessage) Reset() { *m = MailMessage{} }
func (m *MailMessage) String() string { return proto.CompactTextString(m) }
func (*MailMessage) ProtoMessage() {}
func (*MailMessage) Descriptor() ([]byte, []int) {
return fileDescriptor_mail_service_78722be3c4c01d17, []int{3}
}
func (m *MailMessage) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_MailMessage.Unmarshal(m, b)
}
func (m *MailMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_MailMessage.Marshal(b, m, deterministic)
}
func (dst *MailMessage) XXX_Merge(src proto.Message) {
xxx_messageInfo_MailMessage.Merge(dst, src)
}
func (m *MailMessage) XXX_Size() int {
return xxx_messageInfo_MailMessage.Size(m)
}
func (m *MailMessage) XXX_DiscardUnknown() {
xxx_messageInfo_MailMessage.DiscardUnknown(m)
}
var xxx_messageInfo_MailMessage proto.InternalMessageInfo
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() {
proto.RegisterType((*MailServiceError)(nil), "appengine.MailServiceError")
proto.RegisterType((*MailAttachment)(nil), "appengine.MailAttachment")
proto.RegisterType((*MailHeader)(nil), "appengine.MailHeader")
proto.RegisterType((*MailMessage)(nil), "appengine.MailMessage")
}
func init() {
proto.RegisterFile("google.golang.org/appengine/internal/mail/mail_service.proto", fileDescriptor_mail_service_78722be3c4c01d17)
}
var fileDescriptor_mail_service_78722be3c4c01d17 = []byte{
// 480 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x5c, 0x92, 0xcf, 0x6e, 0xd3, 0x40,
0x10, 0xc6, 0x89, 0x9d, 0xb8, 0xf5, 0x04, 0x05, 0x6b, 0x81, 0x76, 0xf9, 0x73, 0x88, 0x72, 0xca,
0x85, 0x44, 0xe2, 0x80, 0x84, 0xc4, 0xc5, 0xb1, 0x17, 0xc5, 0xa2, 0x71, 0x60, 0xb3, 0x41, 0xa2,
0x07, 0xac, 0xc5, 0x19, 0x19, 0x23, 0xc7, 0x1b, 0x39, 0xdb, 0x8a, 0x3e, 0x0d, 0x4f, 0xc0, 0x8d,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8f, 0xfb, 0xaf, 0x9f, 0x4d, 0x8e, 0x47, 0x33, 0xf9, 0x3f, 0x7a, 0xfe, 0x4f, 0x33, 0x79, 0x05,
0x4e, 0x13, 0x1a, 0x85, 0xda, 0xf6, 0xf4, 0x9e, 0xad, 0x11, 0xf9, 0xa1, 0x69, 0xe6, 0x5c, 0x77,
0xcd, 0x7d, 0xfe, 0x0d, 0x00, 0x00, 0xff, 0xff, 0x4e, 0xd3, 0x01, 0x27, 0xd0, 0x02, 0x00, 0x00,
}

View File

@ -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;
}

16
vendor/google.golang.org/appengine/internal/main.go generated vendored Normal file
View File

@ -0,0 +1,16 @@
// 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.
// +build appengine
package internal
import (
"appengine_internal"
)
func Main() {
MainPath = ""
appengine_internal.Main()
}

View File

@ -0,0 +1,7 @@
package internal
// MainPath stores the file path of the main package. On App Engine Standard
// using Go version 1.9 and below, this will be unset. On App Engine Flex and
// App Engine Standard second-gen (Go 1.11 and above), this will be the
// filepath to package main.
var MainPath string

View File

@ -0,0 +1,18 @@
// +build !appengine
package internal
import (
"go/build"
"path/filepath"
"testing"
)
func TestFindMainPath(t *testing.T) {
// Tests won't have package main, instead they have testing.tRunner
want := filepath.Join(build.Default.GOROOT, "src", "testing", "testing.go")
got := findMainPath()
if want != got {
t.Errorf("findMainPath: want %s, got %s", want, got)
}
}

69
vendor/google.golang.org/appengine/internal/main_vm.go generated vendored Normal file
View File

@ -0,0 +1,69 @@
// 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.
// +build !appengine
package internal
import (
"io"
"log"
"net/http"
"net/url"
"os"
"path/filepath"
"runtime"
)
func Main() {
MainPath = filepath.Dir(findMainPath())
installHealthChecker(http.DefaultServeMux)
port := "8080"
if s := os.Getenv("PORT"); s != "" {
port = s
}
host := ""
if IsDevAppServer() {
host = "127.0.0.1"
}
if err := http.ListenAndServe(host+":"+port, http.HandlerFunc(handleHTTP)); err != nil {
log.Fatalf("http.ListenAndServe: %v", err)
}
}
// Find the path to package main by looking at the root Caller.
func findMainPath() string {
pc := make([]uintptr, 100)
n := runtime.Callers(2, pc)
frames := runtime.CallersFrames(pc[:n])
for {
frame, more := frames.Next()
// Tests won't have package main, instead they have testing.tRunner
if frame.Function == "main.main" || frame.Function == "testing.tRunner" {
return frame.File
}
if !more {
break
}
}
return ""
}
func installHealthChecker(mux *http.ServeMux) {
// If no health check handler has been installed by this point, add a trivial one.
const healthPath = "/_ah/health"
hreq := &http.Request{
Method: "GET",
URL: &url.URL{
Path: healthPath,
},
}
if _, pat := mux.Handler(hreq); pat != healthPath {
mux.HandleFunc(healthPath, func(w http.ResponseWriter, r *http.Request) {
io.WriteString(w, "ok")
})
}
}

File diff suppressed because it is too large Load Diff

View File

@ -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;
}
}

View File

@ -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.
package internal
// This file has code for accessing metadata.
//
// References:
// https://cloud.google.com/compute/docs/metadata
import (
"fmt"
"io/ioutil"
"net/http"
"net/url"
)
const (
metadataHost = "metadata"
metadataPath = "/computeMetadata/v1/"
)
var (
metadataRequestHeaders = http.Header{
"Metadata-Flavor": []string{"Google"},
}
)
// TODO(dsymonds): Do we need to support default values, like Python?
func mustGetMetadata(key string) []byte {
b, err := getMetadata(key)
if err != nil {
panic(fmt.Sprintf("Metadata fetch failed for '%s': %v", key, err))
}
return b
}
func getMetadata(key string) ([]byte, error) {
// TODO(dsymonds): May need to use url.Parse to support keys with query args.
req := &http.Request{
Method: "GET",
URL: &url.URL{
Scheme: "http",
Host: metadataHost,
Path: metadataPath + key,
},
Header: metadataRequestHeaders,
Host: metadataHost,
}
resp, err := http.DefaultClient.Do(req)
if err != nil {
return nil, err
}
defer resp.Body.Close()
if resp.StatusCode != 200 {
return nil, fmt.Errorf("metadata server returned HTTP %d", resp.StatusCode)
}
return ioutil.ReadAll(resp.Body)
}

View File

@ -0,0 +1,786 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: google.golang.org/appengine/internal/modules/modules_service.proto
package modules
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
// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
type ModulesServiceError_ErrorCode int32
const (
ModulesServiceError_OK ModulesServiceError_ErrorCode = 0
ModulesServiceError_INVALID_MODULE ModulesServiceError_ErrorCode = 1
ModulesServiceError_INVALID_VERSION ModulesServiceError_ErrorCode = 2
ModulesServiceError_INVALID_INSTANCES ModulesServiceError_ErrorCode = 3
ModulesServiceError_TRANSIENT_ERROR ModulesServiceError_ErrorCode = 4
ModulesServiceError_UNEXPECTED_STATE ModulesServiceError_ErrorCode = 5
)
var ModulesServiceError_ErrorCode_name = map[int32]string{
0: "OK",
1: "INVALID_MODULE",
2: "INVALID_VERSION",
3: "INVALID_INSTANCES",
4: "TRANSIENT_ERROR",
5: "UNEXPECTED_STATE",
}
var ModulesServiceError_ErrorCode_value = map[string]int32{
"OK": 0,
"INVALID_MODULE": 1,
"INVALID_VERSION": 2,
"INVALID_INSTANCES": 3,
"TRANSIENT_ERROR": 4,
"UNEXPECTED_STATE": 5,
}
func (x ModulesServiceError_ErrorCode) Enum() *ModulesServiceError_ErrorCode {
p := new(ModulesServiceError_ErrorCode)
*p = x
return p
}
func (x ModulesServiceError_ErrorCode) String() string {
return proto.EnumName(ModulesServiceError_ErrorCode_name, int32(x))
}
func (x *ModulesServiceError_ErrorCode) UnmarshalJSON(data []byte) error {
value, err := proto.UnmarshalJSONEnum(ModulesServiceError_ErrorCode_value, data, "ModulesServiceError_ErrorCode")
if err != nil {
return err
}
*x = ModulesServiceError_ErrorCode(value)
return nil
}
func (ModulesServiceError_ErrorCode) EnumDescriptor() ([]byte, []int) {
return fileDescriptor_modules_service_9cd3bffe4e91c59a, []int{0, 0}
}
type ModulesServiceError struct {
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *ModulesServiceError) Reset() { *m = ModulesServiceError{} }
func (m *ModulesServiceError) String() string { return proto.CompactTextString(m) }
func (*ModulesServiceError) ProtoMessage() {}
func (*ModulesServiceError) Descriptor() ([]byte, []int) {
return fileDescriptor_modules_service_9cd3bffe4e91c59a, []int{0}
}
func (m *ModulesServiceError) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_ModulesServiceError.Unmarshal(m, b)
}
func (m *ModulesServiceError) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_ModulesServiceError.Marshal(b, m, deterministic)
}
func (dst *ModulesServiceError) XXX_Merge(src proto.Message) {
xxx_messageInfo_ModulesServiceError.Merge(dst, src)
}
func (m *ModulesServiceError) XXX_Size() int {
return xxx_messageInfo_ModulesServiceError.Size(m)
}
func (m *ModulesServiceError) XXX_DiscardUnknown() {
xxx_messageInfo_ModulesServiceError.DiscardUnknown(m)
}
var xxx_messageInfo_ModulesServiceError proto.InternalMessageInfo
type GetModulesRequest struct {
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *GetModulesRequest) Reset() { *m = GetModulesRequest{} }
func (m *GetModulesRequest) String() string { return proto.CompactTextString(m) }
func (*GetModulesRequest) ProtoMessage() {}
func (*GetModulesRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_modules_service_9cd3bffe4e91c59a, []int{1}
}
func (m *GetModulesRequest) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_GetModulesRequest.Unmarshal(m, b)
}
func (m *GetModulesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_GetModulesRequest.Marshal(b, m, deterministic)
}
func (dst *GetModulesRequest) XXX_Merge(src proto.Message) {
xxx_messageInfo_GetModulesRequest.Merge(dst, src)
}
func (m *GetModulesRequest) XXX_Size() int {
return xxx_messageInfo_GetModulesRequest.Size(m)
}
func (m *GetModulesRequest) XXX_DiscardUnknown() {
xxx_messageInfo_GetModulesRequest.DiscardUnknown(m)
}
var xxx_messageInfo_GetModulesRequest proto.InternalMessageInfo
type GetModulesResponse struct {
Module []string `protobuf:"bytes,1,rep,name=module" json:"module,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *GetModulesResponse) Reset() { *m = GetModulesResponse{} }
func (m *GetModulesResponse) String() string { return proto.CompactTextString(m) }
func (*GetModulesResponse) ProtoMessage() {}
func (*GetModulesResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_modules_service_9cd3bffe4e91c59a, []int{2}
}
func (m *GetModulesResponse) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_GetModulesResponse.Unmarshal(m, b)
}
func (m *GetModulesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_GetModulesResponse.Marshal(b, m, deterministic)
}
func (dst *GetModulesResponse) XXX_Merge(src proto.Message) {
xxx_messageInfo_GetModulesResponse.Merge(dst, src)
}
func (m *GetModulesResponse) XXX_Size() int {
return xxx_messageInfo_GetModulesResponse.Size(m)
}
func (m *GetModulesResponse) XXX_DiscardUnknown() {
xxx_messageInfo_GetModulesResponse.DiscardUnknown(m)
}
var xxx_messageInfo_GetModulesResponse proto.InternalMessageInfo
func (m *GetModulesResponse) GetModule() []string {
if m != nil {
return m.Module
}
return nil
}
type GetVersionsRequest struct {
Module *string `protobuf:"bytes,1,opt,name=module" json:"module,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *GetVersionsRequest) Reset() { *m = GetVersionsRequest{} }
func (m *GetVersionsRequest) String() string { return proto.CompactTextString(m) }
func (*GetVersionsRequest) ProtoMessage() {}
func (*GetVersionsRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_modules_service_9cd3bffe4e91c59a, []int{3}
}
func (m *GetVersionsRequest) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_GetVersionsRequest.Unmarshal(m, b)
}
func (m *GetVersionsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_GetVersionsRequest.Marshal(b, m, deterministic)
}
func (dst *GetVersionsRequest) XXX_Merge(src proto.Message) {
xxx_messageInfo_GetVersionsRequest.Merge(dst, src)
}
func (m *GetVersionsRequest) XXX_Size() int {
return xxx_messageInfo_GetVersionsRequest.Size(m)
}
func (m *GetVersionsRequest) XXX_DiscardUnknown() {
xxx_messageInfo_GetVersionsRequest.DiscardUnknown(m)
}
var xxx_messageInfo_GetVersionsRequest proto.InternalMessageInfo
func (m *GetVersionsRequest) GetModule() string {
if m != nil && m.Module != nil {
return *m.Module
}
return ""
}
type GetVersionsResponse struct {
Version []string `protobuf:"bytes,1,rep,name=version" json:"version,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *GetVersionsResponse) Reset() { *m = GetVersionsResponse{} }
func (m *GetVersionsResponse) String() string { return proto.CompactTextString(m) }
func (*GetVersionsResponse) ProtoMessage() {}
func (*GetVersionsResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_modules_service_9cd3bffe4e91c59a, []int{4}
}
func (m *GetVersionsResponse) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_GetVersionsResponse.Unmarshal(m, b)
}
func (m *GetVersionsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_GetVersionsResponse.Marshal(b, m, deterministic)
}
func (dst *GetVersionsResponse) XXX_Merge(src proto.Message) {
xxx_messageInfo_GetVersionsResponse.Merge(dst, src)
}
func (m *GetVersionsResponse) XXX_Size() int {
return xxx_messageInfo_GetVersionsResponse.Size(m)
}
func (m *GetVersionsResponse) XXX_DiscardUnknown() {
xxx_messageInfo_GetVersionsResponse.DiscardUnknown(m)
}
var xxx_messageInfo_GetVersionsResponse proto.InternalMessageInfo
func (m *GetVersionsResponse) GetVersion() []string {
if m != nil {
return m.Version
}
return nil
}
type GetDefaultVersionRequest struct {
Module *string `protobuf:"bytes,1,opt,name=module" json:"module,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *GetDefaultVersionRequest) Reset() { *m = GetDefaultVersionRequest{} }
func (m *GetDefaultVersionRequest) String() string { return proto.CompactTextString(m) }
func (*GetDefaultVersionRequest) ProtoMessage() {}
func (*GetDefaultVersionRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_modules_service_9cd3bffe4e91c59a, []int{5}
}
func (m *GetDefaultVersionRequest) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_GetDefaultVersionRequest.Unmarshal(m, b)
}
func (m *GetDefaultVersionRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_GetDefaultVersionRequest.Marshal(b, m, deterministic)
}
func (dst *GetDefaultVersionRequest) XXX_Merge(src proto.Message) {
xxx_messageInfo_GetDefaultVersionRequest.Merge(dst, src)
}
func (m *GetDefaultVersionRequest) XXX_Size() int {
return xxx_messageInfo_GetDefaultVersionRequest.Size(m)
}
func (m *GetDefaultVersionRequest) XXX_DiscardUnknown() {
xxx_messageInfo_GetDefaultVersionRequest.DiscardUnknown(m)
}
var xxx_messageInfo_GetDefaultVersionRequest proto.InternalMessageInfo
func (m *GetDefaultVersionRequest) GetModule() string {
if m != nil && m.Module != nil {
return *m.Module
}
return ""
}
type GetDefaultVersionResponse struct {
Version *string `protobuf:"bytes,1,req,name=version" json:"version,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *GetDefaultVersionResponse) Reset() { *m = GetDefaultVersionResponse{} }
func (m *GetDefaultVersionResponse) String() string { return proto.CompactTextString(m) }
func (*GetDefaultVersionResponse) ProtoMessage() {}
func (*GetDefaultVersionResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_modules_service_9cd3bffe4e91c59a, []int{6}
}
func (m *GetDefaultVersionResponse) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_GetDefaultVersionResponse.Unmarshal(m, b)
}
func (m *GetDefaultVersionResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_GetDefaultVersionResponse.Marshal(b, m, deterministic)
}
func (dst *GetDefaultVersionResponse) XXX_Merge(src proto.Message) {
xxx_messageInfo_GetDefaultVersionResponse.Merge(dst, src)
}
func (m *GetDefaultVersionResponse) XXX_Size() int {
return xxx_messageInfo_GetDefaultVersionResponse.Size(m)
}
func (m *GetDefaultVersionResponse) XXX_DiscardUnknown() {
xxx_messageInfo_GetDefaultVersionResponse.DiscardUnknown(m)
}
var xxx_messageInfo_GetDefaultVersionResponse proto.InternalMessageInfo
func (m *GetDefaultVersionResponse) GetVersion() string {
if m != nil && m.Version != nil {
return *m.Version
}
return ""
}
type GetNumInstancesRequest struct {
Module *string `protobuf:"bytes,1,opt,name=module" json:"module,omitempty"`
Version *string `protobuf:"bytes,2,opt,name=version" json:"version,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *GetNumInstancesRequest) Reset() { *m = GetNumInstancesRequest{} }
func (m *GetNumInstancesRequest) String() string { return proto.CompactTextString(m) }
func (*GetNumInstancesRequest) ProtoMessage() {}
func (*GetNumInstancesRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_modules_service_9cd3bffe4e91c59a, []int{7}
}
func (m *GetNumInstancesRequest) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_GetNumInstancesRequest.Unmarshal(m, b)
}
func (m *GetNumInstancesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_GetNumInstancesRequest.Marshal(b, m, deterministic)
}
func (dst *GetNumInstancesRequest) XXX_Merge(src proto.Message) {
xxx_messageInfo_GetNumInstancesRequest.Merge(dst, src)
}
func (m *GetNumInstancesRequest) XXX_Size() int {
return xxx_messageInfo_GetNumInstancesRequest.Size(m)
}
func (m *GetNumInstancesRequest) XXX_DiscardUnknown() {
xxx_messageInfo_GetNumInstancesRequest.DiscardUnknown(m)
}
var xxx_messageInfo_GetNumInstancesRequest proto.InternalMessageInfo
func (m *GetNumInstancesRequest) GetModule() string {
if m != nil && m.Module != nil {
return *m.Module
}
return ""
}
func (m *GetNumInstancesRequest) GetVersion() string {
if m != nil && m.Version != nil {
return *m.Version
}
return ""
}
type GetNumInstancesResponse struct {
Instances *int64 `protobuf:"varint,1,req,name=instances" json:"instances,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *GetNumInstancesResponse) Reset() { *m = GetNumInstancesResponse{} }
func (m *GetNumInstancesResponse) String() string { return proto.CompactTextString(m) }
func (*GetNumInstancesResponse) ProtoMessage() {}
func (*GetNumInstancesResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_modules_service_9cd3bffe4e91c59a, []int{8}
}
func (m *GetNumInstancesResponse) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_GetNumInstancesResponse.Unmarshal(m, b)
}
func (m *GetNumInstancesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_GetNumInstancesResponse.Marshal(b, m, deterministic)
}
func (dst *GetNumInstancesResponse) XXX_Merge(src proto.Message) {
xxx_messageInfo_GetNumInstancesResponse.Merge(dst, src)
}
func (m *GetNumInstancesResponse) XXX_Size() int {
return xxx_messageInfo_GetNumInstancesResponse.Size(m)
}
func (m *GetNumInstancesResponse) XXX_DiscardUnknown() {
xxx_messageInfo_GetNumInstancesResponse.DiscardUnknown(m)
}
var xxx_messageInfo_GetNumInstancesResponse proto.InternalMessageInfo
func (m *GetNumInstancesResponse) GetInstances() int64 {
if m != nil && m.Instances != nil {
return *m.Instances
}
return 0
}
type SetNumInstancesRequest struct {
Module *string `protobuf:"bytes,1,opt,name=module" json:"module,omitempty"`
Version *string `protobuf:"bytes,2,opt,name=version" json:"version,omitempty"`
Instances *int64 `protobuf:"varint,3,req,name=instances" json:"instances,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *SetNumInstancesRequest) Reset() { *m = SetNumInstancesRequest{} }
func (m *SetNumInstancesRequest) String() string { return proto.CompactTextString(m) }
func (*SetNumInstancesRequest) ProtoMessage() {}
func (*SetNumInstancesRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_modules_service_9cd3bffe4e91c59a, []int{9}
}
func (m *SetNumInstancesRequest) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_SetNumInstancesRequest.Unmarshal(m, b)
}
func (m *SetNumInstancesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_SetNumInstancesRequest.Marshal(b, m, deterministic)
}
func (dst *SetNumInstancesRequest) XXX_Merge(src proto.Message) {
xxx_messageInfo_SetNumInstancesRequest.Merge(dst, src)
}
func (m *SetNumInstancesRequest) XXX_Size() int {
return xxx_messageInfo_SetNumInstancesRequest.Size(m)
}
func (m *SetNumInstancesRequest) XXX_DiscardUnknown() {
xxx_messageInfo_SetNumInstancesRequest.DiscardUnknown(m)
}
var xxx_messageInfo_SetNumInstancesRequest proto.InternalMessageInfo
func (m *SetNumInstancesRequest) GetModule() string {
if m != nil && m.Module != nil {
return *m.Module
}
return ""
}
func (m *SetNumInstancesRequest) GetVersion() string {
if m != nil && m.Version != nil {
return *m.Version
}
return ""
}
func (m *SetNumInstancesRequest) GetInstances() int64 {
if m != nil && m.Instances != nil {
return *m.Instances
}
return 0
}
type SetNumInstancesResponse struct {
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *SetNumInstancesResponse) Reset() { *m = SetNumInstancesResponse{} }
func (m *SetNumInstancesResponse) String() string { return proto.CompactTextString(m) }
func (*SetNumInstancesResponse) ProtoMessage() {}
func (*SetNumInstancesResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_modules_service_9cd3bffe4e91c59a, []int{10}
}
func (m *SetNumInstancesResponse) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_SetNumInstancesResponse.Unmarshal(m, b)
}
func (m *SetNumInstancesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_SetNumInstancesResponse.Marshal(b, m, deterministic)
}
func (dst *SetNumInstancesResponse) XXX_Merge(src proto.Message) {
xxx_messageInfo_SetNumInstancesResponse.Merge(dst, src)
}
func (m *SetNumInstancesResponse) XXX_Size() int {
return xxx_messageInfo_SetNumInstancesResponse.Size(m)
}
func (m *SetNumInstancesResponse) XXX_DiscardUnknown() {
xxx_messageInfo_SetNumInstancesResponse.DiscardUnknown(m)
}
var xxx_messageInfo_SetNumInstancesResponse proto.InternalMessageInfo
type StartModuleRequest struct {
Module *string `protobuf:"bytes,1,req,name=module" json:"module,omitempty"`
Version *string `protobuf:"bytes,2,req,name=version" json:"version,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *StartModuleRequest) Reset() { *m = StartModuleRequest{} }
func (m *StartModuleRequest) String() string { return proto.CompactTextString(m) }
func (*StartModuleRequest) ProtoMessage() {}
func (*StartModuleRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_modules_service_9cd3bffe4e91c59a, []int{11}
}
func (m *StartModuleRequest) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_StartModuleRequest.Unmarshal(m, b)
}
func (m *StartModuleRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_StartModuleRequest.Marshal(b, m, deterministic)
}
func (dst *StartModuleRequest) XXX_Merge(src proto.Message) {
xxx_messageInfo_StartModuleRequest.Merge(dst, src)
}
func (m *StartModuleRequest) XXX_Size() int {
return xxx_messageInfo_StartModuleRequest.Size(m)
}
func (m *StartModuleRequest) XXX_DiscardUnknown() {
xxx_messageInfo_StartModuleRequest.DiscardUnknown(m)
}
var xxx_messageInfo_StartModuleRequest proto.InternalMessageInfo
func (m *StartModuleRequest) GetModule() string {
if m != nil && m.Module != nil {
return *m.Module
}
return ""
}
func (m *StartModuleRequest) GetVersion() string {
if m != nil && m.Version != nil {
return *m.Version
}
return ""
}
type StartModuleResponse struct {
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *StartModuleResponse) Reset() { *m = StartModuleResponse{} }
func (m *StartModuleResponse) String() string { return proto.CompactTextString(m) }
func (*StartModuleResponse) ProtoMessage() {}
func (*StartModuleResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_modules_service_9cd3bffe4e91c59a, []int{12}
}
func (m *StartModuleResponse) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_StartModuleResponse.Unmarshal(m, b)
}
func (m *StartModuleResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_StartModuleResponse.Marshal(b, m, deterministic)
}
func (dst *StartModuleResponse) XXX_Merge(src proto.Message) {
xxx_messageInfo_StartModuleResponse.Merge(dst, src)
}
func (m *StartModuleResponse) XXX_Size() int {
return xxx_messageInfo_StartModuleResponse.Size(m)
}
func (m *StartModuleResponse) XXX_DiscardUnknown() {
xxx_messageInfo_StartModuleResponse.DiscardUnknown(m)
}
var xxx_messageInfo_StartModuleResponse proto.InternalMessageInfo
type StopModuleRequest struct {
Module *string `protobuf:"bytes,1,opt,name=module" json:"module,omitempty"`
Version *string `protobuf:"bytes,2,opt,name=version" json:"version,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *StopModuleRequest) Reset() { *m = StopModuleRequest{} }
func (m *StopModuleRequest) String() string { return proto.CompactTextString(m) }
func (*StopModuleRequest) ProtoMessage() {}
func (*StopModuleRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_modules_service_9cd3bffe4e91c59a, []int{13}
}
func (m *StopModuleRequest) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_StopModuleRequest.Unmarshal(m, b)
}
func (m *StopModuleRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_StopModuleRequest.Marshal(b, m, deterministic)
}
func (dst *StopModuleRequest) XXX_Merge(src proto.Message) {
xxx_messageInfo_StopModuleRequest.Merge(dst, src)
}
func (m *StopModuleRequest) XXX_Size() int {
return xxx_messageInfo_StopModuleRequest.Size(m)
}
func (m *StopModuleRequest) XXX_DiscardUnknown() {
xxx_messageInfo_StopModuleRequest.DiscardUnknown(m)
}
var xxx_messageInfo_StopModuleRequest proto.InternalMessageInfo
func (m *StopModuleRequest) GetModule() string {
if m != nil && m.Module != nil {
return *m.Module
}
return ""
}
func (m *StopModuleRequest) GetVersion() string {
if m != nil && m.Version != nil {
return *m.Version
}
return ""
}
type StopModuleResponse struct {
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *StopModuleResponse) Reset() { *m = StopModuleResponse{} }
func (m *StopModuleResponse) String() string { return proto.CompactTextString(m) }
func (*StopModuleResponse) ProtoMessage() {}
func (*StopModuleResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_modules_service_9cd3bffe4e91c59a, []int{14}
}
func (m *StopModuleResponse) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_StopModuleResponse.Unmarshal(m, b)
}
func (m *StopModuleResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_StopModuleResponse.Marshal(b, m, deterministic)
}
func (dst *StopModuleResponse) XXX_Merge(src proto.Message) {
xxx_messageInfo_StopModuleResponse.Merge(dst, src)
}
func (m *StopModuleResponse) XXX_Size() int {
return xxx_messageInfo_StopModuleResponse.Size(m)
}
func (m *StopModuleResponse) XXX_DiscardUnknown() {
xxx_messageInfo_StopModuleResponse.DiscardUnknown(m)
}
var xxx_messageInfo_StopModuleResponse proto.InternalMessageInfo
type GetHostnameRequest struct {
Module *string `protobuf:"bytes,1,opt,name=module" json:"module,omitempty"`
Version *string `protobuf:"bytes,2,opt,name=version" json:"version,omitempty"`
Instance *string `protobuf:"bytes,3,opt,name=instance" json:"instance,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *GetHostnameRequest) Reset() { *m = GetHostnameRequest{} }
func (m *GetHostnameRequest) String() string { return proto.CompactTextString(m) }
func (*GetHostnameRequest) ProtoMessage() {}
func (*GetHostnameRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_modules_service_9cd3bffe4e91c59a, []int{15}
}
func (m *GetHostnameRequest) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_GetHostnameRequest.Unmarshal(m, b)
}
func (m *GetHostnameRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_GetHostnameRequest.Marshal(b, m, deterministic)
}
func (dst *GetHostnameRequest) XXX_Merge(src proto.Message) {
xxx_messageInfo_GetHostnameRequest.Merge(dst, src)
}
func (m *GetHostnameRequest) XXX_Size() int {
return xxx_messageInfo_GetHostnameRequest.Size(m)
}
func (m *GetHostnameRequest) XXX_DiscardUnknown() {
xxx_messageInfo_GetHostnameRequest.DiscardUnknown(m)
}
var xxx_messageInfo_GetHostnameRequest proto.InternalMessageInfo
func (m *GetHostnameRequest) GetModule() string {
if m != nil && m.Module != nil {
return *m.Module
}
return ""
}
func (m *GetHostnameRequest) GetVersion() string {
if m != nil && m.Version != nil {
return *m.Version
}
return ""
}
func (m *GetHostnameRequest) GetInstance() string {
if m != nil && m.Instance != nil {
return *m.Instance
}
return ""
}
type GetHostnameResponse struct {
Hostname *string `protobuf:"bytes,1,req,name=hostname" json:"hostname,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *GetHostnameResponse) Reset() { *m = GetHostnameResponse{} }
func (m *GetHostnameResponse) String() string { return proto.CompactTextString(m) }
func (*GetHostnameResponse) ProtoMessage() {}
func (*GetHostnameResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_modules_service_9cd3bffe4e91c59a, []int{16}
}
func (m *GetHostnameResponse) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_GetHostnameResponse.Unmarshal(m, b)
}
func (m *GetHostnameResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_GetHostnameResponse.Marshal(b, m, deterministic)
}
func (dst *GetHostnameResponse) XXX_Merge(src proto.Message) {
xxx_messageInfo_GetHostnameResponse.Merge(dst, src)
}
func (m *GetHostnameResponse) XXX_Size() int {
return xxx_messageInfo_GetHostnameResponse.Size(m)
}
func (m *GetHostnameResponse) XXX_DiscardUnknown() {
xxx_messageInfo_GetHostnameResponse.DiscardUnknown(m)
}
var xxx_messageInfo_GetHostnameResponse proto.InternalMessageInfo
func (m *GetHostnameResponse) GetHostname() string {
if m != nil && m.Hostname != nil {
return *m.Hostname
}
return ""
}
func init() {
proto.RegisterType((*ModulesServiceError)(nil), "appengine.ModulesServiceError")
proto.RegisterType((*GetModulesRequest)(nil), "appengine.GetModulesRequest")
proto.RegisterType((*GetModulesResponse)(nil), "appengine.GetModulesResponse")
proto.RegisterType((*GetVersionsRequest)(nil), "appengine.GetVersionsRequest")
proto.RegisterType((*GetVersionsResponse)(nil), "appengine.GetVersionsResponse")
proto.RegisterType((*GetDefaultVersionRequest)(nil), "appengine.GetDefaultVersionRequest")
proto.RegisterType((*GetDefaultVersionResponse)(nil), "appengine.GetDefaultVersionResponse")
proto.RegisterType((*GetNumInstancesRequest)(nil), "appengine.GetNumInstancesRequest")
proto.RegisterType((*GetNumInstancesResponse)(nil), "appengine.GetNumInstancesResponse")
proto.RegisterType((*SetNumInstancesRequest)(nil), "appengine.SetNumInstancesRequest")
proto.RegisterType((*SetNumInstancesResponse)(nil), "appengine.SetNumInstancesResponse")
proto.RegisterType((*StartModuleRequest)(nil), "appengine.StartModuleRequest")
proto.RegisterType((*StartModuleResponse)(nil), "appengine.StartModuleResponse")
proto.RegisterType((*StopModuleRequest)(nil), "appengine.StopModuleRequest")
proto.RegisterType((*StopModuleResponse)(nil), "appengine.StopModuleResponse")
proto.RegisterType((*GetHostnameRequest)(nil), "appengine.GetHostnameRequest")
proto.RegisterType((*GetHostnameResponse)(nil), "appengine.GetHostnameResponse")
}
func init() {
proto.RegisterFile("google.golang.org/appengine/internal/modules/modules_service.proto", fileDescriptor_modules_service_9cd3bffe4e91c59a)
}
var fileDescriptor_modules_service_9cd3bffe4e91c59a = []byte{
// 457 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x94, 0xc1, 0x6f, 0xd3, 0x30,
0x14, 0xc6, 0x69, 0x02, 0xdb, 0xf2, 0x0e, 0x90, 0x3a, 0x5b, 0xd7, 0x4d, 0x1c, 0x50, 0x4e, 0x1c,
0x50, 0x2b, 0x90, 0x10, 0xe7, 0xae, 0x35, 0x25, 0xb0, 0xa5, 0x28, 0xce, 0x2a, 0xc4, 0xa5, 0x0a,
0xdb, 0x23, 0x8b, 0x94, 0xda, 0xc1, 0x76, 0x77, 0xe4, 0xbf, 0xe0, 0xff, 0x45, 0x4b, 0xed, 0xb6,
0x81, 0x4e, 0x45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8c, 0x68, 0x55, 0x9f, 0x79, 0x5f, 0xf7, 0xcd, 0x5f, 0xe2, 0x77, 0x00, 0x00, 0x00, 0xff,
0xff, 0x6e, 0xbc, 0xe0, 0x61, 0x5c, 0x04, 0x00, 0x00,
}

View File

@ -0,0 +1,80 @@
syntax = "proto2";
option go_package = "modules";
package appengine;
message ModulesServiceError {
enum ErrorCode {
OK = 0;
INVALID_MODULE = 1;
INVALID_VERSION = 2;
INVALID_INSTANCES = 3;
TRANSIENT_ERROR = 4;
UNEXPECTED_STATE = 5;
}
}
message GetModulesRequest {
}
message GetModulesResponse {
repeated string module = 1;
}
message GetVersionsRequest {
optional string module = 1;
}
message GetVersionsResponse {
repeated string version = 1;
}
message GetDefaultVersionRequest {
optional string module = 1;
}
message GetDefaultVersionResponse {
required string version = 1;
}
message GetNumInstancesRequest {
optional string module = 1;
optional string version = 2;
}
message GetNumInstancesResponse {
required int64 instances = 1;
}
message SetNumInstancesRequest {
optional string module = 1;
optional string version = 2;
required int64 instances = 3;
}
message SetNumInstancesResponse {}
message StartModuleRequest {
required string module = 1;
required string version = 2;
}
message StartModuleResponse {}
message StopModuleRequest {
optional string module = 1;
optional string version = 2;
}
message StopModuleResponse {}
message GetHostnameRequest {
optional string module = 1;
optional string version = 2;
optional string instance = 3;
}
message GetHostnameResponse {
required string hostname = 1;
}

56
vendor/google.golang.org/appengine/internal/net.go generated vendored Normal file
View File

@ -0,0 +1,56 @@
// 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.
package internal
// This file implements a network dialer that limits the number of concurrent connections.
// It is only used for API calls.
import (
"log"
"net"
"runtime"
"sync"
"time"
)
var limitSem = make(chan int, 100) // TODO(dsymonds): Use environment variable.
func limitRelease() {
// non-blocking
select {
case <-limitSem:
default:
// This should not normally happen.
log.Print("appengine: unbalanced limitSem release!")
}
}
func limitDial(network, addr string) (net.Conn, error) {
limitSem <- 1
// Dial with a timeout in case the API host is MIA.
// The connection should normally be very fast.
conn, err := net.DialTimeout(network, addr, 500*time.Millisecond)
if err != nil {
limitRelease()
return nil, err
}
lc := &limitConn{Conn: conn}
runtime.SetFinalizer(lc, (*limitConn).Close) // shouldn't usually be required
return lc, nil
}
type limitConn struct {
close sync.Once
net.Conn
}
func (lc *limitConn) Close() error {
defer lc.close.Do(func() {
limitRelease()
runtime.SetFinalizer(lc, nil)
})
return lc.Conn.Close()
}

View File

@ -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()
}

40
vendor/google.golang.org/appengine/internal/regen.sh generated vendored Executable file
View File

@ -0,0 +1,40 @@
#!/bin/bash -e
#
# This script rebuilds the generated code for the protocol buffers.
# To run this you will need protoc and goprotobuf installed;
# see https://github.com/golang/protobuf for instructions.
PKG=google.golang.org/appengine
function die() {
echo 1>&2 $*
exit 1
}
# Sanity check that the right tools are accessible.
for tool in go protoc protoc-gen-go; do
q=$(which $tool) || die "didn't find $tool"
echo 1>&2 "$tool: $q"
done
echo -n 1>&2 "finding package dir... "
pkgdir=$(go list -f '{{.Dir}}' $PKG)
echo 1>&2 $pkgdir
base=$(echo $pkgdir | sed "s,/$PKG\$,,")
echo 1>&2 "base: $base"
cd $base
# Run protoc once per package.
for dir in $(find $PKG/internal -name '*.proto' | xargs dirname | sort | uniq); do
echo 1>&2 "* $dir"
protoc --go_out=. $dir/*.proto
done
for f in $(find $PKG/internal -name '*.pb.go'); do
# Remove proto.RegisterEnum calls.
# These cause duplicate registration panics when these packages
# are used on classic App Engine. proto.RegisterEnum only affects
# parsing the text format; we don't care about that.
# https://code.google.com/p/googleappengine/issues/detail?id=11670#c17
sed -i '/proto.RegisterEnum/d' $f
done

View File

@ -0,0 +1,361 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: google.golang.org/appengine/internal/remote_api/remote_api.proto
package remote_api
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
// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
type RpcError_ErrorCode int32
const (
RpcError_UNKNOWN RpcError_ErrorCode = 0
RpcError_CALL_NOT_FOUND RpcError_ErrorCode = 1
RpcError_PARSE_ERROR RpcError_ErrorCode = 2
RpcError_SECURITY_VIOLATION RpcError_ErrorCode = 3
RpcError_OVER_QUOTA RpcError_ErrorCode = 4
RpcError_REQUEST_TOO_LARGE RpcError_ErrorCode = 5
RpcError_CAPABILITY_DISABLED RpcError_ErrorCode = 6
RpcError_FEATURE_DISABLED RpcError_ErrorCode = 7
RpcError_BAD_REQUEST RpcError_ErrorCode = 8
RpcError_RESPONSE_TOO_LARGE RpcError_ErrorCode = 9
RpcError_CANCELLED RpcError_ErrorCode = 10
RpcError_REPLAY_ERROR RpcError_ErrorCode = 11
RpcError_DEADLINE_EXCEEDED RpcError_ErrorCode = 12
)
var RpcError_ErrorCode_name = map[int32]string{
0: "UNKNOWN",
1: "CALL_NOT_FOUND",
2: "PARSE_ERROR",
3: "SECURITY_VIOLATION",
4: "OVER_QUOTA",
5: "REQUEST_TOO_LARGE",
6: "CAPABILITY_DISABLED",
7: "FEATURE_DISABLED",
8: "BAD_REQUEST",
9: "RESPONSE_TOO_LARGE",
10: "CANCELLED",
11: "REPLAY_ERROR",
12: "DEADLINE_EXCEEDED",
}
var RpcError_ErrorCode_value = map[string]int32{
"UNKNOWN": 0,
"CALL_NOT_FOUND": 1,
"PARSE_ERROR": 2,
"SECURITY_VIOLATION": 3,
"OVER_QUOTA": 4,
"REQUEST_TOO_LARGE": 5,
"CAPABILITY_DISABLED": 6,
"FEATURE_DISABLED": 7,
"BAD_REQUEST": 8,
"RESPONSE_TOO_LARGE": 9,
"CANCELLED": 10,
"REPLAY_ERROR": 11,
"DEADLINE_EXCEEDED": 12,
}
func (x RpcError_ErrorCode) Enum() *RpcError_ErrorCode {
p := new(RpcError_ErrorCode)
*p = x
return p
}
func (x RpcError_ErrorCode) String() string {
return proto.EnumName(RpcError_ErrorCode_name, int32(x))
}
func (x *RpcError_ErrorCode) UnmarshalJSON(data []byte) error {
value, err := proto.UnmarshalJSONEnum(RpcError_ErrorCode_value, data, "RpcError_ErrorCode")
if err != nil {
return err
}
*x = RpcError_ErrorCode(value)
return nil
}
func (RpcError_ErrorCode) EnumDescriptor() ([]byte, []int) {
return fileDescriptor_remote_api_1978114ec33a273d, []int{2, 0}
}
type Request struct {
ServiceName *string `protobuf:"bytes,2,req,name=service_name,json=serviceName" json:"service_name,omitempty"`
Method *string `protobuf:"bytes,3,req,name=method" json:"method,omitempty"`
Request []byte `protobuf:"bytes,4,req,name=request" json:"request,omitempty"`
RequestId *string `protobuf:"bytes,5,opt,name=request_id,json=requestId" json:"request_id,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *Request) Reset() { *m = Request{} }
func (m *Request) String() string { return proto.CompactTextString(m) }
func (*Request) ProtoMessage() {}
func (*Request) Descriptor() ([]byte, []int) {
return fileDescriptor_remote_api_1978114ec33a273d, []int{0}
}
func (m *Request) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_Request.Unmarshal(m, b)
}
func (m *Request) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_Request.Marshal(b, m, deterministic)
}
func (dst *Request) XXX_Merge(src proto.Message) {
xxx_messageInfo_Request.Merge(dst, src)
}
func (m *Request) XXX_Size() int {
return xxx_messageInfo_Request.Size(m)
}
func (m *Request) XXX_DiscardUnknown() {
xxx_messageInfo_Request.DiscardUnknown(m)
}
var xxx_messageInfo_Request proto.InternalMessageInfo
func (m *Request) GetServiceName() string {
if m != nil && m.ServiceName != nil {
return *m.ServiceName
}
return ""
}
func (m *Request) GetMethod() string {
if m != nil && m.Method != nil {
return *m.Method
}
return ""
}
func (m *Request) GetRequest() []byte {
if m != nil {
return m.Request
}
return nil
}
func (m *Request) GetRequestId() string {
if m != nil && m.RequestId != nil {
return *m.RequestId
}
return ""
}
type ApplicationError struct {
Code *int32 `protobuf:"varint,1,req,name=code" json:"code,omitempty"`
Detail *string `protobuf:"bytes,2,req,name=detail" json:"detail,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *ApplicationError) Reset() { *m = ApplicationError{} }
func (m *ApplicationError) String() string { return proto.CompactTextString(m) }
func (*ApplicationError) ProtoMessage() {}
func (*ApplicationError) Descriptor() ([]byte, []int) {
return fileDescriptor_remote_api_1978114ec33a273d, []int{1}
}
func (m *ApplicationError) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_ApplicationError.Unmarshal(m, b)
}
func (m *ApplicationError) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_ApplicationError.Marshal(b, m, deterministic)
}
func (dst *ApplicationError) XXX_Merge(src proto.Message) {
xxx_messageInfo_ApplicationError.Merge(dst, src)
}
func (m *ApplicationError) XXX_Size() int {
return xxx_messageInfo_ApplicationError.Size(m)
}
func (m *ApplicationError) XXX_DiscardUnknown() {
xxx_messageInfo_ApplicationError.DiscardUnknown(m)
}
var xxx_messageInfo_ApplicationError proto.InternalMessageInfo
func (m *ApplicationError) GetCode() int32 {
if m != nil && m.Code != nil {
return *m.Code
}
return 0
}
func (m *ApplicationError) GetDetail() string {
if m != nil && m.Detail != nil {
return *m.Detail
}
return ""
}
type RpcError struct {
Code *int32 `protobuf:"varint,1,req,name=code" json:"code,omitempty"`
Detail *string `protobuf:"bytes,2,opt,name=detail" json:"detail,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *RpcError) Reset() { *m = RpcError{} }
func (m *RpcError) String() string { return proto.CompactTextString(m) }
func (*RpcError) ProtoMessage() {}
func (*RpcError) Descriptor() ([]byte, []int) {
return fileDescriptor_remote_api_1978114ec33a273d, []int{2}
}
func (m *RpcError) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_RpcError.Unmarshal(m, b)
}
func (m *RpcError) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_RpcError.Marshal(b, m, deterministic)
}
func (dst *RpcError) XXX_Merge(src proto.Message) {
xxx_messageInfo_RpcError.Merge(dst, src)
}
func (m *RpcError) XXX_Size() int {
return xxx_messageInfo_RpcError.Size(m)
}
func (m *RpcError) XXX_DiscardUnknown() {
xxx_messageInfo_RpcError.DiscardUnknown(m)
}
var xxx_messageInfo_RpcError proto.InternalMessageInfo
func (m *RpcError) GetCode() int32 {
if m != nil && m.Code != nil {
return *m.Code
}
return 0
}
func (m *RpcError) GetDetail() string {
if m != nil && m.Detail != nil {
return *m.Detail
}
return ""
}
type Response struct {
Response []byte `protobuf:"bytes,1,opt,name=response" json:"response,omitempty"`
Exception []byte `protobuf:"bytes,2,opt,name=exception" json:"exception,omitempty"`
ApplicationError *ApplicationError `protobuf:"bytes,3,opt,name=application_error,json=applicationError" json:"application_error,omitempty"`
JavaException []byte `protobuf:"bytes,4,opt,name=java_exception,json=javaException" json:"java_exception,omitempty"`
RpcError *RpcError `protobuf:"bytes,5,opt,name=rpc_error,json=rpcError" json:"rpc_error,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *Response) Reset() { *m = Response{} }
func (m *Response) String() string { return proto.CompactTextString(m) }
func (*Response) ProtoMessage() {}
func (*Response) Descriptor() ([]byte, []int) {
return fileDescriptor_remote_api_1978114ec33a273d, []int{3}
}
func (m *Response) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_Response.Unmarshal(m, b)
}
func (m *Response) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_Response.Marshal(b, m, deterministic)
}
func (dst *Response) XXX_Merge(src proto.Message) {
xxx_messageInfo_Response.Merge(dst, src)
}
func (m *Response) XXX_Size() int {
return xxx_messageInfo_Response.Size(m)
}
func (m *Response) XXX_DiscardUnknown() {
xxx_messageInfo_Response.DiscardUnknown(m)
}
var xxx_messageInfo_Response proto.InternalMessageInfo
func (m *Response) GetResponse() []byte {
if m != nil {
return m.Response
}
return nil
}
func (m *Response) GetException() []byte {
if m != nil {
return m.Exception
}
return nil
}
func (m *Response) GetApplicationError() *ApplicationError {
if m != nil {
return m.ApplicationError
}
return nil
}
func (m *Response) GetJavaException() []byte {
if m != nil {
return m.JavaException
}
return nil
}
func (m *Response) GetRpcError() *RpcError {
if m != nil {
return m.RpcError
}
return nil
}
func init() {
proto.RegisterType((*Request)(nil), "remote_api.Request")
proto.RegisterType((*ApplicationError)(nil), "remote_api.ApplicationError")
proto.RegisterType((*RpcError)(nil), "remote_api.RpcError")
proto.RegisterType((*Response)(nil), "remote_api.Response")
}
func init() {
proto.RegisterFile("google.golang.org/appengine/internal/remote_api/remote_api.proto", fileDescriptor_remote_api_1978114ec33a273d)
}
var fileDescriptor_remote_api_1978114ec33a273d = []byte{
// 531 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x93, 0x51, 0x6e, 0xd3, 0x40,
0x10, 0x86, 0xb1, 0x9b, 0x34, 0xf1, 0xc4, 0x2d, 0xdb, 0xa5, 0x14, 0x0b, 0x15, 0x29, 0x44, 0x42,
0xca, 0x53, 0x2a, 0x38, 0x00, 0x62, 0x63, 0x6f, 0x91, 0x85, 0x65, 0xa7, 0x6b, 0xbb, 0x50, 0x5e,
0x56, 0x2b, 0x67, 0x65, 0x8c, 0x12, 0xaf, 0xd9, 0x98, 0x8a, 0x17, 0x6e, 0xc0, 0xb5, 0x38, 0x0c,
0xb7, 0x40, 0x36, 0x6e, 0x63, 0xf5, 0x89, 0xb7, 0x7f, 0x7e, 0x7b, 0xe6, 0x1b, 0xcd, 0xcc, 0xc2,
0xbb, 0x5c, 0xa9, 0x7c, 0x23, 0x17, 0xb9, 0xda, 0x88, 0x32, 0x5f, 0x28, 0x9d, 0x5f, 0x88, 0xaa,
0x92, 0x65, 0x5e, 0x94, 0xf2, 0xa2, 0x28, 0x6b, 0xa9, 0x4b, 0xb1, 0xb9, 0xd0, 0x72, 0xab, 0x6a,
0xc9, 0x45, 0x55, 0xf4, 0xe4, 0xa2, 0xd2, 0xaa, 0x56, 0x18, 0xf6, 0xce, 0xec, 0x27, 0x8c, 0x98,
0xfc, 0xf6, 0x5d, 0xee, 0x6a, 0xfc, 0x12,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74, 0xda, 0x27, 0xdd, 0x1d, 0x07, 0x1b, 0xeb, 0x4e,
0x2d, 0xed, 0xcf, 0xbd, 0x07, 0xf0, 0x37, 0x00, 0x00, 0xff, 0xff, 0x38, 0xd1, 0x0f, 0x22, 0x4f,
0x03, 0x00, 0x00,
}

View File

@ -0,0 +1,44 @@
syntax = "proto2";
option go_package = "remote_api";
package remote_api;
message Request {
required string service_name = 2;
required string method = 3;
required bytes request = 4;
optional string request_id = 5;
}
message ApplicationError {
required int32 code = 1;
required string detail = 2;
}
message RpcError {
enum ErrorCode {
UNKNOWN = 0;
CALL_NOT_FOUND = 1;
PARSE_ERROR = 2;
SECURITY_VIOLATION = 3;
OVER_QUOTA = 4;
REQUEST_TOO_LARGE = 5;
CAPABILITY_DISABLED = 6;
FEATURE_DISABLED = 7;
BAD_REQUEST = 8;
RESPONSE_TOO_LARGE = 9;
CANCELLED = 10;
REPLAY_ERROR = 11;
DEADLINE_EXCEEDED = 12;
}
required int32 code = 1;
optional string detail = 2;
}
message Response {
optional bytes response = 1;
optional bytes exception = 2;
optional ApplicationError application_error = 3;
optional bytes java_exception = 4;
optional RpcError rpc_error = 5;
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,394 @@
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;
optional OrderIdSource order_id_source = 6 [default = SUPPLIED];
enum OrderIdSource {
DEFAULTED = 0;
SUPPLIED = 1;
}
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;
}

File diff suppressed because it is too large Load Diff

View File

@ -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;
}

View File

@ -0,0 +1,362 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: google.golang.org/appengine/internal/system/system_service.proto
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
// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
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
}
func (SystemServiceError_ErrorCode) EnumDescriptor() ([]byte, []int) {
return fileDescriptor_system_service_ccf41ec210fc59eb, []int{0, 0}
}
type SystemServiceError struct {
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *SystemServiceError) Reset() { *m = SystemServiceError{} }
func (m *SystemServiceError) String() string { return proto.CompactTextString(m) }
func (*SystemServiceError) ProtoMessage() {}
func (*SystemServiceError) Descriptor() ([]byte, []int) {
return fileDescriptor_system_service_ccf41ec210fc59eb, []int{0}
}
func (m *SystemServiceError) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_SystemServiceError.Unmarshal(m, b)
}
func (m *SystemServiceError) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_SystemServiceError.Marshal(b, m, deterministic)
}
func (dst *SystemServiceError) XXX_Merge(src proto.Message) {
xxx_messageInfo_SystemServiceError.Merge(dst, src)
}
func (m *SystemServiceError) XXX_Size() int {
return xxx_messageInfo_SystemServiceError.Size(m)
}
func (m *SystemServiceError) XXX_DiscardUnknown() {
xxx_messageInfo_SystemServiceError.DiscardUnknown(m)
}
var xxx_messageInfo_SystemServiceError proto.InternalMessageInfo
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_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *SystemStat) Reset() { *m = SystemStat{} }
func (m *SystemStat) String() string { return proto.CompactTextString(m) }
func (*SystemStat) ProtoMessage() {}
func (*SystemStat) Descriptor() ([]byte, []int) {
return fileDescriptor_system_service_ccf41ec210fc59eb, []int{1}
}
func (m *SystemStat) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_SystemStat.Unmarshal(m, b)
}
func (m *SystemStat) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_SystemStat.Marshal(b, m, deterministic)
}
func (dst *SystemStat) XXX_Merge(src proto.Message) {
xxx_messageInfo_SystemStat.Merge(dst, src)
}
func (m *SystemStat) XXX_Size() int {
return xxx_messageInfo_SystemStat.Size(m)
}
func (m *SystemStat) XXX_DiscardUnknown() {
xxx_messageInfo_SystemStat.DiscardUnknown(m)
}
var xxx_messageInfo_SystemStat proto.InternalMessageInfo
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_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *GetSystemStatsRequest) Reset() { *m = GetSystemStatsRequest{} }
func (m *GetSystemStatsRequest) String() string { return proto.CompactTextString(m) }
func (*GetSystemStatsRequest) ProtoMessage() {}
func (*GetSystemStatsRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_system_service_ccf41ec210fc59eb, []int{2}
}
func (m *GetSystemStatsRequest) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_GetSystemStatsRequest.Unmarshal(m, b)
}
func (m *GetSystemStatsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_GetSystemStatsRequest.Marshal(b, m, deterministic)
}
func (dst *GetSystemStatsRequest) XXX_Merge(src proto.Message) {
xxx_messageInfo_GetSystemStatsRequest.Merge(dst, src)
}
func (m *GetSystemStatsRequest) XXX_Size() int {
return xxx_messageInfo_GetSystemStatsRequest.Size(m)
}
func (m *GetSystemStatsRequest) XXX_DiscardUnknown() {
xxx_messageInfo_GetSystemStatsRequest.DiscardUnknown(m)
}
var xxx_messageInfo_GetSystemStatsRequest proto.InternalMessageInfo
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_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *GetSystemStatsResponse) Reset() { *m = GetSystemStatsResponse{} }
func (m *GetSystemStatsResponse) String() string { return proto.CompactTextString(m) }
func (*GetSystemStatsResponse) ProtoMessage() {}
func (*GetSystemStatsResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_system_service_ccf41ec210fc59eb, []int{3}
}
func (m *GetSystemStatsResponse) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_GetSystemStatsResponse.Unmarshal(m, b)
}
func (m *GetSystemStatsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_GetSystemStatsResponse.Marshal(b, m, deterministic)
}
func (dst *GetSystemStatsResponse) XXX_Merge(src proto.Message) {
xxx_messageInfo_GetSystemStatsResponse.Merge(dst, src)
}
func (m *GetSystemStatsResponse) XXX_Size() int {
return xxx_messageInfo_GetSystemStatsResponse.Size(m)
}
func (m *GetSystemStatsResponse) XXX_DiscardUnknown() {
xxx_messageInfo_GetSystemStatsResponse.DiscardUnknown(m)
}
var xxx_messageInfo_GetSystemStatsResponse proto.InternalMessageInfo
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_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *StartBackgroundRequestRequest) Reset() { *m = StartBackgroundRequestRequest{} }
func (m *StartBackgroundRequestRequest) String() string { return proto.CompactTextString(m) }
func (*StartBackgroundRequestRequest) ProtoMessage() {}
func (*StartBackgroundRequestRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_system_service_ccf41ec210fc59eb, []int{4}
}
func (m *StartBackgroundRequestRequest) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_StartBackgroundRequestRequest.Unmarshal(m, b)
}
func (m *StartBackgroundRequestRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_StartBackgroundRequestRequest.Marshal(b, m, deterministic)
}
func (dst *StartBackgroundRequestRequest) XXX_Merge(src proto.Message) {
xxx_messageInfo_StartBackgroundRequestRequest.Merge(dst, src)
}
func (m *StartBackgroundRequestRequest) XXX_Size() int {
return xxx_messageInfo_StartBackgroundRequestRequest.Size(m)
}
func (m *StartBackgroundRequestRequest) XXX_DiscardUnknown() {
xxx_messageInfo_StartBackgroundRequestRequest.DiscardUnknown(m)
}
var xxx_messageInfo_StartBackgroundRequestRequest proto.InternalMessageInfo
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=requestId" json:"request_id,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *StartBackgroundRequestResponse) Reset() { *m = StartBackgroundRequestResponse{} }
func (m *StartBackgroundRequestResponse) String() string { return proto.CompactTextString(m) }
func (*StartBackgroundRequestResponse) ProtoMessage() {}
func (*StartBackgroundRequestResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_system_service_ccf41ec210fc59eb, []int{5}
}
func (m *StartBackgroundRequestResponse) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_StartBackgroundRequestResponse.Unmarshal(m, b)
}
func (m *StartBackgroundRequestResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_StartBackgroundRequestResponse.Marshal(b, m, deterministic)
}
func (dst *StartBackgroundRequestResponse) XXX_Merge(src proto.Message) {
xxx_messageInfo_StartBackgroundRequestResponse.Merge(dst, src)
}
func (m *StartBackgroundRequestResponse) XXX_Size() int {
return xxx_messageInfo_StartBackgroundRequestResponse.Size(m)
}
func (m *StartBackgroundRequestResponse) XXX_DiscardUnknown() {
xxx_messageInfo_StartBackgroundRequestResponse.DiscardUnknown(m)
}
var xxx_messageInfo_StartBackgroundRequestResponse proto.InternalMessageInfo
func (m *StartBackgroundRequestResponse) GetRequestId() string {
if m != nil && m.RequestId != nil {
return *m.RequestId
}
return ""
}
func init() {
proto.RegisterType((*SystemServiceError)(nil), "appengine.SystemServiceError")
proto.RegisterType((*SystemStat)(nil), "appengine.SystemStat")
proto.RegisterType((*GetSystemStatsRequest)(nil), "appengine.GetSystemStatsRequest")
proto.RegisterType((*GetSystemStatsResponse)(nil), "appengine.GetSystemStatsResponse")
proto.RegisterType((*StartBackgroundRequestRequest)(nil), "appengine.StartBackgroundRequestRequest")
proto.RegisterType((*StartBackgroundRequestResponse)(nil), "appengine.StartBackgroundRequestResponse")
}
func init() {
proto.RegisterFile("google.golang.org/appengine/internal/system/system_service.proto", fileDescriptor_system_service_ccf41ec210fc59eb)
}
var fileDescriptor_system_service_ccf41ec210fc59eb = []byte{
// 377 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x92, 0x4f, 0x8f, 0x93, 0x40,
0x18, 0xc6, 0xa5, 0x75, 0x51, 0x5e, 0xa3, 0xc1, 0xc9, 0xee, 0xca, 0xc1, 0x5d, 0x0d, 0x17, 0xbd,
0x48, 0x57, 0xbf, 0x80, 0xf6, 0xcf, 0x44, 0x49, 0x6b, 0xab, 0xd3, 0x7a, 0xf1, 0x42, 0x26, 0xf0,
0x3a, 0x21, 0xc2, 0x0c, 0x0e, 0x43, 0x93, 0x7e, 0x27, 0x3f, 0xa4, 0xe9, 0x30, 0x6d, 0xcd, 0x26,
0x3d, 0x31, 0xcf, 0xf3, 0xfc, 0x02, 0x3f, 0x08, 0xf0, 0x49, 0x28, 0x25, 0x2a, 0x4c, 0x84, 0xaa,
0xb8, 0x14, 0x89, 0xd2, 0x62, 0xc4, 0x9b, 0x06, 0xa5, 0x28, 0x25, 0x8e, 0x4a, 0x69, 0x50, 0x4b,
0x5e, 0x8d, 0xda, 0x5d, 0x6b, 0xb0, 0x76, 0x97, 0xac, 0x45, 0xbd, 0x2d, 0x73, 0x4c, 0x1a, 0xad,
0x8c, 0x22, 0xc1, 0x91, 0x8f, 0x7f, 0x01, 0x59, 0x5b, 0x64, 0xdd, 0x13, 0x54, 0x6b, 0xa5, 0xe3,
0x6f, 0x10, 0xd8, 0xc3, 0x54, 0x15, 0x48, 0x7c, 0x18, 0xac, 0xe6, 0xe1, 0x03, 0x42, 0xe0, 0x59,
0xba, 0xdc, 0x50, 0xb6, 0x1c, 0x2f, 0x32, 0xca, 0xd8, 0x8a, 0x85, 0x1e, 0xb9, 0x84, 0x70, 0x32,
0x9e, 0xce, 0xe9, 0x72, 0x96, 0x31, 0xfa, 0xfd, 0x47, 0xca, 0xe8, 0x2c, 0x1c, 0x90, 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xf1, 0x4f, 0xbf, 0xff, 0x4d, 0xfe, 0x05, 0x00, 0x00, 0xff,
0xff, 0x56, 0x5d, 0x5e, 0xc3, 0x5b, 0x02, 0x00, 0x00,
}

View File

@ -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;
}

File diff suppressed because it is too large Load Diff

View File

@ -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;
}

View File

@ -0,0 +1,115 @@
// 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.
package internal
// This file implements hooks for applying datastore transactions.
import (
"errors"
"reflect"
"github.com/golang/protobuf/proto"
netcontext "golang.org/x/net/context"
basepb "google.golang.org/appengine/internal/base"
pb "google.golang.org/appengine/internal/datastore"
)
var transactionSetters = make(map[reflect.Type]reflect.Value)
// RegisterTransactionSetter registers a function that sets transaction information
// in a protocol buffer message. f should be a function with two arguments,
// the first being a protocol buffer type, and the second being *datastore.Transaction.
func RegisterTransactionSetter(f interface{}) {
v := reflect.ValueOf(f)
transactionSetters[v.Type().In(0)] = v
}
// applyTransaction applies the transaction t to message pb
// by using the relevant setter passed to RegisterTransactionSetter.
func applyTransaction(pb proto.Message, t *pb.Transaction) {
v := reflect.ValueOf(pb)
if f, ok := transactionSetters[v.Type()]; ok {
f.Call([]reflect.Value{v, reflect.ValueOf(t)})
}
}
var transactionKey = "used for *Transaction"
func transactionFromContext(ctx netcontext.Context) *transaction {
t, _ := ctx.Value(&transactionKey).(*transaction)
return t
}
func withTransaction(ctx netcontext.Context, t *transaction) netcontext.Context {
return netcontext.WithValue(ctx, &transactionKey, t)
}
type transaction struct {
transaction pb.Transaction
finished bool
}
var ErrConcurrentTransaction = errors.New("internal: concurrent transaction")
func RunTransactionOnce(c netcontext.Context, f func(netcontext.Context) error, xg bool, readOnly bool, previousTransaction *pb.Transaction) (*pb.Transaction, error) {
if transactionFromContext(c) != nil {
return nil, errors.New("nested transactions are not supported")
}
// Begin the transaction.
t := &transaction{}
req := &pb.BeginTransactionRequest{
App: proto.String(FullyQualifiedAppID(c)),
}
if xg {
req.AllowMultipleEg = proto.Bool(true)
}
if previousTransaction != nil {
req.PreviousTransaction = previousTransaction
}
if readOnly {
req.Mode = pb.BeginTransactionRequest_READ_ONLY.Enum()
} else {
req.Mode = pb.BeginTransactionRequest_READ_WRITE.Enum()
}
if err := Call(c, "datastore_v3", "BeginTransaction", req, &t.transaction); err != nil {
return nil, err
}
// Call f, rolling back the transaction if f returns a non-nil error, or panics.
// The panic is not recovered.
defer func() {
if t.finished {
return
}
t.finished = true
// Ignore the error return value, since we are already returning a non-nil
// error (or we're panicking).
Call(c, "datastore_v3", "Rollback", &t.transaction, &basepb.VoidProto{})
}()
if err := f(withTransaction(c, t)); err != nil {
return &t.transaction, err
}
t.finished = true
// Commit the transaction.
res := &pb.CommitResponse{}
err := Call(c, "datastore_v3", "Commit", &t.transaction, res)
if ae, ok := err.(*APIError); ok {
/* TODO: restore this conditional
if appengine.IsDevAppServer() {
*/
// The Python Dev AppServer raises an ApplicationError with error code 2 (which is
// Error.CONCURRENT_TRANSACTION) and message "Concurrency exception.".
if ae.Code == int32(pb.Error_BAD_REQUEST) && ae.Detail == "ApplicationError: 2 Concurrency exception." {
return &t.transaction, ErrConcurrentTransaction
}
if ae.Code == int32(pb.Error_CONCURRENT_TRANSACTION) {
return &t.transaction, ErrConcurrentTransaction
}
}
return &t.transaction, err
}

View File

@ -0,0 +1,527 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: google.golang.org/appengine/internal/urlfetch/urlfetch_service.proto
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
// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
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
}
func (URLFetchServiceError_ErrorCode) EnumDescriptor() ([]byte, []int) {
return fileDescriptor_urlfetch_service_b245a7065f33bced, []int{0, 0}
}
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
}
func (URLFetchRequest_RequestMethod) EnumDescriptor() ([]byte, []int) {
return fileDescriptor_urlfetch_service_b245a7065f33bced, []int{1, 0}
}
type URLFetchServiceError struct {
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *URLFetchServiceError) Reset() { *m = URLFetchServiceError{} }
func (m *URLFetchServiceError) String() string { return proto.CompactTextString(m) }
func (*URLFetchServiceError) ProtoMessage() {}
func (*URLFetchServiceError) Descriptor() ([]byte, []int) {
return fileDescriptor_urlfetch_service_b245a7065f33bced, []int{0}
}
func (m *URLFetchServiceError) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_URLFetchServiceError.Unmarshal(m, b)
}
func (m *URLFetchServiceError) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_URLFetchServiceError.Marshal(b, m, deterministic)
}
func (dst *URLFetchServiceError) XXX_Merge(src proto.Message) {
xxx_messageInfo_URLFetchServiceError.Merge(dst, src)
}
func (m *URLFetchServiceError) XXX_Size() int {
return xxx_messageInfo_URLFetchServiceError.Size(m)
}
func (m *URLFetchServiceError) XXX_DiscardUnknown() {
xxx_messageInfo_URLFetchServiceError.DiscardUnknown(m)
}
var xxx_messageInfo_URLFetchServiceError proto.InternalMessageInfo
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" 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_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *URLFetchRequest) Reset() { *m = URLFetchRequest{} }
func (m *URLFetchRequest) String() string { return proto.CompactTextString(m) }
func (*URLFetchRequest) ProtoMessage() {}
func (*URLFetchRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_urlfetch_service_b245a7065f33bced, []int{1}
}
func (m *URLFetchRequest) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_URLFetchRequest.Unmarshal(m, b)
}
func (m *URLFetchRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_URLFetchRequest.Marshal(b, m, deterministic)
}
func (dst *URLFetchRequest) XXX_Merge(src proto.Message) {
xxx_messageInfo_URLFetchRequest.Merge(dst, src)
}
func (m *URLFetchRequest) XXX_Size() int {
return xxx_messageInfo_URLFetchRequest.Size(m)
}
func (m *URLFetchRequest) XXX_DiscardUnknown() {
xxx_messageInfo_URLFetchRequest.DiscardUnknown(m)
}
var xxx_messageInfo_URLFetchRequest proto.InternalMessageInfo
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_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *URLFetchRequest_Header) Reset() { *m = URLFetchRequest_Header{} }
func (m *URLFetchRequest_Header) String() string { return proto.CompactTextString(m) }
func (*URLFetchRequest_Header) ProtoMessage() {}
func (*URLFetchRequest_Header) Descriptor() ([]byte, []int) {
return fileDescriptor_urlfetch_service_b245a7065f33bced, []int{1, 0}
}
func (m *URLFetchRequest_Header) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_URLFetchRequest_Header.Unmarshal(m, b)
}
func (m *URLFetchRequest_Header) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_URLFetchRequest_Header.Marshal(b, m, deterministic)
}
func (dst *URLFetchRequest_Header) XXX_Merge(src proto.Message) {
xxx_messageInfo_URLFetchRequest_Header.Merge(dst, src)
}
func (m *URLFetchRequest_Header) XXX_Size() int {
return xxx_messageInfo_URLFetchRequest_Header.Size(m)
}
func (m *URLFetchRequest_Header) XXX_DiscardUnknown() {
xxx_messageInfo_URLFetchRequest_Header.DiscardUnknown(m)
}
var xxx_messageInfo_URLFetchRequest_Header proto.InternalMessageInfo
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" 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_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *URLFetchResponse) Reset() { *m = URLFetchResponse{} }
func (m *URLFetchResponse) String() string { return proto.CompactTextString(m) }
func (*URLFetchResponse) ProtoMessage() {}
func (*URLFetchResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_urlfetch_service_b245a7065f33bced, []int{2}
}
func (m *URLFetchResponse) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_URLFetchResponse.Unmarshal(m, b)
}
func (m *URLFetchResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_URLFetchResponse.Marshal(b, m, deterministic)
}
func (dst *URLFetchResponse) XXX_Merge(src proto.Message) {
xxx_messageInfo_URLFetchResponse.Merge(dst, src)
}
func (m *URLFetchResponse) XXX_Size() int {
return xxx_messageInfo_URLFetchResponse.Size(m)
}
func (m *URLFetchResponse) XXX_DiscardUnknown() {
xxx_messageInfo_URLFetchResponse.DiscardUnknown(m)
}
var xxx_messageInfo_URLFetchResponse proto.InternalMessageInfo
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_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *URLFetchResponse_Header) Reset() { *m = URLFetchResponse_Header{} }
func (m *URLFetchResponse_Header) String() string { return proto.CompactTextString(m) }
func (*URLFetchResponse_Header) ProtoMessage() {}
func (*URLFetchResponse_Header) Descriptor() ([]byte, []int) {
return fileDescriptor_urlfetch_service_b245a7065f33bced, []int{2, 0}
}
func (m *URLFetchResponse_Header) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_URLFetchResponse_Header.Unmarshal(m, b)
}
func (m *URLFetchResponse_Header) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_URLFetchResponse_Header.Marshal(b, m, deterministic)
}
func (dst *URLFetchResponse_Header) XXX_Merge(src proto.Message) {
xxx_messageInfo_URLFetchResponse_Header.Merge(dst, src)
}
func (m *URLFetchResponse_Header) XXX_Size() int {
return xxx_messageInfo_URLFetchResponse_Header.Size(m)
}
func (m *URLFetchResponse_Header) XXX_DiscardUnknown() {
xxx_messageInfo_URLFetchResponse_Header.DiscardUnknown(m)
}
var xxx_messageInfo_URLFetchResponse_Header proto.InternalMessageInfo
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() {
proto.RegisterType((*URLFetchServiceError)(nil), "appengine.URLFetchServiceError")
proto.RegisterType((*URLFetchRequest)(nil), "appengine.URLFetchRequest")
proto.RegisterType((*URLFetchRequest_Header)(nil), "appengine.URLFetchRequest.Header")
proto.RegisterType((*URLFetchResponse)(nil), "appengine.URLFetchResponse")
proto.RegisterType((*URLFetchResponse_Header)(nil), "appengine.URLFetchResponse.Header")
}
func init() {
proto.RegisterFile("google.golang.org/appengine/internal/urlfetch/urlfetch_service.proto", fileDescriptor_urlfetch_service_b245a7065f33bced)
}
var fileDescriptor_urlfetch_service_b245a7065f33bced = []byte{
// 770 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x54, 0xdd, 0x6e, 0xe3, 0x54,
0x10, 0xc6, 0x76, 0x7e, 0xa7, 0x5d, 0x7a, 0x76, 0xb6, 0x45, 0x66, 0xb5, 0xa0, 0x10, 0x09, 0x29,
0x17, 0x90, 0x2e, 0x2b, 0x24, 0x44, 0xaf, 0x70, 0xed, 0x93, 0xad, 0xa9, 0x63, 0x47, 0xc7, 0x4e,
0x61, 0xb9, 0xb1, 0xac, 0x78, 0x9a, 0x5a, 0xb2, 0xec, 0x60, 0x9f, 0x2c, 0xf4, 0x35, 0x78, 0x0d,
0xde, 0x87, 0xa7, 0xe1, 0x02, 0x9d, 0xc4, 0xc9, 0x6e, 0xbb, 0xd1, 0x4a, 0x5c, 0x65, 0xe6, 0x9b,
0xef, 0xcc, 0x99, 0x7c, 0xdf, 0xf8, 0x80, 0xb3, 0x2c, 0xcb, 0x65, 0x4e, 0xe3, 0x65, 0x99, 0x27,
0xc5, 0x72, 0x5c, 0x56, 0xcb, 0xf3, 0x64, 0xb5, 0xa2, 0x62, 0x99, 0x15, 0x74, 0x9e, 0x15, 0x92,
0xaa, 0x22, 0xc9, 0xcf, 0xd7, 0x55, 0x7e, 0x4b, 0x72, 0x71, 0xb7, 0x0f, 0xe2, 0x9a, 0xaa, 0xb7,
0xd9, 0x82, 0xc6, 0xab, 0xaa, 0x94, 0x25, 0xf6, 0xf7, 0x67, 0x86, 0x7f, 0xeb, 0x70, 0x3a, 0x17,
0xde, 0x44, 0xb1, 0xc2, 0x2d, 0x89, 0x57, 0x55, 0x59, 0x0d, 0xff, 0xd2, 0xa1, 0xbf, 0x89, 0xec,
0x32, 0x25, 0xec, 0x80, 0x1e, 0x5c, 0xb3, 0x4f, 0xf0, 0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e2, 0x40, 0x11, 0xbf, 0x86, 0x63, 0x6b, 0x95, 0xbd, 0x9b, 0xf6, 0x68, 0x47, 0x7e, 0x00, 0xe3,
0xb7, 0xc0, 0x76, 0xf9, 0x7e, 0xcc, 0xe3, 0x1d, 0xf5, 0x83, 0xd2, 0xff, 0x5f, 0xa6, 0x4b, 0xf8,
0xad, 0xb7, 0x7b, 0x2a, 0xff, 0x0b, 0x00, 0x00, 0xff, 0xff, 0x1d, 0x9f, 0x6d, 0x24, 0x63, 0x05,
0x00, 0x00,
}

View File

@ -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];
}

View File

@ -0,0 +1,531 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: google.golang.org/appengine/internal/user/user_service.proto
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
// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
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
}
func (UserServiceError_ErrorCode) EnumDescriptor() ([]byte, []int) {
return fileDescriptor_user_service_faa685423dd20b0a, []int{0, 0}
}
type UserServiceError struct {
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *UserServiceError) Reset() { *m = UserServiceError{} }
func (m *UserServiceError) String() string { return proto.CompactTextString(m) }
func (*UserServiceError) ProtoMessage() {}
func (*UserServiceError) Descriptor() ([]byte, []int) {
return fileDescriptor_user_service_faa685423dd20b0a, []int{0}
}
func (m *UserServiceError) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_UserServiceError.Unmarshal(m, b)
}
func (m *UserServiceError) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_UserServiceError.Marshal(b, m, deterministic)
}
func (dst *UserServiceError) XXX_Merge(src proto.Message) {
xxx_messageInfo_UserServiceError.Merge(dst, src)
}
func (m *UserServiceError) XXX_Size() int {
return xxx_messageInfo_UserServiceError.Size(m)
}
func (m *UserServiceError) XXX_DiscardUnknown() {
xxx_messageInfo_UserServiceError.DiscardUnknown(m)
}
var xxx_messageInfo_UserServiceError proto.InternalMessageInfo
type CreateLoginURLRequest struct {
DestinationUrl *string `protobuf:"bytes,1,req,name=destination_url,json=destinationUrl" json:"destination_url,omitempty"`
AuthDomain *string `protobuf:"bytes,2,opt,name=auth_domain,json=authDomain" json:"auth_domain,omitempty"`
FederatedIdentity *string `protobuf:"bytes,3,opt,name=federated_identity,json=federatedIdentity,def=" json:"federated_identity,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *CreateLoginURLRequest) Reset() { *m = CreateLoginURLRequest{} }
func (m *CreateLoginURLRequest) String() string { return proto.CompactTextString(m) }
func (*CreateLoginURLRequest) ProtoMessage() {}
func (*CreateLoginURLRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_user_service_faa685423dd20b0a, []int{1}
}
func (m *CreateLoginURLRequest) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_CreateLoginURLRequest.Unmarshal(m, b)
}
func (m *CreateLoginURLRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_CreateLoginURLRequest.Marshal(b, m, deterministic)
}
func (dst *CreateLoginURLRequest) XXX_Merge(src proto.Message) {
xxx_messageInfo_CreateLoginURLRequest.Merge(dst, src)
}
func (m *CreateLoginURLRequest) XXX_Size() int {
return xxx_messageInfo_CreateLoginURLRequest.Size(m)
}
func (m *CreateLoginURLRequest) XXX_DiscardUnknown() {
xxx_messageInfo_CreateLoginURLRequest.DiscardUnknown(m)
}
var xxx_messageInfo_CreateLoginURLRequest proto.InternalMessageInfo
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=loginUrl" json:"login_url,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *CreateLoginURLResponse) Reset() { *m = CreateLoginURLResponse{} }
func (m *CreateLoginURLResponse) String() string { return proto.CompactTextString(m) }
func (*CreateLoginURLResponse) ProtoMessage() {}
func (*CreateLoginURLResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_user_service_faa685423dd20b0a, []int{2}
}
func (m *CreateLoginURLResponse) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_CreateLoginURLResponse.Unmarshal(m, b)
}
func (m *CreateLoginURLResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_CreateLoginURLResponse.Marshal(b, m, deterministic)
}
func (dst *CreateLoginURLResponse) XXX_Merge(src proto.Message) {
xxx_messageInfo_CreateLoginURLResponse.Merge(dst, src)
}
func (m *CreateLoginURLResponse) XXX_Size() int {
return xxx_messageInfo_CreateLoginURLResponse.Size(m)
}
func (m *CreateLoginURLResponse) XXX_DiscardUnknown() {
xxx_messageInfo_CreateLoginURLResponse.DiscardUnknown(m)
}
var xxx_messageInfo_CreateLoginURLResponse proto.InternalMessageInfo
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=destinationUrl" json:"destination_url,omitempty"`
AuthDomain *string `protobuf:"bytes,2,opt,name=auth_domain,json=authDomain" json:"auth_domain,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *CreateLogoutURLRequest) Reset() { *m = CreateLogoutURLRequest{} }
func (m *CreateLogoutURLRequest) String() string { return proto.CompactTextString(m) }
func (*CreateLogoutURLRequest) ProtoMessage() {}
func (*CreateLogoutURLRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_user_service_faa685423dd20b0a, []int{3}
}
func (m *CreateLogoutURLRequest) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_CreateLogoutURLRequest.Unmarshal(m, b)
}
func (m *CreateLogoutURLRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_CreateLogoutURLRequest.Marshal(b, m, deterministic)
}
func (dst *CreateLogoutURLRequest) XXX_Merge(src proto.Message) {
xxx_messageInfo_CreateLogoutURLRequest.Merge(dst, src)
}
func (m *CreateLogoutURLRequest) XXX_Size() int {
return xxx_messageInfo_CreateLogoutURLRequest.Size(m)
}
func (m *CreateLogoutURLRequest) XXX_DiscardUnknown() {
xxx_messageInfo_CreateLogoutURLRequest.DiscardUnknown(m)
}
var xxx_messageInfo_CreateLogoutURLRequest proto.InternalMessageInfo
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=logoutUrl" json:"logout_url,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *CreateLogoutURLResponse) Reset() { *m = CreateLogoutURLResponse{} }
func (m *CreateLogoutURLResponse) String() string { return proto.CompactTextString(m) }
func (*CreateLogoutURLResponse) ProtoMessage() {}
func (*CreateLogoutURLResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_user_service_faa685423dd20b0a, []int{4}
}
func (m *CreateLogoutURLResponse) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_CreateLogoutURLResponse.Unmarshal(m, b)
}
func (m *CreateLogoutURLResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_CreateLogoutURLResponse.Marshal(b, m, deterministic)
}
func (dst *CreateLogoutURLResponse) XXX_Merge(src proto.Message) {
xxx_messageInfo_CreateLogoutURLResponse.Merge(dst, src)
}
func (m *CreateLogoutURLResponse) XXX_Size() int {
return xxx_messageInfo_CreateLogoutURLResponse.Size(m)
}
func (m *CreateLogoutURLResponse) XXX_DiscardUnknown() {
xxx_messageInfo_CreateLogoutURLResponse.DiscardUnknown(m)
}
var xxx_messageInfo_CreateLogoutURLResponse proto.InternalMessageInfo
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_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *GetOAuthUserRequest) Reset() { *m = GetOAuthUserRequest{} }
func (m *GetOAuthUserRequest) String() string { return proto.CompactTextString(m) }
func (*GetOAuthUserRequest) ProtoMessage() {}
func (*GetOAuthUserRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_user_service_faa685423dd20b0a, []int{5}
}
func (m *GetOAuthUserRequest) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_GetOAuthUserRequest.Unmarshal(m, b)
}
func (m *GetOAuthUserRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_GetOAuthUserRequest.Marshal(b, m, deterministic)
}
func (dst *GetOAuthUserRequest) XXX_Merge(src proto.Message) {
xxx_messageInfo_GetOAuthUserRequest.Merge(dst, src)
}
func (m *GetOAuthUserRequest) XXX_Size() int {
return xxx_messageInfo_GetOAuthUserRequest.Size(m)
}
func (m *GetOAuthUserRequest) XXX_DiscardUnknown() {
xxx_messageInfo_GetOAuthUserRequest.DiscardUnknown(m)
}
var xxx_messageInfo_GetOAuthUserRequest proto.InternalMessageInfo
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=userId" json:"user_id,omitempty"`
AuthDomain *string `protobuf:"bytes,3,req,name=auth_domain,json=authDomain" json:"auth_domain,omitempty"`
UserOrganization *string `protobuf:"bytes,4,opt,name=user_organization,json=userOrganization,def=" json:"user_organization,omitempty"`
IsAdmin *bool `protobuf:"varint,5,opt,name=is_admin,json=isAdmin,def=0" json:"is_admin,omitempty"`
ClientId *string `protobuf:"bytes,6,opt,name=client_id,json=clientId,def=" json:"client_id,omitempty"`
Scopes []string `protobuf:"bytes,7,rep,name=scopes" json:"scopes,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *GetOAuthUserResponse) Reset() { *m = GetOAuthUserResponse{} }
func (m *GetOAuthUserResponse) String() string { return proto.CompactTextString(m) }
func (*GetOAuthUserResponse) ProtoMessage() {}
func (*GetOAuthUserResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_user_service_faa685423dd20b0a, []int{6}
}
func (m *GetOAuthUserResponse) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_GetOAuthUserResponse.Unmarshal(m, b)
}
func (m *GetOAuthUserResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_GetOAuthUserResponse.Marshal(b, m, deterministic)
}
func (dst *GetOAuthUserResponse) XXX_Merge(src proto.Message) {
xxx_messageInfo_GetOAuthUserResponse.Merge(dst, src)
}
func (m *GetOAuthUserResponse) XXX_Size() int {
return xxx_messageInfo_GetOAuthUserResponse.Size(m)
}
func (m *GetOAuthUserResponse) XXX_DiscardUnknown() {
xxx_messageInfo_GetOAuthUserResponse.DiscardUnknown(m)
}
var xxx_messageInfo_GetOAuthUserResponse proto.InternalMessageInfo
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_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *CheckOAuthSignatureRequest) Reset() { *m = CheckOAuthSignatureRequest{} }
func (m *CheckOAuthSignatureRequest) String() string { return proto.CompactTextString(m) }
func (*CheckOAuthSignatureRequest) ProtoMessage() {}
func (*CheckOAuthSignatureRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_user_service_faa685423dd20b0a, []int{7}
}
func (m *CheckOAuthSignatureRequest) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_CheckOAuthSignatureRequest.Unmarshal(m, b)
}
func (m *CheckOAuthSignatureRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_CheckOAuthSignatureRequest.Marshal(b, m, deterministic)
}
func (dst *CheckOAuthSignatureRequest) XXX_Merge(src proto.Message) {
xxx_messageInfo_CheckOAuthSignatureRequest.Merge(dst, src)
}
func (m *CheckOAuthSignatureRequest) XXX_Size() int {
return xxx_messageInfo_CheckOAuthSignatureRequest.Size(m)
}
func (m *CheckOAuthSignatureRequest) XXX_DiscardUnknown() {
xxx_messageInfo_CheckOAuthSignatureRequest.DiscardUnknown(m)
}
var xxx_messageInfo_CheckOAuthSignatureRequest proto.InternalMessageInfo
type CheckOAuthSignatureResponse struct {
OauthConsumerKey *string `protobuf:"bytes,1,req,name=oauth_consumer_key,json=oauthConsumerKey" json:"oauth_consumer_key,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *CheckOAuthSignatureResponse) Reset() { *m = CheckOAuthSignatureResponse{} }
func (m *CheckOAuthSignatureResponse) String() string { return proto.CompactTextString(m) }
func (*CheckOAuthSignatureResponse) ProtoMessage() {}
func (*CheckOAuthSignatureResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_user_service_faa685423dd20b0a, []int{8}
}
func (m *CheckOAuthSignatureResponse) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_CheckOAuthSignatureResponse.Unmarshal(m, b)
}
func (m *CheckOAuthSignatureResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_CheckOAuthSignatureResponse.Marshal(b, m, deterministic)
}
func (dst *CheckOAuthSignatureResponse) XXX_Merge(src proto.Message) {
xxx_messageInfo_CheckOAuthSignatureResponse.Merge(dst, src)
}
func (m *CheckOAuthSignatureResponse) XXX_Size() int {
return xxx_messageInfo_CheckOAuthSignatureResponse.Size(m)
}
func (m *CheckOAuthSignatureResponse) XXX_DiscardUnknown() {
xxx_messageInfo_CheckOAuthSignatureResponse.DiscardUnknown(m)
}
var xxx_messageInfo_CheckOAuthSignatureResponse proto.InternalMessageInfo
func (m *CheckOAuthSignatureResponse) GetOauthConsumerKey() string {
if m != nil && m.OauthConsumerKey != nil {
return *m.OauthConsumerKey
}
return ""
}
func init() {
proto.RegisterType((*UserServiceError)(nil), "appengine.UserServiceError")
proto.RegisterType((*CreateLoginURLRequest)(nil), "appengine.CreateLoginURLRequest")
proto.RegisterType((*CreateLoginURLResponse)(nil), "appengine.CreateLoginURLResponse")
proto.RegisterType((*CreateLogoutURLRequest)(nil), "appengine.CreateLogoutURLRequest")
proto.RegisterType((*CreateLogoutURLResponse)(nil), "appengine.CreateLogoutURLResponse")
proto.RegisterType((*GetOAuthUserRequest)(nil), "appengine.GetOAuthUserRequest")
proto.RegisterType((*GetOAuthUserResponse)(nil), "appengine.GetOAuthUserResponse")
proto.RegisterType((*CheckOAuthSignatureRequest)(nil), "appengine.CheckOAuthSignatureRequest")
proto.RegisterType((*CheckOAuthSignatureResponse)(nil), "appengine.CheckOAuthSignatureResponse")
}
func init() {
proto.RegisterFile("google.golang.org/appengine/internal/user/user_service.proto", fileDescriptor_user_service_faa685423dd20b0a)
}
var fileDescriptor_user_service_faa685423dd20b0a = []byte{
// 573 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x52, 0x4d, 0x6f, 0xdb, 0x38,
0x10, 0x8d, 0xec, 0xd8, 0xb1, 0x26, 0xc0, 0x46, 0x61, 0xbe, 0xb4, 0x9b, 0x0d, 0xd6, 0xd0, 0x65,
0x7d, 0x68, 0xe3, 0x53, 0x81, 0x22, 0xe8, 0xc5, 0xb5, 0x85, 0xd4, 0xb0, 0x60, 0xa1, 0x8c, 0xd5,
0x02, 0xbd, 0x08, 0xac, 0x35, 0x51, 0x88, 0xc8, 0xa4, 0x4b, 0x52, 0x05, 0xd2, 0x73, 0x7f, 0x41,
0x6f, 0xfd, 0x93, 0xfd, 0x0d, 0x85, 0x68, 0x25, 0x50, 0xd2, 0x5e, 0x7b, 0x11, 0x34, 0xef, 0x0d,
0xdf, 0xbc, 0x37, 0x24, 0xbc, 0xca, 0xa5, 0xcc, 0x0b, 0x3c, 0xcf, 0x65, 0xc1, 0x44, 0x7e, 0x2e,
0x55, 0x3e, 0x64, 0xeb, 0x35, 0x8a, 0x9c, 0x0b, 0x1c, 0x72, 0x61, 0x50, 0x09, 0x56, 0x0c, 0x4b,
0x8d, 0xca, 0x7e, 0x52, 0x8d, 0xea, 0x33, 0x5f, 0xe2, 0xf9, 0x5a, 0x49, 0x23, 0x89, 0xfb, 0xd0,
0x1b, 0x7c, 0x77, 0xc0, 0x4b, 0x34, 0xaa, 0xab, 0x4d, 0x43, 0xa8, 0x94, 0x54, 0xc1, 0x57, 0x07,
0x5c, 0xfb, 0x37, 0x96, 0x19, 0x92, 0x2e, 0xb4, 0xe2, 0x99, 0xb7, 0x45, 0xfe, 0x86, 0x23, 0x1a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0x65,
0xeb, 0xa5, 0x3c, 0x03, 0x22, 0x6d, 0xcc, 0xa5, 0x14, 0xba, 0x5c, 0xa1, 0x4a, 0x6f, 0xf1, 0xae,
0xde, 0x90, 0x67, 0x99, 0x71, 0x4d, 0xcc, 0xf0, 0xee, 0x75, 0xf7, 0xc3, 0x76, 0x95, 0xeb, 0x67,
0x00, 0x00, 0x00, 0xff, 0xff, 0x58, 0x04, 0x53, 0xcc, 0xf8, 0x03, 0x00, 0x00,
}

View File

@ -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;
}

View File

@ -0,0 +1,726 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: google.golang.org/appengine/internal/xmpp/xmpp_service.proto
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
// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
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
}
func (XmppServiceError_ErrorCode) EnumDescriptor() ([]byte, []int) {
return fileDescriptor_xmpp_service_628da92437bed65f, []int{0, 0}
}
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
}
func (PresenceResponse_SHOW) EnumDescriptor() ([]byte, []int) {
return fileDescriptor_xmpp_service_628da92437bed65f, []int{2, 0}
}
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
}
func (XmppMessageResponse_XmppMessageStatus) EnumDescriptor() ([]byte, []int) {
return fileDescriptor_xmpp_service_628da92437bed65f, []int{6, 0}
}
type XmppServiceError struct {
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *XmppServiceError) Reset() { *m = XmppServiceError{} }
func (m *XmppServiceError) String() string { return proto.CompactTextString(m) }
func (*XmppServiceError) ProtoMessage() {}
func (*XmppServiceError) Descriptor() ([]byte, []int) {
return fileDescriptor_xmpp_service_628da92437bed65f, []int{0}
}
func (m *XmppServiceError) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_XmppServiceError.Unmarshal(m, b)
}
func (m *XmppServiceError) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_XmppServiceError.Marshal(b, m, deterministic)
}
func (dst *XmppServiceError) XXX_Merge(src proto.Message) {
xxx_messageInfo_XmppServiceError.Merge(dst, src)
}
func (m *XmppServiceError) XXX_Size() int {
return xxx_messageInfo_XmppServiceError.Size(m)
}
func (m *XmppServiceError) XXX_DiscardUnknown() {
xxx_messageInfo_XmppServiceError.DiscardUnknown(m)
}
var xxx_messageInfo_XmppServiceError proto.InternalMessageInfo
type PresenceRequest struct {
Jid *string `protobuf:"bytes,1,req,name=jid" json:"jid,omitempty"`
FromJid *string `protobuf:"bytes,2,opt,name=from_jid,json=fromJid" json:"from_jid,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *PresenceRequest) Reset() { *m = PresenceRequest{} }
func (m *PresenceRequest) String() string { return proto.CompactTextString(m) }
func (*PresenceRequest) ProtoMessage() {}
func (*PresenceRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_xmpp_service_628da92437bed65f, []int{1}
}
func (m *PresenceRequest) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_PresenceRequest.Unmarshal(m, b)
}
func (m *PresenceRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_PresenceRequest.Marshal(b, m, deterministic)
}
func (dst *PresenceRequest) XXX_Merge(src proto.Message) {
xxx_messageInfo_PresenceRequest.Merge(dst, src)
}
func (m *PresenceRequest) XXX_Size() int {
return xxx_messageInfo_PresenceRequest.Size(m)
}
func (m *PresenceRequest) XXX_DiscardUnknown() {
xxx_messageInfo_PresenceRequest.DiscardUnknown(m)
}
var xxx_messageInfo_PresenceRequest proto.InternalMessageInfo
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=isAvailable" 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_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *PresenceResponse) Reset() { *m = PresenceResponse{} }
func (m *PresenceResponse) String() string { return proto.CompactTextString(m) }
func (*PresenceResponse) ProtoMessage() {}
func (*PresenceResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_xmpp_service_628da92437bed65f, []int{2}
}
func (m *PresenceResponse) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_PresenceResponse.Unmarshal(m, b)
}
func (m *PresenceResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_PresenceResponse.Marshal(b, m, deterministic)
}
func (dst *PresenceResponse) XXX_Merge(src proto.Message) {
xxx_messageInfo_PresenceResponse.Merge(dst, src)
}
func (m *PresenceResponse) XXX_Size() int {
return xxx_messageInfo_PresenceResponse.Size(m)
}
func (m *PresenceResponse) XXX_DiscardUnknown() {
xxx_messageInfo_PresenceResponse.DiscardUnknown(m)
}
var xxx_messageInfo_PresenceResponse proto.InternalMessageInfo
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=fromJid" json:"from_jid,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *BulkPresenceRequest) Reset() { *m = BulkPresenceRequest{} }
func (m *BulkPresenceRequest) String() string { return proto.CompactTextString(m) }
func (*BulkPresenceRequest) ProtoMessage() {}
func (*BulkPresenceRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_xmpp_service_628da92437bed65f, []int{3}
}
func (m *BulkPresenceRequest) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_BulkPresenceRequest.Unmarshal(m, b)
}
func (m *BulkPresenceRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_BulkPresenceRequest.Marshal(b, m, deterministic)
}
func (dst *BulkPresenceRequest) XXX_Merge(src proto.Message) {
xxx_messageInfo_BulkPresenceRequest.Merge(dst, src)
}
func (m *BulkPresenceRequest) XXX_Size() int {
return xxx_messageInfo_BulkPresenceRequest.Size(m)
}
func (m *BulkPresenceRequest) XXX_DiscardUnknown() {
xxx_messageInfo_BulkPresenceRequest.DiscardUnknown(m)
}
var xxx_messageInfo_BulkPresenceRequest proto.InternalMessageInfo
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=presenceResponse" json:"presence_response,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *BulkPresenceResponse) Reset() { *m = BulkPresenceResponse{} }
func (m *BulkPresenceResponse) String() string { return proto.CompactTextString(m) }
func (*BulkPresenceResponse) ProtoMessage() {}
func (*BulkPresenceResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_xmpp_service_628da92437bed65f, []int{4}
}
func (m *BulkPresenceResponse) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_BulkPresenceResponse.Unmarshal(m, b)
}
func (m *BulkPresenceResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_BulkPresenceResponse.Marshal(b, m, deterministic)
}
func (dst *BulkPresenceResponse) XXX_Merge(src proto.Message) {
xxx_messageInfo_BulkPresenceResponse.Merge(dst, src)
}
func (m *BulkPresenceResponse) XXX_Size() int {
return xxx_messageInfo_BulkPresenceResponse.Size(m)
}
func (m *BulkPresenceResponse) XXX_DiscardUnknown() {
xxx_messageInfo_BulkPresenceResponse.DiscardUnknown(m)
}
var xxx_messageInfo_BulkPresenceResponse proto.InternalMessageInfo
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,json=rawXml,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=fromJid" json:"from_jid,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *XmppMessageRequest) Reset() { *m = XmppMessageRequest{} }
func (m *XmppMessageRequest) String() string { return proto.CompactTextString(m) }
func (*XmppMessageRequest) ProtoMessage() {}
func (*XmppMessageRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_xmpp_service_628da92437bed65f, []int{5}
}
func (m *XmppMessageRequest) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_XmppMessageRequest.Unmarshal(m, b)
}
func (m *XmppMessageRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_XmppMessageRequest.Marshal(b, m, deterministic)
}
func (dst *XmppMessageRequest) XXX_Merge(src proto.Message) {
xxx_messageInfo_XmppMessageRequest.Merge(dst, src)
}
func (m *XmppMessageRequest) XXX_Size() int {
return xxx_messageInfo_XmppMessageRequest.Size(m)
}
func (m *XmppMessageRequest) XXX_DiscardUnknown() {
xxx_messageInfo_XmppMessageRequest.DiscardUnknown(m)
}
var xxx_messageInfo_XmppMessageRequest proto.InternalMessageInfo
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_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *XmppMessageResponse) Reset() { *m = XmppMessageResponse{} }
func (m *XmppMessageResponse) String() string { return proto.CompactTextString(m) }
func (*XmppMessageResponse) ProtoMessage() {}
func (*XmppMessageResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_xmpp_service_628da92437bed65f, []int{6}
}
func (m *XmppMessageResponse) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_XmppMessageResponse.Unmarshal(m, b)
}
func (m *XmppMessageResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_XmppMessageResponse.Marshal(b, m, deterministic)
}
func (dst *XmppMessageResponse) XXX_Merge(src proto.Message) {
xxx_messageInfo_XmppMessageResponse.Merge(dst, src)
}
func (m *XmppMessageResponse) XXX_Size() int {
return xxx_messageInfo_XmppMessageResponse.Size(m)
}
func (m *XmppMessageResponse) XXX_DiscardUnknown() {
xxx_messageInfo_XmppMessageResponse.DiscardUnknown(m)
}
var xxx_messageInfo_XmppMessageResponse proto.InternalMessageInfo
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=fromJid" json:"from_jid,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *XmppSendPresenceRequest) Reset() { *m = XmppSendPresenceRequest{} }
func (m *XmppSendPresenceRequest) String() string { return proto.CompactTextString(m) }
func (*XmppSendPresenceRequest) ProtoMessage() {}
func (*XmppSendPresenceRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_xmpp_service_628da92437bed65f, []int{7}
}
func (m *XmppSendPresenceRequest) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_XmppSendPresenceRequest.Unmarshal(m, b)
}
func (m *XmppSendPresenceRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_XmppSendPresenceRequest.Marshal(b, m, deterministic)
}
func (dst *XmppSendPresenceRequest) XXX_Merge(src proto.Message) {
xxx_messageInfo_XmppSendPresenceRequest.Merge(dst, src)
}
func (m *XmppSendPresenceRequest) XXX_Size() int {
return xxx_messageInfo_XmppSendPresenceRequest.Size(m)
}
func (m *XmppSendPresenceRequest) XXX_DiscardUnknown() {
xxx_messageInfo_XmppSendPresenceRequest.DiscardUnknown(m)
}
var xxx_messageInfo_XmppSendPresenceRequest proto.InternalMessageInfo
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_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *XmppSendPresenceResponse) Reset() { *m = XmppSendPresenceResponse{} }
func (m *XmppSendPresenceResponse) String() string { return proto.CompactTextString(m) }
func (*XmppSendPresenceResponse) ProtoMessage() {}
func (*XmppSendPresenceResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_xmpp_service_628da92437bed65f, []int{8}
}
func (m *XmppSendPresenceResponse) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_XmppSendPresenceResponse.Unmarshal(m, b)
}
func (m *XmppSendPresenceResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_XmppSendPresenceResponse.Marshal(b, m, deterministic)
}
func (dst *XmppSendPresenceResponse) XXX_Merge(src proto.Message) {
xxx_messageInfo_XmppSendPresenceResponse.Merge(dst, src)
}
func (m *XmppSendPresenceResponse) XXX_Size() int {
return xxx_messageInfo_XmppSendPresenceResponse.Size(m)
}
func (m *XmppSendPresenceResponse) XXX_DiscardUnknown() {
xxx_messageInfo_XmppSendPresenceResponse.DiscardUnknown(m)
}
var xxx_messageInfo_XmppSendPresenceResponse proto.InternalMessageInfo
type XmppInviteRequest struct {
Jid *string `protobuf:"bytes,1,req,name=jid" json:"jid,omitempty"`
FromJid *string `protobuf:"bytes,2,opt,name=from_jid,json=fromJid" json:"from_jid,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *XmppInviteRequest) Reset() { *m = XmppInviteRequest{} }
func (m *XmppInviteRequest) String() string { return proto.CompactTextString(m) }
func (*XmppInviteRequest) ProtoMessage() {}
func (*XmppInviteRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_xmpp_service_628da92437bed65f, []int{9}
}
func (m *XmppInviteRequest) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_XmppInviteRequest.Unmarshal(m, b)
}
func (m *XmppInviteRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_XmppInviteRequest.Marshal(b, m, deterministic)
}
func (dst *XmppInviteRequest) XXX_Merge(src proto.Message) {
xxx_messageInfo_XmppInviteRequest.Merge(dst, src)
}
func (m *XmppInviteRequest) XXX_Size() int {
return xxx_messageInfo_XmppInviteRequest.Size(m)
}
func (m *XmppInviteRequest) XXX_DiscardUnknown() {
xxx_messageInfo_XmppInviteRequest.DiscardUnknown(m)
}
var xxx_messageInfo_XmppInviteRequest proto.InternalMessageInfo
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_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *XmppInviteResponse) Reset() { *m = XmppInviteResponse{} }
func (m *XmppInviteResponse) String() string { return proto.CompactTextString(m) }
func (*XmppInviteResponse) ProtoMessage() {}
func (*XmppInviteResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_xmpp_service_628da92437bed65f, []int{10}
}
func (m *XmppInviteResponse) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_XmppInviteResponse.Unmarshal(m, b)
}
func (m *XmppInviteResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_XmppInviteResponse.Marshal(b, m, deterministic)
}
func (dst *XmppInviteResponse) XXX_Merge(src proto.Message) {
xxx_messageInfo_XmppInviteResponse.Merge(dst, src)
}
func (m *XmppInviteResponse) XXX_Size() int {
return xxx_messageInfo_XmppInviteResponse.Size(m)
}
func (m *XmppInviteResponse) XXX_DiscardUnknown() {
xxx_messageInfo_XmppInviteResponse.DiscardUnknown(m)
}
var xxx_messageInfo_XmppInviteResponse proto.InternalMessageInfo
func init() {
proto.RegisterType((*XmppServiceError)(nil), "appengine.XmppServiceError")
proto.RegisterType((*PresenceRequest)(nil), "appengine.PresenceRequest")
proto.RegisterType((*PresenceResponse)(nil), "appengine.PresenceResponse")
proto.RegisterType((*BulkPresenceRequest)(nil), "appengine.BulkPresenceRequest")
proto.RegisterType((*BulkPresenceResponse)(nil), "appengine.BulkPresenceResponse")
proto.RegisterType((*XmppMessageRequest)(nil), "appengine.XmppMessageRequest")
proto.RegisterType((*XmppMessageResponse)(nil), "appengine.XmppMessageResponse")
proto.RegisterType((*XmppSendPresenceRequest)(nil), "appengine.XmppSendPresenceRequest")
proto.RegisterType((*XmppSendPresenceResponse)(nil), "appengine.XmppSendPresenceResponse")
proto.RegisterType((*XmppInviteRequest)(nil), "appengine.XmppInviteRequest")
proto.RegisterType((*XmppInviteResponse)(nil), "appengine.XmppInviteResponse")
}
func init() {
proto.RegisterFile("google.golang.org/appengine/internal/xmpp/xmpp_service.proto", fileDescriptor_xmpp_service_628da92437bed65f)
}
var fileDescriptor_xmpp_service_628da92437bed65f = []byte{
// 681 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x54, 0xcd, 0x72, 0xda, 0x48,
0x10, 0xb6, 0x40, 0xfc, 0x35, 0x5e, 0x7b, 0x18, 0xb3, 0xbb, 0xec, 0xa6, 0x2a, 0x45, 0x74, 0xf2,
0x09, 0xa7, 0x7c, 0x74, 0xb9, 0x52, 0x11, 0x68, 0x5c, 0xc8, 0x05, 0x12, 0x19, 0x20, 0xc6, 0xbe,
0x4c, 0x64, 0x33, 0x96, 0x95, 0x08, 0x49, 0x91, 0x64, 0x6c, 0xbf, 0x40, 0xae, 0x79, 0x89, 0xbc,
0x46, 0x5e, 0x22, 0xa7, 0x3c, 0x4e, 0x4a, 0x23, 0x41, 0xc0, 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, 0xa5, 0x48, 0xe1, 0xd9, 0xa2, 0xe5, 0xc7, 0xfc, 0xfa, 0x1f, 0x1a,
0x0f, 0xfb, 0xc8, 0xa6, 0xfb, 0x32, 0x55, 0xaa, 0x7b, 0x73, 0x27, 0xfe, 0xb3, 0x05, 0xad, 0xa7,
0xcf, 0x63, 0xc1, 0x90, 0xf2, 0xb6, 0x8b, 0x67, 0x72, 0xf2, 0xb1, 0xfb, 0x16, 0x00, 0x00, 0xff,
0xff, 0x4e, 0x58, 0x2e, 0xb1, 0x1d, 0x05, 0x00, 0x00,
}

View File

@ -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 {
}