ent

package
v0.0.0-...-91de038 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2023 License: MIT Imports: 21 Imported by: 3

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.
	TypeDChat         = "DChat"
	TypeDChessdbCache = "DChessdbCache"
	TypeDRoom         = "DRoom"
	TypeDSession      = "DSession"
	TypeDUser         = "DUser"
)

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
	// DChat is the client for interacting with the DChat builders.
	DChat *DChatClient
	// DChessdbCache is the client for interacting with the DChessdbCache builders.
	DChessdbCache *DChessdbCacheClient
	// DRoom is the client for interacting with the DRoom builders.
	DRoom *DRoomClient
	// DSession is the client for interacting with the DSession builders.
	DSession *DSessionClient
	// DUser is the client for interacting with the DUser builders.
	DUser *DUserClient
	// 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().
	DChat.
	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(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 Committer 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 DChat

type DChat struct {

	// ID of the ent.
	ID string `json:"id,omitempty"`
	// SessionID holds the value of the "session_id" field.
	SessionID string `json:"session_id,omitempty"`
	// UserID holds the value of the "user_id" field.
	UserID string `json:"user_id,omitempty"`
	// RoomID holds the value of the "room_id" field.
	RoomID string `json:"room_id,omitempty"`
	// Text holds the value of the "text" field.
	Text string `json:"text,omitempty"`
	// CreateTime holds the value of the "create_time" field.
	CreateTime time.Time `json:"create_time,omitempty"`
	// contains filtered or unexported fields
}

DChat is the model entity for the DChat schema.

func (*DChat) String

func (d *DChat) String() string

String implements the fmt.Stringer.

func (*DChat) Unwrap

func (d *DChat) Unwrap() *DChat

Unwrap unwraps the DChat 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 (*DChat) Update

func (d *DChat) Update() *DChatUpdateOne

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

type DChatClient

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

DChatClient is a client for the DChat schema.

func NewDChatClient

func NewDChatClient(c config) *DChatClient

NewDChatClient returns a client for the DChat from the given config.

func (*DChatClient) Create

func (c *DChatClient) Create() *DChatCreate

Create returns a create builder for DChat.

func (*DChatClient) CreateBulk

func (c *DChatClient) CreateBulk(builders ...*DChatCreate) *DChatCreateBulk

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

func (*DChatClient) Delete

func (c *DChatClient) Delete() *DChatDelete

Delete returns a delete builder for DChat.

func (*DChatClient) DeleteOne

func (c *DChatClient) DeleteOne(d *DChat) *DChatDeleteOne

DeleteOne returns a delete builder for the given entity.

func (*DChatClient) DeleteOneID

func (c *DChatClient) DeleteOneID(id string) *DChatDeleteOne

DeleteOneID returns a delete builder for the given id.

func (*DChatClient) Get

func (c *DChatClient) Get(ctx context.Context, id string) (*DChat, error)

Get returns a DChat entity by its id.

func (*DChatClient) GetX

func (c *DChatClient) GetX(ctx context.Context, id string) *DChat

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

func (*DChatClient) Hooks

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

Hooks returns the client hooks.

func (*DChatClient) Query

func (c *DChatClient) Query() *DChatQuery

Query returns a query builder for DChat.

func (*DChatClient) Update

func (c *DChatClient) Update() *DChatUpdate

Update returns an update builder for DChat.

func (*DChatClient) UpdateOne

func (c *DChatClient) UpdateOne(d *DChat) *DChatUpdateOne

UpdateOne returns an update builder for the given entity.

func (*DChatClient) UpdateOneID

func (c *DChatClient) UpdateOneID(id string) *DChatUpdateOne

UpdateOneID returns an update builder for the given id.

func (*DChatClient) Use

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

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

type DChatCreate

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

DChatCreate is the builder for creating a DChat entity.

func (*DChatCreate) Exec

func (dc *DChatCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*DChatCreate) ExecX

func (dc *DChatCreate) ExecX(ctx context.Context)

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

func (*DChatCreate) Mutation

func (dc *DChatCreate) Mutation() *DChatMutation

Mutation returns the DChatMutation object of the builder.

func (*DChatCreate) Save

func (dc *DChatCreate) Save(ctx context.Context) (*DChat, error)

Save creates the DChat in the database.

func (*DChatCreate) SaveX

func (dc *DChatCreate) SaveX(ctx context.Context) *DChat

SaveX calls Save and panics if Save returns an error.

func (*DChatCreate) SetCreateTime

func (dc *DChatCreate) SetCreateTime(t time.Time) *DChatCreate

SetCreateTime sets the "create_time" field.

func (*DChatCreate) SetID

func (dc *DChatCreate) SetID(s string) *DChatCreate

SetID sets the "id" field.

func (*DChatCreate) SetRoomID

func (dc *DChatCreate) SetRoomID(s string) *DChatCreate

SetRoomID sets the "room_id" field.

func (*DChatCreate) SetSessionID

func (dc *DChatCreate) SetSessionID(s string) *DChatCreate

SetSessionID sets the "session_id" field.

func (*DChatCreate) SetText

func (dc *DChatCreate) SetText(s string) *DChatCreate

SetText sets the "text" field.

func (*DChatCreate) SetUserID

func (dc *DChatCreate) SetUserID(s string) *DChatCreate

SetUserID sets the "user_id" field.

type DChatCreateBulk

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

DChatCreateBulk is the builder for creating many DChat entities in bulk.

func (*DChatCreateBulk) Exec

func (dcb *DChatCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*DChatCreateBulk) ExecX

func (dcb *DChatCreateBulk) ExecX(ctx context.Context)

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

func (*DChatCreateBulk) Save

func (dcb *DChatCreateBulk) Save(ctx context.Context) ([]*DChat, error)

Save creates the DChat entities in the database.

func (*DChatCreateBulk) SaveX

func (dcb *DChatCreateBulk) SaveX(ctx context.Context) []*DChat

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

type DChatDelete

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

DChatDelete is the builder for deleting a DChat entity.

func (*DChatDelete) Exec

func (dd *DChatDelete) Exec(ctx context.Context) (int, error)

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

func (*DChatDelete) ExecX

func (dd *DChatDelete) ExecX(ctx context.Context) int

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

func (*DChatDelete) Where

func (dd *DChatDelete) Where(ps ...predicate.DChat) *DChatDelete

Where appends a list predicates to the DChatDelete builder.

type DChatDeleteOne

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

DChatDeleteOne is the builder for deleting a single DChat entity.

func (*DChatDeleteOne) Exec

func (ddo *DChatDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*DChatDeleteOne) ExecX

func (ddo *DChatDeleteOne) ExecX(ctx context.Context)

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

type DChatGroupBy

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

DChatGroupBy is the group-by builder for DChat entities.

func (*DChatGroupBy) Aggregate

func (dgb *DChatGroupBy) Aggregate(fns ...AggregateFunc) *DChatGroupBy

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

func (*DChatGroupBy) Bool

func (dgb *DChatGroupBy) 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 (*DChatGroupBy) BoolX

func (dgb *DChatGroupBy) BoolX(ctx context.Context) bool

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

func (*DChatGroupBy) Bools

func (dgb *DChatGroupBy) 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 (*DChatGroupBy) BoolsX

func (dgb *DChatGroupBy) BoolsX(ctx context.Context) []bool

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

func (*DChatGroupBy) Float64

func (dgb *DChatGroupBy) 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 (*DChatGroupBy) Float64X

func (dgb *DChatGroupBy) Float64X(ctx context.Context) float64

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

func (*DChatGroupBy) Float64s

func (dgb *DChatGroupBy) 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 (*DChatGroupBy) Float64sX

func (dgb *DChatGroupBy) Float64sX(ctx context.Context) []float64

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

func (*DChatGroupBy) Int

func (dgb *DChatGroupBy) 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 (*DChatGroupBy) IntX

func (dgb *DChatGroupBy) IntX(ctx context.Context) int

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

func (*DChatGroupBy) Ints

func (dgb *DChatGroupBy) 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 (*DChatGroupBy) IntsX

func (dgb *DChatGroupBy) IntsX(ctx context.Context) []int

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

func (*DChatGroupBy) Scan

func (dgb *DChatGroupBy) Scan(ctx context.Context, v interface{}) error

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

func (*DChatGroupBy) ScanX

func (dgb *DChatGroupBy) ScanX(ctx context.Context, v interface{})

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

func (*DChatGroupBy) String

func (dgb *DChatGroupBy) 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 (*DChatGroupBy) StringX

func (dgb *DChatGroupBy) StringX(ctx context.Context) string

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

func (*DChatGroupBy) Strings

func (dgb *DChatGroupBy) 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 (*DChatGroupBy) StringsX

func (dgb *DChatGroupBy) StringsX(ctx context.Context) []string

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

type DChatMutation

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

DChatMutation represents an operation that mutates the DChat nodes in the graph.

func (*DChatMutation) AddField

func (m *DChatMutation) 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 (*DChatMutation) AddedEdges

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

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

func (*DChatMutation) AddedField

func (m *DChatMutation) 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 (*DChatMutation) AddedFields

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

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

func (*DChatMutation) AddedIDs

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

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

func (*DChatMutation) ClearEdge

func (m *DChatMutation) 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 (*DChatMutation) ClearField

func (m *DChatMutation) 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 (*DChatMutation) ClearedEdges

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

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

func (*DChatMutation) ClearedFields

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

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

func (DChatMutation) Client

func (m DChatMutation) 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 (*DChatMutation) CreateTime

func (m *DChatMutation) CreateTime() (r time.Time, exists bool)

CreateTime returns the value of the "create_time" field in the mutation.

func (*DChatMutation) EdgeCleared

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

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

func (*DChatMutation) Field

func (m *DChatMutation) 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 (*DChatMutation) FieldCleared

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

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

func (*DChatMutation) Fields

func (m *DChatMutation) 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 (*DChatMutation) ID

func (m *DChatMutation) ID() (id string, 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 (*DChatMutation) OldCreateTime

func (m *DChatMutation) OldCreateTime(ctx context.Context) (v time.Time, err error)

OldCreateTime returns the old "create_time" field's value of the DChat entity. If the DChat 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 (*DChatMutation) OldField

func (m *DChatMutation) 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 (*DChatMutation) OldRoomID

func (m *DChatMutation) OldRoomID(ctx context.Context) (v string, err error)

OldRoomID returns the old "room_id" field's value of the DChat entity. If the DChat 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 (*DChatMutation) OldSessionID

func (m *DChatMutation) OldSessionID(ctx context.Context) (v string, err error)

OldSessionID returns the old "session_id" field's value of the DChat entity. If the DChat 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 (*DChatMutation) OldText

func (m *DChatMutation) OldText(ctx context.Context) (v string, err error)

OldText returns the old "text" field's value of the DChat entity. If the DChat 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 (*DChatMutation) OldUserID

func (m *DChatMutation) OldUserID(ctx context.Context) (v string, err error)

OldUserID returns the old "user_id" field's value of the DChat entity. If the DChat 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 (*DChatMutation) Op

func (m *DChatMutation) Op() Op

Op returns the operation name.

func (*DChatMutation) RemovedEdges

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

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

func (*DChatMutation) RemovedIDs

func (m *DChatMutation) 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 (*DChatMutation) ResetCreateTime

func (m *DChatMutation) ResetCreateTime()

ResetCreateTime resets all changes to the "create_time" field.

func (*DChatMutation) ResetEdge

func (m *DChatMutation) 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 (*DChatMutation) ResetField

func (m *DChatMutation) 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 (*DChatMutation) ResetRoomID

func (m *DChatMutation) ResetRoomID()

ResetRoomID resets all changes to the "room_id" field.

func (*DChatMutation) ResetSessionID

func (m *DChatMutation) ResetSessionID()

ResetSessionID resets all changes to the "session_id" field.

func (*DChatMutation) ResetText

func (m *DChatMutation) ResetText()

ResetText resets all changes to the "text" field.

func (*DChatMutation) ResetUserID

func (m *DChatMutation) ResetUserID()

ResetUserID resets all changes to the "user_id" field.

func (*DChatMutation) RoomID

func (m *DChatMutation) RoomID() (r string, exists bool)

RoomID returns the value of the "room_id" field in the mutation.

func (*DChatMutation) SessionID

func (m *DChatMutation) SessionID() (r string, exists bool)

SessionID returns the value of the "session_id" field in the mutation.

func (*DChatMutation) SetCreateTime

func (m *DChatMutation) SetCreateTime(t time.Time)

SetCreateTime sets the "create_time" field.

func (*DChatMutation) SetField

func (m *DChatMutation) 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 (*DChatMutation) SetID

func (m *DChatMutation) SetID(id string)

SetID sets the value of the id field. Note that this operation is only accepted on creation of DChat entities.

func (*DChatMutation) SetRoomID

func (m *DChatMutation) SetRoomID(s string)

SetRoomID sets the "room_id" field.

func (*DChatMutation) SetSessionID

func (m *DChatMutation) SetSessionID(s string)

SetSessionID sets the "session_id" field.

func (*DChatMutation) SetText

func (m *DChatMutation) SetText(s string)

SetText sets the "text" field.

func (*DChatMutation) SetUserID

func (m *DChatMutation) SetUserID(s string)

SetUserID sets the "user_id" field.

func (*DChatMutation) Text

func (m *DChatMutation) Text() (r string, exists bool)

Text returns the value of the "text" field in the mutation.

func (DChatMutation) Tx

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

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

func (*DChatMutation) Type

func (m *DChatMutation) Type() string

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

func (*DChatMutation) UserID

func (m *DChatMutation) UserID() (r string, exists bool)

UserID returns the value of the "user_id" field in the mutation.

func (*DChatMutation) Where

func (m *DChatMutation) Where(ps ...predicate.DChat)

Where appends a list predicates to the DChatMutation builder.

type DChatQuery

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

DChatQuery is the builder for querying DChat entities.

func (*DChatQuery) All

func (dq *DChatQuery) All(ctx context.Context) ([]*DChat, error)

All executes the query and returns a list of DChats.

func (*DChatQuery) AllX

func (dq *DChatQuery) AllX(ctx context.Context) []*DChat

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

func (*DChatQuery) Clone

func (dq *DChatQuery) Clone() *DChatQuery

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

func (*DChatQuery) Count

func (dq *DChatQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*DChatQuery) CountX

func (dq *DChatQuery) CountX(ctx context.Context) int

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

func (*DChatQuery) Exist

func (dq *DChatQuery) Exist(ctx context.Context) (bool, error)

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

func (*DChatQuery) ExistX

func (dq *DChatQuery) ExistX(ctx context.Context) bool

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

func (*DChatQuery) First

func (dq *DChatQuery) First(ctx context.Context) (*DChat, error)

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

func (*DChatQuery) FirstID

func (dq *DChatQuery) FirstID(ctx context.Context) (id string, err error)

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

func (*DChatQuery) FirstIDX

func (dq *DChatQuery) FirstIDX(ctx context.Context) string

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

func (*DChatQuery) FirstX

func (dq *DChatQuery) FirstX(ctx context.Context) *DChat

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

func (*DChatQuery) GroupBy

func (dq *DChatQuery) GroupBy(field string, fields ...string) *DChatGroupBy

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 {
	SessionID string `json:"session_id,omitempty"`
	Count int `json:"count,omitempty"`
}

client.DChat.Query().
	GroupBy(dchat.FieldSessionID).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*DChatQuery) IDs

func (dq *DChatQuery) IDs(ctx context.Context) ([]string, error)

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

func (*DChatQuery) IDsX

func (dq *DChatQuery) IDsX(ctx context.Context) []string

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

func (*DChatQuery) Limit

func (dq *DChatQuery) Limit(limit int) *DChatQuery

Limit adds a limit step to the query.

func (*DChatQuery) Offset

func (dq *DChatQuery) Offset(offset int) *DChatQuery

Offset adds an offset step to the query.

func (*DChatQuery) Only

func (dq *DChatQuery) Only(ctx context.Context) (*DChat, error)

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

func (*DChatQuery) OnlyID

func (dq *DChatQuery) OnlyID(ctx context.Context) (id string, err error)

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

func (*DChatQuery) OnlyIDX

func (dq *DChatQuery) OnlyIDX(ctx context.Context) string

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

func (*DChatQuery) OnlyX

func (dq *DChatQuery) OnlyX(ctx context.Context) *DChat

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

func (*DChatQuery) Order

func (dq *DChatQuery) Order(o ...OrderFunc) *DChatQuery

Order adds an order step to the query.

func (*DChatQuery) Select

func (dq *DChatQuery) Select(fields ...string) *DChatSelect

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 {
	SessionID string `json:"session_id,omitempty"`
}

client.DChat.Query().
	Select(dchat.FieldSessionID).
	Scan(ctx, &v)

func (*DChatQuery) Unique

func (dq *DChatQuery) Unique(unique bool) *DChatQuery

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 (*DChatQuery) Where

func (dq *DChatQuery) Where(ps ...predicate.DChat) *DChatQuery

Where adds a new predicate for the DChatQuery builder.

type DChatSelect

type DChatSelect struct {
	*DChatQuery
	// contains filtered or unexported fields
}

DChatSelect is the builder for selecting fields of DChat entities.

func (*DChatSelect) Bool

func (ds *DChatSelect) Bool(ctx context.Context) (_ bool, err error)

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

func (*DChatSelect) BoolX

func (ds *DChatSelect) BoolX(ctx context.Context) bool

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

func (*DChatSelect) Bools

func (ds *DChatSelect) Bools(ctx context.Context) ([]bool, error)

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

func (*DChatSelect) BoolsX

func (ds *DChatSelect) BoolsX(ctx context.Context) []bool

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

func (*DChatSelect) Float64

func (ds *DChatSelect) Float64(ctx context.Context) (_ float64, err error)

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

func (*DChatSelect) Float64X

func (ds *DChatSelect) Float64X(ctx context.Context) float64

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

func (*DChatSelect) Float64s

func (ds *DChatSelect) Float64s(ctx context.Context) ([]float64, error)

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

func (*DChatSelect) Float64sX

func (ds *DChatSelect) Float64sX(ctx context.Context) []float64

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

func (*DChatSelect) Int

func (ds *DChatSelect) Int(ctx context.Context) (_ int, err error)

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

func (*DChatSelect) IntX

func (ds *DChatSelect) IntX(ctx context.Context) int

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

func (*DChatSelect) Ints

func (ds *DChatSelect) Ints(ctx context.Context) ([]int, error)

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

func (*DChatSelect) IntsX

func (ds *DChatSelect) IntsX(ctx context.Context) []int

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

func (*DChatSelect) Scan

func (ds *DChatSelect) Scan(ctx context.Context, v interface{}) error

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

func (*DChatSelect) ScanX

func (ds *DChatSelect) ScanX(ctx context.Context, v interface{})

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

func (*DChatSelect) String

func (ds *DChatSelect) String(ctx context.Context) (_ string, err error)

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

func (*DChatSelect) StringX

func (ds *DChatSelect) StringX(ctx context.Context) string

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

func (*DChatSelect) Strings

func (ds *DChatSelect) Strings(ctx context.Context) ([]string, error)

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

func (*DChatSelect) StringsX

func (ds *DChatSelect) StringsX(ctx context.Context) []string

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

type DChatUpdate

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

DChatUpdate is the builder for updating DChat entities.

func (*DChatUpdate) Exec

func (du *DChatUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*DChatUpdate) ExecX

func (du *DChatUpdate) ExecX(ctx context.Context)

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

func (*DChatUpdate) Mutation

func (du *DChatUpdate) Mutation() *DChatMutation

Mutation returns the DChatMutation object of the builder.

func (*DChatUpdate) Save

func (du *DChatUpdate) Save(ctx context.Context) (int, error)

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

func (*DChatUpdate) SaveX

func (du *DChatUpdate) SaveX(ctx context.Context) int

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

func (*DChatUpdate) SetCreateTime

func (du *DChatUpdate) SetCreateTime(t time.Time) *DChatUpdate

SetCreateTime sets the "create_time" field.

func (*DChatUpdate) SetRoomID

func (du *DChatUpdate) SetRoomID(s string) *DChatUpdate

SetRoomID sets the "room_id" field.

func (*DChatUpdate) SetSessionID

func (du *DChatUpdate) SetSessionID(s string) *DChatUpdate

SetSessionID sets the "session_id" field.

func (*DChatUpdate) SetText

func (du *DChatUpdate) SetText(s string) *DChatUpdate

SetText sets the "text" field.

func (*DChatUpdate) SetUserID

func (du *DChatUpdate) SetUserID(s string) *DChatUpdate

SetUserID sets the "user_id" field.

func (*DChatUpdate) Where

func (du *DChatUpdate) Where(ps ...predicate.DChat) *DChatUpdate

Where appends a list predicates to the DChatUpdate builder.

type DChatUpdateOne

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

DChatUpdateOne is the builder for updating a single DChat entity.

func (*DChatUpdateOne) Exec

func (duo *DChatUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*DChatUpdateOne) ExecX

func (duo *DChatUpdateOne) ExecX(ctx context.Context)

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

func (*DChatUpdateOne) Mutation

func (duo *DChatUpdateOne) Mutation() *DChatMutation

Mutation returns the DChatMutation object of the builder.

func (*DChatUpdateOne) Save

func (duo *DChatUpdateOne) Save(ctx context.Context) (*DChat, error)

Save executes the query and returns the updated DChat entity.

func (*DChatUpdateOne) SaveX

func (duo *DChatUpdateOne) SaveX(ctx context.Context) *DChat

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

func (*DChatUpdateOne) Select

func (duo *DChatUpdateOne) Select(field string, fields ...string) *DChatUpdateOne

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

func (*DChatUpdateOne) SetCreateTime

func (duo *DChatUpdateOne) SetCreateTime(t time.Time) *DChatUpdateOne

SetCreateTime sets the "create_time" field.

func (*DChatUpdateOne) SetRoomID

func (duo *DChatUpdateOne) SetRoomID(s string) *DChatUpdateOne

SetRoomID sets the "room_id" field.

func (*DChatUpdateOne) SetSessionID

func (duo *DChatUpdateOne) SetSessionID(s string) *DChatUpdateOne

SetSessionID sets the "session_id" field.

func (*DChatUpdateOne) SetText

func (duo *DChatUpdateOne) SetText(s string) *DChatUpdateOne

SetText sets the "text" field.

func (*DChatUpdateOne) SetUserID

func (duo *DChatUpdateOne) SetUserID(s string) *DChatUpdateOne

SetUserID sets the "user_id" field.

type DChats

type DChats []*DChat

DChats is a parsable slice of DChat.

type DChessdbCache

type DChessdbCache struct {

	// ID of the ent.
	ID string `json:"id,omitempty"`
	// Board holds the value of the "board" field.
	Board string `json:"board,omitempty"`
	// Resp holds the value of the "resp" field.
	Resp []byte `json:"resp,omitempty"`
	// CreateTime holds the value of the "create_time" field.
	CreateTime time.Time `json:"create_time,omitempty"`
	// contains filtered or unexported fields
}

DChessdbCache is the model entity for the DChessdbCache schema.

func (*DChessdbCache) String

func (dc *DChessdbCache) String() string

String implements the fmt.Stringer.

func (*DChessdbCache) Unwrap

func (dc *DChessdbCache) Unwrap() *DChessdbCache

Unwrap unwraps the DChessdbCache 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 (*DChessdbCache) Update

func (dc *DChessdbCache) Update() *DChessdbCacheUpdateOne

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

type DChessdbCacheClient

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

DChessdbCacheClient is a client for the DChessdbCache schema.

func NewDChessdbCacheClient

func NewDChessdbCacheClient(c config) *DChessdbCacheClient

NewDChessdbCacheClient returns a client for the DChessdbCache from the given config.

func (*DChessdbCacheClient) Create

Create returns a create builder for DChessdbCache.

func (*DChessdbCacheClient) CreateBulk

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

func (*DChessdbCacheClient) Delete

Delete returns a delete builder for DChessdbCache.

func (*DChessdbCacheClient) DeleteOne

DeleteOne returns a delete builder for the given entity.

func (*DChessdbCacheClient) DeleteOneID

DeleteOneID returns a delete builder for the given id.

func (*DChessdbCacheClient) Get

Get returns a DChessdbCache entity by its id.

func (*DChessdbCacheClient) GetX

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

func (*DChessdbCacheClient) Hooks

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

Hooks returns the client hooks.

func (*DChessdbCacheClient) Query

Query returns a query builder for DChessdbCache.

func (*DChessdbCacheClient) Update

Update returns an update builder for DChessdbCache.

func (*DChessdbCacheClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*DChessdbCacheClient) UpdateOneID

UpdateOneID returns an update builder for the given id.

func (*DChessdbCacheClient) Use

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

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

type DChessdbCacheCreate

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

DChessdbCacheCreate is the builder for creating a DChessdbCache entity.

func (*DChessdbCacheCreate) Exec

func (dcc *DChessdbCacheCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*DChessdbCacheCreate) ExecX

func (dcc *DChessdbCacheCreate) ExecX(ctx context.Context)

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

func (*DChessdbCacheCreate) Mutation

func (dcc *DChessdbCacheCreate) Mutation() *DChessdbCacheMutation

Mutation returns the DChessdbCacheMutation object of the builder.

func (*DChessdbCacheCreate) Save

Save creates the DChessdbCache in the database.

func (*DChessdbCacheCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*DChessdbCacheCreate) SetBoard

SetBoard sets the "board" field.

func (*DChessdbCacheCreate) SetCreateTime

func (dcc *DChessdbCacheCreate) SetCreateTime(t time.Time) *DChessdbCacheCreate

SetCreateTime sets the "create_time" field.

func (*DChessdbCacheCreate) SetID

SetID sets the "id" field.

func (*DChessdbCacheCreate) SetResp

func (dcc *DChessdbCacheCreate) SetResp(b []byte) *DChessdbCacheCreate

SetResp sets the "resp" field.

type DChessdbCacheCreateBulk

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

DChessdbCacheCreateBulk is the builder for creating many DChessdbCache entities in bulk.

func (*DChessdbCacheCreateBulk) Exec

func (dccb *DChessdbCacheCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*DChessdbCacheCreateBulk) ExecX

func (dccb *DChessdbCacheCreateBulk) ExecX(ctx context.Context)

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

func (*DChessdbCacheCreateBulk) Save

Save creates the DChessdbCache entities in the database.

func (*DChessdbCacheCreateBulk) SaveX

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

type DChessdbCacheDelete

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

DChessdbCacheDelete is the builder for deleting a DChessdbCache entity.

func (*DChessdbCacheDelete) Exec

func (dcd *DChessdbCacheDelete) Exec(ctx context.Context) (int, error)

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

func (*DChessdbCacheDelete) ExecX

func (dcd *DChessdbCacheDelete) ExecX(ctx context.Context) int

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

func (*DChessdbCacheDelete) Where

Where appends a list predicates to the DChessdbCacheDelete builder.

type DChessdbCacheDeleteOne

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

DChessdbCacheDeleteOne is the builder for deleting a single DChessdbCache entity.

func (*DChessdbCacheDeleteOne) Exec

func (dcdo *DChessdbCacheDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*DChessdbCacheDeleteOne) ExecX

func (dcdo *DChessdbCacheDeleteOne) ExecX(ctx context.Context)

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

type DChessdbCacheGroupBy

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

DChessdbCacheGroupBy is the group-by builder for DChessdbCache entities.

func (*DChessdbCacheGroupBy) Aggregate

func (dcgb *DChessdbCacheGroupBy) Aggregate(fns ...AggregateFunc) *DChessdbCacheGroupBy

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

func (*DChessdbCacheGroupBy) Bool

func (dcgb *DChessdbCacheGroupBy) 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 (*DChessdbCacheGroupBy) BoolX

func (dcgb *DChessdbCacheGroupBy) BoolX(ctx context.Context) bool

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

func (*DChessdbCacheGroupBy) Bools

func (dcgb *DChessdbCacheGroupBy) 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 (*DChessdbCacheGroupBy) BoolsX

func (dcgb *DChessdbCacheGroupBy) BoolsX(ctx context.Context) []bool

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

func (*DChessdbCacheGroupBy) Float64

func (dcgb *DChessdbCacheGroupBy) 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 (*DChessdbCacheGroupBy) Float64X

func (dcgb *DChessdbCacheGroupBy) Float64X(ctx context.Context) float64

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

func (*DChessdbCacheGroupBy) Float64s

func (dcgb *DChessdbCacheGroupBy) 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 (*DChessdbCacheGroupBy) Float64sX

func (dcgb *DChessdbCacheGroupBy) Float64sX(ctx context.Context) []float64

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

func (*DChessdbCacheGroupBy) Int

func (dcgb *DChessdbCacheGroupBy) 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 (*DChessdbCacheGroupBy) IntX

func (dcgb *DChessdbCacheGroupBy) IntX(ctx context.Context) int

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

func (*DChessdbCacheGroupBy) Ints

func (dcgb *DChessdbCacheGroupBy) 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 (*DChessdbCacheGroupBy) IntsX

func (dcgb *DChessdbCacheGroupBy) IntsX(ctx context.Context) []int

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

func (*DChessdbCacheGroupBy) Scan

func (dcgb *DChessdbCacheGroupBy) Scan(ctx context.Context, v interface{}) error

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

func (*DChessdbCacheGroupBy) ScanX

func (dcgb *DChessdbCacheGroupBy) ScanX(ctx context.Context, v interface{})

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

func (*DChessdbCacheGroupBy) String

func (dcgb *DChessdbCacheGroupBy) 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 (*DChessdbCacheGroupBy) StringX

func (dcgb *DChessdbCacheGroupBy) StringX(ctx context.Context) string

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

func (*DChessdbCacheGroupBy) Strings

func (dcgb *DChessdbCacheGroupBy) 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 (*DChessdbCacheGroupBy) StringsX

func (dcgb *DChessdbCacheGroupBy) StringsX(ctx context.Context) []string

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

type DChessdbCacheMutation

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

DChessdbCacheMutation represents an operation that mutates the DChessdbCache nodes in the graph.

func (*DChessdbCacheMutation) AddField

func (m *DChessdbCacheMutation) 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 (*DChessdbCacheMutation) AddedEdges

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

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

func (*DChessdbCacheMutation) AddedField

func (m *DChessdbCacheMutation) 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 (*DChessdbCacheMutation) AddedFields

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

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

func (*DChessdbCacheMutation) AddedIDs

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

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

func (*DChessdbCacheMutation) Board

func (m *DChessdbCacheMutation) Board() (r string, exists bool)

Board returns the value of the "board" field in the mutation.

func (*DChessdbCacheMutation) ClearEdge

func (m *DChessdbCacheMutation) 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 (*DChessdbCacheMutation) ClearField

func (m *DChessdbCacheMutation) 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 (*DChessdbCacheMutation) ClearedEdges

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

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

func (*DChessdbCacheMutation) ClearedFields

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

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

func (DChessdbCacheMutation) Client

func (m DChessdbCacheMutation) 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 (*DChessdbCacheMutation) CreateTime

func (m *DChessdbCacheMutation) CreateTime() (r time.Time, exists bool)

CreateTime returns the value of the "create_time" field in the mutation.

func (*DChessdbCacheMutation) EdgeCleared

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

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

func (*DChessdbCacheMutation) Field

func (m *DChessdbCacheMutation) 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 (*DChessdbCacheMutation) FieldCleared

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

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

func (*DChessdbCacheMutation) Fields

func (m *DChessdbCacheMutation) 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 (*DChessdbCacheMutation) ID

func (m *DChessdbCacheMutation) ID() (id string, 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 (*DChessdbCacheMutation) OldBoard

func (m *DChessdbCacheMutation) OldBoard(ctx context.Context) (v string, err error)

OldBoard returns the old "board" field's value of the DChessdbCache entity. If the DChessdbCache 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 (*DChessdbCacheMutation) OldCreateTime

func (m *DChessdbCacheMutation) OldCreateTime(ctx context.Context) (v time.Time, err error)

OldCreateTime returns the old "create_time" field's value of the DChessdbCache entity. If the DChessdbCache 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 (*DChessdbCacheMutation) OldField

func (m *DChessdbCacheMutation) 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 (*DChessdbCacheMutation) OldResp

func (m *DChessdbCacheMutation) OldResp(ctx context.Context) (v []byte, err error)

OldResp returns the old "resp" field's value of the DChessdbCache entity. If the DChessdbCache 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 (*DChessdbCacheMutation) Op

func (m *DChessdbCacheMutation) Op() Op

Op returns the operation name.

func (*DChessdbCacheMutation) RemovedEdges

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

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

func (*DChessdbCacheMutation) RemovedIDs

func (m *DChessdbCacheMutation) 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 (*DChessdbCacheMutation) ResetBoard

func (m *DChessdbCacheMutation) ResetBoard()

ResetBoard resets all changes to the "board" field.

func (*DChessdbCacheMutation) ResetCreateTime

func (m *DChessdbCacheMutation) ResetCreateTime()

ResetCreateTime resets all changes to the "create_time" field.

func (*DChessdbCacheMutation) ResetEdge

func (m *DChessdbCacheMutation) 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 (*DChessdbCacheMutation) ResetField

func (m *DChessdbCacheMutation) 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 (*DChessdbCacheMutation) ResetResp

func (m *DChessdbCacheMutation) ResetResp()

ResetResp resets all changes to the "resp" field.

func (*DChessdbCacheMutation) Resp

func (m *DChessdbCacheMutation) Resp() (r []byte, exists bool)

Resp returns the value of the "resp" field in the mutation.

func (*DChessdbCacheMutation) SetBoard

func (m *DChessdbCacheMutation) SetBoard(s string)

SetBoard sets the "board" field.

func (*DChessdbCacheMutation) SetCreateTime

func (m *DChessdbCacheMutation) SetCreateTime(t time.Time)

SetCreateTime sets the "create_time" field.

func (*DChessdbCacheMutation) SetField

func (m *DChessdbCacheMutation) 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 (*DChessdbCacheMutation) SetID

func (m *DChessdbCacheMutation) SetID(id string)

SetID sets the value of the id field. Note that this operation is only accepted on creation of DChessdbCache entities.

func (*DChessdbCacheMutation) SetResp

func (m *DChessdbCacheMutation) SetResp(b []byte)

SetResp sets the "resp" field.

func (DChessdbCacheMutation) Tx

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

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

func (*DChessdbCacheMutation) Type

func (m *DChessdbCacheMutation) Type() string

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

func (*DChessdbCacheMutation) Where

Where appends a list predicates to the DChessdbCacheMutation builder.

type DChessdbCacheQuery

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

DChessdbCacheQuery is the builder for querying DChessdbCache entities.

func (*DChessdbCacheQuery) All

All executes the query and returns a list of DChessdbCaches.

func (*DChessdbCacheQuery) AllX

func (dcq *DChessdbCacheQuery) AllX(ctx context.Context) []*DChessdbCache

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

func (*DChessdbCacheQuery) Clone

func (dcq *DChessdbCacheQuery) Clone() *DChessdbCacheQuery

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

func (*DChessdbCacheQuery) Count

func (dcq *DChessdbCacheQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*DChessdbCacheQuery) CountX

func (dcq *DChessdbCacheQuery) CountX(ctx context.Context) int

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

func (*DChessdbCacheQuery) Exist

func (dcq *DChessdbCacheQuery) Exist(ctx context.Context) (bool, error)

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

func (*DChessdbCacheQuery) ExistX

func (dcq *DChessdbCacheQuery) ExistX(ctx context.Context) bool

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

func (*DChessdbCacheQuery) First

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

func (*DChessdbCacheQuery) FirstID

func (dcq *DChessdbCacheQuery) FirstID(ctx context.Context) (id string, err error)

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

func (*DChessdbCacheQuery) FirstIDX

func (dcq *DChessdbCacheQuery) FirstIDX(ctx context.Context) string

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

func (*DChessdbCacheQuery) FirstX

func (dcq *DChessdbCacheQuery) FirstX(ctx context.Context) *DChessdbCache

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

func (*DChessdbCacheQuery) GroupBy

func (dcq *DChessdbCacheQuery) GroupBy(field string, fields ...string) *DChessdbCacheGroupBy

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 {
	Board string `json:"board,omitempty"`
	Count int `json:"count,omitempty"`
}

client.DChessdbCache.Query().
	GroupBy(dchessdbcache.FieldBoard).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*DChessdbCacheQuery) IDs

func (dcq *DChessdbCacheQuery) IDs(ctx context.Context) ([]string, error)

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

func (*DChessdbCacheQuery) IDsX

func (dcq *DChessdbCacheQuery) IDsX(ctx context.Context) []string

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

func (*DChessdbCacheQuery) Limit

func (dcq *DChessdbCacheQuery) Limit(limit int) *DChessdbCacheQuery

Limit adds a limit step to the query.

func (*DChessdbCacheQuery) Offset

func (dcq *DChessdbCacheQuery) Offset(offset int) *DChessdbCacheQuery

Offset adds an offset step to the query.

func (*DChessdbCacheQuery) Only

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

func (*DChessdbCacheQuery) OnlyID

func (dcq *DChessdbCacheQuery) OnlyID(ctx context.Context) (id string, err error)

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

func (*DChessdbCacheQuery) OnlyIDX

func (dcq *DChessdbCacheQuery) OnlyIDX(ctx context.Context) string

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

func (*DChessdbCacheQuery) OnlyX

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

func (*DChessdbCacheQuery) Order

Order adds an order step to the query.

func (*DChessdbCacheQuery) Select

func (dcq *DChessdbCacheQuery) Select(fields ...string) *DChessdbCacheSelect

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 {
	Board string `json:"board,omitempty"`
}

client.DChessdbCache.Query().
	Select(dchessdbcache.FieldBoard).
	Scan(ctx, &v)

func (*DChessdbCacheQuery) Unique

func (dcq *DChessdbCacheQuery) Unique(unique bool) *DChessdbCacheQuery

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 (*DChessdbCacheQuery) Where

Where adds a new predicate for the DChessdbCacheQuery builder.

type DChessdbCacheSelect

type DChessdbCacheSelect struct {
	*DChessdbCacheQuery
	// contains filtered or unexported fields
}

DChessdbCacheSelect is the builder for selecting fields of DChessdbCache entities.

func (*DChessdbCacheSelect) Bool

func (dcs *DChessdbCacheSelect) Bool(ctx context.Context) (_ bool, err error)

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

func (*DChessdbCacheSelect) BoolX

func (dcs *DChessdbCacheSelect) BoolX(ctx context.Context) bool

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

func (*DChessdbCacheSelect) Bools

func (dcs *DChessdbCacheSelect) Bools(ctx context.Context) ([]bool, error)

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

func (*DChessdbCacheSelect) BoolsX

func (dcs *DChessdbCacheSelect) BoolsX(ctx context.Context) []bool

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

func (*DChessdbCacheSelect) Float64

func (dcs *DChessdbCacheSelect) Float64(ctx context.Context) (_ float64, err error)

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

func (*DChessdbCacheSelect) Float64X

func (dcs *DChessdbCacheSelect) Float64X(ctx context.Context) float64

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

func (*DChessdbCacheSelect) Float64s

func (dcs *DChessdbCacheSelect) Float64s(ctx context.Context) ([]float64, error)

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

func (*DChessdbCacheSelect) Float64sX

func (dcs *DChessdbCacheSelect) Float64sX(ctx context.Context) []float64

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

func (*DChessdbCacheSelect) Int

func (dcs *DChessdbCacheSelect) Int(ctx context.Context) (_ int, err error)

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

func (*DChessdbCacheSelect) IntX

func (dcs *DChessdbCacheSelect) IntX(ctx context.Context) int

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

func (*DChessdbCacheSelect) Ints

func (dcs *DChessdbCacheSelect) Ints(ctx context.Context) ([]int, error)

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

func (*DChessdbCacheSelect) IntsX

func (dcs *DChessdbCacheSelect) IntsX(ctx context.Context) []int

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

func (*DChessdbCacheSelect) Scan

func (dcs *DChessdbCacheSelect) Scan(ctx context.Context, v interface{}) error

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

func (*DChessdbCacheSelect) ScanX

func (dcs *DChessdbCacheSelect) ScanX(ctx context.Context, v interface{})

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

func (*DChessdbCacheSelect) String

func (dcs *DChessdbCacheSelect) String(ctx context.Context) (_ string, err error)

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

func (*DChessdbCacheSelect) StringX

func (dcs *DChessdbCacheSelect) StringX(ctx context.Context) string

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

func (*DChessdbCacheSelect) Strings

func (dcs *DChessdbCacheSelect) Strings(ctx context.Context) ([]string, error)

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

func (*DChessdbCacheSelect) StringsX

func (dcs *DChessdbCacheSelect) StringsX(ctx context.Context) []string

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

type DChessdbCacheUpdate

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

DChessdbCacheUpdate is the builder for updating DChessdbCache entities.

func (*DChessdbCacheUpdate) Exec

func (dcu *DChessdbCacheUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*DChessdbCacheUpdate) ExecX

func (dcu *DChessdbCacheUpdate) ExecX(ctx context.Context)

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

func (*DChessdbCacheUpdate) Mutation

func (dcu *DChessdbCacheUpdate) Mutation() *DChessdbCacheMutation

Mutation returns the DChessdbCacheMutation object of the builder.

func (*DChessdbCacheUpdate) Save

func (dcu *DChessdbCacheUpdate) Save(ctx context.Context) (int, error)

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

func (*DChessdbCacheUpdate) SaveX

func (dcu *DChessdbCacheUpdate) SaveX(ctx context.Context) int

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

func (*DChessdbCacheUpdate) SetBoard

SetBoard sets the "board" field.

func (*DChessdbCacheUpdate) SetCreateTime

func (dcu *DChessdbCacheUpdate) SetCreateTime(t time.Time) *DChessdbCacheUpdate

SetCreateTime sets the "create_time" field.

func (*DChessdbCacheUpdate) SetResp

func (dcu *DChessdbCacheUpdate) SetResp(b []byte) *DChessdbCacheUpdate

SetResp sets the "resp" field.

func (*DChessdbCacheUpdate) Where

Where appends a list predicates to the DChessdbCacheUpdate builder.

type DChessdbCacheUpdateOne

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

DChessdbCacheUpdateOne is the builder for updating a single DChessdbCache entity.

func (*DChessdbCacheUpdateOne) Exec

func (dcuo *DChessdbCacheUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*DChessdbCacheUpdateOne) ExecX

func (dcuo *DChessdbCacheUpdateOne) ExecX(ctx context.Context)

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

func (*DChessdbCacheUpdateOne) Mutation

Mutation returns the DChessdbCacheMutation object of the builder.

func (*DChessdbCacheUpdateOne) Save

Save executes the query and returns the updated DChessdbCache entity.

func (*DChessdbCacheUpdateOne) SaveX

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

func (*DChessdbCacheUpdateOne) Select

func (dcuo *DChessdbCacheUpdateOne) Select(field string, fields ...string) *DChessdbCacheUpdateOne

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

func (*DChessdbCacheUpdateOne) SetBoard

SetBoard sets the "board" field.

func (*DChessdbCacheUpdateOne) SetCreateTime

func (dcuo *DChessdbCacheUpdateOne) SetCreateTime(t time.Time) *DChessdbCacheUpdateOne

SetCreateTime sets the "create_time" field.

func (*DChessdbCacheUpdateOne) SetResp

SetResp sets the "resp" field.

type DChessdbCaches

type DChessdbCaches []*DChessdbCache

DChessdbCaches is a parsable slice of DChessdbCache.

type DRoom

type DRoom struct {

	// ID of the ent.
	ID string `json:"id,omitempty"`
	// IsGameRunning holds the value of the "is_game_running" field.
	IsGameRunning bool `json:"is_game_running,omitempty"`
	// Panel holds the value of the "panel" field.
	Panel string `json:"panel,omitempty"`
	// WUserID holds the value of the "w_user_id" field.
	WUserID string `json:"w_user_id,omitempty"`
	// BUserID holds the value of the "b_user_id" field.
	BUserID string `json:"b_user_id,omitempty"`
	// CreateTime holds the value of the "create_time" field.
	CreateTime time.Time `json:"create_time,omitempty"`
	// contains filtered or unexported fields
}

DRoom is the model entity for the DRoom schema.

func (*DRoom) String

func (d *DRoom) String() string

String implements the fmt.Stringer.

func (*DRoom) Unwrap

func (d *DRoom) Unwrap() *DRoom

Unwrap unwraps the DRoom 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 (*DRoom) Update

func (d *DRoom) Update() *DRoomUpdateOne

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

type DRoomClient

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

DRoomClient is a client for the DRoom schema.

func NewDRoomClient

func NewDRoomClient(c config) *DRoomClient

NewDRoomClient returns a client for the DRoom from the given config.

func (*DRoomClient) Create

func (c *DRoomClient) Create() *DRoomCreate

Create returns a create builder for DRoom.

func (*DRoomClient) CreateBulk

func (c *DRoomClient) CreateBulk(builders ...*DRoomCreate) *DRoomCreateBulk

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

func (*DRoomClient) Delete

func (c *DRoomClient) Delete() *DRoomDelete

Delete returns a delete builder for DRoom.

func (*DRoomClient) DeleteOne

func (c *DRoomClient) DeleteOne(d *DRoom) *DRoomDeleteOne

DeleteOne returns a delete builder for the given entity.

func (*DRoomClient) DeleteOneID

func (c *DRoomClient) DeleteOneID(id string) *DRoomDeleteOne

DeleteOneID returns a delete builder for the given id.

func (*DRoomClient) Get

func (c *DRoomClient) Get(ctx context.Context, id string) (*DRoom, error)

Get returns a DRoom entity by its id.

func (*DRoomClient) GetX

func (c *DRoomClient) GetX(ctx context.Context, id string) *DRoom

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

func (*DRoomClient) Hooks

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

Hooks returns the client hooks.

func (*DRoomClient) Query

func (c *DRoomClient) Query() *DRoomQuery

Query returns a query builder for DRoom.

func (*DRoomClient) Update

func (c *DRoomClient) Update() *DRoomUpdate

Update returns an update builder for DRoom.

func (*DRoomClient) UpdateOne

func (c *DRoomClient) UpdateOne(d *DRoom) *DRoomUpdateOne

UpdateOne returns an update builder for the given entity.

func (*DRoomClient) UpdateOneID

func (c *DRoomClient) UpdateOneID(id string) *DRoomUpdateOne

UpdateOneID returns an update builder for the given id.

func (*DRoomClient) Use

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

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

type DRoomCreate

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

DRoomCreate is the builder for creating a DRoom entity.

func (*DRoomCreate) Exec

func (dc *DRoomCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*DRoomCreate) ExecX

func (dc *DRoomCreate) ExecX(ctx context.Context)

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

func (*DRoomCreate) Mutation

func (dc *DRoomCreate) Mutation() *DRoomMutation

Mutation returns the DRoomMutation object of the builder.

func (*DRoomCreate) Save

func (dc *DRoomCreate) Save(ctx context.Context) (*DRoom, error)

Save creates the DRoom in the database.

func (*DRoomCreate) SaveX

func (dc *DRoomCreate) SaveX(ctx context.Context) *DRoom

SaveX calls Save and panics if Save returns an error.

func (*DRoomCreate) SetBUserID

func (dc *DRoomCreate) SetBUserID(s string) *DRoomCreate

SetBUserID sets the "b_user_id" field.

func (*DRoomCreate) SetCreateTime

func (dc *DRoomCreate) SetCreateTime(t time.Time) *DRoomCreate

SetCreateTime sets the "create_time" field.

func (*DRoomCreate) SetID

func (dc *DRoomCreate) SetID(s string) *DRoomCreate

SetID sets the "id" field.

func (*DRoomCreate) SetIsGameRunning

func (dc *DRoomCreate) SetIsGameRunning(b bool) *DRoomCreate

SetIsGameRunning sets the "is_game_running" field.

func (*DRoomCreate) SetNillableBUserID

func (dc *DRoomCreate) SetNillableBUserID(s *string) *DRoomCreate

SetNillableBUserID sets the "b_user_id" field if the given value is not nil.

func (*DRoomCreate) SetNillableIsGameRunning

func (dc *DRoomCreate) SetNillableIsGameRunning(b *bool) *DRoomCreate

SetNillableIsGameRunning sets the "is_game_running" field if the given value is not nil.

func (*DRoomCreate) SetNillablePanel

func (dc *DRoomCreate) SetNillablePanel(s *string) *DRoomCreate

SetNillablePanel sets the "panel" field if the given value is not nil.

func (*DRoomCreate) SetNillableWUserID

func (dc *DRoomCreate) SetNillableWUserID(s *string) *DRoomCreate

SetNillableWUserID sets the "w_user_id" field if the given value is not nil.

func (*DRoomCreate) SetPanel

func (dc *DRoomCreate) SetPanel(s string) *DRoomCreate

SetPanel sets the "panel" field.

func (*DRoomCreate) SetWUserID

func (dc *DRoomCreate) SetWUserID(s string) *DRoomCreate

SetWUserID sets the "w_user_id" field.

type DRoomCreateBulk

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

DRoomCreateBulk is the builder for creating many DRoom entities in bulk.

func (*DRoomCreateBulk) Exec

func (dcb *DRoomCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*DRoomCreateBulk) ExecX

func (dcb *DRoomCreateBulk) ExecX(ctx context.Context)

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

func (*DRoomCreateBulk) Save

func (dcb *DRoomCreateBulk) Save(ctx context.Context) ([]*DRoom, error)

Save creates the DRoom entities in the database.

func (*DRoomCreateBulk) SaveX

func (dcb *DRoomCreateBulk) SaveX(ctx context.Context) []*DRoom

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

type DRoomDelete

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

DRoomDelete is the builder for deleting a DRoom entity.

func (*DRoomDelete) Exec

func (dd *DRoomDelete) Exec(ctx context.Context) (int, error)

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

func (*DRoomDelete) ExecX

func (dd *DRoomDelete) ExecX(ctx context.Context) int

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

func (*DRoomDelete) Where

func (dd *DRoomDelete) Where(ps ...predicate.DRoom) *DRoomDelete

Where appends a list predicates to the DRoomDelete builder.

type DRoomDeleteOne

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

DRoomDeleteOne is the builder for deleting a single DRoom entity.

func (*DRoomDeleteOne) Exec

func (ddo *DRoomDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*DRoomDeleteOne) ExecX

func (ddo *DRoomDeleteOne) ExecX(ctx context.Context)

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

type DRoomGroupBy

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

DRoomGroupBy is the group-by builder for DRoom entities.

func (*DRoomGroupBy) Aggregate

func (dgb *DRoomGroupBy) Aggregate(fns ...AggregateFunc) *DRoomGroupBy

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

func (*DRoomGroupBy) Bool

func (dgb *DRoomGroupBy) 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 (*DRoomGroupBy) BoolX

func (dgb *DRoomGroupBy) BoolX(ctx context.Context) bool

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

func (*DRoomGroupBy) Bools

func (dgb *DRoomGroupBy) 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 (*DRoomGroupBy) BoolsX

func (dgb *DRoomGroupBy) BoolsX(ctx context.Context) []bool

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

func (*DRoomGroupBy) Float64

func (dgb *DRoomGroupBy) 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 (*DRoomGroupBy) Float64X

func (dgb *DRoomGroupBy) Float64X(ctx context.Context) float64

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

func (*DRoomGroupBy) Float64s

func (dgb *DRoomGroupBy) 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 (*DRoomGroupBy) Float64sX

func (dgb *DRoomGroupBy) Float64sX(ctx context.Context) []float64

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

func (*DRoomGroupBy) Int

func (dgb *DRoomGroupBy) 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 (*DRoomGroupBy) IntX

func (dgb *DRoomGroupBy) IntX(ctx context.Context) int

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

func (*DRoomGroupBy) Ints

func (dgb *DRoomGroupBy) 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 (*DRoomGroupBy) IntsX

func (dgb *DRoomGroupBy) IntsX(ctx context.Context) []int

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

func (*DRoomGroupBy) Scan

func (dgb *DRoomGroupBy) Scan(ctx context.Context, v interface{}) error

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

func (*DRoomGroupBy) ScanX

func (dgb *DRoomGroupBy) ScanX(ctx context.Context, v interface{})

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

func (*DRoomGroupBy) String

func (dgb *DRoomGroupBy) 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 (*DRoomGroupBy) StringX

func (dgb *DRoomGroupBy) StringX(ctx context.Context) string

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

func (*DRoomGroupBy) Strings

func (dgb *DRoomGroupBy) 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 (*DRoomGroupBy) StringsX

func (dgb *DRoomGroupBy) StringsX(ctx context.Context) []string

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

type DRoomMutation

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

DRoomMutation represents an operation that mutates the DRoom nodes in the graph.

func (*DRoomMutation) AddField

func (m *DRoomMutation) 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 (*DRoomMutation) AddedEdges

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

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

func (*DRoomMutation) AddedField

func (m *DRoomMutation) 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 (*DRoomMutation) AddedFields

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

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

func (*DRoomMutation) AddedIDs

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

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

func (*DRoomMutation) BUserID

func (m *DRoomMutation) BUserID() (r string, exists bool)

BUserID returns the value of the "b_user_id" field in the mutation.

func (*DRoomMutation) BUserIDCleared

func (m *DRoomMutation) BUserIDCleared() bool

BUserIDCleared returns if the "b_user_id" field was cleared in this mutation.

func (*DRoomMutation) ClearBUserID

func (m *DRoomMutation) ClearBUserID()

ClearBUserID clears the value of the "b_user_id" field.

func (*DRoomMutation) ClearEdge

func (m *DRoomMutation) 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 (*DRoomMutation) ClearField

func (m *DRoomMutation) 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 (*DRoomMutation) ClearIsGameRunning

func (m *DRoomMutation) ClearIsGameRunning()

ClearIsGameRunning clears the value of the "is_game_running" field.

func (*DRoomMutation) ClearPanel

func (m *DRoomMutation) ClearPanel()

ClearPanel clears the value of the "panel" field.

func (*DRoomMutation) ClearWUserID

func (m *DRoomMutation) ClearWUserID()

ClearWUserID clears the value of the "w_user_id" field.

func (*DRoomMutation) ClearedEdges

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

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

func (*DRoomMutation) ClearedFields

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

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

func (DRoomMutation) Client

func (m DRoomMutation) 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 (*DRoomMutation) CreateTime

func (m *DRoomMutation) CreateTime() (r time.Time, exists bool)

CreateTime returns the value of the "create_time" field in the mutation.

func (*DRoomMutation) EdgeCleared

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

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

func (*DRoomMutation) Field

func (m *DRoomMutation) 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 (*DRoomMutation) FieldCleared

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

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

func (*DRoomMutation) Fields

func (m *DRoomMutation) 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 (*DRoomMutation) ID

func (m *DRoomMutation) ID() (id string, 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 (*DRoomMutation) IsGameRunning

func (m *DRoomMutation) IsGameRunning() (r bool, exists bool)

IsGameRunning returns the value of the "is_game_running" field in the mutation.

func (*DRoomMutation) IsGameRunningCleared

func (m *DRoomMutation) IsGameRunningCleared() bool

IsGameRunningCleared returns if the "is_game_running" field was cleared in this mutation.

func (*DRoomMutation) OldBUserID

func (m *DRoomMutation) OldBUserID(ctx context.Context) (v string, err error)

OldBUserID returns the old "b_user_id" field's value of the DRoom entity. If the DRoom 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 (*DRoomMutation) OldCreateTime

func (m *DRoomMutation) OldCreateTime(ctx context.Context) (v time.Time, err error)

OldCreateTime returns the old "create_time" field's value of the DRoom entity. If the DRoom 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 (*DRoomMutation) OldField

func (m *DRoomMutation) 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 (*DRoomMutation) OldIsGameRunning

func (m *DRoomMutation) OldIsGameRunning(ctx context.Context) (v bool, err error)

OldIsGameRunning returns the old "is_game_running" field's value of the DRoom entity. If the DRoom 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 (*DRoomMutation) OldPanel

func (m *DRoomMutation) OldPanel(ctx context.Context) (v string, err error)

OldPanel returns the old "panel" field's value of the DRoom entity. If the DRoom 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 (*DRoomMutation) OldWUserID

func (m *DRoomMutation) OldWUserID(ctx context.Context) (v string, err error)

OldWUserID returns the old "w_user_id" field's value of the DRoom entity. If the DRoom 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 (*DRoomMutation) Op

func (m *DRoomMutation) Op() Op

Op returns the operation name.

func (*DRoomMutation) Panel

func (m *DRoomMutation) Panel() (r string, exists bool)

Panel returns the value of the "panel" field in the mutation.

func (*DRoomMutation) PanelCleared

func (m *DRoomMutation) PanelCleared() bool

PanelCleared returns if the "panel" field was cleared in this mutation.

func (*DRoomMutation) RemovedEdges

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

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

func (*DRoomMutation) RemovedIDs

func (m *DRoomMutation) 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 (*DRoomMutation) ResetBUserID

func (m *DRoomMutation) ResetBUserID()

ResetBUserID resets all changes to the "b_user_id" field.

func (*DRoomMutation) ResetCreateTime

func (m *DRoomMutation) ResetCreateTime()

ResetCreateTime resets all changes to the "create_time" field.

func (*DRoomMutation) ResetEdge

func (m *DRoomMutation) 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 (*DRoomMutation) ResetField

func (m *DRoomMutation) 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 (*DRoomMutation) ResetIsGameRunning

func (m *DRoomMutation) ResetIsGameRunning()

ResetIsGameRunning resets all changes to the "is_game_running" field.

func (*DRoomMutation) ResetPanel

func (m *DRoomMutation) ResetPanel()

ResetPanel resets all changes to the "panel" field.

func (*DRoomMutation) ResetWUserID

func (m *DRoomMutation) ResetWUserID()

ResetWUserID resets all changes to the "w_user_id" field.

func (*DRoomMutation) SetBUserID

func (m *DRoomMutation) SetBUserID(s string)

SetBUserID sets the "b_user_id" field.

func (*DRoomMutation) SetCreateTime

func (m *DRoomMutation) SetCreateTime(t time.Time)

SetCreateTime sets the "create_time" field.

func (*DRoomMutation) SetField

func (m *DRoomMutation) 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 (*DRoomMutation) SetID

func (m *DRoomMutation) SetID(id string)

SetID sets the value of the id field. Note that this operation is only accepted on creation of DRoom entities.

func (*DRoomMutation) SetIsGameRunning

func (m *DRoomMutation) SetIsGameRunning(b bool)

SetIsGameRunning sets the "is_game_running" field.

func (*DRoomMutation) SetPanel

func (m *DRoomMutation) SetPanel(s string)

SetPanel sets the "panel" field.

func (*DRoomMutation) SetWUserID

func (m *DRoomMutation) SetWUserID(s string)

SetWUserID sets the "w_user_id" field.

func (DRoomMutation) Tx

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

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

func (*DRoomMutation) Type

func (m *DRoomMutation) Type() string

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

func (*DRoomMutation) WUserID

func (m *DRoomMutation) WUserID() (r string, exists bool)

WUserID returns the value of the "w_user_id" field in the mutation.

func (*DRoomMutation) WUserIDCleared

func (m *DRoomMutation) WUserIDCleared() bool

WUserIDCleared returns if the "w_user_id" field was cleared in this mutation.

func (*DRoomMutation) Where

func (m *DRoomMutation) Where(ps ...predicate.DRoom)

Where appends a list predicates to the DRoomMutation builder.

type DRoomQuery

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

DRoomQuery is the builder for querying DRoom entities.

func (*DRoomQuery) All

func (dq *DRoomQuery) All(ctx context.Context) ([]*DRoom, error)

All executes the query and returns a list of DRooms.

func (*DRoomQuery) AllX

func (dq *DRoomQuery) AllX(ctx context.Context) []*DRoom

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

func (*DRoomQuery) Clone

func (dq *DRoomQuery) Clone() *DRoomQuery

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

func (*DRoomQuery) Count

func (dq *DRoomQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*DRoomQuery) CountX

func (dq *DRoomQuery) CountX(ctx context.Context) int

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

func (*DRoomQuery) Exist

func (dq *DRoomQuery) Exist(ctx context.Context) (bool, error)

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

func (*DRoomQuery) ExistX

func (dq *DRoomQuery) ExistX(ctx context.Context) bool

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

func (*DRoomQuery) First

func (dq *DRoomQuery) First(ctx context.Context) (*DRoom, error)

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

func (*DRoomQuery) FirstID

func (dq *DRoomQuery) FirstID(ctx context.Context) (id string, err error)

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

func (*DRoomQuery) FirstIDX

func (dq *DRoomQuery) FirstIDX(ctx context.Context) string

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

func (*DRoomQuery) FirstX

func (dq *DRoomQuery) FirstX(ctx context.Context) *DRoom

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

func (*DRoomQuery) GroupBy

func (dq *DRoomQuery) GroupBy(field string, fields ...string) *DRoomGroupBy

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 {
	IsGameRunning bool `json:"is_game_running,omitempty"`
	Count int `json:"count,omitempty"`
}

client.DRoom.Query().
	GroupBy(droom.FieldIsGameRunning).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*DRoomQuery) IDs

func (dq *DRoomQuery) IDs(ctx context.Context) ([]string, error)

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

func (*DRoomQuery) IDsX

func (dq *DRoomQuery) IDsX(ctx context.Context) []string

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

func (*DRoomQuery) Limit

func (dq *DRoomQuery) Limit(limit int) *DRoomQuery

Limit adds a limit step to the query.

func (*DRoomQuery) Offset

func (dq *DRoomQuery) Offset(offset int) *DRoomQuery

Offset adds an offset step to the query.

func (*DRoomQuery) Only

func (dq *DRoomQuery) Only(ctx context.Context) (*DRoom, error)

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

func (*DRoomQuery) OnlyID

func (dq *DRoomQuery) OnlyID(ctx context.Context) (id string, err error)

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

func (*DRoomQuery) OnlyIDX

func (dq *DRoomQuery) OnlyIDX(ctx context.Context) string

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

func (*DRoomQuery) OnlyX

func (dq *DRoomQuery) OnlyX(ctx context.Context) *DRoom

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

func (*DRoomQuery) Order

func (dq *DRoomQuery) Order(o ...OrderFunc) *DRoomQuery

Order adds an order step to the query.

func (*DRoomQuery) Select

func (dq *DRoomQuery) Select(fields ...string) *DRoomSelect

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 {
	IsGameRunning bool `json:"is_game_running,omitempty"`
}

client.DRoom.Query().
	Select(droom.FieldIsGameRunning).
	Scan(ctx, &v)

func (*DRoomQuery) Unique

func (dq *DRoomQuery) Unique(unique bool) *DRoomQuery

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 (*DRoomQuery) Where

func (dq *DRoomQuery) Where(ps ...predicate.DRoom) *DRoomQuery

Where adds a new predicate for the DRoomQuery builder.

type DRoomSelect

type DRoomSelect struct {
	*DRoomQuery
	// contains filtered or unexported fields
}

DRoomSelect is the builder for selecting fields of DRoom entities.

func (*DRoomSelect) Bool

func (ds *DRoomSelect) Bool(ctx context.Context) (_ bool, err error)

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

func (*DRoomSelect) BoolX

func (ds *DRoomSelect) BoolX(ctx context.Context) bool

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

func (*DRoomSelect) Bools

func (ds *DRoomSelect) Bools(ctx context.Context) ([]bool, error)

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

func (*DRoomSelect) BoolsX

func (ds *DRoomSelect) BoolsX(ctx context.Context) []bool

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

func (*DRoomSelect) Float64

func (ds *DRoomSelect) Float64(ctx context.Context) (_ float64, err error)

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

func (*DRoomSelect) Float64X

func (ds *DRoomSelect) Float64X(ctx context.Context) float64

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

func (*DRoomSelect) Float64s

func (ds *DRoomSelect) Float64s(ctx context.Context) ([]float64, error)

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

func (*DRoomSelect) Float64sX

func (ds *DRoomSelect) Float64sX(ctx context.Context) []float64

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

func (*DRoomSelect) Int

func (ds *DRoomSelect) Int(ctx context.Context) (_ int, err error)

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

func (*DRoomSelect) IntX

func (ds *DRoomSelect) IntX(ctx context.Context) int

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

func (*DRoomSelect) Ints

func (ds *DRoomSelect) Ints(ctx context.Context) ([]int, error)

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

func (*DRoomSelect) IntsX

func (ds *DRoomSelect) IntsX(ctx context.Context) []int

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

func (*DRoomSelect) Scan

func (ds *DRoomSelect) Scan(ctx context.Context, v interface{}) error

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

func (*DRoomSelect) ScanX

func (ds *DRoomSelect) ScanX(ctx context.Context, v interface{})

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

func (*DRoomSelect) String

func (ds *DRoomSelect) String(ctx context.Context) (_ string, err error)

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

func (*DRoomSelect) StringX

func (ds *DRoomSelect) StringX(ctx context.Context) string

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

func (*DRoomSelect) Strings

func (ds *DRoomSelect) Strings(ctx context.Context) ([]string, error)

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

func (*DRoomSelect) StringsX

func (ds *DRoomSelect) StringsX(ctx context.Context) []string

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

type DRoomUpdate

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

DRoomUpdate is the builder for updating DRoom entities.

func (*DRoomUpdate) ClearBUserID

func (du *DRoomUpdate) ClearBUserID() *DRoomUpdate

ClearBUserID clears the value of the "b_user_id" field.

func (*DRoomUpdate) ClearIsGameRunning

func (du *DRoomUpdate) ClearIsGameRunning() *DRoomUpdate

ClearIsGameRunning clears the value of the "is_game_running" field.

func (*DRoomUpdate) ClearPanel

func (du *DRoomUpdate) ClearPanel() *DRoomUpdate

ClearPanel clears the value of the "panel" field.

func (*DRoomUpdate) ClearWUserID

func (du *DRoomUpdate) ClearWUserID() *DRoomUpdate

ClearWUserID clears the value of the "w_user_id" field.

func (*DRoomUpdate) Exec

func (du *DRoomUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*DRoomUpdate) ExecX

func (du *DRoomUpdate) ExecX(ctx context.Context)

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

func (*DRoomUpdate) Mutation

func (du *DRoomUpdate) Mutation() *DRoomMutation

Mutation returns the DRoomMutation object of the builder.

func (*DRoomUpdate) Save

func (du *DRoomUpdate) Save(ctx context.Context) (int, error)

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

func (*DRoomUpdate) SaveX

func (du *DRoomUpdate) SaveX(ctx context.Context) int

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

func (*DRoomUpdate) SetBUserID

func (du *DRoomUpdate) SetBUserID(s string) *DRoomUpdate

SetBUserID sets the "b_user_id" field.

func (*DRoomUpdate) SetCreateTime

func (du *DRoomUpdate) SetCreateTime(t time.Time) *DRoomUpdate

SetCreateTime sets the "create_time" field.

func (*DRoomUpdate) SetIsGameRunning

func (du *DRoomUpdate) SetIsGameRunning(b bool) *DRoomUpdate

SetIsGameRunning sets the "is_game_running" field.

func (*DRoomUpdate) SetNillableBUserID

func (du *DRoomUpdate) SetNillableBUserID(s *string) *DRoomUpdate

SetNillableBUserID sets the "b_user_id" field if the given value is not nil.

func (*DRoomUpdate) SetNillableIsGameRunning

func (du *DRoomUpdate) SetNillableIsGameRunning(b *bool) *DRoomUpdate

SetNillableIsGameRunning sets the "is_game_running" field if the given value is not nil.

func (*DRoomUpdate) SetNillablePanel

func (du *DRoomUpdate) SetNillablePanel(s *string) *DRoomUpdate

SetNillablePanel sets the "panel" field if the given value is not nil.

func (*DRoomUpdate) SetNillableWUserID

func (du *DRoomUpdate) SetNillableWUserID(s *string) *DRoomUpdate

SetNillableWUserID sets the "w_user_id" field if the given value is not nil.

func (*DRoomUpdate) SetPanel

func (du *DRoomUpdate) SetPanel(s string) *DRoomUpdate

SetPanel sets the "panel" field.

func (*DRoomUpdate) SetWUserID

func (du *DRoomUpdate) SetWUserID(s string) *DRoomUpdate

SetWUserID sets the "w_user_id" field.

func (*DRoomUpdate) Where

func (du *DRoomUpdate) Where(ps ...predicate.DRoom) *DRoomUpdate

Where appends a list predicates to the DRoomUpdate builder.

type DRoomUpdateOne

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

DRoomUpdateOne is the builder for updating a single DRoom entity.

func (*DRoomUpdateOne) ClearBUserID

func (duo *DRoomUpdateOne) ClearBUserID() *DRoomUpdateOne

ClearBUserID clears the value of the "b_user_id" field.

func (*DRoomUpdateOne) ClearIsGameRunning

func (duo *DRoomUpdateOne) ClearIsGameRunning() *DRoomUpdateOne

ClearIsGameRunning clears the value of the "is_game_running" field.

func (*DRoomUpdateOne) ClearPanel

func (duo *DRoomUpdateOne) ClearPanel() *DRoomUpdateOne

ClearPanel clears the value of the "panel" field.

func (*DRoomUpdateOne) ClearWUserID

func (duo *DRoomUpdateOne) ClearWUserID() *DRoomUpdateOne

ClearWUserID clears the value of the "w_user_id" field.

func (*DRoomUpdateOne) Exec

func (duo *DRoomUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*DRoomUpdateOne) ExecX

func (duo *DRoomUpdateOne) ExecX(ctx context.Context)

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

func (*DRoomUpdateOne) Mutation

func (duo *DRoomUpdateOne) Mutation() *DRoomMutation

Mutation returns the DRoomMutation object of the builder.

func (*DRoomUpdateOne) Save

func (duo *DRoomUpdateOne) Save(ctx context.Context) (*DRoom, error)

Save executes the query and returns the updated DRoom entity.

func (*DRoomUpdateOne) SaveX

func (duo *DRoomUpdateOne) SaveX(ctx context.Context) *DRoom

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

func (*DRoomUpdateOne) Select

func (duo *DRoomUpdateOne) Select(field string, fields ...string) *DRoomUpdateOne

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

func (*DRoomUpdateOne) SetBUserID

func (duo *DRoomUpdateOne) SetBUserID(s string) *DRoomUpdateOne

SetBUserID sets the "b_user_id" field.

func (*DRoomUpdateOne) SetCreateTime

func (duo *DRoomUpdateOne) SetCreateTime(t time.Time) *DRoomUpdateOne

SetCreateTime sets the "create_time" field.

func (*DRoomUpdateOne) SetIsGameRunning

func (duo *DRoomUpdateOne) SetIsGameRunning(b bool) *DRoomUpdateOne

SetIsGameRunning sets the "is_game_running" field.

func (*DRoomUpdateOne) SetNillableBUserID

func (duo *DRoomUpdateOne) SetNillableBUserID(s *string) *DRoomUpdateOne

SetNillableBUserID sets the "b_user_id" field if the given value is not nil.

func (*DRoomUpdateOne) SetNillableIsGameRunning

func (duo *DRoomUpdateOne) SetNillableIsGameRunning(b *bool) *DRoomUpdateOne

SetNillableIsGameRunning sets the "is_game_running" field if the given value is not nil.

func (*DRoomUpdateOne) SetNillablePanel

func (duo *DRoomUpdateOne) SetNillablePanel(s *string) *DRoomUpdateOne

SetNillablePanel sets the "panel" field if the given value is not nil.

func (*DRoomUpdateOne) SetNillableWUserID

func (duo *DRoomUpdateOne) SetNillableWUserID(s *string) *DRoomUpdateOne

SetNillableWUserID sets the "w_user_id" field if the given value is not nil.

func (*DRoomUpdateOne) SetPanel

func (duo *DRoomUpdateOne) SetPanel(s string) *DRoomUpdateOne

SetPanel sets the "panel" field.

func (*DRoomUpdateOne) SetWUserID

func (duo *DRoomUpdateOne) SetWUserID(s string) *DRoomUpdateOne

SetWUserID sets the "w_user_id" field.

type DRooms

type DRooms []*DRoom

DRooms is a parsable slice of DRoom.

type DSession

type DSession struct {

	// ID of the ent.
	ID string `json:"id,omitempty"`
	// UserID holds the value of the "user_id" field.
	UserID string `json:"user_id,omitempty"`
	// RoomID holds the value of the "room_id" field.
	RoomID string `json:"room_id,omitempty"`
	// CreateTime holds the value of the "create_time" field.
	CreateTime time.Time `json:"create_time,omitempty"`
	// contains filtered or unexported fields
}

DSession is the model entity for the DSession schema.

func (*DSession) String

func (d *DSession) String() string

String implements the fmt.Stringer.

func (*DSession) Unwrap

func (d *DSession) Unwrap() *DSession

Unwrap unwraps the DSession 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 (*DSession) Update

func (d *DSession) Update() *DSessionUpdateOne

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

type DSessionClient

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

DSessionClient is a client for the DSession schema.

func NewDSessionClient

func NewDSessionClient(c config) *DSessionClient

NewDSessionClient returns a client for the DSession from the given config.

func (*DSessionClient) Create

func (c *DSessionClient) Create() *DSessionCreate

Create returns a create builder for DSession.

func (*DSessionClient) CreateBulk

func (c *DSessionClient) CreateBulk(builders ...*DSessionCreate) *DSessionCreateBulk

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

func (*DSessionClient) Delete

func (c *DSessionClient) Delete() *DSessionDelete

Delete returns a delete builder for DSession.

func (*DSessionClient) DeleteOne

func (c *DSessionClient) DeleteOne(d *DSession) *DSessionDeleteOne

DeleteOne returns a delete builder for the given entity.

func (*DSessionClient) DeleteOneID

func (c *DSessionClient) DeleteOneID(id string) *DSessionDeleteOne

DeleteOneID returns a delete builder for the given id.

func (*DSessionClient) Get

func (c *DSessionClient) Get(ctx context.Context, id string) (*DSession, error)

Get returns a DSession entity by its id.

func (*DSessionClient) GetX

func (c *DSessionClient) GetX(ctx context.Context, id string) *DSession

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

func (*DSessionClient) Hooks

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

Hooks returns the client hooks.

func (*DSessionClient) Query

func (c *DSessionClient) Query() *DSessionQuery

Query returns a query builder for DSession.

func (*DSessionClient) Update

func (c *DSessionClient) Update() *DSessionUpdate

Update returns an update builder for DSession.

func (*DSessionClient) UpdateOne

func (c *DSessionClient) UpdateOne(d *DSession) *DSessionUpdateOne

UpdateOne returns an update builder for the given entity.

func (*DSessionClient) UpdateOneID

func (c *DSessionClient) UpdateOneID(id string) *DSessionUpdateOne

UpdateOneID returns an update builder for the given id.

func (*DSessionClient) Use

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

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

type DSessionCreate

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

DSessionCreate is the builder for creating a DSession entity.

func (*DSessionCreate) Exec

func (dc *DSessionCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*DSessionCreate) ExecX

func (dc *DSessionCreate) ExecX(ctx context.Context)

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

func (*DSessionCreate) Mutation

func (dc *DSessionCreate) Mutation() *DSessionMutation

Mutation returns the DSessionMutation object of the builder.

func (*DSessionCreate) Save

func (dc *DSessionCreate) Save(ctx context.Context) (*DSession, error)

Save creates the DSession in the database.

func (*DSessionCreate) SaveX

func (dc *DSessionCreate) SaveX(ctx context.Context) *DSession

SaveX calls Save and panics if Save returns an error.

func (*DSessionCreate) SetCreateTime

func (dc *DSessionCreate) SetCreateTime(t time.Time) *DSessionCreate

SetCreateTime sets the "create_time" field.

func (*DSessionCreate) SetID

func (dc *DSessionCreate) SetID(s string) *DSessionCreate

SetID sets the "id" field.

func (*DSessionCreate) SetNillableRoomID

func (dc *DSessionCreate) SetNillableRoomID(s *string) *DSessionCreate

SetNillableRoomID sets the "room_id" field if the given value is not nil.

func (*DSessionCreate) SetNillableUserID

func (dc *DSessionCreate) SetNillableUserID(s *string) *DSessionCreate

SetNillableUserID sets the "user_id" field if the given value is not nil.

func (*DSessionCreate) SetRoomID

func (dc *DSessionCreate) SetRoomID(s string) *DSessionCreate

SetRoomID sets the "room_id" field.

func (*DSessionCreate) SetUserID

func (dc *DSessionCreate) SetUserID(s string) *DSessionCreate

SetUserID sets the "user_id" field.

type DSessionCreateBulk

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

DSessionCreateBulk is the builder for creating many DSession entities in bulk.

func (*DSessionCreateBulk) Exec

func (dcb *DSessionCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*DSessionCreateBulk) ExecX

func (dcb *DSessionCreateBulk) ExecX(ctx context.Context)

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

func (*DSessionCreateBulk) Save

func (dcb *DSessionCreateBulk) Save(ctx context.Context) ([]*DSession, error)

Save creates the DSession entities in the database.

func (*DSessionCreateBulk) SaveX

func (dcb *DSessionCreateBulk) SaveX(ctx context.Context) []*DSession

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

type DSessionDelete

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

DSessionDelete is the builder for deleting a DSession entity.

func (*DSessionDelete) Exec

func (dd *DSessionDelete) Exec(ctx context.Context) (int, error)

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

func (*DSessionDelete) ExecX

func (dd *DSessionDelete) ExecX(ctx context.Context) int

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

func (*DSessionDelete) Where

func (dd *DSessionDelete) Where(ps ...predicate.DSession) *DSessionDelete

Where appends a list predicates to the DSessionDelete builder.

type DSessionDeleteOne

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

DSessionDeleteOne is the builder for deleting a single DSession entity.

func (*DSessionDeleteOne) Exec

func (ddo *DSessionDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*DSessionDeleteOne) ExecX

func (ddo *DSessionDeleteOne) ExecX(ctx context.Context)

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

type DSessionGroupBy

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

DSessionGroupBy is the group-by builder for DSession entities.

func (*DSessionGroupBy) Aggregate

func (dgb *DSessionGroupBy) Aggregate(fns ...AggregateFunc) *DSessionGroupBy

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

func (*DSessionGroupBy) Bool

func (dgb *DSessionGroupBy) 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 (*DSessionGroupBy) BoolX

func (dgb *DSessionGroupBy) BoolX(ctx context.Context) bool

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

func (*DSessionGroupBy) Bools

func (dgb *DSessionGroupBy) 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 (*DSessionGroupBy) BoolsX

func (dgb *DSessionGroupBy) BoolsX(ctx context.Context) []bool

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

func (*DSessionGroupBy) Float64

func (dgb *DSessionGroupBy) 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 (*DSessionGroupBy) Float64X

func (dgb *DSessionGroupBy) Float64X(ctx context.Context) float64

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

func (*DSessionGroupBy) Float64s

func (dgb *DSessionGroupBy) 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 (*DSessionGroupBy) Float64sX

func (dgb *DSessionGroupBy) Float64sX(ctx context.Context) []float64

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

func (*DSessionGroupBy) Int

func (dgb *DSessionGroupBy) 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 (*DSessionGroupBy) IntX

func (dgb *DSessionGroupBy) IntX(ctx context.Context) int

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

func (*DSessionGroupBy) Ints

func (dgb *DSessionGroupBy) 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 (*DSessionGroupBy) IntsX

func (dgb *DSessionGroupBy) IntsX(ctx context.Context) []int

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

func (*DSessionGroupBy) Scan

func (dgb *DSessionGroupBy) Scan(ctx context.Context, v interface{}) error

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

func (*DSessionGroupBy) ScanX

func (dgb *DSessionGroupBy) ScanX(ctx context.Context, v interface{})

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

func (*DSessionGroupBy) String

func (dgb *DSessionGroupBy) 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 (*DSessionGroupBy) StringX

func (dgb *DSessionGroupBy) StringX(ctx context.Context) string

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

func (*DSessionGroupBy) Strings

func (dgb *DSessionGroupBy) 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 (*DSessionGroupBy) StringsX

func (dgb *DSessionGroupBy) StringsX(ctx context.Context) []string

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

type DSessionMutation

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

DSessionMutation represents an operation that mutates the DSession nodes in the graph.

func (*DSessionMutation) AddField

func (m *DSessionMutation) 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 (*DSessionMutation) AddedEdges

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

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

func (*DSessionMutation) AddedField

func (m *DSessionMutation) 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 (*DSessionMutation) AddedFields

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

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

func (*DSessionMutation) AddedIDs

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

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

func (*DSessionMutation) ClearEdge

func (m *DSessionMutation) 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 (*DSessionMutation) ClearField

func (m *DSessionMutation) 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 (*DSessionMutation) ClearedEdges

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

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

func (*DSessionMutation) ClearedFields

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

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

func (DSessionMutation) Client

func (m DSessionMutation) 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 (*DSessionMutation) CreateTime

func (m *DSessionMutation) CreateTime() (r time.Time, exists bool)

CreateTime returns the value of the "create_time" field in the mutation.

func (*DSessionMutation) EdgeCleared

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

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

func (*DSessionMutation) Field

func (m *DSessionMutation) 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 (*DSessionMutation) FieldCleared

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

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

func (*DSessionMutation) Fields

func (m *DSessionMutation) 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 (*DSessionMutation) ID

func (m *DSessionMutation) ID() (id string, 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 (*DSessionMutation) OldCreateTime

func (m *DSessionMutation) OldCreateTime(ctx context.Context) (v time.Time, err error)

OldCreateTime returns the old "create_time" field's value of the DSession entity. If the DSession 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 (*DSessionMutation) OldField

func (m *DSessionMutation) 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 (*DSessionMutation) OldRoomID

func (m *DSessionMutation) OldRoomID(ctx context.Context) (v string, err error)

OldRoomID returns the old "room_id" field's value of the DSession entity. If the DSession 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 (*DSessionMutation) OldUserID

func (m *DSessionMutation) OldUserID(ctx context.Context) (v string, err error)

OldUserID returns the old "user_id" field's value of the DSession entity. If the DSession 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 (*DSessionMutation) Op

func (m *DSessionMutation) Op() Op

Op returns the operation name.

func (*DSessionMutation) RemovedEdges

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

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

func (*DSessionMutation) RemovedIDs

func (m *DSessionMutation) 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 (*DSessionMutation) ResetCreateTime

func (m *DSessionMutation) ResetCreateTime()

ResetCreateTime resets all changes to the "create_time" field.

func (*DSessionMutation) ResetEdge

func (m *DSessionMutation) 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 (*DSessionMutation) ResetField

func (m *DSessionMutation) 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 (*DSessionMutation) ResetRoomID

func (m *DSessionMutation) ResetRoomID()

ResetRoomID resets all changes to the "room_id" field.

func (*DSessionMutation) ResetUserID

func (m *DSessionMutation) ResetUserID()

ResetUserID resets all changes to the "user_id" field.

func (*DSessionMutation) RoomID

func (m *DSessionMutation) RoomID() (r string, exists bool)

RoomID returns the value of the "room_id" field in the mutation.

func (*DSessionMutation) SetCreateTime

func (m *DSessionMutation) SetCreateTime(t time.Time)

SetCreateTime sets the "create_time" field.

func (*DSessionMutation) SetField

func (m *DSessionMutation) 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 (*DSessionMutation) SetID

func (m *DSessionMutation) SetID(id string)

SetID sets the value of the id field. Note that this operation is only accepted on creation of DSession entities.

func (*DSessionMutation) SetRoomID

func (m *DSessionMutation) SetRoomID(s string)

SetRoomID sets the "room_id" field.

func (*DSessionMutation) SetUserID

func (m *DSessionMutation) SetUserID(s string)

SetUserID sets the "user_id" field.

func (DSessionMutation) Tx

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

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

func (*DSessionMutation) Type

func (m *DSessionMutation) Type() string

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

func (*DSessionMutation) UserID

func (m *DSessionMutation) UserID() (r string, exists bool)

UserID returns the value of the "user_id" field in the mutation.

func (*DSessionMutation) Where

func (m *DSessionMutation) Where(ps ...predicate.DSession)

Where appends a list predicates to the DSessionMutation builder.

type DSessionQuery

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

DSessionQuery is the builder for querying DSession entities.

func (*DSessionQuery) All

func (dq *DSessionQuery) All(ctx context.Context) ([]*DSession, error)

All executes the query and returns a list of DSessions.

func (*DSessionQuery) AllX

func (dq *DSessionQuery) AllX(ctx context.Context) []*DSession

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

func (*DSessionQuery) Clone

func (dq *DSessionQuery) Clone() *DSessionQuery

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

func (*DSessionQuery) Count

func (dq *DSessionQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*DSessionQuery) CountX

func (dq *DSessionQuery) CountX(ctx context.Context) int

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

func (*DSessionQuery) Exist

func (dq *DSessionQuery) Exist(ctx context.Context) (bool, error)

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

func (*DSessionQuery) ExistX

func (dq *DSessionQuery) ExistX(ctx context.Context) bool

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

func (*DSessionQuery) First

func (dq *DSessionQuery) First(ctx context.Context) (*DSession, error)

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

func (*DSessionQuery) FirstID

func (dq *DSessionQuery) FirstID(ctx context.Context) (id string, err error)

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

func (*DSessionQuery) FirstIDX

func (dq *DSessionQuery) FirstIDX(ctx context.Context) string

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

func (*DSessionQuery) FirstX

func (dq *DSessionQuery) FirstX(ctx context.Context) *DSession

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

func (*DSessionQuery) GroupBy

func (dq *DSessionQuery) GroupBy(field string, fields ...string) *DSessionGroupBy

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 {
	UserID string `json:"user_id,omitempty"`
	Count int `json:"count,omitempty"`
}

client.DSession.Query().
	GroupBy(dsession.FieldUserID).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*DSessionQuery) IDs

func (dq *DSessionQuery) IDs(ctx context.Context) ([]string, error)

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

func (*DSessionQuery) IDsX

func (dq *DSessionQuery) IDsX(ctx context.Context) []string

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

func (*DSessionQuery) Limit

func (dq *DSessionQuery) Limit(limit int) *DSessionQuery

Limit adds a limit step to the query.

func (*DSessionQuery) Offset

func (dq *DSessionQuery) Offset(offset int) *DSessionQuery

Offset adds an offset step to the query.

func (*DSessionQuery) Only

func (dq *DSessionQuery) Only(ctx context.Context) (*DSession, error)

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

func (*DSessionQuery) OnlyID

func (dq *DSessionQuery) OnlyID(ctx context.Context) (id string, err error)

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

func (*DSessionQuery) OnlyIDX

func (dq *DSessionQuery) OnlyIDX(ctx context.Context) string

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

func (*DSessionQuery) OnlyX

func (dq *DSessionQuery) OnlyX(ctx context.Context) *DSession

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

func (*DSessionQuery) Order

func (dq *DSessionQuery) Order(o ...OrderFunc) *DSessionQuery

Order adds an order step to the query.

func (*DSessionQuery) Select

func (dq *DSessionQuery) Select(fields ...string) *DSessionSelect

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 {
	UserID string `json:"user_id,omitempty"`
}

client.DSession.Query().
	Select(dsession.FieldUserID).
	Scan(ctx, &v)

func (*DSessionQuery) Unique

func (dq *DSessionQuery) Unique(unique bool) *DSessionQuery

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 (*DSessionQuery) Where

func (dq *DSessionQuery) Where(ps ...predicate.DSession) *DSessionQuery

Where adds a new predicate for the DSessionQuery builder.

type DSessionSelect

type DSessionSelect struct {
	*DSessionQuery
	// contains filtered or unexported fields
}

DSessionSelect is the builder for selecting fields of DSession entities.

func (*DSessionSelect) Bool

func (ds *DSessionSelect) Bool(ctx context.Context) (_ bool, err error)

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

func (*DSessionSelect) BoolX

func (ds *DSessionSelect) BoolX(ctx context.Context) bool

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

func (*DSessionSelect) Bools

func (ds *DSessionSelect) Bools(ctx context.Context) ([]bool, error)

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

func (*DSessionSelect) BoolsX

func (ds *DSessionSelect) BoolsX(ctx context.Context) []bool

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

func (*DSessionSelect) Float64

func (ds *DSessionSelect) Float64(ctx context.Context) (_ float64, err error)

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

func (*DSessionSelect) Float64X

func (ds *DSessionSelect) Float64X(ctx context.Context) float64

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

func (*DSessionSelect) Float64s

func (ds *DSessionSelect) Float64s(ctx context.Context) ([]float64, error)

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

func (*DSessionSelect) Float64sX

func (ds *DSessionSelect) Float64sX(ctx context.Context) []float64

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

func (*DSessionSelect) Int

func (ds *DSessionSelect) Int(ctx context.Context) (_ int, err error)

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

func (*DSessionSelect) IntX

func (ds *DSessionSelect) IntX(ctx context.Context) int

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

func (*DSessionSelect) Ints

func (ds *DSessionSelect) Ints(ctx context.Context) ([]int, error)

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

func (*DSessionSelect) IntsX

func (ds *DSessionSelect) IntsX(ctx context.Context) []int

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

func (*DSessionSelect) Scan

func (ds *DSessionSelect) Scan(ctx context.Context, v interface{}) error

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

func (*DSessionSelect) ScanX

func (ds *DSessionSelect) ScanX(ctx context.Context, v interface{})

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

func (*DSessionSelect) String

func (ds *DSessionSelect) String(ctx context.Context) (_ string, err error)

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

func (*DSessionSelect) StringX

func (ds *DSessionSelect) StringX(ctx context.Context) string

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

func (*DSessionSelect) Strings

func (ds *DSessionSelect) Strings(ctx context.Context) ([]string, error)

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

func (*DSessionSelect) StringsX

func (ds *DSessionSelect) StringsX(ctx context.Context) []string

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

type DSessionUpdate

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

DSessionUpdate is the builder for updating DSession entities.

func (*DSessionUpdate) Exec

func (du *DSessionUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*DSessionUpdate) ExecX

func (du *DSessionUpdate) ExecX(ctx context.Context)

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

func (*DSessionUpdate) Mutation

func (du *DSessionUpdate) Mutation() *DSessionMutation

Mutation returns the DSessionMutation object of the builder.

func (*DSessionUpdate) Save

func (du *DSessionUpdate) Save(ctx context.Context) (int, error)

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

func (*DSessionUpdate) SaveX

func (du *DSessionUpdate) SaveX(ctx context.Context) int

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

func (*DSessionUpdate) SetCreateTime

func (du *DSessionUpdate) SetCreateTime(t time.Time) *DSessionUpdate

SetCreateTime sets the "create_time" field.

func (*DSessionUpdate) SetNillableRoomID

func (du *DSessionUpdate) SetNillableRoomID(s *string) *DSessionUpdate

SetNillableRoomID sets the "room_id" field if the given value is not nil.

func (*DSessionUpdate) SetNillableUserID

func (du *DSessionUpdate) SetNillableUserID(s *string) *DSessionUpdate

SetNillableUserID sets the "user_id" field if the given value is not nil.

func (*DSessionUpdate) SetRoomID

func (du *DSessionUpdate) SetRoomID(s string) *DSessionUpdate

SetRoomID sets the "room_id" field.

func (*DSessionUpdate) SetUserID

func (du *DSessionUpdate) SetUserID(s string) *DSessionUpdate

SetUserID sets the "user_id" field.

func (*DSessionUpdate) Where

func (du *DSessionUpdate) Where(ps ...predicate.DSession) *DSessionUpdate

Where appends a list predicates to the DSessionUpdate builder.

type DSessionUpdateOne

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

DSessionUpdateOne is the builder for updating a single DSession entity.

func (*DSessionUpdateOne) Exec

func (duo *DSessionUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*DSessionUpdateOne) ExecX

func (duo *DSessionUpdateOne) ExecX(ctx context.Context)

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

func (*DSessionUpdateOne) Mutation

func (duo *DSessionUpdateOne) Mutation() *DSessionMutation

Mutation returns the DSessionMutation object of the builder.

func (*DSessionUpdateOne) Save

func (duo *DSessionUpdateOne) Save(ctx context.Context) (*DSession, error)

Save executes the query and returns the updated DSession entity.

func (*DSessionUpdateOne) SaveX

func (duo *DSessionUpdateOne) SaveX(ctx context.Context) *DSession

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

func (*DSessionUpdateOne) Select

func (duo *DSessionUpdateOne) Select(field string, fields ...string) *DSessionUpdateOne

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

func (*DSessionUpdateOne) SetCreateTime

func (duo *DSessionUpdateOne) SetCreateTime(t time.Time) *DSessionUpdateOne

SetCreateTime sets the "create_time" field.

func (*DSessionUpdateOne) SetNillableRoomID

func (duo *DSessionUpdateOne) SetNillableRoomID(s *string) *DSessionUpdateOne

SetNillableRoomID sets the "room_id" field if the given value is not nil.

func (*DSessionUpdateOne) SetNillableUserID

func (duo *DSessionUpdateOne) SetNillableUserID(s *string) *DSessionUpdateOne

SetNillableUserID sets the "user_id" field if the given value is not nil.

func (*DSessionUpdateOne) SetRoomID

func (duo *DSessionUpdateOne) SetRoomID(s string) *DSessionUpdateOne

SetRoomID sets the "room_id" field.

func (*DSessionUpdateOne) SetUserID

func (duo *DSessionUpdateOne) SetUserID(s string) *DSessionUpdateOne

SetUserID sets the "user_id" field.

type DSessions

type DSessions []*DSession

DSessions is a parsable slice of DSession.

type DUser

type DUser struct {

	// ID of the ent.
	ID string `json:"id,omitempty"`
	// Name holds the value of the "name" field.
	Name string `json:"name,omitempty"`
	// PasswordHash holds the value of the "password_hash" field.
	PasswordHash string `json:"password_hash,omitempty"`
	// CreateTime holds the value of the "create_time" field.
	CreateTime time.Time `json:"create_time,omitempty"`
	// contains filtered or unexported fields
}

DUser is the model entity for the DUser schema.

func (*DUser) String

func (d *DUser) String() string

String implements the fmt.Stringer.

func (*DUser) Unwrap

func (d *DUser) Unwrap() *DUser

Unwrap unwraps the DUser 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 (*DUser) Update

func (d *DUser) Update() *DUserUpdateOne

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

type DUserClient

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

DUserClient is a client for the DUser schema.

func NewDUserClient

func NewDUserClient(c config) *DUserClient

NewDUserClient returns a client for the DUser from the given config.

func (*DUserClient) Create

func (c *DUserClient) Create() *DUserCreate

Create returns a create builder for DUser.

func (*DUserClient) CreateBulk

func (c *DUserClient) CreateBulk(builders ...*DUserCreate) *DUserCreateBulk

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

func (*DUserClient) Delete

func (c *DUserClient) Delete() *DUserDelete

Delete returns a delete builder for DUser.

func (*DUserClient) DeleteOne

func (c *DUserClient) DeleteOne(d *DUser) *DUserDeleteOne

DeleteOne returns a delete builder for the given entity.

func (*DUserClient) DeleteOneID

func (c *DUserClient) DeleteOneID(id string) *DUserDeleteOne

DeleteOneID returns a delete builder for the given id.

func (*DUserClient) Get

func (c *DUserClient) Get(ctx context.Context, id string) (*DUser, error)

Get returns a DUser entity by its id.

func (*DUserClient) GetX

func (c *DUserClient) GetX(ctx context.Context, id string) *DUser

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

func (*DUserClient) Hooks

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

Hooks returns the client hooks.

func (*DUserClient) Query

func (c *DUserClient) Query() *DUserQuery

Query returns a query builder for DUser.

func (*DUserClient) Update

func (c *DUserClient) Update() *DUserUpdate

Update returns an update builder for DUser.

func (*DUserClient) UpdateOne

func (c *DUserClient) UpdateOne(d *DUser) *DUserUpdateOne

UpdateOne returns an update builder for the given entity.

func (*DUserClient) UpdateOneID

func (c *DUserClient) UpdateOneID(id string) *DUserUpdateOne

UpdateOneID returns an update builder for the given id.

func (*DUserClient) Use

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

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

type DUserCreate

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

DUserCreate is the builder for creating a DUser entity.

func (*DUserCreate) Exec

func (dc *DUserCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*DUserCreate) ExecX

func (dc *DUserCreate) ExecX(ctx context.Context)

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

func (*DUserCreate) Mutation

func (dc *DUserCreate) Mutation() *DUserMutation

Mutation returns the DUserMutation object of the builder.

func (*DUserCreate) Save

func (dc *DUserCreate) Save(ctx context.Context) (*DUser, error)

Save creates the DUser in the database.

func (*DUserCreate) SaveX

func (dc *DUserCreate) SaveX(ctx context.Context) *DUser

SaveX calls Save and panics if Save returns an error.

func (*DUserCreate) SetCreateTime

func (dc *DUserCreate) SetCreateTime(t time.Time) *DUserCreate

SetCreateTime sets the "create_time" field.

func (*DUserCreate) SetID

func (dc *DUserCreate) SetID(s string) *DUserCreate

SetID sets the "id" field.

func (*DUserCreate) SetName

func (dc *DUserCreate) SetName(s string) *DUserCreate

SetName sets the "name" field.

func (*DUserCreate) SetPasswordHash

func (dc *DUserCreate) SetPasswordHash(s string) *DUserCreate

SetPasswordHash sets the "password_hash" field.

type DUserCreateBulk

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

DUserCreateBulk is the builder for creating many DUser entities in bulk.

func (*DUserCreateBulk) Exec

func (dcb *DUserCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*DUserCreateBulk) ExecX

func (dcb *DUserCreateBulk) ExecX(ctx context.Context)

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

func (*DUserCreateBulk) Save

func (dcb *DUserCreateBulk) Save(ctx context.Context) ([]*DUser, error)

Save creates the DUser entities in the database.

func (*DUserCreateBulk) SaveX

func (dcb *DUserCreateBulk) SaveX(ctx context.Context) []*DUser

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

type DUserDelete

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

DUserDelete is the builder for deleting a DUser entity.

func (*DUserDelete) Exec

func (dd *DUserDelete) Exec(ctx context.Context) (int, error)

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

func (*DUserDelete) ExecX

func (dd *DUserDelete) ExecX(ctx context.Context) int

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

func (*DUserDelete) Where

func (dd *DUserDelete) Where(ps ...predicate.DUser) *DUserDelete

Where appends a list predicates to the DUserDelete builder.

type DUserDeleteOne

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

DUserDeleteOne is the builder for deleting a single DUser entity.

func (*DUserDeleteOne) Exec

func (ddo *DUserDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*DUserDeleteOne) ExecX

func (ddo *DUserDeleteOne) ExecX(ctx context.Context)

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

type DUserGroupBy

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

DUserGroupBy is the group-by builder for DUser entities.

func (*DUserGroupBy) Aggregate

func (dgb *DUserGroupBy) Aggregate(fns ...AggregateFunc) *DUserGroupBy

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

func (*DUserGroupBy) Bool

func (dgb *DUserGroupBy) 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 (*DUserGroupBy) BoolX

func (dgb *DUserGroupBy) BoolX(ctx context.Context) bool

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

func (*DUserGroupBy) Bools

func (dgb *DUserGroupBy) 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 (*DUserGroupBy) BoolsX

func (dgb *DUserGroupBy) BoolsX(ctx context.Context) []bool

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

func (*DUserGroupBy) Float64

func (dgb *DUserGroupBy) 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 (*DUserGroupBy) Float64X

func (dgb *DUserGroupBy) Float64X(ctx context.Context) float64

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

func (*DUserGroupBy) Float64s

func (dgb *DUserGroupBy) 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 (*DUserGroupBy) Float64sX

func (dgb *DUserGroupBy) Float64sX(ctx context.Context) []float64

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

func (*DUserGroupBy) Int

func (dgb *DUserGroupBy) 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 (*DUserGroupBy) IntX

func (dgb *DUserGroupBy) IntX(ctx context.Context) int

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

func (*DUserGroupBy) Ints

func (dgb *DUserGroupBy) 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 (*DUserGroupBy) IntsX

func (dgb *DUserGroupBy) IntsX(ctx context.Context) []int

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

func (*DUserGroupBy) Scan

func (dgb *DUserGroupBy) Scan(ctx context.Context, v interface{}) error

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

func (*DUserGroupBy) ScanX

func (dgb *DUserGroupBy) ScanX(ctx context.Context, v interface{})

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

func (*DUserGroupBy) String

func (dgb *DUserGroupBy) 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 (*DUserGroupBy) StringX

func (dgb *DUserGroupBy) StringX(ctx context.Context) string

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

func (*DUserGroupBy) Strings

func (dgb *DUserGroupBy) 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 (*DUserGroupBy) StringsX

func (dgb *DUserGroupBy) StringsX(ctx context.Context) []string

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

type DUserMutation

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

DUserMutation represents an operation that mutates the DUser nodes in the graph.

func (*DUserMutation) AddField

func (m *DUserMutation) 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 (*DUserMutation) AddedEdges

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

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

func (*DUserMutation) AddedField

func (m *DUserMutation) 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 (*DUserMutation) AddedFields

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

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

func (*DUserMutation) AddedIDs

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

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

func (*DUserMutation) ClearEdge

func (m *DUserMutation) 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 (*DUserMutation) ClearField

func (m *DUserMutation) 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 (*DUserMutation) ClearedEdges

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

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

func (*DUserMutation) ClearedFields

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

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

func (DUserMutation) Client

func (m DUserMutation) 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 (*DUserMutation) CreateTime

func (m *DUserMutation) CreateTime() (r time.Time, exists bool)

CreateTime returns the value of the "create_time" field in the mutation.

func (*DUserMutation) EdgeCleared

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

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

func (*DUserMutation) Field

func (m *DUserMutation) 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 (*DUserMutation) FieldCleared

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

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

func (*DUserMutation) Fields

func (m *DUserMutation) 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 (*DUserMutation) ID

func (m *DUserMutation) ID() (id string, 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 (*DUserMutation) Name

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

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

func (*DUserMutation) OldCreateTime

func (m *DUserMutation) OldCreateTime(ctx context.Context) (v time.Time, err error)

OldCreateTime returns the old "create_time" field's value of the DUser entity. If the DUser 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 (*DUserMutation) OldField

func (m *DUserMutation) 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 (*DUserMutation) OldName

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

OldName returns the old "name" field's value of the DUser entity. If the DUser 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 (*DUserMutation) OldPasswordHash

func (m *DUserMutation) OldPasswordHash(ctx context.Context) (v string, err error)

OldPasswordHash returns the old "password_hash" field's value of the DUser entity. If the DUser 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 (*DUserMutation) Op

func (m *DUserMutation) Op() Op

Op returns the operation name.

func (*DUserMutation) PasswordHash

func (m *DUserMutation) PasswordHash() (r string, exists bool)

PasswordHash returns the value of the "password_hash" field in the mutation.

func (*DUserMutation) RemovedEdges

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

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

func (*DUserMutation) RemovedIDs

func (m *DUserMutation) 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 (*DUserMutation) ResetCreateTime

func (m *DUserMutation) ResetCreateTime()

ResetCreateTime resets all changes to the "create_time" field.

func (*DUserMutation) ResetEdge

func (m *DUserMutation) 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 (*DUserMutation) ResetField

func (m *DUserMutation) 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 (*DUserMutation) ResetName

func (m *DUserMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*DUserMutation) ResetPasswordHash

func (m *DUserMutation) ResetPasswordHash()

ResetPasswordHash resets all changes to the "password_hash" field.

func (*DUserMutation) SetCreateTime

func (m *DUserMutation) SetCreateTime(t time.Time)

SetCreateTime sets the "create_time" field.

func (*DUserMutation) SetField

func (m *DUserMutation) 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 (*DUserMutation) SetID

func (m *DUserMutation) SetID(id string)

SetID sets the value of the id field. Note that this operation is only accepted on creation of DUser entities.

func (*DUserMutation) SetName

func (m *DUserMutation) SetName(s string)

SetName sets the "name" field.

func (*DUserMutation) SetPasswordHash

func (m *DUserMutation) SetPasswordHash(s string)

SetPasswordHash sets the "password_hash" field.

func (DUserMutation) Tx

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

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

func (*DUserMutation) Type

func (m *DUserMutation) Type() string

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

func (*DUserMutation) Where

func (m *DUserMutation) Where(ps ...predicate.DUser)

Where appends a list predicates to the DUserMutation builder.

type DUserQuery

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

DUserQuery is the builder for querying DUser entities.

func (*DUserQuery) All

func (dq *DUserQuery) All(ctx context.Context) ([]*DUser, error)

All executes the query and returns a list of DUsers.

func (*DUserQuery) AllX

func (dq *DUserQuery) AllX(ctx context.Context) []*DUser

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

func (*DUserQuery) Clone

func (dq *DUserQuery) Clone() *DUserQuery

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

func (*DUserQuery) Count

func (dq *DUserQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*DUserQuery) CountX

func (dq *DUserQuery) CountX(ctx context.Context) int

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

func (*DUserQuery) Exist

func (dq *DUserQuery) Exist(ctx context.Context) (bool, error)

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

func (*DUserQuery) ExistX

func (dq *DUserQuery) ExistX(ctx context.Context) bool

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

func (*DUserQuery) First

func (dq *DUserQuery) First(ctx context.Context) (*DUser, error)

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

func (*DUserQuery) FirstID

func (dq *DUserQuery) FirstID(ctx context.Context) (id string, err error)

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

func (*DUserQuery) FirstIDX

func (dq *DUserQuery) FirstIDX(ctx context.Context) string

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

func (*DUserQuery) FirstX

func (dq *DUserQuery) FirstX(ctx context.Context) *DUser

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

func (*DUserQuery) GroupBy

func (dq *DUserQuery) GroupBy(field string, fields ...string) *DUserGroupBy

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 {
	Name string `json:"name,omitempty"`
	Count int `json:"count,omitempty"`
}

client.DUser.Query().
	GroupBy(duser.FieldName).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*DUserQuery) IDs

func (dq *DUserQuery) IDs(ctx context.Context) ([]string, error)

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

func (*DUserQuery) IDsX

func (dq *DUserQuery) IDsX(ctx context.Context) []string

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

func (*DUserQuery) Limit

func (dq *DUserQuery) Limit(limit int) *DUserQuery

Limit adds a limit step to the query.

func (*DUserQuery) Offset

func (dq *DUserQuery) Offset(offset int) *DUserQuery

Offset adds an offset step to the query.

func (*DUserQuery) Only

func (dq *DUserQuery) Only(ctx context.Context) (*DUser, error)

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

func (*DUserQuery) OnlyID

func (dq *DUserQuery) OnlyID(ctx context.Context) (id string, err error)

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

func (*DUserQuery) OnlyIDX

func (dq *DUserQuery) OnlyIDX(ctx context.Context) string

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

func (*DUserQuery) OnlyX

func (dq *DUserQuery) OnlyX(ctx context.Context) *DUser

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

func (*DUserQuery) Order

func (dq *DUserQuery) Order(o ...OrderFunc) *DUserQuery

Order adds an order step to the query.

func (*DUserQuery) Select

func (dq *DUserQuery) Select(fields ...string) *DUserSelect

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 {
	Name string `json:"name,omitempty"`
}

client.DUser.Query().
	Select(duser.FieldName).
	Scan(ctx, &v)

func (*DUserQuery) Unique

func (dq *DUserQuery) Unique(unique bool) *DUserQuery

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 (*DUserQuery) Where

func (dq *DUserQuery) Where(ps ...predicate.DUser) *DUserQuery

Where adds a new predicate for the DUserQuery builder.

type DUserSelect

type DUserSelect struct {
	*DUserQuery
	// contains filtered or unexported fields
}

DUserSelect is the builder for selecting fields of DUser entities.

func (*DUserSelect) Bool

func (ds *DUserSelect) Bool(ctx context.Context) (_ bool, err error)

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

func (*DUserSelect) BoolX

func (ds *DUserSelect) BoolX(ctx context.Context) bool

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

func (*DUserSelect) Bools

func (ds *DUserSelect) Bools(ctx context.Context) ([]bool, error)

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

func (*DUserSelect) BoolsX

func (ds *DUserSelect) BoolsX(ctx context.Context) []bool

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

func (*DUserSelect) Float64

func (ds *DUserSelect) Float64(ctx context.Context) (_ float64, err error)

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

func (*DUserSelect) Float64X

func (ds *DUserSelect) Float64X(ctx context.Context) float64

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

func (*DUserSelect) Float64s

func (ds *DUserSelect) Float64s(ctx context.Context) ([]float64, error)

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

func (*DUserSelect) Float64sX

func (ds *DUserSelect) Float64sX(ctx context.Context) []float64

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

func (*DUserSelect) Int

func (ds *DUserSelect) Int(ctx context.Context) (_ int, err error)

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

func (*DUserSelect) IntX

func (ds *DUserSelect) IntX(ctx context.Context) int

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

func (*DUserSelect) Ints

func (ds *DUserSelect) Ints(ctx context.Context) ([]int, error)

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

func (*DUserSelect) IntsX

func (ds *DUserSelect) IntsX(ctx context.Context) []int

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

func (*DUserSelect) Scan

func (ds *DUserSelect) Scan(ctx context.Context, v interface{}) error

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

func (*DUserSelect) ScanX

func (ds *DUserSelect) ScanX(ctx context.Context, v interface{})

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

func (*DUserSelect) String

func (ds *DUserSelect) String(ctx context.Context) (_ string, err error)

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

func (*DUserSelect) StringX

func (ds *DUserSelect) StringX(ctx context.Context) string

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

func (*DUserSelect) Strings

func (ds *DUserSelect) Strings(ctx context.Context) ([]string, error)

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

func (*DUserSelect) StringsX

func (ds *DUserSelect) StringsX(ctx context.Context) []string

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

type DUserUpdate

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

DUserUpdate is the builder for updating DUser entities.

func (*DUserUpdate) Exec

func (du *DUserUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*DUserUpdate) ExecX

func (du *DUserUpdate) ExecX(ctx context.Context)

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

func (*DUserUpdate) Mutation

func (du *DUserUpdate) Mutation() *DUserMutation

Mutation returns the DUserMutation object of the builder.

func (*DUserUpdate) Save

func (du *DUserUpdate) Save(ctx context.Context) (int, error)

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

func (*DUserUpdate) SaveX

func (du *DUserUpdate) SaveX(ctx context.Context) int

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

func (*DUserUpdate) SetCreateTime

func (du *DUserUpdate) SetCreateTime(t time.Time) *DUserUpdate

SetCreateTime sets the "create_time" field.

func (*DUserUpdate) SetName

func (du *DUserUpdate) SetName(s string) *DUserUpdate

SetName sets the "name" field.

func (*DUserUpdate) SetPasswordHash

func (du *DUserUpdate) SetPasswordHash(s string) *DUserUpdate

SetPasswordHash sets the "password_hash" field.

func (*DUserUpdate) Where

func (du *DUserUpdate) Where(ps ...predicate.DUser) *DUserUpdate

Where appends a list predicates to the DUserUpdate builder.

type DUserUpdateOne

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

DUserUpdateOne is the builder for updating a single DUser entity.

func (*DUserUpdateOne) Exec

func (duo *DUserUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*DUserUpdateOne) ExecX

func (duo *DUserUpdateOne) ExecX(ctx context.Context)

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

func (*DUserUpdateOne) Mutation

func (duo *DUserUpdateOne) Mutation() *DUserMutation

Mutation returns the DUserMutation object of the builder.

func (*DUserUpdateOne) Save

func (duo *DUserUpdateOne) Save(ctx context.Context) (*DUser, error)

Save executes the query and returns the updated DUser entity.

func (*DUserUpdateOne) SaveX

func (duo *DUserUpdateOne) SaveX(ctx context.Context) *DUser

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

func (*DUserUpdateOne) Select

func (duo *DUserUpdateOne) Select(field string, fields ...string) *DUserUpdateOne

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

func (*DUserUpdateOne) SetCreateTime

func (duo *DUserUpdateOne) SetCreateTime(t time.Time) *DUserUpdateOne

SetCreateTime sets the "create_time" field.

func (*DUserUpdateOne) SetName

func (duo *DUserUpdateOne) SetName(s string) *DUserUpdateOne

SetName sets the "name" field.

func (*DUserUpdateOne) SetPasswordHash

func (duo *DUserUpdateOne) SetPasswordHash(s string) *DUserUpdateOne

SetPasswordHash sets the "password_hash" field.

type DUsers

type DUsers []*DUser

DUsers is a parsable slice of DUser.

type Hook

type Hook = ent.Hook

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

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(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 Rollbacker method.

type Tx

type Tx struct {

	// DChat is the client for interacting with the DChat builders.
	DChat *DChatClient
	// DChessdbCache is the client for interacting with the DChessdbCache builders.
	DChessdbCache *DChessdbCacheClient
	// DRoom is the client for interacting with the DRoom builders.
	DRoom *DRoomClient
	// DSession is the client for interacting with the DSession builders.
	DSession *DSessionClient
	// DUser is the client for interacting with the DUser builders.
	DUser *DUserClient
	// 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 ValidationError

type ValidationError struct {
	Name string // Field or edge name.
	// contains filtered or unexported fields
}

ValidationError returns when validating a field 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.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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