grpc: google.golang.org/grpc/examples/route_guide/routeguide Index | Files

package routeguide

import "google.golang.org/grpc/examples/route_guide/routeguide"

Index

Package Files

route_guide.pb.go

func RegisterRouteGuideServer Uses

func RegisterRouteGuideServer(s *grpc.Server, srv RouteGuideServer)

type Feature Uses

type Feature struct {
    // The name of the feature.
    Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
    // The point where the feature is detected.
    Location             *Point   `protobuf:"bytes,2,opt,name=location,proto3" json:"location,omitempty"`
    XXX_NoUnkeyedLiteral struct{} `json:"-"`
    XXX_unrecognized     []byte   `json:"-"`
    XXX_sizecache        int32    `json:"-"`
}

A feature names something at a given point.

If a feature could not be named, the name is empty.

func (*Feature) Descriptor Uses

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

func (*Feature) GetLocation Uses

func (m *Feature) GetLocation() *Point

func (*Feature) GetName Uses

func (m *Feature) GetName() string

func (*Feature) ProtoMessage Uses

func (*Feature) ProtoMessage()

func (*Feature) Reset Uses

func (m *Feature) Reset()

func (*Feature) String Uses

func (m *Feature) String() string

func (*Feature) XXX_DiscardUnknown Uses

func (m *Feature) XXX_DiscardUnknown()

func (*Feature) XXX_Marshal Uses

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

func (*Feature) XXX_Merge Uses

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

func (*Feature) XXX_Size Uses

func (m *Feature) XXX_Size() int

func (*Feature) XXX_Unmarshal Uses

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

type Point Uses

type Point struct {
    Latitude             int32    `protobuf:"varint,1,opt,name=latitude,proto3" json:"latitude,omitempty"`
    Longitude            int32    `protobuf:"varint,2,opt,name=longitude,proto3" json:"longitude,omitempty"`
    XXX_NoUnkeyedLiteral struct{} `json:"-"`
    XXX_unrecognized     []byte   `json:"-"`
    XXX_sizecache        int32    `json:"-"`
}

Points are represented as latitude-longitude pairs in the E7 representation (degrees multiplied by 10**7 and rounded to the nearest integer). Latitudes should be in the range +/- 90 degrees and longitude should be in the range +/- 180 degrees (inclusive).

func (*Point) Descriptor Uses

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

func (*Point) GetLatitude Uses

func (m *Point) GetLatitude() int32

func (*Point) GetLongitude Uses

func (m *Point) GetLongitude() int32

func (*Point) ProtoMessage Uses

func (*Point) ProtoMessage()

func (*Point) Reset Uses

func (m *Point) Reset()

func (*Point) String Uses

func (m *Point) String() string

func (*Point) XXX_DiscardUnknown Uses

func (m *Point) XXX_DiscardUnknown()

func (*Point) XXX_Marshal Uses

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

func (*Point) XXX_Merge Uses

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

func (*Point) XXX_Size Uses

func (m *Point) XXX_Size() int

func (*Point) XXX_Unmarshal Uses

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

type Rectangle Uses

type Rectangle struct {
    // One corner of the rectangle.
    Lo  *Point `protobuf:"bytes,1,opt,name=lo,proto3" json:"lo,omitempty"`
    // The other corner of the rectangle.
    Hi                   *Point   `protobuf:"bytes,2,opt,name=hi,proto3" json:"hi,omitempty"`
    XXX_NoUnkeyedLiteral struct{} `json:"-"`
    XXX_unrecognized     []byte   `json:"-"`
    XXX_sizecache        int32    `json:"-"`
}

A latitude-longitude rectangle, represented as two diagonally opposite points "lo" and "hi".

func (*Rectangle) Descriptor Uses

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

func (*Rectangle) GetHi Uses

func (m *Rectangle) GetHi() *Point

func (*Rectangle) GetLo Uses

func (m *Rectangle) GetLo() *Point

func (*Rectangle) ProtoMessage Uses

func (*Rectangle) ProtoMessage()

func (*Rectangle) Reset Uses

