diff --git a/database/database.go b/database/database.go new file mode 100644 index 0000000..5284c6f --- /dev/null +++ b/database/database.go @@ -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() { + +} diff --git a/database/models.go b/database/models.go new file mode 100644 index 0000000..89bd157 --- /dev/null +++ b/database/models.go @@ -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 +}