Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
2023-08-19 16:55:52 +03:00
parent 0e18a63f10
commit 59e28e5a86
18 changed files with 801 additions and 804 deletions

View File

@@ -9,6 +9,7 @@ import (
)
type Package struct {
LastCheck sql.NullTime `db:"last_check"`
Created time.Time `db:"created"`
Updated time.Time `db:"updated"`
Name string `db:"name"`
@@ -18,7 +19,6 @@ type Package struct {
Comments uint64 `db:"comments"`
ID uint64 `db:"id"`
Status uint64 `db:"status"`
LastCheck sql.NullTime `db:"last_check"`
}
func NewPackage(pkg *Package) *pb.Package {
@@ -39,25 +39,22 @@ func NewPackage(pkg *Package) *pb.Package {
}
type Module struct {
Created time.Time `db:"created"`
Updated time.Time `db:"updated"`
Name string `db:"name"`
Version string `db:"version"`
LastVersion string `db:"last_version"`
ID uint64 `db:"id"`
Package uint64 `db:"package"`
LastCheck sql.NullTime `db:"last_check"`
Name string `db:"name"`
Version string `db:"version"`
ID uint64 `db:"id"`
}
func NewModule(mod *Module) *pb.Module {
return &pb.Module{
Name: mod.Name,
Version: mod.Version,
LastVersion: mod.LastVersion,
Package: mod.Package,
Id: mod.ID,
Created: timestamppb.New(mod.Created),
Updated: timestamppb.New(mod.Updated),
rsp := &pb.Module{
Name: mod.Name,
Version: mod.Version,
Id: mod.ID,
}
if mod.LastCheck.Valid {
rsp.LastCheck = timestamppb.New(mod.LastCheck.Time)
}
return rsp
}
type Issue struct {