ent

package
v0.0.0-...-7432d34 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2024 License: Apache-2.0 Imports: 20 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.
	TypeLogentry = "Logentry"
	TypeProject  = "Project"
)

Variables

View Source
var ErrTxStarted = errors.New("ent: 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(ent.As(ent.Sum(field1), "sum_field1"), (ent.As(ent.Sum(field2), "sum_field2")).
Scan(ctx, &v)

func Count

func Count() AggregateFunc

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

func Max

func Max(field string) AggregateFunc

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

func Mean

func Mean(field string) AggregateFunc

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

func Min

func Min(field string) AggregateFunc

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

func Sum

func Sum(field string) AggregateFunc

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

type Client

type Client struct {

	// Schema is the client for creating, migrating and dropping schema.
	Schema *migrate.Schema
	// Logentry is the client for interacting with the Logentry builders.
	Logentry *LogentryClient
	// Project is the client for interacting with the Project builders.
	Project *ProjectClient
	// 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().
	Logentry.
	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 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 Logentries

type Logentries []*Logentry

Logentries is a parsable slice of Logentry.

type Logentry

type Logentry struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// Date holds the value of the "date" field.
	Date time.Time `json:"date,omitempty"`
	// Content holds the value of the "content" field.
	Content string `json:"content,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the LogentryQuery when eager-loading is set.
	Edges LogentryEdges `json:"edges"`
	// contains filtered or unexported fields
}

Logentry is the model entity for the Logentry schema.

func (*Logentry) QueryProject

func (l *Logentry) QueryProject() *ProjectQuery

QueryProject queries the "project" edge of the Logentry entity.

func (*Logentry) String

func (l *Logentry) String() string

String implements the fmt.Stringer.

func (*Logentry) Unwrap

func (l *Logentry) Unwrap() *Logentry

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

func (l *Logentry) Update() *LogentryUpdateOne

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

func (*Logentry) Value

func (l *Logentry) Value(name string) (ent.Value, error)

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

type LogentryClient

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

LogentryClient is a client for the Logentry schema.

func NewLogentryClient

func NewLogentryClient(c config) *LogentryClient

NewLogentryClient returns a client for the Logentry from the given config.

func (*LogentryClient) Create

func (c *LogentryClient) Create() *LogentryCreate

Create returns a builder for creating a Logentry entity.

func (*LogentryClient) CreateBulk

func (c *LogentryClient) CreateBulk(builders ...*LogentryCreate) *LogentryCreateBulk

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

func (*LogentryClient) Delete

func (c *LogentryClient) Delete() *LogentryDelete

Delete returns a delete builder for Logentry.

func (*LogentryClient) DeleteOne

func (c *LogentryClient) DeleteOne(l *Logentry) *LogentryDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*LogentryClient) DeleteOneID

func (c *LogentryClient) DeleteOneID(id int) *LogentryDeleteOne

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

func (*LogentryClient) Get

func (c *LogentryClient) Get(ctx context.Context, id int) (*Logentry, error)

Get returns a Logentry entity by its id.

func (*LogentryClient) GetX

func (c *LogentryClient) GetX(ctx context.Context, id int) *Logentry

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

func (*LogentryClient) Hooks

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

Hooks returns the client hooks.

func (*LogentryClient) Intercept

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

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

func (*LogentryClient) Interceptors

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

Interceptors returns the client interceptors.

func (*LogentryClient) MapCreateBulk

func (c *LogentryClient) MapCreateBulk(slice any, setFunc func(*LogentryCreate, int)) *LogentryCreateBulk

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 (*LogentryClient) Query

func (c *LogentryClient) Query() *LogentryQuery

Query returns a query builder for Logentry.

func (*LogentryClient) QueryProject

func (c *LogentryClient) QueryProject(l *Logentry) *ProjectQuery

QueryProject queries the project edge of a Logentry.

func (*LogentryClient) Update

func (c *LogentryClient) Update() *LogentryUpdate

Update returns an update builder for Logentry.

func (*LogentryClient) UpdateOne

func (c *LogentryClient) UpdateOne(l *Logentry) *LogentryUpdateOne

UpdateOne returns an update builder for the given entity.

func (*LogentryClient) UpdateOneID

func (c *LogentryClient) UpdateOneID(id int) *LogentryUpdateOne

UpdateOneID returns an update builder for the given id.

func (*LogentryClient) Use

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

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

type LogentryCreate

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

LogentryCreate is the builder for creating a Logentry entity.

func (*LogentryCreate) Exec

func (lc *LogentryCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*LogentryCreate) ExecX

func (lc *LogentryCreate) ExecX(ctx context.Context)

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

func (*LogentryCreate) Mutation

func (lc *LogentryCreate) Mutation() *LogentryMutation

Mutation returns the LogentryMutation object of the builder.

func (*LogentryCreate) Save

func (lc *LogentryCreate) Save(ctx context.Context) (*Logentry, error)

Save creates the Logentry in the database.

func (*LogentryCreate) SaveX

func (lc *LogentryCreate) SaveX(ctx context.Context) *Logentry

SaveX calls Save and panics if Save returns an error.

func (*LogentryCreate) SetContent

func (lc *LogentryCreate) SetContent(s string) *LogentryCreate

SetContent sets the "content" field.

func (*LogentryCreate) SetDate

func (lc *LogentryCreate) SetDate(t time.Time) *LogentryCreate

SetDate sets the "date" field.

func (*LogentryCreate) SetID

func (lc *LogentryCreate) SetID(i int) *LogentryCreate

SetID sets the "id" field.

func (*LogentryCreate) SetNillableDate

func (lc *LogentryCreate) SetNillableDate(t *time.Time) *LogentryCreate

SetNillableDate sets the "date" field if the given value is not nil.

func (*LogentryCreate) SetNillableProjectID

func (lc *LogentryCreate) SetNillableProjectID(id *int) *LogentryCreate

SetNillableProjectID sets the "project" edge to the Project entity by ID if the given value is not nil.

func (*LogentryCreate) SetProject

func (lc *LogentryCreate) SetProject(p *Project) *LogentryCreate

SetProject sets the "project" edge to the Project entity.

func (*LogentryCreate) SetProjectID

func (lc *LogentryCreate) SetProjectID(id int) *LogentryCreate

SetProjectID sets the "project" edge to the Project entity by ID.

type LogentryCreateBulk

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

LogentryCreateBulk is the builder for creating many Logentry entities in bulk.

func (*LogentryCreateBulk) Exec

func (lcb *LogentryCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*LogentryCreateBulk) ExecX

func (lcb *LogentryCreateBulk) ExecX(ctx context.Context)

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

func (*LogentryCreateBulk) Save

func (lcb *LogentryCreateBulk) Save(ctx context.Context) ([]*Logentry, error)

Save creates the Logentry entities in the database.

func (*LogentryCreateBulk) SaveX

func (lcb *LogentryCreateBulk) SaveX(ctx context.Context) []*Logentry

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

type LogentryDelete

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

LogentryDelete is the builder for deleting a Logentry entity.

func (*LogentryDelete) Exec

func (ld *LogentryDelete) Exec(ctx context.Context) (int, error)

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

func (*LogentryDelete) ExecX

func (ld *LogentryDelete) ExecX(ctx context.Context) int

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

func (*LogentryDelete) Where

func (ld *LogentryDelete) Where(ps ...predicate.Logentry) *LogentryDelete

Where appends a list predicates to the LogentryDelete builder.

type LogentryDeleteOne

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

LogentryDeleteOne is the builder for deleting a single Logentry entity.

func (*LogentryDeleteOne) Exec

func (ldo *LogentryDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*LogentryDeleteOne) ExecX

func (ldo *LogentryDeleteOne) ExecX(ctx context.Context)

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

func (*LogentryDeleteOne) Where

Where appends a list predicates to the LogentryDelete builder.

type LogentryEdges

type LogentryEdges struct {
	// Project holds the value of the project edge.
	Project *Project `json:"project,omitempty"`
	// contains filtered or unexported fields
}

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

func (LogentryEdges) ProjectOrErr

func (e LogentryEdges) ProjectOrErr() (*Project, error)

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

type LogentryGroupBy

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

LogentryGroupBy is the group-by builder for Logentry entities.

func (*LogentryGroupBy) Aggregate

func (lgb *LogentryGroupBy) Aggregate(fns ...AggregateFunc) *LogentryGroupBy

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

func (*LogentryGroupBy) Bool

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

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

func (*LogentryGroupBy) BoolX

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

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

func (*LogentryGroupBy) Bools

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

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

func (*LogentryGroupBy) BoolsX

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

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

func (*LogentryGroupBy) Float64

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

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

func (*LogentryGroupBy) Float64X

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

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

func (*LogentryGroupBy) Float64s

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

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

func (*LogentryGroupBy) Float64sX

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

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

func (*LogentryGroupBy) Int

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

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

func (*LogentryGroupBy) IntX

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

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

func (*LogentryGroupBy) Ints

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

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

func (*LogentryGroupBy) IntsX

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

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

func (*LogentryGroupBy) Scan

func (lgb *LogentryGroupBy) Scan(ctx context.Context, v any) error

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

func (*LogentryGroupBy) ScanX

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

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

func (*LogentryGroupBy) String

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

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

func (*LogentryGroupBy) StringX

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

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

func (*LogentryGroupBy) Strings

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

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

func (*LogentryGroupBy) StringsX

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

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

type LogentryMutation

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

LogentryMutation represents an operation that mutates the Logentry nodes in the graph.

func (*LogentryMutation) AddField

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

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

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

func (*LogentryMutation) AddedField

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

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

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

func (*LogentryMutation) AddedIDs

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

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

func (*LogentryMutation) ClearEdge

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

func (m *LogentryMutation) 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 (*LogentryMutation) ClearProject

func (m *LogentryMutation) ClearProject()

ClearProject clears the "project" edge to the Project entity.

func (*LogentryMutation) ClearedEdges

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

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

func (*LogentryMutation) ClearedFields

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

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

func (LogentryMutation) Client

func (m LogentryMutation) 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 (*LogentryMutation) Content

func (m *LogentryMutation) Content() (r string, exists bool)

Content returns the value of the "content" field in the mutation.

func (*LogentryMutation) Date

func (m *LogentryMutation) Date() (r time.Time, exists bool)

Date returns the value of the "date" field in the mutation.

func (*LogentryMutation) EdgeCleared

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

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

func (*LogentryMutation) Field

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

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

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

func (*LogentryMutation) Fields

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

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

func (m *LogentryMutation) 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 (*LogentryMutation) OldContent

func (m *LogentryMutation) OldContent(ctx context.Context) (v string, err error)

OldContent returns the old "content" field's value of the Logentry entity. If the Logentry 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 (*LogentryMutation) OldDate

func (m *LogentryMutation) OldDate(ctx context.Context) (v time.Time, err error)

OldDate returns the old "date" field's value of the Logentry entity. If the Logentry 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 (*LogentryMutation) OldField

func (m *LogentryMutation) 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 (*LogentryMutation) Op

func (m *LogentryMutation) Op() Op

Op returns the operation name.

func (*LogentryMutation) ProjectCleared

func (m *LogentryMutation) ProjectCleared() bool

ProjectCleared reports if the "project" edge to the Project entity was cleared.

func (*LogentryMutation) ProjectID

func (m *LogentryMutation) ProjectID() (id int, exists bool)

ProjectID returns the "project" edge ID in the mutation.

func (*LogentryMutation) ProjectIDs

func (m *LogentryMutation) ProjectIDs() (ids []int)

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

func (*LogentryMutation) RemovedEdges

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

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

func (*LogentryMutation) RemovedIDs

func (m *LogentryMutation) 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 (*LogentryMutation) ResetContent

func (m *LogentryMutation) ResetContent()

ResetContent resets all changes to the "content" field.

func (*LogentryMutation) ResetDate

func (m *LogentryMutation) ResetDate()

ResetDate resets all changes to the "date" field.

func (*LogentryMutation) ResetEdge

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

func (m *LogentryMutation) 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 (*LogentryMutation) ResetProject

func (m *LogentryMutation) ResetProject()

ResetProject resets all changes to the "project" edge.

func (*LogentryMutation) SetContent

func (m *LogentryMutation) SetContent(s string)

SetContent sets the "content" field.

func (*LogentryMutation) SetDate

func (m *LogentryMutation) SetDate(t time.Time)

SetDate sets the "date" field.

func (*LogentryMutation) SetField

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

func (m *LogentryMutation) SetID(id int)

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

func (*LogentryMutation) SetOp

func (m *LogentryMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*LogentryMutation) SetProjectID

func (m *LogentryMutation) SetProjectID(id int)

SetProjectID sets the "project" edge to the Project entity by id.

func (LogentryMutation) Tx

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

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

func (*LogentryMutation) Type

func (m *LogentryMutation) Type() string

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

func (*LogentryMutation) Where

func (m *LogentryMutation) Where(ps ...predicate.Logentry)

Where appends a list predicates to the LogentryMutation builder.

func (*LogentryMutation) WhereP

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

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

type LogentryQuery

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

LogentryQuery is the builder for querying Logentry entities.

func (*LogentryQuery) Aggregate

func (lq *LogentryQuery) Aggregate(fns ...AggregateFunc) *LogentrySelect

Aggregate returns a LogentrySelect configured with the given aggregations.

func (*LogentryQuery) All

func (lq *LogentryQuery) All(ctx context.Context) ([]*Logentry, error)

All executes the query and returns a list of Logentries.

func (*LogentryQuery) AllX

func (lq *LogentryQuery) AllX(ctx context.Context) []*Logentry

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

func (*LogentryQuery) Clone

func (lq *LogentryQuery) Clone() *LogentryQuery

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

func (*LogentryQuery) Count

func (lq *LogentryQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*LogentryQuery) CountX

func (lq *LogentryQuery) CountX(ctx context.Context) int

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

func (*LogentryQuery) Exist

func (lq *LogentryQuery) Exist(ctx context.Context) (bool, error)

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

func (*LogentryQuery) ExistX

func (lq *LogentryQuery) ExistX(ctx context.Context) bool

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

func (*LogentryQuery) First

func (lq *LogentryQuery) First(ctx context.Context) (*Logentry, error)

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

func (*LogentryQuery) FirstID

func (lq *LogentryQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*LogentryQuery) FirstIDX

func (lq *LogentryQuery) FirstIDX(ctx context.Context) int

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

func (*LogentryQuery) FirstX

func (lq *LogentryQuery) FirstX(ctx context.Context) *Logentry

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

func (*LogentryQuery) GroupBy

func (lq *LogentryQuery) GroupBy(field string, fields ...string) *LogentryGroupBy

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

client.Logentry.Query().
	GroupBy(logentry.FieldDate).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*LogentryQuery) IDs

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

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

func (*LogentryQuery) IDsX

func (lq *LogentryQuery) IDsX(ctx context.Context) []int

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

func (*LogentryQuery) Limit

func (lq *LogentryQuery) Limit(limit int) *LogentryQuery

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

func (*LogentryQuery) Offset

func (lq *LogentryQuery) Offset(offset int) *LogentryQuery

Offset to start from.

func (*LogentryQuery) Only

func (lq *LogentryQuery) Only(ctx context.Context) (*Logentry, error)

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

func (*LogentryQuery) OnlyID

func (lq *LogentryQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*LogentryQuery) OnlyIDX

func (lq *LogentryQuery) OnlyIDX(ctx context.Context) int

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

func (*LogentryQuery) OnlyX

func (lq *LogentryQuery) OnlyX(ctx context.Context) *Logentry

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

func (*LogentryQuery) Order

Order specifies how the records should be ordered.

func (*LogentryQuery) QueryProject

func (lq *LogentryQuery) QueryProject() *ProjectQuery

QueryProject chains the current query on the "project" edge.

func (*LogentryQuery) Select

func (lq *LogentryQuery) Select(fields ...string) *LogentrySelect

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

client.Logentry.Query().
	Select(logentry.FieldDate).
	Scan(ctx, &v)

func (*LogentryQuery) Unique

func (lq *LogentryQuery) Unique(unique bool) *LogentryQuery

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

func (lq *LogentryQuery) Where(ps ...predicate.Logentry) *LogentryQuery

Where adds a new predicate for the LogentryQuery builder.

func (*LogentryQuery) WithProject

func (lq *LogentryQuery) WithProject(opts ...func(*ProjectQuery)) *LogentryQuery

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

type LogentrySelect

type LogentrySelect struct {
	*LogentryQuery
	// contains filtered or unexported fields
}

LogentrySelect is the builder for selecting fields of Logentry entities.

func (*LogentrySelect) Aggregate

func (ls *LogentrySelect) Aggregate(fns ...AggregateFunc) *LogentrySelect

Aggregate adds the given aggregation functions to the selector query.

func (*LogentrySelect) Bool

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

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

func (*LogentrySelect) BoolX

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

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

func (*LogentrySelect) Bools

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

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

func (*LogentrySelect) BoolsX

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

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

func (*LogentrySelect) Float64

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

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

func (*LogentrySelect) Float64X

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

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

func (*LogentrySelect) Float64s

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

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

func (*LogentrySelect) Float64sX

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

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

func (*LogentrySelect) Int

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

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

func (*LogentrySelect) IntX

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

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

func (*LogentrySelect) Ints

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

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

func (*LogentrySelect) IntsX

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

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

func (*LogentrySelect) Scan

func (ls *LogentrySelect) Scan(ctx context.Context, v any) error

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

func (*LogentrySelect) ScanX

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

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

func (*LogentrySelect) String

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

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

func (*LogentrySelect) StringX

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

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

func (*LogentrySelect) Strings

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

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

func (*LogentrySelect) StringsX

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

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

type LogentryUpdate

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

LogentryUpdate is the builder for updating Logentry entities.

func (*LogentryUpdate) ClearProject

func (lu *LogentryUpdate) ClearProject() *LogentryUpdate

ClearProject clears the "project" edge to the Project entity.

func (*LogentryUpdate) Exec

func (lu *LogentryUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*LogentryUpdate) ExecX

func (lu *LogentryUpdate) ExecX(ctx context.Context)

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

func (*LogentryUpdate) Mutation

func (lu *LogentryUpdate) Mutation() *LogentryMutation

Mutation returns the LogentryMutation object of the builder.

func (*LogentryUpdate) Save

func (lu *LogentryUpdate) Save(ctx context.Context) (int, error)

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

func (*LogentryUpdate) SaveX

func (lu *LogentryUpdate) SaveX(ctx context.Context) int

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

func (*LogentryUpdate) SetContent

func (lu *LogentryUpdate) SetContent(s string) *LogentryUpdate

SetContent sets the "content" field.

func (*LogentryUpdate) SetNillableContent

func (lu *LogentryUpdate) SetNillableContent(s *string) *LogentryUpdate

SetNillableContent sets the "content" field if the given value is not nil.

func (*LogentryUpdate) SetNillableProjectID

func (lu *LogentryUpdate) SetNillableProjectID(id *int) *LogentryUpdate

SetNillableProjectID sets the "project" edge to the Project entity by ID if the given value is not nil.

func (*LogentryUpdate) SetProject

func (lu *LogentryUpdate) SetProject(p *Project) *LogentryUpdate

SetProject sets the "project" edge to the Project entity.

func (*LogentryUpdate) SetProjectID

func (lu *LogentryUpdate) SetProjectID(id int) *LogentryUpdate

SetProjectID sets the "project" edge to the Project entity by ID.

func (*LogentryUpdate) Where

func (lu *LogentryUpdate) Where(ps ...predicate.Logentry) *LogentryUpdate

Where appends a list predicates to the LogentryUpdate builder.

type LogentryUpdateOne

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

LogentryUpdateOne is the builder for updating a single Logentry entity.

func (*LogentryUpdateOne) ClearProject

func (luo *LogentryUpdateOne) ClearProject() *LogentryUpdateOne

ClearProject clears the "project" edge to the Project entity.

func (*LogentryUpdateOne) Exec

func (luo *LogentryUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*LogentryUpdateOne) ExecX

func (luo *LogentryUpdateOne) ExecX(ctx context.Context)

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

func (*LogentryUpdateOne) Mutation

func (luo *LogentryUpdateOne) Mutation() *LogentryMutation

Mutation returns the LogentryMutation object of the builder.

func (*LogentryUpdateOne) Save

func (luo *LogentryUpdateOne) Save(ctx context.Context) (*Logentry, error)

Save executes the query and returns the updated Logentry entity.

func (*LogentryUpdateOne) SaveX

func (luo *LogentryUpdateOne) SaveX(ctx context.Context) *Logentry

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

func (*LogentryUpdateOne) Select

func (luo *LogentryUpdateOne) Select(field string, fields ...string) *LogentryUpdateOne

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

func (*LogentryUpdateOne) SetContent

func (luo *LogentryUpdateOne) SetContent(s string) *LogentryUpdateOne

SetContent sets the "content" field.

func (*LogentryUpdateOne) SetNillableContent

func (luo *LogentryUpdateOne) SetNillableContent(s *string) *LogentryUpdateOne

SetNillableContent sets the "content" field if the given value is not nil.

func (*LogentryUpdateOne) SetNillableProjectID

func (luo *LogentryUpdateOne) SetNillableProjectID(id *int) *LogentryUpdateOne

SetNillableProjectID sets the "project" edge to the Project entity by ID if the given value is not nil.

func (*LogentryUpdateOne) SetProject

func (luo *LogentryUpdateOne) SetProject(p *Project) *LogentryUpdateOne

SetProject sets the "project" edge to the Project entity.

func (*LogentryUpdateOne) SetProjectID

func (luo *LogentryUpdateOne) SetProjectID(id int) *LogentryUpdateOne

SetProjectID sets the "project" edge to the Project entity by ID.

func (*LogentryUpdateOne) Where

Where appends a list predicates to the LogentryUpdate builder.

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 Policy

type Policy = ent.Policy

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

type Project

type Project struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// CreateTime holds the value of the "create_time" field.
	CreateTime time.Time `json:"create_time,omitempty"`
	// User holds the value of the "user" field.
	User string `json:"user,omitempty"`
	// Group holds the value of the "group" field.
	Group string `json:"group,omitempty"`
	// RootPath holds the value of the "root_path" field.
	RootPath string `json:"root_path,omitempty"`
	// ServiceName holds the value of the "service_name" field.
	ServiceName string `json:"service_name,omitempty"`
	// BinaryPath holds the value of the "binary_path" field.
	BinaryPath string `json:"binary_path,omitempty"`
	// MoveToTarget holds the value of the "move_to_target" field.
	MoveToTarget bool `json:"move_to_target,omitempty"`
	// BinaryTargetPath holds the value of the "binary_target_path" field.
	BinaryTargetPath string `json:"binary_target_path,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the ProjectQuery when eager-loading is set.
	Edges ProjectEdges `json:"edges"`
	// contains filtered or unexported fields
}

Project is the model entity for the Project schema.

func (*Project) QueryLogentries

func (pr *Project) QueryLogentries() *LogentryQuery

QueryLogentries queries the "logentries" edge of the Project entity.

func (*Project) String

func (pr *Project) String() string

String implements the fmt.Stringer.

func (*Project) Unwrap

func (pr *Project) Unwrap() *Project

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

func (pr *Project) Update() *ProjectUpdateOne

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

func (*Project) Value

func (pr *Project) Value(name string) (ent.Value, error)

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

type ProjectClient

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

ProjectClient is a client for the Project schema.

func NewProjectClient

func NewProjectClient(c config) *ProjectClient

NewProjectClient returns a client for the Project from the given config.

func (*ProjectClient) Create

func (c *ProjectClient) Create() *ProjectCreate

Create returns a builder for creating a Project entity.

func (*ProjectClient) CreateBulk

func (c *ProjectClient) CreateBulk(builders ...*ProjectCreate) *ProjectCreateBulk

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

func (*ProjectClient) Delete

func (c *ProjectClient) Delete() *ProjectDelete

Delete returns a delete builder for Project.

func (*ProjectClient) DeleteOne

func (c *ProjectClient) DeleteOne(pr *Project) *ProjectDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*ProjectClient) DeleteOneID

