Documentation
¶
Index ¶
- Constants
- Variables
- func RegisterStudentHTTPServer(s *http.Server, srv StudentHTTPServer)
- func RegisterStudentServer(s grpc.ServiceRegistrar, srv StudentServer)
- type ListReply
- type ListRequest
- type SaveReply
- type SaveRequest
- func (*SaveRequest) Descriptor() ([]byte, []int)deprecated
- func (x *SaveRequest) GetAge() uint32
- func (x *SaveRequest) GetId() string
- func (x *SaveRequest) GetName() string
- func (x *SaveRequest) GetScore() uint32
- func (*SaveRequest) ProtoMessage()
- func (x *SaveRequest) ProtoReflect() protoreflect.Message
- func (x *SaveRequest) Reset()
- func (x *SaveRequest) String() string
- type StudentClient
- type StudentEntity
- func (*StudentEntity) Descriptor() ([]byte, []int)deprecated
- func (x *StudentEntity) GetAge() int32
- func (x *StudentEntity) GetId() string
- func (x *StudentEntity) GetName() string
- func (x *StudentEntity) GetScore() float32
- func (*StudentEntity) ProtoMessage()
- func (x *StudentEntity) ProtoReflect() protoreflect.Message
- func (x *StudentEntity) Reset()
- func (x *StudentEntity) String() string
- type StudentHTTPClient
- type StudentHTTPClientImpl
- type StudentHTTPServer
- type StudentServer
- type UnimplementedStudentServer
- type UnsafeStudentServer
Constants ¶
const ( Student_Save_FullMethodName = "/api.helloworld.v1.Student/Save" Student_List_FullMethodName = "/api.helloworld.v1.Student/List" )
const OperationStudentList = "/api.helloworld.v1.Student/List"
const OperationStudentSave = "/api.helloworld.v1.Student/Save"
Variables ¶
var File_student_v1_student_proto protoreflect.FileDescriptor
var Student_ServiceDesc = grpc.ServiceDesc{ ServiceName: "api.helloworld.v1.Student", HandlerType: (*StudentServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Save", Handler: _Student_Save_Handler, }, { MethodName: "List", Handler: _Student_List_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "student/v1/student.proto", }
Student_ServiceDesc is the grpc.ServiceDesc for Student service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterStudentHTTPServer ¶
func RegisterStudentHTTPServer(s *http.Server, srv StudentHTTPServer)
func RegisterStudentServer ¶
func RegisterStudentServer(s grpc.ServiceRegistrar, srv StudentServer)
Types ¶
type ListReply ¶
type ListReply struct {
List []*StudentEntity `protobuf:"bytes,1,rep,name=list,proto3" json:"list,omitempty"`
// contains filtered or unexported fields
}
func (*ListReply) GetList ¶
func (x *ListReply) GetList() []*StudentEntity
func (*ListReply) ProtoReflect ¶
func (x *ListReply) ProtoReflect() protoreflect.Message
type ListRequest ¶
type ListRequest struct {
Page int32 `protobuf:"varint,1,opt,name=page,proto3" json:"page,omitempty"`
Limit int32 `protobuf:"varint,2,opt,name=limit,proto3" json:"limit,omitempty"`
// contains filtered or unexported fields
}
func (*ListRequest) Descriptor
deprecated
func (*ListRequest) Descriptor() ([]byte, []int)
Deprecated: Use ListRequest.ProtoReflect.Descriptor instead.
func (*ListRequest) GetLimit ¶
func (x *ListRequest) GetLimit() int32
func (*ListRequest) GetPage ¶
func (x *ListRequest) GetPage() int32
func (*ListRequest) ProtoMessage ¶
func (*ListRequest) ProtoMessage()
func (*ListRequest) ProtoReflect ¶
func (x *ListRequest) ProtoReflect() protoreflect.Message
func (*ListRequest) Reset ¶
func (x *ListRequest) Reset()
func (*ListRequest) String ¶
func (x *ListRequest) String() string
type SaveReply ¶
type SaveReply struct {
Entity *StudentEntity `protobuf:"bytes,1,opt,name=entity,proto3" json:"entity,omitempty"`
// contains filtered or unexported fields
}
func (*SaveReply) GetEntity ¶
func (x *SaveReply) GetEntity() *StudentEntity
func (*SaveReply) ProtoReflect ¶
func (x *SaveReply) ProtoReflect() protoreflect.Message
type SaveRequest ¶
type SaveRequest struct {
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
Age uint32 `protobuf:"varint,3,opt,name=age,proto3" json:"age,omitempty"`
Score uint32 `protobuf:"varint,4,opt,name=score,proto3" json:"score,omitempty"`
// contains filtered or unexported fields
}
func (*SaveRequest) Descriptor
deprecated
func (*SaveRequest) Descriptor() ([]byte, []int)
Deprecated: Use SaveRequest.ProtoReflect.Descriptor instead.
func (*SaveRequest) GetAge ¶
func (x *SaveRequest) GetAge() uint32
func (*SaveRequest) GetId ¶
func (x *SaveRequest) GetId() string
func (*SaveRequest) GetName ¶
func (x *SaveRequest) GetName() string
func (*SaveRequest) GetScore ¶
func (x *SaveRequest) GetScore() uint32
func (*SaveRequest) ProtoMessage ¶
func (*SaveRequest) ProtoMessage()
func (*SaveRequest) ProtoReflect ¶
func (x *SaveRequest) ProtoReflect() protoreflect.Message
func (*SaveRequest) Reset ¶
func (x *SaveRequest) Reset()
func (*SaveRequest) String ¶
func (x *SaveRequest) String() string
type StudentClient ¶
type StudentClient interface {
Save(ctx context.Context, in *SaveRequest, opts ...grpc.CallOption) (*SaveReply, error)
List(ctx context.Context, in *ListRequest, opts ...grpc.CallOption) (*ListReply, error)
}
StudentClient is the client API for Student 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 NewStudentClient ¶
func NewStudentClient(cc grpc.ClientConnInterface) StudentClient
type StudentEntity ¶
type StudentEntity struct {
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
Age int32 `protobuf:"varint,3,opt,name=age,proto3" json:"age,omitempty"`
Score float32 `protobuf:"fixed32,4,opt,name=score,proto3" json:"score,omitempty"`
// contains filtered or unexported fields
}
func (*StudentEntity) Descriptor
deprecated
func (*StudentEntity) Descriptor() ([]byte, []int)
Deprecated: Use StudentEntity.ProtoReflect.Descriptor instead.
func (*StudentEntity) GetAge ¶
func (x *StudentEntity) GetAge() int32
func (*StudentEntity) GetId ¶
func (x *StudentEntity) GetId() string
func (*StudentEntity) GetName ¶
func (x *StudentEntity) GetName() string
func (*StudentEntity) GetScore ¶
func (x *StudentEntity) GetScore() float32
func (*StudentEntity) ProtoMessage ¶
func (*StudentEntity) ProtoMessage()
func (*StudentEntity) ProtoReflect ¶
func (x *StudentEntity) ProtoReflect() protoreflect.Message
func (*StudentEntity) Reset ¶
func (x *StudentEntity) Reset()
func (*StudentEntity) String ¶
func (x *StudentEntity) String() string
type StudentHTTPClient ¶
type StudentHTTPClient interface {
List(ctx context.Context, req *ListRequest, opts ...http.CallOption) (rsp *ListReply, err error)
Save(ctx context.Context, req *SaveRequest, opts ...http.CallOption) (rsp *SaveReply, err error)
}
func NewStudentHTTPClient ¶
func NewStudentHTTPClient(client *http.Client) StudentHTTPClient
type StudentHTTPClientImpl ¶
type StudentHTTPClientImpl struct {
// contains filtered or unexported fields
}
func (*StudentHTTPClientImpl) List ¶
func (c *StudentHTTPClientImpl) List(ctx context.Context, in *ListRequest, opts ...http.CallOption) (*ListReply, error)
func (*StudentHTTPClientImpl) Save ¶
func (c *StudentHTTPClientImpl) Save(ctx context.Context, in *SaveRequest, opts ...http.CallOption) (*SaveReply, error)
type StudentHTTPServer ¶
type StudentHTTPServer interface {
List(context.Context, *ListRequest) (*ListReply, error)
Save(context.Context, *SaveRequest) (*SaveReply, error)
}
type StudentServer ¶
type StudentServer interface {
Save(context.Context, *SaveRequest) (*SaveReply, error)
List(context.Context, *ListRequest) (*ListReply, error)
// contains filtered or unexported methods
}
StudentServer is the server API for Student service. All implementations must embed UnimplementedStudentServer for forward compatibility.
type UnimplementedStudentServer ¶
type UnimplementedStudentServer struct{}
UnimplementedStudentServer 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 (UnimplementedStudentServer) List ¶
func (UnimplementedStudentServer) List(context.Context, *ListRequest) (*ListReply, error)
func (UnimplementedStudentServer) Save ¶
func (UnimplementedStudentServer) Save(context.Context, *SaveRequest) (*SaveReply, error)
type UnsafeStudentServer ¶
type UnsafeStudentServer interface {
// contains filtered or unexported methods
}
UnsafeStudentServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to StudentServer will result in compilation errors.
Source Files
¶
- student.pb.go
- student_grpc.pb.go
- student_http.pb.go