membership

package
v1.66.0 Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2025 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Label holds the string label denoting the membership type in the database.
	Label = "membership"
	// FieldID holds the string denoting the id field in the database.
	FieldID = "id"
	// FieldCurrent holds the string denoting the current field in the database.
	FieldCurrent = "current"
	// FieldCreatedAt holds the string denoting the created_at field in the database.
	FieldCreatedAt = "created_at"
	// FieldUpdatedAt holds the string denoting the updated_at field in the database.
	FieldUpdatedAt = "updated_at"
	// FieldRole holds the string denoting the role field in the database.
	FieldRole = "role"
	// FieldMembershipType holds the string denoting the membership_type field in the database.
	FieldMembershipType = "membership_type"
	// FieldMemberID holds the string denoting the member_id field in the database.
	FieldMemberID = "member_id"
	// FieldResourceType holds the string denoting the resource_type field in the database.
	FieldResourceType = "resource_type"
	// FieldResourceID holds the string denoting the resource_id field in the database.
	FieldResourceID = "resource_id"
	// FieldParentID holds the string denoting the parent_id field in the database.
	FieldParentID = "parent_id"
	// EdgeOrganization holds the string denoting the organization edge name in mutations.
	EdgeOrganization = "organization"
	// EdgeUser holds the string denoting the user edge name in mutations.
	EdgeUser = "user"
	// EdgeParent holds the string denoting the parent edge name in mutations.
	EdgeParent = "parent"
	// EdgeChildren holds the string denoting the children edge name in mutations.
	EdgeChildren = "children"
	// Table holds the table name of the membership in the database.
	Table = "memberships"
	// OrganizationTable is the table that holds the organization relation/edge.
	OrganizationTable = "memberships"
	// OrganizationInverseTable is the table name for the Organization entity.
	// It exists in this package in order to avoid circular dependency with the "organization" package.
	OrganizationInverseTable = "organizations"
	// OrganizationColumn is the table column denoting the organization relation/edge.
	OrganizationColumn = "organization_memberships"
	// 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_memberships"
	// ParentTable is the table that holds the parent relation/edge.
	ParentTable = "memberships"
	// ParentColumn is the table column denoting the parent relation/edge.
	ParentColumn = "parent_id"
	// ChildrenTable is the table that holds the children relation/edge.
	ChildrenTable = "memberships"
	// ChildrenColumn is the table column denoting the children relation/edge.
	ChildrenColumn = "parent_id"
)

Variables

View Source
var (
	// DefaultCurrent holds the default value on creation for the "current" field.
	DefaultCurrent bool
	// DefaultCreatedAt holds the default value on creation for the "created_at" field.
	DefaultCreatedAt func() time.Time
	// DefaultUpdatedAt holds the default value on creation for the "updated_at" field.
	DefaultUpdatedAt func() time.Time
	// DefaultID holds the default value on creation for the "id" field.
	DefaultID func() uuid.UUID
)

Columns holds all SQL columns for membership fields.

View Source
var ForeignKeys = []string{
	"organization_memberships",
	"user_memberships",
}

ForeignKeys holds the SQL foreign-keys that are owned by the "memberships" table and are not defined as standalone fields in the schema.

Functions

func And

func And(predicates ...predicate.Membership) predicate.Membership

And groups predicates with the AND operator between them.

func CreatedAt

func CreatedAt(v time.Time) predicate.Membership

CreatedAt applies equality check predicate on the "created_at" field. It's identical to CreatedAtEQ.

func CreatedAtEQ

func CreatedAtEQ(v time.Time) predicate.Membership

CreatedAtEQ applies the EQ predicate on the "created_at" field.

func CreatedAtGT

func CreatedAtGT(v time.Time) predicate.Membership

CreatedAtGT applies the GT predicate on the "created_at" field.

func CreatedAtGTE

func CreatedAtGTE(v time.Time) predicate.Membership

CreatedAtGTE applies the GTE predicate on the "created_at" field.

