ent

package
v1.5.1 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2022 License: GPL-3.0 Imports: 19 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.
	TypeHero              = "Hero"
	TypeSubscription      = "Subscription"
	TypeSubscriptionMatch = "SubscriptionMatch"
)

Variables

This section is empty.

Functions

func IsConstraintError

func IsConstraintError(err error) bool

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

func IsNotFound

func IsNotFound(err error) bool

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

func IsNotLoaded

func IsNotLoaded(err error) bool

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

func IsNotSingular

func IsNotSingular(err error) bool

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

func IsValidationError

func IsValidationError(err error) bool

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

func MaskNotFound

func MaskNotFound(err error) error

MaskNotFound masks not found error.

func NewContext

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

NewContext returns a new context with the given Client attached.

func NewTxContext

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

NewTxContext returns a new context with the given Tx attached.

Types

type AggregateFunc

type AggregateFunc func(*sql.Selector) string

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

func As

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

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

func Count

func Count() AggregateFunc

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

func Max

func Max(field string) AggregateFunc

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

func Mean

func Mean(field string) AggregateFunc

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

func Min

func Min(field string) AggregateFunc

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

func Sum

func Sum(field string) AggregateFunc

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

type Client

type Client struct {

	// Schema is the client for creating, migrating and dropping schema.
	Schema *migrate.Schema
	// Hero is the client for interacting with the Hero builders.
	Hero *HeroClient
	// Subscription is the client for interacting with the Subscription builders.
	Subscription *SubscriptionClient
	// SubscriptionMatch is the client for interacting with the SubscriptionMatch builders.
	SubscriptionMatch *SubscriptionMatchClient
	// 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().
	Hero.
	Query().
	Count(ctx)

func (*Client) Tx

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

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

func (*Client) Use

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

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

type CommitFunc

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

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

func (CommitFunc) Commit

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

Commit calls f(ctx, m).

type CommitHook

type CommitHook func(Committer) Committer

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

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

type Committer

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

Committer is the interface that wraps the Commit method.

type ConstraintError

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

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

func (ConstraintError) Error

func (e ConstraintError) Error() string

Error implements the error interface.

func (*ConstraintError) Unwrap

func (e *ConstraintError) Unwrap() error

Unwrap implements the errors.Wrapper interface.

type Hero

type Hero struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// CreateTime holds the value of the "create_time" field.
	CreateTime time.Time `json:"create_time,omitempty"`
	// UpdateTime holds the value of the "update_time" field.
	UpdateTime time.Time `json:"update_time,omitempty"`
	// HeroID holds the value of the "hero_id" field.
	HeroID int `json:"hero_id,omitempty"`
	// Name holds the value of the "name" field.
	Name string `json:"name,omitempty"`
	// LocalizedName holds the value of the "localized_name" field.
	LocalizedName string `json:"localized_name,omitempty"`
	// contains filtered or unexported fields
}

Hero is the model entity for the Hero schema.

func (*Hero) String

func (h *Hero) String() string

String implements the fmt.Stringer.

func (*Hero) Unwrap

func (h *Hero) Unwrap() *Hero

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

func (h *Hero) Update() *HeroUpdateOne

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

type HeroClient

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

HeroClient is a client for the Hero schema.

func NewHeroClient

func NewHeroClient(c config) *HeroClient

NewHeroClient returns a client for the Hero from the given config.

func (*HeroClient) Create

func (c *HeroClient) Create() *HeroCreate

Create returns a builder for creating a Hero entity.

func (*HeroClient) CreateBulk

func (c *HeroClient) CreateBulk(builders ...*HeroCreate) *HeroCreateBulk

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

func (*HeroClient) Delete

func (c *HeroClient) Delete() *HeroDelete

Delete returns a delete builder for Hero.

func (*HeroClient) DeleteOne

func (c *HeroClient) DeleteOne(h *Hero) *HeroDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*HeroClient) DeleteOneID

func (c *HeroClient) DeleteOneID(id int) *HeroDeleteOne

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

func (*HeroClient) Get

func (c *HeroClient) Get(ctx context.Context, id int) (*Hero, error)

Get returns a Hero entity by its id.

func (*HeroClient) GetX

func (c *HeroClient) GetX(ctx context.Context, id int) *Hero

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

func (*HeroClient) Hooks

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

Hooks returns the client hooks.

func (*HeroClient) Query

func (c *HeroClient) Query() *HeroQuery

Query returns a query builder for Hero.

func (*HeroClient) Update

func (c *HeroClient) Update() *HeroUpdate

Update returns an update builder for Hero.

func (*HeroClient) UpdateOne

func (c *HeroClient) UpdateOne(h *Hero) *HeroUpdateOne

UpdateOne returns an update builder for the given entity.

func (*HeroClient) UpdateOneID

func (c *HeroClient) UpdateOneID(id int) *HeroUpdateOne

UpdateOneID returns an update builder for the given id.

func (*HeroClient) Use

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

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

type HeroCreate

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

HeroCreate is the builder for creating a Hero entity.

func (*HeroCreate) Exec

func (hc *HeroCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*HeroCreate) ExecX

func (hc *HeroCreate) ExecX(ctx context.Context)

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

func (*HeroCreate) Mutation

func (hc *HeroCreate) Mutation() *HeroMutation

Mutation returns the HeroMutation object of the builder.

func (*HeroCreate) Save

func (hc *HeroCreate) Save(ctx context.Context) (*Hero, error)

Save creates the Hero in the database.

func (*HeroCreate) SaveX

func (hc *HeroCreate) SaveX(ctx context.Context) *Hero

SaveX calls Save and panics if Save returns an error.

func (*HeroCreate) SetCreateTime

func (hc *HeroCreate) SetCreateTime(t time.Time) *HeroCreate

SetCreateTime sets the "create_time" field.

func (*HeroCreate) SetHeroID

func (hc *HeroCreate) SetHeroID(i int) *HeroCreate

SetHeroID sets the "hero_id" field.

func (*HeroCreate) SetLocalizedName

func (hc *HeroCreate) SetLocalizedName(s string) *HeroCreate

SetLocalizedName sets the "localized_name" field.

func (*HeroCreate) SetName

func (hc *HeroCreate) SetName(s string) *HeroCreate

SetName sets the "name" field.

func (*HeroCreate) SetNillableCreateTime

func (hc *HeroCreate) SetNillableCreateTime(t *time.Time) *HeroCreate

SetNillableCreateTime sets the "create_time" field if the given value is not nil.

func (*HeroCreate) SetNillableUpdateTime

func (hc *HeroCreate) SetNillableUpdateTime(t *time.Time) *HeroCreate

SetNillableUpdateTime sets the "update_time" field if the given value is not nil.

func (*HeroCreate) SetUpdateTime

func (hc *HeroCreate) SetUpdateTime(t time.Time) *HeroCreate

SetUpdateTime sets the "update_time" field.

type HeroCreateBulk

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

HeroCreateBulk is the builder for creating many Hero entities in bulk.

func (*HeroCreateBulk) Exec

func (hcb *HeroCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*HeroCreateBulk) ExecX

func (hcb *HeroCreateBulk) ExecX(ctx context.Context)

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

func (*HeroCreateBulk) Save

func (hcb *HeroCreateBulk) Save(ctx context.Context) ([]*Hero, error)

Save creates the Hero entities in the database.

func (*HeroCreateBulk) SaveX

func (hcb *HeroCreateBulk) SaveX(ctx context.Context) []*Hero

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

type HeroDelete

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

HeroDelete is the builder for deleting a Hero entity.

func (*HeroDelete) Exec

func (hd *HeroDelete) Exec(ctx context.Context) (int, error)

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

func (*HeroDelete) ExecX

func (hd *HeroDelete) ExecX(ctx context.Context) int

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

func (*HeroDelete) Where

func (hd *HeroDelete) Where(ps ...predicate.Hero) *HeroDelete

Where appends a list predicates to the HeroDelete builder.

type HeroDeleteOne

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

HeroDeleteOne is the builder for deleting a single Hero entity.

func (*HeroDeleteOne) Exec

func (hdo *HeroDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*HeroDeleteOne) ExecX

func (hdo *HeroDeleteOne) ExecX(ctx context.Context)

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

type HeroGroupBy

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

HeroGroupBy is the group-by builder for Hero entities.

func (*HeroGroupBy) Aggregate

func (hgb *HeroGroupBy) Aggregate(fns ...AggregateFunc) *HeroGroupBy

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

func (*HeroGroupBy) Bool

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

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

func (*HeroGroupBy) BoolX

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

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

func (*HeroGroupBy) Bools

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

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

func (*HeroGroupBy) BoolsX

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

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

func (*HeroGroupBy) Float64

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

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

func (*HeroGroupBy) Float64X

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

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

func (*HeroGroupBy) Float64s

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

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

func (*HeroGroupBy) Float64sX

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

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

func (*HeroGroupBy) Int

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

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

func (*HeroGroupBy) IntX

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

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

func (*HeroGroupBy) Ints

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

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

func (*HeroGroupBy) IntsX

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

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

func (*HeroGroupBy) Scan

func (hgb *HeroGroupBy) Scan(ctx context.Context, v interface{}) error

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

func (*HeroGroupBy) ScanX

func (s *HeroGroupBy) ScanX(ctx context.Context, v interface{})

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

func (*HeroGroupBy) String

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

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

func (*HeroGroupBy) StringX

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

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

func (*HeroGroupBy) Strings

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

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

func (*HeroGroupBy) StringsX

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

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

type HeroMutation

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

HeroMutation represents an operation that mutates the Hero nodes in the graph.

func (*HeroMutation) AddField

func (m *HeroMutation) 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 (*HeroMutation) AddHeroID

func (m *HeroMutation) AddHeroID(i int)

AddHeroID adds i to the "hero_id" field.

func (*HeroMutation) AddedEdges

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

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

func (*HeroMutation) AddedField

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

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

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

func (*HeroMutation) AddedHeroID

func (m *HeroMutation) AddedHeroID() (r int, exists bool)

AddedHeroID returns the value that was added to the "hero_id" field in this mutation.

func (*HeroMutation) AddedIDs

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

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

func (*HeroMutation) ClearEdge

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

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

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

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

func (*HeroMutation) ClearedFields

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

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

func (HeroMutation) Client

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

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

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

func (*HeroMutation) EdgeCleared

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

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

func (*HeroMutation) Field

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

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

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

func (*HeroMutation) Fields

func (m *HeroMutation) 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 (*HeroMutation) HeroID

func (m *HeroMutation) HeroID() (r int, exists bool)

HeroID returns the value of the "hero_id" field in the mutation.

func (*HeroMutation) ID

func (m *HeroMutation) 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 (*HeroMutation) IDs

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

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

func (*HeroMutation) LocalizedName

func (m *HeroMutation) LocalizedName() (r string, exists bool)

LocalizedName returns the value of the "localized_name" field in the mutation.

func (*HeroMutation) Name

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

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

func (*HeroMutation) OldCreateTime

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

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

func (m *HeroMutation) 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 (*HeroMutation) OldHeroID

func (m *HeroMutation) OldHeroID(ctx context.Context) (v int, err error)

OldHeroID returns the old "hero_id" field's value of the Hero entity. If the Hero 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 (*HeroMutation) OldLocalizedName

func (m *HeroMutation) OldLocalizedName(ctx context.Context) (v string, err error)

