Documentation ¶
Overview ¶
Package protos 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 UnimplementedUserServiceServer
- type User
- func (*User) Descriptor() ([]byte, []int)deprecated
- func (x *User) GetCreatedDate() *timestamp.Timestamp
- func (x *User) GetEmail() string
- func (x *User) GetId() int64
- func (x *User) GetUpdatedDate() *timestamp.Timestamp
- func (x *User) GetUsername() string
- func (*User) ProtoMessage()
- func (x *User) ProtoReflect() protoreflect.Message
- func (x *User) Reset()
- func (x *User) String() string
- func (m *User) Validate() error
- type UserLoginRequest
- func (*UserLoginRequest) Descriptor() ([]byte, []int)deprecated
- func (x *UserLoginRequest) GetPassword() string
- func (x *UserLoginRequest) GetUsername() string
- func (*UserLoginRequest) ProtoMessage()
- func (x *UserLoginRequest) ProtoReflect() protoreflect.Message
- func (x *UserLoginRequest) Reset()
- func (x *UserLoginRequest) String() string
- func (m *UserLoginRequest) Validate() error
- type UserLoginRequestValidationError
- func (e UserLoginRequestValidationError) Cause() error
- func (e UserLoginRequestValidationError) Error() string
- func (e UserLoginRequestValidationError) ErrorName() string
- func (e UserLoginRequestValidationError) Field() string
- func (e UserLoginRequestValidationError) Key() bool
- func (e UserLoginRequestValidationError) Reason() string
- type UserRegisterRequest
- func (*UserRegisterRequest) Descriptor() ([]byte, []int)deprecated
- func (x *UserRegisterRequest) GetEmail() string
- func (x *UserRegisterRequest) GetPassword() string
- func (x *UserRegisterRequest) GetPasswordRepeat() string
- func (x *UserRegisterRequest) GetUsername() string
- func (*UserRegisterRequest) ProtoMessage()
- func (x *UserRegisterRequest) ProtoReflect() protoreflect.Message
- func (x *UserRegisterRequest) Reset()
- func (x *UserRegisterRequest) String() string
- func (m *UserRegisterRequest) Validate() error
- type UserRegisterRequestValidationError
- func (e UserRegisterRequestValidationError) Cause() error
- func (e UserRegisterRequestValidationError) Error() string
- func (e UserRegisterRequestValidationError) ErrorName() string
- func (e UserRegisterRequestValidationError) Field() string
- func (e UserRegisterRequestValidationError) Key() bool
- func (e UserRegisterRequestValidationError) Reason() string
- type UserResponse
- func (*UserResponse) Descriptor() ([]byte, []int)deprecated
- func (x *UserResponse) GetCode() int32
- func (x *UserResponse) GetDetails() *User
- func (x *UserResponse) GetMessage() string
- func (*UserResponse) ProtoMessage()
- func (x *UserResponse) ProtoReflect() protoreflect.Message
- func (x *UserResponse) Reset()
- func (x *UserResponse) String() string
- func (m *UserResponse) Validate() error
- type UserResponseValidationError
- func (e UserResponseValidationError) Cause() error
- func (e UserResponseValidationError) Error() string
- func (e UserResponseValidationError) ErrorName() string
- func (e UserResponseValidationError) Field() string
- func (e UserResponseValidationError) Key() bool
- func (e UserResponseValidationError) Reason() string
- type UserServiceClient
- type UserServiceServer
- type UserValidationError
Constants ¶
This section is empty.
Variables ¶
var File_users_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 UnimplementedUserServiceServer ¶
type UnimplementedUserServiceServer struct { }
UnimplementedUserServiceServer can be embedded to have forward compatible implementations.
func (*UnimplementedUserServiceServer) Login ¶
func (*UnimplementedUserServiceServer) Login(context.Context, *UserLoginRequest) (*UserResponse, error)
func (*UnimplementedUserServiceServer) Register ¶
func (*UnimplementedUserServiceServer) Register(context.Context, *UserRegisterRequest) (*UserResponse, error)
type User ¶
type User struct { Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` Username string `protobuf:"bytes,2,opt,name=username,proto3" json:"username,omitempty"` Email string `protobuf:"bytes,3,opt,name=email,proto3" json:"email,omitempty"` CreatedDate *timestamp.Timestamp `protobuf:"bytes,4,opt,name=Created_date,json=CreatedDate,proto3" json:"Created_date,omitempty"` UpdatedDate *timestamp.Timestamp `protobuf:"bytes,5,opt,name=updated_date,json=updatedDate,proto3" json:"updated_date,omitempty"` // contains filtered or unexported fields }
func (*User) Descriptor
deprecated
func (*User) GetCreatedDate ¶
func (*User) GetUpdatedDate ¶
func (*User) GetUsername ¶
func (*User) ProtoMessage ¶
func (*User) ProtoMessage()
func (*User) ProtoReflect ¶
func (x *User) ProtoReflect() protoreflect.Message
type UserLoginRequest ¶
type UserLoginRequest struct { Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"` Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"` // contains filtered or unexported fields }
func (*UserLoginRequest) Descriptor
deprecated
func (*UserLoginRequest) Descriptor() ([]byte, []int)
Deprecated: Use UserLoginRequest.ProtoReflect.Descriptor instead.
func (*UserLoginRequest) GetPassword ¶
func (x *UserLoginRequest) GetPassword() string
func (*UserLoginRequest) GetUsername ¶
func (x *UserLoginRequest) GetUsername() string
func (*UserLoginRequest) ProtoMessage ¶
func (*UserLoginRequest) ProtoMessage()
func (*UserLoginRequest) ProtoReflect ¶
func (x *UserLoginRequest) ProtoReflect() protoreflect.Message
func (*UserLoginRequest) Reset ¶
func (x *UserLoginRequest) Reset()
func (*UserLoginRequest) String ¶
func (x *UserLoginRequest) String() string
func (*UserLoginRequest) Validate ¶
func (m *UserLoginRequest) Validate() error
Validate checks the field values on UserLoginRequest with the rules defined in the proto definition for this message. If any rules are violated, an error is returned.
type UserLoginRequestValidationError ¶
type UserLoginRequestValidationError struct {
// contains filtered or unexported fields
}
UserLoginRequestValidationError is the validation error returned by UserLoginRequest.Validate if the designated constraints aren't met.
func (UserLoginRequestValidationError) Cause ¶
func (e UserLoginRequestValidationError) Cause() error
Cause function returns cause value.
func (UserLoginRequestValidationError) Error ¶
func (e UserLoginRequestValidationError) Error() string
Error satisfies the builtin error interface
func (UserLoginRequestValidationError) ErrorName ¶
func (e UserLoginRequestValidationError) ErrorName() string
ErrorName returns error name.
func (UserLoginRequestValidationError) Field ¶
func (e UserLoginRequestValidationError) Field() string
Field function returns field value.
func (UserLoginRequestValidationError) Key ¶
func (e UserLoginRequestValidationError) Key() bool
Key function returns key value.
func (UserLoginRequestValidationError) Reason ¶
func (e UserLoginRequestValidationError) Reason() string
Reason function returns reason value.
type UserRegisterRequest ¶
type UserRegisterRequest struct { Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"` Email string `protobuf:"bytes,2,opt,name=email,proto3" json:"email,omitempty"` Password string `protobuf:"bytes,3,opt,name=password,proto3" json:"password,omitempty"` PasswordRepeat string `protobuf:"bytes,4,opt,name=passwordRepeat,proto3" json:"passwordRepeat,omitempty"` // contains filtered or unexported fields }
func (*UserRegisterRequest) Descriptor
deprecated
func (*UserRegisterRequest) Descriptor() ([]byte, []int)
Deprecated: Use UserRegisterRequest.ProtoReflect.Descriptor instead.
func (*UserRegisterRequest) GetEmail ¶
func (x *UserRegisterRequest) GetEmail() string
func (*UserRegisterRequest) GetPassword ¶
func (x *UserRegisterRequest) GetPassword() string
func (*UserRegisterRequest) GetPasswordRepeat ¶
func (x *UserRegisterRequest) GetPasswordRepeat() string
func (*UserRegisterRequest) GetUsername ¶
func (x *UserRegisterRequest) GetUsername() string
func (*UserRegisterRequest) ProtoMessage ¶
func (*UserRegisterRequest) ProtoMessage()
func (*UserRegisterRequest) ProtoReflect ¶
func (x *UserRegisterRequest) ProtoReflect() protoreflect.Message
func (*UserRegisterRequest) Reset ¶
func (x *UserRegisterRequest) Reset()
func (*UserRegisterRequest) String ¶
func (x *UserRegisterRequest) String() string
func (*UserRegisterRequest) Validate ¶
func (m *UserRegisterRequest) Validate() error
Validate checks the field values on UserRegisterRequest with the rules defined in the proto definition for this message. If any rules are violated, an error is returned.
type UserRegisterRequestValidationError ¶
type UserRegisterRequestValidationError struct {
// contains filtered or unexported fields
}
UserRegisterRequestValidationError is the validation error returned by UserRegisterRequest.Validate if the designated constraints aren't met.
func (UserRegisterRequestValidationError) Cause ¶
func (e UserRegisterRequestValidationError) Cause() error
Cause function returns cause value.
func (UserRegisterRequestValidationError) Error ¶
func (e UserRegisterRequestValidationError) Error() string
Error satisfies the builtin error interface
func (UserRegisterRequestValidationError) ErrorName ¶
func (e UserRegisterRequestValidationError) ErrorName() string
ErrorName returns error name.
func (UserRegisterRequestValidationError) Field ¶
func (e UserRegisterRequestValidationError) Field() string
Field function returns field value.
func (UserRegisterRequestValidationError) Key ¶
func (e UserRegisterRequestValidationError) Key() bool
Key function returns key value.
func (UserRegisterRequestValidationError) Reason ¶
func (e UserRegisterRequestValidationError) Reason() string
Reason function returns reason value.
type UserResponse ¶
type UserResponse struct { Code int32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` Details *User `protobuf:"bytes,3,opt,name=details,proto3" json:"details,omitempty"` // contains filtered or unexported fields }
func (*UserResponse) Descriptor
deprecated
func (*UserResponse) Descriptor() ([]byte, []int)
Deprecated: Use UserResponse.ProtoReflect.Descriptor instead.
func (*UserResponse) GetCode ¶
func (x *UserResponse) GetCode() int32
func (*UserResponse) GetDetails ¶
func (x *UserResponse) GetDetails() *User
func (*UserResponse) GetMessage ¶
func (x *UserResponse) GetMessage() string
func (*UserResponse) ProtoMessage ¶
func (*UserResponse) ProtoMessage()
func (*UserResponse) ProtoReflect ¶
func (x *UserResponse) ProtoReflect() protoreflect.Message
func (*UserResponse) Reset ¶
func (x *UserResponse) Reset()
func (*UserResponse) String ¶
func (x *UserResponse) String() string
func (*UserResponse) Validate ¶
func (m *UserResponse) Validate() error
Validate checks the field values on UserResponse with the rules defined in the proto definition for this message. If any rules are violated, an error is returned.
type UserResponseValidationError ¶
type UserResponseValidationError struct {
// contains filtered or unexported fields
}
UserResponseValidationError is the validation error returned by UserResponse.Validate if the designated constraints aren't met.
func (UserResponseValidationError) Cause ¶
func (e UserResponseValidationError) Cause() error
Cause function returns cause value.
func (UserResponseValidationError) Error ¶
func (e UserResponseValidationError) Error() string
Error satisfies the builtin error interface
func (UserResponseValidationError) ErrorName ¶
func (e UserResponseValidationError) ErrorName() string
ErrorName returns error name.
func (UserResponseValidationError) Field ¶
func (e UserResponseValidationError) Field() string
Field function returns field value.
func (UserResponseValidationError) Key ¶
func (e UserResponseValidationError) Key() bool
Key function returns key value.
func (UserResponseValidationError) Reason ¶
func (e UserResponseValidationError) Reason() string
Reason function returns reason value.
type UserServiceClient ¶
type UserServiceClient interface { Register(ctx context.Context, in *UserRegisterRequest, opts ...grpc.CallOption) (*UserResponse, error) Login(ctx context.Context, in *UserLoginRequest, opts ...grpc.CallOption) (*UserResponse, 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 { Register(context.Context, *UserRegisterRequest) (*UserResponse, error) Login(context.Context, *UserLoginRequest) (*UserResponse, error) }
UserServiceServer is the server API for UserService service.
type UserValidationError ¶
type UserValidationError struct {
// contains filtered or unexported fields
}
UserValidationError is the validation error returned by User.Validate if the designated constraints aren't met.
func (UserValidationError) Cause ¶
func (e UserValidationError) Cause() error
Cause function returns cause value.
func (UserValidationError) Error ¶
func (e UserValidationError) Error() string
Error satisfies the builtin error interface
func (UserValidationError) ErrorName ¶
func (e UserValidationError) ErrorName() string
ErrorName returns error name.
func (UserValidationError) Field ¶
func (e UserValidationError) Field() string
Field function returns field value.
func (UserValidationError) Key ¶
func (e UserValidationError) Key() bool
Key function returns key value.
func (UserValidationError) Reason ¶
func (e UserValidationError) Reason() string
Reason function returns reason value.