Documentation ¶
Index ¶
- Variables
- func RegisterUserStorageServer(s grpc.ServiceRegistrar, srv UserStorageServer)
- type Empty
- type Id
- type UnimplementedUserStorageServer
- func (UnimplementedUserStorageServer) Create(context.Context, *User) (*User, error)
- func (UnimplementedUserStorageServer) List(*Empty, UserStorage_ListServer) error
- func (UnimplementedUserStorageServer) Remove(context.Context, *Id) (*Empty, error)
- func (UnimplementedUserStorageServer) Update(context.Context, *User) (*User, error)
- type UnsafeUserStorageServer
- type User
- func (*User) Descriptor() ([]byte, []int)deprecated
- func (x *User) GetAge() int32
- func (x *User) GetDescription() string
- func (x *User) GetId() int32
- func (x *User) GetName() string
- func (*User) ProtoMessage()
- func (x *User) ProtoReflect() protoreflect.Message
- func (x *User) Reset()
- func (x *User) String() string
- type UserStorageClient
- type UserStorageServer
- type UserStorage_ListClient
- type UserStorage_ListServer
- type Users
Constants ¶
This section is empty.
Variables ¶
var File_api_proto protoreflect.FileDescriptor
var UserStorage_ServiceDesc = grpc.ServiceDesc{ ServiceName: "template.v1.UserStorage", HandlerType: (*UserStorageServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Create", Handler: _UserStorage_Create_Handler, }, { MethodName: "Remove", Handler: _UserStorage_Remove_Handler, }, { MethodName: "Update", Handler: _UserStorage_Update_Handler, }, }, Streams: []grpc.StreamDesc{ { StreamName: "List", Handler: _UserStorage_List_Handler, ServerStreams: true, }, }, Metadata: "api.proto", }
UserStorage_ServiceDesc is the grpc.ServiceDesc for UserStorage service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterUserStorageServer ¶
func RegisterUserStorageServer(s grpc.ServiceRegistrar, srv UserStorageServer)
Types ¶
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 Id ¶
type Id struct { Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` // contains filtered or unexported fields }
func (*Id) Descriptor
deprecated
func (*Id) ProtoMessage ¶
func (*Id) ProtoMessage()
func (*Id) ProtoReflect ¶
func (x *Id) ProtoReflect() protoreflect.Message
type UnimplementedUserStorageServer ¶
type UnimplementedUserStorageServer struct { }
UnimplementedUserStorageServer should be embedded to have forward compatible implementations.
func (UnimplementedUserStorageServer) List ¶
func (UnimplementedUserStorageServer) List(*Empty, UserStorage_ListServer) error
type UnsafeUserStorageServer ¶
type UnsafeUserStorageServer interface {
// contains filtered or unexported methods
}
UnsafeUserStorageServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to UserStorageServer will result in compilation errors.
type User ¶
type User struct { // User id that will be set on create operation Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` // User name Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` // User age Age int32 `protobuf:"varint,3,opt,name=age,proto3" json:"age,omitempty"` // Information about user Description string `protobuf:"bytes,4,opt,name=description,proto3" json:"description,omitempty"` // contains filtered or unexported fields }
Unified entity for user
func (*User) Descriptor
deprecated
func (*User) GetDescription ¶
func (*User) ProtoMessage ¶
func (*User) ProtoMessage()
func (*User) ProtoReflect ¶
func (x *User) ProtoReflect() protoreflect.Message
type UserStorageClient ¶
type UserStorageClient interface { // Creates new user Create(ctx context.Context, in *User, opts ...grpc.CallOption) (*User, error) // Operation to recieve new user List(ctx context.Context, in *Empty, opts ...grpc.CallOption) (UserStorage_ListClient, error) // Operation to delete user Remove(ctx context.Context, in *Id, opts ...grpc.CallOption) (*Empty, error) // Operation update information about user Update(ctx context.Context, in *User, opts ...grpc.CallOption) (*User, error) }
UserStorageClient is the client API for UserStorage 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 NewUserStorageClient ¶
func NewUserStorageClient(cc grpc.ClientConnInterface) UserStorageClient
type UserStorageServer ¶
type UserStorageServer interface { // Creates new user Create(context.Context, *User) (*User, error) // Operation to recieve new user List(*Empty, UserStorage_ListServer) error // Operation to delete user Remove(context.Context, *Id) (*Empty, error) // Operation update information about user Update(context.Context, *User) (*User, error) }
UserStorageServer is the server API for UserStorage service. All implementations should embed UnimplementedUserStorageServer for forward compatibility
type UserStorage_ListClient ¶
type UserStorage_ListClient interface { Recv() (*User, error) grpc.ClientStream }
type UserStorage_ListServer ¶
type UserStorage_ListServer interface { Send(*User) error grpc.ServerStream }
type Users ¶
type Users struct { // list with repeated users Users []*User `protobuf:"bytes,1,rep,name=users,proto3" json:"users,omitempty"` // contains filtered or unexported fields }
Multiple users
func (*Users) Descriptor
deprecated
func (*Users) ProtoMessage ¶
func (*Users) ProtoMessage()
func (*Users) ProtoReflect ¶
func (x *Users) ProtoReflect() protoreflect.Message