ent

package
v0.0.0-...-7f4b9de Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2021 License: MIT Imports: 20 Imported by: 0

README

ClientServer:
	+-------------+-----------+--------+----------+----------+---------+---------------+-----------+------------------------------+------------+
	|    Field    |   Type    | Unique | Optional | Nillable | Default | UpdateDefault | Immutable |          StructTag           | Validators |
	+-------------+-----------+--------+----------+----------+---------+---------------+-----------+------------------------------+------------+
	| id          | int       | false  | false    | false    | false   | false         | false     | json:"id,omitempty"          |          0 |
	| client_name | string    | false  | false    | false    | false   | false         | false     | json:"client_name,omitempty" |          0 |
	| token       | string    | false  | false    | false    | false   | false         | false     | json:"token,omitempty"       |          0 |
	| link        | string    | false  | false    | false    | false   | false         | false     | json:"link,omitempty"        |          0 |
	| description | string    | false  | false    | false    | false   | false         | false     | json:"description,omitempty" |          0 |
	| available   | bool      | false  | false    | false    | false   | false         | false     | json:"available,omitempty"   |          0 |
	| created_at  | time.Time | false  | false    | false    | true    | false         | false     | json:"created_at,omitempty"  |          0 |
	+-------------+-----------+--------+----------+----------+---------+---------------+-----------+------------------------------+------------+
	+--------+-------+---------+--------------+----------+--------+----------+
	|  Edge  | Type  | Inverse |   BackRef    | Relation | Unique | Optional |
	+--------+-------+---------+--------------+----------+--------+----------+
	| events | Event | true    | clientserver | O2M      | false  | true     |
	+--------+-------+---------+--------------+----------+--------+----------+
	
Event:
	+------------+-----------+--------+----------+----------+---------+---------------+-----------+-----------------------------+------------+
	|   Field    |   Type    | Unique | Optional | Nillable | Default | UpdateDefault | Immutable |          StructTag          | Validators |
	+------------+-----------+--------+----------+----------+---------+---------------+-----------+-----------------------------+------------+
	| id         | int       | false  | false    | false    | false   | false         | false     | json:"id,omitempty"         |          0 |
	| event      | string    | false  | false    | false    | false   | false         | false     | json:"event,omitempty"      |          0 |
	| message    | string    | false  | false    | false    | false   | false         | false     | json:"message,omitempty"    |          0 |
	| created_at | time.Time | false  | false    | false    | true    | false         | false     | json:"created_at,omitempty" |          0 |
	+------------+-----------+--------+----------+----------+---------+---------------+-----------+-----------------------------+------------+
	+--------------+--------------+---------+---------+----------+--------+----------+
	|     Edge     |     Type     | Inverse | BackRef | Relation | Unique | Optional |
	+--------------+--------------+---------+---------+----------+--------+----------+
	| user         | User         | false   |         | M2O      | true   | true     |
	| clientserver | ClientServer | false   |         | M2O      | true   | true     |
	+--------------+--------------+---------+---------+----------+--------+----------+
	
User:
	+-------------+-----------+--------+----------+----------+---------+---------------+-----------+------------------------------+------------+
	|    Field    |   Type    | Unique | Optional | Nillable | Default | UpdateDefault | Immutable |          StructTag           | Validators |
	+-------------+-----------+--------+----------+----------+---------+---------------+-----------+------------------------------+------------+
	| id          | int       | false  | false    | false    | false   | false         | false     | json:"id,omitempty"          |          0 |
	| user_id     | string    | true   | false    | false    | false   | false         | false     | json:"user_id,omitempty"     |          0 |
	| user_pw     | string    | false  | false    | false    | false   | false         | false     | json:"user_pw,omitempty"     |          0 |
	| user_name   | string    | false  | false    | false    | false   | false         | false     | json:"user_name,omitempty"   |          0 |
	| user_number | string    | false  | false    | false    | false   | false         | false     | json:"user_number,omitempty" |          0 |
	| email       | string    | false  | false    | false    | false   | false         | false     | json:"email,omitempty"       |          0 |
	| created_at  | time.Time | false  | false    | false    | true    | false         | false     | json:"created_at,omitempty"  |          0 |
	| deleted_at  | time.Time | false  | true     | false    | false   | false         | false     | json:"deleted_at,omitempty"  |          0 |
	+-------------+-----------+--------+----------+----------+---------+---------------+-----------+------------------------------+------------+
	+--------+-------+---------+---------+----------+--------+----------+
	|  Edge  | Type  | Inverse | BackRef | Relation | Unique | Optional |
	+--------+-------+---------+---------+----------+--------+----------+
	| events | Event | true    | user    | O2M      | false  | true     |
	+--------+-------+---------+---------+----------+--------+----------+
	

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.
	TypeClientServer = "ClientServer"
	TypeEvent        = "Event"
	TypeUser         = "User"
)

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 validaton 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, func(string) bool) 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
	// ClientServer is the client for interacting with the ClientServer builders.
	ClientServer *ClientServerClient
	// Event is the client for interacting with the Event builders.
	Event *EventClient
	// User is the client for interacting with the User builders.
	User *UserClient
	// 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().
	ClientServer.
	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 ClientServer