func (c *ProjectClient) DeleteOneID(id int) *ProjectDeleteOne

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

func (*ProjectClient) Get

func (c *ProjectClient) Get(ctx context.Context, id int) (*Project, error)

Get returns a Project entity by its id.

func (*ProjectClient) GetX

func (c *ProjectClient) GetX(ctx context.Context, id int) *Project

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

func (*ProjectClient) Hooks

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

Hooks returns the client hooks.

func (*ProjectClient) Intercept

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

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

func (*ProjectClient) Interceptors

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

Interceptors returns the client interceptors.

func (*ProjectClient) MapCreateBulk

func (c *ProjectClient) MapCreateBulk(slice any, setFunc func(*ProjectCreate, int)) *ProjectCreateBulk

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 (*ProjectClient) Query

func (c *ProjectClient) Query() *ProjectQuery

Query returns a query builder for Project.

func (*ProjectClient) QueryLogentries

func (c *ProjectClient) QueryLogentries(pr *Project) *LogentryQuery

QueryLogentries queries the logentries edge of a Project.

func (*ProjectClient) Update

func (c *ProjectClient) Update() *ProjectUpdate

Update returns an update builder for Project.

func (*ProjectClient) UpdateOne

func (c *ProjectClient) UpdateOne(pr *Project) *ProjectUpdateOne

