message

package
v0.17.0 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Label holds the string label denoting the message type in the database.
	Label = "message"
	// FieldID holds the string denoting the id field in the database.
	FieldID = "id"
	// FieldChatID holds the string denoting the chat_id field in the database.
	FieldChatID = "chat_id"
	// FieldAuthorType holds the string denoting the author_type field in the database.
	FieldAuthorType = "author_type"
	// FieldAuthorUserID holds the string denoting the author_user_id field in the database.
	FieldAuthorUserID = "author_user_id"
	// FieldContent holds the string denoting the content field in the database.
	FieldContent = "content"
	// FieldCreatedAt holds the string denoting the created_at field in the database.
	FieldCreatedAt = "created_at"
	// EdgeChat holds the string denoting the chat edge name in mutations.
	EdgeChat = "chat"
	// EdgeAuthor holds the string denoting the author edge name in mutations.
	EdgeAuthor = "author"
	// Table holds the table name of the message in the database.
	Table = "messages"
	// ChatTable is the table that holds the chat relation/edge.
	ChatTable = "messages"
	// ChatInverseTable is the table name for the Chat entity.
	// It exists in this package in order to avoid circular dependency with the "chat" package.
	ChatInverseTable = "chats"
	// ChatColumn is the table column denoting the chat relation/edge.
	ChatColumn = "chat_id"
	// AuthorTable is the table that holds the author relation/edge.
	AuthorTable = "messages"
	// 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_user_id"
)

Variables

View Source
var (
	// ContentValidator is a validator for the "content" field. It is called by the builders before save.
	ContentValidator func(string) error
	// DefaultCreatedAt holds the default value on creation for the "created_at" field.
	DefaultCreatedAt func() time.Time
	// DefaultID holds the default value on creation for the "id" field.
	DefaultID func() uuid.UUID
)

Columns holds all SQL columns for message fields.

Functions

func And

func And(predicates ...predicate.Message) predicate.Message

And groups predicates with the AND operator between them.

func AuthorTypeEQ

func AuthorTypeEQ(v AuthorType) predicate.Message

AuthorTypeEQ applies the EQ predicate on the "author_type" field.

func AuthorTypeIn

func AuthorTypeIn(vs ...AuthorType) predicate.Message

AuthorTypeIn applies the In predicate on the "author_type" field.

func AuthorTypeNEQ

func AuthorTypeNEQ(v AuthorType) predicate.Message

AuthorTypeNEQ applies the NEQ predicate on the "author_type" field.

func AuthorTypeNotIn

func AuthorTypeNotIn(vs ...AuthorType) predicate.Message

AuthorTypeNotIn applies the NotIn predicate on the "author_type" field.

func AuthorTypeValidator

func AuthorTypeValidator(at AuthorType) error

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

func AuthorUserID

func AuthorUserID(v uuid.UUID) predicate.Message

AuthorUserID applies equality check predicate on the "author_user_id" field. It's identical to AuthorUserIDEQ.

func AuthorUserIDEQ

func AuthorUserIDEQ(v uuid.UUID) predicate.Message

AuthorUserIDEQ applies the EQ predicate on the "author_user_id" field.

func AuthorUserIDIn

func AuthorUserIDIn(vs ...uuid.UUID) predicate.Message

AuthorUserIDIn applies the In predicate on the "author_user_id" field.

func AuthorUserIDIsNil

func AuthorUserIDIsNil() predicate.Message

AuthorUserIDIsNil applies the IsNil predicate on the "author_user_id" field.

func AuthorUserIDNEQ

func AuthorUserIDNEQ(v uuid.UUID) predicate.Message

AuthorUserIDNEQ applies the NEQ predicate on the "author_user_id" field.

func AuthorUserIDNotIn

func AuthorUserIDNotIn(vs ...uuid.UUID) predicate.Message

AuthorUserIDNotIn applies the NotIn predicate on the "author_user_id" field.

func AuthorUserIDNotNil

func AuthorUserIDNotNil() predicate.Message

AuthorUserIDNotNil applies the NotNil predicate on the "author_user_id" field.

func ChatID

func ChatID(v uuid.UUID) predicate.Message

ChatID applies equality check predicate on the "chat_id" field. It's identical to ChatIDEQ.

func ChatIDEQ

func ChatIDEQ(v uuid.UUID) predicate.Message

ChatIDEQ applies the EQ predicate on the "chat_id" field.

func ChatIDIn

func ChatIDIn(vs ...uuid.UUID) predicate.Message

ChatIDIn applies the In predicate on the "chat_id" field.

func ChatIDNEQ

func ChatIDNEQ(v uuid.UUID) predicate.Message

ChatIDNEQ applies the NEQ predicate on the "chat_id" field.

func ChatIDNotIn

func ChatIDNotIn(vs ...uuid.UUID) predicate.Message

ChatIDNotIn applies the NotIn predicate on the "chat_id" field.

func Content

func Content(v string) predicate.Message

Content applies equality check predicate on the "content" field. It's identical to ContentEQ.

func ContentContains

func ContentContains(v string) predicate.Message

ContentContains applies the Contains predicate on the "content" field.

func ContentContainsFold

func ContentContainsFold(v string) predicate.Message

ContentContainsFold applies the ContainsFold predicate on the "content" field.

func ContentEQ

func ContentEQ(v string) predicate.Message

ContentEQ applies the EQ predicate on the "content" field.

func ContentEqualFold

func ContentEqualFold(v string) predicate.Message

ContentEqualFold applies the EqualFold predicate on the "content" field.

func ContentGT

func ContentGT(v string) predicate.Message

ContentGT applies the GT predicate on the "content" field.

func ContentGTE

func ContentGTE(v string) predicate.Message

ContentGTE applies the GTE predicate on the "content" field.

func ContentHasPrefix

func ContentHasPrefix(v string) predicate.Message

ContentHasPrefix applies the HasPrefix predicate on the "content" field.

func ContentHasSuffix

func ContentHasSuffix(v string) predicate.Message

ContentHasSuffix applies the HasSuffix predicate on the "content" field.

func ContentIn

func ContentIn(vs ...string) predicate.Message

ContentIn applies the In predicate on the "content" field.

func ContentLT

func ContentLT(v string) predicate.Message

ContentLT applies the LT predicate on the "content" field.

func ContentLTE

func ContentLTE(v string) predicate.Message

ContentLTE applies the LTE predicate on the "content" field.

func ContentNEQ

func ContentNEQ(v string) predicate.Message

ContentNEQ applies the NEQ predicate on the "content" field.

func ContentNotIn

func ContentNotIn(vs ...string) predicate.Message

ContentNotIn applies the NotIn predicate on the "content" field.

func CreatedAt

func CreatedAt(v time.Time) predicate.Message

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

func CreatedAtEQ

func CreatedAtEQ(v time.Time) predicate.Message

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

func CreatedAtGT

func CreatedAtGT(v time.Time) predicate.Message

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

func CreatedAtGTE

func CreatedAtGTE(v time.Time) predicate.Message

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

func CreatedAtIn

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

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

func CreatedAtLT

func CreatedAtLT(v time.Time) predicate.Message

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

func CreatedAtLTE

func CreatedAtLTE(v time.Time) predicate.Message

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

func CreatedAtNEQ

func CreatedAtNEQ(v time.Time) predicate.Message

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

func CreatedAtNotIn

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

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

func HasAuthor

func HasAuthor() predicate.Message

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

func HasAuthorWith

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

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

func HasChat

func HasChat() predicate.Message

HasChat applies the HasEdge predicate on the "chat" edge.

func HasChatWith

func HasChatWith(preds ...predicate.Chat) predicate.Message

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

func ID

func ID(id uuid.UUID) predicate.Message

ID filters vertices based on their ID field.

func IDEQ

func IDEQ(id uuid.UUID) predicate.Message

IDEQ applies the EQ predicate on the ID field.

func IDGT

func IDGT(id uuid.UUID) predicate.Message

IDGT applies the GT predicate on the ID field.

func IDGTE

func IDGTE(id uuid.UUID) predicate.Message

IDGTE applies the GTE predicate on the ID field.

func IDIn

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

IDIn applies the In predicate on the ID field.

func IDLT

func IDLT(id uuid.UUID) predicate.Message

IDLT applies the LT predicate on the ID field.

func IDLTE

func IDLTE(id uuid.UUID) predicate.Message

IDLTE applies the LTE predicate on the ID field.

func IDNEQ

func IDNEQ(id uuid.UUID) predicate.Message

IDNEQ applies the NEQ predicate on the ID field.

func IDNotIn

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

IDNotIn applies the NotIn predicate on the ID field.

func Not

Not applies the not operator on the given predicate.

func Or

func Or(predicates ...predicate.Message) predicate.Message

Or groups predicates with the OR operator between them.

func ValidColumn

func ValidColumn(column string) bool

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

Types

type AuthorType

type AuthorType string

AuthorType defines the type for the "author_type" enum field.

const (
	AuthorTypeUser  AuthorType = "user"
	AuthorTypeAgent AuthorType = "agent"
)

AuthorType values.

func (AuthorType) String

func (at AuthorType) String() string

type OrderOption

type OrderOption func(*sql.Selector)

OrderOption defines the ordering options for the Message queries.

func ByAuthorField

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

ByAuthorField orders the results by author field.

func ByAuthorType

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

ByAuthorType orders the results by the author_type field.

func ByAuthorUserID

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

ByAuthorUserID orders the results by the author_user_id field.

func ByChatField

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

ByChatField orders the results by chat field.

func ByChatID

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

ByChatID orders the results by the chat_id field.

func ByContent

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

ByContent orders the results by the content 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.

Jump to

Keyboard shortcuts

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