Documentation
¶
Index ¶
- Variables
- func GenerateToken() string
- func SetStockRepo(repo *StockRepository)
- func SetTokenRepo(repo *TokenRepository)
- func SetTransactionRepo(repo *TransactionRepository)
- func SetUserRepo(repo *UserRepository)
- type Repository
- func (s *Repository) Add(user *interface{}) apierrors.ApiError
- func (s *Repository) DeleteByObject(data interface{}) apierrors.ApiError
- func (s *Repository) FundsByID(data interface{}) apierrors.ApiError
- func (s *Repository) GetAll(list []*interface{}) apierrors.ApiError
- func (s *Repository) GetByID(object interface{}, id string) apierrors.ApiError
- func (s *Repository) UpdateWithMap(data map[string]interface{}) apierrors.ApiError
- func (s *Repository) UpdateWithObject(object interface{}) apierrors.ApiError
- type StockRepository
- func (s *StockRepository) Add(stock *models.Stock) apierrors.ApiError
- func (s *StockRepository) AddStockToUser(stockID string, userID string, quantity int) apierrors.ApiError
- func (s *StockRepository) DeleteByObject(data *models.Stock) apierrors.ApiError
- func (s *StockRepository) GetAll() ([]*models.Stock, apierrors.ApiError)
- func (s *StockRepository) GetByID(id string) (*models.Stock, apierrors.ApiError)
- func (s *StockRepository) GetStockPerUser(stockID string, userID string) (*models.StockToUser, apierrors.ApiError)
- func (s *StockRepository) UpdateWithMap(data map[string]interface{}) apierrors.ApiError
- func (s *StockRepository) UpdateWithObject(stock *models.Stock) apierrors.ApiError
- type TokenRepository
- func (s *TokenRepository) Add(token *models.Token) apierrors.ApiError
- func (s *TokenRepository) DeleteByID(id string) apierrors.ApiError
- func (s *TokenRepository) DeleteByObject(data *models.User) apierrors.ApiError
- func (s *TokenRepository) GenerateAndAddToken(userid string, validUntil int64) (string, apierrors.ApiError)
- func (s *TokenRepository) GetAll(userID string) ([]*models.Token, apierrors.ApiError)
- func (s *TokenRepository) GetByID(id string) (*models.Token, apierrors.ApiError)
- func (s *TokenRepository) GetUserIDByToken(token string) (string, apierrors.ApiError)
- func (s *TokenRepository) UpdateWithMap(data map[string]interface{}) apierrors.ApiError
- type TransactionRepository
- func (s *TransactionRepository) Add(Transaction *models.Transaction) apierrors.ApiError
- func (s *TransactionRepository) DeleteByObject(data *models.Transaction) apierrors.ApiError
- func (s *TransactionRepository) ExecuteTransaction(Data []interface{}) apierrors.ApiError
- func (s *TransactionRepository) GetAll() ([]*models.Transaction, apierrors.ApiError)
- func (s *TransactionRepository) GetByID(id string) (*models.Transaction, apierrors.ApiError)
- func (s *TransactionRepository) TransactionCostsbyID(transactionID string) (*models.MonetaryUnit, apierrors.ApiError)
- func (s *TransactionRepository) UpdateWithMap(data map[string]interface{}) apierrors.ApiError
- func (s *TransactionRepository) UpdateWithObject(Transaction *models.Transaction) apierrors.ApiError
- type UserRepository
- func (s *UserRepository) Add(user *models.User) apierrors.ApiError
- func (s *UserRepository) AddFunds(userID string, mu models.MonetaryUnit) apierrors.ApiError
- func (s *UserRepository) DeleteByObject(data *models.User) apierrors.ApiError
- func (s *UserRepository) FundsByID(id string) (*models.MonetaryUnit, apierrors.ApiError)
- func (s *UserRepository) GetAll() ([]*models.User, apierrors.ApiError)
- func (s *UserRepository) GetByID(id string) (*models.User, apierrors.ApiError)
- func (s *UserRepository) GetPWByName(userName string) (string, apierrors.ApiError)
- func (s *UserRepository) GetyName(userName string) (*models.User, apierrors.ApiError)
- func (s *UserRepository) UpdateWithMap(data map[string]interface{}) apierrors.ApiError
- func (s *UserRepository) UpdateWithObject(user *models.User) apierrors.ApiError
Constants ¶
This section is empty.
Variables ¶
View Source
var DEFAULT_TOKEN_LENGTH = 32
Functions ¶
func GenerateToken ¶
func GenerateToken() string
func SetStockRepo ¶
func SetStockRepo(repo *StockRepository)
func SetTokenRepo ¶
func SetTokenRepo(repo *TokenRepository)
func SetTransactionRepo ¶
func SetTransactionRepo(repo *TransactionRepository)
func SetUserRepo ¶
func SetUserRepo(repo *UserRepository)
Types ¶
type Repository ¶
type Repository struct {
// contains filtered or unexported fields
}
func NewRepository ¶
func NewRepository(dbConn database.DBConnector, dbModel interface{}, selectString []string) *Repository
func (*Repository) Add ¶
func (s *Repository) Add(user *interface{}) apierrors.ApiError
func (*Repository) DeleteByObject ¶
func (s *Repository) DeleteByObject(data interface{}) apierrors.ApiError
func (*Repository) FundsByID ¶
func (s *Repository) FundsByID(data interface{}) apierrors.ApiError
func (*Repository) GetAll ¶
func (s *Repository) GetAll(list []*interface{}) apierrors.ApiError
func (*Repository) GetByID ¶
func (s *Repository) GetByID(object interface{}, id string) apierrors.ApiError
func (*Repository) UpdateWithMap ¶
func (s *Repository) UpdateWithMap(data map[string]interface{}) apierrors.ApiError
func (*Repository) UpdateWithObject ¶
func (s *Repository) UpdateWithObject(object interface{}) apierrors.ApiError
type StockRepository ¶
type StockRepository struct {
// contains filtered or unexported fields
}
var StockRepo *StockRepository
func NewStockRepository ¶
func NewStockRepository(dbConn database.DBConnector) *StockRepository
func (*StockRepository) AddStockToUser ¶
func (*StockRepository) DeleteByObject ¶
func (s *StockRepository) DeleteByObject(data *models.Stock) apierrors.ApiError
func (*StockRepository) GetAll ¶
func (s *StockRepository) GetAll() ([]*models.Stock, apierrors.ApiError)
func (*StockRepository) GetStockPerUser ¶
func (s *StockRepository) GetStockPerUser(stockID string, userID string) (*models.StockToUser, apierrors.ApiError)
func (*StockRepository) UpdateWithMap ¶
func (s *StockRepository) UpdateWithMap(data map[string]interface{}) apierrors.ApiError
func (*StockRepository) UpdateWithObject ¶
func (s *StockRepository) UpdateWithObject(stock *models.Stock) apierrors.ApiError
type TokenRepository ¶
type TokenRepository struct {
// contains filtered or unexported fields
}
var TokenRepo *TokenRepository
func NewTokenRepository ¶
func NewTokenRepository(dbConn database.DBConnector) *TokenRepository
func (*TokenRepository) DeleteByID ¶
func (s *TokenRepository) DeleteByID(id string) apierrors.ApiError
func (*TokenRepository) DeleteByObject ¶
func (s *TokenRepository) DeleteByObject(data *models.User) apierrors.ApiError
func (*TokenRepository) GenerateAndAddToken ¶
func (*TokenRepository) GetUserIDByToken ¶
func (s *TokenRepository) GetUserIDByToken(token string) (string, apierrors.ApiError)
func (*TokenRepository) UpdateWithMap ¶
func (s *TokenRepository) UpdateWithMap(data map[string]interface{}) apierrors.ApiError
type TransactionRepository ¶
type TransactionRepository struct {
// contains filtered or unexported fields
}
var TransactionRepo *TransactionRepository
func NewTransactionRepository ¶
func NewTransactionRepository(dbConn database.DBConnector) *TransactionRepository
func (*TransactionRepository) Add ¶
func (s *TransactionRepository) Add(Transaction *models.Transaction) apierrors.ApiError
func (*TransactionRepository) DeleteByObject ¶
func (s *TransactionRepository) DeleteByObject(data *models.Transaction) apierrors.ApiError
func (*TransactionRepository) ExecuteTransaction ¶
func (s *TransactionRepository) ExecuteTransaction(Data []interface{}) apierrors.ApiError
func (*TransactionRepository) GetAll ¶
func (s *TransactionRepository) GetAll() ([]*models.Transaction, apierrors.ApiError)
func (*TransactionRepository) GetByID ¶
func (s *TransactionRepository) GetByID(id string) (*models.Transaction, apierrors.ApiError)
func (*TransactionRepository) TransactionCostsbyID ¶
func (s *TransactionRepository) TransactionCostsbyID(transactionID string) (*models.MonetaryUnit, apierrors.ApiError)
func (*TransactionRepository) UpdateWithMap ¶
func (s *TransactionRepository) UpdateWithMap(data map[string]interface{}) apierrors.ApiError
func (*TransactionRepository) UpdateWithObject ¶
func (s *TransactionRepository) UpdateWithObject(Transaction *models.Transaction) apierrors.ApiError
type UserRepository ¶
type UserRepository struct {
// contains filtered or unexported fields
}
var UserRepo *UserRepository
func NewUserRepository ¶
func NewUserRepository(dbConn database.DBConnector) *UserRepository
func (*UserRepository) AddFunds ¶
func (s *UserRepository) AddFunds(userID string, mu models.MonetaryUnit) apierrors.ApiError
func (*UserRepository) DeleteByObject ¶
func (s *UserRepository) DeleteByObject(data *models.User) apierrors.ApiError
func (*UserRepository) FundsByID ¶
func (s *UserRepository) FundsByID(id string) (*models.MonetaryUnit, apierrors.ApiError)
func (*UserRepository) GetAll ¶
func (s *UserRepository) GetAll() ([]*models.User, apierrors.ApiError)
func (*UserRepository) GetPWByName ¶
func (s *UserRepository) GetPWByName(userName string) (string, apierrors.ApiError)
func (*UserRepository) UpdateWithMap ¶
func (s *UserRepository) UpdateWithMap(data map[string]interface{}) apierrors.ApiError
func (*UserRepository) UpdateWithObject ¶
func (s *UserRepository) UpdateWithObject(user *models.User) apierrors.ApiError
Click to show internal directories.
Click to hide internal directories.