Documentation ¶
Index ¶
- Variables
- func RegisterApiServer(s grpc.ServiceRegistrar, srv ApiServer)
- type ApiClient
- type ApiServer
- type AuthRequest
- func (*AuthRequest) Descriptor() ([]byte, []int)deprecated
- func (x *AuthRequest) GetPassword() string
- func (x *AuthRequest) GetUsername() string
- func (*AuthRequest) ProtoMessage()
- func (x *AuthRequest) ProtoReflect() protoreflect.Message
- func (x *AuthRequest) Reset()
- func (x *AuthRequest) String() string
- type AuthResponse
- func (*AuthResponse) Descriptor() ([]byte, []int)deprecated
- func (x *AuthResponse) GetError() bool
- func (x *AuthResponse) GetMessage() string
- func (x *AuthResponse) GetUserDetails() *UserDetailsResponse
- func (x *AuthResponse) GetUserId() int64
- func (*AuthResponse) ProtoMessage()
- func (x *AuthResponse) ProtoReflect() protoreflect.Message
- func (x *AuthResponse) Reset()
- func (x *AuthResponse) String() string
- type ErrorResponse
- func (*ErrorResponse) Descriptor() ([]byte, []int)deprecated
- func (x *ErrorResponse) GetError() bool
- func (x *ErrorResponse) GetMessage() string
- func (*ErrorResponse) ProtoMessage()
- func (x *ErrorResponse) ProtoReflect() protoreflect.Message
- func (x *ErrorResponse) Reset()
- func (x *ErrorResponse) String() string
- type UnimplementedApiServer
- type UnsafeApiServer
- type UserDetailsResponse
- func (*UserDetailsResponse) Descriptor() ([]byte, []int)deprecated
- func (x *UserDetailsResponse) GetName() string
- func (x *UserDetailsResponse) GetUserId() int64
- func (*UserDetailsResponse) ProtoMessage()
- func (x *UserDetailsResponse) ProtoReflect() protoreflect.Message
- func (x *UserDetailsResponse) Reset()
- func (x *UserDetailsResponse) String() string
Constants ¶
This section is empty.
Variables ¶
var Api_ServiceDesc = grpc.ServiceDesc{ ServiceName: "example.Api", HandlerType: (*ApiServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Auth", Handler: _Api_Auth_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "shared/proto/example/example.proto", }
Api_ServiceDesc is the grpc.ServiceDesc for Api service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterApiServer ¶
func RegisterApiServer(s grpc.ServiceRegistrar, srv ApiServer)
Types ¶
type ApiClient ¶
type ApiClient interface {
Auth(ctx context.Context, in *AuthRequest, opts ...grpc.CallOption) (*AuthResponse, error)
}
ApiClient is the client API for Api 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 NewApiClient ¶
func NewApiClient(cc grpc.ClientConnInterface) ApiClient
type ApiServer ¶
type ApiServer interface { Auth(context.Context, *AuthRequest) (*AuthResponse, error) // contains filtered or unexported methods }
ApiServer is the server API for Api service. All implementations must embed UnimplementedApiServer for forward compatibility
type AuthRequest ¶
type AuthRequest struct { Username string `protobuf:"bytes,1,opt,name=Username,proto3" json:"username,omitempty" validate:"required,min=5,max=20"` // @gotags: json:"username,omitempty" validate:"required,min=5,max=20" Password string `protobuf:"bytes,2,opt,name=Password,proto3" json:"password,omitempty" validate:"required,min=8"` // @gotags: json:"password,omitempty" validate:"required,min=8" // contains filtered or unexported fields }
func (*AuthRequest) Descriptor
deprecated
func (*AuthRequest) Descriptor() ([]byte, []int)
Deprecated: Use AuthRequest.ProtoReflect.Descriptor instead.
func (*AuthRequest) GetPassword ¶
func (x *AuthRequest) GetPassword() string
func (*AuthRequest) GetUsername ¶
func (x *AuthRequest) GetUsername() string
func (*AuthRequest) ProtoMessage ¶
func (*AuthRequest) ProtoMessage()
func (*AuthRequest) ProtoReflect ¶
func (x *AuthRequest) ProtoReflect() protoreflect.Message
func (*AuthRequest) Reset ¶
func (x *AuthRequest) Reset()
func (*AuthRequest) String ¶
func (x *AuthRequest) String() string
type AuthResponse ¶
type AuthResponse struct { UserId int64 `protobuf:"varint,1,opt,name=UserId,proto3" json:"userId,omitempty"` // @gotags: json:"userId,omitempty" Error bool `protobuf:"varint,2,opt,name=Error,proto3" json:"error,omitempty"` // @gotags: json:"error,omitempty" Message string `protobuf:"bytes,3,opt,name=Message,proto3" json:"message,omitempty"` // @gotags: json:"message,omitempty" UserDetails *UserDetailsResponse `protobuf:"bytes,4,opt,name=UserDetails,proto3" json:"userDetails,omitempty"` // @gotags: json:"userDetails,omitempty" // contains filtered or unexported fields }
func (*AuthResponse) Descriptor
deprecated
func (*AuthResponse) Descriptor() ([]byte, []int)
Deprecated: Use AuthResponse.ProtoReflect.Descriptor instead.
func (*AuthResponse) GetError ¶
func (x *AuthResponse) GetError() bool
func (*AuthResponse) GetMessage ¶
func (x *AuthResponse) GetMessage() string
func (*AuthResponse) GetUserDetails ¶
func (x *AuthResponse) GetUserDetails() *UserDetailsResponse
func (*AuthResponse) GetUserId ¶
func (x *AuthResponse) GetUserId() int64
func (*AuthResponse) ProtoMessage ¶
func (*AuthResponse) ProtoMessage()
func (*AuthResponse) ProtoReflect ¶
func (x *AuthResponse) ProtoReflect() protoreflect.Message
func (*AuthResponse) Reset ¶
func (x *AuthResponse) Reset()
func (*AuthResponse) String ¶
func (x *AuthResponse) String() string
type ErrorResponse ¶
type ErrorResponse struct { Error bool `protobuf:"varint,1,opt,name=Error,proto3" json:"error,omitempty"` // @gotags: json:"error,omitempty" Message string `protobuf:"bytes,2,opt,name=Message,proto3" json:"message,omitempty"` // @gotags: json:"message,omitempty" // contains filtered or unexported fields }
func (*ErrorResponse) Descriptor
deprecated
func (*ErrorResponse) Descriptor() ([]byte, []int)
Deprecated: Use ErrorResponse.ProtoReflect.Descriptor instead.
func (*ErrorResponse) GetError ¶
func (x *ErrorResponse) GetError() bool
func (*ErrorResponse) GetMessage ¶
func (x *ErrorResponse) GetMessage() string
func (*ErrorResponse) ProtoMessage ¶
func (*ErrorResponse) ProtoMessage()
func (*ErrorResponse) ProtoReflect ¶
func (x *ErrorResponse) ProtoReflect() protoreflect.Message
func (*ErrorResponse) Reset ¶
func (x *ErrorResponse) Reset()
func (*ErrorResponse) String ¶
func (x *ErrorResponse) String() string
type UnimplementedApiServer ¶
type UnimplementedApiServer struct { }
UnimplementedApiServer must be embedded to have forward compatible implementations.
func (UnimplementedApiServer) Auth ¶
func (UnimplementedApiServer) Auth(context.Context, *AuthRequest) (*AuthResponse, error)
type UnsafeApiServer ¶
type UnsafeApiServer interface {
// contains filtered or unexported methods
}
UnsafeApiServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to ApiServer will result in compilation errors.
type UserDetailsResponse ¶
type UserDetailsResponse struct { UserId int64 `protobuf:"varint,1,opt,name=UserId,proto3" json:"userId,omitempty"` // @gotags: json:"userId,omitempty" Name string `protobuf:"bytes,2,opt,name=Name,proto3" json:"name,omitempty"` // @gotags: json:"name,omitempty" // contains filtered or unexported fields }
func (*UserDetailsResponse) Descriptor
deprecated
func (*UserDetailsResponse) Descriptor() ([]byte, []int)
Deprecated: Use UserDetailsResponse.ProtoReflect.Descriptor instead.
func (*UserDetailsResponse) GetName ¶
func (x *UserDetailsResponse) GetName() string
func (*UserDetailsResponse) GetUserId ¶
func (x *UserDetailsResponse) GetUserId() int64
func (*UserDetailsResponse) ProtoMessage ¶
func (*UserDetailsResponse) ProtoMessage()
func (*UserDetailsResponse) ProtoReflect ¶
func (x *UserDetailsResponse) ProtoReflect() protoreflect.Message
func (*UserDetailsResponse) Reset ¶
func (x *UserDetailsResponse) Reset()
func (*UserDetailsResponse) String ¶
func (x *UserDetailsResponse) String() string