Documentation ¶
Overview ¶
Package time is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Variables
- func RegisterTimeHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterTimeHandlerClient(ctx context.Context, mux *runtime.ServeMux, client TimeClient) error
- func RegisterTimeHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterTimeHandlerServer(ctx context.Context, mux *runtime.ServeMux, server TimeServer) error
- func RegisterTimeServer(s grpc.ServiceRegistrar, srv TimeServer)
- type NowRequest
- type NowResponse
- type TimeClient
- type TimeServer
- type UnimplementedTimeServer
- type UnsafeTimeServer
Constants ¶
This section is empty.
Variables ¶
var File_time_v1_time_proto protoreflect.FileDescriptor
var Time_ServiceDesc = grpc.ServiceDesc{ ServiceName: "kzmake.time.v1.Time", HandlerType: (*TimeServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Now", Handler: _Time_Now_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "time/v1/time.proto", }
Time_ServiceDesc is the grpc.ServiceDesc for Time service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterTimeHandler ¶
RegisterTimeHandler registers the http handlers for service Time to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterTimeHandlerClient ¶
RegisterTimeHandlerClient registers the http handlers for service Time to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "TimeClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "TimeClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "TimeClient" to call the correct interceptors.
func RegisterTimeHandlerFromEndpoint ¶
func RegisterTimeHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterTimeHandlerFromEndpoint is same as RegisterTimeHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterTimeHandlerServer ¶
RegisterTimeHandlerServer registers the http handlers for service Time to "mux". UnaryRPC :call TimeServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterTimeHandlerFromEndpoint instead.
func RegisterTimeServer ¶
func RegisterTimeServer(s grpc.ServiceRegistrar, srv TimeServer)
Types ¶
type NowRequest ¶
type NowRequest struct {
// contains filtered or unexported fields
}
func (*NowRequest) Descriptor
deprecated
func (*NowRequest) Descriptor() ([]byte, []int)
Deprecated: Use NowRequest.ProtoReflect.Descriptor instead.
func (*NowRequest) ProtoMessage ¶
func (*NowRequest) ProtoMessage()
func (*NowRequest) ProtoReflect ¶
func (x *NowRequest) ProtoReflect() protoreflect.Message
func (*NowRequest) Reset ¶
func (x *NowRequest) Reset()
func (*NowRequest) String ¶
func (x *NowRequest) String() string
type NowResponse ¶
type NowResponse struct { Now string `protobuf:"bytes,1,opt,name=now,proto3" json:"now,omitempty"` // contains filtered or unexported fields }
func (*NowResponse) Descriptor
deprecated
func (*NowResponse) Descriptor() ([]byte, []int)
Deprecated: Use NowResponse.ProtoReflect.Descriptor instead.
func (*NowResponse) GetNow ¶
func (x *NowResponse) GetNow() string
func (*NowResponse) ProtoMessage ¶
func (*NowResponse) ProtoMessage()
func (*NowResponse) ProtoReflect ¶
func (x *NowResponse) ProtoReflect() protoreflect.Message
func (*NowResponse) Reset ¶
func (x *NowResponse) Reset()
func (*NowResponse) String ¶
func (x *NowResponse) String() string
type TimeClient ¶
type TimeClient interface {
Now(ctx context.Context, in *NowRequest, opts ...grpc.CallOption) (*NowResponse, error)
}
TimeClient is the client API for Time 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 NewTimeClient ¶
func NewTimeClient(cc grpc.ClientConnInterface) TimeClient
type TimeServer ¶
type TimeServer interface {
Now(context.Context, *NowRequest) (*NowResponse, error)
}
TimeServer is the server API for Time service. All implementations should embed UnimplementedTimeServer for forward compatibility
type UnimplementedTimeServer ¶
type UnimplementedTimeServer struct { }
UnimplementedTimeServer should be embedded to have forward compatible implementations.
func (UnimplementedTimeServer) Now ¶
func (UnimplementedTimeServer) Now(context.Context, *NowRequest) (*NowResponse, error)
type UnsafeTimeServer ¶
type UnsafeTimeServer interface {
// contains filtered or unexported methods
}
UnsafeTimeServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to TimeServer will result in compilation errors.