resource

package
v1.3.6 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2026 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Label holds the string label denoting the resource type in the database.
	Label = "resource"
	// 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"
	// FieldDescription holds the string denoting the description field in the database.
	FieldDescription = "description"
	// FieldCreatedAt holds the string denoting the created_at field in the database.
	FieldCreatedAt = "created_at"
	// FieldUpdateType holds the string denoting the update_type field in the database.
	FieldUpdateType = "update_type"
	// EdgeVersions holds the string denoting the versions edge name in mutations.
	EdgeVersions = "versions"
	// Table holds the table name of the resource in the database.
	Table = "resources"
	// VersionsTable is the table that holds the versions relation/edge.
	VersionsTable = "versions"
	// VersionsInverseTable is the table name for the Version entity.
	// It exists in this package in order to avoid circular dependency with the "version" package.
	VersionsInverseTable = "versions"
	// VersionsColumn is the table column denoting the versions relation/edge.
	VersionsColumn = "resource_versions"
)

Variables

View Source
var (
	// NameValidator is a validator for the "name" field. It is called by the builders before save.
	NameValidator func(string) error
	// DefaultCreatedAt holds the default value on creation for the "created_at" field.
	DefaultCreatedAt func() time.Time
	// DefaultUpdateType holds the default value on creation for the "update_type" field.
	DefaultUpdateType string
	// IDValidator is a validator for the "id" field. It is called by the builders before save.
	IDValidator func(string) error
)

Columns holds all SQL columns for resource fields.

Functions

func And

func And(predicates ...predicate.Resource) predicate.Resource

And groups predicates with the AND operator between them.

func CreatedAt

func CreatedAt(v time.Time) predicate.Resource

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

func CreatedAtEQ

func CreatedAtEQ(v time.Time) predicate.Resource

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

func CreatedAtGT

func CreatedAtGT(v time.Time) predicate.Resource

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

func CreatedAtGTE

func CreatedAtGTE(v time.Time) predicate.Resource

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

func CreatedAtIn

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

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

func CreatedAtLT

func CreatedAtLT(v time.Time) predicate.Resource

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

func CreatedAtLTE

func CreatedAtLTE(v time.Time) predicate.Resource

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

func CreatedAtNEQ

func CreatedAtNEQ(v time.Time) predicate.Resource

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

func CreatedAtNotIn

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

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

func Description

func Description(v string) predicate.Resource

Description applies equality check predicate on the "description" field. It's identical to DescriptionEQ.

func DescriptionContains

func DescriptionContains(v string) predicate.Resource

DescriptionContains applies the Contains predicate on the "description" field.

func DescriptionContainsFold

func DescriptionContainsFold(v string) predicate.Resource

DescriptionContainsFold applies the ContainsFold predicate on the "description" field.

func DescriptionEQ

func DescriptionEQ(v string) predicate.Resource

DescriptionEQ applies the EQ predicate on the "description" field.

func DescriptionEqualFold

func DescriptionEqualFold(v string) predicate.Resource

DescriptionEqualFold applies the EqualFold predicate on the "description" field.

func DescriptionGT

func DescriptionGT(v string) predicate.Resource

DescriptionGT applies the GT predicate on the "description" field.

func DescriptionGTE

func DescriptionGTE(v string) predicate.Resource

DescriptionGTE applies the GTE predicate on the "description" field.

func DescriptionHasPrefix

func DescriptionHasPrefix(v string) predicate.Resource

DescriptionHasPrefix applies the HasPrefix predicate on the "description" field.

func DescriptionHasSuffix

func DescriptionHasSuffix(v string) predicate.Resource

DescriptionHasSuffix applies the HasSuffix predicate on the "description" field.

func DescriptionIn

func DescriptionIn(vs ...string) predicate.Resource

DescriptionIn applies the In predicate on the "description" field.

func DescriptionLT

func DescriptionLT(v string) predicate.Resource

DescriptionLT applies the LT predicate on the "description" field.

func DescriptionLTE

func DescriptionLTE(v string) predicate.Resource

DescriptionLTE applies the LTE predicate on the "description" field.

func DescriptionNEQ

func DescriptionNEQ(v string) predicate.Resource

DescriptionNEQ applies the NEQ predicate on the "description" field.

func DescriptionNotIn

func DescriptionNotIn(vs ...string) predicate.Resource

DescriptionNotIn applies the NotIn predicate on the "description" field.

func HasVersions

func HasVersions() predicate.Resource

HasVersions applies the HasEdge predicate on the "versions" edge.

func HasVersionsWith

func HasVersionsWith(preds ...predicate.Version) predicate.Resource

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

func ID

func ID(id string) predicate.Resource

ID filters vertices based on their ID field.

func IDContainsFold added in v0.2.0

func IDContainsFold(id string) predicate.Resource

IDContainsFold applies the ContainsFold predicate on the ID field.

func IDEQ

func IDEQ(id string) predicate.Resource

IDEQ applies the EQ predicate on the ID field.

func IDEqualFold added in v0.2.0

