repository

package
v0.0.0-...-46f0560 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Buy

type Buy interface {
	Create(ctx context.Context, userId, companyId int, price int) (model.Buy, error)
	Delete(ctx context.Context, id int) (model.Buy, error)
	Get(ctx context.Context, id int) (model.Buy, error)
	GetBuys(ctx context.Context, companyId int, minPrice int, limit uint64) (id []int, err error)
	GetAllBuys(ctx context.Context, companyId int, limit, offset uint64) (price []int, err error)
	DeleteExpired(ctx context.Context) (id []model.BidInfo, err error)
}

type Company

type Company interface {
	GetAll(ctx context.Context) ([]model.Company, error)
}

type Operation

type Operation interface {
	Create(ctx context.Context, buyerId, sellerId, companyId int, price int) error
}

type Portfolio

type Portfolio interface {
	AddStock(ctx context.Context, userId, companyId int) error
	RemoveStock(ctx context.Context, userId, companyId int) error
	Create(ctx context.Context, userId, companyId int, count int) error
	Get(ctx context.Context, userId int) ([]model.Asset, error)
}

type Repositories

type Repositories struct {
	User
	Sale
	Buy
	Operation
	Secret
	Portfolio
	Company
}

func NewRepositories

func NewRepositories(db *database.Postgres) *Repositories

type Sale

type Sale interface {
	Create(ctx context.Context, userId, companyId int, price int) (model.Sale, error)
	Get(ctx context.Context, id int) (model.Sale, error)
	Delete(ctx context.Context, id int) (model.Sale, error)
	GetSales(ctx context.Context, companyId int, maxPrice int, limit uint64) (id []int, err error)
	GetAllSales(ctx context.Context, companyId int, limit, offset uint64) (price []int, err error)
	DeleteExpired(ctx context.Context) (id []model.BidInfo, err error)
}

type Secret

type Secret interface {
	SetToken(ctx context.Context, id int) (token string, err error)
	GetUserId(ctx context.Context, token string) (int, error)
}

type User

type User interface {
	Create(ctx context.Context, login string, wealth int) (id int, err error)
	Withdraw(ctx context.Context, id int, wealth int) error
	TopUp(ctx context.Context, id int, wealth int) error
	Get(ctx context.Context, id int) (model.User, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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