Documentation ¶
Index ¶
- func LoadRoutes(r chi.Router, config config.Config, store *store.PostgresStore)
- type Folder
- type FolderDeleteResp
- type FolderHandler
- func (f FolderHandler) CreateFolder(w http.ResponseWriter, r *http.Request) error
- func (l FolderHandler) CreateLink(w http.ResponseWriter, r *http.Request) error
- func (f FolderHandler) DeleteFoldersByIdAndUserId(w http.ResponseWriter, r *http.Request) error
- func (f FolderHandler) GetFolderByIdAndUserId(w http.ResponseWriter, r *http.Request) error
- func (f FolderHandler) GetFoldersByUserId(w http.ResponseWriter, r *http.Request) error
- func (f FolderHandler) PatchFoldersByIdAndUserId(w http.ResponseWriter, r *http.Request) error
- type FolderIdReq
- type FolderPatchReq
- type FolderReq
- type FolderResp
- type FolderService
- func (s *FolderService) CreateFolder(ctx context.Context, folder *Folder) (*Folder, error)
- func (s *FolderService) DeleteFoldersByIdAndUserId(ctx context.Context, folderId string, userId string) error
- func (s *FolderService) GetFolderByIdAndUserId(ctx context.Context, folderId string, userId string) (*Folder, error)
- func (s *FolderService) GetFoldersByUserId(ctx context.Context, userId string) ([]*Folder, error)
- func (s *FolderService) PatchFolderByIdAndUserId(ctx context.Context, folderId string, userId string, folder *Folder) (*Folder, error)
- type PostgresRepository
- func (repo *PostgresRepository) CreateFolder(ctx context.Context, folder *Folder) (*Folder, error)
- func (repo *PostgresRepository) DeleteFoldersByIdAndUserId(ctx context.Context, folderId string, userId string) error
- func (repo *PostgresRepository) GetFolderByIdAndUserId(ctx context.Context, folderId string, userId string) (*Folder, error)
- func (repo *PostgresRepository) GetFolders(ctx context.Context, userId string) ([]*Folder, error)
- func (repo *PostgresRepository) GetHomeLayaoutByUserId(ctx context.Context, userId string) ([]*Folder, error)
- func (repo *PostgresRepository) PatchFolderByIdAndUserId(ctx context.Context, folderId string, userId string, folder *Folder) (*Folder, error)
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 Folder ¶
type Folder struct { CreatedAt time.Time `db:"created_at" json:"created_at"` UpdatedAt *time.Time `db:"updated_at" json:"updated_at"` Id string `db:"id" json:"id"` Name string `db:"name" validate:"required,min=3,max=255" json:"name"` ParentFolderId *string `db:"parent_folder_id" validate:"omitempty,uuid" json:"parent_folder_id"` AccountId string `db:"account_id" validate:"omitempty,uuid" json:"account_id"` Description string `db:"description" validate:"min=10" json:"description"` }
type FolderDeleteResp ¶
type FolderDeleteResp struct {
Id string `json:"id"`
}
func (*FolderDeleteResp) Render ¶
func (res *FolderDeleteResp) Render(w http.ResponseWriter, r *http.Request) error
type FolderHandler ¶
type FolderHandler struct {
// contains filtered or unexported fields
}
func (FolderHandler) CreateFolder ¶
func (f FolderHandler) CreateFolder(w http.ResponseWriter, r *http.Request) error
func (FolderHandler) CreateLink ¶
func (l FolderHandler) CreateLink(w http.ResponseWriter, r *http.Request) error
func (FolderHandler) DeleteFoldersByIdAndUserId ¶
func (f FolderHandler) DeleteFoldersByIdAndUserId(w http.ResponseWriter, r *http.Request) error
func (FolderHandler) GetFolderByIdAndUserId ¶
func (f FolderHandler) GetFolderByIdAndUserId(w http.ResponseWriter, r *http.Request) error
func (FolderHandler) GetFoldersByUserId ¶
func (f FolderHandler) GetFoldersByUserId(w http.ResponseWriter, r *http.Request) error
func (FolderHandler) PatchFoldersByIdAndUserId ¶
func (f FolderHandler) PatchFoldersByIdAndUserId(w http.ResponseWriter, r *http.Request) error
type FolderIdReq ¶
type FolderIdReq struct {
Id string `validate:"required,uuid"`
}
type FolderPatchReq ¶
type FolderResp ¶
type FolderResp struct {
*Folder
}
func (*FolderResp) Render ¶
func (res *FolderResp) Render(w http.ResponseWriter, r *http.Request) error
type FolderService ¶
type FolderService struct {
Repository foldersRepository
}
func (*FolderService) CreateFolder ¶
func (*FolderService) DeleteFoldersByIdAndUserId ¶
func (*FolderService) GetFolderByIdAndUserId ¶
func (*FolderService) GetFoldersByUserId ¶
func (*FolderService) PatchFolderByIdAndUserId ¶
type PostgresRepository ¶
type PostgresRepository struct {
// contains filtered or unexported fields
}
func GetNewFolderRepository ¶
func GetNewFolderRepository(store *store.PostgresStore) *PostgresRepository
func (*PostgresRepository) CreateFolder ¶
func (*PostgresRepository) DeleteFoldersByIdAndUserId ¶
func (*PostgresRepository) GetFolderByIdAndUserId ¶
func (*PostgresRepository) GetFolders ¶
func (*PostgresRepository) GetHomeLayaoutByUserId ¶
func (*PostgresRepository) PatchFolderByIdAndUserId ¶
Click to show internal directories.
Click to hide internal directories.