post

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

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

Go to latest
Published: Apr 6, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Label holds the string label denoting the post type in the database.
	Label = "post"
	// FieldID holds the string denoting the id field in the database.
	FieldID = "id"
	// 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"
	// FieldText holds the string denoting the text field in the database.
	FieldText = "text"
	// FieldSlug holds the string denoting the slug field in the database.
	FieldSlug = "slug"
	// FieldAuthorID holds the string denoting the author_id field in the database.
	FieldAuthorID = "author_id"
	// FieldImageID holds the string denoting the image_id field in the database.
	FieldImageID = "image_id"
	// EdgeReactions holds the string denoting the reactions edge name in mutations.
	EdgeReactions = "reactions"
	// EdgeAuthor holds the string denoting the author edge name in mutations.
	EdgeAuthor = "author"
	// EdgeImage holds the string denoting the image edge name in mutations.
	EdgeImage = "image"
	// EdgeComments holds the string denoting the comments edge name in mutations.
	EdgeComments = "comments"
	// EdgeNotifications holds the string denoting the notifications edge name in mutations.
	EdgeNotifications = "notifications"
	// Table holds the table name of the post in the database.
	Table = "posts"
	// ReactionsTable is the table that holds the reactions relation/edge.
	ReactionsTable = "reactions"
	// ReactionsInverseTable is the table name for the Reaction entity.
	// It exists in this package in order to avoid circular dependency with the "reaction" package.
	ReactionsInverseTable = "reactions"
	// ReactionsColumn is the table column denoting the reactions relation/edge.
	ReactionsColumn = "post_id"
	// AuthorTable is the table that holds the author relation/edge.
	AuthorTable = "posts"
	// AuthorInverseTable is the table name for the User entity.
	// It exists in this package in order to avoid circular dependency with the "user" package.
	AuthorInverseTable = "users"
	// AuthorColumn is the table column denoting the author relation/edge.
	AuthorColumn = "author_id"
	// ImageTable is the table that holds the image relation/edge.
	ImageTable = "posts"
	// ImageInverseTable is the table name for the File entity.
	// It exists in this package in order to avoid circular dependency with the "file" package.
	ImageInverseTable = "files"
	// ImageColumn is the table column denoting the image relation/edge.
	ImageColumn = "image_id"
	// CommentsTable is the table that holds the comments relation/edge.
	CommentsTable = "comments"
	// CommentsInverseTable is the table name for the Comment entity.
	// It exists in this package in order to avoid circular dependency with the "comment" package.
	CommentsInverseTable = "comments"
	// CommentsColumn is the table column denoting the comments relation/edge.
	CommentsColumn = "post_id"
	// NotificationsTable is the table that holds the notifications relation/edge.
	NotificationsTable = "notifications"
	// NotificationsInverseTable is the table name for the Notification entity.
	// It exists in this package in order to avoid circular dependency with the "notification" package.
	NotificationsInverseTable = "notifications"
	// NotificationsColumn is the table column denoting the notifications relation/edge.
	NotificationsColumn = "post_id"
)

Variables

