pkgdash/models/entities.go

45 lines
1.0 KiB
Go

package models
import (
_ "database/sql"
"github.com/google/uuid"
"github.com/jackc/pgtype"
)
type Package struct {
ID int64 `db:"id"` // package id
Name string `db:"name"` // service name, last component path
URL string `db:"url"` // scm url
Modules []Module `db:"modules"` // parsed go.mod modules
Issues []Issue `db:"issues"` // issues list
Comments []int64 `db:"comments"`
}
type Module struct {
ID int64 `db:"id"`
Name string `db:"name"` // module name
Version string `db:"version"` // module
Package int64 `db:"package"`
}
type Issue struct {
ID int64 `db:"id"`
Status int64 `db:"status"`
Desc string `db:"desc"`
Package int64 `db:"package"`
Modules []int64 `db:"modules"`
}
type Comment struct {
ID int64 `db:"id"`
Text string `db:"value"`
Created pgtype.Date `db:"created"`
Updated pgtype.Date `db:"updated"`
}
type Dashboard struct {
ID int64 `db:"id"`
Uuid uuid.UUID `db:"uuid"`
Package int64 `db:"package"`
}