user

package
v0.11.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 5, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Label holds the string label denoting the user type in the database.
	Label = "user"
	// FieldID holds the string denoting the id field in the database.
	FieldID = "id"
	// FieldName holds the string denoting the name field in the database.
	FieldName = "name"
	// EdgeGroups holds the string denoting the groups edge name in mutations.
	EdgeGroups = "groups"
	// EdgeFriends holds the string denoting the friends edge name in mutations.
	EdgeFriends = "friends"
	// EdgeRelatives holds the string denoting the relatives edge name in mutations.
	EdgeRelatives = "relatives"
	// EdgeLikedTweets holds the string denoting the liked_tweets edge name in mutations.
	EdgeLikedTweets = "liked_tweets"
	// EdgeTweets holds the string denoting the tweets edge name in mutations.
	EdgeTweets = "tweets"
	// EdgeRoles holds the string denoting the roles edge name in mutations.
	EdgeRoles = "roles"
	// EdgeJoinedGroups holds the string denoting the joined_groups edge name in mutations.
	EdgeJoinedGroups = "joined_groups"
	// EdgeFriendships holds the string denoting the friendships edge name in mutations.
	EdgeFriendships = "friendships"
	// EdgeRelationship holds the string denoting the relationship edge name in mutations.
	EdgeRelationship = "relationship"
	// EdgeLikes holds the string denoting the likes edge name in mutations.
	EdgeLikes = "likes"
	// EdgeUserTweets holds the string denoting the user_tweets edge name in mutations.
	EdgeUserTweets = "user_tweets"
	// EdgeRolesUsers holds the string denoting the roles_users edge name in mutations.
	EdgeRolesUsers = "roles_users"
	// Table holds the table name of the user in the database.
	Table = "users"
	// GroupsTable is the table that holds the groups relation/edge. The primary key declared below.
	GroupsTable = "user_groups"
	// GroupsInverseTable is the table name for the Group entity.
	// It exists in this package in order to avoid circular dependency with the "group" package.
	GroupsInverseTable = "groups"
	// FriendsTable is the table that holds the friends relation/edge. The primary key declared below.
	FriendsTable = "friendships"
	// RelativesTable is the table that holds the relatives relation/edge. The primary key declared below.
	RelativesTable = "relationships"
	// LikedTweetsTable is the table that holds the liked_tweets relation/edge. The primary key declared below.
	LikedTweetsTable = "tweet_likes"
	// LikedTweetsInverseTable is the table name for the Tweet entity.
	// It exists in this package in order to avoid circular dependency with the "tweet" package.
	LikedTweetsInverseTable = "tweets"
	// TweetsTable is the table that holds the tweets relation/edge. The primary key declared below.
	TweetsTable = "user_tweets"
	// TweetsInverseTable is the table name for the Tweet entity.
	// It exists in this package in order to avoid circular dependency with the "tweet" package.
	TweetsInverseTable = "tweets"
	// RolesTable is the table that holds the roles relation/edge. The primary key declared below.
	RolesTable = "role_users"
	// RolesInverseTable is the table name for the Role entity.
	// It exists in this package in order to avoid circular dependency with the "role" package.
	RolesInverseTable = "roles"
	// JoinedGroupsTable is the table that holds the joined_groups relation/edge.
	JoinedGroupsTable = "user_groups"
	// JoinedGroupsInverseTable is the table name for the UserGroup entity.
	// It exists in this package in order to avoid circular dependency with the "usergroup" package.
	JoinedGroupsInverseTable = "user_groups"
	// JoinedGroupsColumn is the table column denoting the joined_groups relation/edge.
	JoinedGroupsColumn = "user_id"
	// FriendshipsTable is the table that holds the friendships relation/edge.
	FriendshipsTable = "friendships"
	// FriendshipsInverseTable is the table name for the Friendship entity.
	// It exists in this package in order to avoid circular dependency with the "friendship" package.
	FriendshipsInverseTable = "friendships"
	// FriendshipsColumn is the table column denoting the friendships relation/edge.
	FriendshipsColumn = "user_id"
	// RelationshipTable is the table that holds the relationship relation/edge.
	RelationshipTable = "relationships"
	// RelationshipInverseTable is the table name for the Relationship entity.
	// It exists in this package in order to avoid circular dependency with the "relationship" package.
	RelationshipInverseTable = "relationships"
	// RelationshipColumn is the table column denoting the relationship relation/edge.
	RelationshipColumn = "user_id"
	// LikesTable is the table that holds the likes relation/edge.
	LikesTable = "tweet_likes"
	// LikesInverseTable is the table name for the TweetLike entity.
	// It exists in this package in order to avoid circular dependency with the "tweetlike" package.
	LikesInverseTable = "tweet_likes"
	// LikesColumn is the table column denoting the likes relation/edge.
	LikesColumn = "user_id"
	// UserTweetsTable is the table that holds the user_tweets relation/edge.
	UserTweetsTable = "user_tweets"
	// UserTweetsInverseTable is the table name for the UserTweet entity.
	// It exists in this package in order to avoid circular dependency with the "usertweet" package.
	UserTweetsInverseTable = "user_tweets"
	// UserTweetsColumn is the table column denoting the user_tweets relation/edge.
	UserTweetsColumn = "user_id"
	// RolesUsersTable is the table that holds the roles_users relation/edge.
	RolesUsersTable = "role_users"
	// RolesUsersInverseTable is the table name for the RoleUser entity.
	// It exists in this package in order to avoid circular dependency with the "roleuser" package.
	RolesUsersInverseTable = "role_users"
	// RolesUsersColumn is the table column denoting the roles_users relation/edge.
	RolesUsersColumn = "user_id"
)

