notification

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: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Label holds the string label denoting the notification type in the database.
	Label = "notification"
	// 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"
	// FieldSenderID holds the string denoting the sender_id field in the database.
	FieldSenderID = "sender_id"
	// FieldNtype holds the string denoting the ntype field in the database.
	FieldNtype = "ntype"
	// FieldPostID holds the string denoting the post_id field in the database.
	FieldPostID = "post_id"
	// FieldCommentID holds the string denoting the comment_id field in the database.
	FieldCommentID = "comment_id"
	// FieldReplyID holds the string denoting the reply_id field in the database.
	FieldReplyID = "reply_id"
	// FieldText holds the string denoting the text field in the database.
	FieldText = "text"
	// EdgeSender holds the string denoting the sender edge name in mutations.
	EdgeSender = "sender"
	// EdgeReceivers holds the string denoting the receivers edge name in mutations.
	EdgeReceivers = "receivers"
	// EdgePost holds the string denoting the post edge name in mutations.
	EdgePost = "post"
	// EdgeComment holds the string denoting the comment edge name in mutations.
	EdgeComment = "comment"
	// EdgeReply holds the string denoting the reply edge name in mutations.
	EdgeReply = "reply"
	// EdgeReadBy holds the string denoting the read_by edge name in mutations.
	EdgeReadBy = "read_by"
	// Table holds the table name of the notification in the database.
	Table = "notifications"
	// SenderTable is the table that holds the sender relation/edge.
	SenderTable = "notifications"
	// SenderInverseTable is the table name for the User entity.
	// It exists in this package in order to avoid circular dependency with the "user" package.
	SenderInverseTable = "users"
	// SenderColumn is the table column denoting the sender relation/edge.
	SenderColumn = "sender_id"
	// ReceiversTable is the table that holds the receivers relation/edge. The primary key declared below.
	ReceiversTable = "user_notifications"
	// ReceiversInverseTable is the table name for the User entity.
	// It exists in this package in order to avoid circular dependency with the "user" package.
	ReceiversInverseTable = "users"
	// PostTable is the table that holds the post relation/edge.
	PostTable = "notifications"
	// PostInverseTable is the table name for the Post entity.
	// It exists in this package in order to avoid circular dependency with the "post" package.
	PostInverseTable = "posts"
	// PostColumn is the table column denoting the post relation/edge.
	PostColumn = "post_id"
	// CommentTable is the table that holds the comment relation/edge.
	CommentTable = "notifications"
	// CommentInverseTable is the table name for the Comment entity.
	// It exists in this package in order to avoid circular dependency with the "comment" package.
	CommentInverseTable = "comments"
	// CommentColumn is the table column denoting the comment relation/edge.
	CommentColumn = "comment_id"
	// ReplyTable is the table that holds the reply relation/edge.
	ReplyTable = "notifications"
	// ReplyInverseTable is the table name for the Reply entity.
	// It exists in this package in order to avoid circular dependency with the "reply" package.
	ReplyInverseTable = "replies"
	// ReplyColumn is the table column denoting the reply relation/edge.
	ReplyColumn = "reply_id"
	// ReadByTable is the table that holds the read_by relation/edge. The primary key declared below.
	ReadByTable = "user_notifications_read"
	// ReadByInverseTable is the table name for the User entity.
	// It exists in this package in order to avoid circular dependency with the "user" package.
	ReadByInverseTable = "users"
)

Variables

View Source
var (
	// ReceiversPrimaryKey and ReceiversColumn2 are the table columns denoting the
	// primary key for the receivers relation (M2M).
	ReceiversPrimaryKey = []string{"user_id", "notification_id"}
	// ReadByPrimaryKey and ReadByColumn2 are the table columns denoting the
	// primary key for the read_by relation (M2M).
	ReadByPrimaryKey = []string{"user_id", "notification_id"}
)
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
	// DefaultID holds the default value on creation for the "id" field.
	DefaultID func() uuid.UUID
)

