Documentation ¶
Overview ¶
Package gen is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Variables
- func RegisterCreateUserHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterCreateUserHandlerClient(ctx context.Context, mux *runtime.ServeMux, client CreateUserClient) error
- func RegisterCreateUserHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterCreateUserHandlerServer(ctx context.Context, mux *runtime.ServeMux, server CreateUserServer) error
- func RegisterCreateUserServer(s grpc.ServiceRegistrar, srv CreateUserServer)
- type CreateUserClient
- type CreateUserServer
- type UnimplementedCreateUserServer
- type UnsafeCreateUserServer
- type User
- func (*User) Descriptor() ([]byte, []int)deprecated
- func (x *User) GetCreated() *timestamppb.Timestamp
- func (x *User) GetDeleted() bool
- func (x *User) GetEmail() string
- func (x *User) GetId() int32
- func (x *User) GetLastUpdated() *timestamppb.Timestamp
- func (x *User) GetName() string
- func (*User) ProtoMessage()
- func (x *User) ProtoReflect() protoreflect.Message
- func (x *User) Reset()
- func (x *User) String() string
Constants ¶
This section is empty.
Variables ¶
var CreateUser_ServiceDesc = grpc.ServiceDesc{ ServiceName: "models.CreateUser", HandlerType: (*CreateUserServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Echo", Handler: _CreateUser_Echo_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "user.proto", }
CreateUser_ServiceDesc is the grpc.ServiceDesc for CreateUser service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
var File_user_proto protoreflect.FileDescriptor
Functions ¶
func RegisterCreateUserHandler ¶
func RegisterCreateUserHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
RegisterCreateUserHandler registers the http handlers for service CreateUser to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterCreateUserHandlerClient ¶
func RegisterCreateUserHandlerClient(ctx context.Context, mux *runtime.ServeMux, client CreateUserClient) error
RegisterCreateUserHandlerClient registers the http handlers for service CreateUser to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "CreateUserClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "CreateUserClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "CreateUserClient" to call the correct interceptors.
func RegisterCreateUserHandlerFromEndpoint ¶
func RegisterCreateUserHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterCreateUserHandlerFromEndpoint is same as RegisterCreateUserHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterCreateUserHandlerServer ¶
func RegisterCreateUserHandlerServer(ctx context.Context, mux *runtime.ServeMux, server CreateUserServer) error
RegisterCreateUserHandlerServer registers the http handlers for service CreateUser to "mux". UnaryRPC :call CreateUserServer 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 RegisterCreateUserHandlerFromEndpoint instead.
func RegisterCreateUserServer ¶
func RegisterCreateUserServer(s grpc.ServiceRegistrar, srv CreateUserServer)
Types ¶
type CreateUserClient ¶
type CreateUserClient interface {
Echo(ctx context.Context, in *User, opts ...grpc.CallOption) (*User, error)
}
CreateUserClient is the client API for CreateUser 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 NewCreateUserClient ¶
func NewCreateUserClient(cc grpc.ClientConnInterface) CreateUserClient
type CreateUserServer ¶
type CreateUserServer interface { Echo(context.Context, *User) (*User, error) // contains filtered or unexported methods }
CreateUserServer is the server API for CreateUser service. All implementations must embed UnimplementedCreateUserServer for forward compatibility
type UnimplementedCreateUserServer ¶
type UnimplementedCreateUserServer struct { }
UnimplementedCreateUserServer must be embedded to have forward compatible implementations.
type UnsafeCreateUserServer ¶
type UnsafeCreateUserServer interface {
// contains filtered or unexported methods
}
UnsafeCreateUserServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to CreateUserServer will result in compilation errors.
type User ¶
type User struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` Id int32 `protobuf:"varint,2,opt,name=id,proto3" json:"id,omitempty"` // Unique ID number for this person. Email string `protobuf:"bytes,3,opt,name=email,proto3" json:"email,omitempty"` Created *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=created,proto3" json:"created,omitempty"` LastUpdated *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=last_updated,json=lastUpdated,proto3" json:"last_updated,omitempty"` Deleted bool `protobuf:"varint,6,opt,name=deleted,proto3" json:"deleted,omitempty"` // contains filtered or unexported fields }
func (*User) Descriptor
deprecated
func (*User) GetCreated ¶
func (x *User) GetCreated() *timestamppb.Timestamp
func (*User) GetDeleted ¶
func (*User) GetLastUpdated ¶
func (x *User) GetLastUpdated() *timestamppb.Timestamp
func (*User) ProtoMessage ¶
func (*User) ProtoMessage()
func (*User) ProtoReflect ¶
func (x *User) ProtoReflect() protoreflect.Message