Documentation
¶
Index ¶
- Constants
- Variables
- func RegisterAdminServiceServer(s grpc.ServiceRegistrar, srv AdminServiceServer)
- type AdminServiceClient
- type AdminServiceServer
- type AuthResponse
- func (*AuthResponse) Descriptor() ([]byte, []int)deprecated
- func (x *AuthResponse) GetAccessToken() string
- func (x *AuthResponse) GetExpireIn() int32
- func (x *AuthResponse) GetRefreshToken() string
- func (x *AuthResponse) GetRefreshTokenExpireIn() int32
- func (*AuthResponse) ProtoMessage()
- func (x *AuthResponse) ProtoReflect() protoreflect.Message
- func (x *AuthResponse) Reset()
- func (x *AuthResponse) String() string
- type EmptyResponse
- type LoginRequest
- func (*LoginRequest) Descriptor() ([]byte, []int)deprecated
- func (x *LoginRequest) GetPassword() string
- func (x *LoginRequest) GetUsername() string
- func (*LoginRequest) ProtoMessage()
- func (x *LoginRequest) ProtoReflect() protoreflect.Message
- func (x *LoginRequest) Reset()
- func (x *LoginRequest) String() string
- type LogoutRequest
- type RegisterRequest
- func (*RegisterRequest) Descriptor() ([]byte, []int)deprecated
- func (x *RegisterRequest) GetEmail() string
- func (x *RegisterRequest) GetFirstName() string
- func (x *RegisterRequest) GetLastName() string
- func (x *RegisterRequest) GetPassword() string
- func (x *RegisterRequest) GetUsername() string
- func (*RegisterRequest) ProtoMessage()
- func (x *RegisterRequest) ProtoReflect() protoreflect.Message
- func (x *RegisterRequest) Reset()
- func (x *RegisterRequest) String() string
- type ResetPasswordRequest
- func (*ResetPasswordRequest) Descriptor() ([]byte, []int)deprecated
- func (x *ResetPasswordRequest) GetNewPassword() string
- func (x *ResetPasswordRequest) GetOldPassword() string
- func (x *ResetPasswordRequest) GetUserId() string
- func (*ResetPasswordRequest) ProtoMessage()
- func (x *ResetPasswordRequest) ProtoReflect() protoreflect.Message
- func (x *ResetPasswordRequest) Reset()
- func (x *ResetPasswordRequest) String() string
- type UnimplementedAdminServiceServer
- func (UnimplementedAdminServiceServer) Login(context.Context, *LoginRequest) (*AuthResponse, error)
- func (UnimplementedAdminServiceServer) Logout(context.Context, *LogoutRequest) (*EmptyResponse, error)
- func (UnimplementedAdminServiceServer) Register(context.Context, *RegisterRequest) (*AuthResponse, error)
- func (UnimplementedAdminServiceServer) ResetPassword(context.Context, *ResetPasswordRequest) (*EmptyResponse, error)
- type UnsafeAdminServiceServer
Constants ¶
const ( AdminService_Login_FullMethodName = "/admin.AdminService/Login" AdminService_Register_FullMethodName = "/admin.AdminService/Register" AdminService_Logout_FullMethodName = "/admin.AdminService/Logout" AdminService_ResetPassword_FullMethodName = "/admin.AdminService/ResetPassword" )
Variables ¶
var AdminService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "admin.AdminService", HandlerType: (*AdminServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Login", Handler: _AdminService_Login_Handler, }, { MethodName: "Register", Handler: _AdminService_Register_Handler, }, { MethodName: "Logout", Handler: _AdminService_Logout_Handler, }, { MethodName: "ResetPassword", Handler: _AdminService_ResetPassword_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "admin.proto", }
AdminService_ServiceDesc is the grpc.ServiceDesc for AdminService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
var File_admin_proto protoreflect.FileDescriptor
Functions ¶
func RegisterAdminServiceServer ¶
func RegisterAdminServiceServer(s grpc.ServiceRegistrar, srv AdminServiceServer)
Types ¶
type AdminServiceClient ¶
type AdminServiceClient interface {
// Logs a user in and returns a set of tokens
Login(ctx context.Context, in *LoginRequest, opts ...grpc.CallOption) (*AuthResponse, error)
// Registers a new admin/user and returns tokens immediately
Register(ctx context.Context, in *RegisterRequest, opts ...grpc.CallOption) (*AuthResponse, error)
// Invalidates a specific session
Logout(ctx context.Context, in *LogoutRequest, opts ...grpc.CallOption) (*EmptyResponse, error)
// Updates the user password
ResetPassword(ctx context.Context, in *ResetPasswordRequest, opts ...grpc.CallOption) (*EmptyResponse, error)
}
AdminServiceClient is the client API for AdminService 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 NewAdminServiceClient ¶
func NewAdminServiceClient(cc grpc.ClientConnInterface) AdminServiceClient
type AdminServiceServer ¶
type AdminServiceServer interface {
// Logs a user in and returns a set of tokens
Login(context.Context, *LoginRequest) (*AuthResponse, error)
// Registers a new admin/user and returns tokens immediately
Register(context.Context, *RegisterRequest) (*AuthResponse, error)
// Invalidates a specific session
Logout(context.Context, *LogoutRequest) (*EmptyResponse, error)
// Updates the user password
ResetPassword(context.Context, *ResetPasswordRequest) (*EmptyResponse, error)
// contains filtered or unexported methods
}
AdminServiceServer is the server API for AdminService service. All implementations must embed UnimplementedAdminServiceServer for forward compatibility.
type AuthResponse ¶
type AuthResponse struct {
AccessToken string `protobuf:"bytes,1,opt,name=access_token,json=accessToken,proto3" json:"access_token,omitempty"`
ExpireIn int32 `protobuf:"varint,2,opt,name=expire_in,json=expireIn,proto3" json:"expire_in,omitempty"`
RefreshToken string `protobuf:"bytes,3,opt,name=refresh_token,json=refreshToken,proto3" json:"refresh_token,omitempty"`
RefreshTokenExpireIn int32 `` /* 126-byte string literal not displayed */
// contains filtered or unexported fields
}
func (*AuthResponse) Descriptor
deprecated
func (*AuthResponse) Descriptor() ([]byte, []int)
Deprecated: Use AuthResponse.ProtoReflect.Descriptor instead.
func (*AuthResponse) GetAccessToken ¶
func (x *AuthResponse) GetAccessToken() string
func (*AuthResponse) GetExpireIn ¶
func (x *AuthResponse) GetExpireIn() int32
func (*AuthResponse) GetRefreshToken ¶
func (x *AuthResponse) GetRefreshToken() string
func (*AuthResponse) GetRefreshTokenExpireIn ¶
func (x *AuthResponse) GetRefreshTokenExpireIn() int32
func (*AuthResponse) ProtoMessage ¶
func (*AuthResponse) ProtoMessage()
func (*AuthResponse) ProtoReflect ¶
func (x *AuthResponse) ProtoReflect() protoreflect.Message
func (*AuthResponse) Reset ¶
func (x *AuthResponse) Reset()
func (*AuthResponse) String ¶
func (x *AuthResponse) String() string
type EmptyResponse ¶
type EmptyResponse struct {
// contains filtered or unexported fields
}
func (*EmptyResponse) Descriptor
deprecated
func (*EmptyResponse) Descriptor() ([]byte, []int)
Deprecated: Use EmptyResponse.ProtoReflect.Descriptor instead.
func (*EmptyResponse) ProtoMessage ¶
func (*EmptyResponse) ProtoMessage()
func (*EmptyResponse) ProtoReflect ¶
func (x *EmptyResponse) ProtoReflect() protoreflect.Message
func (*EmptyResponse) Reset ¶
func (x *EmptyResponse) Reset()
func (*EmptyResponse) String ¶
func (x *EmptyResponse) String() string
type LoginRequest ¶
type LoginRequest struct {
Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"`
Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"`
// contains filtered or unexported fields
}
func (*LoginRequest) Descriptor
deprecated
func (*LoginRequest) Descriptor() ([]byte, []int)
Deprecated: Use LoginRequest.ProtoReflect.Descriptor instead.
func (*LoginRequest) GetPassword ¶
func (x *LoginRequest) GetPassword() string
func (*LoginRequest) GetUsername ¶
func (x *LoginRequest) GetUsername() 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 LogoutRequest ¶
type LogoutRequest struct {
JwtId string `protobuf:"bytes,1,opt,name=jwtId,proto3" json:"jwtId,omitempty"`
// contains filtered or unexported fields
}
func (*LogoutRequest) Descriptor
deprecated
func (*LogoutRequest) Descriptor() ([]byte, []int)
Deprecated: Use LogoutRequest.ProtoReflect.Descriptor instead.
func (*LogoutRequest) GetJwtId ¶
func (x *LogoutRequest) GetJwtId() 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 RegisterRequest ¶
type RegisterRequest struct {
Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"`
Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"`
FirstName string `protobuf:"bytes,3,opt,name=first_name,json=firstName,proto3" json:"first_name,omitempty"`
LastName string `protobuf:"bytes,4,opt,name=last_name,json=lastName,proto3" json:"last_name,omitempty"`
Email string `protobuf:"bytes,5,opt,name=email,proto3" json:"email,omitempty"`
// 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) GetFirstName ¶
func (x *RegisterRequest) GetFirstName() string
func (*RegisterRequest) GetLastName ¶
func (x *RegisterRequest) GetLastName() string
func (*RegisterRequest) GetPassword ¶
func (x *RegisterRequest) GetPassword() string
func (*RegisterRequest) GetUsername ¶
func (x *RegisterRequest) GetUsername() 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 ResetPasswordRequest ¶
type ResetPasswordRequest struct {
UserId string `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"`
OldPassword string `protobuf:"bytes,2,opt,name=old_password,json=oldPassword,proto3" json:"old_password,omitempty"`
NewPassword string `protobuf:"bytes,3,opt,name=new_password,json=newPassword,proto3" json:"new_password,omitempty"`
// contains filtered or unexported fields
}
func (*ResetPasswordRequest) Descriptor
deprecated
func (*ResetPasswordRequest) Descriptor() ([]byte, []int)
Deprecated: Use ResetPasswordRequest.ProtoReflect.Descriptor instead.
func (*ResetPasswordRequest) GetNewPassword ¶
func (x *ResetPasswordRequest) GetNewPassword() string
func (*ResetPasswordRequest) GetOldPassword ¶
func (x *ResetPasswordRequest) GetOldPassword() string
func (*ResetPasswordRequest) GetUserId ¶
func (x *ResetPasswordRequest) GetUserId() string
func (*ResetPasswordRequest) ProtoMessage ¶
func (*ResetPasswordRequest) ProtoMessage()
func (*ResetPasswordRequest) ProtoReflect ¶
func (x *ResetPasswordRequest) ProtoReflect() protoreflect.Message
func (*ResetPasswordRequest) Reset ¶
func (x *ResetPasswordRequest) Reset()
func (*ResetPasswordRequest) String ¶
func (x *ResetPasswordRequest) String() string
type UnimplementedAdminServiceServer ¶
type UnimplementedAdminServiceServer struct{}
UnimplementedAdminServiceServer 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 (UnimplementedAdminServiceServer) Login ¶
func (UnimplementedAdminServiceServer) Login(context.Context, *LoginRequest) (*AuthResponse, error)
func (UnimplementedAdminServiceServer) Logout ¶
func (UnimplementedAdminServiceServer) Logout(context.Context, *LogoutRequest) (*EmptyResponse, error)
func (UnimplementedAdminServiceServer) Register ¶
func (UnimplementedAdminServiceServer) Register(context.Context, *RegisterRequest) (*AuthResponse, error)
func (UnimplementedAdminServiceServer) ResetPassword ¶
func (UnimplementedAdminServiceServer) ResetPassword(context.Context, *ResetPasswordRequest) (*EmptyResponse, error)
type UnsafeAdminServiceServer ¶
type UnsafeAdminServiceServer interface {
// contains filtered or unexported methods
}
UnsafeAdminServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to AdminServiceServer will result in compilation errors.