auth

package
v0.0.0-...-38b1c69 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 25, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
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)

View Source
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) Descriptor() ([]byte, []int)

Deprecated: Use Session.ProtoReflect.Descriptor instead.

func (*Session) GetExpire

func (x *Session) GetExpire() *timestamp.Timestamp

func (*Session) GetKey

func (x *Session) GetKey() string

func (*Session) GetUserID

func (x *Session) GetUserID() int64

func (*Session) ProtoMessage

func (*Session) ProtoMessage()

func (*Session) ProtoReflect

func (x *Session) ProtoReflect() protoreflect.Message

func (*Session) Reset

func (x *Session) Reset()

func (*Session) String

func (x *Session) String() string

type UnimplementedAuthServer

type UnimplementedAuthServer struct {
}

UnimplementedAuthServer must be embedded to have forward compatible implementations.

func (UnimplementedAuthServer) GetUserID

func (UnimplementedAuthServer) Login

func (UnimplementedAuthServer) Logout

func (UnimplementedAuthServer) Register

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) Descriptor() ([]byte, []int)

Deprecated: Use User.ProtoReflect.Descriptor instead.

func (*User) GetAvatar

func (x *User) GetAvatar() string

func (*User) GetId

func (x *User) GetId() int64

func (*User) GetUsername

func (x *User) GetUsername() string

func (*User) ProtoMessage

func (*User) ProtoMessage()

func (*User) ProtoReflect

func (x *User) ProtoReflect() protoreflect.Message

func (*User) Reset

func (x *User) Reset()

func (*User) String

func (x *User) String() string

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) Descriptor() ([]byte, []int)

Deprecated: Use UserID.ProtoReflect.Descriptor instead.

func (*UserID) GetId

func (x *UserID) GetId() int64

func (*UserID) ProtoMessage

func (*UserID) ProtoMessage()

func (*UserID) ProtoReflect

func (x *UserID) ProtoReflect() protoreflect.Message

func (*UserID) Reset

func (x *UserID) Reset()

func (*UserID) String

func (x *UserID) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL