pkgdash/models/entities.go

46 lines
1.3 KiB
Go

package models
import (
_ "database/sql"
"github.com/google/uuid"
"github.com/jackc/pgtype"
)
type Package struct {
ID uint64 `db:"id" json:"id"` // package id
Name string `db:"name" json:"name"` // service name, last component path
URL string `db:"url" json:"url"` // scm url
Modules []uint64 `db:"modules" json:"modules"` // parsed go.mod modules
Issues []uint64 `db:"issues" json:"issues,omitempty"` // issues list
Comments []uint64 `db:"comments" json:"comments,omitempty"`
}
type Module struct {
ID int64 `db:"id"`
Name string `db:"name"` // module name
Version string `db:"version"` // module
Package int64 `db:"package"`
LastVersion string `db:"last_version"`
}
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" json:"id"`
Text string `db:"value" json:"text"`
Created pgtype.Date `db:"created" json:"created"`
Updated pgtype.Date `db:"updated" json:"updated,omitempty"`
}
type Dashboard struct {
ID int64 `db:"id"`
Uuid uuid.UUID `db:"uuid"`
Packages []int64 `db:"package"`
}