ent

package
v0.0.0-...-214d0a7 Latest Latest
Warning

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

Go to latest
Published: May 15, 2023 License: GPL-3.0 Imports: 40 Imported by: 0

Documentation

Index

Constants

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

	// Node types.
	TypeCard     = "Card"
	TypeGame     = "Game"
	TypeGameUser = "GameUser"
	TypeMission  = "Mission"
	TypeRecord   = "Record"
	TypeRoom     = "Room"
	TypeRoomUser = "RoomUser"
	TypeSquad    = "Squad"
	TypeVote     = "Vote"
)

Variables

View Source
var (
	// CardOrderFieldCreatedAt orders Card by created_at.
	CardOrderFieldCreatedAt = &CardOrderField{
		field: card.FieldCreatedAt,
		toCursor: func(c *Card) Cursor {
			return Cursor{
				ID:    c.ID,
				Value: c.CreatedAt,
			}
		},
	}
	// CardOrderFieldUpdatedAt orders Card by updated_at.
	CardOrderFieldUpdatedAt = &CardOrderField{
		field: card.FieldUpdatedAt,
		toCursor: func(c *Card) Cursor {
			return Cursor{
				ID:    c.ID,
				Value: c.UpdatedAt,
			}
		},
	}
	// CardOrderFieldDeletedAt orders Card by deleted_at.
	CardOrderFieldDeletedAt = &CardOrderField{
		field: card.FieldDeletedAt,
		toCursor: func(c *Card) Cursor {
			return Cursor{
				ID:    c.ID,
				Value: c.DeletedAt,
			}
		},
	}
	// CardOrderFieldName orders Card by name.
	CardOrderFieldName = &CardOrderField{
		field: card.FieldName,
		toCursor: func(c *Card) Cursor {
			return Cursor{
				ID:    c.ID,
				Value: c.Name,
			}
		},
	}
)
View Source
var (
	// GameOrderFieldCreatedAt orders Game by created_at.
	GameOrderFieldCreatedAt = &GameOrderField{
		field: game.FieldCreatedAt,
		toCursor: func(ga *Game) Cursor {
			return Cursor{
				ID:    ga.ID,
				Value: ga.CreatedAt,
			}
		},
	}
	// GameOrderFieldUpdatedAt orders Game by updated_at.
	GameOrderFieldUpdatedAt = &GameOrderField{
		field: game.FieldUpdatedAt,
		toCursor: func(ga *Game) Cursor {
			return Cursor{
				ID:    ga.ID,
				Value: ga.UpdatedAt,
			}
		},
	}
	// GameOrderFieldDeletedAt orders Game by deleted_at.
	GameOrderFieldDeletedAt = &GameOrderField{
		field: game.FieldDeletedAt,
		toCursor: func(ga *Game) Cursor {
			return Cursor{
				ID:    ga.ID,
				Value: ga.DeletedAt,
			}
		},
	}
)
View Source
var (
	// GameUserOrderFieldCreatedAt orders GameUser by created_at.
	GameUserOrderFieldCreatedAt = &GameUserOrderField{
		field: gameuser.FieldCreatedAt,
		toCursor: func(gu *GameUser) Cursor {
			return Cursor{
				ID:    gu.ID,
				Value: gu.CreatedAt,
			}
		},
	}
	// GameUserOrderFieldUpdatedAt orders GameUser by updated_at.
	GameUserOrderFieldUpdatedAt = &GameUserOrderField{
		field: gameuser.FieldUpdatedAt,
		toCursor: func(gu *GameUser) Cursor {
			return Cursor{
				ID:    gu.ID,
				Value: gu.UpdatedAt,
			}
		},
	}
	// GameUserOrderFieldDeletedAt orders GameUser by deleted_at.
	GameUserOrderFieldDeletedAt = &GameUserOrderField{
		field: gameuser.FieldDeletedAt,
		toCursor: func(gu *GameUser) Cursor {
			return Cursor{
				ID:    gu.ID,
				Value: gu.DeletedAt,
			}
		},
	}
)
View Source
var (
	// MissionOrderFieldCreatedAt orders Mission by created_at.
	MissionOrderFieldCreatedAt = &MissionOrderField{
		field: mission.FieldCreatedAt,
		toCursor: func(m *Mission) Cursor {
			return Cursor{
				ID:    m.ID,
				Value: m.CreatedAt,
			}
		},
	}
	// MissionOrderFieldUpdatedAt orders Mission by updated_at.
	MissionOrderFieldUpdatedAt = &MissionOrderField{
		field: mission.FieldUpdatedAt,
		toCursor: func(m *Mission) Cursor {
			return Cursor{
				ID:    m.ID,
				Value: m.UpdatedAt,
			}
		},
	}
	// MissionOrderFieldDeletedAt orders Mission by deleted_at.
	MissionOrderFieldDeletedAt = &MissionOrderField{
		field: mission.FieldDeletedAt,
		toCursor: func(m *Mission) Cursor {
			return Cursor{
				ID:    m.ID,
				Value: m.DeletedAt,
			}
		},
	}
)
View Source
var (
	// RecordOrderFieldCreatedAt orders Record by created_at.
	RecordOrderFieldCreatedAt = &RecordOrderField{
		field: record.FieldCreatedAt,
		toCursor: func(r *Record) Cursor {
			return Cursor{
				ID:    r.ID,
				Value: r.CreatedAt,
			}
		},
	}
	// RecordOrderFieldUpdatedAt orders Record by updated_at.
	RecordOrderFieldUpdatedAt = &RecordOrderField{
		field: record.FieldUpdatedAt,
		toCursor: func(r *Record) Cursor {
			return Cursor{
				ID:    r.ID,
				Value: r.UpdatedAt,
			}
		},
	}
	// RecordOrderFieldDeletedAt orders Record by deleted_at.
	RecordOrderFieldDeletedAt = &RecordOrderField{
		field: record.FieldDeletedAt,
		toCursor: func(r *Record) Cursor {
			return Cursor{
				ID:    r.ID,
				Value: r.DeletedAt,
			}
		},
	}
)
View Source
var (
	// RoomOrderFieldCreatedAt orders Room by created_at.
	RoomOrderFieldCreatedAt = &RoomOrderField{
		field: room.FieldCreatedAt,
		toCursor: func(r *Room) Cursor {
			return Cursor{
				ID:    r.ID,
				Value: r.CreatedAt,
			}
		},
	}
	// RoomOrderFieldUpdatedAt orders Room by updated_at.
	RoomOrderFieldUpdatedAt = &RoomOrderField{
		field: room.FieldUpdatedAt,
		toCursor: func(r *Room) Cursor {
			return Cursor{
				ID:    r.ID,
				Value: r.UpdatedAt,
			}
		},
	}
	// RoomOrderFieldDeletedAt orders Room by deleted_at.
	RoomOrderFieldDeletedAt = &RoomOrderField{
		field: room.FieldDeletedAt,
		toCursor: func(r *Room) Cursor {
			return Cursor{
				ID:    r.ID,
				Value: r.DeletedAt,
			}
		},
	}
	// RoomOrderFieldName orders Room by name.
	RoomOrderFieldName = &RoomOrderField{
		field: room.FieldName,
		toCursor: func(r *Room) Cursor {
			return Cursor{
				ID:    r.ID,
				Value: r.Name,
			}
		},
	}
)
View Source
var (
	// RoomUserOrderFieldCreatedAt orders RoomUser by created_at.
	RoomUserOrderFieldCreatedAt = &RoomUserOrderField{
		field: roomuser.FieldCreatedAt,
		toCursor: func(ru *RoomUser) Cursor {
			return Cursor{
				ID:    ru.ID,
				Value: ru.CreatedAt,
			}
		},
	}
	// RoomUserOrderFieldUpdatedAt orders RoomUser by updated_at.
	RoomUserOrderFieldUpdatedAt = &RoomUserOrderField{
		field: roomuser.FieldUpdatedAt,
		toCursor: func(ru *RoomUser) Cursor {
			return Cursor{
				ID:    ru.ID,
				Value: ru.UpdatedAt,
			}
		},
	}
	// RoomUserOrderFieldDeletedAt orders RoomUser by deleted_at.
	RoomUserOrderFieldDeletedAt = &RoomUserOrderField{
		field: roomuser.FieldDeletedAt,
		toCursor: func(ru *RoomUser) Cursor {
			return Cursor{
				ID:    ru.ID,
				Value: ru.DeletedAt,
			}
		},
	}
)
View Source
var (
	// SquadOrderFieldCreatedAt orders Squad by created_at.
	SquadOrderFieldCreatedAt = &SquadOrderField{
		field: squad.FieldCreatedAt,
		toCursor: func(s *Squad) Cursor {
			return Cursor{
				ID:    s.ID,
				Value: s.CreatedAt,
			}
		},
	}
	// SquadOrderFieldUpdatedAt orders Squad by updated_at.
	SquadOrderFieldUpdatedAt = &SquadOrderField{
		field: squad.FieldUpdatedAt,
		toCursor: func(s *Squad) Cursor {
			return Cursor{
				ID:    s.ID,
				Value: s.UpdatedAt,
			}
		},
	}
	// SquadOrderFieldDeletedAt orders Squad by deleted_at.
	SquadOrderFieldDeletedAt = &SquadOrderField{
		field: squad.FieldDeletedAt,
		toCursor: func(s *Squad) Cursor {
			return Cursor{
				ID:    s.ID,
				Value: s.DeletedAt,
			}
		},
	}
)
View Source
var (
	// VoteOrderFieldCreatedAt orders Vote by created_at.
	VoteOrderFieldCreatedAt = &VoteOrderField{
		field: vote.FieldCreatedAt,
		toCursor: func(v *Vote) Cursor {
			return Cursor{
				ID:    v.ID,
				Value: v.CreatedAt,
			}
		},
	}
	// VoteOrderFieldUpdatedAt orders Vote by updated_at.
	VoteOrderFieldUpdatedAt = &VoteOrderField{
		field: vote.FieldUpdatedAt,
		toCursor: func(v *Vote) Cursor {
			return Cursor{
				ID:    v.ID,
				Value: v.UpdatedAt,
			}
		},
	}
	// VoteOrderFieldDeletedAt orders Vote by deleted_at.
	VoteOrderFieldDeletedAt = &VoteOrderField{
		field: vote.FieldDeletedAt,
		toCursor: func(v *Vote) Cursor {
			return Cursor{
				ID:    v.ID,
				Value: v.DeletedAt,
			}
		},
	}
)
View Source
var DefaultCardOrder = &CardOrder{
	Direction: OrderDirectionAsc,
	Field: &CardOrderField{
		field: card.FieldID,
		toCursor: func(c *Card) Cursor {
			return Cursor{ID: c.ID}
		},
	},
}

DefaultCardOrder is the default ordering of Card.

View Source
var DefaultGameOrder = &GameOrder{
	Direction: OrderDirectionAsc,
	Field: &GameOrderField{
		field: game.FieldID,
		toCursor: func(ga *Game) Cursor {
			return Cursor{ID: ga.ID}
		},
	},
}

DefaultGameOrder is the default ordering of Game.

View Source
var DefaultGameUserOrder = &GameUserOrder{
	Direction: OrderDirectionAsc,
	Field: &GameUserOrderField{
		field: gameuser.FieldID,
		toCursor: func(gu *GameUser) Cursor {
			return Cursor{ID: gu.ID}
		},
	},
}

DefaultGameUserOrder is the default ordering of GameUser.

View Source
var DefaultMissionOrder = &MissionOrder{
	Direction: OrderDirectionAsc,
	Field: &MissionOrderField{
		field: mission.FieldID,
		toCursor: func(m *Mission) Cursor {
			return Cursor{ID: m.ID}
		},
	},
}

DefaultMissionOrder is the default ordering of Mission.

View Source
var DefaultRecordOrder = &RecordOrder{
	Direction: OrderDirectionAsc,
	Field: &RecordOrderField{
		field: record.FieldID,
		toCursor: func(r *Record) Cursor {
			return Cursor{ID: r.ID}
		},
	},
}

DefaultRecordOrder is the default ordering of Record.

View Source
var DefaultRoomOrder = &RoomOrder{
	Direction: OrderDirectionAsc,
	Field: &RoomOrderField{
		field: room.FieldID,
		toCursor: func(r *Room) Cursor {
			return Cursor{ID: r.ID}
		},
	},
}

DefaultRoomOrder is the default ordering of Room.

View Source
var DefaultRoomUserOrder = &RoomUserOrder{
	Direction: OrderDirectionAsc,
	Field: &RoomUserOrderField{
		field: roomuser.FieldID,
		toCursor: func(ru *RoomUser) Cursor {
			return Cursor{ID: ru.ID}
		},
	},
}

DefaultRoomUserOrder is the default ordering of RoomUser.

View Source
var DefaultSquadOrder = &SquadOrder{
	Direction: OrderDirectionAsc,
	Field: &SquadOrderField{
		field: squad.FieldID,
		toCursor: func(s *Squad) Cursor {
			return Cursor{ID: s.ID}
		},
	},
}

DefaultSquadOrder is the default ordering of Squad.

View Source
var DefaultVoteOrder = &VoteOrder{
	Direction: OrderDirectionAsc,
	Field: &VoteOrderField{
		field: vote.FieldID,
		toCursor: func(v *Vote) Cursor {
			return Cursor{ID: v.ID}
		},
	},
}

DefaultVoteOrder is the default ordering of Vote.

View Source
var ErrEmptyCardWhereInput = errors.New("ent: empty predicate CardWhereInput")

ErrEmptyCardWhereInput is returned in case the CardWhereInput is empty.

View Source
var ErrEmptyGameUserWhereInput = errors.New("ent: empty predicate GameUserWhereInput")

ErrEmptyGameUserWhereInput is returned in case the GameUserWhereInput is empty.

View Source
var ErrEmptyGameWhereInput = errors.New("ent: empty predicate GameWhereInput")

ErrEmptyGameWhereInput is returned in case the GameWhereInput is empty.

View Source
var ErrEmptyMissionWhereInput = errors.New("ent: empty predicate MissionWhereInput")

ErrEmptyMissionWhereInput is returned in case the MissionWhereInput is empty.

View Source
var ErrEmptyRecordWhereInput = errors.New("ent: empty predicate RecordWhereInput")

ErrEmptyRecordWhereInput is returned in case the RecordWhereInput is empty.

View Source
var ErrEmptyRoomUserWhereInput = errors.New("ent: empty predicate RoomUserWhereInput")

ErrEmptyRoomUserWhereInput is returned in case the RoomUserWhereInput is empty.

View Source
var ErrEmptyRoomWhereInput = errors.New("ent: empty predicate RoomWhereInput")

ErrEmptyRoomWhereInput is returned in case the RoomWhereInput is empty.

View Source
var ErrEmptySquadWhereInput = errors.New("ent: empty predicate SquadWhereInput")

ErrEmptySquadWhereInput is returned in case the SquadWhereInput is empty.

View Source
var ErrEmptyVoteWhereInput = errors.New("ent: empty predicate VoteWhereInput")

ErrEmptyVoteWhereInput is returned in case the VoteWhereInput 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.

func OpenTxFromContext

func OpenTxFromContext(ctx context.Context) (context.Context, driver.Tx, error)

OpenTxFromContext open transactions from client stored in context.

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 Card

type Card struct {

	// ID of the ent.
	ID int64 `json:"id,omitempty"`
	// CreatedBy holds the value of the "created_by" field.
	CreatedBy int64 `json:"created_by"`
	// UpdatedBy holds the value of the "updated_by" field.
	UpdatedBy int64 `json:"updated_by"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at"`
	// UpdatedAt holds the value of the "updated_at" field.
	UpdatedAt time.Time `json:"updated_at"`
	// DeletedAt holds the value of the "deleted_at" field.
	DeletedAt time.Time `json:"deleted_at"`
	// 名称
	Name card.Name `json:"name"`
	// 角色
	Role card.Role `json:"role"`
	// 故事
	Tale string `json:"tale"`
	// 是否属于红方
	Red bool `json:"red"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the CardQuery when eager-loading is set.
	Edges CardEdges `json:"edges"`
	// contains filtered or unexported fields
}

Card is the model entity for the Card schema.

func (*Card) GameUsers

func (c *Card) GameUsers(ctx context.Context) (result []*GameUser, err error)

func (Card) IsEntity

func (c Card) IsEntity()

IsEntity implement fedruntime.Entity

func (*Card) NamedGameUsers

func (c *Card) NamedGameUsers(name string) ([]*GameUser, error)

NamedGameUsers returns the GameUsers named value or an error if the edge was not loaded in eager-loading with this name.

func (*Card) Node

func (c *Card) Node(ctx context.Context) (node *Node, err error)

func (*Card) QueryGameUsers

func (c *Card) QueryGameUsers() *GameUserQuery

QueryGameUsers queries the "game_users" edge of the Card entity.

func (*Card) String

func (c *Card) String() string

String implements the fmt.Stringer.

func (*Card) ToEdge

func (c *Card) ToEdge(order *CardOrder) *CardEdge

ToEdge converts Card into CardEdge.

func (*Card) Unwrap

func (c *Card) Unwrap() *Card

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

func (c *Card) Update() *CardUpdateOne

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

type CardClient

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

CardClient is a client for the Card schema.

func NewCardClient

func NewCardClient(c config) *CardClient

NewCardClient returns a client for the Card from the given config.

func (*CardClient) Create

func (c *CardClient) Create() *CardCreate

Create returns a builder for creating a Card entity.

func (*CardClient) CreateBulk

func (c *CardClient) CreateBulk(builders ...*CardCreate) *CardCreateBulk

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

func (*CardClient) Delete

func (c *CardClient) Delete() *CardDelete

Delete returns a delete builder for Card.

func (*CardClient) DeleteOne

func (c *CardClient) DeleteOne(ca *Card) *CardDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*CardClient) DeleteOneID

func (c *CardClient) DeleteOneID(id int64) *CardDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*CardClient) Get

func (c *CardClient) Get(ctx context.Context, id int64) (*Card, error)

Get returns a Card entity by its id.

func (*CardClient) GetX

func (c *CardClient) GetX(ctx context.Context, id int64) *Card

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

func (*CardClient) Hooks

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

Hooks returns the client hooks.

func (*CardClient) Query

func (c *CardClient) Query() *CardQuery

Query returns a query builder for Card.

func (*CardClient) QueryGameUsers

func (c *CardClient) QueryGameUsers(ca *Card) *GameUserQuery

QueryGameUsers queries the game_users edge of a Card.

func (*CardClient) Update

func (c *CardClient) Update() *CardUpdate

Update returns an update builder for Card.

func (*CardClient) UpdateOne

func (c *CardClient) UpdateOne(ca *Card) *CardUpdateOne

UpdateOne returns an update builder for the given entity.

func (*CardClient) UpdateOneID

func (c *CardClient) UpdateOneID(id int64) *CardUpdateOne

UpdateOneID returns an update builder for the given id.

func (*CardClient) Use

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

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

type CardConnection

type CardConnection struct {
	Edges      []*CardEdge `json:"edges"`
	PageInfo   PageInfo    `json:"pageInfo"`
	TotalCount int         `json:"totalCount"`
}

CardConnection is the connection containing edges to Card.

type CardCreate

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

CardCreate is the builder for creating a Card entity.

func (*CardCreate) AddGameUserIDs

func (cc *CardCreate) AddGameUserIDs(ids ...int64) *CardCreate

AddGameUserIDs adds the "game_users" edge to the GameUser entity by IDs.

func (*CardCreate) AddGameUsers

func (cc *CardCreate) AddGameUsers(g ...*GameUser) *CardCreate

AddGameUsers adds the "game_users" edges to the GameUser entity.

func (*CardCreate) Exec

func (cc *CardCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*CardCreate) ExecX

func (cc *CardCreate) ExecX(ctx context.Context)

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

func (*CardCreate) Mutation

func (cc *CardCreate) Mutation() *CardMutation

Mutation returns the CardMutation object of the builder.

func (*CardCreate) Save

func (cc *CardCreate) Save(ctx context.Context) (*Card, error)

Save creates the Card in the database.

func (*CardCreate) SaveX

func (cc *CardCreate) SaveX(ctx context.Context) *Card

SaveX calls Save and panics if Save returns an error.

func (*CardCreate) SetCreatedAt

func (cc *CardCreate) SetCreatedAt(t time.Time) *CardCreate

SetCreatedAt sets the "created_at" field.

func (*CardCreate) SetCreatedBy

func (cc *CardCreate) SetCreatedBy(i int64) *CardCreate

SetCreatedBy sets the "created_by" field.

func (*CardCreate) SetDeletedAt

func (cc *CardCreate) SetDeletedAt(t time.Time) *CardCreate

SetDeletedAt sets the "deleted_at" field.

func (*CardCreate) SetID

func (cc *CardCreate) SetID(i int64) *CardCreate

SetID sets the "id" field.

func (*CardCreate) SetInput

func (c *CardCreate) SetInput(i CreateCardInput) *CardCreate

SetInput applies the change-set in the CreateCardInput on the CardCreate builder.

func (*CardCreate) SetName

func (cc *CardCreate) SetName(c card.Name) *CardCreate

SetName sets the "name" field.

func (*CardCreate) SetNillableCreatedAt

func (cc *CardCreate) SetNillableCreatedAt(t *time.Time) *CardCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*CardCreate) SetNillableCreatedBy

func (cc *CardCreate) SetNillableCreatedBy(i *int64) *CardCreate

SetNillableCreatedBy sets the "created_by" field if the given value is not nil.

func (*CardCreate) SetNillableDeletedAt

func (cc *CardCreate) SetNillableDeletedAt(t *time.Time) *CardCreate

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*CardCreate) SetNillableID

func (cc *CardCreate) SetNillableID(i *int64) *CardCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*CardCreate) SetNillableName

func (cc *CardCreate) SetNillableName(c *card.Name) *CardCreate

SetNillableName sets the "name" field if the given value is not nil.

func (*CardCreate) SetNillableRed

func (cc *CardCreate) SetNillableRed(b *bool) *CardCreate

SetNillableRed sets the "red" field if the given value is not nil.

func (*CardCreate) SetNillableTale

func (cc *CardCreate) SetNillableTale(s *string) *CardCreate

SetNillableTale sets the "tale" field if the given value is not nil.

func (*CardCreate) SetNillableUpdatedAt

func (cc *CardCreate) SetNillableUpdatedAt(t *time.Time) *CardCreate

SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.

func (*CardCreate) SetNillableUpdatedBy

func (cc *CardCreate) SetNillableUpdatedBy(i *int64) *CardCreate

SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil.

func (*CardCreate) SetRed

func (cc *CardCreate) SetRed(b bool) *CardCreate

SetRed sets the "red" field.

func (*CardCreate) SetRole

func (cc *CardCreate) SetRole(c card.Role) *CardCreate

SetRole sets the "role" field.

func (*CardCreate) SetTale

func (cc *CardCreate) SetTale(s string) *CardCreate

SetTale sets the "tale" field.

func (*CardCreate) SetUpdatedAt

func (cc *CardCreate) SetUpdatedAt(t time.Time) *CardCreate

SetUpdatedAt sets the "updated_at" field.

func (*CardCreate) SetUpdatedBy

func (cc *CardCreate) SetUpdatedBy(i int64) *CardCreate

SetUpdatedBy sets the "updated_by" field.

type CardCreateBulk

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

CardCreateBulk is the builder for creating many Card entities in bulk.

func (*CardCreateBulk) Exec

func (ccb *CardCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*CardCreateBulk) ExecX

func (ccb *CardCreateBulk) ExecX(ctx context.Context)

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

func (*CardCreateBulk) Save

func (ccb *CardCreateBulk) Save(ctx context.Context) ([]*Card, error)

Save creates the Card entities in the database.

func (*CardCreateBulk) SaveX

func (ccb *CardCreateBulk) SaveX(ctx context.Context) []*Card

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

type CardDelete

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

CardDelete is the builder for deleting a Card entity.

func (*CardDelete) Exec

func (cd *CardDelete) Exec(ctx context.Context) (int, error)

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

func (*CardDelete) ExecX

func (cd *CardDelete) ExecX(ctx context.Context) int

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

func (*CardDelete) Where

func (cd *CardDelete) Where(ps ...predicate.Card) *CardDelete

Where appends a list predicates to the CardDelete builder.

type CardDeleteOne

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

CardDeleteOne is the builder for deleting a single Card entity.

func (*CardDeleteOne) Exec

func (cdo *CardDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*CardDeleteOne) ExecX

func (cdo *CardDeleteOne) ExecX(ctx context.Context)

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

type CardEdge

type CardEdge struct {
	Node   *Card  `json:"node"`
	Cursor Cursor `json:"cursor"`
}

CardEdge is the edge representation of Card.

type CardEdges

type CardEdges struct {
	// GameUsers holds the value of the game_users edge.
	GameUsers []*GameUser `json:"game_users,omitempty"`
	// contains filtered or unexported fields
}

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

func (CardEdges) GameUsersOrErr

func (e CardEdges) GameUsersOrErr() ([]*GameUser, error)

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

type CardGroupBy

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

CardGroupBy is the group-by builder for Card entities.

func (*CardGroupBy) Aggregate

func (cgb *CardGroupBy) Aggregate(fns ...AggregateFunc) *CardGroupBy

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

func (*CardGroupBy) Bool

func (s *CardGroupBy) Bool(ctx context.Context) (_ bool, err error)

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

func (*CardGroupBy) BoolX

func (s *CardGroupBy) BoolX(ctx context.Context) bool

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

func (*CardGroupBy) Bools

func (s *CardGroupBy) Bools(ctx context.Context) ([]bool, error)

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

func (*CardGroupBy) BoolsX

func (s *CardGroupBy) BoolsX(ctx context.Context) []bool

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

func (*CardGroupBy) Float64

func (s *CardGroupBy) Float64(ctx context.Context) (_ float64, err error)

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

func (*CardGroupBy) Float64X

func (s *CardGroupBy) Float64X(ctx context.Context) float64

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

func (*CardGroupBy) Float64s

func (s *CardGroupBy) Float64s(ctx context.Context) ([]float64, error)

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

func (*CardGroupBy) Float64sX

func (s *CardGroupBy) Float64sX(ctx context.Context) []float64

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

func (*CardGroupBy) Int

func (s *CardGroupBy) Int(ctx context.Context) (_ int, err error)

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

func (*CardGroupBy) IntX

func (s *CardGroupBy) IntX(ctx context.Context) int

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

func (*CardGroupBy) Ints

func (s *CardGroupBy) Ints(ctx context.Context) ([]int, error)

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

func (*CardGroupBy) IntsX

func (s *CardGroupBy) IntsX(ctx context.Context) []int

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

func (*CardGroupBy) Scan

func (cgb *CardGroupBy) Scan(ctx context.Context, v any) error

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

func (*CardGroupBy) ScanX

func (s *CardGroupBy) ScanX(ctx context.Context, v any)

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

func (*CardGroupBy) String

func (s *CardGroupBy) String(ctx context.Context) (_ string, err error)

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

func (*CardGroupBy) StringX

func (s *CardGroupBy) StringX(ctx context.Context) string

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

func (*CardGroupBy) Strings

func (s *CardGroupBy) Strings(ctx context.Context) ([]string, error)

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

func (*CardGroupBy) StringsX

func (s *CardGroupBy) StringsX(ctx context.Context) []string

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

type CardMutation

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

CardMutation represents an operation that mutates the Card nodes in the graph.

func (*CardMutation) AddCreatedBy

func (m *CardMutation) AddCreatedBy(i int64)

AddCreatedBy adds i to the "created_by" field.

func (*CardMutation) AddField

func (m *CardMutation) 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 (*CardMutation) AddGameUserIDs

func (m *CardMutation) AddGameUserIDs(ids ...int64)

AddGameUserIDs adds the "game_users" edge to the GameUser entity by ids.

func (*CardMutation) AddUpdatedBy

func (m *CardMutation) AddUpdatedBy(i int64)

AddUpdatedBy adds i to the "updated_by" field.

func (*CardMutation) AddedCreatedBy

func (m *CardMutation) AddedCreatedBy() (r int64, exists bool)

AddedCreatedBy returns the value that was added to the "created_by" field in this mutation.

func (*CardMutation) AddedEdges

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

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

func (*CardMutation) AddedField

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

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

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

func (*CardMutation) AddedIDs

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

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

func (*CardMutation) AddedUpdatedBy

func (m *CardMutation) AddedUpdatedBy() (r int64, exists bool)

AddedUpdatedBy returns the value that was added to the "updated_by" field in this mutation.

func (*CardMutation) ClearEdge

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

func (m *CardMutation) 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 (*CardMutation) ClearGameUsers

func (m *CardMutation) ClearGameUsers()

ClearGameUsers clears the "game_users" edge to the GameUser entity.

func (*CardMutation) ClearedEdges

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

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

func (*CardMutation) ClearedFields

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

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

func (CardMutation) Client

func (m CardMutation) 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 (*CardMutation) CreatedAt

func (m *CardMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*CardMutation) CreatedBy

func (m *CardMutation) CreatedBy() (r int64, exists bool)

CreatedBy returns the value of the "created_by" field in the mutation.

func (*CardMutation) DeletedAt

func (m *CardMutation) DeletedAt() (r time.Time, exists bool)

DeletedAt returns the value of the "deleted_at" field in the mutation.

func (*CardMutation) EdgeCleared

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

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

func (*CardMutation) Field

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

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

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

func (*CardMutation) Fields

func (m *CardMutation) 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 (*CardMutation) GameUsersCleared

func (m *CardMutation) GameUsersCleared() bool

GameUsersCleared reports if the "game_users" edge to the GameUser entity was cleared.

func (*CardMutation) GameUsersIDs

func (m *CardMutation) GameUsersIDs() (ids []int64)

GameUsersIDs returns the "game_users" edge IDs in the mutation.

func (*CardMutation) ID

func (m *CardMutation) ID() (id int64, 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 (*CardMutation) IDs

func (m *CardMutation) IDs(ctx context.Context) ([]int64, error)

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

func (*CardMutation) Name

func (m *CardMutation) Name() (r card.Name, exists bool)

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

func (*CardMutation) OldCreatedAt

func (m *CardMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the Card entity. If the Card 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 (*CardMutation) OldCreatedBy

func (m *CardMutation) OldCreatedBy(ctx context.Context) (v int64, err error)

OldCreatedBy returns the old "created_by" field's value of the Card entity. If the Card 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 (*CardMutation) OldDeletedAt

func (m *CardMutation) OldDeletedAt(ctx context.Context) (v time.Time, err error)

OldDeletedAt returns the old "deleted_at" field's value of the Card entity. If the Card 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 (*CardMutation) OldField

func (m *CardMutation) 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 (*CardMutation) OldName

func (m *CardMutation) OldName(ctx context.Context) (v card.Name, err error)

OldName returns the old "name" field's value of the Card entity. If the Card 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 (*CardMutation) OldRed

func (m *CardMutation) OldRed(ctx context.Context) (v bool, err error)

OldRed returns the old "red" field's value of the Card entity. If the Card 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 (*CardMutation) OldRole

func (m *CardMutation) OldRole(ctx context.Context) (v card.Role, err error)

OldRole returns the old "role" field's value of the Card entity. If the Card 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 (*CardMutation) OldTale

func (m *CardMutation) OldTale(ctx context.Context) (v string, err error)

OldTale returns the old "tale" field's value of the Card entity. If the Card 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 (*CardMutation) OldUpdatedAt

func (m *CardMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)

OldUpdatedAt returns the old "updated_at" field's value of the Card entity. If the Card 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 (*CardMutation) OldUpdatedBy

func (m *CardMutation) OldUpdatedBy(ctx context.Context) (v int64, err error)

OldUpdatedBy returns the old "updated_by" field's value of the Card entity. If the Card 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 (*CardMutation) Op

func (m *CardMutation) Op() Op

Op returns the operation name.

func (*CardMutation) Red

func (m *CardMutation) Red() (r bool, exists bool)

Red returns the value of the "red" field in the mutation.

func (*CardMutation) RemoveGameUserIDs

func (m *CardMutation) RemoveGameUserIDs(ids ...int64)

RemoveGameUserIDs removes the "game_users" edge to the GameUser entity by IDs.

func (*CardMutation) RemovedEdges

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

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

func (*CardMutation) RemovedGameUsersIDs

func (m *CardMutation) RemovedGameUsersIDs() (ids []int64)

RemovedGameUsers returns the removed IDs of the "game_users" edge to the GameUser entity.

func (*CardMutation) RemovedIDs

func (m *CardMutation) 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 (*CardMutation) ResetCreatedAt

func (m *CardMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*CardMutation) ResetCreatedBy

func (m *CardMutation) ResetCreatedBy()

ResetCreatedBy resets all changes to the "created_by" field.

func (*CardMutation) ResetDeletedAt

func (m *CardMutation) ResetDeletedAt()

ResetDeletedAt resets all changes to the "deleted_at" field.

func (*CardMutation) ResetEdge

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

func (m *CardMutation) 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 (*CardMutation) ResetGameUsers

func (m *CardMutation) ResetGameUsers()

ResetGameUsers resets all changes to the "game_users" edge.

func (*CardMutation) ResetName

func (m *CardMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*CardMutation) ResetRed

func (m *CardMutation) ResetRed()

ResetRed resets all changes to the "red" field.

func (*CardMutation) ResetRole

func (m *CardMutation) ResetRole()

ResetRole resets all changes to the "role" field.

func (*CardMutation) ResetTale

func (m *CardMutation) ResetTale()

ResetTale resets all changes to the "tale" field.

func (*CardMutation) ResetUpdatedAt

func (m *CardMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*CardMutation) ResetUpdatedBy

func (m *CardMutation) ResetUpdatedBy()

ResetUpdatedBy resets all changes to the "updated_by" field.

func (*CardMutation) Role

func (m *CardMutation) Role() (r card.Role, exists bool)

Role returns the value of the "role" field in the mutation.

func (*CardMutation) SetCreatedAt

func (m *CardMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*CardMutation) SetCreatedBy

func (m *CardMutation) SetCreatedBy(i int64)

SetCreatedBy sets the "created_by" field.

func (*CardMutation) SetDeletedAt

func (m *CardMutation) SetDeletedAt(t time.Time)

SetDeletedAt sets the "deleted_at" field.

func (*CardMutation) SetField

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

func (m *CardMutation) SetID(id int64)

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

func (*CardMutation) SetName

func (m *CardMutation) SetName(c card.Name)

SetName sets the "name" field.

func (*CardMutation) SetRed

func (m *CardMutation) SetRed(b bool)

SetRed sets the "red" field.

func (*CardMutation) SetRole

func (m *CardMutation) SetRole(c card.Role)

SetRole sets the "role" field.

func (*CardMutation) SetTale

func (m *CardMutation) SetTale(s string)

SetTale sets the "tale" field.

func (*CardMutation) SetUpdatedAt

func (m *CardMutation) SetUpdatedAt(t time.Time)

SetUpdatedAt sets the "updated_at" field.

func (*CardMutation) SetUpdatedBy

func (m *CardMutation) SetUpdatedBy(i int64)

SetUpdatedBy sets the "updated_by" field.

func (*CardMutation) Tale

func (m *CardMutation) Tale() (r string, exists bool)

Tale returns the value of the "tale" field in the mutation.

func (CardMutation) Tx

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

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

func (*CardMutation) Type

func (m *CardMutation) Type() string

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

func (*CardMutation) UpdatedAt

func (m *CardMutation) UpdatedAt() (r time.Time, exists bool)

UpdatedAt returns the value of the "updated_at" field in the mutation.

func (*CardMutation) UpdatedBy

func (m *CardMutation) UpdatedBy() (r int64, exists bool)

UpdatedBy returns the value of the "updated_by" field in the mutation.

func (*CardMutation) Where

func (m *CardMutation) Where(ps ...predicate.Card)

Where appends a list predicates to the CardMutation builder.

type CardOrder

type CardOrder struct {
	Direction OrderDirection  `json:"direction"`
	Field     *CardOrderField `json:"field"`
}

CardOrder defines the ordering of Card.

type CardOrderField

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

CardOrderField defines the ordering field of Card.

func (CardOrderField) MarshalGQL

func (f CardOrderField) MarshalGQL(w io.Writer)

MarshalGQL implements graphql.Marshaler interface.

func (CardOrderField) String

func (f CardOrderField) String() string

String implement fmt.Stringer interface.

func (*CardOrderField) UnmarshalGQL

func (f *CardOrderField) UnmarshalGQL(v interface{}) error

UnmarshalGQL implements graphql.Unmarshaler interface.

type CardPaginateOption

type CardPaginateOption func(*cardPager) error

CardPaginateOption enables pagination customization.

func WithCardFilter

func WithCardFilter(filter func(*CardQuery) (*CardQuery, error)) CardPaginateOption

WithCardFilter configures pagination filter.

func WithCardOrder

func WithCardOrder(order *CardOrder) CardPaginateOption

WithCardOrder configures pagination ordering.

type CardQuery

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

CardQuery is the builder for querying Card entities.

func (*CardQuery) Aggregate

func (cq *CardQuery) Aggregate(fns ...AggregateFunc) *CardSelect

Aggregate returns a CardSelect configured with the given aggregations.

func (*CardQuery) All

func (cq *CardQuery) All(ctx context.Context) ([]*Card, error)

All executes the query and returns a list of Cards.

func (*CardQuery) AllX

func (cq *CardQuery) AllX(ctx context.Context) []*Card

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

func (*CardQuery) Clone

func (cq *CardQuery) Clone() *CardQuery

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

func (*CardQuery) CollectFields

func (c *CardQuery) CollectFields(ctx context.Context, satisfies ...string) (*CardQuery, error)

CollectFields tells the query-builder to eagerly load connected nodes by resolver context.

func (*CardQuery) Count

func (cq *CardQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*CardQuery) CountX

func (cq *CardQuery) CountX(ctx context.Context) int

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

func (*CardQuery) Exist

func (cq *CardQuery) Exist(ctx context.Context) (bool, error)

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

func (*CardQuery) ExistX

func (cq *CardQuery) ExistX(ctx context.Context) bool

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

func (*CardQuery) First

func (cq *CardQuery) First(ctx context.Context) (*Card, error)

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

func (*CardQuery) FirstID

func (cq *CardQuery) FirstID(ctx context.Context) (id int64, err error)

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

func (*CardQuery) FirstIDX

func (cq *CardQuery) FirstIDX(ctx context.Context) int64

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

func (*CardQuery) FirstX

func (cq *CardQuery) FirstX(ctx context.Context) *Card

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

func (*CardQuery) GroupBy

func (cq *CardQuery) GroupBy(field string, fields ...string) *CardGroupBy

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 {
	CreatedBy int64 `json:"created_by"`
	Count int `json:"count,omitempty"`
}

client.Card.Query().
	GroupBy(card.FieldCreatedBy).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*CardQuery) IDs

func (cq *CardQuery) IDs(ctx context.Context) ([]int64, error)

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

func (*CardQuery) IDsX

func (cq *CardQuery) IDsX(ctx context.Context) []int64

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

func (*CardQuery) Limit

func (cq *CardQuery) Limit(limit int) *CardQuery

Limit adds a limit step to the query.

func (*CardQuery) Offset

func (cq *CardQuery) Offset(offset int) *CardQuery

Offset adds an offset step to the query.

func (*CardQuery) Only

func (cq *CardQuery) Only(ctx context.Context) (*Card, error)

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

func (*CardQuery) OnlyID

func (cq *CardQuery) OnlyID(ctx context.Context) (id int64, err error)

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

func (*CardQuery) OnlyIDX

func (cq *CardQuery) OnlyIDX(ctx context.Context) int64

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

func (*CardQuery) OnlyX

func (cq *CardQuery) OnlyX(ctx context.Context) *Card

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

func (*CardQuery) Order

func (cq *CardQuery) Order(o ...OrderFunc) *CardQuery

Order adds an order step to the query.

func (*CardQuery) Paginate

func (c *CardQuery) Paginate(
	ctx context.Context, after *Cursor, first *int,
	before *Cursor, last *int, opts ...CardPaginateOption,
) (*CardConnection, error)

Paginate executes the query and returns a relay based cursor connection to Card.

func (*CardQuery) QueryGameUsers

func (cq *CardQuery) QueryGameUsers() *GameUserQuery

QueryGameUsers chains the current query on the "game_users" edge.

func (*CardQuery) Select

func (cq *CardQuery) Select(fields ...string) *CardSelect

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 {
	CreatedBy int64 `json:"created_by"`
}

client.Card.Query().
	Select(card.FieldCreatedBy).
	Scan(ctx, &v)

func (*CardQuery) Unique

func (cq *CardQuery) Unique(unique bool) *CardQuery

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

func (cq *CardQuery) Where(ps ...predicate.Card) *CardQuery

Where adds a new predicate for the CardQuery builder.

func (*CardQuery) WithGameUsers

func (cq *CardQuery) WithGameUsers(opts ...func(*GameUserQuery)) *CardQuery

WithGameUsers tells the query-builder to eager-load the nodes that are connected to the "game_users" edge. The optional arguments are used to configure the query builder of the edge.

func (*CardQuery) WithNamedGameUsers

func (cq *CardQuery) WithNamedGameUsers(name string, opts ...func(*GameUserQuery)) *CardQuery

WithNamedGameUsers tells the query-builder to eager-load the nodes that are connected to the "game_users" edge with the given name. The optional arguments are used to configure the query builder of the edge.

type CardSelect

type CardSelect struct {
	*CardQuery
	// contains filtered or unexported fields
}

CardSelect is the builder for selecting fields of Card entities.

func (*CardSelect) Aggregate

func (cs *CardSelect) Aggregate(fns ...AggregateFunc) *CardSelect

Aggregate adds the given aggregation functions to the selector query.

func (*CardSelect) Bool

func (s *CardSelect) Bool(ctx context.Context) (_ bool, err error)

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

func (*CardSelect) BoolX

func (s *CardSelect) BoolX(ctx context.Context) bool

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

func (*CardSelect) Bools

func (s *CardSelect) Bools(ctx context.Context) ([]bool, error)

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

func (*CardSelect) BoolsX

func (s *CardSelect) BoolsX(ctx context.Context) []bool

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

func (*CardSelect) Float64

func (s *CardSelect) Float64(ctx context.Context) (_ float64, err error)

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

func (*CardSelect) Float64X

func (s *CardSelect) Float64X(ctx context.Context) float64

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

func (*CardSelect) Float64s

func (s *CardSelect) Float64s(ctx context.Context) ([]float64, error)

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

func (*CardSelect) Float64sX

func (s *CardSelect) Float64sX(ctx context.Context) []float64

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

func (*CardSelect) Int

func (s *CardSelect) Int(ctx context.Context) (_ int, err error)

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

func (*CardSelect) IntX

func (s *CardSelect) IntX(ctx context.Context) int

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

func (*CardSelect) Ints

func (s *CardSelect) Ints(ctx context.Context) ([]int, error)

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

func (*CardSelect) IntsX

func (s *CardSelect) IntsX(ctx context.Context) []int

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

func (*CardSelect) Scan

func (cs *CardSelect) Scan(ctx context.Context, v any) error

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

func (*CardSelect) ScanX

func (s *CardSelect) ScanX(ctx context.Context, v any)

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

func (*CardSelect) String

func (s *CardSelect) String(ctx context.Context) (_ string, err error)

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

func (*CardSelect) StringX

func (s *CardSelect) StringX(ctx context.Context) string

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

func (*CardSelect) Strings

func (s *CardSelect) Strings(ctx context.Context) ([]string, error)

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

func (*CardSelect) StringsX

func (s *CardSelect) StringsX(ctx context.Context) []string

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

type CardUpdate

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

CardUpdate is the builder for updating Card entities.

func (*CardUpdate) AddCreatedBy

func (cu *CardUpdate) AddCreatedBy(i int64) *CardUpdate

AddCreatedBy adds i to the "created_by" field.

func (*CardUpdate) AddGameUserIDs

func (cu *CardUpdate) AddGameUserIDs(ids ...int64) *CardUpdate

AddGameUserIDs adds the "game_users" edge to the GameUser entity by IDs.

func (*CardUpdate) AddGameUsers

func (cu *CardUpdate) AddGameUsers(g ...*GameUser) *CardUpdate

AddGameUsers adds the "game_users" edges to the GameUser entity.

func (*CardUpdate) AddUpdatedBy

func (cu *CardUpdate) AddUpdatedBy(i int64) *CardUpdate

AddUpdatedBy adds i to the "updated_by" field.

func (*CardUpdate) ClearGameUsers

func (cu *CardUpdate) ClearGameUsers() *CardUpdate

ClearGameUsers clears all "game_users" edges to the GameUser entity.

func (*CardUpdate) Exec

func (cu *CardUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*CardUpdate) ExecX

func (cu *CardUpdate) ExecX(ctx context.Context)

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

func (*CardUpdate) Mutation

func (cu *CardUpdate) Mutation() *CardMutation

Mutation returns the CardMutation object of the builder.

func (*CardUpdate) RemoveGameUserIDs

func (cu *CardUpdate) RemoveGameUserIDs(ids ...int64) *CardUpdate

RemoveGameUserIDs removes the "game_users" edge to GameUser entities by IDs.

func (*CardUpdate) RemoveGameUsers

func (cu *CardUpdate) RemoveGameUsers(g ...*GameUser) *CardUpdate

RemoveGameUsers removes "game_users" edges to GameUser entities.

func (*CardUpdate) Save

func (cu *CardUpdate) Save(ctx context.Context) (int, error)

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

func (*CardUpdate) SaveX

func (cu *CardUpdate) SaveX(ctx context.Context) int

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

func (*CardUpdate) SetCreatedBy

func (cu *CardUpdate) SetCreatedBy(i int64) *CardUpdate

SetCreatedBy sets the "created_by" field.

func (*CardUpdate) SetDeletedAt

func (cu *CardUpdate) SetDeletedAt(t time.Time) *CardUpdate

SetDeletedAt sets the "deleted_at" field.

func (*CardUpdate) SetInput

func (c *CardUpdate) SetInput(i UpdateCardInput) *CardUpdate

SetInput applies the change-set in the UpdateCardInput on the CardUpdate builder.

func (*CardUpdate) SetName

func (cu *CardUpdate) SetName(c card.Name) *CardUpdate

SetName sets the "name" field.

func (*CardUpdate) SetNillableCreatedBy

func (cu *CardUpdate) SetNillableCreatedBy(i *int64) *CardUpdate

SetNillableCreatedBy sets the "created_by" field if the given value is not nil.

func (*CardUpdate) SetNillableDeletedAt

func (cu *CardUpdate) SetNillableDeletedAt(t *time.Time) *CardUpdate

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*CardUpdate) SetNillableName

func (cu *CardUpdate) SetNillableName(c *card.Name) *CardUpdate

SetNillableName sets the "name" field if the given value is not nil.

func (*CardUpdate) SetNillableRed

func (cu *CardUpdate) SetNillableRed(b *bool) *CardUpdate

SetNillableRed sets the "red" field if the given value is not nil.

func (*CardUpdate) SetNillableTale

func (cu *CardUpdate) SetNillableTale(s *string) *CardUpdate

SetNillableTale sets the "tale" field if the given value is not nil.

func (*CardUpdate) SetNillableUpdatedBy

func (cu *CardUpdate) SetNillableUpdatedBy(i *int64) *CardUpdate

SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil.

func (*CardUpdate) SetRed

func (cu *CardUpdate) SetRed(b bool) *CardUpdate

SetRed sets the "red" field.

func (*CardUpdate) SetRole

func (cu *CardUpdate) SetRole(c card.Role) *CardUpdate

SetRole sets the "role" field.

func (*CardUpdate) SetTale

func (cu *CardUpdate) SetTale(s string) *CardUpdate

SetTale sets the "tale" field.

func (*CardUpdate) SetUpdatedAt

func (cu *CardUpdate) SetUpdatedAt(t time.Time) *CardUpdate

SetUpdatedAt sets the "updated_at" field.

func (*CardUpdate) SetUpdatedBy

func (cu *CardUpdate) SetUpdatedBy(i int64) *CardUpdate

SetUpdatedBy sets the "updated_by" field.

func (*CardUpdate) Where

func (cu *CardUpdate) Where(ps ...predicate.Card) *CardUpdate

Where appends a list predicates to the CardUpdate builder.

type CardUpdateOne

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

CardUpdateOne is the builder for updating a single Card entity.

func (*CardUpdateOne) AddCreatedBy

func (cuo *CardUpdateOne) AddCreatedBy(i int64) *CardUpdateOne

AddCreatedBy adds i to the "created_by" field.

func (*CardUpdateOne) AddGameUserIDs

func (cuo *CardUpdateOne) AddGameUserIDs(ids ...int64) *CardUpdateOne

AddGameUserIDs adds the "game_users" edge to the GameUser entity by IDs.

func (*CardUpdateOne) AddGameUsers

func (cuo *CardUpdateOne) AddGameUsers(g ...*GameUser) *CardUpdateOne

AddGameUsers adds the "game_users" edges to the GameUser entity.

func (*CardUpdateOne) AddUpdatedBy

func (cuo *CardUpdateOne) AddUpdatedBy(i int64) *CardUpdateOne

AddUpdatedBy adds i to the "updated_by" field.

func (*CardUpdateOne) ClearGameUsers

func (cuo *CardUpdateOne) ClearGameUsers() *CardUpdateOne

ClearGameUsers clears all "game_users" edges to the GameUser entity.

func (*CardUpdateOne) Exec

func (cuo *CardUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*CardUpdateOne) ExecX

func (cuo *CardUpdateOne) ExecX(ctx context.Context)

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

func (*CardUpdateOne) Mutation

func (cuo *CardUpdateOne) Mutation() *CardMutation

Mutation returns the CardMutation object of the builder.

func (*CardUpdateOne) RemoveGameUserIDs

func (cuo *CardUpdateOne) RemoveGameUserIDs(ids ...int64) *CardUpdateOne

RemoveGameUserIDs removes the "game_users" edge to GameUser entities by IDs.

func (*CardUpdateOne) RemoveGameUsers

func (cuo *CardUpdateOne) RemoveGameUsers(g ...*GameUser) *CardUpdateOne

RemoveGameUsers removes "game_users" edges to GameUser entities.

func (*CardUpdateOne) Save

func (cuo *CardUpdateOne) Save(ctx context.Context) (*Card, error)

Save executes the query and returns the updated Card entity.

func (*CardUpdateOne) SaveX

func (cuo *CardUpdateOne) SaveX(ctx context.Context) *Card

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

func (*CardUpdateOne) Select

func (cuo *CardUpdateOne) Select(field string, fields ...string) *CardUpdateOne

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

func (*CardUpdateOne) SetCreatedBy

func (cuo *CardUpdateOne) SetCreatedBy(i int64) *CardUpdateOne

SetCreatedBy sets the "created_by" field.

func (*CardUpdateOne) SetDeletedAt

func (cuo *CardUpdateOne) SetDeletedAt(t time.Time) *CardUpdateOne

SetDeletedAt sets the "deleted_at" field.

func (*CardUpdateOne) SetInput

SetInput applies the change-set in the UpdateCardInput on the CardUpdateOne builder.

func (*CardUpdateOne) SetName

func (cuo *CardUpdateOne) SetName(c card.Name) *CardUpdateOne

SetName sets the "name" field.

func (*CardUpdateOne) SetNillableCreatedBy

func (cuo *CardUpdateOne) SetNillableCreatedBy(i *int64) *CardUpdateOne

SetNillableCreatedBy sets the "created_by" field if the given value is not nil.

func (*CardUpdateOne) SetNillableDeletedAt

func (cuo *CardUpdateOne) SetNillableDeletedAt(t *time.Time) *CardUpdateOne

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*CardUpdateOne) SetNillableName

func (cuo *CardUpdateOne) SetNillableName(c *card.Name) *CardUpdateOne

SetNillableName sets the "name" field if the given value is not nil.

func (*CardUpdateOne) SetNillableRed

func (cuo *CardUpdateOne) SetNillableRed(b *bool) *CardUpdateOne

SetNillableRed sets the "red" field if the given value is not nil.

func (*CardUpdateOne) SetNillableTale

func (cuo *CardUpdateOne) SetNillableTale(s *string) *CardUpdateOne

SetNillableTale sets the "tale" field if the given value is not nil.

func (*CardUpdateOne) SetNillableUpdatedBy

func (cuo *CardUpdateOne) SetNillableUpdatedBy(i *int64) *CardUpdateOne

SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil.

func (*CardUpdateOne) SetRed

func (cuo *CardUpdateOne) SetRed(b bool) *CardUpdateOne

SetRed sets the "red" field.

func (*CardUpdateOne) SetRole

func (cuo *CardUpdateOne) SetRole(c card.Role) *CardUpdateOne

SetRole sets the "role" field.

func (*CardUpdateOne) SetTale

func (cuo *CardUpdateOne) SetTale(s string) *CardUpdateOne

SetTale sets the "tale" field.

func (*CardUpdateOne) SetUpdatedAt

func (cuo *CardUpdateOne) SetUpdatedAt(t time.Time) *CardUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*CardUpdateOne) SetUpdatedBy

func (cuo *CardUpdateOne) SetUpdatedBy(i int64) *CardUpdateOne

SetUpdatedBy sets the "updated_by" field.

type CardWhereInput

type CardWhereInput struct {
	Predicates []predicate.Card  `json:"-"`
	Not        *CardWhereInput   `json:"not,omitempty"`
	Or         []*CardWhereInput `json:"or,omitempty"`
	And        []*CardWhereInput `json:"and,omitempty"`

	// "id" field predicates.
	ID      *int64  `json:"id,omitempty"`
	IDNEQ   *int64  `json:"idNEQ,omitempty"`
	IDIn    []int64 `json:"idIn,omitempty"`
	IDNotIn []int64 `json:"idNotIn,omitempty"`
	IDGT    *int64  `json:"idGT,omitempty"`
	IDGTE   *int64  `json:"idGTE,omitempty"`
	IDLT    *int64  `json:"idLT,omitempty"`
	IDLTE   *int64  `json:"idLTE,omitempty"`

	// "created_by" field predicates.
	CreatedBy      *int64  `json:"createdBy,omitempty"`
	CreatedByNEQ   *int64  `json:"createdByNEQ,omitempty"`
	CreatedByIn    []int64 `json:"createdByIn,omitempty"`
	CreatedByNotIn []int64 `json:"createdByNotIn,omitempty"`
	CreatedByGT    *int64  `json:"createdByGT,omitempty"`
	CreatedByGTE   *int64  `json:"createdByGTE,omitempty"`
	CreatedByLT    *int64  `json:"createdByLT,omitempty"`
	CreatedByLTE   *int64  `json:"createdByLTE,omitempty"`

	// "updated_by" field predicates.
	UpdatedBy      *int64  `json:"updatedBy,omitempty"`
	UpdatedByNEQ   *int64  `json:"updatedByNEQ,omitempty"`
	UpdatedByIn    []int64 `json:"updatedByIn,omitempty"`
	UpdatedByNotIn []int64 `json:"updatedByNotIn,omitempty"`
	UpdatedByGT    *int64  `json:"updatedByGT,omitempty"`
	UpdatedByGTE   *int64  `json:"updatedByGTE,omitempty"`
	UpdatedByLT    *int64  `json:"updatedByLT,omitempty"`
	UpdatedByLTE   *int64  `json:"updatedByLTE,omitempty"`

	// "created_at" field predicates.
	CreatedAt      *time.Time  `json:"createdAt,omitempty"`
	CreatedAtNEQ   *time.Time  `json:"createdAtNEQ,omitempty"`
	CreatedAtIn    []time.Time `json:"createdAtIn,omitempty"`
	CreatedAtNotIn []time.Time `json:"createdAtNotIn,omitempty"`
	CreatedAtGT    *time.Time  `json:"createdAtGT,omitempty"`
	CreatedAtGTE   *time.Time  `json:"createdAtGTE,omitempty"`
	CreatedAtLT    *time.Time  `json:"createdAtLT,omitempty"`
	CreatedAtLTE   *time.Time  `json:"createdAtLTE,omitempty"`

	// "updated_at" field predicates.
	UpdatedAt      *time.Time  `json:"updatedAt,omitempty"`
	UpdatedAtNEQ   *time.Time  `json:"updatedAtNEQ,omitempty"`
	UpdatedAtIn    []time.Time `json:"updatedAtIn,omitempty"`
	UpdatedAtNotIn []time.Time `json:"updatedAtNotIn,omitempty"`
	UpdatedAtGT    *time.Time  `json:"updatedAtGT,omitempty"`
	UpdatedAtGTE   *time.Time  `json:"updatedAtGTE,omitempty"`
	UpdatedAtLT    *time.Time  `json:"updatedAtLT,omitempty"`
	UpdatedAtLTE   *time.Time  `json:"updatedAtLTE,omitempty"`

	// "deleted_at" field predicates.
	DeletedAt      *time.Time  `json:"deletedAt,omitempty"`
	DeletedAtNEQ   *time.Time  `json:"deletedAtNEQ,omitempty"`
	DeletedAtIn    []time.Time `json:"deletedAtIn,omitempty"`
	DeletedAtNotIn []time.Time `json:"deletedAtNotIn,omitempty"`
	DeletedAtGT    *time.Time  `json:"deletedAtGT,omitempty"`
	DeletedAtGTE   *time.Time  `json:"deletedAtGTE,omitempty"`
	DeletedAtLT    *time.Time  `json:"deletedAtLT,omitempty"`
	DeletedAtLTE   *time.Time  `json:"deletedAtLTE,omitempty"`

	// "name" field predicates.
	Name      *card.Name  `json:"name,omitempty"`
	NameNEQ   *card.Name  `json:"nameNEQ,omitempty"`
	NameIn    []card.Name `json:"nameIn,omitempty"`
	NameNotIn []card.Name `json:"nameNotIn,omitempty"`

	// "role" field predicates.
	Role      *card.Role  `json:"role,omitempty"`
	RoleNEQ   *card.Role  `json:"roleNEQ,omitempty"`
	RoleIn    []card.Role `json:"roleIn,omitempty"`
	RoleNotIn []card.Role `json:"roleNotIn,omitempty"`

	// "tale" field predicates.
	Tale             *string  `json:"tale,omitempty"`
	TaleNEQ          *string  `json:"taleNEQ,omitempty"`
	TaleIn           []string `json:"taleIn,omitempty"`
	TaleNotIn        []string `json:"taleNotIn,omitempty"`
	TaleGT           *string  `json:"taleGT,omitempty"`
	TaleGTE          *string  `json:"taleGTE,omitempty"`
	TaleLT           *string  `json:"taleLT,omitempty"`
	TaleLTE          *string  `json:"taleLTE,omitempty"`
	TaleContains     *string  `json:"taleContains,omitempty"`
	TaleHasPrefix    *string  `json:"taleHasPrefix,omitempty"`
	TaleHasSuffix    *string  `json:"taleHasSuffix,omitempty"`
	TaleEqualFold    *string  `json:"taleEqualFold,omitempty"`
	TaleContainsFold *string  `json:"taleContainsFold,omitempty"`

	// "red" field predicates.
	Red    *bool `json:"red,omitempty"`
	RedNEQ *bool `json:"redNEQ,omitempty"`

	// "game_users" edge predicates.
	HasGameUsers     *bool                 `json:"hasGameUsers,omitempty"`
	HasGameUsersWith []*GameUserWhereInput `json:"hasGameUsersWith,omitempty"`
}

CardWhereInput represents a where input for filtering Card queries.

func (*CardWhereInput) AddPredicates

func (i *CardWhereInput) AddPredicates(predicates ...predicate.Card)

AddPredicates adds custom predicates to the where input to be used during the filtering phase.

func (*CardWhereInput) Filter

func (i *CardWhereInput) Filter(q *CardQuery) (*CardQuery, error)

Filter applies the CardWhereInput filter on the CardQuery builder.

func (*CardWhereInput) P

func (i *CardWhereInput) P() (predicate.Card, error)

P returns a predicate for filtering cards. An error is returned if the input is empty or invalid.

type Cards

type Cards []*Card

Cards is a parsable slice of Card.

type Client

type Client struct {

	// Schema is the client for creating, migrating and dropping schema.
	Schema *migrate.Schema
	// Card is the client for interacting with the Card builders.
	Card *CardClient
	// Game is the client for interacting with the Game builders.
	Game *GameClient
	// GameUser is the client for interacting with the GameUser builders.
	GameUser *GameUserClient
	// Mission is the client for interacting with the Mission builders.
	Mission *MissionClient
	// Record is the client for interacting with the Record builders.
	Record *RecordClient
	// Room is the client for interacting with the Room builders.
	Room *RoomClient
	// RoomUser is the client for interacting with the RoomUser builders.
	RoomUser *RoomUserClient
	// Squad is the client for interacting with the Squad builders.
	Squad *SquadClient
	// Vote is the client for interacting with the Vote builders.
	Vote *VoteClient
	// 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().
	Card.
	Query().
	Count(ctx)

func (*Client) Node

func (c *Client) Node(ctx context.Context, id int64) (*Node, error)

func (*Client) Noder

func (c *Client) Noder(ctx context.Context, id int64, opts ...NodeOption) (_ Noder, err error)

Noder returns a Node by its id. If the NodeType was not provided, it will be derived from the id value according to the universal-id configuration.

c.Noder(ctx, id)
c.Noder(ctx, id, ent.WithNodeType(typeResolver))

func (*Client) Noders

func (c *Client) Noders(ctx context.Context, ids []int64, opts ...NodeOption) ([]Noder, error)

func (*Client) OpenTx

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

OpenTx opens a transaction and returns a transactional context along with the created transaction.

func (*Client) Tx

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

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

func (*Client) Use

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

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

type CommitFunc

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

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

func (CommitFunc) Commit

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

Commit calls f(ctx, m).

type CommitHook

type CommitHook func(Committer) Committer

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

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

type Committer

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

Committer is the interface that wraps the Commit method.

type ConstraintError

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

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

func (ConstraintError) Error

func (e ConstraintError) Error() string

Error implements the error interface.

func (*ConstraintError) Unwrap

func (e *ConstraintError) Unwrap() error

Unwrap implements the errors.Wrapper interface.

type CreateCardInput

type CreateCardInput struct {
	CreatedBy   *int64
	UpdatedBy   *int64
	CreatedAt   *time.Time
	UpdatedAt   *time.Time
	DeletedAt   *time.Time
	Name        *card.Name
	Role        card.Role
	Tale        *string
	Red         *bool
	GameUserIDs []int64
}

CreateCardInput represents a mutation input for creating cards.

func (*CreateCardInput) Mutate

func (i *CreateCardInput) Mutate(m *CardMutation)

Mutate applies the CreateCardInput on the CardMutation builder.

type CreateGameInput

type CreateGameInput struct {
	CreatedBy          *int64
	UpdatedBy          *int64
	CreatedAt          *time.Time
	UpdatedAt          *time.Time
	DeletedAt          *time.Time
	Result             *game.Result
	Capacity           *uint8
	TheAssassinatedIds []string
	AssassinChance     *uint8
	Closed             *bool
	GameUserIDs        []int64
	MissionIDs         []int64
	RoomID             int64
}

CreateGameInput represents a mutation input for creating games.

func (*CreateGameInput) Mutate

func (i *CreateGameInput) Mutate(m *GameMutation)

Mutate applies the CreateGameInput on the GameMutation builder.

type CreateGameUserInput

type CreateGameUserInput struct {
	CreatedBy *int64
	UpdatedBy *int64
	CreatedAt *time.Time
	UpdatedAt *time.Time
	DeletedAt *time.Time
	UserID    int64
	Number    uint8
	Exited    *bool
	GameID    int64
	CardID    int64
}

CreateGameUserInput represents a mutation input for creating gameusers.

func (*CreateGameUserInput) Mutate

func (i *CreateGameUserInput) Mutate(m *GameUserMutation)

Mutate applies the CreateGameUserInput on the GameUserMutation builder.

type CreateMissionInput

type CreateMissionInput struct {
	CreatedBy *int64
	UpdatedBy *int64
	CreatedAt *time.Time
	UpdatedAt *time.Time
	DeletedAt *time.Time
	Sequence  uint8
	Status    *mission.Status
	Failed    *bool
	Capacity  *uint8
	LeaderID  *int64
	Protected *bool
	GameID    int64
	SquadIDs  []int64
	VoteIDs   []int64
}

CreateMissionInput represents a mutation input for creating missions.

func (*CreateMissionInput) Mutate

func (i *CreateMissionInput) Mutate(m *MissionMutation)

Mutate applies the CreateMissionInput on the MissionMutation builder.

type CreateRecordInput

type CreateRecordInput struct {
	CreatedBy *int64
	UpdatedBy *int64
	CreatedAt *time.Time
	UpdatedAt *time.Time
	DeletedAt *time.Time
	UserID    int64
	Score     *int32
	RoomID    int64
}

CreateRecordInput represents a mutation input for creating records.

func (*CreateRecordInput) Mutate

func (i *CreateRecordInput) Mutate(m *RecordMutation)

Mutate applies the CreateRecordInput on the RecordMutation builder.

type CreateRoomInput

type CreateRoomInput struct {
	CreatedBy   *int64
	UpdatedBy   *int64
	CreatedAt   *time.Time
	UpdatedAt   *time.Time
	DeletedAt   *time.Time
	Name        *string
	Closed      *bool
	GameOn      *bool
	RoomUserIDs []int64
	GameIDs     []int64
	RecordIDs   []int64
}

CreateRoomInput represents a mutation input for creating rooms.

func (*CreateRoomInput) Mutate

func (i *CreateRoomInput) Mutate(m *RoomMutation)

Mutate applies the CreateRoomInput on the RoomMutation builder.

type CreateRoomUserInput

type CreateRoomUserInput struct {
	CreatedBy *int64
	UpdatedBy *int64
	CreatedAt *time.Time
	UpdatedAt *time.Time
	DeletedAt *time.Time
	UserID    int64
	Host      *bool
	RoomID    int64
}

CreateRoomUserInput represents a mutation input for creating roomusers.

func (*CreateRoomUserInput) Mutate

func (i *CreateRoomUserInput) Mutate(m *RoomUserMutation)

Mutate applies the CreateRoomUserInput on the RoomUserMutation builder.

type CreateSquadInput

type CreateSquadInput struct {
	CreatedBy *int64
	UpdatedBy *int64
	CreatedAt *time.Time
	UpdatedAt *time.Time
	DeletedAt *time.Time
	UserID    int64
	Rat       *bool
	Acted     *bool
	MissionID int64
}

CreateSquadInput represents a mutation input for creating squads.

func (*CreateSquadInput) Mutate

func (i *CreateSquadInput) Mutate(m *SquadMutation)

Mutate applies the CreateSquadInput on the SquadMutation builder.

type CreateVoteInput

type CreateVoteInput struct {
	CreatedBy *int64
	UpdatedBy *int64
	CreatedAt *time.Time
	UpdatedAt *time.Time
	DeletedAt *time.Time
	UserID    int64
	Pass      *bool
	Voted     *bool
	MissionID int64
}

CreateVoteInput represents a mutation input for creating votes.

func (*CreateVoteInput) Mutate

func (i *CreateVoteInput) Mutate(m *VoteMutation)

Mutate applies the CreateVoteInput on the VoteMutation builder.

type Cursor

type Cursor struct {
	ID    int64 `msgpack:"i"`
	Value Value `msgpack:"v,omitempty"`
}

Cursor of an edge type.

func (Cursor) MarshalGQL

func (c Cursor) MarshalGQL(w io.Writer)

MarshalGQL implements graphql.Marshaler interface.

func (*Cursor) UnmarshalGQL

func (c *Cursor) UnmarshalGQL(v interface{}) error

UnmarshalGQL implements graphql.Unmarshaler interface.

type Edge

type Edge struct {
	Type string  `json:"type,omitempty"` // edge type.
	Name string  `json:"name,omitempty"` // edge name.
	IDs  []int64 `json:"ids,omitempty"`  // node ids (where this edge point to).
}

Edges between two nodes.

type Field

type Field struct {
	Type  string `json:"type,omitempty"`  // field type.
	Name  string `json:"name,omitempty"`  // field name (as in struct).
	Value string `json:"value,omitempty"` // stringified value.
}

Field of a node.

type Game

type Game struct {

	// ID of the ent.
	ID int64 `json:"id,omitempty"`
	// CreatedBy holds the value of the "created_by" field.
	CreatedBy int64 `json:"created_by"`
	// UpdatedBy holds the value of the "updated_by" field.
	UpdatedBy int64 `json:"updated_by"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at"`
	// UpdatedAt holds the value of the "updated_at" field.
	UpdatedAt time.Time `json:"updated_at"`
	// DeletedAt holds the value of the "deleted_at" field.
	DeletedAt time.Time `json:"deleted_at"`
	// 所属房间 ID
	RoomID int64 `json:"room_id"`
	// 游戏结果
	Result game.Result `json:"result"`
	// 游戏人数
	Capacity uint8 `json:"capacity"`
	// 被刺杀者[们] ID
	TheAssassinatedIds []string `json:"the_assassinated_ids"`
	// 刺杀机会,默认为 1 次
	AssassinChance uint8 `json:"assassin_chance"`
	// 游戏是否关闭,需要有结果且所有人都退出才会关闭或者强制关闭
	Closed bool `json:"closed"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the GameQuery when eager-loading is set.
	Edges GameEdges `json:"edges"`
	// contains filtered or unexported fields
}

Game is the model entity for the Game schema.

func (*Game) GameUsers

func (ga *Game) GameUsers(ctx context.Context) (result []*GameUser, err error)

func (Game) IsEntity

func (ga Game) IsEntity()

IsEntity implement fedruntime.Entity

func (*Game) Missions

func (ga *Game) Missions(ctx context.Context) (result []*Mission, err error)

func (*Game) NamedGameUsers

func (ga *Game) NamedGameUsers(name string) ([]*GameUser, error)

NamedGameUsers returns the GameUsers named value or an error if the edge was not loaded in eager-loading with this name.

func (*Game) NamedMissions

func (ga *Game) NamedMissions(name string) ([]*Mission, error)

NamedMissions returns the Missions named value or an error if the edge was not loaded in eager-loading with this name.

func (*Game) Node

func (ga *Game) Node(ctx context.Context) (node *Node, err error)

func (*Game) QueryGameUsers

func (ga *Game) QueryGameUsers() *GameUserQuery

QueryGameUsers queries the "game_users" edge of the Game entity.

func (*Game) QueryMissions

func (ga *Game) QueryMissions() *MissionQuery

QueryMissions queries the "missions" edge of the Game entity.

func (*Game) QueryRoom

func (ga *Game) QueryRoom() *RoomQuery

QueryRoom queries the "room" edge of the Game entity.

func (*Game) Room

func (ga *Game) Room(ctx context.Context) (*Room, error)

func (*Game) String

func (ga *Game) String() string

String implements the fmt.Stringer.

func (*Game) ToEdge

func (ga *Game) ToEdge(order *GameOrder) *GameEdge

ToEdge converts Game into GameEdge.

func (*Game) Unwrap

func (ga *Game) Unwrap() *Game

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

func (ga *Game) Update() *GameUpdateOne

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

type GameClient

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

GameClient is a client for the Game schema.

func NewGameClient

func NewGameClient(c config) *GameClient

NewGameClient returns a client for the Game from the given config.

func (*GameClient) Create

func (c *GameClient) Create() *GameCreate

Create returns a builder for creating a Game entity.

func (*GameClient) CreateBulk

func (c *GameClient) CreateBulk(builders ...*GameCreate) *GameCreateBulk

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

func (*GameClient) Delete

func (c *GameClient) Delete() *GameDelete

Delete returns a delete builder for Game.

func (*GameClient) DeleteOne

func (c *GameClient) DeleteOne(ga *Game) *GameDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*GameClient) DeleteOneID

func (c *GameClient) DeleteOneID(id int64) *GameDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*GameClient) Get

func (c *GameClient) Get(ctx context.Context, id int64) (*Game, error)

Get returns a Game entity by its id.

func (*GameClient) GetX

func (c *GameClient) GetX(ctx context.Context, id int64) *Game

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

func (*GameClient) Hooks

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

Hooks returns the client hooks.

func (*GameClient) Query

func (c *GameClient) Query() *GameQuery

Query returns a query builder for Game.

func (*GameClient) QueryGameUsers

func (c *GameClient) QueryGameUsers(ga *Game) *GameUserQuery

QueryGameUsers queries the game_users edge of a Game.

func (*GameClient) QueryMissions

func (c *GameClient) QueryMissions(ga *Game) *MissionQuery

QueryMissions queries the missions edge of a Game.

func (*GameClient) QueryRoom

func (c *GameClient) QueryRoom(ga *Game) *RoomQuery

QueryRoom queries the room edge of a Game.

func (*GameClient) Update

func (c *GameClient) Update() *GameUpdate

Update returns an update builder for Game.

func (*GameClient) UpdateOne

func (c *GameClient) UpdateOne(ga *Game) *GameUpdateOne

UpdateOne returns an update builder for the given entity.

func (*GameClient) UpdateOneID

func (c *GameClient) UpdateOneID(id int64) *GameUpdateOne

UpdateOneID returns an update builder for the given id.

func (*GameClient) Use

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

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

type GameConnection

type GameConnection struct {
	Edges      []*GameEdge `json:"edges"`
	PageInfo   PageInfo    `json:"pageInfo"`
	TotalCount int         `json:"totalCount"`
}

GameConnection is the connection containing edges to Game.

type GameCreate

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

GameCreate is the builder for creating a Game entity.

func (*GameCreate) AddGameUserIDs

func (gc *GameCreate) AddGameUserIDs(ids ...int64) *GameCreate

AddGameUserIDs adds the "game_users" edge to the GameUser entity by IDs.

func (*GameCreate) AddGameUsers

func (gc *GameCreate) AddGameUsers(g ...*GameUser) *GameCreate

AddGameUsers adds the "game_users" edges to the GameUser entity.

func (*GameCreate) AddMissionIDs

func (gc *GameCreate) AddMissionIDs(ids ...int64) *GameCreate

AddMissionIDs adds the "missions" edge to the Mission entity by IDs.

func (*GameCreate) AddMissions

func (gc *GameCreate) AddMissions(m ...*Mission) *GameCreate

AddMissions adds the "missions" edges to the Mission entity.

func (*GameCreate) Exec

func (gc *GameCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*GameCreate) ExecX

func (gc *GameCreate) ExecX(ctx context.Context)

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

func (*GameCreate) Mutation

func (gc *GameCreate) Mutation() *GameMutation

Mutation returns the GameMutation object of the builder.

func (*GameCreate) Save

func (gc *GameCreate) Save(ctx context.Context) (*Game, error)

Save creates the Game in the database.

func (*GameCreate) SaveX

func (gc *GameCreate) SaveX(ctx context.Context) *Game

SaveX calls Save and panics if Save returns an error.

func (*GameCreate) SetAssassinChance

func (gc *GameCreate) SetAssassinChance(u uint8) *GameCreate

SetAssassinChance sets the "assassin_chance" field.

func (*GameCreate) SetCapacity

func (gc *GameCreate) SetCapacity(u uint8) *GameCreate

SetCapacity sets the "capacity" field.

func (*GameCreate) SetClosed

func (gc *GameCreate) SetClosed(b bool) *GameCreate

SetClosed sets the "closed" field.

func (*GameCreate) SetCreatedAt

func (gc *GameCreate) SetCreatedAt(t time.Time) *GameCreate

SetCreatedAt sets the "created_at" field.

func (*GameCreate) SetCreatedBy

func (gc *GameCreate) SetCreatedBy(i int64) *GameCreate

SetCreatedBy sets the "created_by" field.

func (*GameCreate) SetDeletedAt

func (gc *GameCreate) SetDeletedAt(t time.Time) *GameCreate

SetDeletedAt sets the "deleted_at" field.

func (*GameCreate) SetID

func (gc *GameCreate) SetID(i int64) *GameCreate

SetID sets the "id" field.

func (*GameCreate) SetInput

func (c *GameCreate) SetInput(i CreateGameInput) *GameCreate

SetInput applies the change-set in the CreateGameInput on the GameCreate builder.

func (*GameCreate) SetNillableAssassinChance

func (gc *GameCreate) SetNillableAssassinChance(u *uint8) *GameCreate

SetNillableAssassinChance sets the "assassin_chance" field if the given value is not nil.

func (*GameCreate) SetNillableCapacity

func (gc *GameCreate) SetNillableCapacity(u *uint8) *GameCreate

SetNillableCapacity sets the "capacity" field if the given value is not nil.

func (*GameCreate) SetNillableClosed

func (gc *GameCreate) SetNillableClosed(b *bool) *GameCreate

SetNillableClosed sets the "closed" field if the given value is not nil.

func (*GameCreate) SetNillableCreatedAt

func (gc *GameCreate) SetNillableCreatedAt(t *time.Time) *GameCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*GameCreate) SetNillableCreatedBy

func (gc *GameCreate) SetNillableCreatedBy(i *int64) *GameCreate

SetNillableCreatedBy sets the "created_by" field if the given value is not nil.

func (*GameCreate) SetNillableDeletedAt

func (gc *GameCreate) SetNillableDeletedAt(t *time.Time) *GameCreate

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*GameCreate) SetNillableID

func (gc *GameCreate) SetNillableID(i *int64) *GameCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*GameCreate) SetNillableResult

func (gc *GameCreate) SetNillableResult(ga *game.Result) *GameCreate

SetNillableResult sets the "result" field if the given value is not nil.

func (*GameCreate) SetNillableUpdatedAt

func (gc *GameCreate) SetNillableUpdatedAt(t *time.Time) *GameCreate

SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.

func (*GameCreate) SetNillableUpdatedBy

func (gc *GameCreate) SetNillableUpdatedBy(i *int64) *GameCreate

SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil.

func (*GameCreate) SetResult

func (gc *GameCreate) SetResult(ga game.Result) *GameCreate

SetResult sets the "result" field.

func (*GameCreate) SetRoom

func (gc *GameCreate) SetRoom(r *Room) *GameCreate

SetRoom sets the "room" edge to the Room entity.

func (*GameCreate) SetRoomID

func (gc *GameCreate) SetRoomID(i int64) *GameCreate

SetRoomID sets the "room_id" field.

func (*GameCreate) SetTheAssassinatedIds

func (gc *GameCreate) SetTheAssassinatedIds(s []string) *GameCreate

SetTheAssassinatedIds sets the "the_assassinated_ids" field.

func (*GameCreate) SetUpdatedAt

func (gc *GameCreate) SetUpdatedAt(t time.Time) *GameCreate

SetUpdatedAt sets the "updated_at" field.

func (*GameCreate) SetUpdatedBy

func (gc *GameCreate) SetUpdatedBy(i int64) *GameCreate

SetUpdatedBy sets the "updated_by" field.

type GameCreateBulk

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

GameCreateBulk is the builder for creating many Game entities in bulk.

func (*GameCreateBulk) Exec

func (gcb *GameCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*GameCreateBulk) ExecX

func (gcb *GameCreateBulk) ExecX(ctx context.Context)

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

func (*GameCreateBulk) Save

func (gcb *GameCreateBulk) Save(ctx context.Context) ([]*Game, error)

Save creates the Game entities in the database.

func (*GameCreateBulk) SaveX

func (gcb *GameCreateBulk) SaveX(ctx context.Context) []*Game

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

type GameDelete

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

GameDelete is the builder for deleting a Game entity.

func (*GameDelete) Exec

func (gd *GameDelete) Exec(ctx context.Context) (int, error)

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

func (*GameDelete) ExecX

func (gd *GameDelete) ExecX(ctx context.Context) int

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

func (*GameDelete) Where

func (gd *GameDelete) Where(ps ...predicate.Game) *GameDelete

Where appends a list predicates to the GameDelete builder.

type GameDeleteOne

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

GameDeleteOne is the builder for deleting a single Game entity.

func (*GameDeleteOne) Exec

func (gdo *GameDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*GameDeleteOne) ExecX

func (gdo *GameDeleteOne) ExecX(ctx context.Context)

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

type GameEdge

type GameEdge struct {
	Node   *Game  `json:"node"`
	Cursor Cursor `json:"cursor"`
}

GameEdge is the edge representation of Game.

type GameEdges

type GameEdges struct {
	// GameUsers holds the value of the game_users edge.
	GameUsers []*GameUser `json:"game_users,omitempty"`
	// Missions holds the value of the missions edge.
	Missions []*Mission `json:"missions,omitempty"`
	// Room holds the value of the room edge.
	Room *Room `json:"room,omitempty"`
	// contains filtered or unexported fields
}

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

func (GameEdges) GameUsersOrErr

func (e GameEdges) GameUsersOrErr() ([]*GameUser, error)

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

func (GameEdges) MissionsOrErr

func (e GameEdges) MissionsOrErr() ([]*Mission, error)

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

func (GameEdges) RoomOrErr

func (e GameEdges) RoomOrErr() (*Room, error)

RoomOrErr returns the Room value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

type GameGroupBy

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

GameGroupBy is the group-by builder for Game entities.

func (*GameGroupBy) Aggregate

func (ggb *GameGroupBy) Aggregate(fns ...AggregateFunc) *GameGroupBy

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

func (*GameGroupBy) Bool

func (s *GameGroupBy) Bool(ctx context.Context) (_ bool, err error)

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

func (*GameGroupBy) BoolX

func (s *GameGroupBy) BoolX(ctx context.Context) bool

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

func (*GameGroupBy) Bools

func (s *GameGroupBy) Bools(ctx context.Context) ([]bool, error)

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

func (*GameGroupBy) BoolsX

func (s *GameGroupBy) BoolsX(ctx context.Context) []bool

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

func (*GameGroupBy) Float64

func (s *GameGroupBy) Float64(ctx context.Context) (_ float64, err error)

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

func (*GameGroupBy) Float64X

func (s *GameGroupBy) Float64X(ctx context.Context) float64

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

func (*GameGroupBy) Float64s

func (s *GameGroupBy) Float64s(ctx context.Context) ([]float64, error)

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

func (*GameGroupBy) Float64sX

func (s *GameGroupBy) Float64sX(ctx context.Context) []float64

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

func (*GameGroupBy) Int

func (s *GameGroupBy) Int(ctx context.Context) (_ int, err error)

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

func (*GameGroupBy) IntX

func (s *GameGroupBy) IntX(ctx context.Context) int

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

func (*GameGroupBy) Ints

func (s *GameGroupBy) Ints(ctx context.Context) ([]int, error)

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

func (*GameGroupBy) IntsX

func (s *GameGroupBy) IntsX(ctx context.Context) []int

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

func (*GameGroupBy) Scan

func (ggb *GameGroupBy) Scan(ctx context.Context, v any) error

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

func (*GameGroupBy) ScanX

func (s *GameGroupBy) ScanX(ctx context.Context, v any)

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

func (*GameGroupBy) String

func (s *GameGroupBy) String(ctx context.Context) (_ string, err error)

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

func (*GameGroupBy) StringX

func (s *GameGroupBy) StringX(ctx context.Context) string

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

func (*GameGroupBy) Strings

func (s *GameGroupBy) Strings(ctx context.Context) ([]string, error)

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

func (*GameGroupBy) StringsX

func (s *GameGroupBy) StringsX(ctx context.Context) []string

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

type GameMutation

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

GameMutation represents an operation that mutates the Game nodes in the graph.

func (*GameMutation) AddAssassinChance

func (m *GameMutation) AddAssassinChance(u int8)

AddAssassinChance adds u to the "assassin_chance" field.

func (*GameMutation) AddCapacity

func (m *GameMutation) AddCapacity(u int8)

AddCapacity adds u to the "capacity" field.

func (*GameMutation) AddCreatedBy

func (m *GameMutation) AddCreatedBy(i int64)

AddCreatedBy adds i to the "created_by" field.

func (*GameMutation) AddField

func (m *GameMutation) 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 (*GameMutation) AddGameUserIDs

func (m *GameMutation) AddGameUserIDs(ids ...int64)

AddGameUserIDs adds the "game_users" edge to the GameUser entity by ids.

func (*GameMutation) AddMissionIDs

func (m *GameMutation) AddMissionIDs(ids ...int64)

AddMissionIDs adds the "missions" edge to the Mission entity by ids.

func (*GameMutation) AddUpdatedBy

func (m *GameMutation) AddUpdatedBy(i int64)

AddUpdatedBy adds i to the "updated_by" field.

func (*GameMutation) AddedAssassinChance

func (m *GameMutation) AddedAssassinChance() (r int8, exists bool)

AddedAssassinChance returns the value that was added to the "assassin_chance" field in this mutation.

func (*GameMutation) AddedCapacity

func (m *GameMutation) AddedCapacity() (r int8, exists bool)

AddedCapacity returns the value that was added to the "capacity" field in this mutation.

func (*GameMutation) AddedCreatedBy

func (m *GameMutation) AddedCreatedBy() (r int64, exists bool)

AddedCreatedBy returns the value that was added to the "created_by" field in this mutation.

func (*GameMutation) AddedEdges

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

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

func (*GameMutation) AddedField

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

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

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

func (*GameMutation) AddedIDs

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

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

func (*GameMutation) AddedUpdatedBy

func (m *GameMutation) AddedUpdatedBy() (r int64, exists bool)

AddedUpdatedBy returns the value that was added to the "updated_by" field in this mutation.

func (*GameMutation) AppendTheAssassinatedIds

func (m *GameMutation) AppendTheAssassinatedIds(s []string)

AppendTheAssassinatedIds adds s to the "the_assassinated_ids" field.

func (*GameMutation) AppendedTheAssassinatedIds

func (m *GameMutation) AppendedTheAssassinatedIds() ([]string, bool)

AppendedTheAssassinatedIds returns the list of values that were appended to the "the_assassinated_ids" field in this mutation.

func (*GameMutation) AssassinChance

func (m *GameMutation) AssassinChance() (r uint8, exists bool)

AssassinChance returns the value of the "assassin_chance" field in the mutation.

func (*GameMutation) Capacity

func (m *GameMutation) Capacity() (r uint8, exists bool)

Capacity returns the value of the "capacity" field in the mutation.

func (*GameMutation) ClearEdge

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

func (m *GameMutation) 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 (*GameMutation) ClearGameUsers

func (m *GameMutation) ClearGameUsers()

ClearGameUsers clears the "game_users" edge to the GameUser entity.

func (*GameMutation) ClearMissions

func (m *GameMutation) ClearMissions()

ClearMissions clears the "missions" edge to the Mission entity.

func (*GameMutation) ClearRoom

func (m *GameMutation) ClearRoom()

ClearRoom clears the "room" edge to the Room entity.

func (*GameMutation) ClearTheAssassinatedIds

func (m *GameMutation) ClearTheAssassinatedIds()

ClearTheAssassinatedIds clears the value of the "the_assassinated_ids" field.

func (*GameMutation) ClearedEdges

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

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

func (*GameMutation) ClearedFields

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

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

func (GameMutation) Client

func (m GameMutation) 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 (*GameMutation) Closed

func (m *GameMutation) Closed() (r bool, exists bool)

Closed returns the value of the "closed" field in the mutation.

func (*GameMutation) CreatedAt

func (m *GameMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*GameMutation) CreatedBy

func (m *GameMutation) CreatedBy() (r int64, exists bool)

CreatedBy returns the value of the "created_by" field in the mutation.

func (*GameMutation) DeletedAt

func (m *GameMutation) DeletedAt() (r time.Time, exists bool)

DeletedAt returns the value of the "deleted_at" field in the mutation.

func (*GameMutation) EdgeCleared

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

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

func (*GameMutation) Field

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

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

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

func (*GameMutation) Fields

func (m *GameMutation) 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 (*GameMutation) GameUsersCleared

func (m *GameMutation) GameUsersCleared() bool

GameUsersCleared reports if the "game_users" edge to the GameUser entity was cleared.

func (*GameMutation) GameUsersIDs

func (m *GameMutation) GameUsersIDs() (ids []int64)

GameUsersIDs returns the "game_users" edge IDs in the mutation.

func (*GameMutation) ID

func (m *GameMutation) ID() (id int64, 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 (*GameMutation) IDs

func (m *GameMutation) IDs(ctx context.Context) ([]int64, error)

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

func (*GameMutation) MissionsCleared

func (m *GameMutation) MissionsCleared() bool

MissionsCleared reports if the "missions" edge to the Mission entity was cleared.

func (*GameMutation) MissionsIDs

func (m *GameMutation) MissionsIDs() (ids []int64)

MissionsIDs returns the "missions" edge IDs in the mutation.

func (*GameMutation) OldAssassinChance

func (m *GameMutation) OldAssassinChance(ctx context.Context) (v uint8, err error)

OldAssassinChance returns the old "assassin_chance" field's value of the Game entity. If the Game 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 (*GameMutation) OldCapacity

func (m *GameMutation) OldCapacity(ctx context.Context) (v uint8, err error)

OldCapacity returns the old "capacity" field's value of the Game entity. If the Game 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 (*GameMutation) OldClosed

func (m *GameMutation) OldClosed(ctx context.Context) (v bool, err error)

OldClosed returns the old "closed" field's value of the Game entity. If the Game 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 (*GameMutation) OldCreatedAt

func (m *GameMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the Game entity. If the Game 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 (*GameMutation) OldCreatedBy

func (m *GameMutation) OldCreatedBy(ctx context.Context) (v int64, err error)

OldCreatedBy returns the old "created_by" field's value of the Game entity. If the Game 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 (*GameMutation) OldDeletedAt

func (m *GameMutation) OldDeletedAt(ctx context.Context) (v time.Time, err error)

OldDeletedAt returns the old "deleted_at" field's value of the Game entity. If the Game 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 (*GameMutation) OldField

func (m *GameMutation) 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 (*GameMutation) OldResult

func (m *GameMutation) OldResult(ctx context.Context) (v game.Result, err error)

OldResult returns the old "result" field's value of the Game entity. If the Game 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 (*GameMutation) OldRoomID

func (m *GameMutation) OldRoomID(ctx context.Context) (v int64, err error)

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

func (m *GameMutation) OldTheAssassinatedIds(ctx context.Context) (v []string, err error)

OldTheAssassinatedIds returns the old "the_assassinated_ids" field's value of the Game entity. If the Game 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 (*GameMutation) OldUpdatedAt

func (m *GameMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)

OldUpdatedAt returns the old "updated_at" field's value of the Game entity. If the Game 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 (*GameMutation) OldUpdatedBy

func (m *GameMutation) OldUpdatedBy(ctx context.Context) (v int64, err error)

OldUpdatedBy returns the old "updated_by" field's value of the Game entity. If the Game 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 (*GameMutation) Op

func (m *GameMutation) Op() Op

Op returns the operation name.

func (*GameMutation) RemoveGameUserIDs

func (m *GameMutation) RemoveGameUserIDs(ids ...int64)

RemoveGameUserIDs removes the "game_users" edge to the GameUser entity by IDs.

func (*GameMutation) RemoveMissionIDs

func (m *GameMutation) RemoveMissionIDs(ids ...int64)

RemoveMissionIDs removes the "missions" edge to the Mission entity by IDs.

func (*GameMutation) RemovedEdges

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

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

func (*GameMutation) RemovedGameUsersIDs

func (m *GameMutation) RemovedGameUsersIDs() (ids []int64)

RemovedGameUsers returns the removed IDs of the "game_users" edge to the GameUser entity.

func (*GameMutation) RemovedIDs

func (m *GameMutation) 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 (*GameMutation) RemovedMissionsIDs

func (m *GameMutation) RemovedMissionsIDs() (ids []int64)

RemovedMissions returns the removed IDs of the "missions" edge to the Mission entity.

func (*GameMutation) ResetAssassinChance

func (m *GameMutation) ResetAssassinChance()

ResetAssassinChance resets all changes to the "assassin_chance" field.

func (*GameMutation) ResetCapacity

func (m *GameMutation) ResetCapacity()

ResetCapacity resets all changes to the "capacity" field.

func (*GameMutation) ResetClosed

func (m *GameMutation) ResetClosed()

ResetClosed resets all changes to the "closed" field.

func (*GameMutation) ResetCreatedAt

func (m *GameMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*GameMutation) ResetCreatedBy

func (m *GameMutation) ResetCreatedBy()

ResetCreatedBy resets all changes to the "created_by" field.

func (*GameMutation) ResetDeletedAt

func (m *GameMutation) ResetDeletedAt()

ResetDeletedAt resets all changes to the "deleted_at" field.

func (*GameMutation) ResetEdge

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

func (m *GameMutation) 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 (*GameMutation) ResetGameUsers

func (m *GameMutation) ResetGameUsers()

ResetGameUsers resets all changes to the "game_users" edge.

func (*GameMutation) ResetMissions

func (m *GameMutation) ResetMissions()

ResetMissions resets all changes to the "missions" edge.

func (*GameMutation) ResetResult

func (m *GameMutation) ResetResult()

ResetResult resets all changes to the "result" field.

func (*GameMutation) ResetRoom

func (m *GameMutation) ResetRoom()

ResetRoom resets all changes to the "room" edge.

func (*GameMutation) ResetRoomID

func (m *GameMutation) ResetRoomID()

ResetRoomID resets all changes to the "room_id" field.

func (*GameMutation) ResetTheAssassinatedIds

func (m *GameMutation) ResetTheAssassinatedIds()

ResetTheAssassinatedIds resets all changes to the "the_assassinated_ids" field.

func (*GameMutation) ResetUpdatedAt

func (m *GameMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*GameMutation) ResetUpdatedBy

func (m *GameMutation) ResetUpdatedBy()

ResetUpdatedBy resets all changes to the "updated_by" field.

func (*GameMutation) Result

func (m *GameMutation) Result() (r game.Result, exists bool)

Result returns the value of the "result" field in the mutation.

func (*GameMutation) RoomCleared

func (m *GameMutation) RoomCleared() bool

RoomCleared reports if the "room" edge to the Room entity was cleared.

func (*GameMutation) RoomID

func (m *GameMutation) RoomID() (r int64, exists bool)

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

func (*GameMutation) RoomIDs

func (m *GameMutation) RoomIDs() (ids []int64)

RoomIDs returns the "room" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use RoomID instead. It exists only for internal usage by the builders.

func (*GameMutation) SetAssassinChance

func (m *GameMutation) SetAssassinChance(u uint8)

SetAssassinChance sets the "assassin_chance" field.

func (*GameMutation) SetCapacity

func (m *GameMutation) SetCapacity(u uint8)

SetCapacity sets the "capacity" field.

func (*GameMutation) SetClosed

func (m *GameMutation) SetClosed(b bool)

SetClosed sets the "closed" field.

func (*GameMutation) SetCreatedAt

func (m *GameMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*GameMutation) SetCreatedBy

func (m *GameMutation) SetCreatedBy(i int64)

SetCreatedBy sets the "created_by" field.

func (*GameMutation) SetDeletedAt

func (m *GameMutation) SetDeletedAt(t time.Time)

SetDeletedAt sets the "deleted_at" field.

func (*GameMutation) SetField

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

func (m *GameMutation) SetID(id int64)

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

func (*GameMutation) SetResult

func (m *GameMutation) SetResult(ga game.Result)

SetResult sets the "result" field.

func (*GameMutation) SetRoomID

func (m *GameMutation) SetRoomID(i int64)

SetRoomID sets the "room_id" field.

func (*GameMutation) SetTheAssassinatedIds

func (m *GameMutation) SetTheAssassinatedIds(s []string)

SetTheAssassinatedIds sets the "the_assassinated_ids" field.

func (*GameMutation) SetUpdatedAt

func (m *GameMutation) SetUpdatedAt(t time.Time)

SetUpdatedAt sets the "updated_at" field.

func (*GameMutation) SetUpdatedBy

func (m *GameMutation) SetUpdatedBy(i int64)

SetUpdatedBy sets the "updated_by" field.

func (*GameMutation) TheAssassinatedIds

func (m *GameMutation) TheAssassinatedIds() (r []string, exists bool)

TheAssassinatedIds returns the value of the "the_assassinated_ids" field in the mutation.

func (*GameMutation) TheAssassinatedIdsCleared

func (m *GameMutation) TheAssassinatedIdsCleared() bool

TheAssassinatedIdsCleared returns if the "the_assassinated_ids" field was cleared in this mutation.

func (GameMutation) Tx

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

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

func (*GameMutation) Type

func (m *GameMutation) Type() string

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

func (*GameMutation) UpdatedAt

func (m *GameMutation) UpdatedAt() (r time.Time, exists bool)

UpdatedAt returns the value of the "updated_at" field in the mutation.

func (*GameMutation) UpdatedBy

func (m *GameMutation) UpdatedBy() (r int64, exists bool)

UpdatedBy returns the value of the "updated_by" field in the mutation.

func (*GameMutation) Where

func (m *GameMutation) Where(ps ...predicate.Game)

Where appends a list predicates to the GameMutation builder.

type GameOrder

type GameOrder struct {
	Direction OrderDirection  `json:"direction"`
	Field     *GameOrderField `json:"field"`
}

GameOrder defines the ordering of Game.

type GameOrderField

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

GameOrderField defines the ordering field of Game.

func (GameOrderField) MarshalGQL

func (f GameOrderField) MarshalGQL(w io.Writer)

MarshalGQL implements graphql.Marshaler interface.

func (GameOrderField) String

func (f GameOrderField) String() string

String implement fmt.Stringer interface.

func (*GameOrderField) UnmarshalGQL

func (f *GameOrderField) UnmarshalGQL(v interface{}) error

UnmarshalGQL implements graphql.Unmarshaler interface.

type GamePaginateOption

type GamePaginateOption func(*gamePager) error

GamePaginateOption enables pagination customization.

func WithGameFilter

func WithGameFilter(filter func(*GameQuery) (*GameQuery, error)) GamePaginateOption

WithGameFilter configures pagination filter.

func WithGameOrder

func WithGameOrder(order *GameOrder) GamePaginateOption

WithGameOrder configures pagination ordering.

type GameQuery

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

GameQuery is the builder for querying Game entities.

func (*GameQuery) Aggregate

func (gq *GameQuery) Aggregate(fns ...AggregateFunc) *GameSelect

Aggregate returns a GameSelect configured with the given aggregations.

func (*GameQuery) All

func (gq *GameQuery) All(ctx context.Context) ([]*Game, error)

All executes the query and returns a list of Games.

func (*GameQuery) AllX

func (gq *GameQuery) AllX(ctx context.Context) []*Game

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

func (*GameQuery) Clone

func (gq *GameQuery) Clone() *GameQuery

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

func (*GameQuery) CollectFields

func (ga *GameQuery) CollectFields(ctx context.Context, satisfies ...string) (*GameQuery, error)

CollectFields tells the query-builder to eagerly load connected nodes by resolver context.

func (*GameQuery) Count

func (gq *GameQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*GameQuery) CountX

func (gq *GameQuery) CountX(ctx context.Context) int

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

func (*GameQuery) Exist

func (gq *GameQuery) Exist(ctx context.Context) (bool, error)

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

func (*GameQuery) ExistX

func (gq *GameQuery) ExistX(ctx context.Context) bool

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

func (*GameQuery) First

func (gq *GameQuery) First(ctx context.Context) (*Game, error)

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

func (*GameQuery) FirstID

func (gq *GameQuery) FirstID(ctx context.Context) (id int64, err error)

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

func (*GameQuery) FirstIDX

func (gq *GameQuery) FirstIDX(ctx context.Context) int64

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

func (*GameQuery) FirstX

func (gq *GameQuery) FirstX(ctx context.Context) *Game

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

func (*GameQuery) GroupBy

func (gq *GameQuery) GroupBy(field string, fields ...string) *GameGroupBy

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 {
	CreatedBy int64 `json:"created_by"`
	Count int `json:"count,omitempty"`
}

client.Game.Query().
	GroupBy(game.FieldCreatedBy).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*GameQuery) IDs

func (gq *GameQuery) IDs(ctx context.Context) ([]int64, error)

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

func (*GameQuery) IDsX

func (gq *GameQuery) IDsX(ctx context.Context) []int64

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

func (*GameQuery) Limit

func (gq *GameQuery) Limit(limit int) *GameQuery

Limit adds a limit step to the query.

func (*GameQuery) Offset

func (gq *GameQuery) Offset(offset int) *GameQuery

Offset adds an offset step to the query.

func (*GameQuery) Only

func (gq *GameQuery) Only(ctx context.Context) (*Game, error)

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

func (*GameQuery) OnlyID

func (gq *GameQuery) OnlyID(ctx context.Context) (id int64, err error)

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

func (*GameQuery) OnlyIDX

func (gq *GameQuery) OnlyIDX(ctx context.Context) int64

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

func (*GameQuery) OnlyX

func (gq *GameQuery) OnlyX(ctx context.Context) *Game

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

func (*GameQuery) Order

func (gq *GameQuery) Order(o ...OrderFunc) *GameQuery

Order adds an order step to the query.

func (*GameQuery) Paginate

func (ga *GameQuery) Paginate(
	ctx context.Context, after *Cursor, first *int,
	before *Cursor, last *int, opts ...GamePaginateOption,
) (*GameConnection, error)

Paginate executes the query and returns a relay based cursor connection to Game.

func (*GameQuery) QueryGameUsers

func (gq *GameQuery) QueryGameUsers() *GameUserQuery

QueryGameUsers chains the current query on the "game_users" edge.

func (*GameQuery) QueryMissions

func (gq *GameQuery) QueryMissions() *MissionQuery

QueryMissions chains the current query on the "missions" edge.

func (*GameQuery) QueryRoom

func (gq *GameQuery) QueryRoom() *RoomQuery

QueryRoom chains the current query on the "room" edge.

func (*GameQuery) Select

func (gq *GameQuery) Select(fields ...string) *GameSelect

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 {
	CreatedBy int64 `json:"created_by"`
}

client.Game.Query().
	Select(game.FieldCreatedBy).
	Scan(ctx, &v)

func (*GameQuery) Unique

func (gq *GameQuery) Unique(unique bool) *GameQuery

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

func (gq *GameQuery) Where(ps ...predicate.Game) *GameQuery

Where adds a new predicate for the GameQuery builder.

func (*GameQuery) WithGameUsers

func (gq *GameQuery) WithGameUsers(opts ...func(*GameUserQuery)) *GameQuery

WithGameUsers tells the query-builder to eager-load the nodes that are connected to the "game_users" edge. The optional arguments are used to configure the query builder of the edge.

func (*GameQuery) WithMissions

func (gq *GameQuery) WithMissions(opts ...func(*MissionQuery)) *GameQuery

WithMissions tells the query-builder to eager-load the nodes that are connected to the "missions" edge. The optional arguments are used to configure the query builder of the edge.

func (*GameQuery) WithNamedGameUsers

func (gq *GameQuery) WithNamedGameUsers(name string, opts ...func(*GameUserQuery)) *GameQuery

WithNamedGameUsers tells the query-builder to eager-load the nodes that are connected to the "game_users" edge with the given name. The optional arguments are used to configure the query builder of the edge.

func (*GameQuery) WithNamedMissions

func (gq *GameQuery) WithNamedMissions(name string, opts ...func(*MissionQuery)) *GameQuery

WithNamedMissions tells the query-builder to eager-load the nodes that are connected to the "missions" edge with the given name. The optional arguments are used to configure the query builder of the edge.

func (*GameQuery) WithRoom

func (gq *GameQuery) WithRoom(opts ...func(*RoomQuery)) *GameQuery

WithRoom tells the query-builder to eager-load the nodes that are connected to the "room" edge. The optional arguments are used to configure the query builder of the edge.

type GameSelect

type GameSelect struct {
	*GameQuery
	// contains filtered or unexported fields
}

GameSelect is the builder for selecting fields of Game entities.

func (*GameSelect) Aggregate

func (gs *GameSelect) Aggregate(fns ...AggregateFunc) *GameSelect

Aggregate adds the given aggregation functions to the selector query.

func (*GameSelect) Bool

func (s *GameSelect) Bool(ctx context.Context) (_ bool, err error)

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

func (*GameSelect) BoolX

func (s *GameSelect) BoolX(ctx context.Context) bool

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

func (*GameSelect) Bools

func (s *GameSelect) Bools(ctx context.Context) ([]bool, error)

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

func (*GameSelect) BoolsX

func (s *GameSelect) BoolsX(ctx context.Context) []bool

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

func (*GameSelect) Float64

func (s *GameSelect) Float64(ctx context.Context) (_ float64, err error)

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

func (*GameSelect) Float64X

func (s *GameSelect) Float64X(ctx context.Context) float64

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

func (*GameSelect) Float64s

func (s *GameSelect) Float64s(ctx context.Context) ([]float64, error)

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

func (*GameSelect) Float64sX

func (s *GameSelect) Float64sX(ctx context.Context) []float64

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

func (*GameSelect) Int

func (s *GameSelect) Int(ctx context.Context) (_ int, err error)

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

func (*GameSelect) IntX

func (s *GameSelect) IntX(ctx context.Context) int

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

func (*GameSelect) Ints

func (s *GameSelect) Ints(ctx context.Context) ([]int, error)

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

func (*GameSelect) IntsX

func (s *GameSelect) IntsX(ctx context.Context) []int

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

func (*GameSelect) Scan

func (gs *GameSelect) Scan(ctx context.Context, v any) error

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

func (*GameSelect) ScanX

func (s *GameSelect) ScanX(ctx context.Context, v any)

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

func (*GameSelect) String

func (s *GameSelect) String(ctx context.Context) (_ string, err error)

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

func (*GameSelect) StringX

func (s *GameSelect) StringX(ctx context.Context) string

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

func (*GameSelect) Strings

func (s *GameSelect) Strings(ctx context.Context) ([]string, error)

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

func (*GameSelect) StringsX

func (s *GameSelect) StringsX(ctx context.Context) []string

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

type GameUpdate

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

GameUpdate is the builder for updating Game entities.

func (*GameUpdate) AddAssassinChance

func (gu *GameUpdate) AddAssassinChance(u int8) *GameUpdate

AddAssassinChance adds u to the "assassin_chance" field.

func (*GameUpdate) AddCapacity

func (gu *GameUpdate) AddCapacity(u int8) *GameUpdate

AddCapacity adds u to the "capacity" field.

func (*GameUpdate) AddCreatedBy

func (gu *GameUpdate) AddCreatedBy(i int64) *GameUpdate

AddCreatedBy adds i to the "created_by" field.

func (*GameUpdate) AddGameUserIDs

func (gu *GameUpdate) AddGameUserIDs(ids ...int64) *GameUpdate

AddGameUserIDs adds the "game_users" edge to the GameUser entity by IDs.

func (*GameUpdate) AddGameUsers

func (gu *GameUpdate) AddGameUsers(g ...*GameUser) *GameUpdate

AddGameUsers adds the "game_users" edges to the GameUser entity.

func (*GameUpdate) AddMissionIDs

func (gu *GameUpdate) AddMissionIDs(ids ...int64) *GameUpdate

AddMissionIDs adds the "missions" edge to the Mission entity by IDs.

func (*GameUpdate) AddMissions

func (gu *GameUpdate) AddMissions(m ...*Mission) *GameUpdate

AddMissions adds the "missions" edges to the Mission entity.

func (*GameUpdate) AddUpdatedBy

func (gu *GameUpdate) AddUpdatedBy(i int64) *GameUpdate

AddUpdatedBy adds i to the "updated_by" field.

func (*GameUpdate) AppendTheAssassinatedIds

func (gu *GameUpdate) AppendTheAssassinatedIds(s []string) *GameUpdate

AppendTheAssassinatedIds appends s to the "the_assassinated_ids" field.

func (*GameUpdate) ClearGameUsers

func (gu *GameUpdate) ClearGameUsers() *GameUpdate

ClearGameUsers clears all "game_users" edges to the GameUser entity.

func (*GameUpdate) ClearMissions

func (gu *GameUpdate) ClearMissions() *GameUpdate

ClearMissions clears all "missions" edges to the Mission entity.

func (*GameUpdate) ClearRoom

func (gu *GameUpdate) ClearRoom() *GameUpdate

ClearRoom clears the "room" edge to the Room entity.

func (*GameUpdate) ClearTheAssassinatedIds

func (gu *GameUpdate) ClearTheAssassinatedIds() *GameUpdate

ClearTheAssassinatedIds clears the value of the "the_assassinated_ids" field.

func (*GameUpdate) Exec

func (gu *GameUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*GameUpdate) ExecX

func (gu *GameUpdate) ExecX(ctx context.Context)

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

func (*GameUpdate) Mutation

func (gu *GameUpdate) Mutation() *GameMutation

Mutation returns the GameMutation object of the builder.

func (*GameUpdate) RemoveGameUserIDs

func (gu *GameUpdate) RemoveGameUserIDs(ids ...int64) *GameUpdate

RemoveGameUserIDs removes the "game_users" edge to GameUser entities by IDs.

func (*GameUpdate) RemoveGameUsers

func (gu *GameUpdate) RemoveGameUsers(g ...*GameUser) *GameUpdate

RemoveGameUsers removes "game_users" edges to GameUser entities.

func (*GameUpdate) RemoveMissionIDs

func (gu *GameUpdate) RemoveMissionIDs(ids ...int64) *GameUpdate

RemoveMissionIDs removes the "missions" edge to Mission entities by IDs.

func (*GameUpdate) RemoveMissions

func (gu *GameUpdate) RemoveMissions(m ...*Mission) *GameUpdate

RemoveMissions removes "missions" edges to Mission entities.

func (*GameUpdate) Save

func (gu *GameUpdate) Save(ctx context.Context) (int, error)

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

func (*GameUpdate) SaveX

func (gu *GameUpdate) SaveX(ctx context.Context) int

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

func (*GameUpdate) SetAssassinChance

func (gu *GameUpdate) SetAssassinChance(u uint8) *GameUpdate

SetAssassinChance sets the "assassin_chance" field.

func (*GameUpdate) SetCapacity

func (gu *GameUpdate) SetCapacity(u uint8) *GameUpdate

SetCapacity sets the "capacity" field.

func (*GameUpdate) SetClosed

func (gu *GameUpdate) SetClosed(b bool) *GameUpdate

SetClosed sets the "closed" field.

func (*GameUpdate) SetCreatedBy

func (gu *GameUpdate) SetCreatedBy(i int64) *GameUpdate

SetCreatedBy sets the "created_by" field.

func (*GameUpdate) SetDeletedAt

func (gu *GameUpdate) SetDeletedAt(t time.Time) *GameUpdate

SetDeletedAt sets the "deleted_at" field.

func (*GameUpdate) SetInput

func (c *GameUpdate) SetInput(i UpdateGameInput) *GameUpdate

SetInput applies the change-set in the UpdateGameInput on the GameUpdate builder.

func (*GameUpdate) SetNillableAssassinChance

func (gu *GameUpdate) SetNillableAssassinChance(u *uint8) *GameUpdate

SetNillableAssassinChance sets the "assassin_chance" field if the given value is not nil.

func (*GameUpdate) SetNillableCapacity

func (gu *GameUpdate) SetNillableCapacity(u *uint8) *GameUpdate

SetNillableCapacity sets the "capacity" field if the given value is not nil.

func (*GameUpdate) SetNillableClosed

func (gu *GameUpdate) SetNillableClosed(b *bool) *GameUpdate

SetNillableClosed sets the "closed" field if the given value is not nil.

func (*GameUpdate) SetNillableCreatedBy

func (gu *GameUpdate) SetNillableCreatedBy(i *int64) *GameUpdate

SetNillableCreatedBy sets the "created_by" field if the given value is not nil.

func (*GameUpdate) SetNillableDeletedAt

func (gu *GameUpdate) SetNillableDeletedAt(t *time.Time) *GameUpdate

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*GameUpdate) SetNillableResult

func (gu *GameUpdate) SetNillableResult(ga *game.Result) *GameUpdate

SetNillableResult sets the "result" field if the given value is not nil.

func (*GameUpdate) SetNillableUpdatedBy

func (gu *GameUpdate) SetNillableUpdatedBy(i *int64) *GameUpdate

SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil.

func (*GameUpdate) SetResult

func (gu *GameUpdate) SetResult(ga game.Result) *GameUpdate

SetResult sets the "result" field.

func (*GameUpdate) SetRoom

func (gu *GameUpdate) SetRoom(r *Room) *GameUpdate

SetRoom sets the "room" edge to the Room entity.

func (*GameUpdate) SetRoomID

func (gu *GameUpdate) SetRoomID(i int64) *GameUpdate

SetRoomID sets the "room_id" field.

func (*GameUpdate) SetTheAssassinatedIds

func (gu *GameUpdate) SetTheAssassinatedIds(s []string) *GameUpdate

SetTheAssassinatedIds sets the "the_assassinated_ids" field.

func (*GameUpdate) SetUpdatedAt

func (gu *GameUpdate) SetUpdatedAt(t time.Time) *GameUpdate

SetUpdatedAt sets the "updated_at" field.

func (*GameUpdate) SetUpdatedBy

func (gu *GameUpdate) SetUpdatedBy(i int64) *GameUpdate

SetUpdatedBy sets the "updated_by" field.

func (*GameUpdate) Where

func (gu *GameUpdate) Where(ps ...predicate.Game) *GameUpdate

Where appends a list predicates to the GameUpdate builder.

type GameUpdateOne

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

GameUpdateOne is the builder for updating a single Game entity.

func (*GameUpdateOne) AddAssassinChance

func (guo *GameUpdateOne) AddAssassinChance(u int8) *GameUpdateOne

AddAssassinChance adds u to the "assassin_chance" field.

func (*GameUpdateOne) AddCapacity

func (guo *GameUpdateOne) AddCapacity(u int8) *GameUpdateOne

AddCapacity adds u to the "capacity" field.

func (*GameUpdateOne) AddCreatedBy

func (guo *GameUpdateOne) AddCreatedBy(i int64) *GameUpdateOne

AddCreatedBy adds i to the "created_by" field.

func (*GameUpdateOne) AddGameUserIDs

func (guo *GameUpdateOne) AddGameUserIDs(ids ...int64) *GameUpdateOne

AddGameUserIDs adds the "game_users" edge to the GameUser entity by IDs.

func (*GameUpdateOne) AddGameUsers

func (guo *GameUpdateOne) AddGameUsers(g ...*GameUser) *GameUpdateOne

AddGameUsers adds the "game_users" edges to the GameUser entity.

func (*GameUpdateOne) AddMissionIDs

func (guo *GameUpdateOne) AddMissionIDs(ids ...int64) *GameUpdateOne

AddMissionIDs adds the "missions" edge to the Mission entity by IDs.

func (*GameUpdateOne) AddMissions

func (guo *GameUpdateOne) AddMissions(m ...*Mission) *GameUpdateOne

AddMissions adds the "missions" edges to the Mission entity.

func (*GameUpdateOne) AddUpdatedBy

func (guo *GameUpdateOne) AddUpdatedBy(i int64) *GameUpdateOne

AddUpdatedBy adds i to the "updated_by" field.

func (*GameUpdateOne) AppendTheAssassinatedIds

func (guo *GameUpdateOne) AppendTheAssassinatedIds(s []string) *GameUpdateOne

AppendTheAssassinatedIds appends s to the "the_assassinated_ids" field.

func (*GameUpdateOne) ClearGameUsers

func (guo *GameUpdateOne) ClearGameUsers() *GameUpdateOne

ClearGameUsers clears all "game_users" edges to the GameUser entity.

func (*GameUpdateOne) ClearMissions

func (guo *GameUpdateOne) ClearMissions() *GameUpdateOne

ClearMissions clears all "missions" edges to the Mission entity.

func (*GameUpdateOne) ClearRoom

func (guo *GameUpdateOne) ClearRoom() *GameUpdateOne

ClearRoom clears the "room" edge to the Room entity.

func (*GameUpdateOne) ClearTheAssassinatedIds

func (guo *GameUpdateOne) ClearTheAssassinatedIds() *GameUpdateOne

ClearTheAssassinatedIds clears the value of the "the_assassinated_ids" field.

func (*GameUpdateOne) Exec

func (guo *GameUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*GameUpdateOne) ExecX

func (guo *GameUpdateOne) ExecX(ctx context.Context)

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

func (*GameUpdateOne) Mutation

func (guo *GameUpdateOne) Mutation() *GameMutation

Mutation returns the GameMutation object of the builder.

func (*GameUpdateOne) RemoveGameUserIDs

func (guo *GameUpdateOne) RemoveGameUserIDs(ids ...int64) *GameUpdateOne

RemoveGameUserIDs removes the "game_users" edge to GameUser entities by IDs.

func (*GameUpdateOne) RemoveGameUsers

func (guo *GameUpdateOne) RemoveGameUsers(g ...*GameUser) *GameUpdateOne

RemoveGameUsers removes "game_users" edges to GameUser entities.

func (*GameUpdateOne) RemoveMissionIDs

func (guo *GameUpdateOne) RemoveMissionIDs(ids ...int64) *GameUpdateOne

RemoveMissionIDs removes the "missions" edge to Mission entities by IDs.

func (*GameUpdateOne) RemoveMissions

func (guo *GameUpdateOne) RemoveMissions(m ...*Mission) *GameUpdateOne

RemoveMissions removes "missions" edges to Mission entities.

func (*GameUpdateOne) Save

func (guo *GameUpdateOne) Save(ctx context.Context) (*Game, error)

Save executes the query and returns the updated Game entity.

func (*GameUpdateOne) SaveX

func (guo *GameUpdateOne) SaveX(ctx context.Context) *Game

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

func (*GameUpdateOne) Select

func (guo *GameUpdateOne) Select(field string, fields ...string) *GameUpdateOne

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

func (*GameUpdateOne) SetAssassinChance

func (guo *GameUpdateOne) SetAssassinChance(u uint8) *GameUpdateOne

SetAssassinChance sets the "assassin_chance" field.

func (*GameUpdateOne) SetCapacity

func (guo *GameUpdateOne) SetCapacity(u uint8) *GameUpdateOne

SetCapacity sets the "capacity" field.

func (*GameUpdateOne) SetClosed

func (guo *GameUpdateOne) SetClosed(b bool) *GameUpdateOne

SetClosed sets the "closed" field.

func (*GameUpdateOne) SetCreatedBy

func (guo *GameUpdateOne) SetCreatedBy(i int64) *GameUpdateOne

SetCreatedBy sets the "created_by" field.

func (*GameUpdateOne) SetDeletedAt

func (guo *GameUpdateOne) SetDeletedAt(t time.Time) *GameUpdateOne

SetDeletedAt sets the "deleted_at" field.

func (*GameUpdateOne) SetInput

SetInput applies the change-set in the UpdateGameInput on the GameUpdateOne builder.

func (*GameUpdateOne) SetNillableAssassinChance

func (guo *GameUpdateOne) SetNillableAssassinChance(u *uint8) *GameUpdateOne

SetNillableAssassinChance sets the "assassin_chance" field if the given value is not nil.

func (*GameUpdateOne) SetNillableCapacity

func (guo *GameUpdateOne) SetNillableCapacity(u *uint8) *GameUpdateOne

SetNillableCapacity sets the "capacity" field if the given value is not nil.

func (*GameUpdateOne) SetNillableClosed

func (guo *GameUpdateOne) SetNillableClosed(b *bool) *GameUpdateOne

SetNillableClosed sets the "closed" field if the given value is not nil.

func (*GameUpdateOne) SetNillableCreatedBy

func (guo *GameUpdateOne) SetNillableCreatedBy(i *int64) *GameUpdateOne

SetNillableCreatedBy sets the "created_by" field if the given value is not nil.

func (*GameUpdateOne) SetNillableDeletedAt

func (guo *GameUpdateOne) SetNillableDeletedAt(t *time.Time) *GameUpdateOne

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*GameUpdateOne) SetNillableResult

func (guo *GameUpdateOne) SetNillableResult(ga *game.Result) *GameUpdateOne

SetNillableResult sets the "result" field if the given value is not nil.

func (*GameUpdateOne) SetNillableUpdatedBy

func (guo *GameUpdateOne) SetNillableUpdatedBy(i *int64) *GameUpdateOne

SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil.

func (*GameUpdateOne) SetResult

func (guo *GameUpdateOne) SetResult(ga game.Result) *GameUpdateOne

SetResult sets the "result" field.

func (*GameUpdateOne) SetRoom

func (guo *GameUpdateOne) SetRoom(r *Room) *GameUpdateOne

SetRoom sets the "room" edge to the Room entity.

func (*GameUpdateOne) SetRoomID

func (guo *GameUpdateOne) SetRoomID(i int64) *GameUpdateOne

SetRoomID sets the "room_id" field.

func (*GameUpdateOne) SetTheAssassinatedIds

func (guo *GameUpdateOne) SetTheAssassinatedIds(s []string) *GameUpdateOne

SetTheAssassinatedIds sets the "the_assassinated_ids" field.

func (*GameUpdateOne) SetUpdatedAt

func (guo *GameUpdateOne) SetUpdatedAt(t time.Time) *GameUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*GameUpdateOne) SetUpdatedBy

func (guo *GameUpdateOne) SetUpdatedBy(i int64) *GameUpdateOne

SetUpdatedBy sets the "updated_by" field.

type GameUser

type GameUser struct {

	// ID of the ent.
	ID int64 `json:"id,omitempty"`
	// CreatedBy holds the value of the "created_by" field.
	CreatedBy int64 `json:"created_by"`
	// UpdatedBy holds the value of the "updated_by" field.
	UpdatedBy int64 `json:"updated_by"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at"`
	// UpdatedAt holds the value of the "updated_at" field.
	UpdatedAt time.Time `json:"updated_at"`
	// DeletedAt holds the value of the "deleted_at" field.
	DeletedAt time.Time `json:"deleted_at"`
	// 用户 ID
	UserID int64 `json:"user_id"`
	// 游戏 ID
	GameID int64 `json:"game_id"`
	// 卡牌 ID
	CardID int64 `json:"card_id"`
	// 排序,号数
	Number uint8 `json:"number"`
	// 用户是否已经退出游戏,都退出游戏时游戏关闭,为了让游戏结束时用户还可以进去查看结果
	Exited bool `json:"exited"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the GameUserQuery when eager-loading is set.
	Edges GameUserEdges `json:"edges"`
	// contains filtered or unexported fields
}

GameUser is the model entity for the GameUser schema.

func (*GameUser) Card

func (gu *GameUser) Card(ctx context.Context) (*Card, error)

func (*GameUser) Game

func (gu *GameUser) Game(ctx context.Context) (*Game, error)

func (GameUser) IsEntity

func (gu GameUser) IsEntity()

IsEntity implement fedruntime.Entity

func (*GameUser) Node

func (gu *GameUser) Node(ctx context.Context) (node *Node, err error)

func (*GameUser) QueryCard

func (gu *GameUser) QueryCard() *CardQuery

QueryCard queries the "card" edge of the GameUser entity.

func (*GameUser) QueryGame

func (gu *GameUser) QueryGame() *GameQuery

QueryGame queries the "game" edge of the GameUser entity.

func (*GameUser) String

func (gu *GameUser) String() string

String implements the fmt.Stringer.

func (*GameUser) ToEdge

func (gu *GameUser) ToEdge(order *GameUserOrder) *GameUserEdge

ToEdge converts GameUser into GameUserEdge.

func (*GameUser) Unwrap

func (gu *GameUser) Unwrap() *GameUser

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

func (gu *GameUser) Update() *GameUserUpdateOne

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

type GameUserClient

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

GameUserClient is a client for the GameUser schema.

func NewGameUserClient

func NewGameUserClient(c config) *GameUserClient

NewGameUserClient returns a client for the GameUser from the given config.

func (*GameUserClient) Create

func (c *GameUserClient) Create() *GameUserCreate

Create returns a builder for creating a GameUser entity.

func (*GameUserClient) CreateBulk

func (c *GameUserClient) CreateBulk(builders ...*GameUserCreate) *GameUserCreateBulk

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

func (*GameUserClient) Delete

func (c *GameUserClient) Delete() *GameUserDelete

Delete returns a delete builder for GameUser.

func (*GameUserClient) DeleteOne

func (c *GameUserClient) DeleteOne(gu *GameUser) *GameUserDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*GameUserClient) DeleteOneID

func (c *GameUserClient) DeleteOneID(id int64) *GameUserDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*GameUserClient) Get

func (c *GameUserClient) Get(ctx context.Context, id int64) (*GameUser, error)

Get returns a GameUser entity by its id.

func (*GameUserClient) GetX

func (c *GameUserClient) GetX(ctx context.Context, id int64) *GameUser

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

func (*GameUserClient) Hooks

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

Hooks returns the client hooks.

func (*GameUserClient) Query

func (c *GameUserClient) Query() *GameUserQuery

Query returns a query builder for GameUser.

func (*GameUserClient) QueryCard

func (c *GameUserClient) QueryCard(gu *GameUser) *CardQuery

QueryCard queries the card edge of a GameUser.

func (*GameUserClient) QueryGame

func (c *GameUserClient) QueryGame(gu *GameUser) *GameQuery

QueryGame queries the game edge of a GameUser.

func (*GameUserClient) Update

func (c *GameUserClient) Update() *GameUserUpdate

Update returns an update builder for GameUser.

func (*GameUserClient) UpdateOne

func (c *GameUserClient) UpdateOne(gu *GameUser) *GameUserUpdateOne

UpdateOne returns an update builder for the given entity.

func (*GameUserClient) UpdateOneID

func (c *GameUserClient) UpdateOneID(id int64) *GameUserUpdateOne

UpdateOneID returns an update builder for the given id.

func (*GameUserClient) Use

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

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

type GameUserConnection

type GameUserConnection struct {
	Edges      []*GameUserEdge `json:"edges"`
	PageInfo   PageInfo        `json:"pageInfo"`
	TotalCount int             `json:"totalCount"`
}

GameUserConnection is the connection containing edges to GameUser.

type GameUserCreate

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

GameUserCreate is the builder for creating a GameUser entity.

func (*GameUserCreate) Exec

func (guc *GameUserCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*GameUserCreate) ExecX

func (guc *GameUserCreate) ExecX(ctx context.Context)

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

func (*GameUserCreate) Mutation

func (guc *GameUserCreate) Mutation() *GameUserMutation

Mutation returns the GameUserMutation object of the builder.

func (*GameUserCreate) Save

func (guc *GameUserCreate) Save(ctx context.Context) (*GameUser, error)

Save creates the GameUser in the database.

func (*GameUserCreate) SaveX

func (guc *GameUserCreate) SaveX(ctx context.Context) *GameUser

SaveX calls Save and panics if Save returns an error.

func (*GameUserCreate) SetCard

func (guc *GameUserCreate) SetCard(c *Card) *GameUserCreate

SetCard sets the "card" edge to the Card entity.

func (*GameUserCreate) SetCardID

func (guc *GameUserCreate) SetCardID(i int64) *GameUserCreate

SetCardID sets the "card_id" field.

func (*GameUserCreate) SetCreatedAt

func (guc *GameUserCreate) SetCreatedAt(t time.Time) *GameUserCreate

SetCreatedAt sets the "created_at" field.

func (*GameUserCreate) SetCreatedBy

func (guc *GameUserCreate) SetCreatedBy(i int64) *GameUserCreate

SetCreatedBy sets the "created_by" field.

func (*GameUserCreate) SetDeletedAt

func (guc *GameUserCreate) SetDeletedAt(t time.Time) *GameUserCreate

SetDeletedAt sets the "deleted_at" field.

func (*GameUserCreate) SetExited

func (guc *GameUserCreate) SetExited(b bool) *GameUserCreate

SetExited sets the "exited" field.

func (*GameUserCreate) SetGame

func (guc *GameUserCreate) SetGame(g *Game) *GameUserCreate

SetGame sets the "game" edge to the Game entity.

func (*GameUserCreate) SetGameID

func (guc *GameUserCreate) SetGameID(i int64) *GameUserCreate

SetGameID sets the "game_id" field.

func (*GameUserCreate) SetID

func (guc *GameUserCreate) SetID(i int64) *GameUserCreate

SetID sets the "id" field.

func (*GameUserCreate) SetInput

SetInput applies the change-set in the CreateGameUserInput on the GameUserCreate builder.

func (*GameUserCreate) SetNillableCreatedAt

func (guc *GameUserCreate) SetNillableCreatedAt(t *time.Time) *GameUserCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*GameUserCreate) SetNillableCreatedBy

func (guc *GameUserCreate) SetNillableCreatedBy(i *int64) *GameUserCreate

SetNillableCreatedBy sets the "created_by" field if the given value is not nil.

func (*GameUserCreate) SetNillableDeletedAt

func (guc *GameUserCreate) SetNillableDeletedAt(t *time.Time) *GameUserCreate

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*GameUserCreate) SetNillableExited

func (guc *GameUserCreate) SetNillableExited(b *bool) *GameUserCreate

SetNillableExited sets the "exited" field if the given value is not nil.

func (*GameUserCreate) SetNillableID

func (guc *GameUserCreate) SetNillableID(i *int64) *GameUserCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*GameUserCreate) SetNillableUpdatedAt

func (guc *GameUserCreate) SetNillableUpdatedAt(t *time.Time) *GameUserCreate

SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.

func (*GameUserCreate) SetNillableUpdatedBy

func (guc *GameUserCreate) SetNillableUpdatedBy(i *int64) *GameUserCreate

SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil.

func (*GameUserCreate) SetNumber

func (guc *GameUserCreate) SetNumber(u uint8) *GameUserCreate

SetNumber sets the "number" field.

func (*GameUserCreate) SetUpdatedAt

func (guc *GameUserCreate) SetUpdatedAt(t time.Time) *GameUserCreate

SetUpdatedAt sets the "updated_at" field.

func (*GameUserCreate) SetUpdatedBy

func (guc *GameUserCreate) SetUpdatedBy(i int64) *GameUserCreate

SetUpdatedBy sets the "updated_by" field.

func (*GameUserCreate) SetUserID

func (guc *GameUserCreate) SetUserID(i int64) *GameUserCreate

SetUserID sets the "user_id" field.

type GameUserCreateBulk

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

GameUserCreateBulk is the builder for creating many GameUser entities in bulk.

func (*GameUserCreateBulk) Exec

func (gucb *GameUserCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*GameUserCreateBulk) ExecX

func (gucb *GameUserCreateBulk) ExecX(ctx context.Context)

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

func (*GameUserCreateBulk) Save

func (gucb *GameUserCreateBulk) Save(ctx context.Context) ([]*GameUser, error)

Save creates the GameUser entities in the database.

func (*GameUserCreateBulk) SaveX

func (gucb *GameUserCreateBulk) SaveX(ctx context.Context) []*GameUser

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

type GameUserDelete

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

GameUserDelete is the builder for deleting a GameUser entity.

func (*GameUserDelete) Exec

func (gud *GameUserDelete) Exec(ctx context.Context) (int, error)

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

func (*GameUserDelete) ExecX

func (gud *GameUserDelete) ExecX(ctx context.Context) int

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

func (*GameUserDelete) Where

func (gud *GameUserDelete) Where(ps ...predicate.GameUser) *GameUserDelete

Where appends a list predicates to the GameUserDelete builder.

type GameUserDeleteOne

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

GameUserDeleteOne is the builder for deleting a single GameUser entity.

func (*GameUserDeleteOne) Exec

func (gudo *GameUserDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*GameUserDeleteOne) ExecX

func (gudo *GameUserDeleteOne) ExecX(ctx context.Context)

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

type GameUserEdge

type GameUserEdge struct {
	Node   *GameUser `json:"node"`
	Cursor Cursor    `json:"cursor"`
}

GameUserEdge is the edge representation of GameUser.

type GameUserEdges

type GameUserEdges struct {
	// Game holds the value of the game edge.
	Game *Game `json:"game,omitempty"`
	// Card holds the value of the card edge.
	Card *Card `json:"card,omitempty"`
	// contains filtered or unexported fields
}

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

func (GameUserEdges) CardOrErr

func (e GameUserEdges) CardOrErr() (*Card, error)

CardOrErr returns the Card value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

func (GameUserEdges) GameOrErr

func (e GameUserEdges) GameOrErr() (*Game, error)

GameOrErr returns the Game value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

type GameUserGroupBy

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

GameUserGroupBy is the group-by builder for GameUser entities.

func (*GameUserGroupBy) Aggregate

func (gugb *GameUserGroupBy) Aggregate(fns ...AggregateFunc) *GameUserGroupBy

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

func (*GameUserGroupBy) Bool

func (s *GameUserGroupBy) Bool(ctx context.Context) (_ bool, err error)

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

func (*GameUserGroupBy) BoolX

func (s *GameUserGroupBy) BoolX(ctx context.Context) bool

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

func (*GameUserGroupBy) Bools

func (s *GameUserGroupBy) Bools(ctx context.Context) ([]bool, error)

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

func (*GameUserGroupBy) BoolsX

func (s *GameUserGroupBy) BoolsX(ctx context.Context) []bool

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

func (*GameUserGroupBy) Float64

func (s *GameUserGroupBy) Float64(ctx context.Context) (_ float64, err error)

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

func (*GameUserGroupBy) Float64X

func (s *GameUserGroupBy) Float64X(ctx context.Context) float64

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

func (*GameUserGroupBy) Float64s

func (s *GameUserGroupBy) Float64s(ctx context.Context) ([]float64, error)

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

func (*GameUserGroupBy) Float64sX

func (s *GameUserGroupBy) Float64sX(ctx context.Context) []float64

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

func (*GameUserGroupBy) Int

func (s *GameUserGroupBy) Int(ctx context.Context) (_ int, err error)

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

func (*GameUserGroupBy) IntX

func (s *GameUserGroupBy) IntX(ctx context.Context) int

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

func (*GameUserGroupBy) Ints

func (s *GameUserGroupBy) Ints(ctx context.Context) ([]int, error)

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

func (*GameUserGroupBy) IntsX

func (s *GameUserGroupBy) IntsX(ctx context.Context) []int

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

func (*GameUserGroupBy) Scan

func (gugb *GameUserGroupBy) Scan(ctx context.Context, v any) error

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

func (*GameUserGroupBy) ScanX

func (s *GameUserGroupBy) ScanX(ctx context.Context, v any)

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

func (*GameUserGroupBy) String

func (s *GameUserGroupBy) String(ctx context.Context) (_ string, err error)

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

func (*GameUserGroupBy) StringX

func (s *GameUserGroupBy) StringX(ctx context.Context) string

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

func (*GameUserGroupBy) Strings

func (s *GameUserGroupBy) Strings(ctx context.Context) ([]string, error)

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

func (*GameUserGroupBy) StringsX

func (s *GameUserGroupBy) StringsX(ctx context.Context) []string

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

type GameUserMutation

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

GameUserMutation represents an operation that mutates the GameUser nodes in the graph.

func (*GameUserMutation) AddCreatedBy

func (m *GameUserMutation) AddCreatedBy(i int64)

AddCreatedBy adds i to the "created_by" field.

func (*GameUserMutation) AddField

func (m *GameUserMutation) 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 (*GameUserMutation) AddNumber

func (m *GameUserMutation) AddNumber(u int8)

AddNumber adds u to the "number" field.

func (*GameUserMutation) AddUpdatedBy

func (m *GameUserMutation) AddUpdatedBy(i int64)

AddUpdatedBy adds i to the "updated_by" field.

func (*GameUserMutation) AddUserID

func (m *GameUserMutation) AddUserID(i int64)

AddUserID adds i to the "user_id" field.

func (*GameUserMutation) AddedCreatedBy

func (m *GameUserMutation) AddedCreatedBy() (r int64, exists bool)

AddedCreatedBy returns the value that was added to the "created_by" field in this mutation.

func (*GameUserMutation) AddedEdges

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

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

func (*GameUserMutation) AddedField

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

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

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

func (*GameUserMutation) AddedIDs

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

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

func (*GameUserMutation) AddedNumber

func (m *GameUserMutation) AddedNumber() (r int8, exists bool)

AddedNumber returns the value that was added to the "number" field in this mutation.

func (*GameUserMutation) AddedUpdatedBy

func (m *GameUserMutation) AddedUpdatedBy() (r int64, exists bool)

AddedUpdatedBy returns the value that was added to the "updated_by" field in this mutation.

func (*GameUserMutation) AddedUserID

func (m *GameUserMutation) AddedUserID() (r int64, exists bool)

AddedUserID returns the value that was added to the "user_id" field in this mutation.

func (*GameUserMutation) CardCleared

func (m *GameUserMutation) CardCleared() bool

CardCleared reports if the "card" edge to the Card entity was cleared.

func (*GameUserMutation) CardID

func (m *GameUserMutation) CardID() (r int64, exists bool)

CardID returns the value of the "card_id" field in the mutation.

func (*GameUserMutation) CardIDs

func (m *GameUserMutation) CardIDs() (ids []int64)

CardIDs returns the "card" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use CardID instead. It exists only for internal usage by the builders.

func (*GameUserMutation) ClearCard

func (m *GameUserMutation) ClearCard()

ClearCard clears the "card" edge to the Card entity.

func (*GameUserMutation) ClearEdge

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

func (m *GameUserMutation) 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 (*GameUserMutation) ClearGame

func (m *GameUserMutation) ClearGame()

ClearGame clears the "game" edge to the Game entity.

func (*GameUserMutation) ClearedEdges

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

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

func (*GameUserMutation) ClearedFields

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

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

func (GameUserMutation) Client

func (m GameUserMutation) 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 (*GameUserMutation) CreatedAt

func (m *GameUserMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*GameUserMutation) CreatedBy

func (m *GameUserMutation) CreatedBy() (r int64, exists bool)

CreatedBy returns the value of the "created_by" field in the mutation.

func (*GameUserMutation) DeletedAt

func (m *GameUserMutation) DeletedAt() (r time.Time, exists bool)

DeletedAt returns the value of the "deleted_at" field in the mutation.

func (*GameUserMutation) EdgeCleared

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

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

func (*GameUserMutation) Exited

func (m *GameUserMutation) Exited() (r bool, exists bool)

Exited returns the value of the "exited" field in the mutation.

func (*GameUserMutation) Field

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

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

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

func (*GameUserMutation) Fields

func (m *GameUserMutation) 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 (*GameUserMutation) GameCleared

func (m *GameUserMutation) GameCleared() bool

GameCleared reports if the "game" edge to the Game entity was cleared.

func (*GameUserMutation) GameID

func (m *GameUserMutation) GameID() (r int64, exists bool)

GameID returns the value of the "game_id" field in the mutation.

func (*GameUserMutation) GameIDs

func (m *GameUserMutation) GameIDs() (ids []int64)

GameIDs returns the "game" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use GameID instead. It exists only for internal usage by the builders.

func (*GameUserMutation) ID

func (m *GameUserMutation) ID() (id int64, 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 (*GameUserMutation) IDs

func (m *GameUserMutation) IDs(ctx context.Context) ([]int64, error)

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

func (*GameUserMutation) Number

func (m *GameUserMutation) Number() (r uint8, exists bool)

Number returns the value of the "number" field in the mutation.

func (*GameUserMutation) OldCardID

func (m *GameUserMutation) OldCardID(ctx context.Context) (v int64, err error)

OldCardID returns the old "card_id" field's value of the GameUser entity. If the GameUser 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 (*GameUserMutation) OldCreatedAt

func (m *GameUserMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the GameUser entity. If the GameUser 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 (*GameUserMutation) OldCreatedBy

func (m *GameUserMutation) OldCreatedBy(ctx context.Context) (v int64, err error)

OldCreatedBy returns the old "created_by" field's value of the GameUser entity. If the GameUser 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 (*GameUserMutation) OldDeletedAt

func (m *GameUserMutation) OldDeletedAt(ctx context.Context) (v time.Time, err error)

OldDeletedAt returns the old "deleted_at" field's value of the GameUser entity. If the GameUser 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 (*GameUserMutation) OldExited

func (m *GameUserMutation) OldExited(ctx context.Context) (v bool, err error)

OldExited returns the old "exited" field's value of the GameUser entity. If the GameUser 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 (*GameUserMutation) OldField

func (m *GameUserMutation) 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 (*GameUserMutation) OldGameID

func (m *GameUserMutation) OldGameID(ctx context.Context) (v int64, err error)

OldGameID returns the old "game_id" field's value of the GameUser entity. If the GameUser 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 (*GameUserMutation) OldNumber

func (m *GameUserMutation) OldNumber(ctx context.Context) (v uint8, err error)

OldNumber returns the old "number" field's value of the GameUser entity. If the GameUser 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 (*GameUserMutation) OldUpdatedAt

func (m *GameUserMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)

OldUpdatedAt returns the old "updated_at" field's value of the GameUser entity. If the GameUser 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 (*GameUserMutation) OldUpdatedBy

func (m *GameUserMutation) OldUpdatedBy(ctx context.Context) (v int64, err error)

OldUpdatedBy returns the old "updated_by" field's value of the GameUser entity. If the GameUser 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 (*GameUserMutation) OldUserID

func (m *GameUserMutation) OldUserID(ctx context.Context) (v int64, err error)

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

func (m *GameUserMutation) Op() Op

Op returns the operation name.

func (*GameUserMutation) RemovedEdges

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

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

func (*GameUserMutation) RemovedIDs

func (m *GameUserMutation) 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 (*GameUserMutation) ResetCard

func (m *GameUserMutation) ResetCard()

ResetCard resets all changes to the "card" edge.

func (*GameUserMutation) ResetCardID

func (m *GameUserMutation) ResetCardID()

ResetCardID resets all changes to the "card_id" field.

func (*GameUserMutation) ResetCreatedAt

func (m *GameUserMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*GameUserMutation) ResetCreatedBy

func (m *GameUserMutation) ResetCreatedBy()

ResetCreatedBy resets all changes to the "created_by" field.

func (*GameUserMutation) ResetDeletedAt

func (m *GameUserMutation) ResetDeletedAt()

ResetDeletedAt resets all changes to the "deleted_at" field.

func (*GameUserMutation) ResetEdge

func (m *GameUserMutation) 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 (*GameUserMutation) ResetExited

func (m *GameUserMutation) ResetExited()

ResetExited resets all changes to the "exited" field.

func (*GameUserMutation) ResetField

func (m *GameUserMutation) 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 (*GameUserMutation) ResetGame

func (m *GameUserMutation) ResetGame()

ResetGame resets all changes to the "game" edge.

func (*GameUserMutation) ResetGameID

func (m *GameUserMutation) ResetGameID()

ResetGameID resets all changes to the "game_id" field.

func (*GameUserMutation) ResetNumber

func (m *GameUserMutation) ResetNumber()

ResetNumber resets all changes to the "number" field.

func (*GameUserMutation) ResetUpdatedAt

func (m *GameUserMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*GameUserMutation) ResetUpdatedBy

func (m *GameUserMutation) ResetUpdatedBy()

ResetUpdatedBy resets all changes to the "updated_by" field.

func (*GameUserMutation) ResetUserID

func (m *GameUserMutation) ResetUserID()

ResetUserID resets all changes to the "user_id" field.

func (*GameUserMutation) SetCardID

func (m *GameUserMutation) SetCardID(i int64)

SetCardID sets the "card_id" field.

func (*GameUserMutation) SetCreatedAt

func (m *GameUserMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*GameUserMutation) SetCreatedBy

func (m *GameUserMutation) SetCreatedBy(i int64)

SetCreatedBy sets the "created_by" field.

func (*GameUserMutation) SetDeletedAt

func (m *GameUserMutation) SetDeletedAt(t time.Time)

SetDeletedAt sets the "deleted_at" field.

func (*GameUserMutation) SetExited

func (m *GameUserMutation) SetExited(b bool)

SetExited sets the "exited" field.

func (*GameUserMutation) SetField

func (m *GameUserMutation) 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 (*GameUserMutation) SetGameID

func (m *GameUserMutation) SetGameID(i int64)

SetGameID sets the "game_id" field.

func (*GameUserMutation) SetID

func (m *GameUserMutation) SetID(id int64)

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

func (*GameUserMutation) SetNumber

func (m *GameUserMutation) SetNumber(u uint8)

SetNumber sets the "number" field.

func (*GameUserMutation) SetUpdatedAt

func (m *GameUserMutation) SetUpdatedAt(t time.Time)

SetUpdatedAt sets the "updated_at" field.

func (*GameUserMutation) SetUpdatedBy

func (m *GameUserMutation) SetUpdatedBy(i int64)

SetUpdatedBy sets the "updated_by" field.

func (*GameUserMutation) SetUserID

func (m *GameUserMutation) SetUserID(i int64)

SetUserID sets the "user_id" field.

func (GameUserMutation) Tx

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

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

func (*GameUserMutation) Type

func (m *GameUserMutation) Type() string

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

func (*GameUserMutation) UpdatedAt

func (m *GameUserMutation) UpdatedAt() (r time.Time, exists bool)

UpdatedAt returns the value of the "updated_at" field in the mutation.

func (*GameUserMutation) UpdatedBy

func (m *GameUserMutation) UpdatedBy() (r int64, exists bool)

UpdatedBy returns the value of the "updated_by" field in the mutation.

func (*GameUserMutation) UserID

func (m *GameUserMutation) UserID() (r int64, exists bool)

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

func (*GameUserMutation) Where

func (m *GameUserMutation) Where(ps ...predicate.GameUser)

Where appends a list predicates to the GameUserMutation builder.

type GameUserOrder

type GameUserOrder struct {
	Direction OrderDirection      `json:"direction"`
	Field     *GameUserOrderField `json:"field"`
}

GameUserOrder defines the ordering of GameUser.

type GameUserOrderField

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

GameUserOrderField defines the ordering field of GameUser.

func (GameUserOrderField) MarshalGQL

func (f GameUserOrderField) MarshalGQL(w io.Writer)

MarshalGQL implements graphql.Marshaler interface.

func (GameUserOrderField) String

func (f GameUserOrderField) String() string

String implement fmt.Stringer interface.

func (*GameUserOrderField) UnmarshalGQL

func (f *GameUserOrderField) UnmarshalGQL(v interface{}) error

UnmarshalGQL implements graphql.Unmarshaler interface.

type GameUserPaginateOption

type GameUserPaginateOption func(*gameuserPager) error

GameUserPaginateOption enables pagination customization.

func WithGameUserFilter

func WithGameUserFilter(filter func(*GameUserQuery) (*GameUserQuery, error)) GameUserPaginateOption

WithGameUserFilter configures pagination filter.

func WithGameUserOrder

func WithGameUserOrder(order *GameUserOrder) GameUserPaginateOption

WithGameUserOrder configures pagination ordering.

type GameUserQuery

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

GameUserQuery is the builder for querying GameUser entities.

func (*GameUserQuery) Aggregate

func (guq *GameUserQuery) Aggregate(fns ...AggregateFunc) *GameUserSelect

Aggregate returns a GameUserSelect configured with the given aggregations.

func (*GameUserQuery) All

func (guq *GameUserQuery) All(ctx context.Context) ([]*GameUser, error)

All executes the query and returns a list of GameUsers.

func (*GameUserQuery) AllX

func (guq *GameUserQuery) AllX(ctx context.Context) []*GameUser

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

func (*GameUserQuery) Clone

func (guq *GameUserQuery) Clone() *GameUserQuery

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

func (*GameUserQuery) CollectFields

func (gu *GameUserQuery) CollectFields(ctx context.Context, satisfies ...string) (*GameUserQuery, error)

CollectFields tells the query-builder to eagerly load connected nodes by resolver context.

func (*GameUserQuery) Count

func (guq *GameUserQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*GameUserQuery) CountX

func (guq *GameUserQuery) CountX(ctx context.Context) int

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

func (*GameUserQuery) Exist

func (guq *GameUserQuery) Exist(ctx context.Context) (bool, error)

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

func (*GameUserQuery) ExistX

func (guq *GameUserQuery) ExistX(ctx context.Context) bool

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

func (*GameUserQuery) First

func (guq *GameUserQuery) First(ctx context.Context) (*GameUser, error)

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

func (*GameUserQuery) FirstID

func (guq *GameUserQuery) FirstID(ctx context.Context) (id int64, err error)

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

func (*GameUserQuery) FirstIDX

func (guq *GameUserQuery) FirstIDX(ctx context.Context) int64

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

func (*GameUserQuery) FirstX

func (guq *GameUserQuery) FirstX(ctx context.Context) *GameUser

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

func (*GameUserQuery) GroupBy

func (guq *GameUserQuery) GroupBy(field string, fields ...string) *GameUserGroupBy

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 {
	CreatedBy int64 `json:"created_by"`
	Count int `json:"count,omitempty"`
}

client.GameUser.Query().
	GroupBy(gameuser.FieldCreatedBy).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*GameUserQuery) IDs

func (guq *GameUserQuery) IDs(ctx context.Context) ([]int64, error)

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

func (*GameUserQuery) IDsX

func (guq *GameUserQuery) IDsX(ctx context.Context) []int64

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

func (*GameUserQuery) Limit

func (guq *GameUserQuery) Limit(limit int) *GameUserQuery

Limit adds a limit step to the query.

func (*GameUserQuery) Offset

func (guq *GameUserQuery) Offset(offset int) *GameUserQuery

Offset adds an offset step to the query.

func (*GameUserQuery) Only

func (guq *GameUserQuery) Only(ctx context.Context) (*GameUser, error)

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

func (*GameUserQuery) OnlyID

func (guq *GameUserQuery) OnlyID(ctx context.Context) (id int64, err error)

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

func (*GameUserQuery) OnlyIDX

func (guq *GameUserQuery) OnlyIDX(ctx context.Context) int64

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

func (*GameUserQuery) OnlyX

func (guq *GameUserQuery) OnlyX(ctx context.Context) *GameUser

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

func (*GameUserQuery) Order

func (guq *GameUserQuery) Order(o ...OrderFunc) *GameUserQuery

Order adds an order step to the query.

func (*GameUserQuery) Paginate

func (gu *GameUserQuery) Paginate(
	ctx context.Context, after *Cursor, first *int,
	before *Cursor, last *int, opts ...GameUserPaginateOption,
) (*GameUserConnection, error)

Paginate executes the query and returns a relay based cursor connection to GameUser.

func (*GameUserQuery) QueryCard

func (guq *GameUserQuery) QueryCard() *CardQuery

QueryCard chains the current query on the "card" edge.

func (*GameUserQuery) QueryGame

func (guq *GameUserQuery) QueryGame() *GameQuery

QueryGame chains the current query on the "game" edge.

func (*GameUserQuery) Select

func (guq *GameUserQuery) Select(fields ...string) *GameUserSelect

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 {
	CreatedBy int64 `json:"created_by"`
}

client.GameUser.Query().
	Select(gameuser.FieldCreatedBy).
	Scan(ctx, &v)

func (*GameUserQuery) Unique

func (guq *GameUserQuery) Unique(unique bool) *GameUserQuery

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

func (guq *GameUserQuery) Where(ps ...predicate.GameUser) *GameUserQuery

Where adds a new predicate for the GameUserQuery builder.

func (*GameUserQuery) WithCard

func (guq *GameUserQuery) WithCard(opts ...func(*CardQuery)) *GameUserQuery

WithCard tells the query-builder to eager-load the nodes that are connected to the "card" edge. The optional arguments are used to configure the query builder of the edge.

func (*GameUserQuery) WithGame

func (guq *GameUserQuery) WithGame(opts ...func(*GameQuery)) *GameUserQuery

WithGame tells the query-builder to eager-load the nodes that are connected to the "game" edge. The optional arguments are used to configure the query builder of the edge.

type GameUserSelect

type GameUserSelect struct {
	*GameUserQuery
	// contains filtered or unexported fields
}

GameUserSelect is the builder for selecting fields of GameUser entities.

func (*GameUserSelect) Aggregate

func (gus *GameUserSelect) Aggregate(fns ...AggregateFunc) *GameUserSelect

Aggregate adds the given aggregation functions to the selector query.

func (*GameUserSelect) Bool

func (s *GameUserSelect) Bool(ctx context.Context) (_ bool, err error)

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

func (*GameUserSelect) BoolX

func (s *GameUserSelect) BoolX(ctx context.Context) bool

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

func (*GameUserSelect) Bools

func (s *GameUserSelect) Bools(ctx context.Context) ([]bool, error)

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

func (*GameUserSelect) BoolsX

func (s *GameUserSelect) BoolsX(ctx context.Context) []bool

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

func (*GameUserSelect) Float64

func (s *GameUserSelect) Float64(ctx context.Context) (_ float64, err error)

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

func (*GameUserSelect) Float64X

func (s *GameUserSelect) Float64X(ctx context.Context) float64

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

func (*GameUserSelect) Float64s

func (s *GameUserSelect) Float64s(ctx context.Context) ([]float64, error)

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

func (*GameUserSelect) Float64sX

func (s *GameUserSelect) Float64sX(ctx context.Context) []float64

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

func (*GameUserSelect) Int

func (s *GameUserSelect) Int(ctx context.Context) (_ int, err error)

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

func (*GameUserSelect) IntX

func (s *GameUserSelect) IntX(ctx context.Context) int

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

func (*GameUserSelect) Ints

func (s *GameUserSelect) Ints(ctx context.Context) ([]int, error)

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

func (*GameUserSelect) IntsX

func (s *GameUserSelect) IntsX(ctx context.Context) []int

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

func (*GameUserSelect) Scan

func (gus *GameUserSelect) Scan(ctx context.Context, v any) error

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

func (*GameUserSelect) ScanX

func (s *GameUserSelect) ScanX(ctx context.Context, v any)

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

func (*GameUserSelect) String

func (s *GameUserSelect) String(ctx context.Context) (_ string, err error)

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

func (*GameUserSelect) StringX

func (s *GameUserSelect) StringX(ctx context.Context) string

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

func (*GameUserSelect) Strings

func (s *GameUserSelect) Strings(ctx context.Context) ([]string, error)

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

func (*GameUserSelect) StringsX

func (s *GameUserSelect) StringsX(ctx context.Context) []string

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

type GameUserUpdate

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

GameUserUpdate is the builder for updating GameUser entities.

func (*GameUserUpdate) AddCreatedBy

func (guu *GameUserUpdate) AddCreatedBy(i int64) *GameUserUpdate

AddCreatedBy adds i to the "created_by" field.

func (*GameUserUpdate) AddNumber

func (guu *GameUserUpdate) AddNumber(u int8) *GameUserUpdate

AddNumber adds u to the "number" field.

func (*GameUserUpdate) AddUpdatedBy

func (guu *GameUserUpdate) AddUpdatedBy(i int64) *GameUserUpdate

AddUpdatedBy adds i to the "updated_by" field.

func (*GameUserUpdate) AddUserID

func (guu *GameUserUpdate) AddUserID(i int64) *GameUserUpdate

AddUserID adds i to the "user_id" field.

func (*GameUserUpdate) ClearCard

func (guu *GameUserUpdate) ClearCard() *GameUserUpdate

ClearCard clears the "card" edge to the Card entity.

func (*GameUserUpdate) ClearGame

func (guu *GameUserUpdate) ClearGame() *GameUserUpdate

ClearGame clears the "game" edge to the Game entity.

func (*GameUserUpdate) Exec

func (guu *GameUserUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*GameUserUpdate) ExecX

func (guu *GameUserUpdate) ExecX(ctx context.Context)

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

func (*GameUserUpdate) Mutation

func (guu *GameUserUpdate) Mutation() *GameUserMutation

Mutation returns the GameUserMutation object of the builder.

func (*GameUserUpdate) Save

func (guu *GameUserUpdate) Save(ctx context.Context) (int, error)

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

func (*GameUserUpdate) SaveX

func (guu *GameUserUpdate) SaveX(ctx context.Context) int

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

func (*GameUserUpdate) SetCard

func (guu *GameUserUpdate) SetCard(c *Card) *GameUserUpdate

SetCard sets the "card" edge to the Card entity.

func (*GameUserUpdate) SetCardID

func (guu *GameUserUpdate) SetCardID(i int64) *GameUserUpdate

SetCardID sets the "card_id" field.

func (*GameUserUpdate) SetCreatedBy

func (guu *GameUserUpdate) SetCreatedBy(i int64) *GameUserUpdate

SetCreatedBy sets the "created_by" field.

func (*GameUserUpdate) SetDeletedAt

func (guu *GameUserUpdate) SetDeletedAt(t time.Time) *GameUserUpdate

SetDeletedAt sets the "deleted_at" field.

func (*GameUserUpdate) SetExited

func (guu *GameUserUpdate) SetExited(b bool) *GameUserUpdate

SetExited sets the "exited" field.

func (*GameUserUpdate) SetGame

func (guu *GameUserUpdate) SetGame(g *Game) *GameUserUpdate

SetGame sets the "game" edge to the Game entity.

func (*GameUserUpdate) SetGameID

func (guu *GameUserUpdate) SetGameID(i int64) *GameUserUpdate

SetGameID sets the "game_id" field.

func (*GameUserUpdate) SetInput

SetInput applies the change-set in the UpdateGameUserInput on the GameUserUpdate builder.

func (*GameUserUpdate) SetNillableCreatedBy

func (guu *GameUserUpdate) SetNillableCreatedBy(i *int64) *GameUserUpdate

SetNillableCreatedBy sets the "created_by" field if the given value is not nil.

func (*GameUserUpdate) SetNillableDeletedAt

func (guu *GameUserUpdate) SetNillableDeletedAt(t *time.Time) *GameUserUpdate

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*GameUserUpdate) SetNillableExited

func (guu *GameUserUpdate) SetNillableExited(b *bool) *GameUserUpdate

SetNillableExited sets the "exited" field if the given value is not nil.

func (*GameUserUpdate) SetNillableUpdatedBy

func (guu *GameUserUpdate) SetNillableUpdatedBy(i *int64) *GameUserUpdate

SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil.

func (*GameUserUpdate) SetNumber

func (guu *GameUserUpdate) SetNumber(u uint8) *GameUserUpdate

SetNumber sets the "number" field.

func (*GameUserUpdate) SetUpdatedAt

func (guu *GameUserUpdate) SetUpdatedAt(t time.Time) *GameUserUpdate

SetUpdatedAt sets the "updated_at" field.

func (*GameUserUpdate) SetUpdatedBy

func (guu *GameUserUpdate) SetUpdatedBy(i int64) *GameUserUpdate

SetUpdatedBy sets the "updated_by" field.

func (*GameUserUpdate) SetUserID

func (guu *GameUserUpdate) SetUserID(i int64) *GameUserUpdate

SetUserID sets the "user_id" field.

func (*GameUserUpdate) Where

func (guu *GameUserUpdate) Where(ps ...predicate.GameUser) *GameUserUpdate

Where appends a list predicates to the GameUserUpdate builder.

type GameUserUpdateOne

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

GameUserUpdateOne is the builder for updating a single GameUser entity.

func (*GameUserUpdateOne) AddCreatedBy

func (guuo *GameUserUpdateOne) AddCreatedBy(i int64) *GameUserUpdateOne

AddCreatedBy adds i to the "created_by" field.

func (*GameUserUpdateOne) AddNumber

func (guuo *GameUserUpdateOne) AddNumber(u int8) *GameUserUpdateOne

AddNumber adds u to the "number" field.

func (*GameUserUpdateOne) AddUpdatedBy

func (guuo *GameUserUpdateOne) AddUpdatedBy(i int64) *GameUserUpdateOne

AddUpdatedBy adds i to the "updated_by" field.

func (*GameUserUpdateOne) AddUserID

func (guuo *GameUserUpdateOne) AddUserID(i int64) *GameUserUpdateOne

AddUserID adds i to the "user_id" field.

func (*GameUserUpdateOne) ClearCard

func (guuo *GameUserUpdateOne) ClearCard() *GameUserUpdateOne

ClearCard clears the "card" edge to the Card entity.

func (*GameUserUpdateOne) ClearGame

func (guuo *GameUserUpdateOne) ClearGame() *GameUserUpdateOne

ClearGame clears the "game" edge to the Game entity.

func (*GameUserUpdateOne) Exec

func (guuo *GameUserUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*GameUserUpdateOne) ExecX

func (guuo *GameUserUpdateOne) ExecX(ctx context.Context)

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

func (*GameUserUpdateOne) Mutation

func (guuo *GameUserUpdateOne) Mutation() *GameUserMutation

Mutation returns the GameUserMutation object of the builder.

func (*GameUserUpdateOne) Save

func (guuo *GameUserUpdateOne) Save(ctx context.Context) (*GameUser, error)

Save executes the query and returns the updated GameUser entity.

func (*GameUserUpdateOne) SaveX

func (guuo *GameUserUpdateOne) SaveX(ctx context.Context) *GameUser

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

func (*GameUserUpdateOne) Select

func (guuo *GameUserUpdateOne) Select(field string, fields ...string) *GameUserUpdateOne

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

func (*GameUserUpdateOne) SetCard

func (guuo *GameUserUpdateOne) SetCard(c *Card) *GameUserUpdateOne

SetCard sets the "card" edge to the Card entity.

func (*GameUserUpdateOne) SetCardID

func (guuo *GameUserUpdateOne) SetCardID(i int64) *GameUserUpdateOne

SetCardID sets the "card_id" field.

func (*GameUserUpdateOne) SetCreatedBy

func (guuo *GameUserUpdateOne) SetCreatedBy(i int64) *GameUserUpdateOne

SetCreatedBy sets the "created_by" field.

func (*GameUserUpdateOne) SetDeletedAt

func (guuo *GameUserUpdateOne) SetDeletedAt(t time.Time) *GameUserUpdateOne

SetDeletedAt sets the "deleted_at" field.

func (*GameUserUpdateOne) SetExited

func (guuo *GameUserUpdateOne) SetExited(b bool) *GameUserUpdateOne

SetExited sets the "exited" field.

func (*GameUserUpdateOne) SetGame

func (guuo *GameUserUpdateOne) SetGame(g *Game) *GameUserUpdateOne

SetGame sets the "game" edge to the Game entity.

func (*GameUserUpdateOne) SetGameID

func (guuo *GameUserUpdateOne) SetGameID(i int64) *GameUserUpdateOne

SetGameID sets the "game_id" field.

func (*GameUserUpdateOne) SetInput

SetInput applies the change-set in the UpdateGameUserInput on the GameUserUpdateOne builder.

func (*GameUserUpdateOne) SetNillableCreatedBy

func (guuo *GameUserUpdateOne) SetNillableCreatedBy(i *int64) *GameUserUpdateOne

SetNillableCreatedBy sets the "created_by" field if the given value is not nil.

func (*GameUserUpdateOne) SetNillableDeletedAt

func (guuo *GameUserUpdateOne) SetNillableDeletedAt(t *time.Time) *GameUserUpdateOne

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*GameUserUpdateOne) SetNillableExited

func (guuo *GameUserUpdateOne) SetNillableExited(b *bool) *GameUserUpdateOne

SetNillableExited sets the "exited" field if the given value is not nil.

func (*GameUserUpdateOne) SetNillableUpdatedBy

func (guuo *GameUserUpdateOne) SetNillableUpdatedBy(i *int64) *GameUserUpdateOne

SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil.

func (*GameUserUpdateOne) SetNumber

func (guuo *GameUserUpdateOne) SetNumber(u uint8) *GameUserUpdateOne

SetNumber sets the "number" field.

func (*GameUserUpdateOne) SetUpdatedAt

func (guuo *GameUserUpdateOne) SetUpdatedAt(t time.Time) *GameUserUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*GameUserUpdateOne) SetUpdatedBy

func (guuo *GameUserUpdateOne) SetUpdatedBy(i int64) *GameUserUpdateOne

SetUpdatedBy sets the "updated_by" field.

func (*GameUserUpdateOne) SetUserID

func (guuo *GameUserUpdateOne) SetUserID(i int64) *GameUserUpdateOne

SetUserID sets the "user_id" field.

type GameUserWhereInput

type GameUserWhereInput struct {
	Predicates []predicate.GameUser  `json:"-"`
	Not        *GameUserWhereInput   `json:"not,omitempty"`
	Or         []*GameUserWhereInput `json:"or,omitempty"`
	And        []*GameUserWhereInput `json:"and,omitempty"`

	// "id" field predicates.
	ID      *int64  `json:"id,omitempty"`
	IDNEQ   *int64  `json:"idNEQ,omitempty"`
	IDIn    []int64 `json:"idIn,omitempty"`
	IDNotIn []int64 `json:"idNotIn,omitempty"`
	IDGT    *int64  `json:"idGT,omitempty"`
	IDGTE   *int64  `json:"idGTE,omitempty"`
	IDLT    *int64  `json:"idLT,omitempty"`
	IDLTE   *int64  `json:"idLTE,omitempty"`

	// "created_by" field predicates.
	CreatedBy      *int64  `json:"createdBy,omitempty"`
	CreatedByNEQ   *int64  `json:"createdByNEQ,omitempty"`
	CreatedByIn    []int64 `json:"createdByIn,omitempty"`
	CreatedByNotIn []int64 `json:"createdByNotIn,omitempty"`
	CreatedByGT    *int64  `json:"createdByGT,omitempty"`
	CreatedByGTE   *int64  `json:"createdByGTE,omitempty"`
	CreatedByLT    *int64  `json:"createdByLT,omitempty"`
	CreatedByLTE   *int64  `json:"createdByLTE,omitempty"`

	// "updated_by" field predicates.
	UpdatedBy      *int64  `json:"updatedBy,omitempty"`
	UpdatedByNEQ   *int64  `json:"updatedByNEQ,omitempty"`
	UpdatedByIn    []int64 `json:"updatedByIn,omitempty"`
	UpdatedByNotIn []int64 `json:"updatedByNotIn,omitempty"`
	UpdatedByGT    *int64  `json:"updatedByGT,omitempty"`
	UpdatedByGTE   *int64  `json:"updatedByGTE,omitempty"`
	UpdatedByLT    *int64  `json:"updatedByLT,omitempty"`
	UpdatedByLTE   *int64  `json:"updatedByLTE,omitempty"`

	// "created_at" field predicates.
	CreatedAt      *time.Time  `json:"createdAt,omitempty"`
	CreatedAtNEQ   *time.Time  `json:"createdAtNEQ,omitempty"`
	CreatedAtIn    []time.Time `json:"createdAtIn,omitempty"`
	CreatedAtNotIn []time.Time `json:"createdAtNotIn,omitempty"`
	CreatedAtGT    *time.Time  `json:"createdAtGT,omitempty"`
	CreatedAtGTE   *time.Time  `json:"createdAtGTE,omitempty"`
	CreatedAtLT    *time.Time  `json:"createdAtLT,omitempty"`
	CreatedAtLTE   *time.Time  `json:"createdAtLTE,omitempty"`

	// "updated_at" field predicates.
	UpdatedAt      *time.Time  `json:"updatedAt,omitempty"`
	UpdatedAtNEQ   *time.Time  `json:"updatedAtNEQ,omitempty"`
	UpdatedAtIn    []time.Time `json:"updatedAtIn,omitempty"`
	UpdatedAtNotIn []time.Time `json:"updatedAtNotIn,omitempty"`
	UpdatedAtGT    *time.Time  `json:"updatedAtGT,omitempty"`
	UpdatedAtGTE   *time.Time  `json:"updatedAtGTE,omitempty"`
	UpdatedAtLT    *time.Time  `json:"updatedAtLT,omitempty"`
	UpdatedAtLTE   *time.Time  `json:"updatedAtLTE,omitempty"`

	// "deleted_at" field predicates.
	DeletedAt      *time.Time  `json:"deletedAt,omitempty"`
	DeletedAtNEQ   *time.Time  `json:"deletedAtNEQ,omitempty"`
	DeletedAtIn    []time.Time `json:"deletedAtIn,omitempty"`
	DeletedAtNotIn []time.Time `json:"deletedAtNotIn,omitempty"`
	DeletedAtGT    *time.Time  `json:"deletedAtGT,omitempty"`
	DeletedAtGTE   *time.Time  `json:"deletedAtGTE,omitempty"`
	DeletedAtLT    *time.Time  `json:"deletedAtLT,omitempty"`
	DeletedAtLTE   *time.Time  `json:"deletedAtLTE,omitempty"`

	// "user_id" field predicates.
	UserID      *int64  `json:"userID,omitempty"`
	UserIDNEQ   *int64  `json:"userIDNEQ,omitempty"`
	UserIDIn    []int64 `json:"userIDIn,omitempty"`
	UserIDNotIn []int64 `json:"userIDNotIn,omitempty"`
	UserIDGT    *int64  `json:"userIDGT,omitempty"`
	UserIDGTE   *int64  `json:"userIDGTE,omitempty"`
	UserIDLT    *int64  `json:"userIDLT,omitempty"`
	UserIDLTE   *int64  `json:"userIDLTE,omitempty"`

	// "game_id" field predicates.
	GameID      *int64  `json:"gameID,omitempty"`
	GameIDNEQ   *int64  `json:"gameIDNEQ,omitempty"`
	GameIDIn    []int64 `json:"gameIDIn,omitempty"`
	GameIDNotIn []int64 `json:"gameIDNotIn,omitempty"`

	// "card_id" field predicates.
	CardID      *int64  `json:"cardID,omitempty"`
	CardIDNEQ   *int64  `json:"cardIDNEQ,omitempty"`
	CardIDIn    []int64 `json:"cardIDIn,omitempty"`
	CardIDNotIn []int64 `json:"cardIDNotIn,omitempty"`

	// "number" field predicates.
	Number      *uint8  `json:"number,omitempty"`
	NumberNEQ   *uint8  `json:"numberNEQ,omitempty"`
	NumberIn    []uint8 `json:"numberIn,omitempty"`
	NumberNotIn []uint8 `json:"numberNotIn,omitempty"`
	NumberGT    *uint8  `json:"numberGT,omitempty"`
	NumberGTE   *uint8  `json:"numberGTE,omitempty"`
	NumberLT    *uint8  `json:"numberLT,omitempty"`
	NumberLTE   *uint8  `json:"numberLTE,omitempty"`

	// "exited" field predicates.
	Exited    *bool `json:"exited,omitempty"`
	ExitedNEQ *bool `json:"exitedNEQ,omitempty"`

	// "game" edge predicates.
	HasGame     *bool             `json:"hasGame,omitempty"`
	HasGameWith []*GameWhereInput `json:"hasGameWith,omitempty"`

	// "card" edge predicates.
	HasCard     *bool             `json:"hasCard,omitempty"`
	HasCardWith []*CardWhereInput `json:"hasCardWith,omitempty"`
}

GameUserWhereInput represents a where input for filtering GameUser queries.

func (*GameUserWhereInput) AddPredicates

func (i *GameUserWhereInput) AddPredicates(predicates ...predicate.GameUser)

AddPredicates adds custom predicates to the where input to be used during the filtering phase.

func (*GameUserWhereInput) Filter

Filter applies the GameUserWhereInput filter on the GameUserQuery builder.

func (*GameUserWhereInput) P

P returns a predicate for filtering gameusers. An error is returned if the input is empty or invalid.

type GameUsers

type GameUsers []*GameUser

GameUsers is a parsable slice of GameUser.

type GameWhereInput

type GameWhereInput struct {
	Predicates []predicate.Game  `json:"-"`
	Not        *GameWhereInput   `json:"not,omitempty"`
	Or         []*GameWhereInput `json:"or,omitempty"`
	And        []*GameWhereInput `json:"and,omitempty"`

	// "id" field predicates.
	ID      *int64  `json:"id,omitempty"`
	IDNEQ   *int64  `json:"idNEQ,omitempty"`
	IDIn    []int64 `json:"idIn,omitempty"`
	IDNotIn []int64 `json:"idNotIn,omitempty"`
	IDGT    *int64  `json:"idGT,omitempty"`
	IDGTE   *int64  `json:"idGTE,omitempty"`
	IDLT    *int64  `json:"idLT,omitempty"`
	IDLTE   *int64  `json:"idLTE,omitempty"`

	// "created_by" field predicates.
	CreatedBy      *int64  `json:"createdBy,omitempty"`
	CreatedByNEQ   *int64  `json:"createdByNEQ,omitempty"`
	CreatedByIn    []int64 `json:"createdByIn,omitempty"`
	CreatedByNotIn []int64 `json:"createdByNotIn,omitempty"`
	CreatedByGT    *int64  `json:"createdByGT,omitempty"`
	CreatedByGTE   *int64  `json:"createdByGTE,omitempty"`
	CreatedByLT    *int64  `json:"createdByLT,omitempty"`
	CreatedByLTE   *int64  `json:"createdByLTE,omitempty"`

	// "updated_by" field predicates.
	UpdatedBy      *int64  `json:"updatedBy,omitempty"`
	UpdatedByNEQ   *int64  `json:"updatedByNEQ,omitempty"`
	UpdatedByIn    []int64 `json:"updatedByIn,omitempty"`
	UpdatedByNotIn []int64 `json:"updatedByNotIn,omitempty"`
	UpdatedByGT    *int64  `json:"updatedByGT,omitempty"`
	UpdatedByGTE   *int64  `json:"updatedByGTE,omitempty"`
	UpdatedByLT    *int64  `json:"updatedByLT,omitempty"`
	UpdatedByLTE   *int64  `json:"updatedByLTE,omitempty"`

	// "created_at" field predicates.
	CreatedAt      *time.Time  `json:"createdAt,omitempty"`
	CreatedAtNEQ   *time.Time  `json:"createdAtNEQ,omitempty"`
	CreatedAtIn    []time.Time `json:"createdAtIn,omitempty"`
	CreatedAtNotIn []time.Time `json:"createdAtNotIn,omitempty"`
	CreatedAtGT    *time.Time  `json:"createdAtGT,omitempty"`
	CreatedAtGTE   *time.Time  `json:"createdAtGTE,omitempty"`
	CreatedAtLT    *time.Time  `json:"createdAtLT,omitempty"`
	CreatedAtLTE   *time.Time  `json:"createdAtLTE,omitempty"`

	// "updated_at" field predicates.
	UpdatedAt      *time.Time  `json:"updatedAt,omitempty"`
	UpdatedAtNEQ   *time.Time  `json:"updatedAtNEQ,omitempty"`
	UpdatedAtIn    []time.Time `json:"updatedAtIn,omitempty"`
	UpdatedAtNotIn []time.Time `json:"updatedAtNotIn,omitempty"`
	UpdatedAtGT    *time.Time  `json:"updatedAtGT,omitempty"`
	UpdatedAtGTE   *time.Time  `json:"updatedAtGTE,omitempty"`
	UpdatedAtLT    *time.Time  `json:"updatedAtLT,omitempty"`
	UpdatedAtLTE   *time.Time  `json:"updatedAtLTE,omitempty"`

	// "deleted_at" field predicates.
	DeletedAt      *time.Time  `json:"deletedAt,omitempty"`
	DeletedAtNEQ   *time.Time  `json:"deletedAtNEQ,omitempty"`
	DeletedAtIn    []time.Time `json:"deletedAtIn,omitempty"`
	DeletedAtNotIn []time.Time `json:"deletedAtNotIn,omitempty"`
	DeletedAtGT    *time.Time  `json:"deletedAtGT,omitempty"`
	DeletedAtGTE   *time.Time  `json:"deletedAtGTE,omitempty"`
	DeletedAtLT    *time.Time  `json:"deletedAtLT,omitempty"`
	DeletedAtLTE   *time.Time  `json:"deletedAtLTE,omitempty"`

	// "room_id" field predicates.
	RoomID      *int64  `json:"roomID,omitempty"`
	RoomIDNEQ   *int64  `json:"roomIDNEQ,omitempty"`
	RoomIDIn    []int64 `json:"roomIDIn,omitempty"`
	RoomIDNotIn []int64 `json:"roomIDNotIn,omitempty"`

	// "result" field predicates.
	Result      *game.Result  `json:"result,omitempty"`
	ResultNEQ   *game.Result  `json:"resultNEQ,omitempty"`
	ResultIn    []game.Result `json:"resultIn,omitempty"`
	ResultNotIn []game.Result `json:"resultNotIn,omitempty"`

	// "capacity" field predicates.
	Capacity      *uint8  `json:"capacity,omitempty"`
	CapacityNEQ   *uint8  `json:"capacityNEQ,omitempty"`
	CapacityIn    []uint8 `json:"capacityIn,omitempty"`
	CapacityNotIn []uint8 `json:"capacityNotIn,omitempty"`
	CapacityGT    *uint8  `json:"capacityGT,omitempty"`
	CapacityGTE   *uint8  `json:"capacityGTE,omitempty"`
	CapacityLT    *uint8  `json:"capacityLT,omitempty"`
	CapacityLTE   *uint8  `json:"capacityLTE,omitempty"`

	// "assassin_chance" field predicates.
	AssassinChance      *uint8  `json:"assassinChance,omitempty"`
	AssassinChanceNEQ   *uint8  `json:"assassinChanceNEQ,omitempty"`
	AssassinChanceIn    []uint8 `json:"assassinChanceIn,omitempty"`
	AssassinChanceNotIn []uint8 `json:"assassinChanceNotIn,omitempty"`
	AssassinChanceGT    *uint8  `json:"assassinChanceGT,omitempty"`
	AssassinChanceGTE   *uint8  `json:"assassinChanceGTE,omitempty"`
	AssassinChanceLT    *uint8  `json:"assassinChanceLT,omitempty"`
	AssassinChanceLTE   *uint8  `json:"assassinChanceLTE,omitempty"`

	// "closed" field predicates.
	Closed    *bool `json:"closed,omitempty"`
	ClosedNEQ *bool `json:"closedNEQ,omitempty"`

	// "game_users" edge predicates.
	HasGameUsers     *bool                 `json:"hasGameUsers,omitempty"`
	HasGameUsersWith []*GameUserWhereInput `json:"hasGameUsersWith,omitempty"`

	// "missions" edge predicates.
	HasMissions     *bool                `json:"hasMissions,omitempty"`
	HasMissionsWith []*MissionWhereInput `json:"hasMissionsWith,omitempty"`

	// "room" edge predicates.
	HasRoom     *bool             `json:"hasRoom,omitempty"`
	HasRoomWith []*RoomWhereInput `json:"hasRoomWith,omitempty"`
}

GameWhereInput represents a where input for filtering Game queries.

func (*GameWhereInput) AddPredicates

func (i *GameWhereInput) AddPredicates(predicates ...predicate.Game)

AddPredicates adds custom predicates to the where input to be used during the filtering phase.

func (*GameWhereInput) Filter

func (i *GameWhereInput) Filter(q *GameQuery) (*GameQuery, error)

Filter applies the GameWhereInput filter on the GameQuery builder.

func (*GameWhereInput) P

func (i *GameWhereInput) P() (predicate.Game, error)

P returns a predicate for filtering games. An error is returned if the input is empty or invalid.

type Games

type Games []*Game

Games is a parsable slice of Game.

type Hook

type Hook = ent.Hook

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

type Mission

type Mission struct {

	// ID of the ent.
	ID int64 `json:"id,omitempty"`
	// CreatedBy holds the value of the "created_by" field.
	CreatedBy int64 `json:"created_by"`
	// UpdatedBy holds the value of the "updated_by" field.
	UpdatedBy int64 `json:"updated_by"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at"`
	// UpdatedAt holds the value of the "updated_at" field.
	UpdatedAt time.Time `json:"updated_at"`
	// DeletedAt holds the value of the "deleted_at" field.
	DeletedAt time.Time `json:"deleted_at"`
	// 排序
	Sequence uint8 `json:"sequence"`
	// 任务状态
	Status mission.Status `json:"status"`
	// 是否失败
	Failed bool `json:"failed"`
	// 所属游戏 ID
	GameID int64 `json:"game_id"`
	// 需出征人数
	Capacity uint8 `json:"capacity"`
	// 队长用户 ID
	LeaderID int64 `json:"leader_id"`
	// 是否保护轮
	Protected bool `json:"protected"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the MissionQuery when eager-loading is set.
	Edges MissionEdges `json:"edges"`
	// contains filtered or unexported fields
}

Mission is the model entity for the Mission schema.

func (*Mission) Game

func (m *Mission) Game(ctx context.Context) (*Game, error)

func (Mission) IsEntity

func (m Mission) IsEntity()

IsEntity implement fedruntime.Entity

func (*Mission) NamedSquads

func (m *Mission) NamedSquads(name string) ([]*Squad, error)

NamedSquads returns the Squads named value or an error if the edge was not loaded in eager-loading with this name.

func (*Mission) NamedVotes

func (m *Mission) NamedVotes(name string) ([]*Vote, error)

NamedVotes returns the Votes named value or an error if the edge was not loaded in eager-loading with this name.

func (*Mission) Node

func (m *Mission) Node(ctx context.Context) (node *Node, err error)

func (*Mission) QueryGame

func (m *Mission) QueryGame() *GameQuery

QueryGame queries the "game" edge of the Mission entity.

func (*Mission) QuerySquads

func (m *Mission) QuerySquads() *SquadQuery

QuerySquads queries the "squads" edge of the Mission entity.

func (*Mission) QueryVotes

func (m *Mission) QueryVotes() *VoteQuery

QueryVotes queries the "votes" edge of the Mission entity.

func (*Mission) Squads

func (m *Mission) Squads(ctx context.Context) (result []*Squad, err error)

func (*Mission) String

func (m *Mission) String() string

String implements the fmt.Stringer.

func (*Mission) ToEdge

func (m *Mission) ToEdge(order *MissionOrder) *MissionEdge

ToEdge converts Mission into MissionEdge.

func (*Mission) Unwrap

func (m *Mission) Unwrap() *Mission

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

func (m *Mission) Update() *MissionUpdateOne

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

func (*Mission) Votes

func (m *Mission) Votes(ctx context.Context) (result []*Vote, err error)

type MissionClient

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

MissionClient is a client for the Mission schema.

func NewMissionClient

func NewMissionClient(c config) *MissionClient

NewMissionClient returns a client for the Mission from the given config.

func (*MissionClient) Create

func (c *MissionClient) Create() *MissionCreate

Create returns a builder for creating a Mission entity.

func (*MissionClient) CreateBulk

func (c *MissionClient) CreateBulk(builders ...*MissionCreate) *MissionCreateBulk

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

func (*MissionClient) Delete

func (c *MissionClient) Delete() *MissionDelete

Delete returns a delete builder for Mission.

func (*MissionClient) DeleteOne

func (c *MissionClient) DeleteOne(m *Mission) *MissionDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*MissionClient) DeleteOneID

func (c *MissionClient) DeleteOneID(id int64) *MissionDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*MissionClient) Get

func (c *MissionClient) Get(ctx context.Context, id int64) (*Mission, error)

Get returns a Mission entity by its id.

func (*MissionClient) GetX

func (c *MissionClient) GetX(ctx context.Context, id int64) *Mission

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

func (*MissionClient) Hooks

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

Hooks returns the client hooks.

func (*MissionClient) Query

func (c *MissionClient) Query() *MissionQuery

Query returns a query builder for Mission.

func (*MissionClient) QueryGame

func (c *MissionClient) QueryGame(m *Mission) *GameQuery

QueryGame queries the game edge of a Mission.

func (*MissionClient) QuerySquads

func (c *MissionClient) QuerySquads(m *Mission) *SquadQuery

QuerySquads queries the squads edge of a Mission.

func (*MissionClient) QueryVotes

func (c *MissionClient) QueryVotes(m *Mission) *VoteQuery

QueryVotes queries the votes edge of a Mission.

func (*MissionClient) Update

func (c *MissionClient) Update() *MissionUpdate

Update returns an update builder for Mission.

func (*MissionClient) UpdateOne

func (c *MissionClient) UpdateOne(m *Mission) *MissionUpdateOne

UpdateOne returns an update builder for the given entity.

func (*MissionClient) UpdateOneID

func (c *MissionClient) UpdateOneID(id int64) *MissionUpdateOne

UpdateOneID returns an update builder for the given id.

func (*MissionClient) Use

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

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

type MissionConnection

type MissionConnection struct {
	Edges      []*MissionEdge `json:"edges"`
	PageInfo   PageInfo       `json:"pageInfo"`
	TotalCount int            `json:"totalCount"`
}

MissionConnection is the connection containing edges to Mission.

type MissionCreate

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

MissionCreate is the builder for creating a Mission entity.

func (*MissionCreate) AddSquadIDs

func (mc *MissionCreate) AddSquadIDs(ids ...int64) *MissionCreate

AddSquadIDs adds the "squads" edge to the Squad entity by IDs.

func (*MissionCreate) AddSquads

func (mc *MissionCreate) AddSquads(s ...*Squad) *MissionCreate

AddSquads adds the "squads" edges to the Squad entity.

func (*MissionCreate) AddVoteIDs

func (mc *MissionCreate) AddVoteIDs(ids ...int64) *MissionCreate

AddVoteIDs adds the "votes" edge to the Vote entity by IDs.

func (*MissionCreate) AddVotes

func (mc *MissionCreate) AddVotes(v ...*Vote) *MissionCreate

AddVotes adds the "votes" edges to the Vote entity.

func (*MissionCreate) Exec

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

Exec executes the query.

func (*MissionCreate) ExecX

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

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

func (*MissionCreate) Mutation

func (mc *MissionCreate) Mutation() *MissionMutation

Mutation returns the MissionMutation object of the builder.

func (*MissionCreate) Save

func (mc *MissionCreate) Save(ctx context.Context) (*Mission, error)

Save creates the Mission in the database.

func (*MissionCreate) SaveX

func (mc *MissionCreate) SaveX(ctx context.Context) *Mission

SaveX calls Save and panics if Save returns an error.

func (*MissionCreate) SetCapacity

func (mc *MissionCreate) SetCapacity(u uint8) *MissionCreate

SetCapacity sets the "capacity" field.

func (*MissionCreate) SetCreatedAt

func (mc *MissionCreate) SetCreatedAt(t time.Time) *MissionCreate

SetCreatedAt sets the "created_at" field.

func (*MissionCreate) SetCreatedBy

func (mc *MissionCreate) SetCreatedBy(i int64) *MissionCreate

SetCreatedBy sets the "created_by" field.

func (*MissionCreate) SetDeletedAt

func (mc *MissionCreate) SetDeletedAt(t time.Time) *MissionCreate

SetDeletedAt sets the "deleted_at" field.

func (*MissionCreate) SetFailed

func (mc *MissionCreate) SetFailed(b bool) *MissionCreate

SetFailed sets the "failed" field.

func (*MissionCreate) SetGame

func (mc *MissionCreate) SetGame(g *Game) *MissionCreate

SetGame sets the "game" edge to the Game entity.

func (*MissionCreate) SetGameID

func (mc *MissionCreate) SetGameID(i int64) *MissionCreate

SetGameID sets the "game_id" field.

func (*MissionCreate) SetID

func (mc *MissionCreate) SetID(i int64) *MissionCreate

SetID sets the "id" field.

func (*MissionCreate) SetInput

SetInput applies the change-set in the CreateMissionInput on the MissionCreate builder.

func (*MissionCreate) SetLeaderID

func (mc *MissionCreate) SetLeaderID(i int64) *MissionCreate

SetLeaderID sets the "leader_id" field.

func (*MissionCreate) SetNillableCapacity

func (mc *MissionCreate) SetNillableCapacity(u *uint8) *MissionCreate

SetNillableCapacity sets the "capacity" field if the given value is not nil.

func (*MissionCreate) SetNillableCreatedAt

func (mc *MissionCreate) SetNillableCreatedAt(t *time.Time) *MissionCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*MissionCreate) SetNillableCreatedBy

func (mc *MissionCreate) SetNillableCreatedBy(i *int64) *MissionCreate

SetNillableCreatedBy sets the "created_by" field if the given value is not nil.

func (*MissionCreate) SetNillableDeletedAt

func (mc *MissionCreate) SetNillableDeletedAt(t *time.Time) *MissionCreate

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*MissionCreate) SetNillableFailed

func (mc *MissionCreate) SetNillableFailed(b *bool) *MissionCreate

SetNillableFailed sets the "failed" field if the given value is not nil.

func (*MissionCreate) SetNillableID

func (mc *MissionCreate) SetNillableID(i *int64) *MissionCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*MissionCreate) SetNillableLeaderID

func (mc *MissionCreate) SetNillableLeaderID(i *int64) *MissionCreate

SetNillableLeaderID sets the "leader_id" field if the given value is not nil.

func (*MissionCreate) SetNillableProtected

func (mc *MissionCreate) SetNillableProtected(b *bool) *MissionCreate

SetNillableProtected sets the "protected" field if the given value is not nil.

func (*MissionCreate) SetNillableStatus

func (mc *MissionCreate) SetNillableStatus(m *mission.Status) *MissionCreate

SetNillableStatus sets the "status" field if the given value is not nil.

func (*MissionCreate) SetNillableUpdatedAt

func (mc *MissionCreate) SetNillableUpdatedAt(t *time.Time) *MissionCreate

SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.

func (*MissionCreate) SetNillableUpdatedBy

func (mc *MissionCreate) SetNillableUpdatedBy(i *int64) *MissionCreate

SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil.

func (*MissionCreate) SetProtected

func (mc *MissionCreate) SetProtected(b bool) *MissionCreate

SetProtected sets the "protected" field.

func (*MissionCreate) SetSequence

func (mc *MissionCreate) SetSequence(u uint8) *MissionCreate

SetSequence sets the "sequence" field.

func (*MissionCreate) SetStatus

func (mc *MissionCreate) SetStatus(m mission.Status) *MissionCreate

SetStatus sets the "status" field.

func (*MissionCreate) SetUpdatedAt

func (mc *MissionCreate) SetUpdatedAt(t time.Time) *MissionCreate

SetUpdatedAt sets the "updated_at" field.

func (*MissionCreate) SetUpdatedBy

func (mc *MissionCreate) SetUpdatedBy(i int64) *MissionCreate

SetUpdatedBy sets the "updated_by" field.

type MissionCreateBulk

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

MissionCreateBulk is the builder for creating many Mission entities in bulk.

func (*MissionCreateBulk) Exec

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

Exec executes the query.

func (*MissionCreateBulk) ExecX

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

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

func (*MissionCreateBulk) Save

func (mcb *MissionCreateBulk) Save(ctx context.Context) ([]*Mission, error)

Save creates the Mission entities in the database.

func (*MissionCreateBulk) SaveX

func (mcb *MissionCreateBulk) SaveX(ctx context.Context) []*Mission

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

type MissionDelete

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

MissionDelete is the builder for deleting a Mission entity.

func (*MissionDelete) Exec

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

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

func (*MissionDelete) ExecX

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

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

func (*MissionDelete) Where

func (md *MissionDelete) Where(ps ...predicate.Mission) *MissionDelete

Where appends a list predicates to the MissionDelete builder.

type MissionDeleteOne

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

MissionDeleteOne is the builder for deleting a single Mission entity.

func (*MissionDeleteOne) Exec

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

Exec executes the deletion query.

func (*MissionDeleteOne) ExecX

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

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

type MissionEdge

type MissionEdge struct {
	Node   *Mission `json:"node"`
	Cursor Cursor   `json:"cursor"`
}

MissionEdge is the edge representation of Mission.

type MissionEdges

type MissionEdges struct {
	// Game holds the value of the game edge.
	Game *Game `json:"game,omitempty"`
	// Squads holds the value of the squads edge.
	Squads []*Squad `json:"squads,omitempty"`
	// Votes holds the value of the votes edge.
	Votes []*Vote `json:"votes,omitempty"`
	// contains filtered or unexported fields
}

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

func (MissionEdges) GameOrErr

func (e MissionEdges) GameOrErr() (*Game, error)

GameOrErr returns the Game value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

func (MissionEdges) SquadsOrErr

func (e MissionEdges) SquadsOrErr() ([]*Squad, error)

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

func (MissionEdges) VotesOrErr

func (e MissionEdges) VotesOrErr() ([]*Vote, error)

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

type MissionGroupBy

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

MissionGroupBy is the group-by builder for Mission entities.

func (*MissionGroupBy) Aggregate

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

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

func (*MissionGroupBy) Bool

func (s *MissionGroupBy) Bool(ctx context.Context) (_ bool, err error)

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

func (*MissionGroupBy) BoolX

func (s *MissionGroupBy) BoolX(ctx context.Context) bool

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

func (*MissionGroupBy) Bools

func (s *MissionGroupBy) Bools(ctx context.Context) ([]bool, error)

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

func (*MissionGroupBy) BoolsX

func (s *MissionGroupBy) BoolsX(ctx context.Context) []bool

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

func (*MissionGroupBy) Float64

func (s *MissionGroupBy) Float64(ctx context.Context) (_ float64, err error)

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

func (*MissionGroupBy) Float64X

func (s *MissionGroupBy) Float64X(ctx context.Context) float64

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

func (*MissionGroupBy) Float64s

func (s *MissionGroupBy) Float64s(ctx context.Context) ([]float64, error)

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

func (*MissionGroupBy) Float64sX

func (s *MissionGroupBy) Float64sX(ctx context.Context) []float64

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

func (*MissionGroupBy) Int

func (s *MissionGroupBy) Int(ctx context.Context) (_ int, err error)

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

func (*MissionGroupBy) IntX

func (s *MissionGroupBy) IntX(ctx context.Context) int

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

func (*MissionGroupBy) Ints

func (s *MissionGroupBy) Ints(ctx context.Context) ([]int, error)

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

func (*MissionGroupBy) IntsX

func (s *MissionGroupBy) IntsX(ctx context.Context) []int

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

func (*MissionGroupBy) Scan

func (mgb *MissionGroupBy) Scan(ctx context.Context, v any) error

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

func (*MissionGroupBy) ScanX

func (s *MissionGroupBy) ScanX(ctx context.Context, v any)

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

func (*MissionGroupBy) String

func (s *MissionGroupBy) String(ctx context.Context) (_ string, err error)

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

func (*MissionGroupBy) StringX

func (s *MissionGroupBy) StringX(ctx context.Context) string

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

func (*MissionGroupBy) Strings

func (s *MissionGroupBy) Strings(ctx context.Context) ([]string, error)

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

func (*MissionGroupBy) StringsX

func (s *MissionGroupBy) StringsX(ctx context.Context) []string

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

type MissionMutation

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

MissionMutation represents an operation that mutates the Mission nodes in the graph.

func (*MissionMutation) AddCapacity

func (m *MissionMutation) AddCapacity(u int8)

AddCapacity adds u to the "capacity" field.

func (*MissionMutation) AddCreatedBy

func (m *MissionMutation) AddCreatedBy(i int64)

AddCreatedBy adds i to the "created_by" field.

func (*MissionMutation) AddField

func (m *MissionMutation) 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 (*MissionMutation) AddLeaderID

func (m *MissionMutation) AddLeaderID(i int64)

AddLeaderID adds i to the "leader_id" field.

func (*MissionMutation) AddSequence

func (m *MissionMutation) AddSequence(u int8)

AddSequence adds u to the "sequence" field.

func (*MissionMutation) AddSquadIDs

func (m *MissionMutation) AddSquadIDs(ids ...int64)

AddSquadIDs adds the "squads" edge to the Squad entity by ids.

func (*MissionMutation) AddUpdatedBy

func (m *MissionMutation) AddUpdatedBy(i int64)

AddUpdatedBy adds i to the "updated_by" field.

func (*MissionMutation) AddVoteIDs

func (m *MissionMutation) AddVoteIDs(ids ...int64)

AddVoteIDs adds the "votes" edge to the Vote entity by ids.

func (*MissionMutation) AddedCapacity

func (m *MissionMutation) AddedCapacity() (r int8, exists bool)

AddedCapacity returns the value that was added to the "capacity" field in this mutation.

func (*MissionMutation) AddedCreatedBy

func (m *MissionMutation) AddedCreatedBy() (r int64, exists bool)

AddedCreatedBy returns the value that was added to the "created_by" field in this mutation.

func (*MissionMutation) AddedEdges

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

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

func (*MissionMutation) AddedField

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

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

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

func (*MissionMutation) AddedIDs

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

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

func (*MissionMutation) AddedLeaderID

func (m *MissionMutation) AddedLeaderID() (r int64, exists bool)

AddedLeaderID returns the value that was added to the "leader_id" field in this mutation.

func (*MissionMutation) AddedSequence

func (m *MissionMutation) AddedSequence() (r int8, exists bool)

AddedSequence returns the value that was added to the "sequence" field in this mutation.

func (*MissionMutation) AddedUpdatedBy

func (m *MissionMutation) AddedUpdatedBy() (r int64, exists bool)

AddedUpdatedBy returns the value that was added to the "updated_by" field in this mutation.

func (*MissionMutation) Capacity

func (m *MissionMutation) Capacity() (r uint8, exists bool)

Capacity returns the value of the "capacity" field in the mutation.

func (*MissionMutation) ClearEdge

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

func (m *MissionMutation) 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 (*MissionMutation) ClearGame

func (m *MissionMutation) ClearGame()

ClearGame clears the "game" edge to the Game entity.

func (*MissionMutation) ClearSquads

func (m *MissionMutation) ClearSquads()

ClearSquads clears the "squads" edge to the Squad entity.

func (*MissionMutation) ClearVotes

func (m *MissionMutation) ClearVotes()

ClearVotes clears the "votes" edge to the Vote entity.

func (*MissionMutation) ClearedEdges

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

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

func (*MissionMutation) ClearedFields

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

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

func (MissionMutation) Client

func (m MissionMutation) 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 (*MissionMutation) CreatedAt

func (m *MissionMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*MissionMutation) CreatedBy

func (m *MissionMutation) CreatedBy() (r int64, exists bool)

CreatedBy returns the value of the "created_by" field in the mutation.

func (*MissionMutation) DeletedAt

func (m *MissionMutation) DeletedAt() (r time.Time, exists bool)

DeletedAt returns the value of the "deleted_at" field in the mutation.

func (*MissionMutation) EdgeCleared

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

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

func (*MissionMutation) Failed

func (m *MissionMutation) Failed() (r bool, exists bool)

Failed returns the value of the "failed" field in the mutation.

func (*MissionMutation) Field

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

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

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

func (*MissionMutation) Fields

func (m *MissionMutation) 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 (*MissionMutation) GameCleared

func (m *MissionMutation) GameCleared() bool

GameCleared reports if the "game" edge to the Game entity was cleared.

func (*MissionMutation) GameID

func (m *MissionMutation) GameID() (r int64, exists bool)

GameID returns the value of the "game_id" field in the mutation.

func (*MissionMutation) GameIDs

func (m *MissionMutation) GameIDs() (ids []int64)

GameIDs returns the "game" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use GameID instead. It exists only for internal usage by the builders.

func (*MissionMutation) ID

func (m *MissionMutation) ID() (id int64, 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 (*MissionMutation) IDs

func (m *MissionMutation) IDs(ctx context.Context) ([]int64, error)

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

func (*MissionMutation) LeaderID

func (m *MissionMutation) LeaderID() (r int64, exists bool)

LeaderID returns the value of the "leader_id" field in the mutation.

func (*MissionMutation) OldCapacity

func (m *MissionMutation) OldCapacity(ctx context.Context) (v uint8, err error)

OldCapacity returns the old "capacity" field's value of the Mission entity. If the Mission 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 (*MissionMutation) OldCreatedAt

func (m *MissionMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the Mission entity. If the Mission 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 (*MissionMutation) OldCreatedBy

func (m *MissionMutation) OldCreatedBy(ctx context.Context) (v int64, err error)

OldCreatedBy returns the old "created_by" field's value of the Mission entity. If the Mission 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 (*MissionMutation) OldDeletedAt

func (m *MissionMutation) OldDeletedAt(ctx context.Context) (v time.Time, err error)

OldDeletedAt returns the old "deleted_at" field's value of the Mission entity. If the Mission 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 (*MissionMutation) OldFailed

func (m *MissionMutation) OldFailed(ctx context.Context) (v bool, err error)

OldFailed returns the old "failed" field's value of the Mission entity. If the Mission 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 (*MissionMutation) OldField

func (m *MissionMutation) 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 (*MissionMutation) OldGameID

func (m *MissionMutation) OldGameID(ctx context.Context) (v int64, err error)

OldGameID returns the old "game_id" field's value of the Mission entity. If the Mission 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 (*MissionMutation) OldLeaderID

func (m *MissionMutation) OldLeaderID(ctx context.Context) (v int64, err error)

OldLeaderID returns the old "leader_id" field's value of the Mission entity. If the Mission 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 (*MissionMutation) OldProtected

func (m *MissionMutation) OldProtected(ctx context.Context) (v bool, err error)

OldProtected returns the old "protected" field's value of the Mission entity. If the Mission 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 (*MissionMutation) OldSequence

func (m *MissionMutation) OldSequence(ctx context.Context) (v uint8, err error)

OldSequence returns the old "sequence" field's value of the Mission entity. If the Mission 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 (*MissionMutation) OldStatus

func (m *MissionMutation) OldStatus(ctx context.Context) (v mission.Status, err error)

OldStatus returns the old "status" field's value of the Mission entity. If the Mission 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 (*MissionMutation) OldUpdatedAt

func (m *MissionMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)

OldUpdatedAt returns the old "updated_at" field's value of the Mission entity. If the Mission 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 (*MissionMutation) OldUpdatedBy

func (m *MissionMutation) OldUpdatedBy(ctx context.Context) (v int64, err error)

OldUpdatedBy returns the old "updated_by" field's value of the Mission entity. If the Mission 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 (*MissionMutation) Op

func (m *MissionMutation) Op() Op

Op returns the operation name.

func (*MissionMutation) Protected

func (m *MissionMutation) Protected() (r bool, exists bool)

Protected returns the value of the "protected" field in the mutation.

func (*MissionMutation) RemoveSquadIDs

func (m *MissionMutation) RemoveSquadIDs(ids ...int64)

RemoveSquadIDs removes the "squads" edge to the Squad entity by IDs.

func (*MissionMutation) RemoveVoteIDs

func (m *MissionMutation) RemoveVoteIDs(ids ...int64)

RemoveVoteIDs removes the "votes" edge to the Vote entity by IDs.

func (*MissionMutation) RemovedEdges

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

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

func (*MissionMutation) RemovedIDs

func (m *MissionMutation) 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 (*MissionMutation) RemovedSquadsIDs

func (m *MissionMutation) RemovedSquadsIDs() (ids []int64)

RemovedSquads returns the removed IDs of the "squads" edge to the Squad entity.

func (*MissionMutation) RemovedVotesIDs

func (m *MissionMutation) RemovedVotesIDs() (ids []int64)

RemovedVotes returns the removed IDs of the "votes" edge to the Vote entity.

func (*MissionMutation) ResetCapacity

func (m *MissionMutation) ResetCapacity()

ResetCapacity resets all changes to the "capacity" field.

func (*MissionMutation) ResetCreatedAt

func (m *MissionMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*MissionMutation) ResetCreatedBy

func (m *MissionMutation) ResetCreatedBy()

ResetCreatedBy resets all changes to the "created_by" field.

func (*MissionMutation) ResetDeletedAt

func (m *MissionMutation) ResetDeletedAt()

ResetDeletedAt resets all changes to the "deleted_at" field.

func (*MissionMutation) ResetEdge

func (m *MissionMutation) 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 (*MissionMutation) ResetFailed

func (m *MissionMutation) ResetFailed()

ResetFailed resets all changes to the "failed" field.

func (*MissionMutation) ResetField

func (m *MissionMutation) 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 (*MissionMutation) ResetGame

func (m *MissionMutation) ResetGame()

ResetGame resets all changes to the "game" edge.

func (*MissionMutation) ResetGameID

func (m *MissionMutation) ResetGameID()

ResetGameID resets all changes to the "game_id" field.

func (*MissionMutation) ResetLeaderID

func (m *MissionMutation) ResetLeaderID()

ResetLeaderID resets all changes to the "leader_id" field.

func (*MissionMutation) ResetProtected

func (m *MissionMutation) ResetProtected()

ResetProtected resets all changes to the "protected" field.

func (*MissionMutation) ResetSequence

func (m *MissionMutation) ResetSequence()

ResetSequence resets all changes to the "sequence" field.

func (*MissionMutation) ResetSquads

func (m *MissionMutation) ResetSquads()

ResetSquads resets all changes to the "squads" edge.

func (*MissionMutation) ResetStatus

func (m *MissionMutation) ResetStatus()

ResetStatus resets all changes to the "status" field.

func (*MissionMutation) ResetUpdatedAt

func (m *MissionMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*MissionMutation) ResetUpdatedBy

func (m *MissionMutation) ResetUpdatedBy()

ResetUpdatedBy resets all changes to the "updated_by" field.

func (*MissionMutation) ResetVotes

func (m *MissionMutation) ResetVotes()

ResetVotes resets all changes to the "votes" edge.

func (*MissionMutation) Sequence

func (m *MissionMutation) Sequence() (r uint8, exists bool)

Sequence returns the value of the "sequence" field in the mutation.

func (*MissionMutation) SetCapacity

func (m *MissionMutation) SetCapacity(u uint8)

SetCapacity sets the "capacity" field.

func (*MissionMutation) SetCreatedAt

func (m *MissionMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*MissionMutation) SetCreatedBy

func (m *MissionMutation) SetCreatedBy(i int64)

SetCreatedBy sets the "created_by" field.

func (*MissionMutation) SetDeletedAt

func (m *MissionMutation) SetDeletedAt(t time.Time)

SetDeletedAt sets the "deleted_at" field.

func (*MissionMutation) SetFailed

func (m *MissionMutation) SetFailed(b bool)

SetFailed sets the "failed" field.

func (*MissionMutation) SetField

func (m *MissionMutation) 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 (*MissionMutation) SetGameID

func (m *MissionMutation) SetGameID(i int64)

SetGameID sets the "game_id" field.

func (*MissionMutation) SetID

func (m *MissionMutation) SetID(id int64)

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

func (*MissionMutation) SetLeaderID

func (m *MissionMutation) SetLeaderID(i int64)

SetLeaderID sets the "leader_id" field.

func (*MissionMutation) SetProtected

func (m *MissionMutation) SetProtected(b bool)

SetProtected sets the "protected" field.

func (*MissionMutation) SetSequence

func (m *MissionMutation) SetSequence(u uint8)

SetSequence sets the "sequence" field.

func (*MissionMutation) SetStatus

func (m *MissionMutation) SetStatus(value mission.Status)

SetStatus sets the "status" field.

func (*MissionMutation) SetUpdatedAt

func (m *MissionMutation) SetUpdatedAt(t time.Time)

SetUpdatedAt sets the "updated_at" field.

func (*MissionMutation) SetUpdatedBy

func (m *MissionMutation) SetUpdatedBy(i int64)

SetUpdatedBy sets the "updated_by" field.

func (*MissionMutation) SquadsCleared

func (m *MissionMutation) SquadsCleared() bool

SquadsCleared reports if the "squads" edge to the Squad entity was cleared.

func (*MissionMutation) SquadsIDs

func (m *MissionMutation) SquadsIDs() (ids []int64)

SquadsIDs returns the "squads" edge IDs in the mutation.

func (*MissionMutation) Status

func (m *MissionMutation) Status() (r mission.Status, exists bool)

Status returns the value of the "status" field in the mutation.

func (MissionMutation) Tx

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

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

func (*MissionMutation) Type

func (m *MissionMutation) Type() string

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

func (*MissionMutation) UpdatedAt

func (m *MissionMutation) UpdatedAt() (r time.Time, exists bool)

UpdatedAt returns the value of the "updated_at" field in the mutation.

func (*MissionMutation) UpdatedBy

func (m *MissionMutation) UpdatedBy() (r int64, exists bool)

UpdatedBy returns the value of the "updated_by" field in the mutation.

func (*MissionMutation) VotesCleared

func (m *MissionMutation) VotesCleared() bool

VotesCleared reports if the "votes" edge to the Vote entity was cleared.

func (*MissionMutation) VotesIDs

func (m *MissionMutation) VotesIDs() (ids []int64)

VotesIDs returns the "votes" edge IDs in the mutation.

func (*MissionMutation) Where

func (m *MissionMutation) Where(ps ...predicate.Mission)

Where appends a list predicates to the MissionMutation builder.

type MissionOrder

type MissionOrder struct {
	Direction OrderDirection     `json:"direction"`
	Field     *MissionOrderField `json:"field"`
}

MissionOrder defines the ordering of Mission.

type MissionOrderField

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

MissionOrderField defines the ordering field of Mission.

func (MissionOrderField) MarshalGQL

func (f MissionOrderField) MarshalGQL(w io.Writer)

MarshalGQL implements graphql.Marshaler interface.

func (MissionOrderField) String

func (f MissionOrderField) String() string

String implement fmt.Stringer interface.

func (*MissionOrderField) UnmarshalGQL

func (f *MissionOrderField) UnmarshalGQL(v interface{}) error

UnmarshalGQL implements graphql.Unmarshaler interface.

type MissionPaginateOption

type MissionPaginateOption func(*missionPager) error

MissionPaginateOption enables pagination customization.

func WithMissionFilter

func WithMissionFilter(filter func(*MissionQuery) (*MissionQuery, error)) MissionPaginateOption

WithMissionFilter configures pagination filter.

func WithMissionOrder

func WithMissionOrder(order *MissionOrder) MissionPaginateOption

WithMissionOrder configures pagination ordering.

type MissionQuery

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

MissionQuery is the builder for querying Mission entities.

func (*MissionQuery) Aggregate

func (mq *MissionQuery) Aggregate(fns ...AggregateFunc) *MissionSelect

Aggregate returns a MissionSelect configured with the given aggregations.

func (*MissionQuery) All

func (mq *MissionQuery) All(ctx context.Context) ([]*Mission, error)

All executes the query and returns a list of Missions.

func (*MissionQuery) AllX

func (mq *MissionQuery) AllX(ctx context.Context) []*Mission

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

func (*MissionQuery) Clone

func (mq *MissionQuery) Clone() *MissionQuery

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

func (*MissionQuery) CollectFields

func (m *MissionQuery) CollectFields(ctx context.Context, satisfies ...string) (*MissionQuery, error)

CollectFields tells the query-builder to eagerly load connected nodes by resolver context.

func (*MissionQuery) Count

func (mq *MissionQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*MissionQuery) CountX

func (mq *MissionQuery) CountX(ctx context.Context) int

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

func (*MissionQuery) Exist

func (mq *MissionQuery) Exist(ctx context.Context) (bool, error)

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

func (*MissionQuery) ExistX

func (mq *MissionQuery) ExistX(ctx context.Context) bool

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

func (*MissionQuery) First

func (mq *MissionQuery) First(ctx context.Context) (*Mission, error)

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

func (*MissionQuery) FirstID

func (mq *MissionQuery) FirstID(ctx context.Context) (id int64, err error)

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

func (*MissionQuery) FirstIDX

func (mq *MissionQuery) FirstIDX(ctx context.Context) int64

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

func (*MissionQuery) FirstX

func (mq *MissionQuery) FirstX(ctx context.Context) *Mission

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

func (*MissionQuery) GroupBy

func (mq *MissionQuery) GroupBy(field string, fields ...string) *MissionGroupBy

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 {
	CreatedBy int64 `json:"created_by"`
	Count int `json:"count,omitempty"`
}

client.Mission.Query().
	GroupBy(mission.FieldCreatedBy).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*MissionQuery) IDs

func (mq *MissionQuery) IDs(ctx context.Context) ([]int64, error)

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

func (*MissionQuery) IDsX

func (mq *MissionQuery) IDsX(ctx context.Context) []int64

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

func (*MissionQuery) Limit

func (mq *MissionQuery) Limit(limit int) *MissionQuery

Limit adds a limit step to the query.

func (*MissionQuery) Offset

func (mq *MissionQuery) Offset(offset int) *MissionQuery

Offset adds an offset step to the query.

func (*MissionQuery) Only

func (mq *MissionQuery) Only(ctx context.Context) (*Mission, error)

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

func (*MissionQuery) OnlyID

func (mq *MissionQuery) OnlyID(ctx context.Context) (id int64, err error)

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

func (*MissionQuery) OnlyIDX

func (mq *MissionQuery) OnlyIDX(ctx context.Context) int64

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

func (*MissionQuery) OnlyX

func (mq *MissionQuery) OnlyX(ctx context.Context) *Mission

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

func (*MissionQuery) Order

func (mq *MissionQuery) Order(o ...OrderFunc) *MissionQuery

Order adds an order step to the query.

func (*MissionQuery) Paginate

func (m *MissionQuery) Paginate(
	ctx context.Context, after *Cursor, first *int,
	before *Cursor, last *int, opts ...MissionPaginateOption,
) (*MissionConnection, error)

Paginate executes the query and returns a relay based cursor connection to Mission.

func (*MissionQuery) QueryGame

func (mq *MissionQuery) QueryGame() *GameQuery

QueryGame chains the current query on the "game" edge.

func (*MissionQuery) QuerySquads

func (mq *MissionQuery) QuerySquads() *SquadQuery

QuerySquads chains the current query on the "squads" edge.

func (*MissionQuery) QueryVotes

func (mq *MissionQuery) QueryVotes() *VoteQuery

QueryVotes chains the current query on the "votes" edge.

func (*MissionQuery) Select

func (mq *MissionQuery) Select(fields ...string) *MissionSelect

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 {
	CreatedBy int64 `json:"created_by"`
}

client.Mission.Query().
	Select(mission.FieldCreatedBy).
	Scan(ctx, &v)

func (*MissionQuery) Unique

func (mq *MissionQuery) Unique(unique bool) *MissionQuery

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

func (mq *MissionQuery) Where(ps ...predicate.Mission) *MissionQuery

Where adds a new predicate for the MissionQuery builder.

func (*MissionQuery) WithGame

func (mq *MissionQuery) WithGame(opts ...func(*GameQuery)) *MissionQuery

WithGame tells the query-builder to eager-load the nodes that are connected to the "game" edge. The optional arguments are used to configure the query builder of the edge.

func (*MissionQuery) WithNamedSquads

func (mq *MissionQuery) WithNamedSquads(name string, opts ...func(*SquadQuery)) *MissionQuery

WithNamedSquads tells the query-builder to eager-load the nodes that are connected to the "squads" edge with the given name. The optional arguments are used to configure the query builder of the edge.

func (*MissionQuery) WithNamedVotes

func (mq *MissionQuery) WithNamedVotes(name string, opts ...func(*VoteQuery)) *MissionQuery

WithNamedVotes tells the query-builder to eager-load the nodes that are connected to the "votes" edge with the given name. The optional arguments are used to configure the query builder of the edge.

func (*MissionQuery) WithSquads

func (mq *MissionQuery) WithSquads(opts ...func(*SquadQuery)) *MissionQuery

WithSquads tells the query-builder to eager-load the nodes that are connected to the "squads" edge. The optional arguments are used to configure the query builder of the edge.

func (*MissionQuery) WithVotes

func (mq *MissionQuery) WithVotes(opts ...func(*VoteQuery)) *MissionQuery

WithVotes tells the query-builder to eager-load the nodes that are connected to the "votes" edge. The optional arguments are used to configure the query builder of the edge.

type MissionSelect

type MissionSelect struct {
	*MissionQuery
	// contains filtered or unexported fields
}

MissionSelect is the builder for selecting fields of Mission entities.

func (*MissionSelect) Aggregate

func (ms *MissionSelect) Aggregate(fns ...AggregateFunc) *MissionSelect

Aggregate adds the given aggregation functions to the selector query.

func (*MissionSelect) Bool

func (s *MissionSelect) Bool(ctx context.Context) (_ bool, err error)

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

func (*MissionSelect) BoolX

func (s *MissionSelect) BoolX(ctx context.Context) bool

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

func (*MissionSelect) Bools

func (s *MissionSelect) Bools(ctx context.Context) ([]bool, error)

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

func (*MissionSelect) BoolsX

func (s *MissionSelect) BoolsX(ctx context.Context) []bool

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

func (*MissionSelect) Float64

func (s *MissionSelect) Float64(ctx context.Context) (_ float64, err error)

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

func (*MissionSelect) Float64X

func (s *MissionSelect) Float64X(ctx context.Context) float64

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

func (*MissionSelect) Float64s

func (s *MissionSelect) Float64s(ctx context.Context) ([]float64, error)

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

func (*MissionSelect) Float64sX

func (s *MissionSelect) Float64sX(ctx context.Context) []float64

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

func (*MissionSelect) Int

func (s *MissionSelect) Int(ctx context.Context) (_ int, err error)

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

func (*MissionSelect) IntX

func (s *MissionSelect) IntX(ctx context.Context) int

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

func (*MissionSelect) Ints

func (s *MissionSelect) Ints(ctx context.Context) ([]int, error)

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

func (*MissionSelect) IntsX

func (s *MissionSelect) IntsX(ctx context.Context) []int

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

func (*MissionSelect) Scan

func (ms *MissionSelect) Scan(ctx context.Context, v any) error

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

func (*MissionSelect) ScanX

func (s *MissionSelect) ScanX(ctx context.Context, v any)

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

func (*MissionSelect) String

func (s *MissionSelect) String(ctx context.Context) (_ string, err error)

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

func (*MissionSelect) StringX

func (s *MissionSelect) StringX(ctx context.Context) string

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

func (*MissionSelect) Strings

func (s *MissionSelect) Strings(ctx context.Context) ([]string, error)

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

func (*MissionSelect) StringsX

func (s *MissionSelect) StringsX(ctx context.Context) []string

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

type MissionUpdate

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

MissionUpdate is the builder for updating Mission entities.

func (*MissionUpdate) AddCapacity

func (mu *MissionUpdate) AddCapacity(u int8) *MissionUpdate

AddCapacity adds u to the "capacity" field.

func (*MissionUpdate) AddCreatedBy

func (mu *MissionUpdate) AddCreatedBy(i int64) *MissionUpdate

AddCreatedBy adds i to the "created_by" field.

func (*MissionUpdate) AddLeaderID

func (mu *MissionUpdate) AddLeaderID(i int64) *MissionUpdate

AddLeaderID adds i to the "leader_id" field.

func (*MissionUpdate) AddSequence

func (mu *MissionUpdate) AddSequence(u int8) *MissionUpdate

AddSequence adds u to the "sequence" field.

func (*MissionUpdate) AddSquadIDs

func (mu *MissionUpdate) AddSquadIDs(ids ...int64) *MissionUpdate

AddSquadIDs adds the "squads" edge to the Squad entity by IDs.

func (*MissionUpdate) AddSquads

func (mu *MissionUpdate) AddSquads(s ...*Squad) *MissionUpdate

AddSquads adds the "squads" edges to the Squad entity.

func (*MissionUpdate) AddUpdatedBy

func (mu *MissionUpdate) AddUpdatedBy(i int64) *MissionUpdate

AddUpdatedBy adds i to the "updated_by" field.

func (*MissionUpdate) AddVoteIDs

func (mu *MissionUpdate) AddVoteIDs(ids ...int64) *MissionUpdate

AddVoteIDs adds the "votes" edge to the Vote entity by IDs.

func (*MissionUpdate) AddVotes

func (mu *MissionUpdate) AddVotes(v ...*Vote) *MissionUpdate

AddVotes adds the "votes" edges to the Vote entity.

func (*MissionUpdate) ClearGame

func (mu *MissionUpdate) ClearGame() *MissionUpdate

ClearGame clears the "game" edge to the Game entity.

func (*MissionUpdate) ClearSquads

func (mu *MissionUpdate) ClearSquads() *MissionUpdate

ClearSquads clears all "squads" edges to the Squad entity.

func (*MissionUpdate) ClearVotes

func (mu *MissionUpdate) ClearVotes() *MissionUpdate

ClearVotes clears all "votes" edges to the Vote entity.

func (*MissionUpdate) Exec

func (mu *MissionUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*MissionUpdate) ExecX

func (mu *MissionUpdate) ExecX(ctx context.Context)

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

func (*MissionUpdate) Mutation

func (mu *MissionUpdate) Mutation() *MissionMutation

Mutation returns the MissionMutation object of the builder.

func (*MissionUpdate) RemoveSquadIDs

func (mu *MissionUpdate) RemoveSquadIDs(ids ...int64) *MissionUpdate

RemoveSquadIDs removes the "squads" edge to Squad entities by IDs.

func (*MissionUpdate) RemoveSquads

func (mu *MissionUpdate) RemoveSquads(s ...*Squad) *MissionUpdate

RemoveSquads removes "squads" edges to Squad entities.

func (*MissionUpdate) RemoveVoteIDs

func (mu *MissionUpdate) RemoveVoteIDs(ids ...int64) *MissionUpdate

RemoveVoteIDs removes the "votes" edge to Vote entities by IDs.

func (*MissionUpdate) RemoveVotes

func (mu *MissionUpdate) RemoveVotes(v ...*Vote) *MissionUpdate

RemoveVotes removes "votes" edges to Vote entities.

func (*MissionUpdate) Save

func (mu *MissionUpdate) Save(ctx context.Context) (int, error)

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

func (*MissionUpdate) SaveX

func (mu *MissionUpdate) SaveX(ctx context.Context) int

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

func (*MissionUpdate) SetCapacity

func (mu *MissionUpdate) SetCapacity(u uint8) *MissionUpdate

SetCapacity sets the "capacity" field.

func (*MissionUpdate) SetCreatedBy

func (mu *MissionUpdate) SetCreatedBy(i int64) *MissionUpdate

SetCreatedBy sets the "created_by" field.

func (*MissionUpdate) SetDeletedAt

func (mu *MissionUpdate) SetDeletedAt(t time.Time) *MissionUpdate

SetDeletedAt sets the "deleted_at" field.

func (*MissionUpdate) SetFailed

func (mu *MissionUpdate) SetFailed(b bool) *MissionUpdate

SetFailed sets the "failed" field.

func (*MissionUpdate) SetGame

func (mu *MissionUpdate) SetGame(g *Game) *MissionUpdate

SetGame sets the "game" edge to the Game entity.

func (*MissionUpdate) SetGameID

func (mu *MissionUpdate) SetGameID(i int64) *MissionUpdate

SetGameID sets the "game_id" field.

func (*MissionUpdate) SetInput

SetInput applies the change-set in the UpdateMissionInput on the MissionUpdate builder.

func (*MissionUpdate) SetLeaderID

func (mu *MissionUpdate) SetLeaderID(i int64) *MissionUpdate

SetLeaderID sets the "leader_id" field.

func (*MissionUpdate) SetNillableCapacity

func (mu *MissionUpdate) SetNillableCapacity(u *uint8) *MissionUpdate

SetNillableCapacity sets the "capacity" field if the given value is not nil.

func (*MissionUpdate) SetNillableCreatedBy

func (mu *MissionUpdate) SetNillableCreatedBy(i *int64) *MissionUpdate

SetNillableCreatedBy sets the "created_by" field if the given value is not nil.

func (*MissionUpdate) SetNillableDeletedAt

func (mu *MissionUpdate) SetNillableDeletedAt(t *time.Time) *MissionUpdate

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*MissionUpdate) SetNillableFailed

func (mu *MissionUpdate) SetNillableFailed(b *bool) *MissionUpdate

SetNillableFailed sets the "failed" field if the given value is not nil.

func (*MissionUpdate) SetNillableLeaderID

func (mu *MissionUpdate) SetNillableLeaderID(i *int64) *MissionUpdate

SetNillableLeaderID sets the "leader_id" field if the given value is not nil.

func (*MissionUpdate) SetNillableProtected

func (mu *MissionUpdate) SetNillableProtected(b *bool) *MissionUpdate

SetNillableProtected sets the "protected" field if the given value is not nil.

func (*MissionUpdate) SetNillableStatus

func (mu *MissionUpdate) SetNillableStatus(m *mission.Status) *MissionUpdate

SetNillableStatus sets the "status" field if the given value is not nil.

func (*MissionUpdate) SetNillableUpdatedBy

func (mu *MissionUpdate) SetNillableUpdatedBy(i *int64) *MissionUpdate

SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil.

func (*MissionUpdate) SetProtected

func (mu *MissionUpdate) SetProtected(b bool) *MissionUpdate

SetProtected sets the "protected" field.

func (*MissionUpdate) SetSequence

func (mu *MissionUpdate) SetSequence(u uint8) *MissionUpdate

SetSequence sets the "sequence" field.

func (*MissionUpdate) SetStatus

func (mu *MissionUpdate) SetStatus(m mission.Status) *MissionUpdate

SetStatus sets the "status" field.

func (*MissionUpdate) SetUpdatedAt

func (mu *MissionUpdate) SetUpdatedAt(t time.Time) *MissionUpdate

SetUpdatedAt sets the "updated_at" field.

func (*MissionUpdate) SetUpdatedBy

func (mu *MissionUpdate) SetUpdatedBy(i int64) *MissionUpdate

SetUpdatedBy sets the "updated_by" field.

func (*MissionUpdate) Where

func (mu *MissionUpdate) Where(ps ...predicate.Mission) *MissionUpdate

Where appends a list predicates to the MissionUpdate builder.

type MissionUpdateOne

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

MissionUpdateOne is the builder for updating a single Mission entity.

func (*MissionUpdateOne) AddCapacity

func (muo *MissionUpdateOne) AddCapacity(u int8) *MissionUpdateOne

AddCapacity adds u to the "capacity" field.

func (*MissionUpdateOne) AddCreatedBy

func (muo *MissionUpdateOne) AddCreatedBy(i int64) *MissionUpdateOne

AddCreatedBy adds i to the "created_by" field.

func (*MissionUpdateOne) AddLeaderID

func (muo *MissionUpdateOne) AddLeaderID(i int64) *MissionUpdateOne

AddLeaderID adds i to the "leader_id" field.

func (*MissionUpdateOne) AddSequence

func (muo *MissionUpdateOne) AddSequence(u int8) *MissionUpdateOne

AddSequence adds u to the "sequence" field.

func (*MissionUpdateOne) AddSquadIDs

func (muo *MissionUpdateOne) AddSquadIDs(ids ...int64) *MissionUpdateOne

AddSquadIDs adds the "squads" edge to the Squad entity by IDs.

func (*MissionUpdateOne) AddSquads

func (muo *MissionUpdateOne) AddSquads(s ...*Squad) *MissionUpdateOne

AddSquads adds the "squads" edges to the Squad entity.

func (*MissionUpdateOne) AddUpdatedBy

func (muo *MissionUpdateOne) AddUpdatedBy(i int64) *MissionUpdateOne

AddUpdatedBy adds i to the "updated_by" field.

func (*MissionUpdateOne) AddVoteIDs

func (muo *MissionUpdateOne) AddVoteIDs(ids ...int64) *MissionUpdateOne

AddVoteIDs adds the "votes" edge to the Vote entity by IDs.

func (*MissionUpdateOne) AddVotes

func (muo *MissionUpdateOne) AddVotes(v ...*Vote) *MissionUpdateOne

AddVotes adds the "votes" edges to the Vote entity.

func (*MissionUpdateOne) ClearGame

func (muo *MissionUpdateOne) ClearGame() *MissionUpdateOne

ClearGame clears the "game" edge to the Game entity.

func (*MissionUpdateOne) ClearSquads

func (muo *MissionUpdateOne) ClearSquads() *MissionUpdateOne

ClearSquads clears all "squads" edges to the Squad entity.

func (*MissionUpdateOne) ClearVotes

func (muo *MissionUpdateOne) ClearVotes() *MissionUpdateOne

ClearVotes clears all "votes" edges to the Vote entity.

func (*MissionUpdateOne) Exec

func (muo *MissionUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*MissionUpdateOne) ExecX

func (muo *MissionUpdateOne) ExecX(ctx context.Context)

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

func (*MissionUpdateOne) Mutation

func (muo *MissionUpdateOne) Mutation() *MissionMutation

Mutation returns the MissionMutation object of the builder.

func (*MissionUpdateOne) RemoveSquadIDs

func (muo *MissionUpdateOne) RemoveSquadIDs(ids ...int64) *MissionUpdateOne

RemoveSquadIDs removes the "squads" edge to Squad entities by IDs.

func (*MissionUpdateOne) RemoveSquads

func (muo *MissionUpdateOne) RemoveSquads(s ...*Squad) *MissionUpdateOne

RemoveSquads removes "squads" edges to Squad entities.

func (*MissionUpdateOne) RemoveVoteIDs

func (muo *MissionUpdateOne) RemoveVoteIDs(ids ...int64) *MissionUpdateOne

RemoveVoteIDs removes the "votes" edge to Vote entities by IDs.

func (*MissionUpdateOne) RemoveVotes

func (muo *MissionUpdateOne) RemoveVotes(v ...*Vote) *MissionUpdateOne

RemoveVotes removes "votes" edges to Vote entities.

func (*MissionUpdateOne) Save

func (muo *MissionUpdateOne) Save(ctx context.Context) (*Mission, error)

Save executes the query and returns the updated Mission entity.

func (*MissionUpdateOne) SaveX

func (muo *MissionUpdateOne) SaveX(ctx context.Context) *Mission

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

func (*MissionUpdateOne) Select

func (muo *MissionUpdateOne) Select(field string, fields ...string) *MissionUpdateOne

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

func (*MissionUpdateOne) SetCapacity

func (muo *MissionUpdateOne) SetCapacity(u uint8) *MissionUpdateOne

SetCapacity sets the "capacity" field.

func (*MissionUpdateOne) SetCreatedBy

func (muo *MissionUpdateOne) SetCreatedBy(i int64) *MissionUpdateOne

SetCreatedBy sets the "created_by" field.

func (*MissionUpdateOne) SetDeletedAt

func (muo *MissionUpdateOne) SetDeletedAt(t time.Time) *MissionUpdateOne

SetDeletedAt sets the "deleted_at" field.

func (*MissionUpdateOne) SetFailed

func (muo *MissionUpdateOne) SetFailed(b bool) *MissionUpdateOne

SetFailed sets the "failed" field.

func (*MissionUpdateOne) SetGame

func (muo *MissionUpdateOne) SetGame(g *Game) *MissionUpdateOne

SetGame sets the "game" edge to the Game entity.

func (*MissionUpdateOne) SetGameID

func (muo *MissionUpdateOne) SetGameID(i int64) *MissionUpdateOne

SetGameID sets the "game_id" field.

func (*MissionUpdateOne) SetInput

SetInput applies the change-set in the UpdateMissionInput on the MissionUpdateOne builder.

func (*MissionUpdateOne) SetLeaderID

func (muo *MissionUpdateOne) SetLeaderID(i int64) *MissionUpdateOne

SetLeaderID sets the "leader_id" field.

func (*MissionUpdateOne) SetNillableCapacity

func (muo *MissionUpdateOne) SetNillableCapacity(u *uint8) *MissionUpdateOne

SetNillableCapacity sets the "capacity" field if the given value is not nil.

func (*MissionUpdateOne) SetNillableCreatedBy

func (muo *MissionUpdateOne) SetNillableCreatedBy(i *int64) *MissionUpdateOne

SetNillableCreatedBy sets the "created_by" field if the given value is not nil.

func (*MissionUpdateOne) SetNillableDeletedAt

func (muo *MissionUpdateOne) SetNillableDeletedAt(t *time.Time) *MissionUpdateOne

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*MissionUpdateOne) SetNillableFailed

func (muo *MissionUpdateOne) SetNillableFailed(b *bool) *MissionUpdateOne

SetNillableFailed sets the "failed" field if the given value is not nil.

func (*MissionUpdateOne) SetNillableLeaderID

func (muo *MissionUpdateOne) SetNillableLeaderID(i *int64) *MissionUpdateOne

SetNillableLeaderID sets the "leader_id" field if the given value is not nil.

func (*MissionUpdateOne) SetNillableProtected

func (muo *MissionUpdateOne) SetNillableProtected(b *bool) *MissionUpdateOne

SetNillableProtected sets the "protected" field if the given value is not nil.

func (*MissionUpdateOne) SetNillableStatus

func (muo *MissionUpdateOne) SetNillableStatus(m *mission.Status) *MissionUpdateOne

SetNillableStatus sets the "status" field if the given value is not nil.

func (*MissionUpdateOne) SetNillableUpdatedBy

func (muo *MissionUpdateOne) SetNillableUpdatedBy(i *int64) *MissionUpdateOne

SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil.

func (*MissionUpdateOne) SetProtected

func (muo *MissionUpdateOne) SetProtected(b bool) *MissionUpdateOne

SetProtected sets the "protected" field.

func (*MissionUpdateOne) SetSequence

func (muo *MissionUpdateOne) SetSequence(u uint8) *MissionUpdateOne

SetSequence sets the "sequence" field.

func (*MissionUpdateOne) SetStatus

func (muo *MissionUpdateOne) SetStatus(m mission.Status) *MissionUpdateOne

SetStatus sets the "status" field.

func (*MissionUpdateOne) SetUpdatedAt

func (muo *MissionUpdateOne) SetUpdatedAt(t time.Time) *MissionUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*MissionUpdateOne) SetUpdatedBy

func (muo *MissionUpdateOne) SetUpdatedBy(i int64) *MissionUpdateOne

SetUpdatedBy sets the "updated_by" field.

type MissionWhereInput

type MissionWhereInput struct {
	Predicates []predicate.Mission  `json:"-"`
	Not        *MissionWhereInput   `json:"not,omitempty"`
	Or         []*MissionWhereInput `json:"or,omitempty"`
	And        []*MissionWhereInput `json:"and,omitempty"`

	// "id" field predicates.
	ID      *int64  `json:"id,omitempty"`
	IDNEQ   *int64  `json:"idNEQ,omitempty"`
	IDIn    []int64 `json:"idIn,omitempty"`
	IDNotIn []int64 `json:"idNotIn,omitempty"`
	IDGT    *int64  `json:"idGT,omitempty"`
	IDGTE   *int64  `json:"idGTE,omitempty"`
	IDLT    *int64  `json:"idLT,omitempty"`
	IDLTE   *int64  `json:"idLTE,omitempty"`

	// "created_by" field predicates.
	CreatedBy      *int64  `json:"createdBy,omitempty"`
	CreatedByNEQ   *int64  `json:"createdByNEQ,omitempty"`
	CreatedByIn    []int64 `json:"createdByIn,omitempty"`
	CreatedByNotIn []int64 `json:"createdByNotIn,omitempty"`
	CreatedByGT    *int64  `json:"createdByGT,omitempty"`
	CreatedByGTE   *int64  `json:"createdByGTE,omitempty"`
	CreatedByLT    *int64  `json:"createdByLT,omitempty"`
	CreatedByLTE   *int64  `json:"createdByLTE,omitempty"`

	// "updated_by" field predicates.
	UpdatedBy      *int64  `json:"updatedBy,omitempty"`
	UpdatedByNEQ   *int64  `json:"updatedByNEQ,omitempty"`
	UpdatedByIn    []int64 `json:"updatedByIn,omitempty"`
	UpdatedByNotIn []int64 `json:"updatedByNotIn,omitempty"`
	UpdatedByGT    *int64  `json:"updatedByGT,omitempty"`
	UpdatedByGTE   *int64  `json:"updatedByGTE,omitempty"`
	UpdatedByLT    *int64  `json:"updatedByLT,omitempty"`
	UpdatedByLTE   *int64  `json:"updatedByLTE,omitempty"`

	// "created_at" field predicates.
	CreatedAt      *time.Time  `json:"createdAt,omitempty"`
	CreatedAtNEQ   *time.Time  `json:"createdAtNEQ,omitempty"`
	CreatedAtIn    []time.Time `json:"createdAtIn,omitempty"`
	CreatedAtNotIn []time.Time `json:"createdAtNotIn,omitempty"`
	CreatedAtGT    *time.Time  `json:"createdAtGT,omitempty"`
	CreatedAtGTE   *time.Time  `json:"createdAtGTE,omitempty"`
	CreatedAtLT    *time.Time  `json:"createdAtLT,omitempty"`
	CreatedAtLTE   *time.Time  `json:"createdAtLTE,omitempty"`

	// "updated_at" field predicates.
	UpdatedAt      *time.Time  `json:"updatedAt,omitempty"`
	UpdatedAtNEQ   *time.Time  `json:"updatedAtNEQ,omitempty"`
	UpdatedAtIn    []time.Time `json:"updatedAtIn,omitempty"`
	UpdatedAtNotIn []time.Time `json:"updatedAtNotIn,omitempty"`
	UpdatedAtGT    *time.Time  `json:"updatedAtGT,omitempty"`
	UpdatedAtGTE   *time.Time  `json:"updatedAtGTE,omitempty"`
	UpdatedAtLT    *time.Time  `json:"updatedAtLT,omitempty"`
	UpdatedAtLTE   *time.Time  `json:"updatedAtLTE,omitempty"`

	// "deleted_at" field predicates.
	DeletedAt      *time.Time  `json:"deletedAt,omitempty"`
	DeletedAtNEQ   *time.Time  `json:"deletedAtNEQ,omitempty"`
	DeletedAtIn    []time.Time `json:"deletedAtIn,omitempty"`
	DeletedAtNotIn []time.Time `json:"deletedAtNotIn,omitempty"`
	DeletedAtGT    *time.Time  `json:"deletedAtGT,omitempty"`
	DeletedAtGTE   *time.Time  `json:"deletedAtGTE,omitempty"`
	DeletedAtLT    *time.Time  `json:"deletedAtLT,omitempty"`
	DeletedAtLTE   *time.Time  `json:"deletedAtLTE,omitempty"`

	// "sequence" field predicates.
	Sequence      *uint8  `json:"sequence,omitempty"`
	SequenceNEQ   *uint8  `json:"sequenceNEQ,omitempty"`
	SequenceIn    []uint8 `json:"sequenceIn,omitempty"`
	SequenceNotIn []uint8 `json:"sequenceNotIn,omitempty"`
	SequenceGT    *uint8  `json:"sequenceGT,omitempty"`
	SequenceGTE   *uint8  `json:"sequenceGTE,omitempty"`
	SequenceLT    *uint8  `json:"sequenceLT,omitempty"`
	SequenceLTE   *uint8  `json:"sequenceLTE,omitempty"`

	// "status" field predicates.
	Status      *mission.Status  `json:"status,omitempty"`
	StatusNEQ   *mission.Status  `json:"statusNEQ,omitempty"`
	StatusIn    []mission.Status `json:"statusIn,omitempty"`
	StatusNotIn []mission.Status `json:"statusNotIn,omitempty"`

	// "failed" field predicates.
	Failed    *bool `json:"failed,omitempty"`
	FailedNEQ *bool `json:"failedNEQ,omitempty"`

	// "game_id" field predicates.
	GameID      *int64  `json:"gameID,omitempty"`
	GameIDNEQ   *int64  `json:"gameIDNEQ,omitempty"`
	GameIDIn    []int64 `json:"gameIDIn,omitempty"`
	GameIDNotIn []int64 `json:"gameIDNotIn,omitempty"`

	// "capacity" field predicates.
	Capacity      *uint8  `json:"capacity,omitempty"`
	CapacityNEQ   *uint8  `json:"capacityNEQ,omitempty"`
	CapacityIn    []uint8 `json:"capacityIn,omitempty"`
	CapacityNotIn []uint8 `json:"capacityNotIn,omitempty"`
	CapacityGT    *uint8  `json:"capacityGT,omitempty"`
	CapacityGTE   *uint8  `json:"capacityGTE,omitempty"`
	CapacityLT    *uint8  `json:"capacityLT,omitempty"`
	CapacityLTE   *uint8  `json:"capacityLTE,omitempty"`

	// "leader_id" field predicates.
	LeaderID      *int64  `json:"leaderID,omitempty"`
	LeaderIDNEQ   *int64  `json:"leaderIDNEQ,omitempty"`
	LeaderIDIn    []int64 `json:"leaderIDIn,omitempty"`
	LeaderIDNotIn []int64 `json:"leaderIDNotIn,omitempty"`
	LeaderIDGT    *int64  `json:"leaderIDGT,omitempty"`
	LeaderIDGTE   *int64  `json:"leaderIDGTE,omitempty"`
	LeaderIDLT    *int64  `json:"leaderIDLT,omitempty"`
	LeaderIDLTE   *int64  `json:"leaderIDLTE,omitempty"`

	// "protected" field predicates.
	Protected    *bool `json:"protected,omitempty"`
	ProtectedNEQ *bool `json:"protectedNEQ,omitempty"`

	// "game" edge predicates.
	HasGame     *bool             `json:"hasGame,omitempty"`
	HasGameWith []*GameWhereInput `json:"hasGameWith,omitempty"`

	// "squads" edge predicates.
	HasSquads     *bool              `json:"hasSquads,omitempty"`
	HasSquadsWith []*SquadWhereInput `json:"hasSquadsWith,omitempty"`

	// "votes" edge predicates.
	HasVotes     *bool             `json:"hasVotes,omitempty"`
	HasVotesWith []*VoteWhereInput `json:"hasVotesWith,omitempty"`
}

MissionWhereInput represents a where input for filtering Mission queries.

func (*MissionWhereInput) AddPredicates

func (i *MissionWhereInput) AddPredicates(predicates ...predicate.Mission)

AddPredicates adds custom predicates to the where input to be used during the filtering phase.

func (*MissionWhereInput) Filter

Filter applies the MissionWhereInput filter on the MissionQuery builder.

func (*MissionWhereInput) P

P returns a predicate for filtering missions. An error is returned if the input is empty or invalid.

type Missions

type Missions []*Mission

Missions is a parsable slice of Mission.

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 Node

type Node struct {
	ID     int64    `json:"id,omitempty"`     // node id.
	Type   string   `json:"type,omitempty"`   // node type.
	Fields []*Field `json:"fields,omitempty"` // node fields.
	Edges  []*Edge  `json:"edges,omitempty"`  // node edges.
}

Node in the graph.

type NodeOption

type NodeOption func(*nodeOptions)

NodeOption allows configuring the Noder execution using functional options.

func WithFixedNodeType

func WithFixedNodeType(t string) NodeOption

WithFixedNodeType sets the Type of the node to a fixed value.

func WithNodeType

func WithNodeType(f func(context.Context, int64) (string, error)) NodeOption

WithNodeType sets the node Type resolver function (i.e. the table to query). If was not provided, the table will be derived from the universal-id configuration as described in: https://entgo.io/docs/migrate/#universal-ids.

type Noder

type Noder interface {
	Node(context.Context) (*Node, error)
}

Noder wraps the basic Node method.

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(...any)) Option

Log sets the logging function for debug mode.

type OrderDirection

type OrderDirection string

OrderDirection defines the directions in which to order a list of items.

const (
	// OrderDirectionAsc specifies an ascending order.
	OrderDirectionAsc OrderDirection = "ASC"
	// OrderDirectionDesc specifies a descending order.
	OrderDirectionDesc OrderDirection = "DESC"
)

func (OrderDirection) MarshalGQL

func (o OrderDirection) MarshalGQL(w io.Writer)

MarshalGQL implements graphql.Marshaler interface.

func (OrderDirection) String

func (o OrderDirection) String() string

String implements fmt.Stringer interface.

func (*OrderDirection) UnmarshalGQL

func (o *OrderDirection) UnmarshalGQL(val interface{}) error

UnmarshalGQL implements graphql.Unmarshaler interface.

func (OrderDirection) Validate

func (o OrderDirection) Validate() error

Validate the order direction value.

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 PageInfo

type PageInfo struct {
	HasNextPage     bool    `json:"hasNextPage"`
	HasPreviousPage bool    `json:"hasPreviousPage"`
	StartCursor     *Cursor `json:"startCursor"`
	EndCursor       *Cursor `json:"endCursor"`
}

PageInfo of a connection type.

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 Record

type Record struct {

	// ID of the ent.
	ID int64 `json:"id,omitempty"`
	// CreatedBy holds the value of the "created_by" field.
	CreatedBy int64 `json:"created_by"`
	// UpdatedBy holds the value of the "updated_by" field.
	UpdatedBy int64 `json:"updated_by"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at"`
	// UpdatedAt holds the value of the "updated_at" field.
	UpdatedAt time.Time `json:"updated_at"`
	// DeletedAt holds the value of the "deleted_at" field.
	DeletedAt time.Time `json:"deleted_at"`
	// 用户 ID
	UserID int64 `json:"user_id"`
	// 房间 ID
	RoomID int64 `json:"room_id"`
	// 分数
	Score int32 `json:"score"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the RecordQuery when eager-loading is set.
	Edges RecordEdges `json:"edges"`
	// contains filtered or unexported fields
}

Record is the model entity for the Record schema.

func (Record) IsEntity

func (r Record) IsEntity()

IsEntity implement fedruntime.Entity

func (*Record) Node

func (r *Record) Node(ctx context.Context) (node *Node, err error)

func (*Record) QueryRoom

func (r *Record) QueryRoom() *RoomQuery

QueryRoom queries the "room" edge of the Record entity.

func (*Record) Room

func (r *Record) Room(ctx context.Context) (*Room, error)

func (*Record) String

func (r *Record) String() string

String implements the fmt.Stringer.

func (*Record) ToEdge

func (r *Record) ToEdge(order *RecordOrder) *RecordEdge

ToEdge converts Record into RecordEdge.

func (*Record) Unwrap

func (r *Record) Unwrap() *Record

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

func (r *Record) Update() *RecordUpdateOne

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

type RecordClient

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

RecordClient is a client for the Record schema.

func NewRecordClient

func NewRecordClient(c config) *RecordClient

NewRecordClient returns a client for the Record from the given config.

func (*RecordClient) Create

func (c *RecordClient) Create() *RecordCreate

Create returns a builder for creating a Record entity.

func (*RecordClient) CreateBulk

func (c *RecordClient) CreateBulk(builders ...*RecordCreate) *RecordCreateBulk

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

func (*RecordClient) Delete

func (c *RecordClient) Delete() *RecordDelete

Delete returns a delete builder for Record.

func (*RecordClient) DeleteOne

func (c *RecordClient) DeleteOne(r *Record) *RecordDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*RecordClient) DeleteOneID

func (c *RecordClient) DeleteOneID(id int64) *RecordDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*RecordClient) Get

func (c *RecordClient) Get(ctx context.Context, id int64) (*Record, error)

Get returns a Record entity by its id.

func (*RecordClient) GetX

func (c *RecordClient) GetX(ctx context.Context, id int64) *Record

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

func (*RecordClient) Hooks

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

Hooks returns the client hooks.

func (*RecordClient) Query

func (c *RecordClient) Query() *RecordQuery

Query returns a query builder for Record.

func (*RecordClient) QueryRoom

func (c *RecordClient) QueryRoom(r *Record) *RoomQuery

QueryRoom queries the room edge of a Record.

func (*RecordClient) Update

func (c *RecordClient) Update() *RecordUpdate

Update returns an update builder for Record.

func (*RecordClient) UpdateOne

func (c *RecordClient) UpdateOne(r *Record) *RecordUpdateOne

UpdateOne returns an update builder for the given entity.

func (*RecordClient) UpdateOneID

func (c *RecordClient) UpdateOneID(id int64) *RecordUpdateOne

UpdateOneID returns an update builder for the given id.

func (*RecordClient) Use

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

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

type RecordConnection

type RecordConnection struct {
	Edges      []*RecordEdge `json:"edges"`
	PageInfo   PageInfo      `json:"pageInfo"`
	TotalCount int           `json:"totalCount"`
}

RecordConnection is the connection containing edges to Record.

type RecordCreate

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

RecordCreate is the builder for creating a Record entity.

func (*RecordCreate) Exec

func (rc *RecordCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*RecordCreate) ExecX

func (rc *RecordCreate) ExecX(ctx context.Context)

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

func (*RecordCreate) Mutation

func (rc *RecordCreate) Mutation() *RecordMutation

Mutation returns the RecordMutation object of the builder.

func (*RecordCreate) Save

func (rc *RecordCreate) Save(ctx context.Context) (*Record, error)

Save creates the Record in the database.

func (*RecordCreate) SaveX

func (rc *RecordCreate) SaveX(ctx context.Context) *Record

SaveX calls Save and panics if Save returns an error.

func (*RecordCreate) SetCreatedAt

func (rc *RecordCreate) SetCreatedAt(t time.Time) *RecordCreate

SetCreatedAt sets the "created_at" field.

func (*RecordCreate) SetCreatedBy

func (rc *RecordCreate) SetCreatedBy(i int64) *RecordCreate

SetCreatedBy sets the "created_by" field.

func (*RecordCreate) SetDeletedAt

func (rc *RecordCreate) SetDeletedAt(t time.Time) *RecordCreate

SetDeletedAt sets the "deleted_at" field.

func (*RecordCreate) SetID

func (rc *RecordCreate) SetID(i int64) *RecordCreate

SetID sets the "id" field.

func (*RecordCreate) SetInput

SetInput applies the change-set in the CreateRecordInput on the RecordCreate builder.

func (*RecordCreate) SetNillableCreatedAt

func (rc *RecordCreate) SetNillableCreatedAt(t *time.Time) *RecordCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*RecordCreate) SetNillableCreatedBy

func (rc *RecordCreate) SetNillableCreatedBy(i *int64) *RecordCreate

SetNillableCreatedBy sets the "created_by" field if the given value is not nil.

func (*RecordCreate) SetNillableDeletedAt

func (rc *RecordCreate) SetNillableDeletedAt(t *time.Time) *RecordCreate

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*RecordCreate) SetNillableID

func (rc *RecordCreate) SetNillableID(i *int64) *RecordCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*RecordCreate) SetNillableScore

func (rc *RecordCreate) SetNillableScore(i *int32) *RecordCreate

SetNillableScore sets the "score" field if the given value is not nil.

func (*RecordCreate) SetNillableUpdatedAt

func (rc *RecordCreate) SetNillableUpdatedAt(t *time.Time) *RecordCreate

SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.

func (*RecordCreate) SetNillableUpdatedBy

func (rc *RecordCreate) SetNillableUpdatedBy(i *int64) *RecordCreate

SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil.

func (*RecordCreate) SetRoom

func (rc *RecordCreate) SetRoom(r *Room) *RecordCreate

SetRoom sets the "room" edge to the Room entity.

func (*RecordCreate) SetRoomID

func (rc *RecordCreate) SetRoomID(i int64) *RecordCreate

SetRoomID sets the "room_id" field.

func (*RecordCreate) SetScore

func (rc *RecordCreate) SetScore(i int32) *RecordCreate

SetScore sets the "score" field.

func (*RecordCreate) SetUpdatedAt

func (rc *RecordCreate) SetUpdatedAt(t time.Time) *RecordCreate

SetUpdatedAt sets the "updated_at" field.

func (*RecordCreate) SetUpdatedBy

func (rc *RecordCreate) SetUpdatedBy(i int64) *RecordCreate

SetUpdatedBy sets the "updated_by" field.

func (*RecordCreate) SetUserID

func (rc *RecordCreate) SetUserID(i int64) *RecordCreate

SetUserID sets the "user_id" field.

type RecordCreateBulk

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

RecordCreateBulk is the builder for creating many Record entities in bulk.

func (*RecordCreateBulk) Exec

func (rcb *RecordCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*RecordCreateBulk) ExecX

func (rcb *RecordCreateBulk) ExecX(ctx context.Context)

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

func (*RecordCreateBulk) Save

func (rcb *RecordCreateBulk) Save(ctx context.Context) ([]*Record, error)

Save creates the Record entities in the database.

func (*RecordCreateBulk) SaveX

func (rcb *RecordCreateBulk) SaveX(ctx context.Context) []*Record

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

type RecordDelete

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

RecordDelete is the builder for deleting a Record entity.

func (*RecordDelete) Exec

func (rd *RecordDelete) Exec(ctx context.Context) (int, error)

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

func (*RecordDelete) ExecX

func (rd *RecordDelete) ExecX(ctx context.Context) int

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

func (*RecordDelete) Where

func (rd *RecordDelete) Where(ps ...predicate.Record) *RecordDelete

Where appends a list predicates to the RecordDelete builder.

type RecordDeleteOne

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

RecordDeleteOne is the builder for deleting a single Record entity.

func (*RecordDeleteOne) Exec

func (rdo *RecordDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*RecordDeleteOne) ExecX

func (rdo *RecordDeleteOne) ExecX(ctx context.Context)

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

type RecordEdge

type RecordEdge struct {
	Node   *Record `json:"node"`
	Cursor Cursor  `json:"cursor"`
}

RecordEdge is the edge representation of Record.

type RecordEdges

type RecordEdges struct {
	// Room holds the value of the room edge.
	Room *Room `json:"room,omitempty"`
	// contains filtered or unexported fields
}

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

func (RecordEdges) RoomOrErr

func (e RecordEdges) RoomOrErr() (*Room, error)

RoomOrErr returns the Room value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

type RecordGroupBy

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

RecordGroupBy is the group-by builder for Record entities.

func (*RecordGroupBy) Aggregate

func (rgb *RecordGroupBy) Aggregate(fns ...AggregateFunc) *RecordGroupBy

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

func (*RecordGroupBy) Bool

func (s *RecordGroupBy) Bool(ctx context.Context) (_ bool, err error)

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

func (*RecordGroupBy) BoolX

func (s *RecordGroupBy) BoolX(ctx context.Context) bool

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

func (*RecordGroupBy) Bools

func (s *RecordGroupBy) Bools(ctx context.Context) ([]bool, error)

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

func (*RecordGroupBy) BoolsX

func (s *RecordGroupBy) BoolsX(ctx context.Context) []bool

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

func (*RecordGroupBy) Float64

func (s *RecordGroupBy) Float64(ctx context.Context) (_ float64, err error)

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

func (*RecordGroupBy) Float64X

func (s *RecordGroupBy) Float64X(ctx context.Context) float64

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

func (*RecordGroupBy) Float64s

func (s *RecordGroupBy) Float64s(ctx context.Context) ([]float64, error)

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

func (*RecordGroupBy) Float64sX

func (s *RecordGroupBy) Float64sX(ctx context.Context) []float64

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

func (*RecordGroupBy) Int

func (s *RecordGroupBy) Int(ctx context.Context) (_ int, err error)

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

func (*RecordGroupBy) IntX

func (s *RecordGroupBy) IntX(ctx context.Context) int

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

func (*RecordGroupBy) Ints

func (s *RecordGroupBy) Ints(ctx context.Context) ([]int, error)

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

func (*RecordGroupBy) IntsX

func (s *RecordGroupBy) IntsX(ctx context.Context) []int

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

func (*RecordGroupBy) Scan

func (rgb *RecordGroupBy) Scan(ctx context.Context, v any) error

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

func (*RecordGroupBy) ScanX

func (s *RecordGroupBy) ScanX(ctx context.Context, v any)

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

func (*RecordGroupBy) String

func (s *RecordGroupBy) String(ctx context.Context) (_ string, err error)

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

func (*RecordGroupBy) StringX

func (s *RecordGroupBy) StringX(ctx context.Context) string

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

func (*RecordGroupBy) Strings

func (s *RecordGroupBy) Strings(ctx context.Context) ([]string, error)

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

func (*RecordGroupBy) StringsX

func (s *RecordGroupBy) StringsX(ctx context.Context) []string

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

type RecordMutation

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

RecordMutation represents an operation that mutates the Record nodes in the graph.

func (*RecordMutation) AddCreatedBy

func (m *RecordMutation) AddCreatedBy(i int64)

AddCreatedBy adds i to the "created_by" field.

func (*RecordMutation) AddField

func (m *RecordMutation) 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 (*RecordMutation) AddScore

func (m *RecordMutation) AddScore(i int32)

AddScore adds i to the "score" field.

func (*RecordMutation) AddUpdatedBy

func (m *RecordMutation) AddUpdatedBy(i int64)

AddUpdatedBy adds i to the "updated_by" field.

func (*RecordMutation) AddUserID

func (m *RecordMutation) AddUserID(i int64)

AddUserID adds i to the "user_id" field.

func (*RecordMutation) AddedCreatedBy

func (m *RecordMutation) AddedCreatedBy() (r int64, exists bool)

AddedCreatedBy returns the value that was added to the "created_by" field in this mutation.

func (*RecordMutation) AddedEdges

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

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

func (*RecordMutation) AddedField

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

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

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

func (*RecordMutation) AddedIDs

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

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

func (*RecordMutation) AddedScore

func (m *RecordMutation) AddedScore() (r int32, exists bool)

AddedScore returns the value that was added to the "score" field in this mutation.

func (*RecordMutation) AddedUpdatedBy

func (m *RecordMutation) AddedUpdatedBy() (r int64, exists bool)

AddedUpdatedBy returns the value that was added to the "updated_by" field in this mutation.

func (*RecordMutation) AddedUserID

func (m *RecordMutation) AddedUserID() (r int64, exists bool)

AddedUserID returns the value that was added to the "user_id" field in this mutation.

func (*RecordMutation) ClearEdge

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

func (m *RecordMutation) 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 (*RecordMutation) ClearRoom

func (m *RecordMutation) ClearRoom()

ClearRoom clears the "room" edge to the Room entity.

func (*RecordMutation) ClearedEdges

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

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

func (*RecordMutation) ClearedFields

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

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

func (RecordMutation) Client

func (m RecordMutation) 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 (*RecordMutation) CreatedAt

func (m *RecordMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*RecordMutation) CreatedBy

func (m *RecordMutation) CreatedBy() (r int64, exists bool)

CreatedBy returns the value of the "created_by" field in the mutation.

func (*RecordMutation) DeletedAt

func (m *RecordMutation) DeletedAt() (r time.Time, exists bool)

DeletedAt returns the value of the "deleted_at" field in the mutation.

func (*RecordMutation) EdgeCleared

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

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

func (*RecordMutation) Field

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

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

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

func (*RecordMutation) Fields

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

func (m *RecordMutation) ID() (id int64, 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 (*RecordMutation) IDs

func (m *RecordMutation) IDs(ctx context.Context) ([]int64, error)

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

func (*RecordMutation) OldCreatedAt

func (m *RecordMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the Record entity. If the Record 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 (*RecordMutation) OldCreatedBy

func (m *RecordMutation) OldCreatedBy(ctx context.Context) (v int64, err error)

OldCreatedBy returns the old "created_by" field's value of the Record entity. If the Record 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 (*RecordMutation) OldDeletedAt

func (m *RecordMutation) OldDeletedAt(ctx context.Context) (v time.Time, err error)

OldDeletedAt returns the old "deleted_at" field's value of the Record entity. If the Record 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 (*RecordMutation) OldField

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

func (m *RecordMutation) OldRoomID(ctx context.Context) (v int64, err error)

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

func (m *RecordMutation) OldScore(ctx context.Context) (v int32, err error)

OldScore returns the old "score" field's value of the Record entity. If the Record 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 (*RecordMutation) OldUpdatedAt

func (m *RecordMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)

OldUpdatedAt returns the old "updated_at" field's value of the Record entity. If the Record 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 (*RecordMutation) OldUpdatedBy

func (m *RecordMutation) OldUpdatedBy(ctx context.Context) (v int64, err error)

OldUpdatedBy returns the old "updated_by" field's value of the Record entity. If the Record 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 (*RecordMutation) OldUserID

func (m *RecordMutation) OldUserID(ctx context.Context) (v int64, err error)

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

func (m *RecordMutation) Op() Op

Op returns the operation name.

func (*RecordMutation) RemovedEdges

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

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

func (*RecordMutation) RemovedIDs

func (m *RecordMutation) 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 (*RecordMutation) ResetCreatedAt

func (m *RecordMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*RecordMutation) ResetCreatedBy

func (m *RecordMutation) ResetCreatedBy()

ResetCreatedBy resets all changes to the "created_by" field.

func (*RecordMutation) ResetDeletedAt

func (m *RecordMutation) ResetDeletedAt()

ResetDeletedAt resets all changes to the "deleted_at" field.

func (*RecordMutation) ResetEdge

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

func (m *RecordMutation) 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 (*RecordMutation) ResetRoom

func (m *RecordMutation) ResetRoom()

ResetRoom resets all changes to the "room" edge.

func (*RecordMutation) ResetRoomID

func (m *RecordMutation) ResetRoomID()

ResetRoomID resets all changes to the "room_id" field.

func (*RecordMutation) ResetScore

func (m *RecordMutation) ResetScore()

ResetScore resets all changes to the "score" field.

func (*RecordMutation) ResetUpdatedAt

func (m *RecordMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*RecordMutation) ResetUpdatedBy

func (m *RecordMutation) ResetUpdatedBy()

ResetUpdatedBy resets all changes to the "updated_by" field.

func (*RecordMutation) ResetUserID

func (m *RecordMutation) ResetUserID()

ResetUserID resets all changes to the "user_id" field.

func (*RecordMutation) RoomCleared

func (m *RecordMutation) RoomCleared() bool

RoomCleared reports if the "room" edge to the Room entity was cleared.

func (*RecordMutation) RoomID

func (m *RecordMutation) RoomID() (r int64, exists bool)

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

func (*RecordMutation) RoomIDs

func (m *RecordMutation) RoomIDs() (ids []int64)

RoomIDs returns the "room" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use RoomID instead. It exists only for internal usage by the builders.

func (*RecordMutation) Score

func (m *RecordMutation) Score() (r int32, exists bool)

Score returns the value of the "score" field in the mutation.

func (*RecordMutation) SetCreatedAt

func (m *RecordMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*RecordMutation) SetCreatedBy

func (m *RecordMutation) SetCreatedBy(i int64)

SetCreatedBy sets the "created_by" field.

func (*RecordMutation) SetDeletedAt

func (m *RecordMutation) SetDeletedAt(t time.Time)

SetDeletedAt sets the "deleted_at" field.

func (*RecordMutation) SetField

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

func (m *RecordMutation) SetID(id int64)

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

func (*RecordMutation) SetRoomID

func (m *RecordMutation) SetRoomID(i int64)

SetRoomID sets the "room_id" field.

func (*RecordMutation) SetScore

func (m *RecordMutation) SetScore(i int32)

SetScore sets the "score" field.

func (*RecordMutation) SetUpdatedAt

func (m *RecordMutation) SetUpdatedAt(t time.Time)

SetUpdatedAt sets the "updated_at" field.

func (*RecordMutation) SetUpdatedBy

func (m *RecordMutation) SetUpdatedBy(i int64)

SetUpdatedBy sets the "updated_by" field.

func (*RecordMutation) SetUserID

func (m *RecordMutation) SetUserID(i int64)

SetUserID sets the "user_id" field.

func (RecordMutation) Tx

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

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

func (*RecordMutation) Type

func (m *RecordMutation) Type() string

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

func (*RecordMutation) UpdatedAt

func (m *RecordMutation) UpdatedAt() (r time.Time, exists bool)

UpdatedAt returns the value of the "updated_at" field in the mutation.

func (*RecordMutation) UpdatedBy

func (m *RecordMutation) UpdatedBy() (r int64, exists bool)

UpdatedBy returns the value of the "updated_by" field in the mutation.

func (*RecordMutation) UserID

func (m *RecordMutation) UserID() (r int64, exists bool)

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

func (*RecordMutation) Where

func (m *RecordMutation) Where(ps ...predicate.Record)

Where appends a list predicates to the RecordMutation builder.

type RecordOrder

type RecordOrder struct {
	Direction OrderDirection    `json:"direction"`
	Field     *RecordOrderField `json:"field"`
}

RecordOrder defines the ordering of Record.

type RecordOrderField

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

RecordOrderField defines the ordering field of Record.

func (RecordOrderField) MarshalGQL

func (f RecordOrderField) MarshalGQL(w io.Writer)

MarshalGQL implements graphql.Marshaler interface.

func (RecordOrderField) String

func (f RecordOrderField) String() string

String implement fmt.Stringer interface.

func (*RecordOrderField) UnmarshalGQL

func (f *RecordOrderField) UnmarshalGQL(v interface{}) error

UnmarshalGQL implements graphql.Unmarshaler interface.

type RecordPaginateOption

type RecordPaginateOption func(*recordPager) error

RecordPaginateOption enables pagination customization.

func WithRecordFilter

func WithRecordFilter(filter func(*RecordQuery) (*RecordQuery, error)) RecordPaginateOption

WithRecordFilter configures pagination filter.

func WithRecordOrder

func WithRecordOrder(order *RecordOrder) RecordPaginateOption

WithRecordOrder configures pagination ordering.

type RecordQuery

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

RecordQuery is the builder for querying Record entities.

func (*RecordQuery) Aggregate

func (rq *RecordQuery) Aggregate(fns ...AggregateFunc) *RecordSelect

Aggregate returns a RecordSelect configured with the given aggregations.

func (*RecordQuery) All

func (rq *RecordQuery) All(ctx context.Context) ([]*Record, error)

All executes the query and returns a list of Records.

func (*RecordQuery) AllX

func (rq *RecordQuery) AllX(ctx context.Context) []*Record

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

func (*RecordQuery) Clone

func (rq *RecordQuery) Clone() *RecordQuery

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

func (*RecordQuery) CollectFields

func (r *RecordQuery) CollectFields(ctx context.Context, satisfies ...string) (*RecordQuery, error)

CollectFields tells the query-builder to eagerly load connected nodes by resolver context.

func (*RecordQuery) Count

func (rq *RecordQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*RecordQuery) CountX

func (rq *RecordQuery) CountX(ctx context.Context) int

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

func (*RecordQuery) Exist

func (rq *RecordQuery) Exist(ctx context.Context) (bool, error)

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

func (*RecordQuery) ExistX

func (rq *RecordQuery) ExistX(ctx context.Context) bool

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

func (*RecordQuery) First

func (rq *RecordQuery) First(ctx context.Context) (*Record, error)

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

func (*RecordQuery) FirstID

func (rq *RecordQuery) FirstID(ctx context.Context) (id int64, err error)

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

func (*RecordQuery) FirstIDX

func (rq *RecordQuery) FirstIDX(ctx context.Context) int64

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

func (*RecordQuery) FirstX

func (rq *RecordQuery) FirstX(ctx context.Context) *Record

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

func (*RecordQuery) GroupBy

func (rq *RecordQuery) GroupBy(field string, fields ...string) *RecordGroupBy

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 {
	CreatedBy int64 `json:"created_by"`
	Count int `json:"count,omitempty"`
}

client.Record.Query().
	GroupBy(record.FieldCreatedBy).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*RecordQuery) IDs

func (rq *RecordQuery) IDs(ctx context.Context) ([]int64, error)

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

func (*RecordQuery) IDsX

func (rq *RecordQuery) IDsX(ctx context.Context) []int64

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

func (*RecordQuery) Limit

func (rq *RecordQuery) Limit(limit int) *RecordQuery

Limit adds a limit step to the query.

func (*RecordQuery) Offset

func (rq *RecordQuery) Offset(offset int) *RecordQuery

Offset adds an offset step to the query.

func (*RecordQuery) Only

func (rq *RecordQuery) Only(ctx context.Context) (*Record, error)

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

func (*RecordQuery) OnlyID

func (rq *RecordQuery) OnlyID(ctx context.Context) (id int64, err error)

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

func (*RecordQuery) OnlyIDX

func (rq *RecordQuery) OnlyIDX(ctx context.Context) int64

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

func (*RecordQuery) OnlyX

func (rq *RecordQuery) OnlyX(ctx context.Context) *Record

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

func (*RecordQuery) Order

func (rq *RecordQuery) Order(o ...OrderFunc) *RecordQuery

Order adds an order step to the query.

func (*RecordQuery) Paginate

func (r *RecordQuery) Paginate(
	ctx context.Context, after *Cursor, first *int,
	before *Cursor, last *int, opts ...RecordPaginateOption,
) (*RecordConnection, error)

Paginate executes the query and returns a relay based cursor connection to Record.

func (*RecordQuery) QueryRoom

func (rq *RecordQuery) QueryRoom() *RoomQuery

QueryRoom chains the current query on the "room" edge.

func (*RecordQuery) Select

func (rq *RecordQuery) Select(fields ...string) *RecordSelect

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 {
	CreatedBy int64 `json:"created_by"`
}

client.Record.Query().
	Select(record.FieldCreatedBy).
	Scan(ctx, &v)

func (*RecordQuery) Unique

func (rq *RecordQuery) Unique(unique bool) *RecordQuery

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

func (rq *RecordQuery) Where(ps ...predicate.Record) *RecordQuery

Where adds a new predicate for the RecordQuery builder.

func (*RecordQuery) WithRoom

func (rq *RecordQuery) WithRoom(opts ...func(*RoomQuery)) *RecordQuery

WithRoom tells the query-builder to eager-load the nodes that are connected to the "room" edge. The optional arguments are used to configure the query builder of the edge.

type RecordSelect

type RecordSelect struct {
	*RecordQuery
	// contains filtered or unexported fields
}

RecordSelect is the builder for selecting fields of Record entities.

func (*RecordSelect) Aggregate

func (rs *RecordSelect) Aggregate(fns ...AggregateFunc) *RecordSelect

Aggregate adds the given aggregation functions to the selector query.

func (*RecordSelect) Bool

func (s *RecordSelect) Bool(ctx context.Context) (_ bool, err error)

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

func (*RecordSelect) BoolX

func (s *RecordSelect) BoolX(ctx context.Context) bool

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

func (*RecordSelect) Bools

func (s *RecordSelect) Bools(ctx context.Context) ([]bool, error)

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

func (*RecordSelect) BoolsX

func (s *RecordSelect) BoolsX(ctx context.Context) []bool

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

func (*RecordSelect) Float64

func (s *RecordSelect) Float64(ctx context.Context) (_ float64, err error)

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

func (*RecordSelect) Float64X

func (s *RecordSelect) Float64X(ctx context.Context) float64

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

func (*RecordSelect) Float64s

func (s *RecordSelect) Float64s(ctx context.Context) ([]float64, error)

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

func (*RecordSelect) Float64sX

func (s *RecordSelect) Float64sX(ctx context.Context) []float64

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

func (*RecordSelect) Int

func (s *RecordSelect) Int(ctx context.Context) (_ int, err error)

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

func (*RecordSelect) IntX

func (s *RecordSelect) IntX(ctx context.Context) int

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

func (*RecordSelect) Ints

func (s *RecordSelect) Ints(ctx context.Context) ([]int, error)

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

func (*RecordSelect) IntsX

func (s *RecordSelect) IntsX(ctx context.Context) []int

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

func (*RecordSelect) Scan

func (rs *RecordSelect) Scan(ctx context.Context, v any) error

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

func (*RecordSelect) ScanX

func (s *RecordSelect) ScanX(ctx context.Context, v any)

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

func (*RecordSelect) String

func (s *RecordSelect) String(ctx context.Context) (_ string, err error)

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

func (*RecordSelect) StringX

func (s *RecordSelect) StringX(ctx context.Context) string

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

func (*RecordSelect) Strings

func (s *RecordSelect) Strings(ctx context.Context) ([]string, error)

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

func (*RecordSelect) StringsX

func (s *RecordSelect) StringsX(ctx context.Context) []string

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

type RecordUpdate

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

RecordUpdate is the builder for updating Record entities.

func (*RecordUpdate) AddCreatedBy

func (ru *RecordUpdate) AddCreatedBy(i int64) *RecordUpdate

AddCreatedBy adds i to the "created_by" field.

func (*RecordUpdate) AddScore

func (ru *RecordUpdate) AddScore(i int32) *RecordUpdate

AddScore adds i to the "score" field.

func (*RecordUpdate) AddUpdatedBy

func (ru *RecordUpdate) AddUpdatedBy(i int64) *RecordUpdate

AddUpdatedBy adds i to the "updated_by" field.

func (*RecordUpdate) AddUserID

func (ru *RecordUpdate) AddUserID(i int64) *RecordUpdate

AddUserID adds i to the "user_id" field.

func (*RecordUpdate) ClearRoom

func (ru *RecordUpdate) ClearRoom() *RecordUpdate

ClearRoom clears the "room" edge to the Room entity.

func (*RecordUpdate) Exec

func (ru *RecordUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*RecordUpdate) ExecX

func (ru *RecordUpdate) ExecX(ctx context.Context)

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

func (*RecordUpdate) Mutation

func (ru *RecordUpdate) Mutation() *RecordMutation

Mutation returns the RecordMutation object of the builder.

func (*RecordUpdate) Save

func (ru *RecordUpdate) Save(ctx context.Context) (int, error)

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

func (*RecordUpdate) SaveX

func (ru *RecordUpdate) SaveX(ctx context.Context) int

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

func (*RecordUpdate) SetCreatedBy

func (ru *RecordUpdate) SetCreatedBy(i int64) *RecordUpdate

SetCreatedBy sets the "created_by" field.

func (*RecordUpdate) SetDeletedAt

func (ru *RecordUpdate) SetDeletedAt(t time.Time) *RecordUpdate

SetDeletedAt sets the "deleted_at" field.

func (*RecordUpdate) SetInput

SetInput applies the change-set in the UpdateRecordInput on the RecordUpdate builder.

func (*RecordUpdate) SetNillableCreatedBy

func (ru *RecordUpdate) SetNillableCreatedBy(i *int64) *RecordUpdate

SetNillableCreatedBy sets the "created_by" field if the given value is not nil.

func (*RecordUpdate) SetNillableDeletedAt

func (ru *RecordUpdate) SetNillableDeletedAt(t *time.Time) *RecordUpdate

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*RecordUpdate) SetNillableScore

func (ru *RecordUpdate) SetNillableScore(i *int32) *RecordUpdate

SetNillableScore sets the "score" field if the given value is not nil.

func (*RecordUpdate) SetNillableUpdatedBy

func (ru *RecordUpdate) SetNillableUpdatedBy(i *int64) *RecordUpdate

SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil.

func (*RecordUpdate) SetRoom

func (ru *RecordUpdate) SetRoom(r *Room) *RecordUpdate

SetRoom sets the "room" edge to the Room entity.

func (*RecordUpdate) SetRoomID

func (ru *RecordUpdate) SetRoomID(i int64) *RecordUpdate

SetRoomID sets the "room_id" field.

func (*RecordUpdate) SetScore

func (ru *RecordUpdate) SetScore(i int32) *RecordUpdate

SetScore sets the "score" field.

func (*RecordUpdate) SetUpdatedAt

func (ru *RecordUpdate) SetUpdatedAt(t time.Time) *RecordUpdate

SetUpdatedAt sets the "updated_at" field.

func (*RecordUpdate) SetUpdatedBy

func (ru *RecordUpdate) SetUpdatedBy(i int64) *RecordUpdate

SetUpdatedBy sets the "updated_by" field.

func (*RecordUpdate) SetUserID

func (ru *RecordUpdate) SetUserID(i int64) *RecordUpdate

SetUserID sets the "user_id" field.

func (*RecordUpdate) Where

func (ru *RecordUpdate) Where(ps ...predicate.Record) *RecordUpdate

Where appends a list predicates to the RecordUpdate builder.

type RecordUpdateOne

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

RecordUpdateOne is the builder for updating a single Record entity.

func (*RecordUpdateOne) AddCreatedBy

func (ruo *RecordUpdateOne) AddCreatedBy(i int64) *RecordUpdateOne

AddCreatedBy adds i to the "created_by" field.

func (*RecordUpdateOne) AddScore

func (ruo *RecordUpdateOne) AddScore(i int32) *RecordUpdateOne

AddScore adds i to the "score" field.

func (*RecordUpdateOne) AddUpdatedBy

func (ruo *RecordUpdateOne) AddUpdatedBy(i int64) *RecordUpdateOne

AddUpdatedBy adds i to the "updated_by" field.

func (*RecordUpdateOne) AddUserID

func (ruo *RecordUpdateOne) AddUserID(i int64) *RecordUpdateOne

AddUserID adds i to the "user_id" field.

func (*RecordUpdateOne) ClearRoom

func (ruo *RecordUpdateOne) ClearRoom() *RecordUpdateOne

ClearRoom clears the "room" edge to the Room entity.

func (*RecordUpdateOne) Exec

func (ruo *RecordUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*RecordUpdateOne) ExecX

func (ruo *RecordUpdateOne) ExecX(ctx context.Context)

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

func (*RecordUpdateOne) Mutation

func (ruo *RecordUpdateOne) Mutation() *RecordMutation

Mutation returns the RecordMutation object of the builder.

func (*RecordUpdateOne) Save

func (ruo *RecordUpdateOne) Save(ctx context.Context) (*Record, error)

Save executes the query and returns the updated Record entity.

func (*RecordUpdateOne) SaveX

func (ruo *RecordUpdateOne) SaveX(ctx context.Context) *Record

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

func (*RecordUpdateOne) Select

func (ruo *RecordUpdateOne) Select(field string, fields ...string) *RecordUpdateOne

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

func (*RecordUpdateOne) SetCreatedBy

func (ruo *RecordUpdateOne) SetCreatedBy(i int64) *RecordUpdateOne

SetCreatedBy sets the "created_by" field.

func (*RecordUpdateOne) SetDeletedAt

func (ruo *RecordUpdateOne) SetDeletedAt(t time.Time) *RecordUpdateOne

SetDeletedAt sets the "deleted_at" field.

func (*RecordUpdateOne) SetInput

SetInput applies the change-set in the UpdateRecordInput on the RecordUpdateOne builder.

func (*RecordUpdateOne) SetNillableCreatedBy

func (ruo *RecordUpdateOne) SetNillableCreatedBy(i *int64) *RecordUpdateOne

SetNillableCreatedBy sets the "created_by" field if the given value is not nil.

func (*RecordUpdateOne) SetNillableDeletedAt

func (ruo *RecordUpdateOne) SetNillableDeletedAt(t *time.Time) *RecordUpdateOne

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*RecordUpdateOne) SetNillableScore

func (ruo *RecordUpdateOne) SetNillableScore(i *int32) *RecordUpdateOne

SetNillableScore sets the "score" field if the given value is not nil.

func (*RecordUpdateOne) SetNillableUpdatedBy

func (ruo *RecordUpdateOne) SetNillableUpdatedBy(i *int64) *RecordUpdateOne

SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil.

func (*RecordUpdateOne) SetRoom

func (ruo *RecordUpdateOne) SetRoom(r *Room) *RecordUpdateOne

SetRoom sets the "room" edge to the Room entity.

func (*RecordUpdateOne) SetRoomID

func (ruo *RecordUpdateOne) SetRoomID(i int64) *RecordUpdateOne

SetRoomID sets the "room_id" field.

func (*RecordUpdateOne) SetScore

func (ruo *RecordUpdateOne) SetScore(i int32) *RecordUpdateOne

SetScore sets the "score" field.

func (*RecordUpdateOne) SetUpdatedAt

func (ruo *RecordUpdateOne) SetUpdatedAt(t time.Time) *RecordUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*RecordUpdateOne) SetUpdatedBy

func (ruo *RecordUpdateOne) SetUpdatedBy(i int64) *RecordUpdateOne

SetUpdatedBy sets the "updated_by" field.

func (*RecordUpdateOne) SetUserID

func (ruo *RecordUpdateOne) SetUserID(i int64) *RecordUpdateOne

SetUserID sets the "user_id" field.

type RecordWhereInput

type RecordWhereInput struct {
	Predicates []predicate.Record  `json:"-"`
	Not        *RecordWhereInput   `json:"not,omitempty"`
	Or         []*RecordWhereInput `json:"or,omitempty"`
	And        []*RecordWhereInput `json:"and,omitempty"`

	// "id" field predicates.
	ID      *int64  `json:"id,omitempty"`
	IDNEQ   *int64  `json:"idNEQ,omitempty"`
	IDIn    []int64 `json:"idIn,omitempty"`
	IDNotIn []int64 `json:"idNotIn,omitempty"`
	IDGT    *int64  `json:"idGT,omitempty"`
	IDGTE   *int64  `json:"idGTE,omitempty"`
	IDLT    *int64  `json:"idLT,omitempty"`
	IDLTE   *int64  `json:"idLTE,omitempty"`

	// "created_by" field predicates.
	CreatedBy      *int64  `json:"createdBy,omitempty"`
	CreatedByNEQ   *int64  `json:"createdByNEQ,omitempty"`
	CreatedByIn    []int64 `json:"createdByIn,omitempty"`
	CreatedByNotIn []int64 `json:"createdByNotIn,omitempty"`
	CreatedByGT    *int64  `json:"createdByGT,omitempty"`
	CreatedByGTE   *int64  `json:"createdByGTE,omitempty"`
	CreatedByLT    *int64  `json:"createdByLT,omitempty"`
	CreatedByLTE   *int64  `json:"createdByLTE,omitempty"`

	// "updated_by" field predicates.
	UpdatedBy      *int64  `json:"updatedBy,omitempty"`
	UpdatedByNEQ   *int64  `json:"updatedByNEQ,omitempty"`
	UpdatedByIn    []int64 `json:"updatedByIn,omitempty"`
	UpdatedByNotIn []int64 `json:"updatedByNotIn,omitempty"`
	UpdatedByGT    *int64  `json:"updatedByGT,omitempty"`
	UpdatedByGTE   *int64  `json:"updatedByGTE,omitempty"`
	UpdatedByLT    *int64  `json:"updatedByLT,omitempty"`
	UpdatedByLTE   *int64  `json:"updatedByLTE,omitempty"`

	// "created_at" field predicates.
	CreatedAt      *time.Time  `json:"createdAt,omitempty"`
	CreatedAtNEQ   *time.Time  `json:"createdAtNEQ,omitempty"`
	CreatedAtIn    []time.Time `json:"createdAtIn,omitempty"`
	CreatedAtNotIn []time.Time `json:"createdAtNotIn,omitempty"`
	CreatedAtGT    *time.Time  `json:"createdAtGT,omitempty"`
	CreatedAtGTE   *time.Time  `json:"createdAtGTE,omitempty"`
	CreatedAtLT    *time.Time  `json:"createdAtLT,omitempty"`
	CreatedAtLTE   *time.Time  `json:"createdAtLTE,omitempty"`

	// "updated_at" field predicates.
	UpdatedAt      *time.Time  `json:"updatedAt,omitempty"`
	UpdatedAtNEQ   *time.Time  `json:"updatedAtNEQ,omitempty"`
	UpdatedAtIn    []time.Time `json:"updatedAtIn,omitempty"`
	UpdatedAtNotIn []time.Time `json:"updatedAtNotIn,omitempty"`
	UpdatedAtGT    *time.Time  `json:"updatedAtGT,omitempty"`
	UpdatedAtGTE   *time.Time  `json:"updatedAtGTE,omitempty"`
	UpdatedAtLT    *time.Time  `json:"updatedAtLT,omitempty"`
	UpdatedAtLTE   *time.Time  `json:"updatedAtLTE,omitempty"`

	// "deleted_at" field predicates.
	DeletedAt      *time.Time  `json:"deletedAt,omitempty"`
	DeletedAtNEQ   *time.Time  `json:"deletedAtNEQ,omitempty"`
	DeletedAtIn    []time.Time `json:"deletedAtIn,omitempty"`
	DeletedAtNotIn []time.Time `json:"deletedAtNotIn,omitempty"`
	DeletedAtGT    *time.Time  `json:"deletedAtGT,omitempty"`
	DeletedAtGTE   *time.Time  `json:"deletedAtGTE,omitempty"`
	DeletedAtLT    *time.Time  `json:"deletedAtLT,omitempty"`
	DeletedAtLTE   *time.Time  `json:"deletedAtLTE,omitempty"`

	// "user_id" field predicates.
	UserID      *int64  `json:"userID,omitempty"`
	UserIDNEQ   *int64  `json:"userIDNEQ,omitempty"`
	UserIDIn    []int64 `json:"userIDIn,omitempty"`
	UserIDNotIn []int64 `json:"userIDNotIn,omitempty"`
	UserIDGT    *int64  `json:"userIDGT,omitempty"`
	UserIDGTE   *int64  `json:"userIDGTE,omitempty"`
	UserIDLT    *int64  `json:"userIDLT,omitempty"`
	UserIDLTE   *int64  `json:"userIDLTE,omitempty"`

	// "room_id" field predicates.
	RoomID      *int64  `json:"roomID,omitempty"`
	RoomIDNEQ   *int64  `json:"roomIDNEQ,omitempty"`
	RoomIDIn    []int64 `json:"roomIDIn,omitempty"`
	RoomIDNotIn []int64 `json:"roomIDNotIn,omitempty"`

	// "score" field predicates.
	Score      *int32  `json:"score,omitempty"`
	ScoreNEQ   *int32  `json:"scoreNEQ,omitempty"`
	ScoreIn    []int32 `json:"scoreIn,omitempty"`
	ScoreNotIn []int32 `json:"scoreNotIn,omitempty"`
	ScoreGT    *int32  `json:"scoreGT,omitempty"`
	ScoreGTE   *int32  `json:"scoreGTE,omitempty"`
	ScoreLT    *int32  `json:"scoreLT,omitempty"`
	ScoreLTE   *int32  `json:"scoreLTE,omitempty"`

	// "room" edge predicates.
	HasRoom     *bool             `json:"hasRoom,omitempty"`
	HasRoomWith []*RoomWhereInput `json:"hasRoomWith,omitempty"`
}

RecordWhereInput represents a where input for filtering Record queries.

func (*RecordWhereInput) AddPredicates

func (i *RecordWhereInput) AddPredicates(predicates ...predicate.Record)

AddPredicates adds custom predicates to the where input to be used during the filtering phase.

func (*RecordWhereInput) Filter

func (i *RecordWhereInput) Filter(q *RecordQuery) (*RecordQuery, error)

Filter applies the RecordWhereInput filter on the RecordQuery builder.

func (*RecordWhereInput) P

P returns a predicate for filtering records. An error is returned if the input is empty or invalid.

type Records

type Records []*Record

Records is a parsable slice of Record.

type RollbackFunc

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

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

func (RollbackFunc) Rollback

func (f RollbackFunc) Rollback(ctx context.Context, tx *Tx) error

Rollback calls f(ctx, m).

type RollbackHook

type RollbackHook func(Rollbacker) Rollbacker

RollbackHook defines the "rollback middleware". A function that gets a Rollbacker and returns a Rollbacker. For example:

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

type Rollbacker

type Rollbacker interface {
	Rollback(context.Context, *Tx) error
}

Rollbacker is the interface that wraps the Rollback method.

type Room

type Room struct {

	// ID of the ent.
	ID int64 `json:"id,omitempty"`
	// CreatedBy holds the value of the "created_by" field.
	CreatedBy int64 `json:"created_by"`
	// UpdatedBy holds the value of the "updated_by" field.
	UpdatedBy int64 `json:"updated_by"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at"`
	// UpdatedAt holds the value of the "updated_at" field.
	UpdatedAt time.Time `json:"updated_at"`
	// DeletedAt holds the value of the "deleted_at" field.
	DeletedAt time.Time `json:"deleted_at"`
	// 房间名
	Name string `json:"name"`
	// 房间是否已关闭
	Closed bool `json:"closed"`
	// 房间是否有游戏进行中
	GameOn bool `json:"game_on"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the RoomQuery when eager-loading is set.
	Edges RoomEdges `json:"edges"`
	// contains filtered or unexported fields
}

Room is the model entity for the Room schema.

func (*Room) Games

func (r *Room) Games(ctx context.Context) (result []*Game, err error)

func (Room) IsEntity

func (r Room) IsEntity()

IsEntity implement fedruntime.Entity

func (*Room) NamedGames

func (r *Room) NamedGames(name string) ([]*Game, error)

NamedGames returns the Games named value or an error if the edge was not loaded in eager-loading with this name.

func (*Room) NamedRecords

func (r *Room) NamedRecords(name string) ([]*Record, error)

NamedRecords returns the Records named value or an error if the edge was not loaded in eager-loading with this name.

func (*Room) NamedRoomUsers

func (r *Room) NamedRoomUsers(name string) ([]*RoomUser, error)

NamedRoomUsers returns the RoomUsers named value or an error if the edge was not loaded in eager-loading with this name.

func (*Room) Node

func (r *Room) Node(ctx context.Context) (node *Node, err error)

func (*Room) QueryGames

func (r *Room) QueryGames() *GameQuery

QueryGames queries the "games" edge of the Room entity.

func (*Room) QueryRecords

func (r *Room) QueryRecords() *RecordQuery

QueryRecords queries the "records" edge of the Room entity.

func (*Room) QueryRoomUsers

func (r *Room) QueryRoomUsers() *RoomUserQuery

QueryRoomUsers queries the "room_users" edge of the Room entity.

func (*Room) Records

func (r *Room) Records(ctx context.Context) (result []*Record, err error)

func (*Room) RoomUsers

func (r *Room) RoomUsers(ctx context.Context) (result []*RoomUser, err error)

func (*Room) String

func (r *Room) String() string

String implements the fmt.Stringer.

func (*Room) ToEdge

func (r *Room) ToEdge(order *RoomOrder) *RoomEdge

ToEdge converts Room into RoomEdge.

func (*Room) Unwrap

func (r *Room) Unwrap() *Room

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

func (r *Room) Update() *RoomUpdateOne

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

type RoomClient

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

RoomClient is a client for the Room schema.

func NewRoomClient

func NewRoomClient(c config) *RoomClient

NewRoomClient returns a client for the Room from the given config.

func (*RoomClient) Create

func (c *RoomClient) Create() *RoomCreate

Create returns a builder for creating a Room entity.

func (*RoomClient) CreateBulk

func (c *RoomClient) CreateBulk(builders ...*RoomCreate) *RoomCreateBulk

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

func (*RoomClient) Delete

func (c *RoomClient) Delete() *RoomDelete

Delete returns a delete builder for Room.

func (*RoomClient) DeleteOne

func (c *RoomClient) DeleteOne(r *Room) *RoomDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*RoomClient) DeleteOneID

func (c *RoomClient) DeleteOneID(id int64) *RoomDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*RoomClient) Get

func (c *RoomClient) Get(ctx context.Context, id int64) (*Room, error)

Get returns a Room entity by its id.

func (*RoomClient) GetX

func (c *RoomClient) GetX(ctx context.Context, id int64) *Room

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

func (*RoomClient) Hooks

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

Hooks returns the client hooks.

func (*RoomClient) Query

func (c *RoomClient) Query() *RoomQuery

Query returns a query builder for Room.

func (*RoomClient) QueryGames

func (c *RoomClient) QueryGames(r *Room) *GameQuery

QueryGames queries the games edge of a Room.

func (*RoomClient) QueryRecords

func (c *RoomClient) QueryRecords(r *Room) *RecordQuery

QueryRecords queries the records edge of a Room.

func (*RoomClient) QueryRoomUsers

func (c *RoomClient) QueryRoomUsers(r *Room) *RoomUserQuery

QueryRoomUsers queries the room_users edge of a Room.

func (*RoomClient) Update

func (c *RoomClient) Update() *RoomUpdate

Update returns an update builder for Room.

func (*RoomClient) UpdateOne

func (c *RoomClient) UpdateOne(r *Room) *RoomUpdateOne

UpdateOne returns an update builder for the given entity.

func (*RoomClient) UpdateOneID

func (c *RoomClient) UpdateOneID(id int64) *RoomUpdateOne

UpdateOneID returns an update builder for the given id.

func (*RoomClient) Use

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

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

type RoomConnection

type RoomConnection struct {
	Edges      []*RoomEdge `json:"edges"`
	PageInfo   PageInfo    `json:"pageInfo"`
	TotalCount int         `json:"totalCount"`
}

RoomConnection is the connection containing edges to Room.

type RoomCreate

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

RoomCreate is the builder for creating a Room entity.

func (*RoomCreate) AddGameIDs

func (rc *RoomCreate) AddGameIDs(ids ...int64) *RoomCreate

AddGameIDs adds the "games" edge to the Game entity by IDs.

func (*RoomCreate) AddGames

func (rc *RoomCreate) AddGames(g ...*Game) *RoomCreate

AddGames adds the "games" edges to the Game entity.

func (*RoomCreate) AddRecordIDs

func (rc *RoomCreate) AddRecordIDs(ids ...int64) *RoomCreate

AddRecordIDs adds the "records" edge to the Record entity by IDs.

func (*RoomCreate) AddRecords

func (rc *RoomCreate) AddRecords(r ...*Record) *RoomCreate

AddRecords adds the "records" edges to the Record entity.

func (*RoomCreate) AddRoomUserIDs

func (rc *RoomCreate) AddRoomUserIDs(ids ...int64) *RoomCreate

AddRoomUserIDs adds the "room_users" edge to the RoomUser entity by IDs.

func (*RoomCreate) AddRoomUsers

func (rc *RoomCreate) AddRoomUsers(r ...*RoomUser) *RoomCreate

AddRoomUsers adds the "room_users" edges to the RoomUser entity.

func (*RoomCreate) Exec

func (rc *RoomCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*RoomCreate) ExecX

func (rc *RoomCreate) ExecX(ctx context.Context)

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

func (*RoomCreate) Mutation

func (rc *RoomCreate) Mutation() *RoomMutation

Mutation returns the RoomMutation object of the builder.

func (*RoomCreate) Save

func (rc *RoomCreate) Save(ctx context.Context) (*Room, error)

Save creates the Room in the database.

func (*RoomCreate) SaveX

func (rc *RoomCreate) SaveX(ctx context.Context) *Room

SaveX calls Save and panics if Save returns an error.

func (*RoomCreate) SetClosed

func (rc *RoomCreate) SetClosed(b bool) *RoomCreate

SetClosed sets the "closed" field.

func (*RoomCreate) SetCreatedAt

func (rc *RoomCreate) SetCreatedAt(t time.Time) *RoomCreate

SetCreatedAt sets the "created_at" field.

func (*RoomCreate) SetCreatedBy

func (rc *RoomCreate) SetCreatedBy(i int64) *RoomCreate

SetCreatedBy sets the "created_by" field.

func (*RoomCreate) SetDeletedAt

func (rc *RoomCreate) SetDeletedAt(t time.Time) *RoomCreate

SetDeletedAt sets the "deleted_at" field.

func (*RoomCreate) SetGameOn

func (rc *RoomCreate) SetGameOn(b bool) *RoomCreate

SetGameOn sets the "game_on" field.

func (*RoomCreate) SetID

func (rc *RoomCreate) SetID(i int64) *RoomCreate

SetID sets the "id" field.

func (*RoomCreate) SetInput

func (c *RoomCreate) SetInput(i CreateRoomInput) *RoomCreate

SetInput applies the change-set in the CreateRoomInput on the RoomCreate builder.

func (*RoomCreate) SetName

func (rc *RoomCreate) SetName(s string) *RoomCreate

SetName sets the "name" field.

func (*RoomCreate) SetNillableClosed

func (rc *RoomCreate) SetNillableClosed(b *bool) *RoomCreate

SetNillableClosed sets the "closed" field if the given value is not nil.

func (*RoomCreate) SetNillableCreatedAt

func (rc *RoomCreate) SetNillableCreatedAt(t *time.Time) *RoomCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*RoomCreate) SetNillableCreatedBy

func (rc *RoomCreate) SetNillableCreatedBy(i *int64) *RoomCreate

SetNillableCreatedBy sets the "created_by" field if the given value is not nil.

func (*RoomCreate) SetNillableDeletedAt

func (rc *RoomCreate) SetNillableDeletedAt(t *time.Time) *RoomCreate

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*RoomCreate) SetNillableGameOn

func (rc *RoomCreate) SetNillableGameOn(b *bool) *RoomCreate

SetNillableGameOn sets the "game_on" field if the given value is not nil.

func (*RoomCreate) SetNillableID

func (rc *RoomCreate) SetNillableID(i *int64) *RoomCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*RoomCreate) SetNillableName

func (rc *RoomCreate) SetNillableName(s *string) *RoomCreate

SetNillableName sets the "name" field if the given value is not nil.

func (*RoomCreate) SetNillableUpdatedAt

func (rc *RoomCreate) SetNillableUpdatedAt(t *time.Time) *RoomCreate

SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.

func (*RoomCreate) SetNillableUpdatedBy

func (rc *RoomCreate) SetNillableUpdatedBy(i *int64) *RoomCreate

SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil.

func (*RoomCreate) SetUpdatedAt

func (rc *RoomCreate) SetUpdatedAt(t time.Time) *RoomCreate

SetUpdatedAt sets the "updated_at" field.

func (*RoomCreate) SetUpdatedBy

func (rc *RoomCreate) SetUpdatedBy(i int64) *RoomCreate

SetUpdatedBy sets the "updated_by" field.

type RoomCreateBulk

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

RoomCreateBulk is the builder for creating many Room entities in bulk.

func (*RoomCreateBulk) Exec

func (rcb *RoomCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*RoomCreateBulk) ExecX

func (rcb *RoomCreateBulk) ExecX(ctx context.Context)

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

func (*RoomCreateBulk) Save

func (rcb *RoomCreateBulk) Save(ctx context.Context) ([]*Room, error)

Save creates the Room entities in the database.

func (*RoomCreateBulk) SaveX

func (rcb *RoomCreateBulk) SaveX(ctx context.Context) []*Room

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

type RoomDelete

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

RoomDelete is the builder for deleting a Room entity.

func (*RoomDelete) Exec

func (rd *RoomDelete) Exec(ctx context.Context) (int, error)

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

func (*RoomDelete) ExecX

func (rd *RoomDelete) ExecX(ctx context.Context) int

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

func (*RoomDelete) Where

func (rd *RoomDelete) Where(ps ...predicate.Room) *RoomDelete

Where appends a list predicates to the RoomDelete builder.

type RoomDeleteOne

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

RoomDeleteOne is the builder for deleting a single Room entity.

func (*RoomDeleteOne) Exec

func (rdo *RoomDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*RoomDeleteOne) ExecX

func (rdo *RoomDeleteOne) ExecX(ctx context.Context)

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

type RoomEdge

type RoomEdge struct {
	Node   *Room  `json:"node"`
	Cursor Cursor `json:"cursor"`
}

RoomEdge is the edge representation of Room.

type RoomEdges

type RoomEdges struct {
	// RoomUsers holds the value of the room_users edge.
	RoomUsers []*RoomUser `json:"room_users,omitempty"`
	// Games holds the value of the games edge.
	Games []*Game `json:"games,omitempty"`
	// Records holds the value of the records edge.
	Records []*Record `json:"records,omitempty"`
	// contains filtered or unexported fields
}

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

func (RoomEdges) GamesOrErr

func (e RoomEdges) GamesOrErr() ([]*Game, error)

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

func (RoomEdges) RecordsOrErr

func (e RoomEdges) RecordsOrErr() ([]*Record, error)

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

func (RoomEdges) RoomUsersOrErr

func (e RoomEdges) RoomUsersOrErr() ([]*RoomUser, error)

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

type RoomGroupBy

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

RoomGroupBy is the group-by builder for Room entities.

func (*RoomGroupBy) Aggregate

func (rgb *RoomGroupBy) Aggregate(fns ...AggregateFunc) *RoomGroupBy

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

func (*RoomGroupBy) Bool

func (s *RoomGroupBy) Bool(ctx context.Context) (_ bool, err error)

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

func (*RoomGroupBy) BoolX

func (s *RoomGroupBy) BoolX(ctx context.Context) bool

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

func (*RoomGroupBy) Bools

func (s *RoomGroupBy) Bools(ctx context.Context) ([]bool, error)

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

func (*RoomGroupBy) BoolsX

func (s *RoomGroupBy) BoolsX(ctx context.Context) []bool

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

func (*RoomGroupBy) Float64

func (s *RoomGroupBy) Float64(ctx context.Context) (_ float64, err error)

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

func (*RoomGroupBy) Float64X

func (s *RoomGroupBy) Float64X(ctx context.Context) float64

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

func (*RoomGroupBy) Float64s

func (s *RoomGroupBy) Float64s(ctx context.Context) ([]float64, error)

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

func (*RoomGroupBy) Float64sX

func (s *RoomGroupBy) Float64sX(ctx context.Context) []float64

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

func (*RoomGroupBy) Int

func (s *RoomGroupBy) Int(ctx context.Context) (_ int, err error)

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

func (*RoomGroupBy) IntX

func (s *RoomGroupBy) IntX(ctx context.Context) int

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

func (*RoomGroupBy) Ints

func (s *RoomGroupBy) Ints(ctx context.Context) ([]int, error)

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

func (*RoomGroupBy) IntsX

func (s *RoomGroupBy) IntsX(ctx context.Context) []int

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

func (*RoomGroupBy) Scan

func (rgb *RoomGroupBy) Scan(ctx context.Context, v any) error

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

func (*RoomGroupBy) ScanX

func (s *RoomGroupBy) ScanX(ctx context.Context, v any)

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

func (*RoomGroupBy) String

func (s *RoomGroupBy) String(ctx context.Context) (_ string, err error)

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

func (*RoomGroupBy) StringX

func (s *RoomGroupBy) StringX(ctx context.Context) string

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

func (*RoomGroupBy) Strings

func (s *RoomGroupBy) Strings(ctx context.Context) ([]string, error)

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

func (*RoomGroupBy) StringsX

func (s *RoomGroupBy) StringsX(ctx context.Context) []string

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

type RoomMutation

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

RoomMutation represents an operation that mutates the Room nodes in the graph.

func (*RoomMutation) AddCreatedBy

func (m *RoomMutation) AddCreatedBy(i int64)

AddCreatedBy adds i to the "created_by" field.

func (*RoomMutation) AddField

func (m *RoomMutation) 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 (*RoomMutation) AddGameIDs

func (m *RoomMutation) AddGameIDs(ids ...int64)

AddGameIDs adds the "games" edge to the Game entity by ids.

func (*RoomMutation) AddRecordIDs

func (m *RoomMutation) AddRecordIDs(ids ...int64)

AddRecordIDs adds the "records" edge to the Record entity by ids.

func (*RoomMutation) AddRoomUserIDs

func (m *RoomMutation) AddRoomUserIDs(ids ...int64)

AddRoomUserIDs adds the "room_users" edge to the RoomUser entity by ids.

func (*RoomMutation) AddUpdatedBy

func (m *RoomMutation) AddUpdatedBy(i int64)

AddUpdatedBy adds i to the "updated_by" field.

func (*RoomMutation) AddedCreatedBy

func (m *RoomMutation) AddedCreatedBy() (r int64, exists bool)

AddedCreatedBy returns the value that was added to the "created_by" field in this mutation.

func (*RoomMutation) AddedEdges

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

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

func (*RoomMutation) AddedField

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

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

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

func (*RoomMutation) AddedIDs

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

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

func (*RoomMutation) AddedUpdatedBy

func (m *RoomMutation) AddedUpdatedBy() (r int64, exists bool)

AddedUpdatedBy returns the value that was added to the "updated_by" field in this mutation.

func (*RoomMutation) ClearEdge

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

func (m *RoomMutation) 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 (*RoomMutation) ClearGames

func (m *RoomMutation) ClearGames()

ClearGames clears the "games" edge to the Game entity.

func (*RoomMutation) ClearRecords

func (m *RoomMutation) ClearRecords()

ClearRecords clears the "records" edge to the Record entity.

func (*RoomMutation) ClearRoomUsers

func (m *RoomMutation) ClearRoomUsers()

ClearRoomUsers clears the "room_users" edge to the RoomUser entity.

func (*RoomMutation) ClearedEdges

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

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

func (*RoomMutation) ClearedFields

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

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

func (RoomMutation) Client

func (m RoomMutation) 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 (*RoomMutation) Closed

func (m *RoomMutation) Closed() (r bool, exists bool)

Closed returns the value of the "closed" field in the mutation.

func (*RoomMutation) CreatedAt

func (m *RoomMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*RoomMutation) CreatedBy

func (m *RoomMutation) CreatedBy() (r int64, exists bool)

CreatedBy returns the value of the "created_by" field in the mutation.

func (*RoomMutation) DeletedAt

func (m *RoomMutation) DeletedAt() (r time.Time, exists bool)

DeletedAt returns the value of the "deleted_at" field in the mutation.

func (*RoomMutation) EdgeCleared

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

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

func (*RoomMutation) Field

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

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

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

func (*RoomMutation) Fields

func (m *RoomMutation) 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 (*RoomMutation) GameOn

func (m *RoomMutation) GameOn() (r bool, exists bool)

GameOn returns the value of the "game_on" field in the mutation.

func (*RoomMutation) GamesCleared

func (m *RoomMutation) GamesCleared() bool

GamesCleared reports if the "games" edge to the Game entity was cleared.

func (*RoomMutation) GamesIDs

func (m *RoomMutation) GamesIDs() (ids []int64)

GamesIDs returns the "games" edge IDs in the mutation.

func (*RoomMutation) ID

func (m *RoomMutation) ID() (id int64, 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 (*RoomMutation) IDs

func (m *RoomMutation) IDs(ctx context.Context) ([]int64, error)

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

func (*RoomMutation) Name

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

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

func (*RoomMutation) OldClosed

func (m *RoomMutation) OldClosed(ctx context.Context) (v bool, err error)

OldClosed returns the old "closed" field's value of the Room entity. If the Room 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 (*RoomMutation) OldCreatedAt

func (m *RoomMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the Room entity. If the Room 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 (*RoomMutation) OldCreatedBy

func (m *RoomMutation) OldCreatedBy(ctx context.Context) (v int64, err error)

OldCreatedBy returns the old "created_by" field's value of the Room entity. If the Room 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 (*RoomMutation) OldDeletedAt

func (m *RoomMutation) OldDeletedAt(ctx context.Context) (v time.Time, err error)

OldDeletedAt returns the old "deleted_at" field's value of the Room entity. If the Room 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 (*RoomMutation) OldField

func (m *RoomMutation) 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 (*RoomMutation) OldGameOn

func (m *RoomMutation) OldGameOn(ctx context.Context) (v bool, err error)

OldGameOn returns the old "game_on" field's value of the Room entity. If the Room 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 (*RoomMutation) OldName

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

OldName returns the old "name" field's value of the Room entity. If the Room 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 (*RoomMutation) OldUpdatedAt

func (m *RoomMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)

OldUpdatedAt returns the old "updated_at" field's value of the Room entity. If the Room 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 (*RoomMutation) OldUpdatedBy

func (m *RoomMutation) OldUpdatedBy(ctx context.Context) (v int64, err error)

OldUpdatedBy returns the old "updated_by" field's value of the Room entity. If the Room 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 (*RoomMutation) Op

func (m *RoomMutation) Op() Op

Op returns the operation name.

func (*RoomMutation) RecordsCleared

func (m *RoomMutation) RecordsCleared() bool

RecordsCleared reports if the "records" edge to the Record entity was cleared.

func (*RoomMutation) RecordsIDs

func (m *RoomMutation) RecordsIDs() (ids []int64)

RecordsIDs returns the "records" edge IDs in the mutation.

func (*RoomMutation) RemoveGameIDs

func (m *RoomMutation) RemoveGameIDs(ids ...int64)

RemoveGameIDs removes the "games" edge to the Game entity by IDs.

func (*RoomMutation) RemoveRecordIDs

func (m *RoomMutation) RemoveRecordIDs(ids ...int64)

RemoveRecordIDs removes the "records" edge to the Record entity by IDs.

func (*RoomMutation) RemoveRoomUserIDs

func (m *RoomMutation) RemoveRoomUserIDs(ids ...int64)

RemoveRoomUserIDs removes the "room_users" edge to the RoomUser entity by IDs.

func (*RoomMutation) RemovedEdges

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

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

func (*RoomMutation) RemovedGamesIDs

func (m *RoomMutation) RemovedGamesIDs() (ids []int64)

RemovedGames returns the removed IDs of the "games" edge to the Game entity.

func (*RoomMutation) RemovedIDs

func (m *RoomMutation) 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 (*RoomMutation) RemovedRecordsIDs

func (m *RoomMutation) RemovedRecordsIDs() (ids []int64)

RemovedRecords returns the removed IDs of the "records" edge to the Record entity.

func (*RoomMutation) RemovedRoomUsersIDs

func (m *RoomMutation) RemovedRoomUsersIDs() (ids []int64)

RemovedRoomUsers returns the removed IDs of the "room_users" edge to the RoomUser entity.

func (*RoomMutation) ResetClosed

func (m *RoomMutation) ResetClosed()

ResetClosed resets all changes to the "closed" field.

func (*RoomMutation) ResetCreatedAt

func (m *RoomMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*RoomMutation) ResetCreatedBy

func (m *RoomMutation) ResetCreatedBy()

ResetCreatedBy resets all changes to the "created_by" field.

func (*RoomMutation) ResetDeletedAt

func (m *RoomMutation) ResetDeletedAt()

ResetDeletedAt resets all changes to the "deleted_at" field.

func (*RoomMutation) ResetEdge

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

func (m *RoomMutation) 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 (*RoomMutation) ResetGameOn

func (m *RoomMutation) ResetGameOn()

ResetGameOn resets all changes to the "game_on" field.

func (*RoomMutation) ResetGames

func (m *RoomMutation) ResetGames()

ResetGames resets all changes to the "games" edge.

func (*RoomMutation) ResetName

func (m *RoomMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*RoomMutation) ResetRecords

func (m *RoomMutation) ResetRecords()

ResetRecords resets all changes to the "records" edge.

func (*RoomMutation) ResetRoomUsers

func (m *RoomMutation) ResetRoomUsers()

ResetRoomUsers resets all changes to the "room_users" edge.

func (*RoomMutation) ResetUpdatedAt

func (m *RoomMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*RoomMutation) ResetUpdatedBy

func (m *RoomMutation) ResetUpdatedBy()

ResetUpdatedBy resets all changes to the "updated_by" field.

func (*RoomMutation) RoomUsersCleared

func (m *RoomMutation) RoomUsersCleared() bool

RoomUsersCleared reports if the "room_users" edge to the RoomUser entity was cleared.

func (*RoomMutation) RoomUsersIDs

func (m *RoomMutation) RoomUsersIDs() (ids []int64)

RoomUsersIDs returns the "room_users" edge IDs in the mutation.

func (*RoomMutation) SetClosed

func (m *RoomMutation) SetClosed(b bool)

SetClosed sets the "closed" field.

func (*RoomMutation) SetCreatedAt

func (m *RoomMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*RoomMutation) SetCreatedBy

func (m *RoomMutation) SetCreatedBy(i int64)

SetCreatedBy sets the "created_by" field.

func (*RoomMutation) SetDeletedAt

func (m *RoomMutation) SetDeletedAt(t time.Time)

SetDeletedAt sets the "deleted_at" field.

func (*RoomMutation) SetField

func (m *RoomMutation) 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 (*RoomMutation) SetGameOn

func (m *RoomMutation) SetGameOn(b bool)

SetGameOn sets the "game_on" field.

func (*RoomMutation) SetID

func (m *RoomMutation) SetID(id int64)

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

func (*RoomMutation) SetName

func (m *RoomMutation) SetName(s string)

SetName sets the "name" field.

func (*RoomMutation) SetUpdatedAt

func (m *RoomMutation) SetUpdatedAt(t time.Time)

SetUpdatedAt sets the "updated_at" field.

func (*RoomMutation) SetUpdatedBy

func (m *RoomMutation) SetUpdatedBy(i int64)

SetUpdatedBy sets the "updated_by" field.

func (RoomMutation) Tx

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

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

func (*RoomMutation) Type

func (m *RoomMutation) Type() string

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

func (*RoomMutation) UpdatedAt

func (m *RoomMutation) UpdatedAt() (r time.Time, exists bool)

UpdatedAt returns the value of the "updated_at" field in the mutation.

func (*RoomMutation) UpdatedBy

func (m *RoomMutation) UpdatedBy() (r int64, exists bool)

UpdatedBy returns the value of the "updated_by" field in the mutation.

func (*RoomMutation) Where

func (m *RoomMutation) Where(ps ...predicate.Room)

Where appends a list predicates to the RoomMutation builder.

type RoomOrder

type RoomOrder struct {
	Direction OrderDirection  `json:"direction"`
	Field     *RoomOrderField `json:"field"`
}

RoomOrder defines the ordering of Room.

type RoomOrderField

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

RoomOrderField defines the ordering field of Room.

func (RoomOrderField) MarshalGQL

func (f RoomOrderField) MarshalGQL(w io.Writer)

MarshalGQL implements graphql.Marshaler interface.

func (RoomOrderField) String

func (f RoomOrderField) String() string

String implement fmt.Stringer interface.

func (*RoomOrderField) UnmarshalGQL

func (f *RoomOrderField) UnmarshalGQL(v interface{}) error

UnmarshalGQL implements graphql.Unmarshaler interface.

type RoomPaginateOption

type RoomPaginateOption func(*roomPager) error

RoomPaginateOption enables pagination customization.

func WithRoomFilter

func WithRoomFilter(filter func(*RoomQuery) (*RoomQuery, error)) RoomPaginateOption

WithRoomFilter configures pagination filter.

func WithRoomOrder

func WithRoomOrder(order *RoomOrder) RoomPaginateOption

WithRoomOrder configures pagination ordering.

type RoomQuery

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

RoomQuery is the builder for querying Room entities.

func (*RoomQuery) Aggregate

func (rq *RoomQuery) Aggregate(fns ...AggregateFunc) *RoomSelect

Aggregate returns a RoomSelect configured with the given aggregations.

func (*RoomQuery) All

func (rq *RoomQuery) All(ctx context.Context) ([]*Room, error)

All executes the query and returns a list of Rooms.

func (*RoomQuery) AllX

func (rq *RoomQuery) AllX(ctx context.Context) []*Room

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

func (*RoomQuery) Clone

func (rq *RoomQuery) Clone() *RoomQuery

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

func (*RoomQuery) CollectFields

func (r *RoomQuery) CollectFields(ctx context.Context, satisfies ...string) (*RoomQuery, error)

CollectFields tells the query-builder to eagerly load connected nodes by resolver context.

func (*RoomQuery) Count

func (rq *RoomQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*RoomQuery) CountX

func (rq *RoomQuery) CountX(ctx context.Context) int

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

func (*RoomQuery) Exist

func (rq *RoomQuery) Exist(ctx context.Context) (bool, error)

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

func (*RoomQuery) ExistX

func (rq *RoomQuery) ExistX(ctx context.Context) bool

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

func (*RoomQuery) First

func (rq *RoomQuery) First(ctx context.Context) (*Room, error)

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

func (*RoomQuery) FirstID

func (rq *RoomQuery) FirstID(ctx context.Context) (id int64, err error)

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

func (*RoomQuery) FirstIDX

func (rq *RoomQuery) FirstIDX(ctx context.Context) int64

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

func (*RoomQuery) FirstX

func (rq *RoomQuery) FirstX(ctx context.Context) *Room

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

func (*RoomQuery) GroupBy

func (rq *RoomQuery) GroupBy(field string, fields ...string) *RoomGroupBy

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 {
	CreatedBy int64 `json:"created_by"`
	Count int `json:"count,omitempty"`
}

client.Room.Query().
	GroupBy(room.FieldCreatedBy).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*RoomQuery) IDs

func (rq *RoomQuery) IDs(ctx context.Context) ([]int64, error)

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

func (*RoomQuery) IDsX

func (rq *RoomQuery) IDsX(ctx context.Context) []int64

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

func (*RoomQuery) Limit

func (rq *RoomQuery) Limit(limit int) *RoomQuery

Limit adds a limit step to the query.

func (*RoomQuery) Offset

func (rq *RoomQuery) Offset(offset int) *RoomQuery

Offset adds an offset step to the query.

func (*RoomQuery) Only

func (rq *RoomQuery) Only(ctx context.Context) (*Room, error)

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

func (*RoomQuery) OnlyID

func (rq *RoomQuery) OnlyID(ctx context.Context) (id int64, err error)

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

func (*RoomQuery) OnlyIDX

func (rq *RoomQuery) OnlyIDX(ctx context.Context) int64

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

func (*RoomQuery) OnlyX

func (rq *RoomQuery) OnlyX(ctx context.Context) *Room

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

func (*RoomQuery) Order

func (rq *RoomQuery) Order(o ...OrderFunc) *RoomQuery

Order adds an order step to the query.

func (*RoomQuery) Paginate

func (r *RoomQuery) Paginate(
	ctx context.Context, after *Cursor, first *int,
	before *Cursor, last *int, opts ...RoomPaginateOption,
) (*RoomConnection, error)

Paginate executes the query and returns a relay based cursor connection to Room.

func (*RoomQuery) QueryGames

func (rq *RoomQuery) QueryGames() *GameQuery

QueryGames chains the current query on the "games" edge.

func (*RoomQuery) QueryRecords

func (rq *RoomQuery) QueryRecords() *RecordQuery

QueryRecords chains the current query on the "records" edge.

func (*RoomQuery) QueryRoomUsers

func (rq *RoomQuery) QueryRoomUsers() *RoomUserQuery

QueryRoomUsers chains the current query on the "room_users" edge.

func (*RoomQuery) Select

func (rq *RoomQuery) Select(fields ...string) *RoomSelect

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 {
	CreatedBy int64 `json:"created_by"`
}

client.Room.Query().
	Select(room.FieldCreatedBy).
	Scan(ctx, &v)

func (*RoomQuery) Unique

func (rq *RoomQuery) Unique(unique bool) *RoomQuery

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

func (rq *RoomQuery) Where(ps ...predicate.Room) *RoomQuery

Where adds a new predicate for the RoomQuery builder.

func (*RoomQuery) WithGames

func (rq *RoomQuery) WithGames(opts ...func(*GameQuery)) *RoomQuery

WithGames tells the query-builder to eager-load the nodes that are connected to the "games" edge. The optional arguments are used to configure the query builder of the edge.

func (*RoomQuery) WithNamedGames

func (rq *RoomQuery) WithNamedGames(name string, opts ...func(*GameQuery)) *RoomQuery

WithNamedGames tells the query-builder to eager-load the nodes that are connected to the "games" edge with the given name. The optional arguments are used to configure the query builder of the edge.

func (*RoomQuery) WithNamedRecords

func (rq *RoomQuery) WithNamedRecords(name string, opts ...func(*RecordQuery)) *RoomQuery

WithNamedRecords tells the query-builder to eager-load the nodes that are connected to the "records" edge with the given name. The optional arguments are used to configure the query builder of the edge.

func (*RoomQuery) WithNamedRoomUsers

func (rq *RoomQuery) WithNamedRoomUsers(name string, opts ...func(*RoomUserQuery)) *RoomQuery

WithNamedRoomUsers tells the query-builder to eager-load the nodes that are connected to the "room_users" edge with the given name. The optional arguments are used to configure the query builder of the edge.

func (*RoomQuery) WithRecords

func (rq *RoomQuery) WithRecords(opts ...func(*RecordQuery)) *RoomQuery

WithRecords tells the query-builder to eager-load the nodes that are connected to the "records" edge. The optional arguments are used to configure the query builder of the edge.

func (*RoomQuery) WithRoomUsers

func (rq *RoomQuery) WithRoomUsers(opts ...func(*RoomUserQuery)) *RoomQuery

WithRoomUsers tells the query-builder to eager-load the nodes that are connected to the "room_users" edge. The optional arguments are used to configure the query builder of the edge.

type RoomSelect

type RoomSelect struct {
	*RoomQuery
	// contains filtered or unexported fields
}

RoomSelect is the builder for selecting fields of Room entities.

func (*RoomSelect) Aggregate

func (rs *RoomSelect) Aggregate(fns ...AggregateFunc) *RoomSelect

Aggregate adds the given aggregation functions to the selector query.

func (*RoomSelect) Bool

func (s *RoomSelect) Bool(ctx context.Context) (_ bool, err error)

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

func (*RoomSelect) BoolX

func (s *RoomSelect) BoolX(ctx context.Context) bool

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

func (*RoomSelect) Bools

func (s *RoomSelect) Bools(ctx context.Context) ([]bool, error)

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

func (*RoomSelect) BoolsX

func (s *RoomSelect) BoolsX(ctx context.Context) []bool

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

func (*RoomSelect) Float64

func (s *RoomSelect) Float64(ctx context.Context) (_ float64, err error)

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

func (*RoomSelect) Float64X

func (s *RoomSelect) Float64X(ctx context.Context) float64

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

func (*RoomSelect) Float64s

func (s *RoomSelect) Float64s(ctx context.Context) ([]float64, error)

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

func (*RoomSelect) Float64sX

func (s *RoomSelect) Float64sX(ctx context.Context) []float64

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

func (*RoomSelect) Int

func (s *RoomSelect) Int(ctx context.Context) (_ int, err error)

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

func (*RoomSelect) IntX

func (s *RoomSelect) IntX(ctx context.Context) int

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

func (*RoomSelect) Ints

func (s *RoomSelect) Ints(ctx context.Context) ([]int, error)

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

func (*RoomSelect) IntsX

func (s *RoomSelect) IntsX(ctx context.Context) []int

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

func (*RoomSelect) Scan

func (rs *RoomSelect) Scan(ctx context.Context, v any) error

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

func (*RoomSelect) ScanX

func (s *RoomSelect) ScanX(ctx context.Context, v any)

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

func (*RoomSelect) String

func (s *RoomSelect) String(ctx context.Context) (_ string, err error)

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

func (*RoomSelect) StringX

func (s *RoomSelect) StringX(ctx context.Context) string

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

func (*RoomSelect) Strings

func (s *RoomSelect) Strings(ctx context.Context) ([]string, error)

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

func (*RoomSelect) StringsX

func (s *RoomSelect) StringsX(ctx context.Context) []string

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

type RoomUpdate

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

RoomUpdate is the builder for updating Room entities.

func (*RoomUpdate) AddCreatedBy

func (ru *RoomUpdate) AddCreatedBy(i int64) *RoomUpdate

AddCreatedBy adds i to the "created_by" field.

func (*RoomUpdate) AddGameIDs

func (ru *RoomUpdate) AddGameIDs(ids ...int64) *RoomUpdate

AddGameIDs adds the "games" edge to the Game entity by IDs.

func (*RoomUpdate) AddGames

func (ru *RoomUpdate) AddGames(g ...*Game) *RoomUpdate

AddGames adds the "games" edges to the Game entity.

func (*RoomUpdate) AddRecordIDs

func (ru *RoomUpdate) AddRecordIDs(ids ...int64) *RoomUpdate

AddRecordIDs adds the "records" edge to the Record entity by IDs.

func (*RoomUpdate) AddRecords

func (ru *RoomUpdate) AddRecords(r ...*Record) *RoomUpdate

AddRecords adds the "records" edges to the Record entity.

func (*RoomUpdate) AddRoomUserIDs

func (ru *RoomUpdate) AddRoomUserIDs(ids ...int64) *RoomUpdate

AddRoomUserIDs adds the "room_users" edge to the RoomUser entity by IDs.

func (*RoomUpdate) AddRoomUsers

func (ru *RoomUpdate) AddRoomUsers(r ...*RoomUser) *RoomUpdate

AddRoomUsers adds the "room_users" edges to the RoomUser entity.

func (*RoomUpdate) AddUpdatedBy

func (ru *RoomUpdate) AddUpdatedBy(i int64) *RoomUpdate

AddUpdatedBy adds i to the "updated_by" field.

func (*RoomUpdate) ClearGames

func (ru *RoomUpdate) ClearGames() *RoomUpdate

ClearGames clears all "games" edges to the Game entity.

func (*RoomUpdate) ClearRecords

func (ru *RoomUpdate) ClearRecords() *RoomUpdate

ClearRecords clears all "records" edges to the Record entity.

func (*RoomUpdate) ClearRoomUsers

func (ru *RoomUpdate) ClearRoomUsers() *RoomUpdate

ClearRoomUsers clears all "room_users" edges to the RoomUser entity.

func (*RoomUpdate) Exec

func (ru *RoomUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*RoomUpdate) ExecX

func (ru *RoomUpdate) ExecX(ctx context.Context)

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

func (*RoomUpdate) Mutation

func (ru *RoomUpdate) Mutation() *RoomMutation

Mutation returns the RoomMutation object of the builder.

func (*RoomUpdate) RemoveGameIDs

func (ru *RoomUpdate) RemoveGameIDs(ids ...int64) *RoomUpdate

RemoveGameIDs removes the "games" edge to Game entities by IDs.

func (*RoomUpdate) RemoveGames

func (ru *RoomUpdate) RemoveGames(g ...*Game) *RoomUpdate

RemoveGames removes "games" edges to Game entities.

func (*RoomUpdate) RemoveRecordIDs

func (ru *RoomUpdate) RemoveRecordIDs(ids ...int64) *RoomUpdate

RemoveRecordIDs removes the "records" edge to Record entities by IDs.

func (*RoomUpdate) RemoveRecords

func (ru *RoomUpdate) RemoveRecords(r ...*Record) *RoomUpdate

RemoveRecords removes "records" edges to Record entities.

func (*RoomUpdate) RemoveRoomUserIDs

func (ru *RoomUpdate) RemoveRoomUserIDs(ids ...int64) *RoomUpdate

RemoveRoomUserIDs removes the "room_users" edge to RoomUser entities by IDs.

func (*RoomUpdate) RemoveRoomUsers

func (ru *RoomUpdate) RemoveRoomUsers(r ...*RoomUser) *RoomUpdate

RemoveRoomUsers removes "room_users" edges to RoomUser entities.

func (*RoomUpdate) Save

func (ru *RoomUpdate) Save(ctx context.Context) (int, error)

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

func (*RoomUpdate) SaveX

func (ru *RoomUpdate) SaveX(ctx context.Context) int

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

func (*RoomUpdate) SetClosed

func (ru *RoomUpdate) SetClosed(b bool) *RoomUpdate

SetClosed sets the "closed" field.

func (*RoomUpdate) SetCreatedBy

func (ru *RoomUpdate) SetCreatedBy(i int64) *RoomUpdate

SetCreatedBy sets the "created_by" field.

func (*RoomUpdate) SetDeletedAt

func (ru *RoomUpdate) SetDeletedAt(t time.Time) *RoomUpdate

SetDeletedAt sets the "deleted_at" field.

func (*RoomUpdate) SetGameOn

func (ru *RoomUpdate) SetGameOn(b bool) *RoomUpdate

SetGameOn sets the "game_on" field.

func (*RoomUpdate) SetInput

func (c *RoomUpdate) SetInput(i UpdateRoomInput) *RoomUpdate

SetInput applies the change-set in the UpdateRoomInput on the RoomUpdate builder.

func (*RoomUpdate) SetName

func (ru *RoomUpdate) SetName(s string) *RoomUpdate

SetName sets the "name" field.

func (*RoomUpdate) SetNillableClosed

func (ru *RoomUpdate) SetNillableClosed(b *bool) *RoomUpdate

SetNillableClosed sets the "closed" field if the given value is not nil.

func (*RoomUpdate) SetNillableCreatedBy

func (ru *RoomUpdate) SetNillableCreatedBy(i *int64) *RoomUpdate

SetNillableCreatedBy sets the "created_by" field if the given value is not nil.

func (*RoomUpdate) SetNillableDeletedAt

func (ru *RoomUpdate) SetNillableDeletedAt(t *time.Time) *RoomUpdate

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*RoomUpdate) SetNillableGameOn

func (ru *RoomUpdate) SetNillableGameOn(b *bool) *RoomUpdate

SetNillableGameOn sets the "game_on" field if the given value is not nil.

func (*RoomUpdate) SetNillableName

func (ru *RoomUpdate) SetNillableName(s *string) *RoomUpdate

SetNillableName sets the "name" field if the given value is not nil.

func (*RoomUpdate) SetNillableUpdatedBy

func (ru *RoomUpdate) SetNillableUpdatedBy(i *int64) *RoomUpdate

SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil.

func (*RoomUpdate) SetUpdatedAt

func (ru *RoomUpdate) SetUpdatedAt(t time.Time) *RoomUpdate

SetUpdatedAt sets the "updated_at" field.

func (*RoomUpdate) SetUpdatedBy

func (ru *RoomUpdate) SetUpdatedBy(i int64) *RoomUpdate

SetUpdatedBy sets the "updated_by" field.

func (*RoomUpdate) Where

func (ru *RoomUpdate) Where(ps ...predicate.Room) *RoomUpdate

Where appends a list predicates to the RoomUpdate builder.

type RoomUpdateOne

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

RoomUpdateOne is the builder for updating a single Room entity.

func (*RoomUpdateOne) AddCreatedBy

func (ruo *RoomUpdateOne) AddCreatedBy(i int64) *RoomUpdateOne

AddCreatedBy adds i to the "created_by" field.

func (*RoomUpdateOne) AddGameIDs

func (ruo *RoomUpdateOne) AddGameIDs(ids ...int64) *RoomUpdateOne

AddGameIDs adds the "games" edge to the Game entity by IDs.

func (*RoomUpdateOne) AddGames

func (ruo *RoomUpdateOne) AddGames(g ...*Game) *RoomUpdateOne

AddGames adds the "games" edges to the Game entity.

func (*RoomUpdateOne) AddRecordIDs

func (ruo *RoomUpdateOne) AddRecordIDs(ids ...int64) *RoomUpdateOne

AddRecordIDs adds the "records" edge to the Record entity by IDs.

func (*RoomUpdateOne) AddRecords

func (ruo *RoomUpdateOne) AddRecords(r ...*Record) *RoomUpdateOne

AddRecords adds the "records" edges to the Record entity.

func (*RoomUpdateOne) AddRoomUserIDs

func (ruo *RoomUpdateOne) AddRoomUserIDs(ids ...int64) *RoomUpdateOne

AddRoomUserIDs adds the "room_users" edge to the RoomUser entity by IDs.

func (*RoomUpdateOne) AddRoomUsers

func (ruo *RoomUpdateOne) AddRoomUsers(r ...*RoomUser) *RoomUpdateOne

AddRoomUsers adds the "room_users" edges to the RoomUser entity.

func (*RoomUpdateOne) AddUpdatedBy

func (ruo *RoomUpdateOne) AddUpdatedBy(i int64) *RoomUpdateOne

AddUpdatedBy adds i to the "updated_by" field.

func (*RoomUpdateOne) ClearGames

func (ruo *RoomUpdateOne) ClearGames() *RoomUpdateOne

ClearGames clears all "games" edges to the Game entity.

func (*RoomUpdateOne) ClearRecords

func (ruo *RoomUpdateOne) ClearRecords() *RoomUpdateOne

ClearRecords clears all "records" edges to the Record entity.

func (*RoomUpdateOne) ClearRoomUsers

func (ruo *RoomUpdateOne) ClearRoomUsers() *RoomUpdateOne

ClearRoomUsers clears all "room_users" edges to the RoomUser entity.

func (*RoomUpdateOne) Exec

func (ruo *RoomUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*RoomUpdateOne) ExecX

func (ruo *RoomUpdateOne) ExecX(ctx context.Context)

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

func (*RoomUpdateOne) Mutation

func (ruo *RoomUpdateOne) Mutation() *RoomMutation

Mutation returns the RoomMutation object of the builder.

func (*RoomUpdateOne) RemoveGameIDs

func (ruo *RoomUpdateOne) RemoveGameIDs(ids ...int64) *RoomUpdateOne

RemoveGameIDs removes the "games" edge to Game entities by IDs.

func (*RoomUpdateOne) RemoveGames

func (ruo *RoomUpdateOne) RemoveGames(g ...*Game) *RoomUpdateOne

RemoveGames removes "games" edges to Game entities.

func (*RoomUpdateOne) RemoveRecordIDs

func (ruo *RoomUpdateOne) RemoveRecordIDs(ids ...int64) *RoomUpdateOne

RemoveRecordIDs removes the "records" edge to Record entities by IDs.

func (*RoomUpdateOne) RemoveRecords

func (ruo *RoomUpdateOne) RemoveRecords(r ...*Record) *RoomUpdateOne

RemoveRecords removes "records" edges to Record entities.

func (*RoomUpdateOne) RemoveRoomUserIDs

func (ruo *RoomUpdateOne) RemoveRoomUserIDs(ids ...int64) *RoomUpdateOne

RemoveRoomUserIDs removes the "room_users" edge to RoomUser entities by IDs.

func (*RoomUpdateOne) RemoveRoomUsers

func (ruo *RoomUpdateOne) RemoveRoomUsers(r ...*RoomUser) *RoomUpdateOne

RemoveRoomUsers removes "room_users" edges to RoomUser entities.

func (*RoomUpdateOne) Save

func (ruo *RoomUpdateOne) Save(ctx context.Context) (*Room, error)

Save executes the query and returns the updated Room entity.

func (*RoomUpdateOne) SaveX

func (ruo *RoomUpdateOne) SaveX(ctx context.Context) *Room

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

func (*RoomUpdateOne) Select

func (ruo *RoomUpdateOne) Select(field string, fields ...string) *RoomUpdateOne

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

func (*RoomUpdateOne) SetClosed

func (ruo *RoomUpdateOne) SetClosed(b bool) *RoomUpdateOne

SetClosed sets the "closed" field.

func (*RoomUpdateOne) SetCreatedBy

func (ruo *RoomUpdateOne) SetCreatedBy(i int64) *RoomUpdateOne

SetCreatedBy sets the "created_by" field.

func (*RoomUpdateOne) SetDeletedAt

func (ruo *RoomUpdateOne) SetDeletedAt(t time.Time) *RoomUpdateOne

SetDeletedAt sets the "deleted_at" field.

func (*RoomUpdateOne) SetGameOn

func (ruo *RoomUpdateOne) SetGameOn(b bool) *RoomUpdateOne

SetGameOn sets the "game_on" field.

func (*RoomUpdateOne) SetInput

SetInput applies the change-set in the UpdateRoomInput on the RoomUpdateOne builder.

func (*RoomUpdateOne) SetName

func (ruo *RoomUpdateOne) SetName(s string) *RoomUpdateOne

SetName sets the "name" field.

func (*RoomUpdateOne) SetNillableClosed

func (ruo *RoomUpdateOne) SetNillableClosed(b *bool) *RoomUpdateOne

SetNillableClosed sets the "closed" field if the given value is not nil.

func (*RoomUpdateOne) SetNillableCreatedBy

func (ruo *RoomUpdateOne) SetNillableCreatedBy(i *int64) *RoomUpdateOne

SetNillableCreatedBy sets the "created_by" field if the given value is not nil.

func (*RoomUpdateOne) SetNillableDeletedAt

func (ruo *RoomUpdateOne) SetNillableDeletedAt(t *time.Time) *RoomUpdateOne

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*RoomUpdateOne) SetNillableGameOn

func (ruo *RoomUpdateOne) SetNillableGameOn(b *bool) *RoomUpdateOne

SetNillableGameOn sets the "game_on" field if the given value is not nil.

func (*RoomUpdateOne) SetNillableName

func (ruo *RoomUpdateOne) SetNillableName(s *string) *RoomUpdateOne

SetNillableName sets the "name" field if the given value is not nil.

func (*RoomUpdateOne) SetNillableUpdatedBy

func (ruo *RoomUpdateOne) SetNillableUpdatedBy(i *int64) *RoomUpdateOne

SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil.

func (*RoomUpdateOne) SetUpdatedAt

func (ruo *RoomUpdateOne) SetUpdatedAt(t time.Time) *RoomUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*RoomUpdateOne) SetUpdatedBy

func (ruo *RoomUpdateOne) SetUpdatedBy(i int64) *RoomUpdateOne

SetUpdatedBy sets the "updated_by" field.

type RoomUser

type RoomUser struct {

	// ID of the ent.
	ID int64 `json:"id,omitempty"`
	// CreatedBy holds the value of the "created_by" field.
	CreatedBy int64 `json:"created_by"`
	// UpdatedBy holds the value of the "updated_by" field.
	UpdatedBy int64 `json:"updated_by"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at"`
	// UpdatedAt holds the value of the "updated_at" field.
	UpdatedAt time.Time `json:"updated_at"`
	// DeletedAt holds the value of the "deleted_at" field.
	DeletedAt time.Time `json:"deleted_at"`
	// 用户 ID
	UserID int64 `json:"user_id"`
	// 房间 ID
	RoomID int64 `json:"room_id"`
	// 是否为房主
	Host bool `json:"host"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the RoomUserQuery when eager-loading is set.
	Edges RoomUserEdges `json:"edges"`
	// contains filtered or unexported fields
}

RoomUser is the model entity for the RoomUser schema.

func (RoomUser) IsEntity

func (ru RoomUser) IsEntity()

IsEntity implement fedruntime.Entity

func (*RoomUser) Node

func (ru *RoomUser) Node(ctx context.Context) (node *Node, err error)

func (*RoomUser) QueryRoom

func (ru *RoomUser) QueryRoom() *RoomQuery

QueryRoom queries the "room" edge of the RoomUser entity.

func (*RoomUser) Room

func (ru *RoomUser) Room(ctx context.Context) (*Room, error)

func (*RoomUser) String

func (ru *RoomUser) String() string

String implements the fmt.Stringer.

func (*RoomUser) ToEdge

func (ru *RoomUser) ToEdge(order *RoomUserOrder) *RoomUserEdge

ToEdge converts RoomUser into RoomUserEdge.

func (*RoomUser) Unwrap

func (ru *RoomUser) Unwrap() *RoomUser

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

func (ru *RoomUser) Update() *RoomUserUpdateOne

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

type RoomUserClient

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

RoomUserClient is a client for the RoomUser schema.

func NewRoomUserClient

func NewRoomUserClient(c config) *RoomUserClient

NewRoomUserClient returns a client for the RoomUser from the given config.

func (*RoomUserClient) Create

func (c *RoomUserClient) Create() *RoomUserCreate

Create returns a builder for creating a RoomUser entity.

func (*RoomUserClient) CreateBulk

func (c *RoomUserClient) CreateBulk(builders ...*RoomUserCreate) *RoomUserCreateBulk

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

func (*RoomUserClient) Delete

func (c *RoomUserClient) Delete() *RoomUserDelete

Delete returns a delete builder for RoomUser.

func (*RoomUserClient) DeleteOne

func (c *RoomUserClient) DeleteOne(ru *RoomUser) *RoomUserDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*RoomUserClient) DeleteOneID

func (c *RoomUserClient) DeleteOneID(id int64) *RoomUserDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*RoomUserClient) Get

func (c *RoomUserClient) Get(ctx context.Context, id int64) (*RoomUser, error)

Get returns a RoomUser entity by its id.

func (*RoomUserClient) GetX

func (c *RoomUserClient) GetX(ctx context.Context, id int64) *RoomUser

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

func (*RoomUserClient) Hooks

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

Hooks returns the client hooks.

func (*RoomUserClient) Query

func (c *RoomUserClient) Query() *RoomUserQuery

Query returns a query builder for RoomUser.

func (*RoomUserClient) QueryRoom

func (c *RoomUserClient) QueryRoom(ru *RoomUser) *RoomQuery

QueryRoom queries the room edge of a RoomUser.

func (*RoomUserClient) Update

func (c *RoomUserClient) Update() *RoomUserUpdate

Update returns an update builder for RoomUser.

func (*RoomUserClient) UpdateOne

func (c *RoomUserClient) UpdateOne(ru *RoomUser) *RoomUserUpdateOne

UpdateOne returns an update builder for the given entity.

func (*RoomUserClient) UpdateOneID

func (c *RoomUserClient) UpdateOneID(id int64) *RoomUserUpdateOne

UpdateOneID returns an update builder for the given id.

func (*RoomUserClient) Use

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

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

type RoomUserConnection

type RoomUserConnection struct {
	Edges      []*RoomUserEdge `json:"edges"`
	PageInfo   PageInfo        `json:"pageInfo"`
	TotalCount int             `json:"totalCount"`
}

RoomUserConnection is the connection containing edges to RoomUser.

type RoomUserCreate

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

RoomUserCreate is the builder for creating a RoomUser entity.

func (*RoomUserCreate) Exec

func (ruc *RoomUserCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*RoomUserCreate) ExecX

func (ruc *RoomUserCreate) ExecX(ctx context.Context)

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

func (*RoomUserCreate) Mutation

func (ruc *RoomUserCreate) Mutation() *RoomUserMutation

Mutation returns the RoomUserMutation object of the builder.

func (*RoomUserCreate) Save

func (ruc *RoomUserCreate) Save(ctx context.Context) (*RoomUser, error)

Save creates the RoomUser in the database.

func (*RoomUserCreate) SaveX

func (ruc *RoomUserCreate) SaveX(ctx context.Context) *RoomUser

SaveX calls Save and panics if Save returns an error.

func (*RoomUserCreate) SetCreatedAt

func (ruc *RoomUserCreate) SetCreatedAt(t time.Time) *RoomUserCreate

SetCreatedAt sets the "created_at" field.

func (*RoomUserCreate) SetCreatedBy

func (ruc *RoomUserCreate) SetCreatedBy(i int64) *RoomUserCreate

SetCreatedBy sets the "created_by" field.

func (*RoomUserCreate) SetDeletedAt

func (ruc *RoomUserCreate) SetDeletedAt(t time.Time) *RoomUserCreate

SetDeletedAt sets the "deleted_at" field.

func (*RoomUserCreate) SetHost

func (ruc *RoomUserCreate) SetHost(b bool) *RoomUserCreate

SetHost sets the "host" field.

func (*RoomUserCreate) SetID

func (ruc *RoomUserCreate) SetID(i int64) *RoomUserCreate

SetID sets the "id" field.

func (*RoomUserCreate) SetInput

SetInput applies the change-set in the CreateRoomUserInput on the RoomUserCreate builder.

func (*RoomUserCreate) SetNillableCreatedAt

func (ruc *RoomUserCreate) SetNillableCreatedAt(t *time.Time) *RoomUserCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*RoomUserCreate) SetNillableCreatedBy

func (ruc *RoomUserCreate) SetNillableCreatedBy(i *int64) *RoomUserCreate

SetNillableCreatedBy sets the "created_by" field if the given value is not nil.

func (*RoomUserCreate) SetNillableDeletedAt

func (ruc *RoomUserCreate) SetNillableDeletedAt(t *time.Time) *RoomUserCreate

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*RoomUserCreate) SetNillableHost

func (ruc *RoomUserCreate) SetNillableHost(b *bool) *RoomUserCreate

SetNillableHost sets the "host" field if the given value is not nil.

func (*RoomUserCreate) SetNillableID

func (ruc *RoomUserCreate) SetNillableID(i *int64) *RoomUserCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*RoomUserCreate) SetNillableUpdatedAt

func (ruc *RoomUserCreate) SetNillableUpdatedAt(t *time.Time) *RoomUserCreate

SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.

func (*RoomUserCreate) SetNillableUpdatedBy

func (ruc *RoomUserCreate) SetNillableUpdatedBy(i *int64) *RoomUserCreate

SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil.

func (*RoomUserCreate) SetRoom

func (ruc *RoomUserCreate) SetRoom(r *Room) *RoomUserCreate

SetRoom sets the "room" edge to the Room entity.

func (*RoomUserCreate) SetRoomID

func (ruc *RoomUserCreate) SetRoomID(i int64) *RoomUserCreate

SetRoomID sets the "room_id" field.

func (*RoomUserCreate) SetUpdatedAt

func (ruc *RoomUserCreate) SetUpdatedAt(t time.Time) *RoomUserCreate

SetUpdatedAt sets the "updated_at" field.

func (*RoomUserCreate) SetUpdatedBy

func (ruc *RoomUserCreate) SetUpdatedBy(i int64) *RoomUserCreate

SetUpdatedBy sets the "updated_by" field.

func (*RoomUserCreate) SetUserID

func (ruc *RoomUserCreate) SetUserID(i int64) *RoomUserCreate

SetUserID sets the "user_id" field.

type RoomUserCreateBulk

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

RoomUserCreateBulk is the builder for creating many RoomUser entities in bulk.

func (*RoomUserCreateBulk) Exec

func (rucb *RoomUserCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*RoomUserCreateBulk) ExecX

func (rucb *RoomUserCreateBulk) ExecX(ctx context.Context)

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

func (*RoomUserCreateBulk) Save

func (rucb *RoomUserCreateBulk) Save(ctx context.Context) ([]*RoomUser, error)

Save creates the RoomUser entities in the database.

func (*RoomUserCreateBulk) SaveX

func (rucb *RoomUserCreateBulk) SaveX(ctx context.Context) []*RoomUser

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

type RoomUserDelete

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

RoomUserDelete is the builder for deleting a RoomUser entity.

func (*RoomUserDelete) Exec

func (rud *RoomUserDelete) Exec(ctx context.Context) (int, error)

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

func (*RoomUserDelete) ExecX

func (rud *RoomUserDelete) ExecX(ctx context.Context) int

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

func (*RoomUserDelete) Where

func (rud *RoomUserDelete) Where(ps ...predicate.RoomUser) *RoomUserDelete

Where appends a list predicates to the RoomUserDelete builder.

type RoomUserDeleteOne

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

RoomUserDeleteOne is the builder for deleting a single RoomUser entity.

func (*RoomUserDeleteOne) Exec

func (rudo *RoomUserDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*RoomUserDeleteOne) ExecX

func (rudo *RoomUserDeleteOne) ExecX(ctx context.Context)

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

type RoomUserEdge

type RoomUserEdge struct {
	Node   *RoomUser `json:"node"`
	Cursor Cursor    `json:"cursor"`
}

RoomUserEdge is the edge representation of RoomUser.

type RoomUserEdges

type RoomUserEdges struct {
	// Room holds the value of the room edge.
	Room *Room `json:"room,omitempty"`
	// contains filtered or unexported fields
}

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

func (RoomUserEdges) RoomOrErr

func (e RoomUserEdges) RoomOrErr() (*Room, error)

RoomOrErr returns the Room value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

type RoomUserGroupBy

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

RoomUserGroupBy is the group-by builder for RoomUser entities.

func (*RoomUserGroupBy) Aggregate

func (rugb *RoomUserGroupBy) Aggregate(fns ...AggregateFunc) *RoomUserGroupBy

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

func (*RoomUserGroupBy) Bool

func (s *RoomUserGroupBy) Bool(ctx context.Context) (_ bool, err error)

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

func (*RoomUserGroupBy) BoolX

func (s *RoomUserGroupBy) BoolX(ctx context.Context) bool

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

func (*RoomUserGroupBy) Bools

func (s *RoomUserGroupBy) Bools(ctx context.Context) ([]bool, error)

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

func (*RoomUserGroupBy) BoolsX

func (s *RoomUserGroupBy) BoolsX(ctx context.Context) []bool

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

func (*RoomUserGroupBy) Float64

func (s *RoomUserGroupBy) Float64(ctx context.Context) (_ float64, err error)

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

func (*RoomUserGroupBy) Float64X

func (s *RoomUserGroupBy) Float64X(ctx context.Context) float64

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

func (*RoomUserGroupBy) Float64s

func (s *RoomUserGroupBy) Float64s(ctx context.Context) ([]float64, error)

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

func (*RoomUserGroupBy) Float64sX

func (s *RoomUserGroupBy) Float64sX(ctx context.Context) []float64

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

func (*RoomUserGroupBy) Int

func (s *RoomUserGroupBy) Int(ctx context.Context) (_ int, err error)

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

func (*RoomUserGroupBy) IntX

func (s *RoomUserGroupBy) IntX(ctx context.Context) int

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

func (*RoomUserGroupBy) Ints

func (s *RoomUserGroupBy) Ints(ctx context.Context) ([]int, error)

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

func (*RoomUserGroupBy) IntsX

func (s *RoomUserGroupBy) IntsX(ctx context.Context) []int

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

func (*RoomUserGroupBy) Scan

func (rugb *RoomUserGroupBy) Scan(ctx context.Context, v any) error

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

func (*RoomUserGroupBy) ScanX

func (s *RoomUserGroupBy) ScanX(ctx context.Context, v any)

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

func (*RoomUserGroupBy) String

func (s *RoomUserGroupBy) String(ctx context.Context) (_ string, err error)

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

func (*RoomUserGroupBy) StringX

func (s *RoomUserGroupBy) StringX(ctx context.Context) string

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

func (*RoomUserGroupBy) Strings

func (s *RoomUserGroupBy) Strings(ctx context.Context) ([]string, error)

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

func (*RoomUserGroupBy) StringsX

func (s *RoomUserGroupBy) StringsX(ctx context.Context) []string

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

type RoomUserMutation

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

RoomUserMutation represents an operation that mutates the RoomUser nodes in the graph.

func (*RoomUserMutation) AddCreatedBy

func (m *RoomUserMutation) AddCreatedBy(i int64)

AddCreatedBy adds i to the "created_by" field.

func (*RoomUserMutation) AddField

func (m *RoomUserMutation) 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 (*RoomUserMutation) AddUpdatedBy

func (m *RoomUserMutation) AddUpdatedBy(i int64)

AddUpdatedBy adds i to the "updated_by" field.

func (*RoomUserMutation) AddUserID

func (m *RoomUserMutation) AddUserID(i int64)

AddUserID adds i to the "user_id" field.

func (*RoomUserMutation) AddedCreatedBy

func (m *RoomUserMutation) AddedCreatedBy() (r int64, exists bool)

AddedCreatedBy returns the value that was added to the "created_by" field in this mutation.

func (*RoomUserMutation) AddedEdges

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

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

func (*RoomUserMutation) AddedField

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

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

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

func (*RoomUserMutation) AddedIDs

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

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

func (*RoomUserMutation) AddedUpdatedBy

func (m *RoomUserMutation) AddedUpdatedBy() (r int64, exists bool)

AddedUpdatedBy returns the value that was added to the "updated_by" field in this mutation.

func (*RoomUserMutation) AddedUserID

func (m *RoomUserMutation) AddedUserID() (r int64, exists bool)

AddedUserID returns the value that was added to the "user_id" field in this mutation.

func (*RoomUserMutation) ClearEdge

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

func (m *RoomUserMutation) 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 (*RoomUserMutation) ClearRoom

func (m *RoomUserMutation) ClearRoom()

ClearRoom clears the "room" edge to the Room entity.

func (*RoomUserMutation) ClearedEdges

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

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

func (*RoomUserMutation) ClearedFields

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

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

func (RoomUserMutation) Client

func (m RoomUserMutation) 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 (*RoomUserMutation) CreatedAt

func (m *RoomUserMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*RoomUserMutation) CreatedBy

func (m *RoomUserMutation) CreatedBy() (r int64, exists bool)

CreatedBy returns the value of the "created_by" field in the mutation.

func (*RoomUserMutation) DeletedAt

func (m *RoomUserMutation) DeletedAt() (r time.Time, exists bool)

DeletedAt returns the value of the "deleted_at" field in the mutation.

func (*RoomUserMutation) EdgeCleared

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

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

func (*RoomUserMutation) Field

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

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

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

func (*RoomUserMutation) Fields

func (m *RoomUserMutation) 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 (*RoomUserMutation) Host

func (m *RoomUserMutation) Host() (r bool, exists bool)

Host returns the value of the "host" field in the mutation.

func (*RoomUserMutation) ID

func (m *RoomUserMutation) ID() (id int64, 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 (*RoomUserMutation) IDs

func (m *RoomUserMutation) IDs(ctx context.Context) ([]int64, error)

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

func (*RoomUserMutation) OldCreatedAt

func (m *RoomUserMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the RoomUser entity. If the RoomUser 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 (*RoomUserMutation) OldCreatedBy

func (m *RoomUserMutation) OldCreatedBy(ctx context.Context) (v int64, err error)

OldCreatedBy returns the old "created_by" field's value of the RoomUser entity. If the RoomUser 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 (*RoomUserMutation) OldDeletedAt

func (m *RoomUserMutation) OldDeletedAt(ctx context.Context) (v time.Time, err error)

OldDeletedAt returns the old "deleted_at" field's value of the RoomUser entity. If the RoomUser 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 (*RoomUserMutation) OldField

func (m *RoomUserMutation) 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 (*RoomUserMutation) OldHost

func (m *RoomUserMutation) OldHost(ctx context.Context) (v bool, err error)

OldHost returns the old "host" field's value of the RoomUser entity. If the RoomUser 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 (*RoomUserMutation) OldRoomID

func (m *RoomUserMutation) OldRoomID(ctx context.Context) (v int64, err error)

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

func (m *RoomUserMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)

OldUpdatedAt returns the old "updated_at" field's value of the RoomUser entity. If the RoomUser 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 (*RoomUserMutation) OldUpdatedBy

func (m *RoomUserMutation) OldUpdatedBy(ctx context.Context) (v int64, err error)

OldUpdatedBy returns the old "updated_by" field's value of the RoomUser entity. If the RoomUser 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 (*RoomUserMutation) OldUserID

func (m *RoomUserMutation) OldUserID(ctx context.Context) (v int64, err error)

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

func (m *RoomUserMutation) Op() Op

Op returns the operation name.

func (*RoomUserMutation) RemovedEdges

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

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

func (*RoomUserMutation) RemovedIDs

func (m *RoomUserMutation) 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 (*RoomUserMutation) ResetCreatedAt

func (m *RoomUserMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*RoomUserMutation) ResetCreatedBy

func (m *RoomUserMutation) ResetCreatedBy()

ResetCreatedBy resets all changes to the "created_by" field.

func (*RoomUserMutation) ResetDeletedAt

func (m *RoomUserMutation) ResetDeletedAt()

ResetDeletedAt resets all changes to the "deleted_at" field.

func (*RoomUserMutation) ResetEdge

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

func (m *RoomUserMutation) 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 (*RoomUserMutation) ResetHost

func (m *RoomUserMutation) ResetHost()

ResetHost resets all changes to the "host" field.

func (*RoomUserMutation) ResetRoom

func (m *RoomUserMutation) ResetRoom()

ResetRoom resets all changes to the "room" edge.

func (*RoomUserMutation) ResetRoomID

func (m *RoomUserMutation) ResetRoomID()

ResetRoomID resets all changes to the "room_id" field.

func (*RoomUserMutation) ResetUpdatedAt

func (m *RoomUserMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*RoomUserMutation) ResetUpdatedBy

func (m *RoomUserMutation) ResetUpdatedBy()

ResetUpdatedBy resets all changes to the "updated_by" field.

func (*RoomUserMutation) ResetUserID

func (m *RoomUserMutation) ResetUserID()

ResetUserID resets all changes to the "user_id" field.

func (*RoomUserMutation) RoomCleared

func (m *RoomUserMutation) RoomCleared() bool

RoomCleared reports if the "room" edge to the Room entity was cleared.

func (*RoomUserMutation) RoomID

func (m *RoomUserMutation) RoomID() (r int64, exists bool)

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

func (*RoomUserMutation) RoomIDs

func (m *RoomUserMutation) RoomIDs() (ids []int64)

RoomIDs returns the "room" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use RoomID instead. It exists only for internal usage by the builders.

func (*RoomUserMutation) SetCreatedAt

func (m *RoomUserMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*RoomUserMutation) SetCreatedBy

func (m *RoomUserMutation) SetCreatedBy(i int64)

SetCreatedBy sets the "created_by" field.

func (*RoomUserMutation) SetDeletedAt

func (m *RoomUserMutation) SetDeletedAt(t time.Time)

SetDeletedAt sets the "deleted_at" field.

func (*RoomUserMutation) SetField

func (m *RoomUserMutation) 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 (*RoomUserMutation) SetHost

func (m *RoomUserMutation) SetHost(b bool)

SetHost sets the "host" field.

func (*RoomUserMutation) SetID

func (m *RoomUserMutation) SetID(id int64)

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

func (*RoomUserMutation) SetRoomID

func (m *RoomUserMutation) SetRoomID(i int64)

SetRoomID sets the "room_id" field.

func (*RoomUserMutation) SetUpdatedAt

func (m *RoomUserMutation) SetUpdatedAt(t time.Time)

SetUpdatedAt sets the "updated_at" field.

func (*RoomUserMutation) SetUpdatedBy

func (m *RoomUserMutation) SetUpdatedBy(i int64)

SetUpdatedBy sets the "updated_by" field.

func (*RoomUserMutation) SetUserID

func (m *RoomUserMutation) SetUserID(i int64)

SetUserID sets the "user_id" field.

func (RoomUserMutation) Tx

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

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

func (*RoomUserMutation) Type

func (m *RoomUserMutation) Type() string

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

func (*RoomUserMutation) UpdatedAt

func (m *RoomUserMutation) UpdatedAt() (r time.Time, exists bool)

UpdatedAt returns the value of the "updated_at" field in the mutation.

func (*RoomUserMutation) UpdatedBy

func (m *RoomUserMutation) UpdatedBy() (r int64, exists bool)

UpdatedBy returns the value of the "updated_by" field in the mutation.

func (*RoomUserMutation) UserID

func (m *RoomUserMutation) UserID() (r int64, exists bool)

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

func (*RoomUserMutation) Where

func (m *RoomUserMutation) Where(ps ...predicate.RoomUser)

Where appends a list predicates to the RoomUserMutation builder.

type RoomUserOrder

type RoomUserOrder struct {
	Direction OrderDirection      `json:"direction"`
	Field     *RoomUserOrderField `json:"field"`
}

RoomUserOrder defines the ordering of RoomUser.

type RoomUserOrderField

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

RoomUserOrderField defines the ordering field of RoomUser.

func (RoomUserOrderField) MarshalGQL

func (f RoomUserOrderField) MarshalGQL(w io.Writer)

MarshalGQL implements graphql.Marshaler interface.

func (RoomUserOrderField) String

func (f RoomUserOrderField) String() string

String implement fmt.Stringer interface.

func (*RoomUserOrderField) UnmarshalGQL

func (f *RoomUserOrderField) UnmarshalGQL(v interface{}) error

UnmarshalGQL implements graphql.Unmarshaler interface.

type RoomUserPaginateOption

type RoomUserPaginateOption func(*roomuserPager) error

RoomUserPaginateOption enables pagination customization.

func WithRoomUserFilter

func WithRoomUserFilter(filter func(*RoomUserQuery) (*RoomUserQuery, error)) RoomUserPaginateOption

WithRoomUserFilter configures pagination filter.

func WithRoomUserOrder

func WithRoomUserOrder(order *RoomUserOrder) RoomUserPaginateOption

WithRoomUserOrder configures pagination ordering.

type RoomUserQuery

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

RoomUserQuery is the builder for querying RoomUser entities.

func (*RoomUserQuery) Aggregate

func (ruq *RoomUserQuery) Aggregate(fns ...AggregateFunc) *RoomUserSelect

Aggregate returns a RoomUserSelect configured with the given aggregations.

func (*RoomUserQuery) All

func (ruq *RoomUserQuery) All(ctx context.Context) ([]*RoomUser, error)

All executes the query and returns a list of RoomUsers.

func (*RoomUserQuery) AllX

func (ruq *RoomUserQuery) AllX(ctx context.Context) []*RoomUser

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

func (*RoomUserQuery) Clone

func (ruq *RoomUserQuery) Clone() *RoomUserQuery

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

func (*RoomUserQuery) CollectFields

func (ru *RoomUserQuery) CollectFields(ctx context.Context, satisfies ...string) (*RoomUserQuery, error)

CollectFields tells the query-builder to eagerly load connected nodes by resolver context.

func (*RoomUserQuery) Count

func (ruq *RoomUserQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*RoomUserQuery) CountX

func (ruq *RoomUserQuery) CountX(ctx context.Context) int

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

func (*RoomUserQuery) Exist

func (ruq *RoomUserQuery) Exist(ctx context.Context) (bool, error)

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

func (*RoomUserQuery) ExistX

func (ruq *RoomUserQuery) ExistX(ctx context.Context) bool

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

func (*RoomUserQuery) First

func (ruq *RoomUserQuery) First(ctx context.Context) (*RoomUser, error)

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

func (*RoomUserQuery) FirstID

func (ruq *RoomUserQuery) FirstID(ctx context.Context) (id int64, err error)

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

func (*RoomUserQuery) FirstIDX

func (ruq *RoomUserQuery) FirstIDX(ctx context.Context) int64

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

func (*RoomUserQuery) FirstX

func (ruq *RoomUserQuery) FirstX(ctx context.Context) *RoomUser

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

func (*RoomUserQuery) GroupBy

func (ruq *RoomUserQuery) GroupBy(field string, fields ...string) *RoomUserGroupBy

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 {
	CreatedBy int64 `json:"created_by"`
	Count int `json:"count,omitempty"`
}

client.RoomUser.Query().
	GroupBy(roomuser.FieldCreatedBy).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*RoomUserQuery) IDs

func (ruq *RoomUserQuery) IDs(ctx context.Context) ([]int64, error)

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

func (*RoomUserQuery) IDsX

func (ruq *RoomUserQuery) IDsX(ctx context.Context) []int64

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

func (*RoomUserQuery) Limit

func (ruq *RoomUserQuery) Limit(limit int) *RoomUserQuery

Limit adds a limit step to the query.

func (*RoomUserQuery) Offset

func (ruq *RoomUserQuery) Offset(offset int) *RoomUserQuery

Offset adds an offset step to the query.

func (*RoomUserQuery) Only

func (ruq *RoomUserQuery) Only(ctx context.Context) (*RoomUser, error)

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

func (*RoomUserQuery) OnlyID

func (ruq *RoomUserQuery) OnlyID(ctx context.Context) (id int64, err error)

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

func (*RoomUserQuery) OnlyIDX

func (ruq *RoomUserQuery) OnlyIDX(ctx context.Context) int64

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

func (*RoomUserQuery) OnlyX

func (ruq *RoomUserQuery) OnlyX(ctx context.Context) *RoomUser

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

func (*RoomUserQuery) Order

func (ruq *RoomUserQuery) Order(o ...OrderFunc) *RoomUserQuery

Order adds an order step to the query.

func (*RoomUserQuery) Paginate

func (ru *RoomUserQuery) Paginate(
	ctx context.Context, after *Cursor, first *int,
	before *Cursor, last *int, opts ...RoomUserPaginateOption,
) (*RoomUserConnection, error)

Paginate executes the query and returns a relay based cursor connection to RoomUser.

func (*RoomUserQuery) QueryRoom

func (ruq *RoomUserQuery) QueryRoom() *RoomQuery

QueryRoom chains the current query on the "room" edge.

func (*RoomUserQuery) Select

func (ruq *RoomUserQuery) Select(fields ...string) *RoomUserSelect

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 {
	CreatedBy int64 `json:"created_by"`
}

client.RoomUser.Query().
	Select(roomuser.FieldCreatedBy).
	Scan(ctx, &v)

func (*RoomUserQuery) Unique

func (ruq *RoomUserQuery) Unique(unique bool) *RoomUserQuery

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

func (ruq *RoomUserQuery) Where(ps ...predicate.RoomUser) *RoomUserQuery

Where adds a new predicate for the RoomUserQuery builder.

func (*RoomUserQuery) WithRoom

func (ruq *RoomUserQuery) WithRoom(opts ...func(*RoomQuery)) *RoomUserQuery

WithRoom tells the query-builder to eager-load the nodes that are connected to the "room" edge. The optional arguments are used to configure the query builder of the edge.

type RoomUserSelect

type RoomUserSelect struct {
	*RoomUserQuery
	// contains filtered or unexported fields
}

RoomUserSelect is the builder for selecting fields of RoomUser entities.

func (*RoomUserSelect) Aggregate

func (rus *RoomUserSelect) Aggregate(fns ...AggregateFunc) *RoomUserSelect

Aggregate adds the given aggregation functions to the selector query.

func (*RoomUserSelect) Bool

func (s *RoomUserSelect) Bool(ctx context.Context) (_ bool, err error)

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

func (*RoomUserSelect) BoolX

func (s *RoomUserSelect) BoolX(ctx context.Context) bool

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

func (*RoomUserSelect) Bools

func (s *RoomUserSelect) Bools(ctx context.Context) ([]bool, error)

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

func (*RoomUserSelect) BoolsX

func (s *RoomUserSelect) BoolsX(ctx context.Context) []bool

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

func (*RoomUserSelect) Float64

func (s *RoomUserSelect) Float64(ctx context.Context) (_ float64, err error)

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

func (*RoomUserSelect) Float64X

func (s *RoomUserSelect) Float64X(ctx context.Context) float64

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

func (*RoomUserSelect) Float64s

func (s *RoomUserSelect) Float64s(ctx context.Context) ([]float64, error)

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

func (*RoomUserSelect) Float64sX

func (s *RoomUserSelect) Float64sX(ctx context.Context) []float64

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

func (*RoomUserSelect) Int

func (s *RoomUserSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*RoomUserSelect) IntX

func (s *RoomUserSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*RoomUserSelect) Ints

func (s *RoomUserSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*RoomUserSelect) IntsX

func (s *RoomUserSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*RoomUserSelect) Scan

func (rus *RoomUserSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*RoomUserSelect) ScanX

func (s *RoomUserSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*RoomUserSelect) String

func (s *RoomUserSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*RoomUserSelect) StringX

func (s *RoomUserSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*RoomUserSelect) Strings

func (s *RoomUserSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*RoomUserSelect) StringsX

func (s *RoomUserSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type RoomUserUpdate

type RoomUserUpdate struct {
	// contains filtered or unexported fields
}

RoomUserUpdate is the builder for updating RoomUser entities.

func (*RoomUserUpdate) AddCreatedBy

func (ruu *RoomUserUpdate) AddCreatedBy(i int64) *RoomUserUpdate

AddCreatedBy adds i to the "created_by" field.

func (*RoomUserUpdate) AddUpdatedBy

func (ruu *RoomUserUpdate) AddUpdatedBy(i int64) *RoomUserUpdate

AddUpdatedBy adds i to the "updated_by" field.

func (*RoomUserUpdate) AddUserID

func (ruu *RoomUserUpdate) AddUserID(i int64) *RoomUserUpdate

AddUserID adds i to the "user_id" field.

func (*RoomUserUpdate) ClearRoom

func (ruu *RoomUserUpdate) ClearRoom() *RoomUserUpdate

ClearRoom clears the "room" edge to the Room entity.

func (*RoomUserUpdate) Exec

func (ruu *RoomUserUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*RoomUserUpdate) ExecX

func (ruu *RoomUserUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*RoomUserUpdate) Mutation

func (ruu *RoomUserUpdate) Mutation() *RoomUserMutation

Mutation returns the RoomUserMutation object of the builder.

func (*RoomUserUpdate) Save

func (ruu *RoomUserUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*RoomUserUpdate) SaveX

func (ruu *RoomUserUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*RoomUserUpdate) SetCreatedBy

func (ruu *RoomUserUpdate) SetCreatedBy(i int64) *RoomUserUpdate

SetCreatedBy sets the "created_by" field.

func (*RoomUserUpdate) SetDeletedAt

func (ruu *RoomUserUpdate) SetDeletedAt(t time.Time) *RoomUserUpdate

SetDeletedAt sets the "deleted_at" field.

func (*RoomUserUpdate) SetHost

func (ruu *RoomUserUpdate) SetHost(b bool) *RoomUserUpdate

SetHost sets the "host" field.

func (*RoomUserUpdate) SetInput

SetInput applies the change-set in the UpdateRoomUserInput on the RoomUserUpdate builder.

func (*RoomUserUpdate) SetNillableCreatedBy

func (ruu *RoomUserUpdate) SetNillableCreatedBy(i *int64) *RoomUserUpdate

SetNillableCreatedBy sets the "created_by" field if the given value is not nil.

func (*RoomUserUpdate) SetNillableDeletedAt

func (ruu *RoomUserUpdate) SetNillableDeletedAt(t *time.Time) *RoomUserUpdate

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*RoomUserUpdate) SetNillableHost

func (ruu *RoomUserUpdate) SetNillableHost(b *bool) *RoomUserUpdate

SetNillableHost sets the "host" field if the given value is not nil.

func (*RoomUserUpdate) SetNillableUpdatedBy

func (ruu *RoomUserUpdate) SetNillableUpdatedBy(i *int64) *RoomUserUpdate

SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil.

func (*RoomUserUpdate) SetRoom

func (ruu *RoomUserUpdate) SetRoom(r *Room) *RoomUserUpdate

SetRoom sets the "room" edge to the Room entity.

func (*RoomUserUpdate) SetRoomID

func (ruu *RoomUserUpdate) SetRoomID(i int64) *RoomUserUpdate

SetRoomID sets the "room_id" field.

func (*RoomUserUpdate) SetUpdatedAt

func (ruu *RoomUserUpdate) SetUpdatedAt(t time.Time) *RoomUserUpdate

SetUpdatedAt sets the "updated_at" field.

func (*RoomUserUpdate) SetUpdatedBy

func (ruu *RoomUserUpdate) SetUpdatedBy(i int64) *RoomUserUpdate

SetUpdatedBy sets the "updated_by" field.

func (*RoomUserUpdate) SetUserID

func (ruu *RoomUserUpdate) SetUserID(i int64) *RoomUserUpdate

SetUserID sets the "user_id" field.

func (*RoomUserUpdate) Where

func (ruu *RoomUserUpdate) Where(ps ...predicate.RoomUser) *RoomUserUpdate

Where appends a list predicates to the RoomUserUpdate builder.

type RoomUserUpdateOne

type RoomUserUpdateOne struct {
	// contains filtered or unexported fields
}

RoomUserUpdateOne is the builder for updating a single RoomUser entity.

func (*RoomUserUpdateOne) AddCreatedBy

func (ruuo *RoomUserUpdateOne) AddCreatedBy(i int64) *RoomUserUpdateOne

AddCreatedBy adds i to the "created_by" field.

func (*RoomUserUpdateOne) AddUpdatedBy

func (ruuo *RoomUserUpdateOne) AddUpdatedBy(i int64) *RoomUserUpdateOne

AddUpdatedBy adds i to the "updated_by" field.

func (*RoomUserUpdateOne) AddUserID

func (ruuo *RoomUserUpdateOne) AddUserID(i int64) *RoomUserUpdateOne

AddUserID adds i to the "user_id" field.

func (*RoomUserUpdateOne) ClearRoom

func (ruuo *RoomUserUpdateOne) ClearRoom() *RoomUserUpdateOne

ClearRoom clears the "room" edge to the Room entity.

func (*RoomUserUpdateOne) Exec

func (ruuo *RoomUserUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*RoomUserUpdateOne) ExecX

func (ruuo *RoomUserUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*RoomUserUpdateOne) Mutation

func (ruuo *RoomUserUpdateOne) Mutation() *RoomUserMutation

Mutation returns the RoomUserMutation object of the builder.

func (*RoomUserUpdateOne) Save

func (ruuo *RoomUserUpdateOne) Save(ctx context.Context) (*RoomUser, error)

Save executes the query and returns the updated RoomUser entity.

func (*RoomUserUpdateOne) SaveX

func (ruuo *RoomUserUpdateOne) SaveX(ctx context.Context) *RoomUser

SaveX is like Save, but panics if an error occurs.

func (*RoomUserUpdateOne) Select

func (ruuo *RoomUserUpdateOne) Select(field string, fields ...string) *RoomUserUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*RoomUserUpdateOne) SetCreatedBy

func (ruuo *RoomUserUpdateOne) SetCreatedBy(i int64) *RoomUserUpdateOne

SetCreatedBy sets the "created_by" field.

func (*RoomUserUpdateOne) SetDeletedAt

func (ruuo *RoomUserUpdateOne) SetDeletedAt(t time.Time) *RoomUserUpdateOne

SetDeletedAt sets the "deleted_at" field.

func (*RoomUserUpdateOne) SetHost

func (ruuo *RoomUserUpdateOne) SetHost(b bool) *RoomUserUpdateOne

SetHost sets the "host" field.

func (*RoomUserUpdateOne) SetInput

SetInput applies the change-set in the UpdateRoomUserInput on the RoomUserUpdateOne builder.

func (*RoomUserUpdateOne) SetNillableCreatedBy

func (ruuo *RoomUserUpdateOne) SetNillableCreatedBy(i *int64) *RoomUserUpdateOne

SetNillableCreatedBy sets the "created_by" field if the given value is not nil.

func (*RoomUserUpdateOne) SetNillableDeletedAt

func (ruuo *RoomUserUpdateOne) SetNillableDeletedAt(t *time.Time) *RoomUserUpdateOne

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*RoomUserUpdateOne) SetNillableHost

func (ruuo *RoomUserUpdateOne) SetNillableHost(b *bool) *RoomUserUpdateOne

SetNillableHost sets the "host" field if the given value is not nil.

func (*RoomUserUpdateOne) SetNillableUpdatedBy

func (ruuo *RoomUserUpdateOne) SetNillableUpdatedBy(i *int64) *RoomUserUpdateOne

SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil.

func (*RoomUserUpdateOne) SetRoom

func (ruuo *RoomUserUpdateOne) SetRoom(r *Room) *RoomUserUpdateOne

SetRoom sets the "room" edge to the Room entity.

func (*RoomUserUpdateOne) SetRoomID

func (ruuo *RoomUserUpdateOne) SetRoomID(i int64) *RoomUserUpdateOne

SetRoomID sets the "room_id" field.

func (*RoomUserUpdateOne) SetUpdatedAt

func (ruuo *RoomUserUpdateOne) SetUpdatedAt(t time.Time) *RoomUserUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*RoomUserUpdateOne) SetUpdatedBy

func (ruuo *RoomUserUpdateOne) SetUpdatedBy(i int64) *RoomUserUpdateOne

SetUpdatedBy sets the "updated_by" field.

func (*RoomUserUpdateOne) SetUserID

func (ruuo *RoomUserUpdateOne) SetUserID(i int64) *RoomUserUpdateOne

SetUserID sets the "user_id" field.

type RoomUserWhereInput

type RoomUserWhereInput struct {
	Predicates []predicate.RoomUser  `json:"-"`
	Not        *RoomUserWhereInput   `json:"not,omitempty"`
	Or         []*RoomUserWhereInput `json:"or,omitempty"`
	And        []*RoomUserWhereInput `json:"and,omitempty"`

	// "id" field predicates.
	ID      *int64  `json:"id,omitempty"`
	IDNEQ   *int64  `json:"idNEQ,omitempty"`
	IDIn    []int64 `json:"idIn,omitempty"`
	IDNotIn []int64 `json:"idNotIn,omitempty"`
	IDGT    *int64  `json:"idGT,omitempty"`
	IDGTE   *int64  `json:"idGTE,omitempty"`
	IDLT    *int64  `json:"idLT,omitempty"`
	IDLTE   *int64  `json:"idLTE,omitempty"`

	// "created_by" field predicates.
	CreatedBy      *int64  `json:"createdBy,omitempty"`
	CreatedByNEQ   *int64  `json:"createdByNEQ,omitempty"`
	CreatedByIn    []int64 `json:"createdByIn,omitempty"`
	CreatedByNotIn []int64 `json:"createdByNotIn,omitempty"`
	CreatedByGT    *int64  `json:"createdByGT,omitempty"`
	CreatedByGTE   *int64  `json:"createdByGTE,omitempty"`
	CreatedByLT    *int64  `json:"createdByLT,omitempty"`
	CreatedByLTE   *int64  `json:"createdByLTE,omitempty"`

	// "updated_by" field predicates.
	UpdatedBy      *int64  `json:"updatedBy,omitempty"`
	UpdatedByNEQ   *int64  `json:"updatedByNEQ,omitempty"`
	UpdatedByIn    []int64 `json:"updatedByIn,omitempty"`
	UpdatedByNotIn []int64 `json:"updatedByNotIn,omitempty"`
	UpdatedByGT    *int64  `json:"updatedByGT,omitempty"`
	UpdatedByGTE   *int64  `json:"updatedByGTE,omitempty"`
	UpdatedByLT    *int64  `json:"updatedByLT,omitempty"`
	UpdatedByLTE   *int64  `json:"updatedByLTE,omitempty"`

	// "created_at" field predicates.
	CreatedAt      *time.Time  `json:"createdAt,omitempty"`
	CreatedAtNEQ   *time.Time  `json:"createdAtNEQ,omitempty"`
	CreatedAtIn    []time.Time `json:"createdAtIn,omitempty"`
	CreatedAtNotIn []time.Time `json:"createdAtNotIn,omitempty"`
	CreatedAtGT    *time.Time  `json:"createdAtGT,omitempty"`
	CreatedAtGTE   *time.Time  `json:"createdAtGTE,omitempty"`
	CreatedAtLT    *time.Time  `json:"createdAtLT,omitempty"`
	CreatedAtLTE   *time.Time  `json:"createdAtLTE,omitempty"`

	// "updated_at" field predicates.
	UpdatedAt      *time.Time  `json:"updatedAt,omitempty"`
	UpdatedAtNEQ   *time.Time  `json:"updatedAtNEQ,omitempty"`
	UpdatedAtIn    []time.Time `json:"updatedAtIn,omitempty"`
	UpdatedAtNotIn []time.Time `json:"updatedAtNotIn,omitempty"`
	UpdatedAtGT    *time.Time  `json:"updatedAtGT,omitempty"`
	UpdatedAtGTE   *time.Time  `json:"updatedAtGTE,omitempty"`
	UpdatedAtLT    *time.Time  `json:"updatedAtLT,omitempty"`
	UpdatedAtLTE   *time.Time  `json:"updatedAtLTE,omitempty"`

	// "deleted_at" field predicates.
	DeletedAt      *time.Time  `json:"deletedAt,omitempty"`
	DeletedAtNEQ   *time.Time  `json:"deletedAtNEQ,omitempty"`
	DeletedAtIn    []time.Time `json:"deletedAtIn,omitempty"`
	DeletedAtNotIn []time.Time `json:"deletedAtNotIn,omitempty"`
	DeletedAtGT    *time.Time  `json:"deletedAtGT,omitempty"`
	DeletedAtGTE   *time.Time  `json:"deletedAtGTE,omitempty"`
	DeletedAtLT    *time.Time  `json:"deletedAtLT,omitempty"`
	DeletedAtLTE   *time.Time  `json:"deletedAtLTE,omitempty"`

	// "user_id" field predicates.
	UserID      *int64  `json:"userID,omitempty"`
	UserIDNEQ   *int64  `json:"userIDNEQ,omitempty"`
	UserIDIn    []int64 `json:"userIDIn,omitempty"`
	UserIDNotIn []int64 `json:"userIDNotIn,omitempty"`
	UserIDGT    *int64  `json:"userIDGT,omitempty"`
	UserIDGTE   *int64  `json:"userIDGTE,omitempty"`
	UserIDLT    *int64  `json:"userIDLT,omitempty"`
	UserIDLTE   *int64  `json:"userIDLTE,omitempty"`

	// "room_id" field predicates.
	RoomID      *int64  `json:"roomID,omitempty"`
	RoomIDNEQ   *int64  `json:"roomIDNEQ,omitempty"`
	RoomIDIn    []int64 `json:"roomIDIn,omitempty"`
	RoomIDNotIn []int64 `json:"roomIDNotIn,omitempty"`

	// "host" field predicates.
	Host    *bool `json:"host,omitempty"`
	HostNEQ *bool `json:"hostNEQ,omitempty"`

	// "room" edge predicates.
	HasRoom     *bool             `json:"hasRoom,omitempty"`
	HasRoomWith []*RoomWhereInput `json:"hasRoomWith,omitempty"`
}

RoomUserWhereInput represents a where input for filtering RoomUser queries.

func (*RoomUserWhereInput) AddPredicates

func (i *RoomUserWhereInput) AddPredicates(predicates ...predicate.RoomUser)

AddPredicates adds custom predicates to the where input to be used during the filtering phase.

func (*RoomUserWhereInput) Filter

Filter applies the RoomUserWhereInput filter on the RoomUserQuery builder.

func (*RoomUserWhereInput) P

P returns a predicate for filtering roomusers. An error is returned if the input is empty or invalid.

type RoomUsers

type RoomUsers []*RoomUser

RoomUsers is a parsable slice of RoomUser.

type RoomWhereInput

type RoomWhereInput struct {
	Predicates []predicate.Room  `json:"-"`
	Not        *RoomWhereInput   `json:"not,omitempty"`
	Or         []*RoomWhereInput `json:"or,omitempty"`
	And        []*RoomWhereInput `json:"and,omitempty"`

	// "id" field predicates.
	ID      *int64  `json:"id,omitempty"`
	IDNEQ   *int64  `json:"idNEQ,omitempty"`
	IDIn    []int64 `json:"idIn,omitempty"`
	IDNotIn []int64 `json:"idNotIn,omitempty"`
	IDGT    *int64  `json:"idGT,omitempty"`
	IDGTE   *int64  `json:"idGTE,omitempty"`
	IDLT    *int64  `json:"idLT,omitempty"`
	IDLTE   *int64  `json:"idLTE,omitempty"`

	// "created_by" field predicates.
	CreatedBy      *int64  `json:"createdBy,omitempty"`
	CreatedByNEQ   *int64  `json:"createdByNEQ,omitempty"`
	CreatedByIn    []int64 `json:"createdByIn,omitempty"`
	CreatedByNotIn []int64 `json:"createdByNotIn,omitempty"`
	CreatedByGT    *int64  `json:"createdByGT,omitempty"`
	CreatedByGTE   *int64  `json:"createdByGTE,omitempty"`
	CreatedByLT    *int64  `json:"createdByLT,omitempty"`
	CreatedByLTE   *int64  `json:"createdByLTE,omitempty"`

	// "updated_by" field predicates.
	UpdatedBy      *int64  `json:"updatedBy,omitempty"`
	UpdatedByNEQ   *int64  `json:"updatedByNEQ,omitempty"`
	UpdatedByIn    []int64 `json:"updatedByIn,omitempty"`
	UpdatedByNotIn []int64 `json:"updatedByNotIn,omitempty"`
	UpdatedByGT    *int64  `json:"updatedByGT,omitempty"`
	UpdatedByGTE   *int64  `json:"updatedByGTE,omitempty"`
	UpdatedByLT    *int64  `json:"updatedByLT,omitempty"`
	UpdatedByLTE   *int64  `json:"updatedByLTE,omitempty"`

	// "created_at" field predicates.
	CreatedAt      *time.Time  `json:"createdAt,omitempty"`
	CreatedAtNEQ   *time.Time  `json:"createdAtNEQ,omitempty"`
	CreatedAtIn    []time.Time `json:"createdAtIn,omitempty"`
	CreatedAtNotIn []time.Time `json:"createdAtNotIn,omitempty"`
	CreatedAtGT    *time.Time  `json:"createdAtGT,omitempty"`
	CreatedAtGTE   *time.Time  `json:"createdAtGTE,omitempty"`
	CreatedAtLT    *time.Time  `json:"createdAtLT,omitempty"`
	CreatedAtLTE   *time.Time  `json:"createdAtLTE,omitempty"`

	// "updated_at" field predicates.
	UpdatedAt      *time.Time  `json:"updatedAt,omitempty"`
	UpdatedAtNEQ   *time.Time  `json:"updatedAtNEQ,omitempty"`
	UpdatedAtIn    []time.Time `json:"updatedAtIn,omitempty"`
	UpdatedAtNotIn []time.Time `json:"updatedAtNotIn,omitempty"`
	UpdatedAtGT    *time.Time  `json:"updatedAtGT,omitempty"`
	UpdatedAtGTE   *time.Time  `json:"updatedAtGTE,omitempty"`
	UpdatedAtLT    *time.Time  `json:"updatedAtLT,omitempty"`
	UpdatedAtLTE   *time.Time  `json:"updatedAtLTE,omitempty"`

	// "deleted_at" field predicates.
	DeletedAt      *time.Time  `json:"deletedAt,omitempty"`
	DeletedAtNEQ   *time.Time  `json:"deletedAtNEQ,omitempty"`
	DeletedAtIn    []time.Time `json:"deletedAtIn,omitempty"`
	DeletedAtNotIn []time.Time `json:"deletedAtNotIn,omitempty"`
	DeletedAtGT    *time.Time  `json:"deletedAtGT,omitempty"`
	DeletedAtGTE   *time.Time  `json:"deletedAtGTE,omitempty"`
	DeletedAtLT    *time.Time  `json:"deletedAtLT,omitempty"`
	DeletedAtLTE   *time.Time  `json:"deletedAtLTE,omitempty"`

	// "name" field predicates.
	Name             *string  `json:"name,omitempty"`
	NameNEQ          *string  `json:"nameNEQ,omitempty"`
	NameIn           []string `json:"nameIn,omitempty"`
	NameNotIn        []string `json:"nameNotIn,omitempty"`
	NameGT           *string  `json:"nameGT,omitempty"`
	NameGTE          *string  `json:"nameGTE,omitempty"`
	NameLT           *string  `json:"nameLT,omitempty"`
	NameLTE          *string  `json:"nameLTE,omitempty"`
	NameContains     *string  `json:"nameContains,omitempty"`
	NameHasPrefix    *string  `json:"nameHasPrefix,omitempty"`
	NameHasSuffix    *string  `json:"nameHasSuffix,omitempty"`
	NameEqualFold    *string  `json:"nameEqualFold,omitempty"`
	NameContainsFold *string  `json:"nameContainsFold,omitempty"`

	// "closed" field predicates.
	Closed    *bool `json:"closed,omitempty"`
	ClosedNEQ *bool `json:"closedNEQ,omitempty"`

	// "game_on" field predicates.
	GameOn    *bool `json:"gameOn,omitempty"`
	GameOnNEQ *bool `json:"gameOnNEQ,omitempty"`

	// "room_users" edge predicates.
	HasRoomUsers     *bool                 `json:"hasRoomUsers,omitempty"`
	HasRoomUsersWith []*RoomUserWhereInput `json:"hasRoomUsersWith,omitempty"`

	// "games" edge predicates.
	HasGames     *bool             `json:"hasGames,omitempty"`
	HasGamesWith []*GameWhereInput `json:"hasGamesWith,omitempty"`

	// "records" edge predicates.
	HasRecords     *bool               `json:"hasRecords,omitempty"`
	HasRecordsWith []*RecordWhereInput `json:"hasRecordsWith,omitempty"`
}

RoomWhereInput represents a where input for filtering Room queries.

func (*RoomWhereInput) AddPredicates

func (i *RoomWhereInput) AddPredicates(predicates ...predicate.Room)

AddPredicates adds custom predicates to the where input to be used during the filtering phase.

func (*RoomWhereInput) Filter

func (i *RoomWhereInput) Filter(q *RoomQuery) (*RoomQuery, error)

Filter applies the RoomWhereInput filter on the RoomQuery builder.

func (*RoomWhereInput) P

func (i *RoomWhereInput) P() (predicate.Room, error)

P returns a predicate for filtering rooms. An error is returned if the input is empty or invalid.

type Rooms

type Rooms []*Room

Rooms is a parsable slice of Room.

type Squad

type Squad struct {

	// ID of the ent.
	ID int64 `json:"id,omitempty"`
	// CreatedBy holds the value of the "created_by" field.
	CreatedBy int64 `json:"created_by"`
	// UpdatedBy holds the value of the "updated_by" field.
	UpdatedBy int64 `json:"updated_by"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at"`
	// UpdatedAt holds the value of the "updated_at" field.
	UpdatedAt time.Time `json:"updated_at"`
	// DeletedAt holds the value of the "deleted_at" field.
	DeletedAt time.Time `json:"deleted_at"`
	// 所属任务 ID
	MissionID int64 `json:"mission_id"`
	// 用户 ID
	UserID int64 `json:"user_id"`
	// 是否破坏任务
	Rat bool `json:"rat"`
	// 是否已经行动
	Acted bool `json:"acted"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the SquadQuery when eager-loading is set.
	Edges SquadEdges `json:"edges"`
	// contains filtered or unexported fields
}

Squad is the model entity for the Squad schema.

func (Squad) IsEntity

func (s Squad) IsEntity()

IsEntity implement fedruntime.Entity

func (*Squad) Mission

func (s *Squad) Mission(ctx context.Context) (*Mission, error)

func (*Squad) Node

func (s *Squad) Node(ctx context.Context) (node *Node, err error)

func (*Squad) QueryMission

func (s *Squad) QueryMission() *MissionQuery

QueryMission queries the "mission" edge of the Squad entity.

func (*Squad) String

func (s *Squad) String() string

String implements the fmt.Stringer.

func (*Squad) ToEdge

func (s *Squad) ToEdge(order *SquadOrder) *SquadEdge

ToEdge converts Squad into SquadEdge.

func (*Squad) Unwrap

func (s *Squad) Unwrap() *Squad

Unwrap unwraps the Squad 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 (*Squad) Update

func (s *Squad) Update() *SquadUpdateOne

Update returns a builder for updating this Squad. Note that you need to call Squad.Unwrap() before calling this method if this Squad was returned from a transaction, and the transaction was committed or rolled back.

type SquadClient

type SquadClient struct {
	// contains filtered or unexported fields
}

SquadClient is a client for the Squad schema.

func NewSquadClient

func NewSquadClient(c config) *SquadClient

NewSquadClient returns a client for the Squad from the given config.

func (*SquadClient) Create

func (c *SquadClient) Create() *SquadCreate

Create returns a builder for creating a Squad entity.

func (*SquadClient) CreateBulk

func (c *SquadClient) CreateBulk(builders ...*SquadCreate) *SquadCreateBulk

CreateBulk returns a builder for creating a bulk of Squad entities.

func (*SquadClient) Delete

func (c *SquadClient) Delete() *SquadDelete

Delete returns a delete builder for Squad.

func (*SquadClient) DeleteOne

func (c *SquadClient) DeleteOne(s *Squad) *SquadDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*SquadClient) DeleteOneID

func (c *SquadClient) DeleteOneID(id int64) *SquadDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*SquadClient) Get

func (c *SquadClient) Get(ctx context.Context, id int64) (*Squad, error)

Get returns a Squad entity by its id.

func (*SquadClient) GetX

func (c *SquadClient) GetX(ctx context.Context, id int64) *Squad

GetX is like Get, but panics if an error occurs.

func (*SquadClient) Hooks

func (c *SquadClient) Hooks() []Hook

Hooks returns the client hooks.

func (*SquadClient) Query

func (c *SquadClient) Query() *SquadQuery

Query returns a query builder for Squad.

func (*SquadClient) QueryMission

func (c *SquadClient) QueryMission(s *Squad) *MissionQuery

QueryMission queries the mission edge of a Squad.

func (*SquadClient) Update

func (c *SquadClient) Update() *SquadUpdate

Update returns an update builder for Squad.

func (*SquadClient) UpdateOne

func (c *SquadClient) UpdateOne(s *Squad) *SquadUpdateOne

UpdateOne returns an update builder for the given entity.

func (*SquadClient) UpdateOneID

func (c *SquadClient) UpdateOneID(id int64) *SquadUpdateOne

UpdateOneID returns an update builder for the given id.

func (*SquadClient) Use

func (c *SquadClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `squad.Hooks(f(g(h())))`.

type SquadConnection

type SquadConnection struct {
	Edges      []*SquadEdge `json:"edges"`
	PageInfo   PageInfo     `json:"pageInfo"`
	TotalCount int          `json:"totalCount"`
}

SquadConnection is the connection containing edges to Squad.

type SquadCreate

type SquadCreate struct {
	// contains filtered or unexported fields
}

SquadCreate is the builder for creating a Squad entity.

func (*SquadCreate) Exec

func (sc *SquadCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*SquadCreate) ExecX

func (sc *SquadCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*SquadCreate) Mutation

func (sc *SquadCreate) Mutation() *SquadMutation

Mutation returns the SquadMutation object of the builder.

func (*SquadCreate) Save

func (sc *SquadCreate) Save(ctx context.Context) (*Squad, error)

Save creates the Squad in the database.

func (*SquadCreate) SaveX

func (sc *SquadCreate) SaveX(ctx context.Context) *Squad

SaveX calls Save and panics if Save returns an error.

func (*SquadCreate) SetActed

func (sc *SquadCreate) SetActed(b bool) *SquadCreate

SetActed sets the "acted" field.

func (*SquadCreate) SetCreatedAt

func (sc *SquadCreate) SetCreatedAt(t time.Time) *SquadCreate

SetCreatedAt sets the "created_at" field.

func (*SquadCreate) SetCreatedBy

func (sc *SquadCreate) SetCreatedBy(i int64) *SquadCreate

SetCreatedBy sets the "created_by" field.

func (*SquadCreate) SetDeletedAt

func (sc *SquadCreate) SetDeletedAt(t time.Time) *SquadCreate

SetDeletedAt sets the "deleted_at" field.

func (*SquadCreate) SetID

func (sc *SquadCreate) SetID(i int64) *SquadCreate

SetID sets the "id" field.

func (*SquadCreate) SetInput

func (c *SquadCreate) SetInput(i CreateSquadInput) *SquadCreate

SetInput applies the change-set in the CreateSquadInput on the SquadCreate builder.

func (*SquadCreate) SetMission

func (sc *SquadCreate) SetMission(m *Mission) *SquadCreate

SetMission sets the "mission" edge to the Mission entity.

func (*SquadCreate) SetMissionID

func (sc *SquadCreate) SetMissionID(i int64) *SquadCreate

SetMissionID sets the "mission_id" field.

func (*SquadCreate) SetNillableActed

func (sc *SquadCreate) SetNillableActed(b *bool) *SquadCreate

SetNillableActed sets the "acted" field if the given value is not nil.

func (*SquadCreate) SetNillableCreatedAt

func (sc *SquadCreate) SetNillableCreatedAt(t *time.Time) *SquadCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*SquadCreate) SetNillableCreatedBy

func (sc *SquadCreate) SetNillableCreatedBy(i *int64) *SquadCreate

SetNillableCreatedBy sets the "created_by" field if the given value is not nil.

func (*SquadCreate) SetNillableDeletedAt

func (sc *SquadCreate) SetNillableDeletedAt(t *time.Time) *SquadCreate

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*SquadCreate) SetNillableID

func (sc *SquadCreate) SetNillableID(i *int64) *SquadCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*SquadCreate) SetNillableRat

func (sc *SquadCreate) SetNillableRat(b *bool) *SquadCreate

SetNillableRat sets the "rat" field if the given value is not nil.

func (*SquadCreate) SetNillableUpdatedAt

func (sc *SquadCreate) SetNillableUpdatedAt(t *time.Time) *SquadCreate

SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.

func (*SquadCreate) SetNillableUpdatedBy

func (sc *SquadCreate) SetNillableUpdatedBy(i *int64) *SquadCreate

SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil.

func (*SquadCreate) SetRat

func (sc *SquadCreate) SetRat(b bool) *SquadCreate

SetRat sets the "rat" field.

func (*SquadCreate) SetUpdatedAt

func (sc *SquadCreate) SetUpdatedAt(t time.Time) *SquadCreate

SetUpdatedAt sets the "updated_at" field.

func (*SquadCreate) SetUpdatedBy

func (sc *SquadCreate) SetUpdatedBy(i int64) *SquadCreate

SetUpdatedBy sets the "updated_by" field.

func (*SquadCreate) SetUserID

func (sc *SquadCreate) SetUserID(i int64) *SquadCreate

SetUserID sets the "user_id" field.

type SquadCreateBulk

type SquadCreateBulk struct {
	// contains filtered or unexported fields
}

SquadCreateBulk is the builder for creating many Squad entities in bulk.

func (*SquadCreateBulk) Exec

func (scb *SquadCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*SquadCreateBulk) ExecX

func (scb *SquadCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*SquadCreateBulk) Save

func (scb *SquadCreateBulk) Save(ctx context.Context) ([]*Squad, error)

Save creates the Squad entities in the database.

func (*SquadCreateBulk) SaveX

func (scb *SquadCreateBulk) SaveX(ctx context.Context) []*Squad

SaveX is like Save, but panics if an error occurs.

type SquadDelete

type SquadDelete struct {
	// contains filtered or unexported fields
}

SquadDelete is the builder for deleting a Squad entity.

func (*SquadDelete) Exec

func (sd *SquadDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*SquadDelete) ExecX

func (sd *SquadDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*SquadDelete) Where

func (sd *SquadDelete) Where(ps ...predicate.Squad) *SquadDelete

Where appends a list predicates to the SquadDelete builder.

type SquadDeleteOne

type SquadDeleteOne struct {
	// contains filtered or unexported fields
}

SquadDeleteOne is the builder for deleting a single Squad entity.

func (*SquadDeleteOne) Exec

func (sdo *SquadDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*SquadDeleteOne) ExecX

func (sdo *SquadDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

type SquadEdge

type SquadEdge struct {
	Node   *Squad `json:"node"`
	Cursor Cursor `json:"cursor"`
}

SquadEdge is the edge representation of Squad.

type SquadEdges

type SquadEdges struct {
	// Mission holds the value of the mission edge.
	Mission *Mission `json:"mission,omitempty"`
	// contains filtered or unexported fields
}

SquadEdges holds the relations/edges for other nodes in the graph.

func (SquadEdges) MissionOrErr

func (e SquadEdges) MissionOrErr() (*Mission, error)

MissionOrErr returns the Mission value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

type SquadGroupBy

type SquadGroupBy struct {
	// contains filtered or unexported fields
}

SquadGroupBy is the group-by builder for Squad entities.

func (*SquadGroupBy) Aggregate

func (sgb *SquadGroupBy) Aggregate(fns ...AggregateFunc) *SquadGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*SquadGroupBy) Bool

func (s *SquadGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*SquadGroupBy) BoolX

func (s *SquadGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*SquadGroupBy) Bools

func (s *SquadGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*SquadGroupBy) BoolsX

func (s *SquadGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*SquadGroupBy) Float64

func (s *SquadGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*SquadGroupBy) Float64X

func (s *SquadGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*SquadGroupBy) Float64s

func (s *SquadGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*SquadGroupBy) Float64sX

func (s *SquadGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*SquadGroupBy) Int

func (s *SquadGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*SquadGroupBy) IntX

func (s *SquadGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*SquadGroupBy) Ints

func (s *SquadGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*SquadGroupBy) IntsX

func (s *SquadGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*SquadGroupBy) Scan

func (sgb *SquadGroupBy) Scan(ctx context.Context, v any) error

Scan applies the group-by query and scans the result into the given value.

func (*SquadGroupBy) ScanX

func (s *SquadGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*SquadGroupBy) String

func (s *SquadGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*SquadGroupBy) StringX

func (s *SquadGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*SquadGroupBy) Strings

func (s *SquadGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*SquadGroupBy) StringsX

func (s *SquadGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type SquadMutation

type SquadMutation struct {
	// contains filtered or unexported fields
}

SquadMutation represents an operation that mutates the Squad nodes in the graph.

func (*SquadMutation) Acted

func (m *SquadMutation) Acted() (r bool, exists bool)

Acted returns the value of the "acted" field in the mutation.

func (*SquadMutation) AddCreatedBy

func (m *SquadMutation) AddCreatedBy(i int64)

AddCreatedBy adds i to the "created_by" field.

func (*SquadMutation) AddField

func (m *SquadMutation) 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 (*SquadMutation) AddUpdatedBy

func (m *SquadMutation) AddUpdatedBy(i int64)

AddUpdatedBy adds i to the "updated_by" field.

func (*SquadMutation) AddUserID

func (m *SquadMutation) AddUserID(i int64)

AddUserID adds i to the "user_id" field.

func (*SquadMutation) AddedCreatedBy

func (m *SquadMutation) AddedCreatedBy() (r int64, exists bool)

AddedCreatedBy returns the value that was added to the "created_by" field in this mutation.

func (*SquadMutation) AddedEdges

func (m *SquadMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*SquadMutation) AddedField

func (m *SquadMutation) 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 (*SquadMutation) AddedFields

func (m *SquadMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*SquadMutation) AddedIDs

func (m *SquadMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*SquadMutation) AddedUpdatedBy

func (m *SquadMutation) AddedUpdatedBy() (r int64, exists bool)

AddedUpdatedBy returns the value that was added to the "updated_by" field in this mutation.

func (*SquadMutation) AddedUserID

func (m *SquadMutation) AddedUserID() (r int64, exists bool)

AddedUserID returns the value that was added to the "user_id" field in this mutation.

func (*SquadMutation) ClearEdge

func (m *SquadMutation) 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 (*SquadMutation) ClearField

func (m *SquadMutation) 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 (*SquadMutation) ClearMission

func (m *SquadMutation) ClearMission()

ClearMission clears the "mission" edge to the Mission entity.

func (*SquadMutation) ClearedEdges

func (m *SquadMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*SquadMutation) ClearedFields

func (m *SquadMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (SquadMutation) Client

func (m SquadMutation) 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 (*SquadMutation) CreatedAt

func (m *SquadMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*SquadMutation) CreatedBy

func (m *SquadMutation) CreatedBy() (r int64, exists bool)

CreatedBy returns the value of the "created_by" field in the mutation.

func (*SquadMutation) DeletedAt

func (m *SquadMutation) DeletedAt() (r time.Time, exists bool)

DeletedAt returns the value of the "deleted_at" field in the mutation.

func (*SquadMutation) EdgeCleared

func (m *SquadMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*SquadMutation) Field

func (m *SquadMutation) 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 (*SquadMutation) FieldCleared

func (m *SquadMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*SquadMutation) Fields

func (m *SquadMutation) 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 (*SquadMutation) ID

func (m *SquadMutation) ID() (id int64, 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 (*SquadMutation) IDs

func (m *SquadMutation) IDs(ctx context.Context) ([]int64, error)

IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.

func (*SquadMutation) MissionCleared

func (m *SquadMutation) MissionCleared() bool

MissionCleared reports if the "mission" edge to the Mission entity was cleared.

func (*SquadMutation) MissionID

func (m *SquadMutation) MissionID() (r int64, exists bool)

MissionID returns the value of the "mission_id" field in the mutation.

func (*SquadMutation) MissionIDs

func (m *SquadMutation) MissionIDs() (ids []int64)

MissionIDs returns the "mission" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use MissionID instead. It exists only for internal usage by the builders.

func (*SquadMutation) OldActed

func (m *SquadMutation) OldActed(ctx context.Context) (v bool, err error)

OldActed returns the old "acted" field's value of the Squad entity. If the Squad 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 (*SquadMutation) OldCreatedAt

func (m *SquadMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the Squad entity. If the Squad 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 (*SquadMutation) OldCreatedBy

func (m *SquadMutation) OldCreatedBy(ctx context.Context) (v int64, err error)

OldCreatedBy returns the old "created_by" field's value of the Squad entity. If the Squad 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 (*SquadMutation) OldDeletedAt

func (m *SquadMutation) OldDeletedAt(ctx context.Context) (v time.Time, err error)

OldDeletedAt returns the old "deleted_at" field's value of the Squad entity. If the Squad 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 (*SquadMutation) OldField

func (m *SquadMutation) 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 (*SquadMutation) OldMissionID

func (m *SquadMutation) OldMissionID(ctx context.Context) (v int64, err error)

OldMissionID returns the old "mission_id" field's value of the Squad entity. If the Squad 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 (*SquadMutation) OldRat

func (m *SquadMutation) OldRat(ctx context.Context) (v bool, err error)

OldRat returns the old "rat" field's value of the Squad entity. If the Squad 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 (*SquadMutation) OldUpdatedAt

func (m *SquadMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)

OldUpdatedAt returns the old "updated_at" field's value of the Squad entity. If the Squad 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 (*SquadMutation) OldUpdatedBy

func (m *SquadMutation) OldUpdatedBy(ctx context.Context) (v int64, err error)

OldUpdatedBy returns the old "updated_by" field's value of the Squad entity. If the Squad 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 (*SquadMutation) OldUserID

func (m *SquadMutation) OldUserID(ctx context.Context) (v int64, err error)

OldUserID returns the old "user_id" field's value of the Squad entity. If the Squad 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 (*SquadMutation) Op

func (m *SquadMutation) Op() Op

Op returns the operation name.

func (*SquadMutation) Rat

func (m *SquadMutation) Rat() (r bool, exists bool)

Rat returns the value of the "rat" field in the mutation.

func (*SquadMutation) RemovedEdges

func (m *SquadMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*SquadMutation) RemovedIDs

func (m *SquadMutation) 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 (*SquadMutation) ResetActed

func (m *SquadMutation) ResetActed()

ResetActed resets all changes to the "acted" field.

func (*SquadMutation) ResetCreatedAt

func (m *SquadMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*SquadMutation) ResetCreatedBy

func (m *SquadMutation) ResetCreatedBy()

ResetCreatedBy resets all changes to the "created_by" field.

func (*SquadMutation) ResetDeletedAt

func (m *SquadMutation) ResetDeletedAt()

ResetDeletedAt resets all changes to the "deleted_at" field.

func (*SquadMutation) ResetEdge

func (m *SquadMutation) 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 (*SquadMutation) ResetField

func (m *SquadMutation) 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 (*SquadMutation) ResetMission

func (m *SquadMutation) ResetMission()

ResetMission resets all changes to the "mission" edge.

func (*SquadMutation) ResetMissionID

func (m *SquadMutation) ResetMissionID()

ResetMissionID resets all changes to the "mission_id" field.

func (*SquadMutation) ResetRat

func (m *SquadMutation) ResetRat()

ResetRat resets all changes to the "rat" field.

func (*SquadMutation) ResetUpdatedAt

func (m *SquadMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*SquadMutation) ResetUpdatedBy

func (m *SquadMutation) ResetUpdatedBy()

ResetUpdatedBy resets all changes to the "updated_by" field.

func (*SquadMutation) ResetUserID

func (m *SquadMutation) ResetUserID()

ResetUserID resets all changes to the "user_id" field.

func (*SquadMutation) SetActed

func (m *SquadMutation) SetActed(b bool)

SetActed sets the "acted" field.

func (*SquadMutation) SetCreatedAt

func (m *SquadMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*SquadMutation) SetCreatedBy

func (m *SquadMutation) SetCreatedBy(i int64)

SetCreatedBy sets the "created_by" field.

func (*SquadMutation) SetDeletedAt

func (m *SquadMutation) SetDeletedAt(t time.Time)

SetDeletedAt sets the "deleted_at" field.

func (*SquadMutation) SetField

func (m *SquadMutation) 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 (*SquadMutation) SetID

func (m *SquadMutation) SetID(id int64)

SetID sets the value of the id field. Note that this operation is only accepted on creation of Squad entities.

func (*SquadMutation) SetMissionID

func (m *SquadMutation) SetMissionID(i int64)

SetMissionID sets the "mission_id" field.

func (*SquadMutation) SetRat

func (m *SquadMutation) SetRat(b bool)

SetRat sets the "rat" field.

func (*SquadMutation) SetUpdatedAt

func (m *SquadMutation) SetUpdatedAt(t time.Time)

SetUpdatedAt sets the "updated_at" field.

func (*SquadMutation) SetUpdatedBy

func (m *SquadMutation) SetUpdatedBy(i int64)

SetUpdatedBy sets the "updated_by" field.

func (*SquadMutation) SetUserID

func (m *SquadMutation) SetUserID(i int64)

SetUserID sets the "user_id" field.

func (SquadMutation) Tx

func (m SquadMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*SquadMutation) Type

func (m *SquadMutation) Type() string

Type returns the node type of this mutation (Squad).

func (*SquadMutation) UpdatedAt

func (m *SquadMutation) UpdatedAt() (r time.Time, exists bool)

UpdatedAt returns the value of the "updated_at" field in the mutation.

func (*SquadMutation) UpdatedBy

func (m *SquadMutation) UpdatedBy() (r int64, exists bool)

UpdatedBy returns the value of the "updated_by" field in the mutation.

func (*SquadMutation) UserID

func (m *SquadMutation) UserID() (r int64, exists bool)

UserID returns the value of the "user_id" field in the mutation.

func (*SquadMutation) Where

func (m *SquadMutation) Where(ps ...predicate.Squad)

Where appends a list predicates to the SquadMutation builder.

type SquadOrder

type SquadOrder struct {
	Direction OrderDirection   `json:"direction"`
	Field     *SquadOrderField `json:"field"`
}

SquadOrder defines the ordering of Squad.

type SquadOrderField

type SquadOrderField struct {
	// contains filtered or unexported fields
}

SquadOrderField defines the ordering field of Squad.

func (SquadOrderField) MarshalGQL

func (f SquadOrderField) MarshalGQL(w io.Writer)

MarshalGQL implements graphql.Marshaler interface.

func (SquadOrderField) String

func (f SquadOrderField) String() string

String implement fmt.Stringer interface.

func (*SquadOrderField) UnmarshalGQL

func (f *SquadOrderField) UnmarshalGQL(v interface{}) error

UnmarshalGQL implements graphql.Unmarshaler interface.

type SquadPaginateOption

type SquadPaginateOption func(*squadPager) error

SquadPaginateOption enables pagination customization.

func WithSquadFilter

func WithSquadFilter(filter func(*SquadQuery) (*SquadQuery, error)) SquadPaginateOption

WithSquadFilter configures pagination filter.

func WithSquadOrder

func WithSquadOrder(order *SquadOrder) SquadPaginateOption

WithSquadOrder configures pagination ordering.

type SquadQuery

type SquadQuery struct {
	// contains filtered or unexported fields
}

SquadQuery is the builder for querying Squad entities.

func (*SquadQuery) Aggregate

func (sq *SquadQuery) Aggregate(fns ...AggregateFunc) *SquadSelect

Aggregate returns a SquadSelect configured with the given aggregations.

func (*SquadQuery) All

func (sq *SquadQuery) All(ctx context.Context) ([]*Squad, error)

All executes the query and returns a list of Squads.

func (*SquadQuery) AllX

func (sq *SquadQuery) AllX(ctx context.Context) []*Squad

AllX is like All, but panics if an error occurs.

func (*SquadQuery) Clone

func (sq *SquadQuery) Clone() *SquadQuery

Clone returns a duplicate of the SquadQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*SquadQuery) CollectFields

func (s *SquadQuery) CollectFields(ctx context.Context, satisfies ...string) (*SquadQuery, error)

CollectFields tells the query-builder to eagerly load connected nodes by resolver context.

func (*SquadQuery) Count

func (sq *SquadQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*SquadQuery) CountX

func (sq *SquadQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*SquadQuery) Exist

func (sq *SquadQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*SquadQuery) ExistX

func (sq *SquadQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*SquadQuery) First

func (sq *SquadQuery) First(ctx context.Context) (*Squad, error)

First returns the first Squad entity from the query. Returns a *NotFoundError when no Squad was found.

func (*SquadQuery) FirstID

func (sq *SquadQuery) FirstID(ctx context.Context) (id int64, err error)

FirstID returns the first Squad ID from the query. Returns a *NotFoundError when no Squad ID was found.

func (*SquadQuery) FirstIDX

func (sq *SquadQuery) FirstIDX(ctx context.Context) int64

FirstIDX is like FirstID, but panics if an error occurs.

func (*SquadQuery) FirstX

func (sq *SquadQuery) FirstX(ctx context.Context) *Squad

FirstX is like First, but panics if an error occurs.

func (*SquadQuery) GroupBy

func (sq *SquadQuery) GroupBy(field string, fields ...string) *SquadGroupBy

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 {
	CreatedBy int64 `json:"created_by"`
	Count int `json:"count,omitempty"`
}

client.Squad.Query().
	GroupBy(squad.FieldCreatedBy).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*SquadQuery) IDs

func (sq *SquadQuery) IDs(ctx context.Context) ([]int64, error)

IDs executes the query and returns a list of Squad IDs.

func (*SquadQuery) IDsX

func (sq *SquadQuery) IDsX(ctx context.Context) []int64

IDsX is like IDs, but panics if an error occurs.

func (*SquadQuery) Limit

func (sq *SquadQuery) Limit(limit int) *SquadQuery

Limit adds a limit step to the query.

func (*SquadQuery) Offset

func (sq *SquadQuery) Offset(offset int) *SquadQuery

Offset adds an offset step to the query.

func (*SquadQuery) Only

func (sq *SquadQuery) Only(ctx context.Context) (*Squad, error)

Only returns a single Squad entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Squad entity is found. Returns a *NotFoundError when no Squad entities are found.

func (*SquadQuery) OnlyID

func (sq *SquadQuery) OnlyID(ctx context.Context) (id int64, err error)

OnlyID is like Only, but returns the only Squad ID in the query. Returns a *NotSingularError when more than one Squad ID is found. Returns a *NotFoundError when no entities are found.

func (*SquadQuery) OnlyIDX

func (sq *SquadQuery) OnlyIDX(ctx context.Context) int64

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*SquadQuery) OnlyX

func (sq *SquadQuery) OnlyX(ctx context.Context) *Squad

OnlyX is like Only, but panics if an error occurs.

func (*SquadQuery) Order

func (sq *SquadQuery) Order(o ...OrderFunc) *SquadQuery

Order adds an order step to the query.

func (*SquadQuery) Paginate

func (s *SquadQuery) Paginate(
	ctx context.Context, after *Cursor, first *int,
	before *Cursor, last *int, opts ...SquadPaginateOption,
) (*SquadConnection, error)

Paginate executes the query and returns a relay based cursor connection to Squad.

func (*SquadQuery) QueryMission

func (sq *SquadQuery) QueryMission() *MissionQuery

QueryMission chains the current query on the "mission" edge.

func (*SquadQuery) Select

func (sq *SquadQuery) Select(fields ...string) *SquadSelect

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 {
	CreatedBy int64 `json:"created_by"`
}

client.Squad.Query().
	Select(squad.FieldCreatedBy).
	Scan(ctx, &v)

func (*SquadQuery) Unique

func (sq *SquadQuery) Unique(unique bool) *SquadQuery

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 (*SquadQuery) Where

func (sq *SquadQuery) Where(ps ...predicate.Squad) *SquadQuery

Where adds a new predicate for the SquadQuery builder.

func (*SquadQuery) WithMission

func (sq *SquadQuery) WithMission(opts ...func(*MissionQuery)) *SquadQuery

WithMission tells the query-builder to eager-load the nodes that are connected to the "mission" edge. The optional arguments are used to configure the query builder of the edge.

type SquadSelect

type SquadSelect struct {
	*SquadQuery
	// contains filtered or unexported fields
}

SquadSelect is the builder for selecting fields of Squad entities.

func (*SquadSelect) Aggregate

func (ss *SquadSelect) Aggregate(fns ...AggregateFunc) *SquadSelect

Aggregate adds the given aggregation functions to the selector query.

func (*SquadSelect) Bool

func (s *SquadSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*SquadSelect) BoolX

func (s *SquadSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*SquadSelect) Bools

func (s *SquadSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*SquadSelect) BoolsX

func (s *SquadSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*SquadSelect) Float64

func (s *SquadSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*SquadSelect) Float64X

func (s *SquadSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*SquadSelect) Float64s

func (s *SquadSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*SquadSelect) Float64sX

func (s *SquadSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*SquadSelect) Int

func (s *SquadSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*SquadSelect) IntX

func (s *SquadSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*SquadSelect) Ints

func (s *SquadSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*SquadSelect) IntsX

func (s *SquadSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*SquadSelect) Scan

func (ss *SquadSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*SquadSelect) ScanX

func (s *SquadSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*SquadSelect) String

func (s *SquadSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*SquadSelect) StringX

func (s *SquadSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*SquadSelect) Strings

func (s *SquadSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*SquadSelect) StringsX

func (s *SquadSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type SquadUpdate

type SquadUpdate struct {
	// contains filtered or unexported fields
}

SquadUpdate is the builder for updating Squad entities.

func (*SquadUpdate) AddCreatedBy

func (su *SquadUpdate) AddCreatedBy(i int64) *SquadUpdate

AddCreatedBy adds i to the "created_by" field.

func (*SquadUpdate) AddUpdatedBy

func (su *SquadUpdate) AddUpdatedBy(i int64) *SquadUpdate

AddUpdatedBy adds i to the "updated_by" field.

func (*SquadUpdate) AddUserID

func (su *SquadUpdate) AddUserID(i int64) *SquadUpdate

AddUserID adds i to the "user_id" field.

func (*SquadUpdate) ClearMission

func (su *SquadUpdate) ClearMission() *SquadUpdate

ClearMission clears the "mission" edge to the Mission entity.

func (*SquadUpdate) Exec

func (su *SquadUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*SquadUpdate) ExecX

func (su *SquadUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*SquadUpdate) Mutation

func (su *SquadUpdate) Mutation() *SquadMutation

Mutation returns the SquadMutation object of the builder.

func (*SquadUpdate) Save

func (su *SquadUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*SquadUpdate) SaveX

func (su *SquadUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*SquadUpdate) SetActed

func (su *SquadUpdate) SetActed(b bool) *SquadUpdate

SetActed sets the "acted" field.

func (*SquadUpdate) SetCreatedBy

func (su *SquadUpdate) SetCreatedBy(i int64) *SquadUpdate

SetCreatedBy sets the "created_by" field.

func (*SquadUpdate) SetDeletedAt

func (su *SquadUpdate) SetDeletedAt(t time.Time) *SquadUpdate

SetDeletedAt sets the "deleted_at" field.

func (*SquadUpdate) SetInput

func (c *SquadUpdate) SetInput(i UpdateSquadInput) *SquadUpdate

SetInput applies the change-set in the UpdateSquadInput on the SquadUpdate builder.

func (*SquadUpdate) SetMission

func (su *SquadUpdate) SetMission(m *Mission) *SquadUpdate

SetMission sets the "mission" edge to the Mission entity.

func (*SquadUpdate) SetMissionID

func (su *SquadUpdate) SetMissionID(i int64) *SquadUpdate

SetMissionID sets the "mission_id" field.

func (*SquadUpdate) SetNillableActed

func (su *SquadUpdate) SetNillableActed(b *bool) *SquadUpdate

SetNillableActed sets the "acted" field if the given value is not nil.

func (*SquadUpdate) SetNillableCreatedBy

func (su *SquadUpdate) SetNillableCreatedBy(i *int64) *SquadUpdate

SetNillableCreatedBy sets the "created_by" field if the given value is not nil.

func (*SquadUpdate) SetNillableDeletedAt

func (su *SquadUpdate) SetNillableDeletedAt(t *time.Time) *SquadUpdate

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*SquadUpdate) SetNillableRat

func (su *SquadUpdate) SetNillableRat(b *bool) *SquadUpdate

SetNillableRat sets the "rat" field if the given value is not nil.

func (*SquadUpdate) SetNillableUpdatedBy

func (su *SquadUpdate) SetNillableUpdatedBy(i *int64) *SquadUpdate

SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil.

func (*SquadUpdate) SetRat

func (su *SquadUpdate) SetRat(b bool) *SquadUpdate

SetRat sets the "rat" field.

func (*SquadUpdate) SetUpdatedAt

func (su *SquadUpdate) SetUpdatedAt(t time.Time) *SquadUpdate

SetUpdatedAt sets the "updated_at" field.

func (*SquadUpdate) SetUpdatedBy

func (su *SquadUpdate) SetUpdatedBy(i int64) *SquadUpdate

SetUpdatedBy sets the "updated_by" field.

func (*SquadUpdate) SetUserID

func (su *SquadUpdate) SetUserID(i int64) *SquadUpdate

SetUserID sets the "user_id" field.

func (*SquadUpdate) Where

func (su *SquadUpdate) Where(ps ...predicate.Squad) *SquadUpdate

Where appends a list predicates to the SquadUpdate builder.

type SquadUpdateOne

type SquadUpdateOne struct {
	// contains filtered or unexported fields
}

SquadUpdateOne is the builder for updating a single Squad entity.

func (*SquadUpdateOne) AddCreatedBy

func (suo *SquadUpdateOne) AddCreatedBy(i int64) *SquadUpdateOne

AddCreatedBy adds i to the "created_by" field.

func (*SquadUpdateOne) AddUpdatedBy

func (suo *SquadUpdateOne) AddUpdatedBy(i int64) *SquadUpdateOne

AddUpdatedBy adds i to the "updated_by" field.

func (*SquadUpdateOne) AddUserID

func (suo *SquadUpdateOne) AddUserID(i int64) *SquadUpdateOne

AddUserID adds i to the "user_id" field.

func (*SquadUpdateOne) ClearMission

func (suo *SquadUpdateOne) ClearMission() *SquadUpdateOne

ClearMission clears the "mission" edge to the Mission entity.

func (*SquadUpdateOne) Exec

func (suo *SquadUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*SquadUpdateOne) ExecX

func (suo *SquadUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*SquadUpdateOne) Mutation

func (suo *SquadUpdateOne) Mutation() *SquadMutation

Mutation returns the SquadMutation object of the builder.

func (*SquadUpdateOne) Save

func (suo *SquadUpdateOne) Save(ctx context.Context) (*Squad, error)

Save executes the query and returns the updated Squad entity.

func (*SquadUpdateOne) SaveX

func (suo *SquadUpdateOne) SaveX(ctx context.Context) *Squad

SaveX is like Save, but panics if an error occurs.

func (*SquadUpdateOne) Select

func (suo *SquadUpdateOne) Select(field string, fields ...string) *SquadUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*SquadUpdateOne) SetActed

func (suo *SquadUpdateOne) SetActed(b bool) *SquadUpdateOne

SetActed sets the "acted" field.

func (*SquadUpdateOne) SetCreatedBy

func (suo *SquadUpdateOne) SetCreatedBy(i int64) *SquadUpdateOne

SetCreatedBy sets the "created_by" field.

func (*SquadUpdateOne) SetDeletedAt

func (suo *SquadUpdateOne) SetDeletedAt(t time.Time) *SquadUpdateOne

SetDeletedAt sets the "deleted_at" field.

func (*SquadUpdateOne) SetInput

SetInput applies the change-set in the UpdateSquadInput on the SquadUpdateOne builder.

func (*SquadUpdateOne) SetMission

func (suo *SquadUpdateOne) SetMission(m *Mission) *SquadUpdateOne

SetMission sets the "mission" edge to the Mission entity.

func (*SquadUpdateOne) SetMissionID

func (suo *SquadUpdateOne) SetMissionID(i int64) *SquadUpdateOne

SetMissionID sets the "mission_id" field.

func (*SquadUpdateOne) SetNillableActed

func (suo *SquadUpdateOne) SetNillableActed(b *bool) *SquadUpdateOne

SetNillableActed sets the "acted" field if the given value is not nil.

func (*SquadUpdateOne) SetNillableCreatedBy

func (suo *SquadUpdateOne) SetNillableCreatedBy(i *int64) *SquadUpdateOne

SetNillableCreatedBy sets the "created_by" field if the given value is not nil.

func (*SquadUpdateOne) SetNillableDeletedAt

func (suo *SquadUpdateOne) SetNillableDeletedAt(t *time.Time) *SquadUpdateOne

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*SquadUpdateOne) SetNillableRat

func (suo *SquadUpdateOne) SetNillableRat(b *bool) *SquadUpdateOne

SetNillableRat sets the "rat" field if the given value is not nil.

func (*SquadUpdateOne) SetNillableUpdatedBy

func (suo *SquadUpdateOne) SetNillableUpdatedBy(i *int64) *SquadUpdateOne

SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil.

func (*SquadUpdateOne) SetRat

func (suo *SquadUpdateOne) SetRat(b bool) *SquadUpdateOne

SetRat sets the "rat" field.

func (*SquadUpdateOne) SetUpdatedAt

func (suo *SquadUpdateOne) SetUpdatedAt(t time.Time) *SquadUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*SquadUpdateOne) SetUpdatedBy

func (suo *SquadUpdateOne) SetUpdatedBy(i int64) *SquadUpdateOne

SetUpdatedBy sets the "updated_by" field.

func (*SquadUpdateOne) SetUserID

func (suo *SquadUpdateOne) SetUserID(i int64) *SquadUpdateOne

SetUserID sets the "user_id" field.

type SquadWhereInput

type SquadWhereInput struct {
	Predicates []predicate.Squad  `json:"-"`
	Not        *SquadWhereInput   `json:"not,omitempty"`
	Or         []*SquadWhereInput `json:"or,omitempty"`
	And        []*SquadWhereInput `json:"and,omitempty"`

	// "id" field predicates.
	ID      *int64  `json:"id,omitempty"`
	IDNEQ   *int64  `json:"idNEQ,omitempty"`
	IDIn    []int64 `json:"idIn,omitempty"`
	IDNotIn []int64 `json:"idNotIn,omitempty"`
	IDGT    *int64  `json:"idGT,omitempty"`
	IDGTE   *int64  `json:"idGTE,omitempty"`
	IDLT    *int64  `json:"idLT,omitempty"`
	IDLTE   *int64  `json:"idLTE,omitempty"`

	// "created_by" field predicates.
	CreatedBy      *int64  `json:"createdBy,omitempty"`
	CreatedByNEQ   *int64  `json:"createdByNEQ,omitempty"`
	CreatedByIn    []int64 `json:"createdByIn,omitempty"`
	CreatedByNotIn []int64 `json:"createdByNotIn,omitempty"`
	CreatedByGT    *int64  `json:"createdByGT,omitempty"`
	CreatedByGTE   *int64  `json:"createdByGTE,omitempty"`
	CreatedByLT    *int64  `json:"createdByLT,omitempty"`
	CreatedByLTE   *int64  `json:"createdByLTE,omitempty"`

	// "updated_by" field predicates.
	UpdatedBy      *int64  `json:"updatedBy,omitempty"`
	UpdatedByNEQ   *int64  `json:"updatedByNEQ,omitempty"`
	UpdatedByIn    []int64 `json:"updatedByIn,omitempty"`
	UpdatedByNotIn []int64 `json:"updatedByNotIn,omitempty"`
	UpdatedByGT    *int64  `json:"updatedByGT,omitempty"`
	UpdatedByGTE   *int64  `json:"updatedByGTE,omitempty"`
	UpdatedByLT    *int64  `json:"updatedByLT,omitempty"`
	UpdatedByLTE   *int64  `json:"updatedByLTE,omitempty"`

	// "created_at" field predicates.
	CreatedAt      *time.Time  `json:"createdAt,omitempty"`
	CreatedAtNEQ   *time.Time  `json:"createdAtNEQ,omitempty"`
	CreatedAtIn    []time.Time `json:"createdAtIn,omitempty"`
	CreatedAtNotIn []time.Time `json:"createdAtNotIn,omitempty"`
	CreatedAtGT    *time.Time  `json:"createdAtGT,omitempty"`
	CreatedAtGTE   *time.Time  `json:"createdAtGTE,omitempty"`
	CreatedAtLT    *time.Time  `json:"createdAtLT,omitempty"`
	CreatedAtLTE   *time.Time  `json:"createdAtLTE,omitempty"`

	// "updated_at" field predicates.
	UpdatedAt      *time.Time  `json:"updatedAt,omitempty"`
	UpdatedAtNEQ   *time.Time  `json:"updatedAtNEQ,omitempty"`
	UpdatedAtIn    []time.Time `json:"updatedAtIn,omitempty"`
	UpdatedAtNotIn []time.Time `json:"updatedAtNotIn,omitempty"`
	UpdatedAtGT    *time.Time  `json:"updatedAtGT,omitempty"`
	UpdatedAtGTE   *time.Time  `json:"updatedAtGTE,omitempty"`
	UpdatedAtLT    *time.Time  `json:"updatedAtLT,omitempty"`
	UpdatedAtLTE   *time.Time  `json:"updatedAtLTE,omitempty"`

	// "deleted_at" field predicates.
	DeletedAt      *time.Time  `json:"deletedAt,omitempty"`
	DeletedAtNEQ   *time.Time  `json:"deletedAtNEQ,omitempty"`
	DeletedAtIn    []time.Time `json:"deletedAtIn,omitempty"`
	DeletedAtNotIn []time.Time `json:"deletedAtNotIn,omitempty"`
	DeletedAtGT    *time.Time  `json:"deletedAtGT,omitempty"`
	DeletedAtGTE   *time.Time  `json:"deletedAtGTE,omitempty"`
	DeletedAtLT    *time.Time  `json:"deletedAtLT,omitempty"`
	DeletedAtLTE   *time.Time  `json:"deletedAtLTE,omitempty"`

	// "mission_id" field predicates.
	MissionID      *int64  `json:"missionID,omitempty"`
	MissionIDNEQ   *int64  `json:"missionIDNEQ,omitempty"`
	MissionIDIn    []int64 `json:"missionIDIn,omitempty"`
	MissionIDNotIn []int64 `json:"missionIDNotIn,omitempty"`

	// "user_id" field predicates.
	UserID      *int64  `json:"userID,omitempty"`
	UserIDNEQ   *int64  `json:"userIDNEQ,omitempty"`
	UserIDIn    []int64 `json:"userIDIn,omitempty"`
	UserIDNotIn []int64 `json:"userIDNotIn,omitempty"`
	UserIDGT    *int64  `json:"userIDGT,omitempty"`
	UserIDGTE   *int64  `json:"userIDGTE,omitempty"`
	UserIDLT    *int64  `json:"userIDLT,omitempty"`
	UserIDLTE   *int64  `json:"userIDLTE,omitempty"`

	// "rat" field predicates.
	Rat    *bool `json:"rat,omitempty"`
	RatNEQ *bool `json:"ratNEQ,omitempty"`

	// "acted" field predicates.
	Acted    *bool `json:"acted,omitempty"`
	ActedNEQ *bool `json:"actedNEQ,omitempty"`

	// "mission" edge predicates.
	HasMission     *bool                `json:"hasMission,omitempty"`
	HasMissionWith []*MissionWhereInput `json:"hasMissionWith,omitempty"`
}

SquadWhereInput represents a where input for filtering Squad queries.

func (*SquadWhereInput) AddPredicates

func (i *SquadWhereInput) AddPredicates(predicates ...predicate.Squad)

AddPredicates adds custom predicates to the where input to be used during the filtering phase.

func (*SquadWhereInput) Filter

func (i *SquadWhereInput) Filter(q *SquadQuery) (*SquadQuery, error)

Filter applies the SquadWhereInput filter on the SquadQuery builder.

func (*SquadWhereInput) P

P returns a predicate for filtering squads. An error is returned if the input is empty or invalid.

type Squads

type Squads []*Squad

Squads is a parsable slice of Squad.

type Tx

type Tx struct {

	// Card is the client for interacting with the Card builders.
	Card *CardClient
	// Game is the client for interacting with the Game builders.
	Game *GameClient
	// GameUser is the client for interacting with the GameUser builders.
	GameUser *GameUserClient
	// Mission is the client for interacting with the Mission builders.
	Mission *MissionClient
	// Record is the client for interacting with the Record builders.
	Record *RecordClient
	// Room is the client for interacting with the Room builders.
	Room *RoomClient
	// RoomUser is the client for interacting with the RoomUser builders.
	RoomUser *RoomUserClient
	// Squad is the client for interacting with the Squad builders.
	Squad *SquadClient
	// Vote is the client for interacting with the Vote builders.
	Vote *VoteClient
	// 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 UpdateCardInput

type UpdateCardInput struct {
	CreatedBy         *int64
	UpdatedBy         *int64
	UpdatedAt         *time.Time
	DeletedAt         *time.Time
	Name              *card.Name
	Role              *card.Role
	Tale              *string
	Red               *bool
	AddGameUserIDs    []int64
	RemoveGameUserIDs []int64
}

UpdateCardInput represents a mutation input for updating cards.

func (*UpdateCardInput) Mutate

func (i *UpdateCardInput) Mutate(m *CardMutation)

Mutate applies the UpdateCardInput on the CardMutation builder.

type UpdateGameInput

type UpdateGameInput struct {
	CreatedBy                *int64
	UpdatedBy                *int64
	UpdatedAt                *time.Time
	DeletedAt                *time.Time
	Result                   *game.Result
	Capacity                 *uint8
	ClearTheAssassinatedIds  bool
	TheAssassinatedIds       []string
	AppendTheAssassinatedIds []string
	AssassinChance           *uint8
	Closed                   *bool
	AddGameUserIDs           []int64
	RemoveGameUserIDs        []int64
	AddMissionIDs            []int64
	RemoveMissionIDs         []int64
	ClearRoom                bool
	RoomID                   *int64
}

UpdateGameInput represents a mutation input for updating games.

func (*UpdateGameInput) Mutate

func (i *UpdateGameInput) Mutate(m *GameMutation)

Mutate applies the UpdateGameInput on the GameMutation builder.

type UpdateGameUserInput

type UpdateGameUserInput struct {
	CreatedBy *int64
	UpdatedBy *int64
	UpdatedAt *time.Time
	DeletedAt *time.Time
	UserID    *int64
	Number    *uint8
	Exited    *bool
	ClearGame bool
	GameID    *int64
	ClearCard bool
	CardID    *int64
}

UpdateGameUserInput represents a mutation input for updating gameusers.

func (*UpdateGameUserInput) Mutate

func (i *UpdateGameUserInput) Mutate(m *GameUserMutation)

Mutate applies the UpdateGameUserInput on the GameUserMutation builder.

type UpdateMissionInput

type UpdateMissionInput struct {
	CreatedBy      *int64
	UpdatedBy      *int64
	UpdatedAt      *time.Time
	DeletedAt      *time.Time
	Sequence       *uint8
	Status         *mission.Status
	Failed         *bool
	Capacity       *uint8
	LeaderID       *int64
	Protected      *bool
	ClearGame      bool
	GameID         *int64
	AddSquadIDs    []int64
	RemoveSquadIDs []int64
	AddVoteIDs     []int64
	RemoveVoteIDs  []int64
}

UpdateMissionInput represents a mutation input for updating missions.

func (*UpdateMissionInput) Mutate

func (i *UpdateMissionInput) Mutate(m *MissionMutation)

Mutate applies the UpdateMissionInput on the MissionMutation builder.

type UpdateRecordInput

type UpdateRecordInput struct {
	CreatedBy *int64
	UpdatedBy *int64
	UpdatedAt *time.Time
	DeletedAt *time.Time
	UserID    *int64
	Score     *int32
	ClearRoom bool
	RoomID    *int64
}

UpdateRecordInput represents a mutation input for updating records.

func (*UpdateRecordInput) Mutate

func (i *UpdateRecordInput) Mutate(m *RecordMutation)

Mutate applies the UpdateRecordInput on the RecordMutation builder.

type UpdateRoomInput

type UpdateRoomInput struct {
	CreatedBy         *int64
	UpdatedBy         *int64
	UpdatedAt         *time.Time
	DeletedAt         *time.Time
	Name              *string
	Closed            *bool
	GameOn            *bool
	AddRoomUserIDs    []int64
	RemoveRoomUserIDs []int64
	AddGameIDs        []int64
	RemoveGameIDs     []int64
	AddRecordIDs      []int64
	RemoveRecordIDs   []int64
}

UpdateRoomInput represents a mutation input for updating rooms.

func (*UpdateRoomInput) Mutate

func (i *UpdateRoomInput) Mutate(m *RoomMutation)

Mutate applies the UpdateRoomInput on the RoomMutation builder.

type UpdateRoomUserInput

type UpdateRoomUserInput struct {
	CreatedBy *int64
	UpdatedBy *int64
	UpdatedAt *time.Time
	DeletedAt *time.Time
	UserID    *int64
	Host      *bool
	ClearRoom bool
	RoomID    *int64
}

UpdateRoomUserInput represents a mutation input for updating roomusers.

func (*UpdateRoomUserInput) Mutate

func (i *UpdateRoomUserInput) Mutate(m *RoomUserMutation)

Mutate applies the UpdateRoomUserInput on the RoomUserMutation builder.

type UpdateSquadInput

type UpdateSquadInput struct {
	CreatedBy    *int64
	UpdatedBy    *int64
	UpdatedAt    *time.Time
	DeletedAt    *time.Time
	UserID       *int64
	Rat          *bool
	Acted        *bool
	ClearMission bool
	MissionID    *int64
}

UpdateSquadInput represents a mutation input for updating squads.

func (*UpdateSquadInput) Mutate

func (i *UpdateSquadInput) Mutate(m *SquadMutation)

Mutate applies the UpdateSquadInput on the SquadMutation builder.

type UpdateVoteInput

type UpdateVoteInput struct {
	CreatedBy    *int64
	UpdatedBy    *int64
	UpdatedAt    *time.Time
	DeletedAt    *time.Time
	UserID       *int64
	Pass         *bool
	Voted        *bool
	ClearMission bool
	MissionID    *int64
}

UpdateVoteInput represents a mutation input for updating votes.

func (*UpdateVoteInput) Mutate

func (i *UpdateVoteInput) Mutate(m *VoteMutation)

Mutate applies the UpdateVoteInput on the VoteMutation builder.

type ValidationError

type ValidationError struct {
	Name string // Field or edge name.
	// contains filtered or unexported fields
}

ValidationError returns when validating a field or edge fails.

func (*ValidationError) Error

func (e *ValidationError) Error() string

Error implements the error interface.

func (*ValidationError) Unwrap

func (e *ValidationError) Unwrap() error

Unwrap implements the errors.Wrapper interface.

type Value

type Value = ent.Value

ent aliases to avoid import conflicts in user's code.

type Vote

type Vote struct {

	// ID of the ent.
	ID int64 `json:"id,omitempty"`
	// CreatedBy holds the value of the "created_by" field.
	CreatedBy int64 `json:"created_by"`
	// UpdatedBy holds the value of the "updated_by" field.
	UpdatedBy int64 `json:"updated_by"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at"`
	// UpdatedAt holds the value of the "updated_at" field.
	UpdatedAt time.Time `json:"updated_at"`
	// DeletedAt holds the value of the "deleted_at" field.
	DeletedAt time.Time `json:"deleted_at"`
	// 所属任务 ID
	MissionID int64 `json:"mission_id"`
	// 用户 ID
	UserID int64 `json:"user_id"`
	// 是否赞同目前小队出征
	Pass bool `json:"pass"`
	// 是否已投票
	Voted bool `json:"voted"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the VoteQuery when eager-loading is set.
	Edges VoteEdges `json:"edges"`
	// contains filtered or unexported fields
}

Vote is the model entity for the Vote schema.

func (Vote) IsEntity

func (v Vote) IsEntity()

IsEntity implement fedruntime.Entity

func (*Vote) Mission

func (v *Vote) Mission(ctx context.Context) (*Mission, error)

func (*Vote) Node

func (v *Vote) Node(ctx context.Context) (node *Node, err error)

func (*Vote) QueryMission

func (v *Vote) QueryMission() *MissionQuery

QueryMission queries the "mission" edge of the Vote entity.

func (*Vote) String

func (v *Vote) String() string

String implements the fmt.Stringer.

func (*Vote) ToEdge

func (v *Vote) ToEdge(order *VoteOrder) *VoteEdge

ToEdge converts Vote into VoteEdge.

func (*Vote) Unwrap

func (v *Vote) Unwrap() *Vote

Unwrap unwraps the Vote 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 (*Vote) Update

func (v *Vote) Update() *VoteUpdateOne

Update returns a builder for updating this Vote. Note that you need to call Vote.Unwrap() before calling this method if this Vote was returned from a transaction, and the transaction was committed or rolled back.

type VoteClient

type VoteClient struct {
	// contains filtered or unexported fields
}

VoteClient is a client for the Vote schema.

func NewVoteClient

func NewVoteClient(c config) *VoteClient

NewVoteClient returns a client for the Vote from the given config.

func (*VoteClient) Create

func (c *VoteClient) Create() *VoteCreate

Create returns a builder for creating a Vote entity.

func (*VoteClient) CreateBulk

func (c *VoteClient) CreateBulk(builders ...*VoteCreate) *VoteCreateBulk

CreateBulk returns a builder for creating a bulk of Vote entities.

func (*VoteClient) Delete

func (c *VoteClient) Delete() *VoteDelete

Delete returns a delete builder for Vote.

func (*VoteClient) DeleteOne

func (c *VoteClient) DeleteOne(v *Vote) *VoteDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*VoteClient) DeleteOneID

func (c *VoteClient) DeleteOneID(id int64) *VoteDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*VoteClient) Get

func (c *VoteClient) Get(ctx context.Context, id int64) (*Vote, error)

Get returns a Vote entity by its id.

func (*VoteClient) GetX

func (c *VoteClient) GetX(ctx context.Context, id int64) *Vote

GetX is like Get, but panics if an error occurs.

func (*VoteClient) Hooks

func (c *VoteClient) Hooks() []Hook

Hooks returns the client hooks.

func (*VoteClient) Query

func (c *VoteClient) Query() *VoteQuery

Query returns a query builder for Vote.

func (*VoteClient) QueryMission

func (c *VoteClient) QueryMission(v *Vote) *MissionQuery

QueryMission queries the mission edge of a Vote.

func (*VoteClient) Update

func (c *VoteClient) Update() *VoteUpdate

Update returns an update builder for Vote.

func (*VoteClient) UpdateOne

func (c *VoteClient) UpdateOne(v *Vote) *VoteUpdateOne

UpdateOne returns an update builder for the given entity.

func (*VoteClient) UpdateOneID

func (c *VoteClient) UpdateOneID(id int64) *VoteUpdateOne

UpdateOneID returns an update builder for the given id.

func (*VoteClient) Use

func (c *VoteClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `vote.Hooks(f(g(h())))`.

type VoteConnection

type VoteConnection struct {
	Edges      []*VoteEdge `json:"edges"`
	PageInfo   PageInfo    `json:"pageInfo"`
	TotalCount int         `json:"totalCount"`
}

VoteConnection is the connection containing edges to Vote.

type VoteCreate

type VoteCreate struct {
	// contains filtered or unexported fields
}

VoteCreate is the builder for creating a Vote entity.

func (*VoteCreate) Exec

func (vc *VoteCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*VoteCreate) ExecX

func (vc *VoteCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*VoteCreate) Mutation

func (vc *VoteCreate) Mutation() *VoteMutation

Mutation returns the VoteMutation object of the builder.

func (*VoteCreate) Save

func (vc *VoteCreate) Save(ctx context.Context) (*Vote, error)

Save creates the Vote in the database.

func (*VoteCreate) SaveX

func (vc *VoteCreate) SaveX(ctx context.Context) *Vote

SaveX calls Save and panics if Save returns an error.

func (*VoteCreate) SetCreatedAt

func (vc *VoteCreate) SetCreatedAt(t time.Time) *VoteCreate

SetCreatedAt sets the "created_at" field.

func (*VoteCreate) SetCreatedBy

func (vc *VoteCreate) SetCreatedBy(i int64) *VoteCreate

SetCreatedBy sets the "created_by" field.

func (*VoteCreate) SetDeletedAt

func (vc *VoteCreate) SetDeletedAt(t time.Time) *VoteCreate

SetDeletedAt sets the "deleted_at" field.

func (*VoteCreate) SetID

func (vc *VoteCreate) SetID(i int64) *VoteCreate

SetID sets the "id" field.

func (*VoteCreate) SetInput

func (c *VoteCreate) SetInput(i CreateVoteInput) *VoteCreate

SetInput applies the change-set in the CreateVoteInput on the VoteCreate builder.

func (*VoteCreate) SetMission

func (vc *VoteCreate) SetMission(m *Mission) *VoteCreate

SetMission sets the "mission" edge to the Mission entity.

func (*VoteCreate) SetMissionID

func (vc *VoteCreate) SetMissionID(i int64) *VoteCreate

SetMissionID sets the "mission_id" field.

func (*VoteCreate) SetNillableCreatedAt

func (vc *VoteCreate) SetNillableCreatedAt(t *time.Time) *VoteCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*VoteCreate) SetNillableCreatedBy

func (vc *VoteCreate) SetNillableCreatedBy(i *int64) *VoteCreate

SetNillableCreatedBy sets the "created_by" field if the given value is not nil.

func (*VoteCreate) SetNillableDeletedAt

func (vc *VoteCreate) SetNillableDeletedAt(t *time.Time) *VoteCreate

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*VoteCreate) SetNillableID

func (vc *VoteCreate) SetNillableID(i *int64) *VoteCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*VoteCreate) SetNillablePass

func (vc *VoteCreate) SetNillablePass(b *bool) *VoteCreate

SetNillablePass sets the "pass" field if the given value is not nil.

func (*VoteCreate) SetNillableUpdatedAt

func (vc *VoteCreate) SetNillableUpdatedAt(t *time.Time) *VoteCreate

SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.

func (*VoteCreate) SetNillableUpdatedBy

func (vc *VoteCreate) SetNillableUpdatedBy(i *int64) *VoteCreate

SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil.

func (*VoteCreate) SetNillableVoted

func (vc *VoteCreate) SetNillableVoted(b *bool) *VoteCreate

SetNillableVoted sets the "voted" field if the given value is not nil.

func (*VoteCreate) SetPass

func (vc *VoteCreate) SetPass(b bool) *VoteCreate

SetPass sets the "pass" field.

func (*VoteCreate) SetUpdatedAt

func (vc *VoteCreate) SetUpdatedAt(t time.Time) *VoteCreate

SetUpdatedAt sets the "updated_at" field.

func (*VoteCreate) SetUpdatedBy

func (vc *VoteCreate) SetUpdatedBy(i int64) *VoteCreate

SetUpdatedBy sets the "updated_by" field.

func (*VoteCreate) SetUserID

func (vc *VoteCreate) SetUserID(i int64) *VoteCreate

SetUserID sets the "user_id" field.

func (*VoteCreate) SetVoted

func (vc *VoteCreate) SetVoted(b bool) *VoteCreate

SetVoted sets the "voted" field.

type VoteCreateBulk

type VoteCreateBulk struct {
	// contains filtered or unexported fields
}

VoteCreateBulk is the builder for creating many Vote entities in bulk.

func (*VoteCreateBulk) Exec

func (vcb *VoteCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*VoteCreateBulk) ExecX

func (vcb *VoteCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*VoteCreateBulk) Save

func (vcb *VoteCreateBulk) Save(ctx context.Context) ([]*Vote, error)

Save creates the Vote entities in the database.

func (*VoteCreateBulk) SaveX

func (vcb *VoteCreateBulk) SaveX(ctx context.Context) []*Vote

SaveX is like Save, but panics if an error occurs.

type VoteDelete

type VoteDelete struct {
	// contains filtered or unexported fields
}

VoteDelete is the builder for deleting a Vote entity.

func (*VoteDelete) Exec

func (vd *VoteDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*VoteDelete) ExecX

func (vd *VoteDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*VoteDelete) Where

func (vd *VoteDelete) Where(ps ...predicate.Vote) *VoteDelete

Where appends a list predicates to the VoteDelete builder.

type VoteDeleteOne

type VoteDeleteOne struct {
	// contains filtered or unexported fields
}

VoteDeleteOne is the builder for deleting a single Vote entity.

func (*VoteDeleteOne) Exec

func (vdo *VoteDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*VoteDeleteOne) ExecX

func (vdo *VoteDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

type VoteEdge

type VoteEdge struct {
	Node   *Vote  `json:"node"`
	Cursor Cursor `json:"cursor"`
}

VoteEdge is the edge representation of Vote.

type VoteEdges

type VoteEdges struct {
	// Mission holds the value of the mission edge.
	Mission *Mission `json:"mission,omitempty"`
	// contains filtered or unexported fields
}

VoteEdges holds the relations/edges for other nodes in the graph.

func (VoteEdges) MissionOrErr

func (e VoteEdges) MissionOrErr() (*Mission, error)

MissionOrErr returns the Mission value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

type VoteGroupBy

type VoteGroupBy struct {
	// contains filtered or unexported fields
}

VoteGroupBy is the group-by builder for Vote entities.

func (*VoteGroupBy) Aggregate

func (vgb *VoteGroupBy) Aggregate(fns ...AggregateFunc) *VoteGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*VoteGroupBy) Bool

func (s *VoteGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*VoteGroupBy) BoolX

func (s *VoteGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*VoteGroupBy) Bools

func (s *VoteGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*VoteGroupBy) BoolsX

func (s *VoteGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*VoteGroupBy) Float64

func (s *VoteGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*VoteGroupBy) Float64X

func (s *VoteGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*VoteGroupBy) Float64s

func (s *VoteGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*VoteGroupBy) Float64sX

func (s *VoteGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*VoteGroupBy) Int

func (s *VoteGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*VoteGroupBy) IntX

func (s *VoteGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*VoteGroupBy) Ints

func (s *VoteGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*VoteGroupBy) IntsX

func (s *VoteGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*VoteGroupBy) Scan

func (vgb *VoteGroupBy) Scan(ctx context.Context, v any) error

Scan applies the group-by query and scans the result into the given value.

func (*VoteGroupBy) ScanX

func (s *VoteGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*VoteGroupBy) String

func (s *VoteGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*VoteGroupBy) StringX

func (s *VoteGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*VoteGroupBy) Strings

func (s *VoteGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*VoteGroupBy) StringsX

func (s *VoteGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type VoteMutation

type VoteMutation struct {
	// contains filtered or unexported fields
}

VoteMutation represents an operation that mutates the Vote nodes in the graph.

func (*VoteMutation) AddCreatedBy

func (m *VoteMutation) AddCreatedBy(i int64)

AddCreatedBy adds i to the "created_by" field.

func (*VoteMutation) AddField

func (m *VoteMutation) 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 (*VoteMutation) AddUpdatedBy

func (m *VoteMutation) AddUpdatedBy(i int64)

AddUpdatedBy adds i to the "updated_by" field.

func (*VoteMutation) AddUserID

func (m *VoteMutation) AddUserID(i int64)

AddUserID adds i to the "user_id" field.

func (*VoteMutation) AddedCreatedBy

func (m *VoteMutation) AddedCreatedBy() (r int64, exists bool)

AddedCreatedBy returns the value that was added to the "created_by" field in this mutation.

func (*VoteMutation) AddedEdges

func (m *VoteMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*VoteMutation) AddedField

func (m *VoteMutation) 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 (*VoteMutation) AddedFields

func (m *VoteMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*VoteMutation) AddedIDs

func (m *VoteMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*VoteMutation) AddedUpdatedBy

func (m *VoteMutation) AddedUpdatedBy() (r int64, exists bool)

AddedUpdatedBy returns the value that was added to the "updated_by" field in this mutation.

func (*VoteMutation) AddedUserID

func (m *VoteMutation) AddedUserID() (r int64, exists bool)

AddedUserID returns the value that was added to the "user_id" field in this mutation.

func (*VoteMutation) ClearEdge

func (m *VoteMutation) 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 (*VoteMutation) ClearField

func (m *VoteMutation) 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 (*VoteMutation) ClearMission

func (m *VoteMutation) ClearMission()

ClearMission clears the "mission" edge to the Mission entity.

func (*VoteMutation) ClearedEdges

func (m *VoteMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*VoteMutation) ClearedFields

func (m *VoteMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (VoteMutation) Client

func (m VoteMutation) 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 (*VoteMutation) CreatedAt

func (m *VoteMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*VoteMutation) CreatedBy

func (m *VoteMutation) CreatedBy() (r int64, exists bool)

CreatedBy returns the value of the "created_by" field in the mutation.

func (*VoteMutation) DeletedAt

func (m *VoteMutation) DeletedAt() (r time.Time, exists bool)

DeletedAt returns the value of the "deleted_at" field in the mutation.

func (*VoteMutation) EdgeCleared

func (m *VoteMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*VoteMutation) Field

func (m *VoteMutation) 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 (*VoteMutation) FieldCleared

func (m *VoteMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*VoteMutation) Fields

func (m *VoteMutation) 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 (*VoteMutation) ID

func (m *VoteMutation) ID() (id int64, 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 (*VoteMutation) IDs

func (m *VoteMutation) IDs(ctx context.Context) ([]int64, error)

IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.

func (*VoteMutation) MissionCleared

func (m *VoteMutation) MissionCleared() bool

MissionCleared reports if the "mission" edge to the Mission entity was cleared.

func (*VoteMutation) MissionID

func (m *VoteMutation) MissionID() (r int64, exists bool)

MissionID returns the value of the "mission_id" field in the mutation.

func (*VoteMutation) MissionIDs

func (m *VoteMutation) MissionIDs() (ids []int64)

MissionIDs returns the "mission" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use MissionID instead. It exists only for internal usage by the builders.

func (*VoteMutation) OldCreatedAt

func (m *VoteMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the Vote entity. If the Vote 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 (*VoteMutation) OldCreatedBy

func (m *VoteMutation) OldCreatedBy(ctx context.Context) (v int64, err error)

OldCreatedBy returns the old "created_by" field's value of the Vote entity. If the Vote 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 (*VoteMutation) OldDeletedAt

func (m *VoteMutation) OldDeletedAt(ctx context.Context) (v time.Time, err error)

OldDeletedAt returns the old "deleted_at" field's value of the Vote entity. If the Vote 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 (*VoteMutation) OldField

func (m *VoteMutation) 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 (*VoteMutation) OldMissionID

func (m *VoteMutation) OldMissionID(ctx context.Context) (v int64, err error)

OldMissionID returns the old "mission_id" field's value of the Vote entity. If the Vote 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 (*VoteMutation) OldPass

func (m *VoteMutation) OldPass(ctx context.Context) (v bool, err error)

OldPass returns the old "pass" field's value of the Vote entity. If the Vote 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 (*VoteMutation) OldUpdatedAt

func (m *VoteMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)

OldUpdatedAt returns the old "updated_at" field's value of the Vote entity. If the Vote 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 (*VoteMutation) OldUpdatedBy

func (m *VoteMutation) OldUpdatedBy(ctx context.Context) (v int64, err error)

OldUpdatedBy returns the old "updated_by" field's value of the Vote entity. If the Vote 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 (*VoteMutation) OldUserID

func (m *VoteMutation) OldUserID(ctx context.Context) (v int64, err error)

OldUserID returns the old "user_id" field's value of the Vote entity. If the Vote 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 (*VoteMutation) OldVoted

func (m *VoteMutation) OldVoted(ctx context.Context) (v bool, err error)

OldVoted returns the old "voted" field's value of the Vote entity. If the Vote 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 (*VoteMutation) Op

func (m *VoteMutation) Op() Op

Op returns the operation name.

func (*VoteMutation) Pass

func (m *VoteMutation) Pass() (r bool, exists bool)

Pass returns the value of the "pass" field in the mutation.

func (*VoteMutation) RemovedEdges

func (m *VoteMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*VoteMutation) RemovedIDs

func (m *VoteMutation) 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 (*VoteMutation) ResetCreatedAt

func (m *VoteMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*VoteMutation) ResetCreatedBy

func (m *VoteMutation) ResetCreatedBy()

ResetCreatedBy resets all changes to the "created_by" field.

func (*VoteMutation) ResetDeletedAt

func (m *VoteMutation) ResetDeletedAt()

ResetDeletedAt resets all changes to the "deleted_at" field.

func (*VoteMutation) ResetEdge

func (m *VoteMutation) 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 (*VoteMutation) ResetField

func (m *VoteMutation) 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 (*VoteMutation) ResetMission

func (m *VoteMutation) ResetMission()

ResetMission resets all changes to the "mission" edge.

func (*VoteMutation) ResetMissionID

func (m *VoteMutation) ResetMissionID()

ResetMissionID resets all changes to the "mission_id" field.

func (*VoteMutation) ResetPass

func (m *VoteMutation) ResetPass()

ResetPass resets all changes to the "pass" field.

func (*VoteMutation) ResetUpdatedAt

func (m *VoteMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*VoteMutation) ResetUpdatedBy

func (m *VoteMutation) ResetUpdatedBy()

ResetUpdatedBy resets all changes to the "updated_by" field.

func (*VoteMutation) ResetUserID

func (m *VoteMutation) ResetUserID()

ResetUserID resets all changes to the "user_id" field.

func (*VoteMutation) ResetVoted

func (m *VoteMutation) ResetVoted()

ResetVoted resets all changes to the "voted" field.

func (*VoteMutation) SetCreatedAt

func (m *VoteMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*VoteMutation) SetCreatedBy

func (m *VoteMutation) SetCreatedBy(i int64)

SetCreatedBy sets the "created_by" field.

func (*VoteMutation) SetDeletedAt

func (m *VoteMutation) SetDeletedAt(t time.Time)

SetDeletedAt sets the "deleted_at" field.

func (*VoteMutation) SetField

func (m *VoteMutation) 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 (*VoteMutation) SetID

func (m *VoteMutation) SetID(id int64)

SetID sets the value of the id field. Note that this operation is only accepted on creation of Vote entities.

func (*VoteMutation) SetMissionID

func (m *VoteMutation) SetMissionID(i int64)

SetMissionID sets the "mission_id" field.

func (*VoteMutation) SetPass

func (m *VoteMutation) SetPass(b bool)

SetPass sets the "pass" field.

func (*VoteMutation) SetUpdatedAt

func (m *VoteMutation) SetUpdatedAt(t time.Time)

SetUpdatedAt sets the "updated_at" field.

func (*VoteMutation) SetUpdatedBy

func (m *VoteMutation) SetUpdatedBy(i int64)

SetUpdatedBy sets the "updated_by" field.

func (*VoteMutation) SetUserID

func (m *VoteMutation) SetUserID(i int64)

SetUserID sets the "user_id" field.

func (*VoteMutation) SetVoted

func (m *VoteMutation) SetVoted(b bool)

SetVoted sets the "voted" field.

func (VoteMutation) Tx

func (m VoteMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*VoteMutation) Type

func (m *VoteMutation) Type() string

Type returns the node type of this mutation (Vote).

func (*VoteMutation) UpdatedAt

func (m *VoteMutation) UpdatedAt() (r time.Time, exists bool)

UpdatedAt returns the value of the "updated_at" field in the mutation.

func (*VoteMutation) UpdatedBy

func (m *VoteMutation) UpdatedBy() (r int64, exists bool)

UpdatedBy returns the value of the "updated_by" field in the mutation.

func (*VoteMutation) UserID

func (m *VoteMutation) UserID() (r int64, exists bool)

UserID returns the value of the "user_id" field in the mutation.

func (*VoteMutation) Voted

func (m *VoteMutation) Voted() (r bool, exists bool)

Voted returns the value of the "voted" field in the mutation.

func (*VoteMutation) Where

func (m *VoteMutation) Where(ps ...predicate.Vote)

Where appends a list predicates to the VoteMutation builder.

type VoteOrder

type VoteOrder struct {
	Direction OrderDirection  `json:"direction"`
	Field     *VoteOrderField `json:"field"`
}

VoteOrder defines the ordering of Vote.

type VoteOrderField

type VoteOrderField struct {
	// contains filtered or unexported fields
}

VoteOrderField defines the ordering field of Vote.

func (VoteOrderField) MarshalGQL

func (f VoteOrderField) MarshalGQL(w io.Writer)

MarshalGQL implements graphql.Marshaler interface.

func (VoteOrderField) String

func (f VoteOrderField) String() string

String implement fmt.Stringer interface.

func (*VoteOrderField) UnmarshalGQL

func (f *VoteOrderField) UnmarshalGQL(v interface{}) error

UnmarshalGQL implements graphql.Unmarshaler interface.

type VotePaginateOption

type VotePaginateOption func(*votePager) error

VotePaginateOption enables pagination customization.

func WithVoteFilter

func WithVoteFilter(filter func(*VoteQuery) (*VoteQuery, error)) VotePaginateOption

WithVoteFilter configures pagination filter.

func WithVoteOrder

func WithVoteOrder(order *VoteOrder) VotePaginateOption

WithVoteOrder configures pagination ordering.

type VoteQuery

type VoteQuery struct {
	// contains filtered or unexported fields
}

VoteQuery is the builder for querying Vote entities.

func (*VoteQuery) Aggregate

func (vq *VoteQuery) Aggregate(fns ...AggregateFunc) *VoteSelect

Aggregate returns a VoteSelect configured with the given aggregations.

func (*VoteQuery) All

func (vq *VoteQuery) All(ctx context.Context) ([]*Vote, error)

All executes the query and returns a list of Votes.

func (*VoteQuery) AllX

func (vq *VoteQuery) AllX(ctx context.Context) []*Vote

AllX is like All, but panics if an error occurs.

func (*VoteQuery) Clone

func (vq *VoteQuery) Clone() *VoteQuery

Clone returns a duplicate of the VoteQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*VoteQuery) CollectFields

func (v *VoteQuery) CollectFields(ctx context.Context, satisfies ...string) (*VoteQuery, error)

CollectFields tells the query-builder to eagerly load connected nodes by resolver context.

func (*VoteQuery) Count

func (vq *VoteQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*VoteQuery) CountX

func (vq *VoteQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*VoteQuery) Exist

func (vq *VoteQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*VoteQuery) ExistX

func (vq *VoteQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*VoteQuery) First

func (vq *VoteQuery) First(ctx context.Context) (*Vote, error)

First returns the first Vote entity from the query. Returns a *NotFoundError when no Vote was found.

func (*VoteQuery) FirstID

func (vq *VoteQuery) FirstID(ctx context.Context) (id int64, err error)

FirstID returns the first Vote ID from the query. Returns a *NotFoundError when no Vote ID was found.

func (*VoteQuery) FirstIDX

func (vq *VoteQuery) FirstIDX(ctx context.Context) int64

FirstIDX is like FirstID, but panics if an error occurs.

func (*VoteQuery) FirstX

func (vq *VoteQuery) FirstX(ctx context.Context) *Vote

FirstX is like First, but panics if an error occurs.

func (*VoteQuery) GroupBy

func (vq *VoteQuery) GroupBy(field string, fields ...string) *VoteGroupBy

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 {
	CreatedBy int64 `json:"created_by"`
	Count int `json:"count,omitempty"`
}

client.Vote.Query().
	GroupBy(vote.FieldCreatedBy).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*VoteQuery) IDs

func (vq *VoteQuery) IDs(ctx context.Context) ([]int64, error)

IDs executes the query and returns a list of Vote IDs.

func (*VoteQuery) IDsX

func (vq *VoteQuery) IDsX(ctx context.Context) []int64

IDsX is like IDs, but panics if an error occurs.

func (*VoteQuery) Limit

func (vq *VoteQuery) Limit(limit int) *VoteQuery

Limit adds a limit step to the query.

func (*VoteQuery) Offset

func (vq *VoteQuery) Offset(offset int) *VoteQuery

Offset adds an offset step to the query.

func (*VoteQuery) Only

func (vq *VoteQuery) Only(ctx context.Context) (*Vote, error)

Only returns a single Vote entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Vote entity is found. Returns a *NotFoundError when no Vote entities are found.

func (*VoteQuery) OnlyID

func (vq *VoteQuery) OnlyID(ctx context.Context) (id int64, err error)

OnlyID is like Only, but returns the only Vote ID in the query. Returns a *NotSingularError when more than one Vote ID is found. Returns a *NotFoundError when no entities are found.

func (*VoteQuery) OnlyIDX

func (vq *VoteQuery) OnlyIDX(ctx context.Context) int64

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*VoteQuery) OnlyX

func (vq *VoteQuery) OnlyX(ctx context.Context) *Vote

OnlyX is like Only, but panics if an error occurs.

func (*VoteQuery) Order

func (vq *VoteQuery) Order(o ...OrderFunc) *VoteQuery

Order adds an order step to the query.

func (*VoteQuery) Paginate

func (v *VoteQuery) Paginate(
	ctx context.Context, after *Cursor, first *int,
	before *Cursor, last *int, opts ...VotePaginateOption,
) (*VoteConnection, error)

Paginate executes the query and returns a relay based cursor connection to Vote.

func (*VoteQuery) QueryMission

func (vq *VoteQuery) QueryMission() *MissionQuery

QueryMission chains the current query on the "mission" edge.

func (*VoteQuery) Select

func (vq *VoteQuery) Select(fields ...string) *VoteSelect

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 {
	CreatedBy int64 `json:"created_by"`
}

client.Vote.Query().
	Select(vote.FieldCreatedBy).
	Scan(ctx, &v)

func (*VoteQuery) Unique

func (vq *VoteQuery) Unique(unique bool) *VoteQuery

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 (*VoteQuery) Where

func (vq *VoteQuery) Where(ps ...predicate.Vote) *VoteQuery

Where adds a new predicate for the VoteQuery builder.

func (*VoteQuery) WithMission

func (vq *VoteQuery) WithMission(opts ...func(*MissionQuery)) *VoteQuery

WithMission tells the query-builder to eager-load the nodes that are connected to the "mission" edge. The optional arguments are used to configure the query builder of the edge.

type VoteSelect

type VoteSelect struct {
	*VoteQuery
	// contains filtered or unexported fields
}

VoteSelect is the builder for selecting fields of Vote entities.

func (*VoteSelect) Aggregate

func (vs *VoteSelect) Aggregate(fns ...AggregateFunc) *VoteSelect

Aggregate adds the given aggregation functions to the selector query.

func (*VoteSelect) Bool

func (s *VoteSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*VoteSelect) BoolX

func (s *VoteSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*VoteSelect) Bools

func (s *VoteSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*VoteSelect) BoolsX

func (s *VoteSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*VoteSelect) Float64

func (s *VoteSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*VoteSelect) Float64X

func (s *VoteSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*VoteSelect) Float64s

func (s *VoteSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*VoteSelect) Float64sX

func (s *VoteSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*VoteSelect) Int

func (s *VoteSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*VoteSelect) IntX

func (s *VoteSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*VoteSelect) Ints

func (s *VoteSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*VoteSelect) IntsX

func (s *VoteSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*VoteSelect) Scan

func (vs *VoteSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*VoteSelect) ScanX

func (s *VoteSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*VoteSelect) String

func (s *VoteSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*VoteSelect) StringX

func (s *VoteSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*VoteSelect) Strings

func (s *VoteSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*VoteSelect) StringsX

func (s *VoteSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type VoteUpdate

type VoteUpdate struct {
	// contains filtered or unexported fields
}

VoteUpdate is the builder for updating Vote entities.

func (*VoteUpdate) AddCreatedBy

func (vu *VoteUpdate) AddCreatedBy(i int64) *VoteUpdate

AddCreatedBy adds i to the "created_by" field.

func (*VoteUpdate) AddUpdatedBy

func (vu *VoteUpdate) AddUpdatedBy(i int64) *VoteUpdate

AddUpdatedBy adds i to the "updated_by" field.

func (*VoteUpdate) AddUserID

func (vu *VoteUpdate) AddUserID(i int64) *VoteUpdate

AddUserID adds i to the "user_id" field.

func (*VoteUpdate) ClearMission

func (vu *VoteUpdate) ClearMission() *VoteUpdate

ClearMission clears the "mission" edge to the Mission entity.

func (*VoteUpdate) Exec

func (vu *VoteUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*VoteUpdate) ExecX

func (vu *VoteUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*VoteUpdate) Mutation

func (vu *VoteUpdate) Mutation() *VoteMutation

Mutation returns the VoteMutation object of the builder.

func (*VoteUpdate) Save

func (vu *VoteUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*VoteUpdate) SaveX

func (vu *VoteUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*VoteUpdate) SetCreatedBy

func (vu *VoteUpdate) SetCreatedBy(i int64) *VoteUpdate

SetCreatedBy sets the "created_by" field.

func (*VoteUpdate) SetDeletedAt

func (vu *VoteUpdate) SetDeletedAt(t time.Time) *VoteUpdate

SetDeletedAt sets the "deleted_at" field.

func (*VoteUpdate) SetInput

func (c *VoteUpdate) SetInput(i UpdateVoteInput) *VoteUpdate

SetInput applies the change-set in the UpdateVoteInput on the VoteUpdate builder.

func (*VoteUpdate) SetMission

func (vu *VoteUpdate) SetMission(m *Mission) *VoteUpdate

SetMission sets the "mission" edge to the Mission entity.

func (*VoteUpdate) SetMissionID

func (vu *VoteUpdate) SetMissionID(i int64) *VoteUpdate

SetMissionID sets the "mission_id" field.

func (*VoteUpdate) SetNillableCreatedBy

func (vu *VoteUpdate) SetNillableCreatedBy(i *int64) *VoteUpdate

SetNillableCreatedBy sets the "created_by" field if the given value is not nil.

func (*VoteUpdate) SetNillableDeletedAt

func (vu *VoteUpdate) SetNillableDeletedAt(t *time.Time) *VoteUpdate

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*VoteUpdate) SetNillablePass

func (vu *VoteUpdate) SetNillablePass(b *bool) *VoteUpdate

SetNillablePass sets the "pass" field if the given value is not nil.

func (*VoteUpdate) SetNillableUpdatedBy

func (vu *VoteUpdate) SetNillableUpdatedBy(i *int64) *VoteUpdate

SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil.

func (*VoteUpdate) SetNillableVoted

func (vu *VoteUpdate) SetNillableVoted(b *bool) *VoteUpdate

SetNillableVoted sets the "voted" field if the given value is not nil.

func (*VoteUpdate) SetPass

func (vu *VoteUpdate) SetPass(b bool) *VoteUpdate

SetPass sets the "pass" field.

func (*VoteUpdate) SetUpdatedAt

func (vu *VoteUpdate) SetUpdatedAt(t time.Time) *VoteUpdate

SetUpdatedAt sets the "updated_at" field.

func (*VoteUpdate) SetUpdatedBy

func (vu *VoteUpdate) SetUpdatedBy(i int64) *VoteUpdate

SetUpdatedBy sets the "updated_by" field.

func (*VoteUpdate) SetUserID

func (vu *VoteUpdate) SetUserID(i int64) *VoteUpdate

SetUserID sets the "user_id" field.

func (*VoteUpdate) SetVoted

func (vu *VoteUpdate) SetVoted(b bool) *VoteUpdate

SetVoted sets the "voted" field.

func (*VoteUpdate) Where

func (vu *VoteUpdate) Where(ps ...predicate.Vote) *VoteUpdate

Where appends a list predicates to the VoteUpdate builder.

type VoteUpdateOne

type VoteUpdateOne struct {
	// contains filtered or unexported fields
}

VoteUpdateOne is the builder for updating a single Vote entity.

func (*VoteUpdateOne) AddCreatedBy

func (vuo *VoteUpdateOne) AddCreatedBy(i int64) *VoteUpdateOne

AddCreatedBy adds i to the "created_by" field.

func (*VoteUpdateOne) AddUpdatedBy

func (vuo *VoteUpdateOne) AddUpdatedBy(i int64) *VoteUpdateOne

AddUpdatedBy adds i to the "updated_by" field.

func (*VoteUpdateOne) AddUserID

func (vuo *VoteUpdateOne) AddUserID(i int64) *VoteUpdateOne

AddUserID adds i to the "user_id" field.

func (*VoteUpdateOne) ClearMission

func (vuo *VoteUpdateOne) ClearMission() *VoteUpdateOne

ClearMission clears the "mission" edge to the Mission entity.

func (*VoteUpdateOne) Exec

func (vuo *VoteUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*VoteUpdateOne) ExecX

func (vuo *VoteUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*VoteUpdateOne) Mutation

func (vuo *VoteUpdateOne) Mutation() *VoteMutation

Mutation returns the VoteMutation object of the builder.

func (*VoteUpdateOne) Save

func (vuo *VoteUpdateOne) Save(ctx context.Context) (*Vote, error)

Save executes the query and returns the updated Vote entity.

func (*VoteUpdateOne) SaveX

func (vuo *VoteUpdateOne) SaveX(ctx context.Context) *Vote

SaveX is like Save, but panics if an error occurs.

func (*VoteUpdateOne) Select

func (vuo *VoteUpdateOne) Select(field string, fields ...string) *VoteUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*VoteUpdateOne) SetCreatedBy

func (vuo *VoteUpdateOne) SetCreatedBy(i int64) *VoteUpdateOne

SetCreatedBy sets the "created_by" field.

func (*VoteUpdateOne) SetDeletedAt

func (vuo *VoteUpdateOne) SetDeletedAt(t time.Time) *VoteUpdateOne

SetDeletedAt sets the "deleted_at" field.

func (*VoteUpdateOne) SetInput

SetInput applies the change-set in the UpdateVoteInput on the VoteUpdateOne builder.

func (*VoteUpdateOne) SetMission

func (vuo *VoteUpdateOne) SetMission(m *Mission) *VoteUpdateOne

SetMission sets the "mission" edge to the Mission entity.

func (*VoteUpdateOne) SetMissionID

func (vuo *VoteUpdateOne) SetMissionID(i int64) *VoteUpdateOne

SetMissionID sets the "mission_id" field.

func (*VoteUpdateOne) SetNillableCreatedBy

func (vuo *VoteUpdateOne) SetNillableCreatedBy(i *int64) *VoteUpdateOne

SetNillableCreatedBy sets the "created_by" field if the given value is not nil.

func (*VoteUpdateOne) SetNillableDeletedAt

func (vuo *VoteUpdateOne) SetNillableDeletedAt(t *time.Time) *VoteUpdateOne

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*VoteUpdateOne) SetNillablePass

func (vuo *VoteUpdateOne) SetNillablePass(b *bool) *VoteUpdateOne

SetNillablePass sets the "pass" field if the given value is not nil.

func (*VoteUpdateOne) SetNillableUpdatedBy

func (vuo *VoteUpdateOne) SetNillableUpdatedBy(i *int64) *VoteUpdateOne

SetNillableUpdatedBy sets the "updated_by" field if the given value is not nil.

func (*VoteUpdateOne) SetNillableVoted

func (vuo *VoteUpdateOne) SetNillableVoted(b *bool) *VoteUpdateOne

SetNillableVoted sets the "voted" field if the given value is not nil.

func (*VoteUpdateOne) SetPass

func (vuo *VoteUpdateOne) SetPass(b bool) *VoteUpdateOne

SetPass sets the "pass" field.

func (*VoteUpdateOne) SetUpdatedAt

func (vuo *VoteUpdateOne) SetUpdatedAt(t time.Time) *VoteUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*VoteUpdateOne) SetUpdatedBy

func (vuo *VoteUpdateOne) SetUpdatedBy(i int64) *VoteUpdateOne

SetUpdatedBy sets the "updated_by" field.

func (*VoteUpdateOne) SetUserID

func (vuo *VoteUpdateOne) SetUserID(i int64) *VoteUpdateOne

SetUserID sets the "user_id" field.

func (*VoteUpdateOne) SetVoted

func (vuo *VoteUpdateOne) SetVoted(b bool) *VoteUpdateOne

SetVoted sets the "voted" field.

type VoteWhereInput

type VoteWhereInput struct {
	Predicates []predicate.Vote  `json:"-"`
	Not        *VoteWhereInput   `json:"not,omitempty"`
	Or         []*VoteWhereInput `json:"or,omitempty"`
	And        []*VoteWhereInput `json:"and,omitempty"`

	// "id" field predicates.
	ID      *int64  `json:"id,omitempty"`
	IDNEQ   *int64  `json:"idNEQ,omitempty"`
	IDIn    []int64 `json:"idIn,omitempty"`
	IDNotIn []int64 `json:"idNotIn,omitempty"`
	IDGT    *int64  `json:"idGT,omitempty"`
	IDGTE   *int64  `json:"idGTE,omitempty"`
	IDLT    *int64  `json:"idLT,omitempty"`
	IDLTE   *int64  `json:"idLTE,omitempty"`

	// "created_by" field predicates.
	CreatedBy      *int64  `json:"createdBy,omitempty"`
	CreatedByNEQ   *int64  `json:"createdByNEQ,omitempty"`
	CreatedByIn    []int64 `json:"createdByIn,omitempty"`
	CreatedByNotIn []int64 `json:"createdByNotIn,omitempty"`
	CreatedByGT    *int64  `json:"createdByGT,omitempty"`
	CreatedByGTE   *int64  `json:"createdByGTE,omitempty"`
	CreatedByLT    *int64  `json:"createdByLT,omitempty"`
	CreatedByLTE   *int64  `json:"createdByLTE,omitempty"`

	// "updated_by" field predicates.
	UpdatedBy      *int64  `json:"updatedBy,omitempty"`
	UpdatedByNEQ   *int64  `json:"updatedByNEQ,omitempty"`
	UpdatedByIn    []int64 `json:"updatedByIn,omitempty"`
	UpdatedByNotIn []int64 `json:"updatedByNotIn,omitempty"`
	UpdatedByGT    *int64  `json:"updatedByGT,omitempty"`
	UpdatedByGTE   *int64  `json:"updatedByGTE,omitempty"`
	UpdatedByLT    *int64  `json:"updatedByLT,omitempty"`
	UpdatedByLTE   *int64  `json:"updatedByLTE,omitempty"`

	// "created_at" field predicates.
	CreatedAt      *time.Time  `json:"createdAt,omitempty"`
	CreatedAtNEQ   *time.Time  `json:"createdAtNEQ,omitempty"`
	CreatedAtIn    []time.Time `json:"createdAtIn,omitempty"`
	CreatedAtNotIn []time.Time `json:"createdAtNotIn,omitempty"`
	CreatedAtGT    *time.Time  `json:"createdAtGT,omitempty"`
	CreatedAtGTE   *time.Time  `json:"createdAtGTE,omitempty"`
	CreatedAtLT    *time.Time  `json:"createdAtLT,omitempty"`
	CreatedAtLTE   *time.Time  `json:"createdAtLTE,omitempty"`

	// "updated_at" field predicates.
	UpdatedAt      *time.Time  `json:"updatedAt,omitempty"`
	UpdatedAtNEQ   *time.Time  `json:"updatedAtNEQ,omitempty"`
	UpdatedAtIn    []time.Time `json:"updatedAtIn,omitempty"`
	UpdatedAtNotIn []time.Time `json:"updatedAtNotIn,omitempty"`
	UpdatedAtGT    *time.Time  `json:"updatedAtGT,omitempty"`
	UpdatedAtGTE   *time.Time  `json:"updatedAtGTE,omitempty"`
	UpdatedAtLT    *time.Time  `json:"updatedAtLT,omitempty"`
	UpdatedAtLTE   *time.Time  `json:"updatedAtLTE,omitempty"`

	// "deleted_at" field predicates.
	DeletedAt      *time.Time  `json:"deletedAt,omitempty"`
	DeletedAtNEQ   *time.Time  `json:"deletedAtNEQ,omitempty"`
	DeletedAtIn    []time.Time `json:"deletedAtIn,omitempty"`
	DeletedAtNotIn []time.Time `json:"deletedAtNotIn,omitempty"`
	DeletedAtGT    *time.Time  `json:"deletedAtGT,omitempty"`
	DeletedAtGTE   *time.Time  `json:"deletedAtGTE,omitempty"`
	DeletedAtLT    *time.Time  `json:"deletedAtLT,omitempty"`
	DeletedAtLTE   *time.Time  `json:"deletedAtLTE,omitempty"`

	// "mission_id" field predicates.
	MissionID      *int64  `json:"missionID,omitempty"`
	MissionIDNEQ   *int64  `json:"missionIDNEQ,omitempty"`
	MissionIDIn    []int64 `json:"missionIDIn,omitempty"`
	MissionIDNotIn []int64 `json:"missionIDNotIn,omitempty"`

	// "user_id" field predicates.
	UserID      *int64  `json:"userID,omitempty"`
	UserIDNEQ   *int64  `json:"userIDNEQ,omitempty"`
	UserIDIn    []int64 `json:"userIDIn,omitempty"`
	UserIDNotIn []int64 `json:"userIDNotIn,omitempty"`
	UserIDGT    *int64  `json:"userIDGT,omitempty"`
	UserIDGTE   *int64  `json:"userIDGTE,omitempty"`
	UserIDLT    *int64  `json:"userIDLT,omitempty"`
	UserIDLTE   *int64  `json:"userIDLTE,omitempty"`

	// "pass" field predicates.
	Pass    *bool `json:"pass,omitempty"`
	PassNEQ *bool `json:"passNEQ,omitempty"`

	// "voted" field predicates.
	Voted    *bool `json:"voted,omitempty"`
	VotedNEQ *bool `json:"votedNEQ,omitempty"`

	// "mission" edge predicates.
	HasMission     *bool                `json:"hasMission,omitempty"`
	HasMissionWith []*MissionWhereInput `json:"hasMissionWith,omitempty"`
}

VoteWhereInput represents a where input for filtering Vote queries.

func (*VoteWhereInput) AddPredicates

func (i *VoteWhereInput) AddPredicates(predicates ...predicate.Vote)

AddPredicates adds custom predicates to the where input to be used during the filtering phase.

func (*VoteWhereInput) Filter

func (i *VoteWhereInput) Filter(q *VoteQuery) (*VoteQuery, error)

Filter applies the VoteWhereInput filter on the VoteQuery builder.

func (*VoteWhereInput) P

func (i *VoteWhereInput) P() (predicate.Vote, error)

P returns a predicate for filtering votes. An error is returned if the input is empty or invalid.

type Votes

type Votes []*Vote

Votes is a parsable slice of Vote.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL