folders

package
v0.0.0-...-bb61026 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2024 License: GPL-3.0 Imports: 16 Imported by: 0

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 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

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 (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 FolderPatchReq struct {
	Name        string `db:"name" validate:"required,min=3,max=255" json:"name"`
	Description string `db:"description" validate:"min=10" json:"description"`
}

func (*FolderPatchReq) Bind

func (req *FolderPatchReq) Bind(r *http.Request) error

type FolderReq

type FolderReq struct {
	*Folder
}

func (*FolderReq) Bind

func (req *FolderReq) Bind(r *http.Request) error

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 (s *FolderService) CreateFolder(ctx context.Context, folder *Folder) (*Folder, error)

func (*FolderService) DeleteFoldersByIdAndUserId

func (s *FolderService) DeleteFoldersByIdAndUserId(ctx context.Context, folderId string, userId string) error

func (*FolderService) GetFolderByIdAndUserId

func (s *FolderService) GetFolderByIdAndUserId(ctx context.Context, folderId string, userId string) (*Folder, error)

func (*FolderService) GetFoldersByUserId

func (s *FolderService) GetFoldersByUserId(ctx context.Context, userId string) ([]*Folder, error)

func (*FolderService) PatchFolderByIdAndUserId

func (s *FolderService) PatchFolderByIdAndUserId(ctx context.Context, folderId string, userId string, folder *Folder) (*Folder, error)

type PostgresRepository

type PostgresRepository struct {
	// contains filtered or unexported fields
}

func GetNewFolderRepository

func GetNewFolderRepository(store *store.PostgresStore) *PostgresRepository

func (*PostgresRepository) CreateFolder

func (repo *PostgresRepository) CreateFolder(ctx context.Context, folder *Folder) (*Folder, error)

func (*PostgresRepository) DeleteFoldersByIdAndUserId

func (repo *PostgresRepository) DeleteFoldersByIdAndUserId(ctx context.Context, folderId string, userId string) error

func (*PostgresRepository) GetFolderByIdAndUserId

func (repo *PostgresRepository) GetFolderByIdAndUserId(ctx context.Context, folderId string, userId string) (*Folder, error)

func (*PostgresRepository) GetFolders

func (repo *PostgresRepository) GetFolders(ctx context.Context, userId string) ([]*Folder, error)

func (*PostgresRepository) GetHomeLayaoutByUserId

func (repo *PostgresRepository) GetHomeLayaoutByUserId(ctx context.Context, userId string) ([]*Folder, error)

func (*PostgresRepository) PatchFolderByIdAndUserId

func (repo *PostgresRepository) PatchFolderByIdAndUserId(ctx context.Context, folderId string, userId string, folder *Folder) (*Folder, error)

Jump to

Keyboard shortcuts

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