repo

package
v0.0.0-...-85f739f Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2022 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FileLocalRepo

type FileLocalRepo struct {
	BasePath string
}

func NewFileRepo

func NewFileRepo(basePath string) *FileLocalRepo

func (*FileLocalRepo) DeleteFile

func (r *FileLocalRepo) DeleteFile(fileID string) error

func (*FileLocalRepo) EnsureBaseDir

func (r *FileLocalRepo) EnsureBaseDir(filepath string) error

func (*FileLocalRepo) GetFileContentType

func (r *FileLocalRepo) GetFileContentType(fileID string) string

func (*FileLocalRepo) MatchExt

func (r *FileLocalRepo) MatchExt(filename string, extensions []string) bool

func (*FileLocalRepo) SaveFile

func (r *FileLocalRepo) SaveFile(file *multipart.FileHeader) (string, error)

func (*FileLocalRepo) StreamFile

func (r *FileLocalRepo) StreamFile(fileID string) (io.Reader, error)

type ListRepo

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

func NewListRepo

func NewListRepo(db *gorm.DB) *ListRepo

func (*ListRepo) Create

func (r *ListRepo) Create(l model.List) (model.List, error)

func (*ListRepo) DeleteByID

func (r *ListRepo) DeleteByID(id uint) error

func (*ListRepo) GetAll

func (r *ListRepo) GetAll(offset, limit int) ([]model.List, int, error)

func (*ListRepo) GetByID

func (r *ListRepo) GetByID(id uint) (model.List, error)

func (*ListRepo) GetRoots

func (r *ListRepo) GetRoots(offset, limit int, preload bool) ([]model.List, int, error)

func (*ListRepo) Update

func (r *ListRepo) Update(l *model.List) (err error)

Jump to

Keyboard shortcuts

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