some initial models and the overall structure

This commit is contained in:
Jan 2024-12-14 15:52:01 +01:00
parent bf5dfb06b0
commit 7d56f4650a
2 changed files with 101 additions and 0 deletions

81
database/database.go Normal file
View File

@ -0,0 +1,81 @@
package database
type DB struct {
Host string
User string
Password string
Name string
Port string
}
func SetEnv(env map[string]string) DB {
var db DB
db.Host = env["DB_HOST"]
db.User = env["DB_USER"]
db.Password = env["DB_PASSWORD"]
db.Name = env["DB_NAME"]
db.Port = env["DB_PORT"]
return db
}
func connect() {
}
func createTables() {
}
func updateTables() {
}
func NewAccount() {
}
func UpdateAccount() {
}
func DeleteAccount() {
}
func GetAccount() {
}
func NewTransaction() {
}
func UpdateTransaction() {
}
func DeleteTransaction() {
}
func GetTransactions() {
}
func NewUser() {
}
func UpdateUser() {
}
func DeleteUser() {
}
func GetUser() {
}

20
database/models.go Normal file
View File

@ -0,0 +1,20 @@
package database
type Account struct {
Number int
Name string
Kind string
}
type Transaction struct {
Amount float32
Debit bool
OffsetAccount int
Account int
Description string
}
type User struct {
Name string
Password string
}