grpc

package
v0.0.0-...-ded8aa5 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_user_service_proto protoreflect.FileDescriptor
View Source
var UserService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "gogrpctron.UserService",
	HandlerType: (*UserServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "CreateUser",
			Handler:    _UserService_CreateUser_Handler,
		},
		{
			MethodName: "ListUsers",
			Handler:    _UserService_ListUsers_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "user_service.proto",
}

UserService_ServiceDesc is the grpc.ServiceDesc for UserService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

Functions

func RegisterUserServiceServer

func RegisterUserServiceServer(s grpc.ServiceRegistrar, srv UserServiceServer)

Types

type UnimplementedUserServiceServer

type UnimplementedUserServiceServer struct {
}

UnimplementedUserServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedUserServiceServer) CreateUser

func (UnimplementedUserServiceServer) ListUsers

type UnsafeUserServiceServer

type UnsafeUserServiceServer interface {
	// contains filtered or unexported methods
}

UnsafeUserServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to UserServiceServer will result in compilation errors.

type UserData

type UserData struct {
	Id        int64                  `protobuf:"varint,1,opt,name=Id,proto3" json:"Id,omitempty"`
	UserName  string                 `protobuf:"bytes,2,opt,name=UserName,proto3" json:"UserName,omitempty"`
	CreatedAt *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=CreatedAt,proto3" json:"CreatedAt,omitempty"`
	// contains filtered or unexported fields
}

func (*UserData) Descriptor deprecated

func (*UserData) Descriptor() ([]byte, []int)

Deprecated: Use UserData.ProtoReflect.Descriptor instead.

func (*UserData) GetCreatedAt

func (x *UserData) GetCreatedAt() *timestamppb.Timestamp

func (*UserData) GetId

func (x *UserData) GetId() int64

func (*UserData) GetUserName

func (x *UserData) GetUserName() string

func (*UserData) ProtoMessage

func (*UserData) ProtoMessage()

func (*UserData) ProtoReflect

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

func (*UserData) Reset

func (x *UserData) Reset()

func (*UserData) String

func (x *UserData) String() string

type UserList

type UserList struct {
	Users []*UserData `protobuf:"bytes,1,rep,name=users,proto3" json:"users,omitempty"`
	// contains filtered or unexported fields
}

func (*UserList) Descriptor deprecated

func (*UserList) Descriptor() ([]byte, []int)

Deprecated: Use UserList.ProtoReflect.Descriptor instead.

func (*UserList) GetUsers

func (x *UserList) GetUsers() []*UserData

func (*UserList) ProtoMessage

func (*UserList) ProtoMessage()

func (*UserList) ProtoReflect

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

func (*UserList) Reset

func (x *UserList) Reset()

func (*UserList) String

func (x *UserList) String() string

type UserServiceClient

type UserServiceClient interface {
	CreateUser(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*UserData, error)
	ListUsers(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*UserList, error)
}

UserServiceClient is the client API for UserService 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 UserServiceServer

type UserServiceServer interface {
	CreateUser(context.Context, *emptypb.Empty) (*UserData, error)
	ListUsers(context.Context, *emptypb.Empty) (*UserList, error)
	// contains filtered or unexported methods
}

UserServiceServer is the server API for UserService service. All implementations must embed UnimplementedUserServiceServer for forward compatibility

Jump to

Keyboard shortcuts

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