UpdateOne returns an update builder for the given entity.

func (*ProjectClient) UpdateOneID

func (c *ProjectClient) UpdateOneID(id int) *ProjectUpdateOne

UpdateOneID returns an update builder for the given id.

func (*ProjectClient) Use

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

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

type ProjectCreate

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

ProjectCreate is the builder for creating a Project entity.

func (*ProjectCreate) AddLogentries

func (pc *ProjectCreate) AddLogentries(l ...*Logentry) *ProjectCreate

AddLogentries adds the "logentries" edges to the Logentry entity.

func (*ProjectCreate) AddLogentryIDs

func (pc *ProjectCreate) AddLogentryIDs(ids ...int) *ProjectCreate

AddLogentryIDs adds the "logentries" edge to the Logentry entity by IDs.

func (*ProjectCreate) Exec

func (pc *ProjectCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*ProjectCreate) ExecX

func (pc *ProjectCreate) ExecX(ctx context.Context)

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

func (*ProjectCreate) Mutation

func (pc *ProjectCreate) Mutation() *ProjectMutation

Mutation returns the ProjectMutation object of the builder.

func (*ProjectCreate) Save

func (pc *ProjectCreate) Save(ctx context.Context) (*Project, error)

Save creates the Project in the database.

func (*ProjectCreate) SaveX

