model

package
v0.0.0-...-90a46cf Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2019 License: Unlicense Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Initialize

func Initialize()

Types

type Account

type Account struct {
	Id         primitive.ObjectID `json:"_id,omitempty" bson:"_id,omitempty"`
	CurrencyId string             `json:"currency_id,omitempty" bson:"currency_id,omitempty"`
	Balance    int64
}

func (Account) All

func (m Account) All() (accounts []Account, error error)

func (Account) Create

func (m Account) Create() error

func (Account) Currency

func (m Account) Currency() (currency Currency, error error)

func (Account) Delete

func (m Account) Delete() error

func (Account) Update

func (m Account) Update() error

type AccountInterface

type AccountInterface interface {
	ModelInterface
	All() ([]Account, error)
	Currency() (Currency, error)
}

type Currency

type Currency struct {
	Iso string `json:"_id,omitempty" bson:"_id,omitempty"`
}

func (Currency) All

func (m Currency) All() (currencies []Currency, error error)

func (Currency) Create

func (m Currency) Create() error

func (Currency) Delete

func (m Currency) Delete() error

func (Currency) Find

func (m Currency) Find(iso string) (currency Currency, error error)

func (Currency) Update

func (m Currency) Update() error

type CurrencyInterface

type CurrencyInterface interface {
	ModelInterface
	All() ([]Currency, error)
	Find(iso string) (Currency, error)
}

type ModelInterface

type ModelInterface interface {
	Create() error
	Update() error
	Delete() error
	// contains filtered or unexported methods
}

type User

type User struct {
	Username string   `json:"username" bson:"_id,omitempty"`
	Password string   `json:"-" bson:"password,omitempty"`
	Roles    []string `json:"roles" bson:"roles"`
}

func (User) Create

func (m User) Create() error

func (User) Delete

func (m User) Delete() error

func (*User) Find

func (m *User) Find(login string) error

func (User) GetAccounts

func (m User) GetAccounts() (accounts []Account, error error)

func (User) Update

func (m User) Update() error

type UserInterface

type UserInterface interface {
	ModelInterface
	Find(login string) error
	GetAccounts() ([]Account, error)
}

Jump to

Keyboard shortcuts

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