Columns holds all SQL columns for notification fields.

Functions

func And

func And(predicates ...predicate.Notification) predicate.Notification

And groups predicates with the AND operator between them.

func CommentID

func CommentID(v uuid.UUID) predicate.Notification

CommentID applies equality check predicate on the "comment_id" field. It's identical to CommentIDEQ.

func CommentIDEQ

func CommentIDEQ(v uuid.UUID) predicate.Notification

CommentIDEQ applies the EQ predicate on the "comment_id" field.

func CommentIDIn

func CommentIDIn(vs ...uuid.UUID) predicate.Notification

CommentIDIn applies the In predicate on the "comment_id" field.

func CommentIDIsNil

func CommentIDIsNil() predicate.Notification

CommentIDIsNil applies the IsNil predicate on the "comment_id" field.

func CommentIDNEQ

func CommentIDNEQ(v uuid.UUID) predicate.Notification

CommentIDNEQ applies the NEQ predicate on the "comment_id" field.

func CommentIDNotIn

func CommentIDNotIn(vs ...uuid.UUID) predicate.Notification

CommentIDNotIn applies the NotIn predicate on the "comment_id" field.

func CommentIDNotNil

func CommentIDNotNil() predicate.Notification

CommentIDNotNil applies the NotNil predicate on the "comment_id" field.

func CreatedAt

func CreatedAt(v time.Time) predicate.Notification

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

func CreatedAtEQ

func CreatedAtEQ(v time.Time) predicate.Notification

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

func CreatedAtGT

func CreatedAtGT(v time.Time) predicate.Notification

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

func CreatedAtGTE

func CreatedAtGTE(v time.Time) predicate.Notification

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

func CreatedAtIn

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

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

func CreatedAtLT

func CreatedAtLT(v time.Time) predicate.Notification

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

func CreatedAtLTE

func CreatedAtLTE(v time.Time) predicate.Notification

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

func CreatedAtNEQ

func CreatedAtNEQ(v time.Time) predicate.Notification

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

func CreatedAtNotIn

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

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

func HasComment

func HasComment() predicate.Notification

HasComment applies the HasEdge predicate on the "comment" edge.

func HasCommentWith

func HasCommentWith(preds ...predicate.Comment) predicate.Notification

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

func HasPost

func HasPost() predicate.Notification

HasPost applies the HasEdge predicate on the "post" edge.

func HasPostWith

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

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

func HasReadBy

func HasReadBy() predicate.Notification

HasReadBy applies the HasEdge predicate on the "read_by" edge.

func HasReadByWith

func HasReadByWith(preds ...predicate.User) predicate.Notification

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

func HasReceivers

func HasReceivers() predicate.Notification

HasReceivers applies the HasEdge predicate on the "receivers" edge.

func HasReceiversWith

func HasReceiversWith(preds ...predicate.User) predicate.Notification

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

func HasReply

func HasReply() predicate.Notification

HasReply applies the HasEdge predicate on the "reply" edge.

func HasReplyWith

func HasReplyWith(preds ...predicate.Reply) predicate.Notification

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

func HasSender

func HasSender() predicate.Notification

HasSender applies the HasEdge predicate on the "sender" edge.

func HasSenderWith

func HasSenderWith(preds ...predicate.User) predicate.Notification

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

func ID

ID filters vertices based on their ID field.

func IDEQ

IDEQ applies the EQ predicate on the ID field.

func IDGT

IDGT applies the GT predicate on the ID field.

func IDGTE

func IDGTE(id uuid.UUID) predicate.Notification

IDGTE applies the GTE predicate on the ID field.

func IDIn

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

IDIn applies the In predicate on the ID field.

func IDLT

IDLT applies the LT predicate on the ID field.

func IDLTE

func IDLTE(id uuid.UUID) predicate.Notification

IDLTE applies the LTE predicate on the ID field.

func IDNEQ

func IDNEQ(id uuid.UUID) predicate.Notification

IDNEQ applies the NEQ predicate on the ID field.

func IDNotIn

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

IDNotIn applies the NotIn predicate on the ID field.

func Not

Not applies the not operator on the given predicate.

func NtypeEQ

func NtypeEQ(v Ntype) predicate.Notification

NtypeEQ applies the EQ predicate on the "ntype" field.

func NtypeIn

func NtypeIn(vs ...Ntype) predicate.Notification

NtypeIn applies the In predicate on the "ntype" field.

func NtypeNEQ

func NtypeNEQ(v Ntype) predicate.Notification

NtypeNEQ applies the NEQ predicate on the "ntype" field.

func NtypeNotIn

func NtypeNotIn(vs ...Ntype) predicate.Notification

NtypeNotIn applies the NotIn predicate on the "ntype" field.

func NtypeValidator

func NtypeValidator(n Ntype) error

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

func Or

func Or(predicates ...predicate.Notification) predicate.Notification

Or groups predicates with the OR operator between them.

func PostID

func PostID(v uuid.UUID) predicate.Notification

PostID applies equality check predicate on the "post_id" field. It's identical to PostIDEQ.

func PostIDEQ

func PostIDEQ(v uuid.UUID) predicate.Notification

PostIDEQ applies the EQ predicate on the "post_id" field.

func PostIDIn

func PostIDIn(vs ...uuid.UUID) predicate.Notification

PostIDIn applies the In predicate on the "post_id" field.

func PostIDIsNil

func PostIDIsNil() predicate.Notification

PostIDIsNil applies the IsNil predicate on the "post_id" field.

func PostIDNEQ

func PostIDNEQ(v uuid.UUID) predicate.Notification

PostIDNEQ applies the NEQ predicate on the "post_id" field.

func PostIDNotIn

func PostIDNotIn(vs ...uuid.UUID) predicate.Notification

PostIDNotIn applies the NotIn predicate on the "post_id" field.

func PostIDNotNil

func PostIDNotNil() predicate.Notification

PostIDNotNil applies the NotNil predicate on the "post_id" field.

func ReplyID

func ReplyID(v uuid.UUID) predicate.Notification

ReplyID applies equality check predicate on the "reply_id" field. It's identical to ReplyIDEQ.

func ReplyIDEQ

func ReplyIDEQ(v uuid.UUID) predicate.Notification

ReplyIDEQ applies the EQ predicate on the "reply_id" field.

func ReplyIDIn

func ReplyIDIn(vs ...uuid.UUID) predicate.Notification

ReplyIDIn applies the In predicate on the "reply_id" field.

func ReplyIDIsNil

func ReplyIDIsNil() predicate.Notification

ReplyIDIsNil applies the IsNil predicate on the "reply_id" field.

func ReplyIDNEQ

func ReplyIDNEQ(v uuid.UUID) predicate.Notification

ReplyIDNEQ applies the NEQ predicate on the "reply_id" field.

func ReplyIDNotIn

func ReplyIDNotIn(vs ...uuid.UUID) predicate.Notification

ReplyIDNotIn applies the NotIn predicate on the "reply_id" field.

func ReplyIDNotNil

func ReplyIDNotNil() predicate.Notification

ReplyIDNotNil applies the NotNil predicate on the "reply_id" field.

func SenderID

func SenderID(v uuid.UUID) predicate.Notification

SenderID applies equality check predicate on the "sender_id" field. It's identical to SenderIDEQ.

func SenderIDEQ

func SenderIDEQ(v uuid.UUID) predicate.Notification

SenderIDEQ applies the EQ predicate on the "sender_id" field.

func SenderIDIn

func SenderIDIn(vs ...uuid.UUID) predicate.Notification

SenderIDIn applies the In predicate on the "sender_id" field.

func SenderIDIsNil

func SenderIDIsNil() predicate.Notification

SenderIDIsNil applies the IsNil predicate on the "sender_id" field.

func SenderIDNEQ

func SenderIDNEQ(v uuid.UUID) predicate.Notification

SenderIDNEQ applies the NEQ predicate on the "sender_id" field.

func SenderIDNotIn

func SenderIDNotIn(vs ...uuid.UUID) predicate.Notification

SenderIDNotIn applies the NotIn predicate on the "sender_id" field.

func SenderIDNotNil

func SenderIDNotNil() predicate.Notification

SenderIDNotNil applies the NotNil predicate on the "sender_id" field.

func Text

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

func TextContains

func TextContains(v string) predicate.Notification

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

func TextContainsFold

func TextContainsFold(v string) predicate.Notification

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

func TextEQ

func TextEQ(v string) predicate.Notification

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

func TextEqualFold

func TextEqualFold(v string) predicate.Notification

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

func TextGT

func TextGT(v string) predicate.Notification

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

func TextGTE

func TextGTE(v string) predicate.Notification

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

func TextHasPrefix

func TextHasPrefix(v string) predicate.Notification

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

func TextHasSuffix

func TextHasSuffix(v string) predicate.Notification

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

func TextIn

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

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

func TextIsNil

func TextIsNil() predicate.Notification

TextIsNil applies the IsNil predicate on the "text" field.

func TextLT

func TextLT(v string) predicate.Notification

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

func TextLTE

func TextLTE(v string) predicate.Notification

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

func TextNEQ

func TextNEQ(v string) predicate.Notification

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

func TextNotIn

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

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

func TextNotNil

func TextNotNil() predicate.Notification

TextNotNil applies the NotNil predicate on the "text" field.

func UpdatedAt

func UpdatedAt(v time.Time) predicate.Notification

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

func UpdatedAtEQ

func UpdatedAtEQ(v time.Time) predicate.Notification

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

func UpdatedAtGT

func UpdatedAtGT(v time.Time) predicate.Notification

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

func UpdatedAtGTE

func UpdatedAtGTE(v time.Time) predicate.Notification

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

func UpdatedAtIn

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

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

func UpdatedAtLT

func UpdatedAtLT(v time.Time) predicate.Notification

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

func UpdatedAtLTE

func UpdatedAtLTE(v time.Time) predicate.Notification

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

func UpdatedAtNEQ

func UpdatedAtNEQ(v time.Time) predicate.Notification

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

func UpdatedAtNotIn

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

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 Ntype

type Ntype string

Ntype defines the type for the "ntype" enum field.

const (
	NtypeREACTION Ntype = "REACTION"
	NtypeCOMMENT  Ntype = "COMMENT"
	NtypeREPLY    Ntype = "REPLY"
	NtypeADMIN    Ntype = "ADMIN"
)

Ntype values.

func (Ntype) String

func (n Ntype) String() string

type OrderOption

type OrderOption func(*sql.Selector)

OrderOption defines the ordering options for the Notification queries.

func ByCommentField

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

ByCommentField orders the results by comment field.

func ByCommentID

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

ByCommentID orders the results by the comment_id field.

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 ByNtype

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

ByNtype orders the results by the ntype field.

func ByPostField

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

ByPostField orders the results by post field.

func ByPostID

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

ByPostID orders the results by the post_id field.

func ByReadBy

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

ByReadBy orders the results by read_by terms.

func ByReadByCount

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

ByReadByCount orders the results by read_by count.

func ByReceivers

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

ByReceivers orders the results by receivers terms.

func ByReceiversCount

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

ByReceiversCount orders the results by receivers count.

func ByReplyField

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

ByReplyField orders the results by reply field.

func ByReplyID

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

ByReplyID orders the results by the reply_id field.

func BySenderField

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

BySenderField orders the results by sender field.

func BySenderID

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

BySenderID orders the results by the sender_id 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