repository

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2019 License: Unlicense Imports: 9 Imported by: 0

Documentation

Index

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)

Jump to

Keyboard shortcuts

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