func (pc *ProjectCreate) SaveX(ctx context.Context) *Project

SaveX calls Save and panics if Save returns an error.

func (*ProjectCreate) SetBinaryPath

func (pc *ProjectCreate) SetBinaryPath(s string) *ProjectCreate

SetBinaryPath sets the "binary_path" field.

func (*ProjectCreate) SetBinaryTargetPath

func (pc *ProjectCreate) SetBinaryTargetPath(s string) *ProjectCreate

SetBinaryTargetPath sets the "binary_target_path" field.

func (*ProjectCreate) SetCreateTime

func (pc *ProjectCreate) SetCreateTime(t time.Time) *ProjectCreate

SetCreateTime sets the "create_time" field.

func (*ProjectCreate) SetGroup

func (pc *ProjectCreate) SetGroup(s string) *ProjectCreate

SetGroup sets the "group" field.

func (*ProjectCreate) SetID

func (pc *ProjectCreate) SetID(i int) *ProjectCreate

SetID sets the "id" field.

func (*ProjectCreate) SetMoveToTarget

func (pc *ProjectCreate) SetMoveToTarget(b bool) *ProjectCreate

SetMoveToTarget sets the "move_to_target" field.

func (*ProjectCreate) SetNillableBinaryTargetPath

func (pc *ProjectCreate) SetNillableBinaryTargetPath(s *string) *ProjectCreate

SetNillableBinaryTargetPath sets the "binary_target_path" field if the given value is not nil.

