proto

package
v0.0.0-...-26b8432 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2022 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Overview

This package holds the gRPC definitions and generated code

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoUserFound = status.Error(codes.NotFound, "userz: no user found with given criteria")
	ErrInternal    = status.Error(codes.Internal, "userz: there has been an internal error")
)
View Source
var File_userz_proto protoreflect.FileDescriptor
View Source
var Userz_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "proto.Userz",
	HandlerType: (*UserzServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Add",
			Handler:    _Userz_Add_Handler,
		},
		{
			MethodName: "Update",
			Handler:    _Userz_Update_Handler,
		},
		{
			MethodName: "Remove",
			Handler:    _Userz_Remove_Handler,
		},
	},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "List",
			Handler:       _Userz_List_Handler,
			ServerStreams: true,
		},
	},
	Metadata: "userz.proto",
}

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

Functions

func RegisterUserzServer

func RegisterUserzServer(s grpc.ServiceRegistrar, srv UserzServer)

Types

type AddRequest

type AddRequest struct {
	ServiceOrigin string    `protobuf:"bytes,1,opt,name=service_origin,json=serviceOrigin,proto3" json:"service_origin,omitempty"`
	Data          *UserData `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"`
	// contains filtered or unexported fields
}

func (*AddRequest) Descriptor deprecated

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

Deprecated: Use AddRequest.ProtoReflect.Descriptor instead.

func (*AddRequest) GetData

func (x *AddRequest) GetData() *UserData

func (*AddRequest) GetServiceOrigin

func (x *AddRequest) GetServiceOrigin() string

func (*AddRequest) ProtoMessage

func (*AddRequest) ProtoMessage()

func (*AddRequest) ProtoReflect

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

func (*AddRequest) Reset

func (x *AddRequest) Reset()

func (*AddRequest) String

func (x *AddRequest) String() string

type AddResponse

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

func (*AddResponse) Descriptor deprecated

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

Deprecated: Use AddResponse.ProtoReflect.Descriptor instead.

func (*AddResponse) GetId

func (x *AddResponse) GetId() string

func (*AddResponse) ProtoMessage

func (*AddResponse) ProtoMessage()

func (*AddResponse) ProtoReflect

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

func (*AddResponse) Reset

func (x *AddResponse) Reset()

func (*AddResponse) String

func (x *AddResponse) String() string

type ListRequest

type ListRequest struct {
	ServiceOrigin string            `protobuf:"bytes,1,opt,name=service_origin,json=serviceOrigin,proto3" json:"service_origin,omitempty"`
	Filter        map[string]string `` /* 153-byte string literal not displayed */
	PageSize      int64             `protobuf:"varint,3,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"`
	// contains filtered or unexported fields
}

func (*ListRequest) Descriptor deprecated

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

Deprecated: Use ListRequest.ProtoReflect.Descriptor instead.

func (*ListRequest) GetFilter

func (x *ListRequest) GetFilter() map[string]string

func (*ListRequest) GetPageSize

func (x *ListRequest) GetPageSize() int64

func (*ListRequest) GetServiceOrigin

func (x *ListRequest) GetServiceOrigin() string

func (*ListRequest) ProtoMessage

func (*ListRequest) ProtoMessage()

func (*ListRequest) ProtoReflect

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

func (*ListRequest) Reset

func (x *ListRequest) Reset()

func (*ListRequest) String

func (x *ListRequest) String() string

type ListResponse

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

func (*ListResponse) Descriptor deprecated

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

Deprecated: Use ListResponse.ProtoReflect.Descriptor instead.

func (*ListResponse) GetUsers

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

func (*ListResponse) ProtoMessage

func (*ListResponse) ProtoMessage()

func (*ListResponse) ProtoReflect

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

func (*ListResponse) Reset

func (x *ListResponse) Reset()

func (*ListResponse) String

func (x *ListResponse) String() string

type RemoveRequest

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

func (*RemoveRequest) Descriptor deprecated

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

Deprecated: Use RemoveRequest.ProtoReflect.Descriptor instead.

func (*RemoveRequest) GetId

func (x *RemoveRequest) GetId() string

func (*RemoveRequest) GetServiceOrigin

func (x *RemoveRequest) GetServiceOrigin() string

func (*RemoveRequest) ProtoMessage

func (*RemoveRequest) ProtoMessage()

