users

package
v0.0.0-...-ff2ebec Latest Latest
Warning

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

Go to latest
Published: May 10, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	UserService_AddUser_FullMethodName    = "/users.UserService/AddUser"
	UserService_AddUsers_FullMethodName   = "/users.UserService/AddUsers"
	UserService_DeleteUser_FullMethodName = "/users.UserService/DeleteUser"
	UserService_ListUsers_FullMethodName  = "/users.UserService/ListUsers"
)

Variables

View Source
var (
	Role_name = map[int32]string{
		0: "GUEST",
		1: "MEMBER",
		2: "ADMIN",
	}
	Role_value = map[string]int32{
		"GUEST":  0,
		"MEMBER": 1,
		"ADMIN":  2,
	}
)

Enum value maps for Role.

View Source
var File_proto_users_proto protoreflect.FileDescriptor
View Source
var UserService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "users.UserService",
	HandlerType: (*UserServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "AddUser",
			Handler:    _UserService_AddUser_Handler,
		},
		{
			MethodName: "DeleteUser",
			Handler:    _UserService_DeleteUser_Handler,
		},
	},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "AddUsers",
			Handler:       _UserService_AddUsers_Handler,
			ClientStreams: true,
		},
		{
			StreamName:    "ListUsers",
			Handler:       _UserService_ListUsers_Handler,
			ServerStreams: true,
		},
	},
	Metadata: "proto/users.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 AddUserRequest

type AddUserRequest struct {
	Role Role   `protobuf:"varint,1,opt,name=role,proto3,enum=users.Role" json:"role,omitempty"`
	Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
	// contains filtered or unexported fields
}

func (*AddUserRequest) Descriptor deprecated

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

Deprecated: Use AddUserRequest.ProtoReflect.Descriptor instead.

func (*AddUserRequest) GetName

func (x *AddUserRequest) GetName() string

func (*AddUserRequest) GetRole

func (x *AddUserRequest) GetRole() Role

func (*AddUserRequest) ProtoMessage

func (*AddUserRequest) ProtoMessage()

func (*AddUserRequest) ProtoReflect

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

func (*AddUserRequest) Reset

func (x *AddUserRequest) Reset()

func (*AddUserRequest) String

func (x *AddUserRequest) String() string

type DeleteUserRequest

type DeleteUserRequest struct {
	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	// contains filtered or unexported fields
}

func (*DeleteUserRequest) Descriptor deprecated

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

Deprecated: Use DeleteUserRequest.ProtoReflect.Descriptor instead.

func (*DeleteUserRequest) GetId

func (x *DeleteUserRequest) GetId() string

func (*DeleteUserRequest) ProtoMessage

func (*DeleteUserRequest) ProtoMessage()

func (*DeleteUserRequest) ProtoReflect

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

func (*DeleteUserRequest) Reset

func (x *DeleteUserRequest) Reset()

func (*DeleteUserRequest) String

func (x *DeleteUserRequest) String() string

type ListUsersRequest

type ListUsersRequest struct {

	// Only list users created after this timestamp
	CreatedSince *timestamppb.Timestamp `protobuf:"bytes,1,opt,name=created_since,json=createdSince,proto3" json:"created_since,omitempty"`
	// Only list users older than this Duration
	OlderThan *durationpb.Duration `protobuf:"bytes,2,opt,name=older_than,json=olderThan,proto3" json:"older_than,omitempty"`
	// contains filtered or unexported fields
}

func (*ListUsersRequest) Descriptor deprecated

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

Deprecated: Use ListUsersRequest.ProtoReflect.Descriptor instead.

func (*ListUsersRequest) GetCreatedSince

func (x *ListUsersRequest) GetCreatedSince() *timestamppb.Timestamp

func (*ListUsersRequest) GetOlderThan

func (x *ListUsersRequest) GetOlderThan() *durationpb.Duration

func (*ListUsersRequest) ProtoMessage

func (*ListUsersRequest) ProtoMessage()

func (*ListUsersRequest) ProtoReflect

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

func (*ListUsersRequest) Reset

func (x *ListUsersRequest) Reset()

func (*ListUsersRequest) String

func (x *ListUsersRequest) String() string

type Role

type Role int32
const (
	Role_GUEST  Role = 0
	Role_MEMBER Role = 1
	Role_ADMIN  Role = 2
)

func (Role) Descriptor

func (Role) Descriptor() protoreflect.EnumDescriptor

func (Role) Enum

func (x Role) Enum() *Role

func (Role) EnumDescriptor deprecated

func (Role) EnumDescriptor() ([]byte, []int)

Deprecated: Use Role.Descriptor instead.

func (Role) Number

func (x Role) Number() protoreflect.EnumNumber

func (Role) String

func (x Role) String() string

func (Role) Type

func (Role) Type() protoreflect.EnumType

type UnimplementedUserServiceServer

type UnimplementedUserServiceServer struct {
}

UnimplementedUserServiceServer should be embedded to have forward compatible implementations.

func (UnimplementedUserServiceServer) AddUser

func (UnimplementedUserServiceServer) AddUsers

func (UnimplementedUserServiceServer) DeleteUser

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 User

type User struct {
	Id         string                 `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	Role       Role                   `protobuf:"varint,2,opt,name=role,proto3,enum=users.Role" json:"role,omitempty"`
	CreateTime *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=create_time,json=createTime,proto3" json:"create_time,omitempty"`
	Name       string                 `protobuf:"bytes,4,opt,name=name,proto3" json:"name,omitempty"`
	// contains filtered or unexported fields
}

func (*User) Descriptor deprecated

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

Deprecated: Use User.ProtoReflect.Descriptor instead.

func (*User) GetCreateTime

func (x *User) GetCreateTime() *timestamppb.Timestamp

func (*User) GetId

func (x *User) GetId() string

func (*User) GetName

func (x *User) GetName() string

func (*User) GetRole

func (x *User) GetRole() Role

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 UserRole

type UserRole struct {
	Role Role `protobuf:"varint,1,opt,name=role,proto3,enum=users.Role" json:"role,omitempty"`
	// contains filtered or unexported fields
}

func (*UserRole) Descriptor deprecated

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

Deprecated: Use UserRole.ProtoReflect.Descriptor instead.

func (*UserRole) GetRole

func (x *UserRole) GetRole() Role

func (*UserRole) ProtoMessage

func (*UserRole) ProtoMessage()

func (*UserRole) ProtoReflect

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

func (*UserRole) Reset

func (x *UserRole) Reset()

func (*UserRole) String

func (x *UserRole) String() string

type UserServiceClient

type UserServiceClient interface {
	AddUser(ctx context.Context, in *AddUserRequest, opts ...grpc.CallOption) (*User, error)
	AddUsers(ctx context.Context, opts ...grpc.CallOption) (UserService_AddUsersClient, error)
	DeleteUser(ctx context.Context, in *DeleteUserRequest, opts ...grpc.CallOption) (*User, error)
	ListUsers(ctx context.Context, in *ListUsersRequest, opts ...grpc.CallOption) (UserService_ListUsersClient, 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 {
	AddUser(context.Context, *AddUserRequest) (*User, error)
	AddUsers(UserService_AddUsersServer) error
	DeleteUser(context.Context, *DeleteUserRequest) (*User, error)
	ListUsers(*ListUsersRequest, UserService_ListUsersServer) error
}

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

type UserService_AddUsersClient

type UserService_AddUsersClient interface {
	Send(*AddUserRequest) error
	CloseAndRecv() (*emptypb.Empty, error)
	grpc.ClientStream
}

type UserService_AddUsersServer

type UserService_AddUsersServer interface {
	SendAndClose(*emptypb.Empty) error
	Recv() (*AddUserRequest, error)
	grpc.ServerStream
}

type UserService_ListUsersClient

type UserService_ListUsersClient interface {
	Recv() (*User, error)
	grpc.ClientStream
}

type UserService_ListUsersServer

type UserService_ListUsersServer interface {
	Send(*User) error
	grpc.ServerStream
}

Jump to

Keyboard shortcuts

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