type ClientServer struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// ClientName holds the value of the "client_name" field.
	ClientName string `json:"client_name,omitempty"`
	// Token holds the value of the "token" field.
	Token string `json:"token,omitempty"`
	// Link holds the value of the "link" field.
	Link string `json:"link,omitempty"`
	// Description holds the value of the "description" field.
	Description string `json:"description,omitempty"`
	// Available holds the value of the "available" field.
	Available bool `json:"available,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the ClientServerQuery when eager-loading is set.
	Edges ClientServerEdges `json:"edges"`
	// contains filtered or unexported fields
}

ClientServer is the model entity for the ClientServer schema.

func (*ClientServer) QueryEvents

func (cs *ClientServer) QueryEvents() *EventQuery

QueryEvents queries the "events" edge of the ClientServer entity.

func (*ClientServer) QueryOwner

func (cs *ClientServer) QueryOwner() *UserQuery

QueryOwner queries the "owner" edge of the ClientServer entity.

func (*ClientServer) String

func (cs *ClientServer) String() string

String implements the fmt.Stringer.

func (*ClientServer) Unwrap

func (cs *ClientServer) Unwrap() *ClientServer

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

func (cs *ClientServer) Update() *ClientServerUpdateOne

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

type ClientServerClient

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

ClientServerClient is a client for the ClientServer schema.

func NewClientServerClient

func NewClientServerClient(c config) *ClientServerClient

NewClientServerClient returns a client for the ClientServer from the given config.

func (*ClientServerClient) Create

Create returns a create builder for ClientServer.

func (*ClientServerClient) CreateBulk

func (c *ClientServerClient) CreateBulk(builders ...*ClientServerCreate) *ClientServerCreateBulk

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

func (*ClientServerClient) Delete

Delete returns a delete builder for ClientServer.

func (*ClientServerClient) DeleteOne

DeleteOne returns a delete builder for the given entity.

func (*ClientServerClient) DeleteOneID

func (c *ClientServerClient) DeleteOneID(id int) *ClientServerDeleteOne

DeleteOneID returns a delete builder for the given id.

func (*ClientServerClient) Get

Get returns a ClientServer entity by its id.

func (*ClientServerClient) GetX

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

func (*ClientServerClient) Hooks

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

Hooks returns the client hooks.

func (*ClientServerClient) Query

Query returns a query builder for ClientServer.

func (*ClientServerClient) QueryEvents

func (c *ClientServerClient) QueryEvents(cs *ClientServer) *EventQuery

QueryEvents queries the events edge of a ClientServer.

func (*ClientServerClient) QueryOwner

func (c *ClientServerClient) QueryOwner(cs *ClientServer) *UserQuery

QueryOwner queries the owner edge of a ClientServer.

func (*ClientServerClient) Update

Update returns an update builder for ClientServer.

func (*ClientServerClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*ClientServerClient) UpdateOneID

func (c *ClientServerClient) UpdateOneID(id int) *ClientServerUpdateOne

UpdateOneID returns an update builder for the given id.

func (*ClientServerClient) Use

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

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

type ClientServerCreate

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

ClientServerCreate is the builder for creating a ClientServer entity.

func (*ClientServerCreate) AddEventIDs

func (csc *ClientServerCreate) AddEventIDs(ids ...int) *ClientServerCreate

AddEventIDs adds the "events" edge to the Event entity by IDs.

func (*ClientServerCreate) AddEvents

func (csc *ClientServerCreate) AddEvents(e ...*Event) *ClientServerCreate

AddEvents adds the "events" edges to the Event entity.

func (*ClientServerCreate) AddOwner

func (csc *ClientServerCreate) AddOwner(u ...*User) *ClientServerCreate

AddOwner adds the "owner" edges to the User entity.

func (*ClientServerCreate) AddOwnerIDs

func (csc *ClientServerCreate) AddOwnerIDs(ids ...int) *ClientServerCreate

AddOwnerIDs adds the "owner" edge to the User entity by IDs.

func (*ClientServerCreate) Mutation

func (csc *ClientServerCreate) Mutation() *ClientServerMutation

Mutation returns the ClientServerMutation object of the builder.

func (*ClientServerCreate) Save

Save creates the ClientServer in the database.

func (*ClientServerCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*ClientServerCreate) SetAvailable

func (csc *ClientServerCreate) SetAvailable(b bool) *ClientServerCreate

SetAvailable sets the "available" field.

func (*ClientServerCreate) SetClientName

func (csc *ClientServerCreate) SetClientName(s string) *ClientServerCreate

SetClientName sets the "client_name" field.

func (*ClientServerCreate) SetCreatedAt

func (csc *ClientServerCreate) SetCreatedAt(t time.Time) *ClientServerCreate

SetCreatedAt sets the "created_at" field.

func (*ClientServerCreate) SetDescription

func (csc *ClientServerCreate) SetDescription(s string) *ClientServerCreate

SetDescription sets the "description" field.

func (csc *ClientServerCreate) SetLink(s string) *ClientServerCreate

SetLink sets the "link" field.

func (*ClientServerCreate) SetNillableCreatedAt

func (csc *ClientServerCreate) SetNillableCreatedAt(t *time.Time) *ClientServerCreate

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

func (*ClientServerCreate) SetToken

func (csc *ClientServerCreate) SetToken(s string) *ClientServerCreate

SetToken sets the "token" field.

type ClientServerCreateBulk

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

ClientServerCreateBulk is the builder for creating many ClientServer entities in bulk.

func (*ClientServerCreateBulk) Save

Save creates the ClientServer entities in the database.

func (*ClientServerCreateBulk) SaveX

func (cscb *ClientServerCreateBulk) SaveX(ctx context.Context) []*ClientServer

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

type ClientServerDelete

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

ClientServerDelete is the builder for deleting a ClientServer entity.

func (*ClientServerDelete) Exec

func (csd *ClientServerDelete) Exec(ctx context.Context) (int, error)

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

func (*ClientServerDelete) ExecX

func (csd *ClientServerDelete) ExecX(ctx context.Context) int

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

func (*ClientServerDelete) Where

Where adds a new predicate to the ClientServerDelete builder.

type ClientServerDeleteOne

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

ClientServerDeleteOne is the builder for deleting a single ClientServer entity.

func (*ClientServerDeleteOne) Exec

func (csdo *ClientServerDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*ClientServerDeleteOne) ExecX

func (csdo *ClientServerDeleteOne) ExecX(ctx context.Context)

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

type ClientServerEdges

type ClientServerEdges struct {
	// Events holds the value of the events edge.
	Events []*Event `json:"events,omitempty"`
	// Owner holds the value of the owner edge.
	Owner []*User `json:"owner,omitempty"`
	// contains filtered or unexported fields
}

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

func (ClientServerEdges) EventsOrErr

func (e ClientServerEdges) EventsOrErr() ([]*Event, error)

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

func (ClientServerEdges) OwnerOrErr

func (e ClientServerEdges) OwnerOrErr() ([]*User, error)

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

type ClientServerGroupBy

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

ClientServerGroupBy is the group-by builder for ClientServer entities.

func (*ClientServerGroupBy) Aggregate

func (csgb *ClientServerGroupBy) Aggregate(fns ...AggregateFunc) *ClientServerGroupBy

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

func (*ClientServerGroupBy) Bool

func (csgb *ClientServerGroupBy) Bool(ctx context.Context) (_ bool, err error)

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

func (*ClientServerGroupBy) BoolX

func (csgb *ClientServerGroupBy) BoolX(ctx context.Context) bool

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

func (*ClientServerGroupBy) Bools

func (csgb *ClientServerGroupBy) Bools(ctx context.Context) ([]bool, error)

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

func (*ClientServerGroupBy) BoolsX

func (csgb *ClientServerGroupBy) BoolsX(ctx context.Context) []bool

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

func (*ClientServerGroupBy) Float64

func (csgb *ClientServerGroupBy) Float64(ctx context.Context) (_ float64, err error)

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

func (*ClientServerGroupBy) Float64X

func (csgb *ClientServerGroupBy) Float64X(ctx context.Context) float64

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

func (*ClientServerGroupBy) Float64s

func (csgb *ClientServerGroupBy) Float64s(ctx context.Context) ([]float64, error)

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

func (*ClientServerGroupBy) Float64sX

func (csgb *ClientServerGroupBy) Float64sX(ctx context.Context) []float64

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

func (*ClientServerGroupBy) Int

func (csgb *ClientServerGroupBy) Int(ctx context.Context) (_ int, err error)

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

func (*ClientServerGroupBy) IntX

func (csgb *ClientServerGroupBy) IntX(ctx context.Context) int

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

func (*ClientServerGroupBy) Ints

func (csgb *ClientServerGroupBy) Ints(ctx context.Context) ([]int, error)

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

func (*ClientServerGroupBy) IntsX

func (csgb *ClientServerGroupBy) IntsX(ctx context.Context) []int

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

func (*ClientServerGroupBy) Scan

func (csgb *ClientServerGroupBy) Scan(ctx context.Context, v interface{}) error

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

func (*ClientServerGroupBy) ScanX

func (csgb *ClientServerGroupBy) ScanX(ctx context.Context, v interface{})

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

func (*ClientServerGroupBy) String

func (csgb *ClientServerGroupBy) String(ctx context.Context) (_ string, err error)

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

func (*ClientServerGroupBy) StringX

func (csgb *ClientServerGroupBy) StringX(ctx context.Context) string

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

func (*ClientServerGroupBy) Strings

func (csgb *ClientServerGroupBy) Strings(ctx context.Context) ([]string, error)

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

func (*ClientServerGroupBy) StringsX

func (csgb *ClientServerGroupBy) StringsX(ctx context.Context) []string

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

type ClientServerMutation

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

ClientServerMutation represents an operation that mutates the ClientServer nodes in the graph.

func (*ClientServerMutation) AddEventIDs

func (m *ClientServerMutation) AddEventIDs(ids ...int)

AddEventIDs adds the "events" edge to the Event entity by ids.

func (*ClientServerMutation) AddField

func (m *ClientServerMutation) 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 (*ClientServerMutation) AddOwnerIDs

func (m *ClientServerMutation) AddOwnerIDs(ids ...int)

AddOwnerIDs adds the "owner" edge to the User entity by ids.

func (*ClientServerMutation) AddedEdges

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

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

func (*ClientServerMutation) AddedField

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

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

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

func (*ClientServerMutation) AddedIDs

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

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

func (*ClientServerMutation) Available

func (m *ClientServerMutation) Available() (r bool, exists bool)

Available returns the value of the "available" field in the mutation.

func (*ClientServerMutation) ClearEdge

func (m *ClientServerMutation) 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 (*ClientServerMutation) ClearEvents

func (m *ClientServerMutation) ClearEvents()

ClearEvents clears the "events" edge to the Event entity.

func (*ClientServerMutation) ClearField

func (m *ClientServerMutation) 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 (*ClientServerMutation) ClearOwner

func (m *ClientServerMutation) ClearOwner()

ClearOwner clears the "owner" edge to the User entity.

func (*ClientServerMutation) ClearedEdges

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

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

func (*ClientServerMutation) ClearedFields

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

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

func (ClientServerMutation) Client

func (m ClientServerMutation) 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 (*ClientServerMutation) ClientName

func (m *ClientServerMutation) ClientName() (r string, exists bool)

ClientName returns the value of the "client_name" field in the mutation.

func (*ClientServerMutation) CreatedAt

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

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

func (*ClientServerMutation) Description

func (m *ClientServerMutation) Description() (r string, exists bool)

Description returns the value of the "description" field in the mutation.

func (*ClientServerMutation) EdgeCleared

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

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

func (*ClientServerMutation) EventsCleared

func (m *ClientServerMutation) EventsCleared() bool

EventsCleared returns if the "events" edge to the Event entity was cleared.

func (*ClientServerMutation) EventsIDs

func (m *ClientServerMutation) EventsIDs() (ids []int)

EventsIDs returns the "events" edge IDs in the mutation.

func (*ClientServerMutation) Field

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

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

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

func (*ClientServerMutation) Fields

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

func (m *ClientServerMutation) 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.

func (m *ClientServerMutation) Link() (r string, exists bool)

Link returns the value of the "link" field in the mutation.

func (*ClientServerMutation) OldAvailable

func (m *ClientServerMutation) OldAvailable(ctx context.Context) (v bool, err error)

OldAvailable returns the old "available" field's value of the ClientServer entity. If the ClientServer 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 (*ClientServerMutation) OldClientName

func (m *ClientServerMutation) OldClientName(ctx context.Context) (v string, err error)

OldClientName returns the old "client_name" field's value of the ClientServer entity. If the ClientServer 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 (*ClientServerMutation) OldCreatedAt

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

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

func (m *ClientServerMutation) OldDescription(ctx context.Context) (v string, err error)

OldDescription returns the old "description" field's value of the ClientServer entity. If the ClientServer 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 (*ClientServerMutation) OldField

func (m *ClientServerMutation) 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 (m *ClientServerMutation) OldLink(ctx context.Context) (v string, err error)

OldLink returns the old "link" field's value of the ClientServer entity. If the ClientServer 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 (*ClientServerMutation) OldToken

func (m *ClientServerMutation) OldToken(ctx context.Context) (v string, err error)

OldToken returns the old "token" field's value of the ClientServer entity. If the ClientServer 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 (*ClientServerMutation) Op

func (m *ClientServerMutation) Op() Op

Op returns the operation name.

func (*ClientServerMutation) OwnerCleared

func (m *ClientServerMutation) OwnerCleared() bool

OwnerCleared returns if the "owner" edge to the User entity was cleared.

func (*ClientServerMutation) OwnerIDs

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

OwnerIDs returns the "owner" edge IDs in the mutation.

func (*ClientServerMutation) RemoveEventIDs

func (m *ClientServerMutation) RemoveEventIDs(ids ...int)

RemoveEventIDs removes the "events" edge to the Event entity by IDs.

func (*ClientServerMutation) RemoveOwnerIDs

func (m *ClientServerMutation) RemoveOwnerIDs(ids ...int)

RemoveOwnerIDs removes the "owner" edge to the User entity by IDs.

func (*ClientServerMutation) RemovedEdges

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

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

func (*ClientServerMutation) RemovedEventsIDs

func (m *ClientServerMutation) RemovedEventsIDs() (ids []int)

RemovedEvents returns the removed IDs of the "events" edge to the Event entity.

func (*ClientServerMutation) RemovedIDs

func (m *ClientServerMutation) 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 (*ClientServerMutation) RemovedOwnerIDs

func (m *ClientServerMutation) RemovedOwnerIDs() (ids []int)

RemovedOwner returns the removed IDs of the "owner" edge to the User entity.

func (*ClientServerMutation) ResetAvailable

func (m *ClientServerMutation) ResetAvailable()

ResetAvailable resets all changes to the "available" field.

func (*ClientServerMutation) ResetClientName

func (m *ClientServerMutation) ResetClientName()

ResetClientName resets all changes to the "client_name" field.

func (*ClientServerMutation) ResetCreatedAt

func (m *ClientServerMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*ClientServerMutation) ResetDescription

func (m *ClientServerMutation) ResetDescription()

ResetDescription resets all changes to the "description" field.

func (*ClientServerMutation) ResetEdge

func (m *ClientServerMutation) 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 (*ClientServerMutation) ResetEvents

func (m *ClientServerMutation) ResetEvents()

ResetEvents resets all changes to the "events" edge.

func (*ClientServerMutation) ResetField

func (m *ClientServerMutation) 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 (m *ClientServerMutation) ResetLink()

ResetLink resets all changes to the "link" field.

func (*ClientServerMutation) ResetOwner

func (m *ClientServerMutation) ResetOwner()

ResetOwner resets all changes to the "owner" edge.

func (*ClientServerMutation) ResetToken

func (m *ClientServerMutation) ResetToken()

ResetToken resets all changes to the "token" field.

func (*ClientServerMutation) SetAvailable

func (m *ClientServerMutation) SetAvailable(b bool)

SetAvailable sets the "available" field.

func (*ClientServerMutation) SetClientName

func (m *ClientServerMutation) SetClientName(s string)

SetClientName sets the "client_name" field.

func (*ClientServerMutation) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*ClientServerMutation) SetDescription

func (m *ClientServerMutation) SetDescription(s string)

SetDescription sets the "description" field.

func (*ClientServerMutation) SetField

func (m *ClientServerMutation) 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 (m *ClientServerMutation) SetLink(s string)

SetLink sets the "link" field.

func (*ClientServerMutation) SetToken

func (m *ClientServerMutation) SetToken(s string)

SetToken sets the "token" field.

func (*ClientServerMutation) Token

func (m *ClientServerMutation) Token() (r string, exists bool)

Token returns the value of the "token" field in the mutation.

func (ClientServerMutation) Tx

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

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

func (*ClientServerMutation) Type

func (m *ClientServerMutation) Type() string

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

type ClientServerQuery

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

ClientServerQuery is the builder for querying ClientServer entities.

func (*ClientServerQuery) All

func (csq *ClientServerQuery) All(ctx context.Context) ([]*ClientServer, error)

All executes the query and returns a list of ClientServers.

func (*ClientServerQuery) AllX

func (csq *ClientServerQuery) AllX(ctx context.Context) []*ClientServer

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

func (*ClientServerQuery) Clone

func (csq *ClientServerQuery) Clone() *ClientServerQuery

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

func (*ClientServerQuery) Count

func (csq *ClientServerQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*ClientServerQuery) CountX

func (csq *ClientServerQuery) CountX(ctx context.Context) int

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

func (*ClientServerQuery) Exist

func (csq *ClientServerQuery) Exist(ctx context.Context) (bool, error)

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

func (*ClientServerQuery) ExistX

func (csq *ClientServerQuery) ExistX(ctx context.Context) bool

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

func (*ClientServerQuery) First

func (csq *ClientServerQuery) First(ctx context.Context) (*ClientServer, error)

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

func (*ClientServerQuery) FirstID

func (csq *ClientServerQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*ClientServerQuery) FirstIDX

func (csq *ClientServerQuery) FirstIDX(ctx context.Context) int

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

func (*ClientServerQuery) FirstX

func (csq *ClientServerQuery) FirstX(ctx context.Context) *ClientServer

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

func (*ClientServerQuery) GroupBy

func (csq *ClientServerQuery) GroupBy(field string, fields ...string) *ClientServerGroupBy

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

client.ClientServer.Query().
	GroupBy(clientserver.FieldClientName).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*ClientServerQuery) IDs

func (csq *ClientServerQuery) IDs(ctx context.Context) ([]int, error)

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

func (*ClientServerQuery) IDsX

func (csq *ClientServerQuery) IDsX(ctx context.Context) []int

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

func (*ClientServerQuery) Limit

func (csq *ClientServerQuery) Limit(limit int) *ClientServerQuery

Limit adds a limit step to the query.

func (*ClientServerQuery) Offset

func (csq *ClientServerQuery) Offset(offset int) *ClientServerQuery

Offset adds an offset step to the query.

func (*ClientServerQuery) Only

func (csq *ClientServerQuery) Only(ctx context.Context) (*ClientServer, error)

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

func (*ClientServerQuery) OnlyID

func (csq *ClientServerQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*ClientServerQuery) OnlyIDX

func (csq *ClientServerQuery) OnlyIDX(ctx context.Context) int

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

func (*ClientServerQuery) OnlyX

func (csq *ClientServerQuery) OnlyX(ctx context.Context) *ClientServer

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

func (*ClientServerQuery) Order

func (csq *ClientServerQuery) Order(o ...OrderFunc) *ClientServerQuery

Order adds an order step to the query.

func (*ClientServerQuery) QueryEvents

func (csq *ClientServerQuery) QueryEvents() *EventQuery

QueryEvents chains the current query on the "events" edge.

func (*ClientServerQuery) QueryOwner

func (csq *ClientServerQuery) QueryOwner() *UserQuery

QueryOwner chains the current query on the "owner" edge.

func (*ClientServerQuery) Select

func (csq *ClientServerQuery) Select(field string, fields ...string) *ClientServerSelect

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

client.ClientServer.Query().
	Select(clientserver.FieldClientName).
	Scan(ctx, &v)

func (*ClientServerQuery) Where

Where adds a new predicate for the ClientServerQuery builder.

func (*ClientServerQuery) WithEvents

func (csq *ClientServerQuery) WithEvents(opts ...func(*EventQuery)) *ClientServerQuery

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

func (*ClientServerQuery) WithOwner

func (csq *ClientServerQuery) WithOwner(opts ...func(*UserQuery)) *ClientServerQuery

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

type ClientServerSelect

type ClientServerSelect struct {
	*ClientServerQuery
	// contains filtered or unexported fields
}

ClientServerSelect is the builder for selecting fields of ClientServer entities.

func (*ClientServerSelect) Bool

func (css *ClientServerSelect) Bool(ctx context.Context) (_ bool, err error)

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

func (*ClientServerSelect) BoolX

func (css *ClientServerSelect) BoolX(ctx context.Context) bool

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

func (*ClientServerSelect) Bools

func (css *ClientServerSelect) Bools(ctx context.Context) ([]bool, error)

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

func (*ClientServerSelect) BoolsX

func (css *ClientServerSelect) BoolsX(ctx context.Context) []bool

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

func (*ClientServerSelect) Float64

func (css *ClientServerSelect) Float64(ctx context.Context) (_ float64, err error)

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

func (*ClientServerSelect) Float64X

func (css *ClientServerSelect) Float64X(ctx context.Context) float64

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

func (*ClientServerSelect) Float64s

func (css *ClientServerSelect) Float64s(ctx context.Context) ([]float64, error)

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

func (*ClientServerSelect) Float64sX

func (css *ClientServerSelect) Float64sX(ctx context.Context) []float64

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

func (*ClientServerSelect) Int

func (css *ClientServerSelect) Int(ctx context.Context) (_ int, err error)

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

func (*ClientServerSelect) IntX

func (css *ClientServerSelect) IntX(ctx context.Context) int

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

func (*ClientServerSelect) Ints

func (css *ClientServerSelect) Ints(ctx context.Context) ([]int, error)

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

func (*ClientServerSelect) IntsX

func (css *ClientServerSelect) IntsX(ctx context.Context) []int

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

func (*ClientServerSelect) Scan

func (css *ClientServerSelect) Scan(ctx context.Context, v interface{}) error

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

func (*ClientServerSelect) ScanX

func (css *ClientServerSelect) ScanX(ctx context.Context, v interface{})

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

func (*ClientServerSelect) String

func (css *ClientServerSelect) String(ctx context.Context) (_ string, err error)

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

func (*ClientServerSelect) StringX

func (css *ClientServerSelect) StringX(ctx context.Context) string

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

func (*ClientServerSelect) Strings

func (css *ClientServerSelect) Strings(ctx context.Context) ([]string, error)

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

func (*ClientServerSelect) StringsX

func (css *ClientServerSelect) StringsX(ctx context.Context) []string

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

type ClientServerUpdate

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

ClientServerUpdate is the builder for updating ClientServer entities.

func (*ClientServerUpdate) AddEventIDs

func (csu *ClientServerUpdate) AddEventIDs(ids ...int) *ClientServerUpdate

AddEventIDs adds the "events" edge to the Event entity by IDs.

func (*ClientServerUpdate) AddEvents

func (csu *ClientServerUpdate) AddEvents(e ...*Event) *ClientServerUpdate

AddEvents adds the "events" edges to the Event entity.

func (*ClientServerUpdate) AddOwner

func (csu *ClientServerUpdate) AddOwner(u ...*User) *ClientServerUpdate

AddOwner adds the "owner" edges to the User entity.

func (*ClientServerUpdate) AddOwnerIDs

func (csu *ClientServerUpdate) AddOwnerIDs(ids ...int) *ClientServerUpdate

AddOwnerIDs adds the "owner" edge to the User entity by IDs.

func (*ClientServerUpdate) ClearEvents

func (csu *ClientServerUpdate) ClearEvents() *ClientServerUpdate

ClearEvents clears all "events" edges to the Event entity.

func (*ClientServerUpdate) ClearOwner

func (csu *ClientServerUpdate) ClearOwner() *ClientServerUpdate

ClearOwner clears all "owner" edges to the User entity.

func (*ClientServerUpdate) Exec

func (csu *ClientServerUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*ClientServerUpdate) ExecX

func (csu *ClientServerUpdate) ExecX(ctx context.Context)

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

func (*ClientServerUpdate) Mutation

func (csu *ClientServerUpdate) Mutation() *ClientServerMutation

Mutation returns the ClientServerMutation object of the builder.

func (*ClientServerUpdate) RemoveEventIDs

func (csu *ClientServerUpdate) RemoveEventIDs(ids ...int) *ClientServerUpdate

RemoveEventIDs removes the "events" edge to Event entities by IDs.

func (*ClientServerUpdate) RemoveEvents

func (csu *ClientServerUpdate) RemoveEvents(e ...*Event) *ClientServerUpdate

RemoveEvents removes "events" edges to Event entities.

func (*ClientServerUpdate) RemoveOwner

func (csu *ClientServerUpdate) RemoveOwner(u ...*User) *ClientServerUpdate

RemoveOwner removes "owner" edges to User entities.

func (*ClientServerUpdate) RemoveOwnerIDs

func (csu *ClientServerUpdate) RemoveOwnerIDs(ids ...int) *ClientServerUpdate

RemoveOwnerIDs removes the "owner" edge to User entities by IDs.

func (*ClientServerUpdate) Save

func (csu *ClientServerUpdate) Save(ctx context.Context) (int, error)

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

func (*ClientServerUpdate) SaveX

func (csu *ClientServerUpdate) SaveX(ctx context.Context) int

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

func (*ClientServerUpdate) SetAvailable

func (csu *ClientServerUpdate) SetAvailable(b bool) *ClientServerUpdate

SetAvailable sets the "available" field.

func (*ClientServerUpdate) SetClientName

func (csu *ClientServerUpdate) SetClientName(s string) *ClientServerUpdate

SetClientName sets the "client_name" field.

func (*ClientServerUpdate) SetCreatedAt

func (csu *ClientServerUpdate) SetCreatedAt(t time.Time) *ClientServerUpdate

SetCreatedAt sets the "created_at" field.

func (*ClientServerUpdate) SetDescription

func (csu *ClientServerUpdate) SetDescription(s string) *ClientServerUpdate

SetDescription sets the "description" field.

func (csu *ClientServerUpdate) SetLink(s string) *ClientServerUpdate

SetLink sets the "link" field.

func (*ClientServerUpdate) SetNillableCreatedAt

func (csu *ClientServerUpdate) SetNillableCreatedAt(t *time.Time) *ClientServerUpdate

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

func (*ClientServerUpdate) SetToken

func (csu *ClientServerUpdate) SetToken(s string) *ClientServerUpdate

SetToken sets the "token" field.

func (*ClientServerUpdate) Where

Where adds a new predicate for the ClientServerUpdate builder.

type ClientServerUpdateOne

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

ClientServerUpdateOne is the builder for updating a single ClientServer entity.

func (*ClientServerUpdateOne) AddEventIDs

func (csuo *ClientServerUpdateOne) AddEventIDs(ids ...int) *ClientServerUpdateOne

AddEventIDs adds the "events" edge to the Event entity by IDs.

func (*ClientServerUpdateOne) AddEvents

func (csuo *ClientServerUpdateOne) AddEvents(e ...*Event) *ClientServerUpdateOne

AddEvents adds the "events" edges to the Event entity.

func (*ClientServerUpdateOne) AddOwner

func (csuo *ClientServerUpdateOne) AddOwner(u ...*User) *ClientServerUpdateOne

AddOwner adds the "owner" edges to the User entity.

func (*ClientServerUpdateOne) AddOwnerIDs

func (csuo *ClientServerUpdateOne) AddOwnerIDs(ids ...int) *ClientServerUpdateOne

AddOwnerIDs adds the "owner" edge to the User entity by IDs.

func (*ClientServerUpdateOne) ClearEvents

func (csuo *ClientServerUpdateOne) ClearEvents() *ClientServerUpdateOne

ClearEvents clears all "events" edges to the Event entity.

func (*ClientServerUpdateOne) ClearOwner

func (csuo *ClientServerUpdateOne) ClearOwner() *ClientServerUpdateOne

ClearOwner clears all "owner" edges to the User entity.

func (*ClientServerUpdateOne) Exec

func (csuo *ClientServerUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*ClientServerUpdateOne) ExecX

func (csuo *ClientServerUpdateOne) ExecX(ctx context.Context)

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

func (*ClientServerUpdateOne) Mutation

func (csuo *ClientServerUpdateOne) Mutation() *ClientServerMutation

Mutation returns the ClientServerMutation object of the builder.

func (*ClientServerUpdateOne) RemoveEventIDs

func (csuo *ClientServerUpdateOne) RemoveEventIDs(ids ...int) *ClientServerUpdateOne

RemoveEventIDs removes the "events" edge to Event entities by IDs.

func (*ClientServerUpdateOne) RemoveEvents

func (csuo *ClientServerUpdateOne) RemoveEvents(e ...*Event) *ClientServerUpdateOne

RemoveEvents removes "events" edges to Event entities.

func (*ClientServerUpdateOne) RemoveOwner

func (csuo *ClientServerUpdateOne) RemoveOwner(u ...*User) *ClientServerUpdateOne

RemoveOwner removes "owner" edges to User entities.

func (*ClientServerUpdateOne) RemoveOwnerIDs

func (csuo *ClientServerUpdateOne) RemoveOwnerIDs(ids ...int) *ClientServerUpdateOne

RemoveOwnerIDs removes the "owner" edge to User entities by IDs.

func (*ClientServerUpdateOne) Save

Save executes the query and returns the updated ClientServer entity.

func (*ClientServerUpdateOne) SaveX

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

func (*ClientServerUpdateOne) SetAvailable

func (csuo *ClientServerUpdateOne) SetAvailable(b bool) *ClientServerUpdateOne

SetAvailable sets the "available" field.

func (*ClientServerUpdateOne) SetClientName

func (csuo *ClientServerUpdateOne) SetClientName(s string) *ClientServerUpdateOne

SetClientName sets the "client_name" field.

func (*ClientServerUpdateOne) SetCreatedAt

func (csuo *ClientServerUpdateOne) SetCreatedAt(t time.Time) *ClientServerUpdateOne

SetCreatedAt sets the "created_at" field.

func (*ClientServerUpdateOne) SetDescription

func (csuo *ClientServerUpdateOne) SetDescription(s string) *ClientServerUpdateOne

SetDescription sets the "description" field.

SetLink sets the "link" field.

func (*ClientServerUpdateOne) SetNillableCreatedAt

func (csuo *ClientServerUpdateOne) SetNillableCreatedAt(t *time.Time) *ClientServerUpdateOne

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

func (*ClientServerUpdateOne) SetToken

SetToken sets the "token" field.

type ClientServers

type ClientServers []*ClientServer

ClientServers is a parsable slice of ClientServer.

type CommitFunc

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

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

func (CommitFunc) Commit

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

Commit calls f(ctx, m).

type CommitHook

type CommitHook func(Committer) Committer

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

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

type Committer

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

Committer is the interface that wraps the Committer method.

type ConstraintError

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

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

func (ConstraintError) Error

func (e ConstraintError) Error() string

Error implements the error interface.

func (*ConstraintError) Unwrap

func (e *ConstraintError) Unwrap() error

Unwrap implements the errors.Wrapper interface.

type Event

type Event struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// Event holds the value of the "event" field.
	Event string `json:"event,omitempty"`
	// Message holds the value of the "message" field.
	Message string `json:"message,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the EventQuery when eager-loading is set.
	Edges EventEdges `json:"edges"`
	// contains filtered or unexported fields
}

