product

package
v0.0.0-...-6d1ceae Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2024 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Label holds the string label denoting the product type in the database.
	Label = "product"
	// FieldID holds the string denoting the id field in the database.
	FieldID = "id"
	// FieldCreateTime holds the string denoting the create_time field in the database.
	FieldCreateTime = "create_time"
	// FieldUpdateTime holds the string denoting the update_time field in the database.
	FieldUpdateTime = "update_time"
	// FieldLocale holds the string denoting the locale field in the database.
	FieldLocale = "locale"
	// FieldName holds the string denoting the name field in the database.
	FieldName = "name"
	// FieldSlug holds the string denoting the slug field in the database.
	FieldSlug = "slug"
	// EdgeRequiredInRecipes holds the string denoting the required_in_recipes edge name in mutations.
	EdgeRequiredInRecipes = "required_in_recipes"
	// EdgeIngredients holds the string denoting the ingredients edge name in mutations.
	EdgeIngredients = "ingredients"
	// Table holds the table name of the product in the database.
	Table = "products"
	// RequiredInRecipesTable is the table that holds the required_in_recipes relation/edge. The primary key declared below.
	RequiredInRecipesTable = "ingredients"
	// RequiredInRecipesInverseTable is the table name for the Recipe entity.
	// It exists in this package in order to avoid circular dependency with the "recipe" package.
	RequiredInRecipesInverseTable = "recipes"
	// IngredientsTable is the table that holds the ingredients relation/edge.
	IngredientsTable = "ingredients"
	// IngredientsInverseTable is the table name for the Ingredient entity.
	// It exists in this package in order to avoid circular dependency with the "ingredient" package.
	IngredientsInverseTable = "ingredients"
	// IngredientsColumn is the table column denoting the ingredients relation/edge.
	IngredientsColumn = "product_id"
)
View Source
const DefaultLocale = LocaleRu

LocaleRu is the default value of the Locale enum.

Variables

View Source
var (
	// DefaultCreateTime holds the default value on creation for the "create_time" field.
	DefaultCreateTime func() time.Time
	// DefaultUpdateTime holds the default value on creation for the "update_time" field.
	DefaultUpdateTime func() time.Time
	// UpdateDefaultUpdateTime holds the default value on update for the "update_time" field.
	UpdateDefaultUpdateTime func() time.Time
	// NameValidator is a validator for the "name" field. It is called by the builders before save.
	NameValidator func(string) error
	// SlugValidator is a validator for the "slug" field. It is called by the builders before save.
	SlugValidator func(string) error
	// DefaultID holds the default value on creation for the "id" field.
	DefaultID func() uuid.UUID
)

Columns holds all SQL columns for product fields.

View Source
var (
	// RequiredInRecipesPrimaryKey and RequiredInRecipesColumn2 are the table columns denoting the
	// primary key for the required_in_recipes relation (M2M).
	RequiredInRecipesPrimaryKey = []string{"recipe_id", "product_id"}
)

Functions

func And

func And(predicates ...predicate.Product) predicate.Product

And groups predicates with the AND operator between them.

func CreateTime

func CreateTime(v time.Time) predicate.Product

CreateTime applies equality check predicate on the "create_time" field. It's identical to CreateTimeEQ.

func CreateTimeEQ

func CreateTimeEQ(v time.Time) predicate.Product

CreateTimeEQ applies the EQ predicate on the "create_time" field.

func CreateTimeGT

func CreateTimeGT(v time.Time) predicate.Product

CreateTimeGT applies the GT predicate on the "create_time" field.

func CreateTimeGTE

func CreateTimeGTE(v time.Time) predicate.Product

CreateTimeGTE applies the GTE predicate on the "create_time" field.

func CreateTimeIn

func CreateTimeIn(vs ...time.Time) predicate.Product

CreateTimeIn applies the In predicate on the "create_time" field.

func CreateTimeLT

func CreateTimeLT(v time.Time) predicate.Product

CreateTimeLT applies the LT predicate on the "create_time" field.

func CreateTimeLTE

func CreateTimeLTE(v time.Time) predicate.Product