func IDEqualFold(id string) predicate.Resource

IDEqualFold applies the EqualFold predicate on the ID field.

func IDGT

func IDGT(id string) predicate.Resource

IDGT applies the GT predicate on the ID field.

func IDGTE

func IDGTE(id string) predicate.Resource

IDGTE applies the GTE predicate on the ID field.

func IDIn

func IDIn(ids ...string) predicate.Resource

IDIn applies the In predicate on the ID field.

func IDLT

func IDLT(id string) predicate.Resource

IDLT applies the LT predicate on the ID field.

func IDLTE

func IDLTE(id string) predicate.Resource

IDLTE applies the LTE predicate on the ID field.

func IDNEQ

func IDNEQ(id string) predicate.Resource

IDNEQ applies the NEQ predicate on the ID field.

func IDNotIn

func IDNotIn(ids ...string) predicate.Resource

IDNotIn applies the NotIn predicate on the ID field.

func Name

func Name(v string) predicate.Resource

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

func NameContains

func NameContains(v string) predicate.Resource

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

func NameContainsFold

func NameContainsFold(v string) predicate.Resource

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

func NameEQ

func NameEQ(v string) predicate.Resource

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

func NameEqualFold

func NameEqualFold(v string) predicate.Resource

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

func NameGT

func NameGT(v string) predicate.Resource

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

func NameGTE

func NameGTE(v string) predicate.Resource

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

func NameHasPrefix

func NameHasPrefix(v string) predicate.Resource

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

func NameHasSuffix

func NameHasSuffix(v string) predicate.Resource

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

func NameIn

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

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

func NameLT

func NameLT(v string) predicate.Resource

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

func NameLTE

func NameLTE(v string) predicate.Resource

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

func NameNEQ

func NameNEQ(v string) predicate.Resource

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

func NameNotIn

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

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

Or groups predicates with the OR operator between them.

func UpdateType added in v0.5.1

func UpdateType(v string) predicate.Resource

UpdateType applies equality check predicate on the "update_type" field. It's identical to UpdateTypeEQ.

func UpdateTypeContains added in v0.5.1

func UpdateTypeContains(v string) predicate.Resource

UpdateTypeContains applies the Contains predicate on the "update_type" field.

func UpdateTypeContainsFold added in v0.5.1

func UpdateTypeContainsFold(v string) predicate.Resource

UpdateTypeContainsFold applies the ContainsFold predicate on the "update_type" field.

func UpdateTypeEQ added in v0.5.1

func UpdateTypeEQ(v string) predicate.Resource

UpdateTypeEQ applies the EQ predicate on the "update_type" field.

func UpdateTypeEqualFold added in v0.5.1

func UpdateTypeEqualFold(v string) predicate.Resource

UpdateTypeEqualFold applies the EqualFold predicate on the "update_type" field.

func UpdateTypeGT added in v0.5.1

func UpdateTypeGT(v string) predicate.Resource

UpdateTypeGT applies the GT predicate on the "update_type" field.

func UpdateTypeGTE added in v0.5.1

func UpdateTypeGTE(v string) predicate.Resource

UpdateTypeGTE applies the GTE predicate on the "update_type" field.

func UpdateTypeHasPrefix added in v0.5.1

func UpdateTypeHasPrefix(v string) predicate.Resource

UpdateTypeHasPrefix applies the HasPrefix predicate on the "update_type" field.

func UpdateTypeHasSuffix added in v0.5.1

func UpdateTypeHasSuffix(v string) predicate.Resource

UpdateTypeHasSuffix applies the HasSuffix predicate on the "update_type" field.

func UpdateTypeIn added in v0.5.1

func UpdateTypeIn(vs ...string) predicate.Resource

UpdateTypeIn applies the In predicate on the "update_type" field.

func UpdateTypeLT added in v0.5.1

func UpdateTypeLT(v string) predicate.Resource

UpdateTypeLT applies the LT predicate on the "update_type" field.

func UpdateTypeLTE added in v0.5.1

func UpdateTypeLTE(v string) predicate.Resource

UpdateTypeLTE applies the LTE predicate on the "update_type" field.

func UpdateTypeNEQ added in v0.5.1

func UpdateTypeNEQ(v string) predicate.Resource

UpdateTypeNEQ applies the NEQ predicate on the "update_type" field.

func UpdateTypeNotIn added in v0.5.1

func UpdateTypeNotIn(vs ...string) predicate.Resource

UpdateTypeNotIn applies the NotIn predicate on the "update_type" 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 Resource queries.

func ByCreatedAt

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

ByCreatedAt orders the results by the created_at field.

func ByDescription

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

ByDescription orders the results by the description field.

func ByID

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

ByID orders the results by the id field.

func ByName

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

ByName orders the results by the name field.

func ByUpdateType added in v0.5.1

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

ByUpdateType orders the results by the update_type field.

func ByVersions

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

ByVersions orders the results by versions terms.

func ByVersionsCount

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

ByVersionsCount orders the results by versions count.

Jump to

Keyboard shortcuts

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