func (*RemoveRequest) ProtoReflect

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

func (*RemoveRequest) Reset

func (x *RemoveRequest) Reset()

func (*RemoveRequest) String

func (x *RemoveRequest) String() string

type RemoveResponse

type RemoveResponse struct {
	User *User `protobuf:"bytes,1,opt,name=user,proto3,oneof" json:"user,omitempty"`
	// contains filtered or unexported fields
}

func (*RemoveResponse) Descriptor deprecated

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

Deprecated: Use RemoveResponse.ProtoReflect.Descriptor instead.

func (*RemoveResponse) GetUser

func (x *RemoveResponse) GetUser() *User

func (*RemoveResponse) ProtoMessage

func (*RemoveResponse) ProtoMessage()

func (*RemoveResponse) ProtoReflect

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

func (*RemoveResponse) Reset

func (x *RemoveResponse) Reset()

func (*RemoveResponse) String

func (x *RemoveResponse) String() string

type Service

type Service struct {
	UnimplementedUserzServer
	// contains filtered or unexported fields
}

func (*Service) Add

func (s *Service) Add(ctx context.Context, req *AddRequest) (*AddResponse, error)

func (*Service) List

func (s *Service) List(req *ListRequest, server Userz_ListServer) error

func (*Service) Remove

func (s *Service) Remove(ctx context.Context, req *RemoveRequest) (*RemoveResponse, error)

func (*Service) Update

func (s *Service) Update(ctx context.Context, req *UpdateRequest) (*UpdateResponse, error)

type UnimplementedUserzServer

type UnimplementedUserzServer struct {
}

UnimplementedUserzServer must be embedded to have forward compatible implementations.

func (UnimplementedUserzServer) Add

func (UnimplementedUserzServer) List

func (UnimplementedUserzServer) Remove

func (UnimplementedUserzServer) Update

type UnsafeUserzServer

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

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

type UpdateRequest

type UpdateRequest struct {
	ServiceOrigin string    `protobuf:"bytes,1,opt,name=service_origin,json=serviceOrigin,proto3" json:"service_origin,omitempty"`
	Id            string    `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"`
	Data          *UserData `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"`
	// contains filtered or unexported fields
}

func (*UpdateRequest) Descriptor deprecated

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

Deprecated: Use UpdateRequest.ProtoReflect.Descriptor instead.

func (*UpdateRequest) GetData

func (x *UpdateRequest) GetData() *UserData

func (*UpdateRequest) GetId

func (x *UpdateRequest) GetId() string

func (*UpdateRequest) GetServiceOrigin

func (x *UpdateRequest) GetServiceOrigin() string

func (*UpdateRequest) ProtoMessage

func (*UpdateRequest) ProtoMessage()

func (*UpdateRequest) ProtoReflect

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

func (*UpdateRequest) Reset

func (x *UpdateRequest) Reset()

func (*UpdateRequest) String

func (x *UpdateRequest) String() string

type UpdateResponse

type UpdateResponse struct {
	User *User `protobuf:"bytes,1,opt,name=user,proto3,oneof" json:"user,omitempty"`
	// contains filtered or unexported fields
}

func (*UpdateResponse) Descriptor deprecated

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

Deprecated: Use UpdateResponse.ProtoReflect.Descriptor instead.

func (*UpdateResponse) GetUser

func (x *UpdateResponse) GetUser() *User

func (*UpdateResponse) ProtoMessage

func (*UpdateResponse) ProtoMessage()

func (*UpdateResponse) ProtoReflect

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

func (*UpdateResponse) Reset

func (x *UpdateResponse) Reset()

func (*UpdateResponse) String

func (x *UpdateResponse) String() string

type User

