Documentation ¶
Overview ¶
Code generated by protoc-gen-cdd. DO NOT EDIT. source: user.proto
Package user is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Variables
- func RegisterUserApiGrstServer(grpcRestServer *grst.Server, hndl UserApiServer)
- func RegisterUserApiHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterUserApiHandlerClient(ctx context.Context, mux *runtime.ServeMux, client UserApiClient) error
- func RegisterUserApiHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterUserApiHandlerServer(ctx context.Context, mux *runtime.ServeMux, server UserApiServer) error
- func RegisterUserApiServer(s *grpc.Server, srv UserApiServer)
- func ValidateRequest(req interface{}) error
- type AuthConfig
- type LoginReq
- type UnimplementedUserApiServer
- type UnsafeUserApiServer
- type UpdatePasswordReq
- func (*UpdatePasswordReq) Descriptor() ([]byte, []int)deprecated
- func (x *UpdatePasswordReq) GetEmail() string
- func (x *UpdatePasswordReq) GetNewPassword() string
- func (x *UpdatePasswordReq) GetOldPassword() string
- func (*UpdatePasswordReq) ProtoMessage()
- func (x *UpdatePasswordReq) ProtoReflect() protoreflect.Message
- func (x *UpdatePasswordReq) Reset()
- func (x *UpdatePasswordReq) String() string
- type User
- func (*User) Descriptor() ([]byte, []int)deprecated
- func (x *User) GetEmail() string
- func (x *User) GetName() string
- func (x *User) GetToken() string
- func (x *User) GetUsertype() string
- func (*User) ProtoMessage()
- func (x *User) ProtoReflect() protoreflect.Message
- func (x *User) Reset()
- func (x *User) String() string
- type UserApiClient
- type UserApiServer
Constants ¶
This section is empty.
Variables ¶
var AuthConfigFullMethods = map[string]AuthConfig{ "/user.UserApi/Login": AuthConfig{NeedAuth: false, Roles: []string{"*"}}, "/user.UserApi/GetCurrentLogin": AuthConfig{NeedAuth: false, Roles: []string{"*"}}, "/user.UserApi/UpdatePassword": AuthConfig{NeedAuth: false, Roles: []string{"*"}}, }
var File_user_proto protoreflect.FileDescriptor
var FullMethods = fullMethods{
UserApi_Login: "/user.UserApi/Login",
UserApi_GetCurrentLogin: "/user.UserApi/GetCurrentLogin",
UserApi_UpdatePassword: "/user.UserApi/UpdatePassword",
}
var NeedApiKeyFullMethods = []string{}
var NeedAuthFullMethods = []string{}
Functions ¶
func RegisterUserApiGrstServer ¶
func RegisterUserApiGrstServer(grpcRestServer *grst.Server, hndl UserApiServer)
func RegisterUserApiHandler ¶
func RegisterUserApiHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
RegisterUserApiHandler registers the http handlers for service UserApi to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterUserApiHandlerClient ¶
func RegisterUserApiHandlerClient(ctx context.Context, mux *runtime.ServeMux, client UserApiClient) error
RegisterUserApiHandlerClient registers the http handlers for service UserApi to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "UserApiClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "UserApiClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "UserApiClient" to call the correct interceptors.
func RegisterUserApiHandlerFromEndpoint ¶
func RegisterUserApiHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterUserApiHandlerFromEndpoint is same as RegisterUserApiHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterUserApiHandlerServer ¶
func RegisterUserApiHandlerServer(ctx context.Context, mux *runtime.ServeMux, server UserApiServer) error
RegisterUserApiHandlerServer registers the http handlers for service UserApi to "mux". UnaryRPC :call UserApiServer 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 RegisterUserApiHandlerFromEndpoint instead.
func RegisterUserApiServer ¶
func RegisterUserApiServer(s *grpc.Server, srv UserApiServer)
func ValidateRequest ¶
func ValidateRequest(req interface{}) error
Types ¶
type AuthConfig ¶
type LoginReq ¶
type LoginReq struct { Email string `protobuf:"bytes,1,opt,name=Email,json=email,proto3" json:"email,omitempty" validate:"required,email"` Password string `protobuf:"bytes,2,opt,name=Password,json=password,proto3" json:"password,omitempty" validate:"required"` // contains filtered or unexported fields }
func (*LoginReq) Descriptor
deprecated
func (*LoginReq) GetPassword ¶
func (*LoginReq) ProtoMessage ¶
func (*LoginReq) ProtoMessage()
func (*LoginReq) ProtoReflect ¶
func (x *LoginReq) ProtoReflect() protoreflect.Message
type UnimplementedUserApiServer ¶
type UnimplementedUserApiServer struct { }
UnimplementedUserApiServer must be embedded to have forward compatible implementations.
func (UnimplementedUserApiServer) GetCurrentLogin ¶
func (UnimplementedUserApiServer) UpdatePassword ¶
func (UnimplementedUserApiServer) UpdatePassword(context.Context, *UpdatePasswordReq) (*empty.Empty, error)
type UnsafeUserApiServer ¶
type UnsafeUserApiServer interface {
// contains filtered or unexported methods
}
UnsafeUserApiServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to UserApiServer will result in compilation errors.
type UpdatePasswordReq ¶
type UpdatePasswordReq struct { Email string `protobuf:"bytes,1,opt,name=Email,json=email,proto3" json:"email,omitempty" validate:"required,email"` OldPassword string `protobuf:"bytes,2,opt,name=OldPassword,json=old_password,proto3" json:"old_password,omitempty" validate:"required,min=6"` NewPassword string `protobuf:"bytes,3,opt,name=NewPassword,json=new_password,proto3" json:"new_password,omitempty" validate:"required,min=6"` // contains filtered or unexported fields }
func (*UpdatePasswordReq) Descriptor
deprecated
func (*UpdatePasswordReq) Descriptor() ([]byte, []int)
Deprecated: Use UpdatePasswordReq.ProtoReflect.Descriptor instead.
func (*UpdatePasswordReq) GetEmail ¶
func (x *UpdatePasswordReq) GetEmail() string
func (*UpdatePasswordReq) GetNewPassword ¶
func (x *UpdatePasswordReq) GetNewPassword() string
func (*UpdatePasswordReq) GetOldPassword ¶
func (x *UpdatePasswordReq) GetOldPassword() string
func (*UpdatePasswordReq) ProtoMessage ¶
func (*UpdatePasswordReq) ProtoMessage()
func (*UpdatePasswordReq) ProtoReflect ¶
func (x *UpdatePasswordReq) ProtoReflect() protoreflect.Message
func (*UpdatePasswordReq) Reset ¶
func (x *UpdatePasswordReq) Reset()
func (*UpdatePasswordReq) String ¶
func (x *UpdatePasswordReq) String() string
type User ¶
type User struct { Name string `protobuf:"bytes,1,opt,name=Name,json=name,proto3" json:"name,omitempty"` Usertype string `protobuf:"bytes,2,opt,name=Usertype,json=usertype,proto3" json:"usertype,omitempty"` Email string `protobuf:"bytes,3,opt,name=Email,json=email,proto3" json:"email,omitempty"` Token string `protobuf:"bytes,4,opt,name=Token,json=token,proto3" json:"token,omitempty"` // contains filtered or unexported fields }
func (*User) Descriptor
deprecated
func (*User) GetUsertype ¶
func (*User) ProtoMessage ¶
func (*User) ProtoMessage()
func (*User) ProtoReflect ¶
func (x *User) ProtoReflect() protoreflect.Message
type UserApiClient ¶
type UserApiClient interface { Login(ctx context.Context, in *LoginReq, opts ...grpc.CallOption) (*User, error) GetCurrentLogin(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*User, error) UpdatePassword(ctx context.Context, in *UpdatePasswordReq, opts ...grpc.CallOption) (*empty.Empty, error) }
UserApiClient is the client API for UserApi 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 NewUserApiClient ¶
func NewUserApiClient(cc grpc.ClientConnInterface) UserApiClient
func NewUserApiGrstClient ¶
func NewUserApiGrstClient(serverHost string, creds *credentials.TransportCredentials, dialOpts ...grpc.DialOption) (UserApiClient, error)
type UserApiServer ¶
type UserApiServer interface { Login(context.Context, *LoginReq) (*User, error) GetCurrentLogin(context.Context, *empty.Empty) (*User, error) UpdatePassword(context.Context, *UpdatePasswordReq) (*empty.Empty, error) // contains filtered or unexported methods }
UserApiServer is the server API for UserApi service. All implementations must embed UnimplementedUserApiServer for forward compatibility