ent

package
v0.0.0-...-52c565a Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2020 License: GPL-3.0 Imports: 21 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.
	TypeJiangHuRen = "JiangHuRen"
	TypeMenPai     = "MenPai"
	TypeWeapon     = "Weapon"
	TypeWuGong     = "WuGong"
)

Variables

This section is empty.

Functions

func IsConstraintError

func IsConstraintError(err error) bool

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

func IsNotFound

func IsNotFound(err error) bool

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

func IsNotLoaded

func IsNotLoaded(err error) bool

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

func IsNotSingular

func IsNotSingular(err error) bool

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

func MaskNotFound

func MaskNotFound(err error) error

MaskNotFound masks nor found error.

func NewContext

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

NewContext returns a new context with the given Client attached.

Types

type Aggregate

type Aggregate func(*sql.Selector) string

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

func As

func As(fn Aggregate, end string) Aggregate

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() Aggregate

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

func Max

func Max(field string) Aggregate

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

func Mean

func Mean(field string) Aggregate

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

func Min

func Min(field string) Aggregate

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

func Sum

func Sum(field string) Aggregate

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

type Client

type Client struct {

	// Schema is the client for creating, migrating and dropping schema.
	Schema *migrate.Schema
	// JiangHuRen is the client for interacting with the JiangHuRen builders.
	JiangHuRen *JiangHuRenClient
	// MenPai is the client for interacting with the MenPai builders.
	MenPai *MenPaiClient
	// Weapon is the client for interacting with the Weapon builders.
	Weapon *WeaponClient
	// WuGong is the client for interacting with the WuGong builders.
	WuGong *WuGongClient
	// contains filtered or unexported fields
}

Client is the client that holds all ent builders.

func FromContext

func FromContext(ctx context.Context) *Client

FromContext returns the Client stored in 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 connection to the database specified by the driver name and a driver-specific data source name, and returns a new client attached to it. Optional parameters can be added for configuring the client.

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().
	JiangHuRen.
	Query().
	Count(ctx)

func (*Client) Tx

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

Tx returns a new transactional client.

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 ConstraintError

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

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

func (ConstraintError) Error

func (e ConstraintError) Error() string

Error implements the error interface.

func (*ConstraintError) Unwrap

func (e *ConstraintError) Unwrap() error

Unwrap implements the errors.Wrapper interface.

type Hook

type Hook = ent.Hook

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

type JiangHuRen

type JiangHuRen struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// UpdatedAt holds the value of the "updated_at" field.
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// Name holds the value of the "name" field.
	Name string `json:"name,omitempty"`
	// Age holds the value of the "age" field.
	Age uint `json:"age,omitempty"`
	// Sex holds the value of the "sex" field.
	Sex bool `json:"sex,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the JiangHuRenQuery when eager-loading is set.
	Edges JiangHuRenEdges `json:"edges"`
	// contains filtered or unexported fields
}

JiangHuRen is the model entity for the JiangHuRen schema.

func (*JiangHuRen) QueryApprentices

func (jhr *JiangHuRen) QueryApprentices() *JiangHuRenQuery

QueryApprentices queries the apprentices edge of the JiangHuRen.

func (*JiangHuRen) QueryFollowers

func (jhr *JiangHuRen) QueryFollowers() *JiangHuRenQuery

QueryFollowers queries the followers edge of the JiangHuRen.

func (*JiangHuRen) QueryFollowing

func (jhr *JiangHuRen) QueryFollowing() *JiangHuRenQuery

QueryFollowing queries the following edge of the JiangHuRen.

func (*JiangHuRen) QueryFriends

func (jhr *JiangHuRen) QueryFriends() *JiangHuRenQuery

QueryFriends queries the friends edge of the JiangHuRen.

func (*JiangHuRen) QueryMaster

func (jhr *JiangHuRen) QueryMaster() *JiangHuRenQuery

QueryMaster queries the master edge of the JiangHuRen.

func (*JiangHuRen) QueryMenpai

func (jhr *JiangHuRen) QueryMenpai() *MenPaiQuery

QueryMenpai queries the menpai edge of the JiangHuRen.

func (*JiangHuRen) QuerySpouse

func (jhr *JiangHuRen) QuerySpouse() *JiangHuRenQuery

QuerySpouse queries the spouse edge of the JiangHuRen.

func (*JiangHuRen) QueryWeapon

func (jhr *JiangHuRen) QueryWeapon() *WeaponQuery

QueryWeapon queries the weapon edge of the JiangHuRen.

func (*JiangHuRen) String

func (jhr *JiangHuRen) String() string

String implements the fmt.Stringer.

func (*JiangHuRen) Unwrap

func (jhr *JiangHuRen) Unwrap() *JiangHuRen

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

func (*JiangHuRen) Update

func (jhr *JiangHuRen) Update() *JiangHuRenUpdateOne

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

type JiangHuRenClient

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

JiangHuRenClient is a client for the JiangHuRen schema.

func NewJiangHuRenClient

func NewJiangHuRenClient(c config) *JiangHuRenClient

NewJiangHuRenClient returns a client for the JiangHuRen from the given config.

func (*JiangHuRenClient) Create

func (c *JiangHuRenClient) Create() *JiangHuRenCreate

Create returns a create builder for JiangHuRen.

func (*JiangHuRenClient) Delete

func (c *JiangHuRenClient) Delete() *JiangHuRenDelete

Delete returns a delete builder for JiangHuRen.

func (*JiangHuRenClient) DeleteOne

func (c *JiangHuRenClient) DeleteOne(jhr *JiangHuRen) *JiangHuRenDeleteOne

DeleteOne returns a delete builder for the given entity.

func (*JiangHuRenClient) DeleteOneID

func (c *JiangHuRenClient) DeleteOneID(id int) *JiangHuRenDeleteOne

DeleteOneID returns a delete builder for the given id.

func (*JiangHuRenClient) Get

func (c *JiangHuRenClient) Get(ctx context.Context, id int) (*JiangHuRen, error)

Get returns a JiangHuRen entity by its id.

func (*JiangHuRenClient) GetX

func (c *JiangHuRenClient) GetX(ctx context.Context, id int) *JiangHuRen

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

func (*JiangHuRenClient) Hooks

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

Hooks returns the client hooks.

func (*JiangHuRenClient) Query

func (c *JiangHuRenClient) Query() *JiangHuRenQuery

Create returns a query builder for JiangHuRen.

func (*JiangHuRenClient) QueryApprentices

func (c *JiangHuRenClient) QueryApprentices(jhr *JiangHuRen) *JiangHuRenQuery

QueryApprentices queries the apprentices edge of a JiangHuRen.

func (*JiangHuRenClient) QueryFollowers

func (c *JiangHuRenClient) QueryFollowers(jhr *JiangHuRen) *JiangHuRenQuery

QueryFollowers queries the followers edge of a JiangHuRen.

func (*JiangHuRenClient) QueryFollowing

func (c *JiangHuRenClient) QueryFollowing(jhr *JiangHuRen) *JiangHuRenQuery

QueryFollowing queries the following edge of a JiangHuRen.

func (*JiangHuRenClient) QueryFriends

func (c *JiangHuRenClient) QueryFriends(jhr *JiangHuRen) *JiangHuRenQuery

QueryFriends queries the friends edge of a JiangHuRen.

func (*JiangHuRenClient) QueryMaster

func (c *JiangHuRenClient) QueryMaster(jhr *JiangHuRen) *JiangHuRenQuery

QueryMaster queries the master edge of a JiangHuRen.

func (*JiangHuRenClient) QueryMenpai

func (c *JiangHuRenClient) QueryMenpai(jhr *JiangHuRen) *MenPaiQuery

QueryMenpai queries the menpai edge of a JiangHuRen.

func (*JiangHuRenClient) QuerySpouse

func (c *JiangHuRenClient) QuerySpouse(jhr *JiangHuRen) *JiangHuRenQuery

QuerySpouse queries the spouse edge of a JiangHuRen.

func (*JiangHuRenClient) QueryWeapon

func (c *JiangHuRenClient) QueryWeapon(jhr *JiangHuRen) *WeaponQuery

QueryWeapon queries the weapon edge of a JiangHuRen.

func (*JiangHuRenClient) Update

func (c *JiangHuRenClient) Update() *JiangHuRenUpdate

Update returns an update builder for JiangHuRen.

func (*JiangHuRenClient) UpdateOne

func (c *JiangHuRenClient) UpdateOne(jhr *JiangHuRen) *JiangHuRenUpdateOne

UpdateOne returns an update builder for the given entity.

func (*JiangHuRenClient) UpdateOneID

func (c *JiangHuRenClient) UpdateOneID(id int) *JiangHuRenUpdateOne

UpdateOneID returns an update builder for the given id.

func (*JiangHuRenClient) Use

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

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

type JiangHuRenCreate

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

JiangHuRenCreate is the builder for creating a JiangHuRen entity.

func (*JiangHuRenCreate) AddApprenticeIDs

func (jhrc *JiangHuRenCreate) AddApprenticeIDs(ids ...int) *JiangHuRenCreate

AddApprenticeIDs adds the apprentices edge to JiangHuRen by ids.

func (*JiangHuRenCreate) AddApprentices

func (jhrc *JiangHuRenCreate) AddApprentices(j ...*JiangHuRen) *JiangHuRenCreate

AddApprentices adds the apprentices edges to JiangHuRen.

func (*JiangHuRenCreate) AddFollowerIDs

func (jhrc *JiangHuRenCreate) AddFollowerIDs(ids ...int) *JiangHuRenCreate

AddFollowerIDs adds the followers edge to JiangHuRen by ids.

func (*JiangHuRenCreate) AddFollowers

func (jhrc *JiangHuRenCreate) AddFollowers(j ...*JiangHuRen) *JiangHuRenCreate

AddFollowers adds the followers edges to JiangHuRen.

func (*JiangHuRenCreate) AddFollowing

func (jhrc *JiangHuRenCreate) AddFollowing(j ...*JiangHuRen) *JiangHuRenCreate

AddFollowing adds the following edges to JiangHuRen.

func (*JiangHuRenCreate) AddFollowingIDs

func (jhrc *JiangHuRenCreate) AddFollowingIDs(ids ...int) *JiangHuRenCreate

AddFollowingIDs adds the following edge to JiangHuRen by ids.

func (*JiangHuRenCreate) AddFriendIDs

func (jhrc *JiangHuRenCreate) AddFriendIDs(ids ...int) *JiangHuRenCreate

AddFriendIDs adds the friends edge to JiangHuRen by ids.

func (*JiangHuRenCreate) AddFriends

func (jhrc *JiangHuRenCreate) AddFriends(j ...*JiangHuRen) *JiangHuRenCreate

AddFriends adds the friends edges to JiangHuRen.

func (*JiangHuRenCreate) Save

func (jhrc *JiangHuRenCreate) Save(ctx context.Context) (*JiangHuRen, error)

Save creates the JiangHuRen in the database.

func (*JiangHuRenCreate) SaveX

func (jhrc *JiangHuRenCreate) SaveX(ctx context.Context) *JiangHuRen

SaveX calls Save and panics if Save returns an error.

func (*JiangHuRenCreate) SetAge

func (jhrc *JiangHuRenCreate) SetAge(u uint) *JiangHuRenCreate

SetAge sets the age field.

func (*JiangHuRenCreate) SetCreatedAt

func (jhrc *JiangHuRenCreate) SetCreatedAt(t time.Time) *JiangHuRenCreate

SetCreatedAt sets the created_at field.

func (*JiangHuRenCreate) SetMaster

func (jhrc *JiangHuRenCreate) SetMaster(j *JiangHuRen) *JiangHuRenCreate

SetMaster sets the master edge to JiangHuRen.

func (*JiangHuRenCreate) SetMasterID

func (jhrc *JiangHuRenCreate) SetMasterID(id int) *JiangHuRenCreate

SetMasterID sets the master edge to JiangHuRen by id.

func (*JiangHuRenCreate) SetMenpai

func (jhrc *JiangHuRenCreate) SetMenpai(m *MenPai) *JiangHuRenCreate

SetMenpai sets the menpai edge to MenPai.

func (*JiangHuRenCreate) SetMenpaiID

func (jhrc *JiangHuRenCreate) SetMenpaiID(id int) *JiangHuRenCreate

SetMenpaiID sets the menpai edge to MenPai by id.

func (*JiangHuRenCreate) SetName

func (jhrc *JiangHuRenCreate) SetName(s string) *JiangHuRenCreate

SetName sets the name field.

func (*JiangHuRenCreate) SetNillableCreatedAt

func (jhrc *JiangHuRenCreate) SetNillableCreatedAt(t *time.Time) *JiangHuRenCreate

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

func (*JiangHuRenCreate) SetNillableMasterID

func (jhrc *JiangHuRenCreate) SetNillableMasterID(id *int) *JiangHuRenCreate

SetNillableMasterID sets the master edge to JiangHuRen by id if the given value is not nil.

func (*JiangHuRenCreate) SetNillableMenpaiID

func (jhrc *JiangHuRenCreate) SetNillableMenpaiID(id *int) *JiangHuRenCreate

SetNillableMenpaiID sets the menpai edge to MenPai by id if the given value is not nil.

func (*JiangHuRenCreate) SetNillableSpouseID

func (jhrc *JiangHuRenCreate) SetNillableSpouseID(id *int) *JiangHuRenCreate

SetNillableSpouseID sets the spouse edge to JiangHuRen by id if the given value is not nil.

func (*JiangHuRenCreate) SetNillableUpdatedAt

func (jhrc *JiangHuRenCreate) SetNillableUpdatedAt(t *time.Time) *JiangHuRenCreate

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

func (*JiangHuRenCreate) SetNillableWeaponID

func (jhrc *JiangHuRenCreate) SetNillableWeaponID(id *int) *JiangHuRenCreate

SetNillableWeaponID sets the weapon edge to Weapon by id if the given value is not nil.

func (*JiangHuRenCreate) SetSex

func (jhrc *JiangHuRenCreate) SetSex(b bool) *JiangHuRenCreate

SetSex sets the sex field.

func (*JiangHuRenCreate) SetSpouse

func (jhrc *JiangHuRenCreate) SetSpouse(j *JiangHuRen) *JiangHuRenCreate

SetSpouse sets the spouse edge to JiangHuRen.

func (*JiangHuRenCreate) SetSpouseID

func (jhrc *JiangHuRenCreate) SetSpouseID(id int) *JiangHuRenCreate

SetSpouseID sets the spouse edge to JiangHuRen by id.

func (*JiangHuRenCreate) SetUpdatedAt

func (jhrc *JiangHuRenCreate) SetUpdatedAt(t time.Time) *JiangHuRenCreate

SetUpdatedAt sets the updated_at field.

func (*JiangHuRenCreate) SetWeapon

func (jhrc *JiangHuRenCreate) SetWeapon(w *Weapon) *JiangHuRenCreate

SetWeapon sets the weapon edge to Weapon.

func (*JiangHuRenCreate) SetWeaponID

func (jhrc *JiangHuRenCreate) SetWeaponID(id int) *JiangHuRenCreate

SetWeaponID sets the weapon edge to Weapon by id.

type JiangHuRenDelete

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

JiangHuRenDelete is the builder for deleting a JiangHuRen entity.

func (*JiangHuRenDelete) Exec

func (jhrd *JiangHuRenDelete) Exec(ctx context.Context) (int, error)

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

func (*JiangHuRenDelete) ExecX

func (jhrd *JiangHuRenDelete) ExecX(ctx context.Context) int

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

func (*JiangHuRenDelete) Where

Where adds a new predicate to the delete builder.

type JiangHuRenDeleteOne

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

JiangHuRenDeleteOne is the builder for deleting a single JiangHuRen entity.

func (*JiangHuRenDeleteOne) Exec

func (jhrdo *JiangHuRenDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*JiangHuRenDeleteOne) ExecX

func (jhrdo *JiangHuRenDeleteOne) ExecX(ctx context.Context)

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

type JiangHuRenEdges

type JiangHuRenEdges struct {
	// Weapon holds the value of the weapon edge.
	Weapon *Weapon
	// Menpai holds the value of the menpai edge.
	Menpai *MenPai
	// Spouse holds the value of the spouse edge.
	Spouse *JiangHuRen
	// Master holds the value of the master edge.
	Master *JiangHuRen
	// Apprentices holds the value of the apprentices edge.
	Apprentices []*JiangHuRen
	// Followers holds the value of the followers edge.
	Followers []*JiangHuRen
	// Following holds the value of the following edge.
	Following []*JiangHuRen
	// Friends holds the value of the friends edge.
	Friends []*JiangHuRen
	// contains filtered or unexported fields
}

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

func (JiangHuRenEdges) ApprenticesOrErr

func (e JiangHuRenEdges) ApprenticesOrErr() ([]*JiangHuRen, error)

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

func (JiangHuRenEdges) FollowersOrErr

func (e JiangHuRenEdges) FollowersOrErr() ([]*JiangHuRen, error)

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

func (JiangHuRenEdges) FollowingOrErr

func (e JiangHuRenEdges) FollowingOrErr() ([]*JiangHuRen, error)

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

func (JiangHuRenEdges) FriendsOrErr

func (e JiangHuRenEdges) FriendsOrErr() ([]*JiangHuRen, error)

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

func (JiangHuRenEdges) MasterOrErr

func (e JiangHuRenEdges) MasterOrErr() (*JiangHuRen, error)

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

func (JiangHuRenEdges) MenpaiOrErr

func (e JiangHuRenEdges) MenpaiOrErr() (*MenPai, error)

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

func (JiangHuRenEdges) SpouseOrErr

func (e JiangHuRenEdges) SpouseOrErr() (*JiangHuRen, error)

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

func (JiangHuRenEdges) WeaponOrErr

func (e JiangHuRenEdges) WeaponOrErr() (*Weapon, error)

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

type JiangHuRenGroupBy

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

JiangHuRenGroupBy is the builder for group-by JiangHuRen entities.

func (*JiangHuRenGroupBy) Aggregate

func (jhrgb *JiangHuRenGroupBy) Aggregate(fns ...Aggregate) *JiangHuRenGroupBy

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

func (*JiangHuRenGroupBy) Bools

func (jhrgb *JiangHuRenGroupBy) Bools(ctx context.Context) ([]bool, error)

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

func (*JiangHuRenGroupBy) BoolsX

func (jhrgb *JiangHuRenGroupBy) BoolsX(ctx context.Context) []bool

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

func (*JiangHuRenGroupBy) Float64s

func (jhrgb *JiangHuRenGroupBy) Float64s(ctx context.Context) ([]float64, error)

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

func (*JiangHuRenGroupBy) Float64sX

func (jhrgb *JiangHuRenGroupBy) Float64sX(ctx context.Context) []float64

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

func (*JiangHuRenGroupBy) Ints

func (jhrgb *JiangHuRenGroupBy) Ints(ctx context.Context) ([]int, error)

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

func (*JiangHuRenGroupBy) IntsX

func (jhrgb *JiangHuRenGroupBy) IntsX(ctx context.Context) []int

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

func (*JiangHuRenGroupBy) Scan

func (jhrgb *JiangHuRenGroupBy) Scan(ctx context.Context, v interface{}) error

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

func (*JiangHuRenGroupBy) ScanX

func (jhrgb *JiangHuRenGroupBy) ScanX(ctx context.Context, v interface{})

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

func (*JiangHuRenGroupBy) Strings

func (jhrgb *JiangHuRenGroupBy) Strings(ctx context.Context) ([]string, error)

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

func (*JiangHuRenGroupBy) StringsX

func (jhrgb *JiangHuRenGroupBy) StringsX(ctx context.Context) []string

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

type JiangHuRenMutation

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

JiangHuRenMutation represents an operation that mutate the JiangHuRens nodes in the graph.

func (*JiangHuRenMutation) AddAge

func (m *JiangHuRenMutation) AddAge(u uint)

AddAge adds u to age.

func (*JiangHuRenMutation) AddApprenticeIDs

func (m *JiangHuRenMutation) AddApprenticeIDs(ids ...int)

AddApprenticeIDs adds the apprentices edge to JiangHuRen by ids.

func (*JiangHuRenMutation) AddField

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

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

func (*JiangHuRenMutation) AddFollowerIDs

func (m *JiangHuRenMutation) AddFollowerIDs(ids ...int)

AddFollowerIDs adds the followers edge to JiangHuRen by ids.

func (*JiangHuRenMutation) AddFollowingIDs

func (m *JiangHuRenMutation) AddFollowingIDs(ids ...int)

AddFollowingIDs adds the following edge to JiangHuRen by ids.

func (*JiangHuRenMutation) AddFriendIDs

func (m *JiangHuRenMutation) AddFriendIDs(ids ...int)

AddFriendIDs adds the friends edge to JiangHuRen by ids.

func (*JiangHuRenMutation) AddedAge

func (m *JiangHuRenMutation) AddedAge() (r uint, exists bool)

AddedAge returns the value that was added to the age field in this mutation.

func (*JiangHuRenMutation) AddedEdges

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

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

func (*JiangHuRenMutation) AddedField

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

AddedField returns the numeric value that was in/decremented from a field with the given name. The second value indicates that this field was not set, or was not define in the schema.

func (*JiangHuRenMutation) AddedFields

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

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

func (*JiangHuRenMutation) AddedIDs

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

AddedIDs returns all ids (to other nodes) that were added for the given edge name.

func (*JiangHuRenMutation) Age

func (m *JiangHuRenMutation) Age() (r uint, exists bool)

Age returns the age value in the mutation.

func (*JiangHuRenMutation) ApprenticesIDs

func (m *JiangHuRenMutation) ApprenticesIDs() (ids []int)

ApprenticesIDs returns the apprentices ids in the mutation.

func (*JiangHuRenMutation) ClearEdge

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

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

func (*JiangHuRenMutation) ClearField

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

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

func (*JiangHuRenMutation) ClearMaster

func (m *JiangHuRenMutation) ClearMaster()

ClearMaster clears the master edge to JiangHuRen.

func (*JiangHuRenMutation) ClearMenpai

func (m *JiangHuRenMutation) ClearMenpai()

ClearMenpai clears the menpai edge to MenPai.

func (*JiangHuRenMutation) ClearSpouse

func (m *JiangHuRenMutation) ClearSpouse()

ClearSpouse clears the spouse edge to JiangHuRen.

func (*JiangHuRenMutation) ClearWeapon

func (m *JiangHuRenMutation) ClearWeapon()

ClearWeapon clears the weapon edge to Weapon.

func (*JiangHuRenMutation) ClearedEdges

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

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

func (*JiangHuRenMutation) ClearedFields

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

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

func (JiangHuRenMutation) Client

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

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

CreatedAt returns the created_at value in the mutation.

func (*JiangHuRenMutation) EdgeCleared

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

EdgeCleared returns a boolean indicates if this edge was cleared in this mutation.

func (*JiangHuRenMutation) Field

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

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

func (*JiangHuRenMutation) FieldCleared

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

FieldCleared returns a boolean indicates if this field was cleared in this mutation.

func (*JiangHuRenMutation) Fields

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

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

func (*JiangHuRenMutation) FollowersIDs

func (m *JiangHuRenMutation) FollowersIDs() (ids []int)

FollowersIDs returns the followers ids in the mutation.

func (*JiangHuRenMutation) FollowingIDs

func (m *JiangHuRenMutation) FollowingIDs() (ids []int)

FollowingIDs returns the following ids in the mutation.

func (*JiangHuRenMutation) FriendsIDs

func (m *JiangHuRenMutation) FriendsIDs() (ids []int)

FriendsIDs returns the friends ids in the mutation.

func (*JiangHuRenMutation) ID

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

ID returns the id value in the mutation. Note that, the id is available only if it was provided to the builder.

func (*JiangHuRenMutation) MasterCleared

func (m *JiangHuRenMutation) MasterCleared() bool

MasterCleared returns if the edge master was cleared.

func (*JiangHuRenMutation) MasterID

func (m *JiangHuRenMutation) MasterID() (id int, exists bool)

MasterID returns the master id in the mutation.

func (*JiangHuRenMutation) MasterIDs

func (m *JiangHuRenMutation) MasterIDs() (ids []int)

MasterIDs returns the master ids in the mutation. Note that ids always returns len(ids) <= 1 for unique edges, and you should use MasterID instead. It exists only for internal usage by the builders.

func (*JiangHuRenMutation) MenpaiCleared

func (m *JiangHuRenMutation) MenpaiCleared() bool

MenpaiCleared returns if the edge menpai was cleared.

func (*JiangHuRenMutation) MenpaiID

func (m *JiangHuRenMutation) MenpaiID() (id int, exists bool)

MenpaiID returns the menpai id in the mutation.

func (*JiangHuRenMutation) MenpaiIDs

func (m *JiangHuRenMutation) MenpaiIDs() (ids []int)

MenpaiIDs returns the menpai ids in the mutation. Note that ids always returns len(ids) <= 1 for unique edges, and you should use MenpaiID instead. It exists only for internal usage by the builders.

func (*JiangHuRenMutation) Name

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

Name returns the name value in the mutation.

func (*JiangHuRenMutation) Op

func (m *JiangHuRenMutation) Op() Op

Op returns the operation name.

func (*JiangHuRenMutation) RemoveApprenticeIDs

func (m *JiangHuRenMutation) RemoveApprenticeIDs(ids ...int)

RemoveApprenticeIDs removes the apprentices edge to JiangHuRen by ids.

func (*JiangHuRenMutation) RemoveFollowerIDs

func (m *JiangHuRenMutation) RemoveFollowerIDs(ids ...int)

RemoveFollowerIDs removes the followers edge to JiangHuRen by ids.

func (*JiangHuRenMutation) RemoveFollowingIDs

func (m *JiangHuRenMutation) RemoveFollowingIDs(ids ...int)

RemoveFollowingIDs removes the following edge to JiangHuRen by ids.

func (*JiangHuRenMutation) RemoveFriendIDs

func (m *JiangHuRenMutation) RemoveFriendIDs(ids ...int)

RemoveFriendIDs removes the friends edge to JiangHuRen by ids.

func (*JiangHuRenMutation) RemovedApprenticesIDs

func (m *JiangHuRenMutation) RemovedApprenticesIDs() (ids []int)

RemovedApprentices returns the removed ids of apprentices.

func (*JiangHuRenMutation) RemovedEdges

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

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

func (*JiangHuRenMutation) RemovedFollowersIDs

func (m *JiangHuRenMutation) RemovedFollowersIDs() (ids []int)

RemovedFollowers returns the removed ids of followers.

func (*JiangHuRenMutation) RemovedFollowingIDs

func (m *JiangHuRenMutation) RemovedFollowingIDs() (ids []int)

RemovedFollowing returns the removed ids of following.

func (*JiangHuRenMutation) RemovedFriendsIDs

func (m *JiangHuRenMutation) RemovedFriendsIDs() (ids []int)

RemovedFriends returns the removed ids of friends.

func (*JiangHuRenMutation) RemovedIDs

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

RemovedIDs returns all ids (to other nodes) that were removed for the given edge name.

func (*JiangHuRenMutation) ResetAge

func (m *JiangHuRenMutation) ResetAge()

ResetAge reset all changes of the age field.

func (*JiangHuRenMutation) ResetApprentices

func (m *JiangHuRenMutation) ResetApprentices()

ResetApprentices reset all changes of the apprentices edge.

func (*JiangHuRenMutation) ResetCreatedAt

func (m *JiangHuRenMutation) ResetCreatedAt()

ResetCreatedAt reset all changes of the created_at field.

func (*JiangHuRenMutation) ResetEdge

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

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

func (*JiangHuRenMutation) ResetField

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

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

func (*JiangHuRenMutation) ResetFollowers

func (m *JiangHuRenMutation) ResetFollowers()

ResetFollowers reset all changes of the followers edge.

func (*JiangHuRenMutation) ResetFollowing

func (m *JiangHuRenMutation) ResetFollowing()

ResetFollowing reset all changes of the following edge.

func (*JiangHuRenMutation) ResetFriends

func (m *JiangHuRenMutation) ResetFriends()

ResetFriends reset all changes of the friends edge.

func (*JiangHuRenMutation) ResetMaster

func (m *JiangHuRenMutation) ResetMaster()

ResetMaster reset all changes of the master edge.

func (*JiangHuRenMutation) ResetMenpai

func (m *JiangHuRenMutation) ResetMenpai()

ResetMenpai reset all changes of the menpai edge.

func (*JiangHuRenMutation) ResetName

func (m *JiangHuRenMutation) ResetName()

ResetName reset all changes of the name field.

func (*JiangHuRenMutation) ResetSex

func (m *JiangHuRenMutation) ResetSex()

ResetSex reset all changes of the sex field.

func (*JiangHuRenMutation) ResetSpouse

func (m *JiangHuRenMutation) ResetSpouse()

ResetSpouse reset all changes of the spouse edge.

func (*JiangHuRenMutation) ResetUpdatedAt

func (m *JiangHuRenMutation) ResetUpdatedAt()

ResetUpdatedAt reset all changes of the updated_at field.

func (*JiangHuRenMutation) ResetWeapon

func (m *JiangHuRenMutation) ResetWeapon()

ResetWeapon reset all changes of the weapon edge.

func (*JiangHuRenMutation) SetAge

func (m *JiangHuRenMutation) SetAge(u uint)

SetAge sets the age field.

func (*JiangHuRenMutation) SetCreatedAt

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

SetCreatedAt sets the created_at field.

func (*JiangHuRenMutation) SetField

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

SetField sets the value for the given name. It returns an error if the field is not defined in the schema, or if the type mismatch the field type.

func (*JiangHuRenMutation) SetMasterID

func (m *JiangHuRenMutation) SetMasterID(id int)

SetMasterID sets the master edge to JiangHuRen by id.

func (*JiangHuRenMutation) SetMenpaiID

func (m *JiangHuRenMutation) SetMenpaiID(id int)

SetMenpaiID sets the menpai edge to MenPai by id.

func (*JiangHuRenMutation) SetName

func (m *JiangHuRenMutation) SetName(s string)

SetName sets the name field.

func (*JiangHuRenMutation) SetSex

func (m *JiangHuRenMutation) SetSex(b bool)

SetSex sets the sex field.

func (*JiangHuRenMutation) SetSpouseID

func (m *JiangHuRenMutation) SetSpouseID(id int)

SetSpouseID sets the spouse edge to JiangHuRen by id.

func (*JiangHuRenMutation) SetUpdatedAt

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

SetUpdatedAt sets the updated_at field.

func (*JiangHuRenMutation) SetWeaponID

func (m *JiangHuRenMutation) SetWeaponID(id int)

SetWeaponID sets the weapon edge to Weapon by id.

func (*JiangHuRenMutation) Sex

func (m *JiangHuRenMutation) Sex() (r bool, exists bool)

Sex returns the sex value in the mutation.

func (*JiangHuRenMutation) SpouseCleared

func (m *JiangHuRenMutation) SpouseCleared() bool

SpouseCleared returns if the edge spouse was cleared.

func (*JiangHuRenMutation) SpouseID

func (m *JiangHuRenMutation) SpouseID() (id int, exists bool)

SpouseID returns the spouse id in the mutation.

func (*JiangHuRenMutation) SpouseIDs

func (m *JiangHuRenMutation) SpouseIDs() (ids []int)

SpouseIDs returns the spouse ids in the mutation. Note that ids always returns len(ids) <= 1 for unique edges, and you should use SpouseID instead. It exists only for internal usage by the builders.

func (JiangHuRenMutation) Tx

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

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

func (*JiangHuRenMutation) Type

func (m *JiangHuRenMutation) Type() string

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

func (*JiangHuRenMutation) UpdatedAt

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

UpdatedAt returns the updated_at value in the mutation.

func (*JiangHuRenMutation) WeaponCleared

func (m *JiangHuRenMutation) WeaponCleared() bool

WeaponCleared returns if the edge weapon was cleared.

func (*JiangHuRenMutation) WeaponID

func (m *JiangHuRenMutation) WeaponID() (id int, exists bool)

WeaponID returns the weapon id in the mutation.

func (*JiangHuRenMutation) WeaponIDs

func (m *JiangHuRenMutation) WeaponIDs() (ids []int)

WeaponIDs returns the weapon ids in the mutation. Note that ids always returns len(ids) <= 1 for unique edges, and you should use WeaponID instead. It exists only for internal usage by the builders.

type JiangHuRenQuery

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

JiangHuRenQuery is the builder for querying JiangHuRen entities.

func (*JiangHuRenQuery) All

func (jhrq *JiangHuRenQuery) All(ctx context.Context) ([]*JiangHuRen, error)

All executes the query and returns a list of JiangHuRens.

func (*JiangHuRenQuery) AllX

func (jhrq *JiangHuRenQuery) AllX(ctx context.Context) []*JiangHuRen

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

func (*JiangHuRenQuery) Clone

func (jhrq *JiangHuRenQuery) Clone() *JiangHuRenQuery

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

func (*JiangHuRenQuery) Count

func (jhrq *JiangHuRenQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*JiangHuRenQuery) CountX

func (jhrq *JiangHuRenQuery) CountX(ctx context.Context) int

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

func (*JiangHuRenQuery) Exist

func (jhrq *JiangHuRenQuery) Exist(ctx context.Context) (bool, error)

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

func (*JiangHuRenQuery) ExistX

func (jhrq *JiangHuRenQuery) ExistX(ctx context.Context) bool

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

func (*JiangHuRenQuery) First

func (jhrq *JiangHuRenQuery) First(ctx context.Context) (*JiangHuRen, error)

First returns the first JiangHuRen entity in the query. Returns *NotFoundError when no jianghuren was found.

func (*JiangHuRenQuery) FirstID

func (jhrq *JiangHuRenQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first JiangHuRen id in the query. Returns *NotFoundError when no id was found.

func (*JiangHuRenQuery) FirstX

func (jhrq *JiangHuRenQuery) FirstX(ctx context.Context) *JiangHuRen

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

func (*JiangHuRenQuery) FirstXID

func (jhrq *JiangHuRenQuery) FirstXID(ctx context.Context) int

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

func (*JiangHuRenQuery) GroupBy

func (jhrq *JiangHuRenQuery) GroupBy(field string, fields ...string) *JiangHuRenGroupBy

GroupBy 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 {
	CreatedAt time.Time `json:"created_at,omitempty"`
	Count int `json:"count,omitempty"`
}

client.JiangHuRen.Query().
	GroupBy(jianghuren.FieldCreatedAt).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*JiangHuRenQuery) IDs

func (jhrq *JiangHuRenQuery) IDs(ctx context.Context) ([]int, error)

IDs executes the query and returns a list of JiangHuRen ids.

func (*JiangHuRenQuery) IDsX

func (jhrq *JiangHuRenQuery) IDsX(ctx context.Context) []int

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

func (*JiangHuRenQuery) Limit

func (jhrq *JiangHuRenQuery) Limit(limit int) *JiangHuRenQuery

Limit adds a limit step to the query.

func (*JiangHuRenQuery) Offset

func (jhrq *JiangHuRenQuery) Offset(offset int) *JiangHuRenQuery

Offset adds an offset step to the query.

func (*JiangHuRenQuery) Only

func (jhrq *JiangHuRenQuery) Only(ctx context.Context) (*JiangHuRen, error)

Only returns the only JiangHuRen entity in the query, returns an error if not exactly one entity was returned.

func (*JiangHuRenQuery) OnlyID

func (jhrq *JiangHuRenQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID returns the only JiangHuRen id in the query, returns an error if not exactly one id was returned.

func (*JiangHuRenQuery) OnlyX

func (jhrq *JiangHuRenQuery) OnlyX(ctx context.Context) *JiangHuRen

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

func (*JiangHuRenQuery) OnlyXID

func (jhrq *JiangHuRenQuery) OnlyXID(ctx context.Context) int

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

func (*JiangHuRenQuery) Order

func (jhrq *JiangHuRenQuery) Order(o ...Order) *JiangHuRenQuery

Order adds an order step to the query.

func (*JiangHuRenQuery) QueryApprentices

func (jhrq *JiangHuRenQuery) QueryApprentices() *JiangHuRenQuery

QueryApprentices chains the current query on the apprentices edge.

func (*JiangHuRenQuery) QueryFollowers

func (jhrq *JiangHuRenQuery) QueryFollowers() *JiangHuRenQuery

QueryFollowers chains the current query on the followers edge.

func (*JiangHuRenQuery) QueryFollowing

func (jhrq *JiangHuRenQuery) QueryFollowing() *JiangHuRenQuery

QueryFollowing chains the current query on the following edge.

func (*JiangHuRenQuery) QueryFriends

func (jhrq *JiangHuRenQuery) QueryFriends() *JiangHuRenQuery

QueryFriends chains the current query on the friends edge.

func (*JiangHuRenQuery) QueryMaster

func (jhrq *JiangHuRenQuery) QueryMaster() *JiangHuRenQuery

QueryMaster chains the current query on the master edge.

func (*JiangHuRenQuery) QueryMenpai

func (jhrq *JiangHuRenQuery) QueryMenpai() *MenPaiQuery

QueryMenpai chains the current query on the menpai edge.

func (*JiangHuRenQuery) QuerySpouse

func (jhrq *JiangHuRenQuery) QuerySpouse() *JiangHuRenQuery

QuerySpouse chains the current query on the spouse edge.

func (*JiangHuRenQuery) QueryWeapon

func (jhrq *JiangHuRenQuery) QueryWeapon() *WeaponQuery

QueryWeapon chains the current query on the weapon edge.

func (*JiangHuRenQuery) Select

func (jhrq *JiangHuRenQuery) Select(field string, fields ...string) *JiangHuRenSelect

Select one or more fields from the given query.

Example:

var v []struct {
	CreatedAt time.Time `json:"created_at,omitempty"`
}

client.JiangHuRen.Query().
	Select(jianghuren.FieldCreatedAt).
	Scan(ctx, &v)

func (*JiangHuRenQuery) Where

Where adds a new predicate for the builder.

func (*JiangHuRenQuery) WithApprentices

func (jhrq *JiangHuRenQuery) WithApprentices(opts ...func(*JiangHuRenQuery)) *JiangHuRenQuery
WithApprentices tells the query-builder to eager-loads the nodes that are connected to

the "apprentices" edge. The optional arguments used to configure the query builder of the edge.

func (*JiangHuRenQuery) WithFollowers

func (jhrq *JiangHuRenQuery) WithFollowers(opts ...func(*JiangHuRenQuery)) *JiangHuRenQuery
WithFollowers tells the query-builder to eager-loads the nodes that are connected to

the "followers" edge. The optional arguments used to configure the query builder of the edge.

func (*JiangHuRenQuery) WithFollowing

func (jhrq *JiangHuRenQuery) WithFollowing(opts ...func(*JiangHuRenQuery)) *JiangHuRenQuery
WithFollowing tells the query-builder to eager-loads the nodes that are connected to

the "following" edge. The optional arguments used to configure the query builder of the edge.

func (*JiangHuRenQuery) WithFriends

func (jhrq *JiangHuRenQuery) WithFriends(opts ...func(*JiangHuRenQuery)) *JiangHuRenQuery
WithFriends tells the query-builder to eager-loads the nodes that are connected to

the "friends" edge. The optional arguments used to configure the query builder of the edge.

func (*JiangHuRenQuery) WithMaster

func (jhrq *JiangHuRenQuery) WithMaster(opts ...func(*JiangHuRenQuery)) *JiangHuRenQuery
WithMaster tells the query-builder to eager-loads the nodes that are connected to

the "master" edge. The optional arguments used to configure the query builder of the edge.

func (*JiangHuRenQuery) WithMenpai

func (jhrq *JiangHuRenQuery) WithMenpai(opts ...func(*MenPaiQuery)) *JiangHuRenQuery
WithMenpai tells the query-builder to eager-loads the nodes that are connected to

the "menpai" edge. The optional arguments used to configure the query builder of the edge.

func (*JiangHuRenQuery) WithSpouse

func (jhrq *JiangHuRenQuery) WithSpouse(opts ...func(*JiangHuRenQuery)) *JiangHuRenQuery
WithSpouse tells the query-builder to eager-loads the nodes that are connected to

the "spouse" edge. The optional arguments used to configure the query builder of the edge.

func (*JiangHuRenQuery) WithWeapon

func (jhrq *JiangHuRenQuery) WithWeapon(opts ...func(*WeaponQuery)) *JiangHuRenQuery
WithWeapon tells the query-builder to eager-loads the nodes that are connected to

the "weapon" edge. The optional arguments used to configure the query builder of the edge.

type JiangHuRenSelect

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

JiangHuRenSelect is the builder for select fields of JiangHuRen entities.

func (*JiangHuRenSelect) Bools

func (jhrs *JiangHuRenSelect) Bools(ctx context.Context) ([]bool, error)

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

func (*JiangHuRenSelect) BoolsX

func (jhrs *JiangHuRenSelect) BoolsX(ctx context.Context) []bool

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

func (*JiangHuRenSelect) Float64s

func (jhrs *JiangHuRenSelect) Float64s(ctx context.Context) ([]float64, error)

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

func (*JiangHuRenSelect) Float64sX

func (jhrs *JiangHuRenSelect) Float64sX(ctx context.Context) []float64

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

func (*JiangHuRenSelect) Ints

func (jhrs *JiangHuRenSelect) Ints(ctx context.Context) ([]int, error)

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

func (*JiangHuRenSelect) IntsX

func (jhrs *JiangHuRenSelect) IntsX(ctx context.Context) []int

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

func (*JiangHuRenSelect) Scan

func (jhrs *JiangHuRenSelect) Scan(ctx context.Context, v interface{}) error

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

func (*JiangHuRenSelect) ScanX

func (jhrs *JiangHuRenSelect) ScanX(ctx context.Context, v interface{})

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

func (*JiangHuRenSelect) Strings

func (jhrs *JiangHuRenSelect) Strings(ctx context.Context) ([]string, error)

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

func (*JiangHuRenSelect) StringsX

func (jhrs *JiangHuRenSelect) StringsX(ctx context.Context) []string

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

type JiangHuRenUpdate

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

JiangHuRenUpdate is the builder for updating JiangHuRen entities.

func (*JiangHuRenUpdate) AddAge

func (jhru *JiangHuRenUpdate) AddAge(u uint) *JiangHuRenUpdate

AddAge adds u to age.

func (*JiangHuRenUpdate) AddApprenticeIDs

func (jhru *JiangHuRenUpdate) AddApprenticeIDs(ids ...int) *JiangHuRenUpdate

AddApprenticeIDs adds the apprentices edge to JiangHuRen by ids.

func (*JiangHuRenUpdate) AddApprentices

func (jhru *JiangHuRenUpdate) AddApprentices(j ...*JiangHuRen) *JiangHuRenUpdate

AddApprentices adds the apprentices edges to JiangHuRen.

func (*JiangHuRenUpdate) AddFollowerIDs

func (jhru *JiangHuRenUpdate) AddFollowerIDs(ids ...int) *JiangHuRenUpdate

AddFollowerIDs adds the followers edge to JiangHuRen by ids.

func (*JiangHuRenUpdate) AddFollowers

func (jhru *JiangHuRenUpdate) AddFollowers(j ...*JiangHuRen) *JiangHuRenUpdate

AddFollowers adds the followers edges to JiangHuRen.

func (*JiangHuRenUpdate) AddFollowing

func (jhru *JiangHuRenUpdate) AddFollowing(j ...*JiangHuRen) *JiangHuRenUpdate

AddFollowing adds the following edges to JiangHuRen.

func (*JiangHuRenUpdate) AddFollowingIDs

func (jhru *JiangHuRenUpdate) AddFollowingIDs(ids ...int) *JiangHuRenUpdate

AddFollowingIDs adds the following edge to JiangHuRen by ids.

func (*JiangHuRenUpdate) AddFriendIDs

func (jhru *JiangHuRenUpdate) AddFriendIDs(ids ...int) *JiangHuRenUpdate

AddFriendIDs adds the friends edge to JiangHuRen by ids.

func (*JiangHuRenUpdate) AddFriends

func (jhru *JiangHuRenUpdate) AddFriends(j ...*JiangHuRen) *JiangHuRenUpdate

AddFriends adds the friends edges to JiangHuRen.

func (*JiangHuRenUpdate) ClearMaster

func (jhru *JiangHuRenUpdate) ClearMaster() *JiangHuRenUpdate

ClearMaster clears the master edge to JiangHuRen.

func (*JiangHuRenUpdate) ClearMenpai

func (jhru *JiangHuRenUpdate) ClearMenpai() *JiangHuRenUpdate

ClearMenpai clears the menpai edge to MenPai.

func (*JiangHuRenUpdate) ClearSpouse

func (jhru *JiangHuRenUpdate) ClearSpouse() *JiangHuRenUpdate

ClearSpouse clears the spouse edge to JiangHuRen.

func (*JiangHuRenUpdate) ClearWeapon

func (jhru *JiangHuRenUpdate) ClearWeapon() *JiangHuRenUpdate

ClearWeapon clears the weapon edge to Weapon.

func (*JiangHuRenUpdate) Exec

func (jhru *JiangHuRenUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*JiangHuRenUpdate) ExecX

func (jhru *JiangHuRenUpdate) ExecX(ctx context.Context)

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

func (*JiangHuRenUpdate) RemoveApprenticeIDs

func (jhru *JiangHuRenUpdate) RemoveApprenticeIDs(ids ...int) *JiangHuRenUpdate

RemoveApprenticeIDs removes the apprentices edge to JiangHuRen by ids.

func (*JiangHuRenUpdate) RemoveApprentices

func (jhru *JiangHuRenUpdate) RemoveApprentices(j ...*JiangHuRen) *JiangHuRenUpdate

RemoveApprentices removes apprentices edges to JiangHuRen.

func (*JiangHuRenUpdate) RemoveFollowerIDs

func (jhru *JiangHuRenUpdate) RemoveFollowerIDs(ids ...int) *JiangHuRenUpdate

RemoveFollowerIDs removes the followers edge to JiangHuRen by ids.

func (*JiangHuRenUpdate) RemoveFollowers

func (jhru *JiangHuRenUpdate) RemoveFollowers(j ...*JiangHuRen) *JiangHuRenUpdate

RemoveFollowers removes followers edges to JiangHuRen.

func (*JiangHuRenUpdate) RemoveFollowing

func (jhru *JiangHuRenUpdate) RemoveFollowing(j ...*JiangHuRen) *JiangHuRenUpdate

RemoveFollowing removes following edges to JiangHuRen.

func (*JiangHuRenUpdate) RemoveFollowingIDs

func (jhru *JiangHuRenUpdate) RemoveFollowingIDs(ids ...int) *JiangHuRenUpdate

RemoveFollowingIDs removes the following edge to JiangHuRen by ids.

func (*JiangHuRenUpdate) RemoveFriendIDs

func (jhru *JiangHuRenUpdate) RemoveFriendIDs(ids ...int) *JiangHuRenUpdate

RemoveFriendIDs removes the friends edge to JiangHuRen by ids.

func (*JiangHuRenUpdate) RemoveFriends

func (jhru *JiangHuRenUpdate) RemoveFriends(j ...*JiangHuRen) *JiangHuRenUpdate

RemoveFriends removes friends edges to JiangHuRen.

func (*JiangHuRenUpdate) Save

func (jhru *JiangHuRenUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of rows/vertices matched by this operation.

func (*JiangHuRenUpdate) SaveX

func (jhru *JiangHuRenUpdate) SaveX(ctx context.Context) int

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

func (*JiangHuRenUpdate) SetAge

func (jhru *JiangHuRenUpdate) SetAge(u uint) *JiangHuRenUpdate

SetAge sets the age field.

func (*JiangHuRenUpdate) SetMaster

func (jhru *JiangHuRenUpdate) SetMaster(j *JiangHuRen) *JiangHuRenUpdate

SetMaster sets the master edge to JiangHuRen.

func (*JiangHuRenUpdate) SetMasterID

func (jhru *JiangHuRenUpdate) SetMasterID(id int) *JiangHuRenUpdate

SetMasterID sets the master edge to JiangHuRen by id.

func (*JiangHuRenUpdate) SetMenpai

func (jhru *JiangHuRenUpdate) SetMenpai(m *MenPai) *JiangHuRenUpdate

SetMenpai sets the menpai edge to MenPai.

func (*JiangHuRenUpdate) SetMenpaiID

func (jhru *JiangHuRenUpdate) SetMenpaiID(id int) *JiangHuRenUpdate

SetMenpaiID sets the menpai edge to MenPai by id.

func (*JiangHuRenUpdate) SetName

func (jhru *JiangHuRenUpdate) SetName(s string) *JiangHuRenUpdate

SetName sets the name field.

func (*JiangHuRenUpdate) SetNillableMasterID

func (jhru *JiangHuRenUpdate) SetNillableMasterID(id *int) *JiangHuRenUpdate

SetNillableMasterID sets the master edge to JiangHuRen by id if the given value is not nil.

func (*JiangHuRenUpdate) SetNillableMenpaiID

func (jhru *JiangHuRenUpdate) SetNillableMenpaiID(id *int) *JiangHuRenUpdate

SetNillableMenpaiID sets the menpai edge to MenPai by id if the given value is not nil.

func (*JiangHuRenUpdate) SetNillableSpouseID

func (jhru *JiangHuRenUpdate) SetNillableSpouseID(id *int) *JiangHuRenUpdate

SetNillableSpouseID sets the spouse edge to JiangHuRen by id if the given value is not nil.

func (*JiangHuRenUpdate) SetNillableWeaponID

func (jhru *JiangHuRenUpdate) SetNillableWeaponID(id *int) *JiangHuRenUpdate

SetNillableWeaponID sets the weapon edge to Weapon by id if the given value is not nil.

func (*JiangHuRenUpdate) SetSex

func (jhru *JiangHuRenUpdate) SetSex(b bool) *JiangHuRenUpdate

SetSex sets the sex field.

func (*JiangHuRenUpdate) SetSpouse

func (jhru *JiangHuRenUpdate) SetSpouse(j *JiangHuRen) *JiangHuRenUpdate

SetSpouse sets the spouse edge to JiangHuRen.

func (*JiangHuRenUpdate) SetSpouseID

func (jhru *JiangHuRenUpdate) SetSpouseID(id int) *JiangHuRenUpdate

SetSpouseID sets the spouse edge to JiangHuRen by id.

func (*JiangHuRenUpdate) SetUpdatedAt

func (jhru *JiangHuRenUpdate) SetUpdatedAt(t time.Time) *JiangHuRenUpdate

SetUpdatedAt sets the updated_at field.

func (*JiangHuRenUpdate) SetWeapon

func (jhru *JiangHuRenUpdate) SetWeapon(w *Weapon) *JiangHuRenUpdate

SetWeapon sets the weapon edge to Weapon.

func (*JiangHuRenUpdate) SetWeaponID

func (jhru *JiangHuRenUpdate) SetWeaponID(id int) *JiangHuRenUpdate

SetWeaponID sets the weapon edge to Weapon by id.

func (*JiangHuRenUpdate) Where

Where adds a new predicate for the builder.

type JiangHuRenUpdateOne

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

JiangHuRenUpdateOne is the builder for updating a single JiangHuRen entity.

func (*JiangHuRenUpdateOne) AddAge

func (jhruo *JiangHuRenUpdateOne) AddAge(u uint) *JiangHuRenUpdateOne

AddAge adds u to age.

func (*JiangHuRenUpdateOne) AddApprenticeIDs

func (jhruo *JiangHuRenUpdateOne) AddApprenticeIDs(ids ...int) *JiangHuRenUpdateOne

AddApprenticeIDs adds the apprentices edge to JiangHuRen by ids.

func (*JiangHuRenUpdateOne) AddApprentices

func (jhruo *JiangHuRenUpdateOne) AddApprentices(j ...*JiangHuRen) *JiangHuRenUpdateOne

AddApprentices adds the apprentices edges to JiangHuRen.

func (*JiangHuRenUpdateOne) AddFollowerIDs

func (jhruo *JiangHuRenUpdateOne) AddFollowerIDs(ids ...int) *JiangHuRenUpdateOne

AddFollowerIDs adds the followers edge to JiangHuRen by ids.

func (*JiangHuRenUpdateOne) AddFollowers

func (jhruo *JiangHuRenUpdateOne) AddFollowers(j ...*JiangHuRen) *JiangHuRenUpdateOne

AddFollowers adds the followers edges to JiangHuRen.

func (*JiangHuRenUpdateOne) AddFollowing

func (jhruo *JiangHuRenUpdateOne) AddFollowing(j ...*JiangHuRen) *JiangHuRenUpdateOne

AddFollowing adds the following edges to JiangHuRen.

func (*JiangHuRenUpdateOne) AddFollowingIDs

func (jhruo *JiangHuRenUpdateOne) AddFollowingIDs(ids ...int) *JiangHuRenUpdateOne

AddFollowingIDs adds the following edge to JiangHuRen by ids.

func (*JiangHuRenUpdateOne) AddFriendIDs

func (jhruo *JiangHuRenUpdateOne) AddFriendIDs(ids ...int) *JiangHuRenUpdateOne

AddFriendIDs adds the friends edge to JiangHuRen by ids.

func (*JiangHuRenUpdateOne) AddFriends

func (jhruo *JiangHuRenUpdateOne) AddFriends(j ...*JiangHuRen) *JiangHuRenUpdateOne

AddFriends adds the friends edges to JiangHuRen.

func (*JiangHuRenUpdateOne) ClearMaster

func (jhruo *JiangHuRenUpdateOne) ClearMaster() *JiangHuRenUpdateOne

ClearMaster clears the master edge to JiangHuRen.

func (*JiangHuRenUpdateOne) ClearMenpai

func (jhruo *JiangHuRenUpdateOne) ClearMenpai() *JiangHuRenUpdateOne

ClearMenpai clears the menpai edge to MenPai.

func (*JiangHuRenUpdateOne) ClearSpouse

func (jhruo *JiangHuRenUpdateOne) ClearSpouse() *JiangHuRenUpdateOne

ClearSpouse clears the spouse edge to JiangHuRen.

func (*JiangHuRenUpdateOne) ClearWeapon

func (jhruo *JiangHuRenUpdateOne) ClearWeapon() *JiangHuRenUpdateOne

ClearWeapon clears the weapon edge to Weapon.

func (*JiangHuRenUpdateOne) Exec

func (jhruo *JiangHuRenUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*JiangHuRenUpdateOne) ExecX

func (jhruo *JiangHuRenUpdateOne) ExecX(ctx context.Context)

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

func (*JiangHuRenUpdateOne) RemoveApprenticeIDs

func (jhruo *JiangHuRenUpdateOne) RemoveApprenticeIDs(ids ...int) *JiangHuRenUpdateOne

RemoveApprenticeIDs removes the apprentices edge to JiangHuRen by ids.

func (*JiangHuRenUpdateOne) RemoveApprentices

func (jhruo *JiangHuRenUpdateOne) RemoveApprentices(j ...*JiangHuRen) *JiangHuRenUpdateOne

RemoveApprentices removes apprentices edges to JiangHuRen.

func (*JiangHuRenUpdateOne) RemoveFollowerIDs

func (jhruo *JiangHuRenUpdateOne) RemoveFollowerIDs(ids ...int) *JiangHuRenUpdateOne

RemoveFollowerIDs removes the followers edge to JiangHuRen by ids.

func (*JiangHuRenUpdateOne) RemoveFollowers

func (jhruo *JiangHuRenUpdateOne) RemoveFollowers(j ...*JiangHuRen) *JiangHuRenUpdateOne

RemoveFollowers removes followers edges to JiangHuRen.

func (*JiangHuRenUpdateOne) RemoveFollowing

func (jhruo *JiangHuRenUpdateOne) RemoveFollowing(j ...*JiangHuRen) *JiangHuRenUpdateOne

RemoveFollowing removes following edges to JiangHuRen.

func (*JiangHuRenUpdateOne) RemoveFollowingIDs

func (jhruo *JiangHuRenUpdateOne) RemoveFollowingIDs(ids ...int) *JiangHuRenUpdateOne

RemoveFollowingIDs removes the following edge to JiangHuRen by ids.

func (*JiangHuRenUpdateOne) RemoveFriendIDs

func (jhruo *JiangHuRenUpdateOne) RemoveFriendIDs(ids ...int) *JiangHuRenUpdateOne

RemoveFriendIDs removes the friends edge to JiangHuRen by ids.

func (*JiangHuRenUpdateOne) RemoveFriends

func (jhruo *JiangHuRenUpdateOne) RemoveFriends(j ...*JiangHuRen) *JiangHuRenUpdateOne

RemoveFriends removes friends edges to JiangHuRen.

func (*JiangHuRenUpdateOne) Save

func (jhruo *JiangHuRenUpdateOne) Save(ctx context.Context) (*JiangHuRen, error)

Save executes the query and returns the updated entity.

func (*JiangHuRenUpdateOne) SaveX

func (jhruo *JiangHuRenUpdateOne) SaveX(ctx context.Context) *JiangHuRen

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

func (*JiangHuRenUpdateOne) SetAge

func (jhruo *JiangHuRenUpdateOne) SetAge(u uint) *JiangHuRenUpdateOne

SetAge sets the age field.

func (*JiangHuRenUpdateOne) SetMaster

func (jhruo *JiangHuRenUpdateOne) SetMaster(j *JiangHuRen) *JiangHuRenUpdateOne

SetMaster sets the master edge to JiangHuRen.

func (*JiangHuRenUpdateOne) SetMasterID

func (jhruo *JiangHuRenUpdateOne) SetMasterID(id int) *JiangHuRenUpdateOne

SetMasterID sets the master edge to JiangHuRen by id.

func (*JiangHuRenUpdateOne) SetMenpai

func (jhruo *JiangHuRenUpdateOne) SetMenpai(m *MenPai) *JiangHuRenUpdateOne

SetMenpai sets the menpai edge to MenPai.

func (*JiangHuRenUpdateOne) SetMenpaiID

func (jhruo *JiangHuRenUpdateOne) SetMenpaiID(id int) *JiangHuRenUpdateOne

SetMenpaiID sets the menpai edge to MenPai by id.

func (*JiangHuRenUpdateOne) SetName

func (jhruo *JiangHuRenUpdateOne) SetName(s string) *JiangHuRenUpdateOne

SetName sets the name field.

func (*JiangHuRenUpdateOne) SetNillableMasterID

func (jhruo *JiangHuRenUpdateOne) SetNillableMasterID(id *int) *JiangHuRenUpdateOne

SetNillableMasterID sets the master edge to JiangHuRen by id if the given value is not nil.

func (*JiangHuRenUpdateOne) SetNillableMenpaiID

func (jhruo *JiangHuRenUpdateOne) SetNillableMenpaiID(id *int) *JiangHuRenUpdateOne

SetNillableMenpaiID sets the menpai edge to MenPai by id if the given value is not nil.

func (*JiangHuRenUpdateOne) SetNillableSpouseID

func (jhruo *JiangHuRenUpdateOne) SetNillableSpouseID(id *int) *JiangHuRenUpdateOne

SetNillableSpouseID sets the spouse edge to JiangHuRen by id if the given value is not nil.

func (*JiangHuRenUpdateOne) SetNillableWeaponID

func (jhruo *JiangHuRenUpdateOne) SetNillableWeaponID(id *int) *JiangHuRenUpdateOne

SetNillableWeaponID sets the weapon edge to Weapon by id if the given value is not nil.

func (*JiangHuRenUpdateOne) SetSex

func (jhruo *JiangHuRenUpdateOne) SetSex(b bool) *JiangHuRenUpdateOne

SetSex sets the sex field.

func (*JiangHuRenUpdateOne) SetSpouse

func (jhruo *JiangHuRenUpdateOne) SetSpouse(j *JiangHuRen) *JiangHuRenUpdateOne

SetSpouse sets the spouse edge to JiangHuRen.

func (*JiangHuRenUpdateOne) SetSpouseID

func (jhruo *JiangHuRenUpdateOne) SetSpouseID(id int) *JiangHuRenUpdateOne

SetSpouseID sets the spouse edge to JiangHuRen by id.

func (*JiangHuRenUpdateOne) SetUpdatedAt

func (jhruo *JiangHuRenUpdateOne) SetUpdatedAt(t time.Time) *JiangHuRenUpdateOne

SetUpdatedAt sets the updated_at field.

func (*JiangHuRenUpdateOne) SetWeapon

func (jhruo *JiangHuRenUpdateOne) SetWeapon(w *Weapon) *JiangHuRenUpdateOne

SetWeapon sets the weapon edge to Weapon.

func (*JiangHuRenUpdateOne) SetWeaponID

func (jhruo *JiangHuRenUpdateOne) SetWeaponID(id int) *JiangHuRenUpdateOne

SetWeaponID sets the weapon edge to Weapon by id.

type JiangHuRens

type JiangHuRens []*JiangHuRen

JiangHuRens is a parsable slice of JiangHuRen.

type MenPai

type MenPai struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// UpdatedAt holds the value of the "updated_at" field.
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// Name holds the value of the "name" field.
	Name string `json:"name,omitempty"`
	// Address holds the value of the "address" field.
	Address string `json:"address,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the MenPaiQuery when eager-loading is set.
	Edges MenPaiEdges `json:"edges"`
	// contains filtered or unexported fields
}

MenPai is the model entity for the MenPai schema.

func (*MenPai) QueryDisciples

func (mp *MenPai) QueryDisciples() *JiangHuRenQuery

QueryDisciples queries the disciples edge of the MenPai.

func (*MenPai) String

func (mp *MenPai) String() string

String implements the fmt.Stringer.

func (*MenPai) Unwrap

func (mp *MenPai) Unwrap() *MenPai

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

func (*MenPai) Update

func (mp *MenPai) Update() *MenPaiUpdateOne

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

type MenPaiClient

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

MenPaiClient is a client for the MenPai schema.

func NewMenPaiClient

func NewMenPaiClient(c config) *MenPaiClient

NewMenPaiClient returns a client for the MenPai from the given config.

func (*MenPaiClient) Create

func (c *MenPaiClient) Create() *MenPaiCreate

Create returns a create builder for MenPai.

func (*MenPaiClient) Delete

func (c *MenPaiClient) Delete() *MenPaiDelete

Delete returns a delete builder for MenPai.

func (*MenPaiClient) DeleteOne

func (c *MenPaiClient) DeleteOne(mp *MenPai) *MenPaiDeleteOne

DeleteOne returns a delete builder for the given entity.

func (*MenPaiClient) DeleteOneID

func (c *MenPaiClient) DeleteOneID(id int) *MenPaiDeleteOne

DeleteOneID returns a delete builder for the given id.

func (*MenPaiClient) Get

func (c *MenPaiClient) Get(ctx context.Context, id int) (*MenPai, error)

Get returns a MenPai entity by its id.

func (*MenPaiClient) GetX

func (c *MenPaiClient) GetX(ctx context.Context, id int) *MenPai

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

func (*MenPaiClient) Hooks

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

Hooks returns the client hooks.

func (*MenPaiClient) Query

func (c *MenPaiClient) Query() *MenPaiQuery

Create returns a query builder for MenPai.

func (*MenPaiClient) QueryDisciples

func (c *MenPaiClient) QueryDisciples(mp *MenPai) *JiangHuRenQuery

QueryDisciples queries the disciples edge of a MenPai.

func (*MenPaiClient) Update

func (c *MenPaiClient) Update() *MenPaiUpdate

Update returns an update builder for MenPai.

func (*MenPaiClient) UpdateOne

func (c *MenPaiClient) UpdateOne(mp *MenPai) *MenPaiUpdateOne

UpdateOne returns an update builder for the given entity.

func (*MenPaiClient) UpdateOneID

func (c *MenPaiClient) UpdateOneID(id int) *MenPaiUpdateOne

UpdateOneID returns an update builder for the given id.

func (*MenPaiClient) Use

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

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

type MenPaiCreate

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

MenPaiCreate is the builder for creating a MenPai entity.

func (*MenPaiCreate) AddDiscipleIDs

func (mpc *MenPaiCreate) AddDiscipleIDs(ids ...int) *MenPaiCreate

AddDiscipleIDs adds the disciples edge to JiangHuRen by ids.

func (*MenPaiCreate) AddDisciples

func (mpc *MenPaiCreate) AddDisciples(j ...*JiangHuRen) *MenPaiCreate

AddDisciples adds the disciples edges to JiangHuRen.

func (*MenPaiCreate) Save

func (mpc *MenPaiCreate) Save(ctx context.Context) (*MenPai, error)

Save creates the MenPai in the database.

func (*MenPaiCreate) SaveX

func (mpc *MenPaiCreate) SaveX(ctx context.Context) *MenPai

SaveX calls Save and panics if Save returns an error.

func (*MenPaiCreate) SetAddress

func (mpc *MenPaiCreate) SetAddress(s string) *MenPaiCreate

SetAddress sets the address field.

func (*MenPaiCreate) SetCreatedAt

func (mpc *MenPaiCreate) SetCreatedAt(t time.Time) *MenPaiCreate

SetCreatedAt sets the created_at field.

func (*MenPaiCreate) SetName

func (mpc *MenPaiCreate) SetName(s string) *MenPaiCreate

SetName sets the name field.

func (*MenPaiCreate) SetNillableAddress

func (mpc *MenPaiCreate) SetNillableAddress(s *string) *MenPaiCreate

SetNillableAddress sets the address field if the given value is not nil.

func (*MenPaiCreate) SetNillableCreatedAt

func (mpc *MenPaiCreate) SetNillableCreatedAt(t *time.Time) *MenPaiCreate

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

func (*MenPaiCreate) SetNillableUpdatedAt

func (mpc *MenPaiCreate) SetNillableUpdatedAt(t *time.Time) *MenPaiCreate

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

func (*MenPaiCreate) SetUpdatedAt

func (mpc *MenPaiCreate) SetUpdatedAt(t time.Time) *MenPaiCreate

SetUpdatedAt sets the updated_at field.

type MenPaiDelete

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

MenPaiDelete is the builder for deleting a MenPai entity.

func (*MenPaiDelete) Exec

func (mpd *MenPaiDelete) Exec(ctx context.Context) (int, error)

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

func (*MenPaiDelete) ExecX

func (mpd *MenPaiDelete) ExecX(ctx context.Context) int

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

func (*MenPaiDelete) Where

func (mpd *MenPaiDelete) Where(ps ...predicate.MenPai) *MenPaiDelete

Where adds a new predicate to the delete builder.

type MenPaiDeleteOne

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

MenPaiDeleteOne is the builder for deleting a single MenPai entity.

func (*MenPaiDeleteOne) Exec

func (mpdo *MenPaiDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*MenPaiDeleteOne) ExecX

func (mpdo *MenPaiDeleteOne) ExecX(ctx context.Context)

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

type MenPaiEdges

type MenPaiEdges struct {
	// Disciples holds the value of the disciples edge.
	Disciples []*JiangHuRen
	// contains filtered or unexported fields
}

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

func (MenPaiEdges) DisciplesOrErr

func (e MenPaiEdges) DisciplesOrErr() ([]*JiangHuRen, error)

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

type MenPaiGroupBy

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

MenPaiGroupBy is the builder for group-by MenPai entities.

func (*MenPaiGroupBy) Aggregate

func (mpgb *MenPaiGroupBy) Aggregate(fns ...Aggregate) *MenPaiGroupBy

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

func (*MenPaiGroupBy) Bools

func (mpgb *MenPaiGroupBy) Bools(ctx context.Context) ([]bool, error)

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

func (*MenPaiGroupBy) BoolsX

func (mpgb *MenPaiGroupBy) BoolsX(ctx context.Context) []bool

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

func (*MenPaiGroupBy) Float64s

func (mpgb *MenPaiGroupBy) Float64s(ctx context.Context) ([]float64, error)

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

func (*MenPaiGroupBy) Float64sX

func (mpgb *MenPaiGroupBy) Float64sX(ctx context.Context) []float64

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

func (*MenPaiGroupBy) Ints

func (mpgb *MenPaiGroupBy) Ints(ctx context.Context) ([]int, error)

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

func (*MenPaiGroupBy) IntsX

func (mpgb *MenPaiGroupBy) IntsX(ctx context.Context) []int

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

func (*MenPaiGroupBy) Scan

func (mpgb *MenPaiGroupBy) Scan(ctx context.Context, v interface{}) error

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

func (*MenPaiGroupBy) ScanX

func (mpgb *MenPaiGroupBy) ScanX(ctx context.Context, v interface{})

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

func (*MenPaiGroupBy) Strings

func (mpgb *MenPaiGroupBy) Strings(ctx context.Context) ([]string, error)

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

func (*MenPaiGroupBy) StringsX

func (mpgb *MenPaiGroupBy) StringsX(ctx context.Context) []string

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

type MenPaiMutation

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

MenPaiMutation represents an operation that mutate the MenPais nodes in the graph.

func (*MenPaiMutation) AddDiscipleIDs

func (m *MenPaiMutation) AddDiscipleIDs(ids ...int)

AddDiscipleIDs adds the disciples edge to JiangHuRen by ids.

func (*MenPaiMutation) AddField

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

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

func (*MenPaiMutation) AddedEdges

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

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

func (*MenPaiMutation) AddedField

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

AddedField returns the numeric value that was in/decremented from a field with the given name. The second value indicates that this field was not set, or was not define in the schema.

func (*MenPaiMutation) AddedFields

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

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

func (*MenPaiMutation) AddedIDs

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

AddedIDs returns all ids (to other nodes) that were added for the given edge name.

func (*MenPaiMutation) Address

func (m *MenPaiMutation) Address() (r string, exists bool)

Address returns the address value in the mutation.

func (*MenPaiMutation) ClearEdge

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

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

func (*MenPaiMutation) ClearField

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

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

func (*MenPaiMutation) ClearedEdges

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

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

func (*MenPaiMutation) ClearedFields

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

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

func (MenPaiMutation) Client

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

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

CreatedAt returns the created_at value in the mutation.

func (*MenPaiMutation) DisciplesIDs

func (m *MenPaiMutation) DisciplesIDs() (ids []int)

DisciplesIDs returns the disciples ids in the mutation.

func (*MenPaiMutation) EdgeCleared

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

EdgeCleared returns a boolean indicates if this edge was cleared in this mutation.

func (*MenPaiMutation) Field

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

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

func (*MenPaiMutation) FieldCleared

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

FieldCleared returns a boolean indicates if this field was cleared in this mutation.

func (*MenPaiMutation) Fields

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

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

func (*MenPaiMutation) ID

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

ID returns the id value in the mutation. Note that, the id is available only if it was provided to the builder.

func (*MenPaiMutation) Name

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

Name returns the name value in the mutation.

func (*MenPaiMutation) Op

func (m *MenPaiMutation) Op() Op

Op returns the operation name.

func (*MenPaiMutation) RemoveDiscipleIDs

func (m *MenPaiMutation) RemoveDiscipleIDs(ids ...int)

RemoveDiscipleIDs removes the disciples edge to JiangHuRen by ids.

func (*MenPaiMutation) RemovedDisciplesIDs

func (m *MenPaiMutation) RemovedDisciplesIDs() (ids []int)

RemovedDisciples returns the removed ids of disciples.

func (*MenPaiMutation) RemovedEdges

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

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

func (*MenPaiMutation) RemovedIDs

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

RemovedIDs returns all ids (to other nodes) that were removed for the given edge name.

func (*MenPaiMutation) ResetAddress

func (m *MenPaiMutation) ResetAddress()

ResetAddress reset all changes of the address field.

func (*MenPaiMutation) ResetCreatedAt

func (m *MenPaiMutation) ResetCreatedAt()

ResetCreatedAt reset all changes of the created_at field.

func (*MenPaiMutation) ResetDisciples

func (m *MenPaiMutation) ResetDisciples()

ResetDisciples reset all changes of the disciples edge.

func (*MenPaiMutation) ResetEdge

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

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

func (*MenPaiMutation) ResetField

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

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

func (*MenPaiMutation) ResetName

func (m *MenPaiMutation) ResetName()

ResetName reset all changes of the name field.

func (*MenPaiMutation) ResetUpdatedAt

func (m *MenPaiMutation) ResetUpdatedAt()

ResetUpdatedAt reset all changes of the updated_at field.

func (*MenPaiMutation) SetAddress

func (m *MenPaiMutation) SetAddress(s string)

SetAddress sets the address field.

func (*MenPaiMutation) SetCreatedAt

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

SetCreatedAt sets the created_at field.

func (*MenPaiMutation) SetField

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

SetField sets the value for the given name. It returns an error if the field is not defined in the schema, or if the type mismatch the field type.

func (*MenPaiMutation) SetName

func (m *MenPaiMutation) SetName(s string)

SetName sets the name field.

func (*MenPaiMutation) SetUpdatedAt

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

SetUpdatedAt sets the updated_at field.

func (MenPaiMutation) Tx

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

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

func (*MenPaiMutation) Type

func (m *MenPaiMutation) Type() string

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

func (*MenPaiMutation) UpdatedAt

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

UpdatedAt returns the updated_at value in the mutation.

type MenPaiQuery

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

MenPaiQuery is the builder for querying MenPai entities.

func (*MenPaiQuery) All

func (mpq *MenPaiQuery) All(ctx context.Context) ([]*MenPai, error)

All executes the query and returns a list of MenPais.

func (*MenPaiQuery) AllX

func (mpq *MenPaiQuery) AllX(ctx context.Context) []*MenPai

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

func (*MenPaiQuery) Clone

func (mpq *MenPaiQuery) Clone() *MenPaiQuery

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

func (*MenPaiQuery) Count

func (mpq *MenPaiQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*MenPaiQuery) CountX

func (mpq *MenPaiQuery) CountX(ctx context.Context) int

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

func (*MenPaiQuery) Exist

func (mpq *MenPaiQuery) Exist(ctx context.Context) (bool, error)

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

func (*MenPaiQuery) ExistX

func (mpq *MenPaiQuery) ExistX(ctx context.Context) bool

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

func (*MenPaiQuery) First

func (mpq *MenPaiQuery) First(ctx context.Context) (*MenPai, error)

First returns the first MenPai entity in the query. Returns *NotFoundError when no menpai was found.

func (*MenPaiQuery) FirstID

func (mpq *MenPaiQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first MenPai id in the query. Returns *NotFoundError when no id was found.

func (*MenPaiQuery) FirstX

func (mpq *MenPaiQuery) FirstX(ctx context.Context) *MenPai

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

func (*MenPaiQuery) FirstXID

func (mpq *MenPaiQuery) FirstXID(ctx context.Context) int

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

func (*MenPaiQuery) GroupBy

func (mpq *MenPaiQuery) GroupBy(field string, fields ...string) *MenPaiGroupBy

GroupBy 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 {
	CreatedAt time.Time `json:"created_at,omitempty"`
	Count int `json:"count,omitempty"`
}

client.MenPai.Query().
	GroupBy(menpai.FieldCreatedAt).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*MenPaiQuery) IDs

func (mpq *MenPaiQuery) IDs(ctx context.Context) ([]int, error)

IDs executes the query and returns a list of MenPai ids.

func (*MenPaiQuery) IDsX

func (mpq *MenPaiQuery) IDsX(ctx context.Context) []int

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

func (*MenPaiQuery) Limit

func (mpq *MenPaiQuery) Limit(limit int) *MenPaiQuery

Limit adds a limit step to the query.

func (*MenPaiQuery) Offset

func (mpq *MenPaiQuery) Offset(offset int) *MenPaiQuery

Offset adds an offset step to the query.

func (*MenPaiQuery) Only

func (mpq *MenPaiQuery) Only(ctx context.Context) (*MenPai, error)

Only returns the only MenPai entity in the query, returns an error if not exactly one entity was returned.

func (*MenPaiQuery) OnlyID

func (mpq *MenPaiQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID returns the only MenPai id in the query, returns an error if not exactly one id was returned.

func (*MenPaiQuery) OnlyX

func (mpq *MenPaiQuery) OnlyX(ctx context.Context) *MenPai

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

func (*MenPaiQuery) OnlyXID

func (mpq *MenPaiQuery) OnlyXID(ctx context.Context) int

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

func (*MenPaiQuery) Order

func (mpq *MenPaiQuery) Order(o ...Order) *MenPaiQuery

Order adds an order step to the query.

func (*MenPaiQuery) QueryDisciples

func (mpq *MenPaiQuery) QueryDisciples() *JiangHuRenQuery

QueryDisciples chains the current query on the disciples edge.

func (*MenPaiQuery) Select

func (mpq *MenPaiQuery) Select(field string, fields ...string) *MenPaiSelect

Select one or more fields from the given query.

Example:

var v []struct {
	CreatedAt time.Time `json:"created_at,omitempty"`
}

client.MenPai.Query().
	Select(menpai.FieldCreatedAt).
	Scan(ctx, &v)

func (*MenPaiQuery) Where

func (mpq *MenPaiQuery) Where(ps ...predicate.MenPai) *MenPaiQuery

Where adds a new predicate for the builder.

func (*MenPaiQuery) WithDisciples

func (mpq *MenPaiQuery) WithDisciples(opts ...func(*JiangHuRenQuery)) *MenPaiQuery
WithDisciples tells the query-builder to eager-loads the nodes that are connected to

the "disciples" edge. The optional arguments used to configure the query builder of the edge.

type MenPaiSelect

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

MenPaiSelect is the builder for select fields of MenPai entities.

func (*MenPaiSelect) Bools

func (mps *MenPaiSelect) Bools(ctx context.Context) ([]bool, error)

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

func (*MenPaiSelect) BoolsX

func (mps *MenPaiSelect) BoolsX(ctx context.Context) []bool

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

func (*MenPaiSelect) Float64s

func (mps *MenPaiSelect) Float64s(ctx context.Context) ([]float64, error)

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

func (*MenPaiSelect) Float64sX

func (mps *MenPaiSelect) Float64sX(ctx context.Context) []float64

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

func (*MenPaiSelect) Ints

func (mps *MenPaiSelect) Ints(ctx context.Context) ([]int, error)

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

func (*MenPaiSelect) IntsX

func (mps *MenPaiSelect) IntsX(ctx context.Context) []int

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

func (*MenPaiSelect) Scan

func (mps *MenPaiSelect) Scan(ctx context.Context, v interface{}) error

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

func (*MenPaiSelect) ScanX

func (mps *MenPaiSelect) ScanX(ctx context.Context, v interface{})

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

func (*MenPaiSelect) Strings

func (mps *MenPaiSelect) Strings(ctx context.Context) ([]string, error)

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

func (*MenPaiSelect) StringsX

func (mps *MenPaiSelect) StringsX(ctx context.Context) []string

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

type MenPaiUpdate

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

MenPaiUpdate is the builder for updating MenPai entities.

func (*MenPaiUpdate) AddDiscipleIDs

func (mpu *MenPaiUpdate) AddDiscipleIDs(ids ...int) *MenPaiUpdate

AddDiscipleIDs adds the disciples edge to JiangHuRen by ids.

func (*MenPaiUpdate) AddDisciples

func (mpu *MenPaiUpdate) AddDisciples(j ...*JiangHuRen) *MenPaiUpdate

AddDisciples adds the disciples edges to JiangHuRen.

func (*MenPaiUpdate) Exec

func (mpu *MenPaiUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*MenPaiUpdate) ExecX

func (mpu *MenPaiUpdate) ExecX(ctx context.Context)

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

func (*MenPaiUpdate) RemoveDiscipleIDs

func (mpu *MenPaiUpdate) RemoveDiscipleIDs(ids ...int) *MenPaiUpdate

RemoveDiscipleIDs removes the disciples edge to JiangHuRen by ids.

func (*MenPaiUpdate) RemoveDisciples

func (mpu *MenPaiUpdate) RemoveDisciples(j ...*JiangHuRen) *MenPaiUpdate

RemoveDisciples removes disciples edges to JiangHuRen.

func (*MenPaiUpdate) Save

func (mpu *MenPaiUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of rows/vertices matched by this operation.

func (*MenPaiUpdate) SaveX

func (mpu *MenPaiUpdate) SaveX(ctx context.Context) int

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

func (*MenPaiUpdate) SetAddress

func (mpu *MenPaiUpdate) SetAddress(s string) *MenPaiUpdate

SetAddress sets the address field.

func (*MenPaiUpdate) SetName

func (mpu *MenPaiUpdate) SetName(s string) *MenPaiUpdate

SetName sets the name field.

func (*MenPaiUpdate) SetNillableAddress

func (mpu *MenPaiUpdate) SetNillableAddress(s *string) *MenPaiUpdate

SetNillableAddress sets the address field if the given value is not nil.

func (*MenPaiUpdate) SetUpdatedAt

func (mpu *MenPaiUpdate) SetUpdatedAt(t time.Time) *MenPaiUpdate

SetUpdatedAt sets the updated_at field.

func (*MenPaiUpdate) Where

func (mpu *MenPaiUpdate) Where(ps ...predicate.MenPai) *MenPaiUpdate

Where adds a new predicate for the builder.

type MenPaiUpdateOne

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

MenPaiUpdateOne is the builder for updating a single MenPai entity.

func (*MenPaiUpdateOne) AddDiscipleIDs

func (mpuo *MenPaiUpdateOne) AddDiscipleIDs(ids ...int) *MenPaiUpdateOne

AddDiscipleIDs adds the disciples edge to JiangHuRen by ids.

func (*MenPaiUpdateOne) AddDisciples

func (mpuo *MenPaiUpdateOne) AddDisciples(j ...*JiangHuRen) *MenPaiUpdateOne

AddDisciples adds the disciples edges to JiangHuRen.

func (*MenPaiUpdateOne) Exec

func (mpuo *MenPaiUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*MenPaiUpdateOne) ExecX

func (mpuo *MenPaiUpdateOne) ExecX(ctx context.Context)

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

func (*MenPaiUpdateOne) RemoveDiscipleIDs

func (mpuo *MenPaiUpdateOne) RemoveDiscipleIDs(ids ...int) *MenPaiUpdateOne

RemoveDiscipleIDs removes the disciples edge to JiangHuRen by ids.

func (*MenPaiUpdateOne) RemoveDisciples

func (mpuo *MenPaiUpdateOne) RemoveDisciples(j ...*JiangHuRen) *MenPaiUpdateOne

RemoveDisciples removes disciples edges to JiangHuRen.

func (*MenPaiUpdateOne) Save

func (mpuo *MenPaiUpdateOne) Save(ctx context.Context) (*MenPai, error)

Save executes the query and returns the updated entity.

func (*MenPaiUpdateOne) SaveX

func (mpuo *MenPaiUpdateOne) SaveX(ctx context.Context) *MenPai

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

func (*MenPaiUpdateOne) SetAddress

func (mpuo *MenPaiUpdateOne) SetAddress(s string) *MenPaiUpdateOne

SetAddress sets the address field.

func (*MenPaiUpdateOne) SetName

func (mpuo *MenPaiUpdateOne) SetName(s string) *MenPaiUpdateOne

SetName sets the name field.

func (*MenPaiUpdateOne) SetNillableAddress

func (mpuo *MenPaiUpdateOne) SetNillableAddress(s *string) *MenPaiUpdateOne

SetNillableAddress sets the address field if the given value is not nil.

func (*MenPaiUpdateOne) SetUpdatedAt

func (mpuo *MenPaiUpdateOne) SetUpdatedAt(t time.Time) *MenPaiUpdateOne

SetUpdatedAt sets the updated_at field.

type MenPais

type MenPais []*MenPai

MenPais is a parsable slice of MenPai.

type MutateFunc

type MutateFunc = ent.MutateFunc

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

type Mutation

type Mutation = ent.Mutation

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

type Mutator

type Mutator = ent.Mutator

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

type NotFoundError

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

NotFoundError returns when trying to fetch a specific entity and it was not found in the database.

func (*NotFoundError) Error

func (e *NotFoundError) Error() string

Error implements the error interface.

type NotLoadedError

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

NotLoadedError returns when trying to get a node that was not loaded by the query.

func (*NotLoadedError) Error

func (e *NotLoadedError) Error() string

Error implements the error interface.

type NotSingularError

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

NotSingularError returns when trying to fetch a singular entity and more then one was found in the database.

func (*NotSingularError) Error

func (e *NotSingularError) Error() string

Error implements the error interface.

type Op

type Op = ent.Op

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

type Option

type Option func(*config)

Option function to configure the client.

func Debug

func Debug() Option

Debug enables debug logging on the ent.Driver.

func Driver

func Driver(driver dialect.Driver) Option

Driver configures the client driver.

func Log

func Log(fn func(...interface{})) Option

Log sets the logging function for debug mode.

type Order

type Order func(*sql.Selector)

Order applies an ordering on either graph traversal or sql selector.

func Asc

func Asc(fields ...string) Order

Asc applies the given fields in ASC order.

func Desc

func Desc(fields ...string) Order

Desc applies the given fields in DESC order.

type Query

type Query = ent.Query

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

type Tx

type Tx struct {

	// JiangHuRen is the client for interacting with the JiangHuRen builders.
	JiangHuRen *JiangHuRenClient
	// MenPai is the client for interacting with the MenPai builders.
	MenPai *MenPaiClient
	// Weapon is the client for interacting with the Weapon builders.
	Weapon *WeaponClient
	// WuGong is the client for interacting with the WuGong builders.
	WuGong *WuGongClient
	// contains filtered or unexported fields
}

Tx is a transactional client that is created by calling Client.Tx().

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) Rollback

func (tx *Tx) Rollback() error

Rollback rollbacks the transaction.

type Value

type Value = ent.Value

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

type Weapon

type Weapon struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// UpdatedAt holds the value of the "updated_at" field.
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// Name holds the value of the "name" field.
	Name string `json:"name,omitempty"`
	// Level holds the value of the "level" field.
	Level int `json:"level,omitempty"`
	// Category holds the value of the "category" field.
	Category int `json:"category,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the WeaponQuery when eager-loading is set.
	Edges WeaponEdges `json:"edges"`
	// contains filtered or unexported fields
}

Weapon is the model entity for the Weapon schema.

func (*Weapon) QueryOwner

func (w *Weapon) QueryOwner() *JiangHuRenQuery

QueryOwner queries the owner edge of the Weapon.

func (*Weapon) String

func (w *Weapon) String() string

String implements the fmt.Stringer.

func (*Weapon) Unwrap

func (w *Weapon) Unwrap() *Weapon

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

func (*Weapon) Update

func (w *Weapon) Update() *WeaponUpdateOne

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

type WeaponClient

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

WeaponClient is a client for the Weapon schema.

func NewWeaponClient

func NewWeaponClient(c config) *WeaponClient

NewWeaponClient returns a client for the Weapon from the given config.

func (*WeaponClient) Create

func (c *WeaponClient) Create() *WeaponCreate

Create returns a create builder for Weapon.

func (*WeaponClient) Delete

func (c *WeaponClient) Delete() *WeaponDelete

Delete returns a delete builder for Weapon.

func (*WeaponClient) DeleteOne

func (c *WeaponClient) DeleteOne(w *Weapon) *WeaponDeleteOne

DeleteOne returns a delete builder for the given entity.

func (*WeaponClient) DeleteOneID

func (c *WeaponClient) DeleteOneID(id int) *WeaponDeleteOne

DeleteOneID returns a delete builder for the given id.

func (*WeaponClient) Get

func (c *WeaponClient) Get(ctx context.Context, id int) (*Weapon, error)

Get returns a Weapon entity by its id.

func (*WeaponClient) GetX

func (c *WeaponClient) GetX(ctx context.Context, id int) *Weapon

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

func (*WeaponClient) Hooks

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

Hooks returns the client hooks.

func (*WeaponClient) Query

func (c *WeaponClient) Query() *WeaponQuery

Create returns a query builder for Weapon.

func (*WeaponClient) QueryOwner

func (c *WeaponClient) QueryOwner(w *Weapon) *JiangHuRenQuery

QueryOwner queries the owner edge of a Weapon.

func (*WeaponClient) Update

func (c *WeaponClient) Update() *WeaponUpdate

Update returns an update builder for Weapon.

func (*WeaponClient) UpdateOne

func (c *WeaponClient) UpdateOne(w *Weapon) *WeaponUpdateOne

UpdateOne returns an update builder for the given entity.

func (*WeaponClient) UpdateOneID

func (c *WeaponClient) UpdateOneID(id int) *WeaponUpdateOne

UpdateOneID returns an update builder for the given id.

func (*WeaponClient) Use

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

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

type WeaponCreate

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

WeaponCreate is the builder for creating a Weapon entity.

func (*WeaponCreate) Save

func (wc *WeaponCreate) Save(ctx context.Context) (*Weapon, error)

Save creates the Weapon in the database.

func (*WeaponCreate) SaveX

func (wc *WeaponCreate) SaveX(ctx context.Context) *Weapon

SaveX calls Save and panics if Save returns an error.

func (*WeaponCreate) SetCategory

func (wc *WeaponCreate) SetCategory(i int) *WeaponCreate

SetCategory sets the category field.

func (*WeaponCreate) SetCreatedAt

func (wc *WeaponCreate) SetCreatedAt(t time.Time) *WeaponCreate

SetCreatedAt sets the created_at field.

func (*WeaponCreate) SetLevel

func (wc *WeaponCreate) SetLevel(i int) *WeaponCreate

SetLevel sets the level field.

func (*WeaponCreate) SetName

func (wc *WeaponCreate) SetName(s string) *WeaponCreate

SetName sets the name field.

func (*WeaponCreate) SetNillableCategory

func (wc *WeaponCreate) SetNillableCategory(i *int) *WeaponCreate

SetNillableCategory sets the category field if the given value is not nil.

func (*WeaponCreate) SetNillableCreatedAt

func (wc *WeaponCreate) SetNillableCreatedAt(t *time.Time) *WeaponCreate

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

func (*WeaponCreate) SetNillableLevel

func (wc *WeaponCreate) SetNillableLevel(i *int) *WeaponCreate

SetNillableLevel sets the level field if the given value is not nil.

func (*WeaponCreate) SetNillableUpdatedAt

func (wc *WeaponCreate) SetNillableUpdatedAt(t *time.Time) *WeaponCreate

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

func (*WeaponCreate) SetOwner

func (wc *WeaponCreate) SetOwner(j *JiangHuRen) *WeaponCreate

SetOwner sets the owner edge to JiangHuRen.

func (*WeaponCreate) SetOwnerID

func (wc *WeaponCreate) SetOwnerID(id int) *WeaponCreate

SetOwnerID sets the owner edge to JiangHuRen by id.

func (*WeaponCreate) SetUpdatedAt

func (wc *WeaponCreate) SetUpdatedAt(t time.Time) *WeaponCreate

SetUpdatedAt sets the updated_at field.

type WeaponDelete

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

WeaponDelete is the builder for deleting a Weapon entity.

func (*WeaponDelete) Exec

func (wd *WeaponDelete) Exec(ctx context.Context) (int, error)

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

func (*WeaponDelete) ExecX

func (wd *WeaponDelete) ExecX(ctx context.Context) int

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

func (*WeaponDelete) Where

func (wd *WeaponDelete) Where(ps ...predicate.Weapon) *WeaponDelete

Where adds a new predicate to the delete builder.

type WeaponDeleteOne

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

WeaponDeleteOne is the builder for deleting a single Weapon entity.

func (*WeaponDeleteOne) Exec

func (wdo *WeaponDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*WeaponDeleteOne) ExecX

func (wdo *WeaponDeleteOne) ExecX(ctx context.Context)

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

type WeaponEdges

type WeaponEdges struct {
	// Owner holds the value of the owner edge.
	Owner *JiangHuRen
	// contains filtered or unexported fields
}

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

func (WeaponEdges) OwnerOrErr

func (e WeaponEdges) OwnerOrErr() (*JiangHuRen, error)

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

type WeaponGroupBy

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

WeaponGroupBy is the builder for group-by Weapon entities.

func (*WeaponGroupBy) Aggregate

func (wgb *WeaponGroupBy) Aggregate(fns ...Aggregate) *WeaponGroupBy

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

func (*WeaponGroupBy) Bools

func (wgb *WeaponGroupBy) Bools(ctx context.Context) ([]bool, error)

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

func (*WeaponGroupBy) BoolsX

func (wgb *WeaponGroupBy) BoolsX(ctx context.Context) []bool

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

func (*WeaponGroupBy) Float64s

func (wgb *WeaponGroupBy) Float64s(ctx context.Context) ([]float64, error)

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

func (*WeaponGroupBy) Float64sX

func (wgb *WeaponGroupBy) Float64sX(ctx context.Context) []float64

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

func (*WeaponGroupBy) Ints

func (wgb *WeaponGroupBy) Ints(ctx context.Context) ([]int, error)

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

func (*WeaponGroupBy) IntsX

func (wgb *WeaponGroupBy) IntsX(ctx context.Context) []int

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

func (*WeaponGroupBy) Scan

func (wgb *WeaponGroupBy) Scan(ctx context.Context, v interface{}) error

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

func (*WeaponGroupBy) ScanX

func (wgb *WeaponGroupBy) ScanX(ctx context.Context, v interface{})

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

func (*WeaponGroupBy) Strings

func (wgb *WeaponGroupBy) Strings(ctx context.Context) ([]string, error)

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

func (*WeaponGroupBy) StringsX

func (wgb *WeaponGroupBy) StringsX(ctx context.Context) []string

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

type WeaponMutation

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

WeaponMutation represents an operation that mutate the Weapons nodes in the graph.

func (*WeaponMutation) AddCategory

func (m *WeaponMutation) AddCategory(i int)

AddCategory adds i to category.

func (*WeaponMutation) AddField

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

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

func (*WeaponMutation) AddLevel

func (m *WeaponMutation) AddLevel(i int)

AddLevel adds i to level.

func (*WeaponMutation) AddedCategory

func (m *WeaponMutation) AddedCategory() (r int, exists bool)

AddedCategory returns the value that was added to the category field in this mutation.

func (*WeaponMutation) AddedEdges

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

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

func (*WeaponMutation) AddedField

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

AddedField returns the numeric value that was in/decremented from a field with the given name. The second value indicates that this field was not set, or was not define in the schema.

func (*WeaponMutation) AddedFields

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

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

func (*WeaponMutation) AddedIDs

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

AddedIDs returns all ids (to other nodes) that were added for the given edge name.

func (*WeaponMutation) AddedLevel

func (m *WeaponMutation) AddedLevel() (r int, exists bool)

AddedLevel returns the value that was added to the level field in this mutation.

func (*WeaponMutation) Category

func (m *WeaponMutation) Category() (r int, exists bool)

Category returns the category value in the mutation.

func (*WeaponMutation) ClearEdge

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

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

func (*WeaponMutation) ClearField

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

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

func (*WeaponMutation) ClearOwner

func (m *WeaponMutation) ClearOwner()

ClearOwner clears the owner edge to JiangHuRen.

func (*WeaponMutation) ClearedEdges

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

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

func (*WeaponMutation) ClearedFields

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

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

func (WeaponMutation) Client

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

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

CreatedAt returns the created_at value in the mutation.

func (*WeaponMutation) EdgeCleared

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

EdgeCleared returns a boolean indicates if this edge was cleared in this mutation.

func (*WeaponMutation) Field

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

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

func (*WeaponMutation) FieldCleared

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

FieldCleared returns a boolean indicates if this field was cleared in this mutation.

func (*WeaponMutation) Fields

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

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

func (*WeaponMutation) ID

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

ID returns the id value in the mutation. Note that, the id is available only if it was provided to the builder.

func (*WeaponMutation) Level

func (m *WeaponMutation) Level() (r int, exists bool)

Level returns the level value in the mutation.

func (*WeaponMutation) Name

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

Name returns the name value in the mutation.

func (*WeaponMutation) Op

func (m *WeaponMutation) Op() Op

Op returns the operation name.

func (*WeaponMutation) OwnerCleared

func (m *WeaponMutation) OwnerCleared() bool

OwnerCleared returns if the edge owner was cleared.

func (*WeaponMutation) OwnerID

func (m *WeaponMutation) OwnerID() (id int, exists bool)

OwnerID returns the owner id in the mutation.

func (*WeaponMutation) OwnerIDs

func (m *WeaponMutation) OwnerIDs() (ids []int)

OwnerIDs returns the owner ids in the mutation. Note that ids always returns len(ids) <= 1 for unique edges, and you should use OwnerID instead. It exists only for internal usage by the builders.

func (*WeaponMutation) RemovedEdges

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

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

func (*WeaponMutation) RemovedIDs

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

RemovedIDs returns all ids (to other nodes) that were removed for the given edge name.

func (*WeaponMutation) ResetCategory

func (m *WeaponMutation) ResetCategory()

ResetCategory reset all changes of the category field.

func (*WeaponMutation) ResetCreatedAt

func (m *WeaponMutation) ResetCreatedAt()

ResetCreatedAt reset all changes of the created_at field.

func (*WeaponMutation) ResetEdge

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

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

func (*WeaponMutation) ResetField

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

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

func (*WeaponMutation) ResetLevel

func (m *WeaponMutation) ResetLevel()

ResetLevel reset all changes of the level field.

func (*WeaponMutation) ResetName

func (m *WeaponMutation) ResetName()

ResetName reset all changes of the name field.

func (*WeaponMutation) ResetOwner

func (m *WeaponMutation) ResetOwner()

ResetOwner reset all changes of the owner edge.

func (*WeaponMutation) ResetUpdatedAt

func (m *WeaponMutation) ResetUpdatedAt()

ResetUpdatedAt reset all changes of the updated_at field.

func (*WeaponMutation) SetCategory

func (m *WeaponMutation) SetCategory(i int)

SetCategory sets the category field.

func (*WeaponMutation) SetCreatedAt

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

SetCreatedAt sets the created_at field.

func (*WeaponMutation) SetField

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

SetField sets the value for the given name. It returns an error if the field is not defined in the schema, or if the type mismatch the field type.

func (*WeaponMutation) SetLevel

func (m *WeaponMutation) SetLevel(i int)

SetLevel sets the level field.

func (*WeaponMutation) SetName

func (m *WeaponMutation) SetName(s string)

SetName sets the name field.

func (*WeaponMutation) SetOwnerID

func (m *WeaponMutation) SetOwnerID(id int)

SetOwnerID sets the owner edge to JiangHuRen by id.

func (*WeaponMutation) SetUpdatedAt

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

SetUpdatedAt sets the updated_at field.

func (WeaponMutation) Tx

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

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

func (*WeaponMutation) Type

func (m *WeaponMutation) Type() string

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

func (*WeaponMutation) UpdatedAt

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

UpdatedAt returns the updated_at value in the mutation.

type WeaponQuery

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

WeaponQuery is the builder for querying Weapon entities.

func (*WeaponQuery) All

func (wq *WeaponQuery) All(ctx context.Context) ([]*Weapon, error)

All executes the query and returns a list of Weapons.

func (*WeaponQuery) AllX

func (wq *WeaponQuery) AllX(ctx context.Context) []*Weapon

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

func (*WeaponQuery) Clone

func (wq *WeaponQuery) Clone() *WeaponQuery

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

func (*WeaponQuery) Count

func (wq *WeaponQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*WeaponQuery) CountX

func (wq *WeaponQuery) CountX(ctx context.Context) int

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

func (*WeaponQuery) Exist

func (wq *WeaponQuery) Exist(ctx context.Context) (bool, error)

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

func (*WeaponQuery) ExistX

func (wq *WeaponQuery) ExistX(ctx context.Context) bool

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

func (*WeaponQuery) First

func (wq *WeaponQuery) First(ctx context.Context) (*Weapon, error)

First returns the first Weapon entity in the query. Returns *NotFoundError when no weapon was found.

func (*WeaponQuery) FirstID

func (wq *WeaponQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first Weapon id in the query. Returns *NotFoundError when no id was found.

func (*WeaponQuery) FirstX

func (wq *WeaponQuery) FirstX(ctx context.Context) *Weapon

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

func (*WeaponQuery) FirstXID

func (wq *WeaponQuery) FirstXID(ctx context.Context) int

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

func (*WeaponQuery) GroupBy

func (wq *WeaponQuery) GroupBy(field string, fields ...string) *WeaponGroupBy

GroupBy 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 {
	CreatedAt time.Time `json:"created_at,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Weapon.Query().
	GroupBy(weapon.FieldCreatedAt).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*WeaponQuery) IDs

func (wq *WeaponQuery) IDs(ctx context.Context) ([]int, error)

IDs executes the query and returns a list of Weapon ids.

func (*WeaponQuery) IDsX

func (wq *WeaponQuery) IDsX(ctx context.Context) []int

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

func (*WeaponQuery) Limit

func (wq *WeaponQuery) Limit(limit int) *WeaponQuery

Limit adds a limit step to the query.

func (*WeaponQuery) Offset

func (wq *WeaponQuery) Offset(offset int) *WeaponQuery

Offset adds an offset step to the query.

func (*WeaponQuery) Only

func (wq *WeaponQuery) Only(ctx context.Context) (*Weapon, error)

Only returns the only Weapon entity in the query, returns an error if not exactly one entity was returned.

func (*WeaponQuery) OnlyID

func (wq *WeaponQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID returns the only Weapon id in the query, returns an error if not exactly one id was returned.

func (*WeaponQuery) OnlyX

func (wq *WeaponQuery) OnlyX(ctx context.Context) *Weapon

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

func (*WeaponQuery) OnlyXID

func (wq *WeaponQuery) OnlyXID(ctx context.Context) int

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

func (*WeaponQuery) Order

func (wq *WeaponQuery) Order(o ...Order) *WeaponQuery

Order adds an order step to the query.

func (*WeaponQuery) QueryOwner

func (wq *WeaponQuery) QueryOwner() *JiangHuRenQuery

QueryOwner chains the current query on the owner edge.

func (*WeaponQuery) Select

func (wq *WeaponQuery) Select(field string, fields ...string) *WeaponSelect

Select one or more fields from the given query.

Example:

var v []struct {
	CreatedAt time.Time `json:"created_at,omitempty"`
}

client.Weapon.Query().
	Select(weapon.FieldCreatedAt).
	Scan(ctx, &v)

func (*WeaponQuery) Where

func (wq *WeaponQuery) Where(ps ...predicate.Weapon) *WeaponQuery

Where adds a new predicate for the builder.

func (*WeaponQuery) WithOwner

func (wq *WeaponQuery) WithOwner(opts ...func(*JiangHuRenQuery)) *WeaponQuery
WithOwner tells the query-builder to eager-loads the nodes that are connected to

the "owner" edge. The optional arguments used to configure the query builder of the edge.

type WeaponSelect

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

WeaponSelect is the builder for select fields of Weapon entities.

func (*WeaponSelect) Bools

func (ws *WeaponSelect) Bools(ctx context.Context) ([]bool, error)

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

func (*WeaponSelect) BoolsX

func (ws *WeaponSelect) BoolsX(ctx context.Context) []bool

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

func (*WeaponSelect) Float64s

func (ws *WeaponSelect) Float64s(ctx context.Context) ([]float64, error)

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

func (*WeaponSelect) Float64sX

func (ws *WeaponSelect) Float64sX(ctx context.Context) []float64

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

func (*WeaponSelect) Ints

func (ws *WeaponSelect) Ints(ctx context.Context) ([]int, error)

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

func (*WeaponSelect) IntsX

func (ws *WeaponSelect) IntsX(ctx context.Context) []int

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

func (*WeaponSelect) Scan

func (ws *WeaponSelect) Scan(ctx context.Context, v interface{}) error

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

func (*WeaponSelect) ScanX

func (ws *WeaponSelect) ScanX(ctx context.Context, v interface{})

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

func (*WeaponSelect) Strings

func (ws *WeaponSelect) Strings(ctx context.Context) ([]string, error)

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

func (*WeaponSelect) StringsX

func (ws *WeaponSelect) StringsX(ctx context.Context) []string

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

type WeaponUpdate

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

WeaponUpdate is the builder for updating Weapon entities.

func (*WeaponUpdate) AddCategory

func (wu *WeaponUpdate) AddCategory(i int) *WeaponUpdate

AddCategory adds i to category.

func (*WeaponUpdate) AddLevel

func (wu *WeaponUpdate) AddLevel(i int) *WeaponUpdate

AddLevel adds i to level.

func (*WeaponUpdate) ClearOwner

func (wu *WeaponUpdate) ClearOwner() *WeaponUpdate

ClearOwner clears the owner edge to JiangHuRen.

func (*WeaponUpdate) Exec

func (wu *WeaponUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*WeaponUpdate) ExecX

func (wu *WeaponUpdate) ExecX(ctx context.Context)

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

func (*WeaponUpdate) Save

func (wu *WeaponUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of rows/vertices matched by this operation.

func (*WeaponUpdate) SaveX

func (wu *WeaponUpdate) SaveX(ctx context.Context) int

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

func (*WeaponUpdate) SetCategory

func (wu *WeaponUpdate) SetCategory(i int) *WeaponUpdate

SetCategory sets the category field.

func (*WeaponUpdate) SetLevel

func (wu *WeaponUpdate) SetLevel(i int) *WeaponUpdate

SetLevel sets the level field.

func (*WeaponUpdate) SetName

func (wu *WeaponUpdate) SetName(s string) *WeaponUpdate

SetName sets the name field.

func (*WeaponUpdate) SetNillableCategory

func (wu *WeaponUpdate) SetNillableCategory(i *int) *WeaponUpdate

SetNillableCategory sets the category field if the given value is not nil.

func (*WeaponUpdate) SetNillableLevel

func (wu *WeaponUpdate) SetNillableLevel(i *int) *WeaponUpdate

SetNillableLevel sets the level field if the given value is not nil.

func (*WeaponUpdate) SetOwner

func (wu *WeaponUpdate) SetOwner(j *JiangHuRen) *WeaponUpdate

SetOwner sets the owner edge to JiangHuRen.

func (*WeaponUpdate) SetOwnerID

func (wu *WeaponUpdate) SetOwnerID(id int) *WeaponUpdate

SetOwnerID sets the owner edge to JiangHuRen by id.

func (*WeaponUpdate) SetUpdatedAt

func (wu *WeaponUpdate) SetUpdatedAt(t time.Time) *WeaponUpdate

SetUpdatedAt sets the updated_at field.

func (*WeaponUpdate) Where

func (wu *WeaponUpdate) Where(ps ...predicate.Weapon) *WeaponUpdate

Where adds a new predicate for the builder.

type WeaponUpdateOne

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

WeaponUpdateOne is the builder for updating a single Weapon entity.

func (*WeaponUpdateOne) AddCategory

func (wuo *WeaponUpdateOne) AddCategory(i int) *WeaponUpdateOne

AddCategory adds i to category.

func (*WeaponUpdateOne) AddLevel

func (wuo *WeaponUpdateOne) AddLevel(i int) *WeaponUpdateOne

AddLevel adds i to level.

func (*WeaponUpdateOne) ClearOwner

func (wuo *WeaponUpdateOne) ClearOwner() *WeaponUpdateOne

ClearOwner clears the owner edge to JiangHuRen.

func (*WeaponUpdateOne) Exec

func (wuo *WeaponUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*WeaponUpdateOne) ExecX

func (wuo *WeaponUpdateOne) ExecX(ctx context.Context)

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

func (*WeaponUpdateOne) Save

func (wuo *WeaponUpdateOne) Save(ctx context.Context) (*Weapon, error)

Save executes the query and returns the updated entity.

func (*WeaponUpdateOne) SaveX

func (wuo *WeaponUpdateOne) SaveX(ctx context.Context) *Weapon

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

func (*WeaponUpdateOne) SetCategory

func (wuo *WeaponUpdateOne) SetCategory(i int) *WeaponUpdateOne

SetCategory sets the category field.

func (*WeaponUpdateOne) SetLevel

func (wuo *WeaponUpdateOne) SetLevel(i int) *WeaponUpdateOne

SetLevel sets the level field.

func (*WeaponUpdateOne) SetName

func (wuo *WeaponUpdateOne) SetName(s string) *WeaponUpdateOne

SetName sets the name field.

func (*WeaponUpdateOne) SetNillableCategory

func (wuo *WeaponUpdateOne) SetNillableCategory(i *int) *WeaponUpdateOne

SetNillableCategory sets the category field if the given value is not nil.

func (*WeaponUpdateOne) SetNillableLevel

func (wuo *WeaponUpdateOne) SetNillableLevel(i *int) *WeaponUpdateOne

SetNillableLevel sets the level field if the given value is not nil.

func (*WeaponUpdateOne) SetOwner

func (wuo *WeaponUpdateOne) SetOwner(j *JiangHuRen) *WeaponUpdateOne

SetOwner sets the owner edge to JiangHuRen.

func (*WeaponUpdateOne) SetOwnerID

func (wuo *WeaponUpdateOne) SetOwnerID(id int) *WeaponUpdateOne

SetOwnerID sets the owner edge to JiangHuRen by id.

func (*WeaponUpdateOne) SetUpdatedAt

func (wuo *WeaponUpdateOne) SetUpdatedAt(t time.Time) *WeaponUpdateOne

SetUpdatedAt sets the updated_at field.

type Weapons

type Weapons []*Weapon

Weapons is a parsable slice of Weapon.

type WuGong

type WuGong struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// UpdatedAt holds the value of the "updated_at" field.
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// Name holds the value of the "name" field.
	Name string `json:"name,omitempty"`
	// Damage holds the value of the "damage" field.
	Damage int `json:"damage,omitempty"`
	// Level holds the value of the "level" field.
	Level uint8 `json:"level,omitempty"`
	// contains filtered or unexported fields
}

WuGong is the model entity for the WuGong schema.

func (*WuGong) String

func (wg *WuGong) String() string

String implements the fmt.Stringer.

func (*WuGong) Unwrap

func (wg *WuGong) Unwrap() *WuGong

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

func (*WuGong) Update

func (wg *WuGong) Update() *WuGongUpdateOne

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

type WuGongClient

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

WuGongClient is a client for the WuGong schema.

func NewWuGongClient

func NewWuGongClient(c config) *WuGongClient

NewWuGongClient returns a client for the WuGong from the given config.

func (*WuGongClient) Create

func (c *WuGongClient) Create() *WuGongCreate

Create returns a create builder for WuGong.

func (*WuGongClient) Delete

func (c *WuGongClient) Delete() *WuGongDelete

Delete returns a delete builder for WuGong.

func (*WuGongClient) DeleteOne

func (c *WuGongClient) DeleteOne(wg *WuGong) *WuGongDeleteOne

DeleteOne returns a delete builder for the given entity.

func (*WuGongClient) DeleteOneID

func (c *WuGongClient) DeleteOneID(id int) *WuGongDeleteOne

DeleteOneID returns a delete builder for the given id.

func (*WuGongClient) Get

func (c *WuGongClient) Get(ctx context.Context, id int) (*WuGong, error)

Get returns a WuGong entity by its id.

func (*WuGongClient) GetX

func (c *WuGongClient) GetX(ctx context.Context, id int) *WuGong

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

func (*WuGongClient) Hooks

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

Hooks returns the client hooks.

func (*WuGongClient) Query

func (c *WuGongClient) Query() *WuGongQuery

Create returns a query builder for WuGong.

func (*WuGongClient) Update

func (c *WuGongClient) Update() *WuGongUpdate

Update returns an update builder for WuGong.

func (*WuGongClient) UpdateOne

func (c *WuGongClient) UpdateOne(wg *WuGong) *WuGongUpdateOne

UpdateOne returns an update builder for the given entity.

func (*WuGongClient) UpdateOneID

func (c *WuGongClient) UpdateOneID(id int) *WuGongUpdateOne

UpdateOneID returns an update builder for the given id.

func (*WuGongClient) Use

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

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

type WuGongCreate

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

WuGongCreate is the builder for creating a WuGong entity.

func (*WuGongCreate) Save

func (wgc *WuGongCreate) Save(ctx context.Context) (*WuGong, error)

Save creates the WuGong in the database.

func (*WuGongCreate) SaveX

func (wgc *WuGongCreate) SaveX(ctx context.Context) *WuGong

SaveX calls Save and panics if Save returns an error.

func (*WuGongCreate) SetCreatedAt

func (wgc *WuGongCreate) SetCreatedAt(t time.Time) *WuGongCreate

SetCreatedAt sets the created_at field.

func (*WuGongCreate) SetDamage

func (wgc *WuGongCreate) SetDamage(i int) *WuGongCreate

SetDamage sets the damage field.

func (*WuGongCreate) SetLevel

func (wgc *WuGongCreate) SetLevel(u uint8) *WuGongCreate

SetLevel sets the level field.

func (*WuGongCreate) SetName

func (wgc *WuGongCreate) SetName(s string) *WuGongCreate

SetName sets the name field.

func (*WuGongCreate) SetNillableCreatedAt

func (wgc *WuGongCreate) SetNillableCreatedAt(t *time.Time) *WuGongCreate

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

func (*WuGongCreate) SetNillableDamage

func (wgc *WuGongCreate) SetNillableDamage(i *int) *WuGongCreate

SetNillableDamage sets the damage field if the given value is not nil.

func (*WuGongCreate) SetNillableUpdatedAt

func (wgc *WuGongCreate) SetNillableUpdatedAt(t *time.Time) *WuGongCreate

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

func (*WuGongCreate) SetUpdatedAt

func (wgc *WuGongCreate) SetUpdatedAt(t time.Time) *WuGongCreate

SetUpdatedAt sets the updated_at field.

type WuGongDelete

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

WuGongDelete is the builder for deleting a WuGong entity.

func (*WuGongDelete) Exec

func (wgd *WuGongDelete) Exec(ctx context.Context) (int, error)

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

func (*WuGongDelete) ExecX

func (wgd *WuGongDelete) ExecX(ctx context.Context) int

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

func (*WuGongDelete) Where

func (wgd *WuGongDelete) Where(ps ...predicate.WuGong) *WuGongDelete

Where adds a new predicate to the delete builder.

type WuGongDeleteOne

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

WuGongDeleteOne is the builder for deleting a single WuGong entity.

func (*WuGongDeleteOne) Exec

func (wgdo *WuGongDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*WuGongDeleteOne) ExecX

func (wgdo *WuGongDeleteOne) ExecX(ctx context.Context)

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

type WuGongGroupBy

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

WuGongGroupBy is the builder for group-by WuGong entities.

func (*WuGongGroupBy) Aggregate

func (wggb *WuGongGroupBy) Aggregate(fns ...Aggregate) *WuGongGroupBy

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

func (*WuGongGroupBy) Bools

func (wggb *WuGongGroupBy) Bools(ctx context.Context) ([]bool, error)

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

func (*WuGongGroupBy) BoolsX

func (wggb *WuGongGroupBy) BoolsX(ctx context.Context) []bool

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

func (*WuGongGroupBy) Float64s

func (wggb *WuGongGroupBy) Float64s(ctx context.Context) ([]float64, error)

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

func (*WuGongGroupBy) Float64sX

func (wggb *WuGongGroupBy) Float64sX(ctx context.Context) []float64

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

func (*WuGongGroupBy) Ints

func (wggb *WuGongGroupBy) Ints(ctx context.Context) ([]int, error)

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

func (*WuGongGroupBy) IntsX

func (wggb *WuGongGroupBy) IntsX(ctx context.Context) []int

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

func (*WuGongGroupBy) Scan

func (wggb *WuGongGroupBy) Scan(ctx context.Context, v interface{}) error

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

func (*WuGongGroupBy) ScanX

func (wggb *WuGongGroupBy) ScanX(ctx context.Context, v interface{})

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

func (*WuGongGroupBy) Strings

func (wggb *WuGongGroupBy) Strings(ctx context.Context) ([]string, error)

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

func (*WuGongGroupBy) StringsX

func (wggb *WuGongGroupBy) StringsX(ctx context.Context) []string

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

type WuGongMutation

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

WuGongMutation represents an operation that mutate the WuGongs nodes in the graph.

func (*WuGongMutation) AddDamage

func (m *WuGongMutation) AddDamage(i int)

AddDamage adds i to damage.

func (*WuGongMutation) AddField

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

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

func (*WuGongMutation) AddLevel

func (m *WuGongMutation) AddLevel(u uint8)

AddLevel adds u to level.

func (*WuGongMutation) AddedDamage

func (m *WuGongMutation) AddedDamage() (r int, exists bool)

AddedDamage returns the value that was added to the damage field in this mutation.

func (*WuGongMutation) AddedEdges

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

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

func (*WuGongMutation) AddedField

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

AddedField returns the numeric value that was in/decremented from a field with the given name. The second value indicates that this field was not set, or was not define in the schema.

func (*WuGongMutation) AddedFields

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

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

func (*WuGongMutation) AddedIDs

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

AddedIDs returns all ids (to other nodes) that were added for the given edge name.

func (*WuGongMutation) AddedLevel

func (m *WuGongMutation) AddedLevel() (r uint8, exists bool)

AddedLevel returns the value that was added to the level field in this mutation.

func (*WuGongMutation) ClearEdge

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

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

func (*WuGongMutation) ClearField

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

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

func (*WuGongMutation) ClearedEdges

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

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

func (*WuGongMutation) ClearedFields

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

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

func (WuGongMutation) Client

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

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

CreatedAt returns the created_at value in the mutation.

func (*WuGongMutation) Damage

func (m *WuGongMutation) Damage() (r int, exists bool)

Damage returns the damage value in the mutation.

func (*WuGongMutation) EdgeCleared

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

EdgeCleared returns a boolean indicates if this edge was cleared in this mutation.

func (*WuGongMutation) Field

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

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

func (*WuGongMutation) FieldCleared

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

FieldCleared returns a boolean indicates if this field was cleared in this mutation.

func (*WuGongMutation) Fields

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

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

func (*WuGongMutation) ID

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

ID returns the id value in the mutation. Note that, the id is available only if it was provided to the builder.

func (*WuGongMutation) Level

func (m *WuGongMutation) Level() (r uint8, exists bool)

Level returns the level value in the mutation.

func (*WuGongMutation) Name

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

Name returns the name value in the mutation.

func (*WuGongMutation) Op

func (m *WuGongMutation) Op() Op

Op returns the operation name.

func (*WuGongMutation) RemovedEdges

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

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

func (*WuGongMutation) RemovedIDs

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

RemovedIDs returns all ids (to other nodes) that were removed for the given edge name.

func (*WuGongMutation) ResetCreatedAt

func (m *WuGongMutation) ResetCreatedAt()

ResetCreatedAt reset all changes of the created_at field.

func (*WuGongMutation) ResetDamage

func (m *WuGongMutation) ResetDamage()

ResetDamage reset all changes of the damage field.

func (*WuGongMutation) ResetEdge

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

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

func (*WuGongMutation) ResetField

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

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

func (*WuGongMutation) ResetLevel

func (m *WuGongMutation) ResetLevel()

ResetLevel reset all changes of the level field.

func (*WuGongMutation) ResetName

func (m *WuGongMutation) ResetName()

ResetName reset all changes of the name field.

func (*WuGongMutation) ResetUpdatedAt

func (m *WuGongMutation) ResetUpdatedAt()

ResetUpdatedAt reset all changes of the updated_at field.

func (*WuGongMutation) SetCreatedAt

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

SetCreatedAt sets the created_at field.

func (*WuGongMutation) SetDamage

func (m *WuGongMutation) SetDamage(i int)

SetDamage sets the damage field.

func (*WuGongMutation) SetField

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

SetField sets the value for the given name. It returns an error if the field is not defined in the schema, or if the type mismatch the field type.

func (*WuGongMutation) SetLevel

func (m *WuGongMutation) SetLevel(u uint8)

SetLevel sets the level field.

func (*WuGongMutation) SetName

func (m *WuGongMutation) SetName(s string)

SetName sets the name field.

func (*WuGongMutation) SetUpdatedAt

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

SetUpdatedAt sets the updated_at field.

func (WuGongMutation) Tx

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

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

func (*WuGongMutation) Type

func (m *WuGongMutation) Type() string

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

func (*WuGongMutation) UpdatedAt

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

UpdatedAt returns the updated_at value in the mutation.

type WuGongQuery

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

WuGongQuery is the builder for querying WuGong entities.

func (*WuGongQuery) All

func (wgq *WuGongQuery) All(ctx context.Context) ([]*WuGong, error)

All executes the query and returns a list of WuGongs.

func (*WuGongQuery) AllX

func (wgq *WuGongQuery) AllX(ctx context.Context) []*WuGong

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

func (*WuGongQuery) Clone

func (wgq *WuGongQuery) Clone() *WuGongQuery

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

func (*WuGongQuery) Count

func (wgq *WuGongQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*WuGongQuery) CountX

func (wgq *WuGongQuery) CountX(ctx context.Context) int

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

func (*WuGongQuery) Exist

func (wgq *WuGongQuery) Exist(ctx context.Context) (bool, error)

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

func (*WuGongQuery) ExistX

func (wgq *WuGongQuery) ExistX(ctx context.Context) bool

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

func (*WuGongQuery) First

func (wgq *WuGongQuery) First(ctx context.Context) (*WuGong, error)

First returns the first WuGong entity in the query. Returns *NotFoundError when no wugong was found.

func (*WuGongQuery) FirstID

func (wgq *WuGongQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first WuGong id in the query. Returns *NotFoundError when no id was found.

func (*WuGongQuery) FirstX

func (wgq *WuGongQuery) FirstX(ctx context.Context) *WuGong

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

func (*WuGongQuery) FirstXID

func (wgq *WuGongQuery) FirstXID(ctx context.Context) int

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

func (*WuGongQuery) GroupBy

func (wgq *WuGongQuery) GroupBy(field string, fields ...string) *WuGongGroupBy

GroupBy 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 {
	CreatedAt time.Time `json:"created_at,omitempty"`
	Count int `json:"count,omitempty"`
}

client.WuGong.Query().
	GroupBy(wugong.FieldCreatedAt).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*WuGongQuery) IDs

func (wgq *WuGongQuery) IDs(ctx context.Context) ([]int, error)

IDs executes the query and returns a list of WuGong ids.

func (*WuGongQuery) IDsX

func (wgq *WuGongQuery) IDsX(ctx context.Context) []int

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

func (*WuGongQuery) Limit

func (wgq *WuGongQuery) Limit(limit int) *WuGongQuery

Limit adds a limit step to the query.

func (*WuGongQuery) Offset

func (wgq *WuGongQuery) Offset(offset int) *WuGongQuery

Offset adds an offset step to the query.

func (*WuGongQuery) Only

func (wgq *WuGongQuery) Only(ctx context.Context) (*WuGong, error)

Only returns the only WuGong entity in the query, returns an error if not exactly one entity was returned.

func (*WuGongQuery) OnlyID

func (wgq *WuGongQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID returns the only WuGong id in the query, returns an error if not exactly one id was returned.

func (*WuGongQuery) OnlyX

func (wgq *WuGongQuery) OnlyX(ctx context.Context) *WuGong

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

func (*WuGongQuery) OnlyXID

func (wgq *WuGongQuery) OnlyXID(ctx context.Context) int

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

func (*WuGongQuery) Order

func (wgq *WuGongQuery) Order(o ...Order) *WuGongQuery

Order adds an order step to the query.

func (*WuGongQuery) Select

func (wgq *WuGongQuery) Select(field string, fields ...string) *WuGongSelect

Select one or more fields from the given query.

Example:

var v []struct {
	CreatedAt time.Time `json:"created_at,omitempty"`
}

client.WuGong.Query().
	Select(wugong.FieldCreatedAt).
	Scan(ctx, &v)

func (*WuGongQuery) Where

func (wgq *WuGongQuery) Where(ps ...predicate.WuGong) *WuGongQuery

Where adds a new predicate for the builder.

type WuGongSelect

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

WuGongSelect is the builder for select fields of WuGong entities.

func (*WuGongSelect) Bools

func (wgs *WuGongSelect) Bools(ctx context.Context) ([]bool, error)

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

func (*WuGongSelect) BoolsX

func (wgs *WuGongSelect) BoolsX(ctx context.Context) []bool

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

func (*WuGongSelect) Float64s

func (wgs *WuGongSelect) Float64s(ctx context.Context) ([]float64, error)

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

func (*WuGongSelect) Float64sX

func (wgs *WuGongSelect) Float64sX(ctx context.Context) []float64

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

func (*WuGongSelect) Ints

func (wgs *WuGongSelect) Ints(ctx context.Context) ([]int, error)

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

func (*WuGongSelect) IntsX

func (wgs *WuGongSelect) IntsX(ctx context.Context) []int

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

func (*WuGongSelect) Scan

func (wgs *WuGongSelect) Scan(ctx context.Context, v interface{}) error

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

func (*WuGongSelect) ScanX

func (wgs *WuGongSelect) ScanX(ctx context.Context, v interface{})

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

func (*WuGongSelect) Strings

func (wgs *WuGongSelect) Strings(ctx context.Context) ([]string, error)

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

func (*WuGongSelect) StringsX

func (wgs *WuGongSelect) StringsX(ctx context.Context) []string

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

type WuGongUpdate

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

WuGongUpdate is the builder for updating WuGong entities.

func (*WuGongUpdate) AddDamage

func (wgu *WuGongUpdate) AddDamage(i int) *WuGongUpdate

AddDamage adds i to damage.

func (*WuGongUpdate) AddLevel

func (wgu *WuGongUpdate) AddLevel(u uint8) *WuGongUpdate

AddLevel adds u to level.

func (*WuGongUpdate) Exec

func (wgu *WuGongUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*WuGongUpdate) ExecX

func (wgu *WuGongUpdate) ExecX(ctx context.Context)

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

func (*WuGongUpdate) Save

func (wgu *WuGongUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of rows/vertices matched by this operation.

func (*WuGongUpdate) SaveX

func (wgu *WuGongUpdate) SaveX(ctx context.Context) int

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

func (*WuGongUpdate) SetDamage

func (wgu *WuGongUpdate) SetDamage(i int) *WuGongUpdate

SetDamage sets the damage field.

func (*WuGongUpdate) SetLevel

func (wgu *WuGongUpdate) SetLevel(u uint8) *WuGongUpdate

SetLevel sets the level field.

func (*WuGongUpdate) SetName

func (wgu *WuGongUpdate) SetName(s string) *WuGongUpdate

SetName sets the name field.

func (*WuGongUpdate) SetNillableDamage

func (wgu *WuGongUpdate) SetNillableDamage(i *int) *WuGongUpdate

SetNillableDamage sets the damage field if the given value is not nil.

func (*WuGongUpdate) SetUpdatedAt

func (wgu *WuGongUpdate) SetUpdatedAt(t time.Time) *WuGongUpdate

SetUpdatedAt sets the updated_at field.

func (*WuGongUpdate) Where

func (wgu *WuGongUpdate) Where(ps ...predicate.WuGong) *WuGongUpdate

Where adds a new predicate for the builder.

type WuGongUpdateOne

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

WuGongUpdateOne is the builder for updating a single WuGong entity.

func (*WuGongUpdateOne) AddDamage

func (wguo *WuGongUpdateOne) AddDamage(i int) *WuGongUpdateOne

AddDamage adds i to damage.

func (*WuGongUpdateOne) AddLevel

func (wguo *WuGongUpdateOne) AddLevel(u uint8) *WuGongUpdateOne

AddLevel adds u to level.

func (*WuGongUpdateOne) Exec

func (wguo *WuGongUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*WuGongUpdateOne) ExecX

func (wguo *WuGongUpdateOne) ExecX(ctx context.Context)

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

func (*WuGongUpdateOne) Save

func (wguo *WuGongUpdateOne) Save(ctx context.Context) (*WuGong, error)

Save executes the query and returns the updated entity.

func (*WuGongUpdateOne) SaveX

func (wguo *WuGongUpdateOne) SaveX(ctx context.Context) *WuGong

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

func (*WuGongUpdateOne) SetDamage

func (wguo *WuGongUpdateOne) SetDamage(i int) *WuGongUpdateOne

SetDamage sets the damage field.

func (*WuGongUpdateOne) SetLevel

func (wguo *WuGongUpdateOne) SetLevel(u uint8) *WuGongUpdateOne

SetLevel sets the level field.

func (*WuGongUpdateOne) SetName

func (wguo *WuGongUpdateOne) SetName(s string) *WuGongUpdateOne

SetName sets the name field.

func (*WuGongUpdateOne) SetNillableDamage

func (wguo *WuGongUpdateOne) SetNillableDamage(i *int) *WuGongUpdateOne

SetNillableDamage sets the damage field if the given value is not nil.

func (*WuGongUpdateOne) SetUpdatedAt

func (wguo *WuGongUpdateOne) SetUpdatedAt(t time.Time) *WuGongUpdateOne

SetUpdatedAt sets the updated_at field.

type WuGongs

type WuGongs []*WuGong

WuGongs is a parsable slice of WuGong.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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