model

package module
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2021 License: Apache-2.0 Imports: 24 Imported by: 0

README ¶

model

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.
	TypeModelVersion    = "ModelVersion"
	TypeSystemSetting   = "SystemSetting"
	TypeUser            = "User"
	TypeUserEmail       = "UserEmail"
	TypeUserSecurityLog = "UserSecurityLog"
	TypeUserSetting     = "UserSetting"
)
View Source
const Version string = "7eb7844"

Variables ¶

This section is empty.

Functions ¶

func IsConstraintError ¶

func IsConstraintError(err error) bool

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

func IsNotFound ¶

func IsNotFound(err error) bool

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

func IsNotLoaded ¶

func IsNotLoaded(err error) bool

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

func IsNotSingular ¶

func IsNotSingular(err error) bool

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

func IsValidationError ¶

func IsValidationError(err error) bool

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

func MaskNotFound ¶

func MaskNotFound(err error) error

MaskNotFound masks not found error.

func NewContext ¶

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

NewContext returns a new context with the given Client attached.

func NewTxContext ¶

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

NewTxContext returns a new context with the given Tx attached.

Types ¶

type AggregateFunc ¶

type AggregateFunc func(*sql.Selector) string

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

func As ¶

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

GroupBy(field1, field2).
Aggregate(model.As(model.Sum(field1), "sum_field1"), (model.As(model.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
	// ModelVersion is the client for interacting with the ModelVersion builders.
	ModelVersion *ModelVersionClient
	// SystemSetting is the client for interacting with the SystemSetting builders.
	SystemSetting *SystemSettingClient
	// User is the client for interacting with the User builders.
	User *UserClient
	// UserEmail is the client for interacting with the UserEmail builders.
	UserEmail *UserEmailClient
	// UserSecurityLog is the client for interacting with the UserSecurityLog builders.
	UserSecurityLog *UserSecurityLogClient
	// UserSetting is the client for interacting with the UserSetting builders.
	UserSetting *UserSettingClient
	// 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().
	ModelVersion.
	Query().
	Count(ctx)

func (*Client) Tx ¶

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

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

func (*Client) Use ¶

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

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

type CommitFunc ¶

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

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

func (CommitFunc) Commit ¶

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

Commit calls f(ctx, m).

type CommitHook ¶

type CommitHook func(Committer) Committer

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

hook := func(next ent.Committer) ent.Committer {
	return ent.CommitFunc(func(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 Hook ¶

type Hook = ent.Hook

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

type ModelVersion ¶

type ModelVersion struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// Version holds the value of the "version" field.
	Version string `json:"version,omitempty"`
	// UpdateTime holds the value of the "update_time" field.
	UpdateTime time.Time `json:"-"`
	// contains filtered or unexported fields
}

ModelVersion is the model entity for the ModelVersion schema.

func (*ModelVersion) String ¶

func (mv *ModelVersion) String() string

String implements the fmt.Stringer.

func (*ModelVersion) Unwrap ¶

func (mv *ModelVersion) Unwrap() *ModelVersion

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

func (mv *ModelVersion) Update() *ModelVersionUpdateOne

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

type ModelVersionClient ¶

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

ModelVersionClient is a client for the ModelVersion schema.

func NewModelVersionClient ¶

func NewModelVersionClient(c config) *ModelVersionClient

NewModelVersionClient returns a client for the ModelVersion from the given config.

func (*ModelVersionClient) Create ¶

Create returns a create builder for ModelVersion.

func (*ModelVersionClient) CreateBulk ¶

func (c *ModelVersionClient) CreateBulk(builders ...*ModelVersionCreate) *ModelVersionCreateBulk

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

func (*ModelVersionClient) Delete ¶

Delete returns a delete builder for ModelVersion.

func (*ModelVersionClient) DeleteOne ¶

DeleteOne returns a delete builder for the given entity.

func (*ModelVersionClient) DeleteOneID ¶

func (c *ModelVersionClient) DeleteOneID(id int) *ModelVersionDeleteOne

DeleteOneID returns a delete builder for the given id.

func (*ModelVersionClient) Get ¶

Get returns a ModelVersion entity by its id.

func (*ModelVersionClient) GetX ¶

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

func (*ModelVersionClient) Hooks ¶

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

Hooks returns the client hooks.

func (*ModelVersionClient) Query ¶

Query returns a query builder for ModelVersion.

func (*ModelVersionClient) Update ¶

Update returns an update builder for ModelVersion.

func (*ModelVersionClient) UpdateOne ¶

UpdateOne returns an update builder for the given entity.

func (*ModelVersionClient) UpdateOneID ¶

func (c *ModelVersionClient) UpdateOneID(id int) *ModelVersionUpdateOne

UpdateOneID returns an update builder for the given id.

func (*ModelVersionClient) Use ¶

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

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

type ModelVersionCreate ¶

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

ModelVersionCreate is the builder for creating a ModelVersion entity.

func (*ModelVersionCreate) Exec ¶ added in v1.0.2

func (mvc *ModelVersionCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*ModelVersionCreate) ExecX ¶ added in v1.0.2

func (mvc *ModelVersionCreate) ExecX(ctx context.Context)

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

func (*ModelVersionCreate) Mutation ¶

func (mvc *ModelVersionCreate) Mutation() *ModelVersionMutation

Mutation returns the ModelVersionMutation object of the builder.

func (*ModelVersionCreate) Save ¶

Save creates the ModelVersion in the database.

func (*ModelVersionCreate) SaveX ¶

SaveX calls Save and panics if Save returns an error.

func (*ModelVersionCreate) SetID ¶

func (mvc *ModelVersionCreate) SetID(i int) *ModelVersionCreate

SetID sets the "id" field.

func (*ModelVersionCreate) SetNillableUpdateTime ¶

func (mvc *ModelVersionCreate) SetNillableUpdateTime(t *time.Time) *ModelVersionCreate

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

func (*ModelVersionCreate) SetUpdateTime ¶

func (mvc *ModelVersionCreate) SetUpdateTime(t time.Time) *ModelVersionCreate

SetUpdateTime sets the "update_time" field.

func (*ModelVersionCreate) SetVersion ¶

func (mvc *ModelVersionCreate) SetVersion(s string) *ModelVersionCreate

SetVersion sets the "version" field.

type ModelVersionCreateBulk ¶

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

ModelVersionCreateBulk is the builder for creating many ModelVersion entities in bulk.

func (*ModelVersionCreateBulk) Exec ¶ added in v1.0.2

func (mvcb *ModelVersionCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*ModelVersionCreateBulk) ExecX ¶ added in v1.0.2

func (mvcb *ModelVersionCreateBulk) ExecX(ctx context.Context)

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

func (*ModelVersionCreateBulk) Save ¶

Save creates the ModelVersion entities in the database.

func (*ModelVersionCreateBulk) SaveX ¶

func (mvcb *ModelVersionCreateBulk) SaveX(ctx context.Context) []*ModelVersion

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

type ModelVersionDelete ¶

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

ModelVersionDelete is the builder for deleting a ModelVersion entity.

func (*ModelVersionDelete) Exec ¶

func (mvd *ModelVersionDelete) Exec(ctx context.Context) (int, error)

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

func (*ModelVersionDelete) ExecX ¶

func (mvd *ModelVersionDelete) ExecX(ctx context.Context) int

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

func (*ModelVersionDelete) Where ¶

Where appends a list predicates to the ModelVersionDelete builder.

type ModelVersionDeleteOne ¶

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

ModelVersionDeleteOne is the builder for deleting a single ModelVersion entity.

func (*ModelVersionDeleteOne) Exec ¶

func (mvdo *ModelVersionDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*ModelVersionDeleteOne) ExecX ¶

func (mvdo *ModelVersionDeleteOne) ExecX(ctx context.Context)

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

type ModelVersionGroupBy ¶

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

ModelVersionGroupBy is the group-by builder for ModelVersion entities.

func (*ModelVersionGroupBy) Aggregate ¶

func (mvgb *ModelVersionGroupBy) Aggregate(fns ...AggregateFunc) *ModelVersionGroupBy

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

func (*ModelVersionGroupBy) Bool ¶

func (mvgb *ModelVersionGroupBy) 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 (*ModelVersionGroupBy) BoolX ¶

func (mvgb *ModelVersionGroupBy) BoolX(ctx context.Context) bool

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

func (*ModelVersionGroupBy) Bools ¶

func (mvgb *ModelVersionGroupBy) 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 (*ModelVersionGroupBy) BoolsX ¶

func (mvgb *ModelVersionGroupBy) BoolsX(ctx context.Context) []bool

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

func (*ModelVersionGroupBy) Float64 ¶

func (mvgb *ModelVersionGroupBy) 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 (*ModelVersionGroupBy) Float64X ¶

func (mvgb *ModelVersionGroupBy) Float64X(ctx context.Context) float64

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

func (*ModelVersionGroupBy) Float64s ¶

func (mvgb *ModelVersionGroupBy) 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 (*ModelVersionGroupBy) Float64sX ¶

func (mvgb *ModelVersionGroupBy) Float64sX(ctx context.Context) []float64

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

func (*ModelVersionGroupBy) Int ¶

func (mvgb *ModelVersionGroupBy) 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 (*ModelVersionGroupBy) IntX ¶

func (mvgb *ModelVersionGroupBy) IntX(ctx context.Context) int

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

func (*ModelVersionGroupBy) Ints ¶

func (mvgb *ModelVersionGroupBy) 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 (*ModelVersionGroupBy) IntsX ¶

func (mvgb *ModelVersionGroupBy) IntsX(ctx context.Context) []int

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

func (*ModelVersionGroupBy) Scan ¶

func (mvgb *ModelVersionGroupBy) Scan(ctx context.Context, v interface{}) error

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

func (*ModelVersionGroupBy) ScanX ¶

func (mvgb *ModelVersionGroupBy) ScanX(ctx context.Context, v interface{})

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

func (*ModelVersionGroupBy) String ¶

func (mvgb *ModelVersionGroupBy) 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 (*ModelVersionGroupBy) StringX ¶

func (mvgb *ModelVersionGroupBy) StringX(ctx context.Context) string

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

func (*ModelVersionGroupBy) Strings ¶

func (mvgb *ModelVersionGroupBy) 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 (*ModelVersionGroupBy) StringsX ¶

func (mvgb *ModelVersionGroupBy) StringsX(ctx context.Context) []string

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

type ModelVersionMutation ¶

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

ModelVersionMutation represents an operation that mutates the ModelVersion nodes in the graph.

func (*ModelVersionMutation) AddField ¶

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

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

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

func (*ModelVersionMutation) AddedField ¶

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

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

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

func (*ModelVersionMutation) AddedIDs ¶

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

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

func (*ModelVersionMutation) ClearEdge ¶

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

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

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

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

func (*ModelVersionMutation) ClearedFields ¶

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

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

func (ModelVersionMutation) Client ¶

func (m ModelVersionMutation) 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 (*ModelVersionMutation) EdgeCleared ¶

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

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

func (*ModelVersionMutation) Field ¶

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

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

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

func (*ModelVersionMutation) Fields ¶

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

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

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

func (*ModelVersionMutation) OldField ¶

func (m *ModelVersionMutation) 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 (*ModelVersionMutation) OldUpdateTime ¶

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

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

func (m *ModelVersionMutation) OldVersion(ctx context.Context) (v string, err error)

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

func (m *ModelVersionMutation) Op() Op

Op returns the operation name.

func (*ModelVersionMutation) RemovedEdges ¶

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

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

func (*ModelVersionMutation) RemovedIDs ¶

func (m *ModelVersionMutation) 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 (*ModelVersionMutation) ResetEdge ¶

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

func (m *ModelVersionMutation) 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 (*ModelVersionMutation) ResetUpdateTime ¶

func (m *ModelVersionMutation) ResetUpdateTime()

ResetUpdateTime resets all changes to the "update_time" field.

func (*ModelVersionMutation) ResetVersion ¶

func (m *ModelVersionMutation) ResetVersion()

ResetVersion resets all changes to the "version" field.

func (*ModelVersionMutation) SetField ¶

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

func (m *ModelVersionMutation) SetID(id int)

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

func (*ModelVersionMutation) SetUpdateTime ¶

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

SetUpdateTime sets the "update_time" field.

func (*ModelVersionMutation) SetVersion ¶

func (m *ModelVersionMutation) SetVersion(s string)

SetVersion sets the "version" field.

func (ModelVersionMutation) Tx ¶

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

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

func (*ModelVersionMutation) Type ¶

func (m *ModelVersionMutation) Type() string

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

func (*ModelVersionMutation) UpdateTime ¶

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

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

func (*ModelVersionMutation) Version ¶

func (m *ModelVersionMutation) Version() (r string, exists bool)

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

func (*ModelVersionMutation) Where ¶ added in v1.0.2

Where appends a list predicates to the ModelVersionMutation builder.

type ModelVersionQuery ¶

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

ModelVersionQuery is the builder for querying ModelVersion entities.

func (*ModelVersionQuery) All ¶

func (mvq *ModelVersionQuery) All(ctx context.Context) ([]*ModelVersion, error)

All executes the query and returns a list of ModelVersions.

func (*ModelVersionQuery) AllX ¶

func (mvq *ModelVersionQuery) AllX(ctx context.Context) []*ModelVersion

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

func (*ModelVersionQuery) Clone ¶

func (mvq *ModelVersionQuery) Clone() *ModelVersionQuery

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

func (*ModelVersionQuery) Count ¶

func (mvq *ModelVersionQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*ModelVersionQuery) CountX ¶

func (mvq *ModelVersionQuery) CountX(ctx context.Context) int

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

func (*ModelVersionQuery) Exist ¶

func (mvq *ModelVersionQuery) Exist(ctx context.Context) (bool, error)

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

func (*ModelVersionQuery) ExistX ¶

func (mvq *ModelVersionQuery) ExistX(ctx context.Context) bool

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

func (*ModelVersionQuery) First ¶

func (mvq *ModelVersionQuery) First(ctx context.Context) (*ModelVersion, error)

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

func (*ModelVersionQuery) FirstID ¶

func (mvq *ModelVersionQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*ModelVersionQuery) FirstIDX ¶

func (mvq *ModelVersionQuery) FirstIDX(ctx context.Context) int

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

func (*ModelVersionQuery) FirstX ¶

func (mvq *ModelVersionQuery) FirstX(ctx context.Context) *ModelVersion

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

func (*ModelVersionQuery) GroupBy ¶

func (mvq *ModelVersionQuery) GroupBy(field string, fields ...string) *ModelVersionGroupBy

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

client.ModelVersion.Query().
	GroupBy(modelversion.FieldVersion).
	Aggregate(model.Count()).
	Scan(ctx, &v)

func (*ModelVersionQuery) IDs ¶

func (mvq *ModelVersionQuery) IDs(ctx context.Context) ([]int, error)

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

func (*ModelVersionQuery) IDsX ¶

func (mvq *ModelVersionQuery) IDsX(ctx context.Context) []int

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

func (*ModelVersionQuery) Limit ¶

func (mvq *ModelVersionQuery) Limit(limit int) *ModelVersionQuery

Limit adds a limit step to the query.

func (*ModelVersionQuery) Offset ¶

func (mvq *ModelVersionQuery) Offset(offset int) *ModelVersionQuery

Offset adds an offset step to the query.

func (*ModelVersionQuery) Only ¶

func (mvq *ModelVersionQuery) Only(ctx context.Context) (*ModelVersion, error)

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

func (*ModelVersionQuery) OnlyID ¶

func (mvq *ModelVersionQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*ModelVersionQuery) OnlyIDX ¶

func (mvq *ModelVersionQuery) OnlyIDX(ctx context.Context) int

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

func (*ModelVersionQuery) OnlyX ¶

func (mvq *ModelVersionQuery) OnlyX(ctx context.Context) *ModelVersion

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

func (*ModelVersionQuery) Order ¶

func (mvq *ModelVersionQuery) Order(o ...OrderFunc) *ModelVersionQuery

Order adds an order step to the query.

func (*ModelVersionQuery) Select ¶

func (mvq *ModelVersionQuery) Select(fields ...string) *ModelVersionSelect

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

client.ModelVersion.Query().
	Select(modelversion.FieldVersion).
	Scan(ctx, &v)

func (*ModelVersionQuery) Unique ¶

func (mvq *ModelVersionQuery) Unique(unique bool) *ModelVersionQuery

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

func (*ModelVersionQuery) Where ¶

Where adds a new predicate for the ModelVersionQuery builder.

type ModelVersionSelect ¶

type ModelVersionSelect struct {
	*ModelVersionQuery
	// contains filtered or unexported fields
}

ModelVersionSelect is the builder for selecting fields of ModelVersion entities.

func (*ModelVersionSelect) Bool ¶

func (mvs *ModelVersionSelect) Bool(ctx context.Context) (_ bool, err error)

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

func (*ModelVersionSelect) BoolX ¶

func (mvs *ModelVersionSelect) BoolX(ctx context.Context) bool

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

func (*ModelVersionSelect) Bools ¶

func (mvs *ModelVersionSelect) Bools(ctx context.Context) ([]bool, error)

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

func (*ModelVersionSelect) BoolsX ¶

func (mvs *ModelVersionSelect) BoolsX(ctx context.Context) []bool

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

func (*ModelVersionSelect) Float64 ¶

func (mvs *ModelVersionSelect) Float64(ctx context.Context) (_ float64, err error)

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

func (*ModelVersionSelect) Float64X ¶

func (mvs *ModelVersionSelect) Float64X(ctx context.Context) float64

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

func (*ModelVersionSelect) Float64s ¶

func (mvs *ModelVersionSelect) Float64s(ctx context.Context) ([]float64, error)

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

func (*ModelVersionSelect) Float64sX ¶

func (mvs *ModelVersionSelect) Float64sX(ctx context.Context) []float64

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

func (*ModelVersionSelect) Int ¶

func (mvs *ModelVersionSelect) Int(ctx context.Context) (_ int, err error)

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

func (*ModelVersionSelect) IntX ¶

func (mvs *ModelVersionSelect) IntX(ctx context.Context) int

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

func (*ModelVersionSelect) Ints ¶

func (mvs *ModelVersionSelect) Ints(ctx context.Context) ([]int, error)

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

func (*ModelVersionSelect) IntsX ¶

func (mvs *ModelVersionSelect) IntsX(ctx context.Context) []int

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

func (*ModelVersionSelect) Scan ¶

func (mvs *ModelVersionSelect) Scan(ctx context.Context, v interface{}) error

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

func (*ModelVersionSelect) ScanX ¶

func (mvs *ModelVersionSelect) ScanX(ctx context.Context, v interface{})

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

func (*ModelVersionSelect) String ¶

func (mvs *ModelVersionSelect) String(ctx context.Context) (_ string, err error)

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

func (*ModelVersionSelect) StringX ¶

func (mvs *ModelVersionSelect) StringX(ctx context.Context) string

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

func (*ModelVersionSelect) Strings ¶

func (mvs *ModelVersionSelect) Strings(ctx context.Context) ([]string, error)

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

func (*ModelVersionSelect) StringsX ¶

func (mvs *ModelVersionSelect) StringsX(ctx context.Context) []string

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

type ModelVersionUpdate ¶

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

ModelVersionUpdate is the builder for updating ModelVersion entities.

func (*ModelVersionUpdate) Exec ¶

func (mvu *ModelVersionUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*ModelVersionUpdate) ExecX ¶

func (mvu *ModelVersionUpdate) ExecX(ctx context.Context)

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

func (*ModelVersionUpdate) Mutation ¶

func (mvu *ModelVersionUpdate) Mutation() *ModelVersionMutation

Mutation returns the ModelVersionMutation object of the builder.

func (*ModelVersionUpdate) Save ¶

func (mvu *ModelVersionUpdate) Save(ctx context.Context) (int, error)

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

func (*ModelVersionUpdate) SaveX ¶

func (mvu *ModelVersionUpdate) SaveX(ctx context.Context) int

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

func (*ModelVersionUpdate) SetUpdateTime ¶

func (mvu *ModelVersionUpdate) SetUpdateTime(t time.Time) *ModelVersionUpdate

SetUpdateTime sets the "update_time" field.

func (*ModelVersionUpdate) SetVersion ¶

func (mvu *ModelVersionUpdate) SetVersion(s string) *ModelVersionUpdate

SetVersion sets the "version" field.

func (*ModelVersionUpdate) Where ¶

Where appends a list predicates to the ModelVersionUpdate builder.

type ModelVersionUpdateOne ¶

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

ModelVersionUpdateOne is the builder for updating a single ModelVersion entity.

func (*ModelVersionUpdateOne) Exec ¶

func (mvuo *ModelVersionUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*ModelVersionUpdateOne) ExecX ¶

func (mvuo *ModelVersionUpdateOne) ExecX(ctx context.Context)

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

func (*ModelVersionUpdateOne) Mutation ¶

func (mvuo *ModelVersionUpdateOne) Mutation() *ModelVersionMutation

Mutation returns the ModelVersionMutation object of the builder.

func (*ModelVersionUpdateOne) Save ¶

Save executes the query and returns the updated ModelVersion entity.

func (*ModelVersionUpdateOne) SaveX ¶

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

func (*ModelVersionUpdateOne) Select ¶

func (mvuo *ModelVersionUpdateOne) Select(field string, fields ...string) *ModelVersionUpdateOne

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

func (*ModelVersionUpdateOne) SetUpdateTime ¶

func (mvuo *ModelVersionUpdateOne) SetUpdateTime(t time.Time) *ModelVersionUpdateOne

SetUpdateTime sets the "update_time" field.

func (*ModelVersionUpdateOne) SetVersion ¶

func (mvuo *ModelVersionUpdateOne) SetVersion(s string) *ModelVersionUpdateOne

SetVersion sets the "version" field.

type ModelVersions ¶

type ModelVersions []*ModelVersion

ModelVersions is a parsable slice of ModelVersion.

type MutateFunc ¶

type MutateFunc = ent.MutateFunc

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

type Mutation ¶

type Mutation = ent.Mutation

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

type Mutator ¶

type Mutator = ent.Mutator

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

type NotFoundError ¶

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

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

func (*NotFoundError) Error ¶

func (e *NotFoundError) Error() string

Error implements the error interface.

type NotLoadedError ¶

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

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

func (*NotLoadedError) Error ¶

func (e *NotLoadedError) Error() string

Error implements the error interface.

type NotSingularError ¶

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

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

func (*NotSingularError) Error ¶

func (e *NotSingularError) Error() string

Error implements the error interface.

type Op ¶

type Op = ent.Op

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

type Option ¶

type Option func(*config)

Option function to configure the client.

func Debug ¶

func Debug() Option

Debug enables debug logging on the ent.Driver.

func Driver ¶

func Driver(driver dialect.Driver) Option

Driver configures the client driver.

func Log ¶

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

Log sets the logging function for debug mode.

type OrderFunc ¶

type OrderFunc func(*sql.Selector)

OrderFunc applies an ordering on the sql selector.

func Asc ¶

func Asc(fields ...string) OrderFunc

Asc applies the given fields in ASC order.

func Desc ¶

func Desc(fields ...string) OrderFunc

Desc applies the given fields in DESC order.

type Policy ¶

type Policy = ent.Policy

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

type Query ¶

type Query = ent.Query

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

type RollbackFunc ¶

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

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

func (RollbackFunc) Rollback ¶

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

Rollback calls f(ctx, m).

type RollbackHook ¶

type RollbackHook func(Rollbacker) Rollbacker

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

hook := func(next ent.Rollbacker) ent.Rollbacker {
	return ent.RollbackFunc(func(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 SystemSetting ¶

type SystemSetting struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// Space holds the value of the "space" field.
	Space *systemsetting.Space `json:"space,omitempty"`
	// Key holds the value of the "key" field.
	Key string `json:"key,omitempty"`
	// Value holds the value of the "value" field.
	Value string `json:"value,omitempty"`
	// Typeof holds the value of the "typeof" field.
	Typeof string `json:"typeof,omitempty"`
	// UpdateTime holds the value of the "update_time" field.
	UpdateTime time.Time `json:"-"`
	// contains filtered or unexported fields
}

SystemSetting is the model entity for the SystemSetting schema.

func (*SystemSetting) String ¶

func (ss *SystemSetting) String() string

String implements the fmt.Stringer.

func (*SystemSetting) Unwrap ¶

func (ss *SystemSetting) Unwrap() *SystemSetting

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

func (ss *SystemSetting) Update() *SystemSettingUpdateOne

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

type SystemSettingClient ¶

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

SystemSettingClient is a client for the SystemSetting schema.

func NewSystemSettingClient ¶

func NewSystemSettingClient(c config) *SystemSettingClient

NewSystemSettingClient returns a client for the SystemSetting from the given config.

func (*SystemSettingClient) Create ¶

Create returns a create builder for SystemSetting.

func (*SystemSettingClient) CreateBulk ¶

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

func (*SystemSettingClient) Delete ¶

Delete returns a delete builder for SystemSetting.

func (*SystemSettingClient) DeleteOne ¶

DeleteOne returns a delete builder for the given entity.

func (*SystemSettingClient) DeleteOneID ¶

func (c *SystemSettingClient) DeleteOneID(id int) *SystemSettingDeleteOne

DeleteOneID returns a delete builder for the given id.

func (*SystemSettingClient) Get ¶

Get returns a SystemSetting entity by its id.

func (*SystemSettingClient) GetX ¶

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

func (*SystemSettingClient) Hooks ¶

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

Hooks returns the client hooks.

func (*SystemSettingClient) Query ¶

Query returns a query builder for SystemSetting.

func (*SystemSettingClient) Update ¶

Update returns an update builder for SystemSetting.

func (*SystemSettingClient) UpdateOne ¶

UpdateOne returns an update builder for the given entity.

func (*SystemSettingClient) UpdateOneID ¶

func (c *SystemSettingClient) UpdateOneID(id int) *SystemSettingUpdateOne

UpdateOneID returns an update builder for the given id.

func (*SystemSettingClient) Use ¶

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

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

type SystemSettingCreate ¶

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

SystemSettingCreate is the builder for creating a SystemSetting entity.

func (*SystemSettingCreate) Exec ¶ added in v1.0.2

func (ssc *SystemSettingCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*SystemSettingCreate) ExecX ¶ added in v1.0.2

func (ssc *SystemSettingCreate) ExecX(ctx context.Context)

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

func (*SystemSettingCreate) Mutation ¶

func (ssc *SystemSettingCreate) Mutation() *SystemSettingMutation

Mutation returns the SystemSettingMutation object of the builder.

func (*SystemSettingCreate) Save ¶

Save creates the SystemSetting in the database.

func (*SystemSettingCreate) SaveX ¶

SaveX calls Save and panics if Save returns an error.

func (*SystemSettingCreate) SetID ¶

SetID sets the "id" field.

func (*SystemSettingCreate) SetKey ¶

SetKey sets the "key" field.

func (*SystemSettingCreate) SetNillableSpace ¶

func (ssc *SystemSettingCreate) SetNillableSpace(s *systemsetting.Space) *SystemSettingCreate

SetNillableSpace sets the "space" field if the given value is not nil.

func (*SystemSettingCreate) SetNillableTypeof ¶

func (ssc *SystemSettingCreate) SetNillableTypeof(s *string) *SystemSettingCreate

SetNillableTypeof sets the "typeof" field if the given value is not nil.

func (*SystemSettingCreate) SetNillableUpdateTime ¶

func (ssc *SystemSettingCreate) SetNillableUpdateTime(t *time.Time) *SystemSettingCreate

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

func (*SystemSettingCreate) SetNillableValue ¶

func (ssc *SystemSettingCreate) SetNillableValue(s *string) *SystemSettingCreate

SetNillableValue sets the "value" field if the given value is not nil.

func (*SystemSettingCreate) SetSpace ¶

SetSpace sets the "space" field.

func (*SystemSettingCreate) SetTypeof ¶

func (ssc *SystemSettingCreate) SetTypeof(s string) *SystemSettingCreate

SetTypeof sets the "typeof" field.

func (*SystemSettingCreate) SetUpdateTime ¶

func (ssc *SystemSettingCreate) SetUpdateTime(t time.Time) *SystemSettingCreate

SetUpdateTime sets the "update_time" field.

func (*SystemSettingCreate) SetValue ¶

SetValue sets the "value" field.

type SystemSettingCreateBulk ¶

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

SystemSettingCreateBulk is the builder for creating many SystemSetting entities in bulk.

func (*SystemSettingCreateBulk) Exec ¶ added in v1.0.2

func (sscb *SystemSettingCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*SystemSettingCreateBulk) ExecX ¶ added in v1.0.2

func (sscb *SystemSettingCreateBulk) ExecX(ctx context.Context)

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

func (*SystemSettingCreateBulk) Save ¶

Save creates the SystemSetting entities in the database.

func (*SystemSettingCreateBulk) SaveX ¶

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

type SystemSettingDelete ¶

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

SystemSettingDelete is the builder for deleting a SystemSetting entity.

func (*SystemSettingDelete) Exec ¶

func (ssd *SystemSettingDelete) Exec(ctx context.Context) (int, error)

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

func (*SystemSettingDelete) ExecX ¶

func (ssd *SystemSettingDelete) ExecX(ctx context.Context) int

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

func (*SystemSettingDelete) Where ¶

Where appends a list predicates to the SystemSettingDelete builder.

type SystemSettingDeleteOne ¶

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

SystemSettingDeleteOne is the builder for deleting a single SystemSetting entity.

func (*SystemSettingDeleteOne) Exec ¶

func (ssdo *SystemSettingDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*SystemSettingDeleteOne) ExecX ¶

func (ssdo *SystemSettingDeleteOne) ExecX(ctx context.Context)

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

type SystemSettingGroupBy ¶

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

SystemSettingGroupBy is the group-by builder for SystemSetting entities.

func (*SystemSettingGroupBy) Aggregate ¶

func (ssgb *SystemSettingGroupBy) Aggregate(fns ...AggregateFunc) *SystemSettingGroupBy

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

func (*SystemSettingGroupBy) Bool ¶

func (ssgb *SystemSettingGroupBy) 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 (*SystemSettingGroupBy) BoolX ¶

func (ssgb *SystemSettingGroupBy) BoolX(ctx context.Context) bool

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

func (*SystemSettingGroupBy) Bools ¶

func (ssgb *SystemSettingGroupBy) 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 (*SystemSettingGroupBy) BoolsX ¶

func (ssgb *SystemSettingGroupBy) BoolsX(ctx context.Context) []bool

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

func (*SystemSettingGroupBy) Float64 ¶

func (ssgb *SystemSettingGroupBy) 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 (*SystemSettingGroupBy) Float64X ¶

func (ssgb *SystemSettingGroupBy) Float64X(ctx context.Context) float64

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

func (*SystemSettingGroupBy) Float64s ¶

func (ssgb *SystemSettingGroupBy) 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 (*SystemSettingGroupBy) Float64sX ¶

func (ssgb *SystemSettingGroupBy) Float64sX(ctx context.Context) []float64

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

func (*SystemSettingGroupBy) Int ¶

func (ssgb *SystemSettingGroupBy) 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 (*SystemSettingGroupBy) IntX ¶

func (ssgb *SystemSettingGroupBy) IntX(ctx context.Context) int

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

func (*SystemSettingGroupBy) Ints ¶

func (ssgb *SystemSettingGroupBy) 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 (*SystemSettingGroupBy) IntsX ¶

func (ssgb *SystemSettingGroupBy) IntsX(ctx context.Context) []int

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

func (*SystemSettingGroupBy) Scan ¶

func (ssgb *SystemSettingGroupBy) Scan(ctx context.Context, v interface{}) error

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

func (*SystemSettingGroupBy) ScanX ¶

func (ssgb *SystemSettingGroupBy) ScanX(ctx context.Context, v interface{})

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

func (*SystemSettingGroupBy) String ¶

func (ssgb *SystemSettingGroupBy) 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 (*SystemSettingGroupBy) StringX ¶

func (ssgb *SystemSettingGroupBy) StringX(ctx context.Context) string

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

func (*SystemSettingGroupBy) Strings ¶

func (ssgb *SystemSettingGroupBy) 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 (*SystemSettingGroupBy) StringsX ¶

func (ssgb *SystemSettingGroupBy) StringsX(ctx context.Context) []string

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

type SystemSettingMutation ¶

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

SystemSettingMutation represents an operation that mutates the SystemSetting nodes in the graph.

func (*SystemSettingMutation) AddField ¶

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

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

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

func (*SystemSettingMutation) AddedField ¶

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

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

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

func (*SystemSettingMutation) AddedIDs ¶

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

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

func (*SystemSettingMutation) ClearEdge ¶

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

func (m *SystemSettingMutation) 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 (*SystemSettingMutation) ClearSpace ¶

func (m *SystemSettingMutation) ClearSpace()

ClearSpace clears the value of the "space" field.

func (*SystemSettingMutation) ClearValue ¶

func (m *SystemSettingMutation) ClearValue()

ClearValue clears the value of the "value" field.

func (*SystemSettingMutation) ClearedEdges ¶

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

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

func (*SystemSettingMutation) ClearedFields ¶

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

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

func (SystemSettingMutation) Client ¶

func (m SystemSettingMutation) 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 (*SystemSettingMutation) EdgeCleared ¶

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

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

func (*SystemSettingMutation) Field ¶

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

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

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

func (*SystemSettingMutation) Fields ¶

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

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

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

func (*SystemSettingMutation) Key ¶

func (m *SystemSettingMutation) Key() (r string, exists bool)

Key returns the value of the "key" field in the mutation.

func (*SystemSettingMutation) OldField ¶

func (m *SystemSettingMutation) 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 (*SystemSettingMutation) OldKey ¶

func (m *SystemSettingMutation) OldKey(ctx context.Context) (v string, err error)

OldKey returns the old "key" field's value of the SystemSetting entity. If the SystemSetting 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 (*SystemSettingMutation) OldSpace ¶

func (m *SystemSettingMutation) OldSpace(ctx context.Context) (v *systemsetting.Space, err error)

OldSpace returns the old "space" field's value of the SystemSetting entity. If the SystemSetting 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 (*SystemSettingMutation) OldTypeof ¶

func (m *SystemSettingMutation) OldTypeof(ctx context.Context) (v string, err error)

OldTypeof returns the old "typeof" field's value of the SystemSetting entity. If the SystemSetting 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 (*SystemSettingMutation) OldUpdateTime ¶

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

OldUpdateTime returns the old "update_time" field's value of the SystemSetting entity. If the SystemSetting 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 (*SystemSettingMutation) OldValue ¶

func (m *SystemSettingMutation) OldValue(ctx context.Context) (v string, err error)

OldValue returns the old "value" field's value of the SystemSetting entity. If the SystemSetting 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 (*SystemSettingMutation) Op ¶

func (m *SystemSettingMutation) Op() Op

Op returns the operation name.

func (*SystemSettingMutation) RemovedEdges ¶

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

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

func (*SystemSettingMutation) RemovedIDs ¶

func (m *SystemSettingMutation) 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 (*SystemSettingMutation) ResetEdge ¶

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

func (m *SystemSettingMutation) 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 (*SystemSettingMutation) ResetKey ¶

func (m *SystemSettingMutation) ResetKey()

ResetKey resets all changes to the "key" field.

func (*SystemSettingMutation) ResetSpace ¶

func (m *SystemSettingMutation) ResetSpace()

ResetSpace resets all changes to the "space" field.

func (*SystemSettingMutation) ResetTypeof ¶

func (m *SystemSettingMutation) ResetTypeof()

ResetTypeof resets all changes to the "typeof" field.

func (*SystemSettingMutation) ResetUpdateTime ¶

func (m *SystemSettingMutation) ResetUpdateTime()

ResetUpdateTime resets all changes to the "update_time" field.

func (*SystemSettingMutation) ResetValue ¶

func (m *SystemSettingMutation) ResetValue()

ResetValue resets all changes to the "value" field.

func (*SystemSettingMutation) SetField ¶

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

func (m *SystemSettingMutation) SetID(id int)

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

func (*SystemSettingMutation) SetKey ¶

func (m *SystemSettingMutation) SetKey(s string)

SetKey sets the "key" field.

func (*SystemSettingMutation) SetSpace ¶

func (m *SystemSettingMutation) SetSpace(s systemsetting.Space)

SetSpace sets the "space" field.

func (*SystemSettingMutation) SetTypeof ¶

func (m *SystemSettingMutation) SetTypeof(s string)

SetTypeof sets the "typeof" field.

func (*SystemSettingMutation) SetUpdateTime ¶

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

SetUpdateTime sets the "update_time" field.

func (*SystemSettingMutation) SetValue ¶

func (m *SystemSettingMutation) SetValue(s string)

SetValue sets the "value" field.

func (*SystemSettingMutation) Space ¶

func (m *SystemSettingMutation) Space() (r systemsetting.Space, exists bool)

Space returns the value of the "space" field in the mutation.

func (*SystemSettingMutation) SpaceCleared ¶

func (m *SystemSettingMutation) SpaceCleared() bool

SpaceCleared returns if the "space" field was cleared in this mutation.

func (SystemSettingMutation) Tx ¶

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

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

func (*SystemSettingMutation) Type ¶

func (m *SystemSettingMutation) Type() string

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

func (*SystemSettingMutation) Typeof ¶

func (m *SystemSettingMutation) Typeof() (r string, exists bool)

Typeof returns the value of the "typeof" field in the mutation.

func (*SystemSettingMutation) UpdateTime ¶

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

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

func (*SystemSettingMutation) Value ¶

func (m *SystemSettingMutation) Value() (r string, exists bool)

Value returns the value of the "value" field in the mutation.

func (*SystemSettingMutation) ValueCleared ¶

func (m *SystemSettingMutation) ValueCleared() bool

ValueCleared returns if the "value" field was cleared in this mutation.

func (*SystemSettingMutation) Where ¶ added in v1.0.2

Where appends a list predicates to the SystemSettingMutation builder.

type SystemSettingQuery ¶

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

SystemSettingQuery is the builder for querying SystemSetting entities.

func (*SystemSettingQuery) All ¶

All executes the query and returns a list of SystemSettings.

func (*SystemSettingQuery) AllX ¶

func (ssq *SystemSettingQuery) AllX(ctx context.Context) []*SystemSetting

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

func (*SystemSettingQuery) Clone ¶

func (ssq *SystemSettingQuery) Clone() *SystemSettingQuery

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

func (*SystemSettingQuery) Count ¶

func (ssq *SystemSettingQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*SystemSettingQuery) CountX ¶

func (ssq *SystemSettingQuery) CountX(ctx context.Context) int

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

func (*SystemSettingQuery) Exist ¶

func (ssq *SystemSettingQuery) Exist(ctx context.Context) (bool, error)

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

func (*SystemSettingQuery) ExistX ¶

func (ssq *SystemSettingQuery) ExistX(ctx context.Context) bool

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

func (*SystemSettingQuery) First ¶

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

func (*SystemSettingQuery) FirstID ¶

func (ssq *SystemSettingQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*SystemSettingQuery) FirstIDX ¶

func (ssq *SystemSettingQuery) FirstIDX(ctx context.Context) int

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

func (*SystemSettingQuery) FirstX ¶

func (ssq *SystemSettingQuery) FirstX(ctx context.Context) *SystemSetting

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

func (*SystemSettingQuery) GroupBy ¶

func (ssq *SystemSettingQuery) GroupBy(field string, fields ...string) *SystemSettingGroupBy

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 {
	Space systemsetting.Space `json:"space,omitempty"`
	Count int `json:"count,omitempty"`
}

client.SystemSetting.Query().
	GroupBy(systemsetting.FieldSpace).
	Aggregate(model.Count()).
	Scan(ctx, &v)

func (*SystemSettingQuery) IDs ¶

func (ssq *SystemSettingQuery) IDs(ctx context.Context) ([]int, error)

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

func (*SystemSettingQuery) IDsX ¶

func (ssq *SystemSettingQuery) IDsX(ctx context.Context) []int

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

func (*SystemSettingQuery) Limit ¶

func (ssq *SystemSettingQuery) Limit(limit int) *SystemSettingQuery

Limit adds a limit step to the query.

func (*SystemSettingQuery) Offset ¶

func (ssq *SystemSettingQuery) Offset(offset int) *SystemSettingQuery

Offset adds an offset step to the query.

func (*SystemSettingQuery) Only ¶

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

func (*SystemSettingQuery) OnlyID ¶

func (ssq *SystemSettingQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*SystemSettingQuery) OnlyIDX ¶

func (ssq *SystemSettingQuery) OnlyIDX(ctx context.Context) int

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

func (*SystemSettingQuery) OnlyX ¶

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

func (*SystemSettingQuery) Order ¶

Order adds an order step to the query.

func (*SystemSettingQuery) Select ¶

func (ssq *SystemSettingQuery) Select(fields ...string) *SystemSettingSelect

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 {
	Space systemsetting.Space `json:"space,omitempty"`
}

client.SystemSetting.Query().
	Select(systemsetting.FieldSpace).
	Scan(ctx, &v)

func (*SystemSettingQuery) Unique ¶

func (ssq *SystemSettingQuery) Unique(unique bool) *SystemSettingQuery

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

func (*SystemSettingQuery) Where ¶

Where adds a new predicate for the SystemSettingQuery builder.

type SystemSettingSelect ¶

type SystemSettingSelect struct {
	*SystemSettingQuery
	// contains filtered or unexported fields
}

SystemSettingSelect is the builder for selecting fields of SystemSetting entities.

func (*SystemSettingSelect) Bool ¶

func (sss *SystemSettingSelect) Bool(ctx context.Context) (_ bool, err error)

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

func (*SystemSettingSelect) BoolX ¶

func (sss *SystemSettingSelect) BoolX(ctx context.Context) bool

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

func (*SystemSettingSelect) Bools ¶

func (sss *SystemSettingSelect) Bools(ctx context.Context) ([]bool, error)

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

func (*SystemSettingSelect) BoolsX ¶

func (sss *SystemSettingSelect) BoolsX(ctx context.Context) []bool

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

func (*SystemSettingSelect) Float64 ¶

func (sss *SystemSettingSelect) Float64(ctx context.Context) (_ float64, err error)

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

func (*SystemSettingSelect) Float64X ¶

func (sss *SystemSettingSelect) Float64X(ctx context.Context) float64

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

func (*SystemSettingSelect) Float64s ¶

func (sss *SystemSettingSelect) Float64s(ctx context.Context) ([]float64, error)

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

func (*SystemSettingSelect) Float64sX ¶

func (sss *SystemSettingSelect) Float64sX(ctx context.Context) []float64

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

func (*SystemSettingSelect) Int ¶

func (sss *SystemSettingSelect) Int(ctx context.Context) (_ int, err error)

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

func (*SystemSettingSelect) IntX ¶

func (sss *SystemSettingSelect) IntX(ctx context.Context) int

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

func (*SystemSettingSelect) Ints ¶

func (sss *SystemSettingSelect) Ints(ctx context.Context) ([]int, error)

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

func (*SystemSettingSelect) IntsX ¶

func (sss *SystemSettingSelect) IntsX(ctx context.Context) []int

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

func (*SystemSettingSelect) Scan ¶

func (sss *SystemSettingSelect) Scan(ctx context.Context, v interface{}) error

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

func (*SystemSettingSelect) ScanX ¶

func (sss *SystemSettingSelect) ScanX(ctx context.Context, v interface{})

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

func (*SystemSettingSelect) String ¶

func (sss *SystemSettingSelect) String(ctx context.Context) (_ string, err error)

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

func (*SystemSettingSelect) StringX ¶

func (sss *SystemSettingSelect) StringX(ctx context.Context) string

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

func (*SystemSettingSelect) Strings ¶

func (sss *SystemSettingSelect) Strings(ctx context.Context) ([]string, error)

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

func (*SystemSettingSelect) StringsX ¶

func (sss *SystemSettingSelect) StringsX(ctx context.Context) []string

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

type SystemSettingUpdate ¶

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

SystemSettingUpdate is the builder for updating SystemSetting entities.

func (*SystemSettingUpdate) ClearSpace ¶

func (ssu *SystemSettingUpdate) ClearSpace() *SystemSettingUpdate

ClearSpace clears the value of the "space" field.

func (*SystemSettingUpdate) ClearValue ¶

func (ssu *SystemSettingUpdate) ClearValue() *SystemSettingUpdate

ClearValue clears the value of the "value" field.

func (*SystemSettingUpdate) Exec ¶

func (ssu *SystemSettingUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*SystemSettingUpdate) ExecX ¶

func (ssu *SystemSettingUpdate) ExecX(ctx context.Context)

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

func (*SystemSettingUpdate) Mutation ¶

func (ssu *SystemSettingUpdate) Mutation() *SystemSettingMutation

Mutation returns the SystemSettingMutation object of the builder.

func (*SystemSettingUpdate) Save ¶

func (ssu *SystemSettingUpdate) Save(ctx context.Context) (int, error)

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

func (*SystemSettingUpdate) SaveX ¶

func (ssu *SystemSettingUpdate) SaveX(ctx context.Context) int

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

func (*SystemSettingUpdate) SetKey ¶

SetKey sets the "key" field.

func (*SystemSettingUpdate) SetNillableSpace ¶

func (ssu *SystemSettingUpdate) SetNillableSpace(s *systemsetting.Space) *SystemSettingUpdate

SetNillableSpace sets the "space" field if the given value is not nil.

func (*SystemSettingUpdate) SetNillableTypeof ¶

func (ssu *SystemSettingUpdate) SetNillableTypeof(s *string) *SystemSettingUpdate

SetNillableTypeof sets the "typeof" field if the given value is not nil.

func (*SystemSettingUpdate) SetNillableValue ¶

func (ssu *SystemSettingUpdate) SetNillableValue(s *string) *SystemSettingUpdate

SetNillableValue sets the "value" field if the given value is not nil.

func (*SystemSettingUpdate) SetSpace ¶

SetSpace sets the "space" field.

func (*SystemSettingUpdate) SetTypeof ¶

func (ssu *SystemSettingUpdate) SetTypeof(s string) *SystemSettingUpdate

SetTypeof sets the "typeof" field.

func (*SystemSettingUpdate) SetUpdateTime ¶

func (ssu *SystemSettingUpdate) SetUpdateTime(t time.Time) *SystemSettingUpdate

SetUpdateTime sets the "update_time" field.

func (*SystemSettingUpdate) SetValue ¶

SetValue sets the "value" field.

func (*SystemSettingUpdate) Where ¶

Where appends a list predicates to the SystemSettingUpdate builder.

type SystemSettingUpdateOne ¶

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

SystemSettingUpdateOne is the builder for updating a single SystemSetting entity.

func (*SystemSettingUpdateOne) ClearSpace ¶

func (ssuo *SystemSettingUpdateOne) ClearSpace() *SystemSettingUpdateOne

ClearSpace clears the value of the "space" field.

func (*SystemSettingUpdateOne) ClearValue ¶

func (ssuo *SystemSettingUpdateOne) ClearValue() *SystemSettingUpdateOne

ClearValue clears the value of the "value" field.

func (*SystemSettingUpdateOne) Exec ¶

func (ssuo *SystemSettingUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*SystemSettingUpdateOne) ExecX ¶

func (ssuo *SystemSettingUpdateOne) ExecX(ctx context.Context)

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

func (*SystemSettingUpdateOne) Mutation ¶

Mutation returns the SystemSettingMutation object of the builder.

func (*SystemSettingUpdateOne) Save ¶

Save executes the query and returns the updated SystemSetting entity.

func (*SystemSettingUpdateOne) SaveX ¶

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

func (*SystemSettingUpdateOne) Select ¶

func (ssuo *SystemSettingUpdateOne) Select(field string, fields ...string) *SystemSettingUpdateOne

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

func (*SystemSettingUpdateOne) SetKey ¶

SetKey sets the "key" field.

func (*SystemSettingUpdateOne) SetNillableSpace ¶

SetNillableSpace sets the "space" field if the given value is not nil.

func (*SystemSettingUpdateOne) SetNillableTypeof ¶

func (ssuo *SystemSettingUpdateOne) SetNillableTypeof(s *string) *SystemSettingUpdateOne

SetNillableTypeof sets the "typeof" field if the given value is not nil.

func (*SystemSettingUpdateOne) SetNillableValue ¶

func (ssuo *SystemSettingUpdateOne) SetNillableValue(s *string) *SystemSettingUpdateOne

SetNillableValue sets the "value" field if the given value is not nil.

func (*SystemSettingUpdateOne) SetSpace ¶

SetSpace sets the "space" field.

func (*SystemSettingUpdateOne) SetTypeof ¶

SetTypeof sets the "typeof" field.

func (*SystemSettingUpdateOne) SetUpdateTime ¶

func (ssuo *SystemSettingUpdateOne) SetUpdateTime(t time.Time) *SystemSettingUpdateOne

SetUpdateTime sets the "update_time" field.

func (*SystemSettingUpdateOne) SetValue ¶

SetValue sets the "value" field.

type SystemSettings ¶

type SystemSettings []*SystemSetting

SystemSettings is a parsable slice of SystemSetting.

type Tx ¶

type Tx struct {

	// ModelVersion is the client for interacting with the ModelVersion builders.
	ModelVersion *ModelVersionClient
	// SystemSetting is the client for interacting with the SystemSetting builders.
	SystemSetting *SystemSettingClient
	// User is the client for interacting with the User builders.
	User *UserClient
	// UserEmail is the client for interacting with the UserEmail builders.
	UserEmail *UserEmailClient
	// UserSecurityLog is the client for interacting with the UserSecurityLog builders.
	UserSecurityLog *UserSecurityLogClient
	// UserSetting is the client for interacting with the UserSetting builders.
	UserSetting *UserSettingClient
	// 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"`
	// Sn holds the value of the "sn" field.
	Sn string `json:"-"`
	// Nickname holds the value of the "nickname" field.
	Nickname string `json:"nickname,omitempty"`
	// Phone holds the value of the "phone" field.
	Phone *string `json:"phone,omitempty"`
	// Password holds the value of the "password" field.
	Password *string `json:"-"`
	// Status holds the value of the "status" field.
	Status *user.Status `json:"-"`
	// LastPwdAuth holds the value of the "last_pwd_auth" field.
	LastPwdAuth *time.Time `json:"-"`
	// CreateTime holds the value of the "create_time" field.
	CreateTime time.Time `json:"-"`
	// UpdateTime holds the value of the "update_time" field.
	UpdateTime time.Time `json:"-"`
	// DeleteTime holds the value of the "delete_time" field.
	DeleteTime *time.Time `json:"-"`
	// 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) QueryUserEmails ¶

func (u *User) QueryUserEmails() *UserEmailQuery

QueryUserEmails queries the "UserEmails" edge of the User entity.

func (*User) QueryUserSecurityLogs ¶

func (u *User) QueryUserSecurityLogs() *UserSecurityLogQuery

QueryUserSecurityLogs queries the "UserSecurityLogs" edge of the User entity.

func (*User) QueryUserSettings ¶

func (u *User) QueryUserSettings() *UserSettingQuery

QueryUserSettings queries the "UserSettings" 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) QueryUserEmails ¶

func (c *UserClient) QueryUserEmails(u *User) *UserEmailQuery

QueryUserEmails queries the UserEmails edge of a User.

func (*UserClient) QueryUserSecurityLogs ¶

func (c *UserClient) QueryUserSecurityLogs(u *User) *UserSecurityLogQuery

QueryUserSecurityLogs queries the UserSecurityLogs edge of a User.

func (*UserClient) QueryUserSettings ¶

func (c *UserClient) QueryUserSettings(u *User) *UserSettingQuery

QueryUserSettings queries the UserSettings 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) AddUserEmailIDs ¶

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

AddUserEmailIDs adds the "UserEmails" edge to the UserEmail entity by IDs.

func (*UserCreate) AddUserEmails ¶

func (uc *UserCreate) AddUserEmails(u ...*UserEmail) *UserCreate

AddUserEmails adds the "UserEmails" edges to the UserEmail entity.

func (*UserCreate) AddUserSecurityLogIDs ¶

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

AddUserSecurityLogIDs adds the "UserSecurityLogs" edge to the UserSecurityLog entity by IDs.

func (*UserCreate) AddUserSecurityLogs ¶

func (uc *UserCreate) AddUserSecurityLogs(u ...*UserSecurityLog) *UserCreate

AddUserSecurityLogs adds the "UserSecurityLogs" edges to the UserSecurityLog entity.

func (*UserCreate) AddUserSettingIDs ¶

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

AddUserSettingIDs adds the "UserSettings" edge to the UserSetting entity by IDs.

func (*UserCreate) AddUserSettings ¶

func (uc *UserCreate) AddUserSettings(u ...*UserSetting) *UserCreate

AddUserSettings adds the "UserSettings" edges to the UserSetting entity.

func (*UserCreate) Exec ¶ added in v1.0.2

func (uc *UserCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*UserCreate) ExecX ¶ added in v1.0.2

func (uc *UserCreate) ExecX(ctx context.Context)

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

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) SetCreateTime ¶

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

SetCreateTime sets the "create_time" field.

func (*UserCreate) SetDeleteTime ¶

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

SetDeleteTime sets the "delete_time" field.

func (*UserCreate) SetID ¶

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

SetID sets the "id" field.

func (*UserCreate) SetLastPwdAuth ¶

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

SetLastPwdAuth sets the "last_pwd_auth" field.

func (*UserCreate) SetNickname ¶

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

SetNickname sets the "nickname" field.

func (*UserCreate) SetNillableCreateTime ¶

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

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

func (*UserCreate) SetNillableDeleteTime ¶

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

SetNillableDeleteTime sets the "delete_time" field if the given value is not nil.

func (*UserCreate) SetNillableLastPwdAuth ¶

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

SetNillableLastPwdAuth sets the "last_pwd_auth" field if the given value is not nil.

func (*UserCreate) SetNillablePassword ¶

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

SetNillablePassword sets the "password" field if the given value is not nil.

func (*UserCreate) SetNillablePhone ¶

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

SetNillablePhone sets the "phone" field if the given value is not nil.

func (*UserCreate) SetNillableSn ¶

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

SetNillableSn sets the "sn" field if the given value is not nil.

func (*UserCreate) SetNillableStatus ¶

func (uc *UserCreate) SetNillableStatus(u *user.Status) *UserCreate

SetNillableStatus sets the "status" field if the given value is not nil.

func (*UserCreate) SetNillableUpdateTime ¶

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

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

func (*UserCreate) SetPassword ¶

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

SetPassword sets the "password" field.

func (*UserCreate) SetPhone ¶

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

SetPhone sets the "phone" field.

func (*UserCreate) SetSn ¶

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

SetSn sets the "sn" field.

func (*UserCreate) SetStatus ¶

func (uc *UserCreate) SetStatus(u user.Status) *UserCreate

SetStatus sets the "status" field.

func (*UserCreate) SetUpdateTime ¶

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

SetUpdateTime sets the "update_time" field.

type UserCreateBulk ¶

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

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

func (*UserCreateBulk) Exec ¶ added in v1.0.2

func (ucb *UserCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*UserCreateBulk) ExecX ¶ added in v1.0.2

func (ucb *UserCreateBulk) ExecX(ctx context.Context)

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

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 appends a list predicates 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 {
	// UserEmails holds the value of the UserEmails edge.
	UserEmails []*UserEmail `json:"emails,omitempty"`
	// UserSettings holds the value of the UserSettings edge.
	UserSettings []*UserSetting `json:"settings,omitempty"`
	// UserSecurityLogs holds the value of the UserSecurityLogs edge.
	UserSecurityLogs []*UserSecurityLog `json:"securityLogs,omitempty"`
	// contains filtered or unexported fields
}

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

func (UserEdges) UserEmailsOrErr ¶

func (e UserEdges) UserEmailsOrErr() ([]*UserEmail, error)

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

func (UserEdges) UserSecurityLogsOrErr ¶

func (e UserEdges) UserSecurityLogsOrErr() ([]*UserSecurityLog, error)

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

func (UserEdges) UserSettingsOrErr ¶

func (e UserEdges) UserSettingsOrErr() ([]*UserSetting, error)

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

type UserEmail ¶

type UserEmail struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// OwnerID holds the value of the "owner_id" field.
	OwnerID int `json:"-"`
	// Email holds the value of the "email" field.
	Email string `json:"email,omitempty"`
	// VerifyTicket holds the value of the "verify_ticket" field.
	VerifyTicket *string `json:"-"`
	// VerifyTime holds the value of the "verify_time" field.
	VerifyTime *time.Time `json:"-"`
	// IsPrimary holds the value of the "is_primary" field.
	IsPrimary bool `json:"is_primary,omitempty"`
	// CreateTime holds the value of the "create_time" field.
	CreateTime time.Time `json:"-"`
	// UpdateTime holds the value of the "update_time" field.
	UpdateTime time.Time `json:"-"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the UserEmailQuery when eager-loading is set.
	Edges UserEmailEdges `json:"edges"`
	// contains filtered or unexported fields
}

UserEmail is the model entity for the UserEmail schema.

func (*UserEmail) QueryEmailOwner ¶

func (ue *UserEmail) QueryEmailOwner() *UserQuery

QueryEmailOwner queries the "email_owner" edge of the UserEmail entity.

func (*UserEmail) String ¶

func (ue *UserEmail) String() string

String implements the fmt.Stringer.

func (*UserEmail) Unwrap ¶

func (ue *UserEmail) Unwrap() *UserEmail

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

func (ue *UserEmail) Update() *UserEmailUpdateOne

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

type UserEmailClient ¶

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

UserEmailClient is a client for the UserEmail schema.

func NewUserEmailClient ¶

func NewUserEmailClient(c config) *UserEmailClient

NewUserEmailClient returns a client for the UserEmail from the given config.

func (*UserEmailClient) Create ¶

func (c *UserEmailClient) Create() *UserEmailCreate

Create returns a create builder for UserEmail.

func (*UserEmailClient) CreateBulk ¶

func (c *UserEmailClient) CreateBulk(builders ...*UserEmailCreate) *UserEmailCreateBulk

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

func (*UserEmailClient) Delete ¶

func (c *UserEmailClient) Delete() *UserEmailDelete

Delete returns a delete builder for UserEmail.

func (*UserEmailClient) DeleteOne ¶

func (c *UserEmailClient) DeleteOne(ue *UserEmail) *UserEmailDeleteOne

DeleteOne returns a delete builder for the given entity.

func (*UserEmailClient) DeleteOneID ¶

func (c *UserEmailClient) DeleteOneID(id int) *UserEmailDeleteOne

DeleteOneID returns a delete builder for the given id.

func (*UserEmailClient) Get ¶

func (c *UserEmailClient) Get(ctx context.Context, id int) (*UserEmail, error)

Get returns a UserEmail entity by its id.

func (*UserEmailClient) GetX ¶

func (c *UserEmailClient) GetX(ctx context.Context, id int) *UserEmail

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

func (*UserEmailClient) Hooks ¶

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

Hooks returns the client hooks.

func (*UserEmailClient) Query ¶

func (c *UserEmailClient) Query() *UserEmailQuery

Query returns a query builder for UserEmail.

func (*UserEmailClient) QueryEmailOwner ¶

func (c *UserEmailClient) QueryEmailOwner(ue *UserEmail) *UserQuery

QueryEmailOwner queries the email_owner edge of a UserEmail.

func (*UserEmailClient) Update ¶

func (c *UserEmailClient) Update() *UserEmailUpdate

Update returns an update builder for UserEmail.

func (*UserEmailClient) UpdateOne ¶

func (c *UserEmailClient) UpdateOne(ue *UserEmail) *UserEmailUpdateOne

UpdateOne returns an update builder for the given entity.

func (*UserEmailClient) UpdateOneID ¶

func (c *UserEmailClient) UpdateOneID(id int) *UserEmailUpdateOne

UpdateOneID returns an update builder for the given id.

func (*UserEmailClient) Use ¶

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

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

type UserEmailCreate ¶

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

UserEmailCreate is the builder for creating a UserEmail entity.

func (*UserEmailCreate) Exec ¶ added in v1.0.2

func (uec *UserEmailCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*UserEmailCreate) ExecX ¶ added in v1.0.2

func (uec *UserEmailCreate) ExecX(ctx context.Context)

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

func (*UserEmailCreate) Mutation ¶

func (uec *UserEmailCreate) Mutation() *UserEmailMutation

Mutation returns the UserEmailMutation object of the builder.

func (*UserEmailCreate) Save ¶

func (uec *UserEmailCreate) Save(ctx context.Context) (*UserEmail, error)

Save creates the UserEmail in the database.

func (*UserEmailCreate) SaveX ¶

func (uec *UserEmailCreate) SaveX(ctx context.Context) *UserEmail

SaveX calls Save and panics if Save returns an error.

func (*UserEmailCreate) SetCreateTime ¶

func (uec *UserEmailCreate) SetCreateTime(t time.Time) *UserEmailCreate

SetCreateTime sets the "create_time" field.

func (*UserEmailCreate) SetEmail ¶

func (uec *UserEmailCreate) SetEmail(s string) *UserEmailCreate

SetEmail sets the "email" field.

func (*UserEmailCreate) SetEmailOwner ¶

func (uec *UserEmailCreate) SetEmailOwner(u *User) *UserEmailCreate

SetEmailOwner sets the "email_owner" edge to the User entity.

func (*UserEmailCreate) SetEmailOwnerID ¶

func (uec *UserEmailCreate) SetEmailOwnerID(id int) *UserEmailCreate

SetEmailOwnerID sets the "email_owner" edge to the User entity by ID.

func (*UserEmailCreate) SetID ¶

func (uec *UserEmailCreate) SetID(i int) *UserEmailCreate

SetID sets the "id" field.

func (*UserEmailCreate) SetIsPrimary ¶

func (uec *UserEmailCreate) SetIsPrimary(b bool) *UserEmailCreate

SetIsPrimary sets the "is_primary" field.

func (*UserEmailCreate) SetNillableCreateTime ¶

func (uec *UserEmailCreate) SetNillableCreateTime(t *time.Time) *UserEmailCreate

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

func (*UserEmailCreate) SetNillableIsPrimary ¶

func (uec *UserEmailCreate) SetNillableIsPrimary(b *bool) *UserEmailCreate

SetNillableIsPrimary sets the "is_primary" field if the given value is not nil.

func (*UserEmailCreate) SetNillableUpdateTime ¶

func (uec *UserEmailCreate) SetNillableUpdateTime(t *time.Time) *UserEmailCreate

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

func (*UserEmailCreate) SetNillableVerifyTicket ¶

func (uec *UserEmailCreate) SetNillableVerifyTicket(s *string) *UserEmailCreate

SetNillableVerifyTicket sets the "verify_ticket" field if the given value is not nil.

func (*UserEmailCreate) SetNillableVerifyTime ¶ added in v1.0.2

func (uec *UserEmailCreate) SetNillableVerifyTime(t *time.Time) *UserEmailCreate

SetNillableVerifyTime sets the "verify_time" field if the given value is not nil.

func (*UserEmailCreate) SetOwnerID ¶

func (uec *UserEmailCreate) SetOwnerID(i int) *UserEmailCreate

SetOwnerID sets the "owner_id" field.

func (*UserEmailCreate) SetUpdateTime ¶

func (uec *UserEmailCreate) SetUpdateTime(t time.Time) *UserEmailCreate

SetUpdateTime sets the "update_time" field.

func (*UserEmailCreate) SetVerifyTicket ¶

func (uec *UserEmailCreate) SetVerifyTicket(s string) *UserEmailCreate

SetVerifyTicket sets the "verify_ticket" field.

func (*UserEmailCreate) SetVerifyTime ¶ added in v1.0.2

func (uec *UserEmailCreate) SetVerifyTime(t time.Time) *UserEmailCreate

SetVerifyTime sets the "verify_time" field.

type UserEmailCreateBulk ¶

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

UserEmailCreateBulk is the builder for creating many UserEmail entities in bulk.

func (*UserEmailCreateBulk) Exec ¶ added in v1.0.2

func (uecb *UserEmailCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*UserEmailCreateBulk) ExecX ¶ added in v1.0.2

func (uecb *UserEmailCreateBulk) ExecX(ctx context.Context)

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

func (*UserEmailCreateBulk) Save ¶

func (uecb *UserEmailCreateBulk) Save(ctx context.Context) ([]*UserEmail, error)

Save creates the UserEmail entities in the database.

func (*UserEmailCreateBulk) SaveX ¶

func (uecb *UserEmailCreateBulk) SaveX(ctx context.Context) []*UserEmail

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

type UserEmailDelete ¶

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

UserEmailDelete is the builder for deleting a UserEmail entity.

func (*UserEmailDelete) Exec ¶

func (ued *UserEmailDelete) Exec(ctx context.Context) (int, error)

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

func (*UserEmailDelete) ExecX ¶

func (ued *UserEmailDelete) ExecX(ctx context.Context) int

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

func (*UserEmailDelete) Where ¶

Where appends a list predicates to the UserEmailDelete builder.

type UserEmailDeleteOne ¶

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

UserEmailDeleteOne is the builder for deleting a single UserEmail entity.

func (*UserEmailDeleteOne) Exec ¶

func (uedo *UserEmailDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*UserEmailDeleteOne) ExecX ¶

func (uedo *UserEmailDeleteOne) ExecX(ctx context.Context)

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

type UserEmailEdges ¶

type UserEmailEdges struct {
	// EmailOwner holds the value of the email_owner edge.
	EmailOwner *User `json:"owner,omitempty"`
	// contains filtered or unexported fields
}

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

func (UserEmailEdges) EmailOwnerOrErr ¶

func (e UserEmailEdges) EmailOwnerOrErr() (*User, error)

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

type UserEmailGroupBy ¶

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

UserEmailGroupBy is the group-by builder for UserEmail entities.

func (*UserEmailGroupBy) Aggregate ¶

func (uegb *UserEmailGroupBy) Aggregate(fns ...AggregateFunc) *UserEmailGroupBy

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

func (*UserEmailGroupBy) Bool ¶

func (uegb *UserEmailGroupBy) 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 (*UserEmailGroupBy) BoolX ¶

func (uegb *UserEmailGroupBy) BoolX(ctx context.Context) bool

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

func (*UserEmailGroupBy) Bools ¶

func (uegb *UserEmailGroupBy) 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 (*UserEmailGroupBy) BoolsX ¶

func (uegb *UserEmailGroupBy) BoolsX(ctx context.Context) []bool

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

func (*UserEmailGroupBy) Float64 ¶

func (uegb *UserEmailGroupBy) 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 (*UserEmailGroupBy) Float64X ¶

func (uegb *UserEmailGroupBy) Float64X(ctx context.Context) float64

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

func (*UserEmailGroupBy) Float64s ¶

func (uegb *UserEmailGroupBy) 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 (*UserEmailGroupBy) Float64sX ¶

func (uegb *UserEmailGroupBy) Float64sX(ctx context.Context) []float64

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

func (*UserEmailGroupBy) Int ¶

func (uegb *UserEmailGroupBy) 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 (*UserEmailGroupBy) IntX ¶

func (uegb *UserEmailGroupBy) IntX(ctx context.Context) int

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

func (*UserEmailGroupBy) Ints ¶

func (uegb *UserEmailGroupBy) 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 (*UserEmailGroupBy) IntsX ¶

func (uegb *UserEmailGroupBy) IntsX(ctx context.Context) []int

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

func (*UserEmailGroupBy) Scan ¶

func (uegb *UserEmailGroupBy) Scan(ctx context.Context, v interface{}) error

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

func (*UserEmailGroupBy) ScanX ¶

func (uegb *UserEmailGroupBy) ScanX(ctx context.Context, v interface{})

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

func (*UserEmailGroupBy) String ¶

func (uegb *UserEmailGroupBy) 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 (*UserEmailGroupBy) StringX ¶

func (uegb *UserEmailGroupBy) StringX(ctx context.Context) string

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

func (*UserEmailGroupBy) Strings ¶

func (uegb *UserEmailGroupBy) 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 (*UserEmailGroupBy) StringsX ¶

func (uegb *UserEmailGroupBy) StringsX(ctx context.Context) []string

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

type UserEmailMutation ¶

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

UserEmailMutation represents an operation that mutates the UserEmail nodes in the graph.

func (*UserEmailMutation) AddField ¶

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

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

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

func (*UserEmailMutation) AddedField ¶

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

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

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

func (*UserEmailMutation) AddedIDs ¶

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

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

func (*UserEmailMutation) ClearEdge ¶

func (m *UserEmailMutation) 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 (*UserEmailMutation) ClearEmailOwner ¶

func (m *UserEmailMutation) ClearEmailOwner()

ClearEmailOwner clears the "email_owner" edge to the User entity.

func (*UserEmailMutation) ClearField ¶

func (m *UserEmailMutation) 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 (*UserEmailMutation) ClearVerifyTicket ¶

func (m *UserEmailMutation) ClearVerifyTicket()

ClearVerifyTicket clears the value of the "verify_ticket" field.

func (*UserEmailMutation) ClearVerifyTime ¶ added in v1.0.2

func (m *UserEmailMutation) ClearVerifyTime()

ClearVerifyTime clears the value of the "verify_time" field.

func (*UserEmailMutation) ClearedEdges ¶

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

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

func (*UserEmailMutation) ClearedFields ¶

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

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

func (UserEmailMutation) Client ¶

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

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

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

func (*UserEmailMutation) EdgeCleared ¶

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

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

func (*UserEmailMutation) Email ¶

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

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

func (*UserEmailMutation) EmailOwnerCleared ¶

func (m *UserEmailMutation) EmailOwnerCleared() bool

EmailOwnerCleared reports if the "email_owner" edge to the User entity was cleared.

func (*UserEmailMutation) EmailOwnerID ¶

func (m *UserEmailMutation) EmailOwnerID() (id int, exists bool)

EmailOwnerID returns the "email_owner" edge ID in the mutation.

func (*UserEmailMutation) EmailOwnerIDs ¶

func (m *UserEmailMutation) EmailOwnerIDs() (ids []int)

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

func (*UserEmailMutation) Field ¶

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

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

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

func (*UserEmailMutation) Fields ¶

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

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

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

func (*UserEmailMutation) IsPrimary ¶

func (m *UserEmailMutation) IsPrimary() (r bool, exists bool)

IsPrimary returns the value of the "is_primary" field in the mutation.

func (*UserEmailMutation) OldCreateTime ¶

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

OldCreateTime returns the old "create_time" field's value of the UserEmail entity. If the UserEmail 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 (*UserEmailMutation) OldEmail ¶

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

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

func (m *UserEmailMutation) 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 (*UserEmailMutation) OldIsPrimary ¶

func (m *UserEmailMutation) OldIsPrimary(ctx context.Context) (v bool, err error)

OldIsPrimary returns the old "is_primary" field's value of the UserEmail entity. If the UserEmail 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 (*UserEmailMutation) OldOwnerID ¶

func (m *UserEmailMutation) OldOwnerID(ctx context.Context) (v int, err error)

OldOwnerID returns the old "owner_id" field's value of the UserEmail entity. If the UserEmail 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 (*UserEmailMutation) OldUpdateTime ¶

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

OldUpdateTime returns the old "update_time" field's value of the UserEmail entity. If the UserEmail 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 (*UserEmailMutation) OldVerifyTicket ¶

func (m *UserEmailMutation) OldVerifyTicket(ctx context.Context) (v *string, err error)

OldVerifyTicket returns the old "verify_ticket" field's value of the UserEmail entity. If the UserEmail 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 (*UserEmailMutation) OldVerifyTime ¶ added in v1.0.2

func (m *UserEmailMutation) OldVerifyTime(ctx context.Context) (v *time.Time, err error)

OldVerifyTime returns the old "verify_time" field's value of the UserEmail entity. If the UserEmail 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 (*UserEmailMutation) Op ¶

func (m *UserEmailMutation) Op() Op

Op returns the operation name.

func (*UserEmailMutation) OwnerID ¶

func (m *UserEmailMutation) OwnerID() (r int, exists bool)

OwnerID returns the value of the "owner_id" field in the mutation.

func (*UserEmailMutation) RemovedEdges ¶

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

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

func (*UserEmailMutation) RemovedIDs ¶

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

func (m *UserEmailMutation) ResetCreateTime()

ResetCreateTime resets all changes to the "create_time" field.

func (*UserEmailMutation) ResetEdge ¶

func (m *UserEmailMutation) 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 (*UserEmailMutation) ResetEmail ¶

func (m *UserEmailMutation) ResetEmail()

ResetEmail resets all changes to the "email" field.

func (*UserEmailMutation) ResetEmailOwner ¶

func (m *UserEmailMutation) ResetEmailOwner()

ResetEmailOwner resets all changes to the "email_owner" edge.

func (*UserEmailMutation) ResetField ¶

func (m *UserEmailMutation) 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 (*UserEmailMutation) ResetIsPrimary ¶

func (m *UserEmailMutation) ResetIsPrimary()

ResetIsPrimary resets all changes to the "is_primary" field.

func (*UserEmailMutation) ResetOwnerID ¶

func (m *UserEmailMutation) ResetOwnerID()

ResetOwnerID resets all changes to the "owner_id" field.

func (*UserEmailMutation) ResetUpdateTime ¶

func (m *UserEmailMutation) ResetUpdateTime()

ResetUpdateTime resets all changes to the "update_time" field.

func (*UserEmailMutation) ResetVerifyTicket ¶

func (m *UserEmailMutation) ResetVerifyTicket()

ResetVerifyTicket resets all changes to the "verify_ticket" field.

func (*UserEmailMutation) ResetVerifyTime ¶ added in v1.0.2

func (m *UserEmailMutation) ResetVerifyTime()

ResetVerifyTime resets all changes to the "verify_time" field.

func (*UserEmailMutation) SetCreateTime ¶

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

SetCreateTime sets the "create_time" field.

func (*UserEmailMutation) SetEmail ¶

func (m *UserEmailMutation) SetEmail(s string)

SetEmail sets the "email" field.

func (*UserEmailMutation) SetEmailOwnerID ¶

func (m *UserEmailMutation) SetEmailOwnerID(id int)

SetEmailOwnerID sets the "email_owner" edge to the User entity by id.

func (*UserEmailMutation) SetField ¶

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

func (m *UserEmailMutation) SetID(id int)

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

func (*UserEmailMutation) SetIsPrimary ¶

func (m *UserEmailMutation) SetIsPrimary(b bool)

SetIsPrimary sets the "is_primary" field.

func (*UserEmailMutation) SetOwnerID ¶

func (m *UserEmailMutation) SetOwnerID(i int)

SetOwnerID sets the "owner_id" field.

func (*UserEmailMutation) SetUpdateTime ¶

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

SetUpdateTime sets the "update_time" field.

func (*UserEmailMutation) SetVerifyTicket ¶

func (m *UserEmailMutation) SetVerifyTicket(s string)

SetVerifyTicket sets the "verify_ticket" field.

func (*UserEmailMutation) SetVerifyTime ¶ added in v1.0.2

func (m *UserEmailMutation) SetVerifyTime(t time.Time)

SetVerifyTime sets the "verify_time" field.

func (UserEmailMutation) Tx ¶

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

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

func (*UserEmailMutation) Type ¶

func (m *UserEmailMutation) Type() string

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

func (*UserEmailMutation) UpdateTime ¶

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

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

func (*UserEmailMutation) VerifyTicket ¶

func (m *UserEmailMutation) VerifyTicket() (r string, exists bool)

VerifyTicket returns the value of the "verify_ticket" field in the mutation.

func (*UserEmailMutation) VerifyTicketCleared ¶

func (m *UserEmailMutation) VerifyTicketCleared() bool

VerifyTicketCleared returns if the "verify_ticket" field was cleared in this mutation.

func (*UserEmailMutation) VerifyTime ¶ added in v1.0.2

func (m *UserEmailMutation) VerifyTime() (r time.Time, exists bool)

VerifyTime returns the value of the "verify_time" field in the mutation.

func (*UserEmailMutation) VerifyTimeCleared ¶ added in v1.0.2

func (m *UserEmailMutation) VerifyTimeCleared() bool

VerifyTimeCleared returns if the "verify_time" field was cleared in this mutation.

func (*UserEmailMutation) Where ¶ added in v1.0.2

func (m *UserEmailMutation) Where(ps ...predicate.UserEmail)

Where appends a list predicates to the UserEmailMutation builder.

type UserEmailQuery ¶

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

UserEmailQuery is the builder for querying UserEmail entities.

func (*UserEmailQuery) All ¶

func (ueq *UserEmailQuery) All(ctx context.Context) ([]*UserEmail, error)

All executes the query and returns a list of UserEmails.

func (*UserEmailQuery) AllX ¶

func (ueq *UserEmailQuery) AllX(ctx context.Context) []*UserEmail

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

func (*UserEmailQuery) Clone ¶

func (ueq *UserEmailQuery) Clone() *UserEmailQuery

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

func (*UserEmailQuery) Count ¶

func (ueq *UserEmailQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*UserEmailQuery) CountX ¶

func (ueq *UserEmailQuery) CountX(ctx context.Context) int

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

func (*UserEmailQuery) Exist ¶

func (ueq *UserEmailQuery) Exist(ctx context.Context) (bool, error)

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

func (*UserEmailQuery) ExistX ¶

func (ueq *UserEmailQuery) ExistX(ctx context.Context) bool

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

func (*UserEmailQuery) First ¶

func (ueq *UserEmailQuery) First(ctx context.Context) (*UserEmail, error)

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

func (*UserEmailQuery) FirstID ¶

func (ueq *UserEmailQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*UserEmailQuery) FirstIDX ¶

func (ueq *UserEmailQuery) FirstIDX(ctx context.Context) int

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

func (*UserEmailQuery) FirstX ¶

func (ueq *UserEmailQuery) FirstX(ctx context.Context) *UserEmail

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

func (*UserEmailQuery) GroupBy ¶

func (ueq *UserEmailQuery) GroupBy(field string, fields ...string) *UserEmailGroupBy

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

client.UserEmail.Query().
	GroupBy(useremail.FieldOwnerID).
	Aggregate(model.Count()).
	Scan(ctx, &v)

func (*UserEmailQuery) IDs ¶

func (ueq *UserEmailQuery) IDs(ctx context.Context) ([]int, error)

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

func (*UserEmailQuery) IDsX ¶

func (ueq *UserEmailQuery) IDsX(ctx context.Context) []int

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

func (*UserEmailQuery) Limit ¶

func (ueq *UserEmailQuery) Limit(limit int) *UserEmailQuery

Limit adds a limit step to the query.

func (*UserEmailQuery) Offset ¶

func (ueq *UserEmailQuery) Offset(offset int) *UserEmailQuery

Offset adds an offset step to the query.

func (*UserEmailQuery) Only ¶

func (ueq *UserEmailQuery) Only(ctx context.Context) (*UserEmail, error)

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

func (*UserEmailQuery) OnlyID ¶

func (ueq *UserEmailQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*UserEmailQuery) OnlyIDX ¶

func (ueq *UserEmailQuery) OnlyIDX(ctx context.Context) int

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

func (*UserEmailQuery) OnlyX ¶

func (ueq *UserEmailQuery) OnlyX(ctx context.Context) *UserEmail

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

func (*UserEmailQuery) Order ¶

func (ueq *UserEmailQuery) Order(o ...OrderFunc) *UserEmailQuery

Order adds an order step to the query.

func (*UserEmailQuery) QueryEmailOwner ¶

func (ueq *UserEmailQuery) QueryEmailOwner() *UserQuery

QueryEmailOwner chains the current query on the "email_owner" edge.

func (*UserEmailQuery) Select ¶

func (ueq *UserEmailQuery) Select(fields ...string) *UserEmailSelect

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 {
	OwnerID int `json:"-"`
}

client.UserEmail.Query().
	Select(useremail.FieldOwnerID).
	Scan(ctx, &v)

func (*UserEmailQuery) Unique ¶

func (ueq *UserEmailQuery) Unique(unique bool) *UserEmailQuery

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

func (*UserEmailQuery) Where ¶

func (ueq *UserEmailQuery) Where(ps ...predicate.UserEmail) *UserEmailQuery

Where adds a new predicate for the UserEmailQuery builder.

func (*UserEmailQuery) WithEmailOwner ¶

func (ueq *UserEmailQuery) WithEmailOwner(opts ...func(*UserQuery)) *UserEmailQuery

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

type UserEmailSelect ¶

type UserEmailSelect struct {
	*UserEmailQuery
	// contains filtered or unexported fields
}

UserEmailSelect is the builder for selecting fields of UserEmail entities.

func (*UserEmailSelect) Bool ¶

func (ues *UserEmailSelect) Bool(ctx context.Context) (_ bool, err error)

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

func (*UserEmailSelect) BoolX ¶

func (ues *UserEmailSelect) BoolX(ctx context.Context) bool

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

func (*UserEmailSelect) Bools ¶

func (ues *UserEmailSelect) Bools(ctx context.Context) ([]bool, error)

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

func (*UserEmailSelect) BoolsX ¶

func (ues *UserEmailSelect) BoolsX(ctx context.Context) []bool

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

func (*UserEmailSelect) Float64 ¶

func (ues *UserEmailSelect) Float64(ctx context.Context) (_ float64, err error)

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

func (*UserEmailSelect) Float64X ¶

func (ues *UserEmailSelect) Float64X(ctx context.Context) float64

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

func (*UserEmailSelect) Float64s ¶

func (ues *UserEmailSelect) Float64s(ctx context.Context) ([]float64, error)

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

func (*UserEmailSelect) Float64sX ¶

func (ues *UserEmailSelect) Float64sX(ctx context.Context) []float64

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

func (*UserEmailSelect) Int ¶

func (ues *UserEmailSelect) Int(ctx context.Context) (_ int, err error)

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

func (*UserEmailSelect) IntX ¶

func (ues *UserEmailSelect) IntX(ctx context.Context) int

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

func (*UserEmailSelect) Ints ¶

func (ues *UserEmailSelect) Ints(ctx context.Context) ([]int, error)

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

func (*UserEmailSelect) IntsX ¶

func (ues *UserEmailSelect) IntsX(ctx context.Context) []int

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

func (*UserEmailSelect) Scan ¶

func (ues *UserEmailSelect) Scan(ctx context.Context, v interface{}) error

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

func (*UserEmailSelect) ScanX ¶

func (ues *UserEmailSelect) ScanX(ctx context.Context, v interface{})

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

func (*UserEmailSelect) String ¶

func (ues *UserEmailSelect) String(ctx context.Context) (_ string, err error)

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

func (*UserEmailSelect) StringX ¶

func (ues *UserEmailSelect) StringX(ctx context.Context) string

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

func (*UserEmailSelect) Strings ¶

func (ues *UserEmailSelect) Strings(ctx context.Context) ([]string, error)

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

func (*UserEmailSelect) StringsX ¶

func (ues *UserEmailSelect) StringsX(ctx context.Context) []string

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

type UserEmailUpdate ¶

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

UserEmailUpdate is the builder for updating UserEmail entities.

func (*UserEmailUpdate) ClearEmailOwner ¶

func (ueu *UserEmailUpdate) ClearEmailOwner() *UserEmailUpdate

ClearEmailOwner clears the "email_owner" edge to the User entity.

func (*UserEmailUpdate) ClearVerifyTicket ¶

func (ueu *UserEmailUpdate) ClearVerifyTicket() *UserEmailUpdate

ClearVerifyTicket clears the value of the "verify_ticket" field.

func (*UserEmailUpdate) ClearVerifyTime ¶ added in v1.0.2

func (ueu *UserEmailUpdate) ClearVerifyTime() *UserEmailUpdate

ClearVerifyTime clears the value of the "verify_time" field.

func (*UserEmailUpdate) Exec ¶

func (ueu *UserEmailUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*UserEmailUpdate) ExecX ¶

func (ueu *UserEmailUpdate) ExecX(ctx context.Context)

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

func (*UserEmailUpdate) Mutation ¶

func (ueu *UserEmailUpdate) Mutation() *UserEmailMutation

Mutation returns the UserEmailMutation object of the builder.

func (*UserEmailUpdate) Save ¶

func (ueu *UserEmailUpdate) Save(ctx context.Context) (int, error)

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

func (*UserEmailUpdate) SaveX ¶

func (ueu *UserEmailUpdate) SaveX(ctx context.Context) int

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

func (*UserEmailUpdate) SetEmail ¶

func (ueu *UserEmailUpdate) SetEmail(s string) *UserEmailUpdate

SetEmail sets the "email" field.

func (*UserEmailUpdate) SetEmailOwner ¶

func (ueu *UserEmailUpdate) SetEmailOwner(u *User) *UserEmailUpdate

SetEmailOwner sets the "email_owner" edge to the User entity.

func (*UserEmailUpdate) SetEmailOwnerID ¶

func (ueu *UserEmailUpdate) SetEmailOwnerID(id int) *UserEmailUpdate

SetEmailOwnerID sets the "email_owner" edge to the User entity by ID.

func (*UserEmailUpdate) SetIsPrimary ¶

func (ueu *UserEmailUpdate) SetIsPrimary(b bool) *UserEmailUpdate

SetIsPrimary sets the "is_primary" field.

func (*UserEmailUpdate) SetNillableIsPrimary ¶

func (ueu *UserEmailUpdate) SetNillableIsPrimary(b *bool) *UserEmailUpdate

SetNillableIsPrimary sets the "is_primary" field if the given value is not nil.

func (*UserEmailUpdate) SetNillableVerifyTicket ¶

func (ueu *UserEmailUpdate) SetNillableVerifyTicket(s *string) *UserEmailUpdate

SetNillableVerifyTicket sets the "verify_ticket" field if the given value is not nil.

func (*UserEmailUpdate) SetNillableVerifyTime ¶ added in v1.0.2

func (ueu *UserEmailUpdate) SetNillableVerifyTime(t *time.Time) *UserEmailUpdate

SetNillableVerifyTime sets the "verify_time" field if the given value is not nil.

func (*UserEmailUpdate) SetOwnerID ¶

func (ueu *UserEmailUpdate) SetOwnerID(i int) *UserEmailUpdate

SetOwnerID sets the "owner_id" field.

func (*UserEmailUpdate) SetUpdateTime ¶

func (ueu *UserEmailUpdate) SetUpdateTime(t time.Time) *UserEmailUpdate

SetUpdateTime sets the "update_time" field.

func (*UserEmailUpdate) SetVerifyTicket ¶

func (ueu *UserEmailUpdate) SetVerifyTicket(s string) *UserEmailUpdate

SetVerifyTicket sets the "verify_ticket" field.

func (*UserEmailUpdate) SetVerifyTime ¶ added in v1.0.2

func (ueu *UserEmailUpdate) SetVerifyTime(t time.Time) *UserEmailUpdate

SetVerifyTime sets the "verify_time" field.

func (*UserEmailUpdate) Where ¶

Where appends a list predicates to the UserEmailUpdate builder.

type UserEmailUpdateOne ¶

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

UserEmailUpdateOne is the builder for updating a single UserEmail entity.

func (*UserEmailUpdateOne) ClearEmailOwner ¶

func (ueuo *UserEmailUpdateOne) ClearEmailOwner() *UserEmailUpdateOne

ClearEmailOwner clears the "email_owner" edge to the User entity.

func (*UserEmailUpdateOne) ClearVerifyTicket ¶

func (ueuo *UserEmailUpdateOne) ClearVerifyTicket() *UserEmailUpdateOne

ClearVerifyTicket clears the value of the "verify_ticket" field.

func (*UserEmailUpdateOne) ClearVerifyTime ¶ added in v1.0.2

func (ueuo *UserEmailUpdateOne) ClearVerifyTime() *UserEmailUpdateOne

ClearVerifyTime clears the value of the "verify_time" field.

func (*UserEmailUpdateOne) Exec ¶

func (ueuo *UserEmailUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*UserEmailUpdateOne) ExecX ¶

func (ueuo *UserEmailUpdateOne) ExecX(ctx context.Context)

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

func (*UserEmailUpdateOne) Mutation ¶

func (ueuo *UserEmailUpdateOne) Mutation() *UserEmailMutation

Mutation returns the UserEmailMutation object of the builder.

func (*UserEmailUpdateOne) Save ¶

func (ueuo *UserEmailUpdateOne) Save(ctx context.Context) (*UserEmail, error)

Save executes the query and returns the updated UserEmail entity.

func (*UserEmailUpdateOne) SaveX ¶

func (ueuo *UserEmailUpdateOne) SaveX(ctx context.Context) *UserEmail

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

func (*UserEmailUpdateOne) Select ¶

func (ueuo *UserEmailUpdateOne) Select(field string, fields ...string) *UserEmailUpdateOne

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

func (*UserEmailUpdateOne) SetEmail ¶

func (ueuo *UserEmailUpdateOne) SetEmail(s string) *UserEmailUpdateOne

SetEmail sets the "email" field.

func (*UserEmailUpdateOne) SetEmailOwner ¶

func (ueuo *UserEmailUpdateOne) SetEmailOwner(u *User) *UserEmailUpdateOne

SetEmailOwner sets the "email_owner" edge to the User entity.

func (*UserEmailUpdateOne) SetEmailOwnerID ¶

func (ueuo *UserEmailUpdateOne) SetEmailOwnerID(id int) *UserEmailUpdateOne

SetEmailOwnerID sets the "email_owner" edge to the User entity by ID.

func (*UserEmailUpdateOne) SetIsPrimary ¶

func (ueuo *UserEmailUpdateOne) SetIsPrimary(b bool) *UserEmailUpdateOne

SetIsPrimary sets the "is_primary" field.

func (*UserEmailUpdateOne) SetNillableIsPrimary ¶

func (ueuo *UserEmailUpdateOne) SetNillableIsPrimary(b *bool) *UserEmailUpdateOne

SetNillableIsPrimary sets the "is_primary" field if the given value is not nil.

func (*UserEmailUpdateOne) SetNillableVerifyTicket ¶

func (ueuo *UserEmailUpdateOne) SetNillableVerifyTicket(s *string) *UserEmailUpdateOne

SetNillableVerifyTicket sets the "verify_ticket" field if the given value is not nil.

func (*UserEmailUpdateOne) SetNillableVerifyTime ¶ added in v1.0.2

func (ueuo *UserEmailUpdateOne) SetNillableVerifyTime(t *time.Time) *UserEmailUpdateOne

SetNillableVerifyTime sets the "verify_time" field if the given value is not nil.

func (*UserEmailUpdateOne) SetOwnerID ¶

func (ueuo *UserEmailUpdateOne) SetOwnerID(i int) *UserEmailUpdateOne

SetOwnerID sets the "owner_id" field.

func (*UserEmailUpdateOne) SetUpdateTime ¶

func (ueuo *UserEmailUpdateOne) SetUpdateTime(t time.Time) *UserEmailUpdateOne

SetUpdateTime sets the "update_time" field.

func (*UserEmailUpdateOne) SetVerifyTicket ¶

func (ueuo *UserEmailUpdateOne) SetVerifyTicket(s string) *UserEmailUpdateOne

SetVerifyTicket sets the "verify_ticket" field.

func (*UserEmailUpdateOne) SetVerifyTime ¶ added in v1.0.2

func (ueuo *UserEmailUpdateOne) SetVerifyTime(t time.Time) *UserEmailUpdateOne

SetVerifyTime sets the "verify_time" field.

type UserEmails ¶

type UserEmails []*UserEmail

UserEmails is a parsable slice of UserEmail.

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) 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) AddUserEmailIDs ¶

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

AddUserEmailIDs adds the "UserEmails" edge to the UserEmail entity by ids.

func (*UserMutation) AddUserSecurityLogIDs ¶

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

AddUserSecurityLogIDs adds the "UserSecurityLogs" edge to the UserSecurityLog entity by ids.

func (*UserMutation) AddUserSettingIDs ¶

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

AddUserSettingIDs adds the "UserSettings" edge to the UserSetting entity by ids.

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) ClearDeleteTime ¶

func (m *UserMutation) ClearDeleteTime()

ClearDeleteTime clears the value of the "delete_time" 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) 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) ClearLastPwdAuth ¶

func (m *UserMutation) ClearLastPwdAuth()

ClearLastPwdAuth clears the value of the "last_pwd_auth" field.

func (*UserMutation) ClearPassword ¶

func (m *UserMutation) ClearPassword()

ClearPassword clears the value of the "password" field.

func (*UserMutation) ClearPhone ¶

func (m *UserMutation) ClearPhone()

ClearPhone clears the value of the "phone" field.

func (*UserMutation) ClearStatus ¶

func (m *UserMutation) ClearStatus()

ClearStatus clears the value of the "status" field.

func (*UserMutation) ClearUserEmails ¶

func (m *UserMutation) ClearUserEmails()

ClearUserEmails clears the "UserEmails" edge to the UserEmail entity.

func (*UserMutation) ClearUserSecurityLogs ¶

func (m *UserMutation) ClearUserSecurityLogs()

ClearUserSecurityLogs clears the "UserSecurityLogs" edge to the UserSecurityLog entity.

func (*UserMutation) ClearUserSettings ¶

func (m *UserMutation) ClearUserSettings()

ClearUserSettings clears the "UserSettings" edge to the UserSetting 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) CreateTime ¶

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

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

func (*UserMutation) DeleteTime ¶

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

DeleteTime returns the value of the "delete_time" field in the mutation.

func (*UserMutation) DeleteTimeCleared ¶

func (m *UserMutation) DeleteTimeCleared() bool

DeleteTimeCleared returns if the "delete_time" 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) 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 or after it was returned from the database.

func (*UserMutation) LastPwdAuth ¶

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

LastPwdAuth returns the value of the "last_pwd_auth" field in the mutation.

func (*UserMutation) LastPwdAuthCleared ¶

func (m *UserMutation) LastPwdAuthCleared() bool

LastPwdAuthCleared returns if the "last_pwd_auth" field was cleared in this mutation.

func (*UserMutation) Nickname ¶

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

Nickname returns the value of the "nickname" field in the mutation.

func (*UserMutation) OldCreateTime ¶

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

OldCreateTime returns the old "create_time" 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) OldDeleteTime ¶

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

OldDeleteTime returns the old "delete_time" 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) OldLastPwdAuth ¶

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

OldLastPwdAuth returns the old "last_pwd_auth" 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) OldNickname ¶

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

OldNickname returns the old "nickname" 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) OldPassword ¶

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

OldPassword returns the old "password" 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) OldPhone ¶

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

OldPhone returns the old "phone" 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) OldSn ¶

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

OldSn returns the old "sn" 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) OldStatus ¶

func (m *UserMutation) OldStatus(ctx context.Context) (v *user.Status, err error)

OldStatus returns the old "status" 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) OldUpdateTime ¶

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

OldUpdateTime returns the old "update_time" 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) Password ¶

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

Password returns the value of the "password" field in the mutation.

func (*UserMutation) PasswordCleared ¶

func (m *UserMutation) PasswordCleared() bool

PasswordCleared returns if the "password" field was cleared in this mutation.

func (*UserMutation) Phone ¶

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

Phone returns the value of the "phone" field in the mutation.

func (*UserMutation) PhoneCleared ¶

func (m *UserMutation) PhoneCleared() bool

PhoneCleared returns if the "phone" field was cleared in this mutation.

func (*UserMutation) RemoveUserEmailIDs ¶

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

RemoveUserEmailIDs removes the "UserEmails" edge to the UserEmail entity by IDs.

func (*UserMutation) RemoveUserSecurityLogIDs ¶

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

RemoveUserSecurityLogIDs removes the "UserSecurityLogs" edge to the UserSecurityLog entity by IDs.

func (*UserMutation) RemoveUserSettingIDs ¶

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

RemoveUserSettingIDs removes the "UserSettings" edge to the UserSetting entity by IDs.

func (*UserMutation) RemovedEdges ¶

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

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

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) RemovedUserEmailsIDs ¶

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

RemovedUserEmails returns the removed IDs of the "UserEmails" edge to the UserEmail entity.

func (*UserMutation) RemovedUserSecurityLogsIDs ¶

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

RemovedUserSecurityLogs returns the removed IDs of the "UserSecurityLogs" edge to the UserSecurityLog entity.

func (*UserMutation) RemovedUserSettingsIDs ¶

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

RemovedUserSettings returns the removed IDs of the "UserSettings" edge to the UserSetting entity.

func (*UserMutation) ResetCreateTime ¶

func (m *UserMutation) ResetCreateTime()

ResetCreateTime resets all changes to the "create_time" field.

func (*UserMutation) ResetDeleteTime ¶

func (m *UserMutation) ResetDeleteTime()

ResetDeleteTime resets all changes to the "delete_time" 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) 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) ResetLastPwdAuth ¶

func (m *UserMutation) ResetLastPwdAuth()

ResetLastPwdAuth resets all changes to the "last_pwd_auth" field.

func (*UserMutation) ResetNickname ¶

func (m *UserMutation) ResetNickname()

ResetNickname resets all changes to the "nickname" field.

func (*UserMutation) ResetPassword ¶

func (m *UserMutation) ResetPassword()

ResetPassword resets all changes to the "password" field.

func (*UserMutation) ResetPhone ¶

func (m *UserMutation) ResetPhone()

ResetPhone resets all changes to the "phone" field.

func (*UserMutation) ResetSn ¶

func (m *UserMutation) ResetSn()

ResetSn resets all changes to the "sn" field.

func (*UserMutation) ResetStatus ¶

func (m *UserMutation) ResetStatus()

ResetStatus resets all changes to the "status" field.

func (*UserMutation) ResetUpdateTime ¶

func (m *UserMutation) ResetUpdateTime()

ResetUpdateTime resets all changes to the "update_time" field.

func (*UserMutation) ResetUserEmails ¶

func (m *UserMutation) ResetUserEmails()

ResetUserEmails resets all changes to the "UserEmails" edge.

func (*UserMutation) ResetUserSecurityLogs ¶

func (m *UserMutation) ResetUserSecurityLogs()

ResetUserSecurityLogs resets all changes to the "UserSecurityLogs" edge.

func (*UserMutation) ResetUserSettings ¶

func (m *UserMutation) ResetUserSettings()

ResetUserSettings resets all changes to the "UserSettings" edge.

func (*UserMutation) SetCreateTime ¶

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

SetCreateTime sets the "create_time" field.

func (*UserMutation) SetDeleteTime ¶

func (m *UserMutation) SetDeleteTime(t time.Time)

SetDeleteTime sets the "delete_time" 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) SetID ¶

func (m *UserMutation) SetID(id int)

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

func (*UserMutation) SetLastPwdAuth ¶

func (m *UserMutation) SetLastPwdAuth(t time.Time)

SetLastPwdAuth sets the "last_pwd_auth" field.

func (*UserMutation) SetNickname ¶

func (m *UserMutation) SetNickname(s string)

SetNickname sets the "nickname" field.

func (*UserMutation) SetPassword ¶

func (m *UserMutation) SetPassword(s string)

SetPassword sets the "password" field.

func (*UserMutation) SetPhone ¶

func (m *UserMutation) SetPhone(s string)

SetPhone sets the "phone" field.

func (*UserMutation) SetSn ¶

func (m *UserMutation) SetSn(s string)

SetSn sets the "sn" field.

func (*UserMutation) SetStatus ¶

func (m *UserMutation) SetStatus(u user.Status)

SetStatus sets the "status" field.

func (*UserMutation) SetUpdateTime ¶

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

SetUpdateTime sets the "update_time" field.

func (*UserMutation) Sn ¶

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

Sn returns the value of the "sn" field in the mutation.

func (*UserMutation) Status ¶

func (m *UserMutation) Status() (r user.Status, exists bool)

Status returns the value of the "status" field in the mutation.

func (*UserMutation) StatusCleared ¶

func (m *UserMutation) StatusCleared() bool

StatusCleared returns if the "status" field was cleared in this mutation.

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) UpdateTime ¶

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

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

func (*UserMutation) UserEmailsCleared ¶

func (m *UserMutation) UserEmailsCleared() bool

UserEmailsCleared reports if the "UserEmails" edge to the UserEmail entity was cleared.

func (*UserMutation) UserEmailsIDs ¶

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

UserEmailsIDs returns the "UserEmails" edge IDs in the mutation.

func (*UserMutation) UserSecurityLogsCleared ¶

func (m *UserMutation) UserSecurityLogsCleared() bool

UserSecurityLogsCleared reports if the "UserSecurityLogs" edge to the UserSecurityLog entity was cleared.

func (*UserMutation) UserSecurityLogsIDs ¶

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

UserSecurityLogsIDs returns the "UserSecurityLogs" edge IDs in the mutation.

func (*UserMutation) UserSettingsCleared ¶

func (m *UserMutation) UserSettingsCleared() bool

UserSettingsCleared reports if the "UserSettings" edge to the UserSetting entity was cleared.

func (*UserMutation) UserSettingsIDs ¶

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

UserSettingsIDs returns the "UserSettings" edge IDs in the mutation.

func (*UserMutation) Where ¶ added in v1.0.2

func (m *UserMutation) Where(ps ...predicate.User)

Where appends a list predicates to the UserMutation builder.

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

client.User.Query().
	GroupBy(user.FieldSn).
	Aggregate(model.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) QueryUserEmails ¶

func (uq *UserQuery) QueryUserEmails() *UserEmailQuery

QueryUserEmails chains the current query on the "UserEmails" edge.

func (*UserQuery) QueryUserSecurityLogs ¶

func (uq *UserQuery) QueryUserSecurityLogs() *UserSecurityLogQuery

QueryUserSecurityLogs chains the current query on the "UserSecurityLogs" edge.

func (*UserQuery) QueryUserSettings ¶

func (uq *UserQuery) QueryUserSettings() *UserSettingQuery

QueryUserSettings chains the current query on the "UserSettings" edge.

func (*UserQuery) Select ¶

func (uq *UserQuery) Select(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 {
	Sn string `json:"-"`
}

client.User.Query().
	Select(user.FieldSn).
	Scan(ctx, &v)

func (*UserQuery) Unique ¶

func (uq *UserQuery) Unique(unique bool) *UserQuery

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

func (*UserQuery) Where ¶

func (uq *UserQuery) Where(ps ...predicate.User) *UserQuery

Where adds a new predicate for the UserQuery builder.

func (*UserQuery) WithUserEmails ¶

func (uq *UserQuery) WithUserEmails(opts ...func(*UserEmailQuery)) *UserQuery

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

func (*UserQuery) WithUserSecurityLogs ¶

func (uq *UserQuery) WithUserSecurityLogs(opts ...func(*UserSecurityLogQuery)) *UserQuery

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

func (*UserQuery) WithUserSettings ¶

func (uq *UserQuery) WithUserSettings(opts ...func(*UserSettingQuery)) *UserQuery

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

type UserSecurityLog ¶

type UserSecurityLog struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// OwnerID holds the value of the "owner_id" field.
	OwnerID int `json:"-"`
	// Action holds the value of the "action" field.
	Action usersecuritylog.Action `json:"action,omitempty"`
	// IP holds the value of the "ip" field.
	IP *string `json:"ip,omitempty"`
	// RequestID holds the value of the "request_id" field.
	RequestID *string `json:"request_id,omitempty"`
	// ServerVersion holds the value of the "server_version" field.
	ServerVersion *string `json:"server_version,omitempty"`
	// Description holds the value of the "description" field.
	Description *string `json:"description,omitempty"`
	// Remark holds the value of the "remark" field.
	Remark *string `json:"remark,omitempty"`
	// CreateTime holds the value of the "create_time" field.
	CreateTime time.Time `json:"-"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the UserSecurityLogQuery when eager-loading is set.
	Edges UserSecurityLogEdges `json:"edges"`
	// contains filtered or unexported fields
}

UserSecurityLog is the model entity for the UserSecurityLog schema.

func (*UserSecurityLog) QuerySecurityLogsOwner ¶

func (usl *UserSecurityLog) QuerySecurityLogsOwner() *UserQuery

QuerySecurityLogsOwner queries the "security_logs_owner" edge of the UserSecurityLog entity.

func (*UserSecurityLog) String ¶

func (usl *UserSecurityLog) String() string

String implements the fmt.Stringer.

func (*UserSecurityLog) Unwrap ¶

func (usl *UserSecurityLog) Unwrap() *UserSecurityLog

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

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

type UserSecurityLogClient ¶

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

UserSecurityLogClient is a client for the UserSecurityLog schema.

func NewUserSecurityLogClient ¶

func NewUserSecurityLogClient(c config) *UserSecurityLogClient

NewUserSecurityLogClient returns a client for the UserSecurityLog from the given config.

func (*UserSecurityLogClient) Create ¶

Create returns a create builder for UserSecurityLog.

func (*UserSecurityLogClient) CreateBulk ¶

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

func (*UserSecurityLogClient) Delete ¶

Delete returns a delete builder for UserSecurityLog.

func (*UserSecurityLogClient) DeleteOne ¶

DeleteOne returns a delete builder for the given entity.

func (*UserSecurityLogClient) DeleteOneID ¶

DeleteOneID returns a delete builder for the given id.

func (*UserSecurityLogClient) Get ¶

Get returns a UserSecurityLog entity by its id.

func (*UserSecurityLogClient) GetX ¶

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

func (*UserSecurityLogClient) Hooks ¶

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

Hooks returns the client hooks.

func (*UserSecurityLogClient) Query ¶

Query returns a query builder for UserSecurityLog.

func (*UserSecurityLogClient) QuerySecurityLogsOwner ¶

func (c *UserSecurityLogClient) QuerySecurityLogsOwner(usl *UserSecurityLog) *UserQuery

QuerySecurityLogsOwner queries the security_logs_owner edge of a UserSecurityLog.

func (*UserSecurityLogClient) Update ¶

Update returns an update builder for UserSecurityLog.

func (*UserSecurityLogClient) UpdateOne ¶

UpdateOne returns an update builder for the given entity.

func (*UserSecurityLogClient) UpdateOneID ¶

UpdateOneID returns an update builder for the given id.

func (*UserSecurityLogClient) Use ¶

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

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

type UserSecurityLogCreate ¶

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

UserSecurityLogCreate is the builder for creating a UserSecurityLog entity.

func (*UserSecurityLogCreate) Exec ¶ added in v1.0.2

func (uslc *UserSecurityLogCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*UserSecurityLogCreate) ExecX ¶ added in v1.0.2

func (uslc *UserSecurityLogCreate) ExecX(ctx context.Context)

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

func (*UserSecurityLogCreate) Mutation ¶

Mutation returns the UserSecurityLogMutation object of the builder.

func (*UserSecurityLogCreate) Save ¶

Save creates the UserSecurityLog in the database.

func (*UserSecurityLogCreate) SaveX ¶

SaveX calls Save and panics if Save returns an error.

func (*UserSecurityLogCreate) SetAction ¶

SetAction sets the "action" field.

func (*UserSecurityLogCreate) SetCreateTime ¶

func (uslc *UserSecurityLogCreate) SetCreateTime(t time.Time) *UserSecurityLogCreate

SetCreateTime sets the "create_time" field.

func (*UserSecurityLogCreate) SetDescription ¶

func (uslc *UserSecurityLogCreate) SetDescription(s string) *UserSecurityLogCreate

SetDescription sets the "description" field.

func (*UserSecurityLogCreate) SetID ¶

SetID sets the "id" field.

func (*UserSecurityLogCreate) SetIP ¶

SetIP sets the "ip" field.

func (*UserSecurityLogCreate) SetNillableAction ¶

SetNillableAction sets the "action" field if the given value is not nil.

func (*UserSecurityLogCreate) SetNillableCreateTime ¶

func (uslc *UserSecurityLogCreate) SetNillableCreateTime(t *time.Time) *UserSecurityLogCreate

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

func (*UserSecurityLogCreate) SetNillableDescription ¶

func (uslc *UserSecurityLogCreate) SetNillableDescription(s *string) *UserSecurityLogCreate

SetNillableDescription sets the "description" field if the given value is not nil.

func (*UserSecurityLogCreate) SetNillableIP ¶

func (uslc *UserSecurityLogCreate) SetNillableIP(s *string) *UserSecurityLogCreate

SetNillableIP sets the "ip" field if the given value is not nil.

func (*UserSecurityLogCreate) SetNillableRemark ¶

func (uslc *UserSecurityLogCreate) SetNillableRemark(s *string) *UserSecurityLogCreate

SetNillableRemark sets the "remark" field if the given value is not nil.

func (*UserSecurityLogCreate) SetNillableRequestID ¶

func (uslc *UserSecurityLogCreate) SetNillableRequestID(s *string) *UserSecurityLogCreate

SetNillableRequestID sets the "request_id" field if the given value is not nil.

func (*UserSecurityLogCreate) SetNillableServerVersion ¶

func (uslc *UserSecurityLogCreate) SetNillableServerVersion(s *string) *UserSecurityLogCreate

SetNillableServerVersion sets the "server_version" field if the given value is not nil.

func (*UserSecurityLogCreate) SetOwnerID ¶

func (uslc *UserSecurityLogCreate) SetOwnerID(i int) *UserSecurityLogCreate

SetOwnerID sets the "owner_id" field.

func (*UserSecurityLogCreate) SetRemark ¶

SetRemark sets the "remark" field.

func (*UserSecurityLogCreate) SetRequestID ¶

func (uslc *UserSecurityLogCreate) SetRequestID(s string) *UserSecurityLogCreate

SetRequestID sets the "request_id" field.

func (*UserSecurityLogCreate) SetSecurityLogsOwner ¶

func (uslc *UserSecurityLogCreate) SetSecurityLogsOwner(u *User) *UserSecurityLogCreate

SetSecurityLogsOwner sets the "security_logs_owner" edge to the User entity.

func (*UserSecurityLogCreate) SetSecurityLogsOwnerID ¶

func (uslc *UserSecurityLogCreate) SetSecurityLogsOwnerID(id int) *UserSecurityLogCreate

SetSecurityLogsOwnerID sets the "security_logs_owner" edge to the User entity by ID.

func (*UserSecurityLogCreate) SetServerVersion ¶

func (uslc *UserSecurityLogCreate) SetServerVersion(s string) *UserSecurityLogCreate

SetServerVersion sets the "server_version" field.

type UserSecurityLogCreateBulk ¶

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

UserSecurityLogCreateBulk is the builder for creating many UserSecurityLog entities in bulk.

func (*UserSecurityLogCreateBulk) Exec ¶ added in v1.0.2

Exec executes the query.

func (*UserSecurityLogCreateBulk) ExecX ¶ added in v1.0.2

func (uslcb *UserSecurityLogCreateBulk) ExecX(ctx context.Context)

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

func (*UserSecurityLogCreateBulk) Save ¶

Save creates the UserSecurityLog entities in the database.

func (*UserSecurityLogCreateBulk) SaveX ¶

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

type UserSecurityLogDelete ¶

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

UserSecurityLogDelete is the builder for deleting a UserSecurityLog entity.

func (*UserSecurityLogDelete) Exec ¶

func (usld *UserSecurityLogDelete) Exec(ctx context.Context) (int, error)

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

func (*UserSecurityLogDelete) ExecX ¶

func (usld *UserSecurityLogDelete) ExecX(ctx context.Context) int

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

func (*UserSecurityLogDelete) Where ¶

Where appends a list predicates to the UserSecurityLogDelete builder.

type UserSecurityLogDeleteOne ¶

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

UserSecurityLogDeleteOne is the builder for deleting a single UserSecurityLog entity.

func (*UserSecurityLogDeleteOne) Exec ¶

func (usldo *UserSecurityLogDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*UserSecurityLogDeleteOne) ExecX ¶

func (usldo *UserSecurityLogDeleteOne) ExecX(ctx context.Context)

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

type UserSecurityLogEdges ¶

type UserSecurityLogEdges struct {
	// SecurityLogsOwner holds the value of the security_logs_owner edge.
	SecurityLogsOwner *User `json:"owner,omitempty"`
	// contains filtered or unexported fields
}

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

func (UserSecurityLogEdges) SecurityLogsOwnerOrErr ¶

func (e UserSecurityLogEdges) SecurityLogsOwnerOrErr() (*User, error)

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

type UserSecurityLogGroupBy ¶

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

UserSecurityLogGroupBy is the group-by builder for UserSecurityLog entities.

func (*UserSecurityLogGroupBy) Aggregate ¶

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

func (*UserSecurityLogGroupBy) Bool ¶

func (uslgb *UserSecurityLogGroupBy) 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 (*UserSecurityLogGroupBy) BoolX ¶

func (uslgb *UserSecurityLogGroupBy) BoolX(ctx context.Context) bool

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

func (*UserSecurityLogGroupBy) Bools ¶

func (uslgb *UserSecurityLogGroupBy) 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 (*UserSecurityLogGroupBy) BoolsX ¶

func (uslgb *UserSecurityLogGroupBy) BoolsX(ctx context.Context) []bool

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

func (*UserSecurityLogGroupBy) Float64 ¶

func (uslgb *UserSecurityLogGroupBy) 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 (*UserSecurityLogGroupBy) Float64X ¶

func (uslgb *UserSecurityLogGroupBy) Float64X(ctx context.Context) float64

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

func (*UserSecurityLogGroupBy) Float64s ¶

func (uslgb *UserSecurityLogGroupBy) 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 (*UserSecurityLogGroupBy) Float64sX ¶

func (uslgb *UserSecurityLogGroupBy) Float64sX(ctx context.Context) []float64

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

func (*UserSecurityLogGroupBy) Int ¶

func (uslgb *UserSecurityLogGroupBy) 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 (*UserSecurityLogGroupBy) IntX ¶

func (uslgb *UserSecurityLogGroupBy) IntX(ctx context.Context) int

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

func (*UserSecurityLogGroupBy) Ints ¶

func (uslgb *UserSecurityLogGroupBy) 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 (*UserSecurityLogGroupBy) IntsX ¶

func (uslgb *UserSecurityLogGroupBy) IntsX(ctx context.Context) []int

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

func (*UserSecurityLogGroupBy) Scan ¶

func (uslgb *UserSecurityLogGroupBy) Scan(ctx context.Context, v interface{}) error

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

func (*UserSecurityLogGroupBy) ScanX ¶

func (uslgb *UserSecurityLogGroupBy) ScanX(ctx context.Context, v interface{})

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

func (*UserSecurityLogGroupBy) String ¶

func (uslgb *UserSecurityLogGroupBy) 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 (*UserSecurityLogGroupBy) StringX ¶

func (uslgb *UserSecurityLogGroupBy) StringX(ctx context.Context) string

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

func (*UserSecurityLogGroupBy) Strings ¶

func (uslgb *UserSecurityLogGroupBy) 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 (*UserSecurityLogGroupBy) StringsX ¶

func (uslgb *UserSecurityLogGroupBy) StringsX(ctx context.Context) []string

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

type UserSecurityLogMutation ¶

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

UserSecurityLogMutation represents an operation that mutates the UserSecurityLog nodes in the graph.

func (*UserSecurityLogMutation) Action ¶

func (m *UserSecurityLogMutation) Action() (r usersecuritylog.Action, exists bool)

Action returns the value of the "action" field in the mutation.

func (*UserSecurityLogMutation) AddField ¶

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

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

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

func (*UserSecurityLogMutation) AddedField ¶

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

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

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

func (*UserSecurityLogMutation) AddedIDs ¶

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

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

func (*UserSecurityLogMutation) ClearDescription ¶

func (m *UserSecurityLogMutation) ClearDescription()

ClearDescription clears the value of the "description" field.

func (*UserSecurityLogMutation) ClearEdge ¶

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

func (m *UserSecurityLogMutation) 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 (*UserSecurityLogMutation) ClearIP ¶

func (m *UserSecurityLogMutation) ClearIP()

ClearIP clears the value of the "ip" field.

func (*UserSecurityLogMutation) ClearRemark ¶

func (m *UserSecurityLogMutation) ClearRemark()

ClearRemark clears the value of the "remark" field.

func (*UserSecurityLogMutation) ClearRequestID ¶

func (m *UserSecurityLogMutation) ClearRequestID()

ClearRequestID clears the value of the "request_id" field.

func (*UserSecurityLogMutation) ClearSecurityLogsOwner ¶

func (m *UserSecurityLogMutation) ClearSecurityLogsOwner()

ClearSecurityLogsOwner clears the "security_logs_owner" edge to the User entity.

func (*UserSecurityLogMutation) ClearServerVersion ¶

func (m *UserSecurityLogMutation) ClearServerVersion()

ClearServerVersion clears the value of the "server_version" field.

func (*UserSecurityLogMutation) ClearedEdges ¶

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

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

func (*UserSecurityLogMutation) ClearedFields ¶

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

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

func (UserSecurityLogMutation) Client ¶

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

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

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

func (*UserSecurityLogMutation) Description ¶

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

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

func (*UserSecurityLogMutation) DescriptionCleared ¶

func (m *UserSecurityLogMutation) DescriptionCleared() bool

DescriptionCleared returns if the "description" field was cleared in this mutation.

func (*UserSecurityLogMutation) EdgeCleared ¶

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

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

func (*UserSecurityLogMutation) Field ¶

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

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

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

func (*UserSecurityLogMutation) Fields ¶

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

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

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

func (*UserSecurityLogMutation) IP ¶

func (m *UserSecurityLogMutation) IP() (r string, exists bool)

IP returns the value of the "ip" field in the mutation.

func (*UserSecurityLogMutation) IPCleared ¶

func (m *UserSecurityLogMutation) IPCleared() bool

IPCleared returns if the "ip" field was cleared in this mutation.

func (*UserSecurityLogMutation) OldAction ¶

OldAction returns the old "action" field's value of the UserSecurityLog entity. If the UserSecurityLog 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 (*UserSecurityLogMutation) OldCreateTime ¶

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

OldCreateTime returns the old "create_time" field's value of the UserSecurityLog entity. If the UserSecurityLog 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 (*UserSecurityLogMutation) OldDescription ¶

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

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

func (m *UserSecurityLogMutation) 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 (*UserSecurityLogMutation) OldIP ¶

func (m *UserSecurityLogMutation) OldIP(ctx context.Context) (v *string, err error)

OldIP returns the old "ip" field's value of the UserSecurityLog entity. If the UserSecurityLog 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 (*UserSecurityLogMutation) OldOwnerID ¶

func (m *UserSecurityLogMutation) OldOwnerID(ctx context.Context) (v int, err error)

OldOwnerID returns the old "owner_id" field's value of the UserSecurityLog entity. If the UserSecurityLog 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 (*UserSecurityLogMutation) OldRemark ¶

func (m *UserSecurityLogMutation) OldRemark(ctx context.Context) (v *string, err error)

OldRemark returns the old "remark" field's value of the UserSecurityLog entity. If the UserSecurityLog 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 (*UserSecurityLogMutation) OldRequestID ¶

func (m *UserSecurityLogMutation) OldRequestID(ctx context.Context) (v *string, err error)

OldRequestID returns the old "request_id" field's value of the UserSecurityLog entity. If the UserSecurityLog 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 (*UserSecurityLogMutation) OldServerVersion ¶

func (m *UserSecurityLogMutation) OldServerVersion(ctx context.Context) (v *string, err error)

OldServerVersion returns the old "server_version" field's value of the UserSecurityLog entity. If the UserSecurityLog 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 (*UserSecurityLogMutation) Op ¶

func (m *UserSecurityLogMutation) Op() Op

Op returns the operation name.

func (*UserSecurityLogMutation) OwnerID ¶

func (m *UserSecurityLogMutation) OwnerID() (r int, exists bool)

OwnerID returns the value of the "owner_id" field in the mutation.

func (*UserSecurityLogMutation) Remark ¶

func (m *UserSecurityLogMutation) Remark() (r string, exists bool)

Remark returns the value of the "remark" field in the mutation.

func (*UserSecurityLogMutation) RemarkCleared ¶

func (m *UserSecurityLogMutation) RemarkCleared() bool

RemarkCleared returns if the "remark" field was cleared in this mutation.

func (*UserSecurityLogMutation) RemovedEdges ¶

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

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

func (*UserSecurityLogMutation) RemovedIDs ¶

func (m *UserSecurityLogMutation) 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 (*UserSecurityLogMutation) RequestID ¶

func (m *UserSecurityLogMutation) RequestID() (r string, exists bool)

RequestID returns the value of the "request_id" field in the mutation.

func (*UserSecurityLogMutation) RequestIDCleared ¶

func (m *UserSecurityLogMutation) RequestIDCleared() bool

RequestIDCleared returns if the "request_id" field was cleared in this mutation.

func (*UserSecurityLogMutation) ResetAction ¶

func (m *UserSecurityLogMutation) ResetAction()

ResetAction resets all changes to the "action" field.

func (*UserSecurityLogMutation) ResetCreateTime ¶

func (m *UserSecurityLogMutation) ResetCreateTime()

ResetCreateTime resets all changes to the "create_time" field.

func (*UserSecurityLogMutation) ResetDescription ¶

func (m *UserSecurityLogMutation) ResetDescription()

ResetDescription resets all changes to the "description" field.

func (*UserSecurityLogMutation) ResetEdge ¶

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

func (m *UserSecurityLogMutation) 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 (*UserSecurityLogMutation) ResetIP ¶

func (m *UserSecurityLogMutation) ResetIP()

ResetIP resets all changes to the "ip" field.

func (*UserSecurityLogMutation) ResetOwnerID ¶

func (m *UserSecurityLogMutation) ResetOwnerID()

ResetOwnerID resets all changes to the "owner_id" field.

func (*UserSecurityLogMutation) ResetRemark ¶

func (m *UserSecurityLogMutation) ResetRemark()

ResetRemark resets all changes to the "remark" field.

func (*UserSecurityLogMutation) ResetRequestID ¶

func (m *UserSecurityLogMutation) ResetRequestID()

ResetRequestID resets all changes to the "request_id" field.

func (*UserSecurityLogMutation) ResetSecurityLogsOwner ¶

func (m *UserSecurityLogMutation) ResetSecurityLogsOwner()

ResetSecurityLogsOwner resets all changes to the "security_logs_owner" edge.

func (*UserSecurityLogMutation) ResetServerVersion ¶

func (m *UserSecurityLogMutation) ResetServerVersion()

ResetServerVersion resets all changes to the "server_version" field.

func (*UserSecurityLogMutation) SecurityLogsOwnerCleared ¶

func (m *UserSecurityLogMutation) SecurityLogsOwnerCleared() bool

SecurityLogsOwnerCleared reports if the "security_logs_owner" edge to the User entity was cleared.

func (*UserSecurityLogMutation) SecurityLogsOwnerID ¶

func (m *UserSecurityLogMutation) SecurityLogsOwnerID() (id int, exists bool)

SecurityLogsOwnerID returns the "security_logs_owner" edge ID in the mutation.

func (*UserSecurityLogMutation) SecurityLogsOwnerIDs ¶

func (m *UserSecurityLogMutation) SecurityLogsOwnerIDs() (ids []int)

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

func (*UserSecurityLogMutation) ServerVersion ¶

func (m *UserSecurityLogMutation) ServerVersion() (r string, exists bool)

ServerVersion returns the value of the "server_version" field in the mutation.

func (*UserSecurityLogMutation) ServerVersionCleared ¶

func (m *UserSecurityLogMutation) ServerVersionCleared() bool

ServerVersionCleared returns if the "server_version" field was cleared in this mutation.

func (*UserSecurityLogMutation) SetAction ¶

SetAction sets the "action" field.

func (*UserSecurityLogMutation) SetCreateTime ¶

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

SetCreateTime sets the "create_time" field.

func (*UserSecurityLogMutation) SetDescription ¶

func (m *UserSecurityLogMutation) SetDescription(s string)

SetDescription sets the "description" field.

func (*UserSecurityLogMutation) SetField ¶

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

func (m *UserSecurityLogMutation) SetID(id int)

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

func (*UserSecurityLogMutation) SetIP ¶

func (m *UserSecurityLogMutation) SetIP(s string)

SetIP sets the "ip" field.

func (*UserSecurityLogMutation) SetOwnerID ¶

func (m *UserSecurityLogMutation) SetOwnerID(i int)

SetOwnerID sets the "owner_id" field.

func (*UserSecurityLogMutation) SetRemark ¶

func (m *UserSecurityLogMutation) SetRemark(s string)

SetRemark sets the "remark" field.

func (*UserSecurityLogMutation) SetRequestID ¶

func (m *UserSecurityLogMutation) SetRequestID(s string)

SetRequestID sets the "request_id" field.

func (*UserSecurityLogMutation) SetSecurityLogsOwnerID ¶

func (m *UserSecurityLogMutation) SetSecurityLogsOwnerID(id int)

SetSecurityLogsOwnerID sets the "security_logs_owner" edge to the User entity by id.

func (*UserSecurityLogMutation) SetServerVersion ¶

func (m *UserSecurityLogMutation) SetServerVersion(s string)

SetServerVersion sets the "server_version" field.

func (UserSecurityLogMutation) Tx ¶

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

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

func (*UserSecurityLogMutation) Type ¶

func (m *UserSecurityLogMutation) Type() string

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

func (*UserSecurityLogMutation) Where ¶ added in v1.0.2

Where appends a list predicates to the UserSecurityLogMutation builder.

type UserSecurityLogQuery ¶

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

UserSecurityLogQuery is the builder for querying UserSecurityLog entities.

func (*UserSecurityLogQuery) All ¶

All executes the query and returns a list of UserSecurityLogs.

func (*UserSecurityLogQuery) AllX ¶

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

func (*UserSecurityLogQuery) Clone ¶

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

func (*UserSecurityLogQuery) Count ¶

func (uslq *UserSecurityLogQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*UserSecurityLogQuery) CountX ¶

func (uslq *UserSecurityLogQuery) CountX(ctx context.Context) int

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

func (*UserSecurityLogQuery) Exist ¶

func (uslq *UserSecurityLogQuery) Exist(ctx context.Context) (bool, error)

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

func (*UserSecurityLogQuery) ExistX ¶

func (uslq *UserSecurityLogQuery) ExistX(ctx context.Context) bool

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

func (*UserSecurityLogQuery) First ¶

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

func (*UserSecurityLogQuery) FirstID ¶

func (uslq *UserSecurityLogQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*UserSecurityLogQuery) FirstIDX ¶

func (uslq *UserSecurityLogQuery) FirstIDX(ctx context.Context) int

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

func (*UserSecurityLogQuery) FirstX ¶

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

func (*UserSecurityLogQuery) GroupBy ¶

func (uslq *UserSecurityLogQuery) GroupBy(field string, fields ...string) *UserSecurityLogGroupBy

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

client.UserSecurityLog.Query().
	GroupBy(usersecuritylog.FieldOwnerID).
	Aggregate(model.Count()).
	Scan(ctx, &v)

func (*UserSecurityLogQuery) IDs ¶

func (uslq *UserSecurityLogQuery) IDs(ctx context.Context) ([]int, error)

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

func (*UserSecurityLogQuery) IDsX ¶

func (uslq *UserSecurityLogQuery) IDsX(ctx context.Context) []int

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

func (*UserSecurityLogQuery) Limit ¶

func (uslq *UserSecurityLogQuery) Limit(limit int) *UserSecurityLogQuery

Limit adds a limit step to the query.

func (*UserSecurityLogQuery) Offset ¶

func (uslq *UserSecurityLogQuery) Offset(offset int) *UserSecurityLogQuery

Offset adds an offset step to the query.

func (*UserSecurityLogQuery) Only ¶

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

func (*UserSecurityLogQuery) OnlyID ¶

func (uslq *UserSecurityLogQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*UserSecurityLogQuery) OnlyIDX ¶

func (uslq *UserSecurityLogQuery) OnlyIDX(ctx context.Context) int

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

func (*UserSecurityLogQuery) OnlyX ¶

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

func (*UserSecurityLogQuery) Order ¶

Order adds an order step to the query.

func (*UserSecurityLogQuery) QuerySecurityLogsOwner ¶

func (uslq *UserSecurityLogQuery) QuerySecurityLogsOwner() *UserQuery

QuerySecurityLogsOwner chains the current query on the "security_logs_owner" edge.

func (*UserSecurityLogQuery) Select ¶

func (uslq *UserSecurityLogQuery) Select(fields ...string) *UserSecurityLogSelect

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 {
	OwnerID int `json:"-"`
}

client.UserSecurityLog.Query().
	Select(usersecuritylog.FieldOwnerID).
	Scan(ctx, &v)

func (*UserSecurityLogQuery) Unique ¶

func (uslq *UserSecurityLogQuery) Unique(unique bool) *UserSecurityLogQuery

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

func (*UserSecurityLogQuery) Where ¶

Where adds a new predicate for the UserSecurityLogQuery builder.

func (*UserSecurityLogQuery) WithSecurityLogsOwner ¶

func (uslq *UserSecurityLogQuery) WithSecurityLogsOwner(opts ...func(*UserQuery)) *UserSecurityLogQuery

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

type UserSecurityLogSelect ¶

type UserSecurityLogSelect struct {
	*UserSecurityLogQuery
	// contains filtered or unexported fields
}

UserSecurityLogSelect is the builder for selecting fields of UserSecurityLog entities.

func (*UserSecurityLogSelect) Bool ¶

func (usls *UserSecurityLogSelect) Bool(ctx context.Context) (_ bool, err error)

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

func (*UserSecurityLogSelect) BoolX ¶

func (usls *UserSecurityLogSelect) BoolX(ctx context.Context) bool

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

func (*UserSecurityLogSelect) Bools ¶

func (usls *UserSecurityLogSelect) Bools(ctx context.Context) ([]bool, error)

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

func (*UserSecurityLogSelect) BoolsX ¶

func (usls *UserSecurityLogSelect) BoolsX(ctx context.Context) []bool

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

func (*UserSecurityLogSelect) Float64 ¶

func (usls *UserSecurityLogSelect) Float64(ctx context.Context) (_ float64, err error)

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

func (*UserSecurityLogSelect) Float64X ¶

func (usls *UserSecurityLogSelect) Float64X(ctx context.Context) float64

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

func (*UserSecurityLogSelect) Float64s ¶

func (usls *UserSecurityLogSelect) Float64s(ctx context.Context) ([]float64, error)

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

func (*UserSecurityLogSelect) Float64sX ¶

func (usls *UserSecurityLogSelect) Float64sX(ctx context.Context) []float64

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

func (*UserSecurityLogSelect) Int ¶

func (usls *UserSecurityLogSelect) Int(ctx context.Context) (_ int, err error)

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

func (*UserSecurityLogSelect) IntX ¶

func (usls *UserSecurityLogSelect) IntX(ctx context.Context) int

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

func (*UserSecurityLogSelect) Ints ¶

func (usls *UserSecurityLogSelect) Ints(ctx context.Context) ([]int, error)

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

func (*UserSecurityLogSelect) IntsX ¶

func (usls *UserSecurityLogSelect) IntsX(ctx context.Context) []int

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

func (*UserSecurityLogSelect) Scan ¶

func (usls *UserSecurityLogSelect) Scan(ctx context.Context, v interface{}) error

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

func (*UserSecurityLogSelect) ScanX ¶

func (usls *UserSecurityLogSelect) ScanX(ctx context.Context, v interface{})

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

func (*UserSecurityLogSelect) String ¶

func (usls *UserSecurityLogSelect) String(ctx context.Context) (_ string, err error)

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

func (*UserSecurityLogSelect) StringX ¶

func (usls *UserSecurityLogSelect) StringX(ctx context.Context) string

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

func (*UserSecurityLogSelect) Strings ¶

func (usls *UserSecurityLogSelect) Strings(ctx context.Context) ([]string, error)

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

func (*UserSecurityLogSelect) StringsX ¶

func (usls *UserSecurityLogSelect) StringsX(ctx context.Context) []string

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

type UserSecurityLogUpdate ¶

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

UserSecurityLogUpdate is the builder for updating UserSecurityLog entities.

func (*UserSecurityLogUpdate) ClearDescription ¶

func (uslu *UserSecurityLogUpdate) ClearDescription() *UserSecurityLogUpdate

ClearDescription clears the value of the "description" field.

func (*UserSecurityLogUpdate) ClearIP ¶

ClearIP clears the value of the "ip" field.

func (*UserSecurityLogUpdate) ClearRemark ¶

func (uslu *UserSecurityLogUpdate) ClearRemark() *UserSecurityLogUpdate

ClearRemark clears the value of the "remark" field.

func (*UserSecurityLogUpdate) ClearRequestID ¶

func (uslu *UserSecurityLogUpdate) ClearRequestID() *UserSecurityLogUpdate

ClearRequestID clears the value of the "request_id" field.

func (*UserSecurityLogUpdate) ClearSecurityLogsOwner ¶

func (uslu *UserSecurityLogUpdate) ClearSecurityLogsOwner() *UserSecurityLogUpdate

ClearSecurityLogsOwner clears the "security_logs_owner" edge to the User entity.

func (*UserSecurityLogUpdate) ClearServerVersion ¶

func (uslu *UserSecurityLogUpdate) ClearServerVersion() *UserSecurityLogUpdate

ClearServerVersion clears the value of the "server_version" field.

func (*UserSecurityLogUpdate) Exec ¶

func (uslu *UserSecurityLogUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*UserSecurityLogUpdate) ExecX ¶

func (uslu *UserSecurityLogUpdate) ExecX(ctx context.Context)

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

func (*UserSecurityLogUpdate) Mutation ¶

Mutation returns the UserSecurityLogMutation object of the builder.

func (*UserSecurityLogUpdate) Save ¶

func (uslu *UserSecurityLogUpdate) Save(ctx context.Context) (int, error)

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

func (*UserSecurityLogUpdate) SaveX ¶

func (uslu *UserSecurityLogUpdate) SaveX(ctx context.Context) int

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

func (*UserSecurityLogUpdate) SetAction ¶

SetAction sets the "action" field.

func (*UserSecurityLogUpdate) SetDescription ¶

func (uslu *UserSecurityLogUpdate) SetDescription(s string) *UserSecurityLogUpdate

SetDescription sets the "description" field.

func (*UserSecurityLogUpdate) SetIP ¶

SetIP sets the "ip" field.

func (*UserSecurityLogUpdate) SetNillableAction ¶

SetNillableAction sets the "action" field if the given value is not nil.

func (*UserSecurityLogUpdate) SetNillableDescription ¶

func (uslu *UserSecurityLogUpdate) SetNillableDescription(s *string) *UserSecurityLogUpdate

SetNillableDescription sets the "description" field if the given value is not nil.

func (*UserSecurityLogUpdate) SetNillableIP ¶

func (uslu *UserSecurityLogUpdate) SetNillableIP(s *string) *UserSecurityLogUpdate

SetNillableIP sets the "ip" field if the given value is not nil.

func (*UserSecurityLogUpdate) SetNillableRemark ¶

func (uslu *UserSecurityLogUpdate) SetNillableRemark(s *string) *UserSecurityLogUpdate

SetNillableRemark sets the "remark" field if the given value is not nil.

func (*UserSecurityLogUpdate) SetNillableRequestID ¶

func (uslu *UserSecurityLogUpdate) SetNillableRequestID(s *string) *UserSecurityLogUpdate

SetNillableRequestID sets the "request_id" field if the given value is not nil.

func (*UserSecurityLogUpdate) SetNillableServerVersion ¶

func (uslu *UserSecurityLogUpdate) SetNillableServerVersion(s *string) *UserSecurityLogUpdate

SetNillableServerVersion sets the "server_version" field if the given value is not nil.

func (*UserSecurityLogUpdate) SetOwnerID ¶

func (uslu *UserSecurityLogUpdate) SetOwnerID(i int) *UserSecurityLogUpdate

SetOwnerID sets the "owner_id" field.

func (*UserSecurityLogUpdate) SetRemark ¶

SetRemark sets the "remark" field.

func (*UserSecurityLogUpdate) SetRequestID ¶

func (uslu *UserSecurityLogUpdate) SetRequestID(s string) *UserSecurityLogUpdate

SetRequestID sets the "request_id" field.

func (*UserSecurityLogUpdate) SetSecurityLogsOwner ¶

func (uslu *UserSecurityLogUpdate) SetSecurityLogsOwner(u *User) *UserSecurityLogUpdate

SetSecurityLogsOwner sets the "security_logs_owner" edge to the User entity.

func (*UserSecurityLogUpdate) SetSecurityLogsOwnerID ¶

func (uslu *UserSecurityLogUpdate) SetSecurityLogsOwnerID(id int) *UserSecurityLogUpdate

SetSecurityLogsOwnerID sets the "security_logs_owner" edge to the User entity by ID.

func (*UserSecurityLogUpdate) SetServerVersion ¶

func (uslu *UserSecurityLogUpdate) SetServerVersion(s string) *UserSecurityLogUpdate

SetServerVersion sets the "server_version" field.

func (*UserSecurityLogUpdate) Where ¶

Where appends a list predicates to the UserSecurityLogUpdate builder.

type UserSecurityLogUpdateOne ¶

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

UserSecurityLogUpdateOne is the builder for updating a single UserSecurityLog entity.

func (*UserSecurityLogUpdateOne) ClearDescription ¶

func (usluo *UserSecurityLogUpdateOne) ClearDescription() *UserSecurityLogUpdateOne

ClearDescription clears the value of the "description" field.

func (*UserSecurityLogUpdateOne) ClearIP ¶

ClearIP clears the value of the "ip" field.

func (*UserSecurityLogUpdateOne) ClearRemark ¶

func (usluo *UserSecurityLogUpdateOne) ClearRemark() *UserSecurityLogUpdateOne

ClearRemark clears the value of the "remark" field.

func (*UserSecurityLogUpdateOne) ClearRequestID ¶

func (usluo *UserSecurityLogUpdateOne) ClearRequestID() *UserSecurityLogUpdateOne

ClearRequestID clears the value of the "request_id" field.

func (*UserSecurityLogUpdateOne) ClearSecurityLogsOwner ¶

func (usluo *UserSecurityLogUpdateOne) ClearSecurityLogsOwner() *UserSecurityLogUpdateOne

ClearSecurityLogsOwner clears the "security_logs_owner" edge to the User entity.

func (*UserSecurityLogUpdateOne) ClearServerVersion ¶

func (usluo *UserSecurityLogUpdateOne) ClearServerVersion() *UserSecurityLogUpdateOne

ClearServerVersion clears the value of the "server_version" field.

func (*UserSecurityLogUpdateOne) Exec ¶

func (usluo *UserSecurityLogUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*UserSecurityLogUpdateOne) ExecX ¶

func (usluo *UserSecurityLogUpdateOne) ExecX(ctx context.Context)

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

func (*UserSecurityLogUpdateOne) Mutation ¶

Mutation returns the UserSecurityLogMutation object of the builder.

func (*UserSecurityLogUpdateOne) Save ¶

Save executes the query and returns the updated UserSecurityLog entity.

func (*UserSecurityLogUpdateOne) SaveX ¶

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

func (*UserSecurityLogUpdateOne) Select ¶

func (usluo *UserSecurityLogUpdateOne) Select(field string, fields ...string) *UserSecurityLogUpdateOne

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

func (*UserSecurityLogUpdateOne) SetAction ¶

SetAction sets the "action" field.

func (*UserSecurityLogUpdateOne) SetDescription ¶

func (usluo *UserSecurityLogUpdateOne) SetDescription(s string) *UserSecurityLogUpdateOne

SetDescription sets the "description" field.

func (*UserSecurityLogUpdateOne) SetIP ¶

SetIP sets the "ip" field.

func (*UserSecurityLogUpdateOne) SetNillableAction ¶

SetNillableAction sets the "action" field if the given value is not nil.

func (*UserSecurityLogUpdateOne) SetNillableDescription ¶

func (usluo *UserSecurityLogUpdateOne) SetNillableDescription(s *string) *UserSecurityLogUpdateOne

SetNillableDescription sets the "description" field if the given value is not nil.

func (*UserSecurityLogUpdateOne) SetNillableIP ¶

func (usluo *UserSecurityLogUpdateOne) SetNillableIP(s *string) *UserSecurityLogUpdateOne

SetNillableIP sets the "ip" field if the given value is not nil.

func (*UserSecurityLogUpdateOne) SetNillableRemark ¶

func (usluo *UserSecurityLogUpdateOne) SetNillableRemark(s *string) *UserSecurityLogUpdateOne

SetNillableRemark sets the "remark" field if the given value is not nil.

func (*UserSecurityLogUpdateOne) SetNillableRequestID ¶

func (usluo *UserSecurityLogUpdateOne) SetNillableRequestID(s *string) *UserSecurityLogUpdateOne

SetNillableRequestID sets the "request_id" field if the given value is not nil.

func (*UserSecurityLogUpdateOne) SetNillableServerVersion ¶

func (usluo *UserSecurityLogUpdateOne) SetNillableServerVersion(s *string) *UserSecurityLogUpdateOne

SetNillableServerVersion sets the "server_version" field if the given value is not nil.

func (*UserSecurityLogUpdateOne) SetOwnerID ¶

SetOwnerID sets the "owner_id" field.

func (*UserSecurityLogUpdateOne) SetRemark ¶

SetRemark sets the "remark" field.

func (*UserSecurityLogUpdateOne) SetRequestID ¶

SetRequestID sets the "request_id" field.

func (*UserSecurityLogUpdateOne) SetSecurityLogsOwner ¶

func (usluo *UserSecurityLogUpdateOne) SetSecurityLogsOwner(u *User) *UserSecurityLogUpdateOne

SetSecurityLogsOwner sets the "security_logs_owner" edge to the User entity.

func (*UserSecurityLogUpdateOne) SetSecurityLogsOwnerID ¶

func (usluo *UserSecurityLogUpdateOne) SetSecurityLogsOwnerID(id int) *UserSecurityLogUpdateOne

SetSecurityLogsOwnerID sets the "security_logs_owner" edge to the User entity by ID.

func (*UserSecurityLogUpdateOne) SetServerVersion ¶

func (usluo *UserSecurityLogUpdateOne) SetServerVersion(s string) *UserSecurityLogUpdateOne

SetServerVersion sets the "server_version" field.

type UserSecurityLogs ¶

type UserSecurityLogs []*UserSecurityLog

UserSecurityLogs is a parsable slice of UserSecurityLog.

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 UserSetting ¶

type UserSetting struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// OwnerID holds the value of the "owner_id" field.
	OwnerID int `json:"-"`
	// Key holds the value of the "key" field.
	Key string `json:"key,omitempty"`
	// Value holds the value of the "value" field.
	Value string `json:"value,omitempty"`
	// Typeof holds the value of the "typeof" field.
	Typeof usersetting.Typeof `json:"typeof,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the UserSettingQuery when eager-loading is set.
	Edges UserSettingEdges `json:"edges"`
	// contains filtered or unexported fields
}

UserSetting is the model entity for the UserSetting schema.

func (*UserSetting) QuerySettingsOwner ¶

func (us *UserSetting) QuerySettingsOwner() *UserQuery

QuerySettingsOwner queries the "settings_owner" edge of the UserSetting entity.

func (*UserSetting) String ¶

func (us *UserSetting) String() string

String implements the fmt.Stringer.

func (*UserSetting) Unwrap ¶

func (us *UserSetting) Unwrap() *UserSetting

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

func (us *UserSetting) Update() *UserSettingUpdateOne

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

type UserSettingClient ¶

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

UserSettingClient is a client for the UserSetting schema.

func NewUserSettingClient ¶

func NewUserSettingClient(c config) *UserSettingClient

NewUserSettingClient returns a client for the UserSetting from the given config.

func (*UserSettingClient) Create ¶

func (c *UserSettingClient) Create() *UserSettingCreate

Create returns a create builder for UserSetting.

func (*UserSettingClient) CreateBulk ¶

func (c *UserSettingClient) CreateBulk(builders ...*UserSettingCreate) *UserSettingCreateBulk

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

func (*UserSettingClient) Delete ¶

func (c *UserSettingClient) Delete() *UserSettingDelete

Delete returns a delete builder for UserSetting.

func (*UserSettingClient) DeleteOne ¶

DeleteOne returns a delete builder for the given entity.

func (*UserSettingClient) DeleteOneID ¶

func (c *UserSettingClient) DeleteOneID(id int) *UserSettingDeleteOne

DeleteOneID returns a delete builder for the given id.

func (*UserSettingClient) Get ¶

func (c *UserSettingClient) Get(ctx context.Context, id int) (*UserSetting, error)

Get returns a UserSetting entity by its id.

func (*UserSettingClient) GetX ¶

func (c *UserSettingClient) GetX(ctx context.Context, id int) *UserSetting

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

func (*UserSettingClient) Hooks ¶

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

Hooks returns the client hooks.

func (*UserSettingClient) Query ¶

func (c *UserSettingClient) Query() *UserSettingQuery

Query returns a query builder for UserSetting.

func (*UserSettingClient) QuerySettingsOwner ¶

func (c *UserSettingClient) QuerySettingsOwner(us *UserSetting) *UserQuery

QuerySettingsOwner queries the settings_owner edge of a UserSetting.

func (*UserSettingClient) Update ¶

func (c *UserSettingClient) Update() *UserSettingUpdate

Update returns an update builder for UserSetting.

func (*UserSettingClient) UpdateOne ¶

UpdateOne returns an update builder for the given entity.

func (*UserSettingClient) UpdateOneID ¶

func (c *UserSettingClient) UpdateOneID(id int) *UserSettingUpdateOne

UpdateOneID returns an update builder for the given id.

func (*UserSettingClient) Use ¶

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

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

type UserSettingCreate ¶

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

UserSettingCreate is the builder for creating a UserSetting entity.

func (*UserSettingCreate) Exec ¶ added in v1.0.2

func (usc *UserSettingCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*UserSettingCreate) ExecX ¶ added in v1.0.2

func (usc *UserSettingCreate) ExecX(ctx context.Context)

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

func (*UserSettingCreate) Mutation ¶

func (usc *UserSettingCreate) Mutation() *UserSettingMutation

Mutation returns the UserSettingMutation object of the builder.

func (*UserSettingCreate) Save ¶

func (usc *UserSettingCreate) Save(ctx context.Context) (*UserSetting, error)

Save creates the UserSetting in the database.

func (*UserSettingCreate) SaveX ¶

func (usc *UserSettingCreate) SaveX(ctx context.Context) *UserSetting

SaveX calls Save and panics if Save returns an error.

func (*UserSettingCreate) SetID ¶

func (usc *UserSettingCreate) SetID(i int) *UserSettingCreate

SetID sets the "id" field.

func (*UserSettingCreate) SetKey ¶

func (usc *UserSettingCreate) SetKey(s string) *UserSettingCreate

SetKey sets the "key" field.

func (*UserSettingCreate) SetNillableTypeof ¶

func (usc *UserSettingCreate) SetNillableTypeof(u *usersetting.Typeof) *UserSettingCreate

SetNillableTypeof sets the "typeof" field if the given value is not nil.

func (*UserSettingCreate) SetOwnerID ¶

func (usc *UserSettingCreate) SetOwnerID(i int) *UserSettingCreate

SetOwnerID sets the "owner_id" field.

func (*UserSettingCreate) SetSettingsOwner ¶

func (usc *UserSettingCreate) SetSettingsOwner(u *User) *UserSettingCreate

SetSettingsOwner sets the "settings_owner" edge to the User entity.

func (*UserSettingCreate) SetSettingsOwnerID ¶

func (usc *UserSettingCreate) SetSettingsOwnerID(id int) *UserSettingCreate

SetSettingsOwnerID sets the "settings_owner" edge to the User entity by ID.

func (*UserSettingCreate) SetTypeof ¶

SetTypeof sets the "typeof" field.

func (*UserSettingCreate) SetValue ¶

func (usc *UserSettingCreate) SetValue(s string) *UserSettingCreate

SetValue sets the "value" field.

type UserSettingCreateBulk ¶

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

UserSettingCreateBulk is the builder for creating many UserSetting entities in bulk.

func (*UserSettingCreateBulk) Exec ¶ added in v1.0.2

func (uscb *UserSettingCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*UserSettingCreateBulk) ExecX ¶ added in v1.0.2

func (uscb *UserSettingCreateBulk) ExecX(ctx context.Context)

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

func (*UserSettingCreateBulk) Save ¶

func (uscb *UserSettingCreateBulk) Save(ctx context.Context) ([]*UserSetting, error)

Save creates the UserSetting entities in the database.

func (*UserSettingCreateBulk) SaveX ¶

func (uscb *UserSettingCreateBulk) SaveX(ctx context.Context) []*UserSetting

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

type UserSettingDelete ¶

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

UserSettingDelete is the builder for deleting a UserSetting entity.

func (*UserSettingDelete) Exec ¶

func (usd *UserSettingDelete) Exec(ctx context.Context) (int, error)

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

func (*UserSettingDelete) ExecX ¶

func (usd *UserSettingDelete) ExecX(ctx context.Context) int

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

func (*UserSettingDelete) Where ¶

Where appends a list predicates to the UserSettingDelete builder.

type UserSettingDeleteOne ¶

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

UserSettingDeleteOne is the builder for deleting a single UserSetting entity.

func (*UserSettingDeleteOne) Exec ¶

func (usdo *UserSettingDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*UserSettingDeleteOne) ExecX ¶

func (usdo *UserSettingDeleteOne) ExecX(ctx context.Context)

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

type UserSettingEdges ¶

type UserSettingEdges struct {
	// SettingsOwner holds the value of the settings_owner edge.
	SettingsOwner *User `json:"owner,omitempty"`
	// contains filtered or unexported fields
}

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

func (UserSettingEdges) SettingsOwnerOrErr ¶

func (e UserSettingEdges) SettingsOwnerOrErr() (*User, error)

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

type UserSettingGroupBy ¶

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

UserSettingGroupBy is the group-by builder for UserSetting entities.

func (*UserSettingGroupBy) Aggregate ¶

func (usgb *UserSettingGroupBy) Aggregate(fns ...AggregateFunc) *UserSettingGroupBy

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

func (*UserSettingGroupBy) Bool ¶

func (usgb *UserSettingGroupBy) 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 (*UserSettingGroupBy) BoolX ¶

func (usgb *UserSettingGroupBy) BoolX(ctx context.Context) bool

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

func (*UserSettingGroupBy) Bools ¶

func (usgb *UserSettingGroupBy) 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 (*UserSettingGroupBy) BoolsX ¶

func (usgb *UserSettingGroupBy) BoolsX(ctx context.Context) []bool

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

func (*UserSettingGroupBy) Float64 ¶

func (usgb *UserSettingGroupBy) 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 (*UserSettingGroupBy) Float64X ¶

func (usgb *UserSettingGroupBy) Float64X(ctx context.Context) float64

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

func (*UserSettingGroupBy) Float64s ¶

func (usgb *UserSettingGroupBy) 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 (*UserSettingGroupBy) Float64sX ¶

func (usgb *UserSettingGroupBy) Float64sX(ctx context.Context) []float64

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

func (*UserSettingGroupBy) Int ¶

func (usgb *UserSettingGroupBy) 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 (*UserSettingGroupBy) IntX ¶

func (usgb *UserSettingGroupBy) IntX(ctx context.Context) int

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

func (*UserSettingGroupBy) Ints ¶

func (usgb *UserSettingGroupBy) 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 (*UserSettingGroupBy) IntsX ¶

func (usgb *UserSettingGroupBy) IntsX(ctx context.Context) []int

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

func (*UserSettingGroupBy) Scan ¶

func (usgb *UserSettingGroupBy) Scan(ctx context.Context, v interface{}) error

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

func (*UserSettingGroupBy) ScanX ¶

func (usgb *UserSettingGroupBy) ScanX(ctx context.Context, v interface{})

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

func (*UserSettingGroupBy) String ¶

func (usgb *UserSettingGroupBy) 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 (*UserSettingGroupBy) StringX ¶

func (usgb *UserSettingGroupBy) StringX(ctx context.Context) string

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

func (*UserSettingGroupBy) Strings ¶

func (usgb *UserSettingGroupBy) 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 (*UserSettingGroupBy) StringsX ¶

func (usgb *UserSettingGroupBy) StringsX(ctx context.Context) []string

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

type UserSettingMutation ¶

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

UserSettingMutation represents an operation that mutates the UserSetting nodes in the graph.

func (*UserSettingMutation) AddField ¶

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

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

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

func (*UserSettingMutation) AddedField ¶

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

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

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

func (*UserSettingMutation) AddedIDs ¶

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

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

func (*UserSettingMutation) ClearEdge ¶

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

func (m *UserSettingMutation) 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 (*UserSettingMutation) ClearSettingsOwner ¶

func (m *UserSettingMutation) ClearSettingsOwner()

ClearSettingsOwner clears the "settings_owner" edge to the User entity.

func (*UserSettingMutation) ClearedEdges ¶

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

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

func (*UserSettingMutation) ClearedFields ¶

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

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

func (UserSettingMutation) Client ¶

func (m UserSettingMutation) 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 (*UserSettingMutation) EdgeCleared ¶

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

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

func (*UserSettingMutation) Field ¶

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

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

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

func (*UserSettingMutation) Fields ¶

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

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

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

func (*UserSettingMutation) Key ¶

func (m *UserSettingMutation) Key() (r string, exists bool)

Key returns the value of the "key" field in the mutation.

func (*UserSettingMutation) OldField ¶

func (m *UserSettingMutation) 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 (*UserSettingMutation) OldKey ¶

func (m *UserSettingMutation) OldKey(ctx context.Context) (v string, err error)

OldKey returns the old "key" field's value of the UserSetting entity. If the UserSetting 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 (*UserSettingMutation) OldOwnerID ¶

func (m *UserSettingMutation) OldOwnerID(ctx context.Context) (v int, err error)

OldOwnerID returns the old "owner_id" field's value of the UserSetting entity. If the UserSetting 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 (*UserSettingMutation) OldTypeof ¶

func (m *UserSettingMutation) OldTypeof(ctx context.Context) (v usersetting.Typeof, err error)

OldTypeof returns the old "typeof" field's value of the UserSetting entity. If the UserSetting 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 (*UserSettingMutation) OldValue ¶

func (m *UserSettingMutation) OldValue(ctx context.Context) (v string, err error)

OldValue returns the old "value" field's value of the UserSetting entity. If the UserSetting 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 (*UserSettingMutation) Op ¶

func (m *UserSettingMutation) Op() Op

Op returns the operation name.

func (*UserSettingMutation) OwnerID ¶

func (m *UserSettingMutation) OwnerID() (r int, exists bool)

OwnerID returns the value of the "owner_id" field in the mutation.

func (*UserSettingMutation) RemovedEdges ¶

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

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

func (*UserSettingMutation) RemovedIDs ¶

func (m *UserSettingMutation) 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 (*UserSettingMutation) ResetEdge ¶

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

func (m *UserSettingMutation) 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 (*UserSettingMutation) ResetKey ¶

func (m *UserSettingMutation) ResetKey()

ResetKey resets all changes to the "key" field.

func (*UserSettingMutation) ResetOwnerID ¶

func (m *UserSettingMutation) ResetOwnerID()

ResetOwnerID resets all changes to the "owner_id" field.

func (*UserSettingMutation) ResetSettingsOwner ¶

func (m *UserSettingMutation) ResetSettingsOwner()

ResetSettingsOwner resets all changes to the "settings_owner" edge.

func (*UserSettingMutation) ResetTypeof ¶

func (m *UserSettingMutation) ResetTypeof()

ResetTypeof resets all changes to the "typeof" field.

func (*UserSettingMutation) ResetValue ¶

func (m *UserSettingMutation) ResetValue()

ResetValue resets all changes to the "value" field.

func (*UserSettingMutation) SetField ¶

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

func (m *UserSettingMutation) SetID(id int)

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

func (*UserSettingMutation) SetKey ¶

func (m *UserSettingMutation) SetKey(s string)

SetKey sets the "key" field.

func (*UserSettingMutation) SetOwnerID ¶

func (m *UserSettingMutation) SetOwnerID(i int)

SetOwnerID sets the "owner_id" field.

func (*UserSettingMutation) SetSettingsOwnerID ¶

func (m *UserSettingMutation) SetSettingsOwnerID(id int)

SetSettingsOwnerID sets the "settings_owner" edge to the User entity by id.

func (*UserSettingMutation) SetTypeof ¶

func (m *UserSettingMutation) SetTypeof(u usersetting.Typeof)

SetTypeof sets the "typeof" field.

func (*UserSettingMutation) SetValue ¶

func (m *UserSettingMutation) SetValue(s string)

SetValue sets the "value" field.

func (*UserSettingMutation) SettingsOwnerCleared ¶

func (m *UserSettingMutation) SettingsOwnerCleared() bool

SettingsOwnerCleared reports if the "settings_owner" edge to the User entity was cleared.

func (*UserSettingMutation) SettingsOwnerID ¶

func (m *UserSettingMutation) SettingsOwnerID() (id int, exists bool)

SettingsOwnerID returns the "settings_owner" edge ID in the mutation.

func (*UserSettingMutation) SettingsOwnerIDs ¶

func (m *UserSettingMutation) SettingsOwnerIDs() (ids []int)

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

func (UserSettingMutation) Tx ¶

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

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

func (*UserSettingMutation) Type ¶

func (m *UserSettingMutation) Type() string

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

func (*UserSettingMutation) Typeof ¶

func (m *UserSettingMutation) Typeof() (r usersetting.Typeof, exists bool)

Typeof returns the value of the "typeof" field in the mutation.

func (*UserSettingMutation) Value ¶

func (m *UserSettingMutation) Value() (r string, exists bool)

Value returns the value of the "value" field in the mutation.

func (*UserSettingMutation) Where ¶ added in v1.0.2

func (m *UserSettingMutation) Where(ps ...predicate.UserSetting)

Where appends a list predicates to the UserSettingMutation builder.

type UserSettingQuery ¶

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

UserSettingQuery is the builder for querying UserSetting entities.

func (*UserSettingQuery) All ¶

func (usq *UserSettingQuery) All(ctx context.Context) ([]*UserSetting, error)

All executes the query and returns a list of UserSettings.

func (*UserSettingQuery) AllX ¶

func (usq *UserSettingQuery) AllX(ctx context.Context) []*UserSetting

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

func (*UserSettingQuery) Clone ¶

func (usq *UserSettingQuery) Clone() *UserSettingQuery

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

func (*UserSettingQuery) Count ¶

func (usq *UserSettingQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*UserSettingQuery) CountX ¶

func (usq *UserSettingQuery) CountX(ctx context.Context) int

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

func (*UserSettingQuery) Exist ¶

func (usq *UserSettingQuery) Exist(ctx context.Context) (bool, error)

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

func (*UserSettingQuery) ExistX ¶

func (usq *UserSettingQuery) ExistX(ctx context.Context) bool

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

func (*UserSettingQuery) First ¶

func (usq *UserSettingQuery) First(ctx context.Context) (*UserSetting, error)

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

func (*UserSettingQuery) FirstID ¶

func (usq *UserSettingQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*UserSettingQuery) FirstIDX ¶

func (usq *UserSettingQuery) FirstIDX(ctx context.Context) int

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

func (*UserSettingQuery) FirstX ¶

func (usq *UserSettingQuery) FirstX(ctx context.Context) *UserSetting

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

func (*UserSettingQuery) GroupBy ¶

func (usq *UserSettingQuery) GroupBy(field string, fields ...string) *UserSettingGroupBy

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

client.UserSetting.Query().
	GroupBy(usersetting.FieldOwnerID).
	Aggregate(model.Count()).
	Scan(ctx, &v)

func (*UserSettingQuery) IDs ¶

func (usq *UserSettingQuery) IDs(ctx context.Context) ([]int, error)

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

func (*UserSettingQuery) IDsX ¶

func (usq *UserSettingQuery) IDsX(ctx context.Context) []int

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

func (*UserSettingQuery) Limit ¶

func (usq *UserSettingQuery) Limit(limit int) *UserSettingQuery

Limit adds a limit step to the query.

func (*UserSettingQuery) Offset ¶

func (usq *UserSettingQuery) Offset(offset int) *UserSettingQuery

Offset adds an offset step to the query.

func (*UserSettingQuery) Only ¶

func (usq *UserSettingQuery) Only(ctx context.Context) (*UserSetting, error)

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

func (*UserSettingQuery) OnlyID ¶

func (usq *UserSettingQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*UserSettingQuery) OnlyIDX ¶

func (usq *UserSettingQuery) OnlyIDX(ctx context.Context) int

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

func (*UserSettingQuery) OnlyX ¶

func (usq *UserSettingQuery) OnlyX(ctx context.Context) *UserSetting

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

func (*UserSettingQuery) Order ¶

func (usq *UserSettingQuery) Order(o ...OrderFunc) *UserSettingQuery

Order adds an order step to the query.

func (*UserSettingQuery) QuerySettingsOwner ¶

func (usq *UserSettingQuery) QuerySettingsOwner() *UserQuery

QuerySettingsOwner chains the current query on the "settings_owner" edge.

func (*UserSettingQuery) Select ¶

func (usq *UserSettingQuery) Select(fields ...string) *UserSettingSelect

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 {
	OwnerID int `json:"-"`
}

client.UserSetting.Query().
	Select(usersetting.FieldOwnerID).
	Scan(ctx, &v)

func (*UserSettingQuery) Unique ¶

func (usq *UserSettingQuery) Unique(unique bool) *UserSettingQuery

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

func (*UserSettingQuery) Where ¶

Where adds a new predicate for the UserSettingQuery builder.

func (*UserSettingQuery) WithSettingsOwner ¶

func (usq *UserSettingQuery) WithSettingsOwner(opts ...func(*UserQuery)) *UserSettingQuery

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

type UserSettingSelect ¶

type UserSettingSelect struct {
	*UserSettingQuery
	// contains filtered or unexported fields
}

UserSettingSelect is the builder for selecting fields of UserSetting entities.

func (*UserSettingSelect) Bool ¶

func (uss *UserSettingSelect) Bool(ctx context.Context) (_ bool, err error)

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

func (*UserSettingSelect) BoolX ¶

func (uss *UserSettingSelect) BoolX(ctx context.Context) bool

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

func (*UserSettingSelect) Bools ¶

func (uss *UserSettingSelect) Bools(ctx context.Context) ([]bool, error)

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

func (*UserSettingSelect) BoolsX ¶

func (uss *UserSettingSelect) BoolsX(ctx context.Context) []bool

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

func (*UserSettingSelect) Float64 ¶

func (uss *UserSettingSelect) Float64(ctx context.Context) (_ float64, err error)

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

func (*UserSettingSelect) Float64X ¶

func (uss *UserSettingSelect) Float64X(ctx context.Context) float64

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

func (*UserSettingSelect) Float64s ¶

func (uss *UserSettingSelect) Float64s(ctx context.Context) ([]float64, error)

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

func (*UserSettingSelect) Float64sX ¶

func (uss *UserSettingSelect) Float64sX(ctx context.Context) []float64

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

func (*UserSettingSelect) Int ¶

func (uss *UserSettingSelect) Int(ctx context.Context) (_ int, err error)

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

func (*UserSettingSelect) IntX ¶

func (uss *UserSettingSelect) IntX(ctx context.Context) int

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

func (*UserSettingSelect) Ints ¶

func (uss *UserSettingSelect) Ints(ctx context.Context) ([]int, error)

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

func (*UserSettingSelect) IntsX ¶

func (uss *UserSettingSelect) IntsX(ctx context.Context) []int

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

func (*UserSettingSelect) Scan ¶

func (uss *UserSettingSelect) Scan(ctx context.Context, v interface{}) error

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

func (*UserSettingSelect) ScanX ¶

func (uss *UserSettingSelect) ScanX(ctx context.Context, v interface{})

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

func (*UserSettingSelect) String ¶

func (uss *UserSettingSelect) String(ctx context.Context) (_ string, err error)

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

func (*UserSettingSelect) StringX ¶

func (uss *UserSettingSelect) StringX(ctx context.Context) string

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

func (*UserSettingSelect) Strings ¶

func (uss *UserSettingSelect) Strings(ctx context.Context) ([]string, error)

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

func (*UserSettingSelect) StringsX ¶

func (uss *UserSettingSelect) StringsX(ctx context.Context) []string

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

type UserSettingUpdate ¶

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

UserSettingUpdate is the builder for updating UserSetting entities.

func (*UserSettingUpdate) ClearSettingsOwner ¶

func (usu *UserSettingUpdate) ClearSettingsOwner() *UserSettingUpdate

ClearSettingsOwner clears the "settings_owner" edge to the User entity.

func (*UserSettingUpdate) Exec ¶

func (usu *UserSettingUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*UserSettingUpdate) ExecX ¶

func (usu *UserSettingUpdate) ExecX(ctx context.Context)

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

func (*UserSettingUpdate) Mutation ¶

func (usu *UserSettingUpdate) Mutation() *UserSettingMutation

Mutation returns the UserSettingMutation object of the builder.

func (*UserSettingUpdate) Save ¶

func (usu *UserSettingUpdate) Save(ctx context.Context) (int, error)

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

func (*UserSettingUpdate) SaveX ¶

func (usu *UserSettingUpdate) SaveX(ctx context.Context) int

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

func (*UserSettingUpdate) SetKey ¶

func (usu *UserSettingUpdate) SetKey(s string) *UserSettingUpdate

SetKey sets the "key" field.

func (*UserSettingUpdate) SetNillableTypeof ¶

func (usu *UserSettingUpdate) SetNillableTypeof(u *usersetting.Typeof) *UserSettingUpdate

SetNillableTypeof sets the "typeof" field if the given value is not nil.

func (*UserSettingUpdate) SetOwnerID ¶

func (usu *UserSettingUpdate) SetOwnerID(i int) *UserSettingUpdate

SetOwnerID sets the "owner_id" field.

func (*UserSettingUpdate) SetSettingsOwner ¶

func (usu *UserSettingUpdate) SetSettingsOwner(u *User) *UserSettingUpdate

SetSettingsOwner sets the "settings_owner" edge to the User entity.

func (*UserSettingUpdate) SetSettingsOwnerID ¶

func (usu *UserSettingUpdate) SetSettingsOwnerID(id int) *UserSettingUpdate

SetSettingsOwnerID sets the "settings_owner" edge to the User entity by ID.

func (*UserSettingUpdate) SetTypeof ¶

SetTypeof sets the "typeof" field.

func (*UserSettingUpdate) SetValue ¶

func (usu *UserSettingUpdate) SetValue(s string) *UserSettingUpdate

SetValue sets the "value" field.

func (*UserSettingUpdate) Where ¶

Where appends a list predicates to the UserSettingUpdate builder.

type UserSettingUpdateOne ¶

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

UserSettingUpdateOne is the builder for updating a single UserSetting entity.

func (*UserSettingUpdateOne) ClearSettingsOwner ¶

func (usuo *UserSettingUpdateOne) ClearSettingsOwner() *UserSettingUpdateOne

ClearSettingsOwner clears the "settings_owner" edge to the User entity.

func (*UserSettingUpdateOne) Exec ¶

func (usuo *UserSettingUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*UserSettingUpdateOne) ExecX ¶

func (usuo *UserSettingUpdateOne) ExecX(ctx context.Context)

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

func (*UserSettingUpdateOne) Mutation ¶

func (usuo *UserSettingUpdateOne) Mutation() *UserSettingMutation

Mutation returns the UserSettingMutation object of the builder.

func (*UserSettingUpdateOne) Save ¶

Save executes the query and returns the updated UserSetting entity.

func (*UserSettingUpdateOne) SaveX ¶

func (usuo *UserSettingUpdateOne) SaveX(ctx context.Context) *UserSetting

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

func (*UserSettingUpdateOne) Select ¶

func (usuo *UserSettingUpdateOne) Select(field string, fields ...string) *UserSettingUpdateOne

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

func (*UserSettingUpdateOne) SetKey ¶

SetKey sets the "key" field.

func (*UserSettingUpdateOne) SetNillableTypeof ¶

func (usuo *UserSettingUpdateOne) SetNillableTypeof(u *usersetting.Typeof) *UserSettingUpdateOne

SetNillableTypeof sets the "typeof" field if the given value is not nil.

func (*UserSettingUpdateOne) SetOwnerID ¶

func (usuo *UserSettingUpdateOne) SetOwnerID(i int) *UserSettingUpdateOne

SetOwnerID sets the "owner_id" field.

func (*UserSettingUpdateOne) SetSettingsOwner ¶

func (usuo *UserSettingUpdateOne) SetSettingsOwner(u *User) *UserSettingUpdateOne

SetSettingsOwner sets the "settings_owner" edge to the User entity.

func (*UserSettingUpdateOne) SetSettingsOwnerID ¶

func (usuo *UserSettingUpdateOne) SetSettingsOwnerID(id int) *UserSettingUpdateOne

SetSettingsOwnerID sets the "settings_owner" edge to the User entity by ID.

func (*UserSettingUpdateOne) SetTypeof ¶

SetTypeof sets the "typeof" field.

func (*UserSettingUpdateOne) SetValue ¶

SetValue sets the "value" field.

type UserSettings ¶

type UserSettings []*UserSetting

UserSettings is a parsable slice of UserSetting.

type UserUpdate ¶

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

UserUpdate is the builder for updating User entities.

func (*UserUpdate) AddUserEmailIDs ¶

func (uu *UserUpdate) AddUserEmailIDs(ids ...int) *UserUpdate

AddUserEmailIDs adds the "UserEmails" edge to the UserEmail entity by IDs.

func (*UserUpdate) AddUserEmails ¶

func (uu *UserUpdate) AddUserEmails(u ...*UserEmail) *UserUpdate

AddUserEmails adds the "UserEmails" edges to the UserEmail entity.

func (*UserUpdate) AddUserSecurityLogIDs ¶

func (uu *UserUpdate) AddUserSecurityLogIDs(ids ...int) *UserUpdate

AddUserSecurityLogIDs adds the "UserSecurityLogs" edge to the UserSecurityLog entity by IDs.

func (*UserUpdate) AddUserSecurityLogs ¶

func (uu *UserUpdate) AddUserSecurityLogs(u ...*UserSecurityLog) *UserUpdate

AddUserSecurityLogs adds the "UserSecurityLogs" edges to the UserSecurityLog entity.

func (*UserUpdate) AddUserSettingIDs ¶

func (uu *UserUpdate) AddUserSettingIDs(ids ...int) *UserUpdate

AddUserSettingIDs adds the "UserSettings" edge to the UserSetting entity by IDs.

func (*UserUpdate) AddUserSettings ¶

func (uu *UserUpdate) AddUserSettings(u ...*UserSetting) *UserUpdate

AddUserSettings adds the "UserSettings" edges to the UserSetting entity.

func (*UserUpdate) ClearDeleteTime ¶

func (uu *UserUpdate) ClearDeleteTime() *UserUpdate

ClearDeleteTime clears the value of the "delete_time" field.

func (*UserUpdate) ClearLastPwdAuth ¶

func (uu *UserUpdate) ClearLastPwdAuth() *UserUpdate

ClearLastPwdAuth clears the value of the "last_pwd_auth" field.

func (*UserUpdate) ClearPassword ¶

func (uu *UserUpdate) ClearPassword() *UserUpdate

ClearPassword clears the value of the "password" field.

func (*UserUpdate) ClearPhone ¶

func (uu *UserUpdate) ClearPhone() *UserUpdate

ClearPhone clears the value of the "phone" field.

func (*UserUpdate) ClearStatus ¶

func (uu *UserUpdate) ClearStatus() *UserUpdate

ClearStatus clears the value of the "status" field.

func (*UserUpdate) ClearUserEmails ¶

func (uu *UserUpdate) ClearUserEmails() *UserUpdate

ClearUserEmails clears all "UserEmails" edges to the UserEmail entity.

func (*UserUpdate) ClearUserSecurityLogs ¶

func (uu *UserUpdate) ClearUserSecurityLogs() *UserUpdate

ClearUserSecurityLogs clears all "UserSecurityLogs" edges to the UserSecurityLog entity.

func (*UserUpdate) ClearUserSettings ¶

func (uu *UserUpdate) ClearUserSettings() *UserUpdate

ClearUserSettings clears all "UserSettings" edges to the UserSetting 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) RemoveUserEmailIDs ¶

func (uu *UserUpdate) RemoveUserEmailIDs(ids ...int) *UserUpdate

RemoveUserEmailIDs removes the "UserEmails" edge to UserEmail entities by IDs.

func (*UserUpdate) RemoveUserEmails ¶

func (uu *UserUpdate) RemoveUserEmails(u ...*UserEmail) *UserUpdate

RemoveUserEmails removes "UserEmails" edges to UserEmail entities.

func (*UserUpdate) RemoveUserSecurityLogIDs ¶

func (uu *UserUpdate) RemoveUserSecurityLogIDs(ids ...int) *UserUpdate

RemoveUserSecurityLogIDs removes the "UserSecurityLogs" edge to UserSecurityLog entities by IDs.

func (*UserUpdate) RemoveUserSecurityLogs ¶

func (uu *UserUpdate) RemoveUserSecurityLogs(u ...*UserSecurityLog) *UserUpdate

RemoveUserSecurityLogs removes "UserSecurityLogs" edges to UserSecurityLog entities.

func (*UserUpdate) RemoveUserSettingIDs ¶

func (uu *UserUpdate) RemoveUserSettingIDs(ids ...int) *UserUpdate

RemoveUserSettingIDs removes the "UserSettings" edge to UserSetting entities by IDs.

func (*UserUpdate) RemoveUserSettings ¶

func (uu *UserUpdate) RemoveUserSettings(u ...*UserSetting) *UserUpdate

RemoveUserSettings removes "UserSettings" edges to UserSetting 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) SetDeleteTime ¶

func (uu *UserUpdate) SetDeleteTime(t time.Time) *UserUpdate

SetDeleteTime sets the "delete_time" field.

func (*UserUpdate) SetLastPwdAuth ¶

func (uu *UserUpdate) SetLastPwdAuth(t time.Time) *UserUpdate

SetLastPwdAuth sets the "last_pwd_auth" field.

func (*UserUpdate) SetNickname ¶

func (uu *UserUpdate) SetNickname(s string) *UserUpdate

SetNickname sets the "nickname" field.

func (*UserUpdate) SetNillableDeleteTime ¶

func (uu *UserUpdate) SetNillableDeleteTime(t *time.Time) *UserUpdate

SetNillableDeleteTime sets the "delete_time" field if the given value is not nil.

func (*UserUpdate) SetNillableLastPwdAuth ¶

func (uu *UserUpdate) SetNillableLastPwdAuth(t *time.Time) *UserUpdate

SetNillableLastPwdAuth sets the "last_pwd_auth" field if the given value is not nil.

func (*UserUpdate) SetNillablePassword ¶

func (uu *UserUpdate) SetNillablePassword(s *string) *UserUpdate

SetNillablePassword sets the "password" field if the given value is not nil.

func (*UserUpdate) SetNillablePhone ¶

func (uu *UserUpdate) SetNillablePhone(s *string) *UserUpdate

SetNillablePhone sets the "phone" field if the given value is not nil.

func (*UserUpdate) SetNillableStatus ¶

func (uu *UserUpdate) SetNillableStatus(u *user.Status) *UserUpdate

SetNillableStatus sets the "status" field if the given value is not nil.

func (*UserUpdate) SetPassword ¶

func (uu *UserUpdate) SetPassword(s string) *UserUpdate

SetPassword sets the "password" field.

func (*UserUpdate) SetPhone ¶

func (uu *UserUpdate) SetPhone(s string) *UserUpdate

SetPhone sets the "phone" field.

func (*UserUpdate) SetStatus ¶

func (uu *UserUpdate) SetStatus(u user.Status) *UserUpdate

SetStatus sets the "status" field.

func (*UserUpdate) SetUpdateTime ¶

func (uu *UserUpdate) SetUpdateTime(t time.Time) *UserUpdate

SetUpdateTime sets the "update_time" field.

func (*UserUpdate) Where ¶

func (uu *UserUpdate) Where(ps ...predicate.User) *UserUpdate

Where appends a list predicates to 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) AddUserEmailIDs ¶

func (uuo *UserUpdateOne) AddUserEmailIDs(ids ...int) *UserUpdateOne

AddUserEmailIDs adds the "UserEmails" edge to the UserEmail entity by IDs.

func (*UserUpdateOne) AddUserEmails ¶

func (uuo *UserUpdateOne) AddUserEmails(u ...*UserEmail) *UserUpdateOne

AddUserEmails adds the "UserEmails" edges to the UserEmail entity.

func (*UserUpdateOne) AddUserSecurityLogIDs ¶

func (uuo *UserUpdateOne) AddUserSecurityLogIDs(ids ...int) *UserUpdateOne

AddUserSecurityLogIDs adds the "UserSecurityLogs" edge to the UserSecurityLog entity by IDs.

func (*UserUpdateOne) AddUserSecurityLogs ¶

func (uuo *UserUpdateOne) AddUserSecurityLogs(u ...*UserSecurityLog) *UserUpdateOne

AddUserSecurityLogs adds the "UserSecurityLogs" edges to the UserSecurityLog entity.

func (*UserUpdateOne) AddUserSettingIDs ¶

func (uuo *UserUpdateOne) AddUserSettingIDs(ids ...int) *UserUpdateOne

AddUserSettingIDs adds the "UserSettings" edge to the UserSetting entity by IDs.

func (*UserUpdateOne) AddUserSettings ¶

func (uuo *UserUpdateOne) AddUserSettings(u ...*UserSetting) *UserUpdateOne

AddUserSettings adds the "UserSettings" edges to the UserSetting entity.

func (*UserUpdateOne) ClearDeleteTime ¶

func (uuo *UserUpdateOne) ClearDeleteTime() *UserUpdateOne

ClearDeleteTime clears the value of the "delete_time" field.

func (*UserUpdateOne) ClearLastPwdAuth ¶

func (uuo *UserUpdateOne) ClearLastPwdAuth() *UserUpdateOne

ClearLastPwdAuth clears the value of the "last_pwd_auth" field.

func (*UserUpdateOne) ClearPassword ¶

func (uuo *UserUpdateOne) ClearPassword() *UserUpdateOne

ClearPassword clears the value of the "password" field.

func (*UserUpdateOne) ClearPhone ¶

func (uuo *UserUpdateOne) ClearPhone() *UserUpdateOne

ClearPhone clears the value of the "phone" field.

func (*UserUpdateOne) ClearStatus ¶

func (uuo *UserUpdateOne) ClearStatus() *UserUpdateOne

ClearStatus clears the value of the "status" field.

func (*UserUpdateOne) ClearUserEmails ¶

func (uuo *UserUpdateOne) ClearUserEmails() *UserUpdateOne

ClearUserEmails clears all "UserEmails" edges to the UserEmail entity.

func (*UserUpdateOne) ClearUserSecurityLogs ¶

func (uuo *UserUpdateOne) ClearUserSecurityLogs() *UserUpdateOne

ClearUserSecurityLogs clears all "UserSecurityLogs" edges to the UserSecurityLog entity.

func (*UserUpdateOne) ClearUserSettings ¶

func (uuo *UserUpdateOne) ClearUserSettings() *UserUpdateOne

ClearUserSettings clears all "UserSettings" edges to the UserSetting 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) RemoveUserEmailIDs ¶

func (uuo *UserUpdateOne) RemoveUserEmailIDs(ids ...int) *UserUpdateOne

RemoveUserEmailIDs removes the "UserEmails" edge to UserEmail entities by IDs.

func (*UserUpdateOne) RemoveUserEmails ¶

func (uuo *UserUpdateOne) RemoveUserEmails(u ...*UserEmail) *UserUpdateOne

RemoveUserEmails removes "UserEmails" edges to UserEmail entities.

func (*UserUpdateOne) RemoveUserSecurityLogIDs ¶

func (uuo *UserUpdateOne) RemoveUserSecurityLogIDs(ids ...int) *UserUpdateOne

RemoveUserSecurityLogIDs removes the "UserSecurityLogs" edge to UserSecurityLog entities by IDs.

func (*UserUpdateOne) RemoveUserSecurityLogs ¶

func (uuo *UserUpdateOne) RemoveUserSecurityLogs(u ...*UserSecurityLog) *UserUpdateOne

RemoveUserSecurityLogs removes "UserSecurityLogs" edges to UserSecurityLog entities.

func (*UserUpdateOne) RemoveUserSettingIDs ¶

func (uuo *UserUpdateOne) RemoveUserSettingIDs(ids ...int) *UserUpdateOne

RemoveUserSettingIDs removes the "UserSettings" edge to UserSetting entities by IDs.

func (*UserUpdateOne) RemoveUserSettings ¶

func (uuo *UserUpdateOne) RemoveUserSettings(u ...*UserSetting) *UserUpdateOne

RemoveUserSettings removes "UserSettings" edges to UserSetting 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) Select ¶

func (uuo *UserUpdateOne) Select(field string, fields ...string) *UserUpdateOne

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

func (*UserUpdateOne) SetDeleteTime ¶

func (uuo *UserUpdateOne) SetDeleteTime(t time.Time) *UserUpdateOne

SetDeleteTime sets the "delete_time" field.

func (*UserUpdateOne) SetLastPwdAuth ¶

func (uuo *UserUpdateOne) SetLastPwdAuth(t time.Time) *UserUpdateOne

SetLastPwdAuth sets the "last_pwd_auth" field.

func (*UserUpdateOne) SetNickname ¶

func (uuo *UserUpdateOne) SetNickname(s string) *UserUpdateOne

SetNickname sets the "nickname" field.

func (*UserUpdateOne) SetNillableDeleteTime ¶

func (uuo *UserUpdateOne) SetNillableDeleteTime(t *time.Time) *UserUpdateOne

SetNillableDeleteTime sets the "delete_time" field if the given value is not nil.

func (*UserUpdateOne) SetNillableLastPwdAuth ¶

func (uuo *UserUpdateOne) SetNillableLastPwdAuth(t *time.Time) *UserUpdateOne

SetNillableLastPwdAuth sets the "last_pwd_auth" field if the given value is not nil.

func (*UserUpdateOne) SetNillablePassword ¶

func (uuo *UserUpdateOne) SetNillablePassword(s *string) *UserUpdateOne

SetNillablePassword sets the "password" field if the given value is not nil.

func (*UserUpdateOne) SetNillablePhone ¶

func (uuo *UserUpdateOne) SetNillablePhone(s *string) *UserUpdateOne

SetNillablePhone sets the "phone" field if the given value is not nil.

func (*UserUpdateOne) SetNillableStatus ¶

func (uuo *UserUpdateOne) SetNillableStatus(u *user.Status) *UserUpdateOne

SetNillableStatus sets the "status" field if the given value is not nil.

func (*UserUpdateOne) SetPassword ¶

func (uuo *UserUpdateOne) SetPassword(s string) *UserUpdateOne

SetPassword sets the "password" field.

func (*UserUpdateOne) SetPhone ¶

func (uuo *UserUpdateOne) SetPhone(s string) *UserUpdateOne

SetPhone sets the "phone" field.

func (*UserUpdateOne) SetStatus ¶

func (uuo *UserUpdateOne) SetStatus(u user.Status) *UserUpdateOne

SetStatus sets the "status" field.

func (*UserUpdateOne) SetUpdateTime ¶

func (uuo *UserUpdateOne) SetUpdateTime(t time.Time) *UserUpdateOne

SetUpdateTime sets the "update_time" 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
test
user command

Jump to

Keyboard shortcuts

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