Documentation ¶
Overview ¶
Package schoolTimev1 is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Constants
- Variables
- func RegisterSchoolTimeServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterSchoolTimeServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client SchoolTimeServiceClient) error
- func RegisterSchoolTimeServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterSchoolTimeServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server SchoolTimeServiceServer) error
- func RegisterSchoolTimeServiceServer(s grpc.ServiceRegistrar, srv SchoolTimeServiceServer)
- type GetSchoolTimeResponse
- func (*GetSchoolTimeResponse) Descriptor() ([]byte, []int)deprecated
- func (x *GetSchoolTimeResponse) GetData() *SchoolTime
- func (x *GetSchoolTimeResponse) GetError() int32
- func (x *GetSchoolTimeResponse) GetMsg() string
- func (*GetSchoolTimeResponse) ProtoMessage()
- func (x *GetSchoolTimeResponse) ProtoReflect() protoreflect.Message
- func (x *GetSchoolTimeResponse) Reset()
- func (x *GetSchoolTimeResponse) String() string
- type GetSemesterListRequest
- func (*GetSemesterListRequest) Descriptor() ([]byte, []int)deprecated
- func (x *GetSemesterListRequest) GetEndDate() string
- func (x *GetSemesterListRequest) GetStartDate() string
- func (*GetSemesterListRequest) ProtoMessage()
- func (x *GetSemesterListRequest) ProtoReflect() protoreflect.Message
- func (x *GetSemesterListRequest) Reset()
- func (x *GetSemesterListRequest) String() string
- type GetSemesterListResponse
- func (*GetSemesterListResponse) Descriptor() ([]byte, []int)deprecated
- func (x *GetSemesterListResponse) GetData() []*SemesterInfo
- func (x *GetSemesterListResponse) GetError() int32
- func (x *GetSemesterListResponse) GetMsg() string
- func (*GetSemesterListResponse) ProtoMessage()
- func (x *GetSemesterListResponse) ProtoReflect() protoreflect.Message
- func (x *GetSemesterListResponse) Reset()
- func (x *GetSemesterListResponse) String() string
- type SchoolTime
- func (*SchoolTime) Descriptor() ([]byte, []int)deprecated
- func (x *SchoolTime) GetSchoolYear() string
- func (x *SchoolTime) GetSection() int32
- func (x *SchoolTime) GetSemester() string
- func (x *SchoolTime) GetTimeStamp() int64
- func (x *SchoolTime) GetWeekDayNow() int32
- func (x *SchoolTime) GetWeekNow() int32
- func (*SchoolTime) ProtoMessage()
- func (x *SchoolTime) ProtoReflect() protoreflect.Message
- func (x *SchoolTime) Reset()
- func (x *SchoolTime) String() string
- type SchoolTimeServiceClient
- type SchoolTimeServiceServer
- type SemesterInfo
- func (*SemesterInfo) Descriptor() ([]byte, []int)deprecated
- func (x *SemesterInfo) GetEndDate() string
- func (x *SemesterInfo) GetSchoolYear() string
- func (x *SemesterInfo) GetSemester() string
- func (x *SemesterInfo) GetStartDate() string
- func (x *SemesterInfo) GetState() int32
- func (*SemesterInfo) ProtoMessage()
- func (x *SemesterInfo) ProtoReflect() protoreflect.Message
- func (x *SemesterInfo) Reset()
- func (x *SemesterInfo) String() string
- type UnimplementedSchoolTimeServiceServer
- type UnsafeSchoolTimeServiceServer
Constants ¶
const ( SchoolTimeService_GetSchoolTime_FullMethodName = "/campusapis.schoolTime.v1.SchoolTimeService/GetSchoolTime" SchoolTimeService_GetSemesterList_FullMethodName = "/campusapis.schoolTime.v1.SchoolTimeService/GetSemesterList" )
Variables ¶
var File_campusapis_schoolTime_v1_school_time_proto protoreflect.FileDescriptor
var SchoolTimeService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "campusapis.schoolTime.v1.SchoolTimeService", HandlerType: (*SchoolTimeServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "GetSchoolTime", Handler: _SchoolTimeService_GetSchoolTime_Handler, }, { MethodName: "GetSemesterList", Handler: _SchoolTimeService_GetSemesterList_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "campusapis/schoolTime/v1/school_time.proto", }
SchoolTimeService_ServiceDesc is the grpc.ServiceDesc for SchoolTimeService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterSchoolTimeServiceHandler ¶
func RegisterSchoolTimeServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
RegisterSchoolTimeServiceHandler registers the http handlers for service SchoolTimeService to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterSchoolTimeServiceHandlerClient ¶
func RegisterSchoolTimeServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client SchoolTimeServiceClient) error
RegisterSchoolTimeServiceHandlerClient registers the http handlers for service SchoolTimeService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "SchoolTimeServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "SchoolTimeServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "SchoolTimeServiceClient" to call the correct interceptors. This client ignores the HTTP middlewares.
func RegisterSchoolTimeServiceHandlerFromEndpoint ¶
func RegisterSchoolTimeServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterSchoolTimeServiceHandlerFromEndpoint is same as RegisterSchoolTimeServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterSchoolTimeServiceHandlerServer ¶
func RegisterSchoolTimeServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server SchoolTimeServiceServer) error
RegisterSchoolTimeServiceHandlerServer registers the http handlers for service SchoolTimeService to "mux". UnaryRPC :call SchoolTimeServiceServer 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 RegisterSchoolTimeServiceHandlerFromEndpoint instead. GRPC interceptors will not work for this type of registration. To use interceptors, you must use the "runtime.WithMiddlewares" option in the "runtime.NewServeMux" call.
func RegisterSchoolTimeServiceServer ¶
func RegisterSchoolTimeServiceServer(s grpc.ServiceRegistrar, srv SchoolTimeServiceServer)
Types ¶
type GetSchoolTimeResponse ¶
type GetSchoolTimeResponse 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 *SchoolTime `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"` // contains filtered or unexported fields }
func (*GetSchoolTimeResponse) Descriptor
deprecated
func (*GetSchoolTimeResponse) Descriptor() ([]byte, []int)
Deprecated: Use GetSchoolTimeResponse.ProtoReflect.Descriptor instead.
func (*GetSchoolTimeResponse) GetData ¶
func (x *GetSchoolTimeResponse) GetData() *SchoolTime
func (*GetSchoolTimeResponse) GetError ¶
func (x *GetSchoolTimeResponse) GetError() int32
func (*GetSchoolTimeResponse) GetMsg ¶
func (x *GetSchoolTimeResponse) GetMsg() string
func (*GetSchoolTimeResponse) ProtoMessage ¶
func (*GetSchoolTimeResponse) ProtoMessage()
func (*GetSchoolTimeResponse) ProtoReflect ¶
func (x *GetSchoolTimeResponse) ProtoReflect() protoreflect.Message
func (*GetSchoolTimeResponse) Reset ¶
func (x *GetSchoolTimeResponse) Reset()
func (*GetSchoolTimeResponse) String ¶
func (x *GetSchoolTimeResponse) String() string
type GetSemesterListRequest ¶
type GetSemesterListRequest struct { StartDate string `protobuf:"bytes,1,opt,name=startDate,proto3" json:"startDate,omitempty"` EndDate string `protobuf:"bytes,2,opt,name=endDate,proto3" json:"endDate,omitempty"` // contains filtered or unexported fields }
func (*GetSemesterListRequest) Descriptor
deprecated
func (*GetSemesterListRequest) Descriptor() ([]byte, []int)
Deprecated: Use GetSemesterListRequest.ProtoReflect.Descriptor instead.
func (*GetSemesterListRequest) GetEndDate ¶
func (x *GetSemesterListRequest) GetEndDate() string
func (*GetSemesterListRequest) GetStartDate ¶
func (x *GetSemesterListRequest) GetStartDate() string
func (*GetSemesterListRequest) ProtoMessage ¶
func (*GetSemesterListRequest) ProtoMessage()
func (*GetSemesterListRequest) ProtoReflect ¶
func (x *GetSemesterListRequest) ProtoReflect() protoreflect.Message
func (*GetSemesterListRequest) Reset ¶
func (x *GetSemesterListRequest) Reset()
func (*GetSemesterListRequest) String ¶
func (x *GetSemesterListRequest) String() string
type GetSemesterListResponse ¶
type GetSemesterListResponse 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 []*SemesterInfo `protobuf:"bytes,3,rep,name=data,proto3" json:"data,omitempty"` // contains filtered or unexported fields }
func (*GetSemesterListResponse) Descriptor
deprecated
func (*GetSemesterListResponse) Descriptor() ([]byte, []int)
Deprecated: Use GetSemesterListResponse.ProtoReflect.Descriptor instead.
func (*GetSemesterListResponse) GetData ¶
func (x *GetSemesterListResponse) GetData() []*SemesterInfo
func (*GetSemesterListResponse) GetError ¶
func (x *GetSemesterListResponse) GetError() int32
func (*GetSemesterListResponse) GetMsg ¶
func (x *GetSemesterListResponse) GetMsg() string
func (*GetSemesterListResponse) ProtoMessage ¶
func (*GetSemesterListResponse) ProtoMessage()
func (*GetSemesterListResponse) ProtoReflect ¶
func (x *GetSemesterListResponse) ProtoReflect() protoreflect.Message
func (*GetSemesterListResponse) Reset ¶
func (x *GetSemesterListResponse) Reset()
func (*GetSemesterListResponse) String ¶
func (x *GetSemesterListResponse) String() string
type SchoolTime ¶
type SchoolTime struct { SchoolYear string `protobuf:"bytes,1,opt,name=schoolYear,proto3" json:"schoolYear,omitempty"` Section int32 `protobuf:"varint,2,opt,name=section,proto3" json:"section,omitempty"` Semester string `protobuf:"bytes,3,opt,name=semester,proto3" json:"semester,omitempty"` TimeStamp int64 `protobuf:"varint,4,opt,name=timeStamp,proto3" json:"timeStamp,omitempty"` WeekDayNow int32 `protobuf:"varint,5,opt,name=weekDayNow,proto3" json:"weekDayNow,omitempty"` WeekNow int32 `protobuf:"varint,6,opt,name=weekNow,proto3" json:"weekNow,omitempty"` // contains filtered or unexported fields }
func (*SchoolTime) Descriptor
deprecated
func (*SchoolTime) Descriptor() ([]byte, []int)
Deprecated: Use SchoolTime.ProtoReflect.Descriptor instead.
func (*SchoolTime) GetSchoolYear ¶
func (x *SchoolTime) GetSchoolYear() string
func (*SchoolTime) GetSection ¶
func (x *SchoolTime) GetSection() int32
func (*SchoolTime) GetSemester ¶
func (x *SchoolTime) GetSemester() string
func (*SchoolTime) GetTimeStamp ¶
func (x *SchoolTime) GetTimeStamp() int64
func (*SchoolTime) GetWeekDayNow ¶
func (x *SchoolTime) GetWeekDayNow() int32
func (*SchoolTime) GetWeekNow ¶
func (x *SchoolTime) GetWeekNow() int32
func (*SchoolTime) ProtoMessage ¶
func (*SchoolTime) ProtoMessage()
func (*SchoolTime) ProtoReflect ¶
func (x *SchoolTime) ProtoReflect() protoreflect.Message
func (*SchoolTime) Reset ¶
func (x *SchoolTime) Reset()
func (*SchoolTime) String ¶
func (x *SchoolTime) String() string
type SchoolTimeServiceClient ¶
type SchoolTimeServiceClient interface { // 获取当前学校时间 GetSchoolTime(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*GetSchoolTimeResponse, error) // 获取学校学期信息列表 GetSemesterList(ctx context.Context, in *GetSemesterListRequest, opts ...grpc.CallOption) (*GetSemesterListResponse, error) }
SchoolTimeServiceClient is the client API for SchoolTimeService 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 NewSchoolTimeServiceClient ¶
func NewSchoolTimeServiceClient(cc grpc.ClientConnInterface) SchoolTimeServiceClient
type SchoolTimeServiceServer ¶
type SchoolTimeServiceServer interface { // 获取当前学校时间 GetSchoolTime(context.Context, *emptypb.Empty) (*GetSchoolTimeResponse, error) // 获取学校学期信息列表 GetSemesterList(context.Context, *GetSemesterListRequest) (*GetSemesterListResponse, error) // contains filtered or unexported methods }
SchoolTimeServiceServer is the server API for SchoolTimeService service. All implementations must embed UnimplementedSchoolTimeServiceServer for forward compatibility.
type SemesterInfo ¶
type SemesterInfo 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"` StartDate string `protobuf:"bytes,3,opt,name=startDate,proto3" json:"startDate,omitempty"` EndDate string `protobuf:"bytes,4,opt,name=endDate,proto3" json:"endDate,omitempty"` State int32 `protobuf:"varint,5,opt,name=state,proto3" json:"state,omitempty"` // contains filtered or unexported fields }
func (*SemesterInfo) Descriptor
deprecated
func (*SemesterInfo) Descriptor() ([]byte, []int)
Deprecated: Use SemesterInfo.ProtoReflect.Descriptor instead.
func (*SemesterInfo) GetEndDate ¶
func (x *SemesterInfo) GetEndDate() string
func (*SemesterInfo) GetSchoolYear ¶
func (x *SemesterInfo) GetSchoolYear() string
func (*SemesterInfo) GetSemester ¶
func (x *SemesterInfo) GetSemester() string
func (*SemesterInfo) GetStartDate ¶
func (x *SemesterInfo) GetStartDate() string
func (*SemesterInfo) GetState ¶
func (x *SemesterInfo) GetState() int32
func (*SemesterInfo) ProtoMessage ¶
func (*SemesterInfo) ProtoMessage()
func (*SemesterInfo) ProtoReflect ¶
func (x *SemesterInfo) ProtoReflect() protoreflect.Message
func (*SemesterInfo) Reset ¶
func (x *SemesterInfo) Reset()
func (*SemesterInfo) String ¶
func (x *SemesterInfo) String() string
type UnimplementedSchoolTimeServiceServer ¶
type UnimplementedSchoolTimeServiceServer struct{}
UnimplementedSchoolTimeServiceServer must be embedded to have forward compatible implementations.
NOTE: this should be embedded by value instead of pointer to avoid a nil pointer dereference when methods are called.
func (UnimplementedSchoolTimeServiceServer) GetSchoolTime ¶
func (UnimplementedSchoolTimeServiceServer) GetSchoolTime(context.Context, *emptypb.Empty) (*GetSchoolTimeResponse, error)
func (UnimplementedSchoolTimeServiceServer) GetSemesterList ¶
func (UnimplementedSchoolTimeServiceServer) GetSemesterList(context.Context, *GetSemesterListRequest) (*GetSemesterListResponse, error)
type UnsafeSchoolTimeServiceServer ¶
type UnsafeSchoolTimeServiceServer interface {
// contains filtered or unexported methods
}
UnsafeSchoolTimeServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to SchoolTimeServiceServer will result in compilation errors.