model

package module
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2021 License: Apache-2.0 Imports: 27 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.
	TypeComponent       = "Component"
	TypeComponentTag    = "ComponentTag"
	TypeGroup           = "Group"
	TypeModelVersion    = "ModelVersion"
	TypeSystemSetting   = "SystemSetting"
	TypeUser            = "User"
	TypeUserEmail       = "UserEmail"
	TypeUserSecurityLog = "UserSecurityLog"
	TypeUserSetting     = "UserSetting"
)
View Source
const Version string = "536e424"

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
	// Component is the client for interacting with the Component builders.
	Component *ComponentClient
	// ComponentTag is the client for interacting with the ComponentTag builders.
	ComponentTag *ComponentTagClient
	// Group is the client for interacting with the Group builders.
	Group *GroupClient
	// 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().
	Component.
	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 Component added in v1.0.3

type Component struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// OwnerID holds the value of the "owner_id" field.
	OwnerID int `json:"-"`
	// Sn holds the value of the "sn" field.
	Sn string `json:"sn,omitempty"`
	// Name holds the value of the "name" field.
	Name string `json:"name,omitempty"`
	// Desc holds the value of the "desc" field.
	Desc string `json:"desc,omitempty"`
	// Center holds the value of the "center" field.
	Center bool `json:"center,omitempty"`
	// Version holds the value of the "version" field.
	Version string `json:"version,omitempty"`
	// Raw holds the value of the "raw" field.
	Raw string `json:"raw,omitempty"`
	// RawLength holds the value of the "raw_length" field.
	RawLength uint64 `json:"raw_length,omitempty"`
	// Score holds the value of the "score" field.
	Score int `json:"score,omitempty"`
	// VerifyTime holds the value of the "verify_time" field.
	VerifyTime *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:"-"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the ComponentQuery when eager-loading is set.
	Edges ComponentEdges `json:"edges"`
	// contains filtered or unexported fields
}

Component is the model entity for the Component schema.

func (*Component) QueryComponentOwner added in v1.0.3

func (c *Component) QueryComponentOwner() *UserQuery

QueryComponentOwner queries the "component_owner" edge of the Component entity.

func (*Component) QueryComponentTags added in v1.0.3

func (c *Component) QueryComponentTags() *ComponentTagQuery

QueryComponentTags queries the "component_tags" edge of the Component entity.

func (*Component) String added in v1.0.3

func (c *Component) String() string

String implements the fmt.Stringer.

func (*Component) Unwrap added in v1.0.3

func (c *Component) Unwrap() *Component

Unwrap unwraps the Component 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 (*Component) Update added in v1.0.3

func (c *Component) Update() *ComponentUpdateOne

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

type ComponentClient added in v1.0.3

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

ComponentClient is a client for the Component schema.

func NewComponentClient added in v1.0.3

func NewComponentClient(c config) *ComponentClient

NewComponentClient returns a client for the Component from the given config.

func (*ComponentClient) Create added in v1.0.3

func (c *ComponentClient) Create() *ComponentCreate

Create returns a create builder for Component.

func (*ComponentClient) CreateBulk added in v1.0.3

func (c *ComponentClient) CreateBulk(builders ...*ComponentCreate) *ComponentCreateBulk

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

func (*ComponentClient) Delete added in v1.0.3

func (c *ComponentClient) Delete() *ComponentDelete

Delete returns a delete builder for Component.

func (*ComponentClient) DeleteOne added in v1.0.3

func (c *ComponentClient) DeleteOne(co *Component) *ComponentDeleteOne

DeleteOne returns a delete builder for the given entity.

func (*ComponentClient) DeleteOneID added in v1.0.3

func (c *ComponentClient) DeleteOneID(id int) *ComponentDeleteOne

DeleteOneID returns a delete builder for the given id.

func (*ComponentClient) Get added in v1.0.3

func (c *ComponentClient) Get(ctx context.Context, id int) (*Component, error)

Get returns a Component entity by its id.

func (*ComponentClient) GetX added in v1.0.3

func (c *ComponentClient) GetX(ctx context.Context, id int) *Component

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

func (*ComponentClient) Hooks added in v1.0.3

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

Hooks returns the client hooks.

func (*ComponentClient) Query added in v1.0.3

func (c *ComponentClient) Query() *ComponentQuery

Query returns a query builder for Component.

func (*ComponentClient) QueryComponentOwner added in v1.0.3

func (c *ComponentClient) QueryComponentOwner(co *Component) *UserQuery

QueryComponentOwner queries the component_owner edge of a Component.

func (*ComponentClient) QueryComponentTags added in v1.0.3

func (c *ComponentClient) QueryComponentTags(co *Component) *ComponentTagQuery

QueryComponentTags queries the component_tags edge of a Component.

func (*ComponentClient) Update added in v1.0.3

func (c *ComponentClient) Update() *ComponentUpdate

Update returns an update builder for Component.

func (*ComponentClient) UpdateOne added in v1.0.3

func (c *ComponentClient) UpdateOne(co *Component) *ComponentUpdateOne

UpdateOne returns an update builder for the given entity.

func (*ComponentClient) UpdateOneID added in v1.0.3

func (c *ComponentClient) UpdateOneID(id int) *ComponentUpdateOne

UpdateOneID returns an update builder for the given id.

func (*ComponentClient) Use added in v1.0.3

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

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

type ComponentCreate added in v1.0.3

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

ComponentCreate is the builder for creating a Component entity.

func (*ComponentCreate) AddComponentTagIDs added in v1.0.3

func (cc *ComponentCreate) AddComponentTagIDs(ids ...int) *ComponentCreate

AddComponentTagIDs adds the "component_tags" edge to the ComponentTag entity by IDs.

func (*ComponentCreate) AddComponentTags added in v1.0.3

func (cc *ComponentCreate) AddComponentTags(c ...*ComponentTag) *ComponentCreate

AddComponentTags adds the "component_tags" edges to the ComponentTag entity.

func (*ComponentCreate) Exec added in v1.0.6

func (cc *ComponentCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*ComponentCreate) ExecX added in v1.0.6

func (cc *ComponentCreate) ExecX(ctx context.Context)

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

func (*ComponentCreate) Mutation added in v1.0.3

func (cc *ComponentCreate) Mutation() *ComponentMutation

Mutation returns the ComponentMutation object of the builder.

func (*ComponentCreate) Save added in v1.0.3

func (cc *ComponentCreate) Save(ctx context.Context) (*Component, error)

Save creates the Component in the database.

func (*ComponentCreate) SaveX added in v1.0.3

func (cc *ComponentCreate) SaveX(ctx context.Context) *Component

SaveX calls Save and panics if Save returns an error.

func (*ComponentCreate) SetCenter added in v1.0.3

func (cc *ComponentCreate) SetCenter(b bool) *ComponentCreate

SetCenter sets the "center" field.

func (*ComponentCreate) SetComponentOwner added in v1.0.3

func (cc *ComponentCreate) SetComponentOwner(u *User) *ComponentCreate

SetComponentOwner sets the "component_owner" edge to the User entity.

func (*ComponentCreate) SetComponentOwnerID added in v1.0.3

func (cc *ComponentCreate) SetComponentOwnerID(id int) *ComponentCreate

SetComponentOwnerID sets the "component_owner" edge to the User entity by ID.

func (*ComponentCreate) SetCreateTime added in v1.0.3

func (cc *ComponentCreate) SetCreateTime(t time.Time) *ComponentCreate

SetCreateTime sets the "create_time" field.

func (*ComponentCreate) SetDesc added in v1.0.3

func (cc *ComponentCreate) SetDesc(s string) *ComponentCreate

SetDesc sets the "desc" field.

func (*ComponentCreate) SetID added in v1.0.3

func (cc *ComponentCreate) SetID(i int) *ComponentCreate

SetID sets the "id" field.

func (*ComponentCreate) SetName added in v1.0.3

func (cc *ComponentCreate) SetName(s string) *ComponentCreate

SetName sets the "name" field.

func (*ComponentCreate) SetNillableCenter added in v1.0.3

func (cc *ComponentCreate) SetNillableCenter(b *bool) *ComponentCreate

SetNillableCenter sets the "center" field if the given value is not nil.

func (*ComponentCreate) SetNillableCreateTime added in v1.0.3

func (cc *ComponentCreate) SetNillableCreateTime(t *time.Time) *ComponentCreate

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

func (*ComponentCreate) SetNillableRawLength added in v1.0.3

func (cc *ComponentCreate) SetNillableRawLength(u *uint64) *ComponentCreate

SetNillableRawLength sets the "raw_length" field if the given value is not nil.

func (*ComponentCreate) SetNillableScore added in v1.0.3

func (cc *ComponentCreate) SetNillableScore(i *int) *ComponentCreate

SetNillableScore sets the "score" field if the given value is not nil.

func (*ComponentCreate) SetNillableSn added in v1.0.3

func (cc *ComponentCreate) SetNillableSn(s *string) *ComponentCreate

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

func (*ComponentCreate) SetNillableUpdateTime added in v1.0.3

func (cc *ComponentCreate) SetNillableUpdateTime(t *time.Time) *ComponentCreate

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

func (*ComponentCreate) SetNillableVerifyTime added in v1.0.3

func (cc *ComponentCreate) SetNillableVerifyTime(t *time.Time) *ComponentCreate

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

func (*ComponentCreate) SetNillableVersion added in v1.0.3

func (cc *ComponentCreate) SetNillableVersion(s *string) *ComponentCreate

SetNillableVersion sets the "version" field if the given value is not nil.

func (*ComponentCreate) SetOwnerID added in v1.0.3

func (cc *ComponentCreate) SetOwnerID(i int) *ComponentCreate

SetOwnerID sets the "owner_id" field.

func (*ComponentCreate) SetRaw added in v1.0.3

func (cc *ComponentCreate) SetRaw(s string) *ComponentCreate

SetRaw sets the "raw" field.

func (*ComponentCreate) SetRawLength added in v1.0.3

func (cc *ComponentCreate) SetRawLength(u uint64) *ComponentCreate

SetRawLength sets the "raw_length" field.

func (*ComponentCreate) SetScore added in v1.0.3

func (cc *ComponentCreate) SetScore(i int) *ComponentCreate

SetScore sets the "score" field.

func (*ComponentCreate) SetSn added in v1.0.3

func (cc *ComponentCreate) SetSn(s string) *ComponentCreate

SetSn sets the "sn" field.

func (*ComponentCreate) SetUpdateTime added in v1.0.3

func (cc *ComponentCreate) SetUpdateTime(t time.Time) *ComponentCreate

SetUpdateTime sets the "update_time" field.

func (*ComponentCreate) SetVerifyTime added in v1.0.3

func (cc *ComponentCreate) SetVerifyTime(t time.Time) *ComponentCreate

SetVerifyTime sets the "verify_time" field.

func (*ComponentCreate) SetVersion added in v1.0.3

func (cc *ComponentCreate) SetVersion(s string) *ComponentCreate

SetVersion sets the "version" field.

type ComponentCreateBulk added in v1.0.3

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

ComponentCreateBulk is the builder for creating many Component entities in bulk.

func (*ComponentCreateBulk) Exec added in v1.0.6

func (ccb *ComponentCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*ComponentCreateBulk) ExecX added in v1.0.6

func (ccb *ComponentCreateBulk) ExecX(ctx context.Context)

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

func (*ComponentCreateBulk) Save added in v1.0.3

func (ccb *ComponentCreateBulk) Save(ctx context.Context) ([]*Component, error)

Save creates the Component entities in the database.

func (*ComponentCreateBulk) SaveX added in v1.0.3

func (ccb *ComponentCreateBulk) SaveX(ctx context.Context) []*Component

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

type ComponentDelete added in v1.0.3

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

ComponentDelete is the builder for deleting a Component entity.

func (*ComponentDelete) Exec added in v1.0.3

func (cd *ComponentDelete) Exec(ctx context.Context) (int, error)

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

func (*ComponentDelete) ExecX added in v1.0.3

func (cd *ComponentDelete) ExecX(ctx context.Context) int

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

func (*ComponentDelete) Where added in v1.0.3

Where appends a list predicates to the ComponentDelete builder.

type ComponentDeleteOne added in v1.0.3

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

ComponentDeleteOne is the builder for deleting a single Component entity.

func (*ComponentDeleteOne) Exec added in v1.0.3

func (cdo *ComponentDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*ComponentDeleteOne) ExecX added in v1.0.3

func (cdo *ComponentDeleteOne) ExecX(ctx context.Context)

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

type ComponentEdges added in v1.0.3

type ComponentEdges struct {
	// ComponentOwner holds the value of the component_owner edge.
	ComponentOwner *User `json:"owner,omitempty"`
	// ComponentTags holds the value of the component_tags edge.
	ComponentTags []*ComponentTag `json:"tags,omitempty"`
	// contains filtered or unexported fields
}

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

func (ComponentEdges) ComponentOwnerOrErr added in v1.0.3

func (e ComponentEdges) ComponentOwnerOrErr() (*User, error)

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

func (ComponentEdges) ComponentTagsOrErr added in v1.0.3

func (e ComponentEdges) ComponentTagsOrErr() ([]*ComponentTag, error)

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

type ComponentGroupBy added in v1.0.3

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

ComponentGroupBy is the group-by builder for Component entities.

func (*ComponentGroupBy) Aggregate added in v1.0.3

func (cgb *ComponentGroupBy) Aggregate(fns ...AggregateFunc) *ComponentGroupBy

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

func (*ComponentGroupBy) Bool added in v1.0.3

func (cgb *ComponentGroupBy) 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 (*ComponentGroupBy) BoolX added in v1.0.3

func (cgb *ComponentGroupBy) BoolX(ctx context.Context) bool

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

func (*ComponentGroupBy) Bools added in v1.0.3

func (cgb *ComponentGroupBy) 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 (*ComponentGroupBy) BoolsX added in v1.0.3

func (cgb *ComponentGroupBy) BoolsX(ctx context.Context) []bool

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

func (*ComponentGroupBy) Float64 added in v1.0.3

func (cgb *ComponentGroupBy) 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 (*ComponentGroupBy) Float64X added in v1.0.3

func (cgb *ComponentGroupBy) Float64X(ctx context.Context) float64

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

func (*ComponentGroupBy) Float64s added in v1.0.3

func (cgb *ComponentGroupBy) 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 (*ComponentGroupBy) Float64sX added in v1.0.3

func (cgb *ComponentGroupBy) Float64sX(ctx context.Context) []float64

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

func (*ComponentGroupBy) Int added in v1.0.3

func (cgb *ComponentGroupBy) 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 (*ComponentGroupBy) IntX added in v1.0.3

func (cgb *ComponentGroupBy) IntX(ctx context.Context) int

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

func (*ComponentGroupBy) Ints added in v1.0.3

func (cgb *ComponentGroupBy) 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 (*ComponentGroupBy) IntsX added in v1.0.3

func (cgb *ComponentGroupBy) IntsX(ctx context.Context) []int

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

func (*ComponentGroupBy) Scan added in v1.0.3

func (cgb *ComponentGroupBy) Scan(ctx context.Context, v interface{}) error

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

func (*ComponentGroupBy) ScanX added in v1.0.3

func (cgb *ComponentGroupBy) ScanX(ctx context.Context, v interface{})

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

func (*ComponentGroupBy) String added in v1.0.3

func (cgb *ComponentGroupBy) 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 (*ComponentGroupBy) StringX added in v1.0.3

func (cgb *ComponentGroupBy) StringX(ctx context.Context) string

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

func (*ComponentGroupBy) Strings added in v1.0.3

func (cgb *ComponentGroupBy) 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 (*ComponentGroupBy) StringsX added in v1.0.3

func (cgb *ComponentGroupBy) StringsX(ctx context.Context) []string

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

type ComponentMutation added in v1.0.3

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

ComponentMutation represents an operation that mutates the Component nodes in the graph.

func (*ComponentMutation) AddComponentTagIDs added in v1.0.3

func (m *ComponentMutation) AddComponentTagIDs(ids ...int)

AddComponentTagIDs adds the "component_tags" edge to the ComponentTag entity by ids.

func (*ComponentMutation) AddField added in v1.0.3

func (m *ComponentMutation) 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 (*ComponentMutation) AddRawLength added in v1.0.3

