Documentation ¶
Overview ¶
Package pb is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Variables
- func RegisterUserServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterUserServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client UserServiceClient) error
- func RegisterUserServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterUserServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server UserServiceServer) error
- func RegisterUserServiceServer(s *grpc.Server, srv UserServiceServer)
- type GetAllRequest
- type GetAllResponse
- type GetRequest
- type GetResponse
- type UnimplementedUserServiceServer
- type User
- func (*User) Descriptor() ([]byte, []int)deprecated
- func (x *User) GetAvatar() string
- func (x *User) GetCreatedAt() *timestamp.Timestamp
- func (x *User) GetEmail() string
- func (x *User) GetFirstName() string
- func (x *User) GetId() uint64
- func (x *User) GetLastName() string
- func (x *User) GetMiddleName() string
- func (x *User) GetPassword() string
- func (x *User) GetRememberToken() string
- func (x *User) GetStatusId() uint32
- func (x *User) GetUpdatedAt() *timestamp.Timestamp
- func (x *User) GetVerifiedAt() *timestamp.Timestamp
- func (*User) ProtoMessage()
- func (x *User) ProtoReflect() protoreflect.Message
- func (x *User) Reset()
- func (x *User) String() string
- type UserServiceClient
- type UserServiceServer
- type UserService_GetAllClient
- type UserService_GetAllServer
Constants ¶
This section is empty.
Variables ¶
var File_user_proto protoreflect.FileDescriptor
Functions ¶
func RegisterUserServiceHandler ¶
func RegisterUserServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
RegisterUserServiceHandler registers the http handlers for service UserService to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterUserServiceHandlerClient ¶
func RegisterUserServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client UserServiceClient) error
RegisterUserServiceHandlerClient registers the http handlers for service UserService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "UserServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "UserServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "UserServiceClient" to call the correct interceptors.
func RegisterUserServiceHandlerFromEndpoint ¶
func RegisterUserServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterUserServiceHandlerFromEndpoint is same as RegisterUserServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterUserServiceHandlerServer ¶
func RegisterUserServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server UserServiceServer) error
RegisterUserServiceHandlerServer registers the http handlers for service UserService to "mux". UnaryRPC :call UserServiceServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterUserServiceHandlerFromEndpoint instead.
func RegisterUserServiceServer ¶
func RegisterUserServiceServer(s *grpc.Server, srv UserServiceServer)
Types ¶
type GetAllRequest ¶
type GetAllRequest struct {
// contains filtered or unexported fields
}
func (*GetAllRequest) Descriptor
deprecated
func (*GetAllRequest) Descriptor() ([]byte, []int)
Deprecated: Use GetAllRequest.ProtoReflect.Descriptor instead.
func (*GetAllRequest) ProtoMessage ¶
func (*GetAllRequest) ProtoMessage()
func (*GetAllRequest) ProtoReflect ¶
func (x *GetAllRequest) ProtoReflect() protoreflect.Message
func (*GetAllRequest) Reset ¶
func (x *GetAllRequest) Reset()
func (*GetAllRequest) String ¶
func (x *GetAllRequest) String() string
type GetAllResponse ¶
type GetAllResponse struct { User *User `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"` // contains filtered or unexported fields }
func (*GetAllResponse) Descriptor
deprecated
func (*GetAllResponse) Descriptor() ([]byte, []int)
Deprecated: Use GetAllResponse.ProtoReflect.Descriptor instead.
func (*GetAllResponse) GetUser ¶
func (x *GetAllResponse) GetUser() *User
func (*GetAllResponse) ProtoMessage ¶
func (*GetAllResponse) ProtoMessage()
func (*GetAllResponse) ProtoReflect ¶
func (x *GetAllResponse) ProtoReflect() protoreflect.Message
func (*GetAllResponse) Reset ¶
func (x *GetAllResponse) Reset()
func (*GetAllResponse) String ¶
func (x *GetAllResponse) String() string
type GetRequest ¶
type GetRequest struct { Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` // contains filtered or unexported fields }
func (*GetRequest) Descriptor
deprecated
func (*GetRequest) Descriptor() ([]byte, []int)
Deprecated: Use GetRequest.ProtoReflect.Descriptor instead.
func (*GetRequest) GetId ¶
func (x *GetRequest) GetId() uint64
func (*GetRequest) ProtoMessage ¶
func (*GetRequest) ProtoMessage()
func (*GetRequest) ProtoReflect ¶
func (x *GetRequest) ProtoReflect() protoreflect.Message
func (*GetRequest) Reset ¶
func (x *GetRequest) Reset()
func (*GetRequest) String ¶
func (x *GetRequest) String() string
type GetResponse ¶
type GetResponse struct { User *User `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"` // contains filtered or unexported fields }
func (*GetResponse) Descriptor
deprecated
func (*GetResponse) Descriptor() ([]byte, []int)
Deprecated: Use GetResponse.ProtoReflect.Descriptor instead.
func (*GetResponse) GetUser ¶
func (x *GetResponse) GetUser() *User
func (*GetResponse) ProtoMessage ¶
func (*GetResponse) ProtoMessage()
func (*GetResponse) ProtoReflect ¶
func (x *GetResponse) ProtoReflect() protoreflect.Message
func (*GetResponse) Reset ¶
func (x *GetResponse) Reset()
func (*GetResponse) String ¶
func (x *GetResponse) String() string
type UnimplementedUserServiceServer ¶
type UnimplementedUserServiceServer struct { }
UnimplementedUserServiceServer can be embedded to have forward compatible implementations.
func (*UnimplementedUserServiceServer) Get ¶
func (*UnimplementedUserServiceServer) Get(context.Context, *GetRequest) (*GetResponse, error)
func (*UnimplementedUserServiceServer) GetAll ¶
func (*UnimplementedUserServiceServer) GetAll(*GetAllRequest, UserService_GetAllServer) error
type User ¶
type User struct { Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` FirstName string `protobuf:"bytes,2,opt,name=first_name,json=firstName,proto3" json:"first_name,omitempty"` MiddleName string `protobuf:"bytes,3,opt,name=middle_name,json=middleName,proto3" json:"middle_name,omitempty"` LastName string `protobuf:"bytes,4,opt,name=last_name,json=lastName,proto3" json:"last_name,omitempty"` Email string `protobuf:"bytes,5,opt,name=email,proto3" json:"email,omitempty"` Password string `protobuf:"bytes,6,opt,name=password,proto3" json:"password,omitempty"` Avatar string `protobuf:"bytes,7,opt,name=avatar,proto3" json:"avatar,omitempty"` RememberToken string `protobuf:"bytes,8,opt,name=remember_token,json=rememberToken,proto3" json:"remember_token,omitempty"` StatusId uint32 `protobuf:"varint,9,opt,name=status_id,json=statusId,proto3" json:"status_id,omitempty"` VerifiedAt *timestamp.Timestamp `protobuf:"bytes,10,opt,name=verified_at,json=verifiedAt,proto3" json:"verified_at,omitempty"` CreatedAt *timestamp.Timestamp `protobuf:"bytes,11,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` UpdatedAt *timestamp.Timestamp `protobuf:"bytes,12,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"` // contains filtered or unexported fields }
func (*User) Descriptor
deprecated
func (*User) GetCreatedAt ¶
func (*User) GetFirstName ¶
func (*User) GetLastName ¶
func (*User) GetMiddleName ¶
func (*User) GetPassword ¶
func (*User) GetRememberToken ¶
func (*User) GetStatusId ¶
func (*User) GetUpdatedAt ¶
func (*User) GetVerifiedAt ¶
func (*User) ProtoMessage ¶
func (*User) ProtoMessage()
func (*User) ProtoReflect ¶
func (x *User) ProtoReflect() protoreflect.Message
type UserServiceClient ¶
type UserServiceClient interface { Get(ctx context.Context, in *GetRequest, opts ...grpc.CallOption) (*GetResponse, error) GetAll(ctx context.Context, in *GetAllRequest, opts ...grpc.CallOption) (UserService_GetAllClient, error) }
UserServiceClient is the client API for UserService service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
func NewUserServiceClient ¶
func NewUserServiceClient(cc grpc.ClientConnInterface) UserServiceClient
type UserServiceServer ¶
type UserServiceServer interface { Get(context.Context, *GetRequest) (*GetResponse, error) GetAll(*GetAllRequest, UserService_GetAllServer) error }
UserServiceServer is the server API for UserService service.
type UserService_GetAllClient ¶
type UserService_GetAllClient interface { Recv() (*GetAllResponse, error) grpc.ClientStream }
type UserService_GetAllServer ¶
type UserService_GetAllServer interface { Send(*GetAllResponse) error grpc.ServerStream }