membership

package
v0.0.0-...-e59a564 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
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"
)
View Source
const DefaultRole = RoleDeployer

RoleDeployer is the default value of the Role enum.

Variables

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

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

func RoleValidator(r Role) error

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

func ValidColumn(column string) bool

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

Types

type OrderOption

type OrderOption func(*sql.Selector)

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.

type Role

type Role string

Role defines the type for the "role" enum field.

const (
	RoleViewer    Role = "viewer"
	RoleDeployer  Role = "deployer"
	RoleDeveloper Role = "developer"
	RoleAdmin     Role = "admin"
)

Role values.

func (Role) String

func (r Role) String() string

Jump to

Keyboard shortcuts

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