func (m *Rectangle) Reset()

func (*Rectangle) String Uses

func (m *Rectangle) String() string

func (*Rectangle) XXX_DiscardUnknown Uses

func (m *Rectangle) XXX_DiscardUnknown()

func (*Rectangle) XXX_Marshal Uses

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

func (*Rectangle) XXX_Merge Uses

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

func (*Rectangle) XXX_Size Uses

func (m *Rectangle) XXX_Size() int

func (*Rectangle) XXX_Unmarshal Uses

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

type RouteGuideClient Uses

type RouteGuideClient interface {
    // A simple RPC.
    //
    // Obtains the feature at a given position.
    //
    // A feature with an empty name is returned if there's no feature at the given
    // position.
    GetFeature(ctx context.Context, in *Point, opts ...grpc.CallOption) (*Feature, error)
    // A server-to-client streaming RPC.
    //
    // Obtains the Features available within the given Rectangle.  Results are
    // streamed rather than returned at once (e.g. in a response message with a
    // repeated field), as the rectangle may cover a large area and contain a
    // huge number of features.
    ListFeatures(ctx context.Context, in *Rectangle, opts ...grpc.CallOption) (RouteGuide_ListFeaturesClient, error)
    // A client-to-server streaming RPC.
    //
    // Accepts a stream of Points on a route being traversed, returning a
    // RouteSummary when traversal is completed.
    RecordRoute(ctx context.Context, opts ...grpc.CallOption) (RouteGuide_RecordRouteClient, error)
    // A Bidirectional streaming RPC.
    //
    // Accepts a stream of RouteNotes sent while a route is being traversed,
    // while receiving other RouteNotes (e.g. from other users).
    RouteChat(ctx context.Context, opts ...grpc.CallOption) (RouteGuide_RouteChatClient, error)
}

RouteGuideClient is the client API for RouteGuide service.

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

func NewRouteGuideClient Uses

func NewRouteGuideClient(cc *grpc.ClientConn) RouteGuideClient

type RouteGuideServer Uses

type RouteGuideServer interface {
    // A simple RPC.
    //
    // Obtains the feature at a given position.
    //
    // A feature with an empty name is returned if there's no feature at the given
    // position.
    GetFeature(context.Context, *Point) (*Feature, error)
    // A server-to-client streaming RPC.
    //
    // Obtains the Features available within the given Rectangle.  Results are
    // streamed rather than returned at once (e.g. in a response message with a
    // repeated field), as the rectangle may cover a large area and contain a
    // huge number of features.
    ListFeatures(*Rectangle, RouteGuide_ListFeaturesServer) error
    // A client-to-server streaming RPC.
    //
    // Accepts a stream of Points on a route being traversed, returning a
    // RouteSummary when traversal is completed.
    RecordRoute(RouteGuide_RecordRouteServer) error
    // A Bidirectional streaming RPC.
    //
    // Accepts a stream of RouteNotes sent while a route is being traversed,
    // while receiving other RouteNotes (e.g. from other users).
    RouteChat(RouteGuide_RouteChatServer) error
}

RouteGuideServer is the server API for RouteGuide service.

type RouteGuide_ListFeaturesClient Uses

type RouteGuide_ListFeaturesClient interface {
    Recv() (*Feature, error)
    grpc.ClientStream
}

type RouteGuide_ListFeaturesServer Uses

type RouteGuide_ListFeaturesServer interface {
    Send(*Feature) error
    grpc.ServerStream
}

type RouteGuide_RecordRouteClient Uses

type RouteGuide_RecordRouteClient interface {
    Send(*Point) error
    CloseAndRecv() (*RouteSummary, error)
    grpc.ClientStream
}

type RouteGuide_RecordRouteServer Uses

type RouteGuide_RecordRouteServer interface {
    SendAndClose(*RouteSummary) error
    Recv() (*Point, error)
    grpc.ServerStream
}

type RouteGuide_RouteChatClient Uses

type RouteGuide_RouteChatClient interface {
    Send(*RouteNote) error
    Recv() (*RouteNote, error)
    grpc.ClientStream
}

