Documentation
¶
Index ¶
- Variables
- func RegisterAuthServer(s grpc.ServiceRegistrar, srv AuthServer)
- type AuthClient
- type AuthServer
- type Credentials
- func (*Credentials) Descriptor() ([]byte, []int)deprecated
- func (x *Credentials) GetPassword() string
- func (x *Credentials) GetUsername() string
- func (*Credentials) ProtoMessage()
- func (x *Credentials) ProtoReflect() protoreflect.Message
- func (x *Credentials) Reset()
- func (x *Credentials) String() string
- type RegisterData
- func (*RegisterData) Descriptor() ([]byte, []int)deprecated
- func (x *RegisterData) GetCred() *Credentials
- func (x *RegisterData) GetEmail() string
- func (*RegisterData) ProtoMessage()
- func (x *RegisterData) ProtoReflect() protoreflect.Message
- func (x *RegisterData) Reset()
- func (x *RegisterData) String() string
- type Session
- func (*Session) Descriptor() ([]byte, []int)deprecated
- func (x *Session) GetExpire() *timestamp.Timestamp
- func (x *Session) GetKey() string
- func (x *Session) GetUserID() int64
- func (*Session) ProtoMessage()
- func (x *Session) ProtoReflect() protoreflect.Message
- func (x *Session) Reset()
- func (x *Session) String() string
- type UnimplementedAuthServer
- func (UnimplementedAuthServer) GetUserID(context.Context, *Session) (*UserID, error)
- func (UnimplementedAuthServer) Login(context.Context, *Credentials) (*Session, error)
- func (UnimplementedAuthServer) Logout(context.Context, *Session) (*empty.Empty, error)
- func (UnimplementedAuthServer) Register(context.Context, *RegisterData) (*empty.Empty, error)
- type UnsafeAuthServer
- type User
- type UserID
Constants ¶
This section is empty.
Variables ¶
var Auth_ServiceDesc = grpc.ServiceDesc{ ServiceName: "auth.Auth", HandlerType: (*AuthServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Register", Handler: _Auth_Register_Handler, }, { MethodName: "Login", Handler: _Auth_Login_Handler, }, { MethodName: "Logout", Handler: _Auth_Logout_Handler, }, { MethodName: "GetUserID", Handler: _Auth_GetUserID_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "api/proto/auth.proto", }
Auth_ServiceDesc is the grpc.ServiceDesc for Auth service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
var File_api_proto_auth_proto protoreflect.FileDescriptor
Functions ¶
func RegisterAuthServer ¶
func RegisterAuthServer(s grpc.ServiceRegistrar, srv AuthServer)
Types ¶
type AuthClient ¶
type AuthClient interface { Register(ctx context.Context, in *RegisterData, opts ...grpc.CallOption) (*empty.Empty, error) Login(ctx context.Context, in *Credentials, opts ...grpc.CallOption) (*Session, error) Logout(ctx context.Context, in *Session, opts ...grpc.CallOption) (*empty.Empty, error) GetUserID(ctx context.Context, in *Session, opts ...grpc.CallOption) (*UserID, error) }
AuthClient is the client API for Auth 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 NewAuthClient ¶
func NewAuthClient(cc grpc.ClientConnInterface) AuthClient
type AuthServer ¶
type AuthServer interface { Register(context.Context, *RegisterData) (*empty.Empty, error) Login(context.Context, *Credentials) (*Session, error) Logout(context.Context, *Session) (*empty.Empty, error) GetUserID(context.Context, *Session) (*UserID, error) // contains filtered or unexported methods }
AuthServer is the server API for Auth service. All implementations must embed UnimplementedAuthServer for forward compatibility
type Credentials ¶
type Credentials struct { Password string `protobuf:"bytes,1,opt,name=password,proto3" json:"password,omitempty"` Username string `protobuf:"bytes,2,opt,name=username,proto3" json:"username,omitempty"` // contains filtered or unexported fields }
func (*Credentials) Descriptor
deprecated
func (*Credentials) Descriptor() ([]byte, []int)
Deprecated: Use Credentials.ProtoReflect.Descriptor instead.
func (*Credentials) GetPassword ¶
func (x *Credentials) GetPassword() string
func (*Credentials) GetUsername ¶
func (x *Credentials) GetUsername() string
func (*Credentials) ProtoMessage ¶
func (*Credentials) ProtoMessage()
func (*Credentials) ProtoReflect ¶
func (x *Credentials) ProtoReflect() protoreflect.Message
func (*Credentials) Reset ¶
func (x *Credentials) Reset()
func (*Credentials) String ¶
func (x *Credentials) String() string
type RegisterData ¶
type RegisterData struct { Cred *Credentials `protobuf:"bytes,1,opt,name=cred,proto3" json:"cred,omitempty"` Email string `protobuf:"bytes,2,opt,name=email,proto3" json:"email,omitempty"` // contains filtered or unexported fields }
func (*RegisterData) Descriptor
deprecated
func (*RegisterData) Descriptor() ([]byte, []int)
Deprecated: Use RegisterData.ProtoReflect.Descriptor instead.
func (*RegisterData) GetCred ¶
func (x *RegisterData) GetCred() *Credentials
func (*RegisterData) GetEmail ¶
func (x *RegisterData) GetEmail() string
func (*RegisterData) ProtoMessage ¶
func (*RegisterData) ProtoMessage()
func (*RegisterData) ProtoReflect ¶
func (x *RegisterData) ProtoReflect() protoreflect.Message
func (*RegisterData) Reset ¶
func (x *RegisterData) Reset()
func (*RegisterData) String ¶
func (x *RegisterData) String() string
type Session ¶
type Session struct { Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` UserID int64 `protobuf:"varint,2,opt,name=userID,proto3" json:"userID,omitempty"` Expire *timestamp.Timestamp `protobuf:"bytes,3,opt,name=expire,proto3" json:"expire,omitempty"` // contains filtered or unexported fields }
func (*Session) Descriptor
deprecated
func (*Session) ProtoMessage ¶
func (*Session) ProtoMessage()
func (*Session) ProtoReflect ¶
func (x *Session) ProtoReflect() protoreflect.Message
type UnimplementedAuthServer ¶
type UnimplementedAuthServer struct { }
UnimplementedAuthServer must be embedded to have forward compatible implementations.
func (UnimplementedAuthServer) Login ¶
func (UnimplementedAuthServer) Login(context.Context, *Credentials) (*Session, error)
func (UnimplementedAuthServer) Register ¶
func (UnimplementedAuthServer) Register(context.Context, *RegisterData) (*empty.Empty, error)
type UnsafeAuthServer ¶
type UnsafeAuthServer interface {
// contains filtered or unexported methods
}
UnsafeAuthServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to AuthServer will result in compilation errors.
type User ¶
type User struct { Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` Username string `protobuf:"bytes,2,opt,name=username,proto3" json:"username,omitempty"` Avatar string `protobuf:"bytes,3,opt,name=avatar,proto3" json:"avatar,omitempty"` // contains filtered or unexported fields }
func (*User) Descriptor
deprecated
func (*User) GetUsername ¶
func (*User) ProtoMessage ¶
func (*User) ProtoMessage()
func (*User) ProtoReflect ¶
func (x *User) ProtoReflect() protoreflect.Message
type UserID ¶
type UserID struct { Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` // contains filtered or unexported fields }
func (*UserID) Descriptor
deprecated
func (*UserID) ProtoMessage ¶
func (*UserID) ProtoMessage()
func (*UserID) ProtoReflect ¶
func (x *UserID) ProtoReflect() protoreflect.Message