OldLocalizedName returns the old "localized_name" field's value of the Hero entity. If the Hero 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 (*HeroMutation) OldName

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

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

func (m *HeroMutation) OldUpdateTime(ctx context.Context) (v time.Time, err error)

OldUpdateTime returns the old "update_time" field's value of the Hero entity. If the Hero 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 (*HeroMutation) Op

func (m *HeroMutation) Op() Op

Op returns the operation name.

func (*HeroMutation) RemovedEdges

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

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

func (*HeroMutation) RemovedIDs

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

func (m *HeroMutation) ResetCreateTime()

ResetCreateTime resets all changes to the "create_time" field.

func (*HeroMutation) ResetEdge

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

func (m *HeroMutation) 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 (*HeroMutation) ResetHeroID

func (m *HeroMutation) ResetHeroID()

ResetHeroID resets all changes to the "hero_id" field.

func (*HeroMutation) ResetLocalizedName

func (m *HeroMutation) ResetLocalizedName()

ResetLocalizedName resets all changes to the "localized_name" field.

func (*HeroMutation) ResetName

func (m *HeroMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*HeroMutation) ResetUpdateTime

func (m *HeroMutation) ResetUpdateTime()

ResetUpdateTime resets all changes to the "update_time" field.

func (*HeroMutation) SetCreateTime

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

SetCreateTime sets the "create_time" field.

func (*HeroMutation) SetField

func (m *HeroMutation) 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 (*HeroMutation) SetHeroID

func (m *HeroMutation) SetHeroID(i int)

SetHeroID sets the "hero_id" field.

func (*HeroMutation) SetLocalizedName

func (m *HeroMutation) SetLocalizedName(s string)

SetLocalizedName sets the "localized_name" field.

func (*HeroMutation) SetName

func (m *HeroMutation) SetName(s string)

SetName sets the "name" field.

func (*HeroMutation) SetUpdateTime

func (m *HeroMutation) SetUpdateTime(t time.Time)

SetUpdateTime sets the "update_time" field.

func (HeroMutation) Tx

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

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

func (*HeroMutation) Type

func (m *HeroMutation) Type() string

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

func (*HeroMutation) UpdateTime

func (m *HeroMutation) UpdateTime() (r time.Time, exists bool)

UpdateTime returns the value of the "update_time" field in the mutation.

func (*HeroMutation) Where

func (m *HeroMutation) Where(ps ...predicate.Hero)

Where appends a list predicates to the HeroMutation builder.

type HeroQuery

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

HeroQuery is the builder for querying Hero entities.

func (*HeroQuery) All

func (hq *HeroQuery) All(ctx context.Context) ([]*Hero, error)

All executes the query and returns a list of Heros.

func (*HeroQuery) AllX

func (hq *HeroQuery) AllX(ctx context.Context) []*Hero

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

func (*HeroQuery) Clone

func (hq *HeroQuery) Clone() *HeroQuery

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

func (*HeroQuery) Count

func (hq *HeroQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*HeroQuery) CountX

func (hq *HeroQuery) CountX(ctx context.Context) int

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

func (*HeroQuery) Exist

func (hq *HeroQuery) Exist(ctx context.Context) (bool, error)

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

func (*HeroQuery) ExistX

func (hq *HeroQuery) ExistX(ctx context.Context) bool

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

func (*HeroQuery) First

func (hq *HeroQuery) First(ctx context.Context) (*Hero, error)

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

func (*HeroQuery) FirstID

func (hq *HeroQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*HeroQuery) FirstIDX

func (hq *HeroQuery) FirstIDX(ctx context.Context) int

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

func (*HeroQuery) FirstX

func (hq *HeroQuery) FirstX(ctx context.Context) *Hero

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

func (*HeroQuery) GroupBy

func (hq *HeroQuery) GroupBy(field string, fields ...string) *HeroGroupBy

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

client.Hero.Query().
	GroupBy(hero.FieldCreateTime).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*HeroQuery) IDs

func (hq *HeroQuery) IDs(ctx context.Context) ([]int, error)

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

func (*HeroQuery) IDsX

func (hq *HeroQuery) IDsX(ctx context.Context) []int

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

func (*HeroQuery) Limit

func (hq *HeroQuery) Limit(limit int) *HeroQuery

Limit adds a limit step to the query.

func (*HeroQuery) Offset

func (hq *HeroQuery) Offset(offset int) *HeroQuery

Offset adds an offset step to the query.

func (*HeroQuery) Only

func (hq *HeroQuery) Only(ctx context.Context) (*Hero, error)

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

func (*HeroQuery) OnlyID

func (hq *HeroQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*HeroQuery) OnlyIDX

func (hq *HeroQuery) OnlyIDX(ctx context.Context) int

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

func (*HeroQuery) OnlyX

func (hq *HeroQuery) OnlyX(ctx context.Context) *Hero

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

func (*HeroQuery) Order

func (hq *HeroQuery) Order(o ...OrderFunc) *HeroQuery

Order adds an order step to the query.

func (*HeroQuery) Select

func (hq *HeroQuery) Select(fields ...string) *HeroSelect

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 {
	CreateTime time.Time `json:"create_time,omitempty"`
}

client.Hero.Query().
	Select(hero.FieldCreateTime).
	Scan(ctx, &v)

func (*HeroQuery) Unique

func (hq *HeroQuery) Unique(unique bool) *HeroQuery

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

func (hq *HeroQuery) Where(ps ...predicate.Hero) *HeroQuery

Where adds a new predicate for the HeroQuery builder.

type HeroSelect

type HeroSelect struct {
	*HeroQuery
	// contains filtered or unexported fields
}

HeroSelect is the builder for selecting fields of Hero entities.

func (*HeroSelect) Bool

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

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

func (*HeroSelect) BoolX

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

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

func (*HeroSelect) Bools

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

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

func (*HeroSelect) BoolsX

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

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

func (*HeroSelect) Float64

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

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

func (*HeroSelect) Float64X

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

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

func (*HeroSelect) Float64s

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

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

func (*HeroSelect) Float64sX

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

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

func (*HeroSelect) Int

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

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

func (*HeroSelect) IntX

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

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

func (*HeroSelect) Ints

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

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

func (*HeroSelect) IntsX

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

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

func (*HeroSelect) Scan

func (hs *HeroSelect) Scan(ctx context.Context, v interface{}) error

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

func (*HeroSelect) ScanX

func (s *HeroSelect) ScanX(ctx context.Context, v interface{})

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

func (*HeroSelect) String

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

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

func (*HeroSelect) StringX

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

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

func (*HeroSelect) Strings

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

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

func (*HeroSelect) StringsX

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

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

type HeroUpdate

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

HeroUpdate is the builder for updating Hero entities.

func (*HeroUpdate) AddHeroID

func (hu *HeroUpdate) AddHeroID(i int) *HeroUpdate

AddHeroID adds i to the "hero_id" field.

func (*HeroUpdate) Exec

func (hu *HeroUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*HeroUpdate) ExecX

func (hu *HeroUpdate) ExecX(ctx context.Context)

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

func (*HeroUpdate) Mutation

func (hu *HeroUpdate) Mutation() *HeroMutation

Mutation returns the HeroMutation object of the builder.

func (*HeroUpdate) Save

func (hu *HeroUpdate) Save(ctx context.Context) (int, error)

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

func (*HeroUpdate) SaveX

func (hu *HeroUpdate) SaveX(ctx context.Context) int

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

func (*HeroUpdate) SetHeroID

func (hu *HeroUpdate) SetHeroID(i int) *HeroUpdate

SetHeroID sets the "hero_id" field.

func (*HeroUpdate) SetLocalizedName

func (hu *HeroUpdate) SetLocalizedName(s string) *HeroUpdate

SetLocalizedName sets the "localized_name" field.

func (*HeroUpdate) SetName

func (hu *HeroUpdate) SetName(s string) *HeroUpdate

SetName sets the "name" field.

func (*HeroUpdate) SetUpdateTime

func (hu *HeroUpdate) SetUpdateTime(t time.Time) *HeroUpdate

SetUpdateTime sets the "update_time" field.

func (*HeroUpdate) Where

func (hu *HeroUpdate) Where(ps ...predicate.Hero) *HeroUpdate

Where appends a list predicates to the HeroUpdate builder.

type HeroUpdateOne

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

HeroUpdateOne is the builder for updating a single Hero entity.

func (*HeroUpdateOne) AddHeroID

func (huo *HeroUpdateOne) AddHeroID(i int) *HeroUpdateOne

AddHeroID adds i to the "hero_id" field.

func (*HeroUpdateOne) Exec

func (huo *HeroUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*HeroUpdateOne) ExecX

func (huo *HeroUpdateOne) ExecX(ctx context.Context)

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

func (*HeroUpdateOne) Mutation

func (huo *HeroUpdateOne) Mutation() *HeroMutation

Mutation returns the HeroMutation object of the builder.

func (*HeroUpdateOne) Save

func (huo *HeroUpdateOne) Save(ctx context.Context) (*Hero, error)

Save executes the query and returns the updated Hero entity.

func (*HeroUpdateOne) SaveX

func (huo *HeroUpdateOne) SaveX(ctx context.Context) *Hero

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

func (*HeroUpdateOne) Select

func (huo *HeroUpdateOne) Select(field string, fields ...string) *HeroUpdateOne

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

func (*HeroUpdateOne) SetHeroID

func (huo *HeroUpdateOne) SetHeroID(i int) *HeroUpdateOne

SetHeroID sets the "hero_id" field.

func (*HeroUpdateOne) SetLocalizedName

func (huo *HeroUpdateOne) SetLocalizedName(s string) *HeroUpdateOne

SetLocalizedName sets the "localized_name" field.

func (*HeroUpdateOne) SetName

func (huo *HeroUpdateOne) SetName(s string) *HeroUpdateOne

SetName sets the "name" field.

func (*HeroUpdateOne) SetUpdateTime

func (huo *HeroUpdateOne) SetUpdateTime(t time.Time) *HeroUpdateOne

SetUpdateTime sets the "update_time" field.

type Heros

type Heros []*Hero

Heros is a parsable slice of Hero.

type Hook

type Hook = ent.Hook

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

type MutateFunc

type MutateFunc = ent.MutateFunc

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

type Mutation

type Mutation = ent.Mutation

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

type Mutator

type Mutator = ent.Mutator

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

type NotFoundError

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

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

func (*NotFoundError) Error

func (e *NotFoundError) Error() string

Error implements the error interface.

type NotLoadedError

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

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

func (*NotLoadedError) Error

func (e *NotLoadedError) Error() string

Error implements the error interface.

type NotSingularError

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

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

func (*NotSingularError) Error

func (e *NotSingularError) Error() string

Error implements the error interface.

type Op

type Op = ent.Op

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

type Option

type Option func(*config)

Option function to configure the client.

func Debug

func Debug() Option

Debug enables debug logging on the ent.Driver.

func Driver

func Driver(driver dialect.Driver) Option

Driver configures the client driver.

func Log

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

Log sets the logging function for debug mode.

type OrderFunc

type OrderFunc func(*sql.Selector)

OrderFunc applies an ordering on the sql selector.

func Asc

func Asc(fields ...string) OrderFunc

Asc applies the given fields in ASC order.

func Desc

func Desc(fields ...string) OrderFunc

Desc applies the given fields in DESC order.

type Policy

type Policy = ent.Policy

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

type Query

type Query = ent.Query

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

type RollbackFunc

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

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

