Documentation
¶
Index ¶
- func New(db *mongo.Database) storage.Repository
- type PropertyRepository
- func (repository PropertyRepository) Create(ctx context.Context, property *model.Property) error
- func (repository PropertyRepository) Delete(context context.Context, id string) error
- func (repository PropertyRepository) FindByID(context context.Context, id string) (*model.Property, error)
- func (repository PropertyRepository) FindByName(context context.Context, name string) (*model.Property, error)
- func (repository PropertyRepository) ReadAll(ctx context.Context) ([]*model.Property, error)
- func (repository PropertyRepository) ReadAllFiltered(ctx context.Context, names []string) ([]*model.Property, error)
- func (repository PropertyRepository) Update(ctx context.Context, property *model.Property) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type PropertyRepository ¶
type PropertyRepository struct {
// contains filtered or unexported fields
}
PropertyRepository is a representation of the property repository for a mongo DBs.
func (PropertyRepository) Delete ¶
func (repository PropertyRepository) Delete(context context.Context, id string) error
Delete the property with the given id.
func (PropertyRepository) FindByID ¶
func (repository PropertyRepository) FindByID(context context.Context, id string) (*model.Property, error)
FindByID retrieves the property matching the given id if such a property exists; otherwise will return a not found error.
func (PropertyRepository) FindByName ¶
func (repository PropertyRepository) FindByName(context context.Context, name string) (*model.Property, error)
FindByName retrieves the property matching the given name if such a property exists; otherwise will return a not found error.
func (PropertyRepository) ReadAllFiltered ¶
func (repository PropertyRepository) ReadAllFiltered(ctx context.Context, names []string) ([]*model.Property, error)
ReadAllFiltered reads all available properties and filters them according to the given names.
Click to show internal directories.
Click to hide internal directories.