ent

package
v0.0.0-...-cbae595 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2021 License: MIT Imports: 31 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.
	TypeTurn = "Turn"
)

Variables

View Source
var (
	// TurnOrderFieldUserID orders Turn by user_id.
	TurnOrderFieldUserID = &TurnOrderField{
		field: turn.FieldUserID,
		toCursor: func(t *Turn) Cursor {
			return Cursor{
				ID:    t.ID,
				Value: t.UserID,
			}
		},
	}
	// TurnOrderFieldLocationID orders Turn by location_id.
	TurnOrderFieldLocationID = &TurnOrderField{
		field: turn.FieldLocationID,
		toCursor: func(t *Turn) Cursor {
			return Cursor{
				ID:    t.ID,
				Value: t.LocationID,
			}
		},
	}
	// TurnOrderFieldItemID orders Turn by item_id.
	TurnOrderFieldItemID = &TurnOrderField{
		field: turn.FieldItemID,
		toCursor: func(t *Turn) Cursor {
			return Cursor{
				ID:    t.ID,
				Value: t.ItemID,
			}
		},
	}
	// TurnOrderFieldCreatedAt orders Turn by created_at.
	TurnOrderFieldCreatedAt = &TurnOrderField{
		field: turn.FieldCreatedAt,
		toCursor: func(t *Turn) Cursor {
			return Cursor{
				ID:    t.ID,
				Value: t.CreatedAt,
			}
		},
	}
)
View Source
var DefaultTurnOrder = &TurnOrder{
	Direction: OrderDirectionAsc,
	Field: &TurnOrderField{
		field: turn.FieldID,
		toCursor: func(t *Turn) Cursor {
			return Cursor{ID: t.ID}
		},
	},
}

DefaultTurnOrder is the default ordering of Turn.

Functions

func IsConstraintError

func IsConstraintError(err error) bool

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

func IsNotFound

func IsNotFound(err error) bool

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

func IsNotLoaded

func IsNotLoaded(err error) bool

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

func IsNotSingular

func IsNotSingular(err error) bool

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

func IsValidationError

func IsValidationError(err error) bool

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

func MaskNotFound

func MaskNotFound(err error) error

MaskNotFound masks not found error.

func NewContext

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

NewContext returns a new context with the given Client attached.

func NewTxContext

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

NewTxContext returns a new context with the given Tx attached.

func OpenTxFromContext

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

OpenTxFromContext open transactions from client stored in context.

Types

type AggregateFunc

type AggregateFunc func(*sql.Selector) string

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

func As

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

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

func Count

func Count() AggregateFunc

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

func Max

func Max(field string) AggregateFunc

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

func Mean

func Mean(field string) AggregateFunc

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

func Min

func Min(field string) AggregateFunc

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

func Sum

func Sum(field string) AggregateFunc

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

type Client

type Client struct {

	// Schema is the client for creating, migrating and dropping schema.
	Schema *migrate.Schema
	// Turn is the client for interacting with the Turn builders.
	Turn *TurnClient
	// contains filtered or unexported fields
}

Client is the client that holds all ent builders.

func FromContext

func FromContext(ctx context.Context) *Client

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

func NewClient

func NewClient(opts ...Option) *Client

NewClient creates a new client configured with the given options.

func Open

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

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

func (*Client) BeginTx

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

BeginTx returns a transactional client with specified options.

func (*Client) Close

func (c *Client) Close() error

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

func (*Client) Debug

func (c *Client) Debug() *Client

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

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

func (*Client) Node

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

func (*Client) Noder

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

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

c.Noder(ctx, id)
c.Noder(ctx, id, ent.WithNodeType(pet.Table))

func (*Client) Noders

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

func (*Client) OpenTx

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

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

func (*Client) Tx

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

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

func (*Client) Use

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

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

type CommitFunc

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

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

func (CommitFunc) Commit

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

Commit calls f(ctx, m).

type CommitHook

type CommitHook func(Committer) Committer

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

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

type Committer

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

Committer is the interface that wraps the Committer method.

type ConstraintError

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

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

func (ConstraintError) Error

func (e ConstraintError) Error() string

Error implements the error interface.

func (*ConstraintError) Unwrap

func (e *ConstraintError) Unwrap() error

Unwrap implements the errors.Wrapper interface.

type Cursor

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

Cursor of an edge type.

func (Cursor) MarshalGQL

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

MarshalGQL implements graphql.Marshaler interface.

func (*Cursor) UnmarshalGQL

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

UnmarshalGQL implements graphql.Unmarshaler interface.

type Edge

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

Edges between two nodes.

type Field

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

Field of a node.

type Hook

type Hook = ent.Hook

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

type MutateFunc

type MutateFunc = ent.MutateFunc

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

type Mutation

type Mutation = ent.Mutation

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

type Mutator

type Mutator = ent.Mutator

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

type Node

type Node struct {
	ID     int      `json:"id,omitempty"`     // node id.
	Type   string   `json:"type,omitempty"`   // node type.
	Fields []*Field `json:"fields,omitempty"` // node fields.
	Edges  []*Edge  `json:"edges,omitempty"`  // node edges.
}

Node in the graph.

type NodeOption

type NodeOption func(*nodeOptions)

NodeOption allows configuring the Noder execution using functional options.

func WithFixedNodeType

func WithFixedNodeType(t string) NodeOption

WithFixedNodeType sets the Type of the node to a fixed value.

func WithNodeType

func WithNodeType(f func(context.Context, int) (string, error)) NodeOption

WithNodeType sets the node Type resolver function (i.e. the table to query). If was not provided, the table will be derived from the universal-id configuration as described in: https://entgo.io/docs/migrate/#universal-ids.

type Noder

type Noder interface {
	Node(context.Context) (*Node, error)
}

Noder wraps the basic Node method.

type NotFoundError

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

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

func (*NotFoundError) Error

func (e *NotFoundError) Error() string

Error implements the error interface.

type NotLoadedError

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

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

func (*NotLoadedError) Error

func (e *NotLoadedError) Error() string

Error implements the error interface.

type NotSingularError

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

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

func (*NotSingularError) Error

func (e *NotSingularError) Error() string

Error implements the error interface.

type Op

type Op = ent.Op

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

type Option

type Option func(*config)

Option function to configure the client.

func Debug

func Debug() Option

Debug enables debug logging on the ent.Driver.

func Driver

func Driver(driver dialect.Driver) Option

Driver configures the client driver.

func Log

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

Log sets the logging function for debug mode.

type OrderDirection

type OrderDirection string

OrderDirection defines the directions in which to order a list of items.

const (
	// OrderDirectionAsc specifies an ascending order.
	OrderDirectionAsc OrderDirection = "ASC"
	// OrderDirectionDesc specifies a descending order.
	OrderDirectionDesc OrderDirection = "DESC"
)

func (OrderDirection) MarshalGQL

func (o OrderDirection) MarshalGQL(w io.Writer)

MarshalGQL implements graphql.Marshaler interface.

func (OrderDirection) String

func (o OrderDirection) String() string

String implements fmt.Stringer interface.

func (*OrderDirection) UnmarshalGQL

func (o *OrderDirection) UnmarshalGQL(val interface{}) error

UnmarshalGQL implements graphql.Unmarshaler interface.

func (OrderDirection) Validate

func (o OrderDirection) Validate() error

Validate the order direction value.

type OrderFunc

type OrderFunc func(*sql.Selector)

OrderFunc applies an ordering on the sql selector.

func Asc

func Asc(fields ...string) OrderFunc

Asc applies the given fields in ASC order.

func Desc

func Desc(fields ...string) OrderFunc

Desc applies the given fields in DESC order.

type PageInfo

type PageInfo struct {
	HasNextPage     bool    `json:"hasNextPage"`
	HasPreviousPage bool    `json:"hasPreviousPage"`
	StartCursor     *Cursor `json:"startCursor"`
	EndCursor       *Cursor `json:"endCursor"`
}

PageInfo of a connection type.

type Policy

type Policy = ent.Policy

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

type Query

type Query = ent.Query

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

type RollbackFunc

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

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

func (RollbackFunc) Rollback

func (f RollbackFunc) Rollback(ctx context.Context, tx *Tx) error

Rollback calls f(ctx, m).

type RollbackHook

type RollbackHook func(Rollbacker) Rollbacker

RollbackHook defines the "rollback middleware". A function that gets a Rollbacker and returns a Rollbacker. For example:

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

type Rollbacker

type Rollbacker interface {
	Rollback(context.Context, *Tx) error
}

Rollbacker is the interface that wraps the Rollbacker method.

type Turn

