mongo

package
v0.0.0-...-18fed97 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2020 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

New retrieves a new repository object ready to be used.

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

func (repository PropertyRepository) Create(ctx context.Context, property *model.Property) error

Create a new entry based on the provided property.

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

func (repository PropertyRepository) ReadAll(ctx context.Context) ([]*model.Property, error)

ReadAll retrieves all available properties.

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.

func (PropertyRepository) Update

func (repository PropertyRepository) Update(ctx context.Context, property *model.Property) error

Update all fields of the given property.

Jump to

Keyboard shortcuts

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