added debuginfod support

This commit is contained in:
2022-02-13 22:33:57 +01:00
parent 45672e3459
commit c7ba7340a5
13 changed files with 372 additions and 22 deletions

View File

@@ -41,6 +41,8 @@ const (
FieldLastVersionBuild = "last_version_build"
// FieldLastVerified holds the string denoting the last_verified field in the database.
FieldLastVerified = "last_verified"
// FieldDebugSymbols holds the string denoting the debug_symbols field in the database.
FieldDebugSymbols = "debug_symbols"
// Table holds the table name of the dbpackage in the database.
Table = "db_packages"
)
@@ -63,6 +65,7 @@ var Columns = []string{
FieldLto,
FieldLastVersionBuild,
FieldLastVerified,
FieldDebugSymbols,
}
// ValidColumn reports if the column name is valid (part of the table columns).
@@ -165,3 +168,30 @@ func LtoValidator(l Lto) error {
return fmt.Errorf("dbpackage: invalid enum value for lto field: %q", l)
}
}
// DebugSymbols defines the type for the "debug_symbols" enum field.
type DebugSymbols string
// DebugSymbolsUnknown is the default value of the DebugSymbols enum.
const DefaultDebugSymbols = DebugSymbolsUnknown
// DebugSymbols values.
const (
DebugSymbolsAvailable DebugSymbols = "available"
DebugSymbolsUnknown DebugSymbols = "unknown"
DebugSymbolsNotAvailable DebugSymbols = "not_available"
)
func (ds DebugSymbols) String() string {
return string(ds)
}
// DebugSymbolsValidator is a validator for the "debug_symbols" field enum values. It is called by the builders before save.
func DebugSymbolsValidator(ds DebugSymbols) error {
switch ds {
case DebugSymbolsAvailable, DebugSymbolsUnknown, DebugSymbolsNotAvailable:
return nil
default:
return fmt.Errorf("dbpackage: invalid enum value for debug_symbols field: %q", ds)
}
}

View File

@@ -1562,6 +1562,68 @@ func LastVerifiedNotNil() predicate.DbPackage {
})
}
// DebugSymbolsEQ applies the EQ predicate on the "debug_symbols" field.
func DebugSymbolsEQ(v DebugSymbols) predicate.DbPackage {
return predicate.DbPackage(func(s *sql.Selector) {
s.Where(sql.EQ(s.C(FieldDebugSymbols), v))
})
}
// DebugSymbolsNEQ applies the NEQ predicate on the "debug_symbols" field.
func DebugSymbolsNEQ(v DebugSymbols) predicate.DbPackage {
return predicate.DbPackage(func(s *sql.Selector) {
s.Where(sql.NEQ(s.C(FieldDebugSymbols), v))
})
}
// DebugSymbolsIn applies the In predicate on the "debug_symbols" field.
func DebugSymbolsIn(vs ...DebugSymbols) 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(FieldDebugSymbols), v...))
})
}
// DebugSymbolsNotIn applies the NotIn predicate on the "debug_symbols" field.
func DebugSymbolsNotIn(vs ...DebugSymbols) 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(FieldDebugSymbols), v...))
})
}
// DebugSymbolsIsNil applies the IsNil predicate on the "debug_symbols" field.
func DebugSymbolsIsNil() predicate.DbPackage {
return predicate.DbPackage(func(s *sql.Selector) {
s.Where(sql.IsNull(s.C(FieldDebugSymbols)))
})
}
// DebugSymbolsNotNil applies the NotNil predicate on the "debug_symbols" field.
func DebugSymbolsNotNil() predicate.DbPackage {
return predicate.DbPackage(func(s *sql.Selector) {
s.Where(sql.NotNull(s.C(FieldDebugSymbols)))
})
}
// And groups predicates with the AND operator between them.
func And(predicates ...predicate.DbPackage) predicate.DbPackage {
return predicate.DbPackage(func(s *sql.Selector) {