Documentation ¶
Index ¶
- Variables
- func RegisterTimeServiceServer(s grpc.ServiceRegistrar, srv TimeServiceServer)
- type Time
- func (*Time) Descriptor() ([]byte, []int)deprecated
- func (x *Time) GetLocaltime() *timestamppb.Timestamp
- func (x *Time) GetMetadata() *common.Metadata
- func (x *Time) GetRemotetime() *timestamppb.Timestamp
- func (x *Time) GetServer() string
- func (m *Time) MarshalToSizedBufferVT(dAtA []byte) (int, error)
- func (m *Time) MarshalToVT(dAtA []byte) (int, error)
- func (m *Time) MarshalVT() (dAtA []byte, err error)
- func (*Time) ProtoMessage()
- func (x *Time) ProtoReflect() protoreflect.Message
- func (x *Time) Reset()
- func (m *Time) SizeVT() (n int)
- func (x *Time) String() string
- func (m *Time) UnmarshalVT(dAtA []byte) error
- type TimeRequest
- func (*TimeRequest) Descriptor() ([]byte, []int)deprecated
- func (x *TimeRequest) GetServer() string
- func (m *TimeRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error)
- func (m *TimeRequest) MarshalToVT(dAtA []byte) (int, error)
- func (m *TimeRequest) MarshalVT() (dAtA []byte, err error)
- func (*TimeRequest) ProtoMessage()
- func (x *TimeRequest) ProtoReflect() protoreflect.Message
- func (x *TimeRequest) Reset()
- func (m *TimeRequest) SizeVT() (n int)
- func (x *TimeRequest) String() string
- func (m *TimeRequest) UnmarshalVT(dAtA []byte) error
- type TimeResponse
- func (*TimeResponse) Descriptor() ([]byte, []int)deprecated
- func (x *TimeResponse) GetMessages() []*Time
- func (m *TimeResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error)
- func (m *TimeResponse) MarshalToVT(dAtA []byte) (int, error)
- func (m *TimeResponse) MarshalVT() (dAtA []byte, err error)
- func (*TimeResponse) ProtoMessage()
- func (x *TimeResponse) ProtoReflect() protoreflect.Message
- func (x *TimeResponse) Reset()
- func (m *TimeResponse) SizeVT() (n int)
- func (x *TimeResponse) String() string
- func (m *TimeResponse) UnmarshalVT(dAtA []byte) error
- type TimeServiceClient
- type TimeServiceServer
- type UnimplementedTimeServiceServer
- type UnsafeTimeServiceServer
Constants ¶
This section is empty.
Variables ¶
var ( ErrInvalidLength = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflow = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroup = fmt.Errorf("proto: unexpected end of group") )
var File_time_time_proto protoreflect.FileDescriptor
var TimeService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "time.TimeService", HandlerType: (*TimeServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Time", Handler: _TimeService_Time_Handler, }, { MethodName: "TimeCheck", Handler: _TimeService_TimeCheck_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "time/time.proto", }
TimeService_ServiceDesc is the grpc.ServiceDesc for TimeService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterTimeServiceServer ¶
func RegisterTimeServiceServer(s grpc.ServiceRegistrar, srv TimeServiceServer)
Types ¶
type Time ¶
type Time struct { Metadata *common.Metadata `protobuf:"bytes,1,opt,name=metadata,proto3" json:"metadata,omitempty"` Server string `protobuf:"bytes,2,opt,name=server,proto3" json:"server,omitempty"` Localtime *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=localtime,proto3" json:"localtime,omitempty"` Remotetime *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=remotetime,proto3" json:"remotetime,omitempty"` // contains filtered or unexported fields }
func (*Time) Descriptor
deprecated
func (*Time) GetLocaltime ¶
func (x *Time) GetLocaltime() *timestamppb.Timestamp
func (*Time) GetMetadata ¶
func (*Time) GetRemotetime ¶
func (x *Time) GetRemotetime() *timestamppb.Timestamp
func (*Time) MarshalToSizedBufferVT ¶ added in v0.12.0
func (*Time) ProtoMessage ¶
func (*Time) ProtoMessage()
func (*Time) ProtoReflect ¶
func (x *Time) ProtoReflect() protoreflect.Message
func (*Time) UnmarshalVT ¶ added in v0.12.0
type TimeRequest ¶
type TimeRequest struct { Server string `protobuf:"bytes,1,opt,name=server,proto3" json:"server,omitempty"` // contains filtered or unexported fields }
The response message containing the ntp server
func (*TimeRequest) Descriptor
deprecated
func (*TimeRequest) Descriptor() ([]byte, []int)
Deprecated: Use TimeRequest.ProtoReflect.Descriptor instead.
func (*TimeRequest) GetServer ¶
func (x *TimeRequest) GetServer() string
func (*TimeRequest) MarshalToSizedBufferVT ¶ added in v0.12.0
func (m *TimeRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error)
func (*TimeRequest) MarshalToVT ¶ added in v0.12.0
func (m *TimeRequest) MarshalToVT(dAtA []byte) (int, error)
func (*TimeRequest) MarshalVT ¶ added in v0.12.0
func (m *TimeRequest) MarshalVT() (dAtA []byte, err error)
func (*TimeRequest) ProtoMessage ¶
func (*TimeRequest) ProtoMessage()
func (*TimeRequest) ProtoReflect ¶
func (x *TimeRequest) ProtoReflect() protoreflect.Message
func (*TimeRequest) Reset ¶
func (x *TimeRequest) Reset()
func (*TimeRequest) SizeVT ¶ added in v0.12.0
func (m *TimeRequest) SizeVT() (n int)
func (*TimeRequest) String ¶
func (x *TimeRequest) String() string
func (*TimeRequest) UnmarshalVT ¶ added in v0.12.0
func (m *TimeRequest) UnmarshalVT(dAtA []byte) error
type TimeResponse ¶
type TimeResponse struct { Messages []*Time `protobuf:"bytes,1,rep,name=messages,proto3" json:"messages,omitempty"` // contains filtered or unexported fields }
The response message containing the ntp server, time, and offset
func (*TimeResponse) Descriptor
deprecated
func (*TimeResponse) Descriptor() ([]byte, []int)
Deprecated: Use TimeResponse.ProtoReflect.Descriptor instead.
func (*TimeResponse) GetMessages ¶
func (x *TimeResponse) GetMessages() []*Time
func (*TimeResponse) MarshalToSizedBufferVT ¶ added in v0.12.0
func (m *TimeResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error)
func (*TimeResponse) MarshalToVT ¶ added in v0.12.0
func (m *TimeResponse) MarshalToVT(dAtA []byte) (int, error)
func (*TimeResponse) MarshalVT ¶ added in v0.12.0
func (m *TimeResponse) MarshalVT() (dAtA []byte, err error)
func (*TimeResponse) ProtoMessage ¶
func (*TimeResponse) ProtoMessage()
func (*TimeResponse) ProtoReflect ¶
func (x *TimeResponse) ProtoReflect() protoreflect.Message
func (*TimeResponse) Reset ¶
func (x *TimeResponse) Reset()
func (*TimeResponse) SizeVT ¶ added in v0.12.0
func (m *TimeResponse) SizeVT() (n int)
func (*TimeResponse) String ¶
func (x *TimeResponse) String() string
func (*TimeResponse) UnmarshalVT ¶ added in v0.12.0
func (m *TimeResponse) UnmarshalVT(dAtA []byte) error
type TimeServiceClient ¶
type TimeServiceClient interface { Time(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*TimeResponse, error) TimeCheck(ctx context.Context, in *TimeRequest, opts ...grpc.CallOption) (*TimeResponse, error) }
TimeServiceClient is the client API for TimeService 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 NewTimeServiceClient ¶
func NewTimeServiceClient(cc grpc.ClientConnInterface) TimeServiceClient
type TimeServiceServer ¶
type TimeServiceServer interface { Time(context.Context, *emptypb.Empty) (*TimeResponse, error) TimeCheck(context.Context, *TimeRequest) (*TimeResponse, error) // contains filtered or unexported methods }
TimeServiceServer is the server API for TimeService service. All implementations must embed UnimplementedTimeServiceServer for forward compatibility
type UnimplementedTimeServiceServer ¶
type UnimplementedTimeServiceServer struct { }
UnimplementedTimeServiceServer must be embedded to have forward compatible implementations.
func (UnimplementedTimeServiceServer) Time ¶
func (UnimplementedTimeServiceServer) Time(context.Context, *emptypb.Empty) (*TimeResponse, error)
func (UnimplementedTimeServiceServer) TimeCheck ¶
func (UnimplementedTimeServiceServer) TimeCheck(context.Context, *TimeRequest) (*TimeResponse, error)
type UnsafeTimeServiceServer ¶
type UnsafeTimeServiceServer interface {
// contains filtered or unexported methods
}
UnsafeTimeServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to TimeServiceServer will result in compilation errors.