type User struct {
	Id        string  `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	FirstName *string `protobuf:"bytes,2,opt,name=first_name,json=firstName,proto3,oneof" json:"first_name,omitempty"`
	LastName  *string `protobuf:"bytes,3,opt,name=last_name,json=lastName,proto3,oneof" json:"last_name,omitempty"`
	NickName  string  `protobuf:"bytes,4,opt,name=nick_name,json=nickName,proto3" json:"nick_name,omitempty"`
	Password  string  `protobuf:"bytes,5,opt,name=password,proto3" json:"password,omitempty"`
	Email     string  `protobuf:"bytes,6,opt,name=email,proto3" json:"email,omitempty"`
	Country   *string `protobuf:"bytes,7,opt,name=country,proto3,oneof" json:"country,omitempty"`
	CreatedAt *string `protobuf:"bytes,8,opt,name=created_at,json=createdAt,proto3,oneof" json:"created_at,omitempty"`
	UpdatedAt *string `protobuf:"bytes,9,opt,name=updated_at,json=updatedAt,proto3,oneof" json:"updated_at,omitempty"`
	// contains filtered or unexported fields
}

func FromUser

func FromUser(user *userz.User) *User

func (*User) Descriptor deprecated

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

Deprecated: Use User.ProtoReflect.Descriptor instead.

func (*User) GetCountry

func (x *User) GetCountry() string

func (*User) GetCreatedAt

func (x *User) GetCreatedAt() string

func (*User) GetEmail

func (x *User) GetEmail() string

func (*User) GetFirstName

func (x *User) GetFirstName() string

func (*User) GetId

func (x *User) GetId() string

func (*User) GetLastName

func (x *User) GetLastName() string

func (*User) GetNickName

func (x *User) GetNickName() string

func (*User) GetPassword

func (x *User) GetPassword() string

func (*User) GetUpdatedAt

func (x *User) GetUpdatedAt() 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 UserData

type UserData struct {
	FirstName *string `protobuf:"bytes,1,opt,name=first_name,json=firstName,proto3,oneof" json:"first_name,omitempty"`
	LastName  *string `protobuf:"bytes,2,opt,name=last_name,json=lastName,proto3,oneof" json:"last_name,omitempty"`
	NickName  string  `protobuf:"bytes,3,opt,name=nick_name,json=nickName,proto3" json:"nick_name,omitempty"`
	Password  string  `protobuf:"bytes,4,opt,name=password,proto3" json:"password,omitempty"`
	Email     string  `protobuf:"bytes,5,opt,name=email,proto3" json:"email,omitempty"`
	Country   *string `protobuf:"bytes,6,opt,name=country,proto3,oneof" json:"country,omitempty"`
	// contains filtered or unexported fields
}

func FromUserData

func FromUserData(user *userz.UserData) *UserData

func (*UserData) Descriptor deprecated

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

Deprecated: Use UserData.ProtoReflect.Descriptor instead.

func (*UserData) GetCountry

func (x *UserData) GetCountry() string

func (*UserData) GetEmail

func (x *UserData) GetEmail() string

func (*UserData) GetFirstName

func (x *UserData) GetFirstName() string

func (*UserData) GetLastName

func (x *UserData) GetLastName() string

func (*UserData) GetNickName

func (x *UserData) GetNickName() string

func (*UserData) GetPassword

func (x *UserData) GetPassword() string

func (*UserData) Into

func (d *UserData) Into() *userz.UserData

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 UserzClient

type UserzClient interface {
	Add(ctx context.Context, in *AddRequest, opts ...grpc.CallOption) (*AddResponse, error)
	Update(ctx context.Context, in *UpdateRequest, opts ...grpc.CallOption) (*UpdateResponse, error)
	Remove(ctx context.Context, in *RemoveRequest, opts ...grpc.CallOption) (*RemoveResponse, error)
	List(ctx context.Context, in *ListRequest, opts ...grpc.CallOption) (Userz_ListClient, error)
}

UserzClient is the client API for Userz 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 NewUserzClient

func NewUserzClient(cc grpc.ClientConnInterface) UserzClient

type UserzServer

type UserzServer interface {
	Add(context.Context, *AddRequest) (*AddResponse, error)
	Update(context.Context, *UpdateRequest) (*UpdateResponse, error)
	Remove(context.Context, *RemoveRequest) (*RemoveResponse, error)
	List(*ListRequest, Userz_ListServer) error
	// contains filtered or unexported methods
}

UserzServer is the server API for Userz service. All implementations must embed UnimplementedUserzServer for forward compatibility

func NewUserzServiceServer

func NewUserzServiceServer(store userz.Store) UserzServer

type Userz_ListClient

type Userz_ListClient interface {
	Recv() (*ListResponse, error)
	grpc.ClientStream
}

type Userz_ListServer

type Userz_ListServer interface {
	Send(*ListResponse) error
	grpc.ServerStream
}

Jump to

Keyboard shortcuts

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