Event is the model entity for the Event schema.

func (*Event) QueryClientserver

func (e *Event) QueryClientserver() *ClientServerQuery

QueryClientserver queries the "clientserver" edge of the Event entity.

func (*Event) QueryUser

func (e *Event) QueryUser() *UserQuery

QueryUser queries the "user" edge of the Event entity.

func (*Event) String

func (e *Event) String() string

String implements the fmt.Stringer.

func (*Event) Unwrap

func (e *Event) Unwrap() *Event

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

func (e *Event) Update() *EventUpdateOne

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

type EventClient

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

EventClient is a client for the Event schema.

func NewEventClient

func NewEventClient(c config) *EventClient

NewEventClient returns a client for the Event from the given config.

func (*EventClient) Create

func (c *EventClient) Create() *EventCreate

Create returns a create builder for Event.

func (*EventClient) CreateBulk

func (c *EventClient) CreateBulk(builders ...*EventCreate) *EventCreateBulk

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

func (*EventClient) Delete

func (c *EventClient) Delete() *EventDelete

Delete returns a delete builder for Event.

func (*EventClient) DeleteOne

func (c *EventClient) DeleteOne(e *Event) *EventDeleteOne

DeleteOne returns a delete builder for the given entity.

func (*EventClient) DeleteOneID

