Documentation ¶
Overview ¶
Code generated by protoc-gen-cdd. DO NOT EDIT. source: users.proto
Package users is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Variables
- func RegisterUsersGrstServer(grpcRestServer *grst.Server, hndl UsersServer)
- func RegisterUsersHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterUsersHandlerClient(ctx context.Context, mux *runtime.ServeMux, client UsersClient) error
- func RegisterUsersHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterUsersHandlerServer(ctx context.Context, mux *runtime.ServeMux, server UsersServer) error
- func RegisterUsersServer(s *grpc.Server, srv UsersServer)
- func ValidateRequest(req interface{}) error
- type AuthConfig
- type GetProfileReq
- type UnimplementedUsersServer
- type UnsafeUsersServer
- type User
- type UserProfile
- func (*UserProfile) Descriptor() ([]byte, []int)deprecated
- func (x *UserProfile) GetId() int32
- func (x *UserProfile) GetName() string
- func (x *UserProfile) GetProvinceId() int32
- func (x *UserProfile) GetProvinceName() string
- func (*UserProfile) ProtoMessage()
- func (x *UserProfile) ProtoReflect() protoreflect.Message
- func (x *UserProfile) Reset()
- func (x *UserProfile) String() string
- type UsersClient
- type UsersServer
Constants ¶
This section is empty.
Variables ¶
var AuthConfigFullMethods = map[string]AuthConfig{ "/users.users/GetProfile": AuthConfig{NeedAuth: false, Roles: []string{"*"}}, }
var File_users_proto protoreflect.FileDescriptor
var FullMethods = fullMethods{
Users_GetProfile: "/users.users/GetProfile",
}
var NeedApiKeyFullMethods = []string{}
var NeedAuthFullMethods = []string{}
Functions ¶
func RegisterUsersGrstServer ¶
func RegisterUsersGrstServer(grpcRestServer *grst.Server, hndl UsersServer)
func RegisterUsersHandler ¶
RegisterUsersHandler registers the http handlers for service Users to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterUsersHandlerClient ¶
func RegisterUsersHandlerClient(ctx context.Context, mux *runtime.ServeMux, client UsersClient) error
RegisterUsersHandlerClient registers the http handlers for service Users to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "UsersClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "UsersClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "UsersClient" to call the correct interceptors.
func RegisterUsersHandlerFromEndpoint ¶
func RegisterUsersHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterUsersHandlerFromEndpoint is same as RegisterUsersHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterUsersHandlerServer ¶
func RegisterUsersHandlerServer(ctx context.Context, mux *runtime.ServeMux, server UsersServer) error
RegisterUsersHandlerServer registers the http handlers for service Users to "mux". UnaryRPC :call UsersServer 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 RegisterUsersHandlerFromEndpoint instead.
func RegisterUsersServer ¶
func RegisterUsersServer(s *grpc.Server, srv UsersServer)
func ValidateRequest ¶
func ValidateRequest(req interface{}) error
Types ¶
type AuthConfig ¶
type GetProfileReq ¶
type GetProfileReq struct { Id int32 `protobuf:"varint,1,opt,name=Id,json=id,proto3" json:"id,omitempty" validate:"required" default:"1"` // contains filtered or unexported fields }
func (*GetProfileReq) Descriptor
deprecated
func (*GetProfileReq) Descriptor() ([]byte, []int)
Deprecated: Use GetProfileReq.ProtoReflect.Descriptor instead.
func (*GetProfileReq) GetId ¶
func (x *GetProfileReq) GetId() int32
func (*GetProfileReq) ProtoMessage ¶
func (*GetProfileReq) ProtoMessage()
func (*GetProfileReq) ProtoReflect ¶
func (x *GetProfileReq) ProtoReflect() protoreflect.Message
func (*GetProfileReq) Reset ¶
func (x *GetProfileReq) Reset()
func (*GetProfileReq) String ¶
func (x *GetProfileReq) String() string
type UnimplementedUsersServer ¶
type UnimplementedUsersServer struct { }
UnimplementedUsersServer must be embedded to have forward compatible implementations.
func (UnimplementedUsersServer) GetProfile ¶
func (UnimplementedUsersServer) GetProfile(context.Context, *GetProfileReq) (*UserProfile, error)
type UnsafeUsersServer ¶
type UnsafeUsersServer interface {
// contains filtered or unexported methods
}
UnsafeUsersServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to UsersServer will result in compilation errors.
type User ¶
type User struct { Id int32 `protobuf:"varint,1,opt,name=Id,json=id,proto3" json:"id,omitempty"` Name string `protobuf:"bytes,2,opt,name=Name,json=name,proto3" json:"name,omitempty"` ProvinceId int32 `protobuf:"varint,3,opt,name=ProvinceId,json=province_id,proto3" json:"province_id,omitempty"` // contains filtered or unexported fields }
func (*User) Descriptor
deprecated
func (*User) GetProvinceId ¶
func (*User) ProtoMessage ¶
func (*User) ProtoMessage()
func (*User) ProtoReflect ¶
func (x *User) ProtoReflect() protoreflect.Message
type UserProfile ¶
type UserProfile struct { Id int32 `protobuf:"varint,1,opt,name=Id,proto3" json:"Id,omitempty"` Name string `protobuf:"bytes,2,opt,name=Name,json=name,proto3" json:"name,omitempty"` ProvinceId int32 `protobuf:"varint,3,opt,name=ProvinceId,json=province_id,proto3" json:"province_id,omitempty"` ProvinceName string `protobuf:"bytes,4,opt,name=ProvinceName,json=province_name,proto3" json:"province_name,omitempty"` // contains filtered or unexported fields }
func (*UserProfile) Descriptor
deprecated
func (*UserProfile) Descriptor() ([]byte, []int)
Deprecated: Use UserProfile.ProtoReflect.Descriptor instead.
func (*UserProfile) GetId ¶
func (x *UserProfile) GetId() int32
func (*UserProfile) GetName ¶
func (x *UserProfile) GetName() string
func (*UserProfile) GetProvinceId ¶
func (x *UserProfile) GetProvinceId() int32
func (*UserProfile) GetProvinceName ¶
func (x *UserProfile) GetProvinceName() string
func (*UserProfile) ProtoMessage ¶
func (*UserProfile) ProtoMessage()
func (*UserProfile) ProtoReflect ¶
func (x *UserProfile) ProtoReflect() protoreflect.Message
func (*UserProfile) Reset ¶
func (x *UserProfile) Reset()
func (*UserProfile) String ¶
func (x *UserProfile) String() string
type UsersClient ¶
type UsersClient interface {
GetProfile(ctx context.Context, in *GetProfileReq, opts ...grpc.CallOption) (*UserProfile, error)
}
UsersClient is the client API for Users 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 NewUsersClient ¶
func NewUsersClient(cc grpc.ClientConnInterface) UsersClient
func NewUsersGrstClient ¶
func NewUsersGrstClient(serverHost string, creds *credentials.TransportCredentials, dialOpts ...grpc.DialOption) (UsersClient, error)
type UsersServer ¶
type UsersServer interface { GetProfile(context.Context, *GetProfileReq) (*UserProfile, error) // contains filtered or unexported methods }
UsersServer is the server API for Users service. All implementations must embed UnimplementedUsersServer for forward compatibility