Variables

View Source
var (
	// GroupsPrimaryKey and GroupsColumn2 are the table columns denoting the
	// primary key for the groups relation (M2M).
	GroupsPrimaryKey = []string{"user_id", "group_id"}
	// FriendsPrimaryKey and FriendsColumn2 are the table columns denoting the
	// primary key for the friends relation (M2M).
	FriendsPrimaryKey = []string{"user_id", "friend_id"}
	// RelativesPrimaryKey and RelativesColumn2 are the table columns denoting the
	// primary key for the relatives relation (M2M).
	RelativesPrimaryKey = []string{"user_id", "relative_id"}
	// LikedTweetsPrimaryKey and LikedTweetsColumn2 are the table columns denoting the
	// primary key for the liked_tweets relation (M2M).
	LikedTweetsPrimaryKey = []string{"user_id", "tweet_id"}
	// TweetsPrimaryKey and TweetsColumn2 are the table columns denoting the
	// primary key for the tweets relation (M2M).
	TweetsPrimaryKey = []string{"user_id", "tweet_id"}
	// RolesPrimaryKey and RolesColumn2 are the table columns denoting the
	// primary key for the roles relation (M2M).
	RolesPrimaryKey = []string{"user_id", "role_id"}
)
View Source
var (
	Hooks  [1]ent.Hook
	Policy ent.Policy
	// DefaultName holds the default value on creation for the "name" field.
	DefaultName string
)

Note that the variables below are initialized by the runtime package on the initialization of the application. Therefore, it should be imported in the main as follows:

import _ "entgo.io/ent/entc/integration/edgeschema/ent/runtime"
View Source
var Columns = []string{
	FieldID,
	FieldName,
}

Columns holds all SQL columns for user fields.

Functions

func And

func And(predicates ...predicate.User) predicate.User

And groups predicates with the AND operator between them.

func HasFriends

func HasFriends() predicate.User

HasFriends applies the HasEdge predicate on the "friends" edge.

func HasFriendsWith

func HasFriendsWith(preds ...predicate.User) predicate.User

HasFriendsWith applies the HasEdge predicate on the "friends" edge with a given conditions (other predicates).

func HasFriendships

func HasFriendships() predicate.User

HasFriendships applies the HasEdge predicate on the "friendships" edge.

func HasFriendshipsWith

func HasFriendshipsWith(preds ...predicate.Friendship) predicate.User

HasFriendshipsWith applies the HasEdge predicate on the "friendships" edge with a given conditions (other predicates).

func HasGroups

func HasGroups() predicate.User

HasGroups applies the HasEdge predicate on the "groups" edge.

func HasGroupsWith

func HasGroupsWith(preds ...predicate.Group) predicate.User

HasGroupsWith applies the HasEdge predicate on the "groups" edge with a given conditions (other predicates).

func HasJoinedGroups

func HasJoinedGroups() predicate.User

HasJoinedGroups applies the HasEdge predicate on the "joined_groups" edge.

func HasJoinedGroupsWith

func HasJoinedGroupsWith(preds ...predicate.UserGroup) predicate.User

HasJoinedGroupsWith applies the HasEdge predicate on the "joined_groups" edge with a given conditions (other predicates).

func HasLikedTweets

func HasLikedTweets() predicate.User

HasLikedTweets applies the HasEdge predicate on the "liked_tweets" edge.

func HasLikedTweetsWith

func HasLikedTweetsWith(preds ...predicate.Tweet) predicate.User

HasLikedTweetsWith applies the HasEdge predicate on the "liked_tweets" edge with a given conditions (other predicates).

func HasLikes

func HasLikes() predicate.User

HasLikes applies the HasEdge predicate on the "likes" edge.

func HasLikesWith

func HasLikesWith(preds ...predicate.TweetLike) predicate.User

HasLikesWith applies the HasEdge predicate on the "likes" edge with a given conditions (other predicates).

func HasRelationship

func HasRelationship() predicate.User

HasRelationship applies the HasEdge predicate on the "relationship" edge.

func HasRelationshipWith