func (m *ComponentMutation) AddRawLength(u uint64)

AddRawLength adds u to the "raw_length" field.

func (*ComponentMutation) AddScore added in v1.0.3

func (m *ComponentMutation) AddScore(i int)

AddScore adds i to the "score" field.

func (*ComponentMutation) AddedEdges added in v1.0.3

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

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

func (*ComponentMutation) AddedField added in v1.0.3

func (m *ComponentMutation) 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 (*ComponentMutation) AddedFields added in v1.0.3

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

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

func (*ComponentMutation) AddedIDs added in v1.0.3

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

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

func (*ComponentMutation) AddedRawLength added in v1.0.3

func (m *ComponentMutation) AddedRawLength() (r uint64, exists bool)

AddedRawLength returns the value that was added to the "raw_length" field in this mutation.

func (*ComponentMutation) AddedScore added in v1.0.3

func (m *ComponentMutation) AddedScore() (r int, exists bool)

AddedScore returns the value that was added to the "score" field in this mutation.

func (*ComponentMutation) Center added in v1.0.3

func (m *ComponentMutation) Center() (r bool, exists bool)

Center returns the value of the "center" field in the mutation.

func (*ComponentMutation) ClearComponentOwner added in v1.0.3

func (m *ComponentMutation) ClearComponentOwner()

ClearComponentOwner clears the "component_owner" edge to the User entity.

func (*ComponentMutation) ClearComponentTags added in v1.0.3

func (m *ComponentMutation) ClearComponentTags()

ClearComponentTags clears the "component_tags" edge to the ComponentTag entity.

func (*ComponentMutation) ClearEdge added in v1.0.3

func (m *ComponentMutation) 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 (*ComponentMutation) ClearField added in v1.0.3

func (m *ComponentMutation) 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 (*ComponentMutation) ClearVerifyTime added in v1.0.3

func (m *ComponentMutation) ClearVerifyTime()

ClearVerifyTime clears the value of the "verify_time" field.

func (*ComponentMutation) ClearedEdges added in v1.0.3

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

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

func (*ComponentMutation) ClearedFields added in v1.0.3

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

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

func (ComponentMutation) Client added in v1.0.3

func (m ComponentMutation) 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 (*ComponentMutation) ComponentOwnerCleared added in v1.0.3

func (m *ComponentMutation) ComponentOwnerCleared() bool

ComponentOwnerCleared reports if the "component_owner" edge to the User entity was cleared.

func (*ComponentMutation) ComponentOwnerID added in v1.0.3

func (m *ComponentMutation) ComponentOwnerID() (id int, exists bool)

ComponentOwnerID returns the "component_owner" edge ID in the mutation.

func (*ComponentMutation) ComponentOwnerIDs added in v1.0.3

func (m *ComponentMutation) ComponentOwnerIDs() (ids []int)

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

func (*ComponentMutation) ComponentTagsCleared added in v1.0.3

func (m *ComponentMutation) ComponentTagsCleared() bool

ComponentTagsCleared reports if the "component_tags" edge to the ComponentTag entity was cleared.

func (*ComponentMutation) ComponentTagsIDs added in v1.0.3

func (m *ComponentMutation) ComponentTagsIDs() (ids []int)

ComponentTagsIDs returns the "component_tags" edge IDs in the mutation.

func (*ComponentMutation) CreateTime added in v1.0.3

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

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

func (*ComponentMutation) Desc added in v1.0.3

func (m *ComponentMutation) Desc() (r string, exists bool)

Desc returns the value of the "desc" field in the mutation.

func (*ComponentMutation) EdgeCleared added in v1.0.3

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

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

func (*ComponentMutation) Field added in v1.0.3

func (m *ComponentMutation) 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 (*ComponentMutation) FieldCleared added in v1.0.3

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

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

func (*ComponentMutation) Fields added in v1.0.3

func (m *ComponentMutation) 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 (*ComponentMutation) ID added in v1.0.3

func (m *ComponentMutation) 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 (*ComponentMutation) Name added in v1.0.3

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

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

func (*ComponentMutation) OldCenter added in v1.0.3

func (m *ComponentMutation) OldCenter(ctx context.Context) (v bool, err error)

OldCenter returns the old "center" field's value of the Component entity. If the Component 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 (*ComponentMutation) OldCreateTime added in v1.0.3

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

OldCreateTime returns the old "create_time" field's value of the Component entity. If the Component 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 (*ComponentMutation) OldDesc added in v1.0.3

func (m *ComponentMutation) OldDesc(ctx context.Context) (v string, err error)

OldDesc returns the old "desc" field's value of the Component entity. If the Component 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 (*ComponentMutation) OldField added in v1.0.3

func (m *ComponentMutation) 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 (*ComponentMutation) OldName added in v1.0.3

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

OldName returns the old "name" field's value of the Component entity. If the Component 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 (*ComponentMutation) OldOwnerID added in v1.0.3

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

OldOwnerID returns the old "owner_id" field's value of the Component entity. If the Component 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 (*ComponentMutation) OldRaw added in v1.0.3

func (m *ComponentMutation) OldRaw(ctx context.Context) (v string, err error)

OldRaw returns the old "raw" field's value of the Component entity. If the Component 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 (*ComponentMutation) OldRawLength added in v1.0.3

func (m *ComponentMutation) OldRawLength(ctx context.Context) (v uint64, err error)

OldRawLength returns the old "raw_length" field's value of the Component entity. If the Component 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 (*ComponentMutation) OldScore added in v1.0.3

func (m *ComponentMutation) OldScore(ctx context.Context) (v int, err error)

OldScore returns the old "score" field's value of the Component entity. If the Component 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 (*ComponentMutation) OldSn added in v1.0.3

func (m *ComponentMutation) OldSn(ctx context.Context) (v string, err error)

OldSn returns the old "sn" field's value of the Component entity. If the Component 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 (*ComponentMutation) OldUpdateTime added in v1.0.3

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

OldUpdateTime returns the old "update_time" field's value of the Component entity. If the Component 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 (*ComponentMutation) OldVerifyTime added in v1.0.3

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

OldVerifyTime returns the old "verify_time" field's value of the Component entity. If the Component 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 (*ComponentMutation) OldVersion added in v1.0.3

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

OldVersion returns the old "version" field's value of the Component entity. If the Component 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 (*ComponentMutation) Op added in v1.0.3

func (m *ComponentMutation) Op() Op

Op returns the operation name.

func (*ComponentMutation) OwnerID added in v1.0.3

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

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

func (*ComponentMutation) Raw added in v1.0.3

func (m *ComponentMutation) Raw() (r string, exists bool)

Raw returns the value of the "raw" field in the mutation.

func (*ComponentMutation) RawLength added in v1.0.3

func (m *ComponentMutation) RawLength() (r uint64, exists bool)

RawLength returns the value of the "raw_length" field in the mutation.

func (*ComponentMutation) RemoveComponentTagIDs added in v1.0.3

func (m *ComponentMutation) RemoveComponentTagIDs(ids ...int)

RemoveComponentTagIDs removes the "component_tags" edge to the ComponentTag entity by IDs.

func (*ComponentMutation) RemovedComponentTagsIDs added in v1.0.3

func (m *ComponentMutation) RemovedComponentTagsIDs() (ids []int)

RemovedComponentTags returns the removed IDs of the "component_tags" edge to the ComponentTag entity.

func (*ComponentMutation) RemovedEdges added in v1.0.3

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

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

func (*ComponentMutation) RemovedIDs added in v1.0.3

func (m *ComponentMutation) 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 (*ComponentMutation) ResetCenter added in v1.0.3

func (m *ComponentMutation) ResetCenter()

ResetCenter resets all changes to the "center" field.

func (*ComponentMutation) ResetComponentOwner added in v1.0.3

func (m *ComponentMutation) ResetComponentOwner()

ResetComponentOwner resets all changes to the "component_owner" edge.

func (*ComponentMutation) ResetComponentTags added in v1.0.3

func (m *ComponentMutation) ResetComponentTags()

ResetComponentTags resets all changes to the "component_tags" edge.

func (*ComponentMutation) ResetCreateTime added in v1.0.3

func (m *ComponentMutation) ResetCreateTime()

ResetCreateTime resets all changes to the "create_time" field.

func (*ComponentMutation) ResetDesc added in v1.0.3

func (m *ComponentMutation) ResetDesc()

ResetDesc resets all changes to the "desc" field.

func (*ComponentMutation) ResetEdge added in v1.0.3

func (m *ComponentMutation) 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 (*ComponentMutation) ResetField added in v1.0.3

func (m *ComponentMutation) 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 (*ComponentMutation) ResetName added in v1.0.3

func (m *ComponentMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*ComponentMutation) ResetOwnerID added in v1.0.3

func (m *ComponentMutation) ResetOwnerID()

ResetOwnerID resets all changes to the "owner_id" field.

func (*ComponentMutation) ResetRaw added in v1.0.3

func (m *ComponentMutation) ResetRaw()

ResetRaw resets all changes to the "raw" field.

func (*ComponentMutation) ResetRawLength added in v1.0.3

func (m *ComponentMutation) ResetRawLength()

ResetRawLength resets all changes to the "raw_length" field.

func (*ComponentMutation) ResetScore added in v1.0.3

func (m *ComponentMutation) ResetScore()

ResetScore resets all changes to the "score" field.

func (*ComponentMutation) ResetSn added in v1.0.3

func (m *ComponentMutation) ResetSn()

ResetSn resets all changes to the "sn" field.

func (*ComponentMutation) ResetUpdateTime added in v1.0.3

func (m *ComponentMutation) ResetUpdateTime()

ResetUpdateTime resets all changes to the "update_time" field.

func (*ComponentMutation) ResetVerifyTime added in v1.0.3

func (m *ComponentMutation) ResetVerifyTime()

ResetVerifyTime resets all changes to the "verify_time" field.

func (*ComponentMutation) ResetVersion added in v1.0.3

func (m *ComponentMutation) ResetVersion()

ResetVersion resets all changes to the "version" field.

func (*ComponentMutation) Score added in v1.0.3

func (m *ComponentMutation) Score() (r int, exists bool)

Score returns the value of the "score" field in the mutation.

func (*ComponentMutation) SetCenter added in v1.0.3

func (m *ComponentMutation) SetCenter(b bool)

SetCenter sets the "center" field.

func (*ComponentMutation) SetComponentOwnerID added in v1.0.3

func (m *ComponentMutation) SetComponentOwnerID(id int)

SetComponentOwnerID sets the "component_owner" edge to the User entity by id.

func (*ComponentMutation) SetCreateTime added in v1.0.3

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

SetCreateTime sets the "create_time" field.

func (*ComponentMutation) SetDesc added in v1.0.3

func (m *ComponentMutation) SetDesc(s string)

SetDesc sets the "desc" field.

func (*ComponentMutation) SetField added in v1.0.3

func (m *ComponentMutation) 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 (*ComponentMutation) SetID added in v1.0.3

func (m *ComponentMutation) SetID(id int)

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

func (*ComponentMutation) SetName added in v1.0.3

func (m *ComponentMutation) SetName(s string)

SetName sets the "name" field.

func (*ComponentMutation) SetOwnerID added in v1.0.3

func (m *ComponentMutation) SetOwnerID(i int)

SetOwnerID sets the "owner_id" field.

func (*ComponentMutation) SetRaw added in v1.0.3

func (m *ComponentMutation) SetRaw(s string)

SetRaw sets the "raw" field.

func (*ComponentMutation) SetRawLength added in v1.0.3

func (m *ComponentMutation) SetRawLength(u uint64)

SetRawLength sets the "raw_length" field.

func (*ComponentMutation) SetScore added in v1.0.3

func (m *ComponentMutation) SetScore(i int)

SetScore sets the "score" field.

func (*ComponentMutation) SetSn added in v1.0.3

func (m *ComponentMutation) SetSn(s string)

SetSn sets the "sn" field.

func (*ComponentMutation) SetUpdateTime added in v1.0.3

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

SetUpdateTime sets the "update_time" field.

func (*ComponentMutation) SetVerifyTime added in v1.0.3

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

SetVerifyTime sets the "verify_time" field.

func (*ComponentMutation) SetVersion added in v1.0.3

func (m *ComponentMutation) SetVersion(s string)

SetVersion sets the "version" field.

func (*ComponentMutation) Sn added in v1.0.3

func (m *ComponentMutation) Sn() (r string, exists bool)

Sn returns the value of the "sn" field in the mutation.

func (ComponentMutation) Tx added in v1.0.3

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

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

func (*ComponentMutation) Type added in v1.0.3

func (m *ComponentMutation) Type() string

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

func (*ComponentMutation) UpdateTime added in v1.0.3

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

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

func (*ComponentMutation) VerifyTime added in v1.0.3

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

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

func (*ComponentMutation) VerifyTimeCleared added in v1.0.3

func (m *ComponentMutation) VerifyTimeCleared() bool

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

func (*ComponentMutation) Version added in v1.0.3

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

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

func (*ComponentMutation) Where added in v1.0.6

func (m *ComponentMutation) Where(ps ...predicate.Component)

Where appends a list predicates to the ComponentMutation builder.

type ComponentQuery added in v1.0.3

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

ComponentQuery is the builder for querying Component entities.

func (*ComponentQuery) All added in v1.0.3

func (cq *ComponentQuery) All(ctx context.Context) ([]*Component, error)

All executes the query and returns a list of Components.

func (*ComponentQuery) AllX added in v1.0.3

func (cq *ComponentQuery) AllX(ctx context.Context) []*Component

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

func (*ComponentQuery) Clone added in v1.0.3

func (cq *ComponentQuery) Clone() *ComponentQuery

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

func (*ComponentQuery) Count added in v1.0.3

func (cq *ComponentQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*ComponentQuery) CountX added in v1.0.3

func (cq *ComponentQuery) CountX(ctx context.Context) int

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

func (*ComponentQuery) Exist added in v1.0.3

func (cq *ComponentQuery) Exist(ctx context.Context) (bool, error)

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

func (*ComponentQuery) ExistX added in v1.0.3

func (cq *ComponentQuery) ExistX(ctx context.Context) bool

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

func (*ComponentQuery) First added in v1.0.3

func (cq *ComponentQuery) First(ctx context.Context) (*Component, error)

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

func (*ComponentQuery) FirstID added in v1.0.3

func (cq *ComponentQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*ComponentQuery) FirstIDX added in v1.0.3

func (cq *ComponentQuery) FirstIDX(ctx context.Context) int

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

func (*ComponentQuery) FirstX added in v1.0.3

func (cq *ComponentQuery) FirstX(ctx context.Context) *Component

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

func (*ComponentQuery) GroupBy added in v1.0.3

func (cq *ComponentQuery) GroupBy(field string, fields ...string) *ComponentGroupBy

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.Component.Query().
	GroupBy(component.FieldOwnerID).
	Aggregate(model.Count()).
	Scan(ctx, &v)

func (*ComponentQuery) IDs added in v1.0.3

func (cq *ComponentQuery) IDs(ctx context.Context) ([]int, error)

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

func (*ComponentQuery) IDsX added in v1.0.3

func (cq *ComponentQuery) IDsX(ctx context.Context) []int

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

func (*ComponentQuery) Limit added in v1.0.3

func (cq *ComponentQuery) Limit(limit int) *ComponentQuery

Limit adds a limit step to the query.

func (*ComponentQuery) Offset added in v1.0.3

func (cq *ComponentQuery) Offset(offset int) *ComponentQuery

Offset adds an offset step to the query.

func (*ComponentQuery) Only added in v1.0.3

func (cq *ComponentQuery) Only(ctx context.Context) (*Component, error)

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

func (*ComponentQuery) OnlyID added in v1.0.3

func (cq *ComponentQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*ComponentQuery) OnlyIDX added in v1.0.3

func (cq *ComponentQuery) OnlyIDX(ctx context.Context) int

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

func (*ComponentQuery) OnlyX added in v1.0.3

func (cq *ComponentQuery) OnlyX(ctx context.Context) *Component

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

func (*ComponentQuery) Order added in v1.0.3

func (cq *ComponentQuery) Order(o ...OrderFunc) *ComponentQuery

Order adds an order step to the query.

func (*ComponentQuery) QueryComponentOwner added in v1.0.3