func (c *EventClient) DeleteOneID(id int) *EventDeleteOne

DeleteOneID returns a delete builder for the given id.

func (*EventClient) Get

func (c *EventClient) Get(ctx context.Context, id int) (*Event, error)

Get returns a Event entity by its id.

func (*EventClient) GetX

func (c *EventClient) GetX(ctx context.Context, id int) *Event

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

func (*EventClient) Hooks

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

Hooks returns the client hooks.

func (*EventClient) Query

func (c *EventClient) Query() *EventQuery

Query returns a query builder for Event.

func (*EventClient) QueryClientserver

func (c *EventClient) QueryClientserver(e *Event) *ClientServerQuery

QueryClientserver queries the clientserver edge of a Event.

func (*EventClient) QueryUser

func (c *EventClient) QueryUser(e *Event) *UserQuery

QueryUser queries the user edge of a Event.

func (*EventClient) Update

func (c *EventClient) Update() *EventUpdate

Update returns an update builder for Event.

func (*EventClient) UpdateOne

func (c *EventClient) UpdateOne(e *Event) *EventUpdateOne

UpdateOne returns an update builder for the given entity.

func (*EventClient) UpdateOneID

func (c *EventClient) UpdateOneID(id int) *EventUpdateOne

UpdateOneID returns an update builder for the given id.

func (*EventClient) Use

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

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

type EventCreate

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

EventCreate is the builder for creating a Event entity.

func (*EventCreate) Mutation

func (ec *EventCreate) Mutation() *EventMutation

Mutation returns the EventMutation object of the builder.

func (*EventCreate) Save

func (ec *EventCreate) Save(ctx context.Context) (*Event, error)

Save creates the Event in the database.

func (*EventCreate) SaveX

func (ec *EventCreate) SaveX(ctx context.Context) *Event

SaveX calls Save and panics if Save returns an error.

func (*EventCreate) SetClientserver

func (ec *EventCreate) SetClientserver(c *ClientServer) *EventCreate

SetClientserver sets the "clientserver" edge to the ClientServer entity.

func (*EventCreate) SetClientserverID

func (ec *EventCreate) SetClientserverID(id int) *EventCreate

SetClientserverID sets the "clientserver" edge to the ClientServer entity by ID.

func (*EventCreate) SetCreatedAt

func (ec *EventCreate) SetCreatedAt(t time.Time) *EventCreate

SetCreatedAt sets the "created_at" field.

func (*EventCreate) SetEvent

func (ec *EventCreate) SetEvent(s string) *EventCreate

SetEvent sets the "event" field.

func (*EventCreate) SetMessage

func (ec *EventCreate) SetMessage(s string) *EventCreate

SetMessage sets the "message" field.

func (*EventCreate) SetNillableClientserverID

func (ec *EventCreate) SetNillableClientserverID(id *int) *EventCreate

SetNillableClientserverID sets the "clientserver" edge to the ClientServer entity by ID if the given value is not nil.

func (*EventCreate) SetNillableCreatedAt

func (ec *EventCreate) SetNillableCreatedAt(t *time.Time) *EventCreate

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

func (*EventCreate) SetNillableMessage

func (ec *EventCreate) SetNillableMessage(s *string) *EventCreate

SetNillableMessage sets the "message" field if the given value is not nil.

func (*EventCreate) SetNillableUserID

func (ec *EventCreate) SetNillableUserID(id *int) *EventCreate

SetNillableUserID sets the "user" edge to the User entity by ID if the given value is not nil.

func (*EventCreate) SetUser

func (ec *EventCreate) SetUser(u *User) *EventCreate

SetUser sets the "user" edge to the User entity.

func (*EventCreate) SetUserID

func (ec *EventCreate) SetUserID(id int) *EventCreate

SetUserID sets the "user" edge to the User entity by ID.

type EventCreateBulk

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

EventCreateBulk is the builder for creating many Event entities in bulk.

func (*EventCreateBulk) Save

func (ecb *EventCreateBulk) Save(ctx context.Context) ([]*Event, error)

Save creates the Event entities in the database.

func (*EventCreateBulk) SaveX

func (ecb *EventCreateBulk) SaveX(ctx context.Context) []*Event

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

type EventDelete

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

EventDelete is the builder for deleting a Event entity.

func (*EventDelete) Exec

func (ed *EventDelete) Exec(ctx context.Context) (int, error)

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

func (*EventDelete) ExecX

func (ed *EventDelete) ExecX(ctx context.Context) int

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

func (*EventDelete) Where

func (ed *EventDelete) Where(ps ...predicate.Event) *EventDelete

Where adds a new predicate to the EventDelete builder.

type EventDeleteOne

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

EventDeleteOne is the builder for deleting a single Event entity.

func (*EventDeleteOne) Exec

func (edo *EventDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*EventDeleteOne) ExecX

func (edo *EventDeleteOne) ExecX(ctx context.Context)

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

type EventEdges

type EventEdges struct {
	// User holds the value of the user edge.
	User *User `json:"user,omitempty"`
	// Clientserver holds the value of the clientserver edge.
	Clientserver *ClientServer `json:"clientserver,omitempty"`
	// contains filtered or unexported fields
}

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

func (EventEdges) ClientserverOrErr

func (e EventEdges) ClientserverOrErr() (*ClientServer, error)

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

func (EventEdges) UserOrErr

func (e EventEdges) UserOrErr() (*User, error)

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

type EventGroupBy

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

EventGroupBy is the group-by builder for Event entities.

func (*EventGroupBy) Aggregate

func (egb *EventGroupBy) Aggregate(fns ...AggregateFunc) *EventGroupBy

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

func (*EventGroupBy) Bool

func (egb *EventGroupBy) Bool(ctx context.Context) (_ bool, err error)

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

func (*EventGroupBy) BoolX

func (egb *EventGroupBy) BoolX(ctx context.Context) bool

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

func (*EventGroupBy) Bools

func (egb *EventGroupBy) Bools(ctx context.Context) ([]bool, error)

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

func (*EventGroupBy) BoolsX

func (egb *EventGroupBy) BoolsX(ctx context.Context) []bool

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

func (*EventGroupBy) Float64

func (egb *EventGroupBy) Float64(ctx context.Context) (_ float64, err error)

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

func (*EventGroupBy) Float64X

func (egb *EventGroupBy) Float64X(ctx context.Context) float64

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

func (*EventGroupBy) Float64s

func (egb *EventGroupBy) Float64s(ctx context.Context) ([]float64, error)

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

func (*EventGroupBy) Float64sX

func (egb *EventGroupBy) Float64sX(ctx context.Context) []float64

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

func (*EventGroupBy) Int

func (egb *EventGroupBy) Int(ctx context.Context) (_ int, err error)

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

func (*EventGroupBy) IntX

func (egb *EventGroupBy) IntX(ctx context.Context) int

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

func (*EventGroupBy) Ints

func (egb *EventGroupBy) Ints(ctx context.Context) ([]int, error)

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

func (*EventGroupBy) IntsX

func (egb *EventGroupBy) IntsX(ctx context.Context) []int

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

func (*EventGroupBy) Scan

func (egb *EventGroupBy) Scan(ctx context.Context, v interface{}) error

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

func (*EventGroupBy) ScanX

func (egb *EventGroupBy) ScanX(ctx context.Context, v interface{})

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

func (*EventGroupBy) String

func (egb *EventGroupBy) String(ctx context.Context) (_ string, err error)

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

func (*EventGroupBy) StringX

func (egb *EventGroupBy) StringX(ctx context.Context) string

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

func (*EventGroupBy) Strings

func (egb *EventGroupBy) Strings(ctx context.Context) ([]string, error)

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

func (*EventGroupBy) StringsX

func (egb *EventGroupBy) StringsX(ctx context.Context) []string

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

type EventMutation

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

EventMutation represents an operation that mutates the Event nodes in the graph.

func (*EventMutation) AddField

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

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

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

func (*EventMutation) AddedField

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

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

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

func (*EventMutation) AddedIDs

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

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

func (*EventMutation) ClearClientserver

func (m *EventMutation) ClearClientserver()

ClearClientserver clears the "clientserver" edge to the ClientServer entity.

func (*EventMutation) ClearEdge

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

func (m *EventMutation) 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 (*EventMutation) ClearUser

func (m *EventMutation) ClearUser()

ClearUser clears the "user" edge to the User entity.

func (*EventMutation) ClearedEdges

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

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

func (*EventMutation) ClearedFields

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

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

func (EventMutation) Client

func (m EventMutation) 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 (*EventMutation) ClientserverCleared

func (m *EventMutation) ClientserverCleared() bool

ClientserverCleared returns if the "clientserver" edge to the ClientServer entity was cleared.

func (*EventMutation) ClientserverID

func (m *EventMutation) ClientserverID() (id int, exists bool)

ClientserverID returns the "clientserver" edge ID in the mutation.

func (*EventMutation) ClientserverIDs

func (m *EventMutation) ClientserverIDs() (ids []int)

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

func (*EventMutation) CreatedAt

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

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

func (*EventMutation) EdgeCleared

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

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

func (*EventMutation) Event

func (m *EventMutation) Event() (r string, exists bool)

Event returns the value of the "event" field in the mutation.

func (*EventMutation) Field

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

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

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

func (*EventMutation) Fields

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

func (m *EventMutation) 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.