func (*ProjectCreate) SetNillableCreateTime

func (pc *ProjectCreate) SetNillableCreateTime(t *time.Time) *ProjectCreate

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

func (*ProjectCreate) SetNillableMoveToTarget

func (pc *ProjectCreate) SetNillableMoveToTarget(b *bool) *ProjectCreate

SetNillableMoveToTarget sets the "move_to_target" field if the given value is not nil.

func (*ProjectCreate) SetRootPath

func (pc *ProjectCreate) SetRootPath(s string) *ProjectCreate

SetRootPath sets the "root_path" field.

func (*ProjectCreate) SetServiceName

func (pc *ProjectCreate) SetServiceName(s string) *ProjectCreate

SetServiceName sets the "service_name" field.

func (*ProjectCreate) SetUser

func (pc *ProjectCreate) SetUser(s string) *ProjectCreate

SetUser sets the "user" field.

type ProjectCreateBulk

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

ProjectCreateBulk is the builder for creating many Project entities in bulk.

func (*ProjectCreateBulk) Exec

func (pcb *ProjectCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*ProjectCreateBulk) ExecX

func (pcb *ProjectCreateBulk) ExecX(ctx context.Context)

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

func (*ProjectCreateBulk) Save

func (pcb *ProjectCreateBulk) Save(ctx context.Context) ([]*Project, error)

Save creates the Project entities in the database.

func (*ProjectCreateBulk) SaveX

func (pcb *ProjectCreateBulk) SaveX(ctx context.Context) []*Project

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

type ProjectDelete

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

ProjectDelete is the builder for deleting a Project entity.

func (*ProjectDelete) Exec

func (pd *ProjectDelete) Exec(ctx context.Context) (int, error)

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

func (*ProjectDelete) ExecX

func (pd *ProjectDelete) ExecX(ctx context.Context) int

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

func (*ProjectDelete) Where

func (pd *ProjectDelete) Where(ps ...predicate.Project) *ProjectDelete

Where appends a list predicates to the ProjectDelete builder.

type ProjectDeleteOne

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

ProjectDeleteOne is the builder for deleting a single Project entity.

func (*ProjectDeleteOne) Exec

func (pdo *ProjectDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*ProjectDeleteOne) ExecX

func (pdo *ProjectDeleteOne) ExecX(ctx context.Context)

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

func (*ProjectDeleteOne) Where

Where appends a list predicates to the ProjectDelete builder.

type ProjectEdges

type ProjectEdges struct {
	// Logentries holds the value of the logentries edge.
	Logentries []*Logentry `json:"logentries,omitempty"`
	// contains filtered or unexported fields
}

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

func (ProjectEdges) LogentriesOrErr

func (e ProjectEdges) LogentriesOrErr() ([]*Logentry, error)

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

type ProjectGroupBy

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

ProjectGroupBy is the group-by builder for Project entities.

func (*ProjectGroupBy) Aggregate

func (pgb *ProjectGroupBy) Aggregate(fns ...AggregateFunc) *ProjectGroupBy

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

func (*ProjectGroupBy) Bool

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

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

func (*ProjectGroupBy) BoolX

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

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

func (*ProjectGroupBy) Bools

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

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

func (*ProjectGroupBy) BoolsX

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

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

func (*ProjectGroupBy) Float64

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

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

func (*ProjectGroupBy) Float64X

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

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

func (*ProjectGroupBy) Float64s

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

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

func (*ProjectGroupBy) Float64sX

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

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

func (*ProjectGroupBy) Int

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

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

func (*ProjectGroupBy) IntX

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

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

func (*ProjectGroupBy) Ints

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

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

func (*ProjectGroupBy) IntsX

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

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

func (*ProjectGroupBy) Scan

func (pgb *ProjectGroupBy) Scan(ctx context.Context, v any) error

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

func (*ProjectGroupBy) ScanX

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

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

func (*ProjectGroupBy) String

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

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

func (*ProjectGroupBy) StringX

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

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

func (*ProjectGroupBy) Strings

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

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

func (*ProjectGroupBy) StringsX

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

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

type ProjectMutation

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

ProjectMutation represents an operation that mutates the Project nodes in the graph.

func (*ProjectMutation) AddField

func (m *ProjectMutation) 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 (*ProjectMutation) AddLogentryIDs

func (m *ProjectMutation) AddLogentryIDs(ids ...int)

AddLogentryIDs adds the "logentries" edge to the Logentry entity by ids.

func (*ProjectMutation) AddedEdges

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

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

func (*ProjectMutation) AddedField

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

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

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

func (*ProjectMutation) AddedIDs

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

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

func (*ProjectMutation) BinaryPath

func (m *ProjectMutation) BinaryPath() (r string, exists bool)

BinaryPath returns the value of the "binary_path" field in the mutation.

func (*ProjectMutation) BinaryTargetPath

func (m *ProjectMutation) BinaryTargetPath() (r string, exists bool)

BinaryTargetPath returns the value of the "binary_target_path" field in the mutation.

func (*ProjectMutation) BinaryTargetPathCleared

func (m *ProjectMutation) BinaryTargetPathCleared() bool

BinaryTargetPathCleared returns if the "binary_target_path" field was cleared in this mutation.

func (*ProjectMutation) ClearBinaryTargetPath

func (m *ProjectMutation) ClearBinaryTargetPath()

ClearBinaryTargetPath clears the value of the "binary_target_path" field.

func (*ProjectMutation) ClearEdge

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

func (m *ProjectMutation) 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 (*ProjectMutation) ClearLogentries

func (m *ProjectMutation) ClearLogentries()

ClearLogentries clears the "logentries" edge to the Logentry entity.

func (*ProjectMutation) ClearedEdges

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

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

func (*ProjectMutation) ClearedFields

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

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

func (ProjectMutation) Client

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

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

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

func (*ProjectMutation) EdgeCleared

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

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

func (*ProjectMutation) Field

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

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

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

func (*ProjectMutation) Fields

func (m *ProjectMutation) 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 (*ProjectMutation) Group

func (m *ProjectMutation) Group() (r string, exists bool)

Group returns the value of the "group" field in the mutation.

func (*ProjectMutation) ID

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

func (m *ProjectMutation) 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 (*ProjectMutation) LogentriesCleared

func (m *ProjectMutation) LogentriesCleared() bool

LogentriesCleared reports if the "logentries" edge to the Logentry entity was cleared.

func (*ProjectMutation) LogentriesIDs

func (m *ProjectMutation) LogentriesIDs() (ids []int)

LogentriesIDs returns the "logentries" edge IDs in the mutation.

func (*ProjectMutation) MoveToTarget

func (m *ProjectMutation) MoveToTarget() (r bool, exists bool)

MoveToTarget returns the value of the "move_to_target" field in the mutation.

func (*ProjectMutation) OldBinaryPath

func (m *ProjectMutation) OldBinaryPath(ctx context.Context) (v string, err error)

OldBinaryPath returns the old "binary_path" field's value of the Project entity. If the Project 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 (*ProjectMutation) OldBinaryTargetPath

func (m *ProjectMutation) OldBinaryTargetPath(ctx context.Context) (v string, err error)

