Documentation
¶
Index ¶
- type AllFinder
- type DBError
- type Deleter
- type FileInformationRepository
- type FileInformationService
- func (m *FileInformationService) Delete(ctx context.Context, id string) error
- func (m *FileInformationService) FindAll(ctx context.Context) ([]*FileRecord, error)
- func (m *FileInformationService) FindById(ctx context.Context, id string) (*FileRecord, error)
- func (m *FileInformationService) Save(ctx context.Context, file multipart.File) (*FileRecord, error)
- type FileRecord
- type Finder
- type Metadata
- type PostgresStore
- func (p *PostgresStore) Create(ctx context.Context, fileInformation FileRecord) (*FileRecord, error)
- func (p *PostgresStore) CreateIndexOn(name string, columns []string) error
- func (p *PostgresStore) CreateTable() error
- func (p *PostgresStore) Delete(ctx context.Context, id string) error
- func (p *PostgresStore) FindAll(ctx context.Context) ([]*FileRecord, error)
- func (p *PostgresStore) FindById(ctx context.Context, id string) (*FileRecord, error)
- type Saver
- type Storer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DBError ¶
type DBError struct {
Err error
}
func DBErrorMessage ¶
func DuplicateKeyError ¶
func IndexNotCreatedError ¶
func NewDBError ¶
type FileInformationRepository ¶
type FileInformationRepository interface { FindById(context.Context, string) (*FileRecord, error) FindAll(context.Context) ([]*FileRecord, error) Create(context.Context, FileRecord) (*FileRecord, error) Delete(context.Context, string) error }
type FileInformationService ¶
type FileInformationService struct {
// contains filtered or unexported fields
}
func NewFileInformationService ¶
func NewFileInformationService(repo FileInformationRepository) *FileInformationService
func (*FileInformationService) Delete ¶
func (m *FileInformationService) Delete(ctx context.Context, id string) error
func (*FileInformationService) FindAll ¶
func (m *FileInformationService) FindAll(ctx context.Context) ([]*FileRecord, error)
func (*FileInformationService) FindById ¶
func (m *FileInformationService) FindById(ctx context.Context, id string) (*FileRecord, error)
func (*FileInformationService) Save ¶
func (m *FileInformationService) Save(ctx context.Context, file multipart.File) (*FileRecord, error)
type FileRecord ¶
type FileRecord struct { ID uint `json:"id"` Filename string `json:"name"` FileType string `json:"type"` S3Link string `json:"link"` Category string `json:"category"` UploadDate time.Time `json:"uploadDate"` Metadata `json:"metadata"` }
FileRecord is a DTO
type Metadata ¶
type PostgresStore ¶
type PostgresStore struct {
// contains filtered or unexported fields
}
func NewPostgresStore ¶
func NewPostgresStore(config config.FileInformationStoreConfig) (*PostgresStore, error)
func (*PostgresStore) Create ¶
func (p *PostgresStore) Create(ctx context.Context, fileInformation FileRecord) (*FileRecord, error)
func (*PostgresStore) CreateIndexOn ¶
func (p *PostgresStore) CreateIndexOn(name string, columns []string) error
CreateIndexOn creates an index on the list of columns given. The name provided will be
func (*PostgresStore) CreateTable ¶
func (p *PostgresStore) CreateTable() error
func (*PostgresStore) FindAll ¶
func (p *PostgresStore) FindAll(ctx context.Context) ([]*FileRecord, error)
func (*PostgresStore) FindById ¶
func (p *PostgresStore) FindById(ctx context.Context, id string) (*FileRecord, error)
Click to show internal directories.
Click to hide internal directories.