gen

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2025 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Operation types.
	OpCreate    = ent.OpCreate
	OpDelete    = ent.OpDelete
	OpDeleteOne = ent.OpDeleteOne
	OpUpdate    = ent.OpUpdate
	OpUpdateOne = ent.OpUpdateOne

	// Node types.
	TypeFuncEdge   = "FuncEdge"
	TypeFuncNode   = "FuncNode"
	TypePackageDep = "PackageDep"
	TypePkg        = "Pkg"
)

Variables

View Source
var ErrTxStarted = errors.New("gen: cannot start a transaction within a transaction")

ErrTxStarted is returned when trying to start a new transaction from a transactional client.

Functions

func Asc

func Asc(fields ...string) func(*sql.Selector)

Asc applies the given fields in ASC order.

func Desc

func Desc(fields ...string) func(*sql.Selector)

Desc applies the given fields in DESC order.

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(gen.As(gen.Sum(field1), "sum_field1"), (gen.As(gen.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
	// FuncEdge is the client for interacting with the FuncEdge builders.
	FuncEdge *FuncEdgeClient
	// FuncNode is the client for interacting with the FuncNode builders.
	FuncNode *FuncNodeClient
	// PackageDep is the client for interacting with the PackageDep builders.
	PackageDep *PackageDepClient
	// Pkg is the client for interacting with the Pkg builders.
	Pkg *PkgClient
	// 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().
	FuncEdge.
	Query().
	Count(ctx)

func (*Client) Intercept

func (c *Client) Intercept(interceptors ...Interceptor)

Intercept adds the query interceptors to all the entity clients. In order to add interceptors to a specific client, call: `client.Node.Intercept(...)`.

func (*Client) Mutate

func (c *Client) Mutate(ctx context.Context, m Mutation) (Value, error)

Mutate implements the ent.Mutator interface.

func (*Client) Tx

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

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

func (*Client) Use

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

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

type CommitFunc

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

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

func (CommitFunc) Commit

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

Commit calls f(ctx, m).

type CommitHook

type CommitHook func(Committer) Committer

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

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

type Committer

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

Committer is the interface that wraps the Commit method.

type ConstraintError

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

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

func (ConstraintError) Error

func (e ConstraintError) Error() string

Error implements the error interface.

func (*ConstraintError) Unwrap

func (e *ConstraintError) Unwrap() error

Unwrap implements the errors.Wrapper interface.

type FuncEdge

type FuncEdge struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// CreatedAt holds the value of the "CreatedAt" field.
	CreatedAt time.Time `json:"CreatedAt,omitempty"`
	// UpdatedAt holds the value of the "UpdatedAt" field.
	UpdatedAt time.Time `json:"UpdatedAt,omitempty"`
	// CallerKey holds the value of the "CallerKey" field.
	CallerKey string `json:"CallerKey,omitempty"`
	// CalleeKey holds the value of the "CalleeKey" field.
	CalleeKey string `json:"CalleeKey,omitempty"`
	// 调用发生的文件路径
	CallSiteFile string `json:"call_site_file,omitempty"`
	// 调用发生的行号
	CallSiteLine int `json:"call_site_line,omitempty"`
	// 调用类型: static, dynamic, go, defer
	CallType string `json:"call_type,omitempty"`
	// contains filtered or unexported fields
}

FuncEdge is the model entity for the FuncEdge schema.

func (*FuncEdge) String

func (fe *FuncEdge) String() string

String implements the fmt.Stringer.

func (*FuncEdge) Unwrap

func (fe *FuncEdge) Unwrap() *FuncEdge

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

func (fe *FuncEdge) Update() *FuncEdgeUpdateOne

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

func (*FuncEdge) Value

func (fe *FuncEdge) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the FuncEdge. This includes values selected through modifiers, order, etc.

type FuncEdgeClient

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

FuncEdgeClient is a client for the FuncEdge schema.

func NewFuncEdgeClient

func NewFuncEdgeClient(c config) *FuncEdgeClient

NewFuncEdgeClient returns a client for the FuncEdge from the given config.

func (*FuncEdgeClient) Create

func (c *FuncEdgeClient) Create() *FuncEdgeCreate

Create returns a builder for creating a FuncEdge entity.

func (*FuncEdgeClient) CreateBulk

func (c *FuncEdgeClient) CreateBulk(builders ...*FuncEdgeCreate) *FuncEdgeCreateBulk

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

func (*FuncEdgeClient) Delete

func (c *FuncEdgeClient) Delete() *FuncEdgeDelete

Delete returns a delete builder for FuncEdge.

func (*FuncEdgeClient) DeleteOne

func (c *FuncEdgeClient) DeleteOne(fe *FuncEdge) *FuncEdgeDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*FuncEdgeClient) DeleteOneID

func (c *FuncEdgeClient) DeleteOneID(id int) *FuncEdgeDeleteOne

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

func (*FuncEdgeClient) Get

func (c *FuncEdgeClient) Get(ctx context.Context, id int) (*FuncEdge, error)

Get returns a FuncEdge entity by its id.

func (*FuncEdgeClient) GetX

func (c *FuncEdgeClient) GetX(ctx context.Context, id int) *FuncEdge

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

func (*FuncEdgeClient) Hooks

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

Hooks returns the client hooks.

func (*FuncEdgeClient) Intercept

func (c *FuncEdgeClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `funcedge.Intercept(f(g(h())))`.

func (*FuncEdgeClient) Interceptors

func (c *FuncEdgeClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*FuncEdgeClient) MapCreateBulk

func (c *FuncEdgeClient) MapCreateBulk(slice any, setFunc func(*FuncEdgeCreate, int)) *FuncEdgeCreateBulk

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (*FuncEdgeClient) Query

func (c *FuncEdgeClient) Query() *FuncEdgeQuery

Query returns a query builder for FuncEdge.

func (*FuncEdgeClient) Update

func (c *FuncEdgeClient) Update() *FuncEdgeUpdate

Update returns an update builder for FuncEdge.

func (*FuncEdgeClient) UpdateOne

func (c *FuncEdgeClient) UpdateOne(fe *FuncEdge) *FuncEdgeUpdateOne

UpdateOne returns an update builder for the given entity.

func (*FuncEdgeClient) UpdateOneID

func (c *FuncEdgeClient) UpdateOneID(id int) *FuncEdgeUpdateOne

UpdateOneID returns an update builder for the given id.

func (*FuncEdgeClient) Use

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

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

type FuncEdgeCreate

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

FuncEdgeCreate is the builder for creating a FuncEdge entity.

func (*FuncEdgeCreate) Exec

func (fec *FuncEdgeCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*FuncEdgeCreate) ExecX

func (fec *FuncEdgeCreate) ExecX(ctx context.Context)

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

func (*FuncEdgeCreate) Mutation

func (fec *FuncEdgeCreate) Mutation() *FuncEdgeMutation

Mutation returns the FuncEdgeMutation object of the builder.

func (*FuncEdgeCreate) Save

func (fec *FuncEdgeCreate) Save(ctx context.Context) (*FuncEdge, error)

Save creates the FuncEdge in the database.

func (*FuncEdgeCreate) SaveX

func (fec *FuncEdgeCreate) SaveX(ctx context.Context) *FuncEdge

SaveX calls Save and panics if Save returns an error.

func (*FuncEdgeCreate) SetCallSiteFile added in v1.2.1

func (fec *FuncEdgeCreate) SetCallSiteFile(s string) *FuncEdgeCreate

SetCallSiteFile sets the "call_site_file" field.

func (*FuncEdgeCreate) SetCallSiteLine added in v1.2.1

func (fec *FuncEdgeCreate) SetCallSiteLine(i int) *FuncEdgeCreate

SetCallSiteLine sets the "call_site_line" field.

func (*FuncEdgeCreate) SetCallType added in v1.2.1

func (fec *FuncEdgeCreate) SetCallType(s string) *FuncEdgeCreate

SetCallType sets the "call_type" field.

func (*FuncEdgeCreate) SetCalleeKey

func (fec *FuncEdgeCreate) SetCalleeKey(s string) *FuncEdgeCreate

SetCalleeKey sets the "CalleeKey" field.

func (*FuncEdgeCreate) SetCallerKey

func (fec *FuncEdgeCreate) SetCallerKey(s string) *FuncEdgeCreate

SetCallerKey sets the "CallerKey" field.

func (*FuncEdgeCreate) SetCreatedAt

func (fec *FuncEdgeCreate) SetCreatedAt(t time.Time) *FuncEdgeCreate

SetCreatedAt sets the "CreatedAt" field.

func (*FuncEdgeCreate) SetNillableCallSiteFile added in v1.2.1

func (fec *FuncEdgeCreate) SetNillableCallSiteFile(s *string) *FuncEdgeCreate

SetNillableCallSiteFile sets the "call_site_file" field if the given value is not nil.

func (*FuncEdgeCreate) SetNillableCallSiteLine added in v1.2.1

func (fec *FuncEdgeCreate) SetNillableCallSiteLine(i *int) *FuncEdgeCreate

SetNillableCallSiteLine sets the "call_site_line" field if the given value is not nil.

func (*FuncEdgeCreate) SetNillableCallType added in v1.2.1

func (fec *FuncEdgeCreate) SetNillableCallType(s *string) *FuncEdgeCreate

SetNillableCallType sets the "call_type" field if the given value is not nil.

func (*FuncEdgeCreate) SetUpdatedAt

func (fec *FuncEdgeCreate) SetUpdatedAt(t time.Time) *FuncEdgeCreate

SetUpdatedAt sets the "UpdatedAt" field.

type FuncEdgeCreateBulk

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

FuncEdgeCreateBulk is the builder for creating many FuncEdge entities in bulk.

func (*FuncEdgeCreateBulk) Exec

func (fecb *FuncEdgeCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*FuncEdgeCreateBulk) ExecX

func (fecb *FuncEdgeCreateBulk) ExecX(ctx context.Context)

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

func (*FuncEdgeCreateBulk) Save

func (fecb *FuncEdgeCreateBulk) Save(ctx context.Context) ([]*FuncEdge, error)

Save creates the FuncEdge entities in the database.

func (*FuncEdgeCreateBulk) SaveX

func (fecb *FuncEdgeCreateBulk) SaveX(ctx context.Context) []*FuncEdge

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

type FuncEdgeDelete

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

FuncEdgeDelete is the builder for deleting a FuncEdge entity.

func (*FuncEdgeDelete) Exec

func (fed *FuncEdgeDelete) Exec(ctx context.Context) (int, error)

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

func (*FuncEdgeDelete) ExecX

func (fed *FuncEdgeDelete) ExecX(ctx context.Context) int

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

func (*FuncEdgeDelete) Where

func (fed *FuncEdgeDelete) Where(ps ...predicate.FuncEdge) *FuncEdgeDelete

Where appends a list predicates to the FuncEdgeDelete builder.

type FuncEdgeDeleteOne

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

FuncEdgeDeleteOne is the builder for deleting a single FuncEdge entity.

func (*FuncEdgeDeleteOne) Exec

func (fedo *FuncEdgeDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*FuncEdgeDeleteOne) ExecX

func (fedo *FuncEdgeDeleteOne) ExecX(ctx context.Context)

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

func (*FuncEdgeDeleteOne) Where

Where appends a list predicates to the FuncEdgeDelete builder.

type FuncEdgeGroupBy

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

FuncEdgeGroupBy is the group-by builder for FuncEdge entities.

func (*FuncEdgeGroupBy) Aggregate

func (fegb *FuncEdgeGroupBy) Aggregate(fns ...AggregateFunc) *FuncEdgeGroupBy

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

func (*FuncEdgeGroupBy) Bool

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

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

func (*FuncEdgeGroupBy) BoolX

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

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

func (*FuncEdgeGroupBy) Bools

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

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

func (*FuncEdgeGroupBy) BoolsX

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

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

func (*FuncEdgeGroupBy) Float64

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

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

func (*FuncEdgeGroupBy) Float64X

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

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

func (*FuncEdgeGroupBy) Float64s

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

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

func (*FuncEdgeGroupBy) Float64sX

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

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

func (*FuncEdgeGroupBy) Int

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

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

func (*FuncEdgeGroupBy) IntX

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

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

func (*FuncEdgeGroupBy) Ints

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

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

func (*FuncEdgeGroupBy) IntsX

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

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

func (*FuncEdgeGroupBy) Scan

func (fegb *FuncEdgeGroupBy) Scan(ctx context.Context, v any) error

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

func (*FuncEdgeGroupBy) ScanX

func (s *FuncEdgeGroupBy) ScanX(ctx context.Context, v any)

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

func (*FuncEdgeGroupBy) String

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

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

func (*FuncEdgeGroupBy) StringX

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

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

func (*FuncEdgeGroupBy) Strings

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

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

func (*FuncEdgeGroupBy) StringsX

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

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

type FuncEdgeMutation

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

FuncEdgeMutation represents an operation that mutates the FuncEdge nodes in the graph.

func (*FuncEdgeMutation) AddCallSiteLine added in v1.2.1

func (m *FuncEdgeMutation) AddCallSiteLine(i int)

AddCallSiteLine adds i to the "call_site_line" field.

func (*FuncEdgeMutation) AddField

func (m *FuncEdgeMutation) 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 (*FuncEdgeMutation) AddedCallSiteLine added in v1.2.1

func (m *FuncEdgeMutation) AddedCallSiteLine() (r int, exists bool)

AddedCallSiteLine returns the value that was added to the "call_site_line" field in this mutation.

func (*FuncEdgeMutation) AddedEdges

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

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

func (*FuncEdgeMutation) AddedField

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

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

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

func (*FuncEdgeMutation) AddedIDs

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

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

func (*FuncEdgeMutation) CallSiteFile added in v1.2.1

func (m *FuncEdgeMutation) CallSiteFile() (r string, exists bool)

CallSiteFile returns the value of the "call_site_file" field in the mutation.

func (*FuncEdgeMutation) CallSiteFileCleared added in v1.2.1

func (m *FuncEdgeMutation) CallSiteFileCleared() bool

CallSiteFileCleared returns if the "call_site_file" field was cleared in this mutation.

func (*FuncEdgeMutation) CallSiteLine added in v1.2.1

func (m *FuncEdgeMutation) CallSiteLine() (r int, exists bool)

CallSiteLine returns the value of the "call_site_line" field in the mutation.

func (*FuncEdgeMutation) CallSiteLineCleared added in v1.2.1

func (m *FuncEdgeMutation) CallSiteLineCleared() bool

CallSiteLineCleared returns if the "call_site_line" field was cleared in this mutation.

func (*FuncEdgeMutation) CallType added in v1.2.1

func (m *FuncEdgeMutation) CallType() (r string, exists bool)

CallType returns the value of the "call_type" field in the mutation.

func (*FuncEdgeMutation) CalleeKey

func (m *FuncEdgeMutation) CalleeKey() (r string, exists bool)

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

func (*FuncEdgeMutation) CallerKey

func (m *FuncEdgeMutation) CallerKey() (r string, exists bool)

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

func (*FuncEdgeMutation) ClearCallSiteFile added in v1.2.1

func (m *FuncEdgeMutation) ClearCallSiteFile()

ClearCallSiteFile clears the value of the "call_site_file" field.

func (*FuncEdgeMutation) ClearCallSiteLine added in v1.2.1

func (m *FuncEdgeMutation) ClearCallSiteLine()

ClearCallSiteLine clears the value of the "call_site_line" field.

func (*FuncEdgeMutation) ClearEdge

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

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

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

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

func (*FuncEdgeMutation) ClearedFields

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

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

func (FuncEdgeMutation) Client

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

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

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

func (*FuncEdgeMutation) EdgeCleared

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

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

func (*FuncEdgeMutation) Field

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

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

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

func (*FuncEdgeMutation) Fields

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

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

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

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

func (*FuncEdgeMutation) OldCallSiteFile added in v1.2.1

func (m *FuncEdgeMutation) OldCallSiteFile(ctx context.Context) (v string, err error)

OldCallSiteFile returns the old "call_site_file" field's value of the FuncEdge entity. If the FuncEdge 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 (*FuncEdgeMutation) OldCallSiteLine added in v1.2.1

func (m *FuncEdgeMutation) OldCallSiteLine(ctx context.Context) (v int, err error)

OldCallSiteLine returns the old "call_site_line" field's value of the FuncEdge entity. If the FuncEdge 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 (*FuncEdgeMutation) OldCallType added in v1.2.1

func (m *FuncEdgeMutation) OldCallType(ctx context.Context) (v string, err error)

OldCallType returns the old "call_type" field's value of the FuncEdge entity. If the FuncEdge 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 (*FuncEdgeMutation) OldCalleeKey

func (m *FuncEdgeMutation) OldCalleeKey(ctx context.Context) (v string, err error)

OldCalleeKey returns the old "CalleeKey" field's value of the FuncEdge entity. If the FuncEdge 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 (*FuncEdgeMutation) OldCallerKey

func (m *FuncEdgeMutation) OldCallerKey(ctx context.Context) (v string, err error)

OldCallerKey returns the old "CallerKey" field's value of the FuncEdge entity. If the FuncEdge 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 (*FuncEdgeMutation) OldCreatedAt

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

OldCreatedAt returns the old "CreatedAt" field's value of the FuncEdge entity. If the FuncEdge 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 (*FuncEdgeMutation) OldField

func (m *FuncEdgeMutation) 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 (*FuncEdgeMutation) OldUpdatedAt

func (m *FuncEdgeMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)

OldUpdatedAt returns the old "UpdatedAt" field's value of the FuncEdge entity. If the FuncEdge 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 (*FuncEdgeMutation) Op

func (m *FuncEdgeMutation) Op() Op

Op returns the operation name.

func (*FuncEdgeMutation) RemovedEdges

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

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

func (*FuncEdgeMutation) RemovedIDs

func (m *FuncEdgeMutation) 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 (*FuncEdgeMutation) ResetCallSiteFile added in v1.2.1

func (m *FuncEdgeMutation) ResetCallSiteFile()

ResetCallSiteFile resets all changes to the "call_site_file" field.

func (*FuncEdgeMutation) ResetCallSiteLine added in v1.2.1

func (m *FuncEdgeMutation) ResetCallSiteLine()

ResetCallSiteLine resets all changes to the "call_site_line" field.

func (*FuncEdgeMutation) ResetCallType added in v1.2.1

func (m *FuncEdgeMutation) ResetCallType()

ResetCallType resets all changes to the "call_type" field.

func (*FuncEdgeMutation) ResetCalleeKey

func (m *FuncEdgeMutation) ResetCalleeKey()

ResetCalleeKey resets all changes to the "CalleeKey" field.

func (*FuncEdgeMutation) ResetCallerKey

func (m *FuncEdgeMutation) ResetCallerKey()

ResetCallerKey resets all changes to the "CallerKey" field.

func (*FuncEdgeMutation) ResetCreatedAt

func (m *FuncEdgeMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "CreatedAt" field.

func (*FuncEdgeMutation) ResetEdge

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

func (m *FuncEdgeMutation) 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 (*FuncEdgeMutation) ResetUpdatedAt

func (m *FuncEdgeMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "UpdatedAt" field.

func (*FuncEdgeMutation) SetCallSiteFile added in v1.2.1

func (m *FuncEdgeMutation) SetCallSiteFile(s string)

SetCallSiteFile sets the "call_site_file" field.

func (*FuncEdgeMutation) SetCallSiteLine added in v1.2.1

func (m *FuncEdgeMutation) SetCallSiteLine(i int)

SetCallSiteLine sets the "call_site_line" field.

func (*FuncEdgeMutation) SetCallType added in v1.2.1

func (m *FuncEdgeMutation) SetCallType(s string)

SetCallType sets the "call_type" field.

func (*FuncEdgeMutation) SetCalleeKey

func (m *FuncEdgeMutation) SetCalleeKey(s string)

SetCalleeKey sets the "CalleeKey" field.

func (*FuncEdgeMutation) SetCallerKey

func (m *FuncEdgeMutation) SetCallerKey(s string)

SetCallerKey sets the "CallerKey" field.

func (*FuncEdgeMutation) SetCreatedAt

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

SetCreatedAt sets the "CreatedAt" field.

func (*FuncEdgeMutation) SetField

func (m *FuncEdgeMutation) 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 (*FuncEdgeMutation) SetOp

func (m *FuncEdgeMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*FuncEdgeMutation) SetUpdatedAt

func (m *FuncEdgeMutation) SetUpdatedAt(t time.Time)

SetUpdatedAt sets the "UpdatedAt" field.

func (FuncEdgeMutation) Tx

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

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

func (*FuncEdgeMutation) Type

func (m *FuncEdgeMutation) Type() string

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

func (*FuncEdgeMutation) UpdatedAt

func (m *FuncEdgeMutation) UpdatedAt() (r time.Time, exists bool)

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

func (*FuncEdgeMutation) Where

func (m *FuncEdgeMutation) Where(ps ...predicate.FuncEdge)

Where appends a list predicates to the FuncEdgeMutation builder.

func (*FuncEdgeMutation) WhereP

func (m *FuncEdgeMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the FuncEdgeMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type FuncEdgeQuery

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

FuncEdgeQuery is the builder for querying FuncEdge entities.

func (*FuncEdgeQuery) Aggregate

func (feq *FuncEdgeQuery) Aggregate(fns ...AggregateFunc) *FuncEdgeSelect

Aggregate returns a FuncEdgeSelect configured with the given aggregations.

func (*FuncEdgeQuery) All

func (feq *FuncEdgeQuery) All(ctx context.Context) ([]*FuncEdge, error)

All executes the query and returns a list of FuncEdges.

func (*FuncEdgeQuery) AllX

func (feq *FuncEdgeQuery) AllX(ctx context.Context) []*FuncEdge

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

func (*FuncEdgeQuery) Clone

func (feq *FuncEdgeQuery) Clone() *FuncEdgeQuery

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

func (*FuncEdgeQuery) Count

func (feq *FuncEdgeQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*FuncEdgeQuery) CountX

func (feq *FuncEdgeQuery) CountX(ctx context.Context) int

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

func (*FuncEdgeQuery) Exist

func (feq *FuncEdgeQuery) Exist(ctx context.Context) (bool, error)

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

func (*FuncEdgeQuery) ExistX

func (feq *FuncEdgeQuery) ExistX(ctx context.Context) bool

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

func (*FuncEdgeQuery) First

func (feq *FuncEdgeQuery) First(ctx context.Context) (*FuncEdge, error)

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

func (*FuncEdgeQuery) FirstID

func (feq *FuncEdgeQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*FuncEdgeQuery) FirstIDX

func (feq *FuncEdgeQuery) FirstIDX(ctx context.Context) int

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

func (*FuncEdgeQuery) FirstX

func (feq *FuncEdgeQuery) FirstX(ctx context.Context) *FuncEdge

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

func (*FuncEdgeQuery) GroupBy

func (feq *FuncEdgeQuery) GroupBy(field string, fields ...string) *FuncEdgeGroupBy

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

client.FuncEdge.Query().
	GroupBy(funcedge.FieldCreatedAt).
	Aggregate(gen.Count()).
	Scan(ctx, &v)

func (*FuncEdgeQuery) IDs

func (feq *FuncEdgeQuery) IDs(ctx context.Context) (ids []int, err error)

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

func (*FuncEdgeQuery) IDsX

func (feq *FuncEdgeQuery) IDsX(ctx context.Context) []int

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

func (*FuncEdgeQuery) Limit

func (feq *FuncEdgeQuery) Limit(limit int) *FuncEdgeQuery

Limit the number of records to be returned by this query.

func (*FuncEdgeQuery) Offset

func (feq *FuncEdgeQuery) Offset(offset int) *FuncEdgeQuery

Offset to start from.

func (*FuncEdgeQuery) Only

func (feq *FuncEdgeQuery) Only(ctx context.Context) (*FuncEdge, error)

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

func (*FuncEdgeQuery) OnlyID

func (feq *FuncEdgeQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*FuncEdgeQuery) OnlyIDX

func (feq *FuncEdgeQuery) OnlyIDX(ctx context.Context) int

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

func (*FuncEdgeQuery) OnlyX

func (feq *FuncEdgeQuery) OnlyX(ctx context.Context) *FuncEdge

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

func (*FuncEdgeQuery) Order

func (feq *FuncEdgeQuery) Order(o ...funcedge.OrderOption) *FuncEdgeQuery

Order specifies how the records should be ordered.

func (*FuncEdgeQuery) Select

func (feq *FuncEdgeQuery) Select(fields ...string) *FuncEdgeSelect

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

client.FuncEdge.Query().
	Select(funcedge.FieldCreatedAt).
	Scan(ctx, &v)

func (*FuncEdgeQuery) Unique

func (feq *FuncEdgeQuery) Unique(unique bool) *FuncEdgeQuery

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

func (feq *FuncEdgeQuery) Where(ps ...predicate.FuncEdge) *FuncEdgeQuery

Where adds a new predicate for the FuncEdgeQuery builder.

type FuncEdgeSelect

type FuncEdgeSelect struct {
	*FuncEdgeQuery
	// contains filtered or unexported fields
}

FuncEdgeSelect is the builder for selecting fields of FuncEdge entities.

func (*FuncEdgeSelect) Aggregate

func (fes *FuncEdgeSelect) Aggregate(fns ...AggregateFunc) *FuncEdgeSelect

Aggregate adds the given aggregation functions to the selector query.

func (*FuncEdgeSelect) Bool

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

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

func (*FuncEdgeSelect) BoolX

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

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

func (*FuncEdgeSelect) Bools

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

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

func (*FuncEdgeSelect) BoolsX

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

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

func (*FuncEdgeSelect) Float64

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

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

func (*FuncEdgeSelect) Float64X

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

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

func (*FuncEdgeSelect) Float64s

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

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

func (*FuncEdgeSelect) Float64sX

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

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

func (*FuncEdgeSelect) Int

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

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

func (*FuncEdgeSelect) IntX

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

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

func (*FuncEdgeSelect) Ints

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

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

func (*FuncEdgeSelect) IntsX

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

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

func (*FuncEdgeSelect) Scan

func (fes *FuncEdgeSelect) Scan(ctx context.Context, v any) error

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

func (*FuncEdgeSelect) ScanX

func (s *FuncEdgeSelect) ScanX(ctx context.Context, v any)

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

func (*FuncEdgeSelect) String

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

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

func (*FuncEdgeSelect) StringX

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

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

func (*FuncEdgeSelect) Strings

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

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

func (*FuncEdgeSelect) StringsX

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

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

type FuncEdgeUpdate

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

FuncEdgeUpdate is the builder for updating FuncEdge entities.

func (*FuncEdgeUpdate) AddCallSiteLine added in v1.2.1

func (feu *FuncEdgeUpdate) AddCallSiteLine(i int) *FuncEdgeUpdate

AddCallSiteLine adds i to the "call_site_line" field.

func (*FuncEdgeUpdate) ClearCallSiteFile added in v1.2.1

func (feu *FuncEdgeUpdate) ClearCallSiteFile() *FuncEdgeUpdate

ClearCallSiteFile clears the value of the "call_site_file" field.

func (*FuncEdgeUpdate) ClearCallSiteLine added in v1.2.1

func (feu *FuncEdgeUpdate) ClearCallSiteLine() *FuncEdgeUpdate

ClearCallSiteLine clears the value of the "call_site_line" field.

func (*FuncEdgeUpdate) Exec

func (feu *FuncEdgeUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*FuncEdgeUpdate) ExecX

func (feu *FuncEdgeUpdate) ExecX(ctx context.Context)

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

func (*FuncEdgeUpdate) Mutation

func (feu *FuncEdgeUpdate) Mutation() *FuncEdgeMutation

Mutation returns the FuncEdgeMutation object of the builder.

func (*FuncEdgeUpdate) Save

func (feu *FuncEdgeUpdate) Save(ctx context.Context) (int, error)

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

func (*FuncEdgeUpdate) SaveX

func (feu *FuncEdgeUpdate) SaveX(ctx context.Context) int

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

func (*FuncEdgeUpdate) SetCallSiteFile added in v1.2.1

func (feu *FuncEdgeUpdate) SetCallSiteFile(s string) *FuncEdgeUpdate

SetCallSiteFile sets the "call_site_file" field.

func (*FuncEdgeUpdate) SetCallSiteLine added in v1.2.1

func (feu *FuncEdgeUpdate) SetCallSiteLine(i int) *FuncEdgeUpdate

SetCallSiteLine sets the "call_site_line" field.

func (*FuncEdgeUpdate) SetCallType added in v1.2.1

func (feu *FuncEdgeUpdate) SetCallType(s string) *FuncEdgeUpdate

SetCallType sets the "call_type" field.

func (*FuncEdgeUpdate) SetCalleeKey

func (feu *FuncEdgeUpdate) SetCalleeKey(s string) *FuncEdgeUpdate

SetCalleeKey sets the "CalleeKey" field.

func (*FuncEdgeUpdate) SetCallerKey

func (feu *FuncEdgeUpdate) SetCallerKey(s string) *FuncEdgeUpdate

SetCallerKey sets the "CallerKey" field.

func (*FuncEdgeUpdate) SetCreatedAt

func (feu *FuncEdgeUpdate) SetCreatedAt(t time.Time) *FuncEdgeUpdate

SetCreatedAt sets the "CreatedAt" field.

func (*FuncEdgeUpdate) SetNillableCallSiteFile added in v1.2.1

func (feu *FuncEdgeUpdate) SetNillableCallSiteFile(s *string) *FuncEdgeUpdate

SetNillableCallSiteFile sets the "call_site_file" field if the given value is not nil.

func (*FuncEdgeUpdate) SetNillableCallSiteLine added in v1.2.1

func (feu *FuncEdgeUpdate) SetNillableCallSiteLine(i *int) *FuncEdgeUpdate

SetNillableCallSiteLine sets the "call_site_line" field if the given value is not nil.

func (*FuncEdgeUpdate) SetNillableCallType added in v1.2.1

func (feu *FuncEdgeUpdate) SetNillableCallType(s *string) *FuncEdgeUpdate

SetNillableCallType sets the "call_type" field if the given value is not nil.

func (*FuncEdgeUpdate) SetNillableCalleeKey

func (feu *FuncEdgeUpdate) SetNillableCalleeKey(s *string) *FuncEdgeUpdate

SetNillableCalleeKey sets the "CalleeKey" field if the given value is not nil.

func (*FuncEdgeUpdate) SetNillableCallerKey

func (feu *FuncEdgeUpdate) SetNillableCallerKey(s *string) *FuncEdgeUpdate

SetNillableCallerKey sets the "CallerKey" field if the given value is not nil.

func (*FuncEdgeUpdate) SetNillableCreatedAt

func (feu *FuncEdgeUpdate) SetNillableCreatedAt(t *time.Time) *FuncEdgeUpdate

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

func (*FuncEdgeUpdate) SetNillableUpdatedAt

func (feu *FuncEdgeUpdate) SetNillableUpdatedAt(t *time.Time) *FuncEdgeUpdate

SetNillableUpdatedAt sets the "UpdatedAt" field if the given value is not nil.

func (*FuncEdgeUpdate) SetUpdatedAt

func (feu *FuncEdgeUpdate) SetUpdatedAt(t time.Time) *FuncEdgeUpdate

SetUpdatedAt sets the "UpdatedAt" field.

func (*FuncEdgeUpdate) Where

func (feu *FuncEdgeUpdate) Where(ps ...predicate.FuncEdge) *FuncEdgeUpdate

Where appends a list predicates to the FuncEdgeUpdate builder.

type FuncEdgeUpdateOne

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

FuncEdgeUpdateOne is the builder for updating a single FuncEdge entity.

func (*FuncEdgeUpdateOne) AddCallSiteLine added in v1.2.1

func (feuo *FuncEdgeUpdateOne) AddCallSiteLine(i int) *FuncEdgeUpdateOne

AddCallSiteLine adds i to the "call_site_line" field.

func (*FuncEdgeUpdateOne) ClearCallSiteFile added in v1.2.1

func (feuo *FuncEdgeUpdateOne) ClearCallSiteFile() *FuncEdgeUpdateOne

ClearCallSiteFile clears the value of the "call_site_file" field.

func (*FuncEdgeUpdateOne) ClearCallSiteLine added in v1.2.1

func (feuo *FuncEdgeUpdateOne) ClearCallSiteLine() *FuncEdgeUpdateOne

ClearCallSiteLine clears the value of the "call_site_line" field.

func (*FuncEdgeUpdateOne) Exec

func (feuo *FuncEdgeUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*FuncEdgeUpdateOne) ExecX

func (feuo *FuncEdgeUpdateOne) ExecX(ctx context.Context)

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

func (*FuncEdgeUpdateOne) Mutation

func (feuo *FuncEdgeUpdateOne) Mutation() *FuncEdgeMutation

Mutation returns the FuncEdgeMutation object of the builder.

func (*FuncEdgeUpdateOne) Save

func (feuo *FuncEdgeUpdateOne) Save(ctx context.Context) (*FuncEdge, error)

Save executes the query and returns the updated FuncEdge entity.

func (*FuncEdgeUpdateOne) SaveX

func (feuo *FuncEdgeUpdateOne) SaveX(ctx context.Context) *FuncEdge

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

func (*FuncEdgeUpdateOne) Select

func (feuo *FuncEdgeUpdateOne) Select(field string, fields ...string) *FuncEdgeUpdateOne

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

func (*FuncEdgeUpdateOne) SetCallSiteFile added in v1.2.1

func (feuo *FuncEdgeUpdateOne) SetCallSiteFile(s string) *FuncEdgeUpdateOne

SetCallSiteFile sets the "call_site_file" field.

func (*FuncEdgeUpdateOne) SetCallSiteLine added in v1.2.1

func (feuo *FuncEdgeUpdateOne) SetCallSiteLine(i int) *FuncEdgeUpdateOne

SetCallSiteLine sets the "call_site_line" field.

func (*FuncEdgeUpdateOne) SetCallType added in v1.2.1

func (feuo *FuncEdgeUpdateOne) SetCallType(s string) *FuncEdgeUpdateOne

SetCallType sets the "call_type" field.

func (*FuncEdgeUpdateOne) SetCalleeKey

func (feuo *FuncEdgeUpdateOne) SetCalleeKey(s string) *FuncEdgeUpdateOne

SetCalleeKey sets the "CalleeKey" field.

func (*FuncEdgeUpdateOne) SetCallerKey

func (feuo *FuncEdgeUpdateOne) SetCallerKey(s string) *FuncEdgeUpdateOne

SetCallerKey sets the "CallerKey" field.

func (*FuncEdgeUpdateOne) SetCreatedAt

func (feuo *FuncEdgeUpdateOne) SetCreatedAt(t time.Time) *FuncEdgeUpdateOne

SetCreatedAt sets the "CreatedAt" field.

func (*FuncEdgeUpdateOne) SetNillableCallSiteFile added in v1.2.1

func (feuo *FuncEdgeUpdateOne) SetNillableCallSiteFile(s *string) *FuncEdgeUpdateOne

SetNillableCallSiteFile sets the "call_site_file" field if the given value is not nil.

func (*FuncEdgeUpdateOne) SetNillableCallSiteLine added in v1.2.1

func (feuo *FuncEdgeUpdateOne) SetNillableCallSiteLine(i *int) *FuncEdgeUpdateOne

SetNillableCallSiteLine sets the "call_site_line" field if the given value is not nil.

func (*FuncEdgeUpdateOne) SetNillableCallType added in v1.2.1

func (feuo *FuncEdgeUpdateOne) SetNillableCallType(s *string) *FuncEdgeUpdateOne

SetNillableCallType sets the "call_type" field if the given value is not nil.

func (*FuncEdgeUpdateOne) SetNillableCalleeKey

func (feuo *FuncEdgeUpdateOne) SetNillableCalleeKey(s *string) *FuncEdgeUpdateOne

SetNillableCalleeKey sets the "CalleeKey" field if the given value is not nil.

func (*FuncEdgeUpdateOne) SetNillableCallerKey

func (feuo *FuncEdgeUpdateOne) SetNillableCallerKey(s *string) *FuncEdgeUpdateOne

SetNillableCallerKey sets the "CallerKey" field if the given value is not nil.

func (*FuncEdgeUpdateOne) SetNillableCreatedAt

func (feuo *FuncEdgeUpdateOne) SetNillableCreatedAt(t *time.Time) *FuncEdgeUpdateOne

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

func (*FuncEdgeUpdateOne) SetNillableUpdatedAt

func (feuo *FuncEdgeUpdateOne) SetNillableUpdatedAt(t *time.Time) *FuncEdgeUpdateOne

SetNillableUpdatedAt sets the "UpdatedAt" field if the given value is not nil.

func (*FuncEdgeUpdateOne) SetUpdatedAt

func (feuo *FuncEdgeUpdateOne) SetUpdatedAt(t time.Time) *FuncEdgeUpdateOne

SetUpdatedAt sets the "UpdatedAt" field.

func (*FuncEdgeUpdateOne) Where

Where appends a list predicates to the FuncEdgeUpdate builder.

type FuncEdges

type FuncEdges []*FuncEdge

FuncEdges is a parsable slice of FuncEdge.

type FuncNode

type FuncNode struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// 短格式唯一标识,如 n6796
	Key string `json:"key,omitempty"`
	// 完整的函数路径,如 crypto/hmac.New$1
	FullName string `json:"full_name,omitempty"`
	// 包导入路径,如 net/http
	Pkg string `json:"pkg,omitempty"`
	// 完整包路径,用于关联 PackageNode
	PkgPath string `json:"pkg_path,omitempty"`
	// Name holds the value of the "name" field.
	Name string `json:"name,omitempty"`
	// 源文件路径
	Filename string `json:"filename,omitempty"`
	// 函数开始行
	StartLine int `json:"start_line,omitempty"`
	// 函数结束行
	EndLine int `json:"end_line,omitempty"`
	// 函数签名,如 func(http.ResponseWriter, *http.Request)
	Signature string `json:"signature,omitempty"`
	// 函数的源代码(压缩存储)
	SourceCode string `json:"source_code,omitempty"`
	// CreatedAt holds the value of the "CreatedAt" field.
	CreatedAt time.Time `json:"CreatedAt,omitempty"`
	// UpdatedAt holds the value of the "UpdatedAt" field.
	UpdatedAt time.Time `json:"UpdatedAt,omitempty"`
	// contains filtered or unexported fields
}

FuncNode is the model entity for the FuncNode schema.

func (*FuncNode) String

func (fn *FuncNode) String() string

String implements the fmt.Stringer.

func (*FuncNode) Unwrap

func (fn *FuncNode) Unwrap() *FuncNode

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

func (fn *FuncNode) Update() *FuncNodeUpdateOne

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

func (*FuncNode) Value

func (fn *FuncNode) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the FuncNode. This includes values selected through modifiers, order, etc.

type FuncNodeClient

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

FuncNodeClient is a client for the FuncNode schema.

func NewFuncNodeClient

func NewFuncNodeClient(c config) *FuncNodeClient

NewFuncNodeClient returns a client for the FuncNode from the given config.

func (*FuncNodeClient) Create

func (c *FuncNodeClient) Create() *FuncNodeCreate

Create returns a builder for creating a FuncNode entity.

func (*FuncNodeClient) CreateBulk

func (c *FuncNodeClient) CreateBulk(builders ...*FuncNodeCreate) *FuncNodeCreateBulk

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

func (*FuncNodeClient) Delete

func (c *FuncNodeClient) Delete() *FuncNodeDelete

Delete returns a delete builder for FuncNode.

func (*FuncNodeClient) DeleteOne

func (c *FuncNodeClient) DeleteOne(fn *FuncNode) *FuncNodeDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*FuncNodeClient) DeleteOneID

func (c *FuncNodeClient) DeleteOneID(id int) *FuncNodeDeleteOne

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

func (*FuncNodeClient) Get

func (c *FuncNodeClient) Get(ctx context.Context, id int) (*FuncNode, error)

Get returns a FuncNode entity by its id.

func (*FuncNodeClient) GetX

func (c *FuncNodeClient) GetX(ctx context.Context, id int) *FuncNode

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

func (*FuncNodeClient) Hooks

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

Hooks returns the client hooks.

func (*FuncNodeClient) Intercept

func (c *FuncNodeClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `funcnode.Intercept(f(g(h())))`.

func (*FuncNodeClient) Interceptors

func (c *FuncNodeClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*FuncNodeClient) MapCreateBulk

func (c *FuncNodeClient) MapCreateBulk(slice any, setFunc func(*FuncNodeCreate, int)) *FuncNodeCreateBulk

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (*FuncNodeClient) Query

func (c *FuncNodeClient) Query() *FuncNodeQuery

Query returns a query builder for FuncNode.

func (*FuncNodeClient) Update

func (c *FuncNodeClient) Update() *FuncNodeUpdate

Update returns an update builder for FuncNode.

func (*FuncNodeClient) UpdateOne

func (c *FuncNodeClient) UpdateOne(fn *FuncNode) *FuncNodeUpdateOne

UpdateOne returns an update builder for the given entity.

func (*FuncNodeClient) UpdateOneID

func (c *FuncNodeClient) UpdateOneID(id int) *FuncNodeUpdateOne

UpdateOneID returns an update builder for the given id.

func (*FuncNodeClient) Use

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

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

type FuncNodeCreate

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

FuncNodeCreate is the builder for creating a FuncNode entity.

func (*FuncNodeCreate) Exec

func (fnc *FuncNodeCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*FuncNodeCreate) ExecX

func (fnc *FuncNodeCreate) ExecX(ctx context.Context)

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

func (*FuncNodeCreate) Mutation

func (fnc *FuncNodeCreate) Mutation() *FuncNodeMutation

Mutation returns the FuncNodeMutation object of the builder.

func (*FuncNodeCreate) Save

func (fnc *FuncNodeCreate) Save(ctx context.Context) (*FuncNode, error)

Save creates the FuncNode in the database.

func (*FuncNodeCreate) SaveX

func (fnc *FuncNodeCreate) SaveX(ctx context.Context) *FuncNode

SaveX calls Save and panics if Save returns an error.

func (*FuncNodeCreate) SetCreatedAt

func (fnc *FuncNodeCreate) SetCreatedAt(t time.Time) *FuncNodeCreate

SetCreatedAt sets the "CreatedAt" field.

func (*FuncNodeCreate) SetEndLine added in v1.2.1

func (fnc *FuncNodeCreate) SetEndLine(i int) *FuncNodeCreate

SetEndLine sets the "end_line" field.

func (*FuncNodeCreate) SetFilename added in v1.2.1

func (fnc *FuncNodeCreate) SetFilename(s string) *FuncNodeCreate

SetFilename sets the "filename" field.

func (*FuncNodeCreate) SetFullName added in v1.1.6

func (fnc *FuncNodeCreate) SetFullName(s string) *FuncNodeCreate

SetFullName sets the "full_name" field.

func (*FuncNodeCreate) SetKey

func (fnc *FuncNodeCreate) SetKey(s string) *FuncNodeCreate

SetKey sets the "key" field.

func (*FuncNodeCreate) SetName

func (fnc *FuncNodeCreate) SetName(s string) *FuncNodeCreate

SetName sets the "name" field.

func (*FuncNodeCreate) SetNillableCreatedAt

func (fnc *FuncNodeCreate) SetNillableCreatedAt(t *time.Time) *FuncNodeCreate

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

func (*FuncNodeCreate) SetNillableEndLine added in v1.2.1

func (fnc *FuncNodeCreate) SetNillableEndLine(i *int) *FuncNodeCreate

SetNillableEndLine sets the "end_line" field if the given value is not nil.

func (*FuncNodeCreate) SetNillableFilename added in v1.2.1

func (fnc *FuncNodeCreate) SetNillableFilename(s *string) *FuncNodeCreate

SetNillableFilename sets the "filename" field if the given value is not nil.

func (*FuncNodeCreate) SetNillablePkgPath added in v1.2.1

func (fnc *FuncNodeCreate) SetNillablePkgPath(s *string) *FuncNodeCreate

SetNillablePkgPath sets the "pkg_path" field if the given value is not nil.

func (*FuncNodeCreate) SetNillableSignature added in v1.2.1

func (fnc *FuncNodeCreate) SetNillableSignature(s *string) *FuncNodeCreate

SetNillableSignature sets the "signature" field if the given value is not nil.

func (*FuncNodeCreate) SetNillableSourceCode added in v1.2.1

func (fnc *FuncNodeCreate) SetNillableSourceCode(s *string) *FuncNodeCreate

SetNillableSourceCode sets the "source_code" field if the given value is not nil.

func (*FuncNodeCreate) SetNillableStartLine added in v1.2.1

func (fnc *FuncNodeCreate) SetNillableStartLine(i *int) *FuncNodeCreate

SetNillableStartLine sets the "start_line" field if the given value is not nil.

func (*FuncNodeCreate) SetNillableUpdatedAt

func (fnc *FuncNodeCreate) SetNillableUpdatedAt(t *time.Time) *FuncNodeCreate

SetNillableUpdatedAt sets the "UpdatedAt" field if the given value is not nil.

func (*FuncNodeCreate) SetPkg

func (fnc *FuncNodeCreate) SetPkg(s string) *FuncNodeCreate

SetPkg sets the "pkg" field.

func (*FuncNodeCreate) SetPkgPath added in v1.2.1

func (fnc *FuncNodeCreate) SetPkgPath(s string) *FuncNodeCreate

SetPkgPath sets the "pkg_path" field.

func (*FuncNodeCreate) SetSignature added in v1.2.1

func (fnc *FuncNodeCreate) SetSignature(s string) *FuncNodeCreate

SetSignature sets the "signature" field.

func (*FuncNodeCreate) SetSourceCode added in v1.2.1

func (fnc *FuncNodeCreate) SetSourceCode(s string) *FuncNodeCreate

SetSourceCode sets the "source_code" field.

func (*FuncNodeCreate) SetStartLine added in v1.2.1

func (fnc *FuncNodeCreate) SetStartLine(i int) *FuncNodeCreate

SetStartLine sets the "start_line" field.

func (*FuncNodeCreate) SetUpdatedAt

func (fnc *FuncNodeCreate) SetUpdatedAt(t time.Time) *FuncNodeCreate

SetUpdatedAt sets the "UpdatedAt" field.

type FuncNodeCreateBulk

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

FuncNodeCreateBulk is the builder for creating many FuncNode entities in bulk.

func (*FuncNodeCreateBulk) Exec

func (fncb *FuncNodeCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*FuncNodeCreateBulk) ExecX

func (fncb *FuncNodeCreateBulk) ExecX(ctx context.Context)

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

func (*FuncNodeCreateBulk) Save

func (fncb *FuncNodeCreateBulk) Save(ctx context.Context) ([]*FuncNode, error)

Save creates the FuncNode entities in the database.

func (*FuncNodeCreateBulk) SaveX

func (fncb *FuncNodeCreateBulk) SaveX(ctx context.Context) []*FuncNode

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

type FuncNodeDelete

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

FuncNodeDelete is the builder for deleting a FuncNode entity.

func (*FuncNodeDelete) Exec

func (fnd *FuncNodeDelete) Exec(ctx context.Context) (int, error)

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

func (*FuncNodeDelete) ExecX

func (fnd *FuncNodeDelete) ExecX(ctx context.Context) int

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

func (*FuncNodeDelete) Where

func (fnd *FuncNodeDelete) Where(ps ...predicate.FuncNode) *FuncNodeDelete

Where appends a list predicates to the FuncNodeDelete builder.

type FuncNodeDeleteOne

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

FuncNodeDeleteOne is the builder for deleting a single FuncNode entity.

func (*FuncNodeDeleteOne) Exec

func (fndo *FuncNodeDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*FuncNodeDeleteOne) ExecX

func (fndo *FuncNodeDeleteOne) ExecX(ctx context.Context)

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

func (*FuncNodeDeleteOne) Where

Where appends a list predicates to the FuncNodeDelete builder.

type FuncNodeGroupBy

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

FuncNodeGroupBy is the group-by builder for FuncNode entities.

func (*FuncNodeGroupBy) Aggregate

func (fngb *FuncNodeGroupBy) Aggregate(fns ...AggregateFunc) *FuncNodeGroupBy

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

func (*FuncNodeGroupBy) Bool

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

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

func (*FuncNodeGroupBy) BoolX

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

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

func (*FuncNodeGroupBy) Bools

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

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

func (*FuncNodeGroupBy) BoolsX

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

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

func (*FuncNodeGroupBy) Float64

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

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

func (*FuncNodeGroupBy) Float64X

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

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

func (*FuncNodeGroupBy) Float64s

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

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

func (*FuncNodeGroupBy) Float64sX

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

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

func (*FuncNodeGroupBy) Int

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

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

func (*FuncNodeGroupBy) IntX

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

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

func (*FuncNodeGroupBy) Ints

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

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

func (*FuncNodeGroupBy) IntsX

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

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

func (*FuncNodeGroupBy) Scan

func (fngb *FuncNodeGroupBy) Scan(ctx context.Context, v any) error

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

func (*FuncNodeGroupBy) ScanX

func (s *FuncNodeGroupBy) ScanX(ctx context.Context, v any)

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

func (*FuncNodeGroupBy) String

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

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

func (*FuncNodeGroupBy) StringX

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

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

func (*FuncNodeGroupBy) Strings

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

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

func (*FuncNodeGroupBy) StringsX

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

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

type FuncNodeMutation

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

FuncNodeMutation represents an operation that mutates the FuncNode nodes in the graph.

func (*FuncNodeMutation) AddEndLine added in v1.2.1

func (m *FuncNodeMutation) AddEndLine(i int)

AddEndLine adds i to the "end_line" field.

func (*FuncNodeMutation) AddField

func (m *FuncNodeMutation) 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 (*FuncNodeMutation) AddStartLine added in v1.2.1

func (m *FuncNodeMutation) AddStartLine(i int)

AddStartLine adds i to the "start_line" field.

func (*FuncNodeMutation) AddedEdges

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

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

func (*FuncNodeMutation) AddedEndLine added in v1.2.1

func (m *FuncNodeMutation) AddedEndLine() (r int, exists bool)

AddedEndLine returns the value that was added to the "end_line" field in this mutation.

func (*FuncNodeMutation) AddedField

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

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

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

func (*FuncNodeMutation) AddedIDs

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

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

func (*FuncNodeMutation) AddedStartLine added in v1.2.1

func (m *FuncNodeMutation) AddedStartLine() (r int, exists bool)

AddedStartLine returns the value that was added to the "start_line" field in this mutation.

func (*FuncNodeMutation) ClearEdge

func (m *FuncNodeMutation) 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 (*FuncNodeMutation) ClearEndLine added in v1.2.1

func (m *FuncNodeMutation) ClearEndLine()

ClearEndLine clears the value of the "end_line" field.

func (*FuncNodeMutation) ClearField

func (m *FuncNodeMutation) 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 (*FuncNodeMutation) ClearFilename added in v1.2.1

func (m *FuncNodeMutation) ClearFilename()

ClearFilename clears the value of the "filename" field.

func (*FuncNodeMutation) ClearPkgPath added in v1.2.1

func (m *FuncNodeMutation) ClearPkgPath()

ClearPkgPath clears the value of the "pkg_path" field.

func (*FuncNodeMutation) ClearSignature added in v1.2.1

func (m *FuncNodeMutation) ClearSignature()

ClearSignature clears the value of the "signature" field.

func (*FuncNodeMutation) ClearSourceCode added in v1.2.1

func (m *FuncNodeMutation) ClearSourceCode()

ClearSourceCode clears the value of the "source_code" field.

func (*FuncNodeMutation) ClearStartLine added in v1.2.1

func (m *FuncNodeMutation) ClearStartLine()

ClearStartLine clears the value of the "start_line" field.

func (*FuncNodeMutation) ClearedEdges

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

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

func (*FuncNodeMutation) ClearedFields

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

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

func (FuncNodeMutation) Client

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

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

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

func (*FuncNodeMutation) EdgeCleared

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

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

func (*FuncNodeMutation) EndLine added in v1.2.1

func (m *FuncNodeMutation) EndLine() (r int, exists bool)

EndLine returns the value of the "end_line" field in the mutation.

func (*FuncNodeMutation) EndLineCleared added in v1.2.1

func (m *FuncNodeMutation) EndLineCleared() bool

EndLineCleared returns if the "end_line" field was cleared in this mutation.

func (*FuncNodeMutation) Field

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

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

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

func (*FuncNodeMutation) Fields

func (m *FuncNodeMutation) 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 (*FuncNodeMutation) Filename added in v1.2.1

func (m *FuncNodeMutation) Filename() (r string, exists bool)

Filename returns the value of the "filename" field in the mutation.

func (*FuncNodeMutation) FilenameCleared added in v1.2.1

func (m *FuncNodeMutation) FilenameCleared() bool

FilenameCleared returns if the "filename" field was cleared in this mutation.

func (*FuncNodeMutation) FullName added in v1.1.6

func (m *FuncNodeMutation) FullName() (r string, exists bool)

FullName returns the value of the "full_name" field in the mutation.

func (*FuncNodeMutation) ID

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

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

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

func (*FuncNodeMutation) Key

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

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

func (*FuncNodeMutation) Name

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

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

func (*FuncNodeMutation) OldCreatedAt

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

OldCreatedAt returns the old "CreatedAt" field's value of the FuncNode entity. If the FuncNode 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 (*FuncNodeMutation) OldEndLine added in v1.2.1

func (m *FuncNodeMutation) OldEndLine(ctx context.Context) (v int, err error)

OldEndLine returns the old "end_line" field's value of the FuncNode entity. If the FuncNode 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 (*FuncNodeMutation) OldField

func (m *FuncNodeMutation) 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 (*FuncNodeMutation) OldFilename added in v1.2.1

func (m *FuncNodeMutation) OldFilename(ctx context.Context) (v string, err error)

OldFilename returns the old "filename" field's value of the FuncNode entity. If the FuncNode 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 (*FuncNodeMutation) OldFullName added in v1.1.6

func (m *FuncNodeMutation) OldFullName(ctx context.Context) (v string, err error)

OldFullName returns the old "full_name" field's value of the FuncNode entity. If the FuncNode 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 (*FuncNodeMutation) OldKey

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

OldKey returns the old "key" field's value of the FuncNode entity. If the FuncNode 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 (*FuncNodeMutation) OldName

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

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

func (m *FuncNodeMutation) OldPkg(ctx context.Context) (v string, err error)

OldPkg returns the old "pkg" field's value of the FuncNode entity. If the FuncNode 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 (*FuncNodeMutation) OldPkgPath added in v1.2.1

func (m *FuncNodeMutation) OldPkgPath(ctx context.Context) (v string, err error)

OldPkgPath returns the old "pkg_path" field's value of the FuncNode entity. If the FuncNode 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 (*FuncNodeMutation) OldSignature added in v1.2.1

func (m *FuncNodeMutation) OldSignature(ctx context.Context) (v string, err error)

OldSignature returns the old "signature" field's value of the FuncNode entity. If the FuncNode 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 (*FuncNodeMutation) OldSourceCode added in v1.2.1

func (m *FuncNodeMutation) OldSourceCode(ctx context.Context) (v string, err error)

OldSourceCode returns the old "source_code" field's value of the FuncNode entity. If the FuncNode 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 (*FuncNodeMutation) OldStartLine added in v1.2.1

func (m *FuncNodeMutation) OldStartLine(ctx context.Context) (v int, err error)

OldStartLine returns the old "start_line" field's value of the FuncNode entity. If the FuncNode 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 (*FuncNodeMutation) OldUpdatedAt

func (m *FuncNodeMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)

OldUpdatedAt returns the old "UpdatedAt" field's value of the FuncNode entity. If the FuncNode 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 (*FuncNodeMutation) Op

func (m *FuncNodeMutation) Op() Op

Op returns the operation name.

func (*FuncNodeMutation) Pkg

func (m *FuncNodeMutation) Pkg() (r string, exists bool)

Pkg returns the value of the "pkg" field in the mutation.

func (*FuncNodeMutation) PkgPath added in v1.2.1

func (m *FuncNodeMutation) PkgPath() (r string, exists bool)

PkgPath returns the value of the "pkg_path" field in the mutation.

func (*FuncNodeMutation) PkgPathCleared added in v1.2.1

func (m *FuncNodeMutation) PkgPathCleared() bool

PkgPathCleared returns if the "pkg_path" field was cleared in this mutation.

func (*FuncNodeMutation) RemovedEdges

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

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

func (*FuncNodeMutation) RemovedIDs

func (m *FuncNodeMutation) 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 (*FuncNodeMutation) ResetCreatedAt

func (m *FuncNodeMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "CreatedAt" field.

func (*FuncNodeMutation) ResetEdge

func (m *FuncNodeMutation) 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 (*FuncNodeMutation) ResetEndLine added in v1.2.1

func (m *FuncNodeMutation) ResetEndLine()

ResetEndLine resets all changes to the "end_line" field.

func (*FuncNodeMutation) ResetField

func (m *FuncNodeMutation) 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 (*FuncNodeMutation) ResetFilename added in v1.2.1

func (m *FuncNodeMutation) ResetFilename()

ResetFilename resets all changes to the "filename" field.

func (*FuncNodeMutation) ResetFullName added in v1.1.6

func (m *FuncNodeMutation) ResetFullName()

ResetFullName resets all changes to the "full_name" field.

func (*FuncNodeMutation) ResetKey

func (m *FuncNodeMutation) ResetKey()

ResetKey resets all changes to the "key" field.

func (*FuncNodeMutation) ResetName

func (m *FuncNodeMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*FuncNodeMutation) ResetPkg

func (m *FuncNodeMutation) ResetPkg()

ResetPkg resets all changes to the "pkg" field.

func (*FuncNodeMutation) ResetPkgPath added in v1.2.1

func (m *FuncNodeMutation) ResetPkgPath()

ResetPkgPath resets all changes to the "pkg_path" field.

func (*FuncNodeMutation) ResetSignature added in v1.2.1

func (m *FuncNodeMutation) ResetSignature()

ResetSignature resets all changes to the "signature" field.

func (*FuncNodeMutation) ResetSourceCode added in v1.2.1

func (m *FuncNodeMutation) ResetSourceCode()

ResetSourceCode resets all changes to the "source_code" field.

func (*FuncNodeMutation) ResetStartLine added in v1.2.1

func (m *FuncNodeMutation) ResetStartLine()

ResetStartLine resets all changes to the "start_line" field.

func (*FuncNodeMutation) ResetUpdatedAt

func (m *FuncNodeMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "UpdatedAt" field.

func (*FuncNodeMutation) SetCreatedAt

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

SetCreatedAt sets the "CreatedAt" field.

func (*FuncNodeMutation) SetEndLine added in v1.2.1

func (m *FuncNodeMutation) SetEndLine(i int)

SetEndLine sets the "end_line" field.

func (*FuncNodeMutation) SetField

func (m *FuncNodeMutation) 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 (*FuncNodeMutation) SetFilename added in v1.2.1

func (m *FuncNodeMutation) SetFilename(s string)

SetFilename sets the "filename" field.

func (*FuncNodeMutation) SetFullName added in v1.1.6

func (m *FuncNodeMutation) SetFullName(s string)

SetFullName sets the "full_name" field.

func (*FuncNodeMutation) SetKey

func (m *FuncNodeMutation) SetKey(s string)

SetKey sets the "key" field.

func (*FuncNodeMutation) SetName

func (m *FuncNodeMutation) SetName(s string)

SetName sets the "name" field.

func (*FuncNodeMutation) SetOp

func (m *FuncNodeMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*FuncNodeMutation) SetPkg

func (m *FuncNodeMutation) SetPkg(s string)

SetPkg sets the "pkg" field.

func (*FuncNodeMutation) SetPkgPath added in v1.2.1

func (m *FuncNodeMutation) SetPkgPath(s string)

SetPkgPath sets the "pkg_path" field.

func (*FuncNodeMutation) SetSignature added in v1.2.1

func (m *FuncNodeMutation) SetSignature(s string)

SetSignature sets the "signature" field.

func (*FuncNodeMutation) SetSourceCode added in v1.2.1

func (m *FuncNodeMutation) SetSourceCode(s string)

SetSourceCode sets the "source_code" field.

func (*FuncNodeMutation) SetStartLine added in v1.2.1

func (m *FuncNodeMutation) SetStartLine(i int)

SetStartLine sets the "start_line" field.

func (*FuncNodeMutation) SetUpdatedAt

func (m *FuncNodeMutation) SetUpdatedAt(t time.Time)

SetUpdatedAt sets the "UpdatedAt" field.

func (*FuncNodeMutation) Signature added in v1.2.1

func (m *FuncNodeMutation) Signature() (r string, exists bool)

Signature returns the value of the "signature" field in the mutation.

func (*FuncNodeMutation) SignatureCleared added in v1.2.1

func (m *FuncNodeMutation) SignatureCleared() bool

SignatureCleared returns if the "signature" field was cleared in this mutation.

func (*FuncNodeMutation) SourceCode added in v1.2.1

func (m *FuncNodeMutation) SourceCode() (r string, exists bool)

SourceCode returns the value of the "source_code" field in the mutation.

func (*FuncNodeMutation) SourceCodeCleared added in v1.2.1

func (m *FuncNodeMutation) SourceCodeCleared() bool

SourceCodeCleared returns if the "source_code" field was cleared in this mutation.

func (*FuncNodeMutation) StartLine added in v1.2.1

func (m *FuncNodeMutation) StartLine() (r int, exists bool)

StartLine returns the value of the "start_line" field in the mutation.

func (*FuncNodeMutation) StartLineCleared added in v1.2.1

func (m *FuncNodeMutation) StartLineCleared() bool

StartLineCleared returns if the "start_line" field was cleared in this mutation.

func (FuncNodeMutation) Tx

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

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

func (*FuncNodeMutation) Type

func (m *FuncNodeMutation) Type() string

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

func (*FuncNodeMutation) UpdatedAt

func (m *FuncNodeMutation) UpdatedAt() (r time.Time, exists bool)

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

func (*FuncNodeMutation) Where

func (m *FuncNodeMutation) Where(ps ...predicate.FuncNode)

Where appends a list predicates to the FuncNodeMutation builder.

func (*FuncNodeMutation) WhereP

func (m *FuncNodeMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the FuncNodeMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type FuncNodeQuery

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

FuncNodeQuery is the builder for querying FuncNode entities.

func (*FuncNodeQuery) Aggregate

func (fnq *FuncNodeQuery) Aggregate(fns ...AggregateFunc) *FuncNodeSelect

Aggregate returns a FuncNodeSelect configured with the given aggregations.

func (*FuncNodeQuery) All

func (fnq *FuncNodeQuery) All(ctx context.Context) ([]*FuncNode, error)

All executes the query and returns a list of FuncNodes.

func (*FuncNodeQuery) AllX

func (fnq *FuncNodeQuery) AllX(ctx context.Context) []*FuncNode

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

func (*FuncNodeQuery) Clone

func (fnq *FuncNodeQuery) Clone() *FuncNodeQuery

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

func (*FuncNodeQuery) Count

func (fnq *FuncNodeQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*FuncNodeQuery) CountX

func (fnq *FuncNodeQuery) CountX(ctx context.Context) int

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

func (*FuncNodeQuery) Exist

func (fnq *FuncNodeQuery) Exist(ctx context.Context) (bool, error)

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

func (*FuncNodeQuery) ExistX

func (fnq *FuncNodeQuery) ExistX(ctx context.Context) bool

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

func (*FuncNodeQuery) First

func (fnq *FuncNodeQuery) First(ctx context.Context) (*FuncNode, error)

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

func (*FuncNodeQuery) FirstID

func (fnq *FuncNodeQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*FuncNodeQuery) FirstIDX

func (fnq *FuncNodeQuery) FirstIDX(ctx context.Context) int

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

func (*FuncNodeQuery) FirstX

func (fnq *FuncNodeQuery) FirstX(ctx context.Context) *FuncNode

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

func (*FuncNodeQuery) GroupBy

func (fnq *FuncNodeQuery) GroupBy(field string, fields ...string) *FuncNodeGroupBy

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

client.FuncNode.Query().
	GroupBy(funcnode.FieldKey).
	Aggregate(gen.Count()).
	Scan(ctx, &v)

func (*FuncNodeQuery) IDs

func (fnq *FuncNodeQuery) IDs(ctx context.Context) (ids []int, err error)

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

func (*FuncNodeQuery) IDsX

func (fnq *FuncNodeQuery) IDsX(ctx context.Context) []int

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

func (*FuncNodeQuery) Limit

func (fnq *FuncNodeQuery) Limit(limit int) *FuncNodeQuery

Limit the number of records to be returned by this query.

func (*FuncNodeQuery) Offset

func (fnq *FuncNodeQuery) Offset(offset int) *FuncNodeQuery

Offset to start from.

func (*FuncNodeQuery) Only

func (fnq *FuncNodeQuery) Only(ctx context.Context) (*FuncNode, error)

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

func (*FuncNodeQuery) OnlyID

func (fnq *FuncNodeQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*FuncNodeQuery) OnlyIDX

func (fnq *FuncNodeQuery) OnlyIDX(ctx context.Context) int

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

func (*FuncNodeQuery) OnlyX

func (fnq *FuncNodeQuery) OnlyX(ctx context.Context) *FuncNode

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

func (*FuncNodeQuery) Order

func (fnq *FuncNodeQuery) Order(o ...funcnode.OrderOption) *FuncNodeQuery

Order specifies how the records should be ordered.

func (*FuncNodeQuery) Select

func (fnq *FuncNodeQuery) Select(fields ...string) *FuncNodeSelect

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

client.FuncNode.Query().
	Select(funcnode.FieldKey).
	Scan(ctx, &v)

func (*FuncNodeQuery) Unique

func (fnq *FuncNodeQuery) Unique(unique bool) *FuncNodeQuery

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

func (fnq *FuncNodeQuery) Where(ps ...predicate.FuncNode) *FuncNodeQuery

Where adds a new predicate for the FuncNodeQuery builder.

type FuncNodeSelect

type FuncNodeSelect struct {
	*FuncNodeQuery
	// contains filtered or unexported fields
}

FuncNodeSelect is the builder for selecting fields of FuncNode entities.

func (*FuncNodeSelect) Aggregate

func (fns *FuncNodeSelect) Aggregate(fnss ...AggregateFunc) *FuncNodeSelect

Aggregate adds the given aggregation functions to the selector query.

func (*FuncNodeSelect) Bool

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

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

func (*FuncNodeSelect) BoolX

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

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

func (*FuncNodeSelect) Bools

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

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

func (*FuncNodeSelect) BoolsX

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

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

func (*FuncNodeSelect) Float64

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

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

func (*FuncNodeSelect) Float64X

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

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

func (*FuncNodeSelect) Float64s

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

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

func (*FuncNodeSelect) Float64sX

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

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

func (*FuncNodeSelect) Int

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

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

func (*FuncNodeSelect) IntX

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

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

func (*FuncNodeSelect) Ints

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

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

func (*FuncNodeSelect) IntsX

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

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

func (*FuncNodeSelect) Scan

func (fns *FuncNodeSelect) Scan(ctx context.Context, v any) error

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

func (*FuncNodeSelect) ScanX

func (s *FuncNodeSelect) ScanX(ctx context.Context, v any)

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

func (*FuncNodeSelect) String

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

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

func (*FuncNodeSelect) StringX

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

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

func (*FuncNodeSelect) Strings

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

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

func (*FuncNodeSelect) StringsX

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

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

type FuncNodeUpdate

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

FuncNodeUpdate is the builder for updating FuncNode entities.

func (*FuncNodeUpdate) AddEndLine added in v1.2.1

func (fnu *FuncNodeUpdate) AddEndLine(i int) *FuncNodeUpdate

AddEndLine adds i to the "end_line" field.

func (*FuncNodeUpdate) AddStartLine added in v1.2.1

func (fnu *FuncNodeUpdate) AddStartLine(i int) *FuncNodeUpdate

AddStartLine adds i to the "start_line" field.

func (*FuncNodeUpdate) ClearEndLine added in v1.2.1

func (fnu *FuncNodeUpdate) ClearEndLine() *FuncNodeUpdate

ClearEndLine clears the value of the "end_line" field.

func (*FuncNodeUpdate) ClearFilename added in v1.2.1

func (fnu *FuncNodeUpdate) ClearFilename() *FuncNodeUpdate

ClearFilename clears the value of the "filename" field.

func (*FuncNodeUpdate) ClearPkgPath added in v1.2.1

func (fnu *FuncNodeUpdate) ClearPkgPath() *FuncNodeUpdate

ClearPkgPath clears the value of the "pkg_path" field.

func (*FuncNodeUpdate) ClearSignature added in v1.2.1

func (fnu *FuncNodeUpdate) ClearSignature() *FuncNodeUpdate

ClearSignature clears the value of the "signature" field.

func (*FuncNodeUpdate) ClearSourceCode added in v1.2.1

func (fnu *FuncNodeUpdate) ClearSourceCode() *FuncNodeUpdate

ClearSourceCode clears the value of the "source_code" field.

func (*FuncNodeUpdate) ClearStartLine added in v1.2.1

func (fnu *FuncNodeUpdate) ClearStartLine() *FuncNodeUpdate

ClearStartLine clears the value of the "start_line" field.

func (*FuncNodeUpdate) Exec

func (fnu *FuncNodeUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*FuncNodeUpdate) ExecX

func (fnu *FuncNodeUpdate) ExecX(ctx context.Context)

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

func (*FuncNodeUpdate) Mutation

func (fnu *FuncNodeUpdate) Mutation() *FuncNodeMutation

Mutation returns the FuncNodeMutation object of the builder.

func (*FuncNodeUpdate) Save

func (fnu *FuncNodeUpdate) Save(ctx context.Context) (int, error)

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

func (*FuncNodeUpdate) SaveX

func (fnu *FuncNodeUpdate) SaveX(ctx context.Context) int

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

func (*FuncNodeUpdate) SetCreatedAt

func (fnu *FuncNodeUpdate) SetCreatedAt(t time.Time) *FuncNodeUpdate

SetCreatedAt sets the "CreatedAt" field.

func (*FuncNodeUpdate) SetEndLine added in v1.2.1

func (fnu *FuncNodeUpdate) SetEndLine(i int) *FuncNodeUpdate

SetEndLine sets the "end_line" field.

func (*FuncNodeUpdate) SetFilename added in v1.2.1

func (fnu *FuncNodeUpdate) SetFilename(s string) *FuncNodeUpdate

SetFilename sets the "filename" field.

func (*FuncNodeUpdate) SetFullName added in v1.1.6

func (fnu *FuncNodeUpdate) SetFullName(s string) *FuncNodeUpdate

SetFullName sets the "full_name" field.

func (*FuncNodeUpdate) SetKey

func (fnu *FuncNodeUpdate) SetKey(s string) *FuncNodeUpdate

SetKey sets the "key" field.

func (*FuncNodeUpdate) SetName

func (fnu *FuncNodeUpdate) SetName(s string) *FuncNodeUpdate

SetName sets the "name" field.

func (*FuncNodeUpdate) SetNillableCreatedAt

func (fnu *FuncNodeUpdate) SetNillableCreatedAt(t *time.Time) *FuncNodeUpdate

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

func (*FuncNodeUpdate) SetNillableEndLine added in v1.2.1

func (fnu *FuncNodeUpdate) SetNillableEndLine(i *int) *FuncNodeUpdate

SetNillableEndLine sets the "end_line" field if the given value is not nil.

func (*FuncNodeUpdate) SetNillableFilename added in v1.2.1

func (fnu *FuncNodeUpdate) SetNillableFilename(s *string) *FuncNodeUpdate

SetNillableFilename sets the "filename" field if the given value is not nil.

func (*FuncNodeUpdate) SetNillableFullName added in v1.1.6

func (fnu *FuncNodeUpdate) SetNillableFullName(s *string) *FuncNodeUpdate

SetNillableFullName sets the "full_name" field if the given value is not nil.

func (*FuncNodeUpdate) SetNillableKey

func (fnu *FuncNodeUpdate) SetNillableKey(s *string) *FuncNodeUpdate

SetNillableKey sets the "key" field if the given value is not nil.

func (*FuncNodeUpdate) SetNillableName

func (fnu *FuncNodeUpdate) SetNillableName(s *string) *FuncNodeUpdate

SetNillableName sets the "name" field if the given value is not nil.

func (*FuncNodeUpdate) SetNillablePkg

func (fnu *FuncNodeUpdate) SetNillablePkg(s *string) *FuncNodeUpdate

SetNillablePkg sets the "pkg" field if the given value is not nil.

func (*FuncNodeUpdate) SetNillablePkgPath added in v1.2.1

func (fnu *FuncNodeUpdate) SetNillablePkgPath(s *string) *FuncNodeUpdate

SetNillablePkgPath sets the "pkg_path" field if the given value is not nil.

func (*FuncNodeUpdate) SetNillableSignature added in v1.2.1

func (fnu *FuncNodeUpdate) SetNillableSignature(s *string) *FuncNodeUpdate

SetNillableSignature sets the "signature" field if the given value is not nil.

func (*FuncNodeUpdate) SetNillableSourceCode added in v1.2.1

func (fnu *FuncNodeUpdate) SetNillableSourceCode(s *string) *FuncNodeUpdate

SetNillableSourceCode sets the "source_code" field if the given value is not nil.

func (*FuncNodeUpdate) SetNillableStartLine added in v1.2.1

func (fnu *FuncNodeUpdate) SetNillableStartLine(i *int) *FuncNodeUpdate

SetNillableStartLine sets the "start_line" field if the given value is not nil.

func (*FuncNodeUpdate) SetNillableUpdatedAt

func (fnu *FuncNodeUpdate) SetNillableUpdatedAt(t *time.Time) *FuncNodeUpdate

SetNillableUpdatedAt sets the "UpdatedAt" field if the given value is not nil.

func (*FuncNodeUpdate) SetPkg

func (fnu *FuncNodeUpdate) SetPkg(s string) *FuncNodeUpdate

SetPkg sets the "pkg" field.

func (*FuncNodeUpdate) SetPkgPath added in v1.2.1

func (fnu *FuncNodeUpdate) SetPkgPath(s string) *FuncNodeUpdate

SetPkgPath sets the "pkg_path" field.

func (*FuncNodeUpdate) SetSignature added in v1.2.1

func (fnu *FuncNodeUpdate) SetSignature(s string) *FuncNodeUpdate

SetSignature sets the "signature" field.

func (*FuncNodeUpdate) SetSourceCode added in v1.2.1

func (fnu *FuncNodeUpdate) SetSourceCode(s string) *FuncNodeUpdate

SetSourceCode sets the "source_code" field.

func (*FuncNodeUpdate) SetStartLine added in v1.2.1

func (fnu *FuncNodeUpdate) SetStartLine(i int) *FuncNodeUpdate

SetStartLine sets the "start_line" field.

func (*FuncNodeUpdate) SetUpdatedAt

func (fnu *FuncNodeUpdate) SetUpdatedAt(t time.Time) *FuncNodeUpdate

SetUpdatedAt sets the "UpdatedAt" field.

func (*FuncNodeUpdate) Where

func (fnu *FuncNodeUpdate) Where(ps ...predicate.FuncNode) *FuncNodeUpdate

Where appends a list predicates to the FuncNodeUpdate builder.

type FuncNodeUpdateOne

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

FuncNodeUpdateOne is the builder for updating a single FuncNode entity.

func (*FuncNodeUpdateOne) AddEndLine added in v1.2.1

func (fnuo *FuncNodeUpdateOne) AddEndLine(i int) *FuncNodeUpdateOne

AddEndLine adds i to the "end_line" field.

func (*FuncNodeUpdateOne) AddStartLine added in v1.2.1

func (fnuo *FuncNodeUpdateOne) AddStartLine(i int) *FuncNodeUpdateOne

AddStartLine adds i to the "start_line" field.

func (*FuncNodeUpdateOne) ClearEndLine added in v1.2.1

func (fnuo *FuncNodeUpdateOne) ClearEndLine() *FuncNodeUpdateOne

ClearEndLine clears the value of the "end_line" field.

func (*FuncNodeUpdateOne) ClearFilename added in v1.2.1

func (fnuo *FuncNodeUpdateOne) ClearFilename() *FuncNodeUpdateOne

ClearFilename clears the value of the "filename" field.

func (*FuncNodeUpdateOne) ClearPkgPath added in v1.2.1

func (fnuo *FuncNodeUpdateOne) ClearPkgPath() *FuncNodeUpdateOne

ClearPkgPath clears the value of the "pkg_path" field.

func (*FuncNodeUpdateOne) ClearSignature added in v1.2.1

func (fnuo *FuncNodeUpdateOne) ClearSignature() *FuncNodeUpdateOne

ClearSignature clears the value of the "signature" field.

func (*FuncNodeUpdateOne) ClearSourceCode added in v1.2.1

func (fnuo *FuncNodeUpdateOne) ClearSourceCode() *FuncNodeUpdateOne

ClearSourceCode clears the value of the "source_code" field.

func (*FuncNodeUpdateOne) ClearStartLine added in v1.2.1

func (fnuo *FuncNodeUpdateOne) ClearStartLine() *FuncNodeUpdateOne

ClearStartLine clears the value of the "start_line" field.

func (*FuncNodeUpdateOne) Exec

func (fnuo *FuncNodeUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*FuncNodeUpdateOne) ExecX

func (fnuo *FuncNodeUpdateOne) ExecX(ctx context.Context)

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

func (*FuncNodeUpdateOne) Mutation

func (fnuo *FuncNodeUpdateOne) Mutation() *FuncNodeMutation

Mutation returns the FuncNodeMutation object of the builder.

func (*FuncNodeUpdateOne) Save

func (fnuo *FuncNodeUpdateOne) Save(ctx context.Context) (*FuncNode, error)

Save executes the query and returns the updated FuncNode entity.

func (*FuncNodeUpdateOne) SaveX

func (fnuo *FuncNodeUpdateOne) SaveX(ctx context.Context) *FuncNode

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

func (*FuncNodeUpdateOne) Select

func (fnuo *FuncNodeUpdateOne) Select(field string, fields ...string) *FuncNodeUpdateOne

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

func (*FuncNodeUpdateOne) SetCreatedAt

func (fnuo *FuncNodeUpdateOne) SetCreatedAt(t time.Time) *FuncNodeUpdateOne

SetCreatedAt sets the "CreatedAt" field.

func (*FuncNodeUpdateOne) SetEndLine added in v1.2.1

func (fnuo *FuncNodeUpdateOne) SetEndLine(i int) *FuncNodeUpdateOne

SetEndLine sets the "end_line" field.

func (*FuncNodeUpdateOne) SetFilename added in v1.2.1

func (fnuo *FuncNodeUpdateOne) SetFilename(s string) *FuncNodeUpdateOne

SetFilename sets the "filename" field.

func (*FuncNodeUpdateOne) SetFullName added in v1.1.6

func (fnuo *FuncNodeUpdateOne) SetFullName(s string) *FuncNodeUpdateOne

SetFullName sets the "full_name" field.

func (*FuncNodeUpdateOne) SetKey

func (fnuo *FuncNodeUpdateOne) SetKey(s string) *FuncNodeUpdateOne

SetKey sets the "key" field.

func (*FuncNodeUpdateOne) SetName

func (fnuo *FuncNodeUpdateOne) SetName(s string) *FuncNodeUpdateOne

SetName sets the "name" field.

func (*FuncNodeUpdateOne) SetNillableCreatedAt

func (fnuo *FuncNodeUpdateOne) SetNillableCreatedAt(t *time.Time) *FuncNodeUpdateOne

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

func (*FuncNodeUpdateOne) SetNillableEndLine added in v1.2.1

func (fnuo *FuncNodeUpdateOne) SetNillableEndLine(i *int) *FuncNodeUpdateOne

SetNillableEndLine sets the "end_line" field if the given value is not nil.

func (*FuncNodeUpdateOne) SetNillableFilename added in v1.2.1

func (fnuo *FuncNodeUpdateOne) SetNillableFilename(s *string) *FuncNodeUpdateOne

SetNillableFilename sets the "filename" field if the given value is not nil.

func (*FuncNodeUpdateOne) SetNillableFullName added in v1.1.6

func (fnuo *FuncNodeUpdateOne) SetNillableFullName(s *string) *FuncNodeUpdateOne

SetNillableFullName sets the "full_name" field if the given value is not nil.

func (*FuncNodeUpdateOne) SetNillableKey

func (fnuo *FuncNodeUpdateOne) SetNillableKey(s *string) *FuncNodeUpdateOne

SetNillableKey sets the "key" field if the given value is not nil.

func (*FuncNodeUpdateOne) SetNillableName

func (fnuo *FuncNodeUpdateOne) SetNillableName(s *string) *FuncNodeUpdateOne

SetNillableName sets the "name" field if the given value is not nil.

func (*FuncNodeUpdateOne) SetNillablePkg

func (fnuo *FuncNodeUpdateOne) SetNillablePkg(s *string) *FuncNodeUpdateOne

SetNillablePkg sets the "pkg" field if the given value is not nil.

func (*FuncNodeUpdateOne) SetNillablePkgPath added in v1.2.1

func (fnuo *FuncNodeUpdateOne) SetNillablePkgPath(s *string) *FuncNodeUpdateOne

SetNillablePkgPath sets the "pkg_path" field if the given value is not nil.

func (*FuncNodeUpdateOne) SetNillableSignature added in v1.2.1

func (fnuo *FuncNodeUpdateOne) SetNillableSignature(s *string) *FuncNodeUpdateOne

SetNillableSignature sets the "signature" field if the given value is not nil.

func (*FuncNodeUpdateOne) SetNillableSourceCode added in v1.2.1

func (fnuo *FuncNodeUpdateOne) SetNillableSourceCode(s *string) *FuncNodeUpdateOne

SetNillableSourceCode sets the "source_code" field if the given value is not nil.

func (*FuncNodeUpdateOne) SetNillableStartLine added in v1.2.1

func (fnuo *FuncNodeUpdateOne) SetNillableStartLine(i *int) *FuncNodeUpdateOne

SetNillableStartLine sets the "start_line" field if the given value is not nil.

func (*FuncNodeUpdateOne) SetNillableUpdatedAt

func (fnuo *FuncNodeUpdateOne) SetNillableUpdatedAt(t *time.Time) *FuncNodeUpdateOne

SetNillableUpdatedAt sets the "UpdatedAt" field if the given value is not nil.

func (*FuncNodeUpdateOne) SetPkg

func (fnuo *FuncNodeUpdateOne) SetPkg(s string) *FuncNodeUpdateOne

SetPkg sets the "pkg" field.

func (*FuncNodeUpdateOne) SetPkgPath added in v1.2.1

func (fnuo *FuncNodeUpdateOne) SetPkgPath(s string) *FuncNodeUpdateOne

SetPkgPath sets the "pkg_path" field.

func (*FuncNodeUpdateOne) SetSignature added in v1.2.1

func (fnuo *FuncNodeUpdateOne) SetSignature(s string) *FuncNodeUpdateOne

SetSignature sets the "signature" field.

func (*FuncNodeUpdateOne) SetSourceCode added in v1.2.1

func (fnuo *FuncNodeUpdateOne) SetSourceCode(s string) *FuncNodeUpdateOne

SetSourceCode sets the "source_code" field.

func (*FuncNodeUpdateOne) SetStartLine added in v1.2.1

func (fnuo *FuncNodeUpdateOne) SetStartLine(i int) *FuncNodeUpdateOne

SetStartLine sets the "start_line" field.

func (*FuncNodeUpdateOne) SetUpdatedAt

func (fnuo *FuncNodeUpdateOne) SetUpdatedAt(t time.Time) *FuncNodeUpdateOne

SetUpdatedAt sets the "UpdatedAt" field.

func (*FuncNodeUpdateOne) Where

Where appends a list predicates to the FuncNodeUpdate builder.

type FuncNodes

type FuncNodes []*FuncNode

FuncNodes is a parsable slice of FuncNode.

type Hook

type Hook = ent.Hook

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

type InterceptFunc

type InterceptFunc = ent.InterceptFunc

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

type Interceptor

type Interceptor = ent.Interceptor

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

type MutateFunc

type MutateFunc = ent.MutateFunc

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

type Mutation

type Mutation = ent.Mutation

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

type Mutator

type Mutator = ent.Mutator

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

type NotFoundError

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

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

func (*NotFoundError) Error

func (e *NotFoundError) Error() string

Error implements the error interface.

type NotLoadedError

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

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

func (*NotLoadedError) Error

func (e *NotLoadedError) Error() string

Error implements the error interface.

type NotSingularError

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

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

func (*NotSingularError) Error

func (e *NotSingularError) Error() string

Error implements the error interface.

type Op

type Op = ent.Op

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

type Option

type Option func(*config)

Option function to configure the client.

func Debug

func Debug() Option

Debug enables debug logging on the ent.Driver.

func Driver

func Driver(driver dialect.Driver) Option

Driver configures the client driver.

func Log

func Log(fn func(...any)) Option

Log sets the logging function for debug mode.

type OrderFunc

type OrderFunc func(*sql.Selector)

OrderFunc applies an ordering on the sql selector. Deprecated: Use Asc/Desc functions or the package builders instead.

type PackageDep added in v1.2.1

type PackageDep struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// 导入者包路径
	ImporterPkg string `json:"importer_pkg,omitempty"`
	// 被导入包路径
	ImportedPkg string `json:"imported_pkg,omitempty"`
	// 导入次数(在不同文件中的导入次数)
	ImportCount int `json:"import_count,omitempty"`
	// contains filtered or unexported fields
}

PackageDep is the model entity for the PackageDep schema.

func (*PackageDep) String added in v1.2.1

func (pd *PackageDep) String() string

String implements the fmt.Stringer.

func (*PackageDep) Unwrap added in v1.2.1

func (pd *PackageDep) Unwrap() *PackageDep

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

func (pd *PackageDep) Update() *PackageDepUpdateOne

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

func (*PackageDep) Value added in v1.2.1

func (pd *PackageDep) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the PackageDep. This includes values selected through modifiers, order, etc.

type PackageDepClient added in v1.2.1

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

PackageDepClient is a client for the PackageDep schema.

func NewPackageDepClient added in v1.2.1

func NewPackageDepClient(c config) *PackageDepClient

NewPackageDepClient returns a client for the PackageDep from the given config.

func (*PackageDepClient) Create added in v1.2.1

func (c *PackageDepClient) Create() *PackageDepCreate

Create returns a builder for creating a PackageDep entity.

func (*PackageDepClient) CreateBulk added in v1.2.1

func (c *PackageDepClient) CreateBulk(builders ...*PackageDepCreate) *PackageDepCreateBulk

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

func (*PackageDepClient) Delete added in v1.2.1

func (c *PackageDepClient) Delete() *PackageDepDelete

Delete returns a delete builder for PackageDep.

func (*PackageDepClient) DeleteOne added in v1.2.1

func (c *PackageDepClient) DeleteOne(pd *PackageDep) *PackageDepDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*PackageDepClient) DeleteOneID added in v1.2.1

func (c *PackageDepClient) DeleteOneID(id int) *PackageDepDeleteOne

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

func (*PackageDepClient) Get added in v1.2.1

func (c *PackageDepClient) Get(ctx context.Context, id int) (*PackageDep, error)

Get returns a PackageDep entity by its id.

func (*PackageDepClient) GetX added in v1.2.1

func (c *PackageDepClient) GetX(ctx context.Context, id int) *PackageDep

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

func (*PackageDepClient) Hooks added in v1.2.1

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

Hooks returns the client hooks.

func (*PackageDepClient) Intercept added in v1.2.1

func (c *PackageDepClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `packagedep.Intercept(f(g(h())))`.

func (*PackageDepClient) Interceptors added in v1.2.1

func (c *PackageDepClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*PackageDepClient) MapCreateBulk added in v1.2.1

func (c *PackageDepClient) MapCreateBulk(slice any, setFunc func(*PackageDepCreate, int)) *PackageDepCreateBulk

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (*PackageDepClient) Query added in v1.2.1

func (c *PackageDepClient) Query() *PackageDepQuery

Query returns a query builder for PackageDep.

func (*PackageDepClient) Update added in v1.2.1

func (c *PackageDepClient) Update() *PackageDepUpdate

Update returns an update builder for PackageDep.

func (*PackageDepClient) UpdateOne added in v1.2.1

func (c *PackageDepClient) UpdateOne(pd *PackageDep) *PackageDepUpdateOne

UpdateOne returns an update builder for the given entity.

func (*PackageDepClient) UpdateOneID added in v1.2.1

func (c *PackageDepClient) UpdateOneID(id int) *PackageDepUpdateOne

UpdateOneID returns an update builder for the given id.

func (*PackageDepClient) Use added in v1.2.1

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

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

type PackageDepCreate added in v1.2.1

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

PackageDepCreate is the builder for creating a PackageDep entity.

func (*PackageDepCreate) Exec added in v1.2.1

func (pdc *PackageDepCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*PackageDepCreate) ExecX added in v1.2.1

func (pdc *PackageDepCreate) ExecX(ctx context.Context)

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

func (*PackageDepCreate) Mutation added in v1.2.1

func (pdc *PackageDepCreate) Mutation() *PackageDepMutation

Mutation returns the PackageDepMutation object of the builder.

func (*PackageDepCreate) Save added in v1.2.1

func (pdc *PackageDepCreate) Save(ctx context.Context) (*PackageDep, error)

Save creates the PackageDep in the database.

func (*PackageDepCreate) SaveX added in v1.2.1

func (pdc *PackageDepCreate) SaveX(ctx context.Context) *PackageDep

SaveX calls Save and panics if Save returns an error.

func (*PackageDepCreate) SetImportCount added in v1.2.1

func (pdc *PackageDepCreate) SetImportCount(i int) *PackageDepCreate

SetImportCount sets the "import_count" field.

func (*PackageDepCreate) SetImportedPkg added in v1.2.1

func (pdc *PackageDepCreate) SetImportedPkg(s string) *PackageDepCreate

SetImportedPkg sets the "imported_pkg" field.

func (*PackageDepCreate) SetImporterPkg added in v1.2.1

func (pdc *PackageDepCreate) SetImporterPkg(s string) *PackageDepCreate

SetImporterPkg sets the "importer_pkg" field.

func (*PackageDepCreate) SetNillableImportCount added in v1.2.1

func (pdc *PackageDepCreate) SetNillableImportCount(i *int) *PackageDepCreate

SetNillableImportCount sets the "import_count" field if the given value is not nil.

type PackageDepCreateBulk added in v1.2.1

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

PackageDepCreateBulk is the builder for creating many PackageDep entities in bulk.

func (*PackageDepCreateBulk) Exec added in v1.2.1

func (pdcb *PackageDepCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*PackageDepCreateBulk) ExecX added in v1.2.1

func (pdcb *PackageDepCreateBulk) ExecX(ctx context.Context)

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

func (*PackageDepCreateBulk) Save added in v1.2.1

func (pdcb *PackageDepCreateBulk) Save(ctx context.Context) ([]*PackageDep, error)

Save creates the PackageDep entities in the database.

func (*PackageDepCreateBulk) SaveX added in v1.2.1

func (pdcb *PackageDepCreateBulk) SaveX(ctx context.Context) []*PackageDep

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

type PackageDepDelete added in v1.2.1

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

PackageDepDelete is the builder for deleting a PackageDep entity.

func (*PackageDepDelete) Exec added in v1.2.1

func (pdd *PackageDepDelete) Exec(ctx context.Context) (int, error)

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

func (*PackageDepDelete) ExecX added in v1.2.1

func (pdd *PackageDepDelete) ExecX(ctx context.Context) int

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

func (*PackageDepDelete) Where added in v1.2.1

Where appends a list predicates to the PackageDepDelete builder.

type PackageDepDeleteOne added in v1.2.1

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

PackageDepDeleteOne is the builder for deleting a single PackageDep entity.

func (*PackageDepDeleteOne) Exec added in v1.2.1

func (pddo *PackageDepDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*PackageDepDeleteOne) ExecX added in v1.2.1

func (pddo *PackageDepDeleteOne) ExecX(ctx context.Context)

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

func (*PackageDepDeleteOne) Where added in v1.2.1

Where appends a list predicates to the PackageDepDelete builder.

type PackageDepGroupBy added in v1.2.1

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

PackageDepGroupBy is the group-by builder for PackageDep entities.

func (*PackageDepGroupBy) Aggregate added in v1.2.1

func (pdgb *PackageDepGroupBy) Aggregate(fns ...AggregateFunc) *PackageDepGroupBy

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

func (*PackageDepGroupBy) Bool added in v1.2.1

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

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

func (*PackageDepGroupBy) BoolX added in v1.2.1

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

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

func (*PackageDepGroupBy) Bools added in v1.2.1

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

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

func (*PackageDepGroupBy) BoolsX added in v1.2.1

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

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

func (*PackageDepGroupBy) Float64 added in v1.2.1

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

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

func (*PackageDepGroupBy) Float64X added in v1.2.1

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

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

func (*PackageDepGroupBy) Float64s added in v1.2.1

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

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

func (*PackageDepGroupBy) Float64sX added in v1.2.1

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

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

func (*PackageDepGroupBy) Int added in v1.2.1

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

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

func (*PackageDepGroupBy) IntX added in v1.2.1

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

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

func (*PackageDepGroupBy) Ints added in v1.2.1

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

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

func (*PackageDepGroupBy) IntsX added in v1.2.1

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

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

func (*PackageDepGroupBy) Scan added in v1.2.1

func (pdgb *PackageDepGroupBy) Scan(ctx context.Context, v any) error

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

func (*PackageDepGroupBy) ScanX added in v1.2.1

func (s *PackageDepGroupBy) ScanX(ctx context.Context, v any)

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

func (*PackageDepGroupBy) String added in v1.2.1

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

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

func (*PackageDepGroupBy) StringX added in v1.2.1

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

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

func (*PackageDepGroupBy) Strings added in v1.2.1

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

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

func (*PackageDepGroupBy) StringsX added in v1.2.1

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

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

type PackageDepMutation added in v1.2.1

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

PackageDepMutation represents an operation that mutates the PackageDep nodes in the graph.

func (*PackageDepMutation) AddField added in v1.2.1

func (m *PackageDepMutation) 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 (*PackageDepMutation) AddImportCount added in v1.2.1

func (m *PackageDepMutation) AddImportCount(i int)

AddImportCount adds i to the "import_count" field.

func (*PackageDepMutation) AddedEdges added in v1.2.1

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

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

func (*PackageDepMutation) AddedField added in v1.2.1

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

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

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

func (*PackageDepMutation) AddedIDs added in v1.2.1

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

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

func (*PackageDepMutation) AddedImportCount added in v1.2.1

func (m *PackageDepMutation) AddedImportCount() (r int, exists bool)

AddedImportCount returns the value that was added to the "import_count" field in this mutation.

func (*PackageDepMutation) ClearEdge added in v1.2.1

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

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

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

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

func (*PackageDepMutation) ClearedFields added in v1.2.1

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

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

func (PackageDepMutation) Client added in v1.2.1

func (m PackageDepMutation) 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 (*PackageDepMutation) EdgeCleared added in v1.2.1

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

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

func (*PackageDepMutation) Field added in v1.2.1

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

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

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

func (*PackageDepMutation) Fields added in v1.2.1

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

func (m *PackageDepMutation) 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 (*PackageDepMutation) IDs added in v1.2.1

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

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

func (*PackageDepMutation) ImportCount added in v1.2.1

func (m *PackageDepMutation) ImportCount() (r int, exists bool)

ImportCount returns the value of the "import_count" field in the mutation.

func (*PackageDepMutation) ImportedPkg added in v1.2.1

func (m *PackageDepMutation) ImportedPkg() (r string, exists bool)

ImportedPkg returns the value of the "imported_pkg" field in the mutation.

func (*PackageDepMutation) ImporterPkg added in v1.2.1

func (m *PackageDepMutation) ImporterPkg() (r string, exists bool)

ImporterPkg returns the value of the "importer_pkg" field in the mutation.

func (*PackageDepMutation) OldField added in v1.2.1

func (m *PackageDepMutation) 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 (*PackageDepMutation) OldImportCount added in v1.2.1

func (m *PackageDepMutation) OldImportCount(ctx context.Context) (v int, err error)

OldImportCount returns the old "import_count" field's value of the PackageDep entity. If the PackageDep 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 (*PackageDepMutation) OldImportedPkg added in v1.2.1

func (m *PackageDepMutation) OldImportedPkg(ctx context.Context) (v string, err error)

OldImportedPkg returns the old "imported_pkg" field's value of the PackageDep entity. If the PackageDep 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 (*PackageDepMutation) OldImporterPkg added in v1.2.1

func (m *PackageDepMutation) OldImporterPkg(ctx context.Context) (v string, err error)

OldImporterPkg returns the old "importer_pkg" field's value of the PackageDep entity. If the PackageDep 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 (*PackageDepMutation) Op added in v1.2.1

func (m *PackageDepMutation) Op() Op

Op returns the operation name.

func (*PackageDepMutation) RemovedEdges added in v1.2.1

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

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

func (*PackageDepMutation) RemovedIDs added in v1.2.1

func (m *PackageDepMutation) 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 (*PackageDepMutation) ResetEdge added in v1.2.1

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

func (m *PackageDepMutation) 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 (*PackageDepMutation) ResetImportCount added in v1.2.1

func (m *PackageDepMutation) ResetImportCount()

ResetImportCount resets all changes to the "import_count" field.

func (*PackageDepMutation) ResetImportedPkg added in v1.2.1

func (m *PackageDepMutation) ResetImportedPkg()

ResetImportedPkg resets all changes to the "imported_pkg" field.

func (*PackageDepMutation) ResetImporterPkg added in v1.2.1

func (m *PackageDepMutation) ResetImporterPkg()

ResetImporterPkg resets all changes to the "importer_pkg" field.

func (*PackageDepMutation) SetField added in v1.2.1

func (m *PackageDepMutation) 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 (*PackageDepMutation) SetImportCount added in v1.2.1

func (m *PackageDepMutation) SetImportCount(i int)

SetImportCount sets the "import_count" field.

func (*PackageDepMutation) SetImportedPkg added in v1.2.1

func (m *PackageDepMutation) SetImportedPkg(s string)

SetImportedPkg sets the "imported_pkg" field.

func (*PackageDepMutation) SetImporterPkg added in v1.2.1

func (m *PackageDepMutation) SetImporterPkg(s string)

SetImporterPkg sets the "importer_pkg" field.

func (*PackageDepMutation) SetOp added in v1.2.1

func (m *PackageDepMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (PackageDepMutation) Tx added in v1.2.1

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

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

func (*PackageDepMutation) Type added in v1.2.1

func (m *PackageDepMutation) Type() string

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

func (*PackageDepMutation) Where added in v1.2.1

func (m *PackageDepMutation) Where(ps ...predicate.PackageDep)

Where appends a list predicates to the PackageDepMutation builder.

func (*PackageDepMutation) WhereP added in v1.2.1

func (m *PackageDepMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the PackageDepMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type PackageDepQuery added in v1.2.1

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

PackageDepQuery is the builder for querying PackageDep entities.

func (*PackageDepQuery) Aggregate added in v1.2.1

func (pdq *PackageDepQuery) Aggregate(fns ...AggregateFunc) *PackageDepSelect

Aggregate returns a PackageDepSelect configured with the given aggregations.

func (*PackageDepQuery) All added in v1.2.1

func (pdq *PackageDepQuery) All(ctx context.Context) ([]*PackageDep, error)

All executes the query and returns a list of PackageDeps.

func (*PackageDepQuery) AllX added in v1.2.1

func (pdq *PackageDepQuery) AllX(ctx context.Context) []*PackageDep

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

func (*PackageDepQuery) Clone added in v1.2.1

func (pdq *PackageDepQuery) Clone() *PackageDepQuery

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

func (*PackageDepQuery) Count added in v1.2.1

func (pdq *PackageDepQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*PackageDepQuery) CountX added in v1.2.1

func (pdq *PackageDepQuery) CountX(ctx context.Context) int

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

func (*PackageDepQuery) Exist added in v1.2.1

func (pdq *PackageDepQuery) Exist(ctx context.Context) (bool, error)

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

func (*PackageDepQuery) ExistX added in v1.2.1

func (pdq *PackageDepQuery) ExistX(ctx context.Context) bool

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

func (*PackageDepQuery) First added in v1.2.1

func (pdq *PackageDepQuery) First(ctx context.Context) (*PackageDep, error)

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

func (*PackageDepQuery) FirstID added in v1.2.1

func (pdq *PackageDepQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*PackageDepQuery) FirstIDX added in v1.2.1

func (pdq *PackageDepQuery) FirstIDX(ctx context.Context) int

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

func (*PackageDepQuery) FirstX added in v1.2.1

func (pdq *PackageDepQuery) FirstX(ctx context.Context) *PackageDep

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

func (*PackageDepQuery) GroupBy added in v1.2.1

func (pdq *PackageDepQuery) GroupBy(field string, fields ...string) *PackageDepGroupBy

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

client.PackageDep.Query().
	GroupBy(packagedep.FieldImporterPkg).
	Aggregate(gen.Count()).
	Scan(ctx, &v)

func (*PackageDepQuery) IDs added in v1.2.1

func (pdq *PackageDepQuery) IDs(ctx context.Context) (ids []int, err error)

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

func (*PackageDepQuery) IDsX added in v1.2.1

func (pdq *PackageDepQuery) IDsX(ctx context.Context) []int

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

func (*PackageDepQuery) Limit added in v1.2.1

func (pdq *PackageDepQuery) Limit(limit int) *PackageDepQuery

Limit the number of records to be returned by this query.

func (*PackageDepQuery) Offset added in v1.2.1

func (pdq *PackageDepQuery) Offset(offset int) *PackageDepQuery

Offset to start from.

func (*PackageDepQuery) Only added in v1.2.1

func (pdq *PackageDepQuery) Only(ctx context.Context) (*PackageDep, error)

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

func (*PackageDepQuery) OnlyID added in v1.2.1

func (pdq *PackageDepQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*PackageDepQuery) OnlyIDX added in v1.2.1

func (pdq *PackageDepQuery) OnlyIDX(ctx context.Context) int

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

func (*PackageDepQuery) OnlyX added in v1.2.1

func (pdq *PackageDepQuery) OnlyX(ctx context.Context) *PackageDep

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

func (*PackageDepQuery) Order added in v1.2.1

Order specifies how the records should be ordered.

func (*PackageDepQuery) Select added in v1.2.1

func (pdq *PackageDepQuery) Select(fields ...string) *PackageDepSelect

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

client.PackageDep.Query().
	Select(packagedep.FieldImporterPkg).
	Scan(ctx, &v)

func (*PackageDepQuery) Unique added in v1.2.1

func (pdq *PackageDepQuery) Unique(unique bool) *PackageDepQuery

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

Where adds a new predicate for the PackageDepQuery builder.

type PackageDepSelect added in v1.2.1

type PackageDepSelect struct {
	*PackageDepQuery
	// contains filtered or unexported fields
}

PackageDepSelect is the builder for selecting fields of PackageDep entities.

func (*PackageDepSelect) Aggregate added in v1.2.1

func (pds *PackageDepSelect) Aggregate(fns ...AggregateFunc) *PackageDepSelect

Aggregate adds the given aggregation functions to the selector query.

func (*PackageDepSelect) Bool added in v1.2.1

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

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

func (*PackageDepSelect) BoolX added in v1.2.1

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

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

func (*PackageDepSelect) Bools added in v1.2.1

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

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

func (*PackageDepSelect) BoolsX added in v1.2.1

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

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

func (*PackageDepSelect) Float64 added in v1.2.1

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

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

func (*PackageDepSelect) Float64X added in v1.2.1

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

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

func (*PackageDepSelect) Float64s added in v1.2.1

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

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

func (*PackageDepSelect) Float64sX added in v1.2.1

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

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

func (*PackageDepSelect) Int added in v1.2.1

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

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

func (*PackageDepSelect) IntX added in v1.2.1

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

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

func (*PackageDepSelect) Ints added in v1.2.1

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

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

func (*PackageDepSelect) IntsX added in v1.2.1

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

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

func (*PackageDepSelect) Scan added in v1.2.1

func (pds *PackageDepSelect) Scan(ctx context.Context, v any) error

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

func (*PackageDepSelect) ScanX added in v1.2.1

func (s *PackageDepSelect) ScanX(ctx context.Context, v any)

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

func (*PackageDepSelect) String added in v1.2.1

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

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

func (*PackageDepSelect) StringX added in v1.2.1

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

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

func (*PackageDepSelect) Strings added in v1.2.1

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

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

func (*PackageDepSelect) StringsX added in v1.2.1

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

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

type PackageDepUpdate added in v1.2.1

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

PackageDepUpdate is the builder for updating PackageDep entities.

func (*PackageDepUpdate) AddImportCount added in v1.2.1

func (pdu *PackageDepUpdate) AddImportCount(i int) *PackageDepUpdate

AddImportCount adds i to the "import_count" field.

func (*PackageDepUpdate) Exec added in v1.2.1

func (pdu *PackageDepUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*PackageDepUpdate) ExecX added in v1.2.1

func (pdu *PackageDepUpdate) ExecX(ctx context.Context)

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

func (*PackageDepUpdate) Mutation added in v1.2.1

func (pdu *PackageDepUpdate) Mutation() *PackageDepMutation

Mutation returns the PackageDepMutation object of the builder.

func (*PackageDepUpdate) Save added in v1.2.1

func (pdu *PackageDepUpdate) Save(ctx context.Context) (int, error)

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

func (*PackageDepUpdate) SaveX added in v1.2.1

func (pdu *PackageDepUpdate) SaveX(ctx context.Context) int

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

func (*PackageDepUpdate) SetImportCount added in v1.2.1

func (pdu *PackageDepUpdate) SetImportCount(i int) *PackageDepUpdate

SetImportCount sets the "import_count" field.

func (*PackageDepUpdate) SetImportedPkg added in v1.2.1

func (pdu *PackageDepUpdate) SetImportedPkg(s string) *PackageDepUpdate

SetImportedPkg sets the "imported_pkg" field.

func (*PackageDepUpdate) SetImporterPkg added in v1.2.1

func (pdu *PackageDepUpdate) SetImporterPkg(s string) *PackageDepUpdate

SetImporterPkg sets the "importer_pkg" field.

func (*PackageDepUpdate) SetNillableImportCount added in v1.2.1

func (pdu *PackageDepUpdate) SetNillableImportCount(i *int) *PackageDepUpdate

SetNillableImportCount sets the "import_count" field if the given value is not nil.

func (*PackageDepUpdate) SetNillableImportedPkg added in v1.2.1

func (pdu *PackageDepUpdate) SetNillableImportedPkg(s *string) *PackageDepUpdate

SetNillableImportedPkg sets the "imported_pkg" field if the given value is not nil.

func (*PackageDepUpdate) SetNillableImporterPkg added in v1.2.1

func (pdu *PackageDepUpdate) SetNillableImporterPkg(s *string) *PackageDepUpdate

SetNillableImporterPkg sets the "importer_pkg" field if the given value is not nil.

func (*PackageDepUpdate) Where added in v1.2.1

Where appends a list predicates to the PackageDepUpdate builder.

type PackageDepUpdateOne added in v1.2.1

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

PackageDepUpdateOne is the builder for updating a single PackageDep entity.

func (*PackageDepUpdateOne) AddImportCount added in v1.2.1

func (pduo *PackageDepUpdateOne) AddImportCount(i int) *PackageDepUpdateOne

AddImportCount adds i to the "import_count" field.

func (*PackageDepUpdateOne) Exec added in v1.2.1

func (pduo *PackageDepUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*PackageDepUpdateOne) ExecX added in v1.2.1

func (pduo *PackageDepUpdateOne) ExecX(ctx context.Context)

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

func (*PackageDepUpdateOne) Mutation added in v1.2.1

func (pduo *PackageDepUpdateOne) Mutation() *PackageDepMutation

Mutation returns the PackageDepMutation object of the builder.

func (*PackageDepUpdateOne) Save added in v1.2.1

func (pduo *PackageDepUpdateOne) Save(ctx context.Context) (*PackageDep, error)

Save executes the query and returns the updated PackageDep entity.

func (*PackageDepUpdateOne) SaveX added in v1.2.1

func (pduo *PackageDepUpdateOne) SaveX(ctx context.Context) *PackageDep

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

func (*PackageDepUpdateOne) Select added in v1.2.1

func (pduo *PackageDepUpdateOne) Select(field string, fields ...string) *PackageDepUpdateOne

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

func (*PackageDepUpdateOne) SetImportCount added in v1.2.1

func (pduo *PackageDepUpdateOne) SetImportCount(i int) *PackageDepUpdateOne

SetImportCount sets the "import_count" field.

func (*PackageDepUpdateOne) SetImportedPkg added in v1.2.1

func (pduo *PackageDepUpdateOne) SetImportedPkg(s string) *PackageDepUpdateOne

SetImportedPkg sets the "imported_pkg" field.

func (*PackageDepUpdateOne) SetImporterPkg added in v1.2.1

func (pduo *PackageDepUpdateOne) SetImporterPkg(s string) *PackageDepUpdateOne

SetImporterPkg sets the "importer_pkg" field.

func (*PackageDepUpdateOne) SetNillableImportCount added in v1.2.1

func (pduo *PackageDepUpdateOne) SetNillableImportCount(i *int) *PackageDepUpdateOne

SetNillableImportCount sets the "import_count" field if the given value is not nil.

func (*PackageDepUpdateOne) SetNillableImportedPkg added in v1.2.1

func (pduo *PackageDepUpdateOne) SetNillableImportedPkg(s *string) *PackageDepUpdateOne

SetNillableImportedPkg sets the "imported_pkg" field if the given value is not nil.

func (*PackageDepUpdateOne) SetNillableImporterPkg added in v1.2.1

func (pduo *PackageDepUpdateOne) SetNillableImporterPkg(s *string) *PackageDepUpdateOne

SetNillableImporterPkg sets the "importer_pkg" field if the given value is not nil.

func (*PackageDepUpdateOne) Where added in v1.2.1

Where appends a list predicates to the PackageDepUpdate builder.

type PackageDeps added in v1.2.1

type PackageDeps []*PackageDep

PackageDeps is a parsable slice of PackageDep.

type Pkg added in v1.2.1

type Pkg struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// 包路径,如 github.com/example/pkg
	PkgPath string `json:"pkg_path,omitempty"`
	// 是否为内部包
	IsInternal bool `json:"is_internal,omitempty"`
	// contains filtered or unexported fields
}

Pkg is the model entity for the Pkg schema.

func (*Pkg) String added in v1.2.1

func (pk *Pkg) String() string

String implements the fmt.Stringer.

func (*Pkg) Unwrap added in v1.2.1

func (pk *Pkg) Unwrap() *Pkg

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

func (pk *Pkg) Update() *PkgUpdateOne

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

func (*Pkg) Value added in v1.2.1

func (pk *Pkg) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the Pkg. This includes values selected through modifiers, order, etc.

type PkgClient added in v1.2.1

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

PkgClient is a client for the Pkg schema.

func NewPkgClient added in v1.2.1

func NewPkgClient(c config) *PkgClient

NewPkgClient returns a client for the Pkg from the given config.

func (*PkgClient) Create added in v1.2.1

func (c *PkgClient) Create() *PkgCreate

Create returns a builder for creating a Pkg entity.

func (*PkgClient) CreateBulk added in v1.2.1

func (c *PkgClient) CreateBulk(builders ...*PkgCreate) *PkgCreateBulk

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

func (*PkgClient) Delete added in v1.2.1

func (c *PkgClient) Delete() *PkgDelete

Delete returns a delete builder for Pkg.

func (*PkgClient) DeleteOne added in v1.2.1

func (c *PkgClient) DeleteOne(pk *Pkg) *PkgDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*PkgClient) DeleteOneID added in v1.2.1

func (c *PkgClient) DeleteOneID(id int) *PkgDeleteOne

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

func (*PkgClient) Get added in v1.2.1

func (c *PkgClient) Get(ctx context.Context, id int) (*Pkg, error)

Get returns a Pkg entity by its id.

func (*PkgClient) GetX added in v1.2.1

func (c *PkgClient) GetX(ctx context.Context, id int) *Pkg

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

func (*PkgClient) Hooks added in v1.2.1

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

Hooks returns the client hooks.

func (*PkgClient) Intercept added in v1.2.1

func (c *PkgClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `pkg.Intercept(f(g(h())))`.

func (*PkgClient) Interceptors added in v1.2.1

func (c *PkgClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*PkgClient) MapCreateBulk added in v1.2.1

func (c *PkgClient) MapCreateBulk(slice any, setFunc func(*PkgCreate, int)) *PkgCreateBulk

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (*PkgClient) Query added in v1.2.1

func (c *PkgClient) Query() *PkgQuery

Query returns a query builder for Pkg.

func (*PkgClient) Update added in v1.2.1

func (c *PkgClient) Update() *PkgUpdate

Update returns an update builder for Pkg.

func (*PkgClient) UpdateOne added in v1.2.1

func (c *PkgClient) UpdateOne(pk *Pkg) *PkgUpdateOne

UpdateOne returns an update builder for the given entity.

func (*PkgClient) UpdateOneID added in v1.2.1

func (c *PkgClient) UpdateOneID(id int) *PkgUpdateOne

UpdateOneID returns an update builder for the given id.

func (*PkgClient) Use added in v1.2.1

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

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

type PkgCreate added in v1.2.1

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

PkgCreate is the builder for creating a Pkg entity.

func (*PkgCreate) Exec added in v1.2.1

func (pc *PkgCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*PkgCreate) ExecX added in v1.2.1

func (pc *PkgCreate) ExecX(ctx context.Context)

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

func (*PkgCreate) Mutation added in v1.2.1

func (pc *PkgCreate) Mutation() *PkgMutation

Mutation returns the PkgMutation object of the builder.

func (*PkgCreate) Save added in v1.2.1

func (pc *PkgCreate) Save(ctx context.Context) (*Pkg, error)

Save creates the Pkg in the database.

func (*PkgCreate) SaveX added in v1.2.1

func (pc *PkgCreate) SaveX(ctx context.Context) *Pkg

SaveX calls Save and panics if Save returns an error.

func (*PkgCreate) SetIsInternal added in v1.2.1

func (pc *PkgCreate) SetIsInternal(b bool) *PkgCreate

SetIsInternal sets the "is_internal" field.

func (*PkgCreate) SetNillableIsInternal added in v1.2.1

func (pc *PkgCreate) SetNillableIsInternal(b *bool) *PkgCreate

SetNillableIsInternal sets the "is_internal" field if the given value is not nil.

func (*PkgCreate) SetPkgPath added in v1.2.1

func (pc *PkgCreate) SetPkgPath(s string) *PkgCreate

SetPkgPath sets the "pkg_path" field.

type PkgCreateBulk added in v1.2.1

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

PkgCreateBulk is the builder for creating many Pkg entities in bulk.

func (*PkgCreateBulk) Exec added in v1.2.1

func (pcb *PkgCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*PkgCreateBulk) ExecX added in v1.2.1

func (pcb *PkgCreateBulk) ExecX(ctx context.Context)

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

func (*PkgCreateBulk) Save added in v1.2.1

func (pcb *PkgCreateBulk) Save(ctx context.Context) ([]*Pkg, error)

Save creates the Pkg entities in the database.

func (*PkgCreateBulk) SaveX added in v1.2.1

func (pcb *PkgCreateBulk) SaveX(ctx context.Context) []*Pkg

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

type PkgDelete added in v1.2.1

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

PkgDelete is the builder for deleting a Pkg entity.

func (*PkgDelete) Exec added in v1.2.1

func (pd *PkgDelete) Exec(ctx context.Context) (int, error)

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

func (*PkgDelete) ExecX added in v1.2.1

func (pd *PkgDelete) ExecX(ctx context.Context) int

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

func (*PkgDelete) Where added in v1.2.1

func (pd *PkgDelete) Where(ps ...predicate.Pkg) *PkgDelete

Where appends a list predicates to the PkgDelete builder.

type PkgDeleteOne added in v1.2.1

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

PkgDeleteOne is the builder for deleting a single Pkg entity.

func (*PkgDeleteOne) Exec added in v1.2.1

func (pdo *PkgDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*PkgDeleteOne) ExecX added in v1.2.1

func (pdo *PkgDeleteOne) ExecX(ctx context.Context)

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

func (*PkgDeleteOne) Where added in v1.2.1

func (pdo *PkgDeleteOne) Where(ps ...predicate.Pkg) *PkgDeleteOne

Where appends a list predicates to the PkgDelete builder.

type PkgGroupBy added in v1.2.1

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

PkgGroupBy is the group-by builder for Pkg entities.

func (*PkgGroupBy) Aggregate added in v1.2.1

func (pgb *PkgGroupBy) Aggregate(fns ...AggregateFunc) *PkgGroupBy

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

func (*PkgGroupBy) Bool added in v1.2.1

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

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

func (*PkgGroupBy) BoolX added in v1.2.1

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

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

func (*PkgGroupBy) Bools added in v1.2.1

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

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

func (*PkgGroupBy) BoolsX added in v1.2.1

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

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

func (*PkgGroupBy) Float64 added in v1.2.1

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

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

func (*PkgGroupBy) Float64X added in v1.2.1

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

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

func (*PkgGroupBy) Float64s added in v1.2.1

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

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

func (*PkgGroupBy) Float64sX added in v1.2.1

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

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

func (*PkgGroupBy) Int added in v1.2.1

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

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

func (*PkgGroupBy) IntX added in v1.2.1

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

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

func (*PkgGroupBy) Ints added in v1.2.1

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

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

func (*PkgGroupBy) IntsX added in v1.2.1

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

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

func (*PkgGroupBy) Scan added in v1.2.1

func (pgb *PkgGroupBy) Scan(ctx context.Context, v any) error

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

func (*PkgGroupBy) ScanX added in v1.2.1

func (s *PkgGroupBy) ScanX(ctx context.Context, v any)

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

func (*PkgGroupBy) String added in v1.2.1

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

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

func (*PkgGroupBy) StringX added in v1.2.1

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

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

func (*PkgGroupBy) Strings added in v1.2.1

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

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

func (*PkgGroupBy) StringsX added in v1.2.1

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

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

type PkgMutation added in v1.2.1

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

PkgMutation represents an operation that mutates the Pkg nodes in the graph.

func (*PkgMutation) AddField added in v1.2.1

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

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

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

func (*PkgMutation) AddedField added in v1.2.1

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

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

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

func (*PkgMutation) AddedIDs added in v1.2.1

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

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

func (*PkgMutation) ClearEdge added in v1.2.1

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

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

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

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

func (*PkgMutation) ClearedFields added in v1.2.1

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

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

func (PkgMutation) Client added in v1.2.1

func (m PkgMutation) 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 (*PkgMutation) EdgeCleared added in v1.2.1

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

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

func (*PkgMutation) Field added in v1.2.1

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

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

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

func (*PkgMutation) Fields added in v1.2.1

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

func (m *PkgMutation) 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 (*PkgMutation) IDs added in v1.2.1

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

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

func (*PkgMutation) IsInternal added in v1.2.1

func (m *PkgMutation) IsInternal() (r bool, exists bool)

IsInternal returns the value of the "is_internal" field in the mutation.

func (*PkgMutation) OldField added in v1.2.1

func (m *PkgMutation) 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 (*PkgMutation) OldIsInternal added in v1.2.1

func (m *PkgMutation) OldIsInternal(ctx context.Context) (v bool, err error)

OldIsInternal returns the old "is_internal" field's value of the Pkg entity. If the Pkg 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 (*PkgMutation) OldPkgPath added in v1.2.1

func (m *PkgMutation) OldPkgPath(ctx context.Context) (v string, err error)

OldPkgPath returns the old "pkg_path" field's value of the Pkg entity. If the Pkg 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 (*PkgMutation) Op added in v1.2.1

func (m *PkgMutation) Op() Op

Op returns the operation name.

func (*PkgMutation) PkgPath added in v1.2.1

func (m *PkgMutation) PkgPath() (r string, exists bool)

PkgPath returns the value of the "pkg_path" field in the mutation.

func (*PkgMutation) RemovedEdges added in v1.2.1

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

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

func (*PkgMutation) RemovedIDs added in v1.2.1

func (m *PkgMutation) 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 (*PkgMutation) ResetEdge added in v1.2.1

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

func (m *PkgMutation) 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 (*PkgMutation) ResetIsInternal added in v1.2.1

func (m *PkgMutation) ResetIsInternal()

ResetIsInternal resets all changes to the "is_internal" field.

func (*PkgMutation) ResetPkgPath added in v1.2.1

func (m *PkgMutation) ResetPkgPath()

ResetPkgPath resets all changes to the "pkg_path" field.

func (*PkgMutation) SetField added in v1.2.1

func (m *PkgMutation) 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 (*PkgMutation) SetIsInternal added in v1.2.1

func (m *PkgMutation) SetIsInternal(b bool)

SetIsInternal sets the "is_internal" field.

func (*PkgMutation) SetOp added in v1.2.1

func (m *PkgMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*PkgMutation) SetPkgPath added in v1.2.1

func (m *PkgMutation) SetPkgPath(s string)

SetPkgPath sets the "pkg_path" field.

func (PkgMutation) Tx added in v1.2.1

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

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

func (*PkgMutation) Type added in v1.2.1

func (m *PkgMutation) Type() string

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

func (*PkgMutation) Where added in v1.2.1

func (m *PkgMutation) Where(ps ...predicate.Pkg)

Where appends a list predicates to the PkgMutation builder.

func (*PkgMutation) WhereP added in v1.2.1

func (m *PkgMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the PkgMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type PkgQuery added in v1.2.1

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

PkgQuery is the builder for querying Pkg entities.

func (*PkgQuery) Aggregate added in v1.2.1

func (pq *PkgQuery) Aggregate(fns ...AggregateFunc) *PkgSelect

Aggregate returns a PkgSelect configured with the given aggregations.

func (*PkgQuery) All added in v1.2.1

func (pq *PkgQuery) All(ctx context.Context) ([]*Pkg, error)

All executes the query and returns a list of Pkgs.

func (*PkgQuery) AllX added in v1.2.1

func (pq *PkgQuery) AllX(ctx context.Context) []*Pkg

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

func (*PkgQuery) Clone added in v1.2.1

func (pq *PkgQuery) Clone() *PkgQuery

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

func (*PkgQuery) Count added in v1.2.1

func (pq *PkgQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*PkgQuery) CountX added in v1.2.1

func (pq *PkgQuery) CountX(ctx context.Context) int

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

func (*PkgQuery) Exist added in v1.2.1

func (pq *PkgQuery) Exist(ctx context.Context) (bool, error)

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

func (*PkgQuery) ExistX added in v1.2.1

func (pq *PkgQuery) ExistX(ctx context.Context) bool

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

func (*PkgQuery) First added in v1.2.1

func (pq *PkgQuery) First(ctx context.Context) (*Pkg, error)

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

func (*PkgQuery) FirstID added in v1.2.1

func (pq *PkgQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*PkgQuery) FirstIDX added in v1.2.1

func (pq *PkgQuery) FirstIDX(ctx context.Context) int

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

func (*PkgQuery) FirstX added in v1.2.1

func (pq *PkgQuery) FirstX(ctx context.Context) *Pkg

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

func (*PkgQuery) GroupBy added in v1.2.1

func (pq *PkgQuery) GroupBy(field string, fields ...string) *PkgGroupBy

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

client.Pkg.Query().
	GroupBy(pkg.FieldPkgPath).
	Aggregate(gen.Count()).
	Scan(ctx, &v)

func (*PkgQuery) IDs added in v1.2.1

func (pq *PkgQuery) IDs(ctx context.Context) (ids []int, err error)

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

func (*PkgQuery) IDsX added in v1.2.1

func (pq *PkgQuery) IDsX(ctx context.Context) []int

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

func (*PkgQuery) Limit added in v1.2.1

func (pq *PkgQuery) Limit(limit int) *PkgQuery

Limit the number of records to be returned by this query.

func (*PkgQuery) Offset added in v1.2.1

func (pq *PkgQuery) Offset(offset int) *PkgQuery

Offset to start from.

func (*PkgQuery) Only added in v1.2.1

func (pq *PkgQuery) Only(ctx context.Context) (*Pkg, error)

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

func (*PkgQuery) OnlyID added in v1.2.1

func (pq *PkgQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*PkgQuery) OnlyIDX added in v1.2.1

func (pq *PkgQuery) OnlyIDX(ctx context.Context) int

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

func (*PkgQuery) OnlyX added in v1.2.1

func (pq *PkgQuery) OnlyX(ctx context.Context) *Pkg

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

func (*PkgQuery) Order added in v1.2.1

func (pq *PkgQuery) Order(o ...pkg.OrderOption) *PkgQuery

Order specifies how the records should be ordered.

func (*PkgQuery) Select added in v1.2.1

func (pq *PkgQuery) Select(fields ...string) *PkgSelect

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

client.Pkg.Query().
	Select(pkg.FieldPkgPath).
	Scan(ctx, &v)

func (*PkgQuery) Unique added in v1.2.1

func (pq *PkgQuery) Unique(unique bool) *PkgQuery

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

func (pq *PkgQuery) Where(ps ...predicate.Pkg) *PkgQuery

Where adds a new predicate for the PkgQuery builder.

type PkgSelect added in v1.2.1

type PkgSelect struct {
	*PkgQuery
	// contains filtered or unexported fields
}

PkgSelect is the builder for selecting fields of Pkg entities.

func (*PkgSelect) Aggregate added in v1.2.1

func (ps *PkgSelect) Aggregate(fns ...AggregateFunc) *PkgSelect

Aggregate adds the given aggregation functions to the selector query.

func (*PkgSelect) Bool added in v1.2.1

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

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

func (*PkgSelect) BoolX added in v1.2.1

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

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

func (*PkgSelect) Bools added in v1.2.1

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

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

func (*PkgSelect) BoolsX added in v1.2.1

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

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

func (*PkgSelect) Float64 added in v1.2.1

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

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

func (*PkgSelect) Float64X added in v1.2.1

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

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

func (*PkgSelect) Float64s added in v1.2.1

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

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

func (*PkgSelect) Float64sX added in v1.2.1

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

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

func (*PkgSelect) Int added in v1.2.1

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

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

func (*PkgSelect) IntX added in v1.2.1

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

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

func (*PkgSelect) Ints added in v1.2.1

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

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

func (*PkgSelect) IntsX added in v1.2.1

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

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

func (*PkgSelect) Scan added in v1.2.1

func (ps *PkgSelect) Scan(ctx context.Context, v any) error

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

func (*PkgSelect) ScanX added in v1.2.1

func (s *PkgSelect) ScanX(ctx context.Context, v any)

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

func (*PkgSelect) String added in v1.2.1

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

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

func (*PkgSelect) StringX added in v1.2.1

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

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

func (*PkgSelect) Strings added in v1.2.1

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

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

func (*PkgSelect) StringsX added in v1.2.1

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

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

type PkgUpdate added in v1.2.1

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

PkgUpdate is the builder for updating Pkg entities.

func (*PkgUpdate) Exec added in v1.2.1

func (pu *PkgUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*PkgUpdate) ExecX added in v1.2.1

func (pu *PkgUpdate) ExecX(ctx context.Context)

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

func (*PkgUpdate) Mutation added in v1.2.1

func (pu *PkgUpdate) Mutation() *PkgMutation

Mutation returns the PkgMutation object of the builder.

func (*PkgUpdate) Save added in v1.2.1

func (pu *PkgUpdate) Save(ctx context.Context) (int, error)

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

func (*PkgUpdate) SaveX added in v1.2.1

func (pu *PkgUpdate) SaveX(ctx context.Context) int

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

func (*PkgUpdate) SetIsInternal added in v1.2.1

func (pu *PkgUpdate) SetIsInternal(b bool) *PkgUpdate

SetIsInternal sets the "is_internal" field.

func (*PkgUpdate) SetNillableIsInternal added in v1.2.1

func (pu *PkgUpdate) SetNillableIsInternal(b *bool) *PkgUpdate

SetNillableIsInternal sets the "is_internal" field if the given value is not nil.

func (*PkgUpdate) SetNillablePkgPath added in v1.2.1

func (pu *PkgUpdate) SetNillablePkgPath(s *string) *PkgUpdate

SetNillablePkgPath sets the "pkg_path" field if the given value is not nil.

func (*PkgUpdate) SetPkgPath added in v1.2.1

func (pu *PkgUpdate) SetPkgPath(s string) *PkgUpdate

SetPkgPath sets the "pkg_path" field.

func (*PkgUpdate) Where added in v1.2.1

func (pu *PkgUpdate) Where(ps ...predicate.Pkg) *PkgUpdate

Where appends a list predicates to the PkgUpdate builder.

type PkgUpdateOne added in v1.2.1

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

PkgUpdateOne is the builder for updating a single Pkg entity.

func (*PkgUpdateOne) Exec added in v1.2.1

func (puo *PkgUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*PkgUpdateOne) ExecX added in v1.2.1

func (puo *PkgUpdateOne) ExecX(ctx context.Context)

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

func (*PkgUpdateOne) Mutation added in v1.2.1

func (puo *PkgUpdateOne) Mutation() *PkgMutation

Mutation returns the PkgMutation object of the builder.

func (*PkgUpdateOne) Save added in v1.2.1

func (puo *PkgUpdateOne) Save(ctx context.Context) (*Pkg, error)

Save executes the query and returns the updated Pkg entity.

func (*PkgUpdateOne) SaveX added in v1.2.1

func (puo *PkgUpdateOne) SaveX(ctx context.Context) *Pkg

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

func (*PkgUpdateOne) Select added in v1.2.1

func (puo *PkgUpdateOne) Select(field string, fields ...string) *PkgUpdateOne

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

func (*PkgUpdateOne) SetIsInternal added in v1.2.1

func (puo *PkgUpdateOne) SetIsInternal(b bool) *PkgUpdateOne

SetIsInternal sets the "is_internal" field.

func (*PkgUpdateOne) SetNillableIsInternal added in v1.2.1

func (puo *PkgUpdateOne) SetNillableIsInternal(b *bool) *PkgUpdateOne

SetNillableIsInternal sets the "is_internal" field if the given value is not nil.

func (*PkgUpdateOne) SetNillablePkgPath added in v1.2.1

func (puo *PkgUpdateOne) SetNillablePkgPath(s *string) *PkgUpdateOne

SetNillablePkgPath sets the "pkg_path" field if the given value is not nil.

func (*PkgUpdateOne) SetPkgPath added in v1.2.1

func (puo *PkgUpdateOne) SetPkgPath(s string) *PkgUpdateOne

SetPkgPath sets the "pkg_path" field.

func (*PkgUpdateOne) Where added in v1.2.1

func (puo *PkgUpdateOne) Where(ps ...predicate.Pkg) *PkgUpdateOne

Where appends a list predicates to the PkgUpdate builder.

type Pkgs added in v1.2.1

type Pkgs []*Pkg

Pkgs is a parsable slice of Pkg.

type Policy

type Policy = ent.Policy

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

type Querier

type Querier = ent.Querier

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

type QuerierFunc

type QuerierFunc = ent.QuerierFunc

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 QueryContext

type QueryContext = ent.QueryContext

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

type RollbackFunc

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

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

func (RollbackFunc) Rollback

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

Rollback calls f(ctx, m).

type RollbackHook

type RollbackHook func(Rollbacker) Rollbacker

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

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

type Rollbacker

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

Rollbacker is the interface that wraps the Rollback method.

type TraverseFunc

type TraverseFunc = ent.TraverseFunc

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

type Traverser

type Traverser = ent.Traverser

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

type Tx

type Tx struct {

	// FuncEdge is the client for interacting with the FuncEdge builders.
	FuncEdge *FuncEdgeClient
	// FuncNode is the client for interacting with the FuncNode builders.
	FuncNode *FuncNodeClient
	// PackageDep is the client for interacting with the PackageDep builders.
	PackageDep *PackageDepClient
	// Pkg is the client for interacting with the Pkg builders.
	Pkg *PkgClient
	// contains filtered or unexported fields
}

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

func TxFromContext

func TxFromContext(ctx context.Context) *Tx

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

func (*Tx) Client

func (tx *Tx) Client() *Client

Client returns a Client that binds to current transaction.

func (*Tx) Commit

func (tx *Tx) Commit() error

Commit commits the transaction.

func (*Tx) OnCommit

func (tx *Tx) OnCommit(f CommitHook)

OnCommit adds a hook to call on commit.

func (*Tx) OnRollback

func (tx *Tx) OnRollback(f RollbackHook)

OnRollback adds a hook to call on rollback.

func (*Tx) Rollback

func (tx *Tx) Rollback() error

Rollback rollbacks the transaction.

type ValidationError

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

ValidationError returns when validating a field or edge fails.

func (*ValidationError) Error

func (e *ValidationError) Error() string

Error implements the error interface.

func (*ValidationError) Unwrap

func (e *ValidationError) Unwrap() error

Unwrap implements the errors.Wrapper interface.

type Value

type Value = ent.Value

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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