Documentation ¶
Overview ¶
Package timev1 is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Constants
- Variables
- func RegisterTimeServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterTimeServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client TimeServiceClient) error
- func RegisterTimeServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterTimeServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server TimeServiceServer) error
- func RegisterTimeServiceServer(s grpc.ServiceRegistrar, srv TimeServiceServer)
- type GetTimeResponse
- func (*GetTimeResponse) Descriptor() ([]byte, []int)deprecated
- func (x *GetTimeResponse) GetData() *TimeData
- func (x *GetTimeResponse) GetError() int32
- func (x *GetTimeResponse) GetMsg() string
- func (*GetTimeResponse) ProtoMessage()
- func (x *GetTimeResponse) ProtoReflect() protoreflect.Message
- func (x *GetTimeResponse) Reset()
- func (x *GetTimeResponse) String() string
- type TimeData
- func (*TimeData) Descriptor() ([]byte, []int)deprecated
- func (x *TimeData) GetExamSchoolYear() int32
- func (x *TimeData) GetExamSemester() int32
- func (x *TimeData) GetScheduleSchoolYear() int32
- func (x *TimeData) GetScheduleSemester() int32
- func (x *TimeData) GetSchoolYear() string
- func (x *TimeData) GetScoreSchoolYear() int32
- func (x *TimeData) GetScoreSemester() int32
- func (x *TimeData) GetSection() int32
- func (x *TimeData) GetSemester() string
- func (x *TimeData) GetSemesterStartTimestamp() int64
- func (x *TimeData) GetTimestamp() int32
- func (x *TimeData) GetWeekDayNow() int32
- func (x *TimeData) GetWeekNow() int32
- func (*TimeData) ProtoMessage()
- func (x *TimeData) ProtoReflect() protoreflect.Message
- func (x *TimeData) Reset()
- func (x *TimeData) String() string
- type TimeServiceClient
- type TimeServiceServer
- type UnimplementedTimeServiceServer
- type UnsafeTimeServiceServer
Constants ¶
const (
TimeService_GetTime_FullMethodName = "/aggregatingapis.time.v1.TimeService/GetTime"
)
Variables ¶
var File_aggregatingapis_time_v1_time_proto protoreflect.FileDescriptor
var TimeService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "aggregatingapis.time.v1.TimeService", HandlerType: (*TimeServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "GetTime", Handler: _TimeService_GetTime_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "aggregatingapis/time/v1/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 RegisterTimeServiceHandler ¶
func RegisterTimeServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
RegisterTimeServiceHandler registers the http handlers for service TimeService to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterTimeServiceHandlerClient ¶
func RegisterTimeServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client TimeServiceClient) error
RegisterTimeServiceHandlerClient registers the http handlers for service TimeService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "TimeServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "TimeServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "TimeServiceClient" to call the correct interceptors.
func RegisterTimeServiceHandlerFromEndpoint ¶
func RegisterTimeServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterTimeServiceHandlerFromEndpoint is same as RegisterTimeServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterTimeServiceHandlerServer ¶
func RegisterTimeServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server TimeServiceServer) error
RegisterTimeServiceHandlerServer registers the http handlers for service TimeService to "mux". UnaryRPC :call TimeServiceServer 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 RegisterTimeServiceHandlerFromEndpoint instead.
func RegisterTimeServiceServer ¶
func RegisterTimeServiceServer(s grpc.ServiceRegistrar, srv TimeServiceServer)
Types ¶
type GetTimeResponse ¶
type GetTimeResponse struct { Error int32 `protobuf:"varint,1,opt,name=error,proto3" json:"error,omitempty"` Msg string `protobuf:"bytes,2,opt,name=msg,proto3" json:"msg,omitempty"` Data *TimeData `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"` // contains filtered or unexported fields }
func (*GetTimeResponse) Descriptor
deprecated
func (*GetTimeResponse) Descriptor() ([]byte, []int)
Deprecated: Use GetTimeResponse.ProtoReflect.Descriptor instead.
func (*GetTimeResponse) GetData ¶
func (x *GetTimeResponse) GetData() *TimeData
func (*GetTimeResponse) GetError ¶
func (x *GetTimeResponse) GetError() int32
func (*GetTimeResponse) GetMsg ¶
func (x *GetTimeResponse) GetMsg() string
func (*GetTimeResponse) ProtoMessage ¶
func (*GetTimeResponse) ProtoMessage()
func (*GetTimeResponse) ProtoReflect ¶
func (x *GetTimeResponse) ProtoReflect() protoreflect.Message
func (*GetTimeResponse) Reset ¶
func (x *GetTimeResponse) Reset()
func (*GetTimeResponse) String ¶
func (x *GetTimeResponse) String() string
type TimeData ¶
type TimeData struct { SchoolYear string `protobuf:"bytes,1,opt,name=schoolYear,proto3" json:"schoolYear,omitempty"` Semester string `protobuf:"bytes,2,opt,name=semester,proto3" json:"semester,omitempty"` SemesterStartTimestamp int64 `protobuf:"varint,3,opt,name=semesterStartTimestamp,proto3" json:"semesterStartTimestamp,omitempty"` WeekNow int32 `protobuf:"varint,4,opt,name=weekNow,proto3" json:"weekNow,omitempty"` WeekDayNow int32 `protobuf:"varint,5,opt,name=weekDayNow,proto3" json:"weekDayNow,omitempty"` Timestamp int32 `protobuf:"varint,6,opt,name=timestamp,proto3" json:"timestamp,omitempty"` Section int32 `protobuf:"varint,7,opt,name=section,proto3" json:"section,omitempty"` ScheduleSchoolYear int32 `protobuf:"varint,8,opt,name=scheduleSchoolYear,proto3" json:"scheduleSchoolYear,omitempty"` ScheduleSemester int32 `protobuf:"varint,9,opt,name=scheduleSemester,proto3" json:"scheduleSemester,omitempty"` ExamSchoolYear int32 `protobuf:"varint,10,opt,name=examSchoolYear,proto3" json:"examSchoolYear,omitempty"` ExamSemester int32 `protobuf:"varint,11,opt,name=examSemester,proto3" json:"examSemester,omitempty"` ScoreSchoolYear int32 `protobuf:"varint,12,opt,name=scoreSchoolYear,proto3" json:"scoreSchoolYear,omitempty"` ScoreSemester int32 `protobuf:"varint,13,opt,name=scoreSemester,proto3" json:"scoreSemester,omitempty"` // contains filtered or unexported fields }
func (*TimeData) Descriptor
deprecated
func (*TimeData) GetExamSchoolYear ¶
func (*TimeData) GetExamSemester ¶
func (*TimeData) GetScheduleSchoolYear ¶
func (*TimeData) GetScheduleSemester ¶
func (*TimeData) GetSchoolYear ¶
func (*TimeData) GetScoreSchoolYear ¶
func (*TimeData) GetScoreSemester ¶
func (*TimeData) GetSection ¶
func (*TimeData) GetSemester ¶
func (*TimeData) GetSemesterStartTimestamp ¶
func (*TimeData) GetTimestamp ¶
func (*TimeData) GetWeekDayNow ¶
func (*TimeData) GetWeekNow ¶
func (*TimeData) ProtoMessage ¶
func (*TimeData) ProtoMessage()
func (*TimeData) ProtoReflect ¶
func (x *TimeData) ProtoReflect() protoreflect.Message
type TimeServiceClient ¶
type TimeServiceClient interface {
GetTime(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*GetTimeResponse, 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 { GetTime(context.Context, *emptypb.Empty) (*GetTimeResponse, 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) GetTime ¶
func (UnimplementedTimeServiceServer) GetTime(context.Context, *emptypb.Empty) (*GetTimeResponse, 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.