Documentation ¶
Overview ¶
work with db
Index ¶
- Constants
- func Init(config config) (*sql.DB, error)
- type Storage
- func (s *Storage) AddOrder(ctx context.Context, order entity.Order, user entity.User) error
- func (s *Storage) GetAllNotProcessedOrders(ctx context.Context) ([]entity.Order, error)
- func (s *Storage) GetAllOrders(ctx context.Context, user entity.User) ([]entity.Order, error)
- func (s *Storage) GetBalance(ctx context.Context, user entity.User) (entity.Balance, error)
- func (s *Storage) GetUser(ctx context.Context, userFromReq entity.User) (entity.User, error)
- func (s *Storage) SetOrderStatusAndAccrual(ctx context.Context, order entity.Order) error
- func (s *Storage) UserLogin(ctx context.Context, user entity.User) error
- func (s *Storage) UserRegister(ctx context.Context, user entity.User) (int64, error)
- func (s *Storage) WithdrawBalance(ctx context.Context, balance entity.BalanceUpdate, user entity.User) error
- func (s *Storage) Withdrawals(ctx context.Context, user entity.User) ([]entity.BalanceUpdate, error)
Constants ¶
View Source
const (
UniqueViolation = "duplicate key value violates unique constraint"
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Storage ¶
type Storage struct {
// contains filtered or unexported fields
}
func (*Storage) GetAllNotProcessedOrders ¶
func (*Storage) GetAllOrders ¶
func (*Storage) GetBalance ¶
balance
func (*Storage) SetOrderStatusAndAccrual ¶
func (*Storage) UserRegister ¶
func (*Storage) WithdrawBalance ¶
func (*Storage) Withdrawals ¶
func (s *Storage) Withdrawals(ctx context.Context, user entity.User) ([]entity.BalanceUpdate, error)
Withdrawals
Click to show internal directories.
Click to hide internal directories.