This commit is contained in:
2021-01-02 11:56:24 +01:00
parent 39e5c84cf6
commit 96ab03a5fb
12 changed files with 301 additions and 120 deletions

View File

@@ -2,10 +2,32 @@ package db
import (
"github.com/google/uuid"
"github.com/jackc/pgx/v4/pgxpool"
)
// User is a user in the system
type User struct {
ID uuid.UUID `json:"id"`
Username string `json:"username"`
// Account is an account in the system
type Account struct {
ID uuid.UUID `json:"id"`
AccountName string `json:"accountName"`
APIKey string `json:"apiKey"`
}
// AccountCreateInputFields yes
type AccountCreateInputFields struct {
Name string
Values []string
}
// AccountCreateInput is used as input struct for database creation of account
type AccountCreateInput struct {
ID uuid.UUID
AccountName string
APIKey string
Fields []AccountCreateInputFields
Password string
}
// Db struct
type Db struct {
DbPool *pgxpool.Pool
}