func (*EventMutation) Message

func (m *EventMutation) Message() (r string, exists bool)

Message returns the value of the "message" field in the mutation.

func (*EventMutation) OldCreatedAt

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

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

func (m *EventMutation) OldEvent(ctx context.Context) (v string, err error)

OldEvent returns the old "event" field's value of the Event entity. If the Event 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 (*EventMutation) OldField

func (m *EventMutation) 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 (*EventMutation) OldMessage

func (m *EventMutation) OldMessage(ctx context.Context) (v string, err error)

OldMessage returns the old "message" field's value of the Event entity. If the Event 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 (*EventMutation) Op

func (m *EventMutation) Op() Op

Op returns the operation name.

func (*EventMutation) RemovedEdges

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

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

func (*EventMutation) RemovedIDs

func (m *EventMutation) 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 (*EventMutation) ResetClientserver

func (m *EventMutation) ResetClientserver()

ResetClientserver resets all changes to the "clientserver" edge.

func (*EventMutation) ResetCreatedAt

func (m *EventMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*EventMutation) ResetEdge

func (m *EventMutation) 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 (*EventMutation) ResetEvent

func (m *EventMutation) ResetEvent()

ResetEvent resets all changes to the "event" field.

func (*EventMutation) ResetField

func (m *EventMutation) 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 (*EventMutation) ResetMessage

func (m *EventMutation) ResetMessage()

ResetMessage resets all changes to the "message" field.

func (*EventMutation) ResetUser

func (m *EventMutation) ResetUser()

ResetUser resets all changes to the "user" edge.

func (*EventMutation) SetClientserverID

func (m *EventMutation) SetClientserverID(id int)

SetClientserverID sets the "clientserver" edge to the ClientServer entity by id.

func (*EventMutation) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*EventMutation) SetEvent

func (m *EventMutation) SetEvent(s string)

SetEvent sets the "event" field.

func (*EventMutation) SetField

func (m *EventMutation) 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 (*EventMutation) SetMessage

func (m *EventMutation) SetMessage(s string)

SetMessage sets the "message" field.

func (*EventMutation) SetUserID

func (m *EventMutation) SetUserID(id int)

SetUserID sets the "user" edge to the User entity by id.

func (EventMutation) Tx

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

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

func (*EventMutation) Type

func (m *EventMutation) Type() string

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

func (*EventMutation) UserCleared

func (m *EventMutation) UserCleared() bool

UserCleared returns if the "user" edge to the User entity was cleared.

func (*EventMutation) UserID

func (m *EventMutation) UserID() (id int, exists bool)

UserID returns the "user" edge ID in the mutation.

func (*EventMutation) UserIDs

func (m *EventMutation) UserIDs() (ids []int)

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

type EventQuery

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

EventQuery is the builder for querying Event entities.

func (*EventQuery) All

func (eq *EventQuery) All(ctx context.Context) ([]*Event, error)

All executes the query and returns a list of Events.

func (*EventQuery) AllX

func (eq *EventQuery) AllX(ctx context.Context) []*Event

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

func (*EventQuery) Clone

func (eq *EventQuery) Clone() *EventQuery

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

func (*EventQuery) Count

func (eq *EventQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*EventQuery) CountX

func (eq *EventQuery) CountX(ctx context.Context) int

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

func (*EventQuery) Exist

func (eq *EventQuery) Exist(ctx context.Context) (bool, error)

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

func (*EventQuery) ExistX

func (eq *EventQuery) ExistX(ctx context.Context) bool

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

func (*EventQuery) First

func (eq *EventQuery) First(ctx context.Context) (*Event, error)

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

func (*EventQuery) FirstID

func (eq *EventQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*EventQuery) FirstIDX

func (eq *EventQuery) FirstIDX(ctx context.Context) int

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

func (*EventQuery) FirstX

func (eq *EventQuery) FirstX(ctx context.Context) *Event

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

func (*EventQuery) GroupBy

func (eq *EventQuery) GroupBy(field string, fields ...string) *EventGroupBy

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

client.Event.Query().
	GroupBy(event.FieldEvent).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*EventQuery) IDs

func (eq *EventQuery) IDs(ctx context.Context) ([]int, error)

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

func (*EventQuery) IDsX

func (eq *EventQuery) IDsX(ctx context.Context) []int

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

func (*EventQuery) Limit

func (eq *EventQuery) Limit(limit int) *EventQuery

Limit adds a limit step to the query.

func (*EventQuery) Offset

func (eq *EventQuery) Offset(offset int) *EventQuery

Offset adds an offset step to the query.

func (*EventQuery) Only

func (eq *EventQuery) Only(ctx context.Context) (*Event, error)

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

func (*EventQuery) OnlyID

func (eq *EventQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*EventQuery) OnlyIDX

func (eq *EventQuery) OnlyIDX(ctx context.Context) int

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

func (*EventQuery) OnlyX

func (eq *EventQuery) OnlyX(ctx context.Context) *Event

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

func (*EventQuery) Order

func (eq *EventQuery) Order(o ...OrderFunc) *EventQuery

Order adds an order step to the query.

func (*EventQuery) QueryClientserver

func (eq *EventQuery) QueryClientserver() *ClientServerQuery

QueryClientserver chains the current query on the "clientserver" edge.

func (*EventQuery) QueryUser

func (eq *EventQuery) QueryUser() *UserQuery

QueryUser chains the current query on the "user" edge.

func (*EventQuery) Select

func (eq *EventQuery) Select(field string, fields ...string) *EventSelect

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

client.Event.Query().
	Select(event.FieldEvent).
	Scan(ctx, &v)

func (*EventQuery) Where

func (eq *EventQuery) Where(ps ...predicate.Event) *EventQuery

Where adds a new predicate for the EventQuery builder.

func (*EventQuery) WithClientserver

func (eq *EventQuery) WithClientserver(opts ...func(*ClientServerQuery)) *EventQuery

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

func (*EventQuery) WithUser

func (eq *EventQuery) WithUser(opts ...func(*UserQuery)) *EventQuery

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

type EventSelect

type EventSelect struct {
	*EventQuery
	// contains filtered or unexported fields
}

EventSelect is the builder for selecting fields of Event entities.

func (*EventSelect) Bool

func (es *EventSelect) Bool(ctx context.Context) (_ bool, err error)

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

func (*EventSelect) BoolX

func (es *EventSelect) BoolX(ctx context.Context) bool

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

func (*EventSelect) Bools

func (es *EventSelect) Bools(ctx context.Context) ([]bool, error)

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

func (*EventSelect) BoolsX

func (es *EventSelect) BoolsX(ctx context.Context) []bool

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

func (*EventSelect) Float64

func (es *EventSelect) Float64(ctx context.Context) (_ float64, err error)

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

func (*EventSelect) Float64X

func (es *EventSelect) Float64X(ctx context.Context) float64

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

func (*EventSelect) Float64s

func (es *EventSelect) Float64s(ctx context.Context) ([]float64, error)

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

func (*EventSelect) Float64sX

func (es *EventSelect) Float64sX(ctx context.Context) []float64

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

func (*EventSelect) Int

func (es *EventSelect) Int(ctx context.Context) (_ int, err error)

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

func (*EventSelect) IntX

func (es *EventSelect) IntX(ctx context.Context) int

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

func (*EventSelect) Ints

func (es *EventSelect) Ints(ctx context.Context) ([]int, error)

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

func (*EventSelect) IntsX

func (es *EventSelect) IntsX(ctx context.Context) []int

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

func (*EventSelect) Scan

func (es *EventSelect) Scan(ctx context.Context, v interface{}) error

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

func (*EventSelect) ScanX

func (es *EventSelect) ScanX(ctx context.Context, v interface{})

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

func (*EventSelect) String

func (es *EventSelect) String(ctx context.Context) (_ string, err error)

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

func (*EventSelect) StringX

func (es *EventSelect) StringX(ctx context.Context) string

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

func (*EventSelect) Strings

func (es *EventSelect) Strings(ctx context.Context) ([]string, error)

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

func (*EventSelect) StringsX

func (es *EventSelect) StringsX(ctx context.Context) []string

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

type EventUpdate

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

EventUpdate is the builder for updating Event entities.

func (*EventUpdate) ClearClientserver

func (eu *EventUpdate) ClearClientserver() *EventUpdate

ClearClientserver clears the "clientserver" edge to the ClientServer entity.

func (*EventUpdate) ClearUser

func (eu *EventUpdate) ClearUser() *EventUpdate

ClearUser clears the "user" edge to the User entity.

func (*EventUpdate) Exec

func (eu *EventUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*EventUpdate) ExecX

func (eu *EventUpdate) ExecX(ctx context.Context)

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

func (*EventUpdate) Mutation

func (eu *EventUpdate) Mutation() *EventMutation

Mutation returns the EventMutation object of the builder.

func (*EventUpdate) Save

func (eu *EventUpdate) Save(ctx context.Context) (int, error)

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

func (*EventUpdate) SaveX

func (eu *EventUpdate) SaveX(ctx context.Context) int

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

func (*EventUpdate) SetClientserver

func (eu *EventUpdate) SetClientserver(c *ClientServer) *EventUpdate

SetClientserver sets the "clientserver" edge to the ClientServer entity.

func (*EventUpdate) SetClientserverID

func (eu *EventUpdate) SetClientserverID(id int) *EventUpdate

SetClientserverID sets the "clientserver" edge to the ClientServer entity by ID.

func (*EventUpdate) SetCreatedAt

func (eu *EventUpdate) SetCreatedAt(t time.Time) *EventUpdate

SetCreatedAt sets the "created_at" field.

func (*EventUpdate) SetEvent

func (eu *EventUpdate) SetEvent(s string) *EventUpdate

SetEvent sets the "event" field.

func (*EventUpdate) SetMessage

func (eu *EventUpdate) SetMessage(s string) *EventUpdate

SetMessage sets the "message" field.

func (*EventUpdate) SetNillableClientserverID

func (eu *EventUpdate) SetNillableClientserverID(id *int) *EventUpdate

SetNillableClientserverID sets the "clientserver" edge to the ClientServer entity by ID if the given value is not nil.

func (*EventUpdate) SetNillableCreatedAt

func (eu *EventUpdate) SetNillableCreatedAt(t *time.Time) *EventUpdate

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

func (*EventUpdate) SetNillableMessage

func (eu *EventUpdate) SetNillableMessage(s *string) *EventUpdate

SetNillableMessage sets the "message" field if the given value is not nil.

func (*EventUpdate) SetNillableUserID

func (eu *EventUpdate) SetNillableUserID(id *int) *EventUpdate

SetNillableUserID sets the "user" edge to the User entity by ID if the given value is not nil.

func (*EventUpdate) SetUser

func (eu *EventUpdate) SetUser(u *User) *EventUpdate

SetUser sets the "user" edge to the User entity.

func (*EventUpdate) SetUserID

func (eu *EventUpdate) SetUserID(id int) *EventUpdate

SetUserID sets the "user" edge to the User entity by ID.

func (*EventUpdate) Where

func (eu *EventUpdate) Where(ps ...predicate.Event) *EventUpdate

Where adds a new predicate for the EventUpdate builder.

type EventUpdateOne

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

EventUpdateOne is the builder for updating a single Event entity.

func (*EventUpdateOne) ClearClientserver

func (euo *EventUpdateOne) ClearClientserver() *EventUpdateOne

ClearClientserver clears the "clientserver" edge to the ClientServer entity.

func (*EventUpdateOne) ClearUser

func (euo *EventUpdateOne) ClearUser() *EventUpdateOne

ClearUser clears the "user" edge to the User entity.

func (*EventUpdateOne) Exec

func (euo *EventUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*EventUpdateOne) ExecX

func (euo *EventUpdateOne) ExecX(ctx context.Context)

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

func (*EventUpdateOne) Mutation

func (euo *EventUpdateOne) Mutation() *EventMutation

Mutation returns the EventMutation object of the builder.

