Documentation ¶
Index ¶
- Variables
- func NewHelloworldEndpoints() []*api.Endpoint
- func NewRouteGuideEndpoints() []*api.Endpoint
- func NewStatisticsServiceEndpoints() []*api.Endpoint
- func RegisterHelloworldHandler(s server.Server, hdlr HelloworldHandler, opts ...server.HandlerOption) error
- func RegisterRouteGuideHandler(s server.Server, hdlr RouteGuideHandler, opts ...server.HandlerOption) error
- func RegisterStatisticsServiceHandler(s server.Server, hdlr StatisticsServiceHandler, opts ...server.HandlerOption) error
- type AccessEvent
- func (*AccessEvent) Descriptor() ([]byte, []int)deprecated
- func (x *AccessEvent) GetIp() string
- func (x *AccessEvent) GetLatency() int64
- func (x *AccessEvent) GetMethod() string
- func (x *AccessEvent) GetPath() string
- func (x *AccessEvent) GetStatus() uint32
- func (x *AccessEvent) GetTimestamp() int64
- func (*AccessEvent) ProtoMessage()
- func (x *AccessEvent) ProtoReflect() protoreflect.Message
- func (x *AccessEvent) Reset()
- func (x *AccessEvent) String() string
- type Feature
- type HelloworldHandler
- type HelloworldService
- type Message
- func (*Message) Descriptor() ([]byte, []int)deprecated
- func (x *Message) GetId() string
- func (x *Message) GetMessage() string
- func (x *Message) GetTimestamp() int64
- func (*Message) ProtoMessage()
- func (x *Message) ProtoReflect() protoreflect.Message
- func (x *Message) Reset()
- func (x *Message) String() string
- type Point
- type Rectangle
- type Request
- type Response
- type RouteGuideHandler
- type RouteGuideService
- type RouteGuide_ListFeaturesService
- type RouteGuide_ListFeaturesStream
- type RouteGuide_RecordRouteService
- type RouteGuide_RecordRouteStream
- type RouteGuide_RouteChatService
- type RouteGuide_RouteChatStream
- type RouteNote
- type RouteSummary
- func (*RouteSummary) Descriptor() ([]byte, []int)deprecated
- func (x *RouteSummary) GetDistance() int32
- func (x *RouteSummary) GetElapsedTime() int32
- func (x *RouteSummary) GetFeatureCount() int32
- func (x *RouteSummary) GetPointCount() int32
- func (*RouteSummary) ProtoMessage()
- func (x *RouteSummary) ProtoReflect() protoreflect.Message
- func (x *RouteSummary) Reset()
- func (x *RouteSummary) String() string
- type StatisticsReply
- type StatisticsRequest
- type StatisticsService
- type StatisticsServiceHandler
Constants ¶
This section is empty.
Variables ¶
var File_proto_helloworld_proto protoreflect.FileDescriptor
var File_proto_message_proto protoreflect.FileDescriptor
var File_proto_route_guide_proto protoreflect.FileDescriptor
var File_proto_statistics_proto protoreflect.FileDescriptor
Functions ¶
func NewHelloworldEndpoints ¶
func NewRouteGuideEndpoints ¶
func RegisterHelloworldHandler ¶
func RegisterHelloworldHandler(s server.Server, hdlr HelloworldHandler, opts ...server.HandlerOption) error
func RegisterRouteGuideHandler ¶
func RegisterRouteGuideHandler(s server.Server, hdlr RouteGuideHandler, opts ...server.HandlerOption) error
func RegisterStatisticsServiceHandler ¶
func RegisterStatisticsServiceHandler(s server.Server, hdlr StatisticsServiceHandler, opts ...server.HandlerOption) error
Types ¶
type AccessEvent ¶
type AccessEvent struct { Status uint32 `protobuf:"varint,1,opt,name=status,proto3" json:"status,omitempty"` Method string `protobuf:"bytes,2,opt,name=method,proto3" json:"method,omitempty"` Path string `protobuf:"bytes,3,opt,name=path,proto3" json:"path,omitempty"` Ip string `protobuf:"bytes,4,opt,name=ip,proto3" json:"ip,omitempty"` Latency int64 `protobuf:"varint,5,opt,name=latency,proto3" json:"latency,omitempty"` Timestamp int64 `protobuf:"varint,6,opt,name=timestamp,proto3" json:"timestamp,omitempty"` // contains filtered or unexported fields }
func (*AccessEvent) Descriptor
deprecated
func (*AccessEvent) Descriptor() ([]byte, []int)
Deprecated: Use AccessEvent.ProtoReflect.Descriptor instead.
func (*AccessEvent) GetIp ¶
func (x *AccessEvent) GetIp() string
func (*AccessEvent) GetLatency ¶
func (x *AccessEvent) GetLatency() int64
func (*AccessEvent) GetMethod ¶
func (x *AccessEvent) GetMethod() string
func (*AccessEvent) GetPath ¶
func (x *AccessEvent) GetPath() string
func (*AccessEvent) GetStatus ¶
func (x *AccessEvent) GetStatus() uint32
func (*AccessEvent) GetTimestamp ¶
func (x *AccessEvent) GetTimestamp() int64
func (*AccessEvent) ProtoMessage ¶
func (*AccessEvent) ProtoMessage()
func (*AccessEvent) ProtoReflect ¶
func (x *AccessEvent) ProtoReflect() protoreflect.Message
func (*AccessEvent) Reset ¶
func (x *AccessEvent) Reset()
func (*AccessEvent) String ¶
func (x *AccessEvent) String() string
type Feature ¶
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"` // contains filtered or unexported fields }
A feature names something at a given point.
If a feature could not be named, the name is empty.
func (*Feature) Descriptor
deprecated
func (*Feature) GetLocation ¶
func (*Feature) ProtoMessage ¶
func (*Feature) ProtoMessage()
func (*Feature) ProtoReflect ¶
func (x *Feature) ProtoReflect() protoreflect.Message
type HelloworldHandler ¶
type HelloworldService ¶
type HelloworldService interface {
Call(ctx context.Context, in *Request, opts ...client.CallOption) (*Response, error)
}
func NewHelloworldService ¶
func NewHelloworldService(name string, c client.Client) HelloworldService
type Message ¶
type Message struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` Timestamp int64 `protobuf:"varint,3,opt,name=timestamp,proto3" json:"timestamp,omitempty"` // contains filtered or unexported fields }
func (*Message) Descriptor
deprecated
func (*Message) GetMessage ¶
func (*Message) GetTimestamp ¶
func (*Message) ProtoMessage ¶
func (*Message) ProtoMessage()
func (*Message) ProtoReflect ¶
func (x *Message) ProtoReflect() protoreflect.Message
type Point ¶
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"` // contains filtered or unexported fields }
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
deprecated
func (*Point) GetLatitude ¶
func (*Point) GetLongitude ¶
func (*Point) ProtoMessage ¶
func (*Point) ProtoMessage()
func (*Point) ProtoReflect ¶
func (x *Point) ProtoReflect() protoreflect.Message
type Rectangle ¶
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"` // contains filtered or unexported fields }
A latitude-longitude rectangle, represented as two diagonally opposite points "lo" and "hi".
func (*Rectangle) Descriptor
deprecated
func (*Rectangle) ProtoMessage ¶
func (*Rectangle) ProtoMessage()
func (*Rectangle) ProtoReflect ¶
func (x *Rectangle) ProtoReflect() protoreflect.Message
type Request ¶
type Request struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // contains filtered or unexported fields }
func (*Request) Descriptor
deprecated
func (*Request) ProtoMessage ¶
func (*Request) ProtoMessage()
func (*Request) ProtoReflect ¶
func (x *Request) ProtoReflect() protoreflect.Message
type Response ¶
type Response struct { Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` // contains filtered or unexported fields }
func (*Response) Descriptor
deprecated
func (*Response) GetMessage ¶
func (*Response) ProtoMessage ¶
func (*Response) ProtoMessage()
func (*Response) ProtoReflect ¶
func (x *Response) ProtoReflect() protoreflect.Message
type RouteGuideHandler ¶
type RouteGuideHandler 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(context.Context, *Rectangle, RouteGuide_ListFeaturesStream) 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(context.Context, RouteGuide_RecordRouteStream) 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(context.Context, RouteGuide_RouteChatStream) error }
type RouteGuideService ¶
type RouteGuideService 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 ...client.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 ...client.CallOption) (RouteGuide_ListFeaturesService, 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 ...client.CallOption) (RouteGuide_RecordRouteService, 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 ...client.CallOption) (RouteGuide_RouteChatService, error) }
func NewRouteGuideService ¶
func NewRouteGuideService(name string, c client.Client) RouteGuideService
type RouteNote ¶
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"` // contains filtered or unexported fields }
A RouteNote is a message sent while at a given point.
func (*RouteNote) Descriptor
deprecated
func (*RouteNote) GetLocation ¶
func (*RouteNote) GetMessage ¶
func (*RouteNote) ProtoMessage ¶
func (*RouteNote) ProtoMessage()
func (*RouteNote) ProtoReflect ¶
func (x *RouteNote) ProtoReflect() protoreflect.Message
type RouteSummary ¶
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"` // contains filtered or unexported fields }
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
deprecated
func (*RouteSummary) Descriptor() ([]byte, []int)
Deprecated: Use RouteSummary.ProtoReflect.Descriptor instead.
func (*RouteSummary) GetDistance ¶
func (x *RouteSummary) GetDistance() int32
func (*RouteSummary) GetElapsedTime ¶
func (x *RouteSummary) GetElapsedTime() int32
func (*RouteSummary) GetFeatureCount ¶
func (x *RouteSummary) GetFeatureCount() int32
func (*RouteSummary) GetPointCount ¶
func (x *RouteSummary) GetPointCount() int32
func (*RouteSummary) ProtoMessage ¶
func (*RouteSummary) ProtoMessage()
func (*RouteSummary) ProtoReflect ¶
func (x *RouteSummary) ProtoReflect() protoreflect.Message
func (*RouteSummary) Reset ¶
func (x *RouteSummary) Reset()
func (*RouteSummary) String ¶
func (x *RouteSummary) String() string
type StatisticsReply ¶
type StatisticsReply struct { AccessCount int64 `protobuf:"varint,1,opt,name=access_count,json=accessCount,proto3" json:"access_count,omitempty"` // contains filtered or unexported fields }
func (*StatisticsReply) Descriptor
deprecated
func (*StatisticsReply) Descriptor() ([]byte, []int)
Deprecated: Use StatisticsReply.ProtoReflect.Descriptor instead.
func (*StatisticsReply) GetAccessCount ¶
func (x *StatisticsReply) GetAccessCount() int64
func (*StatisticsReply) ProtoMessage ¶
func (*StatisticsReply) ProtoMessage()
func (*StatisticsReply) ProtoReflect ¶
func (x *StatisticsReply) ProtoReflect() protoreflect.Message
func (*StatisticsReply) Reset ¶
func (x *StatisticsReply) Reset()
func (*StatisticsReply) String ¶
func (x *StatisticsReply) String() string
type StatisticsRequest ¶
type StatisticsRequest struct { Method *string `protobuf:"bytes,1,opt,name=method,proto3,oneof" json:"method,omitempty"` // contains filtered or unexported fields }
func (*StatisticsRequest) Descriptor
deprecated
func (*StatisticsRequest) Descriptor() ([]byte, []int)
Deprecated: Use StatisticsRequest.ProtoReflect.Descriptor instead.
func (*StatisticsRequest) GetMethod ¶
func (x *StatisticsRequest) GetMethod() string
func (*StatisticsRequest) ProtoMessage ¶
func (*StatisticsRequest) ProtoMessage()
func (*StatisticsRequest) ProtoReflect ¶
func (x *StatisticsRequest) ProtoReflect() protoreflect.Message
func (*StatisticsRequest) Reset ¶
func (x *StatisticsRequest) Reset()
func (*StatisticsRequest) String ¶
func (x *StatisticsRequest) String() string
type StatisticsService ¶
type StatisticsService interface {
Statistics(ctx context.Context, in *StatisticsRequest, opts ...client.CallOption) (*StatisticsReply, error)
}
func NewStatisticsService ¶
func NewStatisticsService(name string, c client.Client) StatisticsService
type StatisticsServiceHandler ¶
type StatisticsServiceHandler interface {
Statistics(context.Context, *StatisticsRequest, *StatisticsReply) error
}