Documentation ¶
Overview ¶
Package accountpb is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Variables
- func RegisterAccountHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterAccountHandlerClient(ctx context.Context, mux *runtime.ServeMux, client AccountClient) error
- func RegisterAccountHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterAccountHandlerServer(ctx context.Context, mux *runtime.ServeMux, server AccountServer) error
- func RegisterAccountServer(s grpc.ServiceRegistrar, srv AccountServer)
- type AccountClient
- type AccountServer
- type GetUserReply
- func (*GetUserReply) Descriptor() ([]byte, []int)deprecated
- func (x *GetUserReply) GetEmail() string
- func (x *GetUserReply) GetId() int64
- func (x *GetUserReply) GetName() string
- func (*GetUserReply) ProtoMessage()
- func (x *GetUserReply) ProtoReflect() protoreflect.Message
- func (x *GetUserReply) Reset()
- func (x *GetUserReply) String() string
- type GetUserRequest
- type RegisterReply
- func (*RegisterReply) Descriptor() ([]byte, []int)deprecated
- func (x *RegisterReply) GetAuthorization() string
- func (x *RegisterReply) GetId() int64
- func (*RegisterReply) ProtoMessage()
- func (x *RegisterReply) ProtoReflect() protoreflect.Message
- func (x *RegisterReply) Reset()
- func (x *RegisterReply) String() string
- type RegisterRequest
- func (*RegisterRequest) Descriptor() ([]byte, []int)deprecated
- func (x *RegisterRequest) GetName() string
- func (x *RegisterRequest) GetPassword() string
- func (*RegisterRequest) ProtoMessage()
- func (x *RegisterRequest) ProtoReflect() protoreflect.Message
- func (x *RegisterRequest) Reset()
- func (x *RegisterRequest) String() string
- type UnimplementedAccountServer
- type UnsafeAccountServer
Constants ¶
This section is empty.
Variables ¶
var Account_ServiceDesc = grpc.ServiceDesc{ ServiceName: "proto.Account", HandlerType: (*AccountServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Register", Handler: _Account_Register_Handler, }, { MethodName: "GetUser", Handler: _Account_GetUser_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "account.proto", }
Account_ServiceDesc is the grpc.ServiceDesc for Account service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
var File_account_proto protoreflect.FileDescriptor
Functions ¶
func RegisterAccountHandler ¶
func RegisterAccountHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
RegisterAccountHandler registers the http handlers for service Account to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterAccountHandlerClient ¶
func RegisterAccountHandlerClient(ctx context.Context, mux *runtime.ServeMux, client AccountClient) error
RegisterAccountHandlerClient registers the http handlers for service Account to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "AccountClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "AccountClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "AccountClient" to call the correct interceptors.
func RegisterAccountHandlerFromEndpoint ¶
func RegisterAccountHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterAccountHandlerFromEndpoint is same as RegisterAccountHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterAccountHandlerServer ¶
func RegisterAccountHandlerServer(ctx context.Context, mux *runtime.ServeMux, server AccountServer) error
RegisterAccountHandlerServer registers the http handlers for service Account to "mux". UnaryRPC :call AccountServer 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 RegisterAccountHandlerFromEndpoint instead.
func RegisterAccountServer ¶
func RegisterAccountServer(s grpc.ServiceRegistrar, srv AccountServer)
Types ¶
type AccountClient ¶
type AccountClient interface { Register(ctx context.Context, in *RegisterRequest, opts ...grpc.CallOption) (*RegisterReply, error) GetUser(ctx context.Context, in *GetUserRequest, opts ...grpc.CallOption) (*GetUserReply, error) }
AccountClient is the client API for Account 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 NewAccountClient ¶
func NewAccountClient(cc grpc.ClientConnInterface) AccountClient
type AccountServer ¶
type AccountServer interface { Register(context.Context, *RegisterRequest) (*RegisterReply, error) GetUser(context.Context, *GetUserRequest) (*GetUserReply, error) // contains filtered or unexported methods }
AccountServer is the server API for Account service. All implementations must embed UnimplementedAccountServer for forward compatibility
type GetUserReply ¶
type GetUserReply struct { Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` Email string `protobuf:"bytes,3,opt,name=email,proto3" json:"email,omitempty"` // contains filtered or unexported fields }
func (*GetUserReply) Descriptor
deprecated
func (*GetUserReply) Descriptor() ([]byte, []int)
Deprecated: Use GetUserReply.ProtoReflect.Descriptor instead.
func (*GetUserReply) GetEmail ¶
func (x *GetUserReply) GetEmail() string
func (*GetUserReply) GetId ¶
func (x *GetUserReply) GetId() int64
func (*GetUserReply) GetName ¶
func (x *GetUserReply) GetName() string
func (*GetUserReply) ProtoMessage ¶
func (*GetUserReply) ProtoMessage()
func (*GetUserReply) ProtoReflect ¶
func (x *GetUserReply) ProtoReflect() protoreflect.Message
func (*GetUserReply) Reset ¶
func (x *GetUserReply) Reset()
func (*GetUserReply) String ¶
func (x *GetUserReply) String() string
type GetUserRequest ¶
type GetUserRequest struct { Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` // contains filtered or unexported fields }
func (*GetUserRequest) Descriptor
deprecated
func (*GetUserRequest) Descriptor() ([]byte, []int)
Deprecated: Use GetUserRequest.ProtoReflect.Descriptor instead.
func (*GetUserRequest) GetId ¶
func (x *GetUserRequest) GetId() int64
func (*GetUserRequest) ProtoMessage ¶
func (*GetUserRequest) ProtoMessage()
func (*GetUserRequest) ProtoReflect ¶
func (x *GetUserRequest) ProtoReflect() protoreflect.Message
func (*GetUserRequest) Reset ¶
func (x *GetUserRequest) Reset()
func (*GetUserRequest) String ¶
func (x *GetUserRequest) String() string
type RegisterReply ¶
type RegisterReply struct { Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` Authorization string `protobuf:"bytes,2,opt,name=authorization,proto3" json:"authorization,omitempty"` // contains filtered or unexported fields }
func (*RegisterReply) Descriptor
deprecated
func (*RegisterReply) Descriptor() ([]byte, []int)
Deprecated: Use RegisterReply.ProtoReflect.Descriptor instead.
func (*RegisterReply) GetAuthorization ¶
func (x *RegisterReply) GetAuthorization() string
func (*RegisterReply) GetId ¶
func (x *RegisterReply) GetId() int64
func (*RegisterReply) ProtoMessage ¶
func (*RegisterReply) ProtoMessage()
func (*RegisterReply) ProtoReflect ¶
func (x *RegisterReply) ProtoReflect() protoreflect.Message
func (*RegisterReply) Reset ¶
func (x *RegisterReply) Reset()
func (*RegisterReply) String ¶
func (x *RegisterReply) String() string
type RegisterRequest ¶
type RegisterRequest struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"` // contains filtered or unexported fields }
func (*RegisterRequest) Descriptor
deprecated
func (*RegisterRequest) Descriptor() ([]byte, []int)
Deprecated: Use RegisterRequest.ProtoReflect.Descriptor instead.
func (*RegisterRequest) GetName ¶
func (x *RegisterRequest) GetName() string
func (*RegisterRequest) GetPassword ¶
func (x *RegisterRequest) GetPassword() string
func (*RegisterRequest) ProtoMessage ¶
func (*RegisterRequest) ProtoMessage()
func (*RegisterRequest) ProtoReflect ¶
func (x *RegisterRequest) ProtoReflect() protoreflect.Message
func (*RegisterRequest) Reset ¶
func (x *RegisterRequest) Reset()
func (*RegisterRequest) String ¶
func (x *RegisterRequest) String() string
type UnimplementedAccountServer ¶
type UnimplementedAccountServer struct { }
UnimplementedAccountServer must be embedded to have forward compatible implementations.
func (UnimplementedAccountServer) GetUser ¶
func (UnimplementedAccountServer) GetUser(context.Context, *GetUserRequest) (*GetUserReply, error)
func (UnimplementedAccountServer) Register ¶
func (UnimplementedAccountServer) Register(context.Context, *RegisterRequest) (*RegisterReply, error)
type UnsafeAccountServer ¶
type UnsafeAccountServer interface {
// contains filtered or unexported methods
}
UnsafeAccountServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to AccountServer will result in compilation errors.