func (*EventUpdateOne) Save

func (euo *EventUpdateOne) Save(ctx context.Context) (*Event, error)

Save executes the query and returns the updated Event entity.

func (*EventUpdateOne) SaveX

func (euo *EventUpdateOne) SaveX(ctx context.Context) *Event

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

func (*EventUpdateOne) SetClientserver

func (euo *EventUpdateOne) SetClientserver(c *ClientServer) *EventUpdateOne

SetClientserver sets the "clientserver" edge to the ClientServer entity.

func (*EventUpdateOne) SetClientserverID

func (euo *EventUpdateOne) SetClientserverID(id int) *EventUpdateOne

SetClientserverID sets the "clientserver" edge to the ClientServer entity by ID.

func (*EventUpdateOne) SetCreatedAt

func (euo *EventUpdateOne) SetCreatedAt(t time.Time) *EventUpdateOne

SetCreatedAt sets the "created_at" field.

func (*EventUpdateOne) SetEvent

func (euo *EventUpdateOne) SetEvent(s string) *EventUpdateOne

SetEvent sets the "event" field.

func (*EventUpdateOne) SetMessage

func (euo *EventUpdateOne) SetMessage(s string) *EventUpdateOne

SetMessage sets the "message" field.

func (*EventUpdateOne) SetNillableClientserverID

func (euo *EventUpdateOne) SetNillableClientserverID(id *int) *EventUpdateOne

SetNillableClientserverID sets the "clientserver" edge to the ClientServer entity by ID if the given value is not nil.

func (*EventUpdateOne) SetNillableCreatedAt

func (euo *EventUpdateOne) SetNillableCreatedAt(t *time.Time) *EventUpdateOne

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

func (*EventUpdateOne) SetNillableMessage

func (euo *EventUpdateOne) SetNillableMessage(s *string) *EventUpdateOne

SetNillableMessage sets the "message" field if the given value is not nil.

func (*EventUpdateOne) SetNillableUserID

func (euo *EventUpdateOne) SetNillableUserID(id *int) *EventUpdateOne

SetNillableUserID sets the "user" edge to the User entity by ID if the given value is not nil.

func (*EventUpdateOne) SetUser

func (euo *EventUpdateOne) SetUser(u *User) *EventUpdateOne

SetUser sets the "user" edge to the User entity.

func (*EventUpdateOne) SetUserID

func (euo *EventUpdateOne) SetUserID(id int) *EventUpdateOne

SetUserID sets the "user" edge to the User entity by ID.

type Events

type Events []*Event

Events is a parsable slice of Event.

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, func(string) bool)

OrderFunc applies an ordering on the sql selector.

func Asc

func Asc(fields ...string) OrderFunc

Asc applies the given fields in ASC order.

func Desc

func Desc(fields ...string) OrderFunc

Desc applies the given fields in DESC order.

type Policy

type Policy = ent.Policy

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

type Query

type Query = ent.Query

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

type RollbackFunc

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

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

func (RollbackFunc) Rollback

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

Rollback calls f(ctx, m).

type RollbackHook

type RollbackHook func(Rollbacker) Rollbacker

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

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

type Rollbacker

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

Rollbacker is the interface that wraps the Rollbacker method.

type Tx

type Tx struct {

	// ClientServer is the client for interacting with the ClientServer builders.
	ClientServer *ClientServerClient
	// Event is the client for interacting with the Event builders.
	Event *EventClient
	// User is the client for interacting with the User builders.
	User *UserClient
	// 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 User

type User struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// UserID holds the value of the "user_id" field.
	UserID string `json:"user_id,omitempty"`
	// UserPw holds the value of the "user_pw" field.
	UserPw string `json:"user_pw,omitempty"`
	// UserName holds the value of the "user_name" field.
	UserName string `json:"user_name,omitempty"`
	// UserNumber holds the value of the "user_number" field.
	UserNumber int `json:"user_number,omitempty"`
	// Email holds the value of the "email" field.
	Email string `json:"email,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// DeletedAt holds the value of the "deleted_at" field.
	DeletedAt time.Time `json:"deleted_at,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the UserQuery when eager-loading is set.
	Edges UserEdges `json:"edges"`
	// contains filtered or unexported fields
}

User is the model entity for the User schema.

func (*User) QueryEvents

func (u *User) QueryEvents() *EventQuery

QueryEvents queries the "events" edge of the User entity.

func (*User) QueryOwns

func (u *User) QueryOwns() *ClientServerQuery

QueryOwns queries the "owns" edge of the User entity.

func (*User) String

func (u *User) String() string

String implements the fmt.Stringer.

func (*User) Unwrap

func (u *User) Unwrap() *User

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

func (u *User) Update() *UserUpdateOne

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

type UserClient

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

UserClient is a client for the User schema.

func NewUserClient

func NewUserClient(c config) *UserClient

NewUserClient returns a client for the User from the given config.

func (*UserClient) Create

func (c *UserClient) Create() *UserCreate

Create returns a create builder for User.

func (*UserClient) CreateBulk

func (c *UserClient) CreateBulk(builders ...*UserCreate) *UserCreateBulk

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

func (*UserClient) Delete

func (c *UserClient) Delete() *UserDelete

Delete returns a delete builder for User.

func (*UserClient) DeleteOne

func (c *UserClient) DeleteOne(u *User) *UserDeleteOne

DeleteOne returns a delete builder for the given entity.

func (*UserClient) DeleteOneID

func (c *UserClient) DeleteOneID(id int) *UserDeleteOne

DeleteOneID returns a delete builder for the given id.

func (*UserClient) Get

func (c *UserClient) Get(ctx context.Context, id int) (*User, error)

Get returns a User entity by its id.

func (*UserClient) GetX

func (c *UserClient) GetX(ctx context.Context, id int) *User

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

func (*UserClient) Hooks

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

Hooks returns the client hooks.

func (*UserClient) Query

func (c *UserClient) Query() *UserQuery

Query returns a query builder for User.

func (*UserClient) QueryEvents

func (c *UserClient) QueryEvents(u *User) *EventQuery

QueryEvents queries the events edge of a User.

func (*UserClient) QueryOwns

func (c *UserClient) QueryOwns(u *User) *ClientServerQuery

QueryOwns queries the owns edge of a User.

func (*UserClient) Update

func (c *UserClient) Update() *UserUpdate

Update returns an update builder for User.

func (*UserClient) UpdateOne

func (c *UserClient) UpdateOne(u *User) *UserUpdateOne

UpdateOne returns an update builder for the given entity.

func (*UserClient) UpdateOneID

func (c *UserClient) UpdateOneID(id int) *UserUpdateOne

UpdateOneID returns an update builder for the given id.

func (*UserClient) Use

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

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

type UserCreate

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

UserCreate is the builder for creating a User entity.

func (*UserCreate) AddEventIDs

func (uc *UserCreate) AddEventIDs(ids ...int) *UserCreate

AddEventIDs adds the "events" edge to the Event entity by IDs.

func (*UserCreate) AddEvents

func (uc *UserCreate) AddEvents(e ...*Event) *UserCreate

AddEvents adds the "events" edges to the Event entity.

func (*UserCreate) AddOwnIDs

func (uc *UserCreate) AddOwnIDs(ids ...int) *UserCreate

AddOwnIDs adds the "owns" edge to the ClientServer entity by IDs.

func (*UserCreate) AddOwns

func (uc *UserCreate) AddOwns(c ...*ClientServer) *UserCreate

AddOwns adds the "owns" edges to the ClientServer entity.

func (*UserCreate) Mutation

func (uc *UserCreate) Mutation() *UserMutation

Mutation returns the UserMutation object of the builder.

func (*UserCreate) Save

func (uc *UserCreate) Save(ctx context.Context) (*User, error)

Save creates the User in the database.

func (*UserCreate) SaveX

func (uc *UserCreate) SaveX(ctx context.Context) *User

SaveX calls Save and panics if Save returns an error.

func (*UserCreate) SetCreatedAt

func (uc *UserCreate) SetCreatedAt(t time.Time) *UserCreate

SetCreatedAt sets the "created_at" field.

func (*UserCreate) SetDeletedAt

func (uc *UserCreate) SetDeletedAt(t time.Time) *UserCreate

SetDeletedAt sets the "deleted_at" field.

func (*UserCreate) SetEmail

func (uc *UserCreate) SetEmail(s string) *UserCreate

SetEmail sets the "email" field.

func (*UserCreate) SetNillableCreatedAt

func (uc *UserCreate) SetNillableCreatedAt(t *time.Time) *UserCreate

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

func (*UserCreate) SetNillableDeletedAt

func (uc *UserCreate) SetNillableDeletedAt(t *time.Time) *UserCreate

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

func (*UserCreate) SetUserID

func (uc *UserCreate) SetUserID(s string) *UserCreate

SetUserID sets the "user_id" field.

func (*UserCreate) SetUserName

func (uc *UserCreate) SetUserName(s string) *UserCreate

SetUserName sets the "user_name" field.

func (*UserCreate) SetUserNumber

func (uc *UserCreate) SetUserNumber(i int) *UserCreate

SetUserNumber sets the "user_number" field.

func (*UserCreate) SetUserPw

func (uc *UserCreate) SetUserPw(s string) *UserCreate

SetUserPw sets the "user_pw" field.

type UserCreateBulk

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

UserCreateBulk is the builder for creating many User entities in bulk.

func (*UserCreateBulk) Save

func (ucb *UserCreateBulk) Save(ctx context.Context) ([]*User, error)

Save creates the User entities in the database.

func (*UserCreateBulk) SaveX

func (ucb *UserCreateBulk) SaveX(ctx context.Context) []*User

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

type UserDelete

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

UserDelete is the builder for deleting a User entity.

func (*UserDelete) Exec

func (ud *UserDelete) Exec(ctx context.Context) (int, error)

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

func (*UserDelete) ExecX

func (ud *UserDelete) ExecX(ctx context.Context) int

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

func (*UserDelete) Where

func (ud *UserDelete) Where(ps ...predicate.User) *UserDelete

Where adds a new predicate to the UserDelete builder.

type UserDeleteOne

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

UserDeleteOne is the builder for deleting a single User entity.

func (*UserDeleteOne) Exec

func (udo *UserDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*UserDeleteOne) ExecX

func (udo *UserDeleteOne) ExecX(ctx context.Context)

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

type UserEdges

type UserEdges struct {
	// Events holds the value of the events edge.
	Events []*Event `json:"events,omitempty"`
	// Owns holds the value of the owns edge.
	Owns []*ClientServer `json:"owns,omitempty"`
	// contains filtered or unexported fields
}

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

func (UserEdges) EventsOrErr

func (e UserEdges) EventsOrErr() ([]*Event, error)

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

func (UserEdges) OwnsOrErr

func (e UserEdges) OwnsOrErr() ([]*ClientServer, error)

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

type UserGroupBy

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

UserGroupBy is the group-by builder for User entities.

func (*UserGroupBy) Aggregate

func (ugb *UserGroupBy) Aggregate(fns ...AggregateFunc) *UserGroupBy

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

func (*UserGroupBy) Bool

func (ugb *UserGroupBy) Bool(ctx context.Context) (_ bool, err error)

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

func (*UserGroupBy) BoolX

func (ugb *UserGroupBy) BoolX(ctx context.Context) bool

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

func (*UserGroupBy) Bools

func (ugb *UserGroupBy) Bools(ctx context.Context) ([]bool, error)

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

func (*UserGroupBy) BoolsX

func (ugb *UserGroupBy) BoolsX(ctx context.Context) []bool

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

func (*UserGroupBy) Float64

func (ugb *UserGroupBy) Float64(ctx context.Context) (_ float64, err error)

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

func (*UserGroupBy) Float64X

func (ugb *UserGroupBy) Float64X(ctx context.Context) float64

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

func (*UserGroupBy) Float64s

func (ugb *UserGroupBy) Float64s(ctx context.Context) ([]float64, error)

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

func (*UserGroupBy) Float64sX

func (ugb *UserGroupBy) Float64sX(ctx context.Context) []float64

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

func (*UserGroupBy) Int

func (ugb *UserGroupBy) Int(ctx context.Context) (_ int, err error)

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

func (*UserGroupBy) IntX

func (ugb *UserGroupBy) IntX(ctx context.Context) int

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

func (*UserGroupBy) Ints

func (ugb *UserGroupBy) Ints(ctx context.Context) ([]int, error)

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

func (*UserGroupBy) IntsX

func (ugb *UserGroupBy) IntsX(ctx context.Context) []int

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

func (*UserGroupBy) Scan

func (ugb *UserGroupBy) Scan(ctx context.Context, v interface{}) error

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

func (*UserGroupBy) ScanX

func (ugb *UserGroupBy) ScanX(ctx context.Context, v interface{})

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

func (*UserGroupBy) String

func (ugb *UserGroupBy) String(ctx context.Context) (_ string, err error)

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

func (*UserGroupBy) StringX

func (ugb *UserGroupBy) StringX(ctx context.Context) string

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

func (*UserGroupBy) Strings

func (ugb *UserGroupBy) Strings(ctx context.Context) ([]string, error)

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

func (*UserGroupBy) StringsX

func (ugb *UserGroupBy) StringsX(ctx context.Context) []string

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

type UserMutation

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

UserMutation represents an operation that mutates the User nodes in the graph.

func (*UserMutation) AddEventIDs

func (m *UserMutation) AddEventIDs(ids ...int)

AddEventIDs adds the "events" edge to the Event entity by ids.

func (*UserMutation) AddField

func (m *UserMutation) 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 (*UserMutation) AddOwnIDs

func (m *UserMutation) AddOwnIDs(ids ...int)

AddOwnIDs adds the "owns" edge to the ClientServer entity by ids.

func (*UserMutation) AddUserNumber

func (m *UserMutation) AddUserNumber(i int)

AddUserNumber adds i to the "user_number" field.

func (*UserMutation) AddedEdges

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

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

func (*UserMutation) AddedField

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

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

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

func (*UserMutation) AddedIDs

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

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

func (*UserMutation) AddedUserNumber

func (m *UserMutation) AddedUserNumber() (r int, exists bool)

AddedUserNumber returns the value that was added to the "user_number" field in this mutation.

func (*UserMutation) ClearDeletedAt

func (m *UserMutation) ClearDeletedAt()

ClearDeletedAt clears the value of the "deleted_at" field.

func (*UserMutation) ClearEdge

func (m *UserMutation) 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 (*UserMutation) ClearEvents

func (m *UserMutation) ClearEvents()

ClearEvents clears the "events" edge to the Event entity.

func (*UserMutation) ClearField

func (m *UserMutation) 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 (*UserMutation) ClearOwns

func (m *UserMutation) ClearOwns()

ClearOwns clears the "owns" edge to the ClientServer entity.

func (*UserMutation) ClearedEdges

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

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

func (*UserMutation) ClearedFields

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

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

func (UserMutation) Client

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

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

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

func (*UserMutation) DeletedAt

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

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

func (*UserMutation) DeletedAtCleared

func (m *UserMutation) DeletedAtCleared() bool

DeletedAtCleared returns if the "deleted_at" field was cleared in this mutation.

func (*UserMutation) EdgeCleared

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

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

func (*UserMutation) Email

func (m *UserMutation) Email() (r string, exists bool)

Email returns the value of the "email" field in the mutation.

func (*UserMutation) EventsCleared

func (m *UserMutation) EventsCleared() bool

EventsCleared returns if the "events" edge to the Event entity was cleared.

func (*UserMutation) EventsIDs

func (m *UserMutation) EventsIDs() (ids []int)

EventsIDs returns the "events" edge IDs in the mutation.

func (*UserMutation) Field

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

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

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

func (*UserMutation) Fields

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

func (m *UserMutation) 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.

func (*UserMutation) OldCreatedAt

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

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

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

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

func (m *UserMutation) OldEmail(ctx context.Context) (v string, err error)

OldEmail returns the old "email" field's value of the User entity. If the User 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 (*UserMutation) OldField

func (m *UserMutation) 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 (*UserMutation) OldUserID

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

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

func (m *UserMutation) OldUserName(ctx context.Context) (v string, err error)

OldUserName returns the old "user_name" field's value of the User entity. If the User 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 (*UserMutation) OldUserNumber

func (m *UserMutation) OldUserNumber(ctx context.Context) (v int, err error)

OldUserNumber returns the old "user_number" field's value of the User entity. If the User 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 (*UserMutation) OldUserPw

func (m *UserMutation) OldUserPw(ctx context.Context) (v string, err error)

OldUserPw returns the old "user_pw" field's value of the User entity. If the User 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 (*UserMutation) Op

func (m *UserMutation) Op() Op

Op returns the operation name.

func (*UserMutation) OwnsCleared

func (m *UserMutation) OwnsCleared() bool

OwnsCleared returns if the "owns" edge to the ClientServer entity was cleared.

func (*UserMutation) OwnsIDs

func (m *UserMutation) OwnsIDs() (ids []int)

OwnsIDs returns the "owns" edge IDs in the mutation.

func (*UserMutation) RemoveEventIDs

func (m *UserMutation) RemoveEventIDs(ids ...int)

RemoveEventIDs removes the "events" edge to the Event entity by IDs.

func (*UserMutation) RemoveOwnIDs

func (m *UserMutation) RemoveOwnIDs(ids ...int)

RemoveOwnIDs removes the "owns" edge to the ClientServer entity by IDs.

func (*UserMutation) RemovedEdges

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

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

func (*UserMutation) RemovedEventsIDs

func (m *UserMutation) RemovedEventsIDs() (ids []int)

RemovedEvents returns the removed IDs of the "events" edge to the Event entity.

func (*UserMutation) RemovedIDs

func (m *UserMutation) 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 (*UserMutation) RemovedOwnsIDs

func (m *UserMutation) RemovedOwnsIDs() (ids []int)

RemovedOwns returns the removed IDs of the "owns" edge to the ClientServer entity.

func (*UserMutation) ResetCreatedAt

func (m *UserMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*UserMutation) ResetDeletedAt

func (m *UserMutation) ResetDeletedAt()

ResetDeletedAt resets all changes to the "deleted_at" field.

func (*UserMutation) ResetEdge

func (m *UserMutation) 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 (*UserMutation) ResetEmail

func (m *UserMutation) ResetEmail()

ResetEmail resets all changes to the "email" field.

func (*UserMutation) ResetEvents

func (m *UserMutation) ResetEvents()

ResetEvents resets all changes to the "events" edge.

func (*UserMutation) ResetField

func (m *UserMutation) 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 (*UserMutation) ResetOwns

func (m *UserMutation) ResetOwns()

ResetOwns resets all changes to the "owns" edge.

func (*UserMutation) ResetUserID

func (m *UserMutation) ResetUserID()

ResetUserID resets all changes to the "user_id" field.

func (*UserMutation) ResetUserName

func (m *UserMutation) ResetUserName()

ResetUserName resets all changes to the "user_name" field.

func (*UserMutation) ResetUserNumber

func (m *UserMutation) ResetUserNumber()

ResetUserNumber resets all changes to the "user_number" field.

func (*UserMutation) ResetUserPw

func (m *UserMutation) ResetUserPw()

ResetUserPw resets all changes to the "user_pw" field.

func (*UserMutation) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*UserMutation) SetDeletedAt

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

SetDeletedAt sets the "deleted_at" field.

func (*UserMutation) SetEmail

func (m *UserMutation) SetEmail(s string)

SetEmail sets the "email" field.

func (*UserMutation) SetField

func (m *UserMutation) 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 (*UserMutation) SetUserID

func (m *UserMutation) SetUserID(s string)

SetUserID sets the "user_id" field.

func (*UserMutation) SetUserName

func (m *UserMutation) SetUserName(s string)

SetUserName sets the "user_name" field.

func (*UserMutation) SetUserNumber

func (m *UserMutation) SetUserNumber(i int)

SetUserNumber sets the "user_number" field.

func (*UserMutation) SetUserPw

func (m *UserMutation) SetUserPw(s string)

SetUserPw sets the "user_pw" field.

func (UserMutation) Tx

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

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

func (*UserMutation) Type

func (m *UserMutation) Type() string

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

func (*UserMutation) UserID

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

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

func (*UserMutation) UserName

func (m *UserMutation) UserName() (r string, exists bool)

UserName returns the value of the "user_name" field in the mutation.

func (*UserMutation) UserNumber

func (m *UserMutation) UserNumber() (r int, exists bool)

UserNumber returns the value of the "user_number" field in the mutation.

func (*UserMutation) UserPw

func (m *UserMutation) UserPw() (r string, exists bool)

UserPw returns the value of the "user_pw" field in the mutation.

type UserQuery

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

UserQuery is the builder for querying User entities.

func (*UserQuery) All

func (uq *UserQuery) All(ctx context.Context) ([]*User, error)

All executes the query and returns a list of Users.

func (*UserQuery) AllX

func (uq *UserQuery) AllX(ctx context.Context) []*User

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

func (*UserQuery) Clone

func (uq *UserQuery) Clone() *UserQuery

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

func (*UserQuery) Count

func (uq *UserQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*UserQuery) CountX

func (uq *UserQuery) CountX(ctx context.Context) int

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

func (*UserQuery) Exist

func (uq *UserQuery) Exist(ctx context.Context) (bool, error)

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

func (*UserQuery) ExistX

func (uq *UserQuery) ExistX(ctx context.Context) bool

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

func (*UserQuery) First

func (uq *UserQuery) First(ctx context.Context) (*User, error)

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

func (*UserQuery) FirstID

func (uq *UserQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*UserQuery) FirstIDX

func (uq *UserQuery) FirstIDX(ctx context.Context) int

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

func (*UserQuery) FirstX

func (uq *UserQuery) FirstX(ctx context.Context) *User

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

func (*UserQuery) GroupBy

func (uq *UserQuery) GroupBy(field string, fields ...string) *UserGroupBy

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

Example:

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

client.User.Query().
	GroupBy(user.FieldUserID).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*UserQuery) IDs

func (uq *UserQuery) IDs(ctx context.Context) ([]int, error)

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

func (*UserQuery) IDsX

func (uq *UserQuery) IDsX(ctx context.Context) []int

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

func (*UserQuery) Limit

func (uq *UserQuery) Limit(limit int) *UserQuery

Limit adds a limit step to the query.

func (*UserQuery) Offset

func (uq *UserQuery) Offset(offset int) *UserQuery

Offset adds an offset step to the query.

func (*UserQuery) Only

func (uq *UserQuery) Only(ctx context.Context) (*User, error)

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

func (*UserQuery) OnlyID

func (uq *UserQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*UserQuery) OnlyIDX

func (uq *UserQuery) OnlyIDX(ctx context.Context) int

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

func (*UserQuery) OnlyX

func (uq *UserQuery) OnlyX(ctx context.Context) *User

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

func (*UserQuery) Order

func (uq *UserQuery) Order(o ...OrderFunc) *UserQuery

Order adds an order step to the query.

func (*UserQuery) QueryEvents

func (uq *UserQuery) QueryEvents() *EventQuery

QueryEvents chains the current query on the "events" edge.

func (*UserQuery) QueryOwns

func (uq *UserQuery) QueryOwns() *ClientServerQuery

QueryOwns chains the current query on the "owns" edge.

func (*UserQuery) Select

func (uq *UserQuery) Select(field string, fields ...string) *UserSelect

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

Example:

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

client.User.Query().
	Select(user.FieldUserID).
	Scan(ctx, &v)

func (*UserQuery) Where

func (uq *UserQuery) Where(ps ...predicate.User) *UserQuery

Where adds a new predicate for the UserQuery builder.

func (*UserQuery) WithEvents

func (uq *UserQuery) WithEvents(opts ...func(*EventQuery)) *UserQuery

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

func (*UserQuery) WithOwns

func (uq *UserQuery) WithOwns(opts ...func(*ClientServerQuery)) *UserQuery

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

type UserSelect

type UserSelect struct {
	*UserQuery
	// contains filtered or unexported fields
}

UserSelect is the builder for selecting fields of User entities.

func (*UserSelect) Bool

func (us *UserSelect) Bool(ctx context.Context) (_ bool, err error)

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

func (*UserSelect) BoolX

func (us *UserSelect) BoolX(ctx context.Context) bool

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

func (*UserSelect) Bools

func (us *UserSelect) Bools(ctx context.Context) ([]bool, error)

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

func (*UserSelect) BoolsX

func (us *UserSelect) BoolsX(ctx context.Context) []bool

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

func (*UserSelect) Float64

func (us *UserSelect) Float64(ctx context.Context) (_ float64, err error)

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

func (*UserSelect) Float64X

func (us *UserSelect) Float64X(ctx context.Context) float64

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

func (*UserSelect) Float64s

func (us *UserSelect) Float64s(ctx context.Context) ([]float64, error)

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

func (*UserSelect) Float64sX

func (us *UserSelect) Float64sX(ctx context.Context) []float64

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

func (*UserSelect) Int

func (us *UserSelect) Int(ctx context.Context) (_ int, err error)

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

func (*UserSelect) IntX

func (us *UserSelect) IntX(ctx context.Context) int

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

func (*UserSelect) Ints

func (us *UserSelect) Ints(ctx context.Context) ([]int, error)

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

func (*UserSelect) IntsX

func (us *UserSelect) IntsX(ctx context.Context) []int

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

func (*UserSelect) Scan

func (us *UserSelect) Scan(ctx context.Context, v interface{}) error

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

func (*UserSelect) ScanX

func (us *UserSelect) ScanX(ctx context.Context, v interface{})

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

func (*UserSelect) String

func (us *UserSelect) String(ctx context.Context) (_ string, err error)

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

func (*UserSelect) StringX

func (us *UserSelect) StringX(ctx context.Context) string

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

func (*UserSelect) Strings

func (us *UserSelect) Strings(ctx context.Context) ([]string, error)

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

func (*UserSelect) StringsX

func (us *UserSelect) StringsX(ctx context.Context) []string

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

type UserUpdate

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

UserUpdate is the builder for updating User entities.

func (*UserUpdate) AddEventIDs

func (uu *UserUpdate) AddEventIDs(ids ...int) *UserUpdate

AddEventIDs adds the "events" edge to the Event entity by IDs.

func (*UserUpdate) AddEvents

func (uu *UserUpdate) AddEvents(e ...*Event) *UserUpdate

AddEvents adds the "events" edges to the Event entity.

func (*UserUpdate) AddOwnIDs

func (uu *UserUpdate) AddOwnIDs(ids ...int) *UserUpdate

AddOwnIDs adds the "owns" edge to the ClientServer entity by IDs.

func (*UserUpdate) AddOwns

func (uu *UserUpdate) AddOwns(c ...*ClientServer) *UserUpdate

AddOwns adds the "owns" edges to the ClientServer entity.

func (*UserUpdate) AddUserNumber

func (uu *UserUpdate) AddUserNumber(i int) *UserUpdate

AddUserNumber adds i to the "user_number" field.

func (*UserUpdate) ClearDeletedAt

func (uu *UserUpdate) ClearDeletedAt() *UserUpdate

ClearDeletedAt clears the value of the "deleted_at" field.

func (*UserUpdate) ClearEvents

func (uu *UserUpdate) ClearEvents() *UserUpdate

ClearEvents clears all "events" edges to the Event entity.

func (*UserUpdate) ClearOwns

func (uu *UserUpdate) ClearOwns() *UserUpdate

ClearOwns clears all "owns" edges to the ClientServer entity.

func (*UserUpdate) Exec

func (uu *UserUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*UserUpdate) ExecX

func (uu *UserUpdate) ExecX(ctx context.Context)

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

func (*UserUpdate) Mutation

func (uu *UserUpdate) Mutation() *UserMutation

Mutation returns the UserMutation object of the builder.

func (*UserUpdate) RemoveEventIDs

func (uu *UserUpdate) RemoveEventIDs(ids ...int) *UserUpdate

RemoveEventIDs removes the "events" edge to Event entities by IDs.

func (*UserUpdate) RemoveEvents

func (uu *UserUpdate) RemoveEvents(e ...*Event) *UserUpdate

RemoveEvents removes "events" edges to Event entities.

func (*UserUpdate) RemoveOwnIDs

func (uu *UserUpdate) RemoveOwnIDs(ids ...int) *UserUpdate

RemoveOwnIDs removes the "owns" edge to ClientServer entities by IDs.

func (*UserUpdate) RemoveOwns

func (uu *UserUpdate) RemoveOwns(c ...*ClientServer) *UserUpdate

RemoveOwns removes "owns" edges to ClientServer entities.

func (*UserUpdate) Save

func (uu *UserUpdate) Save(ctx context.Context) (int, error)

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

func (*UserUpdate) SaveX

func (uu *UserUpdate) SaveX(ctx context.Context) int

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

func (*UserUpdate) SetCreatedAt

func (uu *UserUpdate) SetCreatedAt(t time.Time) *UserUpdate

SetCreatedAt sets the "created_at" field.

func (*UserUpdate) SetDeletedAt

func (uu *UserUpdate) SetDeletedAt(t time.Time) *UserUpdate

SetDeletedAt sets the "deleted_at" field.

func (*UserUpdate) SetEmail

func (uu *UserUpdate) SetEmail(s string) *UserUpdate

SetEmail sets the "email" field.

func (*UserUpdate) SetNillableCreatedAt

func (uu *UserUpdate) SetNillableCreatedAt(t *time.Time) *UserUpdate

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

func (*UserUpdate) SetNillableDeletedAt

func (uu *UserUpdate) SetNillableDeletedAt(t *time.Time) *UserUpdate

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

func (*UserUpdate) SetUserID

func (uu *UserUpdate) SetUserID(s string) *UserUpdate

SetUserID sets the "user_id" field.

func (*UserUpdate) SetUserName

func (uu *UserUpdate) SetUserName(s string) *UserUpdate

SetUserName sets the "user_name" field.

func (*UserUpdate) SetUserNumber

func (uu *UserUpdate) SetUserNumber(i int) *UserUpdate

SetUserNumber sets the "user_number" field.

func (*UserUpdate) SetUserPw

func (uu *UserUpdate) SetUserPw(s string) *UserUpdate

SetUserPw sets the "user_pw" field.

func (*UserUpdate) Where

func (uu *UserUpdate) Where(ps ...predicate.User) *UserUpdate

Where adds a new predicate for the UserUpdate builder.

type UserUpdateOne

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

UserUpdateOne is the builder for updating a single User entity.

func (*UserUpdateOne) AddEventIDs

func (uuo *UserUpdateOne) AddEventIDs(ids ...int) *UserUpdateOne

AddEventIDs adds the "events" edge to the Event entity by IDs.

func (*UserUpdateOne) AddEvents

func (uuo *UserUpdateOne) AddEvents(e ...*Event) *UserUpdateOne

AddEvents adds the "events" edges to the Event entity.

func (*UserUpdateOne) AddOwnIDs

func (uuo *UserUpdateOne) AddOwnIDs(ids ...int) *UserUpdateOne

AddOwnIDs adds the "owns" edge to the ClientServer entity by IDs.

func (*UserUpdateOne) AddOwns

func (uuo *UserUpdateOne) AddOwns(c ...*ClientServer) *UserUpdateOne

AddOwns adds the "owns" edges to the ClientServer entity.

func (*UserUpdateOne) AddUserNumber

func (uuo *UserUpdateOne) AddUserNumber(i int) *UserUpdateOne

AddUserNumber adds i to the "user_number" field.

func (*UserUpdateOne) ClearDeletedAt

func (uuo *UserUpdateOne) ClearDeletedAt() *UserUpdateOne

ClearDeletedAt clears the value of the "deleted_at" field.

func (*UserUpdateOne) ClearEvents

func (uuo *UserUpdateOne) ClearEvents() *UserUpdateOne

ClearEvents clears all "events" edges to the Event entity.

func (*UserUpdateOne) ClearOwns

func (uuo *UserUpdateOne) ClearOwns() *UserUpdateOne

ClearOwns clears all "owns" edges to the ClientServer entity.

func (*UserUpdateOne) Exec

func (uuo *UserUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*UserUpdateOne) ExecX

func (uuo *UserUpdateOne) ExecX(ctx context.Context)

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

func (*UserUpdateOne) Mutation

func (uuo *UserUpdateOne) Mutation() *UserMutation

Mutation returns the UserMutation object of the builder.

func (*UserUpdateOne) RemoveEventIDs

func (uuo *UserUpdateOne) RemoveEventIDs(ids ...int) *UserUpdateOne

RemoveEventIDs removes the "events" edge to Event entities by IDs.

func (*UserUpdateOne) RemoveEvents

func (uuo *UserUpdateOne) RemoveEvents(e ...*Event) *UserUpdateOne

RemoveEvents removes "events" edges to Event entities.

func (*UserUpdateOne) RemoveOwnIDs

func (uuo *UserUpdateOne) RemoveOwnIDs(ids ...int) *UserUpdateOne

RemoveOwnIDs removes the "owns" edge to ClientServer entities by IDs.

func (*UserUpdateOne) RemoveOwns

func (uuo *UserUpdateOne) RemoveOwns(c ...*ClientServer) *UserUpdateOne

RemoveOwns removes "owns" edges to ClientServer entities.

func (*UserUpdateOne) Save

func (uuo *UserUpdateOne) Save(ctx context.Context) (*User, error)

Save executes the query and returns the updated User entity.

func (*UserUpdateOne) SaveX

func (uuo *UserUpdateOne) SaveX(ctx context.Context) *User

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

func (*UserUpdateOne) SetCreatedAt

func (uuo *UserUpdateOne) SetCreatedAt(t time.Time) *UserUpdateOne

SetCreatedAt sets the "created_at" field.

func (*UserUpdateOne) SetDeletedAt

func (uuo *UserUpdateOne) SetDeletedAt(t time.Time) *UserUpdateOne

SetDeletedAt sets the "deleted_at" field.

func (*UserUpdateOne) SetEmail

func (uuo *UserUpdateOne) SetEmail(s string) *UserUpdateOne

SetEmail sets the "email" field.

func (*UserUpdateOne) SetNillableCreatedAt

func (uuo *UserUpdateOne) SetNillableCreatedAt(t *time.Time) *UserUpdateOne

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

func (*UserUpdateOne) SetNillableDeletedAt

func (uuo *UserUpdateOne) SetNillableDeletedAt(t *time.Time) *UserUpdateOne

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

func (*UserUpdateOne) SetUserID

func (uuo *UserUpdateOne) SetUserID(s string) *UserUpdateOne

SetUserID sets the "user_id" field.

func (*UserUpdateOne) SetUserName

func (uuo *UserUpdateOne) SetUserName(s string) *UserUpdateOne

SetUserName sets the "user_name" field.

func (*UserUpdateOne) SetUserNumber

func (uuo *UserUpdateOne) SetUserNumber(i int) *UserUpdateOne

SetUserNumber sets the "user_number" field.

func (*UserUpdateOne) SetUserPw

func (uuo *UserUpdateOne) SetUserPw(s string) *UserUpdateOne

SetUserPw sets the "user_pw" field.

type Users

type Users []*User

Users is a parsable slice of User.

type ValidationError

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

ValidationError returns when validating a field fails.

func (*ValidationError) Error

func (e *ValidationError) Error() string

Error implements the error interface.

func (*ValidationError) Unwrap

func (e *ValidationError) Unwrap() error

Unwrap implements the errors.Wrapper interface.

type Value

type Value = ent.Value

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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