CreateTimeLTE applies the LTE predicate on the "create_time" field.

func CreateTimeNEQ

func CreateTimeNEQ(v time.Time) predicate.Product

CreateTimeNEQ applies the NEQ predicate on the "create_time" field.

func CreateTimeNotIn

func CreateTimeNotIn(vs ...time.Time) predicate.Product

CreateTimeNotIn applies the NotIn predicate on the "create_time" field.

func HasIngredients

func HasIngredients() predicate.Product

HasIngredients applies the HasEdge predicate on the "ingredients" edge.

func HasIngredientsWith

func HasIngredientsWith(preds ...predicate.Ingredient) predicate.Product

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

func HasRequiredInRecipes

func HasRequiredInRecipes() predicate.Product

HasRequiredInRecipes applies the HasEdge predicate on the "required_in_recipes" edge.

func HasRequiredInRecipesWith

func HasRequiredInRecipesWith(preds ...predicate.Recipe) predicate.Product

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

func ID

func ID(id uuid.UUID) predicate.Product

ID filters vertices based on their ID field.

func IDEQ

func IDEQ(id uuid.UUID) predicate.Product

IDEQ applies the EQ predicate on the ID field.

func IDGT

func IDGT(id uuid.UUID) predicate.Product

IDGT applies the GT predicate on the ID field.

func IDGTE

func IDGTE(id uuid.UUID) predicate.Product

IDGTE applies the GTE predicate on the ID field.

func IDIn

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

IDIn applies the In predicate on the ID field.

func IDLT

func IDLT(id uuid.UUID) predicate.Product

IDLT applies the LT predicate on the ID field.

func IDLTE

func IDLTE(id uuid.UUID) predicate.Product

IDLTE applies the LTE predicate on the ID field.

func IDNEQ

func IDNEQ(id uuid.UUID) predicate.Product

IDNEQ applies the NEQ predicate on the ID field.

func IDNotIn

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

IDNotIn applies the NotIn predicate on the ID field.

func LocaleEQ

func LocaleEQ(v Locale) predicate.Product

LocaleEQ applies the EQ predicate on the "locale" field.

func LocaleIn

func LocaleIn(vs ...Locale) predicate.Product

LocaleIn applies the In predicate on the "locale" field.

func LocaleNEQ

func LocaleNEQ(v Locale) predicate.Product

LocaleNEQ applies the NEQ predicate on the "locale" field.

func LocaleNotIn

func LocaleNotIn(vs ...Locale) predicate.Product

LocaleNotIn applies the NotIn predicate on the "locale" field.

func LocaleValidator

func LocaleValidator(l Locale) error

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

func Name

func Name(v string) predicate.Product

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

func NameContains

func NameContains(v string) predicate.Product

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

func NameContainsFold

func NameContainsFold(v string) predicate.Product

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

func NameEQ

func NameEQ(v string) predicate.Product

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

func NameEqualFold

func NameEqualFold(v string) predicate.Product

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

func NameGT

func NameGT(v string) predicate.Product

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

func NameGTE

func NameGTE(v string) predicate.Product

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

func NameHasPrefix

func NameHasPrefix(v string) predicate.Product

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

func NameHasSuffix

func NameHasSuffix(v string) predicate.Product

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

func NameIn

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

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

func NameLT

func NameLT(v string) predicate.Product

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

func NameLTE

func NameLTE(v string) predicate.Product

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

func NameNEQ

func NameNEQ(v string) predicate.Product

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

func NameNotIn

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

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.Product) predicate.Product

Or groups predicates with the OR operator between them.

func Slug

func Slug(v string) predicate.Product

Slug applies equality check predicate on the "slug" field. It's identical to SlugEQ.

func SlugContains

func SlugContains(v string) predicate.Product

SlugContains applies the Contains predicate on the "slug" field.

func SlugContainsFold

func SlugContainsFold(v string) predicate.Product

SlugContainsFold applies the ContainsFold predicate on the "slug" field.

func SlugEQ

func SlugEQ(v string) predicate.Product

SlugEQ applies the EQ predicate on the "slug" field.

