Documentation ¶
Index ¶
- func AddCrypto(database *sql.DB, ctx context.Context, crypto m.CryptoCurrency) (*m.CryptoCurrency, error)
- func BuildDatabase(database *sql.DB, seedData bool)
- func CleanTable(database *sql.DB, tableName string)
- func DownvoteCryptoById(database *sql.DB, ctx context.Context, cryptoId int) (int, error)
- func DropTable(database *sql.DB, tableName string)
- func ExecuteCustomStatement(database *sql.DB, statement string)
- func FindAllCryptos(database *sql.DB, ctx context.Context, sortParameter string) ([]m.CryptoCurrency, error)
- func FindCryptoById(database *sql.DB, ctx context.Context, cryptoId int) (m.CryptoCurrency, error)
- func RemoveCryptoById(database *sql.DB, ctx context.Context, cryptoId int) error
- func ReseedTable(database *sql.DB, tableName string)
- func UpdateCrypto(database *sql.DB, ctx context.Context, crypto m.CryptoCurrency) (*m.CryptoCurrency, error)
- func UpvoteCryptoById(database *sql.DB, ctx context.Context, cryptoId int) (int, error)
- type Klever
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddCrypto ¶
func AddCrypto(database *sql.DB, ctx context.Context, crypto m.CryptoCurrency) (*m.CryptoCurrency, error)
Function to Add a new Cryptocurrency
func BuildDatabase ¶
Function to Build Database, Create Tables and Data Seeding
func CleanTable ¶
func DownvoteCryptoById ¶
Function to Subtract a Vote to Given Crypto
func ExecuteCustomStatement ¶
func FindAllCryptos ¶
func FindAllCryptos(database *sql.DB, ctx context.Context, sortParameter string) ([]m.CryptoCurrency, error)
Function to Get All Cryptos according to given parameter
func FindCryptoById ¶
//Function to return a CRYPTO by ID
func RemoveCryptoById ¶
Function to Delete a Crypto by its ID
func ReseedTable ¶
func UpdateCrypto ¶
func UpdateCrypto(database *sql.DB, ctx context.Context, crypto m.CryptoCurrency) (*m.CryptoCurrency, error)
Types ¶
Click to show internal directories.
Click to hide internal directories.