Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LoadRoutes ¶
func LoadRoutes(r chi.Router, config config.Config, store *store.PostgresStore)
Types ¶
type Account ¶
type Account struct { CreatedAt time.Time `db:"created_at" json:"created_at"` ApiToken *string `db:"api_token" json:"api_token"` UpdatedAt *time.Time `db:"updated_at" json:"updated_at"` Id string `db:"id" json:"id"` Name string `db:"name" json:"name"` LastName string `db:"lastname" json:"lastname"` Email string `db:"email" json:"email"` Password string `db:"password" json:"password"` Role int `db:"role" json:"role"` }
type AccountHandler ¶
type AccountHandler struct {
// contains filtered or unexported fields
}
func (AccountHandler) CreateAccount ¶
func (s AccountHandler) CreateAccount(w http.ResponseWriter, r *http.Request) error
func (AccountHandler) GetAccountByIdHandler ¶
func (s AccountHandler) GetAccountByIdHandler(w http.ResponseWriter, r *http.Request) error
type AccountReq ¶
type AccountReq struct {
*Account
}
type AccountResp ¶
type AccountResp struct { *Account Password types.Omit `json:"password,omitempty"` ApiToken types.Omit `json:"api_token,omitempty"` }
func (*AccountResp) Render ¶
func (res *AccountResp) Render(w http.ResponseWriter, r *http.Request) error
type AccountService ¶
type AccountService struct {
Repository accountsRepository
}
func (*AccountService) CreateAccount ¶
func (*AccountService) GetAccountById ¶
type CreateAccountReq ¶
type CreateAccountReq struct { Name string `db:"name" validate:"required,min=3,max=255" json:"name"` LastName string `db:"lastname" validate:"required,min=3,max=255" json:"lastname"` Email string `db:"email" validate:"required,email" json:"email"` Password string `db:"password" validate:"required,min=6,max=30,password" json:"password"` }
type GetAccountByIdHandlerReq ¶
type GetAccountByIdHandlerReq struct {
Id string `validate:"required,uuid"`
}
type PostgresRepository ¶
type PostgresRepository struct {
// contains filtered or unexported fields
}
func GetNewAccountRepository ¶
func GetNewAccountRepository(store *store.PostgresStore) *PostgresRepository
func (*PostgresRepository) CreateAccount ¶
Click to show internal directories.
Click to hide internal directories.