Documentation ¶
Index ¶
- Variables
- func GreeterServiceClientType() reflect.Type
- func GreeterServiceHandlerType() reflect.Type
- func GreeterServiceServerType() reflect.Type
- func RegisterGreeterServiceHandler(r http.Router, srv GreeterServiceHandler, opts ...http.HandleOption)
- func RegisterGreeterServiceImp(regester transport.Register, srv GreeterServiceServer, ...)
- func RegisterGreeterServiceServer(s grpc1.ServiceRegistrar, srv GreeterServiceServer, opts ...grpc1.HandleOption)
- func RegisterUserServiceHandler(r http.Router, srv UserServiceHandler, opts ...http.HandleOption)
- func RegisterUserServiceImp(regester transport.Register, srv UserServiceServer, ...)
- func RegisterUserServiceServer(s grpc1.ServiceRegistrar, srv UserServiceServer, opts ...grpc1.HandleOption)
- func ServiceNames(svr ...string) []string
- func Types() []reflect.Type
- func UserServiceClientType() reflect.Type
- func UserServiceHandlerType() reflect.Type
- func UserServiceServerType() reflect.Type
- type GetUserRequest
- func (*GetUserRequest) Descriptor() ([]byte, []int)deprecated
- func (x *GetUserRequest) GetId() string
- func (*GetUserRequest) ProtoMessage()
- func (x *GetUserRequest) ProtoReflect() protoreflect.Message
- func (x *GetUserRequest) Reset()
- func (x *GetUserRequest) String() string
- func (m *GetUserRequest) UnmarshalURLValues(prefix string, values url.Values) error
- type GetUserResponse
- func (*GetUserResponse) Descriptor() ([]byte, []int)deprecated
- func (x *GetUserResponse) GetData() *User
- func (x *GetUserResponse) GetSuccess() bool
- func (*GetUserResponse) ProtoMessage()
- func (x *GetUserResponse) ProtoReflect() protoreflect.Message
- func (x *GetUserResponse) Reset()
- func (x *GetUserResponse) String() string
- func (m *GetUserResponse) UnmarshalURLValues(prefix string, values url.Values) error
- type GreeterServiceClient
- type GreeterServiceHandler
- type GreeterServiceServer
- type HelloRequest
- func (*HelloRequest) Descriptor() ([]byte, []int)deprecated
- func (x *HelloRequest) GetName() string
- func (*HelloRequest) ProtoMessage()
- func (x *HelloRequest) ProtoReflect() protoreflect.Message
- func (x *HelloRequest) Reset()
- func (x *HelloRequest) String() string
- func (m *HelloRequest) UnmarshalURLValues(prefix string, values url.Values) error
- type HelloResponse
- func (*HelloResponse) Descriptor() ([]byte, []int)deprecated
- func (x *HelloResponse) GetData() string
- func (x *HelloResponse) GetSuccess() bool
- func (*HelloResponse) ProtoMessage()
- func (x *HelloResponse) ProtoReflect() protoreflect.Message
- func (x *HelloResponse) Reset()
- func (x *HelloResponse) String() string
- func (m *HelloResponse) UnmarshalURLValues(prefix string, values url.Values) error
- type UnimplementedGreeterServiceServer
- type UnimplementedUserServiceServer
- type UpdateUserRequest
- func (*UpdateUserRequest) Descriptor() ([]byte, []int)deprecated
- func (x *UpdateUserRequest) GetUser() *User
- func (*UpdateUserRequest) ProtoMessage()
- func (x *UpdateUserRequest) ProtoReflect() protoreflect.Message
- func (x *UpdateUserRequest) Reset()
- func (x *UpdateUserRequest) String() string
- func (m *UpdateUserRequest) UnmarshalURLValues(prefix string, values url.Values) error
- type UpdateUserResponse
- func (*UpdateUserResponse) Descriptor() ([]byte, []int)deprecated
- func (x *UpdateUserResponse) GetSuccess() bool
- func (*UpdateUserResponse) ProtoMessage()
- func (x *UpdateUserResponse) ProtoReflect() protoreflect.Message
- func (x *UpdateUserResponse) Reset()
- func (x *UpdateUserResponse) String() string
- func (m *UpdateUserResponse) UnmarshalURLValues(prefix string, values url.Values) error
- type User
- func (*User) Descriptor() ([]byte, []int)deprecated
- func (x *User) GetAge() int32
- func (x *User) GetBooks() []int64
- func (x *User) GetId() int64
- func (x *User) GetName() string
- func (*User) ProtoMessage()
- func (x *User) ProtoReflect() protoreflect.Message
- func (x *User) Reset()
- func (x *User) String() string
- func (m *User) UnmarshalURLValues(prefix string, values url.Values) error
- type UserServiceClient
- type UserServiceHandler
- type UserServiceServer
Constants ¶
This section is empty.
Variables ¶
var File_greeter_proto protoreflect.FileDescriptor
var File_user_proto protoreflect.FileDescriptor
Functions ¶
func GreeterServiceClientType ¶
GreeterServiceClientType .
func GreeterServiceHandlerType ¶
GreeterServiceHandlerType .
func GreeterServiceServerType ¶
GreeterServiceServerType .
func RegisterGreeterServiceHandler ¶
func RegisterGreeterServiceHandler(r http.Router, srv GreeterServiceHandler, opts ...http.HandleOption)
RegisterGreeterServiceHandler register GreeterServiceHandler to http.Router.
func RegisterGreeterServiceImp ¶
func RegisterGreeterServiceImp(regester transport.Register, srv GreeterServiceServer, opts ...transport.ServiceOption)
RegisterGreeterServiceImp greeter.proto
func RegisterGreeterServiceServer ¶
func RegisterGreeterServiceServer(s grpc1.ServiceRegistrar, srv GreeterServiceServer, opts ...grpc1.HandleOption)
func RegisterUserServiceHandler ¶
func RegisterUserServiceHandler(r http.Router, srv UserServiceHandler, opts ...http.HandleOption)
RegisterUserServiceHandler register UserServiceHandler to http.Router.
func RegisterUserServiceImp ¶
func RegisterUserServiceImp(regester transport.Register, srv UserServiceServer, opts ...transport.ServiceOption)
RegisterUserServiceImp user.proto
func RegisterUserServiceServer ¶
func RegisterUserServiceServer(s grpc1.ServiceRegistrar, srv UserServiceServer, opts ...grpc1.HandleOption)
Types ¶
type GetUserRequest ¶
type GetUserRequest struct { Id string `protobuf:"bytes,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() string
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
func (*GetUserRequest) UnmarshalURLValues ¶
func (m *GetUserRequest) UnmarshalURLValues(prefix string, values url.Values) error
GetUserRequest implement urlenc.URLValuesUnmarshaler.
type GetUserResponse ¶
type GetUserResponse struct { Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` Data *User `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` // contains filtered or unexported fields }
func (*GetUserResponse) Descriptor
deprecated
func (*GetUserResponse) Descriptor() ([]byte, []int)
Deprecated: Use GetUserResponse.ProtoReflect.Descriptor instead.
func (*GetUserResponse) GetData ¶
func (x *GetUserResponse) GetData() *User
func (*GetUserResponse) GetSuccess ¶
func (x *GetUserResponse) GetSuccess() bool
func (*GetUserResponse) ProtoMessage ¶
func (*GetUserResponse) ProtoMessage()
func (*GetUserResponse) ProtoReflect ¶
func (x *GetUserResponse) ProtoReflect() protoreflect.Message
func (*GetUserResponse) Reset ¶
func (x *GetUserResponse) Reset()
func (*GetUserResponse) String ¶
func (x *GetUserResponse) String() string
func (*GetUserResponse) UnmarshalURLValues ¶
func (m *GetUserResponse) UnmarshalURLValues(prefix string, values url.Values) error
GetUserResponse implement urlenc.URLValuesUnmarshaler.
type GreeterServiceClient ¶
type GreeterServiceClient interface { // say hello SayHello(ctx context.Context, in *HelloRequest, opts ...grpc.CallOption) (*HelloResponse, error) }
GreeterServiceClient is the client API for GreeterService 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 NewGreeterServiceClient ¶
func NewGreeterServiceClient(cc grpc1.ClientConnInterface) GreeterServiceClient
type GreeterServiceHandler ¶
type GreeterServiceHandler interface { // say hello // GET /api/greeter/{name} SayHello(context.Context, *HelloRequest) (*HelloResponse, error) }
GreeterServiceHandler is the server API for GreeterService service.
type GreeterServiceServer ¶
type GreeterServiceServer interface { // say hello SayHello(context.Context, *HelloRequest) (*HelloResponse, error) }
GreeterServiceServer is the server API for GreeterService service. All implementations should embed UnimplementedGreeterServiceServer for forward compatibility
type HelloRequest ¶
type HelloRequest struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // contains filtered or unexported fields }
func (*HelloRequest) Descriptor
deprecated
func (*HelloRequest) Descriptor() ([]byte, []int)
Deprecated: Use HelloRequest.ProtoReflect.Descriptor instead.
func (*HelloRequest) GetName ¶
func (x *HelloRequest) GetName() string
func (*HelloRequest) ProtoMessage ¶
func (*HelloRequest) ProtoMessage()
func (*HelloRequest) ProtoReflect ¶
func (x *HelloRequest) ProtoReflect() protoreflect.Message
func (*HelloRequest) Reset ¶
func (x *HelloRequest) Reset()
func (*HelloRequest) String ¶
func (x *HelloRequest) String() string
func (*HelloRequest) UnmarshalURLValues ¶
func (m *HelloRequest) UnmarshalURLValues(prefix string, values url.Values) error
HelloRequest implement urlenc.URLValuesUnmarshaler.
type HelloResponse ¶
type HelloResponse struct { Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` Data string `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` // contains filtered or unexported fields }
func (*HelloResponse) Descriptor
deprecated
func (*HelloResponse) Descriptor() ([]byte, []int)
Deprecated: Use HelloResponse.ProtoReflect.Descriptor instead.
func (*HelloResponse) GetData ¶
func (x *HelloResponse) GetData() string
func (*HelloResponse) GetSuccess ¶
func (x *HelloResponse) GetSuccess() bool
func (*HelloResponse) ProtoMessage ¶
func (*HelloResponse) ProtoMessage()
func (*HelloResponse) ProtoReflect ¶
func (x *HelloResponse) ProtoReflect() protoreflect.Message
func (*HelloResponse) Reset ¶
func (x *HelloResponse) Reset()
func (*HelloResponse) String ¶
func (x *HelloResponse) String() string
func (*HelloResponse) UnmarshalURLValues ¶
func (m *HelloResponse) UnmarshalURLValues(prefix string, values url.Values) error
HelloResponse implement urlenc.URLValuesUnmarshaler.
type UnimplementedGreeterServiceServer ¶
type UnimplementedGreeterServiceServer struct { }
UnimplementedGreeterServiceServer should be embedded to have forward compatible implementations.
func (*UnimplementedGreeterServiceServer) SayHello ¶
func (*UnimplementedGreeterServiceServer) SayHello(context.Context, *HelloRequest) (*HelloResponse, error)
type UnimplementedUserServiceServer ¶
type UnimplementedUserServiceServer struct { }
UnimplementedUserServiceServer should be embedded to have forward compatible implementations.
func (*UnimplementedUserServiceServer) GetUser ¶
func (*UnimplementedUserServiceServer) GetUser(context.Context, *GetUserRequest) (*GetUserResponse, error)
func (*UnimplementedUserServiceServer) UpdateUser ¶
func (*UnimplementedUserServiceServer) UpdateUser(context.Context, *UpdateUserRequest) (*UpdateUserResponse, error)
type UpdateUserRequest ¶
type UpdateUserRequest struct { User *User `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"` // contains filtered or unexported fields }
func (*UpdateUserRequest) Descriptor
deprecated
func (*UpdateUserRequest) Descriptor() ([]byte, []int)
Deprecated: Use UpdateUserRequest.ProtoReflect.Descriptor instead.
func (*UpdateUserRequest) GetUser ¶
func (x *UpdateUserRequest) GetUser() *User
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
func (*UpdateUserRequest) UnmarshalURLValues ¶
func (m *UpdateUserRequest) UnmarshalURLValues(prefix string, values url.Values) error
UpdateUserRequest implement urlenc.URLValuesUnmarshaler.
type UpdateUserResponse ¶
type UpdateUserResponse struct { Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` // contains filtered or unexported fields }
func (*UpdateUserResponse) Descriptor
deprecated
func (*UpdateUserResponse) Descriptor() ([]byte, []int)
Deprecated: Use UpdateUserResponse.ProtoReflect.Descriptor instead.
func (*UpdateUserResponse) GetSuccess ¶
func (x *UpdateUserResponse) GetSuccess() bool
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
func (*UpdateUserResponse) UnmarshalURLValues ¶
func (m *UpdateUserResponse) UnmarshalURLValues(prefix string, values url.Values) error
UpdateUserResponse implement urlenc.URLValuesUnmarshaler.
type User ¶
type User 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"` Age int32 `protobuf:"varint,3,opt,name=age,proto3" json:"age,omitempty"` Books []int64 `protobuf:"varint,4,rep,packed,name=books,proto3" json:"books,omitempty"` // contains filtered or unexported fields }
func (*User) Descriptor
deprecated
func (*User) ProtoMessage ¶
func (*User) ProtoMessage()
func (*User) ProtoReflect ¶
func (x *User) ProtoReflect() protoreflect.Message
type UserServiceClient ¶
type UserServiceClient interface { // get user GetUser(ctx context.Context, in *GetUserRequest, opts ...grpc.CallOption) (*GetUserResponse, error) // update user UpdateUser(ctx context.Context, in *UpdateUserRequest, opts ...grpc.CallOption) (*UpdateUserResponse, error) }
UserServiceClient is the client API for UserService 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 NewUserServiceClient ¶
func NewUserServiceClient(cc grpc1.ClientConnInterface) UserServiceClient
type UserServiceHandler ¶
type UserServiceHandler interface { // get user // GET /api/user/{id} GetUser(context.Context, *GetUserRequest) (*GetUserResponse, error) // update user // PUT /api/user/{user.id} UpdateUser(context.Context, *UpdateUserRequest) (*UpdateUserResponse, error) }
UserServiceHandler is the server API for UserService service.
type UserServiceServer ¶
type UserServiceServer interface { // get user GetUser(context.Context, *GetUserRequest) (*GetUserResponse, error) // update user UpdateUser(context.Context, *UpdateUserRequest) (*UpdateUserResponse, error) }
UserServiceServer is the server API for UserService service. All implementations should embed UnimplementedUserServiceServer for forward compatibility