func CreatedAtIn

func CreatedAtIn(vs ...time.Time) predicate.Membership

CreatedAtIn applies the In predicate on the "created_at" field.

func CreatedAtLT

func CreatedAtLT(v time.Time) predicate.Membership

CreatedAtLT applies the LT predicate on the "created_at" field.

func CreatedAtLTE

func CreatedAtLTE(v time.Time) predicate.Membership

CreatedAtLTE applies the LTE predicate on the "created_at" field.

func CreatedAtNEQ

func CreatedAtNEQ(v time.Time) predicate.Membership

CreatedAtNEQ applies the NEQ predicate on the "created_at" field.

func CreatedAtNotIn

func CreatedAtNotIn(vs ...time.Time) predicate.Membership

CreatedAtNotIn applies the NotIn predicate on the "created_at" field.

func Current

func Current(v bool) predicate.Membership

Current applies equality check predicate on the "current" field. It's identical to CurrentEQ.

func CurrentEQ

func CurrentEQ(v bool) predicate.Membership

CurrentEQ applies the EQ predicate on the "current" field.

func CurrentNEQ

func CurrentNEQ(v bool) predicate.Membership

CurrentNEQ applies the NEQ predicate on the "current" field.

func HasChildren added in v1.36.0

func HasChildren() predicate.Membership

HasChildren applies the HasEdge predicate on the "children" edge.

func HasChildrenWith added in v1.36.0

func HasChildrenWith(preds ...predicate.Membership) predicate.Membership

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

func HasOrganization

func HasOrganization() predicate.Membership

HasOrganization applies the HasEdge predicate on the "organization" edge.

func HasOrganizationWith

func HasOrganizationWith(preds ...predicate.Organization) predicate.Membership

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

func HasParent added in v1.36.0

func HasParent() predicate.Membership

HasParent applies the HasEdge predicate on the "parent" edge.

func HasParentWith added in v1.36.0

func HasParentWith(preds ...predicate.Membership) predicate.Membership

HasParentWith applies the HasEdge predicate on the "parent" 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 ID

ID filters vertices based on their ID field.

func IDEQ

func IDEQ(id uuid.UUID) predicate.Membership

IDEQ applies the EQ predicate on the ID field.

func IDGT

func IDGT(id uuid.UUID) predicate.Membership

IDGT applies the GT predicate on the ID field.

func IDGTE

func IDGTE(id uuid.UUID) predicate.Membership

IDGTE applies the GTE predicate on the ID field.

func IDIn

func IDIn(ids ...uuid.UUID) predicate.Membership

IDIn applies the In predicate on the ID field.

func IDLT

func IDLT(id uuid.UUID) predicate.Membership

IDLT applies the LT predicate on the ID field.

func IDLTE

func IDLTE(id uuid.UUID) predicate.Membership

IDLTE applies the LTE predicate on the ID field.

func IDNEQ

func IDNEQ(id uuid.UUID) predicate.Membership

IDNEQ applies the NEQ predicate on the ID field.

func IDNotIn

func IDNotIn(ids ...uuid.UUID) predicate.Membership

IDNotIn applies the NotIn predicate on the ID field.

func MemberID added in v1.8.0

func MemberID(v uuid.UUID) predicate.Membership

MemberID applies equality check predicate on the "member_id" field. It's identical to MemberIDEQ.

func MemberIDEQ added in v1.8.0

func MemberIDEQ(v uuid.UUID) predicate.Membership

MemberIDEQ applies the EQ predicate on the "member_id" field.

func MemberIDGT added in v1.8.0

func MemberIDGT(v uuid.UUID) predicate.Membership

MemberIDGT applies the GT predicate on the "member_id" field.

func MemberIDGTE added in v1.8.0

func MemberIDGTE(v uuid.UUID) predicate.Membership

MemberIDGTE applies the GTE predicate on the "member_id" field.

func MemberIDIn added in v1.8.0

