Documentation ¶
Overview ¶
Package pb is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Constants
- Variables
- func RegisterMSMBankHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterMSMBankHandlerClient(ctx context.Context, mux *runtime.ServeMux, client MSMBankClient) error
- func RegisterMSMBankHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterMSMBankHandlerServer(ctx context.Context, mux *runtime.ServeMux, server MSMBankServer) error
- func RegisterMSMBankServer(s grpc.ServiceRegistrar, srv MSMBankServer)
- 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 CreateUserRes
- type LoginUserRequest
- func (*LoginUserRequest) Descriptor() ([]byte, []int)deprecated
- func (x *LoginUserRequest) GetEmail() string
- func (x *LoginUserRequest) GetPassword() string
- func (*LoginUserRequest) ProtoMessage()
- func (x *LoginUserRequest) ProtoReflect() protoreflect.Message
- func (x *LoginUserRequest) Reset()
- func (x *LoginUserRequest) String() string
- type LoginUserRes
- func (*LoginUserRes) Descriptor() ([]byte, []int)deprecated
- func (x *LoginUserRes) GetAccessToken() string
- func (x *LoginUserRes) GetAccessTokenExpiresAt() *timestamppb.Timestamp
- func (x *LoginUserRes) GetRefreshToken() string
- func (x *LoginUserRes) GetRefreshTokenExpiresAt() *timestamppb.Timestamp
- func (x *LoginUserRes) GetSession_ID() string
- func (x *LoginUserRes) GetUser() *User
- func (*LoginUserRes) ProtoMessage()
- func (x *LoginUserRes) ProtoReflect() protoreflect.Message
- func (x *LoginUserRes) Reset()
- func (x *LoginUserRes) String() string
- type MSMBankClient
- type MSMBankServer
- type UnimplementedMSMBankServer
- type UnsafeMSMBankServer
- 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) GetPassChangedAt() *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
Constants ¶
const ( MSMBank_CreateUser_FullMethodName = "/pb.MSMBank/CreateUser" MSMBank_LoginUser_FullMethodName = "/pb.MSMBank/LoginUser" )
Variables ¶
var File_rpc_create_user_proto protoreflect.FileDescriptor
var File_rpc_login_user_proto protoreflect.FileDescriptor
var File_service_simple_bank_proto protoreflect.FileDescriptor
var File_user_proto protoreflect.FileDescriptor
var MSMBank_ServiceDesc = grpc.ServiceDesc{ ServiceName: "pb.MSMBank", HandlerType: (*MSMBankServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "CreateUser", Handler: _MSMBank_CreateUser_Handler, }, { MethodName: "LoginUser", Handler: _MSMBank_LoginUser_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "service_simple_bank.proto", }
MSMBank_ServiceDesc is the grpc.ServiceDesc for MSMBank service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterMSMBankHandler ¶
func RegisterMSMBankHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
RegisterMSMBankHandler registers the http handlers for service MSMBank to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterMSMBankHandlerClient ¶
func RegisterMSMBankHandlerClient(ctx context.Context, mux *runtime.ServeMux, client MSMBankClient) error
RegisterMSMBankHandlerClient registers the http handlers for service MSMBank to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "MSMBankClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "MSMBankClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "MSMBankClient" to call the correct interceptors.
func RegisterMSMBankHandlerFromEndpoint ¶
func RegisterMSMBankHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterMSMBankHandlerFromEndpoint is same as RegisterMSMBankHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterMSMBankHandlerServer ¶
func RegisterMSMBankHandlerServer(ctx context.Context, mux *runtime.ServeMux, server MSMBankServer) error
RegisterMSMBankHandlerServer registers the http handlers for service MSMBank to "mux". UnaryRPC :call MSMBankServer 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 RegisterMSMBankHandlerFromEndpoint instead.
func RegisterMSMBankServer ¶
func RegisterMSMBankServer(s grpc.ServiceRegistrar, srv MSMBankServer)
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 CreateUserRes ¶
type CreateUserRes struct { User *User `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"` // contains filtered or unexported fields }
func (*CreateUserRes) Descriptor
deprecated
func (*CreateUserRes) Descriptor() ([]byte, []int)
Deprecated: Use CreateUserRes.ProtoReflect.Descriptor instead.
func (*CreateUserRes) GetUser ¶
func (x *CreateUserRes) GetUser() *User
func (*CreateUserRes) ProtoMessage ¶
func (*CreateUserRes) ProtoMessage()
func (*CreateUserRes) ProtoReflect ¶
func (x *CreateUserRes) ProtoReflect() protoreflect.Message
func (*CreateUserRes) Reset ¶
func (x *CreateUserRes) Reset()
func (*CreateUserRes) String ¶
func (x *CreateUserRes) String() string
type LoginUserRequest ¶
type LoginUserRequest struct { Email string `protobuf:"bytes,1,opt,name=email,proto3" json:"email,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) GetEmail ¶
func (x *LoginUserRequest) GetEmail() string
func (*LoginUserRequest) GetPassword ¶
func (x *LoginUserRequest) GetPassword() 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 LoginUserRes ¶
type LoginUserRes struct { User *User `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"` Session_ID 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 (*LoginUserRes) Descriptor
deprecated
func (*LoginUserRes) Descriptor() ([]byte, []int)
Deprecated: Use LoginUserRes.ProtoReflect.Descriptor instead.
func (*LoginUserRes) GetAccessToken ¶
func (x *LoginUserRes) GetAccessToken() string
func (*LoginUserRes) GetAccessTokenExpiresAt ¶
func (x *LoginUserRes) GetAccessTokenExpiresAt() *timestamppb.Timestamp
func (*LoginUserRes) GetRefreshToken ¶
func (x *LoginUserRes) GetRefreshToken() string
func (*LoginUserRes) GetRefreshTokenExpiresAt ¶
func (x *LoginUserRes) GetRefreshTokenExpiresAt() *timestamppb.Timestamp
func (*LoginUserRes) GetSession_ID ¶
func (x *LoginUserRes) GetSession_ID() string
func (*LoginUserRes) GetUser ¶
func (x *LoginUserRes) GetUser() *User
func (*LoginUserRes) ProtoMessage ¶
func (*LoginUserRes) ProtoMessage()
func (*LoginUserRes) ProtoReflect ¶
func (x *LoginUserRes) ProtoReflect() protoreflect.Message
func (*LoginUserRes) Reset ¶
func (x *LoginUserRes) Reset()
func (*LoginUserRes) String ¶
func (x *LoginUserRes) String() string
type MSMBankClient ¶
type MSMBankClient interface { CreateUser(ctx context.Context, in *CreateUserRequest, opts ...grpc.CallOption) (*CreateUserRes, error) LoginUser(ctx context.Context, in *LoginUserRequest, opts ...grpc.CallOption) (*LoginUserRes, error) }
MSMBankClient is the client API for MSMBank 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 NewMSMBankClient ¶
func NewMSMBankClient(cc grpc.ClientConnInterface) MSMBankClient
type MSMBankServer ¶
type MSMBankServer interface { CreateUser(context.Context, *CreateUserRequest) (*CreateUserRes, error) LoginUser(context.Context, *LoginUserRequest) (*LoginUserRes, error) // contains filtered or unexported methods }
MSMBankServer is the server API for MSMBank service. All implementations must embed UnimplementedMSMBankServer for forward compatibility
type UnimplementedMSMBankServer ¶
type UnimplementedMSMBankServer struct { }
UnimplementedMSMBankServer must be embedded to have forward compatible implementations.
func (UnimplementedMSMBankServer) CreateUser ¶
func (UnimplementedMSMBankServer) CreateUser(context.Context, *CreateUserRequest) (*CreateUserRes, error)
func (UnimplementedMSMBankServer) LoginUser ¶
func (UnimplementedMSMBankServer) LoginUser(context.Context, *LoginUserRequest) (*LoginUserRes, error)
type UnsafeMSMBankServer ¶
type UnsafeMSMBankServer interface {
// contains filtered or unexported methods
}
UnsafeMSMBankServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to MSMBankServer will result in compilation errors.
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"` PassChangedAt *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=pass_changed_at,json=passChangedAt,proto3" json:"pass_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) GetPassChangedAt ¶
func (x *User) GetPassChangedAt() *timestamppb.Timestamp
func (*User) GetUsername ¶
func (*User) ProtoMessage ¶
func (*User) ProtoMessage()
func (*User) ProtoReflect ¶
func (x *User) ProtoReflect() protoreflect.Message