OldBinaryTargetPath returns the old "binary_target_path" field's value of the Project entity. If the Project 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 (*ProjectMutation) OldCreateTime

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

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

func (m *ProjectMutation) 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 (*ProjectMutation) OldGroup

func (m *ProjectMutation) OldGroup(ctx context.Context) (v string, err error)

OldGroup returns the old "group" field's value of the Project entity. If the Project 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 (*ProjectMutation) OldMoveToTarget

func (m *ProjectMutation) OldMoveToTarget(ctx context.Context) (v bool, err error)

OldMoveToTarget returns the old "move_to_target" field's value of the Project entity. If the Project 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 (*ProjectMutation) OldRootPath

func (m *ProjectMutation) OldRootPath(ctx context.Context) (v string, err error)

OldRootPath returns the old "root_path" field's value of the Project entity. If the Project 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 (*ProjectMutation) OldServiceName

func (m *ProjectMutation) OldServiceName(ctx context.Context) (v string, err error)

OldServiceName returns the old "service_name" field's value of the Project entity. If the Project 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 (*ProjectMutation) OldUser

func (m *ProjectMutation) OldUser(ctx context.Context) (v string, err error)

OldUser returns the old "user" field's value of the Project entity. If the Project 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 (*ProjectMutation) Op

func (m *ProjectMutation) Op() Op

Op returns the operation name.

func (*ProjectMutation) RemoveLogentryIDs

func (m *ProjectMutation) RemoveLogentryIDs(ids ...int)

RemoveLogentryIDs removes the "logentries" edge to the Logentry entity by IDs.

func (*ProjectMutation) RemovedEdges

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

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

func (*ProjectMutation) RemovedIDs

func (m *ProjectMutation) 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 (*ProjectMutation) RemovedLogentriesIDs

func (m *ProjectMutation) RemovedLogentriesIDs() (ids []int)

RemovedLogentries returns the removed IDs of the "logentries" edge to the Logentry entity.

func (*ProjectMutation) ResetBinaryPath

func (m *ProjectMutation) ResetBinaryPath()

ResetBinaryPath resets all changes to the "binary_path" field.

func (*ProjectMutation) ResetBinaryTargetPath

func (m *ProjectMutation) ResetBinaryTargetPath()

ResetBinaryTargetPath resets all changes to the "binary_target_path" field.

func (*ProjectMutation) ResetCreateTime

func (m *ProjectMutation) ResetCreateTime()

ResetCreateTime resets all changes to the "create_time" field.

func (*ProjectMutation) ResetEdge

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

func (m *ProjectMutation) 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 (*ProjectMutation) ResetGroup

func (m *ProjectMutation) ResetGroup()

ResetGroup resets all changes to the "group" field.

func (*ProjectMutation) ResetLogentries

func (m *ProjectMutation) ResetLogentries()

ResetLogentries resets all changes to the "logentries" edge.

func (*ProjectMutation) ResetMoveToTarget

func (m *ProjectMutation) ResetMoveToTarget()

ResetMoveToTarget resets all changes to the "move_to_target" field.

func (*ProjectMutation) ResetRootPath

func (m *ProjectMutation) ResetRootPath()

ResetRootPath resets all changes to the "root_path" field.

func (*ProjectMutation) ResetServiceName

func (m *ProjectMutation) ResetServiceName()

ResetServiceName resets all changes to the "service_name" field.

func (*ProjectMutation) ResetUser

func (m *ProjectMutation) ResetUser()

ResetUser resets all changes to the "user" field.

func (*ProjectMutation) RootPath

func (m *ProjectMutation) RootPath() (r string, exists bool)

RootPath returns the value of the "root_path" field in the mutation.

func (*ProjectMutation) ServiceName

func (m *ProjectMutation) ServiceName() (r string, exists bool)

ServiceName returns the value of the "service_name" field in the mutation.

func (*ProjectMutation) SetBinaryPath

func (m *ProjectMutation) SetBinaryPath(s string)

SetBinaryPath sets the "binary_path" field.

func (*ProjectMutation) SetBinaryTargetPath

func (m *ProjectMutation) SetBinaryTargetPath(s string)

SetBinaryTargetPath sets the "binary_target_path" field.

func (*ProjectMutation) SetCreateTime

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

SetCreateTime sets the "create_time" field.

func (*ProjectMutation) SetField

func (m *ProjectMutation) 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 (*ProjectMutation) SetGroup

func (m *ProjectMutation) SetGroup(s string)

SetGroup sets the "group" field.

func (*ProjectMutation) SetID

func (m *ProjectMutation) SetID(id int)

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

func (*ProjectMutation) SetMoveToTarget

func (m *ProjectMutation) SetMoveToTarget(b bool)

SetMoveToTarget sets the "move_to_target" field.

func (*ProjectMutation) SetOp

func (m *ProjectMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*ProjectMutation) SetRootPath

func (m *ProjectMutation) SetRootPath(s string)

SetRootPath sets the "root_path" field.

func (*ProjectMutation) SetServiceName

func (m *ProjectMutation) SetServiceName(s string)

SetServiceName sets the "service_name" field.

func (*ProjectMutation) SetUser

func (m *ProjectMutation) SetUser(s string)

SetUser sets the "user" field.

func (ProjectMutation) Tx

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

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

func (*ProjectMutation) Type

func (m *ProjectMutation) Type() string

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

func (*ProjectMutation) User

func (m *ProjectMutation) User() (r string, exists bool)

User returns the value of the "user" field in the mutation.

func (*ProjectMutation) Where

func (m *ProjectMutation) Where(ps ...predicate.Project)

Where appends a list predicates to the ProjectMutation builder.

func (*ProjectMutation) WhereP

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

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

type ProjectQuery

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

ProjectQuery is the builder for querying Project entities.

func (*ProjectQuery) Aggregate

func (pq *ProjectQuery) Aggregate(fns ...AggregateFunc) *ProjectSelect

Aggregate returns a ProjectSelect configured with the given aggregations.

func (*ProjectQuery) All

func (pq *ProjectQuery) All(ctx context.Context) ([]*Project, error)

All executes the query and returns a list of Projects.

func (*ProjectQuery) AllX

func (pq *ProjectQuery) AllX(ctx context.Context) []*Project

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

func (*ProjectQuery) Clone

func (pq *ProjectQuery) Clone() *ProjectQuery

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

func (*ProjectQuery) Count

func (pq *ProjectQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*ProjectQuery) CountX

func (pq *ProjectQuery) CountX(ctx context.Context) int

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

func (*ProjectQuery) Exist

func (pq *ProjectQuery) Exist(ctx context.Context) (bool, error)

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

func (*ProjectQuery) ExistX

func (pq *ProjectQuery) ExistX(ctx context.Context) bool

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

func (*ProjectQuery) First

func (pq *ProjectQuery) First(ctx context.Context) (*Project, error)

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

func (*ProjectQuery) FirstID

func (pq *ProjectQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*ProjectQuery) FirstIDX

func (pq *ProjectQuery) FirstIDX(ctx context.Context) int

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

func (*ProjectQuery) FirstX

func (pq *ProjectQuery) FirstX(ctx context.Context) *Project

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