func MemberIDIn(vs ...uuid.UUID) predicate.Membership

MemberIDIn applies the In predicate on the "member_id" field.

func MemberIDIsNil added in v1.8.0

func MemberIDIsNil() predicate.Membership

MemberIDIsNil applies the IsNil predicate on the "member_id" field.

func MemberIDLT added in v1.8.0

func MemberIDLT(v uuid.UUID) predicate.Membership

MemberIDLT applies the LT predicate on the "member_id" field.

func MemberIDLTE added in v1.8.0

func MemberIDLTE(v uuid.UUID) predicate.Membership

MemberIDLTE applies the LTE predicate on the "member_id" field.

func MemberIDNEQ added in v1.8.0

func MemberIDNEQ(v uuid.UUID) predicate.Membership

MemberIDNEQ applies the NEQ predicate on the "member_id" field.

func MemberIDNotIn added in v1.8.0

func MemberIDNotIn(vs ...uuid.UUID) predicate.Membership

MemberIDNotIn applies the NotIn predicate on the "member_id" field.

func MemberIDNotNil added in v1.8.0

func MemberIDNotNil() predicate.Membership

MemberIDNotNil applies the NotNil predicate on the "member_id" field.

func MembershipTypeEQ added in v1.8.0

func MembershipTypeEQ(v authz.MembershipType) predicate.Membership

MembershipTypeEQ applies the EQ predicate on the "membership_type" field.

func MembershipTypeIn added in v1.8.0

func MembershipTypeIn(vs ...authz.MembershipType) predicate.Membership

MembershipTypeIn applies the In predicate on the "membership_type" field.

func MembershipTypeIsNil added in v1.8.0

func MembershipTypeIsNil() predicate.Membership

MembershipTypeIsNil applies the IsNil predicate on the "membership_type" field.

func MembershipTypeNEQ added in v1.8.0

func MembershipTypeNEQ(v authz.MembershipType) predicate.Membership

MembershipTypeNEQ applies the NEQ predicate on the "membership_type" field.

func MembershipTypeNotIn added in v1.8.0

func MembershipTypeNotIn(vs ...authz.MembershipType) predicate.Membership

MembershipTypeNotIn applies the NotIn predicate on the "membership_type" field.

func MembershipTypeNotNil added in v1.8.0

func MembershipTypeNotNil() predicate.Membership

MembershipTypeNotNil applies the NotNil predicate on the "membership_type" field.

func MembershipTypeValidator added in v1.8.0

func MembershipTypeValidator(mt authz.MembershipType) error

MembershipTypeValidator is a validator for the "membership_type" field enum values. It is called by the builders before save.

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 ParentID added in v1.36.0

func ParentID(v uuid.UUID) predicate.Membership

ParentID applies equality check predicate on the "parent_id" field. It's identical to ParentIDEQ.

func ParentIDEQ added in v1.36.0

func ParentIDEQ(v uuid.UUID) predicate.Membership

ParentIDEQ applies the EQ predicate on the "parent_id" field.

func ParentIDIn added in v1.36.0

func ParentIDIn(vs ...uuid.UUID) predicate.Membership

ParentIDIn applies the In predicate on the "parent_id" field.

func ParentIDIsNil added in v1.36.0

func ParentIDIsNil() predicate.Membership

ParentIDIsNil applies the IsNil predicate on the "parent_id" field.

func ParentIDNEQ added in v1.36.0

func ParentIDNEQ(v uuid.UUID) predicate.Membership

ParentIDNEQ applies the NEQ predicate on the "parent_id" field.

func ParentIDNotIn added in v1.36.0

func ParentIDNotIn(vs ...uuid.UUID) predicate.Membership

ParentIDNotIn applies the NotIn predicate on the "parent_id" field.

func ParentIDNotNil added in v1.36.0

func ParentIDNotNil() predicate.Membership

ParentIDNotNil applies the NotNil predicate on the "parent_id" field.

func ResourceID added in v1.8.0