View Source
var (
	// 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
	// UpdateDefaultUpdatedAt holds the default value on update for the "updated_at" field.
	UpdateDefaultUpdatedAt func() time.Time
	// TextValidator is a validator for the "text" field. It is called by the builders before save.
	TextValidator 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 post fields.

Functions

func And

func And(predicates ...predicate.Post) predicate.Post

And groups predicates with the AND operator between them.

func AuthorID

func AuthorID(v uuid.UUID) predicate.Post

AuthorID applies equality check predicate on the "author_id" field. It's identical to AuthorIDEQ.

func AuthorIDEQ

func AuthorIDEQ(v uuid.UUID) predicate.Post

AuthorIDEQ applies the EQ predicate on the "author_id" field.

func AuthorIDIn

func AuthorIDIn(vs ...uuid.UUID) predicate.Post

AuthorIDIn applies the In predicate on the "author_id" field.

func AuthorIDNEQ

func AuthorIDNEQ(v uuid.UUID) predicate.Post

AuthorIDNEQ applies the NEQ predicate on the "author_id" field.

func AuthorIDNotIn

func AuthorIDNotIn(vs ...uuid.UUID) predicate.Post

AuthorIDNotIn applies the NotIn predicate on the "author_id" field.

func CreatedAt

func CreatedAt(v time.Time) predicate.Post

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

func CreatedAtEQ

func CreatedAtEQ(v time.Time) predicate.Post

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

func CreatedAtGT

func CreatedAtGT(v time.Time) predicate.Post

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

func CreatedAtGTE

func CreatedAtGTE(v time.Time) predicate.Post

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

func CreatedAtIn

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

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

func CreatedAtLT

func CreatedAtLT(v time.Time) predicate.Post

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

func CreatedAtLTE

func CreatedAtLTE(v time.Time) predicate.Post

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

func CreatedAtNEQ

func CreatedAtNEQ(v time.Time) predicate.Post

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

func CreatedAtNotIn

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

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

func HasAuthor

func HasAuthor() predicate.Post

HasAuthor applies the HasEdge predicate on the "author" edge.

func HasAuthorWith

func HasAuthorWith(preds ...predicate.User) predicate.Post

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

func HasComments

func HasComments() predicate.Post

HasComments applies the HasEdge predicate on the "comments" edge.

func HasCommentsWith

func HasCommentsWith(preds ...predicate.Comment) predicate.Post

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

func HasImage

func HasImage() predicate.Post

HasImage applies the HasEdge predicate on the "image" edge.

func HasImageWith

func HasImageWith(preds ...predicate.File) predicate.Post

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

func HasNotifications

func HasNotifications() predicate.Post

HasNotifications applies the HasEdge predicate on the "notifications" edge.

func HasNotificationsWith

func HasNotificationsWith(preds ...predicate.Notification) predicate.Post

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

func HasReactions

func HasReactions() predicate.Post

HasReactions applies the HasEdge predicate on the "reactions" edge.

func HasReactionsWith

func HasReactionsWith(preds ...predicate.Reaction) predicate.Post

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

func ID

func ID(id uuid.UUID) predicate.Post

ID filters vertices based on their ID field.

func IDEQ

func IDEQ(id uuid.UUID) predicate.Post

IDEQ applies the EQ predicate on the ID field.

func IDGT

func IDGT(id uuid.UUID) predicate.Post

IDGT applies the GT predicate on the ID field.

func IDGTE

func IDGTE(id uuid.UUID) predicate.Post

IDGTE applies the GTE predicate on the ID field.

func IDIn

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

IDIn applies the In predicate on the ID field.

func IDLT

func IDLT(id uuid.UUID) predicate.Post

IDLT applies the LT predicate on the ID field.

func IDLTE

func IDLTE(id uuid.UUID) predicate.Post

IDLTE applies the LTE predicate on the ID field.

func IDNEQ

func IDNEQ(id uuid.UUID) predicate.Post

IDNEQ applies the NEQ predicate on the ID field.

func IDNotIn

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

IDNotIn applies the NotIn predicate on the ID field.

func ImageID

func ImageID(v uuid.UUID) predicate.Post

ImageID applies equality check predicate on the "image_id" field. It's identical to ImageIDEQ.

func ImageIDEQ

func ImageIDEQ(v uuid.UUID) predicate.Post

ImageIDEQ applies the EQ predicate on the "image_id" field.

func ImageIDIn

func ImageIDIn(vs ...uuid.UUID) predicate.Post

ImageIDIn applies the In predicate on the "image_id" field.

func ImageIDIsNil

func ImageIDIsNil() predicate.Post

ImageIDIsNil applies the IsNil predicate on the "image_id" field.

func ImageIDNEQ

func ImageIDNEQ(v uuid.UUID) predicate.Post

ImageIDNEQ applies the NEQ predicate on the "image_id" field.

func ImageIDNotIn

func ImageIDNotIn(vs ...uuid.UUID) predicate.Post

ImageIDNotIn applies the NotIn predicate on the "image_id" field.

func ImageIDNotNil

func ImageIDNotNil() predicate.Post

ImageIDNotNil applies the NotNil predicate on the "image_id" field.

func Not

Not applies the not operator on the given predicate.

func Or

func Or(predicates ...predicate.Post) predicate.Post

Or groups predicates with the OR operator between them.

func Slug

func Slug(v string) predicate.Post

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

func SlugContains

func SlugContains(v string) predicate.Post

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

func SlugContainsFold

func SlugContainsFold(v string) predicate.Post

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

func SlugEQ

func SlugEQ(v string) predicate.Post

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

func SlugEqualFold

func SlugEqualFold(v string) predicate.Post

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

func SlugGT

func SlugGT(v string) predicate.Post

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

func SlugGTE

func SlugGTE(v string) predicate.Post

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

func SlugHasPrefix

func SlugHasPrefix(v string) predicate.Post

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

func SlugHasSuffix

func SlugHasSuffix(v string) predicate.Post

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

func SlugIn

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

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

func SlugLT

func SlugLT(v string) predicate.Post

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

func SlugLTE

func SlugLTE(v string) predicate.Post

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

func SlugNEQ

func SlugNEQ(v string) predicate.Post

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

func SlugNotIn

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

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

func Text

func Text(v string) predicate.Post

Text applies equality check predicate on the "text" field. It's identical to TextEQ.

func TextContains

func TextContains(v string) predicate.Post

TextContains applies the Contains predicate on the "text" field.

func TextContainsFold

func TextContainsFold(v string) predicate.Post

TextContainsFold applies the ContainsFold predicate on the "text" field.

func TextEQ

func TextEQ(v string) predicate.Post

TextEQ applies the EQ predicate on the "text" field.

func TextEqualFold

func TextEqualFold(v string) predicate.Post

TextEqualFold applies the EqualFold predicate on the "text" field.

func TextGT

func TextGT(v string) predicate.Post

TextGT applies the GT predicate on the "text" field.

func TextGTE

func TextGTE(v string) predicate.Post

TextGTE applies the GTE predicate on the "text" field.

func TextHasPrefix

func TextHasPrefix(v string) predicate.Post

TextHasPrefix applies the HasPrefix predicate on the "text" field.

func TextHasSuffix

func TextHasSuffix(v string) predicate.Post

TextHasSuffix applies the HasSuffix predicate on the "text" field.

func TextIn

func TextIn(vs ...string) predicate.Post

TextIn applies the In predicate on the "text" field.

func TextLT

func TextLT(v string) predicate.Post

TextLT applies the LT predicate on the "text" field.

func TextLTE

func TextLTE(v string) predicate.Post

TextLTE applies the LTE predicate on the "text" field.

func TextNEQ

func TextNEQ(v string) predicate.Post

TextNEQ applies the NEQ predicate on the "text" field.

func TextNotIn

func TextNotIn(vs ...string) predicate.Post

TextNotIn applies the NotIn predicate on the "text" field.

func UpdatedAt

func UpdatedAt(v time.Time) predicate.Post

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

func UpdatedAtEQ

func UpdatedAtEQ(v time.Time) predicate.Post

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

func UpdatedAtGT

func UpdatedAtGT(v time.Time) predicate.Post

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

func UpdatedAtGTE

func UpdatedAtGTE(v time.Time) predicate.Post

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

func UpdatedAtIn

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

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

func UpdatedAtLT

func UpdatedAtLT(v time.Time) predicate.Post

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

func UpdatedAtLTE

func UpdatedAtLTE(v time.Time) predicate.Post

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

func UpdatedAtNEQ

func UpdatedAtNEQ(v time.Time) predicate.Post

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

func UpdatedAtNotIn

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

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 Post queries.

func ByAuthorField

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

ByAuthorField orders the results by author field.

func ByAuthorID

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

ByAuthorID orders the results by the author_id field.

func ByComments

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

ByComments orders the results by comments terms.

func ByCommentsCount

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

ByCommentsCount orders the results by comments count.

func ByCreatedAt

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

ByCreatedAt orders the results by the created_at field.

func ByID

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

ByID orders the results by the id field.

func ByImageField

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

ByImageField orders the results by image field.

func ByImageID

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

ByImageID orders the results by the image_id field.

func ByNotifications

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

ByNotifications orders the results by notifications terms.

func ByNotificationsCount

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

ByNotificationsCount orders the results by notifications count.

func ByReactions

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

ByReactions orders the results by reactions terms.

func ByReactionsCount

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

ByReactionsCount orders the results by reactions count.

func BySlug

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

BySlug orders the results by the slug field.

func ByText

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

ByText orders the results by the text field.

func ByUpdatedAt

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

ByUpdatedAt orders the results by the updated_at field.

Jump to

Keyboard shortcuts

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