1
0
forked from ALHP/ALHP.GO

verify pgp signature for a specific package only once

This commit is contained in:
2022-01-18 13:41:12 +01:00
parent 2dfdac8468
commit 907add4e07
11 changed files with 304 additions and 13 deletions

View File

@@ -39,6 +39,8 @@ const (
FieldLto = "lto"
// FieldLastVersionBuild holds the string denoting the last_version_build field in the database.
FieldLastVersionBuild = "last_version_build"
// FieldLastVerified holds the string denoting the last_verified field in the database.
FieldLastVerified = "last_verified"
// Table holds the table name of the dbpackage in the database.
Table = "db_packages"
)
@@ -60,6 +62,7 @@ var Columns = []string{
FieldHash,
FieldLto,
FieldLastVersionBuild,
FieldLastVerified,
}
// ValidColumn reports if the column name is valid (part of the table columns).

View File

@@ -162,6 +162,13 @@ func LastVersionBuild(v string) predicate.DbPackage {
})
}
// LastVerified applies equality check predicate on the "last_verified" field. It's identical to LastVerifiedEQ.
func LastVerified(v time.Time) predicate.DbPackage {
return predicate.DbPackage(func(s *sql.Selector) {
s.Where(sql.EQ(s.C(FieldLastVerified), v))
})
}
// PkgbaseEQ applies the EQ predicate on the "pkgbase" field.
func PkgbaseEQ(v string) predicate.DbPackage {
return predicate.DbPackage(func(s *sql.Selector) {
@@ -1465,6 +1472,96 @@ func LastVersionBuildContainsFold(v string) predicate.DbPackage {
})
}
// LastVerifiedEQ applies the EQ predicate on the "last_verified" field.
func LastVerifiedEQ(v time.Time) predicate.DbPackage {
return predicate.DbPackage(func(s *sql.Selector) {
s.Where(sql.EQ(s.C(FieldLastVerified), v))
})
}
// LastVerifiedNEQ applies the NEQ predicate on the "last_verified" field.
func LastVerifiedNEQ(v time.Time) predicate.DbPackage {
return predicate.DbPackage(func(s *sql.Selector) {
s.Where(sql.NEQ(s.C(FieldLastVerified), v))
})
}
// LastVerifiedIn applies the In predicate on the "last_verified" field.
func LastVerifiedIn(vs ...time.Time) predicate.DbPackage {
v := make([]interface{}, len(vs))
for i := range v {
v[i] = vs[i]
}
return predicate.DbPackage(func(s *sql.Selector) {
// if not arguments were provided, append the FALSE constants,
// since we can't apply "IN ()". This will make this predicate falsy.
if len(v) == 0 {
s.Where(sql.False())
return
}
s.Where(sql.In(s.C(FieldLastVerified), v...))
})
}
// LastVerifiedNotIn applies the NotIn predicate on the "last_verified" field.
func LastVerifiedNotIn(vs ...time.Time) predicate.DbPackage {
v := make([]interface{}, len(vs))
for i := range v {
v[i] = vs[i]
}
return predicate.DbPackage(func(s *sql.Selector) {
// if not arguments were provided, append the FALSE constants,
// since we can't apply "IN ()". This will make this predicate falsy.
if len(v) == 0 {
s.Where(sql.False())
return
}
s.Where(sql.NotIn(s.C(FieldLastVerified), v...))
})
}
// LastVerifiedGT applies the GT predicate on the "last_verified" field.
func LastVerifiedGT(v time.Time) predicate.DbPackage {
return predicate.DbPackage(func(s *sql.Selector) {
s.Where(sql.GT(s.C(FieldLastVerified), v))
})
}
// LastVerifiedGTE applies the GTE predicate on the "last_verified" field.
func LastVerifiedGTE(v time.Time) predicate.DbPackage {
return predicate.DbPackage(func(s *sql.Selector) {
s.Where(sql.GTE(s.C(FieldLastVerified), v))
})
}
// LastVerifiedLT applies the LT predicate on the "last_verified" field.
func LastVerifiedLT(v time.Time) predicate.DbPackage {
return predicate.DbPackage(func(s *sql.Selector) {
s.Where(sql.LT(s.C(FieldLastVerified), v))
})
}
// LastVerifiedLTE applies the LTE predicate on the "last_verified" field.
func LastVerifiedLTE(v time.Time) predicate.DbPackage {
return predicate.DbPackage(func(s *sql.Selector) {
s.Where(sql.LTE(s.C(FieldLastVerified), v))
})
}
// LastVerifiedIsNil applies the IsNil predicate on the "last_verified" field.
func LastVerifiedIsNil() predicate.DbPackage {
return predicate.DbPackage(func(s *sql.Selector) {
s.Where(sql.IsNull(s.C(FieldLastVerified)))
})
}
// LastVerifiedNotNil applies the NotNil predicate on the "last_verified" field.
func LastVerifiedNotNil() predicate.DbPackage {
return predicate.DbPackage(func(s *sql.Selector) {
s.Where(sql.NotNull(s.C(FieldLastVerified)))
})
}
// And groups predicates with the AND operator between them.
func And(predicates ...predicate.DbPackage) predicate.DbPackage {
return predicate.DbPackage(func(s *sql.Selector) {