grpc

package
v0.0.0-...-095c751 Latest Latest
Warning

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

Go to latest
Published: May 29, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Auth_Login_FullMethodName          = "/Auth/Login"
	Auth_Signup_FullMethodName         = "/Auth/Signup"
	Auth_Logout_FullMethodName         = "/Auth/Logout"
	Auth_GetCurrentUser_FullMethodName = "/Auth/GetCurrentUser"
	Auth_EditEmail_FullMethodName      = "/Auth/EditEmail"
)

Variables

View Source
var Auth_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "Auth",
	HandlerType: (*AuthServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Login",
			Handler:    _Auth_Login_Handler,
		},
		{
			MethodName: "Signup",
			Handler:    _Auth_Signup_Handler,
		},
		{
			MethodName: "Logout",
			Handler:    _Auth_Logout_Handler,
		},
		{
			MethodName: "GetCurrentUser",
			Handler:    _Auth_GetCurrentUser_Handler,
		},
		{
			MethodName: "EditEmail",
			Handler:    _Auth_EditEmail_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "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)

Functions

func RegisterAuthServer

func RegisterAuthServer(s grpc.ServiceRegistrar, srv AuthServer)

Types

type AuthClient

type AuthClient interface {
	Login(ctx context.Context, in *ExistedUserData, opts ...grpc.CallOption) (*LoggedUser, error)
	Signup(ctx context.Context, in *NewUserData, opts ...grpc.CallOption) (*LoggedUser, error)
	Logout(ctx context.Context, in *SessionData, opts ...grpc.CallOption) (*emptypb.Empty, error)
	GetCurrentUser(ctx context.Context, in *SessionData, opts ...grpc.CallOption) (*AuthUser, error)
	EditEmail(ctx context.Context, in *EditEmailRequest, opts ...grpc.CallOption) (*User, 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 {
	Login(context.Context, *ExistedUserData) (*LoggedUser, error)
	Signup(context.Context, *NewUserData) (*LoggedUser, error)
	Logout(context.Context, *SessionData) (*emptypb.Empty, error)
	GetCurrentUser(context.Context, *SessionData) (*AuthUser, error)
	EditEmail(context.Context, *EditEmailRequest) (*User, error)
	// contains filtered or unexported methods
}

AuthServer is the server API for Auth service. All implementations must embed UnimplementedAuthServer for forward compatibility

type AuthUser

type AuthUser struct {
	ID           uint64 `protobuf:"varint,1,opt,name=ID,proto3" json:"ID,omitempty"`
	Email        string `protobuf:"bytes,2,opt,name=Email,proto3" json:"Email,omitempty"`
	PasswordHash string `protobuf:"bytes,3,opt,name=PasswordHash,proto3" json:"PasswordHash,omitempty"`
	IsAuth       bool   `protobuf:"varint,4,opt,name=IsAuth,proto3" json:"IsAuth,omitempty"`
	// contains filtered or unexported fields
}

func (*AuthUser) Descriptor deprecated

func (*AuthUser) Descriptor() ([]byte, []int)

Deprecated: Use AuthUser.ProtoReflect.Descriptor instead.

func (*AuthUser) GetEmail

func (x *AuthUser) GetEmail() string

func (*AuthUser) GetID

func (x *AuthUser) GetID() uint64

func (*AuthUser) GetIsAuth

func (x *AuthUser) GetIsAuth() bool

func (*AuthUser) GetPasswordHash

func (x *AuthUser) GetPasswordHash() string

func (*AuthUser) ProtoMessage

func (*AuthUser) ProtoMessage()

func (*AuthUser) ProtoReflect

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

func (*AuthUser) Reset

func (x *AuthUser) Reset()

func (*AuthUser) String

func (x *AuthUser) String() string

type EditEmailRequest

type EditEmailRequest struct {
	SessionID string `protobuf:"bytes,1,opt,name=SessionID,proto3" json:"SessionID,omitempty"`
	Email     string `protobuf:"bytes,2,opt,name=Email,proto3" json:"Email,omitempty"`
	// contains filtered or unexported fields
}

func (*EditEmailRequest) Descriptor deprecated

func (*EditEmailRequest) Descriptor() ([]byte, []int)

Deprecated: Use EditEmailRequest.ProtoReflect.Descriptor instead.

func (*EditEmailRequest) GetEmail

func (x *EditEmailRequest) GetEmail() string

func (*EditEmailRequest) GetSessionID

func (x *EditEmailRequest) GetSessionID() string

func (*EditEmailRequest) ProtoMessage

func (*EditEmailRequest) ProtoMessage()

func (*EditEmailRequest) ProtoReflect

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

func (*EditEmailRequest) Reset

func (x *EditEmailRequest) Reset()

func (*EditEmailRequest) String

func (x *EditEmailRequest) String() string

type ExistedUserData

type ExistedUserData struct {
	Email    string `protobuf:"bytes,1,opt,name=Email,proto3" json:"Email,omitempty"`
	Password string `protobuf:"bytes,2,opt,name=Password,proto3" json:"Password,omitempty"`
	// contains filtered or unexported fields
}

func (*ExistedUserData) Descriptor deprecated

func (*ExistedUserData) Descriptor() ([]byte, []int)

Deprecated: Use ExistedUserData.ProtoReflect.Descriptor instead.

func (*ExistedUserData) GetEmail

func (x *ExistedUserData) GetEmail() string

func (*ExistedUserData) GetPassword

func (x *ExistedUserData) GetPassword() string

func (*ExistedUserData) ProtoMessage

func (*ExistedUserData) ProtoMessage()

func (*ExistedUserData) ProtoReflect

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

func (*ExistedUserData) Reset

func (x *ExistedUserData) Reset()

func (*ExistedUserData) String

func (x *ExistedUserData) String() string

type LoggedUser

type LoggedUser struct {
	ID           uint64 `protobuf:"varint,1,opt,name=ID,proto3" json:"ID,omitempty"`
	Email        string `protobuf:"bytes,2,opt,name=Email,proto3" json:"Email,omitempty"`
	PasswordHash string `protobuf:"bytes,3,opt,name=PasswordHash,proto3" json:"PasswordHash,omitempty"`
	SessionID    string `protobuf:"bytes,4,opt,name=SessionID,proto3" json:"SessionID,omitempty"`
	IsAuth       bool   `protobuf:"varint,5,opt,name=IsAuth,proto3" json:"IsAuth,omitempty"`
	// contains filtered or unexported fields
}

func (*LoggedUser) Descriptor deprecated

func (*LoggedUser) Descriptor() ([]byte, []int)

Deprecated: Use LoggedUser.ProtoReflect.Descriptor instead.

func (*LoggedUser) GetEmail

func (x *LoggedUser) GetEmail() string

func (*LoggedUser) GetID

func (x *LoggedUser) GetID() uint64

func (*LoggedUser) GetIsAuth

func (x *LoggedUser) GetIsAuth() bool

func (*LoggedUser) GetPasswordHash

func (x *LoggedUser) GetPasswordHash() string

func (*LoggedUser) GetSessionID

func (x *LoggedUser) GetSessionID() string

func (*LoggedUser) ProtoMessage

func (*LoggedUser) ProtoMessage()

func (*LoggedUser) ProtoReflect

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

func (*LoggedUser) Reset

func (x *LoggedUser) Reset()

func (*LoggedUser) String

func (x *LoggedUser) String() string

type NewUserData

type NewUserData struct {
	Email          string `protobuf:"bytes,1,opt,name=Email,proto3" json:"Email,omitempty"`
	Password       string `protobuf:"bytes,2,opt,name=Password,proto3" json:"Password,omitempty"`
	PasswordRepeat string `protobuf:"bytes,3,opt,name=PasswordRepeat,proto3" json:"PasswordRepeat,omitempty"`
	// contains filtered or unexported fields
}

func (*NewUserData) Descriptor deprecated

func (*NewUserData) Descriptor() ([]byte, []int)

Deprecated: Use NewUserData.ProtoReflect.Descriptor instead.

func (*NewUserData) GetEmail

func (x *NewUserData) GetEmail() string

func (*NewUserData) GetPassword

func (x *NewUserData) GetPassword() string

func (*NewUserData) GetPasswordRepeat

func (x *NewUserData) GetPasswordRepeat() string

func (*NewUserData) ProtoMessage

func (*NewUserData) ProtoMessage()

func (*NewUserData) ProtoReflect

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

func (*NewUserData) Reset

func (x *NewUserData) Reset()

func (*NewUserData) String

func (x *NewUserData) String() string

type SessionData

type SessionData struct {
	SessionID string `protobuf:"bytes,1,opt,name=SessionID,proto3" json:"SessionID,omitempty"`
	// contains filtered or unexported fields
}

func (*SessionData) Descriptor deprecated

func (*SessionData) Descriptor() ([]byte, []int)

Deprecated: Use SessionData.ProtoReflect.Descriptor instead.

func (*SessionData) GetSessionID

func (x *SessionData) GetSessionID() string

func (*SessionData) ProtoMessage

func (*SessionData) ProtoMessage()

func (*SessionData) ProtoReflect

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

func (*SessionData) Reset

func (x *SessionData) Reset()

func (*SessionData) String

func (x *SessionData) String() string

type UnimplementedAuthServer

type UnimplementedAuthServer struct {
}

UnimplementedAuthServer must be embedded to have forward compatible implementations.

func (UnimplementedAuthServer) EditEmail

func (UnimplementedAuthServer) GetCurrentUser

func (UnimplementedAuthServer) Login

func (UnimplementedAuthServer) Logout

func (UnimplementedAuthServer) Signup

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           uint64 `protobuf:"varint,1,opt,name=ID,proto3" json:"ID,omitempty"`
	Email        string `protobuf:"bytes,2,opt,name=Email,proto3" json:"Email,omitempty"`
	PasswordHash string `protobuf:"bytes,3,opt,name=PasswordHash,proto3" json:"PasswordHash,omitempty"`
	// contains filtered or unexported fields
}

func (*User) Descriptor deprecated

func (*User) Descriptor() ([]byte, []int)

Deprecated: Use User.ProtoReflect.Descriptor instead.

func (*User) GetEmail

func (x *User) GetEmail() string

func (*User) GetID

func (x *User) GetID() uint64

func (*User) GetPasswordHash

func (x *User) GetPasswordHash() 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

Directories

Path Synopsis
Package mock_grpc is a generated GoMock package.
Package mock_grpc is a generated GoMock package.

Jump to

Keyboard shortcuts

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