func (cq *ComponentQuery) QueryComponentOwner() *UserQuery

QueryComponentOwner chains the current query on the "component_owner" edge.

func (*ComponentQuery) QueryComponentTags added in v1.0.3

func (cq *ComponentQuery) QueryComponentTags() *ComponentTagQuery

QueryComponentTags chains the current query on the "component_tags" edge.

func (*ComponentQuery) Select added in v1.0.3

func (cq *ComponentQuery) Select(fields ...string) *ComponentSelect

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.Component.Query().
	Select(component.FieldOwnerID).
	Scan(ctx, &v)

func (*ComponentQuery) Unique added in v1.0.3

func (cq *ComponentQuery) Unique(unique bool) *ComponentQuery

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 (*ComponentQuery) Where added in v1.0.3

Where adds a new predicate for the ComponentQuery builder.

func (*ComponentQuery) WithComponentOwner added in v1.0.3

func (cq *ComponentQuery) WithComponentOwner(opts ...func(*UserQuery)) *ComponentQuery

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

func (*ComponentQuery) WithComponentTags added in v1.0.3

func (cq *ComponentQuery) WithComponentTags(opts ...func(*ComponentTagQuery)) *ComponentQuery

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

type ComponentSelect added in v1.0.3

type ComponentSelect struct {
	*ComponentQuery
	// contains filtered or unexported fields
}

ComponentSelect is the builder for selecting fields of Component entities.

func (*ComponentSelect) Bool added in v1.0.3

func (cs *ComponentSelect) Bool(ctx context.Context) (_ bool, err error)

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

func (*ComponentSelect) BoolX added in v1.0.3

func (cs *ComponentSelect) BoolX(ctx context.Context) bool

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

func (*ComponentSelect) Bools added in v1.0.3

func (cs *ComponentSelect) Bools(ctx context.Context) ([]bool, error)

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

func (*ComponentSelect) BoolsX added in v1.0.3

func (cs *ComponentSelect) BoolsX(ctx context.Context) []bool

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

func (*ComponentSelect) Float64 added in v1.0.3

func (cs *ComponentSelect) Float64(ctx context.Context) (_ float64, err error)

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

func (*ComponentSelect) Float64X added in v1.0.3

func (cs *ComponentSelect) Float64X(ctx context.Context) float64

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

func (*ComponentSelect) Float64s added in v1.0.3

func (cs *ComponentSelect) Float64s(ctx context.Context) ([]float64, error)

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

func (*ComponentSelect) Float64sX added in v1.0.3

func (cs *ComponentSelect) Float64sX(ctx context.Context) []float64

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

func (*ComponentSelect) Int added in v1.0.3

func (cs *ComponentSelect) Int(ctx context.Context) (_ int, err error)

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

func (*ComponentSelect) IntX added in v1.0.3

func (cs *ComponentSelect) IntX(ctx context.Context) int

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

func (*ComponentSelect) Ints added in v1.0.3

func (cs *ComponentSelect) Ints(ctx context.Context) ([]int, error)

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

func (*ComponentSelect) IntsX added in v1.0.3

func (cs *ComponentSelect) IntsX(ctx context.Context) []int

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

func (*ComponentSelect) Scan added in v1.0.3

func (cs *ComponentSelect) Scan(ctx context.Context, v interface{}) error

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

func (*ComponentSelect) ScanX added in v1.0.3

func (cs *ComponentSelect) ScanX(ctx context.Context, v interface{})

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

func (*ComponentSelect) String added in v1.0.3

func (cs *ComponentSelect) String(ctx context.Context) (_ string, err error)

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

func (*ComponentSelect) StringX added in v1.0.3

func (cs *ComponentSelect) StringX(ctx context.Context) string

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

func (*ComponentSelect) Strings added in v1.0.3

func (cs *ComponentSelect) Strings(ctx context.Context) ([]string, error)

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

func (*ComponentSelect) StringsX added in v1.0.3

func (cs *ComponentSelect) StringsX(ctx context.Context) []string

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

type ComponentTag added in v1.0.3

type ComponentTag struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// En holds the value of the "en" field.
	En string `json:"en,omitempty"`
	// Zh holds the value of the "zh" field.
	Zh string `json:"zh,omitempty"`
	// CreateTime holds the value of the "create_time" field.
	CreateTime time.Time `json:"create_time,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the ComponentTagQuery when eager-loading is set.
	Edges ComponentTagEdges `json:"edges"`
	// contains filtered or unexported fields
}

ComponentTag is the model entity for the ComponentTag schema.

func (*ComponentTag) QueryComponentTag added in v1.0.3

func (ct *ComponentTag) QueryComponentTag() *ComponentQuery

QueryComponentTag queries the "component_tag" edge of the ComponentTag entity.

func (*ComponentTag) String added in v1.0.3

func (ct *ComponentTag) String() string

String implements the fmt.Stringer.

func (*ComponentTag) Unwrap added in v1.0.3

func (ct *ComponentTag) Unwrap() *ComponentTag

Unwrap unwraps the ComponentTag 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 (*ComponentTag) Update added in v1.0.3

func (ct *ComponentTag) Update() *ComponentTagUpdateOne

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

type ComponentTagClient added in v1.0.3

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

ComponentTagClient is a client for the ComponentTag schema.

func NewComponentTagClient added in v1.0.3

func NewComponentTagClient(c config) *ComponentTagClient

NewComponentTagClient returns a client for the ComponentTag from the given config.

func (*ComponentTagClient) Create added in v1.0.3

Create returns a create builder for ComponentTag.

func (*ComponentTagClient) CreateBulk added in v1.0.3

func (c *ComponentTagClient) CreateBulk(builders ...*ComponentTagCreate) *ComponentTagCreateBulk

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

func (*ComponentTagClient) Delete added in v1.0.3

Delete returns a delete builder for ComponentTag.

func (*ComponentTagClient) DeleteOne added in v1.0.3

DeleteOne returns a delete builder for the given entity.

func (*ComponentTagClient) DeleteOneID added in v1.0.3

func (c *ComponentTagClient) DeleteOneID(id int) *ComponentTagDeleteOne

DeleteOneID returns a delete builder for the given id.

func (*ComponentTagClient) Get added in v1.0.3

Get returns a ComponentTag entity by its id.

func (*ComponentTagClient) GetX added in v1.0.3

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

func (*ComponentTagClient) Hooks added in v1.0.3

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

Hooks returns the client hooks.

func (*ComponentTagClient) Query added in v1.0.3

Query returns a query builder for ComponentTag.

func (*ComponentTagClient) QueryComponentTag added in v1.0.3

func (c *ComponentTagClient) QueryComponentTag(ct *ComponentTag) *ComponentQuery

QueryComponentTag queries the component_tag edge of a ComponentTag.

func (*ComponentTagClient) Update added in v1.0.3

Update returns an update builder for ComponentTag.

func (*ComponentTagClient) UpdateOne added in v1.0.3

UpdateOne returns an update builder for the given entity.

func (*ComponentTagClient) UpdateOneID added in v1.0.3

func (c *ComponentTagClient) UpdateOneID(id int) *ComponentTagUpdateOne

UpdateOneID returns an update builder for the given id.

func (*ComponentTagClient) Use added in v1.0.3

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

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

type ComponentTagCreate added in v1.0.3

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

ComponentTagCreate is the builder for creating a ComponentTag entity.

func (*ComponentTagCreate) AddComponentTag added in v1.0.3

func (ctc *ComponentTagCreate) AddComponentTag(c ...*Component) *ComponentTagCreate

AddComponentTag adds the "component_tag" edges to the Component entity.

func (*ComponentTagCreate) AddComponentTagIDs added in v1.0.3

func (ctc *ComponentTagCreate) AddComponentTagIDs(ids ...int) *ComponentTagCreate

AddComponentTagIDs adds the "component_tag" edge to the Component entity by IDs.

func (*ComponentTagCreate) Exec added in v1.0.6

func (ctc *ComponentTagCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*ComponentTagCreate) ExecX added in v1.0.6

func (ctc *ComponentTagCreate) ExecX(ctx context.Context)

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

func (*ComponentTagCreate) Mutation added in v1.0.3

func (ctc *ComponentTagCreate) Mutation() *ComponentTagMutation

Mutation returns the ComponentTagMutation object of the builder.

func (*ComponentTagCreate) Save added in v1.0.3

Save creates the ComponentTag in the database.

func (*ComponentTagCreate) SaveX added in v1.0.3

SaveX calls Save and panics if Save returns an error.

func (*ComponentTagCreate) SetCreateTime added in v1.0.3

func (ctc *ComponentTagCreate) SetCreateTime(t time.Time) *ComponentTagCreate

SetCreateTime sets the "create_time" field.

func (*ComponentTagCreate) SetEn added in v1.0.3

SetEn sets the "en" field.

func (*ComponentTagCreate) SetID added in v1.0.3

func (ctc *ComponentTagCreate) SetID(i int) *ComponentTagCreate

SetID sets the "id" field.

func (*ComponentTagCreate) SetNillableCreateTime added in v1.0.3

func (ctc *ComponentTagCreate) SetNillableCreateTime(t *time.Time) *ComponentTagCreate

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

func (*ComponentTagCreate) SetZh added in v1.0.3

SetZh sets the "zh" field.

type ComponentTagCreateBulk added in v1.0.3

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

ComponentTagCreateBulk is the builder for creating many ComponentTag entities in bulk.

func (*ComponentTagCreateBulk) Exec added in v1.0.6

func (ctcb *ComponentTagCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*ComponentTagCreateBulk) ExecX added in v1.0.6

func (ctcb *ComponentTagCreateBulk) ExecX(ctx context.Context)

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

func (*ComponentTagCreateBulk) Save added in v1.0.3

Save creates the ComponentTag entities in the database.

func (*ComponentTagCreateBulk) SaveX added in v1.0.3

func (ctcb *ComponentTagCreateBulk) SaveX(ctx context.Context) []*ComponentTag

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

type ComponentTagDelete added in v1.0.3

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

ComponentTagDelete is the builder for deleting a ComponentTag entity.

func (*ComponentTagDelete) Exec added in v1.0.3

func (ctd *ComponentTagDelete) Exec(ctx context.Context) (int, error)

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

func (*ComponentTagDelete) ExecX added in v1.0.3

func (ctd *ComponentTagDelete) ExecX(ctx context.Context) int

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

func (*ComponentTagDelete) Where added in v1.0.3

Where appends a list predicates to the ComponentTagDelete builder.

type ComponentTagDeleteOne added in v1.0.3

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

ComponentTagDeleteOne is the builder for deleting a single ComponentTag entity.

func (*ComponentTagDeleteOne) Exec added in v1.0.3

func (ctdo *ComponentTagDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*ComponentTagDeleteOne) ExecX added in v1.0.3

func (ctdo *ComponentTagDeleteOne) ExecX(ctx context.Context)

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

type ComponentTagEdges added in v1.0.3

type ComponentTagEdges struct {
	// ComponentTag holds the value of the component_tag edge.
	ComponentTag []*Component `json:"components,omitempty"`
	// contains filtered or unexported fields
}

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

func (ComponentTagEdges) ComponentTagOrErr added in v1.0.3

func (e ComponentTagEdges) ComponentTagOrErr() ([]*Component, error)

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

type ComponentTagGroupBy added in v1.0.3

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

ComponentTagGroupBy is the group-by builder for ComponentTag entities.

func (*ComponentTagGroupBy) Aggregate added in v1.0.3

func (ctgb *ComponentTagGroupBy) Aggregate(fns ...AggregateFunc) *ComponentTagGroupBy

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

func (*ComponentTagGroupBy) Bool added in v1.0.3

func (ctgb *ComponentTagGroupBy) 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 (*ComponentTagGroupBy) BoolX added in v1.0.3

func (ctgb *ComponentTagGroupBy) BoolX(ctx context.Context) bool

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

func (*ComponentTagGroupBy) Bools added in v1.0.3

func (ctgb *ComponentTagGroupBy) 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 (*ComponentTagGroupBy) BoolsX added in v1.0.3

func (ctgb *ComponentTagGroupBy) BoolsX(ctx context.Context) []bool

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

func (*ComponentTagGroupBy) Float64 added in v1.0.3

func (ctgb *ComponentTagGroupBy) 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 (*ComponentTagGroupBy) Float64X added in v1.0.3

func (ctgb *ComponentTagGroupBy) Float64X(ctx context.Context) float64

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

func (*ComponentTagGroupBy) Float64s added in v1.0.3

func (ctgb *ComponentTagGroupBy) 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 (*ComponentTagGroupBy) Float64sX added in v1.0.3

func (ctgb *ComponentTagGroupBy) Float64sX(ctx context.Context) []float64

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

func (*ComponentTagGroupBy) Int added in v1.0.3

func (ctgb *ComponentTagGroupBy) 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 (*ComponentTagGroupBy) IntX added in v1.0.3

func (ctgb *ComponentTagGroupBy) IntX(ctx context.Context) int

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

func (*ComponentTagGroupBy) Ints added in v1.0.3

func (ctgb *ComponentTagGroupBy) 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 (*ComponentTagGroupBy) IntsX added in v1.0.3

func (ctgb *ComponentTagGroupBy) IntsX(ctx context.Context) []int

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

func (*ComponentTagGroupBy) Scan added in v1.0.3

func (ctgb *ComponentTagGroupBy) Scan(ctx context.Context, v interface{}) error

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

func (*ComponentTagGroupBy) ScanX added in v1.0.3

func (ctgb *ComponentTagGroupBy) ScanX(ctx context.Context, v interface{})

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

func (*ComponentTagGroupBy) String added in v1.0.3

func (ctgb *ComponentTagGroupBy) 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 (*ComponentTagGroupBy) StringX added in v1.0.3

func (ctgb *ComponentTagGroupBy) StringX(ctx context.Context) string

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

func (*ComponentTagGroupBy) Strings added in v1.0.3

func (ctgb *ComponentTagGroupBy) 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 (*ComponentTagGroupBy) StringsX added in v1.0.3

func (ctgb *ComponentTagGroupBy) StringsX(ctx context.Context) []string

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

type ComponentTagMutation added in v1.0.3

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

ComponentTagMutation represents an operation that mutates the ComponentTag nodes in the graph.

func (*ComponentTagMutation) AddComponentTagIDs added in v1.0.3

func (m *ComponentTagMutation) AddComponentTagIDs(ids ...int)

AddComponentTagIDs adds the "component_tag" edge to the Component entity by ids.

func (*ComponentTagMutation) AddField added in v1.0.3

func (m *ComponentTagMutation) 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 (*ComponentTagMutation) AddedEdges added in v1.0.3

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

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

func (*ComponentTagMutation) AddedField added in v1.0.3

func (m *ComponentTagMutation) 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 (*ComponentTagMutation) AddedFields added in v1.0.3

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

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

func (*ComponentTagMutation) AddedIDs added in v1.0.3

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

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

func (*ComponentTagMutation) ClearComponentTag added in v1.0.3

func (m *ComponentTagMutation) ClearComponentTag()

ClearComponentTag clears the "component_tag" edge to the Component entity.

func (*ComponentTagMutation) ClearEdge added in v1.0.3

func (m *ComponentTagMutation) 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 (*ComponentTagMutation) ClearField added in v1.0.3

func (m *ComponentTagMutation) 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 (*ComponentTagMutation) ClearedEdges added in v1.0.3

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

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

func (*ComponentTagMutation) ClearedFields added in v1.0.3

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

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

func (ComponentTagMutation) Client added in v1.0.3

func (m ComponentTagMutation) 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 (*ComponentTagMutation) ComponentTagCleared added in v1.0.3

func (m *ComponentTagMutation) ComponentTagCleared() bool

ComponentTagCleared reports if the "component_tag" edge to the Component entity was cleared.

func (*ComponentTagMutation) ComponentTagIDs added in v1.0.3

func (m *ComponentTagMutation) ComponentTagIDs() (ids []int)

ComponentTagIDs returns the "component_tag" edge IDs in the mutation.

func (*ComponentTagMutation) CreateTime added in v1.0.3

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

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

func (*ComponentTagMutation) EdgeCleared added in v1.0.3

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

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

func (*ComponentTagMutation) En added in v1.0.3

func (m *ComponentTagMutation) En() (r string, exists bool)

En returns the value of the "en" field in the mutation.

func (*ComponentTagMutation) Field added in v1.0.3

func (m *ComponentTagMutation) 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 (*ComponentTagMutation) FieldCleared added in v1.0.3

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

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

func (*ComponentTagMutation) Fields added in v1.0.3

func (m *ComponentTagMutation) 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 (*ComponentTagMutation) ID added in v1.0.3

func (m *ComponentTagMutation) 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 (*ComponentTagMutation) OldCreateTime added in v1.0.3

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

OldCreateTime returns the old "create_time" field's value of the ComponentTag entity. If the ComponentTag 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 (*ComponentTagMutation) OldEn added in v1.0.3

func (m *ComponentTagMutation) OldEn(ctx context.Context) (v string, err error)

OldEn returns the old "en" field's value of the ComponentTag entity. If the ComponentTag 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 (*ComponentTagMutation) OldField added in v1.0.3

func (m *ComponentTagMutation) 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 (*ComponentTagMutation) OldZh added in v1.0.3

func (m *ComponentTagMutation) OldZh(ctx context.Context) (v string, err error)

OldZh returns the old "zh" field's value of the ComponentTag entity. If the ComponentTag 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 (*ComponentTagMutation) Op added in v1.0.3

func (m *ComponentTagMutation) Op() Op

Op returns the operation name.

func (*ComponentTagMutation) RemoveComponentTagIDs added in v1.0.3

func (m *ComponentTagMutation) RemoveComponentTagIDs(ids ...int)

RemoveComponentTagIDs removes the "component_tag" edge to the Component entity by IDs.

func (*ComponentTagMutation) RemovedComponentTagIDs added in v1.0.3

func (m *ComponentTagMutation) RemovedComponentTagIDs() (ids []int)

RemovedComponentTag returns the removed IDs of the "component_tag" edge to the Component entity.

func (*ComponentTagMutation) RemovedEdges added in v1.0.3

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

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

func (*ComponentTagMutation) RemovedIDs added in v1.0.3

func (m *ComponentTagMutation) 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 (*ComponentTagMutation) ResetComponentTag added in v1.0.3

func (m *ComponentTagMutation) ResetComponentTag()

ResetComponentTag resets all changes to the "component_tag" edge.

func (*ComponentTagMutation) ResetCreateTime added in v1.0.3

func (m *ComponentTagMutation) ResetCreateTime()

ResetCreateTime resets all changes to the "create_time" field.

func (*ComponentTagMutation) ResetEdge added in v1.0.3

func (m *ComponentTagMutation) 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 (*ComponentTagMutation) ResetEn added in v1.0.3

func (m *ComponentTagMutation) ResetEn()

ResetEn resets all changes to the "en" field.

func (*ComponentTagMutation) ResetField added in v1.0.3

func (m *ComponentTagMutation) 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 (*ComponentTagMutation) ResetZh added in v1.0.3

func (m *ComponentTagMutation) ResetZh()

ResetZh resets all changes to the "zh" field.

func (*ComponentTagMutation) SetCreateTime added in v1.0.3

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

SetCreateTime sets the "create_time" field.

func (*ComponentTagMutation) SetEn added in v1.0.3

func (m *ComponentTagMutation) SetEn(s string)

SetEn sets the "en" field.

func (*ComponentTagMutation) SetField added in v1.0.3

func (m *ComponentTagMutation) 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 (*ComponentTagMutation) SetID added in v1.0.3

func (m *ComponentTagMutation) SetID(id int)

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

func (*ComponentTagMutation) SetZh added in v1.0.3

func (m *ComponentTagMutation) SetZh(s string)

SetZh sets the "zh" field.

func (ComponentTagMutation) Tx added in v1.0.3

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

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

func (*ComponentTagMutation) Type added in v1.0.3

func (m *ComponentTagMutation) Type() string

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

func (*ComponentTagMutation) Where added in v1.0.6

Where appends a list predicates to the ComponentTagMutation builder.

func (*ComponentTagMutation) Zh added in v1.0.3

func (m *ComponentTagMutation) Zh() (r string, exists bool)

Zh returns the value of the "zh" field in the mutation.

type ComponentTagQuery added in v1.0.3

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

ComponentTagQuery is the builder for querying ComponentTag entities.

func (*ComponentTagQuery) All added in v1.0.3

func (ctq *ComponentTagQuery) All(ctx context.Context) ([]*ComponentTag, error)

All executes the query and returns a list of ComponentTags.

func (*ComponentTagQuery) AllX added in v1.0.3

func (ctq *ComponentTagQuery) AllX(ctx context.Context) []*ComponentTag

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

func (*ComponentTagQuery) Clone added in v1.0.3

func (ctq *ComponentTagQuery) Clone() *ComponentTagQuery

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

func (*ComponentTagQuery) Count added in v1.0.3

func (ctq *ComponentTagQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*ComponentTagQuery) CountX added in v1.0.3

func (ctq *ComponentTagQuery) CountX(ctx context.Context) int

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

func (*ComponentTagQuery) Exist added in v1.0.3

func (ctq *ComponentTagQuery) Exist(ctx context.Context) (bool, error)

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

func (*ComponentTagQuery) ExistX added in v1.0.3

func (ctq *ComponentTagQuery) ExistX(ctx context.Context) bool

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

func (*ComponentTagQuery) First added in v1.0.3

func (ctq *ComponentTagQuery) First(ctx context.Context) (*ComponentTag, error)

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

func (*ComponentTagQuery) FirstID added in v1.0.3

func (ctq *ComponentTagQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*ComponentTagQuery) FirstIDX added in v1.0.3

func (ctq *ComponentTagQuery) FirstIDX(ctx context.Context) int

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

func (*ComponentTagQuery) FirstX added in v1.0.3

func (ctq *ComponentTagQuery) FirstX(ctx context.Context) *ComponentTag

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

func (*ComponentTagQuery) GroupBy added in v1.0.3

func (ctq *ComponentTagQuery) GroupBy(field string, fields ...string) *ComponentTagGroupBy

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

client.ComponentTag.Query().
	GroupBy(componenttag.FieldEn).
	Aggregate(model.Count()).
	Scan(ctx, &v)

func (*ComponentTagQuery) IDs added in v1.0.3

func (ctq *ComponentTagQuery) IDs(ctx context.Context) ([]int, error)

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

func (*ComponentTagQuery) IDsX added in v1.0.3

func (ctq *ComponentTagQuery) IDsX(ctx context.Context) []int

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

func (*ComponentTagQuery) Limit added in v1.0.3

func (ctq *ComponentTagQuery) Limit(limit int) *ComponentTagQuery

Limit adds a limit step to the query.

func (*ComponentTagQuery) Offset added in v1.0.3

func (ctq *ComponentTagQuery) Offset(offset int) *ComponentTagQuery

Offset adds an offset step to the query.

func (*ComponentTagQuery) Only added in v1.0.3

func (ctq *ComponentTagQuery) Only(ctx context.Context) (*ComponentTag, error)

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

func (*ComponentTagQuery) OnlyID added in v1.0.3

func (ctq *ComponentTagQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*ComponentTagQuery) OnlyIDX added in v1.0.3

func (ctq *ComponentTagQuery) OnlyIDX(ctx context.Context) int

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

func (*ComponentTagQuery) OnlyX added in v1.0.3

func (ctq *ComponentTagQuery) OnlyX(ctx context.Context) *ComponentTag

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

func (*ComponentTagQuery) Order added in v1.0.3

func (ctq *ComponentTagQuery) Order(o ...OrderFunc) *ComponentTagQuery

Order adds an order step to the query.

func (*ComponentTagQuery) QueryComponentTag added in v1.0.3

func (ctq *ComponentTagQuery) QueryComponentTag() *ComponentQuery

QueryComponentTag chains the current query on the "component_tag" edge.

func (*ComponentTagQuery) Select added in v1.0.3

func (ctq *ComponentTagQuery) Select(fields ...string) *ComponentTagSelect

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

client.ComponentTag.Query().
	Select(componenttag.FieldEn).
	Scan(ctx, &v)

func (*ComponentTagQuery) Unique added in v1.0.3

func (ctq *ComponentTagQuery) Unique(unique bool) *ComponentTagQuery

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 (*ComponentTagQuery) Where added in v1.0.3

Where adds a new predicate for the ComponentTagQuery builder.

func (*ComponentTagQuery) WithComponentTag added in v1.0.3

func (ctq *ComponentTagQuery) WithComponentTag(opts ...func(*ComponentQuery)) *ComponentTagQuery

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

type ComponentTagSelect added in v1.0.3

type ComponentTagSelect struct {
	*ComponentTagQuery
	// contains filtered or unexported fields
}

ComponentTagSelect is the builder for selecting fields of ComponentTag entities.

func (*ComponentTagSelect) Bool added in v1.0.3

func (cts *ComponentTagSelect) Bool(ctx context.Context) (_ bool, err error)

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

func (*ComponentTagSelect) BoolX added in v1.0.3

func (cts *ComponentTagSelect) BoolX(ctx context.Context) bool

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

func (*ComponentTagSelect) Bools added in v1.0.3

func (cts *ComponentTagSelect) Bools(ctx context.Context) ([]bool, error)

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

func (*ComponentTagSelect) BoolsX added in v1.0.3

func (cts *ComponentTagSelect) BoolsX(ctx context.Context) []bool

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

func (*ComponentTagSelect) Float64 added in v1.0.3

func (cts *ComponentTagSelect) Float64(ctx context.Context) (_ float64, err error)

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

func (*ComponentTagSelect) Float64X added in v1.0.3

func (cts *ComponentTagSelect) Float64X(ctx context.Context) float64

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

func (*ComponentTagSelect) Float64s added in v1.0.3

func (cts *ComponentTagSelect) Float64s(ctx context.Context) ([]float64, error)

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

func (*ComponentTagSelect) Float64sX added in v1.0.3

func (cts *ComponentTagSelect) Float64sX(ctx context.Context) []float64

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

func (*ComponentTagSelect) Int added in v1.0.3

func (cts *ComponentTagSelect) Int(ctx context.Context) (_ int, err error)

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

func (*ComponentTagSelect) IntX added in v1.0.3

func (cts *ComponentTagSelect) IntX(ctx context.Context) int

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

func (*ComponentTagSelect) Ints added in v1.0.3

func (cts *ComponentTagSelect) Ints(ctx context.Context) ([]int, error)

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

func (*ComponentTagSelect) IntsX added in v1.0.3

func (cts *ComponentTagSelect) IntsX(ctx context.Context) []int

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

func (*ComponentTagSelect) Scan added in v1.0.3

func (cts *ComponentTagSelect) Scan(ctx context.Context, v interface{}) error

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

func (*ComponentTagSelect) ScanX added in v1.0.3

func (cts *ComponentTagSelect) ScanX(ctx context.Context, v interface{})

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

func (*ComponentTagSelect) String added in v1.0.3

func (cts *ComponentTagSelect) String(ctx context.Context) (_ string, err error)

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

func (*ComponentTagSelect) StringX added in v1.0.3

func (cts *ComponentTagSelect) StringX(ctx context.Context) string

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

func (*ComponentTagSelect) Strings added in v1.0.3

func (cts *ComponentTagSelect) Strings(ctx context.Context) ([]string, error)

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

func (*ComponentTagSelect) StringsX added in v1.0.3

func (cts *ComponentTagSelect) StringsX(ctx context.Context) []string

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

type ComponentTagUpdate added in v1.0.3

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

ComponentTagUpdate is the builder for updating ComponentTag entities.

func (*ComponentTagUpdate) AddComponentTag added in v1.0.3

func (ctu *ComponentTagUpdate) AddComponentTag(c ...*Component) *ComponentTagUpdate

AddComponentTag adds the "component_tag" edges to the Component entity.

func (*ComponentTagUpdate) AddComponentTagIDs added in v1.0.3

func (ctu *ComponentTagUpdate) AddComponentTagIDs(ids ...int) *ComponentTagUpdate

AddComponentTagIDs adds the "component_tag" edge to the Component entity by IDs.

func (*ComponentTagUpdate) ClearComponentTag added in v1.0.3

func (ctu *ComponentTagUpdate) ClearComponentTag() *ComponentTagUpdate

ClearComponentTag clears all "component_tag" edges to the Component entity.

func (*ComponentTagUpdate) Exec added in v1.0.3

func (ctu *ComponentTagUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*ComponentTagUpdate) ExecX added in v1.0.3

func (ctu *ComponentTagUpdate) ExecX(ctx context.Context)

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

func (*ComponentTagUpdate) Mutation added in v1.0.3

func (ctu *ComponentTagUpdate) Mutation() *ComponentTagMutation

Mutation returns the ComponentTagMutation object of the builder.

func (*ComponentTagUpdate) RemoveComponentTag added in v1.0.3

func (ctu *ComponentTagUpdate) RemoveComponentTag(c ...*Component) *ComponentTagUpdate

RemoveComponentTag removes "component_tag" edges to Component entities.

func (*ComponentTagUpdate) RemoveComponentTagIDs added in v1.0.3

func (ctu *ComponentTagUpdate) RemoveComponentTagIDs(ids ...int) *ComponentTagUpdate

RemoveComponentTagIDs removes the "component_tag" edge to Component entities by IDs.

func (*ComponentTagUpdate) Save added in v1.0.3

func (ctu *ComponentTagUpdate) Save(ctx context.Context) (int, error)

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

func (*ComponentTagUpdate) SaveX added in v1.0.3

func (ctu *ComponentTagUpdate) SaveX(ctx context.Context) int

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

func (*ComponentTagUpdate) SetEn added in v1.0.3

SetEn sets the "en" field.

func (*ComponentTagUpdate) SetZh added in v1.0.3

SetZh sets the "zh" field.

func (*ComponentTagUpdate) Where added in v1.0.3

Where appends a list predicates to the ComponentTagUpdate builder.

type ComponentTagUpdateOne added in v1.0.3

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

ComponentTagUpdateOne is the builder for updating a single ComponentTag entity.

func (*ComponentTagUpdateOne) AddComponentTag added in v1.0.3

func (ctuo *ComponentTagUpdateOne) AddComponentTag(c ...*Component) *ComponentTagUpdateOne

AddComponentTag adds the "component_tag" edges to the Component entity.

func (*ComponentTagUpdateOne) AddComponentTagIDs added in v1.0.3

func (ctuo *ComponentTagUpdateOne) AddComponentTagIDs(ids ...int) *ComponentTagUpdateOne

AddComponentTagIDs adds the "component_tag" edge to the Component entity by IDs.

func (*ComponentTagUpdateOne) ClearComponentTag added in v1.0.3

func (ctuo *ComponentTagUpdateOne) ClearComponentTag() *ComponentTagUpdateOne

ClearComponentTag clears all "component_tag" edges to the Component entity.

func (*ComponentTagUpdateOne) Exec added in v1.0.3

func (ctuo *ComponentTagUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*ComponentTagUpdateOne) ExecX added in v1.0.3

func (ctuo *ComponentTagUpdateOne) ExecX(ctx context.Context)

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

func (*ComponentTagUpdateOne) Mutation added in v1.0.3

func (ctuo *ComponentTagUpdateOne) Mutation() *ComponentTagMutation

Mutation returns the ComponentTagMutation object of the builder.

func (*ComponentTagUpdateOne) RemoveComponentTag added in v1.0.3

func (ctuo *ComponentTagUpdateOne) RemoveComponentTag(c ...*Component) *ComponentTagUpdateOne

RemoveComponentTag removes "component_tag" edges to Component entities.

func (*ComponentTagUpdateOne) RemoveComponentTagIDs added in v1.0.3

func (ctuo *ComponentTagUpdateOne) RemoveComponentTagIDs(ids ...int) *ComponentTagUpdateOne

RemoveComponentTagIDs removes the "component_tag" edge to Component entities by IDs.

func (*ComponentTagUpdateOne) Save added in v1.0.3

Save executes the query and returns the updated ComponentTag entity.

func (*ComponentTagUpdateOne) SaveX added in v1.0.3

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

func (*ComponentTagUpdateOne) Select added in v1.0.3

func (ctuo *ComponentTagUpdateOne) Select(field string, fields ...string) *ComponentTagUpdateOne

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

func (*ComponentTagUpdateOne) SetEn added in v1.0.3

SetEn sets the "en" field.

func (*ComponentTagUpdateOne) SetZh added in v1.0.3

SetZh sets the "zh" field.

type ComponentTags added in v1.0.3

type ComponentTags []*ComponentTag

ComponentTags is a parsable slice of ComponentTag.

type ComponentUpdate added in v1.0.3

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

ComponentUpdate is the builder for updating Component entities.

func (*ComponentUpdate) AddComponentTagIDs added in v1.0.3

func (cu *ComponentUpdate) AddComponentTagIDs(ids ...int) *ComponentUpdate

AddComponentTagIDs adds the "component_tags" edge to the ComponentTag entity by IDs.

func (*ComponentUpdate) AddComponentTags added in v1.0.3

func (cu *ComponentUpdate) AddComponentTags(c ...*ComponentTag) *ComponentUpdate

AddComponentTags adds the "component_tags" edges to the ComponentTag entity.

func (*ComponentUpdate) AddRawLength added in v1.0.3

func (cu *ComponentUpdate) AddRawLength(u uint64) *ComponentUpdate

AddRawLength adds u to the "raw_length" field.

func (*ComponentUpdate) AddScore added in v1.0.3

func (cu *ComponentUpdate) AddScore(i int) *ComponentUpdate

AddScore adds i to the "score" field.

func (*ComponentUpdate) ClearComponentOwner added in v1.0.3

func (cu *ComponentUpdate) ClearComponentOwner() *ComponentUpdate

ClearComponentOwner clears the "component_owner" edge to the User entity.

func (*ComponentUpdate) ClearComponentTags added in v1.0.3

func (cu *ComponentUpdate) ClearComponentTags() *ComponentUpdate

ClearComponentTags clears all "component_tags" edges to the ComponentTag entity.

func (*ComponentUpdate) ClearVerifyTime added in v1.0.3

func (cu *ComponentUpdate) ClearVerifyTime() *ComponentUpdate

ClearVerifyTime clears the value of the "verify_time" field.

func (*ComponentUpdate) Exec added in v1.0.3

func (cu *ComponentUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*ComponentUpdate) ExecX added in v1.0.3

func (cu *ComponentUpdate) ExecX(ctx context.Context)

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

func (*ComponentUpdate) Mutation added in v1.0.3

func (cu *ComponentUpdate) Mutation() *ComponentMutation

Mutation returns the ComponentMutation object of the builder.

func (*ComponentUpdate) RemoveComponentTagIDs added in v1.0.3

func (cu *ComponentUpdate) RemoveComponentTagIDs(ids ...int) *ComponentUpdate

RemoveComponentTagIDs removes the "component_tags" edge to ComponentTag entities by IDs.

func (*ComponentUpdate) RemoveComponentTags added in v1.0.3

func (cu *ComponentUpdate) RemoveComponentTags(c ...*ComponentTag) *ComponentUpdate

RemoveComponentTags removes "component_tags" edges to ComponentTag entities.

func (*ComponentUpdate) Save added in v1.0.3

func (cu *ComponentUpdate) Save(ctx context.Context) (int, error)

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

func (*ComponentUpdate) SaveX added in v1.0.3

func (cu *ComponentUpdate) SaveX(ctx context.Context) int

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

func (*ComponentUpdate) SetCenter added in v1.0.3

func (cu *ComponentUpdate) SetCenter(b bool) *ComponentUpdate

SetCenter sets the "center" field.

func (*ComponentUpdate) SetComponentOwner added in v1.0.3

func (cu *ComponentUpdate) SetComponentOwner(u *User) *ComponentUpdate

SetComponentOwner sets the "component_owner" edge to the User entity.

func (*ComponentUpdate) SetComponentOwnerID added in v1.0.3

func (cu *ComponentUpdate) SetComponentOwnerID(id int) *ComponentUpdate

SetComponentOwnerID sets the "component_owner" edge to the User entity by ID.

func (*ComponentUpdate) SetDesc added in v1.0.3

func (cu *ComponentUpdate) SetDesc(s string) *ComponentUpdate

SetDesc sets the "desc" field.

func (*ComponentUpdate) SetName added in v1.0.3

func (cu *ComponentUpdate) SetName(s string) *ComponentUpdate

SetName sets the "name" field.

func (*ComponentUpdate) SetNillableCenter added in v1.0.3

func (cu *ComponentUpdate) SetNillableCenter(b *bool) *ComponentUpdate

SetNillableCenter sets the "center" field if the given value is not nil.

func (*ComponentUpdate) SetNillableRawLength added in v1.0.3

func (cu *ComponentUpdate) SetNillableRawLength(u *uint64) *ComponentUpdate

SetNillableRawLength sets the "raw_length" field if the given value is not nil.

func (*ComponentUpdate) SetNillableScore added in v1.0.3

func (cu *ComponentUpdate) SetNillableScore(i *int) *ComponentUpdate

SetNillableScore sets the "score" field if the given value is not nil.

func (*ComponentUpdate) SetNillableVerifyTime added in v1.0.3

func (cu *ComponentUpdate) SetNillableVerifyTime(t *time.Time) *ComponentUpdate

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

func (*ComponentUpdate) SetNillableVersion added in v1.0.3

func (cu *ComponentUpdate) SetNillableVersion(s *string) *ComponentUpdate

SetNillableVersion sets the "version" field if the given value is not nil.

func (*ComponentUpdate) SetOwnerID added in v1.0.3

func (cu *ComponentUpdate) SetOwnerID(i int) *ComponentUpdate

SetOwnerID sets the "owner_id" field.

func (*ComponentUpdate) SetRaw added in v1.0.3

func (cu *ComponentUpdate) SetRaw(s string) *ComponentUpdate

SetRaw sets the "raw" field.

func (*ComponentUpdate) SetRawLength added in v1.0.3

func (cu *ComponentUpdate) SetRawLength(u uint64) *ComponentUpdate

SetRawLength sets the "raw_length" field.

func (*ComponentUpdate) SetScore added in v1.0.3

func (cu *ComponentUpdate) SetScore(i int) *ComponentUpdate

SetScore sets the "score" field.

func (*ComponentUpdate) SetUpdateTime added in v1.0.3

func (cu *ComponentUpdate) SetUpdateTime(t time.Time) *ComponentUpdate

SetUpdateTime sets the "update_time" field.

func (*ComponentUpdate) SetVerifyTime added in v1.0.3

func (cu *ComponentUpdate) SetVerifyTime(t time.Time) *ComponentUpdate

SetVerifyTime sets the "verify_time" field.

func (*ComponentUpdate) SetVersion added in v1.0.3

func (cu *ComponentUpdate) SetVersion(s string) *ComponentUpdate

SetVersion sets the "version" field.

func (*ComponentUpdate) Where added in v1.0.3

Where appends a list predicates to the ComponentUpdate builder.

type ComponentUpdateOne added in v1.0.3

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

ComponentUpdateOne is the builder for updating a single Component entity.

func (*ComponentUpdateOne) AddComponentTagIDs added in v1.0.3

func (cuo *ComponentUpdateOne) AddComponentTagIDs(ids ...int) *ComponentUpdateOne

AddComponentTagIDs adds the "component_tags" edge to the ComponentTag entity by IDs.

func (*ComponentUpdateOne) AddComponentTags added in v1.0.3

func (cuo *ComponentUpdateOne) AddComponentTags(c ...*ComponentTag) *ComponentUpdateOne

AddComponentTags adds the "component_tags" edges to the ComponentTag entity.

func (*ComponentUpdateOne) AddRawLength added in v1.0.3

func (cuo *ComponentUpdateOne) AddRawLength(u uint64) *ComponentUpdateOne

AddRawLength adds u to the "raw_length" field.

func (*ComponentUpdateOne) AddScore added in v1.0.3

func (cuo *ComponentUpdateOne) AddScore(i int) *ComponentUpdateOne

AddScore adds i to the "score" field.

func (*ComponentUpdateOne) ClearComponentOwner added in v1.0.3

func (cuo *ComponentUpdateOne) ClearComponentOwner() *ComponentUpdateOne

ClearComponentOwner clears the "component_owner" edge to the User entity.

func (*ComponentUpdateOne) ClearComponentTags added in v1.0.3

func (cuo *ComponentUpdateOne) ClearComponentTags() *ComponentUpdateOne

ClearComponentTags clears all "component_tags" edges to the ComponentTag entity.

func (*ComponentUpdateOne) ClearVerifyTime added in v1.0.3

func (cuo *ComponentUpdateOne) ClearVerifyTime() *ComponentUpdateOne

ClearVerifyTime clears the value of the "verify_time" field.

func (*ComponentUpdateOne) Exec added in v1.0.3

func (cuo *ComponentUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*ComponentUpdateOne) ExecX added in v1.0.3

func (cuo *ComponentUpdateOne) ExecX(ctx context.Context)

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

func (*ComponentUpdateOne) Mutation added in v1.0.3

func (cuo *ComponentUpdateOne) Mutation() *ComponentMutation

Mutation returns the ComponentMutation object of the builder.

func (*ComponentUpdateOne) RemoveComponentTagIDs added in v1.0.3

func (cuo *ComponentUpdateOne) RemoveComponentTagIDs(ids ...int) *ComponentUpdateOne

RemoveComponentTagIDs removes the "component_tags" edge to ComponentTag entities by IDs.

func (*ComponentUpdateOne) RemoveComponentTags added in v1.0.3

func (cuo *ComponentUpdateOne) RemoveComponentTags(c ...*ComponentTag) *ComponentUpdateOne

RemoveComponentTags removes "component_tags" edges to ComponentTag entities.

func (*ComponentUpdateOne) Save added in v1.0.3

func (cuo *ComponentUpdateOne) Save(ctx context.Context) (*Component, error)

Save executes the query and returns the updated Component entity.

func (*ComponentUpdateOne) SaveX added in v1.0.3

func (cuo *ComponentUpdateOne) SaveX(ctx context.Context) *Component

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

func (*ComponentUpdateOne) Select added in v1.0.3

func (cuo *ComponentUpdateOne) Select(field string, fields ...string) *ComponentUpdateOne

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

func (*ComponentUpdateOne) SetCenter added in v1.0.3

func (cuo *ComponentUpdateOne) SetCenter(b bool) *ComponentUpdateOne

SetCenter sets the "center" field.

func (*ComponentUpdateOne) SetComponentOwner added in v1.0.3

func (cuo *ComponentUpdateOne) SetComponentOwner(u *User) *ComponentUpdateOne

SetComponentOwner sets the "component_owner" edge to the User entity.

func (*ComponentUpdateOne) SetComponentOwnerID added in v1.0.3

func (cuo *ComponentUpdateOne) SetComponentOwnerID(id int) *ComponentUpdateOne

SetComponentOwnerID sets the "component_owner" edge to the User entity by ID.

func (*ComponentUpdateOne) SetDesc added in v1.0.3

func (cuo *ComponentUpdateOne) SetDesc(s string) *ComponentUpdateOne

SetDesc sets the "desc" field.

func (*ComponentUpdateOne) SetName added in v1.0.3

func (cuo *ComponentUpdateOne) SetName(s string) *ComponentUpdateOne

SetName sets the "name" field.

func (*ComponentUpdateOne) SetNillableCenter added in v1.0.3

func (cuo *ComponentUpdateOne) SetNillableCenter(b *bool) *ComponentUpdateOne

SetNillableCenter sets the "center" field if the given value is not nil.

func (*ComponentUpdateOne) SetNillableRawLength added in v1.0.3

func (cuo *ComponentUpdateOne) SetNillableRawLength(u *uint64) *ComponentUpdateOne

SetNillableRawLength sets the "raw_length" field if the given value is not nil.

func (*ComponentUpdateOne) SetNillableScore added in v1.0.3

func (cuo *ComponentUpdateOne) SetNillableScore(i *int) *ComponentUpdateOne

SetNillableScore sets the "score" field if the given value is not nil.

func (*ComponentUpdateOne) SetNillableVerifyTime added in v1.0.3

func (cuo *ComponentUpdateOne) SetNillableVerifyTime(t *time.Time) *ComponentUpdateOne

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

func (*ComponentUpdateOne) SetNillableVersion added in v1.0.3

func (cuo *ComponentUpdateOne) SetNillableVersion(s *string) *ComponentUpdateOne

SetNillableVersion sets the "version" field if the given value is not nil.

func (*ComponentUpdateOne) SetOwnerID added in v1.0.3

func (cuo *ComponentUpdateOne) SetOwnerID(i int) *ComponentUpdateOne

SetOwnerID sets the "owner_id" field.

func (*ComponentUpdateOne) SetRaw added in v1.0.3

SetRaw sets the "raw" field.

func (*ComponentUpdateOne) SetRawLength added in v1.0.3

func (cuo *ComponentUpdateOne) SetRawLength(u uint64) *ComponentUpdateOne

SetRawLength sets the "raw_length" field.

func (*ComponentUpdateOne) SetScore added in v1.0.3

func (cuo *ComponentUpdateOne) SetScore(i int) *ComponentUpdateOne

SetScore sets the "score" field.

func (*ComponentUpdateOne) SetUpdateTime added in v1.0.3

func (cuo *ComponentUpdateOne) SetUpdateTime(t time.Time) *ComponentUpdateOne

SetUpdateTime sets the "update_time" field.

func (*ComponentUpdateOne) SetVerifyTime added in v1.0.3

func (cuo *ComponentUpdateOne) SetVerifyTime(t time.Time) *ComponentUpdateOne

SetVerifyTime sets the "verify_time" field.

func (*ComponentUpdateOne) SetVersion added in v1.0.3

func (cuo *ComponentUpdateOne) SetVersion(s string) *ComponentUpdateOne

SetVersion sets the "version" field.

type Components added in v1.0.3

type Components []*Component

Components is a parsable slice of Component.

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 Group added in v1.0.4

type Group struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// Sn holds the value of the "sn" field.
	Sn string `json:"sn,omitempty"`
	// Groupname holds the value of the "groupname" field.
	Groupname string `json:"groupname,omitempty"`
	// AvatarURL holds the value of the "avatar_url" field.
	AvatarURL *string `json:"avatar_url,omitempty"`
	// Address holds the value of the "address" field.
	Address *string `json:"address,omitempty"`
	// Homepage holds the value of the "homepage" field.
	Homepage *string `json:"homepage,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:"-"`
	// DeleteTime holds the value of the "delete_time" field.
	DeleteTime *time.Time `json:"-"`
	// contains filtered or unexported fields
}

Group is the model entity for the Group schema.

func (*Group) String added in v1.0.4

func (gr *Group) String() string

String implements the fmt.Stringer.

func (*Group) Unwrap added in v1.0.4

func (gr *Group) Unwrap() *Group

Unwrap unwraps the Group 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 (*Group) Update added in v1.0.4

func (gr *Group) Update() *GroupUpdateOne

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

type GroupClient added in v1.0.4

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

GroupClient is a client for the Group schema.

func NewGroupClient added in v1.0.4

func NewGroupClient(c config) *GroupClient

NewGroupClient returns a client for the Group from the given config.

func (*GroupClient) Create added in v1.0.4

func (c *GroupClient) Create() *GroupCreate

Create returns a create builder for Group.

func (*GroupClient) CreateBulk added in v1.0.4

func (c *GroupClient) CreateBulk(builders ...*GroupCreate) *GroupCreateBulk

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

func (*GroupClient) Delete added in v1.0.4

func (c *GroupClient) Delete() *GroupDelete

Delete returns a delete builder for Group.

func (*GroupClient) DeleteOne added in v1.0.4

func (c *GroupClient) DeleteOne(gr *Group) *GroupDeleteOne

DeleteOne returns a delete builder for the given entity.

func (*GroupClient) DeleteOneID added in v1.0.4

func (c *GroupClient) DeleteOneID(id int) *GroupDeleteOne

DeleteOneID returns a delete builder for the given id.

func (*GroupClient) Get added in v1.0.4

func (c *GroupClient) Get(ctx context.Context, id int) (*Group, error)

Get returns a Group entity by its id.

func (*GroupClient) GetX added in v1.0.4

func (c *GroupClient) GetX(ctx context.Context, id int) *Group

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

func (*GroupClient) Hooks added in v1.0.4

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

Hooks returns the client hooks.

func (*GroupClient) Query added in v1.0.4

func (c *GroupClient) Query() *GroupQuery

Query returns a query builder for Group.

func (*GroupClient) Update added in v1.0.4

func (c *GroupClient) Update() *GroupUpdate

Update returns an update builder for Group.

func (*GroupClient) UpdateOne added in v1.0.4

func (c *GroupClient) UpdateOne(gr *Group) *GroupUpdateOne

UpdateOne returns an update builder for the given entity.

func (*GroupClient) UpdateOneID added in v1.0.4

func (c *GroupClient) UpdateOneID(id int) *GroupUpdateOne

UpdateOneID returns an update builder for the given id.

func (*GroupClient) Use added in v1.0.4

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

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

type GroupCreate added in v1.0.4

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

GroupCreate is the builder for creating a Group entity.

func (*GroupCreate) Exec added in v1.0.6

func (gc *GroupCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*GroupCreate) ExecX added in v1.0.6

func (gc *GroupCreate) ExecX(ctx context.Context)

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

func (*GroupCreate) Mutation added in v1.0.4

func (gc *GroupCreate) Mutation() *GroupMutation

Mutation returns the GroupMutation object of the builder.

func (*GroupCreate) Save added in v1.0.4

func (gc *GroupCreate) Save(ctx context.Context) (*Group, error)

Save creates the Group in the database.

func (*GroupCreate) SaveX added in v1.0.4

func (gc *GroupCreate) SaveX(ctx context.Context) *Group

SaveX calls Save and panics if Save returns an error.

func (*GroupCreate) SetAddress added in v1.0.4

func (gc *GroupCreate) SetAddress(s string) *GroupCreate

SetAddress sets the "address" field.

func (*GroupCreate) SetAvatarURL added in v1.0.6

func (gc *GroupCreate) SetAvatarURL(s string) *GroupCreate

SetAvatarURL sets the "avatar_url" field.

func (*GroupCreate) SetCreateTime added in v1.0.4

func (gc *GroupCreate) SetCreateTime(t time.Time) *GroupCreate

SetCreateTime sets the "create_time" field.

func (*GroupCreate) SetDeleteTime added in v1.0.4

func (gc *GroupCreate) SetDeleteTime(t time.Time) *GroupCreate

SetDeleteTime sets the "delete_time" field.

func (*GroupCreate) SetGroupname added in v1.0.4

func (gc *GroupCreate) SetGroupname(s string) *GroupCreate

SetGroupname sets the "groupname" field.

func (*GroupCreate) SetHomepage added in v1.0.4

func (gc *GroupCreate) SetHomepage(s string) *GroupCreate

SetHomepage sets the "homepage" field.

func (*GroupCreate) SetID added in v1.0.4

func (gc *GroupCreate) SetID(i int) *GroupCreate

SetID sets the "id" field.

func (*GroupCreate) SetNillableAddress added in v1.0.4

func (gc *GroupCreate) SetNillableAddress(s *string) *GroupCreate

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

func (*GroupCreate) SetNillableAvatarURL added in v1.0.6

func (gc *GroupCreate) SetNillableAvatarURL(s *string) *GroupCreate

SetNillableAvatarURL sets the "avatar_url" field if the given value is not nil.

func (*GroupCreate) SetNillableCreateTime added in v1.0.4

func (gc *GroupCreate) SetNillableCreateTime(t *time.Time) *GroupCreate

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

func (*GroupCreate) SetNillableDeleteTime added in v1.0.4

func (gc *GroupCreate) SetNillableDeleteTime(t *time.Time) *GroupCreate

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

func (*GroupCreate) SetNillableHomepage added in v1.0.4

func (gc *GroupCreate) SetNillableHomepage(s *string) *GroupCreate

SetNillableHomepage sets the "homepage" field if the given value is not nil.

func (*GroupCreate) SetNillableSn added in v1.0.4

func (gc *GroupCreate) SetNillableSn(s *string) *GroupCreate

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

func (*GroupCreate) SetNillableUpdateTime added in v1.0.4

func (gc *GroupCreate) SetNillableUpdateTime(t *time.Time) *GroupCreate

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

func (*GroupCreate) SetSn added in v1.0.4

func (gc *GroupCreate) SetSn(s string) *GroupCreate

SetSn sets the "sn" field.

func (*GroupCreate) SetUpdateTime added in v1.0.4

func (gc *GroupCreate) SetUpdateTime(t time.Time) *GroupCreate

SetUpdateTime sets the "update_time" field.

type GroupCreateBulk added in v1.0.4

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

GroupCreateBulk is the builder for creating many Group entities in bulk.

func (*GroupCreateBulk) Exec added in v1.0.6

func (gcb *GroupCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*GroupCreateBulk) ExecX added in v1.0.6

func (gcb *GroupCreateBulk) ExecX(ctx context.Context)

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

func (*GroupCreateBulk) Save added in v1.0.4

func (gcb *GroupCreateBulk) Save(ctx context.Context) ([]*Group, error)

Save creates the Group entities in the database.

func (*GroupCreateBulk) SaveX added in v1.0.4

func (gcb *GroupCreateBulk) SaveX(ctx context.Context) []*Group

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

type GroupDelete added in v1.0.4

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

GroupDelete is the builder for deleting a Group entity.

func (*GroupDelete) Exec added in v1.0.4

func (gd *GroupDelete) Exec(ctx context.Context) (int, error)

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

func (*GroupDelete) ExecX added in v1.0.4

func (gd *GroupDelete) ExecX(ctx context.Context) int

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

func (*GroupDelete) Where added in v1.0.4

func (gd *GroupDelete) Where(ps ...predicate.Group) *GroupDelete

Where appends a list predicates to the GroupDelete builder.

type GroupDeleteOne added in v1.0.4

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

GroupDeleteOne is the builder for deleting a single Group entity.

func (*GroupDeleteOne) Exec added in v1.0.4

func (gdo *GroupDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*GroupDeleteOne) ExecX added in v1.0.4

func (gdo *GroupDeleteOne) ExecX(ctx context.Context)

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

type GroupGroupBy added in v1.0.4

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

GroupGroupBy is the group-by builder for Group entities.

func (*GroupGroupBy) Aggregate added in v1.0.4

func (ggb *GroupGroupBy) Aggregate(fns ...AggregateFunc) *GroupGroupBy

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

func (*GroupGroupBy) Bool added in v1.0.4

func (ggb *GroupGroupBy) 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 (*GroupGroupBy) BoolX added in v1.0.4

func (ggb *GroupGroupBy) BoolX(ctx context.Context) bool

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

func (*GroupGroupBy) Bools added in v1.0.4

func (ggb *GroupGroupBy) 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 (*GroupGroupBy) BoolsX added in v1.0.4

func (ggb *GroupGroupBy) BoolsX(ctx context.Context) []bool

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

func (*GroupGroupBy) Float64 added in v1.0.4

func (ggb *GroupGroupBy) 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 (*GroupGroupBy) Float64X added in v1.0.4

func (ggb *GroupGroupBy) Float64X(ctx context.Context) float64

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

func (*GroupGroupBy) Float64s added in v1.0.4

func (ggb *GroupGroupBy) 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 (*GroupGroupBy) Float64sX added in v1.0.4

func (ggb *GroupGroupBy) Float64sX(ctx context.Context) []float64

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

func (*GroupGroupBy) Int added in v1.0.4

func (ggb *GroupGroupBy) 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 (*GroupGroupBy) IntX added in v1.0.4

func (ggb *GroupGroupBy) IntX(ctx context.Context) int

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

func (*GroupGroupBy) Ints added in v1.0.4

func (ggb *GroupGroupBy) 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 (*GroupGroupBy) IntsX added in v1.0.4

func (ggb *GroupGroupBy) IntsX(ctx context.Context) []int

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

func (*GroupGroupBy) Scan added in v1.0.4

func (ggb *GroupGroupBy) Scan(ctx context.Context, v interface{}) error

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

func (*GroupGroupBy) ScanX added in v1.0.4

func (ggb *GroupGroupBy) ScanX(ctx context.Context, v interface{})

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

func (*GroupGroupBy) String added in v1.0.4

func (ggb *GroupGroupBy) 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 (*GroupGroupBy) StringX added in v1.0.4

func (ggb *GroupGroupBy) StringX(ctx context.Context) string

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

func (*GroupGroupBy) Strings added in v1.0.4

func (ggb *GroupGroupBy) 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 (*GroupGroupBy) StringsX added in v1.0.4

func (ggb *GroupGroupBy) StringsX(ctx context.Context) []string

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

type GroupMutation added in v1.0.4

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

GroupMutation represents an operation that mutates the Group nodes in the graph.

func (*GroupMutation) AddField added in v1.0.4

func (m *GroupMutation) 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 (*GroupMutation) AddedEdges added in v1.0.4

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

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

func (*GroupMutation) AddedField added in v1.0.4

func (m *GroupMutation) 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 (*GroupMutation) AddedFields added in v1.0.4

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

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

func (*GroupMutation) AddedIDs added in v1.0.4

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

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

func (*GroupMutation) Address added in v1.0.4

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

Address returns the value of the "address" field in the mutation.

func (*GroupMutation) AddressCleared added in v1.0.4

func (m *GroupMutation) AddressCleared() bool

AddressCleared returns if the "address" field was cleared in this mutation.

func (*GroupMutation) AvatarURL added in v1.0.6

func (m *GroupMutation) AvatarURL() (r string, exists bool)

AvatarURL returns the value of the "avatar_url" field in the mutation.

func (*GroupMutation) AvatarURLCleared added in v1.0.6

func (m *GroupMutation) AvatarURLCleared() bool

AvatarURLCleared returns if the "avatar_url" field was cleared in this mutation.

func (*GroupMutation) ClearAddress added in v1.0.4

func (m *GroupMutation) ClearAddress()

ClearAddress clears the value of the "address" field.

func (*GroupMutation) ClearAvatarURL added in v1.0.6

func (m *GroupMutation) ClearAvatarURL()

ClearAvatarURL clears the value of the "avatar_url" field.

func (*GroupMutation) ClearDeleteTime added in v1.0.4

func (m *GroupMutation) ClearDeleteTime()

ClearDeleteTime clears the value of the "delete_time" field.

func (*GroupMutation) ClearEdge added in v1.0.4

func (m *GroupMutation) 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 (*GroupMutation) ClearField added in v1.0.4

func (m *GroupMutation) 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 (*GroupMutation) ClearHomepage added in v1.0.4

func (m *GroupMutation) ClearHomepage()

ClearHomepage clears the value of the "homepage" field.

func (*GroupMutation) ClearedEdges added in v1.0.4

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

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

func (*GroupMutation) ClearedFields added in v1.0.4

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

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

func (GroupMutation) Client added in v1.0.4

func (m GroupMutation) 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 (*GroupMutation) CreateTime added in v1.0.4

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

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

func (*GroupMutation) DeleteTime added in v1.0.4

func (m *GroupMutation) DeleteTime() (r time.Time, exists bool)

DeleteTime returns the value of the "delete_time" field in the mutation.

func (*GroupMutation) DeleteTimeCleared added in v1.0.4

func (m *GroupMutation) DeleteTimeCleared() bool

DeleteTimeCleared returns if the "delete_time" field was cleared in this mutation.

func (*GroupMutation) EdgeCleared added in v1.0.4

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

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

func (*GroupMutation) Field added in v1.0.4

func (m *GroupMutation) 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 (*GroupMutation) FieldCleared added in v1.0.4

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

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

func (*GroupMutation) Fields added in v1.0.4

func (m *GroupMutation) 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 (*GroupMutation) Groupname added in v1.0.4

func (m *GroupMutation) Groupname() (r string, exists bool)

Groupname returns the value of the "groupname" field in the mutation.

func (*GroupMutation) Homepage added in v1.0.4

func (m *GroupMutation) Homepage() (r string, exists bool)

Homepage returns the value of the "homepage" field in the mutation.

func (*GroupMutation) HomepageCleared added in v1.0.4

func (m *GroupMutation) HomepageCleared() bool

HomepageCleared returns if the "homepage" field was cleared in this mutation.

func (*GroupMutation) ID added in v1.0.4

func (m *GroupMutation) 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 (*GroupMutation) OldAddress added in v1.0.4

func (m *GroupMutation) OldAddress(ctx context.Context) (v *string, err error)

OldAddress returns the old "address" field's value of the Group entity. If the Group 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 (*GroupMutation) OldAvatarURL added in v1.0.6

func (m *GroupMutation) OldAvatarURL(ctx context.Context) (v *string, err error)

OldAvatarURL returns the old "avatar_url" field's value of the Group entity. If the Group 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 (*GroupMutation) OldCreateTime added in v1.0.4

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

OldCreateTime returns the old "create_time" field's value of the Group entity. If the Group 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 (*GroupMutation) OldDeleteTime added in v1.0.4

func (m *GroupMutation) OldDeleteTime(ctx context.Context) (v *time.Time, err error)

OldDeleteTime returns the old "delete_time" field's value of the Group entity. If the Group 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 (*GroupMutation) OldField added in v1.0.4

func (m *GroupMutation) 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 (*GroupMutation) OldGroupname added in v1.0.4

func (m *GroupMutation) OldGroupname(ctx context.Context) (v string, err error)

OldGroupname returns the old "groupname" field's value of the Group entity. If the Group 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 (*GroupMutation) OldHomepage added in v1.0.4

func (m *GroupMutation) OldHomepage(ctx context.Context) (v *string, err error)

OldHomepage returns the old "homepage" field's value of the Group entity. If the Group 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 (*GroupMutation) OldSn added in v1.0.4

func (m *GroupMutation) OldSn(ctx context.Context) (v string, err error)

OldSn returns the old "sn" field's value of the Group entity. If the Group 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 (*GroupMutation) OldUpdateTime added in v1.0.4

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

OldUpdateTime returns the old "update_time" field's value of the Group entity. If the Group 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 (*GroupMutation) Op added in v1.0.4

func (m *GroupMutation) Op() Op

Op returns the operation name.

func (*GroupMutation) RemovedEdges added in v1.0.4

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

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

func (*GroupMutation) RemovedIDs added in v1.0.4

func (m *GroupMutation) 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 (*GroupMutation) ResetAddress added in v1.0.4

func (m *GroupMutation) ResetAddress()

ResetAddress resets all changes to the "address" field.

func (*GroupMutation) ResetAvatarURL added in v1.0.6

func (m *GroupMutation) ResetAvatarURL()

ResetAvatarURL resets all changes to the "avatar_url" field.

func (*GroupMutation) ResetCreateTime added in v1.0.4

func (m *GroupMutation) ResetCreateTime()

ResetCreateTime resets all changes to the "create_time" field.

func (*GroupMutation) ResetDeleteTime added in v1.0.4

func (m *GroupMutation) ResetDeleteTime()

ResetDeleteTime resets all changes to the "delete_time" field.

func (*GroupMutation) ResetEdge added in v1.0.4

func (m *GroupMutation) 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 (*GroupMutation) ResetField added in v1.0.4

func (m *GroupMutation) 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 (*GroupMutation) ResetGroupname added in v1.0.4

func (m *GroupMutation) ResetGroupname()

ResetGroupname resets all changes to the "groupname" field.

func (*GroupMutation) ResetHomepage added in v1.0.4

func (m *GroupMutation) ResetHomepage()

ResetHomepage resets all changes to the "homepage" field.

func (*GroupMutation) ResetSn added in v1.0.4

func (m *GroupMutation) ResetSn()

ResetSn resets all changes to the "sn" field.

func (*GroupMutation) ResetUpdateTime added in v1.0.4

func (m *GroupMutation) ResetUpdateTime()

ResetUpdateTime resets all changes to the "update_time" field.

func (*GroupMutation) SetAddress added in v1.0.4

func (m *GroupMutation) SetAddress(s string)

SetAddress sets the "address" field.

func (*GroupMutation) SetAvatarURL added in v1.0.6

func (m *GroupMutation) SetAvatarURL(s string)

SetAvatarURL sets the "avatar_url" field.

func (*GroupMutation) SetCreateTime added in v1.0.4

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

SetCreateTime sets the "create_time" field.

func (*GroupMutation) SetDeleteTime added in v1.0.4

func (m *GroupMutation) SetDeleteTime(t time.Time)

SetDeleteTime sets the "delete_time" field.

func (*GroupMutation) SetField added in v1.0.4

func (m *GroupMutation) 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 (*GroupMutation) SetGroupname added in v1.0.4

func (m *GroupMutation) SetGroupname(s string)

SetGroupname sets the "groupname" field.

func (*GroupMutation) SetHomepage added in v1.0.4

func (m *GroupMutation) SetHomepage(s string)

SetHomepage sets the "homepage" field.

func (*GroupMutation) SetID added in v1.0.4

func (m *GroupMutation) SetID(id int)

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

func (*GroupMutation) SetSn added in v1.0.4

func (m *GroupMutation) SetSn(s string)

SetSn sets the "sn" field.

func (*GroupMutation) SetUpdateTime added in v1.0.4

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

SetUpdateTime sets the "update_time" field.

func (*GroupMutation) Sn added in v1.0.4

func (m *GroupMutation) Sn() (r string, exists bool)

Sn returns the value of the "sn" field in the mutation.

func (GroupMutation) Tx added in v1.0.4

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

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

func (*GroupMutation) Type added in v1.0.4

func (m *GroupMutation) Type() string

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

func (*GroupMutation) UpdateTime added in v1.0.4

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

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

func (*GroupMutation) Where added in v1.0.6

func (m *GroupMutation) Where(ps ...predicate.Group)

Where appends a list predicates to the GroupMutation builder.

type GroupQuery added in v1.0.4

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

GroupQuery is the builder for querying Group entities.

func (*GroupQuery) All added in v1.0.4

func (gq *GroupQuery) All(ctx context.Context) ([]*Group, error)

All executes the query and returns a list of Groups.

func (*GroupQuery) AllX added in v1.0.4

func (gq *GroupQuery) AllX(ctx context.Context) []*Group

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

func (*GroupQuery) Clone added in v1.0.4

func (gq *GroupQuery) Clone() *GroupQuery

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

func (*GroupQuery) Count added in v1.0.4

func (gq *GroupQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*GroupQuery) CountX added in v1.0.4

func (gq *GroupQuery) CountX(ctx context.Context) int

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

func (*GroupQuery) Exist added in v1.0.4

func (gq *GroupQuery) Exist(ctx context.Context) (bool, error)

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

func (*GroupQuery) ExistX added in v1.0.4

func (gq *GroupQuery) ExistX(ctx context.Context) bool

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

func (*GroupQuery) First added in v1.0.4

func (gq *GroupQuery) First(ctx context.Context) (*Group, error)

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

func (*GroupQuery) FirstID added in v1.0.4

func (gq *GroupQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*GroupQuery) FirstIDX added in v1.0.4

func (gq *GroupQuery) FirstIDX(ctx context.Context) int

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

func (*GroupQuery) FirstX added in v1.0.4

func (gq *GroupQuery) FirstX(ctx context.Context) *Group

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

func (*GroupQuery) GroupBy added in v1.0.4

func (gq *GroupQuery) GroupBy(field string, fields ...string) *GroupGroupBy

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

client.Group.Query().
	GroupBy(group.FieldSn).
	Aggregate(model.Count()).
	Scan(ctx, &v)

func (*GroupQuery) IDs added in v1.0.4

func (gq *GroupQuery) IDs(ctx context.Context) ([]int, error)

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

func (*GroupQuery) IDsX added in v1.0.4

func (gq *GroupQuery) IDsX(ctx context.Context) []int

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

func (*GroupQuery) Limit added in v1.0.4

func (gq *GroupQuery) Limit(limit int) *GroupQuery

Limit adds a limit step to the query.

func (*GroupQuery) Offset added in v1.0.4

func (gq *GroupQuery) Offset(offset int) *GroupQuery

Offset adds an offset step to the query.

func (*GroupQuery) Only added in v1.0.4

func (gq *GroupQuery) Only(ctx context.Context) (*Group, error)

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

func (*GroupQuery) OnlyID added in v1.0.4

func (gq *GroupQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*GroupQuery) OnlyIDX added in v1.0.4

func (gq *GroupQuery) OnlyIDX(ctx context.Context) int

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

func (*GroupQuery) OnlyX added in v1.0.4

func (gq *GroupQuery) OnlyX(ctx context.Context) *Group

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

func (*GroupQuery) Order added in v1.0.4

func (gq *GroupQuery) Order(o ...OrderFunc) *GroupQuery

Order adds an order step to the query.

func (*GroupQuery) Select added in v1.0.4

func (gq *GroupQuery) Select(fields ...string) *GroupSelect

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:"sn,omitempty"`
}

client.Group.Query().
	Select(group.FieldSn).
	Scan(ctx, &v)

func (*GroupQuery) Unique added in v1.0.4

func (gq *GroupQuery) Unique(unique bool) *GroupQuery

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 (*GroupQuery) Where added in v1.0.4

func (gq *GroupQuery) Where(ps ...predicate.Group) *GroupQuery

Where adds a new predicate for the GroupQuery builder.

type GroupSelect added in v1.0.4

type GroupSelect struct {
	*GroupQuery
	// contains filtered or unexported fields
}

GroupSelect is the builder for selecting fields of Group entities.

func (*GroupSelect) Bool added in v1.0.4

func (gs *GroupSelect) Bool(ctx context.Context) (_ bool, err error)

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

func (*GroupSelect) BoolX added in v1.0.4

func (gs *GroupSelect) BoolX(ctx context.Context) bool

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

func (*GroupSelect) Bools added in v1.0.4

func (gs *GroupSelect) Bools(ctx context.Context) ([]bool, error)

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

func (*GroupSelect) BoolsX added in v1.0.4

func (gs *GroupSelect) BoolsX(ctx context.Context) []bool

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

func (*GroupSelect) Float64 added in v1.0.4

func (gs *GroupSelect) Float64(ctx context.Context) (_ float64, err error)

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

func (*GroupSelect) Float64X added in v1.0.4

func (gs *GroupSelect) Float64X(ctx context.Context) float64

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

func (*GroupSelect) Float64s added in v1.0.4

func (gs *GroupSelect) Float64s(ctx context.Context) ([]float64, error)

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

func (*GroupSelect) Float64sX added in v1.0.4

func (gs *GroupSelect) Float64sX(ctx context.Context) []float64

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

func (*GroupSelect) Int added in v1.0.4

func (gs *GroupSelect) Int(ctx context.Context) (_ int, err error)

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

func (*GroupSelect) IntX added in v1.0.4

func (gs *GroupSelect) IntX(ctx context.Context) int

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

func (*GroupSelect) Ints added in v1.0.4

func (gs *GroupSelect) Ints(ctx context.Context) ([]int, error)

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

func (*GroupSelect) IntsX added in v1.0.4

func (gs *GroupSelect) IntsX(ctx context.Context) []int

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

func (*GroupSelect) Scan added in v1.0.4

func (gs *GroupSelect) Scan(ctx context.Context, v interface{}) error

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

func (*GroupSelect) ScanX added in v1.0.4

func (gs *GroupSelect) ScanX(ctx context.Context, v interface{})

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

func (*GroupSelect) String added in v1.0.4

func (gs *GroupSelect) String(ctx context.Context) (_ string, err error)

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

func (*GroupSelect) StringX added in v1.0.4

func (gs *GroupSelect) StringX(ctx context.Context) string

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

func (*GroupSelect) Strings added in v1.0.4

func (gs *GroupSelect) Strings(ctx context.Context) ([]string, error)

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

func (*GroupSelect) StringsX added in v1.0.4

func (gs *GroupSelect) StringsX(ctx context.Context) []string

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

type GroupUpdate added in v1.0.4

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

GroupUpdate is the builder for updating Group entities.

func (*GroupUpdate) ClearAddress added in v1.0.4

func (gu *GroupUpdate) ClearAddress() *GroupUpdate

ClearAddress clears the value of the "address" field.

func (*GroupUpdate) ClearAvatarURL added in v1.0.6

func (gu *GroupUpdate) ClearAvatarURL() *GroupUpdate

ClearAvatarURL clears the value of the "avatar_url" field.

func (*GroupUpdate) ClearDeleteTime added in v1.0.4

func (gu *GroupUpdate) ClearDeleteTime() *GroupUpdate

ClearDeleteTime clears the value of the "delete_time" field.

func (*GroupUpdate) ClearHomepage added in v1.0.4

func (gu *GroupUpdate) ClearHomepage() *GroupUpdate

ClearHomepage clears the value of the "homepage" field.

func (*GroupUpdate) Exec added in v1.0.4

func (gu *GroupUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*GroupUpdate) ExecX added in v1.0.4

func (gu *GroupUpdate) ExecX(ctx context.Context)

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

func (*GroupUpdate) Mutation added in v1.0.4

func (gu *GroupUpdate) Mutation() *GroupMutation

Mutation returns the GroupMutation object of the builder.

func (*GroupUpdate) Save added in v1.0.4

func (gu *GroupUpdate) Save(ctx context.Context) (int, error)

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

func (*GroupUpdate) SaveX added in v1.0.4

func (gu *GroupUpdate) SaveX(ctx context.Context) int

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

func (*GroupUpdate) SetAddress added in v1.0.4

func (gu *GroupUpdate) SetAddress(s string) *GroupUpdate

SetAddress sets the "address" field.

func (*GroupUpdate) SetAvatarURL added in v1.0.6

func (gu *GroupUpdate) SetAvatarURL(s string) *GroupUpdate

SetAvatarURL sets the "avatar_url" field.

func (*GroupUpdate) SetDeleteTime added in v1.0.4

func (gu *GroupUpdate) SetDeleteTime(t time.Time) *GroupUpdate

SetDeleteTime sets the "delete_time" field.

func (*GroupUpdate) SetGroupname added in v1.0.4

func (gu *GroupUpdate) SetGroupname(s string) *GroupUpdate

SetGroupname sets the "groupname" field.

func (*GroupUpdate) SetHomepage added in v1.0.4

func (gu *GroupUpdate) SetHomepage(s string) *GroupUpdate

SetHomepage sets the "homepage" field.

func (*GroupUpdate) SetNillableAddress added in v1.0.4

func (gu *GroupUpdate) SetNillableAddress(s *string) *GroupUpdate

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

func (*GroupUpdate) SetNillableAvatarURL added in v1.0.6

func (gu *GroupUpdate) SetNillableAvatarURL(s *string) *GroupUpdate

SetNillableAvatarURL sets the "avatar_url" field if the given value is not nil.

func (*GroupUpdate) SetNillableDeleteTime added in v1.0.4

func (gu *GroupUpdate) SetNillableDeleteTime(t *time.Time) *GroupUpdate

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

func (*GroupUpdate) SetNillableHomepage added in v1.0.4

func (gu *GroupUpdate) SetNillableHomepage(s *string) *GroupUpdate

SetNillableHomepage sets the "homepage" field if the given value is not nil.

func (*GroupUpdate) SetUpdateTime added in v1.0.4

func (gu *GroupUpdate) SetUpdateTime(t time.Time) *GroupUpdate

SetUpdateTime sets the "update_time" field.

func (*GroupUpdate) Where added in v1.0.4

func (gu *GroupUpdate) Where(ps ...predicate.Group) *GroupUpdate

Where appends a list predicates to the GroupUpdate builder.

type GroupUpdateOne added in v1.0.4

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

GroupUpdateOne is the builder for updating a single Group entity.

func (*GroupUpdateOne) ClearAddress added in v1.0.4

func (guo *GroupUpdateOne) ClearAddress() *GroupUpdateOne

ClearAddress clears the value of the "address" field.

func (*GroupUpdateOne) ClearAvatarURL added in v1.0.6

func (guo *GroupUpdateOne) ClearAvatarURL() *GroupUpdateOne

ClearAvatarURL clears the value of the "avatar_url" field.

func (*GroupUpdateOne) ClearDeleteTime added in v1.0.4

func (guo *GroupUpdateOne) ClearDeleteTime() *GroupUpdateOne

ClearDeleteTime clears the value of the "delete_time" field.

func (*GroupUpdateOne) ClearHomepage added in v1.0.4

func (guo *GroupUpdateOne) ClearHomepage() *GroupUpdateOne

ClearHomepage clears the value of the "homepage" field.

func (*GroupUpdateOne) Exec added in v1.0.4

func (guo *GroupUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*GroupUpdateOne) ExecX added in v1.0.4

func (guo *GroupUpdateOne) ExecX(ctx context.Context)

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

func (*GroupUpdateOne) Mutation added in v1.0.4

func (guo *GroupUpdateOne) Mutation() *GroupMutation

Mutation returns the GroupMutation object of the builder.

func (*GroupUpdateOne) Save added in v1.0.4

func (guo *GroupUpdateOne) Save(ctx context.Context) (*Group, error)

Save executes the query and returns the updated Group entity.

func (*GroupUpdateOne) SaveX added in v1.0.4

func (guo *GroupUpdateOne) SaveX(ctx context.Context) *Group

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

func (*GroupUpdateOne) Select added in v1.0.4

func (guo *GroupUpdateOne) Select(field string, fields ...string) *GroupUpdateOne

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

func (*GroupUpdateOne) SetAddress added in v1.0.4

func (guo *GroupUpdateOne) SetAddress(s string) *GroupUpdateOne

SetAddress sets the "address" field.

func (*GroupUpdateOne) SetAvatarURL added in v1.0.6

func (guo *GroupUpdateOne) SetAvatarURL(s string) *GroupUpdateOne

SetAvatarURL sets the "avatar_url" field.

func (*GroupUpdateOne) SetDeleteTime added in v1.0.4

func (guo *GroupUpdateOne) SetDeleteTime(t time.Time) *GroupUpdateOne

SetDeleteTime sets the "delete_time" field.

func (*GroupUpdateOne) SetGroupname added in v1.0.4

func (guo *GroupUpdateOne) SetGroupname(s string) *GroupUpdateOne

SetGroupname sets the "groupname" field.

func (*GroupUpdateOne) SetHomepage added in v1.0.4

func (guo *GroupUpdateOne) SetHomepage(s string) *GroupUpdateOne

SetHomepage sets the "homepage" field.

func (*GroupUpdateOne) SetNillableAddress added in v1.0.4

func (guo *GroupUpdateOne) SetNillableAddress(s *string) *GroupUpdateOne

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

func (*GroupUpdateOne) SetNillableAvatarURL added in v1.0.6

func (guo *GroupUpdateOne) SetNillableAvatarURL(s *string) *GroupUpdateOne

SetNillableAvatarURL sets the "avatar_url" field if the given value is not nil.

func (*GroupUpdateOne) SetNillableDeleteTime added in v1.0.4

func (guo *GroupUpdateOne) SetNillableDeleteTime(t *time.Time) *GroupUpdateOne

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

func (*GroupUpdateOne) SetNillableHomepage added in v1.0.4

func (guo *GroupUpdateOne) SetNillableHomepage(s *string) *GroupUpdateOne

SetNillableHomepage sets the "homepage" field if the given value is not nil.

func (*GroupUpdateOne) SetUpdateTime added in v1.0.4

func (guo *GroupUpdateOne) SetUpdateTime(t time.Time) *GroupUpdateOne

SetUpdateTime sets the "update_time" field.

type Groups added in v1.0.4

type Groups []*Group

Groups is a parsable slice of Group.

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 {

	// Component is the client for interacting with the Component builders.
	Component *ComponentClient
	// ComponentTag is the client for interacting with the ComponentTag builders.
	ComponentTag *ComponentTagClient
	// Group is the client for interacting with the Group builders.
	Group *GroupClient
	// 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:"sn,omitempty"`
	// Nickname holds the value of the "nickname" field.
	Nickname *string `json:"nickname,omitempty"`
	// Username holds the value of the "username" field.
	Username string `json:"username,omitempty"`
	// Gender holds the value of the "gender" field.
	Gender user.Gender `json:"gender,omitempty"`
	// Phone holds the value of the "phone" field.
	Phone *string `json:"phone,omitempty"`
	// AvatarURL holds the value of the "avatar_url" field.
	AvatarURL *string `json:"avatar_url,omitempty"`
	// Homepage holds the value of the "homepage" field.
	Homepage *string `json:"homepage,omitempty"`
	// Bio holds the value of the "bio" field.
	Bio *string `json:"bio,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) QueryComponents added in v1.0.3

func (u *User) QueryComponents() *ComponentQuery

QueryComponents queries the "Components" edge of the User entity.

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) QueryComponents added in v1.0.3

func (c *UserClient) QueryComponents(u *User) *ComponentQuery

QueryComponents queries the Components edge of a 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) AddComponentIDs added in v1.0.3

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

AddComponentIDs adds the "Components" edge to the Component entity by IDs.

func (*UserCreate) AddComponents added in v1.0.3

func (uc *UserCreate) AddComponents(c ...*Component) *UserCreate

AddComponents adds the "Components" edges to the Component 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) SetAvatarURL added in v1.0.6

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

SetAvatarURL sets the "avatar_url" field.

func (*UserCreate) SetBio added in v1.0.6

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

SetBio sets the "bio" field.

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) SetGender added in v1.0.3

func (uc *UserCreate) SetGender(u user.Gender) *UserCreate

SetGender sets the "gender" field.

func (*UserCreate) SetHomepage added in v1.0.3

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

SetHomepage sets the "homepage" 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) SetNillableAvatarURL added in v1.0.6

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

SetNillableAvatarURL sets the "avatar_url" field if the given value is not nil.

func (*UserCreate) SetNillableBio added in v1.0.6

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

SetNillableBio sets the "bio" field if the given value is not nil.

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) SetNillableGender added in v1.0.3

func (uc *UserCreate) SetNillableGender(u *user.Gender) *UserCreate

SetNillableGender sets the "gender" field if the given value is not nil.

func (*UserCreate) SetNillableHomepage added in v1.0.3

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

SetNillableHomepage sets the "homepage" 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) SetNillableNickname added in v1.0.5

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

SetNillableNickname sets the "nickname" 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.

func (*UserCreate) SetUsername added in v1.0.5

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

SetUsername sets the "username" 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"`
	// Components holds the value of the Components edge.
	Components []*Component `json:"components,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) ComponentsOrErr added in v1.0.3

func (e UserEdges) ComponentsOrErr() ([]*Component, error)

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

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) 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) 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) 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) 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) 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) 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) 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) 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) AddComponentIDs added in v1.0.3

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

AddComponentIDs adds the "Components" edge to the Component entity by ids.

func (*UserMutation) AddField

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

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

func (*UserMutation) 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) AvatarURL added in v1.0.6

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

AvatarURL returns the value of the "avatar_url" field in the mutation.

func (*UserMutation) AvatarURLCleared added in v1.0.6

func (m *UserMutation) AvatarURLCleared() bool

AvatarURLCleared returns if the "avatar_url" field was cleared in this mutation.

func (*UserMutation) Bio added in v1.0.6

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

Bio returns the value of the "bio" field in the mutation.

func (*UserMutation) BioCleared added in v1.0.6

func (m *UserMutation) BioCleared() bool

BioCleared returns if the "bio" field was cleared in this mutation.

func (*UserMutation) ClearAvatarURL added in v1.0.6

func (m *UserMutation) ClearAvatarURL()

ClearAvatarURL clears the value of the "avatar_url" field.

func (*UserMutation) ClearBio added in v1.0.6

func (m *UserMutation) ClearBio()

ClearBio clears the value of the "bio" field.

func (*UserMutation) ClearComponents added in v1.0.3

func (m *UserMutation) ClearComponents()

ClearComponents clears the "Components" edge to the Component entity.

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) ClearHomepage added in v1.0.3

func (m *UserMutation) ClearHomepage()

ClearHomepage clears the value of the "homepage" field.

func (*UserMutation) ClearLastPwdAuth

func (m *UserMutation) ClearLastPwdAuth()

ClearLastPwdAuth clears the value of the "last_pwd_auth" field.

func (*UserMutation) ClearNickname added in v1.0.5

func (m *UserMutation) ClearNickname()

ClearNickname clears the value of the "nickname" 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) ComponentsCleared added in v1.0.3

func (m *UserMutation) ComponentsCleared() bool

ComponentsCleared reports if the "Components" edge to the Component entity was cleared.

func (*UserMutation) ComponentsIDs added in v1.0.3

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

ComponentsIDs returns the "Components" edge IDs in the mutation.

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) Gender added in v1.0.3

func (m *UserMutation) Gender() (r user.Gender, exists bool)

Gender returns the value of the "gender" field in the mutation.

func (*UserMutation) Homepage added in v1.0.3

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

Homepage returns the value of the "homepage" field in the mutation.

func (*UserMutation) HomepageCleared added in v1.0.3

func (m *UserMutation) HomepageCleared() bool

HomepageCleared returns if the "homepage" field was cleared in this mutation.

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) NicknameCleared added in v1.0.5

func (m *UserMutation) NicknameCleared() bool

NicknameCleared returns if the "nickname" field was cleared in this mutation.

func (*UserMutation) OldAvatarURL added in v1.0.6

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

OldAvatarURL returns the old "avatar_url" 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) OldBio added in v1.0.6

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

OldBio returns the old "bio" 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) 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) OldGender added in v1.0.3

func (m *UserMutation) OldGender(ctx context.Context) (v user.Gender, err error)

OldGender returns the old "gender" 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) OldHomepage added in v1.0.3

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

OldHomepage returns the old "homepage" 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) 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) OldUsername added in v1.0.5

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

OldUsername returns the old "username" 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) RemoveComponentIDs added in v1.0.3

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

RemoveComponentIDs removes the "Components" edge to the Component entity by IDs.

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) RemovedComponentsIDs added in v1.0.3

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

RemovedComponents returns the removed IDs of the "Components" edge to the Component entity.

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) ResetAvatarURL added in v1.0.6

func (m *UserMutation) ResetAvatarURL()

ResetAvatarURL resets all changes to the "avatar_url" field.

func (*UserMutation) ResetBio added in v1.0.6

func (m *UserMutation) ResetBio()

ResetBio resets all changes to the "bio" field.

func (*UserMutation) ResetComponents added in v1.0.3

func (m *UserMutation) ResetComponents()

ResetComponents resets all changes to the "Components" edge.

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) ResetGender added in v1.0.3

func (m *UserMutation) ResetGender()

ResetGender resets all changes to the "gender" field.

func (*UserMutation) ResetHomepage added in v1.0.3

func (m *UserMutation) ResetHomepage()

ResetHomepage resets all changes to the "homepage" field.

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) ResetUsername added in v1.0.5

func (m *UserMutation) ResetUsername()

ResetUsername resets all changes to the "username" field.

func (*UserMutation) SetAvatarURL added in v1.0.6

func (m *UserMutation) SetAvatarURL(s string)

SetAvatarURL sets the "avatar_url" field.

func (*UserMutation) SetBio added in v1.0.6

func (m *UserMutation) SetBio(s string)

SetBio sets the "bio" field.

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) SetGender added in v1.0.3

func (m *UserMutation) SetGender(u user.Gender)

SetGender sets the "gender" field.

func (*UserMutation) SetHomepage added in v1.0.3

func (m *UserMutation) SetHomepage(s string)

SetHomepage sets the "homepage" field.

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) SetUsername added in v1.0.5

func (m *UserMutation) SetUsername(s string)

SetUsername sets the "username" 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) Username added in v1.0.5

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

Username returns the value of the "username" field 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:"sn,omitempty"`
	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) QueryComponents added in v1.0.3

