Documentation ¶
Overview ¶
Package pb is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Variables
- func RegisterBankServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterBankServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client BankServiceClient) error
- func RegisterBankServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterBankServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server BankServiceServer) error
- func RegisterBankServiceServer(s grpc.ServiceRegistrar, srv BankServiceServer)
- type BankServiceClient
- type BankServiceServer
- type LoginRequest
- func (*LoginRequest) Descriptor() ([]byte, []int)deprecated
- func (x *LoginRequest) GetPassword() string
- func (x *LoginRequest) GetUsername() string
- func (*LoginRequest) ProtoMessage()
- func (x *LoginRequest) ProtoReflect() protoreflect.Message
- func (x *LoginRequest) Reset()
- func (x *LoginRequest) String() string
- type LoginResponse
- func (*LoginResponse) Descriptor() ([]byte, []int)deprecated
- func (x *LoginResponse) GetAccessToken() string
- func (x *LoginResponse) GetAccessTokenExpiresAt() *timestamp.Timestamp
- func (x *LoginResponse) GetRefreshToken() string
- func (x *LoginResponse) GetRefreshTokenExpiresAt() *timestamp.Timestamp
- func (x *LoginResponse) GetSessionId() string
- func (x *LoginResponse) GetUser() *UserResponse
- func (*LoginResponse) ProtoMessage()
- func (x *LoginResponse) ProtoReflect() protoreflect.Message
- func (x *LoginResponse) Reset()
- func (x *LoginResponse) String() string
- type LogoutRequest
- type LogoutResponse
- type UnimplementedBankServiceServer
- func (UnimplementedBankServiceServer) CreateUser(context.Context, *UserRequest) (*UserResponse, error)
- func (UnimplementedBankServiceServer) DeleteUser(context.Context, *Username) (*empty.Empty, error)
- func (UnimplementedBankServiceServer) GetUser(context.Context, *Username) (*UserResponse, error)
- func (UnimplementedBankServiceServer) Login(context.Context, *LoginRequest) (*LoginResponse, error)
- func (UnimplementedBankServiceServer) Logout(context.Context, *LogoutRequest) (*empty.Empty, error)
- func (UnimplementedBankServiceServer) UpdateUser(context.Context, *UserUpdateRequest) (*UserResponse, error)
- type UnsafeBankServiceServer
- type User
- func (*User) Descriptor() ([]byte, []int)deprecated
- func (x *User) GetCreatedAt() *timestamp.Timestamp
- func (x *User) GetEmail() string
- func (x *User) GetFullName() string
- func (x *User) GetHashedPassword() string
- func (x *User) GetPasswordChangedAt() *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
- type UserRequest
- func (*UserRequest) Descriptor() ([]byte, []int)deprecated
- func (x *UserRequest) GetEmail() string
- func (x *UserRequest) GetFullName() string
- func (x *UserRequest) GetPassword() string
- func (x *UserRequest) GetPasswordConfirm() string
- func (x *UserRequest) GetUsername() string
- func (*UserRequest) ProtoMessage()
- func (x *UserRequest) ProtoReflect() protoreflect.Message
- func (x *UserRequest) Reset()
- func (x *UserRequest) String() string
- type UserResponse
- func (*UserResponse) Descriptor() ([]byte, []int)deprecated
- func (x *UserResponse) GetCreatedAt() *timestamp.Timestamp
- func (x *UserResponse) GetEmail() string
- func (x *UserResponse) GetFullName() string
- func (x *UserResponse) GetPasswordChangedAt() *timestamp.Timestamp
- func (x *UserResponse) GetUsername() string
- func (*UserResponse) ProtoMessage()
- func (x *UserResponse) ProtoReflect() protoreflect.Message
- func (x *UserResponse) Reset()
- func (x *UserResponse) String() string
- type UserUpdatePassword
- func (*UserUpdatePassword) Descriptor() ([]byte, []int)deprecated
- func (x *UserUpdatePassword) GetNewPassword() string
- func (x *UserUpdatePassword) GetOldPassword() string
- func (*UserUpdatePassword) ProtoMessage()
- func (x *UserUpdatePassword) ProtoReflect() protoreflect.Message
- func (x *UserUpdatePassword) Reset()
- func (x *UserUpdatePassword) String() string
- type UserUpdateRequest
- func (*UserUpdateRequest) Descriptor() ([]byte, []int)deprecated
- func (x *UserUpdateRequest) GetEmail() string
- func (x *UserUpdateRequest) GetFullName() string
- func (x *UserUpdateRequest) GetPassword() *UserUpdatePassword
- func (*UserUpdateRequest) ProtoMessage()
- func (x *UserUpdateRequest) ProtoReflect() protoreflect.Message
- func (x *UserUpdateRequest) Reset()
- func (x *UserUpdateRequest) String() string
- type Username
Constants ¶
This section is empty.
Variables ¶
var BankService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "pb.BankService", HandlerType: (*BankServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Login", Handler: _BankService_Login_Handler, }, { MethodName: "Logout", Handler: _BankService_Logout_Handler, }, { MethodName: "CreateUser", Handler: _BankService_CreateUser_Handler, }, { MethodName: "GetUser", Handler: _BankService_GetUser_Handler, }, { MethodName: "UpdateUser", Handler: _BankService_UpdateUser_Handler, }, { MethodName: "DeleteUser", Handler: _BankService_DeleteUser_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "rpc_bank.proto", }
BankService_ServiceDesc is the grpc.ServiceDesc for BankService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
var File_rpc_bank_proto protoreflect.FileDescriptor
var File_rpc_user_login_proto protoreflect.FileDescriptor
var File_rpc_user_proto protoreflect.FileDescriptor
var File_rpc_user_update_proto protoreflect.FileDescriptor
var File_user_proto protoreflect.FileDescriptor
Functions ¶
func RegisterBankServiceHandler ¶
func RegisterBankServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
RegisterBankServiceHandler registers the http handlers for service BankService to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterBankServiceHandlerClient ¶
func RegisterBankServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client BankServiceClient) error
RegisterBankServiceHandlerClient registers the http handlers for service BankService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "BankServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "BankServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "BankServiceClient" to call the correct interceptors.
func RegisterBankServiceHandlerFromEndpoint ¶
func RegisterBankServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterBankServiceHandlerFromEndpoint is same as RegisterBankServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterBankServiceHandlerServer ¶
func RegisterBankServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server BankServiceServer) error
RegisterBankServiceHandlerServer registers the http handlers for service BankService to "mux". UnaryRPC :call BankServiceServer 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 RegisterBankServiceHandlerFromEndpoint instead.
func RegisterBankServiceServer ¶
func RegisterBankServiceServer(s grpc.ServiceRegistrar, srv BankServiceServer)
Types ¶
type BankServiceClient ¶
type BankServiceClient interface { // Auth gRPC calls Login(ctx context.Context, in *LoginRequest, opts ...grpc.CallOption) (*LoginResponse, error) Logout(ctx context.Context, in *LogoutRequest, opts ...grpc.CallOption) (*empty.Empty, error) // User gRPC calls CreateUser(ctx context.Context, in *UserRequest, opts ...grpc.CallOption) (*UserResponse, error) GetUser(ctx context.Context, in *Username, opts ...grpc.CallOption) (*UserResponse, error) UpdateUser(ctx context.Context, in *UserUpdateRequest, opts ...grpc.CallOption) (*UserResponse, error) DeleteUser(ctx context.Context, in *Username, opts ...grpc.CallOption) (*empty.Empty, error) }
BankServiceClient is the client API for BankService 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 NewBankServiceClient ¶
func NewBankServiceClient(cc grpc.ClientConnInterface) BankServiceClient
type BankServiceServer ¶
type BankServiceServer interface { // Auth gRPC calls Login(context.Context, *LoginRequest) (*LoginResponse, error) Logout(context.Context, *LogoutRequest) (*empty.Empty, error) // User gRPC calls CreateUser(context.Context, *UserRequest) (*UserResponse, error) GetUser(context.Context, *Username) (*UserResponse, error) UpdateUser(context.Context, *UserUpdateRequest) (*UserResponse, error) DeleteUser(context.Context, *Username) (*empty.Empty, error) // contains filtered or unexported methods }
BankServiceServer is the server API for BankService service. All implementations must embed UnimplementedBankServiceServer for forward compatibility
type LoginRequest ¶
type LoginRequest 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 (*LoginRequest) Descriptor
deprecated
func (*LoginRequest) Descriptor() ([]byte, []int)
Deprecated: Use LoginRequest.ProtoReflect.Descriptor instead.
func (*LoginRequest) GetPassword ¶
func (x *LoginRequest) GetPassword() string
func (*LoginRequest) GetUsername ¶
func (x *LoginRequest) GetUsername() string
func (*LoginRequest) ProtoMessage ¶
func (*LoginRequest) ProtoMessage()
func (*LoginRequest) ProtoReflect ¶
func (x *LoginRequest) ProtoReflect() protoreflect.Message
func (*LoginRequest) Reset ¶
func (x *LoginRequest) Reset()
func (*LoginRequest) String ¶
func (x *LoginRequest) String() string
type LoginResponse ¶
type LoginResponse struct { SessionId string `protobuf:"bytes,1,opt,name=session_id,json=sessionId,proto3" json:"session_id,omitempty"` AccessToken string `protobuf:"bytes,2,opt,name=access_token,json=accessToken,proto3" json:"access_token,omitempty"` RefreshToken string `protobuf:"bytes,3,opt,name=refresh_token,json=refreshToken,proto3" json:"refresh_token,omitempty"` AccessTokenExpiresAt *timestamp.Timestamp `protobuf:"bytes,4,opt,name=access_token_expires_at,json=accessTokenExpiresAt,proto3" json:"access_token_expires_at,omitempty"` RefreshTokenExpiresAt *timestamp.Timestamp `` /* 128-byte string literal not displayed */ User *UserResponse `protobuf:"bytes,6,opt,name=user,proto3" json:"user,omitempty"` // contains filtered or unexported fields }
func (*LoginResponse) Descriptor
deprecated
func (*LoginResponse) Descriptor() ([]byte, []int)
Deprecated: Use LoginResponse.ProtoReflect.Descriptor instead.
func (*LoginResponse) GetAccessToken ¶
func (x *LoginResponse) GetAccessToken() string
func (*LoginResponse) GetAccessTokenExpiresAt ¶
func (x *LoginResponse) GetAccessTokenExpiresAt() *timestamp.Timestamp
func (*LoginResponse) GetRefreshToken ¶
func (x *LoginResponse) GetRefreshToken() string
func (*LoginResponse) GetRefreshTokenExpiresAt ¶
func (x *LoginResponse) GetRefreshTokenExpiresAt() *timestamp.Timestamp
func (*LoginResponse) GetSessionId ¶
func (x *LoginResponse) GetSessionId() string
func (*LoginResponse) GetUser ¶
func (x *LoginResponse) GetUser() *UserResponse
func (*LoginResponse) ProtoMessage ¶
func (*LoginResponse) ProtoMessage()
func (*LoginResponse) ProtoReflect ¶
func (x *LoginResponse) ProtoReflect() protoreflect.Message
func (*LoginResponse) Reset ¶
func (x *LoginResponse) Reset()
func (*LoginResponse) String ¶
func (x *LoginResponse) String() string
type LogoutRequest ¶
type LogoutRequest struct { Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"` // contains filtered or unexported fields }
func (*LogoutRequest) Descriptor
deprecated
func (*LogoutRequest) Descriptor() ([]byte, []int)
Deprecated: Use LogoutRequest.ProtoReflect.Descriptor instead.
func (*LogoutRequest) GetUsername ¶
func (x *LogoutRequest) GetUsername() string
func (*LogoutRequest) ProtoMessage ¶
func (*LogoutRequest) ProtoMessage()
func (*LogoutRequest) ProtoReflect ¶
func (x *LogoutRequest) ProtoReflect() protoreflect.Message
func (*LogoutRequest) Reset ¶
func (x *LogoutRequest) Reset()
func (*LogoutRequest) String ¶
func (x *LogoutRequest) String() string
type LogoutResponse ¶
type LogoutResponse struct { Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"` // contains filtered or unexported fields }
func (*LogoutResponse) Descriptor
deprecated
func (*LogoutResponse) Descriptor() ([]byte, []int)
Deprecated: Use LogoutResponse.ProtoReflect.Descriptor instead.
func (*LogoutResponse) GetUsername ¶
func (x *LogoutResponse) GetUsername() string
func (*LogoutResponse) ProtoMessage ¶
func (*LogoutResponse) ProtoMessage()
func (*LogoutResponse) ProtoReflect ¶
func (x *LogoutResponse) ProtoReflect() protoreflect.Message
func (*LogoutResponse) Reset ¶
func (x *LogoutResponse) Reset()
func (*LogoutResponse) String ¶
func (x *LogoutResponse) String() string
type UnimplementedBankServiceServer ¶
type UnimplementedBankServiceServer struct { }
UnimplementedBankServiceServer must be embedded to have forward compatible implementations.
func (UnimplementedBankServiceServer) CreateUser ¶
func (UnimplementedBankServiceServer) CreateUser(context.Context, *UserRequest) (*UserResponse, error)
func (UnimplementedBankServiceServer) DeleteUser ¶
func (UnimplementedBankServiceServer) GetUser ¶
func (UnimplementedBankServiceServer) GetUser(context.Context, *Username) (*UserResponse, error)
func (UnimplementedBankServiceServer) Login ¶
func (UnimplementedBankServiceServer) Login(context.Context, *LoginRequest) (*LoginResponse, error)
func (UnimplementedBankServiceServer) Logout ¶
func (UnimplementedBankServiceServer) Logout(context.Context, *LogoutRequest) (*empty.Empty, error)
func (UnimplementedBankServiceServer) UpdateUser ¶
func (UnimplementedBankServiceServer) UpdateUser(context.Context, *UserUpdateRequest) (*UserResponse, error)
type UnsafeBankServiceServer ¶
type UnsafeBankServiceServer interface {
// contains filtered or unexported methods
}
UnsafeBankServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to BankServiceServer will result in compilation errors.
type User ¶
type User struct { Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"` HashedPassword string `protobuf:"bytes,2,opt,name=hashedPassword,proto3" json:"hashedPassword,omitempty"` FullName string `protobuf:"bytes,3,opt,name=fullName,proto3" json:"fullName,omitempty"` Email string `protobuf:"bytes,4,opt,name=email,proto3" json:"email,omitempty"` PasswordChangedAt *timestamp.Timestamp `protobuf:"bytes,5,opt,name=password_changed_at,json=passwordChangedAt,proto3" json:"password_changed_at,omitempty"` CreatedAt *timestamp.Timestamp `protobuf:"bytes,6,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` // contains filtered or unexported fields }
func (*User) Descriptor
deprecated
func (*User) GetCreatedAt ¶
func (*User) GetFullName ¶
func (*User) GetHashedPassword ¶
func (*User) GetPasswordChangedAt ¶
func (*User) GetUsername ¶
func (*User) ProtoMessage ¶
func (*User) ProtoMessage()
func (*User) ProtoReflect ¶
func (x *User) ProtoReflect() protoreflect.Message
type UserRequest ¶
type UserRequest struct { Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"` FullName string `protobuf:"bytes,2,opt,name=full_name,json=fullName,proto3" json:"full_name,omitempty"` Email string `protobuf:"bytes,3,opt,name=email,proto3" json:"email,omitempty"` Password string `protobuf:"bytes,4,opt,name=password,proto3" json:"password,omitempty"` PasswordConfirm string `protobuf:"bytes,5,opt,name=password_confirm,json=passwordConfirm,proto3" json:"password_confirm,omitempty"` // contains filtered or unexported fields }
func (*UserRequest) Descriptor
deprecated
func (*UserRequest) Descriptor() ([]byte, []int)
Deprecated: Use UserRequest.ProtoReflect.Descriptor instead.
func (*UserRequest) GetEmail ¶
func (x *UserRequest) GetEmail() string
func (*UserRequest) GetFullName ¶
func (x *UserRequest) GetFullName() string
func (*UserRequest) GetPassword ¶
func (x *UserRequest) GetPassword() string
func (*UserRequest) GetPasswordConfirm ¶
func (x *UserRequest) GetPasswordConfirm() string
func (*UserRequest) GetUsername ¶
func (x *UserRequest) GetUsername() string
func (*UserRequest) ProtoMessage ¶
func (*UserRequest) ProtoMessage()
func (*UserRequest) ProtoReflect ¶
func (x *UserRequest) ProtoReflect() protoreflect.Message
func (*UserRequest) Reset ¶
func (x *UserRequest) Reset()
func (*UserRequest) String ¶
func (x *UserRequest) String() string
type UserResponse ¶
type UserResponse struct { Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"` FullName string `protobuf:"bytes,2,opt,name=full_name,json=fullName,proto3" json:"full_name,omitempty"` Email string `protobuf:"bytes,3,opt,name=email,proto3" json:"email,omitempty"` CreatedAt *timestamp.Timestamp `protobuf:"bytes,4,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` PasswordChangedAt *timestamp.Timestamp `protobuf:"bytes,5,opt,name=password_changed_at,json=passwordChangedAt,proto3" json:"password_changed_at,omitempty"` // contains filtered or unexported fields }
func (*UserResponse) Descriptor
deprecated
func (*UserResponse) Descriptor() ([]byte, []int)
Deprecated: Use UserResponse.ProtoReflect.Descriptor instead.
func (*UserResponse) GetCreatedAt ¶
func (x *UserResponse) GetCreatedAt() *timestamp.Timestamp
func (*UserResponse) GetEmail ¶
func (x *UserResponse) GetEmail() string
func (*UserResponse) GetFullName ¶
func (x *UserResponse) GetFullName() string
func (*UserResponse) GetPasswordChangedAt ¶
func (x *UserResponse) GetPasswordChangedAt() *timestamp.Timestamp
func (*UserResponse) GetUsername ¶
func (x *UserResponse) GetUsername() 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
type UserUpdatePassword ¶
type UserUpdatePassword struct { OldPassword string `protobuf:"bytes,3,opt,name=old_password,json=oldPassword,proto3" json:"old_password,omitempty"` NewPassword string `protobuf:"bytes,4,opt,name=new_password,json=newPassword,proto3" json:"new_password,omitempty"` // contains filtered or unexported fields }
func (*UserUpdatePassword) Descriptor
deprecated
func (*UserUpdatePassword) Descriptor() ([]byte, []int)
Deprecated: Use UserUpdatePassword.ProtoReflect.Descriptor instead.
func (*UserUpdatePassword) GetNewPassword ¶
func (x *UserUpdatePassword) GetNewPassword() string
func (*UserUpdatePassword) GetOldPassword ¶
func (x *UserUpdatePassword) GetOldPassword() string
func (*UserUpdatePassword) ProtoMessage ¶
func (*UserUpdatePassword) ProtoMessage()
func (*UserUpdatePassword) ProtoReflect ¶
func (x *UserUpdatePassword) ProtoReflect() protoreflect.Message
func (*UserUpdatePassword) Reset ¶
func (x *UserUpdatePassword) Reset()
func (*UserUpdatePassword) String ¶
func (x *UserUpdatePassword) String() string
type UserUpdateRequest ¶
type UserUpdateRequest struct { FullName *string `protobuf:"bytes,1,opt,name=full_name,json=fullName,proto3,oneof" json:"full_name,omitempty"` Email *string `protobuf:"bytes,2,opt,name=email,proto3,oneof" json:"email,omitempty"` Password *UserUpdatePassword `protobuf:"bytes,3,opt,name=password,proto3,oneof" json:"password,omitempty"` // contains filtered or unexported fields }
func (*UserUpdateRequest) Descriptor
deprecated
func (*UserUpdateRequest) Descriptor() ([]byte, []int)
Deprecated: Use UserUpdateRequest.ProtoReflect.Descriptor instead.
func (*UserUpdateRequest) GetEmail ¶
func (x *UserUpdateRequest) GetEmail() string
func (*UserUpdateRequest) GetFullName ¶
func (x *UserUpdateRequest) GetFullName() string
func (*UserUpdateRequest) GetPassword ¶
func (x *UserUpdateRequest) GetPassword() *UserUpdatePassword
func (*UserUpdateRequest) ProtoMessage ¶
func (*UserUpdateRequest) ProtoMessage()
func (*UserUpdateRequest) ProtoReflect ¶
func (x *UserUpdateRequest) ProtoReflect() protoreflect.Message
func (*UserUpdateRequest) Reset ¶
func (x *UserUpdateRequest) Reset()
func (*UserUpdateRequest) String ¶
func (x *UserUpdateRequest) String() string
type Username ¶
type Username struct { Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"` // contains filtered or unexported fields }
func (*Username) Descriptor
deprecated
func (*Username) GetUsername ¶
func (*Username) ProtoMessage ¶
func (*Username) ProtoMessage()
func (*Username) ProtoReflect ¶
func (x *Username) ProtoReflect() protoreflect.Message