helloworld

package
v0.0.0-...-ed2f012 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterStreamServer

func RegisterStreamServer(s *grpc.Server, srv StreamServer)

Types

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"`
	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

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

func (*Point) GetLatitude

func (m *Point) GetLatitude() int32

func (*Point) GetLongitude

func (m *Point) GetLongitude() int32

func (*Point) ProtoMessage

func (*Point) ProtoMessage()

func (*Point) Reset

func (m *Point) Reset()

func (*Point) String

func (m *Point) String() string

func (*Point) XXX_DiscardUnknown

func (m *Point) XXX_DiscardUnknown()

func (*Point) XXX_Marshal

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

func (*Point) XXX_Merge

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

func (*Point) XXX_Size

func (m *Point) XXX_Size() int

func (*Point) XXX_Unmarshal

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

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"`
	ID                   int64    `protobuf:"varint,3,opt,name=ID,proto3" json:"ID,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

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

func (*RouteNote) GetID

func (m *RouteNote) GetID() int64

func (*RouteNote) GetLocation

func (m *RouteNote) GetLocation() *Point

func (*RouteNote) GetMessage

func (m *RouteNote) GetMessage() string

func (*RouteNote) ProtoMessage

func (*RouteNote) ProtoMessage()

func (*RouteNote) Reset

func (m *RouteNote) Reset()

func (*RouteNote) String

func (m *RouteNote) String() string

func (*RouteNote) XXX_DiscardUnknown

func (m *RouteNote) XXX_DiscardUnknown()

func (*RouteNote) XXX_Marshal

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

func (*RouteNote) XXX_Merge

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

func (*RouteNote) XXX_Size

func (m *RouteNote) XXX_Size() int

func (*RouteNote) XXX_Unmarshal

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

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"`
	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

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

func (*RouteSummary) GetDistance

func (m *RouteSummary) GetDistance() int32

func (*RouteSummary) GetElapsedTime

func (m *RouteSummary) GetElapsedTime() int32

func (*RouteSummary) GetFeatureCount

func (m *RouteSummary) GetFeatureCount() int32

func (*RouteSummary) GetPointCount

func (m *RouteSummary) GetPointCount() int32

func (*RouteSummary) ProtoMessage

func (*RouteSummary) ProtoMessage()

func (*RouteSummary) Reset

func (m *RouteSummary) Reset()

func (*RouteSummary) String

func (m *RouteSummary) String() string

func (*RouteSummary) XXX_DiscardUnknown

func (m *RouteSummary) XXX_DiscardUnknown()

func (*RouteSummary) XXX_Marshal

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

func (*RouteSummary) XXX_Merge

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

func (*RouteSummary) XXX_Size

func (m *RouteSummary) XXX_Size() int

func (*RouteSummary) XXX_Unmarshal

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

type StreamClient

type StreamClient interface {
	// 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) (Stream_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) (Stream_RouteChatClient, error)
}

StreamClient is the client API for Stream service.

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

func NewStreamClient

func NewStreamClient(cc grpc.ClientConnInterface) StreamClient

type StreamServer

type StreamServer interface {
	// A client-to-server streaming RPC.
	//
	// Accepts a stream of Points on a route being traversed, returning a
	// RouteSummary when traversal is completed.
	RecordRoute(Stream_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(Stream_RouteChatServer) error
}

StreamServer is the server API for Stream service.

type Stream_RecordRouteClient

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

type Stream_RecordRouteServer

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

type Stream_RouteChatClient

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

type Stream_RouteChatServer

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

type UnimplementedStreamServer

type UnimplementedStreamServer struct {
}

UnimplementedStreamServer can be embedded to have forward compatible implementations.

func (*UnimplementedStreamServer) RecordRoute

func (*UnimplementedStreamServer) RouteChat

Jump to

Keyboard shortcuts

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