func (uq *UserQuery) QueryComponents() *ComponentQuery

QueryComponents chains the current query on the "Components" edge.

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:"sn,omitempty"`
}

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) WithComponents added in v1.0.3

func (uq *UserQuery) WithComponents(opts ...func(*ComponentQuery)) *UserQuery

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

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) AddComponentIDs added in v1.0.3

func (uu *UserUpdate) AddComponentIDs(ids ...int) *UserUpdate

AddComponentIDs adds the "Components" edge to the Component entity by IDs.

func (*UserUpdate) AddComponents added in v1.0.3

func (uu *UserUpdate) AddComponents(c ...*Component) *UserUpdate

AddComponents adds the "Components" edges to the Component entity.

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) ClearAvatarURL added in v1.0.6

func (uu *UserUpdate) ClearAvatarURL() *UserUpdate

ClearAvatarURL clears the value of the "avatar_url" field.

func (*UserUpdate) ClearBio added in v1.0.6

func (uu *UserUpdate) ClearBio() *UserUpdate

ClearBio clears the value of the "bio" field.

func (*UserUpdate) ClearComponents added in v1.0.3

func (uu *UserUpdate) ClearComponents() *UserUpdate

ClearComponents clears all "Components" edges to the Component entity.

func (*UserUpdate) ClearDeleteTime

func (uu *UserUpdate) ClearDeleteTime() *UserUpdate

ClearDeleteTime clears the value of the "delete_time" field.

func (*UserUpdate) ClearHomepage added in v1.0.3

func (uu *UserUpdate) ClearHomepage() *UserUpdate

ClearHomepage clears the value of the "homepage" field.

func (*UserUpdate) ClearLastPwdAuth

func (uu *UserUpdate) ClearLastPwdAuth() *UserUpdate

ClearLastPwdAuth clears the value of the "last_pwd_auth" field.

func (*UserUpdate) ClearNickname added in v1.0.5

func (uu *UserUpdate) ClearNickname() *UserUpdate

ClearNickname clears the value of the "nickname" 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) RemoveComponentIDs added in v1.0.3

func (uu *UserUpdate) RemoveComponentIDs(ids ...int) *UserUpdate

RemoveComponentIDs removes the "Components" edge to Component entities by IDs.

func (*UserUpdate) RemoveComponents added in v1.0.3

func (uu *UserUpdate) RemoveComponents(c ...*Component) *UserUpdate

RemoveComponents removes "Components" edges to Component entities.

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) SetAvatarURL added in v1.0.6

func (uu *UserUpdate) SetAvatarURL(s string) *UserUpdate

SetAvatarURL sets the "avatar_url" field.

func (*UserUpdate) SetBio added in v1.0.6

func (uu *UserUpdate) SetBio(s string) *UserUpdate

SetBio sets the "bio" field.

func (*UserUpdate) SetDeleteTime

func (uu *UserUpdate) SetDeleteTime(t time.Time) *UserUpdate

SetDeleteTime sets the "delete_time" field.

func (*UserUpdate) SetGender added in v1.0.3

func (uu *UserUpdate) SetGender(u user.Gender) *UserUpdate

SetGender sets the "gender" field.

func (*UserUpdate) SetHomepage added in v1.0.3

func (uu *UserUpdate) SetHomepage(s string) *UserUpdate

SetHomepage sets the "homepage" 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) SetNillableAvatarURL added in v1.0.6

func (uu *UserUpdate) SetNillableAvatarURL(s *string) *UserUpdate

SetNillableAvatarURL sets the "avatar_url" field if the given value is not nil.

func (*UserUpdate) SetNillableBio added in v1.0.6

func (uu *UserUpdate) SetNillableBio(s *string) *UserUpdate

SetNillableBio sets the "bio" field if the given value is not nil.

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) SetNillableGender added in v1.0.3

func (uu *UserUpdate) SetNillableGender(u *user.Gender) *UserUpdate

SetNillableGender sets the "gender" field if the given value is not nil.

func (*UserUpdate) SetNillableHomepage added in v1.0.3

func (uu *UserUpdate) SetNillableHomepage(s *string) *UserUpdate

SetNillableHomepage sets the "homepage" 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) SetNillableNickname added in v1.0.5

func (uu *UserUpdate) SetNillableNickname(s *string) *UserUpdate

SetNillableNickname sets the "nickname" 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) SetUsername added in v1.0.5

func (uu *UserUpdate) SetUsername(s string) *UserUpdate

SetUsername sets the "username" 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) AddComponentIDs added in v1.0.3

func (uuo *UserUpdateOne) AddComponentIDs(ids ...int) *UserUpdateOne

AddComponentIDs adds the "Components" edge to the Component entity by IDs.

func (*UserUpdateOne) AddComponents added in v1.0.3

func (uuo *UserUpdateOne) AddComponents(c ...*Component) *UserUpdateOne

AddComponents adds the "Components" edges to the Component 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) ClearAvatarURL added in v1.0.6

func (uuo *UserUpdateOne) ClearAvatarURL() *UserUpdateOne

ClearAvatarURL clears the value of the "avatar_url" field.

func (*UserUpdateOne) ClearBio added in v1.0.6

func (uuo *UserUpdateOne) ClearBio() *UserUpdateOne

ClearBio clears the value of the "bio" field.

func (*UserUpdateOne) ClearComponents added in v1.0.3

func (uuo *UserUpdateOne) ClearComponents() *UserUpdateOne

ClearComponents clears all "Components" edges to the Component entity.

func (*UserUpdateOne) ClearDeleteTime

func (uuo *UserUpdateOne) ClearDeleteTime() *UserUpdateOne

ClearDeleteTime clears the value of the "delete_time" field.

func (*UserUpdateOne) ClearHomepage added in v1.0.3

func (uuo *UserUpdateOne) ClearHomepage() *UserUpdateOne

ClearHomepage clears the value of the "homepage" field.

func (*UserUpdateOne) ClearLastPwdAuth

func (uuo *UserUpdateOne) ClearLastPwdAuth() *UserUpdateOne

ClearLastPwdAuth clears the value of the "last_pwd_auth" field.

func (*UserUpdateOne) ClearNickname added in v1.0.5

func (uuo *UserUpdateOne) ClearNickname() *UserUpdateOne

ClearNickname clears the value of the "nickname" 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) RemoveComponentIDs added in v1.0.3

func (uuo *UserUpdateOne) RemoveComponentIDs(ids ...int) *UserUpdateOne

RemoveComponentIDs removes the "Components" edge to Component entities by IDs.

func (*UserUpdateOne) RemoveComponents added in v1.0.3

func (uuo *UserUpdateOne) RemoveComponents(c ...*Component) *UserUpdateOne

RemoveComponents removes "Components" edges to Component entities.

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) SetAvatarURL added in v1.0.6

func (uuo *UserUpdateOne) SetAvatarURL(s string) *UserUpdateOne

SetAvatarURL sets the "avatar_url" field.

func (*UserUpdateOne) SetBio added in v1.0.6

func (uuo *UserUpdateOne) SetBio(s string) *UserUpdateOne

SetBio sets the "bio" field.

func (*UserUpdateOne) SetDeleteTime

func (uuo *UserUpdateOne) SetDeleteTime(t time.Time) *UserUpdateOne

SetDeleteTime sets the "delete_time" field.

func (*UserUpdateOne) SetGender added in v1.0.3

func (uuo *UserUpdateOne) SetGender(u user.Gender) *UserUpdateOne

SetGender sets the "gender" field.

func (*UserUpdateOne) SetHomepage added in v1.0.3

func (uuo *UserUpdateOne) SetHomepage(s string) *UserUpdateOne

SetHomepage sets the "homepage" 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) SetNillableAvatarURL added in v1.0.6

func (uuo *UserUpdateOne) SetNillableAvatarURL(s *string) *UserUpdateOne

SetNillableAvatarURL sets the "avatar_url" field if the given value is not nil.

func (*UserUpdateOne) SetNillableBio added in v1.0.6

func (uuo *UserUpdateOne) SetNillableBio(s *string) *UserUpdateOne

SetNillableBio sets the "bio" field if the given value is not nil.

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) SetNillableGender added in v1.0.3

func (uuo *UserUpdateOne) SetNillableGender(u *user.Gender) *UserUpdateOne

SetNillableGender sets the "gender" field if the given value is not nil.

func (*UserUpdateOne) SetNillableHomepage added in v1.0.3

func (uuo *UserUpdateOne) SetNillableHomepage(s *string) *UserUpdateOne

SetNillableHomepage sets the "homepage" 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) SetNillableNickname added in v1.0.5

func (uuo *UserUpdateOne) SetNillableNickname(s *string) *UserUpdateOne

SetNillableNickname sets the "nickname" 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.

func (*UserUpdateOne) SetUsername added in v1.0.5

func (uuo *UserUpdateOne) SetUsername(s string) *UserUpdateOne

SetUsername sets the "username" 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.

Jump to

Keyboard shortcuts

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