timev1

package
v0.0.0-...-a9153d3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 3, 2024 License: MIT Imports: 17 Imported by: 0

Documentation

Overview

Package timev1 is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

View Source
const (
	TimeService_GetTime_FullMethodName = "/aggregatingapis.time.v1.TimeService/GetTime"
)

Variables

View Source
var File_aggregatingapis_time_v1_time_proto protoreflect.FileDescriptor
View Source
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) Descriptor() ([]byte, []int)

Deprecated: Use TimeData.ProtoReflect.Descriptor instead.

func (*TimeData) GetExamSchoolYear

func (x *TimeData) GetExamSchoolYear() int32

func (*TimeData) GetExamSemester

func (x *TimeData) GetExamSemester() int32

func (*TimeData) GetScheduleSchoolYear

func (x *TimeData) GetScheduleSchoolYear() int32

func (*TimeData) GetScheduleSemester

func (x *TimeData) GetScheduleSemester() int32

func (*TimeData) GetSchoolYear

func (x *TimeData) GetSchoolYear() string

func (*TimeData) GetScoreSchoolYear

func (x *TimeData) GetScoreSchoolYear() int32

func (*TimeData) GetScoreSemester

func (x *TimeData) GetScoreSemester() int32

func (*TimeData) GetSection

func (x *TimeData) GetSection() int32

func (*TimeData) GetSemester

func (x *TimeData) GetSemester() string

func (*TimeData) GetSemesterStartTimestamp

func (x *TimeData) GetSemesterStartTimestamp() int64

func (*TimeData) GetTimestamp

func (x *TimeData) GetTimestamp() int32

func (*TimeData) GetWeekDayNow

func (x *TimeData) GetWeekDayNow() int32

func (*TimeData) GetWeekNow

func (x *TimeData) GetWeekNow() int32

func (*TimeData) ProtoMessage

func (*TimeData) ProtoMessage()

func (*TimeData) ProtoReflect

func (x *TimeData) ProtoReflect() protoreflect.Message

func (*TimeData) Reset

func (x *TimeData) Reset()

func (*TimeData) String

func (x *TimeData) String() string

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.

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

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL