mirror of
https://github.com/versia-pub/versia-go.git
synced 2026-03-13 04:29:15 +01:00
refactor!: working WD-4 user discovery
This commit is contained in:
parent
cf0053312d
commit
61891d891a
91 changed files with 12768 additions and 5562 deletions
109
ent/user/user.go
109
ent/user/user.go
|
|
@ -37,6 +37,10 @@ const (
|
|||
FieldBiography = "biography"
|
||||
// FieldPublicKey holds the string denoting the publickey field in the database.
|
||||
FieldPublicKey = "public_key"
|
||||
// FieldPublicKeyActor holds the string denoting the publickeyactor field in the database.
|
||||
FieldPublicKeyActor = "public_key_actor"
|
||||
// FieldPublicKeyAlgorithm holds the string denoting the publickeyalgorithm field in the database.
|
||||
FieldPublicKeyAlgorithm = "public_key_algorithm"
|
||||
// FieldPrivateKey holds the string denoting the privatekey field in the database.
|
||||
FieldPrivateKey = "private_key"
|
||||
// FieldIndexable holds the string denoting the indexable field in the database.
|
||||
|
|
@ -63,6 +67,12 @@ const (
|
|||
EdgeAuthoredNotes = "authoredNotes"
|
||||
// EdgeMentionedNotes holds the string denoting the mentionednotes edge name in mutations.
|
||||
EdgeMentionedNotes = "mentionedNotes"
|
||||
// EdgeServers holds the string denoting the servers edge name in mutations.
|
||||
EdgeServers = "servers"
|
||||
// EdgeModeratedServers holds the string denoting the moderatedservers edge name in mutations.
|
||||
EdgeModeratedServers = "moderatedServers"
|
||||
// EdgeAdministeredServers holds the string denoting the administeredservers edge name in mutations.
|
||||
EdgeAdministeredServers = "administeredServers"
|
||||
// Table holds the table name of the user in the database.
|
||||
Table = "users"
|
||||
// AvatarImageTable is the table that holds the avatarImage relation/edge.
|
||||
|
|
@ -91,6 +101,21 @@ const (
|
|||
// MentionedNotesInverseTable is the table name for the Note entity.
|
||||
// It exists in this package in order to avoid circular dependency with the "note" package.
|
||||
MentionedNotesInverseTable = "notes"
|
||||
// ServersTable is the table that holds the servers relation/edge. The primary key declared below.
|
||||
ServersTable = "instance_metadata_users"
|
||||
// ServersInverseTable is the table name for the InstanceMetadata entity.
|
||||
// It exists in this package in order to avoid circular dependency with the "instancemetadata" package.
|
||||
ServersInverseTable = "instance_metadata"
|
||||
// ModeratedServersTable is the table that holds the moderatedServers relation/edge. The primary key declared below.
|
||||
ModeratedServersTable = "instance_metadata_moderators"
|
||||
// ModeratedServersInverseTable is the table name for the InstanceMetadata entity.
|
||||
// It exists in this package in order to avoid circular dependency with the "instancemetadata" package.
|
||||
ModeratedServersInverseTable = "instance_metadata"
|
||||
// AdministeredServersTable is the table that holds the administeredServers relation/edge. The primary key declared below.
|
||||
AdministeredServersTable = "instance_metadata_admins"
|
||||
// AdministeredServersInverseTable is the table name for the InstanceMetadata entity.
|
||||
// It exists in this package in order to avoid circular dependency with the "instancemetadata" package.
|
||||
AdministeredServersInverseTable = "instance_metadata"
|
||||
)
|
||||
|
||||
// Columns holds all SQL columns for user fields.
|
||||
|
|
@ -106,6 +131,8 @@ var Columns = []string{
|
|||
FieldDisplayName,
|
||||
FieldBiography,
|
||||
FieldPublicKey,
|
||||
FieldPublicKeyActor,
|
||||
FieldPublicKeyAlgorithm,
|
||||
FieldPrivateKey,
|
||||
FieldIndexable,
|
||||
FieldPrivacyLevel,
|
||||
|
|
@ -128,6 +155,15 @@ var (
|
|||
// MentionedNotesPrimaryKey and MentionedNotesColumn2 are the table columns denoting the
|
||||
// primary key for the mentionedNotes relation (M2M).
|
||||
MentionedNotesPrimaryKey = []string{"note_id", "user_id"}
|
||||
// ServersPrimaryKey and ServersColumn2 are the table columns denoting the
|
||||
// primary key for the servers relation (M2M).
|
||||
ServersPrimaryKey = []string{"instance_metadata_id", "user_id"}
|
||||
// ModeratedServersPrimaryKey and ModeratedServersColumn2 are the table columns denoting the
|
||||
// primary key for the moderatedServers relation (M2M).
|
||||
ModeratedServersPrimaryKey = []string{"instance_metadata_id", "user_id"}
|
||||
// AdministeredServersPrimaryKey and AdministeredServersColumn2 are the table columns denoting the
|
||||
// primary key for the administeredServers relation (M2M).
|
||||
AdministeredServersPrimaryKey = []string{"instance_metadata_id", "user_id"}
|
||||
)
|
||||
|
||||
// ValidColumn reports if the column name is valid (part of the table columns).
|
||||
|
|
@ -248,6 +284,16 @@ func ByBiography(opts ...sql.OrderTermOption) OrderOption {
|
|||
return sql.OrderByField(FieldBiography, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByPublicKeyActor orders the results by the publicKeyActor field.
|
||||
func ByPublicKeyActor(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldPublicKeyActor, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByPublicKeyAlgorithm orders the results by the publicKeyAlgorithm field.
|
||||
func ByPublicKeyAlgorithm(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldPublicKeyAlgorithm, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByIndexable orders the results by the indexable field.
|
||||
func ByIndexable(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldIndexable, opts...).ToFunc()
|
||||
|
|
@ -324,6 +370,48 @@ func ByMentionedNotes(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption {
|
|||
sqlgraph.OrderByNeighborTerms(s, newMentionedNotesStep(), append([]sql.OrderTerm{term}, terms...)...)
|
||||
}
|
||||
}
|
||||
|
||||
// ByServersCount orders the results by servers count.
|
||||
func ByServersCount(opts ...sql.OrderTermOption) OrderOption {
|
||||
return func(s *sql.Selector) {
|
||||
sqlgraph.OrderByNeighborsCount(s, newServersStep(), opts...)
|
||||
}
|
||||
}
|
||||
|
||||
// ByServers orders the results by servers terms.
|
||||
func ByServers(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption {
|
||||
return func(s *sql.Selector) {
|
||||
sqlgraph.OrderByNeighborTerms(s, newServersStep(), append([]sql.OrderTerm{term}, terms...)...)
|
||||
}
|
||||
}
|
||||
|
||||
// ByModeratedServersCount orders the results by moderatedServers count.
|
||||
func ByModeratedServersCount(opts ...sql.OrderTermOption) OrderOption {
|
||||
return func(s *sql.Selector) {
|
||||
sqlgraph.OrderByNeighborsCount(s, newModeratedServersStep(), opts...)
|
||||
}
|
||||
}
|
||||
|
||||
// ByModeratedServers orders the results by moderatedServers terms.
|
||||
func ByModeratedServers(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption {
|
||||
return func(s *sql.Selector) {
|
||||
sqlgraph.OrderByNeighborTerms(s, newModeratedServersStep(), append([]sql.OrderTerm{term}, terms...)...)
|
||||
}
|
||||
}
|
||||
|
||||
// ByAdministeredServersCount orders the results by administeredServers count.
|
||||
func ByAdministeredServersCount(opts ...sql.OrderTermOption) OrderOption {
|
||||
return func(s *sql.Selector) {
|
||||
sqlgraph.OrderByNeighborsCount(s, newAdministeredServersStep(), opts...)
|
||||
}
|
||||
}
|
||||
|
||||
// ByAdministeredServers orders the results by administeredServers terms.
|
||||
func ByAdministeredServers(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption {
|
||||
return func(s *sql.Selector) {
|
||||
sqlgraph.OrderByNeighborTerms(s, newAdministeredServersStep(), append([]sql.OrderTerm{term}, terms...)...)
|
||||
}
|
||||
}
|
||||
func newAvatarImageStep() *sqlgraph.Step {
|
||||
return sqlgraph.NewStep(
|
||||
sqlgraph.From(Table, FieldID),
|
||||
|
|
@ -352,3 +440,24 @@ func newMentionedNotesStep() *sqlgraph.Step {
|
|||
sqlgraph.Edge(sqlgraph.M2M, true, MentionedNotesTable, MentionedNotesPrimaryKey...),
|
||||
)
|
||||
}
|
||||
func newServersStep() *sqlgraph.Step {
|
||||
return sqlgraph.NewStep(
|
||||
sqlgraph.From(Table, FieldID),
|
||||
sqlgraph.To(ServersInverseTable, FieldID),
|
||||
sqlgraph.Edge(sqlgraph.M2M, true, ServersTable, ServersPrimaryKey...),
|
||||
)
|
||||
}
|
||||
func newModeratedServersStep() *sqlgraph.Step {
|
||||
return sqlgraph.NewStep(
|
||||
sqlgraph.From(Table, FieldID),
|
||||
sqlgraph.To(ModeratedServersInverseTable, FieldID),
|
||||
sqlgraph.Edge(sqlgraph.M2M, true, ModeratedServersTable, ModeratedServersPrimaryKey...),
|
||||
)
|
||||
}
|
||||
func newAdministeredServersStep() *sqlgraph.Step {
|
||||
return sqlgraph.NewStep(
|
||||
sqlgraph.From(Table, FieldID),
|
||||
sqlgraph.To(AdministeredServersInverseTable, FieldID),
|
||||
sqlgraph.Edge(sqlgraph.M2M, true, AdministeredServersTable, AdministeredServersPrimaryKey...),
|
||||
)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@
|
|||
package user
|
||||
|
||||
import (
|
||||
"crypto/ed25519"
|
||||
"time"
|
||||
|
||||
"entgo.io/ent/dialect/sql"
|
||||
|
|
@ -98,15 +97,23 @@ func Biography(v string) predicate.User {
|
|||
}
|
||||
|
||||
// PublicKey applies equality check predicate on the "publicKey" field. It's identical to PublicKeyEQ.
|
||||
func PublicKey(v ed25519.PublicKey) predicate.User {
|
||||
vc := []byte(v)
|
||||
return predicate.User(sql.FieldEQ(FieldPublicKey, vc))
|
||||
func PublicKey(v []byte) predicate.User {
|
||||
return predicate.User(sql.FieldEQ(FieldPublicKey, v))
|
||||
}
|
||||
|
||||
// PublicKeyActor applies equality check predicate on the "publicKeyActor" field. It's identical to PublicKeyActorEQ.
|
||||
func PublicKeyActor(v string) predicate.User {
|
||||
return predicate.User(sql.FieldEQ(FieldPublicKeyActor, v))
|
||||
}
|
||||
|
||||
// PublicKeyAlgorithm applies equality check predicate on the "publicKeyAlgorithm" field. It's identical to PublicKeyAlgorithmEQ.
|
||||
func PublicKeyAlgorithm(v string) predicate.User {
|
||||
return predicate.User(sql.FieldEQ(FieldPublicKeyAlgorithm, v))
|
||||
}
|
||||
|
||||
// PrivateKey applies equality check predicate on the "privateKey" field. It's identical to PrivateKeyEQ.
|
||||
func PrivateKey(v ed25519.PrivateKey) predicate.User {
|
||||
vc := []byte(v)
|
||||
return predicate.User(sql.FieldEQ(FieldPrivateKey, vc))
|
||||
func PrivateKey(v []byte) predicate.User {
|
||||
return predicate.User(sql.FieldEQ(FieldPrivateKey, v))
|
||||
}
|
||||
|
||||
// Indexable applies equality check predicate on the "indexable" field. It's identical to IndexableEQ.
|
||||
|
|
@ -560,111 +567,213 @@ func BiographyContainsFold(v string) predicate.User {
|
|||
}
|
||||
|
||||
// PublicKeyEQ applies the EQ predicate on the "publicKey" field.
|
||||
func PublicKeyEQ(v ed25519.PublicKey) predicate.User {
|
||||
vc := []byte(v)
|
||||
return predicate.User(sql.FieldEQ(FieldPublicKey, vc))
|
||||
func PublicKeyEQ(v []byte) predicate.User {
|
||||
return predicate.User(sql.FieldEQ(FieldPublicKey, v))
|
||||
}
|
||||
|
||||
// PublicKeyNEQ applies the NEQ predicate on the "publicKey" field.
|
||||
func PublicKeyNEQ(v ed25519.PublicKey) predicate.User {
|
||||
vc := []byte(v)
|
||||
return predicate.User(sql.FieldNEQ(FieldPublicKey, vc))
|
||||
func PublicKeyNEQ(v []byte) predicate.User {
|
||||
return predicate.User(sql.FieldNEQ(FieldPublicKey, v))
|
||||
}
|
||||
|
||||
// PublicKeyIn applies the In predicate on the "publicKey" field.
|
||||
func PublicKeyIn(vs ...ed25519.PublicKey) predicate.User {
|
||||
v := make([]any, len(vs))
|
||||
for i := range v {
|
||||
v[i] = []byte(vs[i])
|
||||
}
|
||||
return predicate.User(sql.FieldIn(FieldPublicKey, v...))
|
||||
func PublicKeyIn(vs ...[]byte) predicate.User {
|
||||
return predicate.User(sql.FieldIn(FieldPublicKey, vs...))
|
||||
}
|
||||
|
||||
// PublicKeyNotIn applies the NotIn predicate on the "publicKey" field.
|
||||
func PublicKeyNotIn(vs ...ed25519.PublicKey) predicate.User {
|
||||
v := make([]any, len(vs))
|
||||
for i := range v {
|
||||
v[i] = []byte(vs[i])
|
||||
}
|
||||
return predicate.User(sql.FieldNotIn(FieldPublicKey, v...))
|
||||
func PublicKeyNotIn(vs ...[]byte) predicate.User {
|
||||
return predicate.User(sql.FieldNotIn(FieldPublicKey, vs...))
|
||||
}
|
||||
|
||||
// PublicKeyGT applies the GT predicate on the "publicKey" field.
|
||||
func PublicKeyGT(v ed25519.PublicKey) predicate.User {
|
||||
vc := []byte(v)
|
||||
return predicate.User(sql.FieldGT(FieldPublicKey, vc))
|
||||
func PublicKeyGT(v []byte) predicate.User {
|
||||
return predicate.User(sql.FieldGT(FieldPublicKey, v))
|
||||
}
|
||||
|
||||
// PublicKeyGTE applies the GTE predicate on the "publicKey" field.
|
||||
func PublicKeyGTE(v ed25519.PublicKey) predicate.User {
|
||||
vc := []byte(v)
|
||||
return predicate.User(sql.FieldGTE(FieldPublicKey, vc))
|
||||
func PublicKeyGTE(v []byte) predicate.User {
|
||||
return predicate.User(sql.FieldGTE(FieldPublicKey, v))
|
||||
}
|
||||
|
||||
// PublicKeyLT applies the LT predicate on the "publicKey" field.
|
||||
func PublicKeyLT(v ed25519.PublicKey) predicate.User {
|
||||
vc := []byte(v)
|
||||
return predicate.User(sql.FieldLT(FieldPublicKey, vc))
|
||||
func PublicKeyLT(v []byte) predicate.User {
|
||||
return predicate.User(sql.FieldLT(FieldPublicKey, v))
|
||||
}
|
||||
|
||||
// PublicKeyLTE applies the LTE predicate on the "publicKey" field.
|
||||
func PublicKeyLTE(v ed25519.PublicKey) predicate.User {
|
||||
vc := []byte(v)
|
||||
return predicate.User(sql.FieldLTE(FieldPublicKey, vc))
|
||||
func PublicKeyLTE(v []byte) predicate.User {
|
||||
return predicate.User(sql.FieldLTE(FieldPublicKey, v))
|
||||
}
|
||||
|
||||
// PublicKeyActorEQ applies the EQ predicate on the "publicKeyActor" field.
|
||||
func PublicKeyActorEQ(v string) predicate.User {
|
||||
return predicate.User(sql.FieldEQ(FieldPublicKeyActor, v))
|
||||
}
|
||||
|
||||
// PublicKeyActorNEQ applies the NEQ predicate on the "publicKeyActor" field.
|
||||
func PublicKeyActorNEQ(v string) predicate.User {
|
||||
return predicate.User(sql.FieldNEQ(FieldPublicKeyActor, v))
|
||||
}
|
||||
|
||||
// PublicKeyActorIn applies the In predicate on the "publicKeyActor" field.
|
||||
func PublicKeyActorIn(vs ...string) predicate.User {
|
||||
return predicate.User(sql.FieldIn(FieldPublicKeyActor, vs...))
|
||||
}
|
||||
|
||||
// PublicKeyActorNotIn applies the NotIn predicate on the "publicKeyActor" field.
|
||||
func PublicKeyActorNotIn(vs ...string) predicate.User {
|
||||
return predicate.User(sql.FieldNotIn(FieldPublicKeyActor, vs...))
|
||||
}
|
||||
|
||||
// PublicKeyActorGT applies the GT predicate on the "publicKeyActor" field.
|
||||
func PublicKeyActorGT(v string) predicate.User {
|
||||
return predicate.User(sql.FieldGT(FieldPublicKeyActor, v))
|
||||
}
|
||||
|
||||
// PublicKeyActorGTE applies the GTE predicate on the "publicKeyActor" field.
|
||||
func PublicKeyActorGTE(v string) predicate.User {
|
||||
return predicate.User(sql.FieldGTE(FieldPublicKeyActor, v))
|
||||
}
|
||||
|
||||
// PublicKeyActorLT applies the LT predicate on the "publicKeyActor" field.
|
||||
func PublicKeyActorLT(v string) predicate.User {
|
||||
return predicate.User(sql.FieldLT(FieldPublicKeyActor, v))
|
||||
}
|
||||
|
||||
// PublicKeyActorLTE applies the LTE predicate on the "publicKeyActor" field.
|
||||
func PublicKeyActorLTE(v string) predicate.User {
|
||||
return predicate.User(sql.FieldLTE(FieldPublicKeyActor, v))
|
||||
}
|
||||
|
||||
// PublicKeyActorContains applies the Contains predicate on the "publicKeyActor" field.
|
||||
func PublicKeyActorContains(v string) predicate.User {
|
||||
return predicate.User(sql.FieldContains(FieldPublicKeyActor, v))
|
||||
}
|
||||
|
||||
// PublicKeyActorHasPrefix applies the HasPrefix predicate on the "publicKeyActor" field.
|
||||
func PublicKeyActorHasPrefix(v string) predicate.User {
|
||||
return predicate.User(sql.FieldHasPrefix(FieldPublicKeyActor, v))
|
||||
}
|
||||
|
||||
// PublicKeyActorHasSuffix applies the HasSuffix predicate on the "publicKeyActor" field.
|
||||
func PublicKeyActorHasSuffix(v string) predicate.User {
|
||||
return predicate.User(sql.FieldHasSuffix(FieldPublicKeyActor, v))
|
||||
}
|
||||
|
||||
// PublicKeyActorEqualFold applies the EqualFold predicate on the "publicKeyActor" field.
|
||||
func PublicKeyActorEqualFold(v string) predicate.User {
|
||||
return predicate.User(sql.FieldEqualFold(FieldPublicKeyActor, v))
|
||||
}
|
||||
|
||||
// PublicKeyActorContainsFold applies the ContainsFold predicate on the "publicKeyActor" field.
|
||||
func PublicKeyActorContainsFold(v string) predicate.User {
|
||||
return predicate.User(sql.FieldContainsFold(FieldPublicKeyActor, v))
|
||||
}
|
||||
|
||||
// PublicKeyAlgorithmEQ applies the EQ predicate on the "publicKeyAlgorithm" field.
|
||||
func PublicKeyAlgorithmEQ(v string) predicate.User {
|
||||
return predicate.User(sql.FieldEQ(FieldPublicKeyAlgorithm, v))
|
||||
}
|
||||
|
||||
// PublicKeyAlgorithmNEQ applies the NEQ predicate on the "publicKeyAlgorithm" field.
|
||||
func PublicKeyAlgorithmNEQ(v string) predicate.User {
|
||||
return predicate.User(sql.FieldNEQ(FieldPublicKeyAlgorithm, v))
|
||||
}
|
||||
|
||||
// PublicKeyAlgorithmIn applies the In predicate on the "publicKeyAlgorithm" field.
|
||||
func PublicKeyAlgorithmIn(vs ...string) predicate.User {
|
||||
return predicate.User(sql.FieldIn(FieldPublicKeyAlgorithm, vs...))
|
||||
}
|
||||
|
||||
// PublicKeyAlgorithmNotIn applies the NotIn predicate on the "publicKeyAlgorithm" field.
|
||||
func PublicKeyAlgorithmNotIn(vs ...string) predicate.User {
|
||||
return predicate.User(sql.FieldNotIn(FieldPublicKeyAlgorithm, vs...))
|
||||
}
|
||||
|
||||
// PublicKeyAlgorithmGT applies the GT predicate on the "publicKeyAlgorithm" field.
|
||||
func PublicKeyAlgorithmGT(v string) predicate.User {
|
||||
return predicate.User(sql.FieldGT(FieldPublicKeyAlgorithm, v))
|
||||
}
|
||||
|
||||
// PublicKeyAlgorithmGTE applies the GTE predicate on the "publicKeyAlgorithm" field.
|
||||
func PublicKeyAlgorithmGTE(v string) predicate.User {
|
||||
return predicate.User(sql.FieldGTE(FieldPublicKeyAlgorithm, v))
|
||||
}
|
||||
|
||||
// PublicKeyAlgorithmLT applies the LT predicate on the "publicKeyAlgorithm" field.
|
||||
func PublicKeyAlgorithmLT(v string) predicate.User {
|
||||
return predicate.User(sql.FieldLT(FieldPublicKeyAlgorithm, v))
|
||||
}
|
||||
|
||||
// PublicKeyAlgorithmLTE applies the LTE predicate on the "publicKeyAlgorithm" field.
|
||||
func PublicKeyAlgorithmLTE(v string) predicate.User {
|
||||
return predicate.User(sql.FieldLTE(FieldPublicKeyAlgorithm, v))
|
||||
}
|
||||
|
||||
// PublicKeyAlgorithmContains applies the Contains predicate on the "publicKeyAlgorithm" field.
|
||||
func PublicKeyAlgorithmContains(v string) predicate.User {
|
||||
return predicate.User(sql.FieldContains(FieldPublicKeyAlgorithm, v))
|
||||
}
|
||||
|
||||
// PublicKeyAlgorithmHasPrefix applies the HasPrefix predicate on the "publicKeyAlgorithm" field.
|
||||
func PublicKeyAlgorithmHasPrefix(v string) predicate.User {
|
||||
return predicate.User(sql.FieldHasPrefix(FieldPublicKeyAlgorithm, v))
|
||||
}
|
||||
|
||||
// PublicKeyAlgorithmHasSuffix applies the HasSuffix predicate on the "publicKeyAlgorithm" field.
|
||||
func PublicKeyAlgorithmHasSuffix(v string) predicate.User {
|
||||
return predicate.User(sql.FieldHasSuffix(FieldPublicKeyAlgorithm, v))
|
||||
}
|
||||
|
||||
// PublicKeyAlgorithmEqualFold applies the EqualFold predicate on the "publicKeyAlgorithm" field.
|
||||
func PublicKeyAlgorithmEqualFold(v string) predicate.User {
|
||||
return predicate.User(sql.FieldEqualFold(FieldPublicKeyAlgorithm, v))
|
||||
}
|
||||
|
||||
// PublicKeyAlgorithmContainsFold applies the ContainsFold predicate on the "publicKeyAlgorithm" field.
|
||||
func PublicKeyAlgorithmContainsFold(v string) predicate.User {
|
||||
return predicate.User(sql.FieldContainsFold(FieldPublicKeyAlgorithm, v))
|
||||
}
|
||||
|
||||
// PrivateKeyEQ applies the EQ predicate on the "privateKey" field.
|
||||
func PrivateKeyEQ(v ed25519.PrivateKey) predicate.User {
|
||||
vc := []byte(v)
|
||||
return predicate.User(sql.FieldEQ(FieldPrivateKey, vc))
|
||||
func PrivateKeyEQ(v []byte) predicate.User {
|
||||
return predicate.User(sql.FieldEQ(FieldPrivateKey, v))
|
||||
}
|
||||
|
||||
// PrivateKeyNEQ applies the NEQ predicate on the "privateKey" field.
|
||||
func PrivateKeyNEQ(v ed25519.PrivateKey) predicate.User {
|
||||
vc := []byte(v)
|
||||
return predicate.User(sql.FieldNEQ(FieldPrivateKey, vc))
|
||||
func PrivateKeyNEQ(v []byte) predicate.User {
|
||||
return predicate.User(sql.FieldNEQ(FieldPrivateKey, v))
|
||||
}
|
||||
|
||||
// PrivateKeyIn applies the In predicate on the "privateKey" field.
|
||||
func PrivateKeyIn(vs ...ed25519.PrivateKey) predicate.User {
|
||||
v := make([]any, len(vs))
|
||||
for i := range v {
|
||||
v[i] = []byte(vs[i])
|
||||
}
|
||||
return predicate.User(sql.FieldIn(FieldPrivateKey, v...))
|
||||
func PrivateKeyIn(vs ...[]byte) predicate.User {
|
||||
return predicate.User(sql.FieldIn(FieldPrivateKey, vs...))
|
||||
}
|
||||
|
||||
// PrivateKeyNotIn applies the NotIn predicate on the "privateKey" field.
|
||||
func PrivateKeyNotIn(vs ...ed25519.PrivateKey) predicate.User {
|
||||
v := make([]any, len(vs))
|
||||
for i := range v {
|
||||
v[i] = []byte(vs[i])
|
||||
}
|
||||
return predicate.User(sql.FieldNotIn(FieldPrivateKey, v...))
|
||||
func PrivateKeyNotIn(vs ...[]byte) predicate.User {
|
||||
return predicate.User(sql.FieldNotIn(FieldPrivateKey, vs...))
|
||||
}
|
||||
|
||||
// PrivateKeyGT applies the GT predicate on the "privateKey" field.
|
||||
func PrivateKeyGT(v ed25519.PrivateKey) predicate.User {
|
||||
vc := []byte(v)
|
||||
return predicate.User(sql.FieldGT(FieldPrivateKey, vc))
|
||||
func PrivateKeyGT(v []byte) predicate.User {
|
||||
return predicate.User(sql.FieldGT(FieldPrivateKey, v))
|
||||
}
|
||||
|
||||
// PrivateKeyGTE applies the GTE predicate on the "privateKey" field.
|
||||
func PrivateKeyGTE(v ed25519.PrivateKey) predicate.User {
|
||||
vc := []byte(v)
|
||||
return predicate.User(sql.FieldGTE(FieldPrivateKey, vc))
|
||||
func PrivateKeyGTE(v []byte) predicate.User {
|
||||
return predicate.User(sql.FieldGTE(FieldPrivateKey, v))
|
||||
}
|
||||
|
||||
// PrivateKeyLT applies the LT predicate on the "privateKey" field.
|
||||
func PrivateKeyLT(v ed25519.PrivateKey) predicate.User {
|
||||
vc := []byte(v)
|
||||
return predicate.User(sql.FieldLT(FieldPrivateKey, vc))
|
||||
func PrivateKeyLT(v []byte) predicate.User {
|
||||
return predicate.User(sql.FieldLT(FieldPrivateKey, v))
|
||||
}
|
||||
|
||||
// PrivateKeyLTE applies the LTE predicate on the "privateKey" field.
|
||||
func PrivateKeyLTE(v ed25519.PrivateKey) predicate.User {
|
||||
vc := []byte(v)
|
||||
return predicate.User(sql.FieldLTE(FieldPrivateKey, vc))
|
||||
func PrivateKeyLTE(v []byte) predicate.User {
|
||||
return predicate.User(sql.FieldLTE(FieldPrivateKey, v))
|
||||
}
|
||||
|
||||
// PrivateKeyIsNil applies the IsNil predicate on the "privateKey" field.
|
||||
|
|
@ -1124,6 +1233,75 @@ func HasMentionedNotesWith(preds ...predicate.Note) predicate.User {
|
|||
})
|
||||
}
|
||||
|
||||
// HasServers applies the HasEdge predicate on the "servers" edge.
|
||||
func HasServers() predicate.User {
|
||||
return predicate.User(func(s *sql.Selector) {
|
||||
step := sqlgraph.NewStep(
|
||||
sqlgraph.From(Table, FieldID),
|
||||
sqlgraph.Edge(sqlgraph.M2M, true, ServersTable, ServersPrimaryKey...),
|
||||
)
|
||||
sqlgraph.HasNeighbors(s, step)
|
||||
})
|
||||
}
|
||||
|
||||
// HasServersWith applies the HasEdge predicate on the "servers" edge with a given conditions (other predicates).
|
||||
func HasServersWith(preds ...predicate.InstanceMetadata) predicate.User {
|
||||
return predicate.User(func(s *sql.Selector) {
|
||||
step := newServersStep()
|
||||
sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) {
|
||||
for _, p := range preds {
|
||||
p(s)
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
// HasModeratedServers applies the HasEdge predicate on the "moderatedServers" edge.
|
||||
func HasModeratedServers() predicate.User {
|
||||
return predicate.User(func(s *sql.Selector) {
|
||||
step := sqlgraph.NewStep(
|
||||
sqlgraph.From(Table, FieldID),
|
||||
sqlgraph.Edge(sqlgraph.M2M, true, ModeratedServersTable, ModeratedServersPrimaryKey...),
|
||||
)
|
||||
sqlgraph.HasNeighbors(s, step)
|
||||
})
|
||||
}
|
||||
|
||||
// HasModeratedServersWith applies the HasEdge predicate on the "moderatedServers" edge with a given conditions (other predicates).
|
||||
func HasModeratedServersWith(preds ...predicate.InstanceMetadata) predicate.User {
|
||||
return predicate.User(func(s *sql.Selector) {
|
||||
step := newModeratedServersStep()
|
||||
sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) {
|
||||
for _, p := range preds {
|
||||
p(s)
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
// HasAdministeredServers applies the HasEdge predicate on the "administeredServers" edge.
|
||||
func HasAdministeredServers() predicate.User {
|
||||
return predicate.User(func(s *sql.Selector) {
|
||||
step := sqlgraph.NewStep(
|
||||
sqlgraph.From(Table, FieldID),
|
||||
sqlgraph.Edge(sqlgraph.M2M, true, AdministeredServersTable, AdministeredServersPrimaryKey...),
|
||||
)
|
||||
sqlgraph.HasNeighbors(s, step)
|
||||
})
|
||||
}
|
||||
|
||||
// HasAdministeredServersWith applies the HasEdge predicate on the "administeredServers" edge with a given conditions (other predicates).
|
||||
func HasAdministeredServersWith(preds ...predicate.InstanceMetadata) predicate.User {
|
||||
return predicate.User(func(s *sql.Selector) {
|
||||
step := newAdministeredServersStep()
|
||||
sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) {
|
||||
for _, p := range preds {
|
||||
p(s)
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
// And groups predicates with the AND operator between them.
|
||||
func And(predicates ...predicate.User) predicate.User {
|
||||
return predicate.User(sql.AndPredicates(predicates...))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue