Documentation
¶
Index ¶
- type Database
- func (d *Database) CreateQuote(ctx context.Context, q *models.Quote) (string, error)
- func (d *Database) GetAllQuotes(ctx context.Context, page int) ([]*models.Quote, error)
- func (d *Database) GetQuote(ctx context.Context, objId primitive.ObjectID) (*models.Quote, error)
- func (d *Database) SearchTags(ctx context.Context, tag string, page int) ([]*models.Quote, error)
- func (d *Database) UpdateQuote(ctx context.Context, q *models.Quote) (int64, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Database ¶
type Database struct { Client *mongo.Client Collection *mongo.Collection DBConfig *configs.DBConfig }
Database struct describes the database
func NewDatabase ¶
NewDatabase returns a new database
func (*Database) CreateQuote ¶
func (*Database) GetAllQuotes ¶
GetAllQuotes returns all quotes from the database (paginated and batched in options)
func (*Database) SearchTags ¶
SearchTags returns quotes that match a given tag
Click to show internal directories.
Click to hide internal directories.