func ResourceID(v uuid.UUID) predicate.Membership

ResourceID applies equality check predicate on the "resource_id" field. It's identical to ResourceIDEQ.

func ResourceIDEQ added in v1.8.0

func ResourceIDEQ(v uuid.UUID) predicate.Membership

ResourceIDEQ applies the EQ predicate on the "resource_id" field.

func ResourceIDGT added in v1.8.0

func ResourceIDGT(v uuid.UUID) predicate.Membership

ResourceIDGT applies the GT predicate on the "resource_id" field.

func ResourceIDGTE added in v1.8.0

func ResourceIDGTE(v uuid.UUID) predicate.Membership

ResourceIDGTE applies the GTE predicate on the "resource_id" field.

func ResourceIDIn added in v1.8.0

func ResourceIDIn(vs ...uuid.UUID) predicate.Membership

ResourceIDIn applies the In predicate on the "resource_id" field.

func ResourceIDIsNil added in v1.8.0

func ResourceIDIsNil() predicate.Membership

ResourceIDIsNil applies the IsNil predicate on the "resource_id" field.

func ResourceIDLT added in v1.8.0

func ResourceIDLT(v uuid.UUID) predicate.Membership

ResourceIDLT applies the LT predicate on the "resource_id" field.

func ResourceIDLTE added in v1.8.0

func ResourceIDLTE(v uuid.UUID) predicate.Membership

ResourceIDLTE applies the LTE predicate on the "resource_id" field.

func ResourceIDNEQ added in v1.8.0

func ResourceIDNEQ(v uuid.UUID) predicate.Membership

ResourceIDNEQ applies the NEQ predicate on the "resource_id" field.

func ResourceIDNotIn added in v1.8.0

func ResourceIDNotIn(vs ...uuid.UUID) predicate.Membership

ResourceIDNotIn applies the NotIn predicate on the "resource_id" field.

func ResourceIDNotNil added in v1.8.0

func ResourceIDNotNil() predicate.Membership

ResourceIDNotNil applies the NotNil predicate on the "resource_id" field.

func ResourceTypeEQ added in v1.8.0

func ResourceTypeEQ(v authz.ResourceType) predicate.Membership

ResourceTypeEQ applies the EQ predicate on the "resource_type" field.

func ResourceTypeIn added in v1.8.0

func ResourceTypeIn(vs ...authz.ResourceType) predicate.Membership

ResourceTypeIn applies the In predicate on the "resource_type" field.

func ResourceTypeIsNil added in v1.8.0

func ResourceTypeIsNil() predicate.Membership

ResourceTypeIsNil applies the IsNil predicate on the "resource_type" field.

func ResourceTypeNEQ added in v1.8.0

func ResourceTypeNEQ(v authz.ResourceType) predicate.Membership

ResourceTypeNEQ applies the NEQ predicate on the "resource_type" field.

func ResourceTypeNotIn added in v1.8.0

func ResourceTypeNotIn(vs ...authz.ResourceType) predicate.Membership

ResourceTypeNotIn applies the NotIn predicate on the "resource_type" field.

func ResourceTypeNotNil added in v1.8.0

func ResourceTypeNotNil() predicate.Membership

ResourceTypeNotNil applies the NotNil predicate on the "resource_type" field.

func ResourceTypeValidator added in v1.8.0

func ResourceTypeValidator(rt authz.ResourceType) error

ResourceTypeValidator is a validator for the "resource_type" field enum values. It is called by the builders before save.

func RoleEQ

func RoleEQ(v authz.Role) predicate.Membership

RoleEQ applies the EQ predicate on the "role" field.

func RoleIn

func RoleIn(vs ...authz.Role) predicate.Membership

RoleIn applies the In predicate on the "role" field.

func RoleNEQ

func RoleNEQ(v authz.Role) predicate.Membership

RoleNEQ applies the NEQ predicate on the "role" field.

func RoleNotIn

func RoleNotIn(vs ...authz.Role) predicate.Membership

