Documentation ¶
Index ¶
- Variables
- func RegisterUserServiceServer(s *grpc.Server, srv UserServiceServer)
- 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) GetId() string
- func (x *AuthResponse) GetToken() string
- func (*AuthResponse) ProtoMessage()
- func (x *AuthResponse) ProtoReflect() protoreflect.Message
- func (x *AuthResponse) Reset()
- func (x *AuthResponse) String() string
- type CreateUserRequest
- func (*CreateUserRequest) Descriptor() ([]byte, []int)deprecated
- func (x *CreateUserRequest) GetClaims() *TokenClaims
- func (x *CreateUserRequest) GetEmail() string
- func (x *CreateUserRequest) GetIsAdmin() bool
- func (x *CreateUserRequest) GetPassword() string
- func (x *CreateUserRequest) GetUsername() string
- func (*CreateUserRequest) ProtoMessage()
- func (x *CreateUserRequest) ProtoReflect() protoreflect.Message
- func (x *CreateUserRequest) Reset()
- func (x *CreateUserRequest) String() string
- type CreateUserResponse
- type Error
- type GetUserRequest
- func (*GetUserRequest) Descriptor() ([]byte, []int)deprecated
- func (x *GetUserRequest) GetClaims() *TokenClaims
- func (x *GetUserRequest) GetId() string
- func (*GetUserRequest) ProtoMessage()
- func (x *GetUserRequest) ProtoReflect() protoreflect.Message
- func (x *GetUserRequest) Reset()
- func (x *GetUserRequest) String() string
- type GetUserResponse
- func (*GetUserResponse) Descriptor() ([]byte, []int)deprecated
- func (x *GetUserResponse) GetEmail() string
- func (x *GetUserResponse) GetId() string
- func (x *GetUserResponse) GetUsername() string
- func (*GetUserResponse) ProtoMessage()
- func (x *GetUserResponse) ProtoReflect() protoreflect.Message
- func (x *GetUserResponse) Reset()
- func (x *GetUserResponse) String() string
- type TokenClaims
- func (*TokenClaims) Descriptor() ([]byte, []int)deprecated
- func (x *TokenClaims) GetExpires() int64
- func (x *TokenClaims) GetIsAdmin() bool
- func (x *TokenClaims) GetUserId() string
- func (*TokenClaims) ProtoMessage()
- func (x *TokenClaims) ProtoReflect() protoreflect.Message
- func (x *TokenClaims) Reset()
- func (x *TokenClaims) String() string
- type UnimplementedUserServiceServer
- func (UnimplementedUserServiceServer) Auth(context.Context, *AuthRequest) (*AuthResponse, error)
- func (UnimplementedUserServiceServer) Create(context.Context, *CreateUserRequest) (*CreateUserResponse, error)
- func (UnimplementedUserServiceServer) Get(context.Context, *GetUserRequest) (*GetUserResponse, error)
- func (UnimplementedUserServiceServer) ValidateToken(context.Context, *ValidateTokenRequest) (*TokenClaims, error)
- type UnsafeUserServiceServer
- type UserServiceClient
- type UserServiceServer
- type ValidateTokenRequest
- func (*ValidateTokenRequest) Descriptor() ([]byte, []int)deprecated
- func (x *ValidateTokenRequest) GetToken() string
- func (*ValidateTokenRequest) ProtoMessage()
- func (x *ValidateTokenRequest) ProtoReflect() protoreflect.Message
- func (x *ValidateTokenRequest) Reset()
- func (x *ValidateTokenRequest) String() string
Constants ¶
This section is empty.
Variables ¶
var File_proto_user_user_proto protoreflect.FileDescriptor
Functions ¶
func RegisterUserServiceServer ¶
func RegisterUserServiceServer(s *grpc.Server, srv UserServiceServer)
Types ¶
type AuthRequest ¶
type AuthRequest struct { Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"` Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"` // 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 { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` Token string `protobuf:"bytes,2,opt,name=token,proto3" json:"token,omitempty"` // contains filtered or unexported fields }
func (*AuthResponse) Descriptor
deprecated
func (*AuthResponse) Descriptor() ([]byte, []int)
Deprecated: Use AuthResponse.ProtoReflect.Descriptor instead.
func (*AuthResponse) GetId ¶
func (x *AuthResponse) GetId() string
func (*AuthResponse) GetToken ¶
func (x *AuthResponse) GetToken() string
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 CreateUserRequest ¶
type CreateUserRequest struct { Claims *TokenClaims `protobuf:"bytes,1,opt,name=claims,proto3" json:"claims,omitempty"` IsAdmin bool `protobuf:"varint,2,opt,name=isAdmin,proto3" json:"isAdmin,omitempty"` Username string `protobuf:"bytes,3,opt,name=username,proto3" json:"username,omitempty"` Email string `protobuf:"bytes,4,opt,name=email,proto3" json:"email,omitempty"` Password string `protobuf:"bytes,5,opt,name=password,proto3" json:"password,omitempty"` // contains filtered or unexported fields }
func (*CreateUserRequest) Descriptor
deprecated
func (*CreateUserRequest) Descriptor() ([]byte, []int)
Deprecated: Use CreateUserRequest.ProtoReflect.Descriptor instead.
func (*CreateUserRequest) GetClaims ¶
func (x *CreateUserRequest) GetClaims() *TokenClaims
func (*CreateUserRequest) GetEmail ¶
func (x *CreateUserRequest) GetEmail() string
func (*CreateUserRequest) GetIsAdmin ¶
func (x *CreateUserRequest) GetIsAdmin() bool
func (*CreateUserRequest) GetPassword ¶
func (x *CreateUserRequest) GetPassword() string
func (*CreateUserRequest) GetUsername ¶
func (x *CreateUserRequest) GetUsername() string
func (*CreateUserRequest) ProtoMessage ¶
func (*CreateUserRequest) ProtoMessage()
func (*CreateUserRequest) ProtoReflect ¶
func (x *CreateUserRequest) ProtoReflect() protoreflect.Message
func (*CreateUserRequest) Reset ¶
func (x *CreateUserRequest) Reset()
func (*CreateUserRequest) String ¶
func (x *CreateUserRequest) String() string
type CreateUserResponse ¶
type CreateUserResponse struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // contains filtered or unexported fields }
func (*CreateUserResponse) Descriptor
deprecated
func (*CreateUserResponse) Descriptor() ([]byte, []int)
Deprecated: Use CreateUserResponse.ProtoReflect.Descriptor instead.
func (*CreateUserResponse) GetId ¶
func (x *CreateUserResponse) GetId() string
func (*CreateUserResponse) ProtoMessage ¶
func (*CreateUserResponse) ProtoMessage()
func (*CreateUserResponse) ProtoReflect ¶
func (x *CreateUserResponse) ProtoReflect() protoreflect.Message
func (*CreateUserResponse) Reset ¶
func (x *CreateUserResponse) Reset()
func (*CreateUserResponse) String ¶
func (x *CreateUserResponse) String() string
type Error ¶
type Error struct { Code int32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` // contains filtered or unexported fields }
func (*Error) Descriptor
deprecated
func (*Error) GetDescription ¶
func (*Error) ProtoMessage ¶
func (*Error) ProtoMessage()
func (*Error) ProtoReflect ¶
func (x *Error) ProtoReflect() protoreflect.Message
type GetUserRequest ¶
type GetUserRequest struct { Claims *TokenClaims `protobuf:"bytes,1,opt,name=claims,proto3" json:"claims,omitempty"` Id string `protobuf:"bytes,2,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) GetClaims ¶
func (x *GetUserRequest) GetClaims() *TokenClaims
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
type GetUserResponse ¶
type GetUserResponse struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` Username string `protobuf:"bytes,2,opt,name=username,proto3" json:"username,omitempty"` Email string `protobuf:"bytes,3,opt,name=email,proto3" json:"email,omitempty"` // contains filtered or unexported fields }
func (*GetUserResponse) Descriptor
deprecated
func (*GetUserResponse) Descriptor() ([]byte, []int)
Deprecated: Use GetUserResponse.ProtoReflect.Descriptor instead.
func (*GetUserResponse) GetEmail ¶
func (x *GetUserResponse) GetEmail() string
func (*GetUserResponse) GetId ¶
func (x *GetUserResponse) GetId() string
func (*GetUserResponse) GetUsername ¶
func (x *GetUserResponse) GetUsername() string
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
type TokenClaims ¶
type TokenClaims struct { IsAdmin bool `protobuf:"varint,1,opt,name=isAdmin,proto3" json:"isAdmin,omitempty"` UserId string `protobuf:"bytes,2,opt,name=userId,proto3" json:"userId,omitempty"` Expires int64 `protobuf:"varint,3,opt,name=expires,proto3" json:"expires,omitempty"` // contains filtered or unexported fields }
func (*TokenClaims) Descriptor
deprecated
func (*TokenClaims) Descriptor() ([]byte, []int)
Deprecated: Use TokenClaims.ProtoReflect.Descriptor instead.
func (*TokenClaims) GetExpires ¶
func (x *TokenClaims) GetExpires() int64
func (*TokenClaims) GetIsAdmin ¶
func (x *TokenClaims) GetIsAdmin() bool
func (*TokenClaims) GetUserId ¶
func (x *TokenClaims) GetUserId() string
func (*TokenClaims) ProtoMessage ¶
func (*TokenClaims) ProtoMessage()
func (*TokenClaims) ProtoReflect ¶
func (x *TokenClaims) ProtoReflect() protoreflect.Message
func (*TokenClaims) Reset ¶
func (x *TokenClaims) Reset()
func (*TokenClaims) String ¶
func (x *TokenClaims) String() string
type UnimplementedUserServiceServer ¶
type UnimplementedUserServiceServer struct { }
UnimplementedUserServiceServer must be embedded to have forward compatible implementations.
func (UnimplementedUserServiceServer) Auth ¶
func (UnimplementedUserServiceServer) Auth(context.Context, *AuthRequest) (*AuthResponse, error)
func (UnimplementedUserServiceServer) Create ¶
func (UnimplementedUserServiceServer) Create(context.Context, *CreateUserRequest) (*CreateUserResponse, error)
func (UnimplementedUserServiceServer) Get ¶
func (UnimplementedUserServiceServer) Get(context.Context, *GetUserRequest) (*GetUserResponse, error)
func (UnimplementedUserServiceServer) ValidateToken ¶
func (UnimplementedUserServiceServer) ValidateToken(context.Context, *ValidateTokenRequest) (*TokenClaims, error)
type UnsafeUserServiceServer ¶
type UnsafeUserServiceServer interface {
// contains filtered or unexported methods
}
UnsafeUserServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to UserServiceServer will result in compilation errors.
type UserServiceClient ¶
type UserServiceClient interface { Create(ctx context.Context, in *CreateUserRequest, opts ...grpc.CallOption) (*CreateUserResponse, error) Get(ctx context.Context, in *GetUserRequest, opts ...grpc.CallOption) (*GetUserResponse, error) Auth(ctx context.Context, in *AuthRequest, opts ...grpc.CallOption) (*AuthResponse, error) ValidateToken(ctx context.Context, in *ValidateTokenRequest, opts ...grpc.CallOption) (*TokenClaims, 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 grpc.ClientConnInterface) UserServiceClient
type UserServiceServer ¶
type UserServiceServer interface { Create(context.Context, *CreateUserRequest) (*CreateUserResponse, error) Get(context.Context, *GetUserRequest) (*GetUserResponse, error) Auth(context.Context, *AuthRequest) (*AuthResponse, error) ValidateToken(context.Context, *ValidateTokenRequest) (*TokenClaims, error) // contains filtered or unexported methods }
UserServiceServer is the server API for UserService service. All implementations must embed UnimplementedUserServiceServer for forward compatibility
type ValidateTokenRequest ¶
type ValidateTokenRequest struct { Token string `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"` // contains filtered or unexported fields }
func (*ValidateTokenRequest) Descriptor
deprecated
func (*ValidateTokenRequest) Descriptor() ([]byte, []int)
Deprecated: Use ValidateTokenRequest.ProtoReflect.Descriptor instead.
func (*ValidateTokenRequest) GetToken ¶
func (x *ValidateTokenRequest) GetToken() string
func (*ValidateTokenRequest) ProtoMessage ¶
func (*ValidateTokenRequest) ProtoMessage()
func (*ValidateTokenRequest) ProtoReflect ¶
func (x *ValidateTokenRequest) ProtoReflect() protoreflect.Message
func (*ValidateTokenRequest) Reset ¶
func (x *ValidateTokenRequest) Reset()
func (*ValidateTokenRequest) String ¶
func (x *ValidateTokenRequest) String() string