func (RollbackFunc) Rollback

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

Rollback calls f(ctx, m).

type RollbackHook

type RollbackHook func(Rollbacker) Rollbacker

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

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

type Rollbacker

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

Rollbacker is the interface that wraps the Rollback method.

type Subscription

type Subscription struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// CreateTime holds the value of the "create_time" field.
	CreateTime time.Time `json:"create_time,omitempty"`
	// UpdateTime holds the value of the "update_time" field.
	UpdateTime time.Time `json:"update_time,omitempty"`
	// GroupID holds the value of the "group_id" field.
	GroupID int `json:"group_id,omitempty"`
	// SteamID holds the value of the "steam_id" field.
	SteamID string `json:"steam_id,omitempty"`
	// Alias holds the value of the "alias" field.
	Alias string `json:"alias,omitempty"`
	// contains filtered or unexported fields
}

Subscription is the model entity for the Subscription schema.

func (*Subscription) String

func (s *Subscription) String() string

String implements the fmt.Stringer.

func (*Subscription) Unwrap

func (s *Subscription) Unwrap() *Subscription

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

func (s *Subscription) Update() *SubscriptionUpdateOne

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

type SubscriptionClient

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

SubscriptionClient is a client for the Subscription schema.

func NewSubscriptionClient

func NewSubscriptionClient(c config) *SubscriptionClient

NewSubscriptionClient returns a client for the Subscription from the given config.

func (*SubscriptionClient) Create

Create returns a builder for creating a Subscription entity.

func (*SubscriptionClient) CreateBulk

func (c *SubscriptionClient) CreateBulk(builders ...*SubscriptionCreate) *SubscriptionCreateBulk

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

func (*SubscriptionClient) Delete

Delete returns a delete builder for Subscription.

func (*SubscriptionClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*SubscriptionClient) DeleteOneID

func (c *SubscriptionClient) DeleteOneID(id int) *SubscriptionDeleteOne

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

func (*SubscriptionClient) Get

Get returns a Subscription entity by its id.

func (*SubscriptionClient) GetX

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

func (*SubscriptionClient) Hooks

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

Hooks returns the client hooks.

func (*SubscriptionClient) Query

Query returns a query builder for Subscription.

func (*SubscriptionClient) Update

Update returns an update builder for Subscription.

func (*SubscriptionClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*SubscriptionClient) UpdateOneID

func (c *SubscriptionClient) UpdateOneID(id int) *SubscriptionUpdateOne

UpdateOneID returns an update builder for the given id.

func (*SubscriptionClient) Use

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

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

type SubscriptionCreate

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

SubscriptionCreate is the builder for creating a Subscription entity.

func (*SubscriptionCreate) Exec

func (sc *SubscriptionCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*SubscriptionCreate) ExecX

func (sc *SubscriptionCreate) ExecX(ctx context.Context)

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

func (*SubscriptionCreate) Mutation

func (sc *SubscriptionCreate) Mutation() *SubscriptionMutation

Mutation returns the SubscriptionMutation object of the builder.

func (*SubscriptionCreate) Save

Save creates the Subscription in the database.

func (*SubscriptionCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*SubscriptionCreate) SetAlias

func (sc *SubscriptionCreate) SetAlias(s string) *SubscriptionCreate

SetAlias sets the "alias" field.

func (*SubscriptionCreate) SetCreateTime

func (sc *SubscriptionCreate) SetCreateTime(t time.Time) *SubscriptionCreate

SetCreateTime sets the "create_time" field.

func (*SubscriptionCreate) SetGroupID

func (sc *SubscriptionCreate) SetGroupID(i int) *SubscriptionCreate

SetGroupID sets the "group_id" field.

func (*SubscriptionCreate) SetNillableCreateTime

func (sc *SubscriptionCreate) SetNillableCreateTime(t *time.Time) *SubscriptionCreate

SetNillableCreateTime sets the "create_time" field if the given value is not nil.

func (*SubscriptionCreate) SetNillableUpdateTime

func (sc *SubscriptionCreate) SetNillableUpdateTime(t *time.Time) *SubscriptionCreate

SetNillableUpdateTime sets the "update_time" field if the given value is not nil.

func (*SubscriptionCreate) SetSteamID

func (sc *SubscriptionCreate) SetSteamID(s string) *SubscriptionCreate

SetSteamID sets the "steam_id" field.

func (*SubscriptionCreate) SetUpdateTime

func (sc *SubscriptionCreate) SetUpdateTime(t time.Time) *SubscriptionCreate

SetUpdateTime sets the "update_time" field.

type SubscriptionCreateBulk

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

SubscriptionCreateBulk is the builder for creating many Subscription entities in bulk.

func (*SubscriptionCreateBulk) Exec

Exec executes the query.

func (*SubscriptionCreateBulk) ExecX

func (scb *SubscriptionCreateBulk) ExecX(ctx context.Context)

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

func (*SubscriptionCreateBulk) Save

Save creates the Subscription entities in the database.

func (*SubscriptionCreateBulk) SaveX

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

type SubscriptionDelete

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

SubscriptionDelete is the builder for deleting a Subscription entity.

func (*SubscriptionDelete) Exec

func (sd *SubscriptionDelete) Exec(ctx context.Context) (int, error)

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

func (*SubscriptionDelete) ExecX

func (sd *SubscriptionDelete) ExecX(ctx context.Context) int

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

func (*SubscriptionDelete) Where

Where appends a list predicates to the SubscriptionDelete builder.

type SubscriptionDeleteOne

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

SubscriptionDeleteOne is the builder for deleting a single Subscription entity.

func (*SubscriptionDeleteOne) Exec

func (sdo *SubscriptionDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*SubscriptionDeleteOne) ExecX

func (sdo *SubscriptionDeleteOne) ExecX(ctx context.Context)

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

type SubscriptionGroupBy

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

SubscriptionGroupBy is the group-by builder for Subscription entities.

func (*SubscriptionGroupBy) Aggregate

func (sgb *SubscriptionGroupBy) Aggregate(fns ...AggregateFunc) *SubscriptionGroupBy

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

func (*SubscriptionGroupBy) Bool

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

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

func (*SubscriptionGroupBy) BoolX

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

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

func (*SubscriptionGroupBy) Bools

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

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

func (*SubscriptionGroupBy) BoolsX

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

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

func (*SubscriptionGroupBy) Float64

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

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

func (*SubscriptionGroupBy) Float64X

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

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

func (*SubscriptionGroupBy) Float64s

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

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

func (*SubscriptionGroupBy) Float64sX

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

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

func (*SubscriptionGroupBy) Int

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

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

func (*SubscriptionGroupBy) IntX

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

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

func (*SubscriptionGroupBy) Ints

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

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

func (*SubscriptionGroupBy) IntsX

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

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

func (*SubscriptionGroupBy) Scan

func (sgb *SubscriptionGroupBy) Scan(ctx context.Context, v interface{}) error

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

func (*SubscriptionGroupBy) ScanX

func (s *SubscriptionGroupBy) ScanX(ctx context.Context, v interface{})

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

func (*SubscriptionGroupBy) String

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

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

func (*SubscriptionGroupBy) StringX

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

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

func (*SubscriptionGroupBy) Strings

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

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

func (*SubscriptionGroupBy) StringsX

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

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

type SubscriptionMatch

type SubscriptionMatch struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// CreateTime holds the value of the "create_time" field.
	CreateTime time.Time `json:"create_time,omitempty"`
	// UpdateTime holds the value of the "update_time" field.
	UpdateTime time.Time `json:"update_time,omitempty"`
	// MatchID holds the value of the "match_id" field.
	MatchID int64 `json:"match_id,omitempty"`
	// PlayerID holds the value of the "player_id" field.
	PlayerID string `json:"player_id,omitempty"`
	// PlayerSlot holds the value of the "player_slot" field.
	PlayerSlot int `json:"player_slot,omitempty"`
	// RadiantWin holds the value of the "radiant_win" field.
	RadiantWin bool `json:"radiant_win,omitempty"`
	// Duration holds the value of the "duration" field.
	Duration int `json:"duration,omitempty"`
	// GameMode holds the value of the "game_mode" field.
	GameMode int `json:"game_mode,omitempty"`
	// LobbyType holds the value of the "lobby_type" field.
	LobbyType int `json:"lobby_type,omitempty"`
	// HeroID holds the value of the "hero_id" field.
	HeroID int `json:"hero_id,omitempty"`
	// StartTime holds the value of the "start_time" field.
	StartTime int `json:"start_time,omitempty"`
	// Version holds the value of the "version" field.
	Version int `json:"version,omitempty"`
	// Kills holds the value of the "kills" field.
	Kills int `json:"kills,omitempty"`
	// Deaths holds the value of the "deaths" field.
	Deaths int `json:"deaths,omitempty"`
	// Assists holds the value of the "assists" field.
	Assists int `json:"assists,omitempty"`
	// Skill holds the value of the "skill" field.
	Skill *int `json:"skill,omitempty"`
	// LeaverStatus holds the value of the "leaver_status" field.
	LeaverStatus int `json:"leaver_status,omitempty"`
	// PartySize holds the value of the "party_size" field.
	PartySize int `json:"party_size,omitempty"`
	// contains filtered or unexported fields
}

SubscriptionMatch is the model entity for the SubscriptionMatch schema.

func (*SubscriptionMatch) String

func (sm *SubscriptionMatch) String() string

String implements the fmt.Stringer.

func (*SubscriptionMatch) Unwrap

func (sm *SubscriptionMatch) Unwrap() *SubscriptionMatch

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

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

type SubscriptionMatchClient

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

SubscriptionMatchClient is a client for the SubscriptionMatch schema.

func NewSubscriptionMatchClient

func NewSubscriptionMatchClient(c config) *SubscriptionMatchClient

NewSubscriptionMatchClient returns a client for the SubscriptionMatch from the given config.

func (*SubscriptionMatchClient) Create

Create returns a builder for creating a SubscriptionMatch entity.

func (*SubscriptionMatchClient) CreateBulk

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

func (*SubscriptionMatchClient) Delete

Delete returns a delete builder for SubscriptionMatch.

func (*SubscriptionMatchClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*SubscriptionMatchClient) DeleteOneID

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

func (*SubscriptionMatchClient) Get

Get returns a SubscriptionMatch entity by its id.

func (*SubscriptionMatchClient) GetX

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

func (*SubscriptionMatchClient) Hooks

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

Hooks returns the client hooks.

func (*SubscriptionMatchClient) Query

Query returns a query builder for SubscriptionMatch.

func (*SubscriptionMatchClient) Update

Update returns an update builder for SubscriptionMatch.

func (*SubscriptionMatchClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*SubscriptionMatchClient) UpdateOneID

UpdateOneID returns an update builder for the given id.

func (*SubscriptionMatchClient) Use

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

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

type SubscriptionMatchCreate

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

SubscriptionMatchCreate is the builder for creating a SubscriptionMatch entity.

func (*SubscriptionMatchCreate) Exec

Exec executes the query.

func (*SubscriptionMatchCreate) ExecX

func (smc *SubscriptionMatchCreate) ExecX(ctx context.Context)

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

func (*SubscriptionMatchCreate) Mutation

Mutation returns the SubscriptionMatchMutation object of the builder.

func (*SubscriptionMatchCreate) Save

Save creates the SubscriptionMatch in the database.

func (*SubscriptionMatchCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*SubscriptionMatchCreate) SetAssists