func SlugEqualFold

func SlugEqualFold(v string) predicate.Product

SlugEqualFold applies the EqualFold predicate on the "slug" field.

func SlugGT

func SlugGT(v string) predicate.Product

SlugGT applies the GT predicate on the "slug" field.

func SlugGTE

func SlugGTE(v string) predicate.Product

SlugGTE applies the GTE predicate on the "slug" field.

func SlugHasPrefix

func SlugHasPrefix(v string) predicate.Product

SlugHasPrefix applies the HasPrefix predicate on the "slug" field.

func SlugHasSuffix

func SlugHasSuffix(v string) predicate.Product

SlugHasSuffix applies the HasSuffix predicate on the "slug" field.

func SlugIn

func SlugIn(vs ...string) predicate.Product

SlugIn applies the In predicate on the "slug" field.

func SlugLT

func SlugLT(v string) predicate.Product

SlugLT applies the LT predicate on the "slug" field.

func SlugLTE

func SlugLTE(v string) predicate.Product

SlugLTE applies the LTE predicate on the "slug" field.

func SlugNEQ

func SlugNEQ(v string) predicate.Product

SlugNEQ applies the NEQ predicate on the "slug" field.

func SlugNotIn

func SlugNotIn(vs ...string) predicate.Product

SlugNotIn applies the NotIn predicate on the "slug" field.

func UpdateTime

func UpdateTime(v time.Time) predicate.Product

UpdateTime applies equality check predicate on the "update_time" field. It's identical to UpdateTimeEQ.

func UpdateTimeEQ

func UpdateTimeEQ(v time.Time) predicate.Product

UpdateTimeEQ applies the EQ predicate on the "update_time" field.

func UpdateTimeGT

func UpdateTimeGT(v time.Time) predicate.Product

UpdateTimeGT applies the GT predicate on the "update_time" field.

func UpdateTimeGTE

func UpdateTimeGTE(v time.Time) predicate.Product

UpdateTimeGTE applies the GTE predicate on the "update_time" field.

func UpdateTimeIn

func UpdateTimeIn(vs ...time.Time) predicate.Product

UpdateTimeIn applies the In predicate on the "update_time" field.

func UpdateTimeLT

func UpdateTimeLT(v time.Time) predicate.Product

UpdateTimeLT applies the LT predicate on the "update_time" field.

func UpdateTimeLTE

func UpdateTimeLTE(v time.Time) predicate.Product

UpdateTimeLTE applies the LTE predicate on the "update_time" field.

func UpdateTimeNEQ

func UpdateTimeNEQ(v time.Time) predicate.Product

UpdateTimeNEQ applies the NEQ predicate on the "update_time" field.

func UpdateTimeNotIn

func UpdateTimeNotIn(vs ...time.Time) predicate.Product

UpdateTimeNotIn applies the NotIn predicate on the "update_time" field.

func ValidColumn

func ValidColumn(column string) bool

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

Types

type Locale

type Locale string

Locale defines the type for the "locale" enum field.

const (
	LocaleEn Locale = "en"
	LocaleRu Locale = "ru"
)

Locale values.

func (Locale) String

func (l Locale) String() string

type OrderOption

type OrderOption func(*sql.Selector)

OrderOption defines the ordering options for the Product queries.

func ByCreateTime

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

ByCreateTime orders the results by the create_time field.

func ByID

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

ByID orders the results by the id field.

func ByIngredients

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

ByIngredients orders the results by ingredients terms.

func ByIngredientsCount

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

ByIngredientsCount orders the results by ingredients count.

func ByLocale

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

ByLocale orders the results by the locale field.

func ByName

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

ByName orders the results by the name field.

func ByRequiredInRecipes

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

ByRequiredInRecipes orders the results by required_in_recipes terms.

func ByRequiredInRecipesCount

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

ByRequiredInRecipesCount orders the results by required_in_recipes count.

func BySlug

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

BySlug orders the results by the slug field.

func ByUpdateTime

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

ByUpdateTime orders the results by the update_time field.

Jump to

Keyboard shortcuts

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