postgresstore

package
v0.0.0-...-f60b94f Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2020 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewDB

func NewDB() (*sqlx.DB, error)

Types

type Account

type Account struct {
	BankID           int64           `db:"bank_id"`
	UsernameHash     string          `db:"username_hash"`
	DateRecorded     time.Time       `db:"date_recorded"`
	Bank             string          `db:"bank"`
	Type             string          `db:"type"`
	AccountName      string          `db:"account_name"`
	BSB              string          `db:"bsb"`
	AccountNumber    string          `db:"account_number"`
	CurrentBalance   decimal.Decimal `db:"current_balance"`
	AvailableBalance decimal.Decimal `db:"available_balance"`
}

type Postgres

type Postgres struct {
	// contains filtered or unexported fields
}

func New

func New() (*Postgres, error)

func (*Postgres) AddCategories

func (p *Postgres) AddCategories(usernameHash string, categories []models.Category) ([]models.Category, error)

func (*Postgres) AddDeviceToken

func (p *Postgres) AddDeviceToken(usernameHash string, deviceToken string) ([]string, error)

func (*Postgres) Close

func (p *Postgres) Close() error

func (*Postgres) GetAccounts

func (p *Postgres) GetAccounts(usernamehash string) (models.BankResponse, error)

func (*Postgres) GetBankData

func (p *Postgres) GetBankData(usernamehash string) (models.BankResponse, error)

func (*Postgres) GetCategories

func (p *Postgres) GetCategories(usernameHash string) ([]models.Category, error)

func (*Postgres) GetCredentials

func (p *Postgres) GetCredentials(usernameHash string) (string, error)

func (*Postgres) GetDeviceTokens

func (p *Postgres) GetDeviceTokens(usernameHash string) ([]string, error)

func (*Postgres) GetExclusions

func (p *Postgres) GetExclusions(usernameHash string) ([]models.Transaction, error)

func (*Postgres) GetInvocations

func (p *Postgres) GetInvocations(usernamehash string) (models.InvocationsResponse, error)

func (*Postgres) GetStoredPassword

func (p *Postgres) GetStoredPassword(usernamehash string) (string, error)

func (*Postgres) GetTransactions

func (p *Postgres) GetTransactions(usernamehash string) (models.BankResponse, error)

func (*Postgres) PatchTransaction

func (p *Postgres) PatchTransaction(usernameHash string, transactionId int64, transactionPatch models.TransactionPatch) (models.Transaction, error)

func (*Postgres) PutUser

func (p *Postgres) PutUser(usernameHash string, password string) error

func (*Postgres) SetCredentials

func (p *Postgres) SetCredentials(usernameHash string, credentials string) error

type Transaction

type Transaction struct {
	TransactionID          int64           `db:"transaction_id"`
	UsernameHash           string          `db:"username_hash"`
	DateRecorded           time.Time       `db:"date_recorded"`
	Date                   time.Time       `db:"date"`
	Account                string          `db:"account"`
	Bank                   string          `db:"bank"`
	Description            string          `db:"description"`
	DisplayableDescription string          `db:"displayable_description"`
	Credit                 decimal.Decimal `db:"credit"`
	Debit                  decimal.Decimal `db:"debit"`
	Type                   string          `db:"type"`
	Location               string          `db:"location"`
	Card                   string          `db:"card"`
	Status                 string          `db:"status"`
}

type User

type User struct {
	UserID       int    `db:"user_id"`
	UsernameHash string `db:"username_hash"`
	Password     string `db:"password"`
	Credentials  string `db:"credentials"`
}

Jump to

Keyboard shortcuts

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