Documentation ¶
Index ¶
- Constants
- type Repository
- func (repository *Repository) CreateSaving(telegramID int, amount float64, currency string) (err error)
- func (repository *Repository) CreateUser(tgUser tgbotapi.User, baseCurrency string) (user *mongo.InsertOneResult, err error)
- func (repository *Repository) DeleteSavings(savingsIDs []string) (err error)
- func (repository *Repository) FindRate(currency string) (*types.Rate, error)
- func (repository *Repository) FindRates(currencies []string) ([]*types.Rate, error)
- func (repository *Repository) FindSavings(telegramID int) ([]*types.Saving, error)
- func (repository *Repository) FindUser(telegram_id int) (*types.User, error)
- func (repository *Repository) UpdateRates(exchangeRates []*types.Rate) (err error)
- func (repository *Repository) UpdateUser(telegram_id int, data map[string]interface{}) (err error)
Constants ¶
View Source
const RATES_COLLECTION = "rates"
View Source
const SAVINGS_COLLECTION = "savings"
View Source
const USERS_COLLECTION = "users"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Repository ¶
type Repository struct {
// contains filtered or unexported fields
}
func GetNew ¶
func GetNew(database *mongo.Database) *Repository
func (*Repository) CreateSaving ¶
func (repository *Repository) CreateSaving( telegramID int, amount float64, currency string, ) (err error)
func (*Repository) CreateUser ¶
func (repository *Repository) CreateUser(tgUser tgbotapi.User, baseCurrency string) (user *mongo.InsertOneResult, err error)
func (*Repository) DeleteSavings ¶
func (repository *Repository) DeleteSavings(savingsIDs []string) (err error)
func (*Repository) FindRate ¶
func (repository *Repository) FindRate(currency string) (*types.Rate, error)
func (*Repository) FindRates ¶
func (repository *Repository) FindRates(currencies []string) ([]*types.Rate, error)
func (*Repository) FindSavings ¶
func (repository *Repository) FindSavings(telegramID int) ([]*types.Saving, error)
func (*Repository) FindUser ¶
func (repository *Repository) FindUser(telegram_id int) (*types.User, error)
func (*Repository) UpdateRates ¶
func (repository *Repository) UpdateRates(exchangeRates []*types.Rate) (err error)
func (*Repository) UpdateUser ¶
func (repository *Repository) UpdateUser(telegram_id int, data map[string]interface{}) (err error)
Click to show internal directories.
Click to hide internal directories.