authv1

package
v0.3.11 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2025 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Auth_Login_FullMethodName    = "/github.chas3air.protos.auth.Auth/Login"
	Auth_Register_FullMethodName = "/github.chas3air.protos.auth.Auth/Register"
	Auth_IsAdmin_FullMethodName  = "/github.chas3air.protos.auth.Auth/IsAdmin"
)

Variables

View Source
var Auth_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "github.chas3air.protos.auth.Auth",
	HandlerType: (*AuthServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Login",
			Handler:    _Auth_Login_Handler,
		},
		{
			MethodName: "Register",
			Handler:    _Auth_Register_Handler,
		},
		{
			MethodName: "IsAdmin",
			Handler:    _Auth_IsAdmin_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "auth/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_auth_auth_proto protoreflect.FileDescriptor

Functions

func RegisterAuthServer

func RegisterAuthServer(s grpc.ServiceRegistrar, srv AuthServer)

Types

type AuthClient

type AuthClient interface {
	Login(ctx context.Context, in *LoginRequest, opts ...grpc.CallOption) (*LoginResponse, error)
	Register(ctx context.Context, in *RegisterRequest, opts ...grpc.CallOption) (*RegisterResponse, error)
	IsAdmin(ctx context.Context, in *IsAdminRequest, opts ...grpc.CallOption) (*IsAdminResponse, 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, *LoginRequest) (*LoginResponse, error)
	Register(context.Context, *RegisterRequest) (*RegisterResponse, error)
	IsAdmin(context.Context, *IsAdminRequest) (*IsAdminResponse, 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 string `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"`
	// 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() string

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"`
	// 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"`
	Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"`
	AppId    string `protobuf:"bytes,3,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty"`
	// 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() string

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 {
	AccessToken  string `protobuf:"bytes,1,opt,name=accessToken,proto3" json:"accessToken,omitempty"`
	RefreshToken string `protobuf:"bytes,2,opt,name=refreshToken,proto3" json:"refreshToken,omitempty"`
	// contains filtered or unexported fields
}

func (*LoginResponse) Descriptor deprecated

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

Deprecated: Use LoginResponse.ProtoReflect.Descriptor instead.

func (*LoginResponse) GetAccessToken added in v0.3.1

func (x *LoginResponse) GetAccessToken() string

func (*LoginResponse) GetRefreshToken added in v0.3.1

func (x *LoginResponse) GetRefreshToken() 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 RegisterRequest

type RegisterRequest struct {
	User *User `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"`
	// contains filtered or unexported fields
}

func (*RegisterRequest) Descriptor deprecated

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

Deprecated: Use RegisterRequest.ProtoReflect.Descriptor instead.

func (*RegisterRequest) GetUser added in v0.2.2

func (x *RegisterRequest) GetUser() *User

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 {
	User *User `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"`
	// contains filtered or unexported fields
}

func (*RegisterResponse) Descriptor deprecated

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

Deprecated: Use RegisterResponse.ProtoReflect.Descriptor instead.

func (*RegisterResponse) GetUser added in v0.3.10

func (x *RegisterResponse) GetUser() *User

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.

NOTE: this should be embedded by value instead of pointer to avoid a nil pointer dereference when methods are called.

func (UnimplementedAuthServer) IsAdmin

func (UnimplementedAuthServer) Login

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 added in v0.2.2

type User struct {
	Id          string                 `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	Email       string                 `protobuf:"bytes,2,opt,name=email,proto3" json:"email,omitempty"`
	Password    string                 `protobuf:"bytes,3,opt,name=password,proto3" json:"password,omitempty"`
	Role        string                 `protobuf:"bytes,4,opt,name=role,proto3" json:"role,omitempty"`
	Nick        string                 `protobuf:"bytes,5,opt,name=nick,proto3" json:"nick,omitempty"`
	Birthday    *timestamppb.Timestamp `protobuf:"bytes,6,opt,name=birthday,proto3" json:"birthday,omitempty"`
	Description string                 `protobuf:"bytes,7,opt,name=description,proto3" json:"description,omitempty"`
	// contains filtered or unexported fields
}

func (*User) Descriptor deprecated added in v0.2.2

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

Deprecated: Use User.ProtoReflect.Descriptor instead.

func (*User) GetBirthday added in v0.2.2

func (x *User) GetBirthday() *timestamppb.Timestamp

func (*User) GetDescription added in v0.2.3

func (x *User) GetDescription() string

func (*User) GetEmail added in v0.2.2

func (x *User) GetEmail() string

func (*User) GetId added in v0.2.2

func (x *User) GetId() string

func (*User) GetNick added in v0.2.2

func (x *User) GetNick() string

func (*User) GetPassword added in v0.2.2

func (x *User) GetPassword() string

func (*User) GetRole added in v0.2.2

func (x *User) GetRole() string

func (*User) ProtoMessage added in v0.2.2

func (*User) ProtoMessage()

func (*User) ProtoReflect added in v0.2.2

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

func (*User) Reset added in v0.2.2

func (x *User) Reset()

func (*User) String added in v0.2.2

func (x *User) String() string

Jump to

Keyboard shortcuts

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