ssov1

package
v0.0.0-...-b64d0d8 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2023 License: MIT Imports: 8 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: "IsAdmin",
			Handler:    _Auth_IsAdmin_Handler,
		},
		{
			MethodName: "Logout",
			Handler:    _Auth_Logout_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "sso/sso.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_sso_sso_proto protoreflect.FileDescriptor

Functions

func RegisterAuthServer

func RegisterAuthServer(s grpc.ServiceRegistrar, srv AuthServer)

Types

type AuthClient

type AuthClient interface {
	// Register registers a new user.
	Register(ctx context.Context, in *RegisterRequest, opts ...grpc.CallOption) (*RegisterResponse, error)
	// Login logs in a user and returns an auth token.
	Login(ctx context.Context, in *LoginRequest, opts ...grpc.CallOption) (*LoginResponse, error)
	// IsAdmin checks whether a user is an admin.
	IsAdmin(ctx context.Context, in *IsAdminRequest, opts ...grpc.CallOption) (*IsAdminResponse, error)
	Logout(ctx context.Context, in *LogoutRequest, opts ...grpc.CallOption) (*LogoutResponse, 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 registers a new user.
	Register(context.Context, *RegisterRequest) (*RegisterResponse, error)
	// Login logs in a user and returns an auth token.
	Login(context.Context, *LoginRequest) (*LoginResponse, error)
	// IsAdmin checks whether a user is an admin.
	IsAdmin(context.Context, *IsAdminRequest) (*IsAdminResponse, error)
	Logout(context.Context, *LogoutRequest) (*LogoutResponse, error)
	// contains filtered or unexported methods
}

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

type IsAdminRequest

type IsAdminRequest struct {
	UserId int64 `protobuf:"varint,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` // User ID to validate.
	// contains filtered or unexported fields
}

func (*IsAdminRequest) Descriptor deprecated

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

Deprecated: Use IsAdminRequest.ProtoReflect.Descriptor instead.

func (*IsAdminRequest) GetUserId

func (x *IsAdminRequest) GetUserId() int64

func (*IsAdminRequest) ProtoMessage

func (*IsAdminRequest) ProtoMessage()

func (*IsAdminRequest) ProtoReflect

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

func (*IsAdminRequest) Reset

func (x *IsAdminRequest) Reset()

func (*IsAdminRequest) String

func (x *IsAdminRequest) String() string

type IsAdminResponse

type IsAdminResponse struct {
	IsAdmin bool `protobuf:"varint,1,opt,name=is_admin,json=isAdmin,proto3" json:"is_admin,omitempty"` // Indicates whether the user is an admin.
	// contains filtered or unexported fields
}

func (*IsAdminResponse) Descriptor deprecated

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

Deprecated: Use IsAdminResponse.ProtoReflect.Descriptor instead.

func (*IsAdminResponse) GetIsAdmin

func (x *IsAdminResponse) GetIsAdmin() bool

func (*IsAdminResponse) ProtoMessage

func (*IsAdminResponse) ProtoMessage()

func (*IsAdminResponse) ProtoReflect

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

func (*IsAdminResponse) Reset

func (x *IsAdminResponse) Reset()

func (*IsAdminResponse) String

func (x *IsAdminResponse) String() string

type LoginRequest

type LoginRequest struct {
	Email    string `protobuf:"bytes,1,opt,name=email,proto3" json:"email,omitempty"`               // Email of the user to login.
	Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"`         // Password of the user to login.
	AppId    int32  `protobuf:"varint,3,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty"` // ID of the app to login to.
	// contains filtered or unexported fields
}

func (*LoginRequest) Descriptor deprecated

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

Deprecated: Use LoginRequest.ProtoReflect.Descriptor instead.

func (*LoginRequest) GetAppId

func (x *LoginRequest) GetAppId() int32

func (*LoginRequest) GetEmail

func (x *LoginRequest) GetEmail() string

func (*LoginRequest) GetPassword

func (x *LoginRequest) GetPassword() string

func (*LoginRequest) ProtoMessage

func (*LoginRequest) ProtoMessage()

func (*LoginRequest) ProtoReflect

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

func (*LoginRequest) Reset

func (x *LoginRequest) Reset()

func (*LoginRequest) String

func (x *LoginRequest) String() string

type LoginResponse

type LoginResponse struct {
	Token string `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"` // Auth token of the logged in user.
	// contains filtered or unexported fields
}

func (*LoginResponse) Descriptor deprecated

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

Deprecated: Use LoginResponse.ProtoReflect.Descriptor instead.

func (*LoginResponse) GetToken

func (x *LoginResponse) GetToken() string

func (*LoginResponse) ProtoMessage

func (*LoginResponse) ProtoMessage()

func (*LoginResponse) ProtoReflect

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

func (*LoginResponse) Reset

func (x *LoginResponse) Reset()

func (*LoginResponse) String

func (x *LoginResponse) String() string

type LogoutRequest

type LogoutRequest struct {
	Token string `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"` // Auth token of the user to logout.
	// contains filtered or unexported fields
}

func (*LogoutRequest) Descriptor deprecated

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

Deprecated: Use LogoutRequest.ProtoReflect.Descriptor instead.

func (*LogoutRequest) GetToken

func (x *LogoutRequest) GetToken() string

func (*LogoutRequest) ProtoMessage

func (*LogoutRequest) ProtoMessage()

func (*LogoutRequest) ProtoReflect

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

func (*LogoutRequest) Reset

func (x *LogoutRequest) Reset()

func (*LogoutRequest) String

func (x *LogoutRequest) String() string

type LogoutResponse

type LogoutResponse struct {
	Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` // Indicates whether the logout was successful.
	// contains filtered or unexported fields
}

func (*LogoutResponse) Descriptor deprecated

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

Deprecated: Use LogoutResponse.ProtoReflect.Descriptor instead.

func (*LogoutResponse) GetSuccess

func (x *LogoutResponse) GetSuccess() bool

func (*LogoutResponse) ProtoMessage

func (*LogoutResponse) ProtoMessage()

func (*LogoutResponse) ProtoReflect

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

func (*LogoutResponse) Reset

func (x *LogoutResponse) Reset()

func (*LogoutResponse) String

func (x *LogoutResponse) String() string

type RegisterRequest

type RegisterRequest struct {
	Email    string `protobuf:"bytes,1,opt,name=email,proto3" json:"email,omitempty"`       // Email of the user to register.
	Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"` // Password of the user to register.
	// contains filtered or unexported fields
}

func (*RegisterRequest) Descriptor deprecated

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

Deprecated: Use RegisterRequest.ProtoReflect.Descriptor instead.

func (*RegisterRequest) GetEmail

func (x *RegisterRequest) GetEmail() string

func (*RegisterRequest) GetPassword

func (x *RegisterRequest) GetPassword() string

func (*RegisterRequest) ProtoMessage

func (*RegisterRequest) ProtoMessage()

func (*RegisterRequest) ProtoReflect

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

func (*RegisterRequest) Reset

func (x *RegisterRequest) Reset()

func (*RegisterRequest) String

func (x *RegisterRequest) String() string

type RegisterResponse

type RegisterResponse struct {
	UserId int64 `protobuf:"varint,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` // User ID of the registered user.
	// contains filtered or unexported fields
}

func (*RegisterResponse) Descriptor deprecated

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

Deprecated: Use RegisterResponse.ProtoReflect.Descriptor instead.

func (*RegisterResponse) GetUserId

func (x *RegisterResponse) GetUserId() int64

func (*RegisterResponse) ProtoMessage

func (*RegisterResponse) ProtoMessage()

func (*RegisterResponse) ProtoReflect

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

func (*RegisterResponse) Reset

func (x *RegisterResponse) Reset()

func (*RegisterResponse) String

func (x *RegisterResponse) String() string

type UnimplementedAuthServer

type UnimplementedAuthServer struct {
}

UnimplementedAuthServer must be embedded to have forward compatible implementations.

func (UnimplementedAuthServer) IsAdmin

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.

Jump to

Keyboard shortcuts

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