Documentation ¶
Index ¶
- Variables
- func RegisterCourseServiceServer(s grpc.ServiceRegistrar, srv CourseServiceServer)
- type Course
- func (*Course) Descriptor() ([]byte, []int)deprecated
- func (x *Course) GetDescription() string
- func (x *Course) GetId() uint64
- func (x *Course) GetName() string
- func (x *Course) GetStudents() []uint64
- func (x *Course) GetTeacher() uint64
- func (*Course) ProtoMessage()
- func (x *Course) ProtoReflect() protoreflect.Message
- func (x *Course) Reset()
- func (x *Course) String() string
- type CourseId
- type CourseServiceClient
- type CourseServiceServer
- type CoursesResponse
- type Empty
- type MessageResponse
- type StudentCourseIdRequest
- func (*StudentCourseIdRequest) Descriptor() ([]byte, []int)deprecated
- func (x *StudentCourseIdRequest) GetCourseId() uint64
- func (x *StudentCourseIdRequest) GetStudentId() uint64
- func (*StudentCourseIdRequest) ProtoMessage()
- func (x *StudentCourseIdRequest) ProtoReflect() protoreflect.Message
- func (x *StudentCourseIdRequest) Reset()
- func (x *StudentCourseIdRequest) String() string
- type UnimplementedCourseServiceServer
- func (UnimplementedCourseServiceServer) AddCourse(context.Context, *Course) (*CourseId, error)
- func (UnimplementedCourseServiceServer) AddStudentsToCourse(context.Context, *StudentCourseIdRequest) (*MessageResponse, error)
- func (UnimplementedCourseServiceServer) DeleteCourse(context.Context, *CourseId) (*MessageResponse, error)
- func (UnimplementedCourseServiceServer) GetCourses(context.Context, *Empty) (*CoursesResponse, error)
- func (UnimplementedCourseServiceServer) RemoveStudentsFromCourse(context.Context, *StudentCourseIdRequest) (*MessageResponse, error)
- type UnsafeCourseServiceServer
Constants ¶
This section is empty.
Variables ¶
var CourseService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "CourseService", HandlerType: (*CourseServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "GetCourses", Handler: _CourseService_GetCourses_Handler, }, { MethodName: "AddCourse", Handler: _CourseService_AddCourse_Handler, }, { MethodName: "DeleteCourse", Handler: _CourseService_DeleteCourse_Handler, }, { MethodName: "AddStudentsToCourse", Handler: _CourseService_AddStudentsToCourse_Handler, }, { MethodName: "RemoveStudentsFromCourse", Handler: _CourseService_RemoveStudentsFromCourse_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "course/course.proto", }
CourseService_ServiceDesc is the grpc.ServiceDesc for CourseService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
var File_course_course_proto protoreflect.FileDescriptor
Functions ¶
func RegisterCourseServiceServer ¶
func RegisterCourseServiceServer(s grpc.ServiceRegistrar, srv CourseServiceServer)
Types ¶
type Course ¶
type Course struct { Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` Teacher uint64 `protobuf:"varint,4,opt,name=teacher,proto3" json:"teacher,omitempty"` Students []uint64 `protobuf:"varint,5,rep,packed,name=students,proto3" json:"students,omitempty"` // contains filtered or unexported fields }
func (*Course) Descriptor
deprecated
func (*Course) GetDescription ¶
func (*Course) GetStudents ¶
func (*Course) GetTeacher ¶
func (*Course) ProtoMessage ¶
func (*Course) ProtoMessage()
func (*Course) ProtoReflect ¶
func (x *Course) ProtoReflect() protoreflect.Message
type CourseId ¶
type CourseId struct { CourseId uint64 `protobuf:"varint,1,opt,name=courseId,proto3" json:"courseId,omitempty"` // contains filtered or unexported fields }
func (*CourseId) Descriptor
deprecated
func (*CourseId) GetCourseId ¶
func (*CourseId) ProtoMessage ¶
func (*CourseId) ProtoMessage()
func (*CourseId) ProtoReflect ¶
func (x *CourseId) ProtoReflect() protoreflect.Message
type CourseServiceClient ¶
type CourseServiceClient interface { GetCourses(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*CoursesResponse, error) AddCourse(ctx context.Context, in *Course, opts ...grpc.CallOption) (*CourseId, error) DeleteCourse(ctx context.Context, in *CourseId, opts ...grpc.CallOption) (*MessageResponse, error) AddStudentsToCourse(ctx context.Context, in *StudentCourseIdRequest, opts ...grpc.CallOption) (*MessageResponse, error) RemoveStudentsFromCourse(ctx context.Context, in *StudentCourseIdRequest, opts ...grpc.CallOption) (*MessageResponse, error) }
CourseServiceClient is the client API for CourseService 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 NewCourseServiceClient ¶
func NewCourseServiceClient(cc grpc.ClientConnInterface) CourseServiceClient
type CourseServiceServer ¶
type CourseServiceServer interface { GetCourses(context.Context, *Empty) (*CoursesResponse, error) AddCourse(context.Context, *Course) (*CourseId, error) DeleteCourse(context.Context, *CourseId) (*MessageResponse, error) AddStudentsToCourse(context.Context, *StudentCourseIdRequest) (*MessageResponse, error) RemoveStudentsFromCourse(context.Context, *StudentCourseIdRequest) (*MessageResponse, error) // contains filtered or unexported methods }
CourseServiceServer is the server API for CourseService service. All implementations must embed UnimplementedCourseServiceServer for forward compatibility
type CoursesResponse ¶
type CoursesResponse struct { Courses []*Course `protobuf:"bytes,1,rep,name=courses,proto3" json:"courses,omitempty"` // contains filtered or unexported fields }
func (*CoursesResponse) Descriptor
deprecated
func (*CoursesResponse) Descriptor() ([]byte, []int)
Deprecated: Use CoursesResponse.ProtoReflect.Descriptor instead.
func (*CoursesResponse) GetCourses ¶
func (x *CoursesResponse) GetCourses() []*Course
func (*CoursesResponse) ProtoMessage ¶
func (*CoursesResponse) ProtoMessage()
func (*CoursesResponse) ProtoReflect ¶
func (x *CoursesResponse) ProtoReflect() protoreflect.Message
func (*CoursesResponse) Reset ¶
func (x *CoursesResponse) Reset()
func (*CoursesResponse) String ¶
func (x *CoursesResponse) String() string
type Empty ¶
type Empty struct {
// contains filtered or unexported fields
}
func (*Empty) Descriptor
deprecated
func (*Empty) ProtoMessage ¶
func (*Empty) ProtoMessage()
func (*Empty) ProtoReflect ¶
func (x *Empty) ProtoReflect() protoreflect.Message
type MessageResponse ¶
type MessageResponse struct { Msg string `protobuf:"bytes,1,opt,name=msg,proto3" json:"msg,omitempty"` // contains filtered or unexported fields }
func (*MessageResponse) Descriptor
deprecated
func (*MessageResponse) Descriptor() ([]byte, []int)
Deprecated: Use MessageResponse.ProtoReflect.Descriptor instead.
func (*MessageResponse) GetMsg ¶
func (x *MessageResponse) GetMsg() string
func (*MessageResponse) ProtoMessage ¶
func (*MessageResponse) ProtoMessage()
func (*MessageResponse) ProtoReflect ¶
func (x *MessageResponse) ProtoReflect() protoreflect.Message
func (*MessageResponse) Reset ¶
func (x *MessageResponse) Reset()
func (*MessageResponse) String ¶
func (x *MessageResponse) String() string
type StudentCourseIdRequest ¶
type StudentCourseIdRequest struct { CourseId uint64 `protobuf:"varint,1,opt,name=courseId,proto3" json:"courseId,omitempty"` StudentId uint64 `protobuf:"varint,2,opt,name=studentId,proto3" json:"studentId,omitempty"` // contains filtered or unexported fields }
func (*StudentCourseIdRequest) Descriptor
deprecated
func (*StudentCourseIdRequest) Descriptor() ([]byte, []int)
Deprecated: Use StudentCourseIdRequest.ProtoReflect.Descriptor instead.
func (*StudentCourseIdRequest) GetCourseId ¶
func (x *StudentCourseIdRequest) GetCourseId() uint64
func (*StudentCourseIdRequest) GetStudentId ¶
func (x *StudentCourseIdRequest) GetStudentId() uint64
func (*StudentCourseIdRequest) ProtoMessage ¶
func (*StudentCourseIdRequest) ProtoMessage()
func (*StudentCourseIdRequest) ProtoReflect ¶
func (x *StudentCourseIdRequest) ProtoReflect() protoreflect.Message
func (*StudentCourseIdRequest) Reset ¶
func (x *StudentCourseIdRequest) Reset()
func (*StudentCourseIdRequest) String ¶
func (x *StudentCourseIdRequest) String() string
type UnimplementedCourseServiceServer ¶
type UnimplementedCourseServiceServer struct { }
UnimplementedCourseServiceServer must be embedded to have forward compatible implementations.
func (UnimplementedCourseServiceServer) AddStudentsToCourse ¶
func (UnimplementedCourseServiceServer) AddStudentsToCourse(context.Context, *StudentCourseIdRequest) (*MessageResponse, error)
func (UnimplementedCourseServiceServer) DeleteCourse ¶
func (UnimplementedCourseServiceServer) DeleteCourse(context.Context, *CourseId) (*MessageResponse, error)
func (UnimplementedCourseServiceServer) GetCourses ¶
func (UnimplementedCourseServiceServer) GetCourses(context.Context, *Empty) (*CoursesResponse, error)
func (UnimplementedCourseServiceServer) RemoveStudentsFromCourse ¶
func (UnimplementedCourseServiceServer) RemoveStudentsFromCourse(context.Context, *StudentCourseIdRequest) (*MessageResponse, error)
type UnsafeCourseServiceServer ¶
type UnsafeCourseServiceServer interface {
// contains filtered or unexported methods
}
UnsafeCourseServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to CourseServiceServer will result in compilation errors.