func HasRelationshipWith(preds ...predicate.Relationship) predicate.User

HasRelationshipWith applies the HasEdge predicate on the "relationship" edge with a given conditions (other predicates).

func HasRelatives

func HasRelatives() predicate.User

HasRelatives applies the HasEdge predicate on the "relatives" edge.

func HasRelativesWith

func HasRelativesWith(preds ...predicate.User) predicate.User

HasRelativesWith applies the HasEdge predicate on the "relatives" edge with a given conditions (other predicates).

func HasRoles added in v0.11.1

func HasRoles() predicate.User

HasRoles applies the HasEdge predicate on the "roles" edge.

func HasRolesUsers added in v0.11.1

func HasRolesUsers() predicate.User

HasRolesUsers applies the HasEdge predicate on the "roles_users" edge.

func HasRolesUsersWith added in v0.11.1

func HasRolesUsersWith(preds ...predicate.RoleUser) predicate.User

HasRolesUsersWith applies the HasEdge predicate on the "roles_users" edge with a given conditions (other predicates).

func HasRolesWith added in v0.11.1

func HasRolesWith(preds ...predicate.Role) predicate.User

HasRolesWith applies the HasEdge predicate on the "roles" edge with a given conditions (other predicates).

func HasTweets

func HasTweets() predicate.User

HasTweets applies the HasEdge predicate on the "tweets" edge.

func HasTweetsWith

func HasTweetsWith(preds ...predicate.Tweet) predicate.User

HasTweetsWith applies the HasEdge predicate on the "tweets" edge with a given conditions (other predicates).

func HasUserTweets

func HasUserTweets() predicate.User

HasUserTweets applies the HasEdge predicate on the "user_tweets" edge.

func HasUserTweetsWith

func HasUserTweetsWith(preds ...predicate.UserTweet) predicate.User

HasUserTweetsWith applies the HasEdge predicate on the "user_tweets" edge with a given conditions (other predicates).

func ID

func ID(id int) predicate.User

ID filters vertices based on their ID field.

func IDEQ

func IDEQ(id int) predicate.User

IDEQ applies the EQ predicate on the ID field.

func IDGT

func IDGT(id int) predicate.User

IDGT applies the GT predicate on the ID field.

func IDGTE

func IDGTE(id int) predicate.User

IDGTE applies the GTE predicate on the ID field.

func IDIn

func IDIn(ids ...int) predicate.User

IDIn applies the In predicate on the ID field.

func IDLT

func IDLT(id int) predicate.User

IDLT applies the LT predicate on the ID field.

func IDLTE

func IDLTE(id int) predicate.User

IDLTE applies the LTE predicate on the ID field.

func IDNEQ

func IDNEQ(id int) predicate.User

IDNEQ applies the NEQ predicate on the ID field.

func IDNotIn

func IDNotIn(ids ...int) predicate.User

IDNotIn applies the NotIn predicate on the ID field.

func Name

func Name(v string) predicate.User

Name applies equality check predicate on the "name" field. It's identical to NameEQ.

func NameContains

func NameContains(v string) predicate.User

NameContains applies the Contains predicate on the "name" field.

func NameContainsFold

func NameContainsFold(v string) predicate.User

NameContainsFold applies the ContainsFold predicate on the "name" field.

func NameEQ

func NameEQ(v string) predicate.User

NameEQ applies the EQ predicate on the "name" field.

func NameEqualFold

func NameEqualFold(v string) predicate.User

NameEqualFold applies the EqualFold predicate on the "name" field.

func NameGT

func NameGT(v string) predicate.User

NameGT applies the GT predicate on the "name" field.

func NameGTE

func NameGTE(v string) predicate.User

NameGTE applies the GTE predicate on the "name" field.

func NameHasPrefix

func NameHasPrefix(v string) predicate.User

NameHasPrefix applies the HasPrefix predicate on the "name" field.

func NameHasSuffix

func NameHasSuffix(v string) predicate.User

NameHasSuffix applies the HasSuffix predicate on the "name" field.

func NameIn

func NameIn(vs ...string) predicate.User

NameIn applies the In predicate on the "name" field.

func NameLT

func NameLT(v string) predicate.User

NameLT applies the LT predicate on the "name" field.

func NameLTE

func NameLTE(v string) predicate.User

NameLTE applies the LTE predicate on the "name" field.

func NameNEQ

func NameNEQ(v string) predicate.User

NameNEQ applies the NEQ predicate on the "name" field.

func NameNotIn

func NameNotIn(vs ...string) predicate.User

NameNotIn applies the NotIn predicate on the "name" field.

func Not

Not applies the not operator on the given predicate.

func Or

func Or(predicates ...predicate.User) predicate.User

Or groups predicates with the OR operator between them.

func ValidColumn

func ValidColumn(column string) bool

ValidColumn reports if the column name is valid (part of the table columns).

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL