Documentation ¶
Index ¶
- type Drug
- type DrugRepository
- type DrugUsecase
- type ErrorResponse
- type JwtCustomClaims
- type JwtCustomRefreshClaims
- type LoginRequest
- type LoginResponse
- type LoginUsecase
- type Pagination
- type RefreshTokenRequest
- type RefreshTokenResponse
- type RefreshTokenUsecase
- type SignupRequest
- type SignupResponse
- type SignupUsecase
- type SuccessResponse
- type User
- type UserRepository
- type UserUseCase
- type Vaccination
- type VaccinationRepository
- type VaccinationUsecase
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DrugRepository ¶
type DrugUsecase ¶
type DrugUsecase interface { CreateDrug(ctx context.Context, drug *Drug) error UpdateDrug(ctx context.Context, id int, drug *Drug) error GetDrugById(ctx context.Context, id int) (*Drug, error) GetAllDrugs(ctx context.Context, pagination *Pagination) ([]*Drug, error) DeleteDrug(ctx context.Context, id int) error }
type ErrorResponse ¶
type ErrorResponse struct {
Message string `json:"message"`
}
type JwtCustomClaims ¶
JwtCustomClaims representa los claims personalizados que se incluyen en el JWT de la plataforma .
type JwtCustomRefreshClaims ¶
type JwtCustomRefreshClaims struct { ID int `json:"id"` jwt.StandardClaims }
JwtCustomRefreshClaims representa los claims personalizados que se incluyen en el JWT de actualización en la plataforma .
type LoginRequest ¶
type LoginResponse ¶
type LoginUsecase ¶
type Pagination ¶
type RefreshTokenRequest ¶
type RefreshTokenRequest struct {
RefreshToken string `form:"refreshToken" binding:"required"`
}
type RefreshTokenResponse ¶
type RefreshTokenUsecase ¶
type RefreshTokenUsecase interface { GetUserByID(c context.Context, id int) (*User, error) GetUserByEmail(c context.Context, email string) (*User, error) CreateAccessToken(user *User, secret string, expiry int) (accessToken string, err error) CreateRefreshToken(user *User, secret string, expiry int) (refreshToken string, err error) ExtractIDFromToken(requestToken string, secret string) (int, error) }
type SignupRequest ¶
type SignupRequest struct { Email string `json:"email,omitempty" jsonschema:"description=Email,format=email,title=Email,required"` Name string `json:"name,omitempty" jsonschema:"description=Name,title=Name"` Password string `json:"password,omitempty" jsonschema:"description=Password,title=Password,required"` }
type SignupResponse ¶
type SignupUsecase ¶
type SignupUsecase interface { Create(c context.Context, user *User) (*User, error) GetUserByEmail(c context.Context, email string) (*User, error) CreateAccessToken(user *User, secret string, expiry int) (accessToken string, err error) CreateRefreshToken(user *User, secret string, expiry int) (refreshToken string, err error) }
type SuccessResponse ¶
type SuccessResponse struct {
Message string `json:"message"`
}
type User ¶
type User struct { ID int `json:"id"` Name *string `json:"name"` Email string `json:"email"` Password string `json:"password,omitempty"` }
func (*User) ComparePassword ¶
ComparePassword compara la contraseña proporcionada con la contraseña almacenada del usuario.
func (*User) SetPassword ¶
SetPassword encripta la contraseña y la asigna al usuario.
type UserRepository ¶
type UserRepository interface { Create(ctx context.Context, user *User) (*User, error) FindByID(ctx context.Context, id int) (*User, error) FindByEmail(ctx context.Context, email string) (*User, error) Update(ctx context.Context, user *User) (*User, error) }
UserRepository define los métodos necesarios para interactuar con la base de datos de registros de usuarios.
type UserUseCase ¶
type UserUseCase interface { GetByID(ctx context.Context, id int) (*User, error) GetByEmail(ctx context.Context, email string) (*User, error) Create(ctx context.Context, user *User) error Update(ctx context.Context, user *User) error Delete(ctx context.Context, id int) error }
UserUseCase define los métodos necesarios para interactuar con la lógica de negocio de registros de usuarios.
type Vaccination ¶
type VaccinationRepository ¶
type VaccinationRepository interface { Create(ctx context.Context, vac *Vaccination) error Update(ctx context.Context, id int, vac *Vaccination) error FindByID(ctx context.Context, id int) (*Vaccination, error) FindAll(ctx context.Context, pagination *Pagination) ([]*Vaccination, error) Delete(ctx context.Context, id int) error }
type VaccinationUsecase ¶
type VaccinationUsecase interface { CreateVaccination(ctx context.Context, vac *Vaccination) error UpdateVaccination(ctx context.Context, id int, vac *Vaccination) error GetVaccinationById(ctx context.Context, id int) (*Vaccination, error) GetAllVaccinations(ctx context.Context, pagination *Pagination) ([]*Vaccination, error) DeleteVaccination(ctx context.Context, id int) error }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.