type RouteGuide_RouteChatServer Uses

type RouteGuide_RouteChatServer interface {
    Send(*RouteNote) error
    Recv() (*RouteNote, error)
    grpc.ServerStream
}

type RouteNote Uses

type RouteNote struct {
    // The location from which the message is sent.
    Location *Point `protobuf:"bytes,1,opt,name=location,proto3" json:"location,omitempty"`
    // The message to be sent.
    Message              string   `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"`
    XXX_NoUnkeyedLiteral struct{} `json:"-"`
    XXX_unrecognized     []byte   `json:"-"`
    XXX_sizecache        int32    `json:"-"`
}

A RouteNote is a message sent while at a given point.

func (*RouteNote) Descriptor Uses

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

func (*RouteNote) GetLocation Uses

func (m *RouteNote) GetLocation() *Point

func (*RouteNote) GetMessage Uses

func (m *RouteNote) GetMessage() string

func (*RouteNote) ProtoMessage Uses

func (*RouteNote) ProtoMessage()

func (*RouteNote) Reset Uses

func (m *RouteNote) Reset()

func (*RouteNote) String Uses

func (m *RouteNote) String() string

func (*RouteNote) XXX_DiscardUnknown Uses

func (m *RouteNote) XXX_DiscardUnknown()

func (*RouteNote) XXX_Marshal Uses

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

func (*RouteNote) XXX_Merge Uses

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

func (*RouteNote) XXX_Size Uses

func (m *RouteNote) XXX_Size() int

func (*RouteNote) XXX_Unmarshal Uses

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

type RouteSummary Uses

type RouteSummary struct {
    // The number of points received.
    PointCount int32 `protobuf:"varint,1,opt,name=point_count,json=pointCount,proto3" json:"point_count,omitempty"`
    // The number of known features passed while traversing the route.
    FeatureCount int32 `protobuf:"varint,2,opt,name=feature_count,json=featureCount,proto3" json:"feature_count,omitempty"`
    // The distance covered in metres.
    Distance int32 `protobuf:"varint,3,opt,name=distance,proto3" json:"distance,omitempty"`
    // The duration of the traversal in seconds.
    ElapsedTime          int32    `protobuf:"varint,4,opt,name=elapsed_time,json=elapsedTime,proto3" json:"elapsed_time,omitempty"`
    XXX_NoUnkeyedLiteral struct{} `json:"-"`
    XXX_unrecognized     []byte   `json:"-"`
    XXX_sizecache        int32    `json:"-"`
}

A RouteSummary is received in response to a RecordRoute rpc.

It contains the number of individual points received, the number of detected features, and the total distance covered as the cumulative sum of the distance between each point.

func (*RouteSummary) Descriptor Uses

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

func (*RouteSummary) GetDistance Uses

func (m *RouteSummary) GetDistance() int32

func (*RouteSummary) GetElapsedTime Uses

func (m *RouteSummary) GetElapsedTime() int32

func (*RouteSummary) GetFeatureCount Uses

func (m *RouteSummary) GetFeatureCount() int32

func (*RouteSummary) GetPointCount Uses

func (m *RouteSummary) GetPointCount() int32

func (*RouteSummary) ProtoMessage Uses

func (*RouteSummary) ProtoMessage()

func (*RouteSummary) Reset Uses

func (m *RouteSummary) Reset()

func (*RouteSummary) String Uses

func (m *RouteSummary) String() string

func (*RouteSummary) XXX_DiscardUnknown Uses

func (m *RouteSummary) XXX_DiscardUnknown()

func (*RouteSummary) XXX_Marshal Uses

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

func (*RouteSummary) XXX_Merge Uses

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

func (*RouteSummary) XXX_Size Uses

func (m *RouteSummary) XXX_Size() int

func (*RouteSummary) XXX_Unmarshal Uses

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

Package routeguide imports 5 packages (graph) and is imported by 60 packages. Updated 2018-06-09. Refresh now. Tools for package owners.