RoleNotIn applies the NotIn predicate on the "role" field.

func RoleValidator

func RoleValidator(r authz.Role) error

RoleValidator is a validator for the "role" field enum values. It is called by the builders before save.

func UpdatedAt

func UpdatedAt(v time.Time) predicate.Membership

UpdatedAt applies equality check predicate on the "updated_at" field. It's identical to UpdatedAtEQ.

func UpdatedAtEQ

func UpdatedAtEQ(v time.Time) predicate.Membership

UpdatedAtEQ applies the EQ predicate on the "updated_at" field.

func UpdatedAtGT

func UpdatedAtGT(v time.Time) predicate.Membership

UpdatedAtGT applies the GT predicate on the "updated_at" field.

func UpdatedAtGTE

func UpdatedAtGTE(v time.Time) predicate.Membership

UpdatedAtGTE applies the GTE predicate on the "updated_at" field.

func UpdatedAtIn

func UpdatedAtIn(vs ...time.Time) predicate.Membership

UpdatedAtIn applies the In predicate on the "updated_at" field.

func UpdatedAtLT

func UpdatedAtLT(v time.Time) predicate.Membership

UpdatedAtLT applies the LT predicate on the "updated_at" field.

func UpdatedAtLTE

func UpdatedAtLTE(v time.Time) predicate.Membership

UpdatedAtLTE applies the LTE predicate on the "updated_at" field.

func UpdatedAtNEQ

func UpdatedAtNEQ(v time.Time) predicate.Membership

UpdatedAtNEQ applies the NEQ predicate on the "updated_at" field.

func UpdatedAtNotIn

func UpdatedAtNotIn(vs ...time.Time) predicate.Membership

UpdatedAtNotIn applies the NotIn predicate on the "updated_at" 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 ByChildren added in v1.36.0

func ByChildren(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption

ByChildren orders the results by children terms.

func ByChildrenCount added in v1.36.0

func ByChildrenCount(opts ...sql.OrderTermOption) OrderOption

ByChildrenCount orders the results by children count.

func ByCreatedAt

func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption

ByCreatedAt orders the results by the created_at field.

func ByCurrent

func ByCurrent(opts ...sql.OrderTermOption) OrderOption

ByCurrent orders the results by the current field.

func ByID

func ByID(opts ...sql.OrderTermOption) OrderOption

ByID orders the results by the id field.

func ByMemberID added in v1.8.0

func ByMemberID(opts ...sql.OrderTermOption) OrderOption

ByMemberID orders the results by the member_id field.

func ByMembershipType added in v1.8.0

func ByMembershipType(opts ...sql.OrderTermOption) OrderOption

ByMembershipType orders the results by the membership_type field.

func ByOrganizationField

func ByOrganizationField(field string, opts ...sql.OrderTermOption) OrderOption

ByOrganizationField orders the results by organization field.

func ByParentField added in v1.36.0

func ByParentField(field string, opts ...sql.OrderTermOption) OrderOption

ByParentField orders the results by parent field.

func ByParentID added in v1.36.0

func ByParentID(opts ...sql.OrderTermOption) OrderOption

ByParentID orders the results by the parent_id field.

func ByResourceID added in v1.8.0

func ByResourceID(opts ...sql.OrderTermOption) OrderOption

ByResourceID orders the results by the resource_id field.

func ByResourceType added in v1.8.0

func ByResourceType(opts ...sql.OrderTermOption) OrderOption

ByResourceType orders the results by the resource_type field.

func ByRole

func ByRole(opts ...sql.OrderTermOption) OrderOption

ByRole orders the results by the role field.

func ByUpdatedAt

func ByUpdatedAt(opts ...sql.OrderTermOption) OrderOption

ByUpdatedAt orders the results by the updated_at field.

func ByUserField

func ByUserField(field string, opts ...sql.OrderTermOption) OrderOption

ByUserField orders the results by user field.

Jump to

Keyboard shortcuts

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