1
0

add mastodon

This commit is contained in:
2023-07-10 12:43:09 +09:00
parent c3bd20d90b
commit dc01c83e9d
21 changed files with 2481 additions and 1817 deletions

View File

@ -15,6 +15,10 @@ const (
FieldUsername = "username"
// FieldDid holds the string denoting the did field in the database.
FieldDid = "did"
// FieldBsky holds the string denoting the bsky field in the database.
FieldBsky = "bsky"
// FieldMastodon holds the string denoting the mastodon field in the database.
FieldMastodon = "mastodon"
// FieldDelete holds the string denoting the delete field in the database.
FieldDelete = "delete"
// FieldHandle holds the string denoting the handle field in the database.
@ -79,6 +83,8 @@ var Columns = []string{
FieldID,
FieldUsername,
FieldDid,
FieldBsky,
FieldMastodon,
FieldDelete,
FieldHandle,
FieldToken,
@ -128,6 +134,10 @@ func ValidColumn(column string) bool {
var (
// UsernameValidator is a validator for the "username" field. It is called by the builders before save.
UsernameValidator func(string) error
// DefaultBsky holds the default value on creation for the "bsky" field.
DefaultBsky bool
// DefaultMastodon holds the default value on creation for the "mastodon" field.
DefaultMastodon bool
// DefaultDelete holds the default value on creation for the "delete" field.
DefaultDelete bool
// DefaultHandle holds the default value on creation for the "handle" field.

View File

@ -65,6 +65,16 @@ func Did(v string) predicate.User {
return predicate.User(sql.FieldEQ(FieldDid, v))
}
// Bsky applies equality check predicate on the "bsky" field. It's identical to BskyEQ.
func Bsky(v bool) predicate.User {
return predicate.User(sql.FieldEQ(FieldBsky, v))
}
// Mastodon applies equality check predicate on the "mastodon" field. It's identical to MastodonEQ.
func Mastodon(v bool) predicate.User {
return predicate.User(sql.FieldEQ(FieldMastodon, v))
}
// Delete applies equality check predicate on the "delete" field. It's identical to DeleteEQ.
func Delete(v bool) predicate.User {
return predicate.User(sql.FieldEQ(FieldDelete, v))
@ -320,6 +330,46 @@ func DidContainsFold(v string) predicate.User {
return predicate.User(sql.FieldContainsFold(FieldDid, v))
}
// BskyEQ applies the EQ predicate on the "bsky" field.
func BskyEQ(v bool) predicate.User {
return predicate.User(sql.FieldEQ(FieldBsky, v))
}
// BskyNEQ applies the NEQ predicate on the "bsky" field.
func BskyNEQ(v bool) predicate.User {
return predicate.User(sql.FieldNEQ(FieldBsky, v))
}
// BskyIsNil applies the IsNil predicate on the "bsky" field.
func BskyIsNil() predicate.User {
return predicate.User(sql.FieldIsNull(FieldBsky))
}
// BskyNotNil applies the NotNil predicate on the "bsky" field.
func BskyNotNil() predicate.User {
return predicate.User(sql.FieldNotNull(FieldBsky))
}
// MastodonEQ applies the EQ predicate on the "mastodon" field.
func MastodonEQ(v bool) predicate.User {
return predicate.User(sql.FieldEQ(FieldMastodon, v))
}
// MastodonNEQ applies the NEQ predicate on the "mastodon" field.
func MastodonNEQ(v bool) predicate.User {
return predicate.User(sql.FieldNEQ(FieldMastodon, v))
}
// MastodonIsNil applies the IsNil predicate on the "mastodon" field.
func MastodonIsNil() predicate.User {
return predicate.User(sql.FieldIsNull(FieldMastodon))
}
// MastodonNotNil applies the NotNil predicate on the "mastodon" field.
func MastodonNotNil() predicate.User {
return predicate.User(sql.FieldNotNull(FieldMastodon))
}
// DeleteEQ applies the EQ predicate on the "delete" field.
func DeleteEQ(v bool) predicate.User {
return predicate.User(sql.FieldEQ(FieldDelete, v))