type Turn struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// UserID holds the value of the "user_id" field.
	UserID string `json:"user_id,omitempty"`
	// LocationID holds the value of the "location_id" field.
	LocationID string `json:"location_id,omitempty"`
	// ItemID holds the value of the "item_id" field.
	ItemID string `json:"item_id,omitempty"`
	// BuyOrSell holds the value of the "buy_or_sell" field.
	BuyOrSell bool `json:"buy_or_sell,omitempty"`
	// AmountToGive holds the value of the "amount_to_give" field.
	AmountToGive schema.BigInt `json:"amount_to_give,omitempty"`
	// UserCombatStats holds the value of the "user_combat_stats" field.
	UserCombatStats []int `json:"user_combat_stats,omitempty"`
	// DrugLordCombatStats holds the value of the "drug_lord_combat_stats" field.
	DrugLordCombatStats []int `json:"drug_lord_combat_stats,omitempty"`
	// TradeOccurs holds the value of the "trade_occurs" field.
	TradeOccurs bool `json:"trade_occurs,omitempty"`
	// UserPreTradeItem holds the value of the "user_pre_trade_item" field.
	UserPreTradeItem schema.BigInt `json:"user_pre_trade_item,omitempty"`
	// UserPostTradePreEventItem holds the value of the "user_post_trade_pre_event_item" field.
	UserPostTradePreEventItem schema.BigInt `json:"user_post_trade_pre_event_item,omitempty"`
	// UserPostTradePostEventItem holds the value of the "user_post_trade_post_event_item" field.
	UserPostTradePostEventItem schema.BigInt `json:"user_post_trade_post_event_item,omitempty"`
	// UserPreTradeMoney holds the value of the "user_pre_trade_money" field.
	UserPreTradeMoney schema.BigInt `json:"user_pre_trade_money,omitempty"`
	// UserPostTradePreEventMoney holds the value of the "user_post_trade_pre_event_money" field.
	UserPostTradePreEventMoney schema.BigInt `json:"user_post_trade_pre_event_money,omitempty"`
	// UserPostTradePostEventMoney holds the value of the "user_post_trade_post_event_money" field.
	UserPostTradePostEventMoney schema.BigInt `json:"user_post_trade_post_event_money,omitempty"`
	// MarketPreTradeItem holds the value of the "market_pre_trade_item" field.
	MarketPreTradeItem schema.BigInt `json:"market_pre_trade_item,omitempty"`
	// MarketPostTradePreEventItem holds the value of the "market_post_trade_pre_event_item" field.
	MarketPostTradePreEventItem schema.BigInt `json:"market_post_trade_pre_event_item,omitempty"`
	// MarketPostTradePostEventItem holds the value of the "market_post_trade_post_event_item" field.
	MarketPostTradePostEventItem schema.BigInt `json:"market_post_trade_post_event_item,omitempty"`
	// MarketPreTradeMoney holds the value of the "market_pre_tradeMoney" field.
	MarketPreTradeMoney schema.BigInt `json:"market_pre_tradeMoney,omitempty"`
	// MarketPostTradePreEventMoney holds the value of the "market_post_trade_pre_eventMoney" field.
	MarketPostTradePreEventMoney schema.BigInt `json:"market_post_trade_pre_eventMoney,omitempty"`
	// MarketPostTradePostEventMoney holds the value of the "market_post_trade_post_eventMoney" field.
	MarketPostTradePostEventMoney schema.BigInt `json:"market_post_trade_post_eventMoney,omitempty"`
	// DealerDash holds the value of the "dealer_dash" field.
	DealerDash bool `json:"dealer_dash,omitempty"`
	// WrangleDashedDealer holds the value of the "wrangle_dashed_dealer" field.
	WrangleDashedDealer bool `json:"wrangle_dashed_dealer,omitempty"`
	// Mugging holds the value of the "mugging" field.
	Mugging bool `json:"mugging,omitempty"`
	// RunFromMugging holds the value of the "run_from_mugging" field.
	RunFromMugging bool `json:"run_from_mugging,omitempty"`
	// GangWar holds the value of the "gang_war" field.
	GangWar bool `json:"gang_war,omitempty"`
	// DefendGangWar holds the value of the "defend_gang_war" field.
	DefendGangWar bool `json:"defend_gang_war,omitempty"`
	// CopRaid holds the value of the "cop_raid" field.
	CopRaid bool `json:"cop_raid,omitempty"`
	// BribeCops holds the value of the "bribe_cops" field.
	BribeCops bool `json:"bribe_cops,omitempty"`
	// FindItem holds the value of the "find_item" field.
	FindItem bool `json:"find_item,omitempty"`
	// LocalShipment holds the value of the "local_shipment" field.
	LocalShipment bool `json:"local_shipment,omitempty"`
	// WarehouseSeizure holds the value of the "warehouse_seizure" field.
	WarehouseSeizure bool `json:"warehouse_seizure,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// contains filtered or unexported fields
}

Turn is the model entity for the Turn schema.

func (*Turn) Node

func (t *Turn) Node(ctx context.Context) (node *Node, err error)

func (*Turn) String

func (t *Turn) String() string

String implements the fmt.Stringer.

func (*Turn) ToEdge

func (t *Turn) ToEdge(order *TurnOrder) *TurnEdge

ToEdge converts Turn into TurnEdge.

func (*Turn) Unwrap

func (t *Turn) Unwrap() *Turn

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

func (*Turn) Update

func (t *Turn) Update() *TurnUpdateOne

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

type TurnClient

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

TurnClient is a client for the Turn schema.

func NewTurnClient

func NewTurnClient(c config) *TurnClient

NewTurnClient returns a client for the Turn from the given config.

func (*TurnClient) Create

func (c *TurnClient) Create() *TurnCreate

Create returns a create builder for Turn.

func (*TurnClient) CreateBulk

func (c *TurnClient) CreateBulk(builders ...*TurnCreate) *TurnCreateBulk

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

func (*TurnClient) Delete

func (c *TurnClient) Delete() *TurnDelete

Delete returns a delete builder for Turn.

func (*TurnClient) DeleteOne

func (c *TurnClient) DeleteOne(t *Turn) *TurnDeleteOne

DeleteOne returns a delete builder for the given entity.

func (*TurnClient) DeleteOneID

func (c *TurnClient) DeleteOneID(id int) *TurnDeleteOne

DeleteOneID returns a delete builder for the given id.

func (*TurnClient) Get

func (c *TurnClient) Get(ctx context.Context, id int) (*Turn, error)

Get returns a Turn entity by its id.

func (*TurnClient) GetX

func (c *TurnClient) GetX(ctx context.Context, id int) *Turn

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

func (*TurnClient) Hooks

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

Hooks returns the client hooks.

func (*TurnClient) Query

func (c *TurnClient) Query() *TurnQuery

Query returns a query builder for Turn.

func (*TurnClient) Update

func (c *TurnClient) Update() *TurnUpdate

Update returns an update builder for Turn.

func (*TurnClient) UpdateOne

func (c *TurnClient) UpdateOne(t *Turn) *TurnUpdateOne

UpdateOne returns an update builder for the given entity.

func (*TurnClient) UpdateOneID

func (c *TurnClient) UpdateOneID(id int) *TurnUpdateOne

UpdateOneID returns an update builder for the given id.

func (*TurnClient) Use

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

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

type TurnConnection

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

TurnConnection is the connection containing edges to Turn.

type TurnCreate

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

TurnCreate is the builder for creating a Turn entity.

func (*TurnCreate) Exec

func (tc *TurnCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*TurnCreate) ExecX

func (tc *TurnCreate) ExecX(ctx context.Context)

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

func (*TurnCreate) Mutation

func (tc *TurnCreate) Mutation() *TurnMutation

Mutation returns the TurnMutation object of the builder.

func (*TurnCreate) Save

func (tc *TurnCreate) Save(ctx context.Context) (*Turn, error)

Save creates the Turn in the database.

func (*TurnCreate) SaveX

func (tc *TurnCreate) SaveX(ctx context.Context) *Turn

SaveX calls Save and panics if Save returns an error.

func (*TurnCreate) SetAmountToGive

func (tc *TurnCreate) SetAmountToGive(si schema.BigInt) *TurnCreate

SetAmountToGive sets the "amount_to_give" field.

func (*TurnCreate) SetBribeCops

func (tc *TurnCreate) SetBribeCops(b bool) *TurnCreate

SetBribeCops sets the "bribe_cops" field.

func (*TurnCreate) SetBuyOrSell

func (tc *TurnCreate) SetBuyOrSell(b bool) *TurnCreate

SetBuyOrSell sets the "buy_or_sell" field.

func (*TurnCreate) SetCopRaid

func (tc *TurnCreate) SetCopRaid(b bool) *TurnCreate

SetCopRaid sets the "cop_raid" field.

func (*TurnCreate) SetCreatedAt

func (tc *TurnCreate) SetCreatedAt(t time.Time) *TurnCreate

SetCreatedAt sets the "created_at" field.

func (*TurnCreate) SetDealerDash

func (tc *TurnCreate) SetDealerDash(b bool) *TurnCreate

SetDealerDash sets the "dealer_dash" field.

func (*TurnCreate) SetDefendGangWar

func (tc *TurnCreate) SetDefendGangWar(b bool) *TurnCreate

SetDefendGangWar sets the "defend_gang_war" field.

func (*TurnCreate) SetDrugLordCombatStats

func (tc *TurnCreate) SetDrugLordCombatStats(i []int) *TurnCreate

SetDrugLordCombatStats sets the "drug_lord_combat_stats" field.

func (*TurnCreate) SetFindItem

func (tc *TurnCreate) SetFindItem(b bool) *TurnCreate

SetFindItem sets the "find_item" field.

func (*TurnCreate) SetGangWar

func (tc *TurnCreate) SetGangWar(b bool) *TurnCreate

SetGangWar sets the "gang_war" field.

func (*TurnCreate) SetItemID

func (tc *TurnCreate) SetItemID(s string) *TurnCreate

SetItemID sets the "item_id" field.

func (*TurnCreate) SetLocalShipment

func (tc *TurnCreate) SetLocalShipment(b bool) *TurnCreate

SetLocalShipment sets the "local_shipment" field.

func (*TurnCreate) SetLocationID

func (tc *TurnCreate) SetLocationID(s string) *TurnCreate

SetLocationID sets the "location_id" field.

func (*TurnCreate) SetMarketPostTradePostEventItem

func (tc *TurnCreate) SetMarketPostTradePostEventItem(si schema.BigInt) *TurnCreate

SetMarketPostTradePostEventItem sets the "market_post_trade_post_event_item" field.

func (*TurnCreate) SetMarketPostTradePostEventMoney

func (tc *TurnCreate) SetMarketPostTradePostEventMoney(si schema.BigInt) *TurnCreate

SetMarketPostTradePostEventMoney sets the "market_post_trade_post_eventMoney" field.

func (*TurnCreate) SetMarketPostTradePreEventItem

func (tc *TurnCreate) SetMarketPostTradePreEventItem(si schema.BigInt) *TurnCreate

SetMarketPostTradePreEventItem sets the "market_post_trade_pre_event_item" field.

func (*TurnCreate) SetMarketPostTradePreEventMoney

func (tc *TurnCreate) SetMarketPostTradePreEventMoney(si schema.BigInt) *TurnCreate

SetMarketPostTradePreEventMoney sets the "market_post_trade_pre_eventMoney" field.

func (*TurnCreate) SetMarketPreTradeItem

func (tc *TurnCreate) SetMarketPreTradeItem(si schema.BigInt) *TurnCreate

SetMarketPreTradeItem sets the "market_pre_trade_item" field.

func (*TurnCreate) SetMarketPreTradeMoney

func (tc *TurnCreate) SetMarketPreTradeMoney(si schema.BigInt) *TurnCreate

SetMarketPreTradeMoney sets the "market_pre_tradeMoney" field.

func (*TurnCreate) SetMugging

func (tc *TurnCreate) SetMugging(b bool) *TurnCreate

SetMugging sets the "mugging" field.

func (*TurnCreate) SetNillableCreatedAt

func (tc *TurnCreate) SetNillableCreatedAt(t *time.Time) *TurnCreate

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

func (*TurnCreate) SetRunFromMugging

func (tc *TurnCreate) SetRunFromMugging(b bool) *TurnCreate

SetRunFromMugging sets the "run_from_mugging" field.

func (*TurnCreate) SetTradeOccurs

func (tc *TurnCreate) SetTradeOccurs(b bool) *TurnCreate

SetTradeOccurs sets the "trade_occurs" field.

func (*TurnCreate) SetUserCombatStats

func (tc *TurnCreate) SetUserCombatStats(i []int) *TurnCreate

SetUserCombatStats sets the "user_combat_stats" field.

func (*TurnCreate) SetUserID

func (tc *TurnCreate) SetUserID(s string) *TurnCreate

SetUserID sets the "user_id" field.

func (*TurnCreate) SetUserPostTradePostEventItem

func (tc *TurnCreate) SetUserPostTradePostEventItem(si schema.BigInt) *TurnCreate

SetUserPostTradePostEventItem sets the "user_post_trade_post_event_item" field.

func (*TurnCreate) SetUserPostTradePostEventMoney

func (tc *TurnCreate) SetUserPostTradePostEventMoney(si schema.BigInt) *TurnCreate

SetUserPostTradePostEventMoney sets the "user_post_trade_post_event_money" field.

func (*TurnCreate) SetUserPostTradePreEventItem

func (tc *TurnCreate) SetUserPostTradePreEventItem(si schema.BigInt) *TurnCreate

SetUserPostTradePreEventItem sets the "user_post_trade_pre_event_item" field.

func (*TurnCreate) SetUserPostTradePreEventMoney

func (tc *TurnCreate) SetUserPostTradePreEventMoney(si schema.BigInt) *TurnCreate

SetUserPostTradePreEventMoney sets the "user_post_trade_pre_event_money" field.

func (*TurnCreate) SetUserPreTradeItem

func (tc *TurnCreate) SetUserPreTradeItem(si schema.BigInt) *TurnCreate

SetUserPreTradeItem sets the "user_pre_trade_item" field.

func (*TurnCreate) SetUserPreTradeMoney

func (tc *TurnCreate) SetUserPreTradeMoney(si schema.BigInt) *TurnCreate

SetUserPreTradeMoney sets the "user_pre_trade_money" field.

func (*TurnCreate) SetWarehouseSeizure

func (tc *TurnCreate) SetWarehouseSeizure(b bool) *TurnCreate

SetWarehouseSeizure sets the "warehouse_seizure" field.

func (*TurnCreate) SetWrangleDashedDealer

func (tc *TurnCreate) SetWrangleDashedDealer(b bool) *TurnCreate

SetWrangleDashedDealer sets the "wrangle_dashed_dealer" field.

type TurnCreateBulk

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

TurnCreateBulk is the builder for creating many Turn entities in bulk.

func (*TurnCreateBulk) Exec

func (tcb *TurnCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*TurnCreateBulk) ExecX

func (tcb *TurnCreateBulk) ExecX(ctx context.Context)

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

func (*TurnCreateBulk) Save

func (tcb *TurnCreateBulk) Save(ctx context.Context) ([]*Turn, error)

Save creates the Turn entities in the database.

func (*TurnCreateBulk) SaveX

func (tcb *TurnCreateBulk) SaveX(ctx context.Context) []*Turn

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

type TurnDelete

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

TurnDelete is the builder for deleting a Turn entity.

func (*TurnDelete) Exec

func (td *TurnDelete) Exec(ctx context.Context) (int, error)

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

func (*TurnDelete) ExecX

func (td *TurnDelete) ExecX(ctx context.Context) int

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

func (*TurnDelete) Where

func (td *TurnDelete) Where(ps ...predicate.Turn) *TurnDelete

Where appends a list predicates to the TurnDelete builder.

type TurnDeleteOne

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

TurnDeleteOne is the builder for deleting a single Turn entity.

func (*TurnDeleteOne) Exec

func (tdo *TurnDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*TurnDeleteOne) ExecX

func (tdo *TurnDeleteOne) ExecX(ctx context.Context)

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

type TurnEdge

type TurnEdge struct {
	Node   *Turn  `json:"node"`
	Cursor Cursor `json:"cursor"`
}

TurnEdge is the edge representation of Turn.

type TurnGroupBy

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

TurnGroupBy is the group-by builder for Turn entities.

func (*TurnGroupBy) Aggregate

func (tgb *TurnGroupBy) Aggregate(fns ...AggregateFunc) *TurnGroupBy

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

func (*TurnGroupBy) Bool

func (tgb *TurnGroupBy) Bool(ctx context.Context) (_ bool, err error)

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

func (*TurnGroupBy) BoolX

func (tgb *TurnGroupBy) BoolX(ctx context.Context) bool

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

func (*TurnGroupBy) Bools

func (tgb *TurnGroupBy) Bools(ctx context.Context) ([]bool, error)

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

func (*TurnGroupBy) BoolsX

func (tgb *TurnGroupBy) BoolsX(ctx context.Context) []bool

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

func (*TurnGroupBy) Float64

func (tgb *TurnGroupBy) Float64(ctx context.Context) (_ float64, err error)

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

func (*TurnGroupBy) Float64X

func (tgb *TurnGroupBy) Float64X(ctx context.Context) float64

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

func (*TurnGroupBy) Float64s

func (tgb *TurnGroupBy) Float64s(ctx context.Context) ([]float64, error)

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

func (*TurnGroupBy) Float64sX

func (tgb *TurnGroupBy) Float64sX(ctx context.Context) []float64

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

func (*TurnGroupBy) Int

func (tgb *TurnGroupBy) Int(ctx context.Context) (_ int, err error)

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

func (*TurnGroupBy) IntX

func (tgb *TurnGroupBy) IntX(ctx context.Context) int

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

func (*TurnGroupBy) Ints

func (tgb *TurnGroupBy) Ints(ctx context.Context) ([]int, error)

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

func (*TurnGroupBy) IntsX

func (tgb *TurnGroupBy) IntsX(ctx context.Context) []int

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

func (*TurnGroupBy) Scan

func (tgb *TurnGroupBy) Scan(ctx context.Context, v interface{}) error

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

func (*TurnGroupBy) ScanX

func (tgb *TurnGroupBy) ScanX(ctx context.Context, v interface{})

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

func (*TurnGroupBy) String

func (tgb *TurnGroupBy) String(ctx context.Context) (_ string, err error)

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

func (*TurnGroupBy) StringX

func (tgb *TurnGroupBy) StringX(ctx context.Context) string

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

func (*TurnGroupBy) Strings

func (tgb *TurnGroupBy) Strings(ctx context.Context) ([]string, error)

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

func (*TurnGroupBy) StringsX

func (tgb *TurnGroupBy) StringsX(ctx context.Context) []string

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

type TurnMutation

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

TurnMutation represents an operation that mutates the Turn nodes in the graph.

func (*TurnMutation) AddAmountToGive

func (m *TurnMutation) AddAmountToGive(si schema.BigInt)

AddAmountToGive adds si to the "amount_to_give" field.

func (*TurnMutation) AddField

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

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

func (*TurnMutation) AddMarketPostTradePostEventItem

func (m *TurnMutation) AddMarketPostTradePostEventItem(si schema.BigInt)

AddMarketPostTradePostEventItem adds si to the "market_post_trade_post_event_item" field.

func (*TurnMutation) AddMarketPostTradePostEventMoney

func (m *TurnMutation) AddMarketPostTradePostEventMoney(si schema.BigInt)

AddMarketPostTradePostEventMoney adds si to the "market_post_trade_post_eventMoney" field.

func (*TurnMutation) AddMarketPostTradePreEventItem

func (m *TurnMutation) AddMarketPostTradePreEventItem(si schema.BigInt)

AddMarketPostTradePreEventItem adds si to the "market_post_trade_pre_event_item" field.

func (*TurnMutation) AddMarketPostTradePreEventMoney

func (m *TurnMutation) AddMarketPostTradePreEventMoney(si schema.BigInt)

AddMarketPostTradePreEventMoney adds si to the "market_post_trade_pre_eventMoney" field.

func (*TurnMutation) AddMarketPreTradeItem

func (m *TurnMutation) AddMarketPreTradeItem(si schema.BigInt)

AddMarketPreTradeItem adds si to the "market_pre_trade_item" field.

func (*TurnMutation) AddMarketPreTradeMoney

func (m *TurnMutation) AddMarketPreTradeMoney(si schema.BigInt)

AddMarketPreTradeMoney adds si to the "market_pre_tradeMoney" field.

func (*TurnMutation) AddUserPostTradePostEventItem

func (m *TurnMutation) AddUserPostTradePostEventItem(si schema.BigInt)

AddUserPostTradePostEventItem adds si to the "user_post_trade_post_event_item" field.

func (*TurnMutation) AddUserPostTradePostEventMoney

func (m *TurnMutation) AddUserPostTradePostEventMoney(si schema.BigInt)

AddUserPostTradePostEventMoney adds si to the "user_post_trade_post_event_money" field.

func (*TurnMutation) AddUserPostTradePreEventItem

func (m *TurnMutation) AddUserPostTradePreEventItem(si schema.BigInt)

AddUserPostTradePreEventItem adds si to the "user_post_trade_pre_event_item" field.

func (*TurnMutation) AddUserPostTradePreEventMoney

func (m *TurnMutation) AddUserPostTradePreEventMoney(si schema.BigInt)

AddUserPostTradePreEventMoney adds si to the "user_post_trade_pre_event_money" field.

func (*TurnMutation) AddUserPreTradeItem

func (m *TurnMutation) AddUserPreTradeItem(si schema.BigInt)

AddUserPreTradeItem adds si to the "user_pre_trade_item" field.

func (*TurnMutation) AddUserPreTradeMoney

func (m *TurnMutation) AddUserPreTradeMoney(si schema.BigInt)

AddUserPreTradeMoney adds si to the "user_pre_trade_money" field.

func (*TurnMutation) AddedAmountToGive

func (m *TurnMutation) AddedAmountToGive() (r schema.BigInt, exists bool)

AddedAmountToGive returns the value that was added to the "amount_to_give" field in this mutation.

func (*TurnMutation) AddedEdges

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

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

func (*TurnMutation) AddedField

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

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

func (*TurnMutation) AddedFields

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

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

func (*TurnMutation) AddedIDs

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

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

func (*TurnMutation) AddedMarketPostTradePostEventItem

func (m *TurnMutation) AddedMarketPostTradePostEventItem() (r schema.BigInt, exists bool)

AddedMarketPostTradePostEventItem returns the value that was added to the "market_post_trade_post_event_item" field in this mutation.

func (*TurnMutation) AddedMarketPostTradePostEventMoney

func (m *TurnMutation) AddedMarketPostTradePostEventMoney() (r schema.BigInt, exists bool)

AddedMarketPostTradePostEventMoney returns the value that was added to the "market_post_trade_post_eventMoney" field in this mutation.

func (*TurnMutation) AddedMarketPostTradePreEventItem

func (m *TurnMutation) AddedMarketPostTradePreEventItem() (r schema.BigInt, exists bool)

AddedMarketPostTradePreEventItem returns the value that was added to the "market_post_trade_pre_event_item" field in this mutation.

func (*TurnMutation) AddedMarketPostTradePreEventMoney

func (m *TurnMutation) AddedMarketPostTradePreEventMoney() (r schema.BigInt, exists bool)

AddedMarketPostTradePreEventMoney returns the value that was added to the "market_post_trade_pre_eventMoney" field in this mutation.

func (*TurnMutation) AddedMarketPreTradeItem

func (m *TurnMutation) AddedMarketPreTradeItem() (r schema.BigInt, exists bool)

AddedMarketPreTradeItem returns the value that was added to the "market_pre_trade_item" field in this mutation.

func (*TurnMutation) AddedMarketPreTradeMoney

func (m *TurnMutation) AddedMarketPreTradeMoney() (r schema.BigInt, exists bool)

AddedMarketPreTradeMoney returns the value that was added to the "market_pre_tradeMoney" field in this mutation.

func (*TurnMutation) AddedUserPostTradePostEventItem

func (m *TurnMutation) AddedUserPostTradePostEventItem() (r schema.BigInt, exists bool)

AddedUserPostTradePostEventItem returns the value that was added to the "user_post_trade_post_event_item" field in this mutation.

func (*TurnMutation) AddedUserPostTradePostEventMoney

func (m *TurnMutation) AddedUserPostTradePostEventMoney() (r schema.BigInt, exists bool)

AddedUserPostTradePostEventMoney returns the value that was added to the "user_post_trade_post_event_money" field in this mutation.

func (*TurnMutation) AddedUserPostTradePreEventItem

func (m *TurnMutation) AddedUserPostTradePreEventItem() (r schema.BigInt, exists bool)

AddedUserPostTradePreEventItem returns the value that was added to the "user_post_trade_pre_event_item" field in this mutation.

func (*TurnMutation) AddedUserPostTradePreEventMoney

func (m *TurnMutation) AddedUserPostTradePreEventMoney() (r schema.BigInt, exists bool)

AddedUserPostTradePreEventMoney returns the value that was added to the "user_post_trade_pre_event_money" field in this mutation.

func (*TurnMutation) AddedUserPreTradeItem

func (m *TurnMutation) AddedUserPreTradeItem() (r schema.BigInt, exists bool)

AddedUserPreTradeItem returns the value that was added to the "user_pre_trade_item" field in this mutation.

func (*TurnMutation) AddedUserPreTradeMoney

func (m *TurnMutation) AddedUserPreTradeMoney() (r schema.BigInt, exists bool)

AddedUserPreTradeMoney returns the value that was added to the "user_pre_trade_money" field in this mutation.

func (*TurnMutation) AmountToGive

func (m *TurnMutation) AmountToGive() (r schema.BigInt, exists bool)

AmountToGive returns the value of the "amount_to_give" field in the mutation.

func (*TurnMutation) BribeCops

func (m *TurnMutation) BribeCops() (r bool, exists bool)

BribeCops returns the value of the "bribe_cops" field in the mutation.

func (*TurnMutation) BuyOrSell

func (m *TurnMutation) BuyOrSell() (r bool, exists bool)

BuyOrSell returns the value of the "buy_or_sell" field in the mutation.

func (*TurnMutation) ClearEdge

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

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

func (*TurnMutation) ClearField

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

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

func (*TurnMutation) ClearedEdges

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

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

func (*TurnMutation) ClearedFields

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

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

func (TurnMutation) Client

func (m TurnMutation) 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 (*TurnMutation) CopRaid

func (m *TurnMutation) CopRaid() (r bool, exists bool)

CopRaid returns the value of the "cop_raid" field in the mutation.

func (*TurnMutation) CreatedAt

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

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

func (*TurnMutation) DealerDash

func (m *TurnMutation) DealerDash() (r bool, exists bool)

DealerDash returns the value of the "dealer_dash" field in the mutation.

func (*TurnMutation) DefendGangWar

func (m *TurnMutation) DefendGangWar() (r bool, exists bool)

DefendGangWar returns the value of the "defend_gang_war" field in the mutation.

func (*TurnMutation) DrugLordCombatStats

func (m *TurnMutation) DrugLordCombatStats() (r []int, exists bool)

DrugLordCombatStats returns the value of the "drug_lord_combat_stats" field in the mutation.

func (*TurnMutation) EdgeCleared

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

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

func (*TurnMutation) Field

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

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

func (*TurnMutation) FieldCleared

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

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

func (*TurnMutation) Fields

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

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

func (*TurnMutation) FindItem

func (m *TurnMutation) FindItem() (r bool, exists bool)

FindItem returns the value of the "find_item" field in the mutation.

func (*TurnMutation) GangWar

func (m *TurnMutation) GangWar() (r bool, exists bool)

GangWar returns the value of the "gang_war" field in the mutation.

func (*TurnMutation) ID

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

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

func (*TurnMutation) ItemID

func (m *TurnMutation) ItemID() (r string, exists bool)

ItemID returns the value of the "item_id" field in the mutation.

func (*TurnMutation) LocalShipment

func (m *TurnMutation) LocalShipment() (r bool, exists bool)

LocalShipment returns the value of the "local_shipment" field in the mutation.

func (*TurnMutation) LocationID

func (m *TurnMutation) LocationID() (r string, exists bool)

LocationID returns the value of the "location_id" field in the mutation.

func (*TurnMutation) MarketPostTradePostEventItem

func (m *TurnMutation) MarketPostTradePostEventItem() (r schema.BigInt, exists bool)

MarketPostTradePostEventItem returns the value of the "market_post_trade_post_event_item" field in the mutation.

func (*TurnMutation) MarketPostTradePostEventMoney

func (m *TurnMutation) MarketPostTradePostEventMoney() (r schema.BigInt, exists bool)

MarketPostTradePostEventMoney returns the value of the "market_post_trade_post_eventMoney" field in the mutation.

func (*TurnMutation) MarketPostTradePreEventItem

func (m *TurnMutation) MarketPostTradePreEventItem() (r schema.BigInt, exists bool)

MarketPostTradePreEventItem returns the value of the "market_post_trade_pre_event_item" field in the mutation.

func (*TurnMutation) MarketPostTradePreEventMoney

func (m *TurnMutation) MarketPostTradePreEventMoney() (r schema.BigInt, exists bool)

MarketPostTradePreEventMoney returns the value of the "market_post_trade_pre_eventMoney" field in the mutation.

func (*TurnMutation) MarketPreTradeItem

func (m *TurnMutation) MarketPreTradeItem() (r schema.BigInt, exists bool)

MarketPreTradeItem returns the value of the "market_pre_trade_item" field in the mutation.

func (*TurnMutation) MarketPreTradeMoney

func (m *TurnMutation) MarketPreTradeMoney() (r schema.BigInt, exists bool)

MarketPreTradeMoney returns the value of the "market_pre_tradeMoney" field in the mutation.

func (*TurnMutation) Mugging

func (m *TurnMutation) Mugging() (r bool, exists bool)

Mugging returns the value of the "mugging" field in the mutation.

func (*TurnMutation) OldAmountToGive

func (m *TurnMutation) OldAmountToGive(ctx context.Context) (v schema.BigInt, err error)

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

func (*TurnMutation) OldBribeCops

func (m *TurnMutation) OldBribeCops(ctx context.Context) (v bool, err error)

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

func (*TurnMutation) OldBuyOrSell

func (m *TurnMutation) OldBuyOrSell(ctx context.Context) (v bool, err error)

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

func (*TurnMutation) OldCopRaid

func (m *TurnMutation) OldCopRaid(ctx context.Context) (v bool, err error)

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

func (*TurnMutation) OldCreatedAt

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

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

func (*TurnMutation) OldDealerDash

func (m *TurnMutation) OldDealerDash(ctx context.Context) (v bool, err error)

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

func (*TurnMutation) OldDefendGangWar

func (m *TurnMutation) OldDefendGangWar(ctx context.Context) (v bool, err error)

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

func (*TurnMutation) OldDrugLordCombatStats

func (m *TurnMutation) OldDrugLordCombatStats(ctx context.Context) (v []int, err error)

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

func (*TurnMutation) OldField

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

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

func (*TurnMutation) OldFindItem

func (m *TurnMutation) OldFindItem(ctx context.Context) (v bool, err error)

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

func (*TurnMutation) OldGangWar

func (m *TurnMutation) OldGangWar(ctx context.Context) (v bool, err error)

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

func (*TurnMutation) OldItemID

func (m *TurnMutation) OldItemID(ctx context.Context) (v string, err error)

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

func (*TurnMutation) OldLocalShipment

func (m *TurnMutation) OldLocalShipment(ctx context.Context) (v bool, err error)

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

func (*TurnMutation) OldLocationID

func (m *TurnMutation) OldLocationID(ctx context.Context) (v string, err error)

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

func (*TurnMutation) OldMarketPostTradePostEventItem

func (m *TurnMutation) OldMarketPostTradePostEventItem(ctx context.Context) (v schema.BigInt, err error)

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

func (*TurnMutation) OldMarketPostTradePostEventMoney

func (m *TurnMutation) OldMarketPostTradePostEventMoney(ctx context.Context) (v schema.BigInt, err error)

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

func (*TurnMutation) OldMarketPostTradePreEventItem

func (m *TurnMutation) OldMarketPostTradePreEventItem(ctx context.Context) (v schema.BigInt, err error)

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

func (*TurnMutation) OldMarketPostTradePreEventMoney

func (m *TurnMutation) OldMarketPostTradePreEventMoney(ctx context.Context) (v schema.BigInt, err error)

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

func (*TurnMutation) OldMarketPreTradeItem

func (m *TurnMutation) OldMarketPreTradeItem(ctx context.Context) (v schema.BigInt, err error)

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

func (*TurnMutation) OldMarketPreTradeMoney

func (m *TurnMutation) OldMarketPreTradeMoney(ctx context.Context) (v schema.BigInt, err error)

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

func (*TurnMutation) OldMugging

func (m *TurnMutation) OldMugging(ctx context.Context) (v bool, err error)

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

func (*TurnMutation) OldRunFromMugging

func (m *TurnMutation) OldRunFromMugging(ctx context.Context) (v bool, err error)

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

func (*TurnMutation) OldTradeOccurs

func (m *TurnMutation) OldTradeOccurs(ctx context.Context) (v bool, err error)

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

func (*TurnMutation) OldUserCombatStats

func (m *TurnMutation) OldUserCombatStats(ctx context.Context) (v []int, err error)

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

func (*TurnMutation) OldUserID

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

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

func (*TurnMutation) OldUserPostTradePostEventItem

func (m *TurnMutation) OldUserPostTradePostEventItem(ctx context.Context) (v schema.BigInt, err error)

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

func (*TurnMutation) OldUserPostTradePostEventMoney

func (m *TurnMutation) OldUserPostTradePostEventMoney(ctx context.Context) (v schema.BigInt, err error)

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

func (*TurnMutation) OldUserPostTradePreEventItem

func (m *TurnMutation) OldUserPostTradePreEventItem(ctx context.Context) (v schema.BigInt, err error)

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

func (*TurnMutation) OldUserPostTradePreEventMoney

func (m *TurnMutation) OldUserPostTradePreEventMoney(ctx context.Context) (v schema.BigInt, err error)

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

func (*TurnMutation) OldUserPreTradeItem

func (m *TurnMutation) OldUserPreTradeItem(ctx context.Context) (v schema.BigInt, err error)

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

func (*TurnMutation) OldUserPreTradeMoney

func (m *TurnMutation) OldUserPreTradeMoney(ctx context.Context) (v schema.BigInt, err error)

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

func (*TurnMutation) OldWarehouseSeizure

func (m *TurnMutation) OldWarehouseSeizure(ctx context.Context) (v bool, err error)

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

func (*TurnMutation) OldWrangleDashedDealer

func (m *TurnMutation) OldWrangleDashedDealer(ctx context.Context) (v bool, err error)

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

func (*TurnMutation) Op

func (m *TurnMutation) Op() Op

Op returns the operation name.

func (*TurnMutation) RemovedEdges

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

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

func (*TurnMutation) RemovedIDs

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

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

func (*TurnMutation) ResetAmountToGive

func (m *TurnMutation) ResetAmountToGive()

ResetAmountToGive resets all changes to the "amount_to_give" field.

func (*TurnMutation) ResetBribeCops

func (m *TurnMutation) ResetBribeCops()

ResetBribeCops resets all changes to the "bribe_cops" field.

func (*TurnMutation) ResetBuyOrSell

func (m *TurnMutation) ResetBuyOrSell()

ResetBuyOrSell resets all changes to the "buy_or_sell" field.

func (*TurnMutation) ResetCopRaid

func (m *TurnMutation) ResetCopRaid()

ResetCopRaid resets all changes to the "cop_raid" field.

func (*TurnMutation) ResetCreatedAt

func (m *TurnMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*TurnMutation) ResetDealerDash

func (m *TurnMutation) ResetDealerDash()

ResetDealerDash resets all changes to the "dealer_dash" field.

func (*TurnMutation) ResetDefendGangWar

func (m *TurnMutation) ResetDefendGangWar()

ResetDefendGangWar resets all changes to the "defend_gang_war" field.

func (*TurnMutation) ResetDrugLordCombatStats

func (m *TurnMutation) ResetDrugLordCombatStats()

ResetDrugLordCombatStats resets all changes to the "drug_lord_combat_stats" field.

func (*TurnMutation) ResetEdge

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

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

func (*TurnMutation) ResetField

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

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

func (*TurnMutation) ResetFindItem

func (m *TurnMutation) ResetFindItem()

ResetFindItem resets all changes to the "find_item" field.

func (*TurnMutation) ResetGangWar

func (m *TurnMutation) ResetGangWar()

ResetGangWar resets all changes to the "gang_war" field.

func (*TurnMutation) ResetItemID

func (m *TurnMutation) ResetItemID()

ResetItemID resets all changes to the "item_id" field.

func (*TurnMutation) ResetLocalShipment

func (m *TurnMutation) ResetLocalShipment()

ResetLocalShipment resets all changes to the "local_shipment" field.

func (*TurnMutation) ResetLocationID

func (m *TurnMutation) ResetLocationID()

ResetLocationID resets all changes to the "location_id" field.

func (*TurnMutation) ResetMarketPostTradePostEventItem

func (m *TurnMutation) ResetMarketPostTradePostEventItem()

ResetMarketPostTradePostEventItem resets all changes to the "market_post_trade_post_event_item" field.

func (*TurnMutation) ResetMarketPostTradePostEventMoney

func (m *TurnMutation) ResetMarketPostTradePostEventMoney()

ResetMarketPostTradePostEventMoney resets all changes to the "market_post_trade_post_eventMoney" field.

func (*TurnMutation) ResetMarketPostTradePreEventItem

func (m *TurnMutation) ResetMarketPostTradePreEventItem()

ResetMarketPostTradePreEventItem resets all changes to the "market_post_trade_pre_event_item" field.

func (*TurnMutation) ResetMarketPostTradePreEventMoney

func (m *TurnMutation) ResetMarketPostTradePreEventMoney()

ResetMarketPostTradePreEventMoney resets all changes to the "market_post_trade_pre_eventMoney" field.

func (*TurnMutation) ResetMarketPreTradeItem

func (m *TurnMutation) ResetMarketPreTradeItem()

ResetMarketPreTradeItem resets all changes to the "market_pre_trade_item" field.

func (*TurnMutation) ResetMarketPreTradeMoney

func (m *TurnMutation) ResetMarketPreTradeMoney()

ResetMarketPreTradeMoney resets all changes to the "market_pre_tradeMoney" field.

func (*TurnMutation) ResetMugging

func (m *TurnMutation) ResetMugging()

ResetMugging resets all changes to the "mugging" field.

func (*TurnMutation) ResetRunFromMugging

func (m *TurnMutation) ResetRunFromMugging()

ResetRunFromMugging resets all changes to the "run_from_mugging" field.

func (*TurnMutation) ResetTradeOccurs

func (m *TurnMutation) ResetTradeOccurs()

ResetTradeOccurs resets all changes to the "trade_occurs" field.

func (*TurnMutation) ResetUserCombatStats

func (m *TurnMutation) ResetUserCombatStats()

ResetUserCombatStats resets all changes to the "user_combat_stats" field.

func (*TurnMutation) ResetUserID

func (m *TurnMutation) ResetUserID()

ResetUserID resets all changes to the "user_id" field.

func (*TurnMutation) ResetUserPostTradePostEventItem

func (m *TurnMutation) ResetUserPostTradePostEventItem()

ResetUserPostTradePostEventItem resets all changes to the "user_post_trade_post_event_item" field.

func (*TurnMutation) ResetUserPostTradePostEventMoney

func (m *TurnMutation) ResetUserPostTradePostEventMoney()

ResetUserPostTradePostEventMoney resets all changes to the "user_post_trade_post_event_money" field.

func (*TurnMutation) ResetUserPostTradePreEventItem

func (m *TurnMutation) ResetUserPostTradePreEventItem()

ResetUserPostTradePreEventItem resets all changes to the "user_post_trade_pre_event_item" field.

func (*TurnMutation) ResetUserPostTradePreEventMoney

func (m *TurnMutation) ResetUserPostTradePreEventMoney()

ResetUserPostTradePreEventMoney resets all changes to the "user_post_trade_pre_event_money" field.

func (*TurnMutation) ResetUserPreTradeItem

func (m *TurnMutation) ResetUserPreTradeItem()

ResetUserPreTradeItem resets all changes to the "user_pre_trade_item" field.

func (*TurnMutation) ResetUserPreTradeMoney

func (m *TurnMutation) ResetUserPreTradeMoney()

ResetUserPreTradeMoney resets all changes to the "user_pre_trade_money" field.

func (*TurnMutation) ResetWarehouseSeizure

func (m *TurnMutation) ResetWarehouseSeizure()

ResetWarehouseSeizure resets all changes to the "warehouse_seizure" field.

func (*TurnMutation) ResetWrangleDashedDealer

func (m *TurnMutation) ResetWrangleDashedDealer()

ResetWrangleDashedDealer resets all changes to the "wrangle_dashed_dealer" field.

func (*TurnMutation) RunFromMugging

func (m *TurnMutation) RunFromMugging() (r bool, exists bool)

RunFromMugging returns the value of the "run_from_mugging" field in the mutation.

func (*TurnMutation) SetAmountToGive

func (m *TurnMutation) SetAmountToGive(si schema.BigInt)

SetAmountToGive sets the "amount_to_give" field.

func (*TurnMutation) SetBribeCops

func (m *TurnMutation) SetBribeCops(b bool)

SetBribeCops sets the "bribe_cops" field.

func (*TurnMutation) SetBuyOrSell

func (m *TurnMutation) SetBuyOrSell(b bool)

SetBuyOrSell sets the "buy_or_sell" field.

func (*TurnMutation) SetCopRaid

func (m *TurnMutation) SetCopRaid(b bool)

SetCopRaid sets the "cop_raid" field.

func (*TurnMutation) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*TurnMutation) SetDealerDash

func (m *TurnMutation) SetDealerDash(b bool)

SetDealerDash sets the "dealer_dash" field.

func (*TurnMutation) SetDefendGangWar

func (m *TurnMutation) SetDefendGangWar(b bool)

SetDefendGangWar sets the "defend_gang_war" field.

func (*TurnMutation) SetDrugLordCombatStats

func (m *TurnMutation) SetDrugLordCombatStats(i []int)

SetDrugLordCombatStats sets the "drug_lord_combat_stats" field.

func (*TurnMutation) SetField

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

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

func (*TurnMutation) SetFindItem

func (m *TurnMutation) SetFindItem(b bool)

SetFindItem sets the "find_item" field.

func (*TurnMutation) SetGangWar

func (m *TurnMutation) SetGangWar(b bool)

SetGangWar sets the "gang_war" field.

func (*TurnMutation) SetItemID

func (m *TurnMutation) SetItemID(s string)

SetItemID sets the "item_id" field.

func (*TurnMutation) SetLocalShipment

func (m *TurnMutation) SetLocalShipment(b bool)

SetLocalShipment sets the "local_shipment" field.

func (*TurnMutation) SetLocationID

func (m *TurnMutation) SetLocationID(s string)

SetLocationID sets the "location_id" field.

func (*TurnMutation) SetMarketPostTradePostEventItem

func (m *TurnMutation) SetMarketPostTradePostEventItem(si schema.BigInt)

SetMarketPostTradePostEventItem sets the "market_post_trade_post_event_item" field.

func (*TurnMutation) SetMarketPostTradePostEventMoney

func (m *TurnMutation) SetMarketPostTradePostEventMoney(si schema.BigInt)

SetMarketPostTradePostEventMoney sets the "market_post_trade_post_eventMoney" field.

func (*TurnMutation) SetMarketPostTradePreEventItem

func (m *TurnMutation) SetMarketPostTradePreEventItem(si schema.BigInt)

SetMarketPostTradePreEventItem sets the "market_post_trade_pre_event_item" field.

func (*TurnMutation) SetMarketPostTradePreEventMoney

func (m *TurnMutation) SetMarketPostTradePreEventMoney(si schema.BigInt)

SetMarketPostTradePreEventMoney sets the "market_post_trade_pre_eventMoney" field.

func (*TurnMutation) SetMarketPreTradeItem

func (m *TurnMutation) SetMarketPreTradeItem(si schema.BigInt)

SetMarketPreTradeItem sets the "market_pre_trade_item" field.

func (*TurnMutation) SetMarketPreTradeMoney

func (m *TurnMutation) SetMarketPreTradeMoney(si schema.BigInt)

SetMarketPreTradeMoney sets the "market_pre_tradeMoney" field.

func (*TurnMutation) SetMugging

func (m *TurnMutation) SetMugging(b bool)

SetMugging sets the "mugging" field.

func (*TurnMutation) SetRunFromMugging

func (m *TurnMutation) SetRunFromMugging(b bool)

SetRunFromMugging sets the "run_from_mugging" field.

func (*TurnMutation) SetTradeOccurs

func (m *TurnMutation) SetTradeOccurs(b bool)

SetTradeOccurs sets the "trade_occurs" field.

func (*TurnMutation) SetUserCombatStats

func (m *TurnMutation) SetUserCombatStats(i []int)

SetUserCombatStats sets the "user_combat_stats" field.

func (*TurnMutation) SetUserID

func (m *TurnMutation) SetUserID(s string)

SetUserID sets the "user_id" field.

func (*TurnMutation) SetUserPostTradePostEventItem

func (m *TurnMutation) SetUserPostTradePostEventItem(si schema.BigInt)

SetUserPostTradePostEventItem sets the "user_post_trade_post_event_item" field.

func (*TurnMutation) SetUserPostTradePostEventMoney

func (m *TurnMutation) SetUserPostTradePostEventMoney(si schema.BigInt)

SetUserPostTradePostEventMoney sets the "user_post_trade_post_event_money" field.

func (*TurnMutation) SetUserPostTradePreEventItem

func (m *TurnMutation) SetUserPostTradePreEventItem(si schema.BigInt)

SetUserPostTradePreEventItem sets the "user_post_trade_pre_event_item" field.

func (*TurnMutation) SetUserPostTradePreEventMoney

func (m *TurnMutation) SetUserPostTradePreEventMoney(si schema.BigInt)

SetUserPostTradePreEventMoney sets the "user_post_trade_pre_event_money" field.

func (*TurnMutation) SetUserPreTradeItem

func (m *TurnMutation) SetUserPreTradeItem(si schema.BigInt)

SetUserPreTradeItem sets the "user_pre_trade_item" field.

func (*TurnMutation) SetUserPreTradeMoney

func (m *TurnMutation) SetUserPreTradeMoney(si schema.BigInt)

SetUserPreTradeMoney sets the "user_pre_trade_money" field.

func (*TurnMutation) SetWarehouseSeizure

func (m *TurnMutation) SetWarehouseSeizure(b bool)

SetWarehouseSeizure sets the "warehouse_seizure" field.

func (*TurnMutation) SetWrangleDashedDealer

func (m *TurnMutation) SetWrangleDashedDealer(b bool)

SetWrangleDashedDealer sets the "wrangle_dashed_dealer" field.

func (*TurnMutation) TradeOccurs

func (m *TurnMutation) TradeOccurs() (r bool, exists bool)

TradeOccurs returns the value of the "trade_occurs" field in the mutation.

func (TurnMutation) Tx

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

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

func (*TurnMutation) Type

func (m *TurnMutation) Type() string

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

func (*TurnMutation) UserCombatStats

func (m *TurnMutation) UserCombatStats() (r []int, exists bool)

UserCombatStats returns the value of the "user_combat_stats" field in the mutation.

func (*TurnMutation) UserID

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

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

func (*TurnMutation) UserPostTradePostEventItem

func (m *TurnMutation) UserPostTradePostEventItem() (r schema.BigInt, exists bool)

UserPostTradePostEventItem returns the value of the "user_post_trade_post_event_item" field in the mutation.

func (*TurnMutation) UserPostTradePostEventMoney

func (m *TurnMutation) UserPostTradePostEventMoney() (r schema.BigInt, exists bool)

UserPostTradePostEventMoney returns the value of the "user_post_trade_post_event_money" field in the mutation.

func (*TurnMutation) UserPostTradePreEventItem

func (m *TurnMutation) UserPostTradePreEventItem() (r schema.BigInt, exists bool)

UserPostTradePreEventItem returns the value of the "user_post_trade_pre_event_item" field in the mutation.

func (*TurnMutation) UserPostTradePreEventMoney

func (m *TurnMutation) UserPostTradePreEventMoney() (r schema.BigInt, exists bool)

UserPostTradePreEventMoney returns the value of the "user_post_trade_pre_event_money" field in the mutation.

func (*TurnMutation) UserPreTradeItem

func (m *TurnMutation) UserPreTradeItem() (r schema.BigInt, exists bool)

UserPreTradeItem returns the value of the "user_pre_trade_item" field in the mutation.

func (*TurnMutation) UserPreTradeMoney

func (m *TurnMutation) UserPreTradeMoney() (r schema.BigInt, exists bool)

UserPreTradeMoney returns the value of the "user_pre_trade_money" field in the mutation.

func (*TurnMutation) WarehouseSeizure

func (m *TurnMutation) WarehouseSeizure() (r bool, exists bool)

WarehouseSeizure returns the value of the "warehouse_seizure" field in the mutation.

func (*TurnMutation) Where

func (m *TurnMutation) Where(ps ...predicate.Turn)

Where appends a list predicates to the TurnMutation builder.

func (*TurnMutation) WrangleDashedDealer

func (m *TurnMutation) WrangleDashedDealer() (r bool, exists bool)

WrangleDashedDealer returns the value of the "wrangle_dashed_dealer" field in the mutation.

type TurnOrder

type TurnOrder struct {
	Direction OrderDirection  `json:"direction"`
	Field     *TurnOrderField `json:"field"`
}

TurnOrder defines the ordering of Turn.

type TurnOrderField

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

TurnOrderField defines the ordering field of Turn.

func (TurnOrderField) MarshalGQL

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

MarshalGQL implements graphql.Marshaler interface.

func (TurnOrderField) String

func (f TurnOrderField) String() string

String implement fmt.Stringer interface.

func (*TurnOrderField) UnmarshalGQL

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

UnmarshalGQL implements graphql.Unmarshaler interface.

type TurnPaginateOption

type TurnPaginateOption func(*turnPager) error

TurnPaginateOption enables pagination customization.

func WithTurnFilter

func WithTurnFilter(filter func(*TurnQuery) (*TurnQuery, error)) TurnPaginateOption

WithTurnFilter configures pagination filter.

func WithTurnOrder

func WithTurnOrder(order *TurnOrder) TurnPaginateOption

WithTurnOrder configures pagination ordering.

type TurnQuery

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

TurnQuery is the builder for querying Turn entities.

func (*TurnQuery) All

func (tq *TurnQuery) All(ctx context.Context) ([]*Turn, error)

All executes the query and returns a list of Turns.

func (*TurnQuery) AllX

func (tq *TurnQuery) AllX(ctx context.Context) []*Turn

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

func (*TurnQuery) Clone

func (tq *TurnQuery) Clone() *TurnQuery

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

func (*TurnQuery) CollectFields

func (t *TurnQuery) CollectFields(ctx context.Context, satisfies ...string) *TurnQuery

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

func (*TurnQuery) Count

func (tq *TurnQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*TurnQuery) CountX

func (tq *TurnQuery) CountX(ctx context.Context) int

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

func (*TurnQuery) Exist

func (tq *TurnQuery) Exist(ctx context.Context) (bool, error)

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

func (*TurnQuery) ExistX

func (tq *TurnQuery) ExistX(ctx context.Context) bool

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

func (*TurnQuery) First

func (tq *TurnQuery) First(ctx context.Context) (*Turn, error)

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

func (*TurnQuery) FirstID

func (tq *TurnQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*TurnQuery) FirstIDX

func (tq *TurnQuery) FirstIDX(ctx context.Context) int

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

func (*TurnQuery) FirstX

func (tq *TurnQuery) FirstX(ctx context.Context) *Turn

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

func (*TurnQuery) GroupBy

func (tq *TurnQuery) GroupBy(field string, fields ...string) *TurnGroupBy

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

Example:

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

client.Turn.Query().
	GroupBy(turn.FieldUserID).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*TurnQuery) IDs

func (tq *TurnQuery) IDs(ctx context.Context) ([]int, error)

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

func (*TurnQuery) IDsX

func (tq *TurnQuery) IDsX(ctx context.Context) []int

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

func (*TurnQuery) Limit

func (tq *TurnQuery) Limit(limit int) *TurnQuery

Limit adds a limit step to the query.

func (*TurnQuery) Offset

func (tq *TurnQuery) Offset(offset int) *TurnQuery

Offset adds an offset step to the query.

func (*TurnQuery) Only

func (tq *TurnQuery) Only(ctx context.Context) (*Turn, error)

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

func (*TurnQuery) OnlyID

func (tq *TurnQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*TurnQuery) OnlyIDX

func (tq *TurnQuery) OnlyIDX(ctx context.Context) int

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

func (*TurnQuery) OnlyX

func (tq *TurnQuery) OnlyX(ctx context.Context) *Turn

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

func (*TurnQuery) Order

func (tq *TurnQuery) Order(o ...OrderFunc) *TurnQuery

Order adds an order step to the query.

func (*TurnQuery) Paginate

func (t *TurnQuery) Paginate(
	ctx context.Context, after *Cursor, first *int,
	before *Cursor, last *int, opts ...TurnPaginateOption,
) (*TurnConnection, error)

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

func (*TurnQuery) Select

func (tq *TurnQuery) Select(fields ...string) *TurnSelect

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

Example:

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

client.Turn.Query().
	Select(turn.FieldUserID).
	Scan(ctx, &v)

func (*TurnQuery) Unique

func (tq *TurnQuery) Unique(unique bool) *TurnQuery

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

func (*TurnQuery) Where

func (tq *TurnQuery) Where(ps ...predicate.Turn) *TurnQuery

Where adds a new predicate for the TurnQuery builder.

type TurnSelect

type TurnSelect struct {
	*TurnQuery
	// contains filtered or unexported fields
}

TurnSelect is the builder for selecting fields of Turn entities.

func (*TurnSelect) Bool

func (ts *TurnSelect) Bool(ctx context.Context) (_ bool, err error)

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

func (*TurnSelect) BoolX

func (ts *TurnSelect) BoolX(ctx context.Context) bool

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

func (*TurnSelect) Bools

func (ts *TurnSelect) Bools(ctx context.Context) ([]bool, error)

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

func (*TurnSelect) BoolsX

func (ts *TurnSelect) BoolsX(ctx context.Context) []bool

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

func (*TurnSelect) Float64

func (ts *TurnSelect) Float64(ctx context.Context) (_ float64, err error)

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

func (*TurnSelect) Float64X

func (ts *TurnSelect) Float64X(ctx context.Context) float64

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

func (*TurnSelect) Float64s

func (ts *TurnSelect) Float64s(ctx context.Context) ([]float64, error)

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

func (*TurnSelect) Float64sX

func (ts *TurnSelect) Float64sX(ctx context.Context) []float64

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

func (*TurnSelect) Int

func (ts *TurnSelect) Int(ctx context.Context) (_ int, err error)

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

func (*TurnSelect) IntX

func (ts *TurnSelect) IntX(ctx context.Context) int

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

func (*TurnSelect) Ints

func (ts *TurnSelect) Ints(ctx context.Context) ([]int, error)

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

func (*TurnSelect) IntsX

func (ts *TurnSelect) IntsX(ctx context.Context) []int

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

func (*TurnSelect) Scan

func (ts *TurnSelect) Scan(ctx context.Context, v interface{}) error

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

func (*TurnSelect) ScanX

func (ts *TurnSelect) ScanX(ctx context.Context, v interface{})

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

func (*TurnSelect) String

func (ts *TurnSelect) String(ctx context.Context) (_ string, err error)

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

func (*TurnSelect) StringX

func (ts *TurnSelect) StringX(ctx context.Context) string

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

func (*TurnSelect) Strings

func (ts *TurnSelect) Strings(ctx context.Context) ([]string, error)

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

func (*TurnSelect) StringsX

func (ts *TurnSelect) StringsX(ctx context.Context) []string

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

type TurnUpdate

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

TurnUpdate is the builder for updating Turn entities.

func (*TurnUpdate) AddAmountToGive

func (tu *TurnUpdate) AddAmountToGive(si schema.BigInt) *TurnUpdate

AddAmountToGive adds si to the "amount_to_give" field.

func (*TurnUpdate) AddMarketPostTradePostEventItem

func (tu *TurnUpdate) AddMarketPostTradePostEventItem(si schema.BigInt) *TurnUpdate

AddMarketPostTradePostEventItem adds si to the "market_post_trade_post_event_item" field.

func (*TurnUpdate) AddMarketPostTradePostEventMoney

func (tu *TurnUpdate) AddMarketPostTradePostEventMoney(si schema.BigInt) *TurnUpdate

AddMarketPostTradePostEventMoney adds si to the "market_post_trade_post_eventMoney" field.

func (*TurnUpdate) AddMarketPostTradePreEventItem

func (tu *TurnUpdate) AddMarketPostTradePreEventItem(si schema.BigInt) *TurnUpdate

AddMarketPostTradePreEventItem adds si to the "market_post_trade_pre_event_item" field.

func (*TurnUpdate) AddMarketPostTradePreEventMoney

func (tu *TurnUpdate) AddMarketPostTradePreEventMoney(si schema.BigInt) *TurnUpdate

AddMarketPostTradePreEventMoney adds si to the "market_post_trade_pre_eventMoney" field.

func (*TurnUpdate) AddMarketPreTradeItem

func (tu *TurnUpdate) AddMarketPreTradeItem(si schema.BigInt) *TurnUpdate

AddMarketPreTradeItem adds si to the "market_pre_trade_item" field.

func (*TurnUpdate) AddMarketPreTradeMoney

func (tu *TurnUpdate) AddMarketPreTradeMoney(si schema.BigInt) *TurnUpdate

AddMarketPreTradeMoney adds si to the "market_pre_tradeMoney" field.

func (*TurnUpdate) AddUserPostTradePostEventItem

func (tu *TurnUpdate) AddUserPostTradePostEventItem(si schema.BigInt) *TurnUpdate

AddUserPostTradePostEventItem adds si to the "user_post_trade_post_event_item" field.

func (*TurnUpdate) AddUserPostTradePostEventMoney

func (tu *TurnUpdate) AddUserPostTradePostEventMoney(si schema.BigInt) *TurnUpdate

AddUserPostTradePostEventMoney adds si to the "user_post_trade_post_event_money" field.

func (*TurnUpdate) AddUserPostTradePreEventItem

func (tu *TurnUpdate) AddUserPostTradePreEventItem(si schema.BigInt) *TurnUpdate

AddUserPostTradePreEventItem adds si to the "user_post_trade_pre_event_item" field.

func (*TurnUpdate) AddUserPostTradePreEventMoney

func (tu *TurnUpdate) AddUserPostTradePreEventMoney(si schema.BigInt) *TurnUpdate

AddUserPostTradePreEventMoney adds si to the "user_post_trade_pre_event_money" field.

func (*TurnUpdate) AddUserPreTradeItem

func (tu *TurnUpdate) AddUserPreTradeItem(si schema.BigInt) *TurnUpdate

AddUserPreTradeItem adds si to the "user_pre_trade_item" field.

func (*TurnUpdate) AddUserPreTradeMoney

func (tu *TurnUpdate) AddUserPreTradeMoney(si schema.BigInt) *TurnUpdate

AddUserPreTradeMoney adds si to the "user_pre_trade_money" field.

func (*TurnUpdate) Exec

func (tu *TurnUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*TurnUpdate) ExecX

func (tu *TurnUpdate) ExecX(ctx context.Context)

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

func (*TurnUpdate) Mutation

func (tu *TurnUpdate) Mutation() *TurnMutation

Mutation returns the TurnMutation object of the builder.

func (*TurnUpdate) Save

func (tu *TurnUpdate) Save(ctx context.Context) (int, error)

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

func (*TurnUpdate) SaveX

func (tu *TurnUpdate) SaveX(ctx context.Context) int

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

func (*TurnUpdate) SetAmountToGive

func (tu *TurnUpdate) SetAmountToGive(si schema.BigInt) *TurnUpdate

SetAmountToGive sets the "amount_to_give" field.

func (*TurnUpdate) SetBribeCops

func (tu *TurnUpdate) SetBribeCops(b bool) *TurnUpdate

SetBribeCops sets the "bribe_cops" field.

func (*TurnUpdate) SetCopRaid

func (tu *TurnUpdate) SetCopRaid(b bool) *TurnUpdate

SetCopRaid sets the "cop_raid" field.

func (*TurnUpdate) SetDealerDash

func (tu *TurnUpdate) SetDealerDash(b bool) *TurnUpdate

SetDealerDash sets the "dealer_dash" field.

func (*TurnUpdate) SetDefendGangWar

func (tu *TurnUpdate) SetDefendGangWar(b bool) *TurnUpdate

SetDefendGangWar sets the "defend_gang_war" field.

func (*TurnUpdate) SetDrugLordCombatStats

func (tu *TurnUpdate) SetDrugLordCombatStats(i []int) *TurnUpdate

SetDrugLordCombatStats sets the "drug_lord_combat_stats" field.

func (*TurnUpdate) SetFindItem

func (tu *TurnUpdate) SetFindItem(b bool) *TurnUpdate

SetFindItem sets the "find_item" field.

func (*TurnUpdate) SetGangWar

func (tu *TurnUpdate) SetGangWar(b bool) *TurnUpdate

SetGangWar sets the "gang_war" field.

func (*TurnUpdate) SetLocalShipment

func (tu *TurnUpdate) SetLocalShipment(b bool) *TurnUpdate

SetLocalShipment sets the "local_shipment" field.

func (*TurnUpdate) SetMarketPostTradePostEventItem

func (tu *TurnUpdate) SetMarketPostTradePostEventItem(si schema.BigInt) *TurnUpdate

SetMarketPostTradePostEventItem sets the "market_post_trade_post_event_item" field.

func (*TurnUpdate) SetMarketPostTradePostEventMoney

func (tu *TurnUpdate) SetMarketPostTradePostEventMoney(si schema.BigInt) *TurnUpdate

SetMarketPostTradePostEventMoney sets the "market_post_trade_post_eventMoney" field.

func (*TurnUpdate) SetMarketPostTradePreEventItem

func (tu *TurnUpdate) SetMarketPostTradePreEventItem(si schema.BigInt) *TurnUpdate

SetMarketPostTradePreEventItem sets the "market_post_trade_pre_event_item" field.

func (*TurnUpdate) SetMarketPostTradePreEventMoney

func (tu *TurnUpdate) SetMarketPostTradePreEventMoney(si schema.BigInt) *TurnUpdate

SetMarketPostTradePreEventMoney sets the "market_post_trade_pre_eventMoney" field.

func (*TurnUpdate) SetMarketPreTradeItem

func (tu *TurnUpdate) SetMarketPreTradeItem(si schema.BigInt) *TurnUpdate

SetMarketPreTradeItem sets the "market_pre_trade_item" field.

func (*TurnUpdate) SetMarketPreTradeMoney

func (tu *TurnUpdate) SetMarketPreTradeMoney(si schema.BigInt) *TurnUpdate

SetMarketPreTradeMoney sets the "market_pre_tradeMoney" field.

func (*TurnUpdate) SetMugging

func (tu *TurnUpdate) SetMugging(b bool) *TurnUpdate

SetMugging sets the "mugging" field.

func (*TurnUpdate) SetRunFromMugging

func (tu *TurnUpdate) SetRunFromMugging(b bool) *TurnUpdate

SetRunFromMugging sets the "run_from_mugging" field.

func (*TurnUpdate) SetTradeOccurs

func (tu *TurnUpdate) SetTradeOccurs(b bool) *TurnUpdate

SetTradeOccurs sets the "trade_occurs" field.

func (*TurnUpdate) SetUserCombatStats

func (tu *TurnUpdate) SetUserCombatStats(i []int) *TurnUpdate

SetUserCombatStats sets the "user_combat_stats" field.

func (*TurnUpdate) SetUserPostTradePostEventItem

func (tu *TurnUpdate) SetUserPostTradePostEventItem(si schema.BigInt) *TurnUpdate

SetUserPostTradePostEventItem sets the "user_post_trade_post_event_item" field.

func (*TurnUpdate) SetUserPostTradePostEventMoney

func (tu *TurnUpdate) SetUserPostTradePostEventMoney(si schema.BigInt) *TurnUpdate

SetUserPostTradePostEventMoney sets the "user_post_trade_post_event_money" field.

func (*TurnUpdate) SetUserPostTradePreEventItem

func (tu *TurnUpdate) SetUserPostTradePreEventItem(si schema.BigInt) *TurnUpdate

SetUserPostTradePreEventItem sets the "user_post_trade_pre_event_item" field.

func (*TurnUpdate) SetUserPostTradePreEventMoney

func (tu *TurnUpdate) SetUserPostTradePreEventMoney(si schema.BigInt) *TurnUpdate

SetUserPostTradePreEventMoney sets the "user_post_trade_pre_event_money" field.

func (*TurnUpdate) SetUserPreTradeItem

func (tu *TurnUpdate) SetUserPreTradeItem(si schema.BigInt) *TurnUpdate

SetUserPreTradeItem sets the "user_pre_trade_item" field.

func (*TurnUpdate) SetUserPreTradeMoney

func (tu *TurnUpdate) SetUserPreTradeMoney(si schema.BigInt) *TurnUpdate

SetUserPreTradeMoney sets the "user_pre_trade_money" field.

func (*TurnUpdate) SetWarehouseSeizure

func (tu *TurnUpdate) SetWarehouseSeizure(b bool) *TurnUpdate

SetWarehouseSeizure sets the "warehouse_seizure" field.

func (*TurnUpdate) SetWrangleDashedDealer

func (tu *TurnUpdate) SetWrangleDashedDealer(b bool) *TurnUpdate

SetWrangleDashedDealer sets the "wrangle_dashed_dealer" field.

func (*TurnUpdate) Where

func (tu *TurnUpdate) Where(ps ...predicate.Turn) *TurnUpdate

Where appends a list predicates to the TurnUpdate builder.

type TurnUpdateOne

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

TurnUpdateOne is the builder for updating a single Turn entity.

func (*TurnUpdateOne) AddAmountToGive

func (tuo *TurnUpdateOne) AddAmountToGive(si schema.BigInt) *TurnUpdateOne

AddAmountToGive adds si to the "amount_to_give" field.

func (*TurnUpdateOne) AddMarketPostTradePostEventItem

func (tuo *TurnUpdateOne) AddMarketPostTradePostEventItem(si schema.BigInt) *TurnUpdateOne

AddMarketPostTradePostEventItem adds si to the "market_post_trade_post_event_item" field.

func (*TurnUpdateOne) AddMarketPostTradePostEventMoney

func (tuo *TurnUpdateOne) AddMarketPostTradePostEventMoney(si schema.BigInt) *TurnUpdateOne

AddMarketPostTradePostEventMoney adds si to the "market_post_trade_post_eventMoney" field.

func (*TurnUpdateOne) AddMarketPostTradePreEventItem

func (tuo *TurnUpdateOne) AddMarketPostTradePreEventItem(si schema.BigInt) *TurnUpdateOne

AddMarketPostTradePreEventItem adds si to the "market_post_trade_pre_event_item" field.

func (*TurnUpdateOne) AddMarketPostTradePreEventMoney

func (tuo *TurnUpdateOne) AddMarketPostTradePreEventMoney(si schema.BigInt) *TurnUpdateOne

AddMarketPostTradePreEventMoney adds si to the "market_post_trade_pre_eventMoney" field.

func (*TurnUpdateOne) AddMarketPreTradeItem

func (tuo *TurnUpdateOne) AddMarketPreTradeItem(si schema.BigInt) *TurnUpdateOne

AddMarketPreTradeItem adds si to the "market_pre_trade_item" field.

func (*TurnUpdateOne) AddMarketPreTradeMoney

func (tuo *TurnUpdateOne) AddMarketPreTradeMoney(si schema.BigInt) *TurnUpdateOne

AddMarketPreTradeMoney adds si to the "market_pre_tradeMoney" field.

func (*TurnUpdateOne) AddUserPostTradePostEventItem

func (tuo *TurnUpdateOne) AddUserPostTradePostEventItem(si schema.BigInt) *TurnUpdateOne

AddUserPostTradePostEventItem adds si to the "user_post_trade_post_event_item" field.

func (*TurnUpdateOne) AddUserPostTradePostEventMoney

func (tuo *TurnUpdateOne) AddUserPostTradePostEventMoney(si schema.BigInt) *TurnUpdateOne

AddUserPostTradePostEventMoney adds si to the "user_post_trade_post_event_money" field.

func (*TurnUpdateOne) AddUserPostTradePreEventItem

func (tuo *TurnUpdateOne) AddUserPostTradePreEventItem(si schema.BigInt) *TurnUpdateOne

AddUserPostTradePreEventItem adds si to the "user_post_trade_pre_event_item" field.

func (*TurnUpdateOne) AddUserPostTradePreEventMoney

func (tuo *TurnUpdateOne) AddUserPostTradePreEventMoney(si schema.BigInt) *TurnUpdateOne

AddUserPostTradePreEventMoney adds si to the "user_post_trade_pre_event_money" field.

func (*TurnUpdateOne) AddUserPreTradeItem

func (tuo *TurnUpdateOne) AddUserPreTradeItem(si schema.BigInt) *TurnUpdateOne

AddUserPreTradeItem adds si to the "user_pre_trade_item" field.

func (*TurnUpdateOne) AddUserPreTradeMoney

func (tuo *TurnUpdateOne) AddUserPreTradeMoney(si schema.BigInt) *TurnUpdateOne

AddUserPreTradeMoney adds si to the "user_pre_trade_money" field.

func (*TurnUpdateOne) Exec

func (tuo *TurnUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*TurnUpdateOne) ExecX

func (tuo *TurnUpdateOne) ExecX(ctx context.Context)

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

func (*TurnUpdateOne) Mutation

func (tuo *TurnUpdateOne) Mutation() *TurnMutation

Mutation returns the TurnMutation object of the builder.

func (*TurnUpdateOne) Save

func (tuo *TurnUpdateOne) Save(ctx context.Context) (*Turn, error)

Save executes the query and returns the updated Turn entity.

func (*TurnUpdateOne) SaveX

func (tuo *TurnUpdateOne) SaveX(ctx context.Context) *Turn

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

func (*TurnUpdateOne) Select

func (tuo *TurnUpdateOne) Select(field string, fields ...string) *TurnUpdateOne

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

func (*TurnUpdateOne) SetAmountToGive

func (tuo *TurnUpdateOne) SetAmountToGive(si schema.BigInt) *TurnUpdateOne

SetAmountToGive sets the "amount_to_give" field.

func (*TurnUpdateOne) SetBribeCops

func (tuo *TurnUpdateOne) SetBribeCops(b bool) *TurnUpdateOne

SetBribeCops sets the "bribe_cops" field.

func (*TurnUpdateOne) SetCopRaid

func (tuo *TurnUpdateOne) SetCopRaid(b bool) *TurnUpdateOne

SetCopRaid sets the "cop_raid" field.

func (*TurnUpdateOne) SetDealerDash

func (tuo *TurnUpdateOne) SetDealerDash(b bool) *TurnUpdateOne

SetDealerDash sets the "dealer_dash" field.

func (*TurnUpdateOne) SetDefendGangWar

func (tuo *TurnUpdateOne) SetDefendGangWar(b bool) *TurnUpdateOne

SetDefendGangWar sets the "defend_gang_war" field.

func (*TurnUpdateOne) SetDrugLordCombatStats

func (tuo *TurnUpdateOne) SetDrugLordCombatStats(i []int) *TurnUpdateOne

SetDrugLordCombatStats sets the "drug_lord_combat_stats" field.

func (*TurnUpdateOne) SetFindItem

func (tuo *TurnUpdateOne) SetFindItem(b bool) *TurnUpdateOne

SetFindItem sets the "find_item" field.

func (*TurnUpdateOne) SetGangWar

func (tuo *TurnUpdateOne) SetGangWar(b bool) *TurnUpdateOne

SetGangWar sets the "gang_war" field.

func (*TurnUpdateOne) SetLocalShipment

func (tuo *TurnUpdateOne) SetLocalShipment(b bool) *TurnUpdateOne

SetLocalShipment sets the "local_shipment" field.

func (*TurnUpdateOne) SetMarketPostTradePostEventItem

func (tuo *TurnUpdateOne) SetMarketPostTradePostEventItem(si schema.BigInt) *TurnUpdateOne

SetMarketPostTradePostEventItem sets the "market_post_trade_post_event_item" field.

func (*TurnUpdateOne) SetMarketPostTradePostEventMoney

func (tuo *TurnUpdateOne) SetMarketPostTradePostEventMoney(si schema.BigInt) *TurnUpdateOne

SetMarketPostTradePostEventMoney sets the "market_post_trade_post_eventMoney" field.

func (*TurnUpdateOne) SetMarketPostTradePreEventItem

func (tuo *TurnUpdateOne) SetMarketPostTradePreEventItem(si schema.BigInt) *TurnUpdateOne

SetMarketPostTradePreEventItem sets the "market_post_trade_pre_event_item" field.

func (*TurnUpdateOne) SetMarketPostTradePreEventMoney

func (tuo *TurnUpdateOne) SetMarketPostTradePreEventMoney(si schema.BigInt) *TurnUpdateOne

SetMarketPostTradePreEventMoney sets the "market_post_trade_pre_eventMoney" field.

func (*TurnUpdateOne) SetMarketPreTradeItem

func (tuo *TurnUpdateOne) SetMarketPreTradeItem(si schema.BigInt) *TurnUpdateOne

SetMarketPreTradeItem sets the "market_pre_trade_item" field.

func (*TurnUpdateOne) SetMarketPreTradeMoney

func (tuo *TurnUpdateOne) SetMarketPreTradeMoney(si schema.BigInt) *TurnUpdateOne

SetMarketPreTradeMoney sets the "market_pre_tradeMoney" field.

func (*TurnUpdateOne) SetMugging

func (tuo *TurnUpdateOne) SetMugging(b bool) *TurnUpdateOne

SetMugging sets the "mugging" field.

func (*TurnUpdateOne) SetRunFromMugging

func (tuo *TurnUpdateOne) SetRunFromMugging(b bool) *TurnUpdateOne

SetRunFromMugging sets the "run_from_mugging" field.

func (*TurnUpdateOne) SetTradeOccurs

func (tuo *TurnUpdateOne) SetTradeOccurs(b bool) *TurnUpdateOne

SetTradeOccurs sets the "trade_occurs" field.

func (*TurnUpdateOne) SetUserCombatStats

func (tuo *TurnUpdateOne) SetUserCombatStats(i []int) *TurnUpdateOne

SetUserCombatStats sets the "user_combat_stats" field.

func (*TurnUpdateOne) SetUserPostTradePostEventItem

func (tuo *TurnUpdateOne) SetUserPostTradePostEventItem(si schema.BigInt) *TurnUpdateOne

SetUserPostTradePostEventItem sets the "user_post_trade_post_event_item" field.

func (*TurnUpdateOne) SetUserPostTradePostEventMoney

func (tuo *TurnUpdateOne) SetUserPostTradePostEventMoney(si schema.BigInt) *TurnUpdateOne

SetUserPostTradePostEventMoney sets the "user_post_trade_post_event_money" field.

func (*TurnUpdateOne) SetUserPostTradePreEventItem

func (tuo *TurnUpdateOne) SetUserPostTradePreEventItem(si schema.BigInt) *TurnUpdateOne

SetUserPostTradePreEventItem sets the "user_post_trade_pre_event_item" field.

func (*TurnUpdateOne) SetUserPostTradePreEventMoney

func (tuo *TurnUpdateOne) SetUserPostTradePreEventMoney(si schema.BigInt) *TurnUpdateOne

SetUserPostTradePreEventMoney sets the "user_post_trade_pre_event_money" field.

func (*TurnUpdateOne) SetUserPreTradeItem

func (tuo *TurnUpdateOne) SetUserPreTradeItem(si schema.BigInt) *TurnUpdateOne

SetUserPreTradeItem sets the "user_pre_trade_item" field.

func (*TurnUpdateOne) SetUserPreTradeMoney

func (tuo *TurnUpdateOne) SetUserPreTradeMoney(si schema.BigInt) *TurnUpdateOne

SetUserPreTradeMoney sets the "user_pre_trade_money" field.

func (*TurnUpdateOne) SetWarehouseSeizure

func (tuo *TurnUpdateOne) SetWarehouseSeizure(b bool) *TurnUpdateOne

SetWarehouseSeizure sets the "warehouse_seizure" field.

func (*TurnUpdateOne) SetWrangleDashedDealer

func (tuo *TurnUpdateOne) SetWrangleDashedDealer(b bool) *TurnUpdateOne

SetWrangleDashedDealer sets the "wrangle_dashed_dealer" field.

type Turns

type Turns []*Turn

Turns is a parsable slice of Turn.

type Tx

type Tx struct {

	// Turn is the client for interacting with the Turn builders.
	Turn *TurnClient
	// contains filtered or unexported fields
}

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

func TxFromContext

func TxFromContext(ctx context.Context) *Tx

TxFromContext returns a Tx stored inside a context, or nil if there isn't one.

func (*Tx) Client

func (tx *Tx) Client() *Client

Client returns a Client that binds to current transaction.

func (*Tx) Commit

func (tx *Tx) Commit() error

Commit commits the transaction.

func (*Tx) OnCommit

func (tx *Tx) OnCommit(f CommitHook)

OnCommit adds a hook to call on commit.

func (*Tx) OnRollback

func (tx *Tx) OnRollback(f RollbackHook)

OnRollback adds a hook to call on rollback.

func (*Tx) Rollback

func (tx *Tx) Rollback() error

Rollback rollbacks the transaction.

type ValidationError

type ValidationError struct {
	Name string // Field or edge name.
	// contains filtered or unexported fields
}

ValidationError returns when validating a field fails.

func (*ValidationError) Error

func (e *ValidationError) Error() string

Error implements the error interface.

func (*ValidationError) Unwrap

func (e *ValidationError) Unwrap() error

Unwrap implements the errors.Wrapper interface.

type Value

type Value = ent.Value

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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