SetAssists sets the "assists" field.

func (*SubscriptionMatchCreate) SetCreateTime

SetCreateTime sets the "create_time" field.

func (*SubscriptionMatchCreate) SetDeaths

SetDeaths sets the "deaths" field.

func (*SubscriptionMatchCreate) SetDuration

SetDuration sets the "duration" field.

func (*SubscriptionMatchCreate) SetGameMode

SetGameMode sets the "game_mode" field.

func (*SubscriptionMatchCreate) SetHeroID

SetHeroID sets the "hero_id" field.

func (*SubscriptionMatchCreate) SetKills

SetKills sets the "kills" field.

func (*SubscriptionMatchCreate) SetLeaverStatus

func (smc *SubscriptionMatchCreate) SetLeaverStatus(i int) *SubscriptionMatchCreate

SetLeaverStatus sets the "leaver_status" field.

func (*SubscriptionMatchCreate) SetLobbyType

func (smc *SubscriptionMatchCreate) SetLobbyType(i int) *SubscriptionMatchCreate

SetLobbyType sets the "lobby_type" field.

func (*SubscriptionMatchCreate) SetMatchID

SetMatchID sets the "match_id" field.

func (*SubscriptionMatchCreate) SetNillableCreateTime

func (smc *SubscriptionMatchCreate) SetNillableCreateTime(t *time.Time) *SubscriptionMatchCreate

SetNillableCreateTime sets the "create_time" field if the given value is not nil.

func (*SubscriptionMatchCreate) SetNillableSkill

func (smc *SubscriptionMatchCreate) SetNillableSkill(i *int) *SubscriptionMatchCreate

SetNillableSkill sets the "skill" field if the given value is not nil.

func (*SubscriptionMatchCreate) SetNillableUpdateTime

func (smc *SubscriptionMatchCreate) SetNillableUpdateTime(t *time.Time) *SubscriptionMatchCreate

SetNillableUpdateTime sets the "update_time" field if the given value is not nil.

func (*SubscriptionMatchCreate) SetPartySize

func (smc *SubscriptionMatchCreate) SetPartySize(i int) *SubscriptionMatchCreate

SetPartySize sets the "party_size" field.

func (*SubscriptionMatchCreate) SetPlayerID

SetPlayerID sets the "player_id" field.

func (*SubscriptionMatchCreate) SetPlayerSlot

func (smc *SubscriptionMatchCreate) SetPlayerSlot(i int) *SubscriptionMatchCreate

SetPlayerSlot sets the "player_slot" field.

func (*SubscriptionMatchCreate) SetRadiantWin

func (smc *SubscriptionMatchCreate) SetRadiantWin(b bool) *SubscriptionMatchCreate

SetRadiantWin sets the "radiant_win" field.

func (*SubscriptionMatchCreate) SetSkill

SetSkill sets the "skill" field.

func (*SubscriptionMatchCreate) SetStartTime

func (smc *SubscriptionMatchCreate) SetStartTime(i int) *SubscriptionMatchCreate

SetStartTime sets the "start_time" field.

func (*SubscriptionMatchCreate) SetUpdateTime

SetUpdateTime sets the "update_time" field.

func (*SubscriptionMatchCreate) SetVersion

SetVersion sets the "version" field.

type SubscriptionMatchCreateBulk

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

SubscriptionMatchCreateBulk is the builder for creating many SubscriptionMatch entities in bulk.

func (*SubscriptionMatchCreateBulk) Exec

Exec executes the query.

func (*SubscriptionMatchCreateBulk) ExecX

func (smcb *SubscriptionMatchCreateBulk) ExecX(ctx context.Context)

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

func (*SubscriptionMatchCreateBulk) Save

Save creates the SubscriptionMatch entities in the database.

func (*SubscriptionMatchCreateBulk) SaveX

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

type SubscriptionMatchDelete

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

SubscriptionMatchDelete is the builder for deleting a SubscriptionMatch entity.

func (*SubscriptionMatchDelete) Exec

func (smd *SubscriptionMatchDelete) Exec(ctx context.Context) (int, error)

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

func (*SubscriptionMatchDelete) ExecX

func (smd *SubscriptionMatchDelete) ExecX(ctx context.Context) int

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

func (*SubscriptionMatchDelete) Where

Where appends a list predicates to the SubscriptionMatchDelete builder.

type SubscriptionMatchDeleteOne

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

SubscriptionMatchDeleteOne is the builder for deleting a single SubscriptionMatch entity.

func (*SubscriptionMatchDeleteOne) Exec

Exec executes the deletion query.

func (*SubscriptionMatchDeleteOne) ExecX

func (smdo *SubscriptionMatchDeleteOne) ExecX(ctx context.Context)

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

type SubscriptionMatchGroupBy

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

SubscriptionMatchGroupBy is the group-by builder for SubscriptionMatch entities.

func (*SubscriptionMatchGroupBy) Aggregate

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

func (*SubscriptionMatchGroupBy) Bool

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

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

func (*SubscriptionMatchGroupBy) BoolX

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

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

func (*SubscriptionMatchGroupBy) Bools

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

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

func (*SubscriptionMatchGroupBy) BoolsX

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

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

func (*SubscriptionMatchGroupBy) Float64

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

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

func (*SubscriptionMatchGroupBy) Float64X

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

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

func (*SubscriptionMatchGroupBy) Float64s

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

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

func (*SubscriptionMatchGroupBy) Float64sX

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

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

func (*SubscriptionMatchGroupBy) Int

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

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

func (*SubscriptionMatchGroupBy) IntX

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

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

func (*SubscriptionMatchGroupBy) Ints

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

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

func (*SubscriptionMatchGroupBy) IntsX

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

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

func (*SubscriptionMatchGroupBy) Scan

func (smgb *SubscriptionMatchGroupBy) Scan(ctx context.Context, v interface{}) error

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

func (*SubscriptionMatchGroupBy) ScanX

func (s *SubscriptionMatchGroupBy) ScanX(ctx context.Context, v interface{})

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

func (*SubscriptionMatchGroupBy) String

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

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

func (*SubscriptionMatchGroupBy) StringX

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

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

func (*SubscriptionMatchGroupBy) Strings

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

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

func (*SubscriptionMatchGroupBy) StringsX

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

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

type SubscriptionMatchMutation

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

SubscriptionMatchMutation represents an operation that mutates the SubscriptionMatch nodes in the graph.

func (*SubscriptionMatchMutation) AddAssists

func (m *SubscriptionMatchMutation) AddAssists(i int)

AddAssists adds i to the "assists" field.

func (*SubscriptionMatchMutation) AddDeaths

func (m *SubscriptionMatchMutation) AddDeaths(i int)

AddDeaths adds i to the "deaths" field.

func (*SubscriptionMatchMutation) AddDuration

func (m *SubscriptionMatchMutation) AddDuration(i int)

AddDuration adds i to the "duration" field.

func (*SubscriptionMatchMutation) AddField

func (m *SubscriptionMatchMutation) 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 (*SubscriptionMatchMutation) AddGameMode

func (m *SubscriptionMatchMutation) AddGameMode(i int)

AddGameMode adds i to the "game_mode" field.

func (*SubscriptionMatchMutation) AddHeroID

func (m *SubscriptionMatchMutation) AddHeroID(i int)

AddHeroID adds i to the "hero_id" field.

func (*SubscriptionMatchMutation) AddKills

func (m *SubscriptionMatchMutation) AddKills(i int)

AddKills adds i to the "kills" field.

func (*SubscriptionMatchMutation) AddLeaverStatus

func (m *SubscriptionMatchMutation) AddLeaverStatus(i int)

AddLeaverStatus adds i to the "leaver_status" field.

func (*SubscriptionMatchMutation) AddLobbyType

func (m *SubscriptionMatchMutation) AddLobbyType(i int)

AddLobbyType adds i to the "lobby_type" field.

func (*SubscriptionMatchMutation) AddMatchID

func (m *SubscriptionMatchMutation) AddMatchID(i int64)

AddMatchID adds i to the "match_id" field.

func (*SubscriptionMatchMutation) AddPartySize

func (m *SubscriptionMatchMutation) AddPartySize(i int)

AddPartySize adds i to the "party_size" field.

func (*SubscriptionMatchMutation) AddPlayerSlot

func (m *SubscriptionMatchMutation) AddPlayerSlot(i int)

AddPlayerSlot adds i to the "player_slot" field.

func (*SubscriptionMatchMutation) AddSkill

func (m *SubscriptionMatchMutation) AddSkill(i int)

AddSkill adds i to the "skill" field.

func (*SubscriptionMatchMutation) AddStartTime

func (m *SubscriptionMatchMutation) AddStartTime(i int)

AddStartTime adds i to the "start_time" field.

func (*SubscriptionMatchMutation) AddVersion

func (m *SubscriptionMatchMutation) AddVersion(i int)

AddVersion adds i to the "version" field.

func (*SubscriptionMatchMutation) AddedAssists

func (m *SubscriptionMatchMutation) AddedAssists() (r int, exists bool)

AddedAssists returns the value that was added to the "assists" field in this mutation.

func (*SubscriptionMatchMutation) AddedDeaths

func (m *SubscriptionMatchMutation) AddedDeaths() (r int, exists bool)

AddedDeaths returns the value that was added to the "deaths" field in this mutation.

func (*SubscriptionMatchMutation) AddedDuration

func (m *SubscriptionMatchMutation) AddedDuration() (r int, exists bool)

AddedDuration returns the value that was added to the "duration" field in this mutation.

func (*SubscriptionMatchMutation) AddedEdges

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

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

func (*SubscriptionMatchMutation) AddedField

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

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

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

func (*SubscriptionMatchMutation) AddedGameMode

func (m *SubscriptionMatchMutation) AddedGameMode() (r int, exists bool)

AddedGameMode returns the value that was added to the "game_mode" field in this mutation.

func (*SubscriptionMatchMutation) AddedHeroID

func (m *SubscriptionMatchMutation) AddedHeroID() (r int, exists bool)

AddedHeroID returns the value that was added to the "hero_id" field in this mutation.

func (*SubscriptionMatchMutation) AddedIDs

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

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

func (*SubscriptionMatchMutation) AddedKills

func (m *SubscriptionMatchMutation) AddedKills() (r int, exists bool)

AddedKills returns the value that was added to the "kills" field in this mutation.

func (*SubscriptionMatchMutation) AddedLeaverStatus

func (m *SubscriptionMatchMutation) AddedLeaverStatus() (r int, exists bool)

AddedLeaverStatus returns the value that was added to the "leaver_status" field in this mutation.

func (*SubscriptionMatchMutation) AddedLobbyType

func (m *SubscriptionMatchMutation) AddedLobbyType() (r int, exists bool)

AddedLobbyType returns the value that was added to the "lobby_type" field in this mutation.

func (*SubscriptionMatchMutation) AddedMatchID

func (m *SubscriptionMatchMutation) AddedMatchID() (r int64, exists bool)

AddedMatchID returns the value that was added to the "match_id" field in this mutation.

func (*SubscriptionMatchMutation) AddedPartySize

func (m *SubscriptionMatchMutation) AddedPartySize() (r int, exists bool)

AddedPartySize returns the value that was added to the "party_size" field in this mutation.

func (*SubscriptionMatchMutation) AddedPlayerSlot

func (m *SubscriptionMatchMutation) AddedPlayerSlot() (r int, exists bool)

