Documentation ¶
Overview ¶
Package pb is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Constants
- Variables
- func RegisterPggoBankHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterPggoBankHandlerClient(ctx context.Context, mux *runtime.ServeMux, client PggoBankClient) error
- func RegisterPggoBankHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterPggoBankHandlerServer(ctx context.Context, mux *runtime.ServeMux, server PggoBankServer) error
- func RegisterPggoBankServer(s grpc.ServiceRegistrar, srv PggoBankServer)
- type CreateUserRequest
- func (*CreateUserRequest) Descriptor() ([]byte, []int)deprecated
- func (x *CreateUserRequest) GetEmail() string
- func (x *CreateUserRequest) GetFullName() string
- func (x *CreateUserRequest) GetPassword() string
- func (x *CreateUserRequest) GetUsername() string
- func (*CreateUserRequest) ProtoMessage()
- func (x *CreateUserRequest) ProtoReflect() protoreflect.Message
- func (x *CreateUserRequest) Reset()
- func (x *CreateUserRequest) String() string
- type CreateUserResponse
- type LoginUserRequest
- func (*LoginUserRequest) Descriptor() ([]byte, []int)deprecated
- func (x *LoginUserRequest) GetPassword() string
- func (x *LoginUserRequest) GetUsername() string
- func (*LoginUserRequest) ProtoMessage()
- func (x *LoginUserRequest) ProtoReflect() protoreflect.Message
- func (x *LoginUserRequest) Reset()
- func (x *LoginUserRequest) String() string
- type LoginUserResponse
- func (*LoginUserResponse) Descriptor() ([]byte, []int)deprecated
- func (x *LoginUserResponse) GetAccessToken() string
- func (x *LoginUserResponse) GetAccessTokenExpiresAt() *timestamppb.Timestamp
- func (x *LoginUserResponse) GetRefreshToken() string
- func (x *LoginUserResponse) GetRefreshTokenExpiresAt() *timestamppb.Timestamp
- func (x *LoginUserResponse) GetSessionId() string
- func (x *LoginUserResponse) GetUser() *User
- func (*LoginUserResponse) ProtoMessage()
- func (x *LoginUserResponse) ProtoReflect() protoreflect.Message
- func (x *LoginUserResponse) Reset()
- func (x *LoginUserResponse) String() string
- type PggoBankClient
- type PggoBankServer
- type UnimplementedPggoBankServer
- func (UnimplementedPggoBankServer) CreateUser(context.Context, *CreateUserRequest) (*CreateUserResponse, error)
- func (UnimplementedPggoBankServer) LoginUser(context.Context, *LoginUserRequest) (*LoginUserResponse, error)
- func (UnimplementedPggoBankServer) UpdateUser(context.Context, *UpdateUserRequest) (*UpdateUserResponse, error)
- func (UnimplementedPggoBankServer) VerifyEmail(context.Context, *VerifyEmailRequest) (*VerifyEmailResponse, error)
- type UnsafePggoBankServer
- type UpdateUserRequest
- func (*UpdateUserRequest) Descriptor() ([]byte, []int)deprecated
- func (x *UpdateUserRequest) GetEmail() string
- func (x *UpdateUserRequest) GetFullName() string
- func (x *UpdateUserRequest) GetPassword() string
- func (x *UpdateUserRequest) GetUsername() string
- func (*UpdateUserRequest) ProtoMessage()
- func (x *UpdateUserRequest) ProtoReflect() protoreflect.Message
- func (x *UpdateUserRequest) Reset()
- func (x *UpdateUserRequest) String() string
- type UpdateUserResponse
- type User
- func (*User) Descriptor() ([]byte, []int)deprecated
- func (x *User) GetCreatedAt() *timestamppb.Timestamp
- func (x *User) GetEmail() string
- func (x *User) GetFullName() string
- func (x *User) GetPasswordChangedAt() *timestamppb.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 VerifyEmailRequest
- func (*VerifyEmailRequest) Descriptor() ([]byte, []int)deprecated
- func (x *VerifyEmailRequest) GetEmailId() int64
- func (x *VerifyEmailRequest) GetSecretCode() string
- func (*VerifyEmailRequest) ProtoMessage()
- func (x *VerifyEmailRequest) ProtoReflect() protoreflect.Message
- func (x *VerifyEmailRequest) Reset()
- func (x *VerifyEmailRequest) String() string
- type VerifyEmailResponse
- func (*VerifyEmailResponse) Descriptor() ([]byte, []int)deprecated
- func (x *VerifyEmailResponse) GetIsVerified() bool
- func (*VerifyEmailResponse) ProtoMessage()
- func (x *VerifyEmailResponse) ProtoReflect() protoreflect.Message
- func (x *VerifyEmailResponse) Reset()
- func (x *VerifyEmailResponse) String() string
Constants ¶
const ( PggoBank_CreateUser_FullMethodName = "/pb.PggoBank/CreateUser" PggoBank_UpdateUser_FullMethodName = "/pb.PggoBank/UpdateUser" PggoBank_LoginUser_FullMethodName = "/pb.PggoBank/LoginUser" PggoBank_VerifyEmail_FullMethodName = "/pb.PggoBank/VerifyEmail" )
Variables ¶
var File_rpc_create_user_proto protoreflect.FileDescriptor
var File_rpc_login_user_proto protoreflect.FileDescriptor
var File_rpc_update_user_proto protoreflect.FileDescriptor
var File_rpc_verify_email_proto protoreflect.FileDescriptor
var File_service_pggo_bank_proto protoreflect.FileDescriptor
var File_user_proto protoreflect.FileDescriptor
var PggoBank_ServiceDesc = grpc.ServiceDesc{ ServiceName: "pb.PggoBank", HandlerType: (*PggoBankServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "CreateUser", Handler: _PggoBank_CreateUser_Handler, }, { MethodName: "UpdateUser", Handler: _PggoBank_UpdateUser_Handler, }, { MethodName: "LoginUser", Handler: _PggoBank_LoginUser_Handler, }, { MethodName: "VerifyEmail", Handler: _PggoBank_VerifyEmail_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "service_pggo_bank.proto", }
PggoBank_ServiceDesc is the grpc.ServiceDesc for PggoBank service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterPggoBankHandler ¶
func RegisterPggoBankHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
RegisterPggoBankHandler registers the http handlers for service PggoBank to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterPggoBankHandlerClient ¶
func RegisterPggoBankHandlerClient(ctx context.Context, mux *runtime.ServeMux, client PggoBankClient) error
RegisterPggoBankHandlerClient registers the http handlers for service PggoBank to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "PggoBankClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "PggoBankClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "PggoBankClient" to call the correct interceptors.
func RegisterPggoBankHandlerFromEndpoint ¶
func RegisterPggoBankHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterPggoBankHandlerFromEndpoint is same as RegisterPggoBankHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterPggoBankHandlerServer ¶
func RegisterPggoBankHandlerServer(ctx context.Context, mux *runtime.ServeMux, server PggoBankServer) error
RegisterPggoBankHandlerServer registers the http handlers for service PggoBank to "mux". UnaryRPC :call PggoBankServer 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 RegisterPggoBankHandlerFromEndpoint instead.
func RegisterPggoBankServer ¶
func RegisterPggoBankServer(s grpc.ServiceRegistrar, srv PggoBankServer)
Types ¶
type CreateUserRequest ¶
type CreateUserRequest 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"` // contains filtered or unexported fields }
func (*CreateUserRequest) Descriptor
deprecated
func (*CreateUserRequest) Descriptor() ([]byte, []int)
Deprecated: Use CreateUserRequest.ProtoReflect.Descriptor instead.
func (*CreateUserRequest) GetEmail ¶
func (x *CreateUserRequest) GetEmail() string
func (*CreateUserRequest) GetFullName ¶
func (x *CreateUserRequest) GetFullName() string
func (*CreateUserRequest) GetPassword ¶
func (x *CreateUserRequest) GetPassword() string
func (*CreateUserRequest) GetUsername ¶
func (x *CreateUserRequest) GetUsername() string
func (*CreateUserRequest) ProtoMessage ¶
func (*CreateUserRequest) ProtoMessage()
func (*CreateUserRequest) ProtoReflect ¶
func (x *CreateUserRequest) ProtoReflect() protoreflect.Message
func (*CreateUserRequest) Reset ¶
func (x *CreateUserRequest) Reset()
func (*CreateUserRequest) String ¶
func (x *CreateUserRequest) String() string
type CreateUserResponse ¶
type CreateUserResponse struct { User *User `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"` // contains filtered or unexported fields }
func (*CreateUserResponse) Descriptor
deprecated
func (*CreateUserResponse) Descriptor() ([]byte, []int)
Deprecated: Use CreateUserResponse.ProtoReflect.Descriptor instead.
func (*CreateUserResponse) GetUser ¶
func (x *CreateUserResponse) GetUser() *User
func (*CreateUserResponse) ProtoMessage ¶
func (*CreateUserResponse) ProtoMessage()
func (*CreateUserResponse) ProtoReflect ¶
func (x *CreateUserResponse) ProtoReflect() protoreflect.Message
func (*CreateUserResponse) Reset ¶
func (x *CreateUserResponse) Reset()
func (*CreateUserResponse) String ¶
func (x *CreateUserResponse) String() string
type LoginUserRequest ¶
type LoginUserRequest 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 (*LoginUserRequest) Descriptor
deprecated
func (*LoginUserRequest) Descriptor() ([]byte, []int)
Deprecated: Use LoginUserRequest.ProtoReflect.Descriptor instead.
func (*LoginUserRequest) GetPassword ¶
func (x *LoginUserRequest) GetPassword() string
func (*LoginUserRequest) GetUsername ¶
func (x *LoginUserRequest) GetUsername() string
func (*LoginUserRequest) ProtoMessage ¶
func (*LoginUserRequest) ProtoMessage()
func (*LoginUserRequest) ProtoReflect ¶
func (x *LoginUserRequest) ProtoReflect() protoreflect.Message
func (*LoginUserRequest) Reset ¶
func (x *LoginUserRequest) Reset()
func (*LoginUserRequest) String ¶
func (x *LoginUserRequest) String() string
type LoginUserResponse ¶
type LoginUserResponse struct { User *User `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"` SessionId string `protobuf:"bytes,2,opt,name=session_id,json=sessionId,proto3" json:"session_id,omitempty"` AccessToken string `protobuf:"bytes,3,opt,name=access_token,json=accessToken,proto3" json:"access_token,omitempty"` RefreshToken string `protobuf:"bytes,4,opt,name=refresh_token,json=refreshToken,proto3" json:"refresh_token,omitempty"` AccessTokenExpiresAt *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=access_token_expires_at,json=accessTokenExpiresAt,proto3" json:"access_token_expires_at,omitempty"` RefreshTokenExpiresAt *timestamppb.Timestamp `` /* 128-byte string literal not displayed */ // contains filtered or unexported fields }
func (*LoginUserResponse) Descriptor
deprecated
func (*LoginUserResponse) Descriptor() ([]byte, []int)
Deprecated: Use LoginUserResponse.ProtoReflect.Descriptor instead.
func (*LoginUserResponse) GetAccessToken ¶
func (x *LoginUserResponse) GetAccessToken() string
func (*LoginUserResponse) GetAccessTokenExpiresAt ¶
func (x *LoginUserResponse) GetAccessTokenExpiresAt() *timestamppb.Timestamp
func (*LoginUserResponse) GetRefreshToken ¶
func (x *LoginUserResponse) GetRefreshToken() string
func (*LoginUserResponse) GetRefreshTokenExpiresAt ¶
func (x *LoginUserResponse) GetRefreshTokenExpiresAt() *timestamppb.Timestamp
func (*LoginUserResponse) GetSessionId ¶
func (x *LoginUserResponse) GetSessionId() string
func (*LoginUserResponse) GetUser ¶
func (x *LoginUserResponse) GetUser() *User
func (*LoginUserResponse) ProtoMessage ¶
func (*LoginUserResponse) ProtoMessage()
func (*LoginUserResponse) ProtoReflect ¶
func (x *LoginUserResponse) ProtoReflect() protoreflect.Message
func (*LoginUserResponse) Reset ¶
func (x *LoginUserResponse) Reset()
func (*LoginUserResponse) String ¶
func (x *LoginUserResponse) String() string
type PggoBankClient ¶
type PggoBankClient interface { CreateUser(ctx context.Context, in *CreateUserRequest, opts ...grpc.CallOption) (*CreateUserResponse, error) UpdateUser(ctx context.Context, in *UpdateUserRequest, opts ...grpc.CallOption) (*UpdateUserResponse, error) LoginUser(ctx context.Context, in *LoginUserRequest, opts ...grpc.CallOption) (*LoginUserResponse, error) VerifyEmail(ctx context.Context, in *VerifyEmailRequest, opts ...grpc.CallOption) (*VerifyEmailResponse, error) }
PggoBankClient is the client API for PggoBank 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 NewPggoBankClient ¶
func NewPggoBankClient(cc grpc.ClientConnInterface) PggoBankClient
type PggoBankServer ¶
type PggoBankServer interface { CreateUser(context.Context, *CreateUserRequest) (*CreateUserResponse, error) UpdateUser(context.Context, *UpdateUserRequest) (*UpdateUserResponse, error) LoginUser(context.Context, *LoginUserRequest) (*LoginUserResponse, error) VerifyEmail(context.Context, *VerifyEmailRequest) (*VerifyEmailResponse, error) // contains filtered or unexported methods }
PggoBankServer is the server API for PggoBank service. All implementations must embed UnimplementedPggoBankServer for forward compatibility
type UnimplementedPggoBankServer ¶
type UnimplementedPggoBankServer struct { }
UnimplementedPggoBankServer must be embedded to have forward compatible implementations.
func (UnimplementedPggoBankServer) CreateUser ¶
func (UnimplementedPggoBankServer) CreateUser(context.Context, *CreateUserRequest) (*CreateUserResponse, error)
func (UnimplementedPggoBankServer) LoginUser ¶
func (UnimplementedPggoBankServer) LoginUser(context.Context, *LoginUserRequest) (*LoginUserResponse, error)
func (UnimplementedPggoBankServer) UpdateUser ¶
func (UnimplementedPggoBankServer) UpdateUser(context.Context, *UpdateUserRequest) (*UpdateUserResponse, error)
func (UnimplementedPggoBankServer) VerifyEmail ¶
func (UnimplementedPggoBankServer) VerifyEmail(context.Context, *VerifyEmailRequest) (*VerifyEmailResponse, error)
type UnsafePggoBankServer ¶
type UnsafePggoBankServer interface {
// contains filtered or unexported methods
}
UnsafePggoBankServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to PggoBankServer will result in compilation errors.
type UpdateUserRequest ¶
type UpdateUserRequest 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,oneof" json:"full_name,omitempty"` Email *string `protobuf:"bytes,3,opt,name=email,proto3,oneof" json:"email,omitempty"` Password *string `protobuf:"bytes,4,opt,name=password,proto3,oneof" json:"password,omitempty"` // contains filtered or unexported fields }
func (*UpdateUserRequest) Descriptor
deprecated
func (*UpdateUserRequest) Descriptor() ([]byte, []int)
Deprecated: Use UpdateUserRequest.ProtoReflect.Descriptor instead.
func (*UpdateUserRequest) GetEmail ¶
func (x *UpdateUserRequest) GetEmail() string
func (*UpdateUserRequest) GetFullName ¶
func (x *UpdateUserRequest) GetFullName() string
func (*UpdateUserRequest) GetPassword ¶
func (x *UpdateUserRequest) GetPassword() string
func (*UpdateUserRequest) GetUsername ¶
func (x *UpdateUserRequest) GetUsername() string
func (*UpdateUserRequest) ProtoMessage ¶
func (*UpdateUserRequest) ProtoMessage()
func (*UpdateUserRequest) ProtoReflect ¶
func (x *UpdateUserRequest) ProtoReflect() protoreflect.Message
func (*UpdateUserRequest) Reset ¶
func (x *UpdateUserRequest) Reset()
func (*UpdateUserRequest) String ¶
func (x *UpdateUserRequest) String() string
type UpdateUserResponse ¶
type UpdateUserResponse struct { User *User `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"` // contains filtered or unexported fields }
func (*UpdateUserResponse) Descriptor
deprecated
func (*UpdateUserResponse) Descriptor() ([]byte, []int)
Deprecated: Use UpdateUserResponse.ProtoReflect.Descriptor instead.
func (*UpdateUserResponse) GetUser ¶
func (x *UpdateUserResponse) GetUser() *User
func (*UpdateUserResponse) ProtoMessage ¶
func (*UpdateUserResponse) ProtoMessage()
func (*UpdateUserResponse) ProtoReflect ¶
func (x *UpdateUserResponse) ProtoReflect() protoreflect.Message
func (*UpdateUserResponse) Reset ¶
func (x *UpdateUserResponse) Reset()
func (*UpdateUserResponse) String ¶
func (x *UpdateUserResponse) String() string
type User ¶
type User 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"` PasswordChangedAt *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=password_changed_at,json=passwordChangedAt,proto3" json:"password_changed_at,omitempty"` CreatedAt *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` // contains filtered or unexported fields }
func (*User) Descriptor
deprecated
func (*User) GetCreatedAt ¶
func (x *User) GetCreatedAt() *timestamppb.Timestamp
func (*User) GetFullName ¶
func (*User) GetPasswordChangedAt ¶
func (x *User) GetPasswordChangedAt() *timestamppb.Timestamp
func (*User) GetUsername ¶
func (*User) ProtoMessage ¶
func (*User) ProtoMessage()
func (*User) ProtoReflect ¶
func (x *User) ProtoReflect() protoreflect.Message
type VerifyEmailRequest ¶
type VerifyEmailRequest struct { EmailId int64 `protobuf:"varint,1,opt,name=email_id,json=emailId,proto3" json:"email_id,omitempty"` SecretCode string `protobuf:"bytes,2,opt,name=secret_code,json=secretCode,proto3" json:"secret_code,omitempty"` // contains filtered or unexported fields }
func (*VerifyEmailRequest) Descriptor
deprecated
func (*VerifyEmailRequest) Descriptor() ([]byte, []int)
Deprecated: Use VerifyEmailRequest.ProtoReflect.Descriptor instead.
func (*VerifyEmailRequest) GetEmailId ¶
func (x *VerifyEmailRequest) GetEmailId() int64
func (*VerifyEmailRequest) GetSecretCode ¶
func (x *VerifyEmailRequest) GetSecretCode() string
func (*VerifyEmailRequest) ProtoMessage ¶
func (*VerifyEmailRequest) ProtoMessage()
func (*VerifyEmailRequest) ProtoReflect ¶
func (x *VerifyEmailRequest) ProtoReflect() protoreflect.Message
func (*VerifyEmailRequest) Reset ¶
func (x *VerifyEmailRequest) Reset()
func (*VerifyEmailRequest) String ¶
func (x *VerifyEmailRequest) String() string
type VerifyEmailResponse ¶
type VerifyEmailResponse struct { IsVerified bool `protobuf:"varint,1,opt,name=is_verified,json=isVerified,proto3" json:"is_verified,omitempty"` // contains filtered or unexported fields }
func (*VerifyEmailResponse) Descriptor
deprecated
func (*VerifyEmailResponse) Descriptor() ([]byte, []int)
Deprecated: Use VerifyEmailResponse.ProtoReflect.Descriptor instead.
func (*VerifyEmailResponse) GetIsVerified ¶
func (x *VerifyEmailResponse) GetIsVerified() bool
func (*VerifyEmailResponse) ProtoMessage ¶
func (*VerifyEmailResponse) ProtoMessage()
func (*VerifyEmailResponse) ProtoReflect ¶
func (x *VerifyEmailResponse) ProtoReflect() protoreflect.Message
func (*VerifyEmailResponse) Reset ¶
func (x *VerifyEmailResponse) Reset()
func (*VerifyEmailResponse) String ¶
func (x *VerifyEmailResponse) String() string