implement simple tui with humans data
This commit is contained in:
@@ -0,0 +1,359 @@
|
||||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||
// versions:
|
||||
// - protoc-gen-go-grpc v1.5.1
|
||||
// - protoc v5.28.3
|
||||
// source: helios/human/human.proto
|
||||
|
||||
package pbhuman
|
||||
|
||||
import (
|
||||
context "context"
|
||||
grpc "google.golang.org/grpc"
|
||||
codes "google.golang.org/grpc/codes"
|
||||
status "google.golang.org/grpc/status"
|
||||
)
|
||||
|
||||
// This is a compile-time assertion to ensure that this generated file
|
||||
// is compatible with the grpc package it is being compiled against.
|
||||
// Requires gRPC-Go v1.64.0 or later.
|
||||
const _ = grpc.SupportPackageIsVersion9
|
||||
|
||||
const (
|
||||
HumanService_AddHuman_FullMethodName = "/helios.human.HumanService/AddHuman"
|
||||
HumanService_GetHumanByEmail_FullMethodName = "/helios.human.HumanService/GetHumanByEmail"
|
||||
HumanService_GetHumanById_FullMethodName = "/helios.human.HumanService/GetHumanById"
|
||||
HumanService_UpdateHumanProfilePicture_FullMethodName = "/helios.human.HumanService/UpdateHumanProfilePicture"
|
||||
HumanService_UpdateHumanDisplayName_FullMethodName = "/helios.human.HumanService/UpdateHumanDisplayName"
|
||||
HumanService_ListHumans_FullMethodName = "/helios.human.HumanService/ListHumans"
|
||||
HumanService_SetFlowyAdmin_FullMethodName = "/helios.human.HumanService/SetFlowyAdmin"
|
||||
)
|
||||
|
||||
// HumanServiceClient is the client API for HumanService 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 HumanServiceClient interface {
|
||||
// Returns ALREADY_EXISTS if the human is already added.
|
||||
AddHuman(ctx context.Context, in *AddHumanRequest, opts ...grpc.CallOption) (*AddHumanResponse, error)
|
||||
// Returns NOT_FOUND if the human is not found.
|
||||
GetHumanByEmail(ctx context.Context, in *GetHumanByEmailRequest, opts ...grpc.CallOption) (*GetHumanByEmailResponse, error)
|
||||
// Returns NOT_FOUND if the human is not found.
|
||||
GetHumanById(ctx context.Context, in *GetHumanByIdRequest, opts ...grpc.CallOption) (*GetHumanByIdResponse, error)
|
||||
UpdateHumanProfilePicture(ctx context.Context, in *UpdateHumanProfilePictureRequest, opts ...grpc.CallOption) (*UpdateHumanProfilePictureResponse, error)
|
||||
UpdateHumanDisplayName(ctx context.Context, in *UpdateHumanDisplayNameRequest, opts ...grpc.CallOption) (*UpdateHumanDisplayNameResponse, error)
|
||||
// Lists all humans.
|
||||
ListHumans(ctx context.Context, in *ListHumansRequest, opts ...grpc.CallOption) (*ListHumansResponse, error)
|
||||
// Returns NOT_FOUND if the human is not found.
|
||||
SetFlowyAdmin(ctx context.Context, in *SetFlowyAdminRequest, opts ...grpc.CallOption) (*SetFlowyAdminResponse, error)
|
||||
}
|
||||
|
||||
type humanServiceClient struct {
|
||||
cc grpc.ClientConnInterface
|
||||
}
|
||||
|
||||
func NewHumanServiceClient(cc grpc.ClientConnInterface) HumanServiceClient {
|
||||
return &humanServiceClient{cc}
|
||||
}
|
||||
|
||||
func (c *humanServiceClient) AddHuman(ctx context.Context, in *AddHumanRequest, opts ...grpc.CallOption) (*AddHumanResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(AddHumanResponse)
|
||||
err := c.cc.Invoke(ctx, HumanService_AddHuman_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *humanServiceClient) GetHumanByEmail(ctx context.Context, in *GetHumanByEmailRequest, opts ...grpc.CallOption) (*GetHumanByEmailResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(GetHumanByEmailResponse)
|
||||
err := c.cc.Invoke(ctx, HumanService_GetHumanByEmail_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *humanServiceClient) GetHumanById(ctx context.Context, in *GetHumanByIdRequest, opts ...grpc.CallOption) (*GetHumanByIdResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(GetHumanByIdResponse)
|
||||
err := c.cc.Invoke(ctx, HumanService_GetHumanById_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *humanServiceClient) UpdateHumanProfilePicture(ctx context.Context, in *UpdateHumanProfilePictureRequest, opts ...grpc.CallOption) (*UpdateHumanProfilePictureResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(UpdateHumanProfilePictureResponse)
|
||||
err := c.cc.Invoke(ctx, HumanService_UpdateHumanProfilePicture_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *humanServiceClient) UpdateHumanDisplayName(ctx context.Context, in *UpdateHumanDisplayNameRequest, opts ...grpc.CallOption) (*UpdateHumanDisplayNameResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(UpdateHumanDisplayNameResponse)
|
||||
err := c.cc.Invoke(ctx, HumanService_UpdateHumanDisplayName_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *humanServiceClient) ListHumans(ctx context.Context, in *ListHumansRequest, opts ...grpc.CallOption) (*ListHumansResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(ListHumansResponse)
|
||||
err := c.cc.Invoke(ctx, HumanService_ListHumans_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *humanServiceClient) SetFlowyAdmin(ctx context.Context, in *SetFlowyAdminRequest, opts ...grpc.CallOption) (*SetFlowyAdminResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(SetFlowyAdminResponse)
|
||||
err := c.cc.Invoke(ctx, HumanService_SetFlowyAdmin_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// HumanServiceServer is the server API for HumanService service.
|
||||
// All implementations must embed UnimplementedHumanServiceServer
|
||||
// for forward compatibility.
|
||||
type HumanServiceServer interface {
|
||||
// Returns ALREADY_EXISTS if the human is already added.
|
||||
AddHuman(context.Context, *AddHumanRequest) (*AddHumanResponse, error)
|
||||
// Returns NOT_FOUND if the human is not found.
|
||||
GetHumanByEmail(context.Context, *GetHumanByEmailRequest) (*GetHumanByEmailResponse, error)
|
||||
// Returns NOT_FOUND if the human is not found.
|
||||
GetHumanById(context.Context, *GetHumanByIdRequest) (*GetHumanByIdResponse, error)
|
||||
UpdateHumanProfilePicture(context.Context, *UpdateHumanProfilePictureRequest) (*UpdateHumanProfilePictureResponse, error)
|
||||
UpdateHumanDisplayName(context.Context, *UpdateHumanDisplayNameRequest) (*UpdateHumanDisplayNameResponse, error)
|
||||
// Lists all humans.
|
||||
ListHumans(context.Context, *ListHumansRequest) (*ListHumansResponse, error)
|
||||
// Returns NOT_FOUND if the human is not found.
|
||||
SetFlowyAdmin(context.Context, *SetFlowyAdminRequest) (*SetFlowyAdminResponse, error)
|
||||
mustEmbedUnimplementedHumanServiceServer()
|
||||
}
|
||||
|
||||
// UnimplementedHumanServiceServer 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.
|
||||
type UnimplementedHumanServiceServer struct{}
|
||||
|
||||
func (UnimplementedHumanServiceServer) AddHuman(context.Context, *AddHumanRequest) (*AddHumanResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method AddHuman not implemented")
|
||||
}
|
||||
func (UnimplementedHumanServiceServer) GetHumanByEmail(context.Context, *GetHumanByEmailRequest) (*GetHumanByEmailResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method GetHumanByEmail not implemented")
|
||||
}
|
||||
func (UnimplementedHumanServiceServer) GetHumanById(context.Context, *GetHumanByIdRequest) (*GetHumanByIdResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method GetHumanById not implemented")
|
||||
}
|
||||
func (UnimplementedHumanServiceServer) UpdateHumanProfilePicture(context.Context, *UpdateHumanProfilePictureRequest) (*UpdateHumanProfilePictureResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method UpdateHumanProfilePicture not implemented")
|
||||
}
|
||||
func (UnimplementedHumanServiceServer) UpdateHumanDisplayName(context.Context, *UpdateHumanDisplayNameRequest) (*UpdateHumanDisplayNameResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method UpdateHumanDisplayName not implemented")
|
||||
}
|
||||
func (UnimplementedHumanServiceServer) ListHumans(context.Context, *ListHumansRequest) (*ListHumansResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method ListHumans not implemented")
|
||||
}
|
||||
func (UnimplementedHumanServiceServer) SetFlowyAdmin(context.Context, *SetFlowyAdminRequest) (*SetFlowyAdminResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method SetFlowyAdmin not implemented")
|
||||
}
|
||||
func (UnimplementedHumanServiceServer) mustEmbedUnimplementedHumanServiceServer() {}
|
||||
func (UnimplementedHumanServiceServer) testEmbeddedByValue() {}
|
||||
|
||||
// UnsafeHumanServiceServer may be embedded to opt out of forward compatibility for this service.
|
||||
// Use of this interface is not recommended, as added methods to HumanServiceServer will
|
||||
// result in compilation errors.
|
||||
type UnsafeHumanServiceServer interface {
|
||||
mustEmbedUnimplementedHumanServiceServer()
|
||||
}
|
||||
|
||||
func RegisterHumanServiceServer(s grpc.ServiceRegistrar, srv HumanServiceServer) {
|
||||
// If the following call pancis, it indicates UnimplementedHumanServiceServer was
|
||||
// embedded by pointer and is nil. This will cause panics if an
|
||||
// unimplemented method is ever invoked, so we test this at initialization
|
||||
// time to prevent it from happening at runtime later due to I/O.
|
||||
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
|
||||
t.testEmbeddedByValue()
|
||||
}
|
||||
s.RegisterService(&HumanService_ServiceDesc, srv)
|
||||
}
|
||||
|
||||
func _HumanService_AddHuman_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(AddHumanRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(HumanServiceServer).AddHuman(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: HumanService_AddHuman_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(HumanServiceServer).AddHuman(ctx, req.(*AddHumanRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _HumanService_GetHumanByEmail_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(GetHumanByEmailRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(HumanServiceServer).GetHumanByEmail(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: HumanService_GetHumanByEmail_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(HumanServiceServer).GetHumanByEmail(ctx, req.(*GetHumanByEmailRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _HumanService_GetHumanById_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(GetHumanByIdRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(HumanServiceServer).GetHumanById(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: HumanService_GetHumanById_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(HumanServiceServer).GetHumanById(ctx, req.(*GetHumanByIdRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _HumanService_UpdateHumanProfilePicture_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(UpdateHumanProfilePictureRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(HumanServiceServer).UpdateHumanProfilePicture(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: HumanService_UpdateHumanProfilePicture_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(HumanServiceServer).UpdateHumanProfilePicture(ctx, req.(*UpdateHumanProfilePictureRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _HumanService_UpdateHumanDisplayName_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(UpdateHumanDisplayNameRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(HumanServiceServer).UpdateHumanDisplayName(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: HumanService_UpdateHumanDisplayName_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(HumanServiceServer).UpdateHumanDisplayName(ctx, req.(*UpdateHumanDisplayNameRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _HumanService_ListHumans_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(ListHumansRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(HumanServiceServer).ListHumans(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: HumanService_ListHumans_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(HumanServiceServer).ListHumans(ctx, req.(*ListHumansRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _HumanService_SetFlowyAdmin_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(SetFlowyAdminRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(HumanServiceServer).SetFlowyAdmin(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: HumanService_SetFlowyAdmin_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(HumanServiceServer).SetFlowyAdmin(ctx, req.(*SetFlowyAdminRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
// HumanService_ServiceDesc is the grpc.ServiceDesc for HumanService service.
|
||||
// It's only intended for direct use with grpc.RegisterService,
|
||||
// and not to be introspected or modified (even as a copy)
|
||||
var HumanService_ServiceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "helios.human.HumanService",
|
||||
HandlerType: (*HumanServiceServer)(nil),
|
||||
Methods: []grpc.MethodDesc{
|
||||
{
|
||||
MethodName: "AddHuman",
|
||||
Handler: _HumanService_AddHuman_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "GetHumanByEmail",
|
||||
Handler: _HumanService_GetHumanByEmail_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "GetHumanById",
|
||||
Handler: _HumanService_GetHumanById_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "UpdateHumanProfilePicture",
|
||||
Handler: _HumanService_UpdateHumanProfilePicture_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "UpdateHumanDisplayName",
|
||||
Handler: _HumanService_UpdateHumanDisplayName_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "ListHumans",
|
||||
Handler: _HumanService_ListHumans_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "SetFlowyAdmin",
|
||||
Handler: _HumanService_SetFlowyAdmin_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "helios/human/human.proto",
|
||||
}
|
||||
Reference in New Issue
Block a user