pb

package
v0.0.0-...-97ec4e3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 28, 2019 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package pb is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterSayHandler

func RegisterSayHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error

RegisterSayHandler registers the http handlers for service Say to "mux". The handlers forward requests to the grpc endpoint over "conn".

func RegisterSayHandlerClient

func RegisterSayHandlerClient(ctx context.Context, mux *runtime.ServeMux, client SayClient) error

RegisterSayHandlerClient registers the http handlers for service Say to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "SayClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "SayClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "SayClient" to call the correct interceptors.

func RegisterSayHandlerFromEndpoint

func RegisterSayHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)

RegisterSayHandlerFromEndpoint is same as RegisterSayHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.

func RegisterSayServer

func RegisterSayServer(s *grpc.Server, srv SayServer)

func RegisterSayServerHandlerClient

func RegisterSayServerHandlerClient(ctx context.Context, mux *runtime.ServeMux, srv SayServer) error

Types

type CreatePhotoRequest

type CreatePhotoRequest struct {
	// Required. Photo to create.
	Photo                *Photo   `protobuf:"bytes,1,opt,name=photo,proto3" json:"photo,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

Request to create a photo.

func (*CreatePhotoRequest) Descriptor

func (*CreatePhotoRequest) Descriptor() ([]byte, []int)

func (*CreatePhotoRequest) GetPhoto

func (m *CreatePhotoRequest) GetPhoto() *Photo

func (*CreatePhotoRequest) ProtoMessage

func (*CreatePhotoRequest) ProtoMessage()

func (*CreatePhotoRequest) Reset

func (m *CreatePhotoRequest) Reset()

func (*CreatePhotoRequest) String

func (m *CreatePhotoRequest) String() string

func (*CreatePhotoRequest) XXX_DiscardUnknown

func (m *CreatePhotoRequest) XXX_DiscardUnknown()

func (*CreatePhotoRequest) XXX_Marshal

func (m *CreatePhotoRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*CreatePhotoRequest) XXX_Merge

func (dst *CreatePhotoRequest) XXX_Merge(src proto.Message)

func (*CreatePhotoRequest) XXX_Size

func (m *CreatePhotoRequest) XXX_Size() int

func (*CreatePhotoRequest) XXX_Unmarshal

func (m *CreatePhotoRequest) XXX_Unmarshal(b []byte) error

type Photo

type Photo struct {
	// Output only. Identifier for the photo, which is unique among all photos in
	// Google.
	PhotoId *PhotoId `protobuf:"bytes,1,opt,name=photo_id,json=photoId,proto3" json:"photo_id,omitempty"`
	// Required (when creating photo). Input only. The resource URL where the
	// photo bytes are uploaded to.
	UploadReference *UploadRef `protobuf:"bytes,2,opt,name=upload_reference,json=uploadReference,proto3" json:"upload_reference,omitempty"`
	// Output only. The download URL for the photo bytes. This field is set only
	// when the `view` parameter in a `GetPhotoRequest` is set to
	// `INCLUDE_DOWNLOAD_URL`.
	DownloadUrl string `protobuf:"bytes,3,opt,name=download_url,json=downloadUrl,proto3" json:"download_url,omitempty"`
	// Output only. The thumbnail URL for showing a preview of the given photo.
	ThumbnailUrl string `protobuf:"bytes,9,opt,name=thumbnail_url,json=thumbnailUrl,proto3" json:"thumbnail_url,omitempty"`
	// Output only. The share link for the photo.
	ShareLink string `protobuf:"bytes,11,opt,name=share_link,json=shareLink,proto3" json:"share_link,omitempty"`
	// Output only. View count of the photo.
	ViewCount            int64    `protobuf:"varint,10,opt,name=view_count,json=viewCount,proto3" json:"view_count,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

Photo is used to store 360 photos along with photo metadata.

func (*Photo) Descriptor

func (*Photo) Descriptor() ([]byte, []int)

func (*Photo) GetDownloadUrl

func (m *Photo) GetDownloadUrl() string

func (*Photo) GetPhotoId

func (m *Photo) GetPhotoId() *PhotoId
func (m *Photo) GetShareLink() string

func (*Photo) GetThumbnailUrl

func (m *Photo) GetThumbnailUrl() string

func (*Photo) GetUploadReference

func (m *Photo) GetUploadReference() *UploadRef

func (*Photo) GetViewCount

func (m *Photo) GetViewCount() int64

func (*Photo) ProtoMessage

func (*Photo) ProtoMessage()

func (*Photo) Reset

func (m *Photo) Reset()

func (*Photo) String

func (m *Photo) String() string

func (*Photo) XXX_DiscardUnknown

func (m *Photo) XXX_DiscardUnknown()

func (*Photo) XXX_Marshal

func (m *Photo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Photo) XXX_Merge

func (dst *Photo) XXX_Merge(src proto.Message)

func (*Photo) XXX_Size

func (m *Photo) XXX_Size() int

func (*Photo) XXX_Unmarshal

func (m *Photo) XXX_Unmarshal(b []byte) error

type PhotoId

type PhotoId struct {
	// Required. A base64 encoded identifier.
	Id                   string   `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

Identifier for a photo.

func (*PhotoId) Descriptor

func (*PhotoId) Descriptor() ([]byte, []int)

func (*PhotoId) GetId

func (m *PhotoId) GetId() string

func (*PhotoId) ProtoMessage

func (*PhotoId) ProtoMessage()

func (*PhotoId) Reset

func (m *PhotoId) Reset()

func (*PhotoId) String

func (m *PhotoId) String() string

func (*PhotoId) XXX_DiscardUnknown

func (m *PhotoId) XXX_DiscardUnknown()

func (*PhotoId) XXX_Marshal

func (m *PhotoId) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*PhotoId) XXX_Merge

func (dst *PhotoId) XXX_Merge(src proto.Message)

func (*PhotoId) XXX_Size

func (m *PhotoId) XXX_Size() int

func (*PhotoId) XXX_Unmarshal

func (m *PhotoId) XXX_Unmarshal(b []byte) error

type Request

type Request struct {
	Id                   uint32   `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
	Name                 string   `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
	Age                  int32    `protobuf:"varint,3,opt,name=age,proto3" json:"age,omitempty"`
	Page                 uint32   `protobuf:"varint,4,opt,name=page,proto3" json:"page,omitempty"`
	Limit                int64    `protobuf:"varint,5,opt,name=limit,proto3" json:"limit,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*Request) Descriptor

func (*Request) Descriptor() ([]byte, []int)

func (*Request) GetAge

func (m *Request) GetAge() int32

func (*Request) GetId

func (m *Request) GetId() uint32

func (*Request) GetLimit

func (m *Request) GetLimit() int64

func (*Request) GetName

func (m *Request) GetName() string

func (*Request) GetPage

func (m *Request) GetPage() uint32

func (*Request) ProtoMessage

func (*Request) ProtoMessage()

func (*Request) Reset

func (m *Request) Reset()

func (*Request) String

func (m *Request) String() string

func (*Request) XXX_DiscardUnknown

func (m *Request) XXX_DiscardUnknown()

func (*Request) XXX_Marshal

func (m *Request) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Request) XXX_Merge

func (dst *Request) XXX_Merge(src proto.Message)

func (*Request) XXX_Size

func (m *Request) XXX_Size() int

func (*Request) XXX_Unmarshal

func (m *Request) XXX_Unmarshal(b []byte) error

type Response

type Response struct {
	Msg                  string   `protobuf:"bytes,1,opt,name=msg,proto3" json:"msg,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*Response) Descriptor

func (*Response) Descriptor() ([]byte, []int)

func (*Response) GetMsg

func (m *Response) GetMsg() string

func (*Response) ProtoMessage

func (*Response) ProtoMessage()

func (*Response) Reset

func (m *Response) Reset()

func (*Response) String

func (m *Response) String() string

func (*Response) XXX_DiscardUnknown

func (m *Response) XXX_DiscardUnknown()

func (*Response) XXX_Marshal

func (m *Response) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Response) XXX_Merge

func (dst *Response) XXX_Merge(src proto.Message)

func (*Response) XXX_Size

func (m *Response) XXX_Size() int

func (*Response) XXX_Unmarshal

func (m *Response) XXX_Unmarshal(b []byte) error

type SayClient

type SayClient interface {
	Hello(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error)
	// Creates an upload session to start uploading photo data. The upload URL of
	// the returned `UploadRef` is used to upload the data for the photo.
	//
	// After the upload is complete, the `UploadRef` is used with
	// `StreetViewPublishService:CreatePhoto()` to create the `Photo` object
	// entry.
	StartUpload(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*UploadRef, error)
	// After the client finishes uploading the photo with the returned
	// `UploadRef`, `photo.create` publishes the uploaded photo to Street View on
	// Google Maps.
	//
	// This method returns the following error codes:
	//
	// * `INVALID_ARGUMENT` if the request is malformed.
	// * `NOT_FOUND` if the upload reference does not exist.
	CreatePhoto(ctx context.Context, in *CreatePhotoRequest, opts ...grpc.CallOption) (*Photo, error)
}

SayClient is the client API for Say service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewSayClient

func NewSayClient(cc *grpc.ClientConn) SayClient

func NewSayServerClient

func NewSayServerClient(srv SayServer) SayClient

type SayServer

type SayServer interface {
	Hello(context.Context, *Request) (*Response, error)
	// Creates an upload session to start uploading photo data. The upload URL of
	// the returned `UploadRef` is used to upload the data for the photo.
	//
	// After the upload is complete, the `UploadRef` is used with
	// `StreetViewPublishService:CreatePhoto()` to create the `Photo` object
	// entry.
	StartUpload(context.Context, *empty.Empty) (*UploadRef, error)
	// After the client finishes uploading the photo with the returned
	// `UploadRef`, `photo.create` publishes the uploaded photo to Street View on
	// Google Maps.
	//
	// This method returns the following error codes:
	//
	// * `INVALID_ARGUMENT` if the request is malformed.
	// * `NOT_FOUND` if the upload reference does not exist.
	CreatePhoto(context.Context, *CreatePhotoRequest) (*Photo, error)
}

SayServer is the server API for Say service.

type UploadRef

type UploadRef struct {
	// Required. An upload reference should be unique for each user. It follows
	// the form:
	// "https://streetviewpublish.googleapis.com/media/user/<account_id>/photo/<upload_reference>"
	UploadUrl            string   `protobuf:"bytes,1,opt,name=upload_url,json=uploadUrl,proto3" json:"upload_url,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

Upload reference for media files.

func (*UploadRef) Descriptor

func (*UploadRef) Descriptor() ([]byte, []int)

func (*UploadRef) GetUploadUrl

func (m *UploadRef) GetUploadUrl() string

func (*UploadRef) ProtoMessage

func (*UploadRef) ProtoMessage()

func (*UploadRef) Reset

func (m *UploadRef) Reset()

func (*UploadRef) String

func (m *UploadRef) String() string

func (*UploadRef) XXX_DiscardUnknown

func (m *UploadRef) XXX_DiscardUnknown()

func (*UploadRef) XXX_Marshal

func (m *UploadRef) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*UploadRef) XXX_Merge

func (dst *UploadRef) XXX_Merge(src proto.Message)

func (*UploadRef) XXX_Size

func (m *UploadRef) XXX_Size() int

func (*UploadRef) XXX_Unmarshal

func (m *UploadRef) XXX_Unmarshal(b []byte) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL