ent

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2022 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Operation types.
	OpCreate    = ent.OpCreate
	OpDelete    = ent.OpDelete
	OpDeleteOne = ent.OpDeleteOne
	OpUpdate    = ent.OpUpdate
	OpUpdateOne = ent.OpUpdateOne

	// Node types.
	TypeMailbox         = "Mailbox"
	TypeMailboxAttr     = "MailboxAttr"
	TypeMailboxFlag     = "MailboxFlag"
	TypeMailboxPermFlag = "MailboxPermFlag"
	TypeMessage         = "Message"
	TypeMessageFlag     = "MessageFlag"
	TypeUID             = "UID"
)

Variables

This section is empty.

Functions

func IsConstraintError

func IsConstraintError(err error) bool

IsConstraintError returns a boolean indicating whether the error is a constraint failure.

func IsNotFound

func IsNotFound(err error) bool

IsNotFound returns a boolean indicating whether the error is a not found error.

func IsNotLoaded

func IsNotLoaded(err error) bool

IsNotLoaded returns a boolean indicating whether the error is a not loaded error.

func IsNotSingular

func IsNotSingular(err error) bool

IsNotSingular returns a boolean indicating whether the error is a not singular error.

func IsValidationError

func IsValidationError(err error) bool

IsValidationError returns a boolean indicating whether the error is a validation error.

func MaskNotFound

func MaskNotFound(err error) error

MaskNotFound masks not found error.

func NewContext

func NewContext(parent context.Context, c *Client) context.Context

NewContext returns a new context with the given Client attached.

func NewTxContext

func NewTxContext(parent context.Context, tx *Tx) context.Context

NewTxContext returns a new context with the given Tx attached.

Types

type AggregateFunc

type AggregateFunc func(*sql.Selector) string

AggregateFunc applies an aggregation step on the group-by traversal/selector.

func As

As is a pseudo aggregation function for renaming another other functions with custom names. For example:

GroupBy(field1, field2).
Aggregate(ent.As(ent.Sum(field1), "sum_field1"), (ent.As(ent.Sum(field2), "sum_field2")).
Scan(ctx, &v)

func Count

func Count() AggregateFunc

Count applies the "count" aggregation function on each group.

func Max

func Max(field string) AggregateFunc

Max applies the "max" aggregation function on the given field of each group.

func Mean

func Mean(field string) AggregateFunc

Mean applies the "mean" aggregation function on the given field of each group.

func Min

func Min(field string) AggregateFunc

Min applies the "min" aggregation function on the given field of each group.

func Sum

func Sum(field string) AggregateFunc

Sum applies the "sum" aggregation function on the given field of each group.

type Client

type Client struct {

	// Schema is the client for creating, migrating and dropping schema.
	Schema *migrate.Schema
	// Mailbox is the client for interacting with the Mailbox builders.
	Mailbox *MailboxClient
	// MailboxAttr is the client for interacting with the MailboxAttr builders.
	MailboxAttr *MailboxAttrClient
	// MailboxFlag is the client for interacting with the MailboxFlag builders.
	MailboxFlag *MailboxFlagClient
	// MailboxPermFlag is the client for interacting with the MailboxPermFlag builders.
	MailboxPermFlag *MailboxPermFlagClient
	// Message is the client for interacting with the Message builders.
	Message *MessageClient
	// MessageFlag is the client for interacting with the MessageFlag builders.
	MessageFlag *MessageFlagClient
	// UID is the client for interacting with the UID builders.
	UID *UIDClient
	// contains filtered or unexported fields
}

Client is the client that holds all ent builders.

func FromContext

func FromContext(ctx context.Context) *Client

FromContext returns a Client stored inside a context, or nil if there isn't one.

func NewClient

func NewClient(opts ...Option) *Client

NewClient creates a new client configured with the given options.

func Open

func Open(driverName, dataSourceName string, options ...Option) (*Client, error)

Open opens a database/sql.DB specified by the driver name and the data source name, and returns a new client attached to it. Optional parameters can be added for configuring the client.

func (*Client) BeginTx

func (c *Client) BeginTx(ctx context.Context, opts *sql.TxOptions) (*Tx, error)

BeginTx returns a transactional client with specified options.

func (*Client) Close

func (c *Client) Close() error

Close closes the database connection and prevents new queries from starting.

func (*Client) Debug

func (c *Client) Debug() *Client

Debug returns a new debug-client. It's used to get verbose logging on specific operations.

client.Debug().
	Mailbox.
	Query().
	Count(ctx)

func (*Client) Tx

func (c *Client) Tx(ctx context.Context) (*Tx, error)

Tx returns a new transactional client. The provided context is used until the transaction is committed or rolled back.

func (*Client) Use

func (c *Client) Use(hooks ...Hook)

Use adds the mutation hooks to all the entity clients. In order to add hooks to a specific client, call: `client.Node.Use(...)`.

type CommitFunc

type CommitFunc func(context.Context, *Tx) error

The CommitFunc type is an adapter to allow the use of ordinary function as a Committer. If f is a function with the appropriate signature, CommitFunc(f) is a Committer that calls f.

func (CommitFunc) Commit

func (f CommitFunc) Commit(ctx context.Context, tx *Tx) error

Commit calls f(ctx, m).

type CommitHook

type CommitHook func(Committer) Committer

CommitHook defines the "commit middleware". A function that gets a Committer and returns a Committer. For example:

hook := func(next ent.Committer) ent.Committer {
	return ent.CommitFunc(func(ctx context.Context, tx *ent.Tx) error {
		// Do some stuff before.
		if err := next.Commit(ctx, tx); err != nil {
			return err
		}
		// Do some stuff after.
		return nil
	})
}

type Committer

type Committer interface {
	Commit(context.Context, *Tx) error
}

Committer is the interface that wraps the Commit method.

type ConstraintError

type ConstraintError struct {
	// contains filtered or unexported fields
}

ConstraintError returns when trying to create/update one or more entities and one or more of their constraints failed. For example, violation of edge or field uniqueness.

func (ConstraintError) Error

func (e ConstraintError) Error() string

Error implements the error interface.

func (*ConstraintError) Unwrap

func (e *ConstraintError) Unwrap() error

Unwrap implements the errors.Wrapper interface.

type Hook

type Hook = ent.Hook

ent aliases to avoid import conflicts in user's code.

type Mailbox

type Mailbox struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// MailboxID holds the value of the "MailboxID" field.
	MailboxID string `json:"MailboxID,omitempty"`
	// Name holds the value of the "Name" field.
	Name string `json:"Name,omitempty"`
	// UIDNext holds the value of the "UIDNext" field.
	UIDNext int `json:"UIDNext,omitempty"`
	// UIDValidity holds the value of the "UIDValidity" field.
	UIDValidity int `json:"UIDValidity,omitempty"`
	// Subscribed holds the value of the "Subscribed" field.
	Subscribed bool `json:"Subscribed,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the MailboxQuery when eager-loading is set.
	Edges MailboxEdges `json:"edges"`
	// contains filtered or unexported fields
}

Mailbox is the model entity for the Mailbox schema.

func (*Mailbox) QueryAttributes

func (m *Mailbox) QueryAttributes() *MailboxAttrQuery

QueryAttributes queries the "attributes" edge of the Mailbox entity.

func (*Mailbox) QueryFlags

func (m *Mailbox) QueryFlags() *MailboxFlagQuery

QueryFlags queries the "flags" edge of the Mailbox entity.

func (*Mailbox) QueryPermanentFlags

func (m *Mailbox) QueryPermanentFlags() *MailboxPermFlagQuery

QueryPermanentFlags queries the "permanent_flags" edge of the Mailbox entity.

func (*Mailbox) QueryUIDs

func (m *Mailbox) QueryUIDs() *UIDQuery

QueryUIDs queries the "UIDs" edge of the Mailbox entity.

func (*Mailbox) String

func (m *Mailbox) String() string

String implements the fmt.Stringer.

func (*Mailbox) Unwrap

func (m *Mailbox) Unwrap() *Mailbox

Unwrap unwraps the Mailbox entity that was returned from a transaction after it was closed, so that all future queries will be executed through the driver which created the transaction.

func (*Mailbox) Update

func (m *Mailbox) Update() *MailboxUpdateOne

Update returns a builder for updating this Mailbox. Note that you need to call Mailbox.Unwrap() before calling this method if this Mailbox was returned from a transaction, and the transaction was committed or rolled back.

type MailboxAttr

type MailboxAttr struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// Value holds the value of the "Value" field.
	Value string `json:"Value,omitempty"`
	// contains filtered or unexported fields
}

MailboxAttr is the model entity for the MailboxAttr schema.

func (*MailboxAttr) String

func (ma *MailboxAttr) String() string

String implements the fmt.Stringer.

func (*MailboxAttr) Unwrap

func (ma *MailboxAttr) Unwrap() *MailboxAttr

Unwrap unwraps the MailboxAttr entity that was returned from a transaction after it was closed, so that all future queries will be executed through the driver which created the transaction.

func (*MailboxAttr) Update

func (ma *MailboxAttr) Update() *MailboxAttrUpdateOne

Update returns a builder for updating this MailboxAttr. Note that you need to call MailboxAttr.Unwrap() before calling this method if this MailboxAttr was returned from a transaction, and the transaction was committed or rolled back.

type MailboxAttrClient

type MailboxAttrClient struct {
	// contains filtered or unexported fields
}

MailboxAttrClient is a client for the MailboxAttr schema.

func NewMailboxAttrClient

func NewMailboxAttrClient(c config) *MailboxAttrClient

NewMailboxAttrClient returns a client for the MailboxAttr from the given config.

func (*MailboxAttrClient) Create

func (c *MailboxAttrClient) Create() *MailboxAttrCreate

Create returns a create builder for MailboxAttr.

func (*MailboxAttrClient) CreateBulk

func (c *MailboxAttrClient) CreateBulk(builders ...*MailboxAttrCreate) *MailboxAttrCreateBulk

CreateBulk returns a builder for creating a bulk of MailboxAttr entities.

func (*MailboxAttrClient) Delete

func (c *MailboxAttrClient) Delete() *MailboxAttrDelete

Delete returns a delete builder for MailboxAttr.

func (*MailboxAttrClient) DeleteOne

DeleteOne returns a delete builder for the given entity.

func (*MailboxAttrClient) DeleteOneID

func (c *MailboxAttrClient) DeleteOneID(id int) *MailboxAttrDeleteOne

DeleteOneID returns a delete builder for the given id.

func (*MailboxAttrClient) Get

func (c *MailboxAttrClient) Get(ctx context.Context, id int) (*MailboxAttr, error)

Get returns a MailboxAttr entity by its id.

func (*MailboxAttrClient) GetX

func (c *MailboxAttrClient) GetX(ctx context.Context, id int) *MailboxAttr

GetX is like Get, but panics if an error occurs.

func (*MailboxAttrClient) Hooks

func (c *MailboxAttrClient) Hooks() []Hook

Hooks returns the client hooks.

func (*MailboxAttrClient) Query

func (c *MailboxAttrClient) Query() *MailboxAttrQuery

Query returns a query builder for MailboxAttr.

func (*MailboxAttrClient) Update

func (c *MailboxAttrClient) Update() *MailboxAttrUpdate

Update returns an update builder for MailboxAttr.

func (*MailboxAttrClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*MailboxAttrClient) UpdateOneID

func (c *MailboxAttrClient) UpdateOneID(id int) *MailboxAttrUpdateOne

UpdateOneID returns an update builder for the given id.

func (*MailboxAttrClient) Use

func (c *MailboxAttrClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `mailboxattr.Hooks(f(g(h())))`.

type MailboxAttrCreate

type MailboxAttrCreate struct {
	// contains filtered or unexported fields
}

MailboxAttrCreate is the builder for creating a MailboxAttr entity.

func (*MailboxAttrCreate) Exec

func (mac *MailboxAttrCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*MailboxAttrCreate) ExecX

func (mac *MailboxAttrCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*MailboxAttrCreate) Mutation

func (mac *MailboxAttrCreate) Mutation() *MailboxAttrMutation

Mutation returns the MailboxAttrMutation object of the builder.

func (*MailboxAttrCreate) Save

func (mac *MailboxAttrCreate) Save(ctx context.Context) (*MailboxAttr, error)

Save creates the MailboxAttr in the database.

func (*MailboxAttrCreate) SaveX

func (mac *MailboxAttrCreate) SaveX(ctx context.Context) *MailboxAttr

SaveX calls Save and panics if Save returns an error.

func (*MailboxAttrCreate) SetValue

func (mac *MailboxAttrCreate) SetValue(s string) *MailboxAttrCreate

SetValue sets the "Value" field.

type MailboxAttrCreateBulk

type MailboxAttrCreateBulk struct {
	// contains filtered or unexported fields
}

MailboxAttrCreateBulk is the builder for creating many MailboxAttr entities in bulk.

func (*MailboxAttrCreateBulk) Exec

func (macb *MailboxAttrCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*MailboxAttrCreateBulk) ExecX

func (macb *MailboxAttrCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*MailboxAttrCreateBulk) Save

func (macb *MailboxAttrCreateBulk) Save(ctx context.Context) ([]*MailboxAttr, error)

Save creates the MailboxAttr entities in the database.

func (*MailboxAttrCreateBulk) SaveX

func (macb *MailboxAttrCreateBulk) SaveX(ctx context.Context) []*MailboxAttr

SaveX is like Save, but panics if an error occurs.

type MailboxAttrDelete

type MailboxAttrDelete struct {
	// contains filtered or unexported fields
}

MailboxAttrDelete is the builder for deleting a MailboxAttr entity.

func (*MailboxAttrDelete) Exec

func (mad *MailboxAttrDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*MailboxAttrDelete) ExecX

func (mad *MailboxAttrDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*MailboxAttrDelete) Where

Where appends a list predicates to the MailboxAttrDelete builder.

type MailboxAttrDeleteOne

type MailboxAttrDeleteOne struct {
	// contains filtered or unexported fields
}

MailboxAttrDeleteOne is the builder for deleting a single MailboxAttr entity.

func (*MailboxAttrDeleteOne) Exec

func (mado *MailboxAttrDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*MailboxAttrDeleteOne) ExecX

func (mado *MailboxAttrDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

type MailboxAttrGroupBy

type MailboxAttrGroupBy struct {
	// contains filtered or unexported fields
}

MailboxAttrGroupBy is the group-by builder for MailboxAttr entities.

func (*MailboxAttrGroupBy) Aggregate

func (magb *MailboxAttrGroupBy) Aggregate(fns ...AggregateFunc) *MailboxAttrGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*MailboxAttrGroupBy) Bool

func (magb *MailboxAttrGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a group-by query. It is only allowed when executing a group-by query with one field.

func (*MailboxAttrGroupBy) BoolX

func (magb *MailboxAttrGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*MailboxAttrGroupBy) Bools

func (magb *MailboxAttrGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from group-by. It is only allowed when executing a group-by query with one field.

func (*MailboxAttrGroupBy) BoolsX

func (magb *MailboxAttrGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*MailboxAttrGroupBy) Float64

func (magb *MailboxAttrGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a group-by query. It is only allowed when executing a group-by query with one field.

func (*MailboxAttrGroupBy) Float64X

func (magb *MailboxAttrGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*MailboxAttrGroupBy) Float64s

func (magb *MailboxAttrGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from group-by. It is only allowed when executing a group-by query with one field.

func (*MailboxAttrGroupBy) Float64sX

func (magb *MailboxAttrGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*MailboxAttrGroupBy) Int

func (magb *MailboxAttrGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a group-by query. It is only allowed when executing a group-by query with one field.

func (*MailboxAttrGroupBy) IntX

func (magb *MailboxAttrGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*MailboxAttrGroupBy) Ints

func (magb *MailboxAttrGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from group-by. It is only allowed when executing a group-by query with one field.

func (*MailboxAttrGroupBy) IntsX

func (magb *MailboxAttrGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*MailboxAttrGroupBy) Scan

func (magb *MailboxAttrGroupBy) Scan(ctx context.Context, v interface{}) error

Scan applies the group-by query and scans the result into the given value.

func (*MailboxAttrGroupBy) ScanX

func (magb *MailboxAttrGroupBy) ScanX(ctx context.Context, v interface{})

ScanX is like Scan, but panics if an error occurs.

func (*MailboxAttrGroupBy) String

func (magb *MailboxAttrGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a group-by query. It is only allowed when executing a group-by query with one field.

func (*MailboxAttrGroupBy) StringX

func (magb *MailboxAttrGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*MailboxAttrGroupBy) Strings

func (magb *MailboxAttrGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from group-by. It is only allowed when executing a group-by query with one field.

func (*MailboxAttrGroupBy) StringsX

func (magb *MailboxAttrGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type MailboxAttrMutation

type MailboxAttrMutation struct {
	// contains filtered or unexported fields
}

MailboxAttrMutation represents an operation that mutates the MailboxAttr nodes in the graph.

func (*MailboxAttrMutation) AddField

func (m *MailboxAttrMutation) AddField(name string, value ent.Value) error

AddField adds the value to the field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*MailboxAttrMutation) AddedEdges

func (m *MailboxAttrMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*MailboxAttrMutation) AddedField

func (m *MailboxAttrMutation) AddedField(name string) (ent.Value, bool)

AddedField returns the numeric value that was incremented/decremented on a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*MailboxAttrMutation) AddedFields

func (m *MailboxAttrMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*MailboxAttrMutation) AddedIDs

func (m *MailboxAttrMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*MailboxAttrMutation) ClearEdge

func (m *MailboxAttrMutation) ClearEdge(name string) error

ClearEdge clears the value of the edge with the given name. It returns an error if that edge is not defined in the schema.

func (*MailboxAttrMutation) ClearField

func (m *MailboxAttrMutation) ClearField(name string) error

ClearField clears the value of the field with the given name. It returns an error if the field is not defined in the schema.

func (*MailboxAttrMutation) ClearedEdges

func (m *MailboxAttrMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*MailboxAttrMutation) ClearedFields

func (m *MailboxAttrMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (MailboxAttrMutation) Client

func (m MailboxAttrMutation) Client() *Client

Client returns a new `ent.Client` from the mutation. If the mutation was executed in a transaction (ent.Tx), a transactional client is returned.

func (*MailboxAttrMutation) EdgeCleared

func (m *MailboxAttrMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*MailboxAttrMutation) Field

func (m *MailboxAttrMutation) Field(name string) (ent.Value, bool)

Field returns the value of a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*MailboxAttrMutation) FieldCleared

func (m *MailboxAttrMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*MailboxAttrMutation) Fields

func (m *MailboxAttrMutation) Fields() []string

Fields returns all fields that were changed during this mutation. Note that in order to get all numeric fields that were incremented/decremented, call AddedFields().

func (*MailboxAttrMutation) ID

func (m *MailboxAttrMutation) ID() (id int, exists bool)

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.

func (*MailboxAttrMutation) IDs

func (m *MailboxAttrMutation) IDs(ctx context.Context) ([]int, error)

IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.

func (*MailboxAttrMutation) OldField

func (m *MailboxAttrMutation) OldField(ctx context.Context, name string) (ent.Value, error)

OldField returns the old value of the field from the database. An error is returned if the mutation operation is not UpdateOne, or the query to the database failed.

func (*MailboxAttrMutation) OldValue

func (m *MailboxAttrMutation) OldValue(ctx context.Context) (v string, err error)

OldValue returns the old "Value" field's value of the MailboxAttr entity. If the MailboxAttr object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*MailboxAttrMutation) Op

func (m *MailboxAttrMutation) Op() Op

Op returns the operation name.

func (*MailboxAttrMutation) RemovedEdges

func (m *MailboxAttrMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*MailboxAttrMutation) RemovedIDs

func (m *MailboxAttrMutation) RemovedIDs(name string) []ent.Value

RemovedIDs returns all IDs (to other nodes) that were removed for the edge with the given name in this mutation.

func (*MailboxAttrMutation) ResetEdge

func (m *MailboxAttrMutation) ResetEdge(name string) error

ResetEdge resets all changes to the edge with the given name in this mutation. It returns an error if the edge is not defined in the schema.

func (*MailboxAttrMutation) ResetField

func (m *MailboxAttrMutation) ResetField(name string) error

ResetField resets all changes in the mutation for the field with the given name. It returns an error if the field is not defined in the schema.

func (*MailboxAttrMutation) ResetValue

func (m *MailboxAttrMutation) ResetValue()

ResetValue resets all changes to the "Value" field.

func (*MailboxAttrMutation) SetField

func (m *MailboxAttrMutation) SetField(name string, value ent.Value) error

SetField sets the value of a field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*MailboxAttrMutation) SetValue

func (m *MailboxAttrMutation) SetValue(s string)

SetValue sets the "Value" field.

func (MailboxAttrMutation) Tx

func (m MailboxAttrMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*MailboxAttrMutation) Type

func (m *MailboxAttrMutation) Type() string

Type returns the node type of this mutation (MailboxAttr).

func (*MailboxAttrMutation) Value

func (m *MailboxAttrMutation) Value() (r string, exists bool)

Value returns the value of the "Value" field in the mutation.

func (*MailboxAttrMutation) Where

func (m *MailboxAttrMutation) Where(ps ...predicate.MailboxAttr)

Where appends a list predicates to the MailboxAttrMutation builder.

type MailboxAttrQuery

type MailboxAttrQuery struct {
	// contains filtered or unexported fields
}

MailboxAttrQuery is the builder for querying MailboxAttr entities.

func (*MailboxAttrQuery) All

func (maq *MailboxAttrQuery) All(ctx context.Context) ([]*MailboxAttr, error)

All executes the query and returns a list of MailboxAttrs.

func (*MailboxAttrQuery) AllX

func (maq *MailboxAttrQuery) AllX(ctx context.Context) []*MailboxAttr

AllX is like All, but panics if an error occurs.

func (*MailboxAttrQuery) Clone

func (maq *MailboxAttrQuery) Clone() *MailboxAttrQuery

Clone returns a duplicate of the MailboxAttrQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*MailboxAttrQuery) Count

func (maq *MailboxAttrQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*MailboxAttrQuery) CountX

func (maq *MailboxAttrQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*MailboxAttrQuery) Exist

func (maq *MailboxAttrQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*MailboxAttrQuery) ExistX

func (maq *MailboxAttrQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*MailboxAttrQuery) First

func (maq *MailboxAttrQuery) First(ctx context.Context) (*MailboxAttr, error)

First returns the first MailboxAttr entity from the query. Returns a *NotFoundError when no MailboxAttr was found.

func (*MailboxAttrQuery) FirstID

func (maq *MailboxAttrQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first MailboxAttr ID from the query. Returns a *NotFoundError when no MailboxAttr ID was found.

func (*MailboxAttrQuery) FirstIDX

func (maq *MailboxAttrQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*MailboxAttrQuery) FirstX

func (maq *MailboxAttrQuery) FirstX(ctx context.Context) *MailboxAttr

FirstX is like First, but panics if an error occurs.

func (*MailboxAttrQuery) GroupBy

func (maq *MailboxAttrQuery) GroupBy(field string, fields ...string) *MailboxAttrGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

Example:

var v []struct {
	Value string `json:"Value,omitempty"`
	Count int `json:"count,omitempty"`
}

client.MailboxAttr.Query().
	GroupBy(mailboxattr.FieldValue).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*MailboxAttrQuery) IDs

func (maq *MailboxAttrQuery) IDs(ctx context.Context) ([]int, error)

IDs executes the query and returns a list of MailboxAttr IDs.

func (*MailboxAttrQuery) IDsX

func (maq *MailboxAttrQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*MailboxAttrQuery) Limit

func (maq *MailboxAttrQuery) Limit(limit int) *MailboxAttrQuery

Limit adds a limit step to the query.

func (*MailboxAttrQuery) Offset

func (maq *MailboxAttrQuery) Offset(offset int) *MailboxAttrQuery

Offset adds an offset step to the query.

func (*MailboxAttrQuery) Only

func (maq *MailboxAttrQuery) Only(ctx context.Context) (*MailboxAttr, error)

Only returns a single MailboxAttr entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one MailboxAttr entity is found. Returns a *NotFoundError when no MailboxAttr entities are found.

func (*MailboxAttrQuery) OnlyID

func (maq *MailboxAttrQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only MailboxAttr ID in the query. Returns a *NotSingularError when more than one MailboxAttr ID is found. Returns a *NotFoundError when no entities are found.

func (*MailboxAttrQuery) OnlyIDX

func (maq *MailboxAttrQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*MailboxAttrQuery) OnlyX

func (maq *MailboxAttrQuery) OnlyX(ctx context.Context) *MailboxAttr

OnlyX is like Only, but panics if an error occurs.

func (*MailboxAttrQuery) Order

func (maq *MailboxAttrQuery) Order(o ...OrderFunc) *MailboxAttrQuery

Order adds an order step to the query.

func (*MailboxAttrQuery) Select

func (maq *MailboxAttrQuery) Select(fields ...string) *MailboxAttrSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	Value string `json:"Value,omitempty"`
}

client.MailboxAttr.Query().
	Select(mailboxattr.FieldValue).
	Scan(ctx, &v)

func (*MailboxAttrQuery) Unique

func (maq *MailboxAttrQuery) Unique(unique bool) *MailboxAttrQuery

Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.

func (*MailboxAttrQuery) Where

Where adds a new predicate for the MailboxAttrQuery builder.

type MailboxAttrSelect

type MailboxAttrSelect struct {
	*MailboxAttrQuery
	// contains filtered or unexported fields
}

MailboxAttrSelect is the builder for selecting fields of MailboxAttr entities.

func (*MailboxAttrSelect) Bool

func (mas *MailboxAttrSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*MailboxAttrSelect) BoolX

func (mas *MailboxAttrSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*MailboxAttrSelect) Bools

func (mas *MailboxAttrSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*MailboxAttrSelect) BoolsX

func (mas *MailboxAttrSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*MailboxAttrSelect) Float64

func (mas *MailboxAttrSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*MailboxAttrSelect) Float64X

func (mas *MailboxAttrSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*MailboxAttrSelect) Float64s

func (mas *MailboxAttrSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*MailboxAttrSelect) Float64sX

func (mas *MailboxAttrSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*MailboxAttrSelect) Int

func (mas *MailboxAttrSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*MailboxAttrSelect) IntX

func (mas *MailboxAttrSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*MailboxAttrSelect) Ints

func (mas *MailboxAttrSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*MailboxAttrSelect) IntsX

func (mas *MailboxAttrSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*MailboxAttrSelect) Scan

func (mas *MailboxAttrSelect) Scan(ctx context.Context, v interface{}) error

Scan applies the selector query and scans the result into the given value.

func (*MailboxAttrSelect) ScanX

func (mas *MailboxAttrSelect) ScanX(ctx context.Context, v interface{})

ScanX is like Scan, but panics if an error occurs.

func (*MailboxAttrSelect) String

func (mas *MailboxAttrSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*MailboxAttrSelect) StringX

func (mas *MailboxAttrSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*MailboxAttrSelect) Strings

func (mas *MailboxAttrSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*MailboxAttrSelect) StringsX

func (mas *MailboxAttrSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type MailboxAttrUpdate

type MailboxAttrUpdate struct {
	// contains filtered or unexported fields
}

MailboxAttrUpdate is the builder for updating MailboxAttr entities.

func (*MailboxAttrUpdate) Exec

func (mau *MailboxAttrUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*MailboxAttrUpdate) ExecX

func (mau *MailboxAttrUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*MailboxAttrUpdate) Mutation

func (mau *MailboxAttrUpdate) Mutation() *MailboxAttrMutation

Mutation returns the MailboxAttrMutation object of the builder.

func (*MailboxAttrUpdate) Save

func (mau *MailboxAttrUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*MailboxAttrUpdate) SaveX

func (mau *MailboxAttrUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*MailboxAttrUpdate) SetValue

func (mau *MailboxAttrUpdate) SetValue(s string) *MailboxAttrUpdate

SetValue sets the "Value" field.

func (*MailboxAttrUpdate) Where

Where appends a list predicates to the MailboxAttrUpdate builder.

type MailboxAttrUpdateOne

type MailboxAttrUpdateOne struct {
	// contains filtered or unexported fields
}

MailboxAttrUpdateOne is the builder for updating a single MailboxAttr entity.

func (*MailboxAttrUpdateOne) Exec

func (mauo *MailboxAttrUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*MailboxAttrUpdateOne) ExecX

func (mauo *MailboxAttrUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*MailboxAttrUpdateOne) Mutation

func (mauo *MailboxAttrUpdateOne) Mutation() *MailboxAttrMutation

Mutation returns the MailboxAttrMutation object of the builder.

func (*MailboxAttrUpdateOne) Save

Save executes the query and returns the updated MailboxAttr entity.

func (*MailboxAttrUpdateOne) SaveX

func (mauo *MailboxAttrUpdateOne) SaveX(ctx context.Context) *MailboxAttr

SaveX is like Save, but panics if an error occurs.

func (*MailboxAttrUpdateOne) Select

func (mauo *MailboxAttrUpdateOne) Select(field string, fields ...string) *MailboxAttrUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*MailboxAttrUpdateOne) SetValue

SetValue sets the "Value" field.

type MailboxAttrs

type MailboxAttrs []*MailboxAttr

MailboxAttrs is a parsable slice of MailboxAttr.

type MailboxClient

type MailboxClient struct {
	// contains filtered or unexported fields
}

MailboxClient is a client for the Mailbox schema.

func NewMailboxClient

func NewMailboxClient(c config) *MailboxClient

NewMailboxClient returns a client for the Mailbox from the given config.

func (*MailboxClient) Create

func (c *MailboxClient) Create() *MailboxCreate

Create returns a create builder for Mailbox.

func (*MailboxClient) CreateBulk

func (c *MailboxClient) CreateBulk(builders ...*MailboxCreate) *MailboxCreateBulk

CreateBulk returns a builder for creating a bulk of Mailbox entities.

func (*MailboxClient) Delete

func (c *MailboxClient) Delete() *MailboxDelete

Delete returns a delete builder for Mailbox.

func (*MailboxClient) DeleteOne

func (c *MailboxClient) DeleteOne(m *Mailbox) *MailboxDeleteOne

DeleteOne returns a delete builder for the given entity.

func (*MailboxClient) DeleteOneID

func (c *MailboxClient) DeleteOneID(id int) *MailboxDeleteOne

DeleteOneID returns a delete builder for the given id.

func (*MailboxClient) Get

func (c *MailboxClient) Get(ctx context.Context, id int) (*Mailbox, error)

Get returns a Mailbox entity by its id.

func (*MailboxClient) GetX

func (c *MailboxClient) GetX(ctx context.Context, id int) *Mailbox

GetX is like Get, but panics if an error occurs.

func (*MailboxClient) Hooks

func (c *MailboxClient) Hooks() []Hook

Hooks returns the client hooks.

func (*MailboxClient) Query

func (c *MailboxClient) Query() *MailboxQuery

Query returns a query builder for Mailbox.

func (*MailboxClient) QueryAttributes

func (c *MailboxClient) QueryAttributes(m *Mailbox) *MailboxAttrQuery

QueryAttributes queries the attributes edge of a Mailbox.

func (*MailboxClient) QueryFlags

func (c *MailboxClient) QueryFlags(m *Mailbox) *MailboxFlagQuery

QueryFlags queries the flags edge of a Mailbox.

func (*MailboxClient) QueryPermanentFlags

func (c *MailboxClient) QueryPermanentFlags(m *Mailbox) *MailboxPermFlagQuery

QueryPermanentFlags queries the permanent_flags edge of a Mailbox.

func (*MailboxClient) QueryUIDs

func (c *MailboxClient) QueryUIDs(m *Mailbox) *UIDQuery

QueryUIDs queries the UIDs edge of a Mailbox.

func (*MailboxClient) Update

func (c *MailboxClient) Update() *MailboxUpdate

Update returns an update builder for Mailbox.

func (*MailboxClient) UpdateOne

func (c *MailboxClient) UpdateOne(m *Mailbox) *MailboxUpdateOne

UpdateOne returns an update builder for the given entity.

func (*MailboxClient) UpdateOneID

func (c *MailboxClient) UpdateOneID(id int) *MailboxUpdateOne

UpdateOneID returns an update builder for the given id.

func (*MailboxClient) Use

func (c *MailboxClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `mailbox.Hooks(f(g(h())))`.

type MailboxCreate

type MailboxCreate struct {
	// contains filtered or unexported fields
}

MailboxCreate is the builder for creating a Mailbox entity.

func (*MailboxCreate) AddAttributeIDs

func (mc *MailboxCreate) AddAttributeIDs(ids ...int) *MailboxCreate

AddAttributeIDs adds the "attributes" edge to the MailboxAttr entity by IDs.

func (*MailboxCreate) AddAttributes

func (mc *MailboxCreate) AddAttributes(m ...*MailboxAttr) *MailboxCreate

AddAttributes adds the "attributes" edges to the MailboxAttr entity.

func (*MailboxCreate) AddFlagIDs

func (mc *MailboxCreate) AddFlagIDs(ids ...int) *MailboxCreate

AddFlagIDs adds the "flags" edge to the MailboxFlag entity by IDs.

func (*MailboxCreate) AddFlags

func (mc *MailboxCreate) AddFlags(m ...*MailboxFlag) *MailboxCreate

AddFlags adds the "flags" edges to the MailboxFlag entity.

func (*MailboxCreate) AddPermanentFlagIDs

func (mc *MailboxCreate) AddPermanentFlagIDs(ids ...int) *MailboxCreate

AddPermanentFlagIDs adds the "permanent_flags" edge to the MailboxPermFlag entity by IDs.

func (*MailboxCreate) AddPermanentFlags

func (mc *MailboxCreate) AddPermanentFlags(m ...*MailboxPermFlag) *MailboxCreate

AddPermanentFlags adds the "permanent_flags" edges to the MailboxPermFlag entity.

func (*MailboxCreate) AddUIDIDs

func (mc *MailboxCreate) AddUIDIDs(ids ...int) *MailboxCreate

AddUIDIDs adds the "UIDs" edge to the UID entity by IDs.

func (*MailboxCreate) AddUIDs

func (mc *MailboxCreate) AddUIDs(u ...*UID) *MailboxCreate

AddUIDs adds the "UIDs" edges to the UID entity.

func (*MailboxCreate) Exec

func (mc *MailboxCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*MailboxCreate) ExecX

func (mc *MailboxCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*MailboxCreate) Mutation

func (mc *MailboxCreate) Mutation() *MailboxMutation

Mutation returns the MailboxMutation object of the builder.

func (*MailboxCreate) Save

func (mc *MailboxCreate) Save(ctx context.Context) (*Mailbox, error)

Save creates the Mailbox in the database.

func (*MailboxCreate) SaveX

func (mc *MailboxCreate) SaveX(ctx context.Context) *Mailbox

SaveX calls Save and panics if Save returns an error.

func (*MailboxCreate) SetMailboxID

func (mc *MailboxCreate) SetMailboxID(s string) *MailboxCreate

SetMailboxID sets the "MailboxID" field.

func (*MailboxCreate) SetName

func (mc *MailboxCreate) SetName(s string) *MailboxCreate

SetName sets the "Name" field.

func (*MailboxCreate) SetNillableSubscribed

func (mc *MailboxCreate) SetNillableSubscribed(b *bool) *MailboxCreate

SetNillableSubscribed sets the "Subscribed" field if the given value is not nil.

func (*MailboxCreate) SetNillableUIDNext

func (mc *MailboxCreate) SetNillableUIDNext(i *int) *MailboxCreate

SetNillableUIDNext sets the "UIDNext" field if the given value is not nil.

func (*MailboxCreate) SetNillableUIDValidity

func (mc *MailboxCreate) SetNillableUIDValidity(i *int) *MailboxCreate

SetNillableUIDValidity sets the "UIDValidity" field if the given value is not nil.

func (*MailboxCreate) SetSubscribed

func (mc *MailboxCreate) SetSubscribed(b bool) *MailboxCreate

SetSubscribed sets the "Subscribed" field.

func (*MailboxCreate) SetUIDNext

func (mc *MailboxCreate) SetUIDNext(i int) *MailboxCreate

SetUIDNext sets the "UIDNext" field.

func (*MailboxCreate) SetUIDValidity

func (mc *MailboxCreate) SetUIDValidity(i int) *MailboxCreate

SetUIDValidity sets the "UIDValidity" field.

type MailboxCreateBulk

type MailboxCreateBulk struct {
	// contains filtered or unexported fields
}

MailboxCreateBulk is the builder for creating many Mailbox entities in bulk.

func (*MailboxCreateBulk) Exec

func (mcb *MailboxCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*MailboxCreateBulk) ExecX

func (mcb *MailboxCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*MailboxCreateBulk) Save

func (mcb *MailboxCreateBulk) Save(ctx context.Context) ([]*Mailbox, error)

Save creates the Mailbox entities in the database.

func (*MailboxCreateBulk) SaveX

func (mcb *MailboxCreateBulk) SaveX(ctx context.Context) []*Mailbox

SaveX is like Save, but panics if an error occurs.

type MailboxDelete

type MailboxDelete struct {
	// contains filtered or unexported fields
}

MailboxDelete is the builder for deleting a Mailbox entity.

func (*MailboxDelete) Exec

func (md *MailboxDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*MailboxDelete) ExecX

func (md *MailboxDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*MailboxDelete) Where

func (md *MailboxDelete) Where(ps ...predicate.Mailbox) *MailboxDelete

Where appends a list predicates to the MailboxDelete builder.

type MailboxDeleteOne

type MailboxDeleteOne struct {
	// contains filtered or unexported fields
}

MailboxDeleteOne is the builder for deleting a single Mailbox entity.

func (*MailboxDeleteOne) Exec

func (mdo *MailboxDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*MailboxDeleteOne) ExecX

func (mdo *MailboxDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

type MailboxEdges

type MailboxEdges struct {
	// UIDs holds the value of the UIDs edge.
	UIDs []*UID `json:"UIDs,omitempty"`
	// Flags holds the value of the flags edge.
	Flags []*MailboxFlag `json:"flags,omitempty"`
	// PermanentFlags holds the value of the permanent_flags edge.
	PermanentFlags []*MailboxPermFlag `json:"permanent_flags,omitempty"`
	// Attributes holds the value of the attributes edge.
	Attributes []*MailboxAttr `json:"attributes,omitempty"`
	// contains filtered or unexported fields
}

MailboxEdges holds the relations/edges for other nodes in the graph.

func (MailboxEdges) AttributesOrErr

func (e MailboxEdges) AttributesOrErr() ([]*MailboxAttr, error)

AttributesOrErr returns the Attributes value or an error if the edge was not loaded in eager-loading.

func (MailboxEdges) FlagsOrErr

func (e MailboxEdges) FlagsOrErr() ([]*MailboxFlag, error)

FlagsOrErr returns the Flags value or an error if the edge was not loaded in eager-loading.

func (MailboxEdges) PermanentFlagsOrErr

func (e MailboxEdges) PermanentFlagsOrErr() ([]*MailboxPermFlag, error)

PermanentFlagsOrErr returns the PermanentFlags value or an error if the edge was not loaded in eager-loading.

func (MailboxEdges) UIDsOrErr

func (e MailboxEdges) UIDsOrErr() ([]*UID, error)

UIDsOrErr returns the UIDs value or an error if the edge was not loaded in eager-loading.

type MailboxFlag

type MailboxFlag struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// Value holds the value of the "Value" field.
	Value string `json:"Value,omitempty"`
	// contains filtered or unexported fields
}

MailboxFlag is the model entity for the MailboxFlag schema.

func (*MailboxFlag) String

func (mf *MailboxFlag) String() string

String implements the fmt.Stringer.

func (*MailboxFlag) Unwrap

func (mf *MailboxFlag) Unwrap() *MailboxFlag

Unwrap unwraps the MailboxFlag entity that was returned from a transaction after it was closed, so that all future queries will be executed through the driver which created the transaction.

func (*MailboxFlag) Update

func (mf *MailboxFlag) Update() *MailboxFlagUpdateOne

Update returns a builder for updating this MailboxFlag. Note that you need to call MailboxFlag.Unwrap() before calling this method if this MailboxFlag was returned from a transaction, and the transaction was committed or rolled back.

type MailboxFlagClient

type MailboxFlagClient struct {
	// contains filtered or unexported fields
}

MailboxFlagClient is a client for the MailboxFlag schema.

func NewMailboxFlagClient

func NewMailboxFlagClient(c config) *MailboxFlagClient

NewMailboxFlagClient returns a client for the MailboxFlag from the given config.

func (*MailboxFlagClient) Create

func (c *MailboxFlagClient) Create() *MailboxFlagCreate

Create returns a create builder for MailboxFlag.

func (*MailboxFlagClient) CreateBulk

func (c *MailboxFlagClient) CreateBulk(builders ...*MailboxFlagCreate) *MailboxFlagCreateBulk

CreateBulk returns a builder for creating a bulk of MailboxFlag entities.

func (*MailboxFlagClient) Delete

func (c *MailboxFlagClient) Delete() *MailboxFlagDelete

Delete returns a delete builder for MailboxFlag.

func (*MailboxFlagClient) DeleteOne

DeleteOne returns a delete builder for the given entity.

func (*MailboxFlagClient) DeleteOneID

func (c *MailboxFlagClient) DeleteOneID(id int) *MailboxFlagDeleteOne

DeleteOneID returns a delete builder for the given id.

func (*MailboxFlagClient) Get

func (c *MailboxFlagClient) Get(ctx context.Context, id int) (*MailboxFlag, error)

Get returns a MailboxFlag entity by its id.

func (*MailboxFlagClient) GetX

func (c *MailboxFlagClient) GetX(ctx context.Context, id int) *MailboxFlag

GetX is like Get, but panics if an error occurs.

func (*MailboxFlagClient) Hooks

func (c *MailboxFlagClient) Hooks() []Hook

Hooks returns the client hooks.

func (*MailboxFlagClient) Query

func (c *MailboxFlagClient) Query() *MailboxFlagQuery

Query returns a query builder for MailboxFlag.

func (*MailboxFlagClient) Update

func (c *MailboxFlagClient) Update() *MailboxFlagUpdate

Update returns an update builder for MailboxFlag.

func (*MailboxFlagClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*MailboxFlagClient) UpdateOneID

func (c *MailboxFlagClient) UpdateOneID(id int) *MailboxFlagUpdateOne

UpdateOneID returns an update builder for the given id.

func (*MailboxFlagClient) Use

func (c *MailboxFlagClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `mailboxflag.Hooks(f(g(h())))`.

type MailboxFlagCreate

type MailboxFlagCreate struct {
	// contains filtered or unexported fields
}

MailboxFlagCreate is the builder for creating a MailboxFlag entity.

func (*MailboxFlagCreate) Exec

func (mfc *MailboxFlagCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*MailboxFlagCreate) ExecX

func (mfc *MailboxFlagCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*MailboxFlagCreate) Mutation

func (mfc *MailboxFlagCreate) Mutation() *MailboxFlagMutation

Mutation returns the MailboxFlagMutation object of the builder.

func (*MailboxFlagCreate) Save

func (mfc *MailboxFlagCreate) Save(ctx context.Context) (*MailboxFlag, error)

Save creates the MailboxFlag in the database.

func (*MailboxFlagCreate) SaveX

func (mfc *MailboxFlagCreate) SaveX(ctx context.Context) *MailboxFlag

SaveX calls Save and panics if Save returns an error.

func (*MailboxFlagCreate) SetValue

func (mfc *MailboxFlagCreate) SetValue(s string) *MailboxFlagCreate

SetValue sets the "Value" field.

type MailboxFlagCreateBulk

type MailboxFlagCreateBulk struct {
	// contains filtered or unexported fields
}

MailboxFlagCreateBulk is the builder for creating many MailboxFlag entities in bulk.

func (*MailboxFlagCreateBulk) Exec

func (mfcb *MailboxFlagCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*MailboxFlagCreateBulk) ExecX

func (mfcb *MailboxFlagCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*MailboxFlagCreateBulk) Save

func (mfcb *MailboxFlagCreateBulk) Save(ctx context.Context) ([]*MailboxFlag, error)

Save creates the MailboxFlag entities in the database.

func (*MailboxFlagCreateBulk) SaveX

func (mfcb *MailboxFlagCreateBulk) SaveX(ctx context.Context) []*MailboxFlag

SaveX is like Save, but panics if an error occurs.

type MailboxFlagDelete

type MailboxFlagDelete struct {
	// contains filtered or unexported fields
}

MailboxFlagDelete is the builder for deleting a MailboxFlag entity.

func (*MailboxFlagDelete) Exec

func (mfd *MailboxFlagDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*MailboxFlagDelete) ExecX

func (mfd *MailboxFlagDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*MailboxFlagDelete) Where

Where appends a list predicates to the MailboxFlagDelete builder.

type MailboxFlagDeleteOne

type MailboxFlagDeleteOne struct {
	// contains filtered or unexported fields
}

MailboxFlagDeleteOne is the builder for deleting a single MailboxFlag entity.

func (*MailboxFlagDeleteOne) Exec

func (mfdo *MailboxFlagDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*MailboxFlagDeleteOne) ExecX

func (mfdo *MailboxFlagDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

type MailboxFlagGroupBy

type MailboxFlagGroupBy struct {
	// contains filtered or unexported fields
}

MailboxFlagGroupBy is the group-by builder for MailboxFlag entities.

func (*MailboxFlagGroupBy) Aggregate

func (mfgb *MailboxFlagGroupBy) Aggregate(fns ...AggregateFunc) *MailboxFlagGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*MailboxFlagGroupBy) Bool

func (mfgb *MailboxFlagGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a group-by query. It is only allowed when executing a group-by query with one field.

func (*MailboxFlagGroupBy) BoolX

func (mfgb *MailboxFlagGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*MailboxFlagGroupBy) Bools

func (mfgb *MailboxFlagGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from group-by. It is only allowed when executing a group-by query with one field.

func (*MailboxFlagGroupBy) BoolsX

func (mfgb *MailboxFlagGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*MailboxFlagGroupBy) Float64

func (mfgb *MailboxFlagGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a group-by query. It is only allowed when executing a group-by query with one field.

func (*MailboxFlagGroupBy) Float64X

func (mfgb *MailboxFlagGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*MailboxFlagGroupBy) Float64s

func (mfgb *MailboxFlagGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from group-by. It is only allowed when executing a group-by query with one field.

func (*MailboxFlagGroupBy) Float64sX

func (mfgb *MailboxFlagGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*MailboxFlagGroupBy) Int

func (mfgb *MailboxFlagGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a group-by query. It is only allowed when executing a group-by query with one field.

func (*MailboxFlagGroupBy) IntX

func (mfgb *MailboxFlagGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*MailboxFlagGroupBy) Ints

func (mfgb *MailboxFlagGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from group-by. It is only allowed when executing a group-by query with one field.

func (*MailboxFlagGroupBy) IntsX

func (mfgb *MailboxFlagGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*MailboxFlagGroupBy) Scan

func (mfgb *MailboxFlagGroupBy) Scan(ctx context.Context, v interface{}) error

Scan applies the group-by query and scans the result into the given value.

func (*MailboxFlagGroupBy) ScanX

func (mfgb *MailboxFlagGroupBy) ScanX(ctx context.Context, v interface{})

ScanX is like Scan, but panics if an error occurs.

func (*MailboxFlagGroupBy) String

func (mfgb *MailboxFlagGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a group-by query. It is only allowed when executing a group-by query with one field.

func (*MailboxFlagGroupBy) StringX

func (mfgb *MailboxFlagGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*MailboxFlagGroupBy) Strings

func (mfgb *MailboxFlagGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from group-by. It is only allowed when executing a group-by query with one field.

func (*MailboxFlagGroupBy) StringsX

func (mfgb *MailboxFlagGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type MailboxFlagMutation

type MailboxFlagMutation struct {
	// contains filtered or unexported fields
}

MailboxFlagMutation represents an operation that mutates the MailboxFlag nodes in the graph.

func (*MailboxFlagMutation) AddField

func (m *MailboxFlagMutation) AddField(name string, value ent.Value) error

AddField adds the value to the field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*MailboxFlagMutation) AddedEdges

func (m *MailboxFlagMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*MailboxFlagMutation) AddedField

func (m *MailboxFlagMutation) AddedField(name string) (ent.Value, bool)

AddedField returns the numeric value that was incremented/decremented on a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*MailboxFlagMutation) AddedFields

func (m *MailboxFlagMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*MailboxFlagMutation) AddedIDs

func (m *MailboxFlagMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*MailboxFlagMutation) ClearEdge

func (m *MailboxFlagMutation) ClearEdge(name string) error

ClearEdge clears the value of the edge with the given name. It returns an error if that edge is not defined in the schema.

func (*MailboxFlagMutation) ClearField

func (m *MailboxFlagMutation) ClearField(name string) error

ClearField clears the value of the field with the given name. It returns an error if the field is not defined in the schema.

func (*MailboxFlagMutation) ClearedEdges

func (m *MailboxFlagMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*MailboxFlagMutation) ClearedFields

func (m *MailboxFlagMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (MailboxFlagMutation) Client

func (m MailboxFlagMutation) Client() *Client

Client returns a new `ent.Client` from the mutation. If the mutation was executed in a transaction (ent.Tx), a transactional client is returned.

func (*MailboxFlagMutation) EdgeCleared

func (m *MailboxFlagMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*MailboxFlagMutation) Field

func (m *MailboxFlagMutation) Field(name string) (ent.Value, bool)

Field returns the value of a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*MailboxFlagMutation) FieldCleared

func (m *MailboxFlagMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*MailboxFlagMutation) Fields

func (m *MailboxFlagMutation) Fields() []string

Fields returns all fields that were changed during this mutation. Note that in order to get all numeric fields that were incremented/decremented, call AddedFields().

func (*MailboxFlagMutation) ID

func (m *MailboxFlagMutation) ID() (id int, exists bool)

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.

func (*MailboxFlagMutation) IDs

func (m *MailboxFlagMutation) IDs(ctx context.Context) ([]int, error)

IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.

func (*MailboxFlagMutation) OldField

func (m *MailboxFlagMutation) OldField(ctx context.Context, name string) (ent.Value, error)

OldField returns the old value of the field from the database. An error is returned if the mutation operation is not UpdateOne, or the query to the database failed.

func (*MailboxFlagMutation) OldValue

func (m *MailboxFlagMutation) OldValue(ctx context.Context) (v string, err error)

OldValue returns the old "Value" field's value of the MailboxFlag entity. If the MailboxFlag object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*MailboxFlagMutation) Op

func (m *MailboxFlagMutation) Op() Op

Op returns the operation name.

func (*MailboxFlagMutation) RemovedEdges

func (m *MailboxFlagMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*MailboxFlagMutation) RemovedIDs

func (m *MailboxFlagMutation) RemovedIDs(name string) []ent.Value

RemovedIDs returns all IDs (to other nodes) that were removed for the edge with the given name in this mutation.

func (*MailboxFlagMutation) ResetEdge

func (m *MailboxFlagMutation) ResetEdge(name string) error

ResetEdge resets all changes to the edge with the given name in this mutation. It returns an error if the edge is not defined in the schema.

func (*MailboxFlagMutation) ResetField

func (m *MailboxFlagMutation) ResetField(name string) error

ResetField resets all changes in the mutation for the field with the given name. It returns an error if the field is not defined in the schema.

func (*MailboxFlagMutation) ResetValue

func (m *MailboxFlagMutation) ResetValue()

ResetValue resets all changes to the "Value" field.

func (*MailboxFlagMutation) SetField

func (m *MailboxFlagMutation) SetField(name string, value ent.Value) error

SetField sets the value of a field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*MailboxFlagMutation) SetValue

func (m *MailboxFlagMutation) SetValue(s string)

SetValue sets the "Value" field.

func (MailboxFlagMutation) Tx

func (m MailboxFlagMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*MailboxFlagMutation) Type

func (m *MailboxFlagMutation) Type() string

Type returns the node type of this mutation (MailboxFlag).

func (*MailboxFlagMutation) Value

func (m *MailboxFlagMutation) Value() (r string, exists bool)

Value returns the value of the "Value" field in the mutation.

func (*MailboxFlagMutation) Where

func (m *MailboxFlagMutation) Where(ps ...predicate.MailboxFlag)

Where appends a list predicates to the MailboxFlagMutation builder.

type MailboxFlagQuery

type MailboxFlagQuery struct {
	// contains filtered or unexported fields
}

MailboxFlagQuery is the builder for querying MailboxFlag entities.

func (*MailboxFlagQuery) All

func (mfq *MailboxFlagQuery) All(ctx context.Context) ([]*MailboxFlag, error)

All executes the query and returns a list of MailboxFlags.

func (*MailboxFlagQuery) AllX

func (mfq *MailboxFlagQuery) AllX(ctx context.Context) []*MailboxFlag

AllX is like All, but panics if an error occurs.

func (*MailboxFlagQuery) Clone

func (mfq *MailboxFlagQuery) Clone() *MailboxFlagQuery

Clone returns a duplicate of the MailboxFlagQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*MailboxFlagQuery) Count

func (mfq *MailboxFlagQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*MailboxFlagQuery) CountX

func (mfq *MailboxFlagQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*MailboxFlagQuery) Exist

func (mfq *MailboxFlagQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*MailboxFlagQuery) ExistX

func (mfq *MailboxFlagQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*MailboxFlagQuery) First

func (mfq *MailboxFlagQuery) First(ctx context.Context) (*MailboxFlag, error)

First returns the first MailboxFlag entity from the query. Returns a *NotFoundError when no MailboxFlag was found.

func (*MailboxFlagQuery) FirstID

func (mfq *MailboxFlagQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first MailboxFlag ID from the query. Returns a *NotFoundError when no MailboxFlag ID was found.

func (*MailboxFlagQuery) FirstIDX

func (mfq *MailboxFlagQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*MailboxFlagQuery) FirstX

func (mfq *MailboxFlagQuery) FirstX(ctx context.Context) *MailboxFlag

FirstX is like First, but panics if an error occurs.

func (*MailboxFlagQuery) GroupBy

func (mfq *MailboxFlagQuery) GroupBy(field string, fields ...string) *MailboxFlagGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

Example:

var v []struct {
	Value string `json:"Value,omitempty"`
	Count int `json:"count,omitempty"`
}

client.MailboxFlag.Query().
	GroupBy(mailboxflag.FieldValue).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*MailboxFlagQuery) IDs

func (mfq *MailboxFlagQuery) IDs(ctx context.Context) ([]int, error)

IDs executes the query and returns a list of MailboxFlag IDs.

func (*MailboxFlagQuery) IDsX

func (mfq *MailboxFlagQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*MailboxFlagQuery) Limit

func (mfq *MailboxFlagQuery) Limit(limit int) *MailboxFlagQuery

Limit adds a limit step to the query.

func (*MailboxFlagQuery) Offset

func (mfq *MailboxFlagQuery) Offset(offset int) *MailboxFlagQuery

Offset adds an offset step to the query.

func (*MailboxFlagQuery) Only

func (mfq *MailboxFlagQuery) Only(ctx context.Context) (*MailboxFlag, error)

Only returns a single MailboxFlag entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one MailboxFlag entity is found. Returns a *NotFoundError when no MailboxFlag entities are found.

func (*MailboxFlagQuery) OnlyID

func (mfq *MailboxFlagQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only MailboxFlag ID in the query. Returns a *NotSingularError when more than one MailboxFlag ID is found. Returns a *NotFoundError when no entities are found.

func (*MailboxFlagQuery) OnlyIDX

func (mfq *MailboxFlagQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*MailboxFlagQuery) OnlyX

func (mfq *MailboxFlagQuery) OnlyX(ctx context.Context) *MailboxFlag

OnlyX is like Only, but panics if an error occurs.

func (*MailboxFlagQuery) Order

func (mfq *MailboxFlagQuery) Order(o ...OrderFunc) *MailboxFlagQuery

Order adds an order step to the query.

func (*MailboxFlagQuery) Select

func (mfq *MailboxFlagQuery) Select(fields ...string) *MailboxFlagSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	Value string `json:"Value,omitempty"`
}

client.MailboxFlag.Query().
	Select(mailboxflag.FieldValue).
	Scan(ctx, &v)

func (*MailboxFlagQuery) Unique

func (mfq *MailboxFlagQuery) Unique(unique bool) *MailboxFlagQuery

Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.

func (*MailboxFlagQuery) Where

Where adds a new predicate for the MailboxFlagQuery builder.

type MailboxFlagSelect

type MailboxFlagSelect struct {
	*MailboxFlagQuery
	// contains filtered or unexported fields
}

MailboxFlagSelect is the builder for selecting fields of MailboxFlag entities.

func (*MailboxFlagSelect) Bool

func (mfs *MailboxFlagSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*MailboxFlagSelect) BoolX

func (mfs *MailboxFlagSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*MailboxFlagSelect) Bools

func (mfs *MailboxFlagSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*MailboxFlagSelect) BoolsX

func (mfs *MailboxFlagSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*MailboxFlagSelect) Float64

func (mfs *MailboxFlagSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*MailboxFlagSelect) Float64X

func (mfs *MailboxFlagSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*MailboxFlagSelect) Float64s

func (mfs *MailboxFlagSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*MailboxFlagSelect) Float64sX

func (mfs *MailboxFlagSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*MailboxFlagSelect) Int

func (mfs *MailboxFlagSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*MailboxFlagSelect) IntX

func (mfs *MailboxFlagSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*MailboxFlagSelect) Ints

func (mfs *MailboxFlagSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*MailboxFlagSelect) IntsX

func (mfs *MailboxFlagSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*MailboxFlagSelect) Scan

func (mfs *MailboxFlagSelect) Scan(ctx context.Context, v interface{}) error

Scan applies the selector query and scans the result into the given value.

func (*MailboxFlagSelect) ScanX

func (mfs *MailboxFlagSelect) ScanX(ctx context.Context, v interface{})

ScanX is like Scan, but panics if an error occurs.

func (*MailboxFlagSelect) String

func (mfs *MailboxFlagSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*MailboxFlagSelect) StringX

func (mfs *MailboxFlagSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*MailboxFlagSelect) Strings

func (mfs *MailboxFlagSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*MailboxFlagSelect) StringsX

func (mfs *MailboxFlagSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type MailboxFlagUpdate

type MailboxFlagUpdate struct {
	// contains filtered or unexported fields
}

MailboxFlagUpdate is the builder for updating MailboxFlag entities.

func (*MailboxFlagUpdate) Exec

func (mfu *MailboxFlagUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*MailboxFlagUpdate) ExecX

func (mfu *MailboxFlagUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*MailboxFlagUpdate) Mutation

func (mfu *MailboxFlagUpdate) Mutation() *MailboxFlagMutation

Mutation returns the MailboxFlagMutation object of the builder.

func (*MailboxFlagUpdate) Save

func (mfu *MailboxFlagUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*MailboxFlagUpdate) SaveX

func (mfu *MailboxFlagUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*MailboxFlagUpdate) SetValue

func (mfu *MailboxFlagUpdate) SetValue(s string) *MailboxFlagUpdate

SetValue sets the "Value" field.

func (*MailboxFlagUpdate) Where

Where appends a list predicates to the MailboxFlagUpdate builder.

type MailboxFlagUpdateOne

type MailboxFlagUpdateOne struct {
	// contains filtered or unexported fields
}

MailboxFlagUpdateOne is the builder for updating a single MailboxFlag entity.

func (*MailboxFlagUpdateOne) Exec

func (mfuo *MailboxFlagUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*MailboxFlagUpdateOne) ExecX

func (mfuo *MailboxFlagUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*MailboxFlagUpdateOne) Mutation

func (mfuo *MailboxFlagUpdateOne) Mutation() *MailboxFlagMutation

Mutation returns the MailboxFlagMutation object of the builder.

func (*MailboxFlagUpdateOne) Save

Save executes the query and returns the updated MailboxFlag entity.

func (*MailboxFlagUpdateOne) SaveX

func (mfuo *MailboxFlagUpdateOne) SaveX(ctx context.Context) *MailboxFlag

SaveX is like Save, but panics if an error occurs.

func (*MailboxFlagUpdateOne) Select

func (mfuo *MailboxFlagUpdateOne) Select(field string, fields ...string) *MailboxFlagUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*MailboxFlagUpdateOne) SetValue

SetValue sets the "Value" field.

type MailboxFlags

type MailboxFlags []*MailboxFlag

MailboxFlags is a parsable slice of MailboxFlag.

type MailboxGroupBy

type MailboxGroupBy struct {
	// contains filtered or unexported fields
}

MailboxGroupBy is the group-by builder for Mailbox entities.

func (*MailboxGroupBy) Aggregate

func (mgb *MailboxGroupBy) Aggregate(fns ...AggregateFunc) *MailboxGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*MailboxGroupBy) Bool

func (mgb *MailboxGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a group-by query. It is only allowed when executing a group-by query with one field.

func (*MailboxGroupBy) BoolX

func (mgb *MailboxGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*MailboxGroupBy) Bools

func (mgb *MailboxGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from group-by. It is only allowed when executing a group-by query with one field.

func (*MailboxGroupBy) BoolsX

func (mgb *MailboxGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*MailboxGroupBy) Float64

func (mgb *MailboxGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a group-by query. It is only allowed when executing a group-by query with one field.

func (*MailboxGroupBy) Float64X

func (mgb *MailboxGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*MailboxGroupBy) Float64s

func (mgb *MailboxGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from group-by. It is only allowed when executing a group-by query with one field.

func (*MailboxGroupBy) Float64sX

func (mgb *MailboxGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*MailboxGroupBy) Int

func (mgb *MailboxGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a group-by query. It is only allowed when executing a group-by query with one field.

func (*MailboxGroupBy) IntX

func (mgb *MailboxGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*MailboxGroupBy) Ints

func (mgb *MailboxGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from group-by. It is only allowed when executing a group-by query with one field.

func (*MailboxGroupBy) IntsX

func (mgb *MailboxGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*MailboxGroupBy) Scan

func (mgb *MailboxGroupBy) Scan(ctx context.Context, v interface{}) error

Scan applies the group-by query and scans the result into the given value.

func (*MailboxGroupBy) ScanX

func (mgb *MailboxGroupBy) ScanX(ctx context.Context, v interface{})

ScanX is like Scan, but panics if an error occurs.

func (*MailboxGroupBy) String

func (mgb *MailboxGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a group-by query. It is only allowed when executing a group-by query with one field.

func (*MailboxGroupBy) StringX

func (mgb *MailboxGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*MailboxGroupBy) Strings

func (mgb *MailboxGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from group-by. It is only allowed when executing a group-by query with one field.

func (*MailboxGroupBy) StringsX

func (mgb *MailboxGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type MailboxMutation

type MailboxMutation struct {
	// contains filtered or unexported fields
}

MailboxMutation represents an operation that mutates the Mailbox nodes in the graph.

func (*MailboxMutation) AddAttributeIDs

func (m *MailboxMutation) AddAttributeIDs(ids ...int)

AddAttributeIDs adds the "attributes" edge to the MailboxAttr entity by ids.

func (*MailboxMutation) AddField

func (m *MailboxMutation) AddField(name string, value ent.Value) error

AddField adds the value to the field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*MailboxMutation) AddFlagIDs

func (m *MailboxMutation) AddFlagIDs(ids ...int)

AddFlagIDs adds the "flags" edge to the MailboxFlag entity by ids.

func (*MailboxMutation) AddPermanentFlagIDs

func (m *MailboxMutation) AddPermanentFlagIDs(ids ...int)

AddPermanentFlagIDs adds the "permanent_flags" edge to the MailboxPermFlag entity by ids.

func (*MailboxMutation) AddUIDIDs

func (m *MailboxMutation) AddUIDIDs(ids ...int)

AddUIDIDs adds the "UIDs" edge to the UID entity by ids.

func (*MailboxMutation) AddUIDNext

func (m *MailboxMutation) AddUIDNext(i int)

AddUIDNext adds i to the "UIDNext" field.

func (*MailboxMutation) AddUIDValidity

func (m *MailboxMutation) AddUIDValidity(i int)

AddUIDValidity adds i to the "UIDValidity" field.

func (*MailboxMutation) AddedEdges

func (m *MailboxMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*MailboxMutation) AddedField

func (m *MailboxMutation) AddedField(name string) (ent.Value, bool)

AddedField returns the numeric value that was incremented/decremented on a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*MailboxMutation) AddedFields

func (m *MailboxMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*MailboxMutation) AddedIDs

func (m *MailboxMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*MailboxMutation) AddedUIDNext

func (m *MailboxMutation) AddedUIDNext() (r int, exists bool)

AddedUIDNext returns the value that was added to the "UIDNext" field in this mutation.

func (*MailboxMutation) AddedUIDValidity

func (m *MailboxMutation) AddedUIDValidity() (r int, exists bool)

AddedUIDValidity returns the value that was added to the "UIDValidity" field in this mutation.

func (*MailboxMutation) AttributesCleared

func (m *MailboxMutation) AttributesCleared() bool

AttributesCleared reports if the "attributes" edge to the MailboxAttr entity was cleared.

func (*MailboxMutation) AttributesIDs

func (m *MailboxMutation) AttributesIDs() (ids []int)

AttributesIDs returns the "attributes" edge IDs in the mutation.

func (*MailboxMutation) ClearAttributes

func (m *MailboxMutation) ClearAttributes()

ClearAttributes clears the "attributes" edge to the MailboxAttr entity.

func (*MailboxMutation) ClearEdge

func (m *MailboxMutation) ClearEdge(name string) error

ClearEdge clears the value of the edge with the given name. It returns an error if that edge is not defined in the schema.

func (*MailboxMutation) ClearField

func (m *MailboxMutation) ClearField(name string) error

ClearField clears the value of the field with the given name. It returns an error if the field is not defined in the schema.

func (*MailboxMutation) ClearFlags

func (m *MailboxMutation) ClearFlags()

ClearFlags clears the "flags" edge to the MailboxFlag entity.

func (*MailboxMutation) ClearPermanentFlags

func (m *MailboxMutation) ClearPermanentFlags()

ClearPermanentFlags clears the "permanent_flags" edge to the MailboxPermFlag entity.

func (*MailboxMutation) ClearUIDs

func (m *MailboxMutation) ClearUIDs()

ClearUIDs clears the "UIDs" edge to the UID entity.

func (*MailboxMutation) ClearedEdges

func (m *MailboxMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*MailboxMutation) ClearedFields

func (m *MailboxMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (MailboxMutation) Client

func (m MailboxMutation) Client() *Client

Client returns a new `ent.Client` from the mutation. If the mutation was executed in a transaction (ent.Tx), a transactional client is returned.

func (*MailboxMutation) EdgeCleared

func (m *MailboxMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*MailboxMutation) Field

func (m *MailboxMutation) Field(name string) (ent.Value, bool)

Field returns the value of a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*MailboxMutation) FieldCleared

func (m *MailboxMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*MailboxMutation) Fields

func (m *MailboxMutation) Fields() []string

Fields returns all fields that were changed during this mutation. Note that in order to get all numeric fields that were incremented/decremented, call AddedFields().

func (*MailboxMutation) FlagsCleared

func (m *MailboxMutation) FlagsCleared() bool

FlagsCleared reports if the "flags" edge to the MailboxFlag entity was cleared.

func (*MailboxMutation) FlagsIDs

func (m *MailboxMutation) FlagsIDs() (ids []int)

FlagsIDs returns the "flags" edge IDs in the mutation.

func (*MailboxMutation) ID

func (m *MailboxMutation) ID() (id int, exists bool)

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.

func (*MailboxMutation) IDs

func (m *MailboxMutation) IDs(ctx context.Context) ([]int, error)

IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.

func (*MailboxMutation) MailboxID

func (m *MailboxMutation) MailboxID() (r string, exists bool)

MailboxID returns the value of the "MailboxID" field in the mutation.

func (*MailboxMutation) Name

func (m *MailboxMutation) Name() (r string, exists bool)

Name returns the value of the "Name" field in the mutation.

func (*MailboxMutation) OldField

func (m *MailboxMutation) OldField(ctx context.Context, name string) (ent.Value, error)

OldField returns the old value of the field from the database. An error is returned if the mutation operation is not UpdateOne, or the query to the database failed.

func (*MailboxMutation) OldMailboxID

func (m *MailboxMutation) OldMailboxID(ctx context.Context) (v string, err error)

OldMailboxID returns the old "MailboxID" field's value of the Mailbox entity. If the Mailbox object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*MailboxMutation) OldName

func (m *MailboxMutation) OldName(ctx context.Context) (v string, err error)

OldName returns the old "Name" field's value of the Mailbox entity. If the Mailbox object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*MailboxMutation) OldSubscribed

func (m *MailboxMutation) OldSubscribed(ctx context.Context) (v bool, err error)

OldSubscribed returns the old "Subscribed" field's value of the Mailbox entity. If the Mailbox object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*MailboxMutation) OldUIDNext

func (m *MailboxMutation) OldUIDNext(ctx context.Context) (v int, err error)

OldUIDNext returns the old "UIDNext" field's value of the Mailbox entity. If the Mailbox object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*MailboxMutation) OldUIDValidity

func (m *MailboxMutation) OldUIDValidity(ctx context.Context) (v int, err error)

OldUIDValidity returns the old "UIDValidity" field's value of the Mailbox entity. If the Mailbox object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*MailboxMutation) Op

func (m *MailboxMutation) Op() Op

Op returns the operation name.

func (*MailboxMutation) PermanentFlagsCleared

func (m *MailboxMutation) PermanentFlagsCleared() bool

PermanentFlagsCleared reports if the "permanent_flags" edge to the MailboxPermFlag entity was cleared.

func (*MailboxMutation) PermanentFlagsIDs

func (m *MailboxMutation) PermanentFlagsIDs() (ids []int)

PermanentFlagsIDs returns the "permanent_flags" edge IDs in the mutation.

func (*MailboxMutation) RemoveAttributeIDs

func (m *MailboxMutation) RemoveAttributeIDs(ids ...int)

RemoveAttributeIDs removes the "attributes" edge to the MailboxAttr entity by IDs.

func (*MailboxMutation) RemoveFlagIDs

func (m *MailboxMutation) RemoveFlagIDs(ids ...int)

RemoveFlagIDs removes the "flags" edge to the MailboxFlag entity by IDs.

func (*MailboxMutation) RemovePermanentFlagIDs

func (m *MailboxMutation) RemovePermanentFlagIDs(ids ...int)

RemovePermanentFlagIDs removes the "permanent_flags" edge to the MailboxPermFlag entity by IDs.

func (*MailboxMutation) RemoveUIDIDs

func (m *MailboxMutation) RemoveUIDIDs(ids ...int)

RemoveUIDIDs removes the "UIDs" edge to the UID entity by IDs.

func (*MailboxMutation) RemovedAttributesIDs

func (m *MailboxMutation) RemovedAttributesIDs() (ids []int)

RemovedAttributes returns the removed IDs of the "attributes" edge to the MailboxAttr entity.

func (*MailboxMutation) RemovedEdges

func (m *MailboxMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*MailboxMutation) RemovedFlagsIDs

func (m *MailboxMutation) RemovedFlagsIDs() (ids []int)

RemovedFlags returns the removed IDs of the "flags" edge to the MailboxFlag entity.

func (*MailboxMutation) RemovedIDs

func (m *MailboxMutation) RemovedIDs(name string) []ent.Value

RemovedIDs returns all IDs (to other nodes) that were removed for the edge with the given name in this mutation.

func (*MailboxMutation) RemovedPermanentFlagsIDs

func (m *MailboxMutation) RemovedPermanentFlagsIDs() (ids []int)

RemovedPermanentFlags returns the removed IDs of the "permanent_flags" edge to the MailboxPermFlag entity.

func (*MailboxMutation) RemovedUIDsIDs

func (m *MailboxMutation) RemovedUIDsIDs() (ids []int)

RemovedUIDs returns the removed IDs of the "UIDs" edge to the UID entity.

func (*MailboxMutation) ResetAttributes

func (m *MailboxMutation) ResetAttributes()

ResetAttributes resets all changes to the "attributes" edge.

func (*MailboxMutation) ResetEdge

func (m *MailboxMutation) ResetEdge(name string) error

ResetEdge resets all changes to the edge with the given name in this mutation. It returns an error if the edge is not defined in the schema.

func (*MailboxMutation) ResetField

func (m *MailboxMutation) ResetField(name string) error

ResetField resets all changes in the mutation for the field with the given name. It returns an error if the field is not defined in the schema.

func (*MailboxMutation) ResetFlags

func (m *MailboxMutation) ResetFlags()

ResetFlags resets all changes to the "flags" edge.

func (*MailboxMutation) ResetMailboxID

func (m *MailboxMutation) ResetMailboxID()

ResetMailboxID resets all changes to the "MailboxID" field.

func (*MailboxMutation) ResetName

func (m *MailboxMutation) ResetName()

ResetName resets all changes to the "Name" field.

func (*MailboxMutation) ResetPermanentFlags

func (m *MailboxMutation) ResetPermanentFlags()

ResetPermanentFlags resets all changes to the "permanent_flags" edge.

func (*MailboxMutation) ResetSubscribed

func (m *MailboxMutation) ResetSubscribed()

ResetSubscribed resets all changes to the "Subscribed" field.

func (*MailboxMutation) ResetUIDNext

func (m *MailboxMutation) ResetUIDNext()

ResetUIDNext resets all changes to the "UIDNext" field.

func (*MailboxMutation) ResetUIDValidity

func (m *MailboxMutation) ResetUIDValidity()

ResetUIDValidity resets all changes to the "UIDValidity" field.

func (*MailboxMutation) ResetUIDs

func (m *MailboxMutation) ResetUIDs()

ResetUIDs resets all changes to the "UIDs" edge.

func (*MailboxMutation) SetField

func (m *MailboxMutation) SetField(name string, value ent.Value) error

SetField sets the value of a field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*MailboxMutation) SetMailboxID

func (m *MailboxMutation) SetMailboxID(s string)

SetMailboxID sets the "MailboxID" field.

func (*MailboxMutation) SetName

func (m *MailboxMutation) SetName(s string)

SetName sets the "Name" field.

func (*MailboxMutation) SetSubscribed

func (m *MailboxMutation) SetSubscribed(b bool)

SetSubscribed sets the "Subscribed" field.

func (*MailboxMutation) SetUIDNext

func (m *MailboxMutation) SetUIDNext(i int)

SetUIDNext sets the "UIDNext" field.

func (*MailboxMutation) SetUIDValidity

func (m *MailboxMutation) SetUIDValidity(i int)

SetUIDValidity sets the "UIDValidity" field.

func (*MailboxMutation) Subscribed

func (m *MailboxMutation) Subscribed() (r bool, exists bool)

Subscribed returns the value of the "Subscribed" field in the mutation.

func (MailboxMutation) Tx

func (m MailboxMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*MailboxMutation) Type

func (m *MailboxMutation) Type() string

Type returns the node type of this mutation (Mailbox).

func (*MailboxMutation) UIDNext

func (m *MailboxMutation) UIDNext() (r int, exists bool)

UIDNext returns the value of the "UIDNext" field in the mutation.

func (*MailboxMutation) UIDValidity

func (m *MailboxMutation) UIDValidity() (r int, exists bool)

UIDValidity returns the value of the "UIDValidity" field in the mutation.

func (*MailboxMutation) UIDsCleared

func (m *MailboxMutation) UIDsCleared() bool

UIDsCleared reports if the "UIDs" edge to the UID entity was cleared.

func (*MailboxMutation) UIDsIDs

func (m *MailboxMutation) UIDsIDs() (ids []int)

UIDsIDs returns the "UIDs" edge IDs in the mutation.

func (*MailboxMutation) Where

func (m *MailboxMutation) Where(ps ...predicate.Mailbox)

Where appends a list predicates to the MailboxMutation builder.

type MailboxPermFlag

type MailboxPermFlag struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// Value holds the value of the "Value" field.
	Value string `json:"Value,omitempty"`
	// contains filtered or unexported fields
}

MailboxPermFlag is the model entity for the MailboxPermFlag schema.

func (*MailboxPermFlag) String

func (mpf *MailboxPermFlag) String() string

String implements the fmt.Stringer.

func (*MailboxPermFlag) Unwrap

func (mpf *MailboxPermFlag) Unwrap() *MailboxPermFlag

Unwrap unwraps the MailboxPermFlag entity that was returned from a transaction after it was closed, so that all future queries will be executed through the driver which created the transaction.

func (*MailboxPermFlag) Update

Update returns a builder for updating this MailboxPermFlag. Note that you need to call MailboxPermFlag.Unwrap() before calling this method if this MailboxPermFlag was returned from a transaction, and the transaction was committed or rolled back.

type MailboxPermFlagClient

type MailboxPermFlagClient struct {
	// contains filtered or unexported fields
}

MailboxPermFlagClient is a client for the MailboxPermFlag schema.

func NewMailboxPermFlagClient

func NewMailboxPermFlagClient(c config) *MailboxPermFlagClient

NewMailboxPermFlagClient returns a client for the MailboxPermFlag from the given config.

func (*MailboxPermFlagClient) Create

Create returns a create builder for MailboxPermFlag.

func (*MailboxPermFlagClient) CreateBulk

CreateBulk returns a builder for creating a bulk of MailboxPermFlag entities.

func (*MailboxPermFlagClient) Delete

Delete returns a delete builder for MailboxPermFlag.

func (*MailboxPermFlagClient) DeleteOne

DeleteOne returns a delete builder for the given entity.

func (*MailboxPermFlagClient) DeleteOneID

DeleteOneID returns a delete builder for the given id.

func (*MailboxPermFlagClient) Get

Get returns a MailboxPermFlag entity by its id.

func (*MailboxPermFlagClient) GetX

GetX is like Get, but panics if an error occurs.

func (*MailboxPermFlagClient) Hooks

func (c *MailboxPermFlagClient) Hooks() []Hook

Hooks returns the client hooks.

func (*MailboxPermFlagClient) Query

Query returns a query builder for MailboxPermFlag.

func (*MailboxPermFlagClient) Update

Update returns an update builder for MailboxPermFlag.

func (*MailboxPermFlagClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*MailboxPermFlagClient) UpdateOneID

UpdateOneID returns an update builder for the given id.

func (*MailboxPermFlagClient) Use

func (c *MailboxPermFlagClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `mailboxpermflag.Hooks(f(g(h())))`.

type MailboxPermFlagCreate

type MailboxPermFlagCreate struct {
	// contains filtered or unexported fields
}

MailboxPermFlagCreate is the builder for creating a MailboxPermFlag entity.

func (*MailboxPermFlagCreate) Exec

func (mpfc *MailboxPermFlagCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*MailboxPermFlagCreate) ExecX

func (mpfc *MailboxPermFlagCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*MailboxPermFlagCreate) Mutation

Mutation returns the MailboxPermFlagMutation object of the builder.

func (*MailboxPermFlagCreate) Save

Save creates the MailboxPermFlag in the database.

func (*MailboxPermFlagCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*MailboxPermFlagCreate) SetValue

SetValue sets the "Value" field.

type MailboxPermFlagCreateBulk

type MailboxPermFlagCreateBulk struct {
	// contains filtered or unexported fields
}

MailboxPermFlagCreateBulk is the builder for creating many MailboxPermFlag entities in bulk.

func (*MailboxPermFlagCreateBulk) Exec

Exec executes the query.

func (*MailboxPermFlagCreateBulk) ExecX

func (mpfcb *MailboxPermFlagCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*MailboxPermFlagCreateBulk) Save

Save creates the MailboxPermFlag entities in the database.

func (*MailboxPermFlagCreateBulk) SaveX

SaveX is like Save, but panics if an error occurs.

type MailboxPermFlagDelete

type MailboxPermFlagDelete struct {
	// contains filtered or unexported fields
}

MailboxPermFlagDelete is the builder for deleting a MailboxPermFlag entity.

func (*MailboxPermFlagDelete) Exec

func (mpfd *MailboxPermFlagDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*MailboxPermFlagDelete) ExecX

func (mpfd *MailboxPermFlagDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*MailboxPermFlagDelete) Where

Where appends a list predicates to the MailboxPermFlagDelete builder.

type MailboxPermFlagDeleteOne

type MailboxPermFlagDeleteOne struct {
	// contains filtered or unexported fields
}

MailboxPermFlagDeleteOne is the builder for deleting a single MailboxPermFlag entity.

func (*MailboxPermFlagDeleteOne) Exec

func (mpfdo *MailboxPermFlagDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*MailboxPermFlagDeleteOne) ExecX

func (mpfdo *MailboxPermFlagDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

type MailboxPermFlagGroupBy

type MailboxPermFlagGroupBy struct {
	// contains filtered or unexported fields
}

MailboxPermFlagGroupBy is the group-by builder for MailboxPermFlag entities.

func (*MailboxPermFlagGroupBy) Aggregate

Aggregate adds the given aggregation functions to the group-by query.

func (*MailboxPermFlagGroupBy) Bool

func (mpfgb *MailboxPermFlagGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a group-by query. It is only allowed when executing a group-by query with one field.

func (*MailboxPermFlagGroupBy) BoolX

func (mpfgb *MailboxPermFlagGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*MailboxPermFlagGroupBy) Bools

func (mpfgb *MailboxPermFlagGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from group-by. It is only allowed when executing a group-by query with one field.

func (*MailboxPermFlagGroupBy) BoolsX

func (mpfgb *MailboxPermFlagGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*MailboxPermFlagGroupBy) Float64

func (mpfgb *MailboxPermFlagGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a group-by query. It is only allowed when executing a group-by query with one field.

func (*MailboxPermFlagGroupBy) Float64X

func (mpfgb *MailboxPermFlagGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*MailboxPermFlagGroupBy) Float64s

func (mpfgb *MailboxPermFlagGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from group-by. It is only allowed when executing a group-by query with one field.

func (*MailboxPermFlagGroupBy) Float64sX

func (mpfgb *MailboxPermFlagGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*MailboxPermFlagGroupBy) Int

func (mpfgb *MailboxPermFlagGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a group-by query. It is only allowed when executing a group-by query with one field.

func (*MailboxPermFlagGroupBy) IntX

func (mpfgb *MailboxPermFlagGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*MailboxPermFlagGroupBy) Ints

func (mpfgb *MailboxPermFlagGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from group-by. It is only allowed when executing a group-by query with one field.

func (*MailboxPermFlagGroupBy) IntsX

func (mpfgb *MailboxPermFlagGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*MailboxPermFlagGroupBy) Scan

func (mpfgb *MailboxPermFlagGroupBy) Scan(ctx context.Context, v interface{}) error

Scan applies the group-by query and scans the result into the given value.

func (*MailboxPermFlagGroupBy) ScanX

func (mpfgb *MailboxPermFlagGroupBy) ScanX(ctx context.Context, v interface{})

ScanX is like Scan, but panics if an error occurs.

func (*MailboxPermFlagGroupBy) String

func (mpfgb *MailboxPermFlagGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a group-by query. It is only allowed when executing a group-by query with one field.

func (*MailboxPermFlagGroupBy) StringX

func (mpfgb *MailboxPermFlagGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*MailboxPermFlagGroupBy) Strings

func (mpfgb *MailboxPermFlagGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from group-by. It is only allowed when executing a group-by query with one field.

func (*MailboxPermFlagGroupBy) StringsX

func (mpfgb *MailboxPermFlagGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type MailboxPermFlagMutation

type MailboxPermFlagMutation struct {
	// contains filtered or unexported fields
}

MailboxPermFlagMutation represents an operation that mutates the MailboxPermFlag nodes in the graph.

func (*MailboxPermFlagMutation) AddField

func (m *MailboxPermFlagMutation) AddField(name string, value ent.Value) error

AddField adds the value to the field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*MailboxPermFlagMutation) AddedEdges

func (m *MailboxPermFlagMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*MailboxPermFlagMutation) AddedField

func (m *MailboxPermFlagMutation) AddedField(name string) (ent.Value, bool)

AddedField returns the numeric value that was incremented/decremented on a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*MailboxPermFlagMutation) AddedFields

func (m *MailboxPermFlagMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*MailboxPermFlagMutation) AddedIDs

func (m *MailboxPermFlagMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*MailboxPermFlagMutation) ClearEdge

func (m *MailboxPermFlagMutation) ClearEdge(name string) error

ClearEdge clears the value of the edge with the given name. It returns an error if that edge is not defined in the schema.

func (*MailboxPermFlagMutation) ClearField

func (m *MailboxPermFlagMutation) ClearField(name string) error

ClearField clears the value of the field with the given name. It returns an error if the field is not defined in the schema.

func (*MailboxPermFlagMutation) ClearedEdges

func (m *MailboxPermFlagMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*MailboxPermFlagMutation) ClearedFields

func (m *MailboxPermFlagMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (MailboxPermFlagMutation) Client

func (m MailboxPermFlagMutation) Client() *Client

Client returns a new `ent.Client` from the mutation. If the mutation was executed in a transaction (ent.Tx), a transactional client is returned.

func (*MailboxPermFlagMutation) EdgeCleared

func (m *MailboxPermFlagMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*MailboxPermFlagMutation) Field

func (m *MailboxPermFlagMutation) Field(name string) (ent.Value, bool)

Field returns the value of a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*MailboxPermFlagMutation) FieldCleared

func (m *MailboxPermFlagMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*MailboxPermFlagMutation) Fields

func (m *MailboxPermFlagMutation) Fields() []string

Fields returns all fields that were changed during this mutation. Note that in order to get all numeric fields that were incremented/decremented, call AddedFields().

func (*MailboxPermFlagMutation) ID

func (m *MailboxPermFlagMutation) ID() (id int, exists bool)

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.

func (*MailboxPermFlagMutation) IDs

func (m *MailboxPermFlagMutation) IDs(ctx context.Context) ([]int, error)

IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.

func (*MailboxPermFlagMutation) OldField

func (m *MailboxPermFlagMutation) OldField(ctx context.Context, name string) (ent.Value, error)

OldField returns the old value of the field from the database. An error is returned if the mutation operation is not UpdateOne, or the query to the database failed.

func (*MailboxPermFlagMutation) OldValue

func (m *MailboxPermFlagMutation) OldValue(ctx context.Context) (v string, err error)

OldValue returns the old "Value" field's value of the MailboxPermFlag entity. If the MailboxPermFlag object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*MailboxPermFlagMutation) Op

func (m *MailboxPermFlagMutation) Op() Op

Op returns the operation name.

func (*MailboxPermFlagMutation) RemovedEdges

func (m *MailboxPermFlagMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*MailboxPermFlagMutation) RemovedIDs

func (m *MailboxPermFlagMutation) RemovedIDs(name string) []ent.Value

RemovedIDs returns all IDs (to other nodes) that were removed for the edge with the given name in this mutation.

func (*MailboxPermFlagMutation) ResetEdge

func (m *MailboxPermFlagMutation) ResetEdge(name string) error

ResetEdge resets all changes to the edge with the given name in this mutation. It returns an error if the edge is not defined in the schema.

func (*MailboxPermFlagMutation) ResetField

func (m *MailboxPermFlagMutation) ResetField(name string) error

ResetField resets all changes in the mutation for the field with the given name. It returns an error if the field is not defined in the schema.

func (*MailboxPermFlagMutation) ResetValue

func (m *MailboxPermFlagMutation) ResetValue()

ResetValue resets all changes to the "Value" field.

func (*MailboxPermFlagMutation) SetField

func (m *MailboxPermFlagMutation) SetField(name string, value ent.Value) error

SetField sets the value of a field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*MailboxPermFlagMutation) SetValue

func (m *MailboxPermFlagMutation) SetValue(s string)

SetValue sets the "Value" field.

func (MailboxPermFlagMutation) Tx

func (m MailboxPermFlagMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*MailboxPermFlagMutation) Type

func (m *MailboxPermFlagMutation) Type() string

Type returns the node type of this mutation (MailboxPermFlag).

func (*MailboxPermFlagMutation) Value

func (m *MailboxPermFlagMutation) Value() (r string, exists bool)

Value returns the value of the "Value" field in the mutation.

func (*MailboxPermFlagMutation) Where

Where appends a list predicates to the MailboxPermFlagMutation builder.

type MailboxPermFlagQuery

type MailboxPermFlagQuery struct {
	// contains filtered or unexported fields
}

MailboxPermFlagQuery is the builder for querying MailboxPermFlag entities.

func (*MailboxPermFlagQuery) All

All executes the query and returns a list of MailboxPermFlags.

func (*MailboxPermFlagQuery) AllX

AllX is like All, but panics if an error occurs.

func (*MailboxPermFlagQuery) Clone

Clone returns a duplicate of the MailboxPermFlagQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*MailboxPermFlagQuery) Count

func (mpfq *MailboxPermFlagQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*MailboxPermFlagQuery) CountX

func (mpfq *MailboxPermFlagQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*MailboxPermFlagQuery) Exist

func (mpfq *MailboxPermFlagQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*MailboxPermFlagQuery) ExistX

func (mpfq *MailboxPermFlagQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*MailboxPermFlagQuery) First

First returns the first MailboxPermFlag entity from the query. Returns a *NotFoundError when no MailboxPermFlag was found.

func (*MailboxPermFlagQuery) FirstID

func (mpfq *MailboxPermFlagQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first MailboxPermFlag ID from the query. Returns a *NotFoundError when no MailboxPermFlag ID was found.

func (*MailboxPermFlagQuery) FirstIDX

func (mpfq *MailboxPermFlagQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*MailboxPermFlagQuery) FirstX

FirstX is like First, but panics if an error occurs.

func (*MailboxPermFlagQuery) GroupBy

func (mpfq *MailboxPermFlagQuery) GroupBy(field string, fields ...string) *MailboxPermFlagGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

Example:

var v []struct {
	Value string `json:"Value,omitempty"`
	Count int `json:"count,omitempty"`
}

client.MailboxPermFlag.Query().
	GroupBy(mailboxpermflag.FieldValue).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*MailboxPermFlagQuery) IDs

func (mpfq *MailboxPermFlagQuery) IDs(ctx context.Context) ([]int, error)

IDs executes the query and returns a list of MailboxPermFlag IDs.

func (*MailboxPermFlagQuery) IDsX

func (mpfq *MailboxPermFlagQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*MailboxPermFlagQuery) Limit

func (mpfq *MailboxPermFlagQuery) Limit(limit int) *MailboxPermFlagQuery

Limit adds a limit step to the query.

func (*MailboxPermFlagQuery) Offset

func (mpfq *MailboxPermFlagQuery) Offset(offset int) *MailboxPermFlagQuery

Offset adds an offset step to the query.

func (*MailboxPermFlagQuery) Only

Only returns a single MailboxPermFlag entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one MailboxPermFlag entity is found. Returns a *NotFoundError when no MailboxPermFlag entities are found.

func (*MailboxPermFlagQuery) OnlyID

func (mpfq *MailboxPermFlagQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only MailboxPermFlag ID in the query. Returns a *NotSingularError when more than one MailboxPermFlag ID is found. Returns a *NotFoundError when no entities are found.

func (*MailboxPermFlagQuery) OnlyIDX

func (mpfq *MailboxPermFlagQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*MailboxPermFlagQuery) OnlyX

OnlyX is like Only, but panics if an error occurs.

func (*MailboxPermFlagQuery) Order

Order adds an order step to the query.

func (*MailboxPermFlagQuery) Select

func (mpfq *MailboxPermFlagQuery) Select(fields ...string) *MailboxPermFlagSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	Value string `json:"Value,omitempty"`
}

client.MailboxPermFlag.Query().
	Select(mailboxpermflag.FieldValue).
	Scan(ctx, &v)

func (*MailboxPermFlagQuery) Unique

func (mpfq *MailboxPermFlagQuery) Unique(unique bool) *MailboxPermFlagQuery

Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.

func (*MailboxPermFlagQuery) Where

Where adds a new predicate for the MailboxPermFlagQuery builder.

type MailboxPermFlagSelect

type MailboxPermFlagSelect struct {
	*MailboxPermFlagQuery
	// contains filtered or unexported fields
}

MailboxPermFlagSelect is the builder for selecting fields of MailboxPermFlag entities.

func (*MailboxPermFlagSelect) Bool

func (mpfs *MailboxPermFlagSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*MailboxPermFlagSelect) BoolX

func (mpfs *MailboxPermFlagSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*MailboxPermFlagSelect) Bools

func (mpfs *MailboxPermFlagSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*MailboxPermFlagSelect) BoolsX

func (mpfs *MailboxPermFlagSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*MailboxPermFlagSelect) Float64

func (mpfs *MailboxPermFlagSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*MailboxPermFlagSelect) Float64X

func (mpfs *MailboxPermFlagSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*MailboxPermFlagSelect) Float64s

func (mpfs *MailboxPermFlagSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*MailboxPermFlagSelect) Float64sX

func (mpfs *MailboxPermFlagSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*MailboxPermFlagSelect) Int

func (mpfs *MailboxPermFlagSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*MailboxPermFlagSelect) IntX

func (mpfs *MailboxPermFlagSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*MailboxPermFlagSelect) Ints

func (mpfs *MailboxPermFlagSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*MailboxPermFlagSelect) IntsX

func (mpfs *MailboxPermFlagSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*MailboxPermFlagSelect) Scan

func (mpfs *MailboxPermFlagSelect) Scan(ctx context.Context, v interface{}) error

Scan applies the selector query and scans the result into the given value.

func (*MailboxPermFlagSelect) ScanX

func (mpfs *MailboxPermFlagSelect) ScanX(ctx context.Context, v interface{})

ScanX is like Scan, but panics if an error occurs.

func (*MailboxPermFlagSelect) String

func (mpfs *MailboxPermFlagSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*MailboxPermFlagSelect) StringX

func (mpfs *MailboxPermFlagSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*MailboxPermFlagSelect) Strings

func (mpfs *MailboxPermFlagSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*MailboxPermFlagSelect) StringsX

func (mpfs *MailboxPermFlagSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type MailboxPermFlagUpdate

type MailboxPermFlagUpdate struct {
	// contains filtered or unexported fields
}

MailboxPermFlagUpdate is the builder for updating MailboxPermFlag entities.

func (*MailboxPermFlagUpdate) Exec

func (mpfu *MailboxPermFlagUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*MailboxPermFlagUpdate) ExecX

func (mpfu *MailboxPermFlagUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*MailboxPermFlagUpdate) Mutation

Mutation returns the MailboxPermFlagMutation object of the builder.

func (*MailboxPermFlagUpdate) Save

func (mpfu *MailboxPermFlagUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*MailboxPermFlagUpdate) SaveX

func (mpfu *MailboxPermFlagUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*MailboxPermFlagUpdate) SetValue

SetValue sets the "Value" field.

func (*MailboxPermFlagUpdate) Where

Where appends a list predicates to the MailboxPermFlagUpdate builder.

type MailboxPermFlagUpdateOne

type MailboxPermFlagUpdateOne struct {
	// contains filtered or unexported fields
}

MailboxPermFlagUpdateOne is the builder for updating a single MailboxPermFlag entity.

func (*MailboxPermFlagUpdateOne) Exec

func (mpfuo *MailboxPermFlagUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*MailboxPermFlagUpdateOne) ExecX

func (mpfuo *MailboxPermFlagUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*MailboxPermFlagUpdateOne) Mutation

Mutation returns the MailboxPermFlagMutation object of the builder.

func (*MailboxPermFlagUpdateOne) Save

Save executes the query and returns the updated MailboxPermFlag entity.

func (*MailboxPermFlagUpdateOne) SaveX

SaveX is like Save, but panics if an error occurs.

func (*MailboxPermFlagUpdateOne) Select

func (mpfuo *MailboxPermFlagUpdateOne) Select(field string, fields ...string) *MailboxPermFlagUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*MailboxPermFlagUpdateOne) SetValue

SetValue sets the "Value" field.

type MailboxPermFlags

type MailboxPermFlags []*MailboxPermFlag

MailboxPermFlags is a parsable slice of MailboxPermFlag.

type MailboxQuery

type MailboxQuery struct {
	// contains filtered or unexported fields
}

MailboxQuery is the builder for querying Mailbox entities.

func (*MailboxQuery) All

func (mq *MailboxQuery) All(ctx context.Context) ([]*Mailbox, error)

All executes the query and returns a list of Mailboxes.

func (*MailboxQuery) AllX

func (mq *MailboxQuery) AllX(ctx context.Context) []*Mailbox

AllX is like All, but panics if an error occurs.

func (*MailboxQuery) Clone

func (mq *MailboxQuery) Clone() *MailboxQuery

Clone returns a duplicate of the MailboxQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*MailboxQuery) Count

func (mq *MailboxQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*MailboxQuery) CountX

func (mq *MailboxQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*MailboxQuery) Exist

func (mq *MailboxQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*MailboxQuery) ExistX

func (mq *MailboxQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*MailboxQuery) First

func (mq *MailboxQuery) First(ctx context.Context) (*Mailbox, error)

First returns the first Mailbox entity from the query. Returns a *NotFoundError when no Mailbox was found.

func (*MailboxQuery) FirstID

func (mq *MailboxQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first Mailbox ID from the query. Returns a *NotFoundError when no Mailbox ID was found.

func (*MailboxQuery) FirstIDX

func (mq *MailboxQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*MailboxQuery) FirstX

func (mq *MailboxQuery) FirstX(ctx context.Context) *Mailbox

FirstX is like First, but panics if an error occurs.

func (*MailboxQuery) GroupBy

func (mq *MailboxQuery) GroupBy(field string, fields ...string) *MailboxGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

Example:

var v []struct {
	MailboxID string `json:"MailboxID,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Mailbox.Query().
	GroupBy(mailbox.FieldMailboxID).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*MailboxQuery) IDs

func (mq *MailboxQuery) IDs(ctx context.Context) ([]int, error)

IDs executes the query and returns a list of Mailbox IDs.

func (*MailboxQuery) IDsX

func (mq *MailboxQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*MailboxQuery) Limit

func (mq *MailboxQuery) Limit(limit int) *MailboxQuery

Limit adds a limit step to the query.

func (*MailboxQuery) Offset

func (mq *MailboxQuery) Offset(offset int) *MailboxQuery

Offset adds an offset step to the query.

func (*MailboxQuery) Only

func (mq *MailboxQuery) Only(ctx context.Context) (*Mailbox, error)

Only returns a single Mailbox entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Mailbox entity is found. Returns a *NotFoundError when no Mailbox entities are found.

func (*MailboxQuery) OnlyID

func (mq *MailboxQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only Mailbox ID in the query. Returns a *NotSingularError when more than one Mailbox ID is found. Returns a *NotFoundError when no entities are found.

func (*MailboxQuery) OnlyIDX

func (mq *MailboxQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*MailboxQuery) OnlyX

func (mq *MailboxQuery) OnlyX(ctx context.Context) *Mailbox

OnlyX is like Only, but panics if an error occurs.

func (*MailboxQuery) Order

func (mq *MailboxQuery) Order(o ...OrderFunc) *MailboxQuery

Order adds an order step to the query.

func (*MailboxQuery) QueryAttributes

func (mq *MailboxQuery) QueryAttributes() *MailboxAttrQuery

QueryAttributes chains the current query on the "attributes" edge.

func (*MailboxQuery) QueryFlags

func (mq *MailboxQuery) QueryFlags() *MailboxFlagQuery

QueryFlags chains the current query on the "flags" edge.

func (*MailboxQuery) QueryPermanentFlags

func (mq *MailboxQuery) QueryPermanentFlags() *MailboxPermFlagQuery

QueryPermanentFlags chains the current query on the "permanent_flags" edge.

func (*MailboxQuery) QueryUIDs

func (mq *MailboxQuery) QueryUIDs() *UIDQuery

QueryUIDs chains the current query on the "UIDs" edge.

func (*MailboxQuery) Select

func (mq *MailboxQuery) Select(fields ...string) *MailboxSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	MailboxID string `json:"MailboxID,omitempty"`
}

client.Mailbox.Query().
	Select(mailbox.FieldMailboxID).
	Scan(ctx, &v)

func (*MailboxQuery) Unique

func (mq *MailboxQuery) Unique(unique bool) *MailboxQuery

Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.

func (*MailboxQuery) Where

func (mq *MailboxQuery) Where(ps ...predicate.Mailbox) *MailboxQuery

Where adds a new predicate for the MailboxQuery builder.

func (*MailboxQuery) WithAttributes

func (mq *MailboxQuery) WithAttributes(opts ...func(*MailboxAttrQuery)) *MailboxQuery

WithAttributes tells the query-builder to eager-load the nodes that are connected to the "attributes" edge. The optional arguments are used to configure the query builder of the edge.

func (*MailboxQuery) WithFlags

func (mq *MailboxQuery) WithFlags(opts ...func(*MailboxFlagQuery)) *MailboxQuery

WithFlags tells the query-builder to eager-load the nodes that are connected to the "flags" edge. The optional arguments are used to configure the query builder of the edge.

func (*MailboxQuery) WithPermanentFlags

func (mq *MailboxQuery) WithPermanentFlags(opts ...func(*MailboxPermFlagQuery)) *MailboxQuery

WithPermanentFlags tells the query-builder to eager-load the nodes that are connected to the "permanent_flags" edge. The optional arguments are used to configure the query builder of the edge.

func (*MailboxQuery) WithUIDs

func (mq *MailboxQuery) WithUIDs(opts ...func(*UIDQuery)) *MailboxQuery

WithUIDs tells the query-builder to eager-load the nodes that are connected to the "UIDs" edge. The optional arguments are used to configure the query builder of the edge.

type MailboxSelect

type MailboxSelect struct {
	*MailboxQuery
	// contains filtered or unexported fields
}

MailboxSelect is the builder for selecting fields of Mailbox entities.

func (*MailboxSelect) Bool

func (ms *MailboxSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*MailboxSelect) BoolX

func (ms *MailboxSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*MailboxSelect) Bools

func (ms *MailboxSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*MailboxSelect) BoolsX

func (ms *MailboxSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*MailboxSelect) Float64

func (ms *MailboxSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*MailboxSelect) Float64X

func (ms *MailboxSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*MailboxSelect) Float64s

func (ms *MailboxSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*MailboxSelect) Float64sX

func (ms *MailboxSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*MailboxSelect) Int

func (ms *MailboxSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*MailboxSelect) IntX

func (ms *MailboxSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*MailboxSelect) Ints

func (ms *MailboxSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*MailboxSelect) IntsX

func (ms *MailboxSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*MailboxSelect) Scan

func (ms *MailboxSelect) Scan(ctx context.Context, v interface{}) error

Scan applies the selector query and scans the result into the given value.

func (*MailboxSelect) ScanX

func (ms *MailboxSelect) ScanX(ctx context.Context, v interface{})

ScanX is like Scan, but panics if an error occurs.

func (*MailboxSelect) String

func (ms *MailboxSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*MailboxSelect) StringX

func (ms *MailboxSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*MailboxSelect) Strings

func (ms *MailboxSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*MailboxSelect) StringsX

func (ms *MailboxSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type MailboxUpdate

type MailboxUpdate struct {
	// contains filtered or unexported fields
}

MailboxUpdate is the builder for updating Mailbox entities.

func (*MailboxUpdate) AddAttributeIDs

func (mu *MailboxUpdate) AddAttributeIDs(ids ...int) *MailboxUpdate

AddAttributeIDs adds the "attributes" edge to the MailboxAttr entity by IDs.

func (*MailboxUpdate) AddAttributes

func (mu *MailboxUpdate) AddAttributes(m ...*MailboxAttr) *MailboxUpdate

AddAttributes adds the "attributes" edges to the MailboxAttr entity.

func (*MailboxUpdate) AddFlagIDs

func (mu *MailboxUpdate) AddFlagIDs(ids ...int) *MailboxUpdate

AddFlagIDs adds the "flags" edge to the MailboxFlag entity by IDs.

func (*MailboxUpdate) AddFlags

func (mu *MailboxUpdate) AddFlags(m ...*MailboxFlag) *MailboxUpdate

AddFlags adds the "flags" edges to the MailboxFlag entity.

func (*MailboxUpdate) AddPermanentFlagIDs

func (mu *MailboxUpdate) AddPermanentFlagIDs(ids ...int) *MailboxUpdate

AddPermanentFlagIDs adds the "permanent_flags" edge to the MailboxPermFlag entity by IDs.

func (*MailboxUpdate) AddPermanentFlags

func (mu *MailboxUpdate) AddPermanentFlags(m ...*MailboxPermFlag) *MailboxUpdate

AddPermanentFlags adds the "permanent_flags" edges to the MailboxPermFlag entity.

func (*MailboxUpdate) AddUIDIDs

func (mu *MailboxUpdate) AddUIDIDs(ids ...int) *MailboxUpdate

AddUIDIDs adds the "UIDs" edge to the UID entity by IDs.

func (*MailboxUpdate) AddUIDNext

func (mu *MailboxUpdate) AddUIDNext(i int) *MailboxUpdate

AddUIDNext adds i to the "UIDNext" field.

func (*MailboxUpdate) AddUIDValidity

func (mu *MailboxUpdate) AddUIDValidity(i int) *MailboxUpdate

AddUIDValidity adds i to the "UIDValidity" field.

func (*MailboxUpdate) AddUIDs

func (mu *MailboxUpdate) AddUIDs(u ...*UID) *MailboxUpdate

AddUIDs adds the "UIDs" edges to the UID entity.

func (*MailboxUpdate) ClearAttributes

func (mu *MailboxUpdate) ClearAttributes() *MailboxUpdate

ClearAttributes clears all "attributes" edges to the MailboxAttr entity.

func (*MailboxUpdate) ClearFlags

func (mu *MailboxUpdate) ClearFlags() *MailboxUpdate

ClearFlags clears all "flags" edges to the MailboxFlag entity.

func (*MailboxUpdate) ClearPermanentFlags

func (mu *MailboxUpdate) ClearPermanentFlags() *MailboxUpdate

ClearPermanentFlags clears all "permanent_flags" edges to the MailboxPermFlag entity.

func (*MailboxUpdate) ClearUIDs

func (mu *MailboxUpdate) ClearUIDs() *MailboxUpdate

ClearUIDs clears all "UIDs" edges to the UID entity.

func (*MailboxUpdate) Exec

func (mu *MailboxUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*MailboxUpdate) ExecX

func (mu *MailboxUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*MailboxUpdate) Mutation

func (mu *MailboxUpdate) Mutation() *MailboxMutation

Mutation returns the MailboxMutation object of the builder.

func (*MailboxUpdate) RemoveAttributeIDs

func (mu *MailboxUpdate) RemoveAttributeIDs(ids ...int) *MailboxUpdate

RemoveAttributeIDs removes the "attributes" edge to MailboxAttr entities by IDs.

func (*MailboxUpdate) RemoveAttributes

func (mu *MailboxUpdate) RemoveAttributes(m ...*MailboxAttr) *MailboxUpdate

RemoveAttributes removes "attributes" edges to MailboxAttr entities.

func (*MailboxUpdate) RemoveFlagIDs

func (mu *MailboxUpdate) RemoveFlagIDs(ids ...int) *MailboxUpdate

RemoveFlagIDs removes the "flags" edge to MailboxFlag entities by IDs.

func (*MailboxUpdate) RemoveFlags

func (mu *MailboxUpdate) RemoveFlags(m ...*MailboxFlag) *MailboxUpdate

RemoveFlags removes "flags" edges to MailboxFlag entities.

func (*MailboxUpdate) RemovePermanentFlagIDs

func (mu *MailboxUpdate) RemovePermanentFlagIDs(ids ...int) *MailboxUpdate

RemovePermanentFlagIDs removes the "permanent_flags" edge to MailboxPermFlag entities by IDs.

func (*MailboxUpdate) RemovePermanentFlags

func (mu *MailboxUpdate) RemovePermanentFlags(m ...*MailboxPermFlag) *MailboxUpdate

RemovePermanentFlags removes "permanent_flags" edges to MailboxPermFlag entities.

func (*MailboxUpdate) RemoveUIDIDs

func (mu *MailboxUpdate) RemoveUIDIDs(ids ...int) *MailboxUpdate

RemoveUIDIDs removes the "UIDs" edge to UID entities by IDs.

func (*MailboxUpdate) RemoveUIDs

func (mu *MailboxUpdate) RemoveUIDs(u ...*UID) *MailboxUpdate

RemoveUIDs removes "UIDs" edges to UID entities.

func (*MailboxUpdate) Save

func (mu *MailboxUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*MailboxUpdate) SaveX

func (mu *MailboxUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*MailboxUpdate) SetMailboxID

func (mu *MailboxUpdate) SetMailboxID(s string) *MailboxUpdate

SetMailboxID sets the "MailboxID" field.

func (*MailboxUpdate) SetName

func (mu *MailboxUpdate) SetName(s string) *MailboxUpdate

SetName sets the "Name" field.

func (*MailboxUpdate) SetNillableSubscribed

func (mu *MailboxUpdate) SetNillableSubscribed(b *bool) *MailboxUpdate

SetNillableSubscribed sets the "Subscribed" field if the given value is not nil.

func (*MailboxUpdate) SetNillableUIDNext

func (mu *MailboxUpdate) SetNillableUIDNext(i *int) *MailboxUpdate

SetNillableUIDNext sets the "UIDNext" field if the given value is not nil.

func (*MailboxUpdate) SetNillableUIDValidity

func (mu *MailboxUpdate) SetNillableUIDValidity(i *int) *MailboxUpdate

SetNillableUIDValidity sets the "UIDValidity" field if the given value is not nil.

func (*MailboxUpdate) SetSubscribed

func (mu *MailboxUpdate) SetSubscribed(b bool) *MailboxUpdate

SetSubscribed sets the "Subscribed" field.

func (*MailboxUpdate) SetUIDNext

func (mu *MailboxUpdate) SetUIDNext(i int) *MailboxUpdate

SetUIDNext sets the "UIDNext" field.

func (*MailboxUpdate) SetUIDValidity

func (mu *MailboxUpdate) SetUIDValidity(i int) *MailboxUpdate

SetUIDValidity sets the "UIDValidity" field.

func (*MailboxUpdate) Where

func (mu *MailboxUpdate) Where(ps ...predicate.Mailbox) *MailboxUpdate

Where appends a list predicates to the MailboxUpdate builder.

type MailboxUpdateOne

type MailboxUpdateOne struct {
	// contains filtered or unexported fields
}

MailboxUpdateOne is the builder for updating a single Mailbox entity.

func (*MailboxUpdateOne) AddAttributeIDs

func (muo *MailboxUpdateOne) AddAttributeIDs(ids ...int) *MailboxUpdateOne

AddAttributeIDs adds the "attributes" edge to the MailboxAttr entity by IDs.

func (*MailboxUpdateOne) AddAttributes

func (muo *MailboxUpdateOne) AddAttributes(m ...*MailboxAttr) *MailboxUpdateOne

AddAttributes adds the "attributes" edges to the MailboxAttr entity.

func (*MailboxUpdateOne) AddFlagIDs

func (muo *MailboxUpdateOne) AddFlagIDs(ids ...int) *MailboxUpdateOne

AddFlagIDs adds the "flags" edge to the MailboxFlag entity by IDs.

func (*MailboxUpdateOne) AddFlags

func (muo *MailboxUpdateOne) AddFlags(m ...*MailboxFlag) *MailboxUpdateOne

AddFlags adds the "flags" edges to the MailboxFlag entity.

func (*MailboxUpdateOne) AddPermanentFlagIDs

func (muo *MailboxUpdateOne) AddPermanentFlagIDs(ids ...int) *MailboxUpdateOne

AddPermanentFlagIDs adds the "permanent_flags" edge to the MailboxPermFlag entity by IDs.

func (*MailboxUpdateOne) AddPermanentFlags

func (muo *MailboxUpdateOne) AddPermanentFlags(m ...*MailboxPermFlag) *MailboxUpdateOne

AddPermanentFlags adds the "permanent_flags" edges to the MailboxPermFlag entity.

func (*MailboxUpdateOne) AddUIDIDs

func (muo *MailboxUpdateOne) AddUIDIDs(ids ...int) *MailboxUpdateOne

AddUIDIDs adds the "UIDs" edge to the UID entity by IDs.

func (*MailboxUpdateOne) AddUIDNext

func (muo *MailboxUpdateOne) AddUIDNext(i int) *MailboxUpdateOne

AddUIDNext adds i to the "UIDNext" field.

func (*MailboxUpdateOne) AddUIDValidity

func (muo *MailboxUpdateOne) AddUIDValidity(i int) *MailboxUpdateOne

AddUIDValidity adds i to the "UIDValidity" field.

func (*MailboxUpdateOne) AddUIDs

func (muo *MailboxUpdateOne) AddUIDs(u ...*UID) *MailboxUpdateOne

AddUIDs adds the "UIDs" edges to the UID entity.

func (*MailboxUpdateOne) ClearAttributes

func (muo *MailboxUpdateOne) ClearAttributes() *MailboxUpdateOne

ClearAttributes clears all "attributes" edges to the MailboxAttr entity.

func (*MailboxUpdateOne) ClearFlags

func (muo *MailboxUpdateOne) ClearFlags() *MailboxUpdateOne

ClearFlags clears all "flags" edges to the MailboxFlag entity.

func (*MailboxUpdateOne) ClearPermanentFlags

func (muo *MailboxUpdateOne) ClearPermanentFlags() *MailboxUpdateOne

ClearPermanentFlags clears all "permanent_flags" edges to the MailboxPermFlag entity.

func (*MailboxUpdateOne) ClearUIDs

func (muo *MailboxUpdateOne) ClearUIDs() *MailboxUpdateOne

ClearUIDs clears all "UIDs" edges to the UID entity.

func (*MailboxUpdateOne) Exec

func (muo *MailboxUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*MailboxUpdateOne) ExecX

func (muo *MailboxUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*MailboxUpdateOne) Mutation

func (muo *MailboxUpdateOne) Mutation() *MailboxMutation

Mutation returns the MailboxMutation object of the builder.

func (*MailboxUpdateOne) RemoveAttributeIDs

func (muo *MailboxUpdateOne) RemoveAttributeIDs(ids ...int) *MailboxUpdateOne

RemoveAttributeIDs removes the "attributes" edge to MailboxAttr entities by IDs.

func (*MailboxUpdateOne) RemoveAttributes

func (muo *MailboxUpdateOne) RemoveAttributes(m ...*MailboxAttr) *MailboxUpdateOne

RemoveAttributes removes "attributes" edges to MailboxAttr entities.

func (*MailboxUpdateOne) RemoveFlagIDs

func (muo *MailboxUpdateOne) RemoveFlagIDs(ids ...int) *MailboxUpdateOne

RemoveFlagIDs removes the "flags" edge to MailboxFlag entities by IDs.

func (*MailboxUpdateOne) RemoveFlags

func (muo *MailboxUpdateOne) RemoveFlags(m ...*MailboxFlag) *MailboxUpdateOne

RemoveFlags removes "flags" edges to MailboxFlag entities.

func (*MailboxUpdateOne) RemovePermanentFlagIDs

func (muo *MailboxUpdateOne) RemovePermanentFlagIDs(ids ...int) *MailboxUpdateOne

RemovePermanentFlagIDs removes the "permanent_flags" edge to MailboxPermFlag entities by IDs.

func (*MailboxUpdateOne) RemovePermanentFlags

func (muo *MailboxUpdateOne) RemovePermanentFlags(m ...*MailboxPermFlag) *MailboxUpdateOne

RemovePermanentFlags removes "permanent_flags" edges to MailboxPermFlag entities.

func (*MailboxUpdateOne) RemoveUIDIDs

func (muo *MailboxUpdateOne) RemoveUIDIDs(ids ...int) *MailboxUpdateOne

RemoveUIDIDs removes the "UIDs" edge to UID entities by IDs.

func (*MailboxUpdateOne) RemoveUIDs

func (muo *MailboxUpdateOne) RemoveUIDs(u ...*UID) *MailboxUpdateOne

RemoveUIDs removes "UIDs" edges to UID entities.

func (*MailboxUpdateOne) Save

func (muo *MailboxUpdateOne) Save(ctx context.Context) (*Mailbox, error)

Save executes the query and returns the updated Mailbox entity.

func (*MailboxUpdateOne) SaveX

func (muo *MailboxUpdateOne) SaveX(ctx context.Context) *Mailbox

SaveX is like Save, but panics if an error occurs.

func (*MailboxUpdateOne) Select

func (muo *MailboxUpdateOne) Select(field string, fields ...string) *MailboxUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*MailboxUpdateOne) SetMailboxID

func (muo *MailboxUpdateOne) SetMailboxID(s string) *MailboxUpdateOne

SetMailboxID sets the "MailboxID" field.

func (*MailboxUpdateOne) SetName

func (muo *MailboxUpdateOne) SetName(s string) *MailboxUpdateOne

SetName sets the "Name" field.

func (*MailboxUpdateOne) SetNillableSubscribed

func (muo *MailboxUpdateOne) SetNillableSubscribed(b *bool) *MailboxUpdateOne

SetNillableSubscribed sets the "Subscribed" field if the given value is not nil.

func (*MailboxUpdateOne) SetNillableUIDNext

func (muo *MailboxUpdateOne) SetNillableUIDNext(i *int) *MailboxUpdateOne

SetNillableUIDNext sets the "UIDNext" field if the given value is not nil.

func (*MailboxUpdateOne) SetNillableUIDValidity

func (muo *MailboxUpdateOne) SetNillableUIDValidity(i *int) *MailboxUpdateOne

SetNillableUIDValidity sets the "UIDValidity" field if the given value is not nil.

func (*MailboxUpdateOne) SetSubscribed

func (muo *MailboxUpdateOne) SetSubscribed(b bool) *MailboxUpdateOne

SetSubscribed sets the "Subscribed" field.

func (*MailboxUpdateOne) SetUIDNext

func (muo *MailboxUpdateOne) SetUIDNext(i int) *MailboxUpdateOne

SetUIDNext sets the "UIDNext" field.

func (*MailboxUpdateOne) SetUIDValidity

func (muo *MailboxUpdateOne) SetUIDValidity(i int) *MailboxUpdateOne

SetUIDValidity sets the "UIDValidity" field.

type Mailboxes

type Mailboxes []*Mailbox

Mailboxes is a parsable slice of Mailbox.

type Message

type Message struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// MessageID holds the value of the "MessageID" field.
	MessageID string `json:"MessageID,omitempty"`
	// InternalID holds the value of the "InternalID" field.
	InternalID string `json:"InternalID,omitempty"`
	// Date holds the value of the "Date" field.
	Date time.Time `json:"Date,omitempty"`
	// Size holds the value of the "Size" field.
	Size int `json:"Size,omitempty"`
	// Body holds the value of the "Body" field.
	Body string `json:"Body,omitempty"`
	// BodyStructure holds the value of the "BodyStructure" field.
	BodyStructure string `json:"BodyStructure,omitempty"`
	// Envelope holds the value of the "Envelope" field.
	Envelope string `json:"Envelope,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the MessageQuery when eager-loading is set.
	Edges MessageEdges `json:"edges"`
	// contains filtered or unexported fields
}

Message is the model entity for the Message schema.

func (*Message) QueryFlags

func (m *Message) QueryFlags() *MessageFlagQuery

QueryFlags queries the "flags" edge of the Message entity.

func (*Message) QueryUIDs

func (m *Message) QueryUIDs() *UIDQuery

QueryUIDs queries the "UIDs" edge of the Message entity.

func (*Message) String

func (m *Message) String() string

String implements the fmt.Stringer.

func (*Message) Unwrap

func (m *Message) Unwrap() *Message

Unwrap unwraps the Message entity that was returned from a transaction after it was closed, so that all future queries will be executed through the driver which created the transaction.

func (*Message) Update

func (m *Message) Update() *MessageUpdateOne

Update returns a builder for updating this Message. Note that you need to call Message.Unwrap() before calling this method if this Message was returned from a transaction, and the transaction was committed or rolled back.

type MessageClient

type MessageClient struct {
	// contains filtered or unexported fields
}

MessageClient is a client for the Message schema.

func NewMessageClient

func NewMessageClient(c config) *MessageClient

NewMessageClient returns a client for the Message from the given config.

func (*MessageClient) Create

func (c *MessageClient) Create() *MessageCreate

Create returns a create builder for Message.

func (*MessageClient) CreateBulk

func (c *MessageClient) CreateBulk(builders ...*MessageCreate) *MessageCreateBulk

CreateBulk returns a builder for creating a bulk of Message entities.

func (*MessageClient) Delete

func (c *MessageClient) Delete() *MessageDelete

Delete returns a delete builder for Message.

func (*MessageClient) DeleteOne

func (c *MessageClient) DeleteOne(m *Message) *MessageDeleteOne

DeleteOne returns a delete builder for the given entity.

func (*MessageClient) DeleteOneID

func (c *MessageClient) DeleteOneID(id int) *MessageDeleteOne

DeleteOneID returns a delete builder for the given id.

func (*MessageClient) Get

func (c *MessageClient) Get(ctx context.Context, id int) (*Message, error)

Get returns a Message entity by its id.

func (*MessageClient) GetX

func (c *MessageClient) GetX(ctx context.Context, id int) *Message

GetX is like Get, but panics if an error occurs.

func (*MessageClient) Hooks

func (c *MessageClient) Hooks() []Hook

Hooks returns the client hooks.

func (*MessageClient) Query

func (c *MessageClient) Query() *MessageQuery

Query returns a query builder for Message.

func (*MessageClient) QueryFlags

func (c *MessageClient) QueryFlags(m *Message) *MessageFlagQuery

QueryFlags queries the flags edge of a Message.

func (*MessageClient) QueryUIDs

func (c *MessageClient) QueryUIDs(m *Message) *UIDQuery

QueryUIDs queries the UIDs edge of a Message.

func (*MessageClient) Update

func (c *MessageClient) Update() *MessageUpdate

Update returns an update builder for Message.

func (*MessageClient) UpdateOne

func (c *MessageClient) UpdateOne(m *Message) *MessageUpdateOne

UpdateOne returns an update builder for the given entity.

func (*MessageClient) UpdateOneID

func (c *MessageClient) UpdateOneID(id int) *MessageUpdateOne

UpdateOneID returns an update builder for the given id.

func (*MessageClient) Use

func (c *MessageClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `message.Hooks(f(g(h())))`.

type MessageCreate

type MessageCreate struct {
	// contains filtered or unexported fields
}

MessageCreate is the builder for creating a Message entity.

func (*MessageCreate) AddFlagIDs

func (mc *MessageCreate) AddFlagIDs(ids ...int) *MessageCreate

AddFlagIDs adds the "flags" edge to the MessageFlag entity by IDs.

func (*MessageCreate) AddFlags

func (mc *MessageCreate) AddFlags(m ...*MessageFlag) *MessageCreate

AddFlags adds the "flags" edges to the MessageFlag entity.

func (*MessageCreate) AddUIDIDs

func (mc *MessageCreate) AddUIDIDs(ids ...int) *MessageCreate

AddUIDIDs adds the "UIDs" edge to the UID entity by IDs.

func (*MessageCreate) AddUIDs

func (mc *MessageCreate) AddUIDs(u ...*UID) *MessageCreate

AddUIDs adds the "UIDs" edges to the UID entity.

func (*MessageCreate) Exec

func (mc *MessageCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*MessageCreate) ExecX

func (mc *MessageCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*MessageCreate) Mutation

func (mc *MessageCreate) Mutation() *MessageMutation

Mutation returns the MessageMutation object of the builder.

func (*MessageCreate) Save

func (mc *MessageCreate) Save(ctx context.Context) (*Message, error)

Save creates the Message in the database.

func (*MessageCreate) SaveX

func (mc *MessageCreate) SaveX(ctx context.Context) *Message

SaveX calls Save and panics if Save returns an error.

func (*MessageCreate) SetBody

func (mc *MessageCreate) SetBody(s string) *MessageCreate

SetBody sets the "Body" field.

func (*MessageCreate) SetBodyStructure

func (mc *MessageCreate) SetBodyStructure(s string) *MessageCreate

SetBodyStructure sets the "BodyStructure" field.

func (*MessageCreate) SetDate

func (mc *MessageCreate) SetDate(t time.Time) *MessageCreate

SetDate sets the "Date" field.

func (*MessageCreate) SetEnvelope

func (mc *MessageCreate) SetEnvelope(s string) *MessageCreate

SetEnvelope sets the "Envelope" field.

func (*MessageCreate) SetInternalID

func (mc *MessageCreate) SetInternalID(s string) *MessageCreate

SetInternalID sets the "InternalID" field.

func (*MessageCreate) SetMessageID

func (mc *MessageCreate) SetMessageID(s string) *MessageCreate

SetMessageID sets the "MessageID" field.

func (*MessageCreate) SetSize

func (mc *MessageCreate) SetSize(i int) *MessageCreate

SetSize sets the "Size" field.

type MessageCreateBulk

type MessageCreateBulk struct {
	// contains filtered or unexported fields
}

MessageCreateBulk is the builder for creating many Message entities in bulk.

func (*MessageCreateBulk) Exec

func (mcb *MessageCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*MessageCreateBulk) ExecX

func (mcb *MessageCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*MessageCreateBulk) Save

func (mcb *MessageCreateBulk) Save(ctx context.Context) ([]*Message, error)

Save creates the Message entities in the database.

func (*MessageCreateBulk) SaveX

func (mcb *MessageCreateBulk) SaveX(ctx context.Context) []*Message

SaveX is like Save, but panics if an error occurs.

type MessageDelete

type MessageDelete struct {
	// contains filtered or unexported fields
}

MessageDelete is the builder for deleting a Message entity.

func (*MessageDelete) Exec

func (md *MessageDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*MessageDelete) ExecX

func (md *MessageDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*MessageDelete) Where

func (md *MessageDelete) Where(ps ...predicate.Message) *MessageDelete

Where appends a list predicates to the MessageDelete builder.

type MessageDeleteOne

type MessageDeleteOne struct {
	// contains filtered or unexported fields
}

MessageDeleteOne is the builder for deleting a single Message entity.

func (*MessageDeleteOne) Exec

func (mdo *MessageDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*MessageDeleteOne) ExecX

func (mdo *MessageDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

type MessageEdges

type MessageEdges struct {
	// Flags holds the value of the flags edge.
	Flags []*MessageFlag `json:"flags,omitempty"`
	// UIDs holds the value of the UIDs edge.
	UIDs []*UID `json:"UIDs,omitempty"`
	// contains filtered or unexported fields
}

MessageEdges holds the relations/edges for other nodes in the graph.

func (MessageEdges) FlagsOrErr

func (e MessageEdges) FlagsOrErr() ([]*MessageFlag, error)

FlagsOrErr returns the Flags value or an error if the edge was not loaded in eager-loading.

func (MessageEdges) UIDsOrErr

func (e MessageEdges) UIDsOrErr() ([]*UID, error)

UIDsOrErr returns the UIDs value or an error if the edge was not loaded in eager-loading.

type MessageFlag

type MessageFlag struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// Value holds the value of the "Value" field.
	Value string `json:"Value,omitempty"`
	// contains filtered or unexported fields
}

MessageFlag is the model entity for the MessageFlag schema.

func (*MessageFlag) String

func (mf *MessageFlag) String() string

String implements the fmt.Stringer.

func (*MessageFlag) Unwrap

func (mf *MessageFlag) Unwrap() *MessageFlag

Unwrap unwraps the MessageFlag entity that was returned from a transaction after it was closed, so that all future queries will be executed through the driver which created the transaction.

func (*MessageFlag) Update

func (mf *MessageFlag) Update() *MessageFlagUpdateOne

Update returns a builder for updating this MessageFlag. Note that you need to call MessageFlag.Unwrap() before calling this method if this MessageFlag was returned from a transaction, and the transaction was committed or rolled back.

type MessageFlagClient

type MessageFlagClient struct {
	// contains filtered or unexported fields
}

MessageFlagClient is a client for the MessageFlag schema.

func NewMessageFlagClient

func NewMessageFlagClient(c config) *MessageFlagClient

NewMessageFlagClient returns a client for the MessageFlag from the given config.

func (*MessageFlagClient) Create

func (c *MessageFlagClient) Create() *MessageFlagCreate

Create returns a create builder for MessageFlag.

func (*MessageFlagClient) CreateBulk

func (c *MessageFlagClient) CreateBulk(builders ...*MessageFlagCreate) *MessageFlagCreateBulk

CreateBulk returns a builder for creating a bulk of MessageFlag entities.

func (*MessageFlagClient) Delete

func (c *MessageFlagClient) Delete() *MessageFlagDelete

Delete returns a delete builder for MessageFlag.

func (*MessageFlagClient) DeleteOne

DeleteOne returns a delete builder for the given entity.

func (*MessageFlagClient) DeleteOneID

func (c *MessageFlagClient) DeleteOneID(id int) *MessageFlagDeleteOne

DeleteOneID returns a delete builder for the given id.

func (*MessageFlagClient) Get

func (c *MessageFlagClient) Get(ctx context.Context, id int) (*MessageFlag, error)

Get returns a MessageFlag entity by its id.

func (*MessageFlagClient) GetX

func (c *MessageFlagClient) GetX(ctx context.Context, id int) *MessageFlag

GetX is like Get, but panics if an error occurs.

func (*MessageFlagClient) Hooks

func (c *MessageFlagClient) Hooks() []Hook

Hooks returns the client hooks.

func (*MessageFlagClient) Query

func (c *MessageFlagClient) Query() *MessageFlagQuery

Query returns a query builder for MessageFlag.

func (*MessageFlagClient) Update

func (c *MessageFlagClient) Update() *MessageFlagUpdate

Update returns an update builder for MessageFlag.

func (*MessageFlagClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*MessageFlagClient) UpdateOneID

func (c *MessageFlagClient) UpdateOneID(id int) *MessageFlagUpdateOne

UpdateOneID returns an update builder for the given id.

func (*MessageFlagClient) Use

func (c *MessageFlagClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `messageflag.Hooks(f(g(h())))`.

type MessageFlagCreate

type MessageFlagCreate struct {
	// contains filtered or unexported fields
}

MessageFlagCreate is the builder for creating a MessageFlag entity.

func (*MessageFlagCreate) Exec

func (mfc *MessageFlagCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*MessageFlagCreate) ExecX

func (mfc *MessageFlagCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*MessageFlagCreate) Mutation

func (mfc *MessageFlagCreate) Mutation() *MessageFlagMutation

Mutation returns the MessageFlagMutation object of the builder.

func (*MessageFlagCreate) Save

func (mfc *MessageFlagCreate) Save(ctx context.Context) (*MessageFlag, error)

Save creates the MessageFlag in the database.

func (*MessageFlagCreate) SaveX

func (mfc *MessageFlagCreate) SaveX(ctx context.Context) *MessageFlag

SaveX calls Save and panics if Save returns an error.

func (*MessageFlagCreate) SetValue

func (mfc *MessageFlagCreate) SetValue(s string) *MessageFlagCreate

SetValue sets the "Value" field.

type MessageFlagCreateBulk

type MessageFlagCreateBulk struct {
	// contains filtered or unexported fields
}

MessageFlagCreateBulk is the builder for creating many MessageFlag entities in bulk.

func (*MessageFlagCreateBulk) Exec

func (mfcb *MessageFlagCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*MessageFlagCreateBulk) ExecX

func (mfcb *MessageFlagCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*MessageFlagCreateBulk) Save

func (mfcb *MessageFlagCreateBulk) Save(ctx context.Context) ([]*MessageFlag, error)

Save creates the MessageFlag entities in the database.

func (*MessageFlagCreateBulk) SaveX

func (mfcb *MessageFlagCreateBulk) SaveX(ctx context.Context) []*MessageFlag

SaveX is like Save, but panics if an error occurs.

type MessageFlagDelete

type MessageFlagDelete struct {
	// contains filtered or unexported fields
}

MessageFlagDelete is the builder for deleting a MessageFlag entity.

func (*MessageFlagDelete) Exec

func (mfd *MessageFlagDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*MessageFlagDelete) ExecX

func (mfd *MessageFlagDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*MessageFlagDelete) Where

Where appends a list predicates to the MessageFlagDelete builder.

type MessageFlagDeleteOne

type MessageFlagDeleteOne struct {
	// contains filtered or unexported fields
}

MessageFlagDeleteOne is the builder for deleting a single MessageFlag entity.

func (*MessageFlagDeleteOne) Exec

func (mfdo *MessageFlagDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*MessageFlagDeleteOne) ExecX

func (mfdo *MessageFlagDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

type MessageFlagGroupBy

type MessageFlagGroupBy struct {
	// contains filtered or unexported fields
}

MessageFlagGroupBy is the group-by builder for MessageFlag entities.

func (*MessageFlagGroupBy) Aggregate

func (mfgb *MessageFlagGroupBy) Aggregate(fns ...AggregateFunc) *MessageFlagGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*MessageFlagGroupBy) Bool

func (mfgb *MessageFlagGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a group-by query. It is only allowed when executing a group-by query with one field.

func (*MessageFlagGroupBy) BoolX

func (mfgb *MessageFlagGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*MessageFlagGroupBy) Bools

func (mfgb *MessageFlagGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from group-by. It is only allowed when executing a group-by query with one field.

func (*MessageFlagGroupBy) BoolsX

func (mfgb *MessageFlagGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*MessageFlagGroupBy) Float64

func (mfgb *MessageFlagGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a group-by query. It is only allowed when executing a group-by query with one field.

func (*MessageFlagGroupBy) Float64X

func (mfgb *MessageFlagGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*MessageFlagGroupBy) Float64s

func (mfgb *MessageFlagGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from group-by. It is only allowed when executing a group-by query with one field.

func (*MessageFlagGroupBy) Float64sX

func (mfgb *MessageFlagGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*MessageFlagGroupBy) Int

func (mfgb *MessageFlagGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a group-by query. It is only allowed when executing a group-by query with one field.

func (*MessageFlagGroupBy) IntX

func (mfgb *MessageFlagGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*MessageFlagGroupBy) Ints

func (mfgb *MessageFlagGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from group-by. It is only allowed when executing a group-by query with one field.

func (*MessageFlagGroupBy) IntsX

func (mfgb *MessageFlagGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*MessageFlagGroupBy) Scan

func (mfgb *MessageFlagGroupBy) Scan(ctx context.Context, v interface{}) error

Scan applies the group-by query and scans the result into the given value.

func (*MessageFlagGroupBy) ScanX

func (mfgb *MessageFlagGroupBy) ScanX(ctx context.Context, v interface{})

ScanX is like Scan, but panics if an error occurs.

func (*MessageFlagGroupBy) String

func (mfgb *MessageFlagGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a group-by query. It is only allowed when executing a group-by query with one field.

func (*MessageFlagGroupBy) StringX

func (mfgb *MessageFlagGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*MessageFlagGroupBy) Strings

func (mfgb *MessageFlagGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from group-by. It is only allowed when executing a group-by query with one field.

func (*MessageFlagGroupBy) StringsX

func (mfgb *MessageFlagGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type MessageFlagMutation

type MessageFlagMutation struct {
	// contains filtered or unexported fields
}

MessageFlagMutation represents an operation that mutates the MessageFlag nodes in the graph.

func (*MessageFlagMutation) AddField

func (m *MessageFlagMutation) AddField(name string, value ent.Value) error

AddField adds the value to the field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*MessageFlagMutation) AddedEdges

func (m *MessageFlagMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*MessageFlagMutation) AddedField

func (m *MessageFlagMutation) AddedField(name string) (ent.Value, bool)

AddedField returns the numeric value that was incremented/decremented on a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*MessageFlagMutation) AddedFields

func (m *MessageFlagMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*MessageFlagMutation) AddedIDs

func (m *MessageFlagMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*MessageFlagMutation) ClearEdge

func (m *MessageFlagMutation) ClearEdge(name string) error

ClearEdge clears the value of the edge with the given name. It returns an error if that edge is not defined in the schema.

func (*MessageFlagMutation) ClearField

func (m *MessageFlagMutation) ClearField(name string) error

ClearField clears the value of the field with the given name. It returns an error if the field is not defined in the schema.

func (*MessageFlagMutation) ClearedEdges

func (m *MessageFlagMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*MessageFlagMutation) ClearedFields

func (m *MessageFlagMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (MessageFlagMutation) Client

func (m MessageFlagMutation) Client() *Client

Client returns a new `ent.Client` from the mutation. If the mutation was executed in a transaction (ent.Tx), a transactional client is returned.

func (*MessageFlagMutation) EdgeCleared

func (m *MessageFlagMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*MessageFlagMutation) Field

func (m *MessageFlagMutation) Field(name string) (ent.Value, bool)

Field returns the value of a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*MessageFlagMutation) FieldCleared

func (m *MessageFlagMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*MessageFlagMutation) Fields

func (m *MessageFlagMutation) Fields() []string

Fields returns all fields that were changed during this mutation. Note that in order to get all numeric fields that were incremented/decremented, call AddedFields().

func (*MessageFlagMutation) ID

func (m *MessageFlagMutation) ID() (id int, exists bool)

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.

func (*MessageFlagMutation) IDs

func (m *MessageFlagMutation) IDs(ctx context.Context) ([]int, error)

IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.

func (*MessageFlagMutation) OldField

func (m *MessageFlagMutation) OldField(ctx context.Context, name string) (ent.Value, error)

OldField returns the old value of the field from the database. An error is returned if the mutation operation is not UpdateOne, or the query to the database failed.

func (*MessageFlagMutation) OldValue

func (m *MessageFlagMutation) OldValue(ctx context.Context) (v string, err error)

OldValue returns the old "Value" field's value of the MessageFlag entity. If the MessageFlag object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*MessageFlagMutation) Op

func (m *MessageFlagMutation) Op() Op

Op returns the operation name.

func (*MessageFlagMutation) RemovedEdges

func (m *MessageFlagMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*MessageFlagMutation) RemovedIDs

func (m *MessageFlagMutation) RemovedIDs(name string) []ent.Value

RemovedIDs returns all IDs (to other nodes) that were removed for the edge with the given name in this mutation.

func (*MessageFlagMutation) ResetEdge

func (m *MessageFlagMutation) ResetEdge(name string) error

ResetEdge resets all changes to the edge with the given name in this mutation. It returns an error if the edge is not defined in the schema.

func (*MessageFlagMutation) ResetField

func (m *MessageFlagMutation) ResetField(name string) error

ResetField resets all changes in the mutation for the field with the given name. It returns an error if the field is not defined in the schema.

func (*MessageFlagMutation) ResetValue

func (m *MessageFlagMutation) ResetValue()

ResetValue resets all changes to the "Value" field.

func (*MessageFlagMutation) SetField

func (m *MessageFlagMutation) SetField(name string, value ent.Value) error

SetField sets the value of a field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*MessageFlagMutation) SetValue

func (m *MessageFlagMutation) SetValue(s string)

SetValue sets the "Value" field.

func (MessageFlagMutation) Tx

func (m MessageFlagMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*MessageFlagMutation) Type

func (m *MessageFlagMutation) Type() string

Type returns the node type of this mutation (MessageFlag).

func (*MessageFlagMutation) Value

func (m *MessageFlagMutation) Value() (r string, exists bool)

Value returns the value of the "Value" field in the mutation.

func (*MessageFlagMutation) Where

func (m *MessageFlagMutation) Where(ps ...predicate.MessageFlag)

Where appends a list predicates to the MessageFlagMutation builder.

type MessageFlagQuery

type MessageFlagQuery struct {
	// contains filtered or unexported fields
}

MessageFlagQuery is the builder for querying MessageFlag entities.

func (*MessageFlagQuery) All

func (mfq *MessageFlagQuery) All(ctx context.Context) ([]*MessageFlag, error)

All executes the query and returns a list of MessageFlags.

func (*MessageFlagQuery) AllX

func (mfq *MessageFlagQuery) AllX(ctx context.Context) []*MessageFlag

AllX is like All, but panics if an error occurs.

func (*MessageFlagQuery) Clone

func (mfq *MessageFlagQuery) Clone() *MessageFlagQuery

Clone returns a duplicate of the MessageFlagQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*MessageFlagQuery) Count

func (mfq *MessageFlagQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*MessageFlagQuery) CountX

func (mfq *MessageFlagQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*MessageFlagQuery) Exist

func (mfq *MessageFlagQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*MessageFlagQuery) ExistX

func (mfq *MessageFlagQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*MessageFlagQuery) First

func (mfq *MessageFlagQuery) First(ctx context.Context) (*MessageFlag, error)

First returns the first MessageFlag entity from the query. Returns a *NotFoundError when no MessageFlag was found.

func (*MessageFlagQuery) FirstID

func (mfq *MessageFlagQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first MessageFlag ID from the query. Returns a *NotFoundError when no MessageFlag ID was found.

func (*MessageFlagQuery) FirstIDX

func (mfq *MessageFlagQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*MessageFlagQuery) FirstX

func (mfq *MessageFlagQuery) FirstX(ctx context.Context) *MessageFlag

FirstX is like First, but panics if an error occurs.

func (*MessageFlagQuery) GroupBy

func (mfq *MessageFlagQuery) GroupBy(field string, fields ...string) *MessageFlagGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

Example:

var v []struct {
	Value string `json:"Value,omitempty"`
	Count int `json:"count,omitempty"`
}

client.MessageFlag.Query().
	GroupBy(messageflag.FieldValue).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*MessageFlagQuery) IDs

func (mfq *MessageFlagQuery) IDs(ctx context.Context) ([]int, error)

IDs executes the query and returns a list of MessageFlag IDs.

func (*MessageFlagQuery) IDsX

func (mfq *MessageFlagQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*MessageFlagQuery) Limit

func (mfq *MessageFlagQuery) Limit(limit int) *MessageFlagQuery

Limit adds a limit step to the query.

func (*MessageFlagQuery) Offset

func (mfq *MessageFlagQuery) Offset(offset int) *MessageFlagQuery

Offset adds an offset step to the query.

func (*MessageFlagQuery) Only

func (mfq *MessageFlagQuery) Only(ctx context.Context) (*MessageFlag, error)

Only returns a single MessageFlag entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one MessageFlag entity is found. Returns a *NotFoundError when no MessageFlag entities are found.

func (*MessageFlagQuery) OnlyID

func (mfq *MessageFlagQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only MessageFlag ID in the query. Returns a *NotSingularError when more than one MessageFlag ID is found. Returns a *NotFoundError when no entities are found.

func (*MessageFlagQuery) OnlyIDX

func (mfq *MessageFlagQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*MessageFlagQuery) OnlyX

func (mfq *MessageFlagQuery) OnlyX(ctx context.Context) *MessageFlag

OnlyX is like Only, but panics if an error occurs.

func (*MessageFlagQuery) Order

func (mfq *MessageFlagQuery) Order(o ...OrderFunc) *MessageFlagQuery

Order adds an order step to the query.

func (*MessageFlagQuery) Select

func (mfq *MessageFlagQuery) Select(fields ...string) *MessageFlagSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	Value string `json:"Value,omitempty"`
}

client.MessageFlag.Query().
	Select(messageflag.FieldValue).
	Scan(ctx, &v)

func (*MessageFlagQuery) Unique

func (mfq *MessageFlagQuery) Unique(unique bool) *MessageFlagQuery

Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.

func (*MessageFlagQuery) Where

Where adds a new predicate for the MessageFlagQuery builder.

type MessageFlagSelect

type MessageFlagSelect struct {
	*MessageFlagQuery
	// contains filtered or unexported fields
}

MessageFlagSelect is the builder for selecting fields of MessageFlag entities.

func (*MessageFlagSelect) Bool

func (mfs *MessageFlagSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*MessageFlagSelect) BoolX

func (mfs *MessageFlagSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*MessageFlagSelect) Bools

func (mfs *MessageFlagSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*MessageFlagSelect) BoolsX

func (mfs *MessageFlagSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*MessageFlagSelect) Float64

func (mfs *MessageFlagSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*MessageFlagSelect) Float64X

func (mfs *MessageFlagSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*MessageFlagSelect) Float64s

func (mfs *MessageFlagSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*MessageFlagSelect) Float64sX

func (mfs *MessageFlagSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*MessageFlagSelect) Int

func (mfs *MessageFlagSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*MessageFlagSelect) IntX

func (mfs *MessageFlagSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*MessageFlagSelect) Ints

func (mfs *MessageFlagSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*MessageFlagSelect) IntsX

func (mfs *MessageFlagSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*MessageFlagSelect) Scan

func (mfs *MessageFlagSelect) Scan(ctx context.Context, v interface{}) error

Scan applies the selector query and scans the result into the given value.

func (*MessageFlagSelect) ScanX

func (mfs *MessageFlagSelect) ScanX(ctx context.Context, v interface{})

ScanX is like Scan, but panics if an error occurs.

func (*MessageFlagSelect) String

func (mfs *MessageFlagSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*MessageFlagSelect) StringX

func (mfs *MessageFlagSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*MessageFlagSelect) Strings

func (mfs *MessageFlagSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*MessageFlagSelect) StringsX

func (mfs *MessageFlagSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type MessageFlagUpdate

type MessageFlagUpdate struct {
	// contains filtered or unexported fields
}

MessageFlagUpdate is the builder for updating MessageFlag entities.

func (*MessageFlagUpdate) Exec

func (mfu *MessageFlagUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*MessageFlagUpdate) ExecX

func (mfu *MessageFlagUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*MessageFlagUpdate) Mutation

func (mfu *MessageFlagUpdate) Mutation() *MessageFlagMutation

Mutation returns the MessageFlagMutation object of the builder.

func (*MessageFlagUpdate) Save

func (mfu *MessageFlagUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*MessageFlagUpdate) SaveX

func (mfu *MessageFlagUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*MessageFlagUpdate) SetValue

func (mfu *MessageFlagUpdate) SetValue(s string) *MessageFlagUpdate

SetValue sets the "Value" field.

func (*MessageFlagUpdate) Where

Where appends a list predicates to the MessageFlagUpdate builder.

type MessageFlagUpdateOne

type MessageFlagUpdateOne struct {
	// contains filtered or unexported fields
}

MessageFlagUpdateOne is the builder for updating a single MessageFlag entity.

func (*MessageFlagUpdateOne) Exec

func (mfuo *MessageFlagUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*MessageFlagUpdateOne) ExecX

func (mfuo *MessageFlagUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*MessageFlagUpdateOne) Mutation

func (mfuo *MessageFlagUpdateOne) Mutation() *MessageFlagMutation

Mutation returns the MessageFlagMutation object of the builder.

func (*MessageFlagUpdateOne) Save

Save executes the query and returns the updated MessageFlag entity.

func (*MessageFlagUpdateOne) SaveX

func (mfuo *MessageFlagUpdateOne) SaveX(ctx context.Context) *MessageFlag

SaveX is like Save, but panics if an error occurs.

func (*MessageFlagUpdateOne) Select

func (mfuo *MessageFlagUpdateOne) Select(field string, fields ...string) *MessageFlagUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*MessageFlagUpdateOne) SetValue

SetValue sets the "Value" field.

type MessageFlags

type MessageFlags []*MessageFlag

MessageFlags is a parsable slice of MessageFlag.

type MessageGroupBy

type MessageGroupBy struct {
	// contains filtered or unexported fields
}

MessageGroupBy is the group-by builder for Message entities.

func (*MessageGroupBy) Aggregate

func (mgb *MessageGroupBy) Aggregate(fns ...AggregateFunc) *MessageGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*MessageGroupBy) Bool

func (mgb *MessageGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a group-by query. It is only allowed when executing a group-by query with one field.

func (*MessageGroupBy) BoolX

func (mgb *MessageGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*MessageGroupBy) Bools

func (mgb *MessageGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from group-by. It is only allowed when executing a group-by query with one field.

func (*MessageGroupBy) BoolsX

func (mgb *MessageGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*MessageGroupBy) Float64

func (mgb *MessageGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a group-by query. It is only allowed when executing a group-by query with one field.

func (*MessageGroupBy) Float64X

func (mgb *MessageGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*MessageGroupBy) Float64s

func (mgb *MessageGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from group-by. It is only allowed when executing a group-by query with one field.

func (*MessageGroupBy) Float64sX

func (mgb *MessageGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*MessageGroupBy) Int

func (mgb *MessageGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a group-by query. It is only allowed when executing a group-by query with one field.

func (*MessageGroupBy) IntX

func (mgb *MessageGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*MessageGroupBy) Ints

func (mgb *MessageGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from group-by. It is only allowed when executing a group-by query with one field.

func (*MessageGroupBy) IntsX

func (mgb *MessageGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*MessageGroupBy) Scan

func (mgb *MessageGroupBy) Scan(ctx context.Context, v interface{}) error

Scan applies the group-by query and scans the result into the given value.

func (*MessageGroupBy) ScanX

func (mgb *MessageGroupBy) ScanX(ctx context.Context, v interface{})

ScanX is like Scan, but panics if an error occurs.

func (*MessageGroupBy) String

func (mgb *MessageGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a group-by query. It is only allowed when executing a group-by query with one field.

func (*MessageGroupBy) StringX

func (mgb *MessageGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*MessageGroupBy) Strings

func (mgb *MessageGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from group-by. It is only allowed when executing a group-by query with one field.

func (*MessageGroupBy) StringsX

func (mgb *MessageGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type MessageMutation

type MessageMutation struct {
	// contains filtered or unexported fields
}

MessageMutation represents an operation that mutates the Message nodes in the graph.

func (*MessageMutation) AddField

func (m *MessageMutation) AddField(name string, value ent.Value) error

AddField adds the value to the field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*MessageMutation) AddFlagIDs

func (m *MessageMutation) AddFlagIDs(ids ...int)

AddFlagIDs adds the "flags" edge to the MessageFlag entity by ids.

func (*MessageMutation) AddSize

func (m *MessageMutation) AddSize(i int)

AddSize adds i to the "Size" field.

func (*MessageMutation) AddUIDIDs

func (m *MessageMutation) AddUIDIDs(ids ...int)

AddUIDIDs adds the "UIDs" edge to the UID entity by ids.

func (*MessageMutation) AddedEdges

func (m *MessageMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*MessageMutation) AddedField

func (m *MessageMutation) AddedField(name string) (ent.Value, bool)

AddedField returns the numeric value that was incremented/decremented on a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*MessageMutation) AddedFields

func (m *MessageMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*MessageMutation) AddedIDs

func (m *MessageMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*MessageMutation) AddedSize

func (m *MessageMutation) AddedSize() (r int, exists bool)

AddedSize returns the value that was added to the "Size" field in this mutation.

func (*MessageMutation) Body

func (m *MessageMutation) Body() (r string, exists bool)

Body returns the value of the "Body" field in the mutation.

func (*MessageMutation) BodyStructure

func (m *MessageMutation) BodyStructure() (r string, exists bool)

BodyStructure returns the value of the "BodyStructure" field in the mutation.

func (*MessageMutation) ClearEdge

func (m *MessageMutation) ClearEdge(name string) error

ClearEdge clears the value of the edge with the given name. It returns an error if that edge is not defined in the schema.

func (*MessageMutation) ClearField

func (m *MessageMutation) ClearField(name string) error

ClearField clears the value of the field with the given name. It returns an error if the field is not defined in the schema.

func (*MessageMutation) ClearFlags

func (m *MessageMutation) ClearFlags()

ClearFlags clears the "flags" edge to the MessageFlag entity.

func (*MessageMutation) ClearUIDs

func (m *MessageMutation) ClearUIDs()

ClearUIDs clears the "UIDs" edge to the UID entity.

func (*MessageMutation) ClearedEdges

func (m *MessageMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*MessageMutation) ClearedFields

func (m *MessageMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (MessageMutation) Client

func (m MessageMutation) Client() *Client

Client returns a new `ent.Client` from the mutation. If the mutation was executed in a transaction (ent.Tx), a transactional client is returned.

func (*MessageMutation) Date

func (m *MessageMutation) Date() (r time.Time, exists bool)

Date returns the value of the "Date" field in the mutation.

func (*MessageMutation) EdgeCleared

func (m *MessageMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*MessageMutation) Envelope

func (m *MessageMutation) Envelope() (r string, exists bool)

Envelope returns the value of the "Envelope" field in the mutation.

func (*MessageMutation) Field

func (m *MessageMutation) Field(name string) (ent.Value, bool)

Field returns the value of a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*MessageMutation) FieldCleared

func (m *MessageMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*MessageMutation) Fields

func (m *MessageMutation) Fields() []string

Fields returns all fields that were changed during this mutation. Note that in order to get all numeric fields that were incremented/decremented, call AddedFields().

func (*MessageMutation) FlagsCleared

func (m *MessageMutation) FlagsCleared() bool

FlagsCleared reports if the "flags" edge to the MessageFlag entity was cleared.

func (*MessageMutation) FlagsIDs

func (m *MessageMutation) FlagsIDs() (ids []int)

FlagsIDs returns the "flags" edge IDs in the mutation.

func (*MessageMutation) ID

func (m *MessageMutation) ID() (id int, exists bool)

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.

func (*MessageMutation) IDs

func (m *MessageMutation) IDs(ctx context.Context) ([]int, error)

IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.

func (*MessageMutation) InternalID

func (m *MessageMutation) InternalID() (r string, exists bool)

InternalID returns the value of the "InternalID" field in the mutation.

func (*MessageMutation) MessageID

func (m *MessageMutation) MessageID() (r string, exists bool)

MessageID returns the value of the "MessageID" field in the mutation.

func (*MessageMutation) OldBody

func (m *MessageMutation) OldBody(ctx context.Context) (v string, err error)

OldBody returns the old "Body" field's value of the Message entity. If the Message object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*MessageMutation) OldBodyStructure

func (m *MessageMutation) OldBodyStructure(ctx context.Context) (v string, err error)

OldBodyStructure returns the old "BodyStructure" field's value of the Message entity. If the Message object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*MessageMutation) OldDate

func (m *MessageMutation) OldDate(ctx context.Context) (v time.Time, err error)

OldDate returns the old "Date" field's value of the Message entity. If the Message object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*MessageMutation) OldEnvelope

func (m *MessageMutation) OldEnvelope(ctx context.Context) (v string, err error)

OldEnvelope returns the old "Envelope" field's value of the Message entity. If the Message object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*MessageMutation) OldField

func (m *MessageMutation) OldField(ctx context.Context, name string) (ent.Value, error)

OldField returns the old value of the field from the database. An error is returned if the mutation operation is not UpdateOne, or the query to the database failed.

func (*MessageMutation) OldInternalID

func (m *MessageMutation) OldInternalID(ctx context.Context) (v string, err error)

OldInternalID returns the old "InternalID" field's value of the Message entity. If the Message object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*MessageMutation) OldMessageID

func (m *MessageMutation) OldMessageID(ctx context.Context) (v string, err error)

OldMessageID returns the old "MessageID" field's value of the Message entity. If the Message object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*MessageMutation) OldSize

func (m *MessageMutation) OldSize(ctx context.Context) (v int, err error)

OldSize returns the old "Size" field's value of the Message entity. If the Message object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*MessageMutation) Op

func (m *MessageMutation) Op() Op

Op returns the operation name.

func (*MessageMutation) RemoveFlagIDs

func (m *MessageMutation) RemoveFlagIDs(ids ...int)

RemoveFlagIDs removes the "flags" edge to the MessageFlag entity by IDs.

func (*MessageMutation) RemoveUIDIDs

func (m *MessageMutation) RemoveUIDIDs(ids ...int)

RemoveUIDIDs removes the "UIDs" edge to the UID entity by IDs.

func (*MessageMutation) RemovedEdges

func (m *MessageMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*MessageMutation) RemovedFlagsIDs

func (m *MessageMutation) RemovedFlagsIDs() (ids []int)

RemovedFlags returns the removed IDs of the "flags" edge to the MessageFlag entity.

func (*MessageMutation) RemovedIDs

func (m *MessageMutation) RemovedIDs(name string) []ent.Value

RemovedIDs returns all IDs (to other nodes) that were removed for the edge with the given name in this mutation.

func (*MessageMutation) RemovedUIDsIDs

func (m *MessageMutation) RemovedUIDsIDs() (ids []int)

RemovedUIDs returns the removed IDs of the "UIDs" edge to the UID entity.

func (*MessageMutation) ResetBody

func (m *MessageMutation) ResetBody()

ResetBody resets all changes to the "Body" field.

func (*MessageMutation) ResetBodyStructure

func (m *MessageMutation) ResetBodyStructure()

ResetBodyStructure resets all changes to the "BodyStructure" field.

func (*MessageMutation) ResetDate

func (m *MessageMutation) ResetDate()

ResetDate resets all changes to the "Date" field.

func (*MessageMutation) ResetEdge

func (m *MessageMutation) ResetEdge(name string) error

ResetEdge resets all changes to the edge with the given name in this mutation. It returns an error if the edge is not defined in the schema.

func (*MessageMutation) ResetEnvelope

func (m *MessageMutation) ResetEnvelope()

ResetEnvelope resets all changes to the "Envelope" field.

func (*MessageMutation) ResetField

func (m *MessageMutation) ResetField(name string) error

ResetField resets all changes in the mutation for the field with the given name. It returns an error if the field is not defined in the schema.

func (*MessageMutation) ResetFlags

func (m *MessageMutation) ResetFlags()

ResetFlags resets all changes to the "flags" edge.

func (*MessageMutation) ResetInternalID

func (m *MessageMutation) ResetInternalID()

ResetInternalID resets all changes to the "InternalID" field.

func (*MessageMutation) ResetMessageID

func (m *MessageMutation) ResetMessageID()

ResetMessageID resets all changes to the "MessageID" field.

func (*MessageMutation) ResetSize

func (m *MessageMutation) ResetSize()

ResetSize resets all changes to the "Size" field.

func (*MessageMutation) ResetUIDs

func (m *MessageMutation) ResetUIDs()

ResetUIDs resets all changes to the "UIDs" edge.

func (*MessageMutation) SetBody

func (m *MessageMutation) SetBody(s string)

SetBody sets the "Body" field.

func (*MessageMutation) SetBodyStructure

func (m *MessageMutation) SetBodyStructure(s string)

SetBodyStructure sets the "BodyStructure" field.

func (*MessageMutation) SetDate

func (m *MessageMutation) SetDate(t time.Time)

SetDate sets the "Date" field.

func (*MessageMutation) SetEnvelope

func (m *MessageMutation) SetEnvelope(s string)

SetEnvelope sets the "Envelope" field.

func (*MessageMutation) SetField

func (m *MessageMutation) SetField(name string, value ent.Value) error

SetField sets the value of a field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*MessageMutation) SetInternalID

func (m *MessageMutation) SetInternalID(s string)

SetInternalID sets the "InternalID" field.

func (*MessageMutation) SetMessageID

func (m *MessageMutation) SetMessageID(s string)

SetMessageID sets the "MessageID" field.

func (*MessageMutation) SetSize

func (m *MessageMutation) SetSize(i int)

SetSize sets the "Size" field.

func (*MessageMutation) Size

func (m *MessageMutation) Size() (r int, exists bool)

Size returns the value of the "Size" field in the mutation.

func (MessageMutation) Tx

func (m MessageMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*MessageMutation) Type

func (m *MessageMutation) Type() string

Type returns the node type of this mutation (Message).

func (*MessageMutation) UIDsCleared

func (m *MessageMutation) UIDsCleared() bool

UIDsCleared reports if the "UIDs" edge to the UID entity was cleared.

func (*MessageMutation) UIDsIDs

func (m *MessageMutation) UIDsIDs() (ids []int)

UIDsIDs returns the "UIDs" edge IDs in the mutation.

func (*MessageMutation) Where

func (m *MessageMutation) Where(ps ...predicate.Message)

Where appends a list predicates to the MessageMutation builder.

type MessageQuery

type MessageQuery struct {
	// contains filtered or unexported fields
}

MessageQuery is the builder for querying Message entities.

func (*MessageQuery) All

func (mq *MessageQuery) All(ctx context.Context) ([]*Message, error)

All executes the query and returns a list of Messages.

func (*MessageQuery) AllX

func (mq *MessageQuery) AllX(ctx context.Context) []*Message

AllX is like All, but panics if an error occurs.

func (*MessageQuery) Clone

func (mq *MessageQuery) Clone() *MessageQuery

Clone returns a duplicate of the MessageQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*MessageQuery) Count

func (mq *MessageQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*MessageQuery) CountX

func (mq *MessageQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*MessageQuery) Exist

func (mq *MessageQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*MessageQuery) ExistX

func (mq *MessageQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*MessageQuery) First

func (mq *MessageQuery) First(ctx context.Context) (*Message, error)

First returns the first Message entity from the query. Returns a *NotFoundError when no Message was found.

func (*MessageQuery) FirstID

func (mq *MessageQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first Message ID from the query. Returns a *NotFoundError when no Message ID was found.

func (*MessageQuery) FirstIDX

func (mq *MessageQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*MessageQuery) FirstX

func (mq *MessageQuery) FirstX(ctx context.Context) *Message

FirstX is like First, but panics if an error occurs.

func (*MessageQuery) GroupBy

func (mq *MessageQuery) GroupBy(field string, fields ...string) *MessageGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

Example:

var v []struct {
	MessageID string `json:"MessageID,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Message.Query().
	GroupBy(message.FieldMessageID).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*MessageQuery) IDs

func (mq *MessageQuery) IDs(ctx context.Context) ([]int, error)

IDs executes the query and returns a list of Message IDs.

func (*MessageQuery) IDsX

func (mq *MessageQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*MessageQuery) Limit

func (mq *MessageQuery) Limit(limit int) *MessageQuery

Limit adds a limit step to the query.

func (*MessageQuery) Offset

func (mq *MessageQuery) Offset(offset int) *MessageQuery

Offset adds an offset step to the query.

func (*MessageQuery) Only

func (mq *MessageQuery) Only(ctx context.Context) (*Message, error)

Only returns a single Message entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Message entity is found. Returns a *NotFoundError when no Message entities are found.

func (*MessageQuery) OnlyID

func (mq *MessageQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only Message ID in the query. Returns a *NotSingularError when more than one Message ID is found. Returns a *NotFoundError when no entities are found.

func (*MessageQuery) OnlyIDX

func (mq *MessageQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*MessageQuery) OnlyX

func (mq *MessageQuery) OnlyX(ctx context.Context) *Message

OnlyX is like Only, but panics if an error occurs.

func (*MessageQuery) Order

func (mq *MessageQuery) Order(o ...OrderFunc) *MessageQuery

Order adds an order step to the query.

func (*MessageQuery) QueryFlags

func (mq *MessageQuery) QueryFlags() *MessageFlagQuery

QueryFlags chains the current query on the "flags" edge.

func (*MessageQuery) QueryUIDs

func (mq *MessageQuery) QueryUIDs() *UIDQuery

QueryUIDs chains the current query on the "UIDs" edge.

func (*MessageQuery) Select

func (mq *MessageQuery) Select(fields ...string) *MessageSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	MessageID string `json:"MessageID,omitempty"`
}

client.Message.Query().
	Select(message.FieldMessageID).
	Scan(ctx, &v)

func (*MessageQuery) Unique

func (mq *MessageQuery) Unique(unique bool) *MessageQuery

Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.

func (*MessageQuery) Where

func (mq *MessageQuery) Where(ps ...predicate.Message) *MessageQuery

Where adds a new predicate for the MessageQuery builder.

func (*MessageQuery) WithFlags

func (mq *MessageQuery) WithFlags(opts ...func(*MessageFlagQuery)) *MessageQuery

WithFlags tells the query-builder to eager-load the nodes that are connected to the "flags" edge. The optional arguments are used to configure the query builder of the edge.

func (*MessageQuery) WithUIDs

func (mq *MessageQuery) WithUIDs(opts ...func(*UIDQuery)) *MessageQuery

WithUIDs tells the query-builder to eager-load the nodes that are connected to the "UIDs" edge. The optional arguments are used to configure the query builder of the edge.

type MessageSelect

type MessageSelect struct {
	*MessageQuery
	// contains filtered or unexported fields
}

MessageSelect is the builder for selecting fields of Message entities.

func (*MessageSelect) Bool

func (ms *MessageSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*MessageSelect) BoolX

func (ms *MessageSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*MessageSelect) Bools

func (ms *MessageSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*MessageSelect) BoolsX

func (ms *MessageSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*MessageSelect) Float64

func (ms *MessageSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*MessageSelect) Float64X

func (ms *MessageSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*MessageSelect) Float64s

func (ms *MessageSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*MessageSelect) Float64sX

func (ms *MessageSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*MessageSelect) Int

func (ms *MessageSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*MessageSelect) IntX

func (ms *MessageSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*MessageSelect) Ints

func (ms *MessageSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*MessageSelect) IntsX

func (ms *MessageSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*MessageSelect) Scan

func (ms *MessageSelect) Scan(ctx context.Context, v interface{}) error

Scan applies the selector query and scans the result into the given value.

func (*MessageSelect) ScanX

func (ms *MessageSelect) ScanX(ctx context.Context, v interface{})

ScanX is like Scan, but panics if an error occurs.

func (*MessageSelect) String

func (ms *MessageSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*MessageSelect) StringX

func (ms *MessageSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*MessageSelect) Strings

func (ms *MessageSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*MessageSelect) StringsX

func (ms *MessageSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type MessageUpdate

type MessageUpdate struct {
	// contains filtered or unexported fields
}

MessageUpdate is the builder for updating Message entities.

func (*MessageUpdate) AddFlagIDs

func (mu *MessageUpdate) AddFlagIDs(ids ...int) *MessageUpdate

AddFlagIDs adds the "flags" edge to the MessageFlag entity by IDs.

func (*MessageUpdate) AddFlags

func (mu *MessageUpdate) AddFlags(m ...*MessageFlag) *MessageUpdate

AddFlags adds the "flags" edges to the MessageFlag entity.

func (*MessageUpdate) AddSize

func (mu *MessageUpdate) AddSize(i int) *MessageUpdate

AddSize adds i to the "Size" field.

func (*MessageUpdate) AddUIDIDs

func (mu *MessageUpdate) AddUIDIDs(ids ...int) *MessageUpdate

AddUIDIDs adds the "UIDs" edge to the UID entity by IDs.

func (*MessageUpdate) AddUIDs

func (mu *MessageUpdate) AddUIDs(u ...*UID) *MessageUpdate

AddUIDs adds the "UIDs" edges to the UID entity.

func (*MessageUpdate) ClearFlags

func (mu *MessageUpdate) ClearFlags() *MessageUpdate

ClearFlags clears all "flags" edges to the MessageFlag entity.

func (*MessageUpdate) ClearUIDs

func (mu *MessageUpdate) ClearUIDs() *MessageUpdate

ClearUIDs clears all "UIDs" edges to the UID entity.

func (*MessageUpdate) Exec

func (mu *MessageUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*MessageUpdate) ExecX

func (mu *MessageUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*MessageUpdate) Mutation

func (mu *MessageUpdate) Mutation() *MessageMutation

Mutation returns the MessageMutation object of the builder.

func (*MessageUpdate) RemoveFlagIDs

func (mu *MessageUpdate) RemoveFlagIDs(ids ...int) *MessageUpdate

RemoveFlagIDs removes the "flags" edge to MessageFlag entities by IDs.

func (*MessageUpdate) RemoveFlags

func (mu *MessageUpdate) RemoveFlags(m ...*MessageFlag) *MessageUpdate

RemoveFlags removes "flags" edges to MessageFlag entities.

func (*MessageUpdate) RemoveUIDIDs

func (mu *MessageUpdate) RemoveUIDIDs(ids ...int) *MessageUpdate

RemoveUIDIDs removes the "UIDs" edge to UID entities by IDs.

func (*MessageUpdate) RemoveUIDs

func (mu *MessageUpdate) RemoveUIDs(u ...*UID) *MessageUpdate

RemoveUIDs removes "UIDs" edges to UID entities.

func (*MessageUpdate) Save

func (mu *MessageUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*MessageUpdate) SaveX

func (mu *MessageUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*MessageUpdate) SetBody

func (mu *MessageUpdate) SetBody(s string) *MessageUpdate

SetBody sets the "Body" field.

func (*MessageUpdate) SetBodyStructure

func (mu *MessageUpdate) SetBodyStructure(s string) *MessageUpdate

SetBodyStructure sets the "BodyStructure" field.

func (*MessageUpdate) SetDate

func (mu *MessageUpdate) SetDate(t time.Time) *MessageUpdate

SetDate sets the "Date" field.

func (*MessageUpdate) SetEnvelope

func (mu *MessageUpdate) SetEnvelope(s string) *MessageUpdate

SetEnvelope sets the "Envelope" field.

func (*MessageUpdate) SetInternalID

func (mu *MessageUpdate) SetInternalID(s string) *MessageUpdate

SetInternalID sets the "InternalID" field.

func (*MessageUpdate) SetMessageID

func (mu *MessageUpdate) SetMessageID(s string) *MessageUpdate

SetMessageID sets the "MessageID" field.

func (*MessageUpdate) SetSize

func (mu *MessageUpdate) SetSize(i int) *MessageUpdate

SetSize sets the "Size" field.

func (*MessageUpdate) Where

func (mu *MessageUpdate) Where(ps ...predicate.Message) *MessageUpdate

Where appends a list predicates to the MessageUpdate builder.

type MessageUpdateOne

type MessageUpdateOne struct {
	// contains filtered or unexported fields
}

MessageUpdateOne is the builder for updating a single Message entity.

func (*MessageUpdateOne) AddFlagIDs

func (muo *MessageUpdateOne) AddFlagIDs(ids ...int) *MessageUpdateOne

AddFlagIDs adds the "flags" edge to the MessageFlag entity by IDs.

func (*MessageUpdateOne) AddFlags

func (muo *MessageUpdateOne) AddFlags(m ...*MessageFlag) *MessageUpdateOne

AddFlags adds the "flags" edges to the MessageFlag entity.

func (*MessageUpdateOne) AddSize

func (muo *MessageUpdateOne) AddSize(i int) *MessageUpdateOne

AddSize adds i to the "Size" field.

func (*MessageUpdateOne) AddUIDIDs

func (muo *MessageUpdateOne) AddUIDIDs(ids ...int) *MessageUpdateOne

AddUIDIDs adds the "UIDs" edge to the UID entity by IDs.

func (*MessageUpdateOne) AddUIDs

func (muo *MessageUpdateOne) AddUIDs(u ...*UID) *MessageUpdateOne

AddUIDs adds the "UIDs" edges to the UID entity.

func (*MessageUpdateOne) ClearFlags

func (muo *MessageUpdateOne) ClearFlags() *MessageUpdateOne

ClearFlags clears all "flags" edges to the MessageFlag entity.

func (*MessageUpdateOne) ClearUIDs

func (muo *MessageUpdateOne) ClearUIDs() *MessageUpdateOne

ClearUIDs clears all "UIDs" edges to the UID entity.

func (*MessageUpdateOne) Exec

func (muo *MessageUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*MessageUpdateOne) ExecX

func (muo *MessageUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*MessageUpdateOne) Mutation

func (muo *MessageUpdateOne) Mutation() *MessageMutation

Mutation returns the MessageMutation object of the builder.

func (*MessageUpdateOne) RemoveFlagIDs

func (muo *MessageUpdateOne) RemoveFlagIDs(ids ...int) *MessageUpdateOne

RemoveFlagIDs removes the "flags" edge to MessageFlag entities by IDs.

func (*MessageUpdateOne) RemoveFlags

func (muo *MessageUpdateOne) RemoveFlags(m ...*MessageFlag) *MessageUpdateOne

RemoveFlags removes "flags" edges to MessageFlag entities.

func (*MessageUpdateOne) RemoveUIDIDs

func (muo *MessageUpdateOne) RemoveUIDIDs(ids ...int) *MessageUpdateOne

RemoveUIDIDs removes the "UIDs" edge to UID entities by IDs.

func (*MessageUpdateOne) RemoveUIDs

func (muo *MessageUpdateOne) RemoveUIDs(u ...*UID) *MessageUpdateOne

RemoveUIDs removes "UIDs" edges to UID entities.

func (*MessageUpdateOne) Save

func (muo *MessageUpdateOne) Save(ctx context.Context) (*Message, error)

Save executes the query and returns the updated Message entity.

func (*MessageUpdateOne) SaveX

func (muo *MessageUpdateOne) SaveX(ctx context.Context) *Message

SaveX is like Save, but panics if an error occurs.

func (*MessageUpdateOne) Select

func (muo *MessageUpdateOne) Select(field string, fields ...string) *MessageUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*MessageUpdateOne) SetBody

func (muo *MessageUpdateOne) SetBody(s string) *MessageUpdateOne

SetBody sets the "Body" field.

func (*MessageUpdateOne) SetBodyStructure

func (muo *MessageUpdateOne) SetBodyStructure(s string) *MessageUpdateOne

SetBodyStructure sets the "BodyStructure" field.

func (*MessageUpdateOne) SetDate

func (muo *MessageUpdateOne) SetDate(t time.Time) *MessageUpdateOne

SetDate sets the "Date" field.

func (*MessageUpdateOne) SetEnvelope

func (muo *MessageUpdateOne) SetEnvelope(s string) *MessageUpdateOne

SetEnvelope sets the "Envelope" field.

func (*MessageUpdateOne) SetInternalID

func (muo *MessageUpdateOne) SetInternalID(s string) *MessageUpdateOne

SetInternalID sets the "InternalID" field.

func (*MessageUpdateOne) SetMessageID

func (muo *MessageUpdateOne) SetMessageID(s string) *MessageUpdateOne

SetMessageID sets the "MessageID" field.

func (*MessageUpdateOne) SetSize

func (muo *MessageUpdateOne) SetSize(i int) *MessageUpdateOne

SetSize sets the "Size" field.

type Messages

type Messages []*Message

Messages is a parsable slice of Message.

type MutateFunc

type MutateFunc = ent.MutateFunc

ent aliases to avoid import conflicts in user's code.

type Mutation

type Mutation = ent.Mutation

ent aliases to avoid import conflicts in user's code.

type Mutator

type Mutator = ent.Mutator

ent aliases to avoid import conflicts in user's code.

type NotFoundError

type NotFoundError struct {
	// contains filtered or unexported fields
}

NotFoundError returns when trying to fetch a specific entity and it was not found in the database.

func (*NotFoundError) Error

func (e *NotFoundError) Error() string

Error implements the error interface.

type NotLoadedError

type NotLoadedError struct {
	// contains filtered or unexported fields
}

NotLoadedError returns when trying to get a node that was not loaded by the query.

func (*NotLoadedError) Error

func (e *NotLoadedError) Error() string

Error implements the error interface.

type NotSingularError

type NotSingularError struct {
	// contains filtered or unexported fields
}

NotSingularError returns when trying to fetch a singular entity and more then one was found in the database.

func (*NotSingularError) Error

func (e *NotSingularError) Error() string

Error implements the error interface.

type Op

type Op = ent.Op

ent aliases to avoid import conflicts in user's code.

type Option

type Option func(*config)

Option function to configure the client.

func Debug

func Debug() Option

Debug enables debug logging on the ent.Driver.

func Driver

func Driver(driver dialect.Driver) Option

Driver configures the client driver.

func Log

func Log(fn func(...interface{})) Option

Log sets the logging function for debug mode.

type OrderFunc

type OrderFunc func(*sql.Selector)

OrderFunc applies an ordering on the sql selector.

func Asc

func Asc(fields ...string) OrderFunc

Asc applies the given fields in ASC order.

func Desc

func Desc(fields ...string) OrderFunc

Desc applies the given fields in DESC order.

type Policy

type Policy = ent.Policy

ent aliases to avoid import conflicts in user's code.

type Query

type Query = ent.Query

ent aliases to avoid import conflicts in user's code.

type RollbackFunc

type RollbackFunc func(context.Context, *Tx) error

The RollbackFunc type is an adapter to allow the use of ordinary function as a Rollbacker. If f is a function with the appropriate signature, RollbackFunc(f) is a Rollbacker that calls f.

func (RollbackFunc) Rollback

func (f RollbackFunc) Rollback(ctx context.Context, tx *Tx) error

Rollback calls f(ctx, m).

type RollbackHook

type RollbackHook func(Rollbacker) Rollbacker

RollbackHook defines the "rollback middleware". A function that gets a Rollbacker and returns a Rollbacker. For example:

hook := func(next ent.Rollbacker) ent.Rollbacker {
	return ent.RollbackFunc(func(ctx context.Context, tx *ent.Tx) error {
		// Do some stuff before.
		if err := next.Rollback(ctx, tx); err != nil {
			return err
		}
		// Do some stuff after.
		return nil
	})
}

type Rollbacker

type Rollbacker interface {
	Rollback(context.Context, *Tx) error
}

Rollbacker is the interface that wraps the Rollback method.

type Tx

type Tx struct {

	// Mailbox is the client for interacting with the Mailbox builders.
	Mailbox *MailboxClient
	// MailboxAttr is the client for interacting with the MailboxAttr builders.
	MailboxAttr *MailboxAttrClient
	// MailboxFlag is the client for interacting with the MailboxFlag builders.
	MailboxFlag *MailboxFlagClient
	// MailboxPermFlag is the client for interacting with the MailboxPermFlag builders.
	MailboxPermFlag *MailboxPermFlagClient
	// Message is the client for interacting with the Message builders.
	Message *MessageClient
	// MessageFlag is the client for interacting with the MessageFlag builders.
	MessageFlag *MessageFlagClient
	// UID is the client for interacting with the UID builders.
	UID *UIDClient
	// contains filtered or unexported fields
}

Tx is a transactional client that is created by calling Client.Tx().

func TxFromContext

func TxFromContext(ctx context.Context) *Tx

TxFromContext returns a Tx stored inside a context, or nil if there isn't one.

func (*Tx) Client

func (tx *Tx) Client() *Client

Client returns a Client that binds to current transaction.

func (*Tx) Commit

func (tx *Tx) Commit() error

Commit commits the transaction.

func (*Tx) OnCommit

func (tx *Tx) OnCommit(f CommitHook)

OnCommit adds a hook to call on commit.

func (*Tx) OnRollback

func (tx *Tx) OnRollback(f RollbackHook)

OnRollback adds a hook to call on rollback.

func (*Tx) Rollback

func (tx *Tx) Rollback() error

Rollback rollbacks the transaction.

type UID

type UID struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// UID holds the value of the "UID" field.
	UID int `json:"UID,omitempty"`
	// Deleted holds the value of the "Deleted" field.
	Deleted bool `json:"Deleted,omitempty"`
	// Recent holds the value of the "Recent" field.
	Recent bool `json:"Recent,omitempty"`
	// InDeletionPool holds the value of the "InDeletionPool" field.
	InDeletionPool bool `json:"InDeletionPool,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the UIDQuery when eager-loading is set.
	Edges UIDEdges `json:"edges"`
	// contains filtered or unexported fields
}

UID is the model entity for the UID schema.

func (*UID) QueryMailbox

func (u *UID) QueryMailbox() *MailboxQuery

QueryMailbox queries the "mailbox" edge of the UID entity.

func (*UID) QueryMessage

func (u *UID) QueryMessage() *MessageQuery

QueryMessage queries the "message" edge of the UID entity.

func (*UID) String

func (u *UID) String() string

String implements the fmt.Stringer.

func (*UID) Unwrap

func (u *UID) Unwrap() *UID

Unwrap unwraps the UID entity that was returned from a transaction after it was closed, so that all future queries will be executed through the driver which created the transaction.

func (*UID) Update

func (u *UID) Update() *UIDUpdateOne

Update returns a builder for updating this UID. Note that you need to call UID.Unwrap() before calling this method if this UID was returned from a transaction, and the transaction was committed or rolled back.

type UIDClient

type UIDClient struct {
	// contains filtered or unexported fields
}

UIDClient is a client for the UID schema.

func NewUIDClient

func NewUIDClient(c config) *UIDClient

NewUIDClient returns a client for the UID from the given config.

func (*UIDClient) Create

func (c *UIDClient) Create() *UIDCreate

Create returns a create builder for UID.

func (*UIDClient) CreateBulk

func (c *UIDClient) CreateBulk(builders ...*UIDCreate) *UIDCreateBulk

CreateBulk returns a builder for creating a bulk of UID entities.

func (*UIDClient) Delete

func (c *UIDClient) Delete() *UIDDelete

Delete returns a delete builder for UID.

func (*UIDClient) DeleteOne

func (c *UIDClient) DeleteOne(u *UID) *UIDDeleteOne

DeleteOne returns a delete builder for the given entity.

func (*UIDClient) DeleteOneID

func (c *UIDClient) DeleteOneID(id int) *UIDDeleteOne

DeleteOneID returns a delete builder for the given id.

func (*UIDClient) Get

func (c *UIDClient) Get(ctx context.Context, id int) (*UID, error)

Get returns a UID entity by its id.

func (*UIDClient) GetX

func (c *UIDClient) GetX(ctx context.Context, id int) *UID

GetX is like Get, but panics if an error occurs.

func (*UIDClient) Hooks

func (c *UIDClient) Hooks() []Hook

Hooks returns the client hooks.

func (*UIDClient) Query

func (c *UIDClient) Query() *UIDQuery

Query returns a query builder for UID.

func (*UIDClient) QueryMailbox

func (c *UIDClient) QueryMailbox(u *UID) *MailboxQuery

QueryMailbox queries the mailbox edge of a UID.

func (*UIDClient) QueryMessage

func (c *UIDClient) QueryMessage(u *UID) *MessageQuery

QueryMessage queries the message edge of a UID.

func (*UIDClient) Update

func (c *UIDClient) Update() *UIDUpdate

Update returns an update builder for UID.

func (*UIDClient) UpdateOne

func (c *UIDClient) UpdateOne(u *UID) *UIDUpdateOne

UpdateOne returns an update builder for the given entity.

func (*UIDClient) UpdateOneID

func (c *UIDClient) UpdateOneID(id int) *UIDUpdateOne

UpdateOneID returns an update builder for the given id.

func (*UIDClient) Use

func (c *UIDClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `uid.Hooks(f(g(h())))`.

type UIDCreate

type UIDCreate struct {
	// contains filtered or unexported fields
}

UIDCreate is the builder for creating a UID entity.

func (*UIDCreate) Exec

func (uc *UIDCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*UIDCreate) ExecX

func (uc *UIDCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UIDCreate) Mutation

func (uc *UIDCreate) Mutation() *UIDMutation

Mutation returns the UIDMutation object of the builder.

func (*UIDCreate) Save

func (uc *UIDCreate) Save(ctx context.Context) (*UID, error)

Save creates the UID in the database.

func (*UIDCreate) SaveX

func (uc *UIDCreate) SaveX(ctx context.Context) *UID

SaveX calls Save and panics if Save returns an error.

func (*UIDCreate) SetDeleted

func (uc *UIDCreate) SetDeleted(b bool) *UIDCreate

SetDeleted sets the "Deleted" field.

func (*UIDCreate) SetInDeletionPool

func (uc *UIDCreate) SetInDeletionPool(b bool) *UIDCreate

SetInDeletionPool sets the "InDeletionPool" field.

func (*UIDCreate) SetMailbox

func (uc *UIDCreate) SetMailbox(m *Mailbox) *UIDCreate

SetMailbox sets the "mailbox" edge to the Mailbox entity.

func (*UIDCreate) SetMailboxID

func (uc *UIDCreate) SetMailboxID(id int) *UIDCreate

SetMailboxID sets the "mailbox" edge to the Mailbox entity by ID.

func (*UIDCreate) SetMessage

func (uc *UIDCreate) SetMessage(m *Message) *UIDCreate

SetMessage sets the "message" edge to the Message entity.

func (*UIDCreate) SetMessageID

func (uc *UIDCreate) SetMessageID(id int) *UIDCreate

SetMessageID sets the "message" edge to the Message entity by ID.

func (*UIDCreate) SetNillableDeleted

func (uc *UIDCreate) SetNillableDeleted(b *bool) *UIDCreate

SetNillableDeleted sets the "Deleted" field if the given value is not nil.

func (*UIDCreate) SetNillableInDeletionPool

func (uc *UIDCreate) SetNillableInDeletionPool(b *bool) *UIDCreate

SetNillableInDeletionPool sets the "InDeletionPool" field if the given value is not nil.

func (*UIDCreate) SetNillableMailboxID

func (uc *UIDCreate) SetNillableMailboxID(id *int) *UIDCreate

SetNillableMailboxID sets the "mailbox" edge to the Mailbox entity by ID if the given value is not nil.

func (*UIDCreate) SetNillableMessageID

func (uc *UIDCreate) SetNillableMessageID(id *int) *UIDCreate

SetNillableMessageID sets the "message" edge to the Message entity by ID if the given value is not nil.

func (*UIDCreate) SetNillableRecent

func (uc *UIDCreate) SetNillableRecent(b *bool) *UIDCreate

SetNillableRecent sets the "Recent" field if the given value is not nil.

func (*UIDCreate) SetRecent

func (uc *UIDCreate) SetRecent(b bool) *UIDCreate

SetRecent sets the "Recent" field.

func (*UIDCreate) SetUID

func (uc *UIDCreate) SetUID(i int) *UIDCreate

SetUID sets the "UID" field.

type UIDCreateBulk

type UIDCreateBulk struct {
	// contains filtered or unexported fields
}

UIDCreateBulk is the builder for creating many UID entities in bulk.

func (*UIDCreateBulk) Exec

func (ucb *UIDCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*UIDCreateBulk) ExecX

func (ucb *UIDCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UIDCreateBulk) Save

func (ucb *UIDCreateBulk) Save(ctx context.Context) ([]*UID, error)

Save creates the UID entities in the database.

func (*UIDCreateBulk) SaveX

func (ucb *UIDCreateBulk) SaveX(ctx context.Context) []*UID

SaveX is like Save, but panics if an error occurs.

type UIDDelete

type UIDDelete struct {
	// contains filtered or unexported fields
}

UIDDelete is the builder for deleting a UID entity.

func (*UIDDelete) Exec

func (ud *UIDDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*UIDDelete) ExecX

func (ud *UIDDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*UIDDelete) Where

func (ud *UIDDelete) Where(ps ...predicate.UID) *UIDDelete

Where appends a list predicates to the UIDDelete builder.

type UIDDeleteOne

type UIDDeleteOne struct {
	// contains filtered or unexported fields
}

UIDDeleteOne is the builder for deleting a single UID entity.

func (*UIDDeleteOne) Exec

func (udo *UIDDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*UIDDeleteOne) ExecX

func (udo *UIDDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

type UIDEdges

type UIDEdges struct {
	// Message holds the value of the message edge.
	Message *Message `json:"message,omitempty"`
	// Mailbox holds the value of the mailbox edge.
	Mailbox *Mailbox `json:"mailbox,omitempty"`
	// contains filtered or unexported fields
}

UIDEdges holds the relations/edges for other nodes in the graph.

func (UIDEdges) MailboxOrErr

func (e UIDEdges) MailboxOrErr() (*Mailbox, error)

MailboxOrErr returns the Mailbox value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

func (UIDEdges) MessageOrErr

func (e UIDEdges) MessageOrErr() (*Message, error)

MessageOrErr returns the Message value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

type UIDGroupBy

type UIDGroupBy struct {
	// contains filtered or unexported fields
}

UIDGroupBy is the group-by builder for UID entities.

func (*UIDGroupBy) Aggregate

func (ugb *UIDGroupBy) Aggregate(fns ...AggregateFunc) *UIDGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*UIDGroupBy) Bool

func (ugb *UIDGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a group-by query. It is only allowed when executing a group-by query with one field.

func (*UIDGroupBy) BoolX

func (ugb *UIDGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*UIDGroupBy) Bools

func (ugb *UIDGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from group-by. It is only allowed when executing a group-by query with one field.

func (*UIDGroupBy) BoolsX

func (ugb *UIDGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*UIDGroupBy) Float64

func (ugb *UIDGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a group-by query. It is only allowed when executing a group-by query with one field.

func (*UIDGroupBy) Float64X

func (ugb *UIDGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*UIDGroupBy) Float64s

func (ugb *UIDGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from group-by. It is only allowed when executing a group-by query with one field.

func (*UIDGroupBy) Float64sX

func (ugb *UIDGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*UIDGroupBy) Int

func (ugb *UIDGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a group-by query. It is only allowed when executing a group-by query with one field.

func (*UIDGroupBy) IntX

func (ugb *UIDGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*UIDGroupBy) Ints

func (ugb *UIDGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from group-by. It is only allowed when executing a group-by query with one field.

func (*UIDGroupBy) IntsX

func (ugb *UIDGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*UIDGroupBy) Scan

func (ugb *UIDGroupBy) Scan(ctx context.Context, v interface{}) error

Scan applies the group-by query and scans the result into the given value.

func (*UIDGroupBy) ScanX

func (ugb *UIDGroupBy) ScanX(ctx context.Context, v interface{})

ScanX is like Scan, but panics if an error occurs.

func (*UIDGroupBy) String

func (ugb *UIDGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a group-by query. It is only allowed when executing a group-by query with one field.

func (*UIDGroupBy) StringX

func (ugb *UIDGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*UIDGroupBy) Strings

func (ugb *UIDGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from group-by. It is only allowed when executing a group-by query with one field.

func (*UIDGroupBy) StringsX

func (ugb *UIDGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type UIDMutation

type UIDMutation struct {
	// contains filtered or unexported fields
}

UIDMutation represents an operation that mutates the UID nodes in the graph.

func (*UIDMutation) AddField

func (m *UIDMutation) AddField(name string, value ent.Value) error

AddField adds the value to the field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*UIDMutation) AddUID

func (m *UIDMutation) AddUID(i int)

AddUID adds i to the "UID" field.

func (*UIDMutation) AddedEdges

func (m *UIDMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*UIDMutation) AddedField

func (m *UIDMutation) AddedField(name string) (ent.Value, bool)

AddedField returns the numeric value that was incremented/decremented on a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*UIDMutation) AddedFields

func (m *UIDMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*UIDMutation) AddedIDs

func (m *UIDMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*UIDMutation) AddedUID

func (m *UIDMutation) AddedUID() (r int, exists bool)

AddedUID returns the value that was added to the "UID" field in this mutation.

func (*UIDMutation) ClearEdge

func (m *UIDMutation) ClearEdge(name string) error

ClearEdge clears the value of the edge with the given name. It returns an error if that edge is not defined in the schema.

func (*UIDMutation) ClearField

func (m *UIDMutation) ClearField(name string) error

ClearField clears the value of the field with the given name. It returns an error if the field is not defined in the schema.

func (*UIDMutation) ClearMailbox

func (m *UIDMutation) ClearMailbox()

ClearMailbox clears the "mailbox" edge to the Mailbox entity.

func (*UIDMutation) ClearMessage

func (m *UIDMutation) ClearMessage()

ClearMessage clears the "message" edge to the Message entity.

func (*UIDMutation) ClearedEdges

func (m *UIDMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*UIDMutation) ClearedFields

func (m *UIDMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (UIDMutation) Client

func (m UIDMutation) Client() *Client

Client returns a new `ent.Client` from the mutation. If the mutation was executed in a transaction (ent.Tx), a transactional client is returned.

func (*UIDMutation) Deleted

func (m *UIDMutation) Deleted() (r bool, exists bool)

Deleted returns the value of the "Deleted" field in the mutation.

func (*UIDMutation) EdgeCleared

func (m *UIDMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*UIDMutation) Field

func (m *UIDMutation) Field(name string) (ent.Value, bool)

Field returns the value of a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*UIDMutation) FieldCleared

func (m *UIDMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*UIDMutation) Fields

func (m *UIDMutation) Fields() []string

Fields returns all fields that were changed during this mutation. Note that in order to get all numeric fields that were incremented/decremented, call AddedFields().

func (*UIDMutation) ID

func (m *UIDMutation) ID() (id int, exists bool)

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.

func (*UIDMutation) IDs

func (m *UIDMutation) IDs(ctx context.Context) ([]int, error)

IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.

func (*UIDMutation) InDeletionPool

func (m *UIDMutation) InDeletionPool() (r bool, exists bool)

InDeletionPool returns the value of the "InDeletionPool" field in the mutation.

func (*UIDMutation) MailboxCleared

func (m *UIDMutation) MailboxCleared() bool

MailboxCleared reports if the "mailbox" edge to the Mailbox entity was cleared.

func (*UIDMutation) MailboxID

func (m *UIDMutation) MailboxID() (id int, exists bool)

MailboxID returns the "mailbox" edge ID in the mutation.

func (*UIDMutation) MailboxIDs

func (m *UIDMutation) MailboxIDs() (ids []int)

MailboxIDs returns the "mailbox" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use MailboxID instead. It exists only for internal usage by the builders.

func (*UIDMutation) MessageCleared

func (m *UIDMutation) MessageCleared() bool

MessageCleared reports if the "message" edge to the Message entity was cleared.

func (*UIDMutation) MessageID

func (m *UIDMutation) MessageID() (id int, exists bool)

MessageID returns the "message" edge ID in the mutation.

func (*UIDMutation) MessageIDs

func (m *UIDMutation) MessageIDs() (ids []int)

MessageIDs returns the "message" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use MessageID instead. It exists only for internal usage by the builders.

func (*UIDMutation) OldDeleted

func (m *UIDMutation) OldDeleted(ctx context.Context) (v bool, err error)

OldDeleted returns the old "Deleted" field's value of the UID entity. If the UID object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*UIDMutation) OldField

func (m *UIDMutation) OldField(ctx context.Context, name string) (ent.Value, error)

OldField returns the old value of the field from the database. An error is returned if the mutation operation is not UpdateOne, or the query to the database failed.

func (*UIDMutation) OldInDeletionPool

func (m *UIDMutation) OldInDeletionPool(ctx context.Context) (v bool, err error)

OldInDeletionPool returns the old "InDeletionPool" field's value of the UID entity. If the UID object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*UIDMutation) OldRecent

func (m *UIDMutation) OldRecent(ctx context.Context) (v bool, err error)

OldRecent returns the old "Recent" field's value of the UID entity. If the UID object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*UIDMutation) OldUID

func (m *UIDMutation) OldUID(ctx context.Context) (v int, err error)

OldUID returns the old "UID" field's value of the UID entity. If the UID object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*UIDMutation) Op

func (m *UIDMutation) Op() Op

Op returns the operation name.

func (*UIDMutation) Recent

func (m *UIDMutation) Recent() (r bool, exists bool)

Recent returns the value of the "Recent" field in the mutation.

func (*UIDMutation) RemovedEdges

func (m *UIDMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*UIDMutation) RemovedIDs

func (m *UIDMutation) RemovedIDs(name string) []ent.Value

RemovedIDs returns all IDs (to other nodes) that were removed for the edge with the given name in this mutation.

func (*UIDMutation) ResetDeleted

func (m *UIDMutation) ResetDeleted()

ResetDeleted resets all changes to the "Deleted" field.

func (*UIDMutation) ResetEdge

func (m *UIDMutation) ResetEdge(name string) error

ResetEdge resets all changes to the edge with the given name in this mutation. It returns an error if the edge is not defined in the schema.

func (*UIDMutation) ResetField

func (m *UIDMutation) ResetField(name string) error

ResetField resets all changes in the mutation for the field with the given name. It returns an error if the field is not defined in the schema.

func (*UIDMutation) ResetInDeletionPool

func (m *UIDMutation) ResetInDeletionPool()

ResetInDeletionPool resets all changes to the "InDeletionPool" field.

func (*UIDMutation) ResetMailbox

func (m *UIDMutation) ResetMailbox()

ResetMailbox resets all changes to the "mailbox" edge.

func (*UIDMutation) ResetMessage

func (m *UIDMutation) ResetMessage()

ResetMessage resets all changes to the "message" edge.

func (*UIDMutation) ResetRecent

func (m *UIDMutation) ResetRecent()

ResetRecent resets all changes to the "Recent" field.

func (*UIDMutation) ResetUID

func (m *UIDMutation) ResetUID()

ResetUID resets all changes to the "UID" field.

func (*UIDMutation) SetDeleted

func (m *UIDMutation) SetDeleted(b bool)

SetDeleted sets the "Deleted" field.

func (*UIDMutation) SetField

func (m *UIDMutation) SetField(name string, value ent.Value) error

SetField sets the value of a field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*UIDMutation) SetInDeletionPool

func (m *UIDMutation) SetInDeletionPool(b bool)

SetInDeletionPool sets the "InDeletionPool" field.

func (*UIDMutation) SetMailboxID

func (m *UIDMutation) SetMailboxID(id int)

SetMailboxID sets the "mailbox" edge to the Mailbox entity by id.

func (*UIDMutation) SetMessageID

func (m *UIDMutation) SetMessageID(id int)

SetMessageID sets the "message" edge to the Message entity by id.

func (*UIDMutation) SetRecent

func (m *UIDMutation) SetRecent(b bool)

SetRecent sets the "Recent" field.

func (*UIDMutation) SetUID

func (m *UIDMutation) SetUID(i int)

SetUID sets the "UID" field.

func (UIDMutation) Tx

func (m UIDMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*UIDMutation) Type

func (m *UIDMutation) Type() string

Type returns the node type of this mutation (UID).

func (*UIDMutation) UID

func (m *UIDMutation) UID() (r int, exists bool)

UID returns the value of the "UID" field in the mutation.

func (*UIDMutation) Where

func (m *UIDMutation) Where(ps ...predicate.UID)

Where appends a list predicates to the UIDMutation builder.

type UIDQuery

type UIDQuery struct {
	// contains filtered or unexported fields
}

UIDQuery is the builder for querying UID entities.

func (*UIDQuery) All

func (uq *UIDQuery) All(ctx context.Context) ([]*UID, error)

All executes the query and returns a list of UIDs.

func (*UIDQuery) AllX

func (uq *UIDQuery) AllX(ctx context.Context) []*UID

AllX is like All, but panics if an error occurs.

func (*UIDQuery) Clone

func (uq *UIDQuery) Clone() *UIDQuery

Clone returns a duplicate of the UIDQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*UIDQuery) Count

func (uq *UIDQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*UIDQuery) CountX

func (uq *UIDQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*UIDQuery) Exist

func (uq *UIDQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*UIDQuery) ExistX

func (uq *UIDQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*UIDQuery) First

func (uq *UIDQuery) First(ctx context.Context) (*UID, error)

First returns the first UID entity from the query. Returns a *NotFoundError when no UID was found.

func (*UIDQuery) FirstID

func (uq *UIDQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first UID ID from the query. Returns a *NotFoundError when no UID ID was found.

func (*UIDQuery) FirstIDX

func (uq *UIDQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*UIDQuery) FirstX

func (uq *UIDQuery) FirstX(ctx context.Context) *UID

FirstX is like First, but panics if an error occurs.

func (*UIDQuery) GroupBy

func (uq *UIDQuery) GroupBy(field string, fields ...string) *UIDGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

Example:

var v []struct {
	UID int `json:"UID,omitempty"`
	Count int `json:"count,omitempty"`
}

client.UID.Query().
	GroupBy(uid.FieldUID).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*UIDQuery) IDs

func (uq *UIDQuery) IDs(ctx context.Context) ([]int, error)

IDs executes the query and returns a list of UID IDs.

func (*UIDQuery) IDsX

func (uq *UIDQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*UIDQuery) Limit

func (uq *UIDQuery) Limit(limit int) *UIDQuery

Limit adds a limit step to the query.

func (*UIDQuery) Offset

func (uq *UIDQuery) Offset(offset int) *UIDQuery

Offset adds an offset step to the query.

func (*UIDQuery) Only

func (uq *UIDQuery) Only(ctx context.Context) (*UID, error)

Only returns a single UID entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one UID entity is found. Returns a *NotFoundError when no UID entities are found.

func (*UIDQuery) OnlyID

func (uq *UIDQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only UID ID in the query. Returns a *NotSingularError when more than one UID ID is found. Returns a *NotFoundError when no entities are found.

func (*UIDQuery) OnlyIDX

func (uq *UIDQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*UIDQuery) OnlyX

func (uq *UIDQuery) OnlyX(ctx context.Context) *UID

OnlyX is like Only, but panics if an error occurs.

func (*UIDQuery) Order

func (uq *UIDQuery) Order(o ...OrderFunc) *UIDQuery

Order adds an order step to the query.

func (*UIDQuery) QueryMailbox

func (uq *UIDQuery) QueryMailbox() *MailboxQuery

QueryMailbox chains the current query on the "mailbox" edge.

func (*UIDQuery) QueryMessage

func (uq *UIDQuery) QueryMessage() *MessageQuery

QueryMessage chains the current query on the "message" edge.

func (*UIDQuery) Select

func (uq *UIDQuery) Select(fields ...string) *UIDSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	UID int `json:"UID,omitempty"`
}

client.UID.Query().
	Select(uid.FieldUID).
	Scan(ctx, &v)

func (*UIDQuery) Unique

func (uq *UIDQuery) Unique(unique bool) *UIDQuery

Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.

func (*UIDQuery) Where

func (uq *UIDQuery) Where(ps ...predicate.UID) *UIDQuery

Where adds a new predicate for the UIDQuery builder.

func (*UIDQuery) WithMailbox

func (uq *UIDQuery) WithMailbox(opts ...func(*MailboxQuery)) *UIDQuery

WithMailbox tells the query-builder to eager-load the nodes that are connected to the "mailbox" edge. The optional arguments are used to configure the query builder of the edge.

func (*UIDQuery) WithMessage

func (uq *UIDQuery) WithMessage(opts ...func(*MessageQuery)) *UIDQuery

WithMessage tells the query-builder to eager-load the nodes that are connected to the "message" edge. The optional arguments are used to configure the query builder of the edge.

type UIDSelect

type UIDSelect struct {
	*UIDQuery
	// contains filtered or unexported fields
}

UIDSelect is the builder for selecting fields of UID entities.

func (*UIDSelect) Bool

func (us *UIDSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*UIDSelect) BoolX

func (us *UIDSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*UIDSelect) Bools

func (us *UIDSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*UIDSelect) BoolsX

func (us *UIDSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*UIDSelect) Float64

func (us *UIDSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*UIDSelect) Float64X

func (us *UIDSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*UIDSelect) Float64s

func (us *UIDSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*UIDSelect) Float64sX

func (us *UIDSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*UIDSelect) Int

func (us *UIDSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*UIDSelect) IntX

func (us *UIDSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*UIDSelect) Ints

func (us *UIDSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*UIDSelect) IntsX

func (us *UIDSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*UIDSelect) Scan

func (us *UIDSelect) Scan(ctx context.Context, v interface{}) error

Scan applies the selector query and scans the result into the given value.

func (*UIDSelect) ScanX

func (us *UIDSelect) ScanX(ctx context.Context, v interface{})

ScanX is like Scan, but panics if an error occurs.

func (*UIDSelect) String

func (us *UIDSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*UIDSelect) StringX

func (us *UIDSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*UIDSelect) Strings

func (us *UIDSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*UIDSelect) StringsX

func (us *UIDSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type UIDUpdate

type UIDUpdate struct {
	// contains filtered or unexported fields
}

UIDUpdate is the builder for updating UID entities.

func (*UIDUpdate) AddUID

func (uu *UIDUpdate) AddUID(i int) *UIDUpdate

AddUID adds i to the "UID" field.

func (*UIDUpdate) ClearMailbox

func (uu *UIDUpdate) ClearMailbox() *UIDUpdate

ClearMailbox clears the "mailbox" edge to the Mailbox entity.

func (*UIDUpdate) ClearMessage

func (uu *UIDUpdate) ClearMessage() *UIDUpdate

ClearMessage clears the "message" edge to the Message entity.

func (*UIDUpdate) Exec

func (uu *UIDUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*UIDUpdate) ExecX

func (uu *UIDUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UIDUpdate) Mutation

func (uu *UIDUpdate) Mutation() *UIDMutation

Mutation returns the UIDMutation object of the builder.

func (*UIDUpdate) Save

func (uu *UIDUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*UIDUpdate) SaveX

func (uu *UIDUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*UIDUpdate) SetDeleted

func (uu *UIDUpdate) SetDeleted(b bool) *UIDUpdate

SetDeleted sets the "Deleted" field.

func (*UIDUpdate) SetInDeletionPool

func (uu *UIDUpdate) SetInDeletionPool(b bool) *UIDUpdate

SetInDeletionPool sets the "InDeletionPool" field.

func (*UIDUpdate) SetMailbox

func (uu *UIDUpdate) SetMailbox(m *Mailbox) *UIDUpdate

SetMailbox sets the "mailbox" edge to the Mailbox entity.

func (*UIDUpdate) SetMailboxID

func (uu *UIDUpdate) SetMailboxID(id int) *UIDUpdate

SetMailboxID sets the "mailbox" edge to the Mailbox entity by ID.

func (*UIDUpdate) SetMessage

func (uu *UIDUpdate) SetMessage(m *Message) *UIDUpdate

SetMessage sets the "message" edge to the Message entity.

func (*UIDUpdate) SetMessageID

func (uu *UIDUpdate) SetMessageID(id int) *UIDUpdate

SetMessageID sets the "message" edge to the Message entity by ID.

func (*UIDUpdate) SetNillableDeleted

func (uu *UIDUpdate) SetNillableDeleted(b *bool) *UIDUpdate

SetNillableDeleted sets the "Deleted" field if the given value is not nil.

func (*UIDUpdate) SetNillableInDeletionPool

func (uu *UIDUpdate) SetNillableInDeletionPool(b *bool) *UIDUpdate

SetNillableInDeletionPool sets the "InDeletionPool" field if the given value is not nil.

func (*UIDUpdate) SetNillableMailboxID

func (uu *UIDUpdate) SetNillableMailboxID(id *int) *UIDUpdate

SetNillableMailboxID sets the "mailbox" edge to the Mailbox entity by ID if the given value is not nil.

func (*UIDUpdate) SetNillableMessageID

func (uu *UIDUpdate) SetNillableMessageID(id *int) *UIDUpdate

SetNillableMessageID sets the "message" edge to the Message entity by ID if the given value is not nil.

func (*UIDUpdate) SetNillableRecent

func (uu *UIDUpdate) SetNillableRecent(b *bool) *UIDUpdate

SetNillableRecent sets the "Recent" field if the given value is not nil.

func (*UIDUpdate) SetRecent

func (uu *UIDUpdate) SetRecent(b bool) *UIDUpdate

SetRecent sets the "Recent" field.

func (*UIDUpdate) SetUID

func (uu *UIDUpdate) SetUID(i int) *UIDUpdate

SetUID sets the "UID" field.

func (*UIDUpdate) Where

func (uu *UIDUpdate) Where(ps ...predicate.UID) *UIDUpdate

Where appends a list predicates to the UIDUpdate builder.

type UIDUpdateOne

type UIDUpdateOne struct {
	// contains filtered or unexported fields
}

UIDUpdateOne is the builder for updating a single UID entity.

func (*UIDUpdateOne) AddUID

func (uuo *UIDUpdateOne) AddUID(i int) *UIDUpdateOne

AddUID adds i to the "UID" field.

func (*UIDUpdateOne) ClearMailbox

func (uuo *UIDUpdateOne) ClearMailbox() *UIDUpdateOne

ClearMailbox clears the "mailbox" edge to the Mailbox entity.

func (*UIDUpdateOne) ClearMessage

func (uuo *UIDUpdateOne) ClearMessage() *UIDUpdateOne

ClearMessage clears the "message" edge to the Message entity.

func (*UIDUpdateOne) Exec

func (uuo *UIDUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*UIDUpdateOne) ExecX

func (uuo *UIDUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UIDUpdateOne) Mutation

func (uuo *UIDUpdateOne) Mutation() *UIDMutation

Mutation returns the UIDMutation object of the builder.

func (*UIDUpdateOne) Save

func (uuo *UIDUpdateOne) Save(ctx context.Context) (*UID, error)

Save executes the query and returns the updated UID entity.

func (*UIDUpdateOne) SaveX

func (uuo *UIDUpdateOne) SaveX(ctx context.Context) *UID

SaveX is like Save, but panics if an error occurs.

func (*UIDUpdateOne) Select

func (uuo *UIDUpdateOne) Select(field string, fields ...string) *UIDUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*UIDUpdateOne) SetDeleted

func (uuo *UIDUpdateOne) SetDeleted(b bool) *UIDUpdateOne

SetDeleted sets the "Deleted" field.

func (*UIDUpdateOne) SetInDeletionPool

func (uuo *UIDUpdateOne) SetInDeletionPool(b bool) *UIDUpdateOne

SetInDeletionPool sets the "InDeletionPool" field.

func (*UIDUpdateOne) SetMailbox

func (uuo *UIDUpdateOne) SetMailbox(m *Mailbox) *UIDUpdateOne

SetMailbox sets the "mailbox" edge to the Mailbox entity.

func (*UIDUpdateOne) SetMailboxID

func (uuo *UIDUpdateOne) SetMailboxID(id int) *UIDUpdateOne

SetMailboxID sets the "mailbox" edge to the Mailbox entity by ID.

func (*UIDUpdateOne) SetMessage

func (uuo *UIDUpdateOne) SetMessage(m *Message) *UIDUpdateOne

SetMessage sets the "message" edge to the Message entity.

func (*UIDUpdateOne) SetMessageID

func (uuo *UIDUpdateOne) SetMessageID(id int) *UIDUpdateOne

SetMessageID sets the "message" edge to the Message entity by ID.

func (*UIDUpdateOne) SetNillableDeleted

func (uuo *UIDUpdateOne) SetNillableDeleted(b *bool) *UIDUpdateOne

SetNillableDeleted sets the "Deleted" field if the given value is not nil.

func (*UIDUpdateOne) SetNillableInDeletionPool

func (uuo *UIDUpdateOne) SetNillableInDeletionPool(b *bool) *UIDUpdateOne

SetNillableInDeletionPool sets the "InDeletionPool" field if the given value is not nil.

func (*UIDUpdateOne) SetNillableMailboxID

func (uuo *UIDUpdateOne) SetNillableMailboxID(id *int) *UIDUpdateOne

SetNillableMailboxID sets the "mailbox" edge to the Mailbox entity by ID if the given value is not nil.

func (*UIDUpdateOne) SetNillableMessageID

func (uuo *UIDUpdateOne) SetNillableMessageID(id *int) *UIDUpdateOne

SetNillableMessageID sets the "message" edge to the Message entity by ID if the given value is not nil.

func (*UIDUpdateOne) SetNillableRecent

func (uuo *UIDUpdateOne) SetNillableRecent(b *bool) *UIDUpdateOne

SetNillableRecent sets the "Recent" field if the given value is not nil.

func (*UIDUpdateOne) SetRecent

func (uuo *UIDUpdateOne) SetRecent(b bool) *UIDUpdateOne

SetRecent sets the "Recent" field.

func (*UIDUpdateOne) SetUID

func (uuo *UIDUpdateOne) SetUID(i int) *UIDUpdateOne

SetUID sets the "UID" field.

type UIDs

type UIDs []*UID

UIDs is a parsable slice of UID.

type ValidationError

type ValidationError struct {
	Name string // Field or edge name.
	// contains filtered or unexported fields
}

ValidationError returns when validating a field or edge fails.

func (*ValidationError) Error

func (e *ValidationError) Error() string

Error implements the error interface.

func (*ValidationError) Unwrap

func (e *ValidationError) Unwrap() error

Unwrap implements the errors.Wrapper interface.

type Value

type Value = ent.Value

ent aliases to avoid import conflicts in user's code.

Jump to

Keyboard shortcuts

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