Documentation
¶
Index ¶
- Variables
- func RegisterPortGuideServer(s grpc.ServiceRegistrar, srv PortGuideServer)
- func RegisterToolGuideServer(s grpc.ServiceRegistrar, srv ToolGuideServer)
- type Circle
- type Content
- type Key
- type Name
- type Point
- type Port
- func (*Port) Descriptor() ([]byte, []int)deprecated
- func (x *Port) GetAlias() []string
- func (x *Port) GetCity() string
- func (x *Port) GetCode() string
- func (x *Port) GetCoordinates() []float32
- func (x *Port) GetCountry() string
- func (x *Port) GetName() string
- func (x *Port) GetProvince() string
- func (x *Port) GetRegions() []string
- func (x *Port) GetTimezone() string
- func (x *Port) GetUnlocs() []string
- func (*Port) ProtoMessage()
- func (x *Port) ProtoReflect() protoreflect.Message
- func (x *Port) Reset()
- func (x *Port) String() string
- type PortGuideClient
- type PortGuideServer
- type PortGuide_RecordListClient
- type PortGuide_RecordListServer
- type Ports
- type Quest
- type Summary
- type ToolGuideClient
- type ToolGuideServer
- type UnimplementedPortGuideServer
- func (UnimplementedPortGuideServer) FindInCircle(context.Context, *Circle) (*Ports, error)
- func (UnimplementedPortGuideServer) FindNearest(context.Context, *Point) (*Port, error)
- func (UnimplementedPortGuideServer) FindText(context.Context, *Quest) (*Ports, error)
- func (UnimplementedPortGuideServer) GetByKey(context.Context, *Key) (*Port, error)
- func (UnimplementedPortGuideServer) GetByName(context.Context, *Name) (*Port, error)
- func (UnimplementedPortGuideServer) RecordList(PortGuide_RecordListServer) error
- func (UnimplementedPortGuideServer) SetByKey(context.Context, *Port) (*Key, error)
- type UnimplementedToolGuideServer
- type UnsafePortGuideServer
- type UnsafeToolGuideServer
Constants ¶
This section is empty.
Variables ¶
var File_pb_pds_proto protoreflect.FileDescriptor
var PortGuide_ServiceDesc = grpc.ServiceDesc{ ServiceName: "pds.PortGuide", HandlerType: (*PortGuideServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "SetByKey", Handler: _PortGuide_SetByKey_Handler, }, { MethodName: "GetByKey", Handler: _PortGuide_GetByKey_Handler, }, { MethodName: "GetByName", Handler: _PortGuide_GetByName_Handler, }, { MethodName: "FindNearest", Handler: _PortGuide_FindNearest_Handler, }, { MethodName: "FindInCircle", Handler: _PortGuide_FindInCircle_Handler, }, { MethodName: "FindText", Handler: _PortGuide_FindText_Handler, }, }, Streams: []grpc.StreamDesc{ { StreamName: "RecordList", Handler: _PortGuide_RecordList_Handler, ClientStreams: true, }, }, Metadata: "pb/pds.proto", }
PortGuide_ServiceDesc is the grpc.ServiceDesc for PortGuide service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
var ToolGuide_ServiceDesc = grpc.ServiceDesc{ ServiceName: "pds.ToolGuide", HandlerType: (*ToolGuideServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Ping", Handler: _ToolGuide_Ping_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "pb/pds.proto", }
ToolGuide_ServiceDesc is the grpc.ServiceDesc for ToolGuide service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterPortGuideServer ¶
func RegisterPortGuideServer(s grpc.ServiceRegistrar, srv PortGuideServer)
func RegisterToolGuideServer ¶
func RegisterToolGuideServer(s grpc.ServiceRegistrar, srv ToolGuideServer)
Types ¶
type Circle ¶
type Circle struct { Center *Point `protobuf:"bytes,1,opt,name=center,proto3" json:"center,omitempty"` Radius float32 `protobuf:"fixed32,2,opt,name=radius,proto3" json:"radius,omitempty"` // contains filtered or unexported fields }
Circle with center at given Point, and radius in meters.
func (*Circle) Descriptor
deprecated
func (*Circle) ProtoMessage ¶
func (*Circle) ProtoMessage()
func (*Circle) ProtoReflect ¶
func (x *Circle) ProtoReflect() protoreflect.Message
type Content ¶
type Content struct { Value []byte `protobuf:"bytes,1,opt,name=Value,proto3" json:"Value,omitempty"` // contains filtered or unexported fields }
Ping message content.
func (*Content) Descriptor
deprecated
func (*Content) ProtoMessage ¶
func (*Content) ProtoMessage()
func (*Content) ProtoReflect ¶
func (x *Content) ProtoReflect() protoreflect.Message
type Key ¶
type Key struct { Value string `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"` // contains filtered or unexported fields }
Port key.
func (*Key) Descriptor
deprecated
func (*Key) ProtoMessage ¶
func (*Key) ProtoMessage()
func (*Key) ProtoReflect ¶
func (x *Key) ProtoReflect() protoreflect.Message
type Name ¶
type Name struct { Value string `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"` // contains filtered or unexported fields }
Port name.
func (*Name) Descriptor
deprecated
func (*Name) ProtoMessage ¶
func (*Name) ProtoMessage()
func (*Name) ProtoReflect ¶
func (x *Name) ProtoReflect() protoreflect.Message
type Point ¶
type Point struct { Latitude float32 `protobuf:"fixed32,1,opt,name=latitude,proto3" json:"latitude,omitempty"` Longitude float32 `protobuf:"fixed32,2,opt,name=longitude,proto3" json:"longitude,omitempty"` // contains filtered or unexported fields }
Point with geo coordinates as latitude-longitude pair.
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 Port ¶
type Port struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` City string `protobuf:"bytes,2,opt,name=city,proto3" json:"city,omitempty"` Country string `protobuf:"bytes,3,opt,name=country,proto3" json:"country,omitempty"` Alias []string `protobuf:"bytes,4,rep,name=alias,proto3" json:"alias,omitempty"` Regions []string `protobuf:"bytes,5,rep,name=regions,proto3" json:"regions,omitempty"` Coordinates []float32 `protobuf:"fixed32,6,rep,packed,name=coordinates,proto3" json:"coordinates,omitempty"` Province string `protobuf:"bytes,7,opt,name=province,proto3" json:"province,omitempty"` Timezone string `protobuf:"bytes,8,opt,name=timezone,proto3" json:"timezone,omitempty"` Unlocs []string `protobuf:"bytes,9,rep,name=unlocs,proto3" json:"unlocs,omitempty"` Code string `protobuf:"bytes,10,opt,name=code,proto3" json:"code,omitempty"` // contains filtered or unexported fields }
Port description.
func (*Port) Descriptor
deprecated
func (*Port) GetCoordinates ¶
func (*Port) GetCountry ¶
func (*Port) GetProvince ¶
func (*Port) GetRegions ¶
func (*Port) GetTimezone ¶
func (*Port) ProtoMessage ¶
func (*Port) ProtoMessage()
func (*Port) ProtoReflect ¶
func (x *Port) ProtoReflect() protoreflect.Message
type PortGuideClient ¶
type PortGuideClient interface { // Accepts a stream of Ports and adds them to map. RecordList(ctx context.Context, opts ...grpc.CallOption) (PortGuide_RecordListClient, error) // Stores Port to map and return associated key. SetByKey(ctx context.Context, in *Port, opts ...grpc.CallOption) (*Key, error) // Returns Port by associated key. GetByKey(ctx context.Context, in *Key, opts ...grpc.CallOption) (*Port, error) // Returns Port by associated name. GetByName(ctx context.Context, in *Name, opts ...grpc.CallOption) (*Port, error) // Finds nearest Port to given coordinates. FindNearest(ctx context.Context, in *Point, opts ...grpc.CallOption) (*Port, error) // Finds all ports in given circle. FindInCircle(ctx context.Context, in *Circle, opts ...grpc.CallOption) (*Ports, error) // Finds all ports each of which contains given text // in one of the fields: name, city, province, country. FindText(ctx context.Context, in *Quest, opts ...grpc.CallOption) (*Ports, error) }
PortGuideClient is the client API for PortGuide service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
func NewPortGuideClient ¶
func NewPortGuideClient(cc grpc.ClientConnInterface) PortGuideClient
type PortGuideServer ¶
type PortGuideServer interface { // Accepts a stream of Ports and adds them to map. RecordList(PortGuide_RecordListServer) error // Stores Port to map and return associated key. SetByKey(context.Context, *Port) (*Key, error) // Returns Port by associated key. GetByKey(context.Context, *Key) (*Port, error) // Returns Port by associated name. GetByName(context.Context, *Name) (*Port, error) // Finds nearest Port to given coordinates. FindNearest(context.Context, *Point) (*Port, error) // Finds all ports in given circle. FindInCircle(context.Context, *Circle) (*Ports, error) // Finds all ports each of which contains given text // in one of the fields: name, city, province, country. FindText(context.Context, *Quest) (*Ports, error) // contains filtered or unexported methods }
PortGuideServer is the server API for PortGuide service. All implementations must embed UnimplementedPortGuideServer for forward compatibility
type Ports ¶
type Ports struct { List []*Port `protobuf:"bytes,1,rep,name=list,proto3" json:"list,omitempty"` // contains filtered or unexported fields }
List on founded ports for given condition.
func (*Ports) Descriptor
deprecated
func (*Ports) ProtoMessage ¶
func (*Ports) ProtoMessage()
func (*Ports) ProtoReflect ¶
func (x *Ports) ProtoReflect() protoreflect.Message
type Quest ¶
type Quest struct { Value string `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"` Sensitive bool `protobuf:"varint,2,opt,name=sensitive,proto3" json:"sensitive,omitempty"` Whole bool `protobuf:"varint,3,opt,name=whole,proto3" json:"whole,omitempty"` // contains filtered or unexported fields }
Quest with text to find in object fields.
func (*Quest) Descriptor
deprecated
func (*Quest) GetSensitive ¶
func (*Quest) ProtoMessage ¶
func (*Quest) ProtoMessage()
func (*Quest) ProtoReflect ¶
func (x *Quest) ProtoReflect() protoreflect.Message
type Summary ¶
type Summary struct { // The number of ports received. PortCount int32 `protobuf:"varint,1,opt,name=port_count,json=portCount,proto3" json:"port_count,omitempty"` // The duration of the traversal in milliseconds. ElapsedTime int32 `protobuf:"varint,2,opt,name=elapsed_time,json=elapsedTime,proto3" json:"elapsed_time,omitempty"` // contains filtered or unexported fields }
Summary result of ports streaming.
func (*Summary) Descriptor
deprecated
func (*Summary) GetElapsedTime ¶
func (*Summary) GetPortCount ¶
func (*Summary) ProtoMessage ¶
func (*Summary) ProtoMessage()
func (*Summary) ProtoReflect ¶
func (x *Summary) ProtoReflect() protoreflect.Message
type ToolGuideClient ¶
type ToolGuideClient interface { // Check up service health. Ping(ctx context.Context, in *Content, opts ...grpc.CallOption) (*Content, error) }
ToolGuideClient is the client API for ToolGuide service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
func NewToolGuideClient ¶
func NewToolGuideClient(cc grpc.ClientConnInterface) ToolGuideClient
type ToolGuideServer ¶
type ToolGuideServer interface { // Check up service health. Ping(context.Context, *Content) (*Content, error) // contains filtered or unexported methods }
ToolGuideServer is the server API for ToolGuide service. All implementations must embed UnimplementedToolGuideServer for forward compatibility
type UnimplementedPortGuideServer ¶
type UnimplementedPortGuideServer struct { }
UnimplementedPortGuideServer must be embedded to have forward compatible implementations.
func (UnimplementedPortGuideServer) FindInCircle ¶
func (UnimplementedPortGuideServer) FindNearest ¶
func (UnimplementedPortGuideServer) RecordList ¶
func (UnimplementedPortGuideServer) RecordList(PortGuide_RecordListServer) error
type UnimplementedToolGuideServer ¶
type UnimplementedToolGuideServer struct { }
UnimplementedToolGuideServer must be embedded to have forward compatible implementations.
type UnsafePortGuideServer ¶
type UnsafePortGuideServer interface {
// contains filtered or unexported methods
}
UnsafePortGuideServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to PortGuideServer will result in compilation errors.
type UnsafeToolGuideServer ¶
type UnsafeToolGuideServer interface {
// contains filtered or unexported methods
}
UnsafeToolGuideServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to ToolGuideServer will result in compilation errors.