func (*ProjectQuery) GroupBy

func (pq *ProjectQuery) GroupBy(field string, fields ...string) *ProjectGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

Example:

var v []struct {
	CreateTime time.Time `json:"create_time,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Project.Query().
	GroupBy(project.FieldCreateTime).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*ProjectQuery) IDs

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

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

func (*ProjectQuery) IDsX

func (pq *ProjectQuery) IDsX(ctx context.Context) []int

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

func (*ProjectQuery) Limit

func (pq *ProjectQuery) Limit(limit int) *ProjectQuery

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

func (*ProjectQuery) Offset

func (pq *ProjectQuery) Offset(offset int) *ProjectQuery

Offset to start from.

func (*ProjectQuery) Only

func (pq *ProjectQuery) Only(ctx context.Context) (*Project, error)

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

func (*ProjectQuery) OnlyID

func (pq *ProjectQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*ProjectQuery) OnlyIDX

func (pq *ProjectQuery) OnlyIDX(ctx context.Context) int

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

func (*ProjectQuery) OnlyX

func (pq *ProjectQuery) OnlyX(ctx context.Context) *Project

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

func (*ProjectQuery) Order

func (pq *ProjectQuery) Order(o ...project.OrderOption) *ProjectQuery

Order specifies how the records should be ordered.

func (*ProjectQuery) QueryLogentries

func (pq *ProjectQuery) QueryLogentries() *LogentryQuery

QueryLogentries chains the current query on the "logentries" edge.

func (*ProjectQuery) Select

func (pq *ProjectQuery) Select(fields ...string) *ProjectSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	CreateTime time.Time `json:"create_time,omitempty"`
}

client.Project.Query().
	Select(project.FieldCreateTime).
	Scan(ctx, &v)

func (*ProjectQuery) Unique

func (pq *ProjectQuery) Unique(unique bool) *ProjectQuery

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

func (pq *ProjectQuery) Where(ps ...predicate.Project) *ProjectQuery

Where adds a new predicate for the ProjectQuery builder.

func (*ProjectQuery) WithLogentries

func (pq *ProjectQuery) WithLogentries(opts ...func(*LogentryQuery)) *ProjectQuery

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

type ProjectSelect

type ProjectSelect struct {
	*ProjectQuery
	// contains filtered or unexported fields
}

ProjectSelect is the builder for selecting fields of Project entities.

func (*ProjectSelect) Aggregate

func (ps *ProjectSelect) Aggregate(fns ...AggregateFunc) *ProjectSelect

Aggregate adds the given aggregation functions to the selector query.

func (*ProjectSelect) Bool

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

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

func (*ProjectSelect) BoolX

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

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

func (*ProjectSelect) Bools

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

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

func (*ProjectSelect) BoolsX

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

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

func (*ProjectSelect) Float64

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

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

func (*ProjectSelect) Float64X

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

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

func (*ProjectSelect) Float64s

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

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

func (*ProjectSelect) Float64sX

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

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

func (*ProjectSelect) Int

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

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

func (*ProjectSelect) IntX

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

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

func (*ProjectSelect) Ints

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

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

func (*ProjectSelect) IntsX

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

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

func (*ProjectSelect) Scan

func (ps *ProjectSelect) Scan(ctx context.Context, v any) error

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

func (*ProjectSelect) ScanX

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

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

func (*ProjectSelect) String

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

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

func (*ProjectSelect) StringX

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

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

func (*ProjectSelect) Strings

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

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

func (*ProjectSelect) StringsX

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

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

type ProjectUpdate

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

ProjectUpdate is the builder for updating Project entities.

func (*ProjectUpdate) AddLogentries

func (pu *ProjectUpdate) AddLogentries(l ...*Logentry) *ProjectUpdate

AddLogentries adds the "logentries" edges to the Logentry entity.

func (*ProjectUpdate) AddLogentryIDs

func (pu *ProjectUpdate) AddLogentryIDs(ids ...int) *ProjectUpdate

AddLogentryIDs adds the "logentries" edge to the Logentry entity by IDs.

func (*ProjectUpdate) ClearBinaryTargetPath

func (pu *ProjectUpdate) ClearBinaryTargetPath() *ProjectUpdate

ClearBinaryTargetPath clears the value of the "binary_target_path" field.

func (*ProjectUpdate) ClearLogentries

func (pu *ProjectUpdate) ClearLogentries() *ProjectUpdate

ClearLogentries clears all "logentries" edges to the Logentry entity.

func (*ProjectUpdate) Exec

func (pu *ProjectUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*ProjectUpdate) ExecX

func (pu *ProjectUpdate) ExecX(ctx context.Context)

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

func (*ProjectUpdate) Mutation

func (pu *ProjectUpdate) Mutation() *ProjectMutation

Mutation returns the ProjectMutation object of the builder.

func (*ProjectUpdate) RemoveLogentries

func (pu *ProjectUpdate) RemoveLogentries(l ...*Logentry) *ProjectUpdate

RemoveLogentries removes "logentries" edges to Logentry entities.

func (*ProjectUpdate) RemoveLogentryIDs

func (pu *ProjectUpdate) RemoveLogentryIDs(ids ...int) *ProjectUpdate

RemoveLogentryIDs removes the "logentries" edge to Logentry entities by IDs.

func (*ProjectUpdate) Save

func (pu *ProjectUpdate) Save(ctx context.Context) (int, error)

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

func (*ProjectUpdate) SaveX

func (pu *ProjectUpdate) SaveX(ctx context.Context) int

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

func (*ProjectUpdate) SetBinaryPath

func (pu *ProjectUpdate) SetBinaryPath(s string) *ProjectUpdate

SetBinaryPath sets the "binary_path" field.

func (*ProjectUpdate) SetBinaryTargetPath

func (pu *ProjectUpdate) SetBinaryTargetPath(s string) *ProjectUpdate

SetBinaryTargetPath sets the "binary_target_path" field.

func (*ProjectUpdate) SetGroup

func (pu *ProjectUpdate) SetGroup(s string) *ProjectUpdate

SetGroup sets the "group" field.

func (*ProjectUpdate) SetMoveToTarget

func (pu *ProjectUpdate) SetMoveToTarget(b bool) *ProjectUpdate

SetMoveToTarget sets the "move_to_target" field.

func (*ProjectUpdate) SetNillableBinaryPath

func (pu *ProjectUpdate) SetNillableBinaryPath(s *string) *ProjectUpdate

SetNillableBinaryPath sets the "binary_path" field if the given value is not nil.

func (*ProjectUpdate) SetNillableBinaryTargetPath

func (pu *ProjectUpdate) SetNillableBinaryTargetPath(s *string) *ProjectUpdate

SetNillableBinaryTargetPath sets the "binary_target_path" field if the given value is not nil.

func (*ProjectUpdate) SetNillableGroup

func (pu *ProjectUpdate) SetNillableGroup(s *string) *ProjectUpdate

SetNillableGroup sets the "group" field if the given value is not nil.

func (*ProjectUpdate) SetNillableMoveToTarget

func (pu *ProjectUpdate) SetNillableMoveToTarget(b *bool) *ProjectUpdate

SetNillableMoveToTarget sets the "move_to_target" field if the given value is not nil.

func (*ProjectUpdate) SetNillableRootPath

func (pu *ProjectUpdate) SetNillableRootPath(s *string) *ProjectUpdate

SetNillableRootPath sets the "root_path" field if the given value is not nil.

func (*ProjectUpdate) SetNillableServiceName

func (pu *ProjectUpdate) SetNillableServiceName(s *string) *ProjectUpdate

SetNillableServiceName sets the "service_name" field if the given value is not nil.

func (*ProjectUpdate) SetNillableUser

func (pu *ProjectUpdate) SetNillableUser(s *string) *ProjectUpdate

SetNillableUser sets the "user" field if the given value is not nil.

func (*ProjectUpdate) SetRootPath

func (pu *ProjectUpdate) SetRootPath(s string) *ProjectUpdate

SetRootPath sets the "root_path" field.

func (*ProjectUpdate) SetServiceName

func (pu *ProjectUpdate) SetServiceName(s string) *ProjectUpdate

SetServiceName sets the "service_name" field.

func (*ProjectUpdate) SetUser

func (pu *ProjectUpdate) SetUser(s string) *ProjectUpdate

SetUser sets the "user" field.

func (*ProjectUpdate) Where

func (pu *ProjectUpdate) Where(ps ...predicate.Project) *ProjectUpdate

Where appends a list predicates to the ProjectUpdate builder.

type ProjectUpdateOne

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

ProjectUpdateOne is the builder for updating a single Project entity.

func (*ProjectUpdateOne) AddLogentries

func (puo *ProjectUpdateOne) AddLogentries(l ...*Logentry) *ProjectUpdateOne

AddLogentries adds the "logentries" edges to the Logentry entity.

func (*ProjectUpdateOne) AddLogentryIDs

func (puo *ProjectUpdateOne) AddLogentryIDs(ids ...int) *ProjectUpdateOne

AddLogentryIDs adds the "logentries" edge to the Logentry entity by IDs.

func (*ProjectUpdateOne) ClearBinaryTargetPath

func (puo *ProjectUpdateOne) ClearBinaryTargetPath() *ProjectUpdateOne

ClearBinaryTargetPath clears the value of the "binary_target_path" field.

func (*ProjectUpdateOne) ClearLogentries

func (puo *ProjectUpdateOne) ClearLogentries() *ProjectUpdateOne

ClearLogentries clears all "logentries" edges to the Logentry entity.

func (*ProjectUpdateOne) Exec

func (puo *ProjectUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*ProjectUpdateOne) ExecX

func (puo *ProjectUpdateOne) ExecX(ctx context.Context)

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

func (*ProjectUpdateOne) Mutation

func (puo *ProjectUpdateOne) Mutation() *ProjectMutation

Mutation returns the ProjectMutation object of the builder.

func (*ProjectUpdateOne) RemoveLogentries

func (puo *ProjectUpdateOne) RemoveLogentries(l ...*Logentry) *ProjectUpdateOne

RemoveLogentries removes "logentries" edges to Logentry entities.

func (*ProjectUpdateOne) RemoveLogentryIDs

func (puo *ProjectUpdateOne) RemoveLogentryIDs(ids ...int) *ProjectUpdateOne

RemoveLogentryIDs removes the "logentries" edge to Logentry entities by IDs.

func (*ProjectUpdateOne) Save

func (puo *ProjectUpdateOne) Save(ctx context.Context) (*Project, error)

Save executes the query and returns the updated Project entity.

func (*ProjectUpdateOne) SaveX

func (puo *ProjectUpdateOne) SaveX(ctx context.Context) *Project

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

func (*ProjectUpdateOne) Select

func (puo *ProjectUpdateOne) Select(field string, fields ...string) *ProjectUpdateOne

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

func (*ProjectUpdateOne) SetBinaryPath

func (puo *ProjectUpdateOne) SetBinaryPath(s string) *ProjectUpdateOne

SetBinaryPath sets the "binary_path" field.

func (*ProjectUpdateOne) SetBinaryTargetPath

func (puo *ProjectUpdateOne) SetBinaryTargetPath(s string) *ProjectUpdateOne

SetBinaryTargetPath sets the "binary_target_path" field.

func (*ProjectUpdateOne) SetGroup

func (puo *ProjectUpdateOne) SetGroup(s string) *ProjectUpdateOne

SetGroup sets the "group" field.

func (*ProjectUpdateOne) SetMoveToTarget

func (puo *ProjectUpdateOne) SetMoveToTarget(b bool) *ProjectUpdateOne

SetMoveToTarget sets the "move_to_target" field.

func (*ProjectUpdateOne) SetNillableBinaryPath

func (puo *ProjectUpdateOne) SetNillableBinaryPath(s *string) *ProjectUpdateOne

SetNillableBinaryPath sets the "binary_path" field if the given value is not nil.

func (*ProjectUpdateOne) SetNillableBinaryTargetPath

func (puo *ProjectUpdateOne) SetNillableBinaryTargetPath(s *string) *ProjectUpdateOne

SetNillableBinaryTargetPath sets the "binary_target_path" field if the given value is not nil.

func (*ProjectUpdateOne) SetNillableGroup

func (puo *ProjectUpdateOne) SetNillableGroup(s *string) *ProjectUpdateOne

SetNillableGroup sets the "group" field if the given value is not nil.

func (*ProjectUpdateOne) SetNillableMoveToTarget

func (puo *ProjectUpdateOne) SetNillableMoveToTarget(b *bool) *ProjectUpdateOne

SetNillableMoveToTarget sets the "move_to_target" field if the given value is not nil.

func (*ProjectUpdateOne) SetNillableRootPath

func (puo *ProjectUpdateOne) SetNillableRootPath(s *string) *ProjectUpdateOne

SetNillableRootPath sets the "root_path" field if the given value is not nil.

func (*ProjectUpdateOne) SetNillableServiceName

func (puo *ProjectUpdateOne) SetNillableServiceName(s *string) *ProjectUpdateOne

SetNillableServiceName sets the "service_name" field if the given value is not nil.

func (*ProjectUpdateOne) SetNillableUser

func (puo *ProjectUpdateOne) SetNillableUser(s *string) *ProjectUpdateOne

SetNillableUser sets the "user" field if the given value is not nil.

func (*ProjectUpdateOne) SetRootPath

func (puo *ProjectUpdateOne) SetRootPath(s string) *ProjectUpdateOne

SetRootPath sets the "root_path" field.

func (*ProjectUpdateOne) SetServiceName

func (puo *ProjectUpdateOne) SetServiceName(s string) *ProjectUpdateOne

SetServiceName sets the "service_name" field.

func (*ProjectUpdateOne) SetUser

func (puo *ProjectUpdateOne) SetUser(s string) *ProjectUpdateOne

SetUser sets the "user" field.

func (*ProjectUpdateOne) Where

Where appends a list predicates to the ProjectUpdate builder.

type Projects

type Projects []*Project

Projects is a parsable slice of Project.

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 {

	// Logentry is the client for interacting with the Logentry builders.
	Logentry *LogentryClient
	// Project is the client for interacting with the Project builders.
	Project *ProjectClient
	// 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