AddedPlayerSlot returns the value that was added to the "player_slot" field in this mutation.

func (*SubscriptionMatchMutation) AddedSkill

func (m *SubscriptionMatchMutation) AddedSkill() (r int, exists bool)

AddedSkill returns the value that was added to the "skill" field in this mutation.

func (*SubscriptionMatchMutation) AddedStartTime

func (m *SubscriptionMatchMutation) AddedStartTime() (r int, exists bool)

AddedStartTime returns the value that was added to the "start_time" field in this mutation.

func (*SubscriptionMatchMutation) AddedVersion

func (m *SubscriptionMatchMutation) AddedVersion() (r int, exists bool)

AddedVersion returns the value that was added to the "version" field in this mutation.

func (*SubscriptionMatchMutation) Assists

func (m *SubscriptionMatchMutation) Assists() (r int, exists bool)

Assists returns the value of the "assists" field in the mutation.

func (*SubscriptionMatchMutation) ClearEdge

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

func (m *SubscriptionMatchMutation) 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 (*SubscriptionMatchMutation) ClearSkill

func (m *SubscriptionMatchMutation) ClearSkill()

ClearSkill clears the value of the "skill" field.

func (*SubscriptionMatchMutation) ClearedEdges

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

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

func (*SubscriptionMatchMutation) ClearedFields

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

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

func (SubscriptionMatchMutation) Client

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

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

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

func (*SubscriptionMatchMutation) Deaths

func (m *SubscriptionMatchMutation) Deaths() (r int, exists bool)

Deaths returns the value of the "deaths" field in the mutation.

func (*SubscriptionMatchMutation) Duration

func (m *SubscriptionMatchMutation) Duration() (r int, exists bool)

Duration returns the value of the "duration" field in the mutation.

func (*SubscriptionMatchMutation) EdgeCleared

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

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

func (*SubscriptionMatchMutation) Field

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

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

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

func (*SubscriptionMatchMutation) Fields

func (m *SubscriptionMatchMutation) 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 (*SubscriptionMatchMutation) GameMode

func (m *SubscriptionMatchMutation) GameMode() (r int, exists bool)

GameMode returns the value of the "game_mode" field in the mutation.

func (*SubscriptionMatchMutation) HeroID

func (m *SubscriptionMatchMutation) HeroID() (r int, exists bool)

HeroID returns the value of the "hero_id" field in the mutation.

func (*SubscriptionMatchMutation) ID

func (m *SubscriptionMatchMutation) 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 (*SubscriptionMatchMutation) IDs

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

func (*SubscriptionMatchMutation) Kills

func (m *SubscriptionMatchMutation) Kills() (r int, exists bool)

Kills returns the value of the "kills" field in the mutation.

func (*SubscriptionMatchMutation) LeaverStatus

func (m *SubscriptionMatchMutation) LeaverStatus() (r int, exists bool)

LeaverStatus returns the value of the "leaver_status" field in the mutation.

func (*SubscriptionMatchMutation) LobbyType

func (m *SubscriptionMatchMutation) LobbyType() (r int, exists bool)

LobbyType returns the value of the "lobby_type" field in the mutation.

func (*SubscriptionMatchMutation) MatchID

func (m *SubscriptionMatchMutation) MatchID() (r int64, exists bool)

MatchID returns the value of the "match_id" field in the mutation.

func (*SubscriptionMatchMutation) OldAssists

func (m *SubscriptionMatchMutation) OldAssists(ctx context.Context) (v int, err error)

OldAssists returns the old "assists" field's value of the SubscriptionMatch entity. If the SubscriptionMatch 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 (*SubscriptionMatchMutation) OldCreateTime

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

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

func (m *SubscriptionMatchMutation) OldDeaths(ctx context.Context) (v int, err error)

OldDeaths returns the old "deaths" field's value of the SubscriptionMatch entity. If the SubscriptionMatch 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 (*SubscriptionMatchMutation) OldDuration

func (m *SubscriptionMatchMutation) OldDuration(ctx context.Context) (v int, err error)

OldDuration returns the old "duration" field's value of the SubscriptionMatch entity. If the SubscriptionMatch 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 (*SubscriptionMatchMutation) OldField

func (m *SubscriptionMatchMutation) 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 (*SubscriptionMatchMutation) OldGameMode

func (m *SubscriptionMatchMutation) OldGameMode(ctx context.Context) (v int, err error)

OldGameMode returns the old "game_mode" field's value of the SubscriptionMatch entity. If the SubscriptionMatch 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 (*SubscriptionMatchMutation) OldHeroID

func (m *SubscriptionMatchMutation) OldHeroID(ctx context.Context) (v int, err error)

OldHeroID returns the old "hero_id" field's value of the SubscriptionMatch entity. If the SubscriptionMatch 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 (*SubscriptionMatchMutation) OldKills

func (m *SubscriptionMatchMutation) OldKills(ctx context.Context) (v int, err error)

OldKills returns the old "kills" field's value of the SubscriptionMatch entity. If the SubscriptionMatch 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 (*SubscriptionMatchMutation) OldLeaverStatus

func (m *SubscriptionMatchMutation) OldLeaverStatus(ctx context.Context) (v int, err error)

OldLeaverStatus returns the old "leaver_status" field's value of the SubscriptionMatch entity. If the SubscriptionMatch 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 (*SubscriptionMatchMutation) OldLobbyType

func (m *SubscriptionMatchMutation) OldLobbyType(ctx context.Context) (v int, err error)

OldLobbyType returns the old "lobby_type" field's value of the SubscriptionMatch entity. If the SubscriptionMatch 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 (*SubscriptionMatchMutation) OldMatchID

func (m *SubscriptionMatchMutation) OldMatchID(ctx context.Context) (v int64, err error)

OldMatchID returns the old "match_id" field's value of the SubscriptionMatch entity. If the SubscriptionMatch 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 (*SubscriptionMatchMutation) OldPartySize

func (m *SubscriptionMatchMutation) OldPartySize(ctx context.Context) (v int, err error)

OldPartySize returns the old "party_size" field's value of the SubscriptionMatch entity. If the SubscriptionMatch 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 (*SubscriptionMatchMutation) OldPlayerID

func (m *SubscriptionMatchMutation) OldPlayerID(ctx context.Context) (v string, err error)

OldPlayerID returns the old "player_id" field's value of the SubscriptionMatch entity. If the SubscriptionMatch 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 (*SubscriptionMatchMutation) OldPlayerSlot

func (m *SubscriptionMatchMutation) OldPlayerSlot(ctx context.Context) (v int, err error)

OldPlayerSlot returns the old "player_slot" field's value of the SubscriptionMatch entity. If the SubscriptionMatch 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 (*SubscriptionMatchMutation) OldRadiantWin

func (m *SubscriptionMatchMutation) OldRadiantWin(ctx context.Context) (v bool, err error)

OldRadiantWin returns the old "radiant_win" field's value of the SubscriptionMatch entity. If the SubscriptionMatch 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 (*SubscriptionMatchMutation) OldSkill

func (m *SubscriptionMatchMutation) OldSkill(ctx context.Context) (v *int, err error)

OldSkill returns the old "skill" field's value of the SubscriptionMatch entity. If the SubscriptionMatch 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 (*SubscriptionMatchMutation) OldStartTime

func (m *SubscriptionMatchMutation) OldStartTime(ctx context.Context) (v int, err error)

OldStartTime returns the old "start_time" field's value of the SubscriptionMatch entity. If the SubscriptionMatch 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 (*SubscriptionMatchMutation) OldUpdateTime

func (m *SubscriptionMatchMutation) OldUpdateTime(ctx context.Context) (v time.Time, err error)

OldUpdateTime returns the old "update_time" field's value of the SubscriptionMatch entity. If the SubscriptionMatch 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 (*SubscriptionMatchMutation) OldVersion

func (m *SubscriptionMatchMutation) OldVersion(ctx context.Context) (v int, err error)

OldVersion returns the old "version" field's value of the SubscriptionMatch entity. If the SubscriptionMatch 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 (*SubscriptionMatchMutation) Op

func (m *SubscriptionMatchMutation) Op() Op

Op returns the operation name.

func (*SubscriptionMatchMutation) PartySize

func (m *SubscriptionMatchMutation) PartySize() (r int, exists bool)

PartySize returns the value of the "party_size" field in the mutation.

func (*SubscriptionMatchMutation) PlayerID

func (m *SubscriptionMatchMutation) PlayerID() (r string, exists bool)

PlayerID returns the value of the "player_id" field in the mutation.

func (*SubscriptionMatchMutation) PlayerSlot

func (m *SubscriptionMatchMutation) PlayerSlot() (r int, exists bool)

PlayerSlot returns the value of the "player_slot" field in the mutation.

func (*SubscriptionMatchMutation) RadiantWin

func (m *SubscriptionMatchMutation) RadiantWin() (r bool, exists bool)

RadiantWin returns the value of the "radiant_win" field in the mutation.

func (*SubscriptionMatchMutation) RemovedEdges

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

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

func (*SubscriptionMatchMutation) RemovedIDs

func (m *SubscriptionMatchMutation) 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 (*SubscriptionMatchMutation) ResetAssists

func (m *SubscriptionMatchMutation) ResetAssists()

ResetAssists resets all changes to the "assists" field.

func (*SubscriptionMatchMutation) ResetCreateTime

func (m *SubscriptionMatchMutation) ResetCreateTime()

ResetCreateTime resets all changes to the "create_time" field.

func (*SubscriptionMatchMutation) ResetDeaths

func (m *SubscriptionMatchMutation) ResetDeaths()

ResetDeaths resets all changes to the "deaths" field.

func (*SubscriptionMatchMutation) ResetDuration

func (m *SubscriptionMatchMutation) ResetDuration()

ResetDuration resets all changes to the "duration" field.

func (*SubscriptionMatchMutation) ResetEdge

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

func (m *SubscriptionMatchMutation) 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 (*SubscriptionMatchMutation) ResetGameMode

func (m *SubscriptionMatchMutation) ResetGameMode()

ResetGameMode resets all changes to the "game_mode" field.

func (*SubscriptionMatchMutation) ResetHeroID

func (m *SubscriptionMatchMutation) ResetHeroID()

ResetHeroID resets all changes to the "hero_id" field.

func (*SubscriptionMatchMutation) ResetKills

func (m *SubscriptionMatchMutation) ResetKills()

ResetKills resets all changes to the "kills" field.

func (*SubscriptionMatchMutation) ResetLeaverStatus

func (m *SubscriptionMatchMutation) ResetLeaverStatus()

ResetLeaverStatus resets all changes to the "leaver_status" field.

func (*SubscriptionMatchMutation) ResetLobbyType

func (m *SubscriptionMatchMutation) ResetLobbyType()

ResetLobbyType resets all changes to the "lobby_type" field.

func (*SubscriptionMatchMutation) ResetMatchID

func (m *SubscriptionMatchMutation) ResetMatchID()

ResetMatchID resets all changes to the "match_id" field.

func (*SubscriptionMatchMutation) ResetPartySize

func (m *SubscriptionMatchMutation) ResetPartySize()

ResetPartySize resets all changes to the "party_size" field.

func (*SubscriptionMatchMutation) ResetPlayerID

func (m *SubscriptionMatchMutation) ResetPlayerID()

ResetPlayerID resets all changes to the "player_id" field.

func (*SubscriptionMatchMutation) ResetPlayerSlot

func (m *SubscriptionMatchMutation) ResetPlayerSlot()

ResetPlayerSlot resets all changes to the "player_slot" field.

func (*SubscriptionMatchMutation) ResetRadiantWin

func (m *SubscriptionMatchMutation) ResetRadiantWin()

ResetRadiantWin resets all changes to the "radiant_win" field.

func (*SubscriptionMatchMutation) ResetSkill

func (m *SubscriptionMatchMutation) ResetSkill()

ResetSkill resets all changes to the "skill" field.

func (*SubscriptionMatchMutation) ResetStartTime

func (m *SubscriptionMatchMutation) ResetStartTime()

ResetStartTime resets all changes to the "start_time" field.

func (*SubscriptionMatchMutation) ResetUpdateTime

func (m *SubscriptionMatchMutation) ResetUpdateTime()

ResetUpdateTime resets all changes to the "update_time" field.

func (*SubscriptionMatchMutation) ResetVersion

func (m *SubscriptionMatchMutation) ResetVersion()

ResetVersion resets all changes to the "version" field.

func (*SubscriptionMatchMutation) SetAssists

func (m *SubscriptionMatchMutation) SetAssists(i int)

SetAssists sets the "assists" field.

func (*SubscriptionMatchMutation) SetCreateTime

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

SetCreateTime sets the "create_time" field.

func (*SubscriptionMatchMutation) SetDeaths

func (m *SubscriptionMatchMutation) SetDeaths(i int)

SetDeaths sets the "deaths" field.

func (*SubscriptionMatchMutation) SetDuration

func (m *SubscriptionMatchMutation) SetDuration(i int)

SetDuration sets the "duration" field.

func (*SubscriptionMatchMutation) SetField

func (m *SubscriptionMatchMutation) 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 (*SubscriptionMatchMutation) SetGameMode

func (m *SubscriptionMatchMutation) SetGameMode(i int)

SetGameMode sets the "game_mode" field.

func (*SubscriptionMatchMutation) SetHeroID

func (m *SubscriptionMatchMutation) SetHeroID(i int)

SetHeroID sets the "hero_id" field.

func (*SubscriptionMatchMutation) SetKills

func (m *SubscriptionMatchMutation) SetKills(i int)

SetKills sets the "kills" field.

func (*SubscriptionMatchMutation) SetLeaverStatus

func (m *SubscriptionMatchMutation) SetLeaverStatus(i int)

SetLeaverStatus sets the "leaver_status" field.

func (*SubscriptionMatchMutation) SetLobbyType

func (m *SubscriptionMatchMutation) SetLobbyType(i int)

SetLobbyType sets the "lobby_type" field.

func (*SubscriptionMatchMutation) SetMatchID

func (m *SubscriptionMatchMutation) SetMatchID(i int64)

SetMatchID sets the "match_id" field.

func (*SubscriptionMatchMutation) SetPartySize

func (m *SubscriptionMatchMutation) SetPartySize(i int)

SetPartySize sets the "party_size" field.

func (*SubscriptionMatchMutation) SetPlayerID

func (m *SubscriptionMatchMutation) SetPlayerID(s string)

SetPlayerID sets the "player_id" field.

func (*SubscriptionMatchMutation) SetPlayerSlot

func (m *SubscriptionMatchMutation) SetPlayerSlot(i int)

SetPlayerSlot sets the "player_slot" field.

func (*SubscriptionMatchMutation) SetRadiantWin

func (m *SubscriptionMatchMutation) SetRadiantWin(b bool)

SetRadiantWin sets the "radiant_win" field.

func (*SubscriptionMatchMutation) SetSkill

func (m *SubscriptionMatchMutation) SetSkill(i int)

SetSkill sets the "skill" field.

func (*SubscriptionMatchMutation) SetStartTime

func (m *SubscriptionMatchMutation) SetStartTime(i int)

SetStartTime sets the "start_time" field.

func (*SubscriptionMatchMutation) SetUpdateTime

func (m *SubscriptionMatchMutation) SetUpdateTime(t time.Time)

SetUpdateTime sets the "update_time" field.

func (*SubscriptionMatchMutation) SetVersion

func (m *SubscriptionMatchMutation) SetVersion(i int)

SetVersion sets the "version" field.

func (*SubscriptionMatchMutation) Skill

func (m *SubscriptionMatchMutation) Skill() (r int, exists bool)

Skill returns the value of the "skill" field in the mutation.

func (*SubscriptionMatchMutation) SkillCleared

func (m *SubscriptionMatchMutation) SkillCleared() bool

SkillCleared returns if the "skill" field was cleared in this mutation.

func (*SubscriptionMatchMutation) StartTime

func (m *SubscriptionMatchMutation) StartTime() (r int, exists bool)

StartTime returns the value of the "start_time" field in the mutation.

func (SubscriptionMatchMutation) Tx

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

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

func (*SubscriptionMatchMutation) Type

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

func (*SubscriptionMatchMutation) UpdateTime

func (m *SubscriptionMatchMutation) UpdateTime() (r time.Time, exists bool)

UpdateTime returns the value of the "update_time" field in the mutation.

func (*SubscriptionMatchMutation) Version

func (m *SubscriptionMatchMutation) Version() (r int, exists bool)

Version returns the value of the "version" field in the mutation.

func (*SubscriptionMatchMutation) Where

Where appends a list predicates to the SubscriptionMatchMutation builder.

type SubscriptionMatchQuery

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

SubscriptionMatchQuery is the builder for querying SubscriptionMatch entities.

func (*SubscriptionMatchQuery) All

All executes the query and returns a list of SubscriptionMatches.

func (*SubscriptionMatchQuery) AllX

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

func (*SubscriptionMatchQuery) Clone

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

func (*SubscriptionMatchQuery) Count

func (smq *SubscriptionMatchQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*SubscriptionMatchQuery) CountX

func (smq *SubscriptionMatchQuery) CountX(ctx context.Context) int

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

func (*SubscriptionMatchQuery) Exist

func (smq *SubscriptionMatchQuery) Exist(ctx context.Context) (bool, error)

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

func (*SubscriptionMatchQuery) ExistX

func (smq *SubscriptionMatchQuery) ExistX(ctx context.Context) bool

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

func (*SubscriptionMatchQuery) First

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

func (*SubscriptionMatchQuery) FirstID

func (smq *SubscriptionMatchQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*SubscriptionMatchQuery) FirstIDX

func (smq *SubscriptionMatchQuery) FirstIDX(ctx context.Context) int

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

func (*SubscriptionMatchQuery) FirstX

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

func (*SubscriptionMatchQuery) GroupBy

func (smq *SubscriptionMatchQuery) GroupBy(field string, fields ...string) *SubscriptionMatchGroupBy

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

client.SubscriptionMatch.Query().
	GroupBy(subscriptionmatch.FieldCreateTime).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*SubscriptionMatchQuery) IDs

func (smq *SubscriptionMatchQuery) IDs(ctx context.Context) ([]int, error)

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

func (*SubscriptionMatchQuery) IDsX

func (smq *SubscriptionMatchQuery) IDsX(ctx context.Context) []int

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

func (*SubscriptionMatchQuery) Limit

Limit adds a limit step to the query.

func (*SubscriptionMatchQuery) Offset

func (smq *SubscriptionMatchQuery) Offset(offset int) *SubscriptionMatchQuery

Offset adds an offset step to the query.

func (*SubscriptionMatchQuery) Only

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

func (*SubscriptionMatchQuery) OnlyID

func (smq *SubscriptionMatchQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*SubscriptionMatchQuery) OnlyIDX

func (smq *SubscriptionMatchQuery) OnlyIDX(ctx context.Context) int

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

func (*SubscriptionMatchQuery) OnlyX

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

func (*SubscriptionMatchQuery) Order

Order adds an order step to the query.

func (*SubscriptionMatchQuery) Select

func (smq *SubscriptionMatchQuery) Select(fields ...string) *SubscriptionMatchSelect

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 {
	CreateTime time.Time `json:"create_time,omitempty"`
}

client.SubscriptionMatch.Query().
	Select(subscriptionmatch.FieldCreateTime).
	Scan(ctx, &v)

func (*SubscriptionMatchQuery) Unique

func (smq *SubscriptionMatchQuery) Unique(unique bool) *SubscriptionMatchQuery

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

Where adds a new predicate for the SubscriptionMatchQuery builder.

type SubscriptionMatchSelect

type SubscriptionMatchSelect struct {
	*SubscriptionMatchQuery
	// contains filtered or unexported fields
}

SubscriptionMatchSelect is the builder for selecting fields of SubscriptionMatch entities.

func (*SubscriptionMatchSelect) Bool

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

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

func (*SubscriptionMatchSelect) BoolX

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

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

func (*SubscriptionMatchSelect) Bools

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

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

func (*SubscriptionMatchSelect) BoolsX

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

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

func (*SubscriptionMatchSelect) Float64

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

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

func (*SubscriptionMatchSelect) Float64X

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

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

func (*SubscriptionMatchSelect) Float64s

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

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

func (*SubscriptionMatchSelect) Float64sX

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

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

func (*SubscriptionMatchSelect) Int

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

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

func (*SubscriptionMatchSelect) IntX

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

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

func (*SubscriptionMatchSelect) Ints

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

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

func (*SubscriptionMatchSelect) IntsX

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

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

func (*SubscriptionMatchSelect) Scan

func (sms *SubscriptionMatchSelect) Scan(ctx context.Context, v interface{}) error

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

func (*SubscriptionMatchSelect) ScanX

func (s *SubscriptionMatchSelect) ScanX(ctx context.Context, v interface{})

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

func (*SubscriptionMatchSelect) String

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

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

func (*SubscriptionMatchSelect) StringX

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

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

func (*SubscriptionMatchSelect) Strings

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

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

func (*SubscriptionMatchSelect) StringsX

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

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

type SubscriptionMatchUpdate

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

SubscriptionMatchUpdate is the builder for updating SubscriptionMatch entities.

func (*SubscriptionMatchUpdate) AddAssists

AddAssists adds i to the "assists" field.

func (*SubscriptionMatchUpdate) AddDeaths

AddDeaths adds i to the "deaths" field.

func (*SubscriptionMatchUpdate) AddDuration

AddDuration adds i to the "duration" field.

func (*SubscriptionMatchUpdate) AddGameMode

AddGameMode adds i to the "game_mode" field.

func (*SubscriptionMatchUpdate) AddHeroID

AddHeroID adds i to the "hero_id" field.

func (*SubscriptionMatchUpdate) AddKills

AddKills adds i to the "kills" field.

func (*SubscriptionMatchUpdate) AddLeaverStatus

func (smu *SubscriptionMatchUpdate) AddLeaverStatus(i int) *SubscriptionMatchUpdate

AddLeaverStatus adds i to the "leaver_status" field.

func (*SubscriptionMatchUpdate) AddLobbyType

func (smu *SubscriptionMatchUpdate) AddLobbyType(i int) *SubscriptionMatchUpdate

AddLobbyType adds i to the "lobby_type" field.

func (*SubscriptionMatchUpdate) AddMatchID

AddMatchID adds i to the "match_id" field.

func (*SubscriptionMatchUpdate) AddPartySize

func (smu *SubscriptionMatchUpdate) AddPartySize(i int) *SubscriptionMatchUpdate

AddPartySize adds i to the "party_size" field.

func (*SubscriptionMatchUpdate) AddPlayerSlot

func (smu *SubscriptionMatchUpdate) AddPlayerSlot(i int) *SubscriptionMatchUpdate

AddPlayerSlot adds i to the "player_slot" field.

func (*SubscriptionMatchUpdate) AddSkill

AddSkill adds i to the "skill" field.

func (*SubscriptionMatchUpdate) AddStartTime

func (smu *SubscriptionMatchUpdate) AddStartTime(i int) *SubscriptionMatchUpdate

AddStartTime adds i to the "start_time" field.

func (*SubscriptionMatchUpdate) AddVersion

AddVersion adds i to the "version" field.

func (*SubscriptionMatchUpdate) ClearSkill

ClearSkill clears the value of the "skill" field.

func (*SubscriptionMatchUpdate) Exec

Exec executes the query.

func (*SubscriptionMatchUpdate) ExecX

func (smu *SubscriptionMatchUpdate) ExecX(ctx context.Context)

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

func (*SubscriptionMatchUpdate) Mutation

Mutation returns the SubscriptionMatchMutation object of the builder.

func (*SubscriptionMatchUpdate) Save

func (smu *SubscriptionMatchUpdate) Save(ctx context.Context) (int, error)

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

func (*SubscriptionMatchUpdate) SaveX

func (smu *SubscriptionMatchUpdate) SaveX(ctx context.Context) int

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

func (*SubscriptionMatchUpdate) SetAssists

SetAssists sets the "assists" field.

func (*SubscriptionMatchUpdate) SetDeaths

SetDeaths sets the "deaths" field.

func (*SubscriptionMatchUpdate) SetDuration

SetDuration sets the "duration" field.

func (*SubscriptionMatchUpdate) SetGameMode

SetGameMode sets the "game_mode" field.

func (*SubscriptionMatchUpdate) SetHeroID

SetHeroID sets the "hero_id" field.

func (*SubscriptionMatchUpdate) SetKills

SetKills sets the "kills" field.

func (*SubscriptionMatchUpdate) SetLeaverStatus

func (smu *SubscriptionMatchUpdate) SetLeaverStatus(i int) *SubscriptionMatchUpdate

SetLeaverStatus sets the "leaver_status" field.

func (*SubscriptionMatchUpdate) SetLobbyType

func (smu *SubscriptionMatchUpdate) SetLobbyType(i int) *SubscriptionMatchUpdate

SetLobbyType sets the "lobby_type" field.

func (*SubscriptionMatchUpdate) SetMatchID

SetMatchID sets the "match_id" field.

func (*SubscriptionMatchUpdate) SetNillableSkill

func (smu *SubscriptionMatchUpdate) SetNillableSkill(i *int) *SubscriptionMatchUpdate

SetNillableSkill sets the "skill" field if the given value is not nil.

func (*SubscriptionMatchUpdate) SetPartySize

func (smu *SubscriptionMatchUpdate) SetPartySize(i int) *SubscriptionMatchUpdate

SetPartySize sets the "party_size" field.

func (*SubscriptionMatchUpdate) SetPlayerID

SetPlayerID sets the "player_id" field.

func (*SubscriptionMatchUpdate) SetPlayerSlot

func (smu *SubscriptionMatchUpdate) SetPlayerSlot(i int) *SubscriptionMatchUpdate

SetPlayerSlot sets the "player_slot" field.

func (*SubscriptionMatchUpdate) SetRadiantWin

func (smu *SubscriptionMatchUpdate) SetRadiantWin(b bool) *SubscriptionMatchUpdate

SetRadiantWin sets the "radiant_win" field.

func (*SubscriptionMatchUpdate) SetSkill

SetSkill sets the "skill" field.

func (*SubscriptionMatchUpdate) SetStartTime

func (smu *SubscriptionMatchUpdate) SetStartTime(i int) *SubscriptionMatchUpdate

SetStartTime sets the "start_time" field.

func (*SubscriptionMatchUpdate) SetUpdateTime

SetUpdateTime sets the "update_time" field.

func (*SubscriptionMatchUpdate) SetVersion

SetVersion sets the "version" field.

func (*SubscriptionMatchUpdate) Where

Where appends a list predicates to the SubscriptionMatchUpdate builder.

type SubscriptionMatchUpdateOne

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

SubscriptionMatchUpdateOne is the builder for updating a single SubscriptionMatch entity.

func (*SubscriptionMatchUpdateOne) AddAssists

AddAssists adds i to the "assists" field.

func (*SubscriptionMatchUpdateOne) AddDeaths

AddDeaths adds i to the "deaths" field.

func (*SubscriptionMatchUpdateOne) AddDuration

AddDuration adds i to the "duration" field.

func (*SubscriptionMatchUpdateOne) AddGameMode

AddGameMode adds i to the "game_mode" field.

func (*SubscriptionMatchUpdateOne) AddHeroID

AddHeroID adds i to the "hero_id" field.

func (*SubscriptionMatchUpdateOne) AddKills

AddKills adds i to the "kills" field.

func (*SubscriptionMatchUpdateOne) AddLeaverStatus

func (smuo *SubscriptionMatchUpdateOne) AddLeaverStatus(i int) *SubscriptionMatchUpdateOne

AddLeaverStatus adds i to the "leaver_status" field.

func (*SubscriptionMatchUpdateOne) AddLobbyType

AddLobbyType adds i to the "lobby_type" field.

func (*SubscriptionMatchUpdateOne) AddMatchID

AddMatchID adds i to the "match_id" field.

func (*SubscriptionMatchUpdateOne) AddPartySize

AddPartySize adds i to the "party_size" field.

func (*SubscriptionMatchUpdateOne) AddPlayerSlot

AddPlayerSlot adds i to the "player_slot" field.

func (*SubscriptionMatchUpdateOne) AddSkill

AddSkill adds i to the "skill" field.

func (*SubscriptionMatchUpdateOne) AddStartTime

AddStartTime adds i to the "start_time" field.

func (*SubscriptionMatchUpdateOne) AddVersion

AddVersion adds i to the "version" field.

func (*SubscriptionMatchUpdateOne) ClearSkill

ClearSkill clears the value of the "skill" field.

func (*SubscriptionMatchUpdateOne) Exec

Exec executes the query on the entity.

func (*SubscriptionMatchUpdateOne) ExecX

func (smuo *SubscriptionMatchUpdateOne) ExecX(ctx context.Context)

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

func (*SubscriptionMatchUpdateOne) Mutation

Mutation returns the SubscriptionMatchMutation object of the builder.

func (*SubscriptionMatchUpdateOne) Save

Save executes the query and returns the updated SubscriptionMatch entity.

func (*SubscriptionMatchUpdateOne) SaveX

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

func (*SubscriptionMatchUpdateOne) Select

func (smuo *SubscriptionMatchUpdateOne) Select(field string, fields ...string) *SubscriptionMatchUpdateOne

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

func (*SubscriptionMatchUpdateOne) SetAssists

SetAssists sets the "assists" field.

func (*SubscriptionMatchUpdateOne) SetDeaths

SetDeaths sets the "deaths" field.

func (*SubscriptionMatchUpdateOne) SetDuration

SetDuration sets the "duration" field.

func (*SubscriptionMatchUpdateOne) SetGameMode

SetGameMode sets the "game_mode" field.

func (*SubscriptionMatchUpdateOne) SetHeroID

SetHeroID sets the "hero_id" field.

func (*SubscriptionMatchUpdateOne) SetKills

SetKills sets the "kills" field.

func (*SubscriptionMatchUpdateOne) SetLeaverStatus

func (smuo *SubscriptionMatchUpdateOne) SetLeaverStatus(i int) *SubscriptionMatchUpdateOne

SetLeaverStatus sets the "leaver_status" field.

func (*SubscriptionMatchUpdateOne) SetLobbyType

SetLobbyType sets the "lobby_type" field.

func (*SubscriptionMatchUpdateOne) SetMatchID

SetMatchID sets the "match_id" field.

func (*SubscriptionMatchUpdateOne) SetNillableSkill

func (smuo *SubscriptionMatchUpdateOne) SetNillableSkill(i *int) *SubscriptionMatchUpdateOne

SetNillableSkill sets the "skill" field if the given value is not nil.

func (*SubscriptionMatchUpdateOne) SetPartySize

SetPartySize sets the "party_size" field.

func (*SubscriptionMatchUpdateOne) SetPlayerID

SetPlayerID sets the "player_id" field.

func (*SubscriptionMatchUpdateOne) SetPlayerSlot

SetPlayerSlot sets the "player_slot" field.

func (*SubscriptionMatchUpdateOne) SetRadiantWin

SetRadiantWin sets the "radiant_win" field.

func (*SubscriptionMatchUpdateOne) SetSkill

SetSkill sets the "skill" field.

func (*SubscriptionMatchUpdateOne) SetStartTime

SetStartTime sets the "start_time" field.

func (*SubscriptionMatchUpdateOne) SetUpdateTime

SetUpdateTime sets the "update_time" field.

func (*SubscriptionMatchUpdateOne) SetVersion

SetVersion sets the "version" field.

type SubscriptionMatches

type SubscriptionMatches []*SubscriptionMatch

SubscriptionMatches is a parsable slice of SubscriptionMatch.

type SubscriptionMutation

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

SubscriptionMutation represents an operation that mutates the Subscription nodes in the graph.

func (*SubscriptionMutation) AddField

func (m *SubscriptionMutation) 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 (*SubscriptionMutation) AddGroupID

func (m *SubscriptionMutation) AddGroupID(i int)

AddGroupID adds i to the "group_id" field.

func (*SubscriptionMutation) AddedEdges

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

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

func (*SubscriptionMutation) AddedField

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

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

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

func (*SubscriptionMutation) AddedGroupID

func (m *SubscriptionMutation) AddedGroupID() (r int, exists bool)

AddedGroupID returns the value that was added to the "group_id" field in this mutation.

func (*SubscriptionMutation) AddedIDs

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

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

func (*SubscriptionMutation) Alias

func (m *SubscriptionMutation) Alias() (r string, exists bool)

Alias returns the value of the "alias" field in the mutation.

func (*SubscriptionMutation) ClearEdge

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

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

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

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

func (*SubscriptionMutation) ClearedFields

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

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

func (SubscriptionMutation) Client

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

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

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

func (*SubscriptionMutation) EdgeCleared

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

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

func (*SubscriptionMutation) Field

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

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

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

func (*SubscriptionMutation) Fields

func (m *SubscriptionMutation) 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 (*SubscriptionMutation) GroupID

func (m *SubscriptionMutation) GroupID() (r int, exists bool)

GroupID returns the value of the "group_id" field in the mutation.

func (*SubscriptionMutation) ID

func (m *SubscriptionMutation) 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 (*SubscriptionMutation) IDs

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

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

func (*SubscriptionMutation) OldAlias

func (m *SubscriptionMutation) OldAlias(ctx context.Context) (v string, err error)

OldAlias returns the old "alias" field's value of the Subscription entity. If the Subscription 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 (*SubscriptionMutation) OldCreateTime

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

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

func (m *SubscriptionMutation) 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 (*SubscriptionMutation) OldGroupID

func (m *SubscriptionMutation) OldGroupID(ctx context.Context) (v int, err error)

OldGroupID returns the old "group_id" field's value of the Subscription entity. If the Subscription 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 (*SubscriptionMutation) OldSteamID

func (m *SubscriptionMutation) OldSteamID(ctx context.Context) (v string, err error)

OldSteamID returns the old "steam_id" field's value of the Subscription entity. If the Subscription 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 (*SubscriptionMutation) OldUpdateTime

func (m *SubscriptionMutation) OldUpdateTime(ctx context.Context) (v time.Time, err error)

OldUpdateTime returns the old "update_time" field's value of the Subscription entity. If the Subscription 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 (*SubscriptionMutation) Op

func (m *SubscriptionMutation) Op() Op

Op returns the operation name.

func (*SubscriptionMutation) RemovedEdges

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

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

func (*SubscriptionMutation) RemovedIDs

func (m *SubscriptionMutation) 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 (*SubscriptionMutation) ResetAlias

func (m *SubscriptionMutation) ResetAlias()

ResetAlias resets all changes to the "alias" field.

func (*SubscriptionMutation) ResetCreateTime

func (m *SubscriptionMutation) ResetCreateTime()

ResetCreateTime resets all changes to the "create_time" field.

func (*SubscriptionMutation) ResetEdge

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

func (m *SubscriptionMutation) 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 (*SubscriptionMutation) ResetGroupID

func (m *SubscriptionMutation) ResetGroupID()

ResetGroupID resets all changes to the "group_id" field.

func (*SubscriptionMutation) ResetSteamID

func (m *SubscriptionMutation) ResetSteamID()

ResetSteamID resets all changes to the "steam_id" field.

func (*SubscriptionMutation) ResetUpdateTime

func (m *SubscriptionMutation) ResetUpdateTime()

ResetUpdateTime resets all changes to the "update_time" field.

func (*SubscriptionMutation) SetAlias

func (m *SubscriptionMutation) SetAlias(s string)

SetAlias sets the "alias" field.

func (*SubscriptionMutation) SetCreateTime

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

SetCreateTime sets the "create_time" field.

func (*SubscriptionMutation) SetField

func (m *SubscriptionMutation) 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 (*SubscriptionMutation) SetGroupID

func (m *SubscriptionMutation) SetGroupID(i int)

SetGroupID sets the "group_id" field.

func (*SubscriptionMutation) SetSteamID

func (m *SubscriptionMutation) SetSteamID(s string)

SetSteamID sets the "steam_id" field.

func (*SubscriptionMutation) SetUpdateTime

func (m *SubscriptionMutation) SetUpdateTime(t time.Time)

SetUpdateTime sets the "update_time" field.

func (*SubscriptionMutation) SteamID

func (m *SubscriptionMutation) SteamID() (r string, exists bool)

SteamID returns the value of the "steam_id" field in the mutation.

func (SubscriptionMutation) Tx

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

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

func (*SubscriptionMutation) Type

func (m *SubscriptionMutation) Type() string

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

func (*SubscriptionMutation) UpdateTime

func (m *SubscriptionMutation) UpdateTime() (r time.Time, exists bool)

UpdateTime returns the value of the "update_time" field in the mutation.

func (*SubscriptionMutation) Where

Where appends a list predicates to the SubscriptionMutation builder.

type SubscriptionQuery

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

SubscriptionQuery is the builder for querying Subscription entities.

func (*SubscriptionQuery) All

func (sq *SubscriptionQuery) All(ctx context.Context) ([]*Subscription, error)

All executes the query and returns a list of Subscriptions.

func (*SubscriptionQuery) AllX

func (sq *SubscriptionQuery) AllX(ctx context.Context) []*Subscription

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

func (*SubscriptionQuery) Clone

func (sq *SubscriptionQuery) Clone() *SubscriptionQuery

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

func (*SubscriptionQuery) Count

func (sq *SubscriptionQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*SubscriptionQuery) CountX

func (sq *SubscriptionQuery) CountX(ctx context.Context) int

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

func (*SubscriptionQuery) Exist

func (sq *SubscriptionQuery) Exist(ctx context.Context) (bool, error)

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

func (*SubscriptionQuery) ExistX

func (sq *SubscriptionQuery) ExistX(ctx context.Context) bool

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

func (*SubscriptionQuery) First

func (sq *SubscriptionQuery) First(ctx context.Context) (*Subscription, error)

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

func (*SubscriptionQuery) FirstID

func (sq *SubscriptionQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*SubscriptionQuery) FirstIDX

func (sq *SubscriptionQuery) FirstIDX(ctx context.Context) int

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

func (*SubscriptionQuery) FirstX

func (sq *SubscriptionQuery) FirstX(ctx context.Context) *Subscription

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

func (*SubscriptionQuery) GroupBy

func (sq *SubscriptionQuery) GroupBy(field string, fields ...string) *SubscriptionGroupBy

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

client.Subscription.Query().
	GroupBy(subscription.FieldCreateTime).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*SubscriptionQuery) IDs

func (sq *SubscriptionQuery) IDs(ctx context.Context) ([]int, error)

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

func (*SubscriptionQuery) IDsX

func (sq *SubscriptionQuery) IDsX(ctx context.Context) []int

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

func (*SubscriptionQuery) Limit

func (sq *SubscriptionQuery) Limit(limit int) *SubscriptionQuery

Limit adds a limit step to the query.

func (*SubscriptionQuery) Offset

func (sq *SubscriptionQuery) Offset(offset int) *SubscriptionQuery

Offset adds an offset step to the query.

func (*SubscriptionQuery) Only

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

func (*SubscriptionQuery) OnlyID

func (sq *SubscriptionQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*SubscriptionQuery) OnlyIDX

func (sq *SubscriptionQuery) OnlyIDX(ctx context.Context) int

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

func (*SubscriptionQuery) OnlyX

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

func (*SubscriptionQuery) Order

Order adds an order step to the query.

func (*SubscriptionQuery) Select

func (sq *SubscriptionQuery) Select(fields ...string) *SubscriptionSelect

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 {
	CreateTime time.Time `json:"create_time,omitempty"`
}

client.Subscription.Query().
	Select(subscription.FieldCreateTime).
	Scan(ctx, &v)

func (*SubscriptionQuery) Unique

func (sq *SubscriptionQuery) Unique(unique bool) *SubscriptionQuery

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

Where adds a new predicate for the SubscriptionQuery builder.

type SubscriptionSelect

type SubscriptionSelect struct {
	*SubscriptionQuery
	// contains filtered or unexported fields
}

SubscriptionSelect is the builder for selecting fields of Subscription entities.

func (*SubscriptionSelect) Bool

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

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

func (*SubscriptionSelect) BoolX

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

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

func (*SubscriptionSelect) Bools

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

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

func (*SubscriptionSelect) BoolsX

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

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

func (*SubscriptionSelect) Float64

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

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

func (*SubscriptionSelect) Float64X

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

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

func (*SubscriptionSelect) Float64s

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

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

func (*SubscriptionSelect) Float64sX

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

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

func (*SubscriptionSelect) Int

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

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

func (*SubscriptionSelect) IntX

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

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

func (*SubscriptionSelect) Ints

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

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

func (*SubscriptionSelect) IntsX

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

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

func (*SubscriptionSelect) Scan

func (ss *SubscriptionSelect) Scan(ctx context.Context, v interface{}) error

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

func (*SubscriptionSelect) ScanX

func (s *SubscriptionSelect) ScanX(ctx context.Context, v interface{})

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

func (*SubscriptionSelect) String

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

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

func (*SubscriptionSelect) StringX

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

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

func (*SubscriptionSelect) Strings

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

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

func (*SubscriptionSelect) StringsX

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

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

type SubscriptionUpdate

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

SubscriptionUpdate is the builder for updating Subscription entities.

func (*SubscriptionUpdate) AddGroupID

func (su *SubscriptionUpdate) AddGroupID(i int) *SubscriptionUpdate

AddGroupID adds i to the "group_id" field.

func (*SubscriptionUpdate) Exec

func (su *SubscriptionUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*SubscriptionUpdate) ExecX

func (su *SubscriptionUpdate) ExecX(ctx context.Context)

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

func (*SubscriptionUpdate) Mutation

func (su *SubscriptionUpdate) Mutation() *SubscriptionMutation

Mutation returns the SubscriptionMutation object of the builder.

func (*SubscriptionUpdate) Save

func (su *SubscriptionUpdate) Save(ctx context.Context) (int, error)

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

func (*SubscriptionUpdate) SaveX

func (su *SubscriptionUpdate) SaveX(ctx context.Context) int

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

func (*SubscriptionUpdate) SetAlias

func (su *SubscriptionUpdate) SetAlias(s string) *SubscriptionUpdate

SetAlias sets the "alias" field.

func (*SubscriptionUpdate) SetGroupID

func (su *SubscriptionUpdate) SetGroupID(i int) *SubscriptionUpdate

SetGroupID sets the "group_id" field.

func (*SubscriptionUpdate) SetSteamID

func (su *SubscriptionUpdate) SetSteamID(s string) *SubscriptionUpdate

SetSteamID sets the "steam_id" field.

func (*SubscriptionUpdate) SetUpdateTime

func (su *SubscriptionUpdate) SetUpdateTime(t time.Time) *SubscriptionUpdate

SetUpdateTime sets the "update_time" field.

func (*SubscriptionUpdate) Where

Where appends a list predicates to the SubscriptionUpdate builder.

type SubscriptionUpdateOne

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

SubscriptionUpdateOne is the builder for updating a single Subscription entity.

func (*SubscriptionUpdateOne) AddGroupID

func (suo *SubscriptionUpdateOne) AddGroupID(i int) *SubscriptionUpdateOne

AddGroupID adds i to the "group_id" field.

func (*SubscriptionUpdateOne) Exec

func (suo *SubscriptionUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*SubscriptionUpdateOne) ExecX

func (suo *SubscriptionUpdateOne) ExecX(ctx context.Context)

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

func (*SubscriptionUpdateOne) Mutation

Mutation returns the SubscriptionMutation object of the builder.

func (*SubscriptionUpdateOne) Save

Save executes the query and returns the updated Subscription entity.

func (*SubscriptionUpdateOne) SaveX

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

func (*SubscriptionUpdateOne) Select

func (suo *SubscriptionUpdateOne) Select(field string, fields ...string) *SubscriptionUpdateOne

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

func (*SubscriptionUpdateOne) SetAlias

SetAlias sets the "alias" field.

func (*SubscriptionUpdateOne) SetGroupID

func (suo *SubscriptionUpdateOne) SetGroupID(i int) *SubscriptionUpdateOne

SetGroupID sets the "group_id" field.

func (*SubscriptionUpdateOne) SetSteamID

SetSteamID sets the "steam_id" field.

func (*SubscriptionUpdateOne) SetUpdateTime

func (suo *SubscriptionUpdateOne) SetUpdateTime(t time.Time) *SubscriptionUpdateOne

SetUpdateTime sets the "update_time" field.

type Subscriptions

type Subscriptions []*Subscription

Subscriptions is a parsable slice of Subscription.

type Tx

type Tx struct {

	// Hero is the client for interacting with the Hero builders.
	Hero *HeroClient
	// Subscription is the client for interacting with the Subscription builders.
	Subscription *SubscriptionClient
	// SubscriptionMatch is the client for interacting with the SubscriptionMatch builders.
	SubscriptionMatch *SubscriptionMatchClient
	// 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 or edge fails.

func (*ValidationError) Error

func (e *ValidationError) Error() string

Error implements the error interface.

func (*ValidationError) Unwrap

func (e *ValidationError) Unwrap() error

Unwrap implements the errors.Wrapper interface.

type Value

type Value = ent.Value

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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