Documentation ¶
Index ¶
- Constants
- Variables
- func And(predicates ...predicate.Membership) predicate.Membership
- func HasProject() predicate.Membership
- func HasProjectWith(preds ...predicate.Project) predicate.Membership
- func HasUser() predicate.Membership
- func HasUserWith(preds ...predicate.User) predicate.Membership
- func Not(p predicate.Membership) predicate.Membership
- func Or(predicates ...predicate.Membership) predicate.Membership
- func ProjectID(v uuid.UUID) predicate.Membership
- func ProjectIDEQ(v uuid.UUID) predicate.Membership
- func ProjectIDIn(vs ...uuid.UUID) predicate.Membership
- func ProjectIDNEQ(v uuid.UUID) predicate.Membership
- func ProjectIDNotIn(vs ...uuid.UUID) predicate.Membership
- func RoleEQ(v Role) predicate.Membership
- func RoleIn(vs ...Role) predicate.Membership
- func RoleNEQ(v Role) predicate.Membership
- func RoleNotIn(vs ...Role) predicate.Membership
- func RoleValidator(r Role) error
- func UserID(v uuid.UUID) predicate.Membership
- func UserIDEQ(v uuid.UUID) predicate.Membership
- func UserIDIn(vs ...uuid.UUID) predicate.Membership
- func UserIDNEQ(v uuid.UUID) predicate.Membership
- func UserIDNotIn(vs ...uuid.UUID) predicate.Membership
- func ValidColumn(column string) bool
- type OrderOption
- func ByProjectField(field string, opts ...sql.OrderTermOption) OrderOption
- func ByProjectID(opts ...sql.OrderTermOption) OrderOption
- func ByRole(opts ...sql.OrderTermOption) OrderOption
- func ByUserField(field string, opts ...sql.OrderTermOption) OrderOption
- func ByUserID(opts ...sql.OrderTermOption) OrderOption
- type Role
Constants ¶
const ( // Label holds the string label denoting the membership type in the database. Label = "membership" // FieldProjectID holds the string denoting the project_id field in the database. FieldProjectID = "project_id" // FieldUserID holds the string denoting the user_id field in the database. FieldUserID = "user_id" // FieldRole holds the string denoting the role field in the database. FieldRole = "role" // EdgeProject holds the string denoting the project edge name in mutations. EdgeProject = "project" // EdgeUser holds the string denoting the user edge name in mutations. EdgeUser = "user" // ProjectFieldID holds the string denoting the ID field of the Project. ProjectFieldID = "id" // UserFieldID holds the string denoting the ID field of the User. UserFieldID = "id" // Table holds the table name of the membership in the database. Table = "memberships" // ProjectTable is the table that holds the project relation/edge. ProjectTable = "memberships" // ProjectInverseTable is the table name for the Project entity. // It exists in this package in order to avoid circular dependency with the "project" package. ProjectInverseTable = "projects" // ProjectColumn is the table column denoting the project relation/edge. ProjectColumn = "project_id" // UserTable is the table that holds the user relation/edge. UserTable = "memberships" // UserInverseTable is the table name for the User entity. // It exists in this package in order to avoid circular dependency with the "user" package. UserInverseTable = "users" // UserColumn is the table column denoting the user relation/edge. UserColumn = "user_id" )
const DefaultRole = RoleDeployer
RoleDeployer is the default value of the Role enum.
Variables ¶
var Columns = []string{ FieldProjectID, FieldUserID, FieldRole, }
Columns holds all SQL columns for membership fields.
Functions ¶
func And ¶
func And(predicates ...predicate.Membership) predicate.Membership
And groups predicates with the AND operator between them.
func HasProject ¶
func HasProject() predicate.Membership
HasProject applies the HasEdge predicate on the "project" edge.
func HasProjectWith ¶
func HasProjectWith(preds ...predicate.Project) predicate.Membership
HasProjectWith applies the HasEdge predicate on the "project" edge with a given conditions (other predicates).
func HasUser ¶
func HasUser() predicate.Membership
HasUser applies the HasEdge predicate on the "user" edge.
func HasUserWith ¶
func HasUserWith(preds ...predicate.User) predicate.Membership
HasUserWith applies the HasEdge predicate on the "user" edge with a given conditions (other predicates).
func Not ¶
func Not(p predicate.Membership) predicate.Membership
Not applies the not operator on the given predicate.
func Or ¶
func Or(predicates ...predicate.Membership) predicate.Membership
Or groups predicates with the OR operator between them.
func ProjectID ¶
func ProjectID(v uuid.UUID) predicate.Membership
ProjectID applies equality check predicate on the "project_id" field. It's identical to ProjectIDEQ.
func ProjectIDEQ ¶
func ProjectIDEQ(v uuid.UUID) predicate.Membership
ProjectIDEQ applies the EQ predicate on the "project_id" field.
func ProjectIDIn ¶
func ProjectIDIn(vs ...uuid.UUID) predicate.Membership
ProjectIDIn applies the In predicate on the "project_id" field.
func ProjectIDNEQ ¶
func ProjectIDNEQ(v uuid.UUID) predicate.Membership
ProjectIDNEQ applies the NEQ predicate on the "project_id" field.
func ProjectIDNotIn ¶
func ProjectIDNotIn(vs ...uuid.UUID) predicate.Membership
ProjectIDNotIn applies the NotIn predicate on the "project_id" field.
func RoleEQ ¶
func RoleEQ(v Role) predicate.Membership
RoleEQ applies the EQ predicate on the "role" field.
func RoleIn ¶
func RoleIn(vs ...Role) predicate.Membership
RoleIn applies the In predicate on the "role" field.
func RoleNEQ ¶
func RoleNEQ(v Role) predicate.Membership
RoleNEQ applies the NEQ predicate on the "role" field.
func RoleNotIn ¶
func RoleNotIn(vs ...Role) predicate.Membership
RoleNotIn applies the NotIn predicate on the "role" field.
func RoleValidator ¶
RoleValidator is a validator for the "role" field enum values. It is called by the builders before save.
func UserID ¶
func UserID(v uuid.UUID) predicate.Membership
UserID applies equality check predicate on the "user_id" field. It's identical to UserIDEQ.
func UserIDEQ ¶
func UserIDEQ(v uuid.UUID) predicate.Membership
UserIDEQ applies the EQ predicate on the "user_id" field.
func UserIDIn ¶
func UserIDIn(vs ...uuid.UUID) predicate.Membership
UserIDIn applies the In predicate on the "user_id" field.
func UserIDNEQ ¶
func UserIDNEQ(v uuid.UUID) predicate.Membership
UserIDNEQ applies the NEQ predicate on the "user_id" field.
func UserIDNotIn ¶
func UserIDNotIn(vs ...uuid.UUID) predicate.Membership
UserIDNotIn applies the NotIn predicate on the "user_id" field.
func ValidColumn ¶
ValidColumn reports if the column name is valid (part of the table columns).
Types ¶
type OrderOption ¶
OrderOption defines the ordering options for the Membership queries.
func ByProjectField ¶
func ByProjectField(field string, opts ...sql.OrderTermOption) OrderOption
ByProjectField orders the results by project field.
func ByProjectID ¶
func ByProjectID(opts ...sql.OrderTermOption) OrderOption
ByProjectID orders the results by the project_id field.
func ByRole ¶
func ByRole(opts ...sql.OrderTermOption) OrderOption
ByRole orders the results by the role field.
func ByUserField ¶
func ByUserField(field string, opts ...sql.OrderTermOption) OrderOption
ByUserField orders the results by user field.
func ByUserID ¶
func ByUserID(opts ...sql.OrderTermOption) OrderOption
ByUserID orders the results by the user_id field.