Documentation
¶
Index ¶
- func NewPostgresDB(ctx context.Context, cfg *config.DBConfig) (*pgx.Conn, error)
- type File
- type FileRepo
- func (r *FileRepo) AddPermission(ctx context.Context, fileID string, userID string) error
- func (r *FileRepo) Create(ctx context.Context, file *model.File) error
- func (r *FileRepo) Delete(ctx context.Context, id string) error
- func (r *FileRepo) DeletePermission(ctx context.Context, fileID string, userID string) error
- func (r *FileRepo) FindByID(ctx context.Context, id string) (*model.File, error)
- func (r *FileRepo) FindPermissionsToFile(ctx context.Context, id string) ([]*model.Permission, error)
- func (r *FileRepo) FindUserFiles(ctx context.Context, userID string) ([]*model.File, error)
- func (r *FileRepo) HasPermission(ctx context.Context, fileID string, userID string) (bool, error)
- type PostgresRepository
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type File ¶
type File interface { Create(ctx context.Context, file *model.File) error FindByID(ctx context.Context, id string) (*model.File, error) FindUserFiles(ctx context.Context, userID string) ([]*model.File, error) AddPermission(ctx context.Context, fileID string, userID string) error HasPermission(ctx context.Context, fileID string, userID string) (bool, error) DeletePermission(ctx context.Context, fileID string, userID string) error Delete(ctx context.Context, id string) error FindPermissionsToFile(ctx context.Context, id string) ([]*model.Permission, error) }
type FileRepo ¶
type FileRepo struct {
// contains filtered or unexported fields
}
func NewFileRepo ¶
func NewFileRepo(db *pgx.Conn) *FileRepo
func (*FileRepo) AddPermission ¶
func (*FileRepo) DeletePermission ¶
func (*FileRepo) FindPermissionsToFile ¶
func (*FileRepo) FindUserFiles ¶
type PostgresRepository ¶
type PostgresRepository struct {
File
}
func NewPostgresRepo ¶
func NewPostgresRepo(db *pgx.Conn) *PostgresRepository
Click to show internal directories.
Click to hide internal directories.