Documentation ¶
Overview ¶
Package pb is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- func RegisterSayHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterSayHandlerClient(ctx context.Context, mux *runtime.ServeMux, client SayClient) error
- func RegisterSayHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterSayServer(s *grpc.Server, srv SayServer)
- func RegisterSayServerHandlerClient(ctx context.Context, mux *runtime.ServeMux, srv SayServer) error
- type CreatePhotoRequest
- func (*CreatePhotoRequest) Descriptor() ([]byte, []int)
- func (m *CreatePhotoRequest) GetPhoto() *Photo
- func (*CreatePhotoRequest) ProtoMessage()
- func (m *CreatePhotoRequest) Reset()
- func (m *CreatePhotoRequest) String() string
- func (m *CreatePhotoRequest) XXX_DiscardUnknown()
- func (m *CreatePhotoRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *CreatePhotoRequest) XXX_Merge(src proto.Message)
- func (m *CreatePhotoRequest) XXX_Size() int
- func (m *CreatePhotoRequest) XXX_Unmarshal(b []byte) error
- type Photo
- func (*Photo) Descriptor() ([]byte, []int)
- func (m *Photo) GetDownloadUrl() string
- func (m *Photo) GetPhotoId() *PhotoId
- func (m *Photo) GetShareLink() string
- func (m *Photo) GetThumbnailUrl() string
- func (m *Photo) GetUploadReference() *UploadRef
- func (m *Photo) GetViewCount() int64
- func (*Photo) ProtoMessage()
- func (m *Photo) Reset()
- func (m *Photo) String() string
- func (m *Photo) XXX_DiscardUnknown()
- func (m *Photo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *Photo) XXX_Merge(src proto.Message)
- func (m *Photo) XXX_Size() int
- func (m *Photo) XXX_Unmarshal(b []byte) error
- type PhotoId
- func (*PhotoId) Descriptor() ([]byte, []int)
- func (m *PhotoId) GetId() string
- func (*PhotoId) ProtoMessage()
- func (m *PhotoId) Reset()
- func (m *PhotoId) String() string
- func (m *PhotoId) XXX_DiscardUnknown()
- func (m *PhotoId) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *PhotoId) XXX_Merge(src proto.Message)
- func (m *PhotoId) XXX_Size() int
- func (m *PhotoId) XXX_Unmarshal(b []byte) error
- type Request
- func (*Request) Descriptor() ([]byte, []int)
- func (m *Request) GetAge() int32
- func (m *Request) GetId() uint32
- func (m *Request) GetLimit() int64
- func (m *Request) GetName() string
- func (m *Request) GetPage() uint32
- func (*Request) ProtoMessage()
- func (m *Request) Reset()
- func (m *Request) String() string
- func (m *Request) XXX_DiscardUnknown()
- func (m *Request) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *Request) XXX_Merge(src proto.Message)
- func (m *Request) XXX_Size() int
- func (m *Request) XXX_Unmarshal(b []byte) error
- type Response
- func (*Response) Descriptor() ([]byte, []int)
- func (m *Response) GetMsg() string
- func (*Response) ProtoMessage()
- func (m *Response) Reset()
- func (m *Response) String() string
- func (m *Response) XXX_DiscardUnknown()
- func (m *Response) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *Response) XXX_Merge(src proto.Message)
- func (m *Response) XXX_Size() int
- func (m *Response) XXX_Unmarshal(b []byte) error
- type SayClient
- type SayServer
- type UploadRef
- func (*UploadRef) Descriptor() ([]byte, []int)
- func (m *UploadRef) GetUploadUrl() string
- func (*UploadRef) ProtoMessage()
- func (m *UploadRef) Reset()
- func (m *UploadRef) String() string
- func (m *UploadRef) XXX_DiscardUnknown()
- func (m *UploadRef) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *UploadRef) XXX_Merge(src proto.Message)
- func (m *UploadRef) XXX_Size() int
- func (m *UploadRef) XXX_Unmarshal(b []byte) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterSayHandler ¶
RegisterSayHandler registers the http handlers for service Say to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterSayHandlerClient ¶
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 ¶
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"` 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) GetDownloadUrl ¶
func (*Photo) GetPhotoId ¶
func (*Photo) GetShareLink ¶
func (*Photo) GetThumbnailUrl ¶
func (*Photo) GetUploadReference ¶
func (*Photo) GetViewCount ¶
func (*Photo) ProtoMessage ¶
func (*Photo) ProtoMessage()
func (*Photo) XXX_DiscardUnknown ¶
func (m *Photo) XXX_DiscardUnknown()
func (*Photo) XXX_Marshal ¶
func (*Photo) XXX_Unmarshal ¶
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) ProtoMessage ¶
func (*PhotoId) ProtoMessage()
func (*PhotoId) XXX_DiscardUnknown ¶
func (m *PhotoId) XXX_DiscardUnknown()
func (*PhotoId) XXX_Marshal ¶
func (*PhotoId) XXX_Unmarshal ¶
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) ProtoMessage ¶
func (*Request) ProtoMessage()
func (*Request) XXX_DiscardUnknown ¶
func (m *Request) XXX_DiscardUnknown()
func (*Request) XXX_Marshal ¶
func (*Request) XXX_Unmarshal ¶
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) ProtoMessage ¶
func (*Response) ProtoMessage()
func (*Response) XXX_DiscardUnknown ¶
func (m *Response) XXX_DiscardUnknown()
func (*Response) XXX_Marshal ¶
func (*Response) XXX_Unmarshal ¶
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 ¶
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) GetUploadUrl ¶
func (*UploadRef) ProtoMessage ¶
func (*UploadRef) ProtoMessage()
func (*UploadRef) XXX_DiscardUnknown ¶
func (m *UploadRef) XXX_DiscardUnknown()