Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var File_proto_template_proto protoreflect.FileDescriptor
var TimeSync_ServiceDesc = grpc.ServiceDesc{ ServiceName: "proto.TimeSync", HandlerType: (*TimeSyncServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Ping", Handler: _TimeSync_Ping_Handler, }, { MethodName: "GetTime", Handler: _TimeSync_GetTime_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "proto/template.proto", }
TimeSync_ServiceDesc is the grpc.ServiceDesc for TimeSync service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterTimeSyncServer ¶
func RegisterTimeSyncServer(s grpc.ServiceRegistrar, srv TimeSyncServer)
Types ¶
type Ack ¶
type Ack struct { ClientName string `protobuf:"bytes,1,opt,name=ClientName,proto3" json:"ClientName,omitempty"` // contains filtered or unexported fields }
func (*Ack) Descriptor
deprecated
func (*Ack) GetClientName ¶
func (*Ack) ProtoMessage ¶
func (*Ack) ProtoMessage()
func (*Ack) ProtoReflect ¶
func (x *Ack) ProtoReflect() protoreflect.Message
type Time ¶
type Time struct { T1 *timestamppb.Timestamp `protobuf:"bytes,1,opt,name=T1,proto3" json:"T1,omitempty"` T2 *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=T2,proto3" json:"T2,omitempty"` // contains filtered or unexported fields }
func (*Time) Descriptor
deprecated
func (*Time) GetT1 ¶
func (x *Time) GetT1() *timestamppb.Timestamp
func (*Time) GetT2 ¶
func (x *Time) GetT2() *timestamppb.Timestamp
func (*Time) ProtoMessage ¶
func (*Time) ProtoMessage()
func (*Time) ProtoReflect ¶
func (x *Time) ProtoReflect() protoreflect.Message
type TimeSyncClient ¶
type TimeSyncClient interface { Ping(ctx context.Context, in *Ack, opts ...grpc.CallOption) (*Ack, error) GetTime(ctx context.Context, in *Ack, opts ...grpc.CallOption) (*Time, error) }
TimeSyncClient is the client API for TimeSync 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 NewTimeSyncClient ¶
func NewTimeSyncClient(cc grpc.ClientConnInterface) TimeSyncClient
type TimeSyncServer ¶
type TimeSyncServer interface { Ping(context.Context, *Ack) (*Ack, error) GetTime(context.Context, *Ack) (*Time, error) // contains filtered or unexported methods }
TimeSyncServer is the server API for TimeSync service. All implementations must embed UnimplementedTimeSyncServer for forward compatibility
type UnimplementedTimeSyncServer ¶
type UnimplementedTimeSyncServer struct { }
UnimplementedTimeSyncServer must be embedded to have forward compatible implementations.
type UnsafeTimeSyncServer ¶
type UnsafeTimeSyncServer interface {
// contains filtered or unexported methods
}
UnsafeTimeSyncServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to TimeSyncServer will result in compilation errors.