pb

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
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) Descriptor() ([]byte, []int)

Deprecated: Use Empty.ProtoReflect.Descriptor instead.

func (*Empty) ProtoMessage

func (*Empty) ProtoMessage()

func (*Empty) ProtoReflect

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

func (*Empty) Reset

func (x *Empty) Reset()

func (*Empty) String

func (x *Empty) String() string

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) Descriptor() ([]byte, []int)

Deprecated: Use Id.ProtoReflect.Descriptor instead.

func (*Id) GetId

func (x *Id) GetId() int32

func (*Id) ProtoMessage

func (*Id) ProtoMessage()

func (*Id) ProtoReflect

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

func (*Id) Reset

func (x *Id) Reset()

func (*Id) String

func (x *Id) String() string

type UnimplementedUserStorageServer

type UnimplementedUserStorageServer struct {
}

UnimplementedUserStorageServer should be embedded to have forward compatible implementations.

func (UnimplementedUserStorageServer) Create

func (UnimplementedUserStorageServer) List

func (UnimplementedUserStorageServer) Remove

func (UnimplementedUserStorageServer) Update

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) Descriptor() ([]byte, []int)

Deprecated: Use User.ProtoReflect.Descriptor instead.

func (*User) GetAge

func (x *User) GetAge() int32

func (*User) GetDescription

func (x *User) GetDescription() string

func (*User) GetId

func (x *User) GetId() int32

func (*User) GetName

func (x *User) GetName() string

func (*User) ProtoMessage

func (*User) ProtoMessage()

func (*User) ProtoReflect

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

func (*User) Reset

func (x *User) Reset()

func (*User) String

func (x *User) String() string

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.

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) Descriptor() ([]byte, []int)

Deprecated: Use Users.ProtoReflect.Descriptor instead.

func (*Users) GetUsers

func (x *Users) GetUsers() []*User

func (*Users) ProtoMessage

func (*Users) ProtoMessage()

func (*Users) ProtoReflect

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

func (*Users) Reset

func (x *Users) Reset()

func (*Users) String

func (x *Users) String() string

Jump to

Keyboard shortcuts

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