ent

package
v0.0.0-...-e59a564 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: GPL-3.0 Imports: 34 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.
	TypeBlueprint         = "Blueprint"
	TypeDeployment        = "Deployment"
	TypeDeploymentNode    = "DeploymentNode"
	TypeGrantedPermission = "GrantedPermission"
	TypeGroup             = "Group"
	TypeGroupMembership   = "GroupMembership"
	TypeMembership        = "Membership"
	TypeProject           = "Project"
	TypeProvider          = "Provider"
	TypeResource          = "Resource"
	TypeUser              = "User"
)

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 Blueprint

type Blueprint struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// UpdatedAt holds the value of the "updated_at" field.
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// Display name of the blueprint
	Name string `json:"name,omitempty"`
	// Display description of the blueprint (supports markdown)
	Description string `json:"description,omitempty"`
	// The blueprint file contents
	BlueprintTemplate []byte `json:"blueprint_template,omitempty"`
	// Stores the names of variables and their data type
	VariableTypes map[string]models.BlueprintVariableType `json:"variable_types,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the BlueprintQuery when eager-loading is set.
	Edges BlueprintEdges `json:"edges"`
	// contains filtered or unexported fields
}

Blueprint is the model entity for the Blueprint schema.

func (*Blueprint) QueryDeployments

func (b *Blueprint) QueryDeployments() *DeploymentQuery

QueryDeployments queries the "deployments" edge of the Blueprint entity.

func (*Blueprint) QueryProject

func (b *Blueprint) QueryProject() *ProjectQuery

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

func (*Blueprint) QueryProvider

func (b *Blueprint) QueryProvider() *ProviderQuery

QueryProvider queries the "provider" edge of the Blueprint entity.

func (*Blueprint) QueryResources

func (b *Blueprint) QueryResources() *ResourceQuery

QueryResources queries the "resources" edge of the Blueprint entity.

func (*Blueprint) String

func (b *Blueprint) String() string

String implements the fmt.Stringer.

func (*Blueprint) Unwrap

func (b *Blueprint) Unwrap() *Blueprint

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

func (b *Blueprint) Update() *BlueprintUpdateOne

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

func (*Blueprint) Value

func (b *Blueprint) Value(name string) (ent.Value, error)

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

type BlueprintClient

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

BlueprintClient is a client for the Blueprint schema.

func NewBlueprintClient

func NewBlueprintClient(c config) *BlueprintClient

NewBlueprintClient returns a client for the Blueprint from the given config.

func (*BlueprintClient) Create

func (c *BlueprintClient) Create() *BlueprintCreate

Create returns a builder for creating a Blueprint entity.

func (*BlueprintClient) CreateBulk

func (c *BlueprintClient) CreateBulk(builders ...*BlueprintCreate) *BlueprintCreateBulk

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

func (*BlueprintClient) Delete

func (c *BlueprintClient) Delete() *BlueprintDelete

Delete returns a delete builder for Blueprint.

func (*BlueprintClient) DeleteOne

func (c *BlueprintClient) DeleteOne(b *Blueprint) *BlueprintDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*BlueprintClient) DeleteOneID

func (c *BlueprintClient) DeleteOneID(id uuid.UUID) *BlueprintDeleteOne

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

func (*BlueprintClient) Get

func (c *BlueprintClient) Get(ctx context.Context, id uuid.UUID) (*Blueprint, error)

Get returns a Blueprint entity by its id.

func (*BlueprintClient) GetX

func (c *BlueprintClient) GetX(ctx context.Context, id uuid.UUID) *Blueprint

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

func (*BlueprintClient) Hooks

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

Hooks returns the client hooks.

func (*BlueprintClient) Intercept

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

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

func (*BlueprintClient) Interceptors

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

Interceptors returns the client interceptors.

func (*BlueprintClient) MapCreateBulk

func (c *BlueprintClient) MapCreateBulk(slice any, setFunc func(*BlueprintCreate, int)) *BlueprintCreateBulk

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

func (c *BlueprintClient) Query() *BlueprintQuery

Query returns a query builder for Blueprint.

func (*BlueprintClient) QueryDeployments

func (c *BlueprintClient) QueryDeployments(b *Blueprint) *DeploymentQuery

QueryDeployments queries the deployments edge of a Blueprint.

func (*BlueprintClient) QueryProject

func (c *BlueprintClient) QueryProject(b *Blueprint) *ProjectQuery

QueryProject queries the project edge of a Blueprint.

func (*BlueprintClient) QueryProvider

func (c *BlueprintClient) QueryProvider(b *Blueprint) *ProviderQuery

QueryProvider queries the provider edge of a Blueprint.

func (*BlueprintClient) QueryResources

func (c *BlueprintClient) QueryResources(b *Blueprint) *ResourceQuery

QueryResources queries the resources edge of a Blueprint.

func (*BlueprintClient) Update

func (c *BlueprintClient) Update() *BlueprintUpdate

Update returns an update builder for Blueprint.

func (*BlueprintClient) UpdateOne

func (c *BlueprintClient) UpdateOne(b *Blueprint) *BlueprintUpdateOne

UpdateOne returns an update builder for the given entity.

func (*BlueprintClient) UpdateOneID

func (c *BlueprintClient) UpdateOneID(id uuid.UUID) *BlueprintUpdateOne

UpdateOneID returns an update builder for the given id.

func (*BlueprintClient) Use

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

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

type BlueprintCreate

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

BlueprintCreate is the builder for creating a Blueprint entity.

func (*BlueprintCreate) AddDeploymentIDs

func (bc *BlueprintCreate) AddDeploymentIDs(ids ...uuid.UUID) *BlueprintCreate

AddDeploymentIDs adds the "deployments" edge to the Deployment entity by IDs.

func (*BlueprintCreate) AddDeployments

func (bc *BlueprintCreate) AddDeployments(d ...*Deployment) *BlueprintCreate

AddDeployments adds the "deployments" edges to the Deployment entity.

func (*BlueprintCreate) AddResourceIDs

func (bc *BlueprintCreate) AddResourceIDs(ids ...uuid.UUID) *BlueprintCreate

AddResourceIDs adds the "resources" edge to the Resource entity by IDs.

func (*BlueprintCreate) AddResources

func (bc *BlueprintCreate) AddResources(r ...*Resource) *BlueprintCreate

AddResources adds the "resources" edges to the Resource entity.

func (*BlueprintCreate) Exec

func (bc *BlueprintCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*BlueprintCreate) ExecX

func (bc *BlueprintCreate) ExecX(ctx context.Context)

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

func (*BlueprintCreate) Mutation

func (bc *BlueprintCreate) Mutation() *BlueprintMutation

Mutation returns the BlueprintMutation object of the builder.

func (*BlueprintCreate) Save

func (bc *BlueprintCreate) Save(ctx context.Context) (*Blueprint, error)

Save creates the Blueprint in the database.

func (*BlueprintCreate) SaveX

func (bc *BlueprintCreate) SaveX(ctx context.Context) *Blueprint

SaveX calls Save and panics if Save returns an error.

func (*BlueprintCreate) SetBlueprintTemplate

func (bc *BlueprintCreate) SetBlueprintTemplate(b []byte) *BlueprintCreate

SetBlueprintTemplate sets the "blueprint_template" field.

func (*BlueprintCreate) SetCreatedAt

func (bc *BlueprintCreate) SetCreatedAt(t time.Time) *BlueprintCreate

SetCreatedAt sets the "created_at" field.

func (*BlueprintCreate) SetDescription

func (bc *BlueprintCreate) SetDescription(s string) *BlueprintCreate

SetDescription sets the "description" field.

func (*BlueprintCreate) SetID

func (bc *BlueprintCreate) SetID(u uuid.UUID) *BlueprintCreate

SetID sets the "id" field.

func (*BlueprintCreate) SetName

func (bc *BlueprintCreate) SetName(s string) *BlueprintCreate

SetName sets the "name" field.

func (*BlueprintCreate) SetNillableCreatedAt

func (bc *BlueprintCreate) SetNillableCreatedAt(t *time.Time) *BlueprintCreate

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

func (*BlueprintCreate) SetNillableID

func (bc *BlueprintCreate) SetNillableID(u *uuid.UUID) *BlueprintCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*BlueprintCreate) SetNillableUpdatedAt

func (bc *BlueprintCreate) SetNillableUpdatedAt(t *time.Time) *BlueprintCreate

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

func (*BlueprintCreate) SetProject

func (bc *BlueprintCreate) SetProject(p *Project) *BlueprintCreate

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

func (*BlueprintCreate) SetProjectID

func (bc *BlueprintCreate) SetProjectID(id uuid.UUID) *BlueprintCreate

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

func (*BlueprintCreate) SetProvider

func (bc *BlueprintCreate) SetProvider(p *Provider) *BlueprintCreate

SetProvider sets the "provider" edge to the Provider entity.

func (*BlueprintCreate) SetProviderID

func (bc *BlueprintCreate) SetProviderID(id uuid.UUID) *BlueprintCreate

SetProviderID sets the "provider" edge to the Provider entity by ID.

func (*BlueprintCreate) SetUpdatedAt

func (bc *BlueprintCreate) SetUpdatedAt(t time.Time) *BlueprintCreate

SetUpdatedAt sets the "updated_at" field.

func (*BlueprintCreate) SetVariableTypes

func (bc *BlueprintCreate) SetVariableTypes(mvt map[string]models.BlueprintVariableType) *BlueprintCreate

SetVariableTypes sets the "variable_types" field.

type BlueprintCreateBulk

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

BlueprintCreateBulk is the builder for creating many Blueprint entities in bulk.

func (*BlueprintCreateBulk) Exec

func (bcb *BlueprintCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*BlueprintCreateBulk) ExecX

func (bcb *BlueprintCreateBulk) ExecX(ctx context.Context)

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

func (*BlueprintCreateBulk) Save

func (bcb *BlueprintCreateBulk) Save(ctx context.Context) ([]*Blueprint, error)

Save creates the Blueprint entities in the database.

func (*BlueprintCreateBulk) SaveX

func (bcb *BlueprintCreateBulk) SaveX(ctx context.Context) []*Blueprint

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

type BlueprintDelete

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

BlueprintDelete is the builder for deleting a Blueprint entity.

func (*BlueprintDelete) Exec

func (bd *BlueprintDelete) Exec(ctx context.Context) (int, error)

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

func (*BlueprintDelete) ExecX

func (bd *BlueprintDelete) ExecX(ctx context.Context) int

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

func (*BlueprintDelete) Where

Where appends a list predicates to the BlueprintDelete builder.

type BlueprintDeleteOne

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

BlueprintDeleteOne is the builder for deleting a single Blueprint entity.

func (*BlueprintDeleteOne) Exec

func (bdo *BlueprintDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*BlueprintDeleteOne) ExecX

func (bdo *BlueprintDeleteOne) ExecX(ctx context.Context)

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

func (*BlueprintDeleteOne) Where

Where appends a list predicates to the BlueprintDelete builder.

type BlueprintEdges

type BlueprintEdges struct {
	// The provider to use for this blueprint
	Provider *Provider `json:"provider,omitempty"`
	// The project this blueprint is associated with (nil indicates a public blueprint)
	Project *Project `json:"project,omitempty"`
	// The resources which are part of this blueprint
	Resources []*Resource `json:"resources,omitempty"`
	// All deployments of this blueprints
	Deployments []*Deployment `json:"deployments,omitempty"`
	// contains filtered or unexported fields
}

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

func (BlueprintEdges) DeploymentsOrErr

func (e BlueprintEdges) DeploymentsOrErr() ([]*Deployment, error)

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

func (BlueprintEdges) ProjectOrErr

func (e BlueprintEdges) 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.

func (BlueprintEdges) ProviderOrErr

func (e BlueprintEdges) ProviderOrErr() (*Provider, error)

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

func (BlueprintEdges) ResourcesOrErr

func (e BlueprintEdges) ResourcesOrErr() ([]*Resource, error)

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

type BlueprintGroupBy

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

BlueprintGroupBy is the group-by builder for Blueprint entities.

func (*BlueprintGroupBy) Aggregate

func (bgb *BlueprintGroupBy) Aggregate(fns ...AggregateFunc) *BlueprintGroupBy

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

func (*BlueprintGroupBy) Bool

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

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

func (*BlueprintGroupBy) BoolX

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

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

func (*BlueprintGroupBy) Bools

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

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

func (*BlueprintGroupBy) BoolsX

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

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

func (*BlueprintGroupBy) Float64

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

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

func (*BlueprintGroupBy) Float64X

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

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

func (*BlueprintGroupBy) Float64s

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

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

func (*BlueprintGroupBy) Float64sX

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

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

func (*BlueprintGroupBy) Int

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

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

func (*BlueprintGroupBy) IntX

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

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

func (*BlueprintGroupBy) Ints

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

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

func (*BlueprintGroupBy) IntsX

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

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

func (*BlueprintGroupBy) Scan

func (bgb *BlueprintGroupBy) Scan(ctx context.Context, v any) error

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

func (*BlueprintGroupBy) ScanX

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

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

func (*BlueprintGroupBy) String

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

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

func (*BlueprintGroupBy) StringX

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

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

func (*BlueprintGroupBy) Strings

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

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

func (*BlueprintGroupBy) StringsX

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

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

type BlueprintMutation

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

BlueprintMutation represents an operation that mutates the Blueprint nodes in the graph.

func (*BlueprintMutation) AddDeploymentIDs

func (m *BlueprintMutation) AddDeploymentIDs(ids ...uuid.UUID)

AddDeploymentIDs adds the "deployments" edge to the Deployment entity by ids.

func (*BlueprintMutation) AddField

func (m *BlueprintMutation) 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 (*BlueprintMutation) AddResourceIDs

func (m *BlueprintMutation) AddResourceIDs(ids ...uuid.UUID)

AddResourceIDs adds the "resources" edge to the Resource entity by ids.

func (*BlueprintMutation) AddedEdges

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

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

func (*BlueprintMutation) AddedField

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

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

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

func (*BlueprintMutation) AddedIDs

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

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

func (*BlueprintMutation) BlueprintTemplate

func (m *BlueprintMutation) BlueprintTemplate() (r []byte, exists bool)

BlueprintTemplate returns the value of the "blueprint_template" field in the mutation.

func (*BlueprintMutation) ClearDeployments

func (m *BlueprintMutation) ClearDeployments()

ClearDeployments clears the "deployments" edge to the Deployment entity.

func (*BlueprintMutation) ClearEdge

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

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

func (m *BlueprintMutation) ClearProject()

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

func (*BlueprintMutation) ClearProvider

func (m *BlueprintMutation) ClearProvider()

ClearProvider clears the "provider" edge to the Provider entity.

func (*BlueprintMutation) ClearResources

func (m *BlueprintMutation) ClearResources()

ClearResources clears the "resources" edge to the Resource entity.

func (*BlueprintMutation) ClearedEdges

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

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

func (*BlueprintMutation) ClearedFields

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

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

func (BlueprintMutation) Client

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

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

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

func (*BlueprintMutation) DeploymentsCleared

func (m *BlueprintMutation) DeploymentsCleared() bool

DeploymentsCleared reports if the "deployments" edge to the Deployment entity was cleared.

func (*BlueprintMutation) DeploymentsIDs

func (m *BlueprintMutation) DeploymentsIDs() (ids []uuid.UUID)

DeploymentsIDs returns the "deployments" edge IDs in the mutation.

func (*BlueprintMutation) Description

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

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

func (*BlueprintMutation) EdgeCleared

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

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

func (*BlueprintMutation) Field

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

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

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

func (*BlueprintMutation) Fields

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

func (m *BlueprintMutation) ID() (id uuid.UUID, 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 (*BlueprintMutation) IDs

func (m *BlueprintMutation) IDs(ctx context.Context) ([]uuid.UUID, 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 (*BlueprintMutation) Name

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

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

func (*BlueprintMutation) OldBlueprintTemplate

func (m *BlueprintMutation) OldBlueprintTemplate(ctx context.Context) (v []byte, err error)

OldBlueprintTemplate returns the old "blueprint_template" field's value of the Blueprint entity. If the Blueprint 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 (*BlueprintMutation) OldCreatedAt

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

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

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

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

func (m *BlueprintMutation) 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 (*BlueprintMutation) OldName

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

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

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

OldUpdatedAt returns the old "updated_at" field's value of the Blueprint entity. If the Blueprint 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 (*BlueprintMutation) OldVariableTypes

func (m *BlueprintMutation) OldVariableTypes(ctx context.Context) (v map[string]models.BlueprintVariableType, err error)

OldVariableTypes returns the old "variable_types" field's value of the Blueprint entity. If the Blueprint 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 (*BlueprintMutation) Op

func (m *BlueprintMutation) Op() Op

Op returns the operation name.

func (*BlueprintMutation) ProjectCleared

func (m *BlueprintMutation) ProjectCleared() bool

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

func (*BlueprintMutation) ProjectID

func (m *BlueprintMutation) ProjectID() (id uuid.UUID, exists bool)

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

func (*BlueprintMutation) ProjectIDs

func (m *BlueprintMutation) ProjectIDs() (ids []uuid.UUID)

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 (*BlueprintMutation) ProviderCleared

func (m *BlueprintMutation) ProviderCleared() bool

ProviderCleared reports if the "provider" edge to the Provider entity was cleared.

func (*BlueprintMutation) ProviderID

func (m *BlueprintMutation) ProviderID() (id uuid.UUID, exists bool)

ProviderID returns the "provider" edge ID in the mutation.

func (*BlueprintMutation) ProviderIDs

func (m *BlueprintMutation) ProviderIDs() (ids []uuid.UUID)

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

func (*BlueprintMutation) RemoveDeploymentIDs

func (m *BlueprintMutation) RemoveDeploymentIDs(ids ...uuid.UUID)

RemoveDeploymentIDs removes the "deployments" edge to the Deployment entity by IDs.

func (*BlueprintMutation) RemoveResourceIDs

func (m *BlueprintMutation) RemoveResourceIDs(ids ...uuid.UUID)

RemoveResourceIDs removes the "resources" edge to the Resource entity by IDs.

func (*BlueprintMutation) RemovedDeploymentsIDs

func (m *BlueprintMutation) RemovedDeploymentsIDs() (ids []uuid.UUID)

RemovedDeployments returns the removed IDs of the "deployments" edge to the Deployment entity.

func (*BlueprintMutation) RemovedEdges

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

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

func (*BlueprintMutation) RemovedIDs

func (m *BlueprintMutation) 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 (*BlueprintMutation) RemovedResourcesIDs

func (m *BlueprintMutation) RemovedResourcesIDs() (ids []uuid.UUID)

RemovedResources returns the removed IDs of the "resources" edge to the Resource entity.

func (*BlueprintMutation) ResetBlueprintTemplate

func (m *BlueprintMutation) ResetBlueprintTemplate()

ResetBlueprintTemplate resets all changes to the "blueprint_template" field.

func (*BlueprintMutation) ResetCreatedAt

func (m *BlueprintMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*BlueprintMutation) ResetDeployments

func (m *BlueprintMutation) ResetDeployments()

ResetDeployments resets all changes to the "deployments" edge.

func (*BlueprintMutation) ResetDescription

func (m *BlueprintMutation) ResetDescription()

ResetDescription resets all changes to the "description" field.

func (*BlueprintMutation) ResetEdge

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

func (m *BlueprintMutation) 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 (*BlueprintMutation) ResetName

func (m *BlueprintMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*BlueprintMutation) ResetProject

func (m *BlueprintMutation) ResetProject()

ResetProject resets all changes to the "project" edge.

func (*BlueprintMutation) ResetProvider

func (m *BlueprintMutation) ResetProvider()

ResetProvider resets all changes to the "provider" edge.

func (*BlueprintMutation) ResetResources

func (m *BlueprintMutation) ResetResources()

ResetResources resets all changes to the "resources" edge.

func (*BlueprintMutation) ResetUpdatedAt

func (m *BlueprintMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*BlueprintMutation) ResetVariableTypes

func (m *BlueprintMutation) ResetVariableTypes()

ResetVariableTypes resets all changes to the "variable_types" field.

func (*BlueprintMutation) ResourcesCleared

func (m *BlueprintMutation) ResourcesCleared() bool

ResourcesCleared reports if the "resources" edge to the Resource entity was cleared.

func (*BlueprintMutation) ResourcesIDs

func (m *BlueprintMutation) ResourcesIDs() (ids []uuid.UUID)

ResourcesIDs returns the "resources" edge IDs in the mutation.

func (*BlueprintMutation) SetBlueprintTemplate

func (m *BlueprintMutation) SetBlueprintTemplate(b []byte)

SetBlueprintTemplate sets the "blueprint_template" field.

func (*BlueprintMutation) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*BlueprintMutation) SetDescription

func (m *BlueprintMutation) SetDescription(s string)

SetDescription sets the "description" field.

func (*BlueprintMutation) SetField

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

func (m *BlueprintMutation) SetID(id uuid.UUID)

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

func (*BlueprintMutation) SetName

func (m *BlueprintMutation) SetName(s string)

SetName sets the "name" field.

func (*BlueprintMutation) SetOp

func (m *BlueprintMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*BlueprintMutation) SetProjectID

func (m *BlueprintMutation) SetProjectID(id uuid.UUID)

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

func (*BlueprintMutation) SetProviderID

func (m *BlueprintMutation) SetProviderID(id uuid.UUID)

SetProviderID sets the "provider" edge to the Provider entity by id.

func (*BlueprintMutation) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" field.

func (*BlueprintMutation) SetVariableTypes

func (m *BlueprintMutation) SetVariableTypes(mvt map[string]models.BlueprintVariableType)

SetVariableTypes sets the "variable_types" field.

func (BlueprintMutation) Tx

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

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

func (*BlueprintMutation) Type

func (m *BlueprintMutation) Type() string

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

func (*BlueprintMutation) UpdatedAt

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

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

func (*BlueprintMutation) VariableTypes

func (m *BlueprintMutation) VariableTypes() (r map[string]models.BlueprintVariableType, exists bool)

VariableTypes returns the value of the "variable_types" field in the mutation.

func (*BlueprintMutation) Where

func (m *BlueprintMutation) Where(ps ...predicate.Blueprint)

Where appends a list predicates to the BlueprintMutation builder.

func (*BlueprintMutation) WhereP

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

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

type BlueprintQuery

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

BlueprintQuery is the builder for querying Blueprint entities.

func (*BlueprintQuery) Aggregate

func (bq *BlueprintQuery) Aggregate(fns ...AggregateFunc) *BlueprintSelect

Aggregate returns a BlueprintSelect configured with the given aggregations.

func (*BlueprintQuery) All

func (bq *BlueprintQuery) All(ctx context.Context) ([]*Blueprint, error)

All executes the query and returns a list of Blueprints.

func (*BlueprintQuery) AllX

func (bq *BlueprintQuery) AllX(ctx context.Context) []*Blueprint

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

func (*BlueprintQuery) Clone

func (bq *BlueprintQuery) Clone() *BlueprintQuery

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

func (*BlueprintQuery) Count

func (bq *BlueprintQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*BlueprintQuery) CountX

func (bq *BlueprintQuery) CountX(ctx context.Context) int

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

func (*BlueprintQuery) Exist

func (bq *BlueprintQuery) Exist(ctx context.Context) (bool, error)

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

func (*BlueprintQuery) ExistX

func (bq *BlueprintQuery) ExistX(ctx context.Context) bool

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

func (*BlueprintQuery) First

func (bq *BlueprintQuery) First(ctx context.Context) (*Blueprint, error)

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

func (*BlueprintQuery) FirstID

func (bq *BlueprintQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

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

func (*BlueprintQuery) FirstIDX

func (bq *BlueprintQuery) FirstIDX(ctx context.Context) uuid.UUID

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

func (*BlueprintQuery) FirstX

func (bq *BlueprintQuery) FirstX(ctx context.Context) *Blueprint

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

func (*BlueprintQuery) GroupBy

func (bq *BlueprintQuery) GroupBy(field string, fields ...string) *BlueprintGroupBy

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

Example:

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

client.Blueprint.Query().
	GroupBy(blueprint.FieldCreatedAt).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*BlueprintQuery) IDs

func (bq *BlueprintQuery) IDs(ctx context.Context) (ids []uuid.UUID, err error)

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

func (*BlueprintQuery) IDsX

func (bq *BlueprintQuery) IDsX(ctx context.Context) []uuid.UUID

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

func (*BlueprintQuery) Limit

func (bq *BlueprintQuery) Limit(limit int) *BlueprintQuery

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

func (*BlueprintQuery) Offset

func (bq *BlueprintQuery) Offset(offset int) *BlueprintQuery

Offset to start from.

func (*BlueprintQuery) Only

func (bq *BlueprintQuery) Only(ctx context.Context) (*Blueprint, error)

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

func (*BlueprintQuery) OnlyID

func (bq *BlueprintQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

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

func (*BlueprintQuery) OnlyIDX

func (bq *BlueprintQuery) OnlyIDX(ctx context.Context) uuid.UUID

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

func (*BlueprintQuery) OnlyX

func (bq *BlueprintQuery) OnlyX(ctx context.Context) *Blueprint

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

func (*BlueprintQuery) Order

Order specifies how the records should be ordered.

func (*BlueprintQuery) QueryDeployments

func (bq *BlueprintQuery) QueryDeployments() *DeploymentQuery

QueryDeployments chains the current query on the "deployments" edge.

func (*BlueprintQuery) QueryProject

func (bq *BlueprintQuery) QueryProject() *ProjectQuery

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

func (*BlueprintQuery) QueryProvider

func (bq *BlueprintQuery) QueryProvider() *ProviderQuery

QueryProvider chains the current query on the "provider" edge.

func (*BlueprintQuery) QueryResources

func (bq *BlueprintQuery) QueryResources() *ResourceQuery

QueryResources chains the current query on the "resources" edge.

func (*BlueprintQuery) Select

func (bq *BlueprintQuery) Select(fields ...string) *BlueprintSelect

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

Example:

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

client.Blueprint.Query().
	Select(blueprint.FieldCreatedAt).
	Scan(ctx, &v)

func (*BlueprintQuery) Unique

func (bq *BlueprintQuery) Unique(unique bool) *BlueprintQuery

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

Where adds a new predicate for the BlueprintQuery builder.

func (*BlueprintQuery) WithDeployments

func (bq *BlueprintQuery) WithDeployments(opts ...func(*DeploymentQuery)) *BlueprintQuery

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

func (*BlueprintQuery) WithProject

func (bq *BlueprintQuery) WithProject(opts ...func(*ProjectQuery)) *BlueprintQuery

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.

func (*BlueprintQuery) WithProvider

func (bq *BlueprintQuery) WithProvider(opts ...func(*ProviderQuery)) *BlueprintQuery

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

func (*BlueprintQuery) WithResources

func (bq *BlueprintQuery) WithResources(opts ...func(*ResourceQuery)) *BlueprintQuery

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

type BlueprintSelect

type BlueprintSelect struct {
	*BlueprintQuery
	// contains filtered or unexported fields
}

BlueprintSelect is the builder for selecting fields of Blueprint entities.

func (*BlueprintSelect) Aggregate

func (bs *BlueprintSelect) Aggregate(fns ...AggregateFunc) *BlueprintSelect

Aggregate adds the given aggregation functions to the selector query.

func (*BlueprintSelect) Bool

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

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

func (*BlueprintSelect) BoolX

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

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

func (*BlueprintSelect) Bools

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

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

func (*BlueprintSelect) BoolsX

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

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

func (*BlueprintSelect) Float64

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

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

func (*BlueprintSelect) Float64X

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

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

func (*BlueprintSelect) Float64s

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

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

func (*BlueprintSelect) Float64sX

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

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

func (*BlueprintSelect) Int

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

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

func (*BlueprintSelect) IntX

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

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

func (*BlueprintSelect) Ints

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

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

func (*BlueprintSelect) IntsX

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

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

func (*BlueprintSelect) Scan

func (bs *BlueprintSelect) Scan(ctx context.Context, v any) error

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

func (*BlueprintSelect) ScanX

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

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

func (*BlueprintSelect) String

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

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

func (*BlueprintSelect) StringX

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

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

func (*BlueprintSelect) Strings

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

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

func (*BlueprintSelect) StringsX

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

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

type BlueprintUpdate

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

BlueprintUpdate is the builder for updating Blueprint entities.

func (*BlueprintUpdate) AddDeploymentIDs

func (bu *BlueprintUpdate) AddDeploymentIDs(ids ...uuid.UUID) *BlueprintUpdate

AddDeploymentIDs adds the "deployments" edge to the Deployment entity by IDs.

func (*BlueprintUpdate) AddDeployments

func (bu *BlueprintUpdate) AddDeployments(d ...*Deployment) *BlueprintUpdate

AddDeployments adds the "deployments" edges to the Deployment entity.

func (*BlueprintUpdate) AddResourceIDs

func (bu *BlueprintUpdate) AddResourceIDs(ids ...uuid.UUID) *BlueprintUpdate

AddResourceIDs adds the "resources" edge to the Resource entity by IDs.

func (*BlueprintUpdate) AddResources

func (bu *BlueprintUpdate) AddResources(r ...*Resource) *BlueprintUpdate

AddResources adds the "resources" edges to the Resource entity.

func (*BlueprintUpdate) ClearDeployments

func (bu *BlueprintUpdate) ClearDeployments() *BlueprintUpdate

ClearDeployments clears all "deployments" edges to the Deployment entity.

func (*BlueprintUpdate) ClearProject

func (bu *BlueprintUpdate) ClearProject() *BlueprintUpdate

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

func (*BlueprintUpdate) ClearProvider

func (bu *BlueprintUpdate) ClearProvider() *BlueprintUpdate

ClearProvider clears the "provider" edge to the Provider entity.

func (*BlueprintUpdate) ClearResources

func (bu *BlueprintUpdate) ClearResources() *BlueprintUpdate

ClearResources clears all "resources" edges to the Resource entity.

func (*BlueprintUpdate) Exec

func (bu *BlueprintUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*BlueprintUpdate) ExecX

func (bu *BlueprintUpdate) ExecX(ctx context.Context)

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

func (*BlueprintUpdate) Mutation

func (bu *BlueprintUpdate) Mutation() *BlueprintMutation

Mutation returns the BlueprintMutation object of the builder.

func (*BlueprintUpdate) RemoveDeploymentIDs

func (bu *BlueprintUpdate) RemoveDeploymentIDs(ids ...uuid.UUID) *BlueprintUpdate

RemoveDeploymentIDs removes the "deployments" edge to Deployment entities by IDs.

func (*BlueprintUpdate) RemoveDeployments

func (bu *BlueprintUpdate) RemoveDeployments(d ...*Deployment) *BlueprintUpdate

RemoveDeployments removes "deployments" edges to Deployment entities.

func (*BlueprintUpdate) RemoveResourceIDs

func (bu *BlueprintUpdate) RemoveResourceIDs(ids ...uuid.UUID) *BlueprintUpdate

RemoveResourceIDs removes the "resources" edge to Resource entities by IDs.

func (*BlueprintUpdate) RemoveResources

func (bu *BlueprintUpdate) RemoveResources(r ...*Resource) *BlueprintUpdate

RemoveResources removes "resources" edges to Resource entities.

func (*BlueprintUpdate) Save

func (bu *BlueprintUpdate) Save(ctx context.Context) (int, error)

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

func (*BlueprintUpdate) SaveX

func (bu *BlueprintUpdate) SaveX(ctx context.Context) int

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

func (*BlueprintUpdate) SetBlueprintTemplate

func (bu *BlueprintUpdate) SetBlueprintTemplate(b []byte) *BlueprintUpdate

SetBlueprintTemplate sets the "blueprint_template" field.

func (*BlueprintUpdate) SetDescription

func (bu *BlueprintUpdate) SetDescription(s string) *BlueprintUpdate

SetDescription sets the "description" field.

func (*BlueprintUpdate) SetName

func (bu *BlueprintUpdate) SetName(s string) *BlueprintUpdate

SetName sets the "name" field.

func (*BlueprintUpdate) SetNillableDescription

func (bu *BlueprintUpdate) SetNillableDescription(s *string) *BlueprintUpdate

SetNillableDescription sets the "description" field if the given value is not nil.

func (*BlueprintUpdate) SetNillableName

func (bu *BlueprintUpdate) SetNillableName(s *string) *BlueprintUpdate

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

func (*BlueprintUpdate) SetProject

func (bu *BlueprintUpdate) SetProject(p *Project) *BlueprintUpdate

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

func (*BlueprintUpdate) SetProjectID

func (bu *BlueprintUpdate) SetProjectID(id uuid.UUID) *BlueprintUpdate

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

func (*BlueprintUpdate) SetProvider

func (bu *BlueprintUpdate) SetProvider(p *Provider) *BlueprintUpdate

SetProvider sets the "provider" edge to the Provider entity.

func (*BlueprintUpdate) SetProviderID

func (bu *BlueprintUpdate) SetProviderID(id uuid.UUID) *BlueprintUpdate

SetProviderID sets the "provider" edge to the Provider entity by ID.

func (*BlueprintUpdate) SetUpdatedAt

func (bu *BlueprintUpdate) SetUpdatedAt(t time.Time) *BlueprintUpdate

SetUpdatedAt sets the "updated_at" field.

func (*BlueprintUpdate) SetVariableTypes

func (bu *BlueprintUpdate) SetVariableTypes(mvt map[string]models.BlueprintVariableType) *BlueprintUpdate

SetVariableTypes sets the "variable_types" field.

func (*BlueprintUpdate) Where

Where appends a list predicates to the BlueprintUpdate builder.

type BlueprintUpdateOne

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

BlueprintUpdateOne is the builder for updating a single Blueprint entity.

func (*BlueprintUpdateOne) AddDeploymentIDs

func (buo *BlueprintUpdateOne) AddDeploymentIDs(ids ...uuid.UUID) *BlueprintUpdateOne

AddDeploymentIDs adds the "deployments" edge to the Deployment entity by IDs.

func (*BlueprintUpdateOne) AddDeployments

func (buo *BlueprintUpdateOne) AddDeployments(d ...*Deployment) *BlueprintUpdateOne

AddDeployments adds the "deployments" edges to the Deployment entity.

func (*BlueprintUpdateOne) AddResourceIDs

func (buo *BlueprintUpdateOne) AddResourceIDs(ids ...uuid.UUID) *BlueprintUpdateOne

AddResourceIDs adds the "resources" edge to the Resource entity by IDs.

func (*BlueprintUpdateOne) AddResources

func (buo *BlueprintUpdateOne) AddResources(r ...*Resource) *BlueprintUpdateOne

AddResources adds the "resources" edges to the Resource entity.

func (*BlueprintUpdateOne) ClearDeployments

func (buo *BlueprintUpdateOne) ClearDeployments() *BlueprintUpdateOne

ClearDeployments clears all "deployments" edges to the Deployment entity.

func (*BlueprintUpdateOne) ClearProject

func (buo *BlueprintUpdateOne) ClearProject() *BlueprintUpdateOne

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

func (*BlueprintUpdateOne) ClearProvider

func (buo *BlueprintUpdateOne) ClearProvider() *BlueprintUpdateOne

ClearProvider clears the "provider" edge to the Provider entity.

func (*BlueprintUpdateOne) ClearResources

func (buo *BlueprintUpdateOne) ClearResources() *BlueprintUpdateOne

ClearResources clears all "resources" edges to the Resource entity.

func (*BlueprintUpdateOne) Exec

func (buo *BlueprintUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*BlueprintUpdateOne) ExecX

func (buo *BlueprintUpdateOne) ExecX(ctx context.Context)

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

func (*BlueprintUpdateOne) Mutation

func (buo *BlueprintUpdateOne) Mutation() *BlueprintMutation

Mutation returns the BlueprintMutation object of the builder.

func (*BlueprintUpdateOne) RemoveDeploymentIDs

func (buo *BlueprintUpdateOne) RemoveDeploymentIDs(ids ...uuid.UUID) *BlueprintUpdateOne

RemoveDeploymentIDs removes the "deployments" edge to Deployment entities by IDs.

func (*BlueprintUpdateOne) RemoveDeployments

func (buo *BlueprintUpdateOne) RemoveDeployments(d ...*Deployment) *BlueprintUpdateOne

RemoveDeployments removes "deployments" edges to Deployment entities.

func (*BlueprintUpdateOne) RemoveResourceIDs

func (buo *BlueprintUpdateOne) RemoveResourceIDs(ids ...uuid.UUID) *BlueprintUpdateOne

RemoveResourceIDs removes the "resources" edge to Resource entities by IDs.

func (*BlueprintUpdateOne) RemoveResources

func (buo *BlueprintUpdateOne) RemoveResources(r ...*Resource) *BlueprintUpdateOne

RemoveResources removes "resources" edges to Resource entities.

func (*BlueprintUpdateOne) Save

func (buo *BlueprintUpdateOne) Save(ctx context.Context) (*Blueprint, error)

Save executes the query and returns the updated Blueprint entity.

func (*BlueprintUpdateOne) SaveX

func (buo *BlueprintUpdateOne) SaveX(ctx context.Context) *Blueprint

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

func (*BlueprintUpdateOne) Select

func (buo *BlueprintUpdateOne) Select(field string, fields ...string) *BlueprintUpdateOne

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

func (*BlueprintUpdateOne) SetBlueprintTemplate

func (buo *BlueprintUpdateOne) SetBlueprintTemplate(b []byte) *BlueprintUpdateOne

SetBlueprintTemplate sets the "blueprint_template" field.

func (*BlueprintUpdateOne) SetDescription

func (buo *BlueprintUpdateOne) SetDescription(s string) *BlueprintUpdateOne

SetDescription sets the "description" field.

func (*BlueprintUpdateOne) SetName

func (buo *BlueprintUpdateOne) SetName(s string) *BlueprintUpdateOne

SetName sets the "name" field.

func (*BlueprintUpdateOne) SetNillableDescription

func (buo *BlueprintUpdateOne) SetNillableDescription(s *string) *BlueprintUpdateOne

SetNillableDescription sets the "description" field if the given value is not nil.

func (*BlueprintUpdateOne) SetNillableName

func (buo *BlueprintUpdateOne) SetNillableName(s *string) *BlueprintUpdateOne

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

func (*BlueprintUpdateOne) SetProject

func (buo *BlueprintUpdateOne) SetProject(p *Project) *BlueprintUpdateOne

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

func (*BlueprintUpdateOne) SetProjectID

func (buo *BlueprintUpdateOne) SetProjectID(id uuid.UUID) *BlueprintUpdateOne

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

func (*BlueprintUpdateOne) SetProvider

func (buo *BlueprintUpdateOne) SetProvider(p *Provider) *BlueprintUpdateOne

SetProvider sets the "provider" edge to the Provider entity.

func (*BlueprintUpdateOne) SetProviderID

func (buo *BlueprintUpdateOne) SetProviderID(id uuid.UUID) *BlueprintUpdateOne

SetProviderID sets the "provider" edge to the Provider entity by ID.

func (*BlueprintUpdateOne) SetUpdatedAt

func (buo *BlueprintUpdateOne) SetUpdatedAt(t time.Time) *BlueprintUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*BlueprintUpdateOne) SetVariableTypes

SetVariableTypes sets the "variable_types" field.

func (*BlueprintUpdateOne) Where

Where appends a list predicates to the BlueprintUpdate builder.

type Blueprints

type Blueprints []*Blueprint

Blueprints is a parsable slice of Blueprint.

type Client

type Client struct {

	// Schema is the client for creating, migrating and dropping schema.
	Schema *migrate.Schema
	// Blueprint is the client for interacting with the Blueprint builders.
	Blueprint *BlueprintClient
	// Deployment is the client for interacting with the Deployment builders.
	Deployment *DeploymentClient
	// DeploymentNode is the client for interacting with the DeploymentNode builders.
	DeploymentNode *DeploymentNodeClient
	// GrantedPermission is the client for interacting with the GrantedPermission builders.
	GrantedPermission *GrantedPermissionClient
	// Group is the client for interacting with the Group builders.
	Group *GroupClient
	// GroupMembership is the client for interacting with the GroupMembership builders.
	GroupMembership *GroupMembershipClient
	// Membership is the client for interacting with the Membership builders.
	Membership *MembershipClient
	// Project is the client for interacting with the Project builders.
	Project *ProjectClient
	// Provider is the client for interacting with the Provider builders.
	Provider *ProviderClient
	// Resource is the client for interacting with the Resource builders.
	Resource *ResourceClient
	// User is the client for interacting with the User builders.
	User *UserClient
	// contains filtered or unexported fields
}

Client is the client that holds all ent builders.

func FromContext

func FromContext(ctx context.Context) *Client

FromContext returns a Client stored inside a context, or nil if there isn't one.

func NewClient

func NewClient(opts ...Option) *Client

NewClient creates a new client configured with the given options.

func Open

func Open(driverName, dataSourceName string, options ...Option) (*Client, error)

Open opens a database/sql.DB specified by the driver name and the data source name, and returns a new client attached to it. Optional parameters can be added for configuring the client.

func (*Client) BeginTx

func (c *Client) BeginTx(ctx context.Context, opts *sql.TxOptions) (*Tx, error)

BeginTx returns a transactional client with specified options.

func (*Client) Close

func (c *Client) Close() error

Close closes the database connection and prevents new queries from starting.

func (*Client) Debug

func (c *Client) Debug() *Client

Debug returns a new debug-client. It's used to get verbose logging on specific operations.

client.Debug().
	Blueprint.
	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 Deployment

type Deployment struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// UpdatedAt holds the value of the "updated_at" field.
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// The last time this deployment was accessed (used for auto-suspending deployments)
	LastAccessed time.Time `json:"last_accessed,omitempty"`
	// Display name of the deployment (defaults to blueprint name)
	Name string `json:"name,omitempty"`
	// Display description of the deployment (supports markdown; defaults to blueprint description)
	Description string `json:"description,omitempty"`
	// The overall state of the deployment (should only by updated by the deploy engine)
	State deployment.State `json:"state,omitempty"`
	// Stores the variable values to be injected into the blueprint template
	TemplateVars map[string]string `json:"template_vars,omitempty"`
	// The time this deployment expires
	ExpiresAt time.Time `json:"expires_at,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the DeploymentQuery when eager-loading is set.
	Edges DeploymentEdges `json:"edges"`
	// contains filtered or unexported fields
}

Deployment is the model entity for the Deployment schema.

func (*Deployment) QueryBlueprint

func (d *Deployment) QueryBlueprint() *BlueprintQuery

QueryBlueprint queries the "blueprint" edge of the Deployment entity.

func (*Deployment) QueryDeploymentNodes

func (d *Deployment) QueryDeploymentNodes() *DeploymentNodeQuery

QueryDeploymentNodes queries the "deployment_nodes" edge of the Deployment entity.

func (*Deployment) QueryProject

func (d *Deployment) QueryProject() *ProjectQuery

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

func (*Deployment) QueryRequester

func (d *Deployment) QueryRequester() *UserQuery

QueryRequester queries the "requester" edge of the Deployment entity.

func (*Deployment) String

func (d *Deployment) String() string

String implements the fmt.Stringer.

func (*Deployment) Unwrap

func (d *Deployment) Unwrap() *Deployment

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

func (d *Deployment) Update() *DeploymentUpdateOne

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

func (*Deployment) Value

func (d *Deployment) Value(name string) (ent.Value, error)

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

type DeploymentClient

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

DeploymentClient is a client for the Deployment schema.

func NewDeploymentClient

func NewDeploymentClient(c config) *DeploymentClient

NewDeploymentClient returns a client for the Deployment from the given config.

func (*DeploymentClient) Create

func (c *DeploymentClient) Create() *DeploymentCreate

Create returns a builder for creating a Deployment entity.

func (*DeploymentClient) CreateBulk

func (c *DeploymentClient) CreateBulk(builders ...*DeploymentCreate) *DeploymentCreateBulk

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

func (*DeploymentClient) Delete

func (c *DeploymentClient) Delete() *DeploymentDelete

Delete returns a delete builder for Deployment.

func (*DeploymentClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*DeploymentClient) DeleteOneID

func (c *DeploymentClient) DeleteOneID(id uuid.UUID) *DeploymentDeleteOne

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

func (*DeploymentClient) Get

Get returns a Deployment entity by its id.

func (*DeploymentClient) GetX

func (c *DeploymentClient) GetX(ctx context.Context, id uuid.UUID) *Deployment

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

func (*DeploymentClient) Hooks

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

Hooks returns the client hooks.

func (*DeploymentClient) Intercept

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

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

func (*DeploymentClient) Interceptors

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

Interceptors returns the client interceptors.

func (*DeploymentClient) MapCreateBulk

func (c *DeploymentClient) MapCreateBulk(slice any, setFunc func(*DeploymentCreate, int)) *DeploymentCreateBulk

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

func (c *DeploymentClient) Query() *DeploymentQuery

Query returns a query builder for Deployment.

func (*DeploymentClient) QueryBlueprint

func (c *DeploymentClient) QueryBlueprint(d *Deployment) *BlueprintQuery

QueryBlueprint queries the blueprint edge of a Deployment.

func (*DeploymentClient) QueryDeploymentNodes

func (c *DeploymentClient) QueryDeploymentNodes(d *Deployment) *DeploymentNodeQuery

QueryDeploymentNodes queries the deployment_nodes edge of a Deployment.

func (*DeploymentClient) QueryProject

func (c *DeploymentClient) QueryProject(d *Deployment) *ProjectQuery

QueryProject queries the project edge of a Deployment.

func (*DeploymentClient) QueryRequester

func (c *DeploymentClient) QueryRequester(d *Deployment) *UserQuery

QueryRequester queries the requester edge of a Deployment.

func (*DeploymentClient) Update

func (c *DeploymentClient) Update() *DeploymentUpdate

Update returns an update builder for Deployment.

func (*DeploymentClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*DeploymentClient) UpdateOneID

func (c *DeploymentClient) UpdateOneID(id uuid.UUID) *DeploymentUpdateOne

UpdateOneID returns an update builder for the given id.

func (*DeploymentClient) Use

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

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

type DeploymentCreate

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

DeploymentCreate is the builder for creating a Deployment entity.

func (*DeploymentCreate) AddDeploymentNodeIDs

func (dc *DeploymentCreate) AddDeploymentNodeIDs(ids ...uuid.UUID) *DeploymentCreate

AddDeploymentNodeIDs adds the "deployment_nodes" edge to the DeploymentNode entity by IDs.

func (*DeploymentCreate) AddDeploymentNodes

func (dc *DeploymentCreate) AddDeploymentNodes(d ...*DeploymentNode) *DeploymentCreate

AddDeploymentNodes adds the "deployment_nodes" edges to the DeploymentNode entity.

func (*DeploymentCreate) Exec

func (dc *DeploymentCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*DeploymentCreate) ExecX

func (dc *DeploymentCreate) ExecX(ctx context.Context)

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

func (*DeploymentCreate) Mutation

func (dc *DeploymentCreate) Mutation() *DeploymentMutation

Mutation returns the DeploymentMutation object of the builder.

func (*DeploymentCreate) Save

func (dc *DeploymentCreate) Save(ctx context.Context) (*Deployment, error)

Save creates the Deployment in the database.

func (*DeploymentCreate) SaveX

func (dc *DeploymentCreate) SaveX(ctx context.Context) *Deployment

SaveX calls Save and panics if Save returns an error.

func (*DeploymentCreate) SetBlueprint

func (dc *DeploymentCreate) SetBlueprint(b *Blueprint) *DeploymentCreate

SetBlueprint sets the "blueprint" edge to the Blueprint entity.

func (*DeploymentCreate) SetBlueprintID

func (dc *DeploymentCreate) SetBlueprintID(id uuid.UUID) *DeploymentCreate

SetBlueprintID sets the "blueprint" edge to the Blueprint entity by ID.

func (*DeploymentCreate) SetCreatedAt

func (dc *DeploymentCreate) SetCreatedAt(t time.Time) *DeploymentCreate

SetCreatedAt sets the "created_at" field.

func (*DeploymentCreate) SetDescription

func (dc *DeploymentCreate) SetDescription(s string) *DeploymentCreate

SetDescription sets the "description" field.

func (*DeploymentCreate) SetExpiresAt

func (dc *DeploymentCreate) SetExpiresAt(t time.Time) *DeploymentCreate

SetExpiresAt sets the "expires_at" field.

func (*DeploymentCreate) SetID

SetID sets the "id" field.

func (*DeploymentCreate) SetLastAccessed

func (dc *DeploymentCreate) SetLastAccessed(t time.Time) *DeploymentCreate

SetLastAccessed sets the "last_accessed" field.

func (*DeploymentCreate) SetName

func (dc *DeploymentCreate) SetName(s string) *DeploymentCreate

SetName sets the "name" field.

func (*DeploymentCreate) SetNillableCreatedAt

func (dc *DeploymentCreate) SetNillableCreatedAt(t *time.Time) *DeploymentCreate

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

func (*DeploymentCreate) SetNillableID

func (dc *DeploymentCreate) SetNillableID(u *uuid.UUID) *DeploymentCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*DeploymentCreate) SetNillableLastAccessed

func (dc *DeploymentCreate) SetNillableLastAccessed(t *time.Time) *DeploymentCreate

SetNillableLastAccessed sets the "last_accessed" field if the given value is not nil.

func (*DeploymentCreate) SetNillableUpdatedAt

func (dc *DeploymentCreate) SetNillableUpdatedAt(t *time.Time) *DeploymentCreate

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

func (*DeploymentCreate) SetProject

func (dc *DeploymentCreate) SetProject(p *Project) *DeploymentCreate

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

func (*DeploymentCreate) SetProjectID

func (dc *DeploymentCreate) SetProjectID(id uuid.UUID) *DeploymentCreate

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

func (*DeploymentCreate) SetRequester

func (dc *DeploymentCreate) SetRequester(u *User) *DeploymentCreate

SetRequester sets the "requester" edge to the User entity.

func (*DeploymentCreate) SetRequesterID

func (dc *DeploymentCreate) SetRequesterID(id uuid.UUID) *DeploymentCreate

SetRequesterID sets the "requester" edge to the User entity by ID.

func (*DeploymentCreate) SetState

SetState sets the "state" field.

func (*DeploymentCreate) SetTemplateVars

func (dc *DeploymentCreate) SetTemplateVars(m map[string]string) *DeploymentCreate

SetTemplateVars sets the "template_vars" field.

func (*DeploymentCreate) SetUpdatedAt

func (dc *DeploymentCreate) SetUpdatedAt(t time.Time) *DeploymentCreate

SetUpdatedAt sets the "updated_at" field.

type DeploymentCreateBulk

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

DeploymentCreateBulk is the builder for creating many Deployment entities in bulk.

func (*DeploymentCreateBulk) Exec

func (dcb *DeploymentCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*DeploymentCreateBulk) ExecX

func (dcb *DeploymentCreateBulk) ExecX(ctx context.Context)

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

func (*DeploymentCreateBulk) Save

func (dcb *DeploymentCreateBulk) Save(ctx context.Context) ([]*Deployment, error)

Save creates the Deployment entities in the database.

func (*DeploymentCreateBulk) SaveX

func (dcb *DeploymentCreateBulk) SaveX(ctx context.Context) []*Deployment

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

type DeploymentDelete

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

DeploymentDelete is the builder for deleting a Deployment entity.

func (*DeploymentDelete) Exec

func (dd *DeploymentDelete) Exec(ctx context.Context) (int, error)

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

func (*DeploymentDelete) ExecX

func (dd *DeploymentDelete) ExecX(ctx context.Context) int

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

func (*DeploymentDelete) Where

Where appends a list predicates to the DeploymentDelete builder.

type DeploymentDeleteOne

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

DeploymentDeleteOne is the builder for deleting a single Deployment entity.

func (*DeploymentDeleteOne) Exec

func (ddo *DeploymentDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*DeploymentDeleteOne) ExecX

func (ddo *DeploymentDeleteOne) ExecX(ctx context.Context)

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

func (*DeploymentDeleteOne) Where

Where appends a list predicates to the DeploymentDelete builder.

type DeploymentEdges

type DeploymentEdges struct {
	// The blueprint for this deployment
	Blueprint *Blueprint `json:"blueprint,omitempty"`
	// The deployment nodes belonging to this deployment
	DeploymentNodes []*DeploymentNode `json:"deployment_nodes,omitempty"`
	// The user who requested this deployment
	Requester *User `json:"requester,omitempty"`
	// The project to contain this deployment
	Project *Project `json:"project,omitempty"`
	// contains filtered or unexported fields
}

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

func (DeploymentEdges) BlueprintOrErr

func (e DeploymentEdges) BlueprintOrErr() (*Blueprint, error)

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

func (DeploymentEdges) DeploymentNodesOrErr

func (e DeploymentEdges) DeploymentNodesOrErr() ([]*DeploymentNode, error)

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

func (DeploymentEdges) ProjectOrErr

func (e DeploymentEdges) 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.

func (DeploymentEdges) RequesterOrErr

func (e DeploymentEdges) RequesterOrErr() (*User, error)

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

type DeploymentGroupBy

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

DeploymentGroupBy is the group-by builder for Deployment entities.

func (*DeploymentGroupBy) Aggregate

func (dgb *DeploymentGroupBy) Aggregate(fns ...AggregateFunc) *DeploymentGroupBy

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

func (*DeploymentGroupBy) Bool

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

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

func (*DeploymentGroupBy) BoolX

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

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

func (*DeploymentGroupBy) Bools

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

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

func (*DeploymentGroupBy) BoolsX

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

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

func (*DeploymentGroupBy) Float64

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

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

func (*DeploymentGroupBy) Float64X

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

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

func (*DeploymentGroupBy) Float64s

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

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

func (*DeploymentGroupBy) Float64sX

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

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

func (*DeploymentGroupBy) Int

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

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

func (*DeploymentGroupBy) IntX

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

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

func (*DeploymentGroupBy) Ints

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

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

func (*DeploymentGroupBy) IntsX

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

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

func (*DeploymentGroupBy) Scan

func (dgb *DeploymentGroupBy) Scan(ctx context.Context, v any) error

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

func (*DeploymentGroupBy) ScanX

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

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

func (*DeploymentGroupBy) String

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

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

func (*DeploymentGroupBy) StringX

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

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

func (*DeploymentGroupBy) Strings

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

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

func (*DeploymentGroupBy) StringsX

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

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

type DeploymentMutation

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

DeploymentMutation represents an operation that mutates the Deployment nodes in the graph.

func (*DeploymentMutation) AddDeploymentNodeIDs

func (m *DeploymentMutation) AddDeploymentNodeIDs(ids ...uuid.UUID)

AddDeploymentNodeIDs adds the "deployment_nodes" edge to the DeploymentNode entity by ids.

func (*DeploymentMutation) AddField

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

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

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

func (*DeploymentMutation) AddedField

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

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

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

func (*DeploymentMutation) AddedIDs

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

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

func (*DeploymentMutation) BlueprintCleared

func (m *DeploymentMutation) BlueprintCleared() bool

BlueprintCleared reports if the "blueprint" edge to the Blueprint entity was cleared.

func (*DeploymentMutation) BlueprintID

func (m *DeploymentMutation) BlueprintID() (id uuid.UUID, exists bool)

BlueprintID returns the "blueprint" edge ID in the mutation.

func (*DeploymentMutation) BlueprintIDs

func (m *DeploymentMutation) BlueprintIDs() (ids []uuid.UUID)

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

func (*DeploymentMutation) ClearBlueprint

func (m *DeploymentMutation) ClearBlueprint()

ClearBlueprint clears the "blueprint" edge to the Blueprint entity.

func (*DeploymentMutation) ClearDeploymentNodes

func (m *DeploymentMutation) ClearDeploymentNodes()

ClearDeploymentNodes clears the "deployment_nodes" edge to the DeploymentNode entity.

func (*DeploymentMutation) ClearEdge

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

func (m *DeploymentMutation) 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 (*DeploymentMutation) ClearLastAccessed

func (m *DeploymentMutation) ClearLastAccessed()

ClearLastAccessed clears the value of the "last_accessed" field.

func (*DeploymentMutation) ClearProject

func (m *DeploymentMutation) ClearProject()

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

func (*DeploymentMutation) ClearRequester

func (m *DeploymentMutation) ClearRequester()

ClearRequester clears the "requester" edge to the User entity.

func (*DeploymentMutation) ClearedEdges

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

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

func (*DeploymentMutation) ClearedFields

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

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

func (DeploymentMutation) Client

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

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

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

func (*DeploymentMutation) DeploymentNodesCleared

func (m *DeploymentMutation) DeploymentNodesCleared() bool

DeploymentNodesCleared reports if the "deployment_nodes" edge to the DeploymentNode entity was cleared.

func (*DeploymentMutation) DeploymentNodesIDs

func (m *DeploymentMutation) DeploymentNodesIDs() (ids []uuid.UUID)

DeploymentNodesIDs returns the "deployment_nodes" edge IDs in the mutation.

func (*DeploymentMutation) Description

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

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

func (*DeploymentMutation) EdgeCleared

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

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

func (*DeploymentMutation) ExpiresAt

func (m *DeploymentMutation) ExpiresAt() (r time.Time, exists bool)

ExpiresAt returns the value of the "expires_at" field in the mutation.

func (*DeploymentMutation) Field

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

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

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

func (*DeploymentMutation) Fields

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

func (m *DeploymentMutation) ID() (id uuid.UUID, 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 (*DeploymentMutation) IDs

func (m *DeploymentMutation) IDs(ctx context.Context) ([]uuid.UUID, 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 (*DeploymentMutation) LastAccessed

func (m *DeploymentMutation) LastAccessed() (r time.Time, exists bool)

LastAccessed returns the value of the "last_accessed" field in the mutation.

func (*DeploymentMutation) LastAccessedCleared

func (m *DeploymentMutation) LastAccessedCleared() bool

LastAccessedCleared returns if the "last_accessed" field was cleared in this mutation.

func (*DeploymentMutation) Name

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

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

func (*DeploymentMutation) OldCreatedAt

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

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

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

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

func (m *DeploymentMutation) OldExpiresAt(ctx context.Context) (v time.Time, err error)

OldExpiresAt returns the old "expires_at" field's value of the Deployment entity. If the Deployment 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 (*DeploymentMutation) OldField

func (m *DeploymentMutation) 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 (*DeploymentMutation) OldLastAccessed

func (m *DeploymentMutation) OldLastAccessed(ctx context.Context) (v time.Time, err error)

OldLastAccessed returns the old "last_accessed" field's value of the Deployment entity. If the Deployment 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 (*DeploymentMutation) OldName

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

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

func (m *DeploymentMutation) OldState(ctx context.Context) (v deployment.State, err error)

OldState returns the old "state" field's value of the Deployment entity. If the Deployment 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 (*DeploymentMutation) OldTemplateVars

func (m *DeploymentMutation) OldTemplateVars(ctx context.Context) (v map[string]string, err error)

OldTemplateVars returns the old "template_vars" field's value of the Deployment entity. If the Deployment 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 (*DeploymentMutation) OldUpdatedAt

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

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

func (m *DeploymentMutation) Op() Op

Op returns the operation name.

func (*DeploymentMutation) ProjectCleared

func (m *DeploymentMutation) ProjectCleared() bool

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

func (*DeploymentMutation) ProjectID

func (m *DeploymentMutation) ProjectID() (id uuid.UUID, exists bool)

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

func (*DeploymentMutation) ProjectIDs

func (m *DeploymentMutation) ProjectIDs() (ids []uuid.UUID)

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 (*DeploymentMutation) RemoveDeploymentNodeIDs

func (m *DeploymentMutation) RemoveDeploymentNodeIDs(ids ...uuid.UUID)

RemoveDeploymentNodeIDs removes the "deployment_nodes" edge to the DeploymentNode entity by IDs.

func (*DeploymentMutation) RemovedDeploymentNodesIDs

func (m *DeploymentMutation) RemovedDeploymentNodesIDs() (ids []uuid.UUID)

RemovedDeploymentNodes returns the removed IDs of the "deployment_nodes" edge to the DeploymentNode entity.

func (*DeploymentMutation) RemovedEdges

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

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

func (*DeploymentMutation) RemovedIDs

func (m *DeploymentMutation) 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 (*DeploymentMutation) RequesterCleared

func (m *DeploymentMutation) RequesterCleared() bool

RequesterCleared reports if the "requester" edge to the User entity was cleared.

func (*DeploymentMutation) RequesterID

func (m *DeploymentMutation) RequesterID() (id uuid.UUID, exists bool)

RequesterID returns the "requester" edge ID in the mutation.

func (*DeploymentMutation) RequesterIDs

func (m *DeploymentMutation) RequesterIDs() (ids []uuid.UUID)

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

func (*DeploymentMutation) ResetBlueprint

func (m *DeploymentMutation) ResetBlueprint()

ResetBlueprint resets all changes to the "blueprint" edge.

func (*DeploymentMutation) ResetCreatedAt

func (m *DeploymentMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*DeploymentMutation) ResetDeploymentNodes

func (m *DeploymentMutation) ResetDeploymentNodes()

ResetDeploymentNodes resets all changes to the "deployment_nodes" edge.

func (*DeploymentMutation) ResetDescription

func (m *DeploymentMutation) ResetDescription()

ResetDescription resets all changes to the "description" field.

func (*DeploymentMutation) ResetEdge

func (m *DeploymentMutation) 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 (*DeploymentMutation) ResetExpiresAt

func (m *DeploymentMutation) ResetExpiresAt()

ResetExpiresAt resets all changes to the "expires_at" field.

func (*DeploymentMutation) ResetField

func (m *DeploymentMutation) 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 (*DeploymentMutation) ResetLastAccessed

func (m *DeploymentMutation) ResetLastAccessed()

ResetLastAccessed resets all changes to the "last_accessed" field.

func (*DeploymentMutation) ResetName

func (m *DeploymentMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*DeploymentMutation) ResetProject

func (m *DeploymentMutation) ResetProject()

ResetProject resets all changes to the "project" edge.

func (*DeploymentMutation) ResetRequester

func (m *DeploymentMutation) ResetRequester()

ResetRequester resets all changes to the "requester" edge.

func (*DeploymentMutation) ResetState

func (m *DeploymentMutation) ResetState()

ResetState resets all changes to the "state" field.

func (*DeploymentMutation) ResetTemplateVars

func (m *DeploymentMutation) ResetTemplateVars()

ResetTemplateVars resets all changes to the "template_vars" field.

func (*DeploymentMutation) ResetUpdatedAt

func (m *DeploymentMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*DeploymentMutation) SetBlueprintID

func (m *DeploymentMutation) SetBlueprintID(id uuid.UUID)

SetBlueprintID sets the "blueprint" edge to the Blueprint entity by id.

func (*DeploymentMutation) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*DeploymentMutation) SetDescription

func (m *DeploymentMutation) SetDescription(s string)

SetDescription sets the "description" field.

func (*DeploymentMutation) SetExpiresAt

func (m *DeploymentMutation) SetExpiresAt(t time.Time)

SetExpiresAt sets the "expires_at" field.

func (*DeploymentMutation) SetField

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

func (m *DeploymentMutation) SetID(id uuid.UUID)

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

func (*DeploymentMutation) SetLastAccessed

func (m *DeploymentMutation) SetLastAccessed(t time.Time)

SetLastAccessed sets the "last_accessed" field.

func (*DeploymentMutation) SetName

func (m *DeploymentMutation) SetName(s string)

SetName sets the "name" field.

func (*DeploymentMutation) SetOp

func (m *DeploymentMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*DeploymentMutation) SetProjectID

func (m *DeploymentMutation) SetProjectID(id uuid.UUID)

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

func (*DeploymentMutation) SetRequesterID

func (m *DeploymentMutation) SetRequesterID(id uuid.UUID)

SetRequesterID sets the "requester" edge to the User entity by id.

func (*DeploymentMutation) SetState

func (m *DeploymentMutation) SetState(d deployment.State)

SetState sets the "state" field.

func (*DeploymentMutation) SetTemplateVars

func (m *DeploymentMutation) SetTemplateVars(value map[string]string)

SetTemplateVars sets the "template_vars" field.

func (*DeploymentMutation) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" field.

func (*DeploymentMutation) State

func (m *DeploymentMutation) State() (r deployment.State, exists bool)

State returns the value of the "state" field in the mutation.

func (*DeploymentMutation) TemplateVars

func (m *DeploymentMutation) TemplateVars() (r map[string]string, exists bool)

TemplateVars returns the value of the "template_vars" field in the mutation.

func (DeploymentMutation) Tx

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

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

func (*DeploymentMutation) Type

func (m *DeploymentMutation) Type() string

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

func (*DeploymentMutation) UpdatedAt

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

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

func (*DeploymentMutation) Where

func (m *DeploymentMutation) Where(ps ...predicate.Deployment)

Where appends a list predicates to the DeploymentMutation builder.

func (*DeploymentMutation) WhereP

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

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

type DeploymentNode

type DeploymentNode struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// UpdatedAt holds the value of the "updated_at" field.
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// The state of the deployed resource (should only by updated by the deploy engine)
	State deploymentnode.State `json:"state,omitempty"`
	// Stores metadata about the deployed resource for use with the provider
	Vars map[string]string `json:"vars,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the DeploymentNodeQuery when eager-loading is set.
	Edges DeploymentNodeEdges `json:"edges"`
	// contains filtered or unexported fields
}

DeploymentNode is the model entity for the DeploymentNode schema.

func (*DeploymentNode) QueryDeployment

func (dn *DeploymentNode) QueryDeployment() *DeploymentQuery

QueryDeployment queries the "deployment" edge of the DeploymentNode entity.

func (*DeploymentNode) QueryNextNodes

func (dn *DeploymentNode) QueryNextNodes() *DeploymentNodeQuery

QueryNextNodes queries the "next_nodes" edge of the DeploymentNode entity.

func (*DeploymentNode) QueryPrevNodes

func (dn *DeploymentNode) QueryPrevNodes() *DeploymentNodeQuery

QueryPrevNodes queries the "prev_nodes" edge of the DeploymentNode entity.

func (*DeploymentNode) QueryResource

func (dn *DeploymentNode) QueryResource() *ResourceQuery

QueryResource queries the "resource" edge of the DeploymentNode entity.

func (*DeploymentNode) String

func (dn *DeploymentNode) String() string

String implements the fmt.Stringer.

func (*DeploymentNode) Unwrap

func (dn *DeploymentNode) Unwrap() *DeploymentNode

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

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

func (*DeploymentNode) Value

func (dn *DeploymentNode) Value(name string) (ent.Value, error)

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

type DeploymentNodeClient

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

DeploymentNodeClient is a client for the DeploymentNode schema.

func NewDeploymentNodeClient

func NewDeploymentNodeClient(c config) *DeploymentNodeClient

NewDeploymentNodeClient returns a client for the DeploymentNode from the given config.

func (*DeploymentNodeClient) Create

Create returns a builder for creating a DeploymentNode entity.

func (*DeploymentNodeClient) CreateBulk

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

func (*DeploymentNodeClient) Delete

Delete returns a delete builder for DeploymentNode.

func (*DeploymentNodeClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*DeploymentNodeClient) DeleteOneID

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

func (*DeploymentNodeClient) Get

Get returns a DeploymentNode entity by its id.

func (*DeploymentNodeClient) GetX

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

func (*DeploymentNodeClient) Hooks

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

Hooks returns the client hooks.

func (*DeploymentNodeClient) Intercept

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

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

func (*DeploymentNodeClient) Interceptors

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

Interceptors returns the client interceptors.

func (*DeploymentNodeClient) MapCreateBulk

func (c *DeploymentNodeClient) MapCreateBulk(slice any, setFunc func(*DeploymentNodeCreate, int)) *DeploymentNodeCreateBulk

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

Query returns a query builder for DeploymentNode.

func (*DeploymentNodeClient) QueryDeployment

func (c *DeploymentNodeClient) QueryDeployment(dn *DeploymentNode) *DeploymentQuery

QueryDeployment queries the deployment edge of a DeploymentNode.

func (*DeploymentNodeClient) QueryNextNodes

QueryNextNodes queries the next_nodes edge of a DeploymentNode.

func (*DeploymentNodeClient) QueryPrevNodes

QueryPrevNodes queries the prev_nodes edge of a DeploymentNode.

func (*DeploymentNodeClient) QueryResource

func (c *DeploymentNodeClient) QueryResource(dn *DeploymentNode) *ResourceQuery

QueryResource queries the resource edge of a DeploymentNode.

func (*DeploymentNodeClient) Update

Update returns an update builder for DeploymentNode.

func (*DeploymentNodeClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*DeploymentNodeClient) UpdateOneID

UpdateOneID returns an update builder for the given id.

func (*DeploymentNodeClient) Use

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

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

type DeploymentNodeCreate

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

DeploymentNodeCreate is the builder for creating a DeploymentNode entity.

func (*DeploymentNodeCreate) AddNextNodeIDs

func (dnc *DeploymentNodeCreate) AddNextNodeIDs(ids ...uuid.UUID) *DeploymentNodeCreate

AddNextNodeIDs adds the "next_nodes" edge to the DeploymentNode entity by IDs.

func (*DeploymentNodeCreate) AddNextNodes

func (dnc *DeploymentNodeCreate) AddNextNodes(d ...*DeploymentNode) *DeploymentNodeCreate

AddNextNodes adds the "next_nodes" edges to the DeploymentNode entity.

func (*DeploymentNodeCreate) AddPrevNodeIDs

func (dnc *DeploymentNodeCreate) AddPrevNodeIDs(ids ...uuid.UUID) *DeploymentNodeCreate

AddPrevNodeIDs adds the "prev_nodes" edge to the DeploymentNode entity by IDs.

func (*DeploymentNodeCreate) AddPrevNodes

func (dnc *DeploymentNodeCreate) AddPrevNodes(d ...*DeploymentNode) *DeploymentNodeCreate

AddPrevNodes adds the "prev_nodes" edges to the DeploymentNode entity.

func (*DeploymentNodeCreate) Exec

func (dnc *DeploymentNodeCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*DeploymentNodeCreate) ExecX

func (dnc *DeploymentNodeCreate) ExecX(ctx context.Context)

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

func (*DeploymentNodeCreate) Mutation

Mutation returns the DeploymentNodeMutation object of the builder.

func (*DeploymentNodeCreate) Save

Save creates the DeploymentNode in the database.

func (*DeploymentNodeCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*DeploymentNodeCreate) SetCreatedAt

func (dnc *DeploymentNodeCreate) SetCreatedAt(t time.Time) *DeploymentNodeCreate

SetCreatedAt sets the "created_at" field.

func (*DeploymentNodeCreate) SetDeployment

func (dnc *DeploymentNodeCreate) SetDeployment(d *Deployment) *DeploymentNodeCreate

SetDeployment sets the "deployment" edge to the Deployment entity.

func (*DeploymentNodeCreate) SetDeploymentID

func (dnc *DeploymentNodeCreate) SetDeploymentID(id uuid.UUID) *DeploymentNodeCreate

SetDeploymentID sets the "deployment" edge to the Deployment entity by ID.

func (*DeploymentNodeCreate) SetID

SetID sets the "id" field.

func (*DeploymentNodeCreate) SetNillableCreatedAt

func (dnc *DeploymentNodeCreate) SetNillableCreatedAt(t *time.Time) *DeploymentNodeCreate

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

func (*DeploymentNodeCreate) SetNillableID

func (dnc *DeploymentNodeCreate) SetNillableID(u *uuid.UUID) *DeploymentNodeCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*DeploymentNodeCreate) SetNillableUpdatedAt

func (dnc *DeploymentNodeCreate) SetNillableUpdatedAt(t *time.Time) *DeploymentNodeCreate

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

func (*DeploymentNodeCreate) SetResource

func (dnc *DeploymentNodeCreate) SetResource(r *Resource) *DeploymentNodeCreate

SetResource sets the "resource" edge to the Resource entity.

func (*DeploymentNodeCreate) SetResourceID

func (dnc *DeploymentNodeCreate) SetResourceID(id uuid.UUID) *DeploymentNodeCreate

SetResourceID sets the "resource" edge to the Resource entity by ID.

func (*DeploymentNodeCreate) SetState

SetState sets the "state" field.

func (*DeploymentNodeCreate) SetUpdatedAt

func (dnc *DeploymentNodeCreate) SetUpdatedAt(t time.Time) *DeploymentNodeCreate

SetUpdatedAt sets the "updated_at" field.

func (*DeploymentNodeCreate) SetVars

SetVars sets the "vars" field.

type DeploymentNodeCreateBulk

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

DeploymentNodeCreateBulk is the builder for creating many DeploymentNode entities in bulk.

func (*DeploymentNodeCreateBulk) Exec

Exec executes the query.

func (*DeploymentNodeCreateBulk) ExecX

func (dncb *DeploymentNodeCreateBulk) ExecX(ctx context.Context)

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

func (*DeploymentNodeCreateBulk) Save

Save creates the DeploymentNode entities in the database.

func (*DeploymentNodeCreateBulk) SaveX

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

type DeploymentNodeDelete

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

DeploymentNodeDelete is the builder for deleting a DeploymentNode entity.

func (*DeploymentNodeDelete) Exec

func (dnd *DeploymentNodeDelete) Exec(ctx context.Context) (int, error)

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

func (*DeploymentNodeDelete) ExecX

func (dnd *DeploymentNodeDelete) ExecX(ctx context.Context) int

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

func (*DeploymentNodeDelete) Where

Where appends a list predicates to the DeploymentNodeDelete builder.

type DeploymentNodeDeleteOne

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

DeploymentNodeDeleteOne is the builder for deleting a single DeploymentNode entity.

func (*DeploymentNodeDeleteOne) Exec

func (dndo *DeploymentNodeDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*DeploymentNodeDeleteOne) ExecX

func (dndo *DeploymentNodeDeleteOne) ExecX(ctx context.Context)

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

func (*DeploymentNodeDeleteOne) Where

Where appends a list predicates to the DeploymentNodeDelete builder.

type DeploymentNodeEdges

type DeploymentNodeEdges struct {
	// The deployment for this node
	Deployment *Deployment `json:"deployment,omitempty"`
	// The resource this node represents
	Resource *Resource `json:"resource,omitempty"`
	// The previous nodes in the dependency tree
	PrevNodes []*DeploymentNode `json:"prev_nodes,omitempty"`
	// The next nodes in the dependency tree
	NextNodes []*DeploymentNode `json:"next_nodes,omitempty"`
	// contains filtered or unexported fields
}

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

func (DeploymentNodeEdges) DeploymentOrErr

func (e DeploymentNodeEdges) DeploymentOrErr() (*Deployment, error)

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

func (DeploymentNodeEdges) NextNodesOrErr

func (e DeploymentNodeEdges) NextNodesOrErr() ([]*DeploymentNode, error)

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

func (DeploymentNodeEdges) PrevNodesOrErr

func (e DeploymentNodeEdges) PrevNodesOrErr() ([]*DeploymentNode, error)

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

func (DeploymentNodeEdges) ResourceOrErr

func (e DeploymentNodeEdges) ResourceOrErr() (*Resource, error)

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

type DeploymentNodeGroupBy

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

DeploymentNodeGroupBy is the group-by builder for DeploymentNode entities.

func (*DeploymentNodeGroupBy) Aggregate

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

func (*DeploymentNodeGroupBy) Bool

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

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

func (*DeploymentNodeGroupBy) BoolX

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

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

func (*DeploymentNodeGroupBy) Bools

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

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

func (*DeploymentNodeGroupBy) BoolsX

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

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

func (*DeploymentNodeGroupBy) Float64

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

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

func (*DeploymentNodeGroupBy) Float64X

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

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

func (*DeploymentNodeGroupBy) Float64s

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

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

func (*DeploymentNodeGroupBy) Float64sX

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

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

func (*DeploymentNodeGroupBy) Int

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

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

func (*DeploymentNodeGroupBy) IntX

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

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

func (*DeploymentNodeGroupBy) Ints

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

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

func (*DeploymentNodeGroupBy) IntsX

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

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

func (*DeploymentNodeGroupBy) Scan

func (dngb *DeploymentNodeGroupBy) Scan(ctx context.Context, v any) error

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

func (*DeploymentNodeGroupBy) ScanX

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

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

func (*DeploymentNodeGroupBy) String

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

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

func (*DeploymentNodeGroupBy) StringX

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

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

func (*DeploymentNodeGroupBy) Strings

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

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

func (*DeploymentNodeGroupBy) StringsX

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

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

type DeploymentNodeMutation

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

DeploymentNodeMutation represents an operation that mutates the DeploymentNode nodes in the graph.

func (*DeploymentNodeMutation) AddField

func (m *DeploymentNodeMutation) 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 (*DeploymentNodeMutation) AddNextNodeIDs

func (m *DeploymentNodeMutation) AddNextNodeIDs(ids ...uuid.UUID)

AddNextNodeIDs adds the "next_nodes" edge to the DeploymentNode entity by ids.

func (*DeploymentNodeMutation) AddPrevNodeIDs

func (m *DeploymentNodeMutation) AddPrevNodeIDs(ids ...uuid.UUID)

AddPrevNodeIDs adds the "prev_nodes" edge to the DeploymentNode entity by ids.

func (*DeploymentNodeMutation) AddedEdges

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

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

func (*DeploymentNodeMutation) AddedField

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

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

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

func (*DeploymentNodeMutation) AddedIDs

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

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

func (*DeploymentNodeMutation) ClearDeployment

func (m *DeploymentNodeMutation) ClearDeployment()

ClearDeployment clears the "deployment" edge to the Deployment entity.

func (*DeploymentNodeMutation) ClearEdge

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

func (m *DeploymentNodeMutation) 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 (*DeploymentNodeMutation) ClearNextNodes

func (m *DeploymentNodeMutation) ClearNextNodes()

ClearNextNodes clears the "next_nodes" edge to the DeploymentNode entity.

func (*DeploymentNodeMutation) ClearPrevNodes

func (m *DeploymentNodeMutation) ClearPrevNodes()

ClearPrevNodes clears the "prev_nodes" edge to the DeploymentNode entity.

func (*DeploymentNodeMutation) ClearResource

func (m *DeploymentNodeMutation) ClearResource()

ClearResource clears the "resource" edge to the Resource entity.

func (*DeploymentNodeMutation) ClearedEdges

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

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

func (*DeploymentNodeMutation) ClearedFields

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

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

func (DeploymentNodeMutation) Client

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

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

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

func (*DeploymentNodeMutation) DeploymentCleared

func (m *DeploymentNodeMutation) DeploymentCleared() bool

DeploymentCleared reports if the "deployment" edge to the Deployment entity was cleared.

func (*DeploymentNodeMutation) DeploymentID

func (m *DeploymentNodeMutation) DeploymentID() (id uuid.UUID, exists bool)

DeploymentID returns the "deployment" edge ID in the mutation.

func (*DeploymentNodeMutation) DeploymentIDs

func (m *DeploymentNodeMutation) DeploymentIDs() (ids []uuid.UUID)

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

func (*DeploymentNodeMutation) EdgeCleared

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

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

func (*DeploymentNodeMutation) Field

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

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

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

func (*DeploymentNodeMutation) Fields

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

func (m *DeploymentNodeMutation) ID() (id uuid.UUID, 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 (*DeploymentNodeMutation) IDs

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 (*DeploymentNodeMutation) NextNodesCleared

func (m *DeploymentNodeMutation) NextNodesCleared() bool

NextNodesCleared reports if the "next_nodes" edge to the DeploymentNode entity was cleared.

func (*DeploymentNodeMutation) NextNodesIDs

func (m *DeploymentNodeMutation) NextNodesIDs() (ids []uuid.UUID)

NextNodesIDs returns the "next_nodes" edge IDs in the mutation.

func (*DeploymentNodeMutation) OldCreatedAt

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

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

func (m *DeploymentNodeMutation) 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 (*DeploymentNodeMutation) OldState

func (m *DeploymentNodeMutation) OldState(ctx context.Context) (v deploymentnode.State, err error)

OldState returns the old "state" field's value of the DeploymentNode entity. If the DeploymentNode 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 (*DeploymentNodeMutation) OldUpdatedAt

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

OldUpdatedAt returns the old "updated_at" field's value of the DeploymentNode entity. If the DeploymentNode 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 (*DeploymentNodeMutation) OldVars

func (m *DeploymentNodeMutation) OldVars(ctx context.Context) (v map[string]string, err error)

OldVars returns the old "vars" field's value of the DeploymentNode entity. If the DeploymentNode 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 (*DeploymentNodeMutation) Op

func (m *DeploymentNodeMutation) Op() Op

Op returns the operation name.

func (*DeploymentNodeMutation) PrevNodesCleared

func (m *DeploymentNodeMutation) PrevNodesCleared() bool

PrevNodesCleared reports if the "prev_nodes" edge to the DeploymentNode entity was cleared.

func (*DeploymentNodeMutation) PrevNodesIDs

func (m *DeploymentNodeMutation) PrevNodesIDs() (ids []uuid.UUID)

PrevNodesIDs returns the "prev_nodes" edge IDs in the mutation.

func (*DeploymentNodeMutation) RemoveNextNodeIDs

func (m *DeploymentNodeMutation) RemoveNextNodeIDs(ids ...uuid.UUID)

RemoveNextNodeIDs removes the "next_nodes" edge to the DeploymentNode entity by IDs.

func (*DeploymentNodeMutation) RemovePrevNodeIDs

func (m *DeploymentNodeMutation) RemovePrevNodeIDs(ids ...uuid.UUID)

RemovePrevNodeIDs removes the "prev_nodes" edge to the DeploymentNode entity by IDs.

func (*DeploymentNodeMutation) RemovedEdges

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

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

func (*DeploymentNodeMutation) RemovedIDs

func (m *DeploymentNodeMutation) 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 (*DeploymentNodeMutation) RemovedNextNodesIDs

func (m *DeploymentNodeMutation) RemovedNextNodesIDs() (ids []uuid.UUID)

RemovedNextNodes returns the removed IDs of the "next_nodes" edge to the DeploymentNode entity.

func (*DeploymentNodeMutation) RemovedPrevNodesIDs

func (m *DeploymentNodeMutation) RemovedPrevNodesIDs() (ids []uuid.UUID)

RemovedPrevNodes returns the removed IDs of the "prev_nodes" edge to the DeploymentNode entity.

func (*DeploymentNodeMutation) ResetCreatedAt

func (m *DeploymentNodeMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*DeploymentNodeMutation) ResetDeployment

func (m *DeploymentNodeMutation) ResetDeployment()

ResetDeployment resets all changes to the "deployment" edge.

func (*DeploymentNodeMutation) ResetEdge

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

func (m *DeploymentNodeMutation) 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 (*DeploymentNodeMutation) ResetNextNodes

func (m *DeploymentNodeMutation) ResetNextNodes()

ResetNextNodes resets all changes to the "next_nodes" edge.

func (*DeploymentNodeMutation) ResetPrevNodes

func (m *DeploymentNodeMutation) ResetPrevNodes()

ResetPrevNodes resets all changes to the "prev_nodes" edge.

func (*DeploymentNodeMutation) ResetResource

func (m *DeploymentNodeMutation) ResetResource()

ResetResource resets all changes to the "resource" edge.

func (*DeploymentNodeMutation) ResetState

func (m *DeploymentNodeMutation) ResetState()

ResetState resets all changes to the "state" field.

func (*DeploymentNodeMutation) ResetUpdatedAt

func (m *DeploymentNodeMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*DeploymentNodeMutation) ResetVars

func (m *DeploymentNodeMutation) ResetVars()

ResetVars resets all changes to the "vars" field.

func (*DeploymentNodeMutation) ResourceCleared

func (m *DeploymentNodeMutation) ResourceCleared() bool

ResourceCleared reports if the "resource" edge to the Resource entity was cleared.

func (*DeploymentNodeMutation) ResourceID

func (m *DeploymentNodeMutation) ResourceID() (id uuid.UUID, exists bool)

ResourceID returns the "resource" edge ID in the mutation.

func (*DeploymentNodeMutation) ResourceIDs

func (m *DeploymentNodeMutation) ResourceIDs() (ids []uuid.UUID)

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

func (*DeploymentNodeMutation) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*DeploymentNodeMutation) SetDeploymentID

func (m *DeploymentNodeMutation) SetDeploymentID(id uuid.UUID)

SetDeploymentID sets the "deployment" edge to the Deployment entity by id.

func (*DeploymentNodeMutation) SetField

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

func (m *DeploymentNodeMutation) SetID(id uuid.UUID)

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

func (*DeploymentNodeMutation) SetOp

func (m *DeploymentNodeMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*DeploymentNodeMutation) SetResourceID

func (m *DeploymentNodeMutation) SetResourceID(id uuid.UUID)

SetResourceID sets the "resource" edge to the Resource entity by id.

func (*DeploymentNodeMutation) SetState

SetState sets the "state" field.

func (*DeploymentNodeMutation) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" field.

func (*DeploymentNodeMutation) SetVars

func (m *DeploymentNodeMutation) SetVars(value map[string]string)

SetVars sets the "vars" field.

func (*DeploymentNodeMutation) State

func (m *DeploymentNodeMutation) State() (r deploymentnode.State, exists bool)

State returns the value of the "state" field in the mutation.

func (DeploymentNodeMutation) Tx

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

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

func (*DeploymentNodeMutation) Type

func (m *DeploymentNodeMutation) Type() string

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

func (*DeploymentNodeMutation) UpdatedAt

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

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

func (*DeploymentNodeMutation) Vars

func (m *DeploymentNodeMutation) Vars() (r map[string]string, exists bool)

Vars returns the value of the "vars" field in the mutation.

func (*DeploymentNodeMutation) Where

Where appends a list predicates to the DeploymentNodeMutation builder.

func (*DeploymentNodeMutation) WhereP

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

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

type DeploymentNodeQuery

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

DeploymentNodeQuery is the builder for querying DeploymentNode entities.

func (*DeploymentNodeQuery) Aggregate

func (dnq *DeploymentNodeQuery) Aggregate(fns ...AggregateFunc) *DeploymentNodeSelect

Aggregate returns a DeploymentNodeSelect configured with the given aggregations.

func (*DeploymentNodeQuery) All

All executes the query and returns a list of DeploymentNodes.

func (*DeploymentNodeQuery) AllX

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

func (*DeploymentNodeQuery) Clone

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

func (*DeploymentNodeQuery) Count

func (dnq *DeploymentNodeQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*DeploymentNodeQuery) CountX

func (dnq *DeploymentNodeQuery) CountX(ctx context.Context) int

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

func (*DeploymentNodeQuery) Exist

func (dnq *DeploymentNodeQuery) Exist(ctx context.Context) (bool, error)

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

func (*DeploymentNodeQuery) ExistX

func (dnq *DeploymentNodeQuery) ExistX(ctx context.Context) bool

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

func (*DeploymentNodeQuery) First

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

func (*DeploymentNodeQuery) FirstID

func (dnq *DeploymentNodeQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

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

func (*DeploymentNodeQuery) FirstIDX

func (dnq *DeploymentNodeQuery) FirstIDX(ctx context.Context) uuid.UUID

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

func (*DeploymentNodeQuery) FirstX

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

func (*DeploymentNodeQuery) GroupBy

func (dnq *DeploymentNodeQuery) GroupBy(field string, fields ...string) *DeploymentNodeGroupBy

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

Example:

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

client.DeploymentNode.Query().
	GroupBy(deploymentnode.FieldCreatedAt).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*DeploymentNodeQuery) IDs

func (dnq *DeploymentNodeQuery) IDs(ctx context.Context) (ids []uuid.UUID, err error)

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

func (*DeploymentNodeQuery) IDsX

func (dnq *DeploymentNodeQuery) IDsX(ctx context.Context) []uuid.UUID

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

func (*DeploymentNodeQuery) Limit

func (dnq *DeploymentNodeQuery) Limit(limit int) *DeploymentNodeQuery

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

func (*DeploymentNodeQuery) Offset

func (dnq *DeploymentNodeQuery) Offset(offset int) *DeploymentNodeQuery

Offset to start from.

func (*DeploymentNodeQuery) Only

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

func (*DeploymentNodeQuery) OnlyID

func (dnq *DeploymentNodeQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

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

func (*DeploymentNodeQuery) OnlyIDX

func (dnq *DeploymentNodeQuery) OnlyIDX(ctx context.Context) uuid.UUID

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

func (*DeploymentNodeQuery) OnlyX

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

func (*DeploymentNodeQuery) Order

Order specifies how the records should be ordered.

func (*DeploymentNodeQuery) QueryDeployment

func (dnq *DeploymentNodeQuery) QueryDeployment() *DeploymentQuery

QueryDeployment chains the current query on the "deployment" edge.

func (*DeploymentNodeQuery) QueryNextNodes

func (dnq *DeploymentNodeQuery) QueryNextNodes() *DeploymentNodeQuery

QueryNextNodes chains the current query on the "next_nodes" edge.

func (*DeploymentNodeQuery) QueryPrevNodes

func (dnq *DeploymentNodeQuery) QueryPrevNodes() *DeploymentNodeQuery

QueryPrevNodes chains the current query on the "prev_nodes" edge.

func (*DeploymentNodeQuery) QueryResource

func (dnq *DeploymentNodeQuery) QueryResource() *ResourceQuery

QueryResource chains the current query on the "resource" edge.

func (*DeploymentNodeQuery) Select

func (dnq *DeploymentNodeQuery) Select(fields ...string) *DeploymentNodeSelect

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

Example:

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

client.DeploymentNode.Query().
	Select(deploymentnode.FieldCreatedAt).
	Scan(ctx, &v)

func (*DeploymentNodeQuery) Unique

func (dnq *DeploymentNodeQuery) Unique(unique bool) *DeploymentNodeQuery

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

Where adds a new predicate for the DeploymentNodeQuery builder.

func (*DeploymentNodeQuery) WithDeployment

func (dnq *DeploymentNodeQuery) WithDeployment(opts ...func(*DeploymentQuery)) *DeploymentNodeQuery

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

func (*DeploymentNodeQuery) WithNextNodes

func (dnq *DeploymentNodeQuery) WithNextNodes(opts ...func(*DeploymentNodeQuery)) *DeploymentNodeQuery

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

func (*DeploymentNodeQuery) WithPrevNodes

func (dnq *DeploymentNodeQuery) WithPrevNodes(opts ...func(*DeploymentNodeQuery)) *DeploymentNodeQuery

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

func (*DeploymentNodeQuery) WithResource

func (dnq *DeploymentNodeQuery) WithResource(opts ...func(*ResourceQuery)) *DeploymentNodeQuery

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

type DeploymentNodeSelect

type DeploymentNodeSelect struct {
	*DeploymentNodeQuery
	// contains filtered or unexported fields
}

DeploymentNodeSelect is the builder for selecting fields of DeploymentNode entities.

func (*DeploymentNodeSelect) Aggregate

Aggregate adds the given aggregation functions to the selector query.

func (*DeploymentNodeSelect) Bool

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

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

func (*DeploymentNodeSelect) BoolX

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

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

func (*DeploymentNodeSelect) Bools

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

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

func (*DeploymentNodeSelect) BoolsX

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

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

func (*DeploymentNodeSelect) Float64

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

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

func (*DeploymentNodeSelect) Float64X

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

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

func (*DeploymentNodeSelect) Float64s

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

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

func (*DeploymentNodeSelect) Float64sX

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

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

func (*DeploymentNodeSelect) Int

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

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

func (*DeploymentNodeSelect) IntX

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

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

func (*DeploymentNodeSelect) Ints

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

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

func (*DeploymentNodeSelect) IntsX

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

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

func (*DeploymentNodeSelect) Scan

func (dns *DeploymentNodeSelect) Scan(ctx context.Context, v any) error

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

func (*DeploymentNodeSelect) ScanX

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

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

func (*DeploymentNodeSelect) String

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

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

func (*DeploymentNodeSelect) StringX

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

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

func (*DeploymentNodeSelect) Strings

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

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

func (*DeploymentNodeSelect) StringsX

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

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

type DeploymentNodeUpdate

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

DeploymentNodeUpdate is the builder for updating DeploymentNode entities.

func (*DeploymentNodeUpdate) AddNextNodeIDs

func (dnu *DeploymentNodeUpdate) AddNextNodeIDs(ids ...uuid.UUID) *DeploymentNodeUpdate

AddNextNodeIDs adds the "next_nodes" edge to the DeploymentNode entity by IDs.

func (*DeploymentNodeUpdate) AddNextNodes

func (dnu *DeploymentNodeUpdate) AddNextNodes(d ...*DeploymentNode) *DeploymentNodeUpdate

AddNextNodes adds the "next_nodes" edges to the DeploymentNode entity.

func (*DeploymentNodeUpdate) AddPrevNodeIDs

func (dnu *DeploymentNodeUpdate) AddPrevNodeIDs(ids ...uuid.UUID) *DeploymentNodeUpdate

AddPrevNodeIDs adds the "prev_nodes" edge to the DeploymentNode entity by IDs.

func (*DeploymentNodeUpdate) AddPrevNodes

func (dnu *DeploymentNodeUpdate) AddPrevNodes(d ...*DeploymentNode) *DeploymentNodeUpdate

AddPrevNodes adds the "prev_nodes" edges to the DeploymentNode entity.

func (*DeploymentNodeUpdate) ClearDeployment

func (dnu *DeploymentNodeUpdate) ClearDeployment() *DeploymentNodeUpdate

ClearDeployment clears the "deployment" edge to the Deployment entity.

func (*DeploymentNodeUpdate) ClearNextNodes

func (dnu *DeploymentNodeUpdate) ClearNextNodes() *DeploymentNodeUpdate

ClearNextNodes clears all "next_nodes" edges to the DeploymentNode entity.

func (*DeploymentNodeUpdate) ClearPrevNodes

func (dnu *DeploymentNodeUpdate) ClearPrevNodes() *DeploymentNodeUpdate

ClearPrevNodes clears all "prev_nodes" edges to the DeploymentNode entity.

func (*DeploymentNodeUpdate) ClearResource

func (dnu *DeploymentNodeUpdate) ClearResource() *DeploymentNodeUpdate

ClearResource clears the "resource" edge to the Resource entity.

func (*DeploymentNodeUpdate) Exec

func (dnu *DeploymentNodeUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*DeploymentNodeUpdate) ExecX

func (dnu *DeploymentNodeUpdate) ExecX(ctx context.Context)

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

func (*DeploymentNodeUpdate) Mutation

Mutation returns the DeploymentNodeMutation object of the builder.

func (*DeploymentNodeUpdate) RemoveNextNodeIDs

func (dnu *DeploymentNodeUpdate) RemoveNextNodeIDs(ids ...uuid.UUID) *DeploymentNodeUpdate

RemoveNextNodeIDs removes the "next_nodes" edge to DeploymentNode entities by IDs.

func (*DeploymentNodeUpdate) RemoveNextNodes

func (dnu *DeploymentNodeUpdate) RemoveNextNodes(d ...*DeploymentNode) *DeploymentNodeUpdate

RemoveNextNodes removes "next_nodes" edges to DeploymentNode entities.

func (*DeploymentNodeUpdate) RemovePrevNodeIDs

func (dnu *DeploymentNodeUpdate) RemovePrevNodeIDs(ids ...uuid.UUID) *DeploymentNodeUpdate

RemovePrevNodeIDs removes the "prev_nodes" edge to DeploymentNode entities by IDs.

func (*DeploymentNodeUpdate) RemovePrevNodes

func (dnu *DeploymentNodeUpdate) RemovePrevNodes(d ...*DeploymentNode) *DeploymentNodeUpdate

RemovePrevNodes removes "prev_nodes" edges to DeploymentNode entities.

func (*DeploymentNodeUpdate) Save

func (dnu *DeploymentNodeUpdate) Save(ctx context.Context) (int, error)

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

func (*DeploymentNodeUpdate) SaveX

func (dnu *DeploymentNodeUpdate) SaveX(ctx context.Context) int

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

func (*DeploymentNodeUpdate) SetDeployment

func (dnu *DeploymentNodeUpdate) SetDeployment(d *Deployment) *DeploymentNodeUpdate

SetDeployment sets the "deployment" edge to the Deployment entity.

func (*DeploymentNodeUpdate) SetDeploymentID

func (dnu *DeploymentNodeUpdate) SetDeploymentID(id uuid.UUID) *DeploymentNodeUpdate

SetDeploymentID sets the "deployment" edge to the Deployment entity by ID.

func (*DeploymentNodeUpdate) SetNillableState

SetNillableState sets the "state" field if the given value is not nil.

func (*DeploymentNodeUpdate) SetResource

func (dnu *DeploymentNodeUpdate) SetResource(r *Resource) *DeploymentNodeUpdate

SetResource sets the "resource" edge to the Resource entity.

func (*DeploymentNodeUpdate) SetResourceID

func (dnu *DeploymentNodeUpdate) SetResourceID(id uuid.UUID) *DeploymentNodeUpdate

SetResourceID sets the "resource" edge to the Resource entity by ID.

func (*DeploymentNodeUpdate) SetState

SetState sets the "state" field.

func (*DeploymentNodeUpdate) SetUpdatedAt

func (dnu *DeploymentNodeUpdate) SetUpdatedAt(t time.Time) *DeploymentNodeUpdate

SetUpdatedAt sets the "updated_at" field.

func (*DeploymentNodeUpdate) SetVars

SetVars sets the "vars" field.

func (*DeploymentNodeUpdate) Where

Where appends a list predicates to the DeploymentNodeUpdate builder.

type DeploymentNodeUpdateOne

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

DeploymentNodeUpdateOne is the builder for updating a single DeploymentNode entity.

func (*DeploymentNodeUpdateOne) AddNextNodeIDs

func (dnuo *DeploymentNodeUpdateOne) AddNextNodeIDs(ids ...uuid.UUID) *DeploymentNodeUpdateOne

AddNextNodeIDs adds the "next_nodes" edge to the DeploymentNode entity by IDs.

func (*DeploymentNodeUpdateOne) AddNextNodes

AddNextNodes adds the "next_nodes" edges to the DeploymentNode entity.

func (*DeploymentNodeUpdateOne) AddPrevNodeIDs

func (dnuo *DeploymentNodeUpdateOne) AddPrevNodeIDs(ids ...uuid.UUID) *DeploymentNodeUpdateOne

AddPrevNodeIDs adds the "prev_nodes" edge to the DeploymentNode entity by IDs.

func (*DeploymentNodeUpdateOne) AddPrevNodes

AddPrevNodes adds the "prev_nodes" edges to the DeploymentNode entity.

func (*DeploymentNodeUpdateOne) ClearDeployment

func (dnuo *DeploymentNodeUpdateOne) ClearDeployment() *DeploymentNodeUpdateOne

ClearDeployment clears the "deployment" edge to the Deployment entity.

func (*DeploymentNodeUpdateOne) ClearNextNodes

func (dnuo *DeploymentNodeUpdateOne) ClearNextNodes() *DeploymentNodeUpdateOne

ClearNextNodes clears all "next_nodes" edges to the DeploymentNode entity.

func (*DeploymentNodeUpdateOne) ClearPrevNodes

func (dnuo *DeploymentNodeUpdateOne) ClearPrevNodes() *DeploymentNodeUpdateOne

ClearPrevNodes clears all "prev_nodes" edges to the DeploymentNode entity.

func (*DeploymentNodeUpdateOne) ClearResource

func (dnuo *DeploymentNodeUpdateOne) ClearResource() *DeploymentNodeUpdateOne

ClearResource clears the "resource" edge to the Resource entity.

func (*DeploymentNodeUpdateOne) Exec

func (dnuo *DeploymentNodeUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*DeploymentNodeUpdateOne) ExecX

func (dnuo *DeploymentNodeUpdateOne) ExecX(ctx context.Context)

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

func (*DeploymentNodeUpdateOne) Mutation

Mutation returns the DeploymentNodeMutation object of the builder.

func (*DeploymentNodeUpdateOne) RemoveNextNodeIDs

func (dnuo *DeploymentNodeUpdateOne) RemoveNextNodeIDs(ids ...uuid.UUID) *DeploymentNodeUpdateOne

RemoveNextNodeIDs removes the "next_nodes" edge to DeploymentNode entities by IDs.

func (*DeploymentNodeUpdateOne) RemoveNextNodes

func (dnuo *DeploymentNodeUpdateOne) RemoveNextNodes(d ...*DeploymentNode) *DeploymentNodeUpdateOne

RemoveNextNodes removes "next_nodes" edges to DeploymentNode entities.

func (*DeploymentNodeUpdateOne) RemovePrevNodeIDs

func (dnuo *DeploymentNodeUpdateOne) RemovePrevNodeIDs(ids ...uuid.UUID) *DeploymentNodeUpdateOne

RemovePrevNodeIDs removes the "prev_nodes" edge to DeploymentNode entities by IDs.

func (*DeploymentNodeUpdateOne) RemovePrevNodes

func (dnuo *DeploymentNodeUpdateOne) RemovePrevNodes(d ...*DeploymentNode) *DeploymentNodeUpdateOne

RemovePrevNodes removes "prev_nodes" edges to DeploymentNode entities.

func (*DeploymentNodeUpdateOne) Save

Save executes the query and returns the updated DeploymentNode entity.

func (*DeploymentNodeUpdateOne) SaveX

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

func (*DeploymentNodeUpdateOne) Select

func (dnuo *DeploymentNodeUpdateOne) Select(field string, fields ...string) *DeploymentNodeUpdateOne

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

func (*DeploymentNodeUpdateOne) SetDeployment

SetDeployment sets the "deployment" edge to the Deployment entity.

func (*DeploymentNodeUpdateOne) SetDeploymentID

func (dnuo *DeploymentNodeUpdateOne) SetDeploymentID(id uuid.UUID) *DeploymentNodeUpdateOne

SetDeploymentID sets the "deployment" edge to the Deployment entity by ID.

func (*DeploymentNodeUpdateOne) SetNillableState

SetNillableState sets the "state" field if the given value is not nil.

func (*DeploymentNodeUpdateOne) SetResource

SetResource sets the "resource" edge to the Resource entity.

func (*DeploymentNodeUpdateOne) SetResourceID

func (dnuo *DeploymentNodeUpdateOne) SetResourceID(id uuid.UUID) *DeploymentNodeUpdateOne

SetResourceID sets the "resource" edge to the Resource entity by ID.

func (*DeploymentNodeUpdateOne) SetState

SetState sets the "state" field.

func (*DeploymentNodeUpdateOne) SetUpdatedAt

SetUpdatedAt sets the "updated_at" field.

func (*DeploymentNodeUpdateOne) SetVars

SetVars sets the "vars" field.

func (*DeploymentNodeUpdateOne) Where

Where appends a list predicates to the DeploymentNodeUpdate builder.

type DeploymentNodes

type DeploymentNodes []*DeploymentNode

DeploymentNodes is a parsable slice of DeploymentNode.

type DeploymentQuery

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

DeploymentQuery is the builder for querying Deployment entities.

func (*DeploymentQuery) Aggregate

func (dq *DeploymentQuery) Aggregate(fns ...AggregateFunc) *DeploymentSelect

Aggregate returns a DeploymentSelect configured with the given aggregations.

func (*DeploymentQuery) All

func (dq *DeploymentQuery) All(ctx context.Context) ([]*Deployment, error)

All executes the query and returns a list of Deployments.

func (*DeploymentQuery) AllX

func (dq *DeploymentQuery) AllX(ctx context.Context) []*Deployment

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

func (*DeploymentQuery) Clone

func (dq *DeploymentQuery) Clone() *DeploymentQuery

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

func (*DeploymentQuery) Count

func (dq *DeploymentQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*DeploymentQuery) CountX

func (dq *DeploymentQuery) CountX(ctx context.Context) int

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

func (*DeploymentQuery) Exist

func (dq *DeploymentQuery) Exist(ctx context.Context) (bool, error)

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

func (*DeploymentQuery) ExistX

func (dq *DeploymentQuery) ExistX(ctx context.Context) bool

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

func (*DeploymentQuery) First

func (dq *DeploymentQuery) First(ctx context.Context) (*Deployment, error)

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

func (*DeploymentQuery) FirstID

func (dq *DeploymentQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

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

func (*DeploymentQuery) FirstIDX

func (dq *DeploymentQuery) FirstIDX(ctx context.Context) uuid.UUID

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

func (*DeploymentQuery) FirstX

func (dq *DeploymentQuery) FirstX(ctx context.Context) *Deployment

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

func (*DeploymentQuery) GroupBy

func (dq *DeploymentQuery) GroupBy(field string, fields ...string) *DeploymentGroupBy

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

Example:

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

client.Deployment.Query().
	GroupBy(deployment.FieldCreatedAt).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*DeploymentQuery) IDs

func (dq *DeploymentQuery) IDs(ctx context.Context) (ids []uuid.UUID, err error)

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

func (*DeploymentQuery) IDsX

func (dq *DeploymentQuery) IDsX(ctx context.Context) []uuid.UUID

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

func (*DeploymentQuery) Limit

func (dq *DeploymentQuery) Limit(limit int) *DeploymentQuery

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

func (*DeploymentQuery) Offset

func (dq *DeploymentQuery) Offset(offset int) *DeploymentQuery

Offset to start from.

func (*DeploymentQuery) Only

func (dq *DeploymentQuery) Only(ctx context.Context) (*Deployment, error)

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

func (*DeploymentQuery) OnlyID

func (dq *DeploymentQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

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

func (*DeploymentQuery) OnlyIDX

func (dq *DeploymentQuery) OnlyIDX(ctx context.Context) uuid.UUID

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

func (*DeploymentQuery) OnlyX

func (dq *DeploymentQuery) OnlyX(ctx context.Context) *Deployment

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

func (*DeploymentQuery) Order

Order specifies how the records should be ordered.

func (*DeploymentQuery) QueryBlueprint

func (dq *DeploymentQuery) QueryBlueprint() *BlueprintQuery

QueryBlueprint chains the current query on the "blueprint" edge.

func (*DeploymentQuery) QueryDeploymentNodes

func (dq *DeploymentQuery) QueryDeploymentNodes() *DeploymentNodeQuery

QueryDeploymentNodes chains the current query on the "deployment_nodes" edge.

func (*DeploymentQuery) QueryProject

func (dq *DeploymentQuery) QueryProject() *ProjectQuery

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

func (*DeploymentQuery) QueryRequester

func (dq *DeploymentQuery) QueryRequester() *UserQuery

QueryRequester chains the current query on the "requester" edge.

func (*DeploymentQuery) Select

func (dq *DeploymentQuery) Select(fields ...string) *DeploymentSelect

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

Example:

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

client.Deployment.Query().
	Select(deployment.FieldCreatedAt).
	Scan(ctx, &v)

func (*DeploymentQuery) Unique

func (dq *DeploymentQuery) Unique(unique bool) *DeploymentQuery

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

Where adds a new predicate for the DeploymentQuery builder.

func (*DeploymentQuery) WithBlueprint

func (dq *DeploymentQuery) WithBlueprint(opts ...func(*BlueprintQuery)) *DeploymentQuery

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

func (*DeploymentQuery) WithDeploymentNodes

func (dq *DeploymentQuery) WithDeploymentNodes(opts ...func(*DeploymentNodeQuery)) *DeploymentQuery

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

func (*DeploymentQuery) WithProject

func (dq *DeploymentQuery) WithProject(opts ...func(*ProjectQuery)) *DeploymentQuery

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.

func (*DeploymentQuery) WithRequester

func (dq *DeploymentQuery) WithRequester(opts ...func(*UserQuery)) *DeploymentQuery

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

type DeploymentSelect

type DeploymentSelect struct {
	*DeploymentQuery
	// contains filtered or unexported fields
}

DeploymentSelect is the builder for selecting fields of Deployment entities.

func (*DeploymentSelect) Aggregate

func (ds *DeploymentSelect) Aggregate(fns ...AggregateFunc) *DeploymentSelect

Aggregate adds the given aggregation functions to the selector query.

func (*DeploymentSelect) Bool

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

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

func (*DeploymentSelect) BoolX

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

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

func (*DeploymentSelect) Bools

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

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

func (*DeploymentSelect) BoolsX

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

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

func (*DeploymentSelect) Float64

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

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

func (*DeploymentSelect) Float64X

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

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

func (*DeploymentSelect) Float64s

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

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

func (*DeploymentSelect) Float64sX

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

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

func (*DeploymentSelect) Int

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

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

func (*DeploymentSelect) IntX

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

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

func (*DeploymentSelect) Ints

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

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

func (*DeploymentSelect) IntsX

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

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

func (*DeploymentSelect) Scan

func (ds *DeploymentSelect) Scan(ctx context.Context, v any) error

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

func (*DeploymentSelect) ScanX

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

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

func (*DeploymentSelect) String

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

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

func (*DeploymentSelect) StringX

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

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

func (*DeploymentSelect) Strings

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

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

func (*DeploymentSelect) StringsX

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

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

type DeploymentUpdate

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

DeploymentUpdate is the builder for updating Deployment entities.

func (*DeploymentUpdate) AddDeploymentNodeIDs

func (du *DeploymentUpdate) AddDeploymentNodeIDs(ids ...uuid.UUID) *DeploymentUpdate

AddDeploymentNodeIDs adds the "deployment_nodes" edge to the DeploymentNode entity by IDs.

func (*DeploymentUpdate) AddDeploymentNodes

func (du *DeploymentUpdate) AddDeploymentNodes(d ...*DeploymentNode) *DeploymentUpdate

AddDeploymentNodes adds the "deployment_nodes" edges to the DeploymentNode entity.

func (*DeploymentUpdate) ClearBlueprint

func (du *DeploymentUpdate) ClearBlueprint() *DeploymentUpdate

ClearBlueprint clears the "blueprint" edge to the Blueprint entity.

func (*DeploymentUpdate) ClearDeploymentNodes

func (du *DeploymentUpdate) ClearDeploymentNodes() *DeploymentUpdate

ClearDeploymentNodes clears all "deployment_nodes" edges to the DeploymentNode entity.

func (*DeploymentUpdate) ClearLastAccessed

func (du *DeploymentUpdate) ClearLastAccessed() *DeploymentUpdate

ClearLastAccessed clears the value of the "last_accessed" field.

func (*DeploymentUpdate) ClearProject

func (du *DeploymentUpdate) ClearProject() *DeploymentUpdate

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

func (*DeploymentUpdate) ClearRequester

func (du *DeploymentUpdate) ClearRequester() *DeploymentUpdate

ClearRequester clears the "requester" edge to the User entity.

func (*DeploymentUpdate) Exec

func (du *DeploymentUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*DeploymentUpdate) ExecX

func (du *DeploymentUpdate) ExecX(ctx context.Context)

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

func (*DeploymentUpdate) Mutation

func (du *DeploymentUpdate) Mutation() *DeploymentMutation

Mutation returns the DeploymentMutation object of the builder.

func (*DeploymentUpdate) RemoveDeploymentNodeIDs

func (du *DeploymentUpdate) RemoveDeploymentNodeIDs(ids ...uuid.UUID) *DeploymentUpdate

RemoveDeploymentNodeIDs removes the "deployment_nodes" edge to DeploymentNode entities by IDs.

func (*DeploymentUpdate) RemoveDeploymentNodes

func (du *DeploymentUpdate) RemoveDeploymentNodes(d ...*DeploymentNode) *DeploymentUpdate

RemoveDeploymentNodes removes "deployment_nodes" edges to DeploymentNode entities.

func (*DeploymentUpdate) Save

func (du *DeploymentUpdate) Save(ctx context.Context) (int, error)

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

func (*DeploymentUpdate) SaveX

func (du *DeploymentUpdate) SaveX(ctx context.Context) int

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

func (*DeploymentUpdate) SetBlueprint

func (du *DeploymentUpdate) SetBlueprint(b *Blueprint) *DeploymentUpdate

SetBlueprint sets the "blueprint" edge to the Blueprint entity.

func (*DeploymentUpdate) SetBlueprintID

func (du *DeploymentUpdate) SetBlueprintID(id uuid.UUID) *DeploymentUpdate

SetBlueprintID sets the "blueprint" edge to the Blueprint entity by ID.

func (*DeploymentUpdate) SetDescription

func (du *DeploymentUpdate) SetDescription(s string) *DeploymentUpdate

SetDescription sets the "description" field.

func (*DeploymentUpdate) SetExpiresAt

func (du *DeploymentUpdate) SetExpiresAt(t time.Time) *DeploymentUpdate

SetExpiresAt sets the "expires_at" field.

func (*DeploymentUpdate) SetLastAccessed

func (du *DeploymentUpdate) SetLastAccessed(t time.Time) *DeploymentUpdate

SetLastAccessed sets the "last_accessed" field.

func (*DeploymentUpdate) SetName

func (du *DeploymentUpdate) SetName(s string) *DeploymentUpdate

SetName sets the "name" field.

func (*DeploymentUpdate) SetNillableDescription

func (du *DeploymentUpdate) SetNillableDescription(s *string) *DeploymentUpdate

SetNillableDescription sets the "description" field if the given value is not nil.

func (*DeploymentUpdate) SetNillableExpiresAt

func (du *DeploymentUpdate) SetNillableExpiresAt(t *time.Time) *DeploymentUpdate

SetNillableExpiresAt sets the "expires_at" field if the given value is not nil.

func (*DeploymentUpdate) SetNillableLastAccessed

func (du *DeploymentUpdate) SetNillableLastAccessed(t *time.Time) *DeploymentUpdate

SetNillableLastAccessed sets the "last_accessed" field if the given value is not nil.

func (*DeploymentUpdate) SetNillableName

func (du *DeploymentUpdate) SetNillableName(s *string) *DeploymentUpdate

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

func (*DeploymentUpdate) SetNillableState

func (du *DeploymentUpdate) SetNillableState(d *deployment.State) *DeploymentUpdate

SetNillableState sets the "state" field if the given value is not nil.

func (*DeploymentUpdate) SetProject

func (du *DeploymentUpdate) SetProject(p *Project) *DeploymentUpdate

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

func (*DeploymentUpdate) SetProjectID

func (du *DeploymentUpdate) SetProjectID(id uuid.UUID) *DeploymentUpdate

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

func (*DeploymentUpdate) SetRequester

func (du *DeploymentUpdate) SetRequester(u *User) *DeploymentUpdate

SetRequester sets the "requester" edge to the User entity.

func (*DeploymentUpdate) SetRequesterID

func (du *DeploymentUpdate) SetRequesterID(id uuid.UUID) *DeploymentUpdate

SetRequesterID sets the "requester" edge to the User entity by ID.

func (*DeploymentUpdate) SetState

SetState sets the "state" field.

func (*DeploymentUpdate) SetTemplateVars

func (du *DeploymentUpdate) SetTemplateVars(m map[string]string) *DeploymentUpdate

SetTemplateVars sets the "template_vars" field.

func (*DeploymentUpdate) SetUpdatedAt

func (du *DeploymentUpdate) SetUpdatedAt(t time.Time) *DeploymentUpdate

SetUpdatedAt sets the "updated_at" field.

func (*DeploymentUpdate) Where

Where appends a list predicates to the DeploymentUpdate builder.

type DeploymentUpdateOne

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

DeploymentUpdateOne is the builder for updating a single Deployment entity.

func (*DeploymentUpdateOne) AddDeploymentNodeIDs

func (duo *DeploymentUpdateOne) AddDeploymentNodeIDs(ids ...uuid.UUID) *DeploymentUpdateOne

AddDeploymentNodeIDs adds the "deployment_nodes" edge to the DeploymentNode entity by IDs.

func (*DeploymentUpdateOne) AddDeploymentNodes

func (duo *DeploymentUpdateOne) AddDeploymentNodes(d ...*DeploymentNode) *DeploymentUpdateOne

AddDeploymentNodes adds the "deployment_nodes" edges to the DeploymentNode entity.

func (*DeploymentUpdateOne) ClearBlueprint

func (duo *DeploymentUpdateOne) ClearBlueprint() *DeploymentUpdateOne

ClearBlueprint clears the "blueprint" edge to the Blueprint entity.

func (*DeploymentUpdateOne) ClearDeploymentNodes

func (duo *DeploymentUpdateOne) ClearDeploymentNodes() *DeploymentUpdateOne

ClearDeploymentNodes clears all "deployment_nodes" edges to the DeploymentNode entity.

func (*DeploymentUpdateOne) ClearLastAccessed

func (duo *DeploymentUpdateOne) ClearLastAccessed() *DeploymentUpdateOne

ClearLastAccessed clears the value of the "last_accessed" field.

func (*DeploymentUpdateOne) ClearProject

func (duo *DeploymentUpdateOne) ClearProject() *DeploymentUpdateOne

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

func (*DeploymentUpdateOne) ClearRequester

func (duo *DeploymentUpdateOne) ClearRequester() *DeploymentUpdateOne

ClearRequester clears the "requester" edge to the User entity.

func (*DeploymentUpdateOne) Exec

func (duo *DeploymentUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*DeploymentUpdateOne) ExecX

func (duo *DeploymentUpdateOne) ExecX(ctx context.Context)

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

func (*DeploymentUpdateOne) Mutation

func (duo *DeploymentUpdateOne) Mutation() *DeploymentMutation

Mutation returns the DeploymentMutation object of the builder.

func (*DeploymentUpdateOne) RemoveDeploymentNodeIDs

func (duo *DeploymentUpdateOne) RemoveDeploymentNodeIDs(ids ...uuid.UUID) *DeploymentUpdateOne

RemoveDeploymentNodeIDs removes the "deployment_nodes" edge to DeploymentNode entities by IDs.

func (*DeploymentUpdateOne) RemoveDeploymentNodes

func (duo *DeploymentUpdateOne) RemoveDeploymentNodes(d ...*DeploymentNode) *DeploymentUpdateOne

RemoveDeploymentNodes removes "deployment_nodes" edges to DeploymentNode entities.

func (*DeploymentUpdateOne) Save

func (duo *DeploymentUpdateOne) Save(ctx context.Context) (*Deployment, error)

Save executes the query and returns the updated Deployment entity.

func (*DeploymentUpdateOne) SaveX

func (duo *DeploymentUpdateOne) SaveX(ctx context.Context) *Deployment

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

func (*DeploymentUpdateOne) Select

func (duo *DeploymentUpdateOne) Select(field string, fields ...string) *DeploymentUpdateOne

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

func (*DeploymentUpdateOne) SetBlueprint

func (duo *DeploymentUpdateOne) SetBlueprint(b *Blueprint) *DeploymentUpdateOne

SetBlueprint sets the "blueprint" edge to the Blueprint entity.

func (*DeploymentUpdateOne) SetBlueprintID

func (duo *DeploymentUpdateOne) SetBlueprintID(id uuid.UUID) *DeploymentUpdateOne

SetBlueprintID sets the "blueprint" edge to the Blueprint entity by ID.

func (*DeploymentUpdateOne) SetDescription

func (duo *DeploymentUpdateOne) SetDescription(s string) *DeploymentUpdateOne

SetDescription sets the "description" field.

func (*DeploymentUpdateOne) SetExpiresAt

func (duo *DeploymentUpdateOne) SetExpiresAt(t time.Time) *DeploymentUpdateOne

SetExpiresAt sets the "expires_at" field.

func (*DeploymentUpdateOne) SetLastAccessed

func (duo *DeploymentUpdateOne) SetLastAccessed(t time.Time) *DeploymentUpdateOne

SetLastAccessed sets the "last_accessed" field.

func (*DeploymentUpdateOne) SetName

SetName sets the "name" field.

func (*DeploymentUpdateOne) SetNillableDescription

func (duo *DeploymentUpdateOne) SetNillableDescription(s *string) *DeploymentUpdateOne

SetNillableDescription sets the "description" field if the given value is not nil.

func (*DeploymentUpdateOne) SetNillableExpiresAt

func (duo *DeploymentUpdateOne) SetNillableExpiresAt(t *time.Time) *DeploymentUpdateOne

SetNillableExpiresAt sets the "expires_at" field if the given value is not nil.

func (*DeploymentUpdateOne) SetNillableLastAccessed

func (duo *DeploymentUpdateOne) SetNillableLastAccessed(t *time.Time) *DeploymentUpdateOne

SetNillableLastAccessed sets the "last_accessed" field if the given value is not nil.

func (*DeploymentUpdateOne) SetNillableName

func (duo *DeploymentUpdateOne) SetNillableName(s *string) *DeploymentUpdateOne

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

func (*DeploymentUpdateOne) SetNillableState

func (duo *DeploymentUpdateOne) SetNillableState(d *deployment.State) *DeploymentUpdateOne

SetNillableState sets the "state" field if the given value is not nil.

func (*DeploymentUpdateOne) SetProject

func (duo *DeploymentUpdateOne) SetProject(p *Project) *DeploymentUpdateOne

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

func (*DeploymentUpdateOne) SetProjectID

func (duo *DeploymentUpdateOne) SetProjectID(id uuid.UUID) *DeploymentUpdateOne

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

func (*DeploymentUpdateOne) SetRequester

func (duo *DeploymentUpdateOne) SetRequester(u *User) *DeploymentUpdateOne

SetRequester sets the "requester" edge to the User entity.

func (*DeploymentUpdateOne) SetRequesterID

func (duo *DeploymentUpdateOne) SetRequesterID(id uuid.UUID) *DeploymentUpdateOne

SetRequesterID sets the "requester" edge to the User entity by ID.

func (*DeploymentUpdateOne) SetState

SetState sets the "state" field.

func (*DeploymentUpdateOne) SetTemplateVars

func (duo *DeploymentUpdateOne) SetTemplateVars(m map[string]string) *DeploymentUpdateOne

SetTemplateVars sets the "template_vars" field.

func (*DeploymentUpdateOne) SetUpdatedAt

func (duo *DeploymentUpdateOne) SetUpdatedAt(t time.Time) *DeploymentUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*DeploymentUpdateOne) Where

Where appends a list predicates to the DeploymentUpdate builder.

type Deployments

type Deployments []*Deployment

Deployments is a parsable slice of Deployment.

type GrantedPermission

type GrantedPermission struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// UpdatedAt holds the value of the "updated_at" field.
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// The type of subject this permission applies to
	SubjectType grantedpermission.SubjectType `json:"subject_type,omitempty"`
	// The ID of subject this permission applies to
	SubjectID uuid.UUID `json:"subject_id,omitempty"`
	// The type of object this permission applies to
	ObjectType grantedpermission.ObjectType `json:"object_type,omitempty"`
	// The ID of object this permission applies to (or `uuid.Nil` for wildcard)
	ObjectID uuid.UUID `json:"object_id,omitempty"`
	// The action associated with the object
	Action actions.PermissionAction `json:"action,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the GrantedPermissionQuery when eager-loading is set.
	Edges GrantedPermissionEdges `json:"edges"`
	// contains filtered or unexported fields
}

GrantedPermission is the model entity for the GrantedPermission schema.

func (*GrantedPermission) QueryGroup

func (gp *GrantedPermission) QueryGroup() *GroupQuery

QueryGroup queries the "group" edge of the GrantedPermission entity.

func (*GrantedPermission) QueryUser

func (gp *GrantedPermission) QueryUser() *UserQuery

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

func (*GrantedPermission) String

func (gp *GrantedPermission) String() string

String implements the fmt.Stringer.

func (*GrantedPermission) Unwrap

func (gp *GrantedPermission) Unwrap() *GrantedPermission

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

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

func (*GrantedPermission) Value

func (gp *GrantedPermission) Value(name string) (ent.Value, error)

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

type GrantedPermissionClient

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

GrantedPermissionClient is a client for the GrantedPermission schema.

func NewGrantedPermissionClient

func NewGrantedPermissionClient(c config) *GrantedPermissionClient

NewGrantedPermissionClient returns a client for the GrantedPermission from the given config.

func (*GrantedPermissionClient) Create

Create returns a builder for creating a GrantedPermission entity.

func (*GrantedPermissionClient) CreateBulk

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

func (*GrantedPermissionClient) Delete

Delete returns a delete builder for GrantedPermission.

func (*GrantedPermissionClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*GrantedPermissionClient) DeleteOneID

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

func (*GrantedPermissionClient) Get

Get returns a GrantedPermission entity by its id.

func (*GrantedPermissionClient) GetX

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

func (*GrantedPermissionClient) Hooks

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

Hooks returns the client hooks.

func (*GrantedPermissionClient) Intercept

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

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

func (*GrantedPermissionClient) Interceptors

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

Interceptors returns the client interceptors.

func (*GrantedPermissionClient) MapCreateBulk

func (c *GrantedPermissionClient) MapCreateBulk(slice any, setFunc func(*GrantedPermissionCreate, int)) *GrantedPermissionCreateBulk

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

Query returns a query builder for GrantedPermission.

func (*GrantedPermissionClient) QueryGroup

QueryGroup queries the group edge of a GrantedPermission.

func (*GrantedPermissionClient) QueryUser

QueryUser queries the user edge of a GrantedPermission.

func (*GrantedPermissionClient) Update

Update returns an update builder for GrantedPermission.

func (*GrantedPermissionClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*GrantedPermissionClient) UpdateOneID

UpdateOneID returns an update builder for the given id.

func (*GrantedPermissionClient) Use

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

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

type GrantedPermissionCreate

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

GrantedPermissionCreate is the builder for creating a GrantedPermission entity.

func (*GrantedPermissionCreate) Exec

Exec executes the query.

func (*GrantedPermissionCreate) ExecX

func (gpc *GrantedPermissionCreate) ExecX(ctx context.Context)

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

func (*GrantedPermissionCreate) Mutation

Mutation returns the GrantedPermissionMutation object of the builder.

func (*GrantedPermissionCreate) Save

Save creates the GrantedPermission in the database.

func (*GrantedPermissionCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*GrantedPermissionCreate) SetAction

SetAction sets the "action" field.

func (*GrantedPermissionCreate) SetCreatedAt

SetCreatedAt sets the "created_at" field.

func (*GrantedPermissionCreate) SetGroup

SetGroup sets the "group" edge to the Group entity.

func (*GrantedPermissionCreate) SetGroupID

SetGroupID sets the "group" edge to the Group entity by ID.

func (*GrantedPermissionCreate) SetID

SetID sets the "id" field.

func (*GrantedPermissionCreate) SetNillableCreatedAt

func (gpc *GrantedPermissionCreate) SetNillableCreatedAt(t *time.Time) *GrantedPermissionCreate

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

func (*GrantedPermissionCreate) SetNillableGroupID

func (gpc *GrantedPermissionCreate) SetNillableGroupID(id *uuid.UUID) *GrantedPermissionCreate

SetNillableGroupID sets the "group" edge to the Group entity by ID if the given value is not nil.

func (*GrantedPermissionCreate) SetNillableID

func (gpc *GrantedPermissionCreate) SetNillableID(u *uuid.UUID) *GrantedPermissionCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*GrantedPermissionCreate) SetNillableUpdatedAt

func (gpc *GrantedPermissionCreate) SetNillableUpdatedAt(t *time.Time) *GrantedPermissionCreate

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

func (*GrantedPermissionCreate) SetNillableUserID

func (gpc *GrantedPermissionCreate) SetNillableUserID(id *uuid.UUID) *GrantedPermissionCreate

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

func (*GrantedPermissionCreate) SetObjectID

SetObjectID sets the "object_id" field.

func (*GrantedPermissionCreate) SetObjectType

SetObjectType sets the "object_type" field.

func (*GrantedPermissionCreate) SetSubjectID

SetSubjectID sets the "subject_id" field.

func (*GrantedPermissionCreate) SetSubjectType

SetSubjectType sets the "subject_type" field.

func (*GrantedPermissionCreate) SetUpdatedAt

SetUpdatedAt sets the "updated_at" field.

func (*GrantedPermissionCreate) SetUser

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

func (*GrantedPermissionCreate) SetUserID

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

type GrantedPermissionCreateBulk

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

GrantedPermissionCreateBulk is the builder for creating many GrantedPermission entities in bulk.

func (*GrantedPermissionCreateBulk) Exec

Exec executes the query.

func (*GrantedPermissionCreateBulk) ExecX

func (gpcb *GrantedPermissionCreateBulk) ExecX(ctx context.Context)

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

func (*GrantedPermissionCreateBulk) Save

Save creates the GrantedPermission entities in the database.

func (*GrantedPermissionCreateBulk) SaveX

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

type GrantedPermissionDelete

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

GrantedPermissionDelete is the builder for deleting a GrantedPermission entity.

func (*GrantedPermissionDelete) Exec

func (gpd *GrantedPermissionDelete) Exec(ctx context.Context) (int, error)

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

func (*GrantedPermissionDelete) ExecX

func (gpd *GrantedPermissionDelete) ExecX(ctx context.Context) int

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

func (*GrantedPermissionDelete) Where

Where appends a list predicates to the GrantedPermissionDelete builder.

type GrantedPermissionDeleteOne

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

GrantedPermissionDeleteOne is the builder for deleting a single GrantedPermission entity.

func (*GrantedPermissionDeleteOne) Exec

Exec executes the deletion query.

func (*GrantedPermissionDeleteOne) ExecX

func (gpdo *GrantedPermissionDeleteOne) ExecX(ctx context.Context)

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

func (*GrantedPermissionDeleteOne) Where

Where appends a list predicates to the GrantedPermissionDelete builder.

type GrantedPermissionEdges

type GrantedPermissionEdges struct {
	// The subject user (if of type user)
	User *User `json:"user,omitempty"`
	// The subject group (if of type user)
	Group *Group `json:"group,omitempty"`
	// contains filtered or unexported fields
}

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

func (GrantedPermissionEdges) GroupOrErr

func (e GrantedPermissionEdges) GroupOrErr() (*Group, error)

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

func (GrantedPermissionEdges) UserOrErr

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

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

type GrantedPermissionGroupBy

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

GrantedPermissionGroupBy is the group-by builder for GrantedPermission entities.

func (*GrantedPermissionGroupBy) Aggregate

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

func (*GrantedPermissionGroupBy) Bool

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

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

func (*GrantedPermissionGroupBy) BoolX

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

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

func (*GrantedPermissionGroupBy) Bools

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

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

func (*GrantedPermissionGroupBy) BoolsX

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

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

func (*GrantedPermissionGroupBy) Float64

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

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

func (*GrantedPermissionGroupBy) Float64X

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

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

func (*GrantedPermissionGroupBy) Float64s

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

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

func (*GrantedPermissionGroupBy) Float64sX

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

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

func (*GrantedPermissionGroupBy) Int

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

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

func (*GrantedPermissionGroupBy) IntX

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

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

func (*GrantedPermissionGroupBy) Ints

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

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

func (*GrantedPermissionGroupBy) IntsX

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

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

func (*GrantedPermissionGroupBy) Scan

func (gpgb *GrantedPermissionGroupBy) Scan(ctx context.Context, v any) error

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

func (*GrantedPermissionGroupBy) ScanX

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

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

func (*GrantedPermissionGroupBy) String

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

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

func (*GrantedPermissionGroupBy) StringX

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

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

func (*GrantedPermissionGroupBy) Strings

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

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

func (*GrantedPermissionGroupBy) StringsX

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

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

type GrantedPermissionMutation

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

GrantedPermissionMutation represents an operation that mutates the GrantedPermission nodes in the graph.

func (*GrantedPermissionMutation) Action

func (m *GrantedPermissionMutation) Action() (r actions.PermissionAction, exists bool)

Action returns the value of the "action" field in the mutation.

func (*GrantedPermissionMutation) AddField

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

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

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

func (*GrantedPermissionMutation) AddedField

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

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

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

func (*GrantedPermissionMutation) AddedIDs

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

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

func (*GrantedPermissionMutation) ClearEdge

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

func (m *GrantedPermissionMutation) 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 (*GrantedPermissionMutation) ClearGroup

func (m *GrantedPermissionMutation) ClearGroup()

ClearGroup clears the "group" edge to the Group entity.

func (*GrantedPermissionMutation) ClearUser

func (m *GrantedPermissionMutation) ClearUser()

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

func (*GrantedPermissionMutation) ClearedEdges

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

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

func (*GrantedPermissionMutation) ClearedFields

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

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

func (GrantedPermissionMutation) Client

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

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

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

func (*GrantedPermissionMutation) EdgeCleared

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

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

func (*GrantedPermissionMutation) Field

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

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

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

func (*GrantedPermissionMutation) Fields

func (m *GrantedPermissionMutation) 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 (*GrantedPermissionMutation) GroupCleared

func (m *GrantedPermissionMutation) GroupCleared() bool

GroupCleared reports if the "group" edge to the Group entity was cleared.

func (*GrantedPermissionMutation) GroupID

func (m *GrantedPermissionMutation) GroupID() (id uuid.UUID, exists bool)

GroupID returns the "group" edge ID in the mutation.

func (*GrantedPermissionMutation) GroupIDs

func (m *GrantedPermissionMutation) GroupIDs() (ids []uuid.UUID)

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

func (*GrantedPermissionMutation) ID

func (m *GrantedPermissionMutation) ID() (id uuid.UUID, 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 (*GrantedPermissionMutation) IDs

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 (*GrantedPermissionMutation) ObjectID

func (m *GrantedPermissionMutation) ObjectID() (r uuid.UUID, exists bool)

ObjectID returns the value of the "object_id" field in the mutation.

func (*GrantedPermissionMutation) ObjectType

func (m *GrantedPermissionMutation) ObjectType() (r grantedpermission.ObjectType, exists bool)

ObjectType returns the value of the "object_type" field in the mutation.

func (*GrantedPermissionMutation) OldAction

OldAction returns the old "action" field's value of the GrantedPermission entity. If the GrantedPermission 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 (*GrantedPermissionMutation) OldCreatedAt

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

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

func (m *GrantedPermissionMutation) 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 (*GrantedPermissionMutation) OldObjectID

func (m *GrantedPermissionMutation) OldObjectID(ctx context.Context) (v uuid.UUID, err error)

OldObjectID returns the old "object_id" field's value of the GrantedPermission entity. If the GrantedPermission 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 (*GrantedPermissionMutation) OldObjectType

OldObjectType returns the old "object_type" field's value of the GrantedPermission entity. If the GrantedPermission 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 (*GrantedPermissionMutation) OldSubjectID

func (m *GrantedPermissionMutation) OldSubjectID(ctx context.Context) (v uuid.UUID, err error)

OldSubjectID returns the old "subject_id" field's value of the GrantedPermission entity. If the GrantedPermission 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 (*GrantedPermissionMutation) OldSubjectType

OldSubjectType returns the old "subject_type" field's value of the GrantedPermission entity. If the GrantedPermission 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 (*GrantedPermissionMutation) OldUpdatedAt

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

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

func (m *GrantedPermissionMutation) Op() Op

Op returns the operation name.

func (*GrantedPermissionMutation) RemovedEdges

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

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

func (*GrantedPermissionMutation) RemovedIDs

func (m *GrantedPermissionMutation) 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 (*GrantedPermissionMutation) ResetAction

func (m *GrantedPermissionMutation) ResetAction()

ResetAction resets all changes to the "action" field.

func (*GrantedPermissionMutation) ResetCreatedAt

func (m *GrantedPermissionMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*GrantedPermissionMutation) ResetEdge

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

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

func (m *GrantedPermissionMutation) ResetGroup()

ResetGroup resets all changes to the "group" edge.

func (*GrantedPermissionMutation) ResetObjectID

func (m *GrantedPermissionMutation) ResetObjectID()

ResetObjectID resets all changes to the "object_id" field.

func (*GrantedPermissionMutation) ResetObjectType

func (m *GrantedPermissionMutation) ResetObjectType()

ResetObjectType resets all changes to the "object_type" field.

func (*GrantedPermissionMutation) ResetSubjectID

func (m *GrantedPermissionMutation) ResetSubjectID()

ResetSubjectID resets all changes to the "subject_id" field.

func (*GrantedPermissionMutation) ResetSubjectType

func (m *GrantedPermissionMutation) ResetSubjectType()

ResetSubjectType resets all changes to the "subject_type" field.

func (*GrantedPermissionMutation) ResetUpdatedAt

func (m *GrantedPermissionMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*GrantedPermissionMutation) ResetUser

func (m *GrantedPermissionMutation) ResetUser()

ResetUser resets all changes to the "user" edge.

func (*GrantedPermissionMutation) SetAction

SetAction sets the "action" field.

func (*GrantedPermissionMutation) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*GrantedPermissionMutation) SetField

func (m *GrantedPermissionMutation) 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 (*GrantedPermissionMutation) SetGroupID

func (m *GrantedPermissionMutation) SetGroupID(id uuid.UUID)

SetGroupID sets the "group" edge to the Group entity by id.

func (*GrantedPermissionMutation) SetID

func (m *GrantedPermissionMutation) SetID(id uuid.UUID)

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

func (*GrantedPermissionMutation) SetObjectID

func (m *GrantedPermissionMutation) SetObjectID(u uuid.UUID)

SetObjectID sets the "object_id" field.

func (*GrantedPermissionMutation) SetObjectType

SetObjectType sets the "object_type" field.

func (*GrantedPermissionMutation) SetOp

func (m *GrantedPermissionMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*GrantedPermissionMutation) SetSubjectID

func (m *GrantedPermissionMutation) SetSubjectID(u uuid.UUID)

SetSubjectID sets the "subject_id" field.

func (*GrantedPermissionMutation) SetSubjectType

SetSubjectType sets the "subject_type" field.

func (*GrantedPermissionMutation) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" field.

func (*GrantedPermissionMutation) SetUserID

func (m *GrantedPermissionMutation) SetUserID(id uuid.UUID)

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

func (*GrantedPermissionMutation) SubjectID

func (m *GrantedPermissionMutation) SubjectID() (r uuid.UUID, exists bool)

SubjectID returns the value of the "subject_id" field in the mutation.

func (*GrantedPermissionMutation) SubjectType

func (m *GrantedPermissionMutation) SubjectType() (r grantedpermission.SubjectType, exists bool)

SubjectType returns the value of the "subject_type" field in the mutation.

func (GrantedPermissionMutation) Tx

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

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

func (*GrantedPermissionMutation) Type

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

func (*GrantedPermissionMutation) UpdatedAt

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

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

func (*GrantedPermissionMutation) UserCleared

func (m *GrantedPermissionMutation) UserCleared() bool

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

func (*GrantedPermissionMutation) UserID

func (m *GrantedPermissionMutation) UserID() (id uuid.UUID, exists bool)

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

func (*GrantedPermissionMutation) UserIDs

func (m *GrantedPermissionMutation) UserIDs() (ids []uuid.UUID)

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

func (*GrantedPermissionMutation) Where

Where appends a list predicates to the GrantedPermissionMutation builder.

func (*GrantedPermissionMutation) WhereP

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

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

type GrantedPermissionQuery

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

GrantedPermissionQuery is the builder for querying GrantedPermission entities.

func (*GrantedPermissionQuery) Aggregate

Aggregate returns a GrantedPermissionSelect configured with the given aggregations.

func (*GrantedPermissionQuery) All

All executes the query and returns a list of GrantedPermissions.

func (*GrantedPermissionQuery) AllX

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

func (*GrantedPermissionQuery) Clone

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

func (*GrantedPermissionQuery) Count

func (gpq *GrantedPermissionQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*GrantedPermissionQuery) CountX

func (gpq *GrantedPermissionQuery) CountX(ctx context.Context) int

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

func (*GrantedPermissionQuery) Exist

func (gpq *GrantedPermissionQuery) Exist(ctx context.Context) (bool, error)

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

func (*GrantedPermissionQuery) ExistX

func (gpq *GrantedPermissionQuery) ExistX(ctx context.Context) bool

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

func (*GrantedPermissionQuery) First

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

func (*GrantedPermissionQuery) FirstID

func (gpq *GrantedPermissionQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

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

func (*GrantedPermissionQuery) FirstIDX

func (gpq *GrantedPermissionQuery) FirstIDX(ctx context.Context) uuid.UUID

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

func (*GrantedPermissionQuery) FirstX

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

func (*GrantedPermissionQuery) GroupBy

func (gpq *GrantedPermissionQuery) GroupBy(field string, fields ...string) *GrantedPermissionGroupBy

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

Example:

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

client.GrantedPermission.Query().
	GroupBy(grantedpermission.FieldCreatedAt).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*GrantedPermissionQuery) IDs

func (gpq *GrantedPermissionQuery) IDs(ctx context.Context) (ids []uuid.UUID, err error)

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

func (*GrantedPermissionQuery) IDsX

func (gpq *GrantedPermissionQuery) IDsX(ctx context.Context) []uuid.UUID

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

func (*GrantedPermissionQuery) Limit

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

func (*GrantedPermissionQuery) Offset

func (gpq *GrantedPermissionQuery) Offset(offset int) *GrantedPermissionQuery

Offset to start from.

func (*GrantedPermissionQuery) Only

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

func (*GrantedPermissionQuery) OnlyID

func (gpq *GrantedPermissionQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

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

func (*GrantedPermissionQuery) OnlyIDX

func (gpq *GrantedPermissionQuery) OnlyIDX(ctx context.Context) uuid.UUID

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

func (*GrantedPermissionQuery) OnlyX

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

func (*GrantedPermissionQuery) Order

Order specifies how the records should be ordered.

func (*GrantedPermissionQuery) QueryGroup

func (gpq *GrantedPermissionQuery) QueryGroup() *GroupQuery

QueryGroup chains the current query on the "group" edge.

func (*GrantedPermissionQuery) QueryUser

func (gpq *GrantedPermissionQuery) QueryUser() *UserQuery

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

func (*GrantedPermissionQuery) Select

func (gpq *GrantedPermissionQuery) Select(fields ...string) *GrantedPermissionSelect

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

Example:

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

client.GrantedPermission.Query().
	Select(grantedpermission.FieldCreatedAt).
	Scan(ctx, &v)

func (*GrantedPermissionQuery) Unique

func (gpq *GrantedPermissionQuery) Unique(unique bool) *GrantedPermissionQuery

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

Where adds a new predicate for the GrantedPermissionQuery builder.

func (*GrantedPermissionQuery) WithGroup

func (gpq *GrantedPermissionQuery) WithGroup(opts ...func(*GroupQuery)) *GrantedPermissionQuery

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

func (*GrantedPermissionQuery) WithUser

func (gpq *GrantedPermissionQuery) WithUser(opts ...func(*UserQuery)) *GrantedPermissionQuery

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

type GrantedPermissionSelect

type GrantedPermissionSelect struct {
	*GrantedPermissionQuery
	// contains filtered or unexported fields
}

GrantedPermissionSelect is the builder for selecting fields of GrantedPermission entities.

func (*GrantedPermissionSelect) Aggregate

Aggregate adds the given aggregation functions to the selector query.

func (*GrantedPermissionSelect) Bool

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

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

func (*GrantedPermissionSelect) BoolX

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

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

func (*GrantedPermissionSelect) Bools

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

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

func (*GrantedPermissionSelect) BoolsX

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

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

func (*GrantedPermissionSelect) Float64

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

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

func (*GrantedPermissionSelect) Float64X

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

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

func (*GrantedPermissionSelect) Float64s

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

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

func (*GrantedPermissionSelect) Float64sX

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

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

func (*GrantedPermissionSelect) Int

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

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

func (*GrantedPermissionSelect) IntX

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

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

func (*GrantedPermissionSelect) Ints

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

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

func (*GrantedPermissionSelect) IntsX

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

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

func (*GrantedPermissionSelect) Scan

func (gps *GrantedPermissionSelect) Scan(ctx context.Context, v any) error

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

func (*GrantedPermissionSelect) ScanX

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

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

func (*GrantedPermissionSelect) String

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

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

func (*GrantedPermissionSelect) StringX

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

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

func (*GrantedPermissionSelect) Strings

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

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

func (*GrantedPermissionSelect) StringsX

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

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

type GrantedPermissionUpdate

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

GrantedPermissionUpdate is the builder for updating GrantedPermission entities.

func (*GrantedPermissionUpdate) ClearGroup

ClearGroup clears the "group" edge to the Group entity.

func (*GrantedPermissionUpdate) ClearUser

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

func (*GrantedPermissionUpdate) Exec

Exec executes the query.

func (*GrantedPermissionUpdate) ExecX

func (gpu *GrantedPermissionUpdate) ExecX(ctx context.Context)

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

func (*GrantedPermissionUpdate) Mutation

Mutation returns the GrantedPermissionMutation object of the builder.

func (*GrantedPermissionUpdate) Save

func (gpu *GrantedPermissionUpdate) Save(ctx context.Context) (int, error)

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

func (*GrantedPermissionUpdate) SaveX

func (gpu *GrantedPermissionUpdate) SaveX(ctx context.Context) int

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

func (*GrantedPermissionUpdate) SetAction

SetAction sets the "action" field.

func (*GrantedPermissionUpdate) SetGroup

SetGroup sets the "group" edge to the Group entity.

func (*GrantedPermissionUpdate) SetGroupID

SetGroupID sets the "group" edge to the Group entity by ID.

func (*GrantedPermissionUpdate) SetNillableAction

SetNillableAction sets the "action" field if the given value is not nil.

func (*GrantedPermissionUpdate) SetNillableGroupID

func (gpu *GrantedPermissionUpdate) SetNillableGroupID(id *uuid.UUID) *GrantedPermissionUpdate

SetNillableGroupID sets the "group" edge to the Group entity by ID if the given value is not nil.

func (*GrantedPermissionUpdate) SetNillableObjectID

func (gpu *GrantedPermissionUpdate) SetNillableObjectID(u *uuid.UUID) *GrantedPermissionUpdate

SetNillableObjectID sets the "object_id" field if the given value is not nil.

func (*GrantedPermissionUpdate) SetNillableObjectType

SetNillableObjectType sets the "object_type" field if the given value is not nil.

func (*GrantedPermissionUpdate) SetNillableSubjectID

func (gpu *GrantedPermissionUpdate) SetNillableSubjectID(u *uuid.UUID) *GrantedPermissionUpdate

SetNillableSubjectID sets the "subject_id" field if the given value is not nil.

func (*GrantedPermissionUpdate) SetNillableSubjectType

SetNillableSubjectType sets the "subject_type" field if the given value is not nil.

func (*GrantedPermissionUpdate) SetNillableUserID

func (gpu *GrantedPermissionUpdate) SetNillableUserID(id *uuid.UUID) *GrantedPermissionUpdate

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

func (*GrantedPermissionUpdate) SetObjectID

SetObjectID sets the "object_id" field.

func (*GrantedPermissionUpdate) SetObjectType

SetObjectType sets the "object_type" field.

func (*GrantedPermissionUpdate) SetSubjectID

SetSubjectID sets the "subject_id" field.

func (*GrantedPermissionUpdate) SetSubjectType

SetSubjectType sets the "subject_type" field.

func (*GrantedPermissionUpdate) SetUpdatedAt

SetUpdatedAt sets the "updated_at" field.

func (*GrantedPermissionUpdate) SetUser

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

func (*GrantedPermissionUpdate) SetUserID

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

func (*GrantedPermissionUpdate) Where

Where appends a list predicates to the GrantedPermissionUpdate builder.

type GrantedPermissionUpdateOne

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

GrantedPermissionUpdateOne is the builder for updating a single GrantedPermission entity.

func (*GrantedPermissionUpdateOne) ClearGroup

ClearGroup clears the "group" edge to the Group entity.

func (*GrantedPermissionUpdateOne) ClearUser

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

func (*GrantedPermissionUpdateOne) Exec

Exec executes the query on the entity.

func (*GrantedPermissionUpdateOne) ExecX

func (gpuo *GrantedPermissionUpdateOne) ExecX(ctx context.Context)

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

func (*GrantedPermissionUpdateOne) Mutation

Mutation returns the GrantedPermissionMutation object of the builder.

func (*GrantedPermissionUpdateOne) Save

Save executes the query and returns the updated GrantedPermission entity.

func (*GrantedPermissionUpdateOne) SaveX

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

func (*GrantedPermissionUpdateOne) Select

func (gpuo *GrantedPermissionUpdateOne) Select(field string, fields ...string) *GrantedPermissionUpdateOne

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

func (*GrantedPermissionUpdateOne) SetAction

SetAction sets the "action" field.

func (*GrantedPermissionUpdateOne) SetGroup

SetGroup sets the "group" edge to the Group entity.

func (*GrantedPermissionUpdateOne) SetGroupID

SetGroupID sets the "group" edge to the Group entity by ID.

func (*GrantedPermissionUpdateOne) SetNillableAction

SetNillableAction sets the "action" field if the given value is not nil.

func (*GrantedPermissionUpdateOne) SetNillableGroupID

func (gpuo *GrantedPermissionUpdateOne) SetNillableGroupID(id *uuid.UUID) *GrantedPermissionUpdateOne

SetNillableGroupID sets the "group" edge to the Group entity by ID if the given value is not nil.

func (*GrantedPermissionUpdateOne) SetNillableObjectID

func (gpuo *GrantedPermissionUpdateOne) SetNillableObjectID(u *uuid.UUID) *GrantedPermissionUpdateOne

SetNillableObjectID sets the "object_id" field if the given value is not nil.

func (*GrantedPermissionUpdateOne) SetNillableObjectType

SetNillableObjectType sets the "object_type" field if the given value is not nil.

func (*GrantedPermissionUpdateOne) SetNillableSubjectID

func (gpuo *GrantedPermissionUpdateOne) SetNillableSubjectID(u *uuid.UUID) *GrantedPermissionUpdateOne

SetNillableSubjectID sets the "subject_id" field if the given value is not nil.

func (*GrantedPermissionUpdateOne) SetNillableSubjectType

SetNillableSubjectType sets the "subject_type" field if the given value is not nil.

func (*GrantedPermissionUpdateOne) SetNillableUserID

func (gpuo *GrantedPermissionUpdateOne) SetNillableUserID(id *uuid.UUID) *GrantedPermissionUpdateOne

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

func (*GrantedPermissionUpdateOne) SetObjectID

SetObjectID sets the "object_id" field.

func (*GrantedPermissionUpdateOne) SetObjectType

SetObjectType sets the "object_type" field.

func (*GrantedPermissionUpdateOne) SetSubjectID

SetSubjectID sets the "subject_id" field.

func (*GrantedPermissionUpdateOne) SetSubjectType

SetSubjectType sets the "subject_type" field.

func (*GrantedPermissionUpdateOne) SetUpdatedAt

SetUpdatedAt sets the "updated_at" field.

func (*GrantedPermissionUpdateOne) SetUser

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

func (*GrantedPermissionUpdateOne) SetUserID

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

func (*GrantedPermissionUpdateOne) Where

Where appends a list predicates to the GrantedPermissionUpdate builder.

type GrantedPermissions

type GrantedPermissions []*GrantedPermission

GrantedPermissions is a parsable slice of GrantedPermission.

type Group

type Group struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// UpdatedAt holds the value of the "updated_at" field.
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// Name holds the value of the "name" field.
	Name string `json:"name,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the GroupQuery when eager-loading is set.
	Edges GroupEdges `json:"edges"`
	// contains filtered or unexported fields
}

Group is the model entity for the Group schema.

func (*Group) QueryProjects

func (gr *Group) QueryProjects() *ProjectQuery

QueryProjects queries the "projects" edge of the Group entity.

func (*Group) QueryUsers

func (gr *Group) QueryUsers() *UserQuery

QueryUsers queries the "users" edge of the Group entity.

func (*Group) String

func (gr *Group) String() string

String implements the fmt.Stringer.

func (*Group) Unwrap

func (gr *Group) Unwrap() *Group

Unwrap unwraps the Group entity that was returned from a transaction after it was closed, so that all future queries will be executed through the driver which created the transaction.

func (*Group) Update

func (gr *Group) Update() *GroupUpdateOne

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

func (*Group) Value

func (gr *Group) Value(name string) (ent.Value, error)

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

type GroupClient

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

GroupClient is a client for the Group schema.

func NewGroupClient

func NewGroupClient(c config) *GroupClient

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

func (*GroupClient) Create

func (c *GroupClient) Create() *GroupCreate

Create returns a builder for creating a Group entity.

func (*GroupClient) CreateBulk

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

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

func (*GroupClient) Delete

func (c *GroupClient) Delete() *GroupDelete

Delete returns a delete builder for Group.

func (*GroupClient) DeleteOne

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

DeleteOne returns a builder for deleting the given entity.

func (*GroupClient) DeleteOneID

func (c *GroupClient) DeleteOneID(id uuid.UUID) *GroupDeleteOne

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

func (*GroupClient) Get

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

Get returns a Group entity by its id.

func (*GroupClient) GetX

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

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

func (*GroupClient) Hooks

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

Hooks returns the client hooks.

func (*GroupClient) Intercept

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

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

func (*GroupClient) Interceptors

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

Interceptors returns the client interceptors.

func (*GroupClient) MapCreateBulk

func (c *GroupClient) MapCreateBulk(slice any, setFunc func(*GroupCreate, int)) *GroupCreateBulk

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

func (c *GroupClient) Query() *GroupQuery

Query returns a query builder for Group.

func (*GroupClient) QueryProjects

func (c *GroupClient) QueryProjects(gr *Group) *ProjectQuery

QueryProjects queries the projects edge of a Group.

func (*GroupClient) QueryUsers

func (c *GroupClient) QueryUsers(gr *Group) *UserQuery

QueryUsers queries the users edge of a Group.

func (*GroupClient) Update

func (c *GroupClient) Update() *GroupUpdate

Update returns an update builder for Group.

func (*GroupClient) UpdateOne

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

UpdateOne returns an update builder for the given entity.

func (*GroupClient) UpdateOneID

func (c *GroupClient) UpdateOneID(id uuid.UUID) *GroupUpdateOne

UpdateOneID returns an update builder for the given id.

func (*GroupClient) Use

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

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

type GroupCreate

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

GroupCreate is the builder for creating a Group entity.

func (*GroupCreate) AddProjectIDs

func (gc *GroupCreate) AddProjectIDs(ids ...uuid.UUID) *GroupCreate

AddProjectIDs adds the "projects" edge to the Project entity by IDs.

func (*GroupCreate) AddProjects

func (gc *GroupCreate) AddProjects(p ...*Project) *GroupCreate

AddProjects adds the "projects" edges to the Project entity.

func (*GroupCreate) AddUserIDs

func (gc *GroupCreate) AddUserIDs(ids ...uuid.UUID) *GroupCreate

AddUserIDs adds the "users" edge to the User entity by IDs.

func (*GroupCreate) AddUsers

func (gc *GroupCreate) AddUsers(u ...*User) *GroupCreate

AddUsers adds the "users" edges to the User entity.

func (*GroupCreate) Exec

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

Exec executes the query.

func (*GroupCreate) ExecX

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

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

func (*GroupCreate) Mutation

func (gc *GroupCreate) Mutation() *GroupMutation

Mutation returns the GroupMutation object of the builder.

func (*GroupCreate) Save

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

Save creates the Group in the database.

func (*GroupCreate) SaveX

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

SaveX calls Save and panics if Save returns an error.

func (*GroupCreate) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*GroupCreate) SetID

func (gc *GroupCreate) SetID(u uuid.UUID) *GroupCreate

SetID sets the "id" field.

func (*GroupCreate) SetName

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

SetName sets the "name" field.

func (*GroupCreate) SetNillableCreatedAt

func (gc *GroupCreate) SetNillableCreatedAt(t *time.Time) *GroupCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*GroupCreate) SetNillableID

func (gc *GroupCreate) SetNillableID(u *uuid.UUID) *GroupCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*GroupCreate) SetNillableUpdatedAt

func (gc *GroupCreate) SetNillableUpdatedAt(t *time.Time) *GroupCreate

SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.

func (*GroupCreate) SetUpdatedAt

func (gc *GroupCreate) SetUpdatedAt(t time.Time) *GroupCreate

SetUpdatedAt sets the "updated_at" field.

type GroupCreateBulk

type GroupCreateBulk struct {
	// contains filtered or unexported fields
}

GroupCreateBulk is the builder for creating many Group entities in bulk.

func (*GroupCreateBulk) Exec

func (gcb *GroupCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*GroupCreateBulk) ExecX

func (gcb *GroupCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*GroupCreateBulk) Save

func (gcb *GroupCreateBulk) Save(ctx context.Context) ([]*Group, error)

Save creates the Group entities in the database.

func (*GroupCreateBulk) SaveX

func (gcb *GroupCreateBulk) SaveX(ctx context.Context) []*Group

SaveX is like Save, but panics if an error occurs.

type GroupDelete

type GroupDelete struct {
	// contains filtered or unexported fields
}

GroupDelete is the builder for deleting a Group entity.

func (*GroupDelete) Exec

func (gd *GroupDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*GroupDelete) ExecX

func (gd *GroupDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*GroupDelete) Where

func (gd *GroupDelete) Where(ps ...predicate.Group) *GroupDelete

Where appends a list predicates to the GroupDelete builder.

type GroupDeleteOne

type GroupDeleteOne struct {
	// contains filtered or unexported fields
}

GroupDeleteOne is the builder for deleting a single Group entity.

func (*GroupDeleteOne) Exec

func (gdo *GroupDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*GroupDeleteOne) ExecX

func (gdo *GroupDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*GroupDeleteOne) Where

func (gdo *GroupDeleteOne) Where(ps ...predicate.Group) *GroupDeleteOne

Where appends a list predicates to the GroupDelete builder.

type GroupEdges

type GroupEdges struct {
	// Users holds the value of the users edge.
	Users []*User `json:"users,omitempty"`
	// Projects this group has access to
	Projects []*Project `json:"projects,omitempty"`
	// contains filtered or unexported fields
}

GroupEdges holds the relations/edges for other nodes in the graph.

func (GroupEdges) ProjectsOrErr

func (e GroupEdges) ProjectsOrErr() ([]*Project, error)

ProjectsOrErr returns the Projects value or an error if the edge was not loaded in eager-loading.

func (GroupEdges) UsersOrErr

func (e GroupEdges) UsersOrErr() ([]*User, error)

UsersOrErr returns the Users value or an error if the edge was not loaded in eager-loading.

type GroupGroupBy

type GroupGroupBy struct {
	// contains filtered or unexported fields
}

GroupGroupBy is the group-by builder for Group entities.

func (*GroupGroupBy) Aggregate

func (ggb *GroupGroupBy) Aggregate(fns ...AggregateFunc) *GroupGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*GroupGroupBy) Bool

func (s *GroupGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*GroupGroupBy) BoolX

func (s *GroupGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*GroupGroupBy) Bools

func (s *GroupGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*GroupGroupBy) BoolsX

func (s *GroupGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*GroupGroupBy) Float64

func (s *GroupGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*GroupGroupBy) Float64X

func (s *GroupGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*GroupGroupBy) Float64s

func (s *GroupGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*GroupGroupBy) Float64sX

func (s *GroupGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*GroupGroupBy) Int

func (s *GroupGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*GroupGroupBy) IntX

func (s *GroupGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*GroupGroupBy) Ints

func (s *GroupGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*GroupGroupBy) IntsX

func (s *GroupGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*GroupGroupBy) Scan

func (ggb *GroupGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*GroupGroupBy) ScanX

func (s *GroupGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*GroupGroupBy) String

func (s *GroupGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*GroupGroupBy) StringX

func (s *GroupGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*GroupGroupBy) Strings

func (s *GroupGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*GroupGroupBy) StringsX

func (s *GroupGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type GroupMembership

type GroupMembership struct {

	// ProjectID holds the value of the "project_id" field.
	ProjectID uuid.UUID `json:"project_id,omitempty"`
	// GroupID holds the value of the "group_id" field.
	GroupID uuid.UUID `json:"group_id,omitempty"`
	// Role holds the value of the "role" field.
	Role groupmembership.Role `json:"role,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the GroupMembershipQuery when eager-loading is set.
	Edges GroupMembershipEdges `json:"edges"`
	// contains filtered or unexported fields
}

GroupMembership is the model entity for the GroupMembership schema.

func (*GroupMembership) QueryGroup

func (gm *GroupMembership) QueryGroup() *GroupQuery

QueryGroup queries the "group" edge of the GroupMembership entity.

func (*GroupMembership) QueryProject

func (gm *GroupMembership) QueryProject() *ProjectQuery

QueryProject queries the "project" edge of the GroupMembership entity.

func (*GroupMembership) String

func (gm *GroupMembership) String() string

String implements the fmt.Stringer.

func (*GroupMembership) Unwrap

func (gm *GroupMembership) Unwrap() *GroupMembership

Unwrap unwraps the GroupMembership 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 (*GroupMembership) Update

Update returns a builder for updating this GroupMembership. Note that you need to call GroupMembership.Unwrap() before calling this method if this GroupMembership was returned from a transaction, and the transaction was committed or rolled back.

func (*GroupMembership) Value

func (gm *GroupMembership) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the GroupMembership. This includes values selected through modifiers, order, etc.

type GroupMembershipClient

type GroupMembershipClient struct {
	// contains filtered or unexported fields
}

GroupMembershipClient is a client for the GroupMembership schema.

func NewGroupMembershipClient

func NewGroupMembershipClient(c config) *GroupMembershipClient

NewGroupMembershipClient returns a client for the GroupMembership from the given config.

func (*GroupMembershipClient) Create

Create returns a builder for creating a GroupMembership entity.

func (*GroupMembershipClient) CreateBulk

CreateBulk returns a builder for creating a bulk of GroupMembership entities.

func (*GroupMembershipClient) Delete

Delete returns a delete builder for GroupMembership.

func (*GroupMembershipClient) Hooks

func (c *GroupMembershipClient) Hooks() []Hook

Hooks returns the client hooks.

func (*GroupMembershipClient) Intercept

func (c *GroupMembershipClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `groupmembership.Intercept(f(g(h())))`.

func (*GroupMembershipClient) Interceptors

func (c *GroupMembershipClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*GroupMembershipClient) MapCreateBulk

func (c *GroupMembershipClient) MapCreateBulk(slice any, setFunc func(*GroupMembershipCreate, int)) *GroupMembershipCreateBulk

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 (*GroupMembershipClient) Query

Query returns a query builder for GroupMembership.

func (*GroupMembershipClient) QueryGroup

func (c *GroupMembershipClient) QueryGroup(gm *GroupMembership) *GroupQuery

QueryGroup queries the group edge of a GroupMembership.

func (*GroupMembershipClient) QueryProject

func (c *GroupMembershipClient) QueryProject(gm *GroupMembership) *ProjectQuery

QueryProject queries the project edge of a GroupMembership.

func (*GroupMembershipClient) Update

Update returns an update builder for GroupMembership.

func (*GroupMembershipClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*GroupMembershipClient) Use

func (c *GroupMembershipClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `groupmembership.Hooks(f(g(h())))`.

type GroupMembershipCreate

type GroupMembershipCreate struct {
	// contains filtered or unexported fields
}

GroupMembershipCreate is the builder for creating a GroupMembership entity.

func (*GroupMembershipCreate) Exec

func (gmc *GroupMembershipCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*GroupMembershipCreate) ExecX

func (gmc *GroupMembershipCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*GroupMembershipCreate) Mutation

Mutation returns the GroupMembershipMutation object of the builder.

func (*GroupMembershipCreate) Save

Save creates the GroupMembership in the database.

func (*GroupMembershipCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*GroupMembershipCreate) SetGroup

SetGroup sets the "group" edge to the Group entity.

func (*GroupMembershipCreate) SetGroupID

SetGroupID sets the "group_id" field.

func (*GroupMembershipCreate) SetNillableRole

SetNillableRole sets the "role" field if the given value is not nil.

func (*GroupMembershipCreate) SetProject

SetProject sets the "project" edge to the Project entity.

func (*GroupMembershipCreate) SetProjectID

func (gmc *GroupMembershipCreate) SetProjectID(u uuid.UUID) *GroupMembershipCreate

SetProjectID sets the "project_id" field.

func (*GroupMembershipCreate) SetRole

SetRole sets the "role" field.

type GroupMembershipCreateBulk

type GroupMembershipCreateBulk struct {
	// contains filtered or unexported fields
}

GroupMembershipCreateBulk is the builder for creating many GroupMembership entities in bulk.

func (*GroupMembershipCreateBulk) Exec

Exec executes the query.

func (*GroupMembershipCreateBulk) ExecX

func (gmcb *GroupMembershipCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*GroupMembershipCreateBulk) Save

Save creates the GroupMembership entities in the database.

func (*GroupMembershipCreateBulk) SaveX

SaveX is like Save, but panics if an error occurs.

type GroupMembershipDelete

type GroupMembershipDelete struct {
	// contains filtered or unexported fields
}

GroupMembershipDelete is the builder for deleting a GroupMembership entity.

func (*GroupMembershipDelete) Exec

func (gmd *GroupMembershipDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*GroupMembershipDelete) ExecX

func (gmd *GroupMembershipDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*GroupMembershipDelete) Where

Where appends a list predicates to the GroupMembershipDelete builder.

type GroupMembershipDeleteOne

type GroupMembershipDeleteOne struct {
	// contains filtered or unexported fields
}

GroupMembershipDeleteOne is the builder for deleting a single GroupMembership entity.

func (*GroupMembershipDeleteOne) Exec

Exec executes the deletion query.

func (*GroupMembershipDeleteOne) ExecX

func (gmdo *GroupMembershipDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*GroupMembershipDeleteOne) Where

Where appends a list predicates to the GroupMembershipDelete builder.

type GroupMembershipEdges

type GroupMembershipEdges struct {
	// Project holds the value of the project edge.
	Project *Project `json:"project,omitempty"`
	// Group holds the value of the group edge.
	Group *Group `json:"group,omitempty"`
	// contains filtered or unexported fields
}

GroupMembershipEdges holds the relations/edges for other nodes in the graph.

func (GroupMembershipEdges) GroupOrErr

func (e GroupMembershipEdges) GroupOrErr() (*Group, error)

GroupOrErr returns the Group value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

func (GroupMembershipEdges) ProjectOrErr

func (e GroupMembershipEdges) 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 GroupMembershipGroupBy

type GroupMembershipGroupBy struct {
	// contains filtered or unexported fields
}

GroupMembershipGroupBy is the group-by builder for GroupMembership entities.

func (*GroupMembershipGroupBy) Aggregate

Aggregate adds the given aggregation functions to the group-by query.

func (*GroupMembershipGroupBy) Bool

func (s *GroupMembershipGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*GroupMembershipGroupBy) BoolX

func (s *GroupMembershipGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*GroupMembershipGroupBy) Bools

func (s *GroupMembershipGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*GroupMembershipGroupBy) BoolsX

func (s *GroupMembershipGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*GroupMembershipGroupBy) Float64

func (s *GroupMembershipGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*GroupMembershipGroupBy) Float64X

func (s *GroupMembershipGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*GroupMembershipGroupBy) Float64s

func (s *GroupMembershipGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*GroupMembershipGroupBy) Float64sX

func (s *GroupMembershipGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*GroupMembershipGroupBy) Int

func (s *GroupMembershipGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*GroupMembershipGroupBy) IntX

func (s *GroupMembershipGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*GroupMembershipGroupBy) Ints

func (s *GroupMembershipGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*GroupMembershipGroupBy) IntsX

func (s *GroupMembershipGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*GroupMembershipGroupBy) Scan

func (gmgb *GroupMembershipGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*GroupMembershipGroupBy) ScanX

func (s *GroupMembershipGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*GroupMembershipGroupBy) String

func (s *GroupMembershipGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*GroupMembershipGroupBy) StringX

func (s *GroupMembershipGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*GroupMembershipGroupBy) Strings

func (s *GroupMembershipGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*GroupMembershipGroupBy) StringsX

func (s *GroupMembershipGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type GroupMembershipMutation

type GroupMembershipMutation struct {
	// contains filtered or unexported fields
}

GroupMembershipMutation represents an operation that mutates the GroupMembership nodes in the graph.

func (*GroupMembershipMutation) AddField

func (m *GroupMembershipMutation) 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 (*GroupMembershipMutation) AddedEdges

func (m *GroupMembershipMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*GroupMembershipMutation) AddedField

func (m *GroupMembershipMutation) 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 (*GroupMembershipMutation) AddedFields

func (m *GroupMembershipMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*GroupMembershipMutation) AddedIDs

func (m *GroupMembershipMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*GroupMembershipMutation) ClearEdge

func (m *GroupMembershipMutation) 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 (*GroupMembershipMutation) ClearField

func (m *GroupMembershipMutation) 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 (*GroupMembershipMutation) ClearGroup

func (m *GroupMembershipMutation) ClearGroup()

ClearGroup clears the "group" edge to the Group entity.

func (*GroupMembershipMutation) ClearProject

func (m *GroupMembershipMutation) ClearProject()

ClearProject clears the "project" edge to the Project entity.

func (*GroupMembershipMutation) ClearedEdges

func (m *GroupMembershipMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*GroupMembershipMutation) ClearedFields

func (m *GroupMembershipMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (GroupMembershipMutation) Client

func (m GroupMembershipMutation) 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 (*GroupMembershipMutation) EdgeCleared

func (m *GroupMembershipMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*GroupMembershipMutation) Field

func (m *GroupMembershipMutation) 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 (*GroupMembershipMutation) FieldCleared

func (m *GroupMembershipMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*GroupMembershipMutation) Fields

func (m *GroupMembershipMutation) 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 (*GroupMembershipMutation) GroupCleared

func (m *GroupMembershipMutation) GroupCleared() bool

GroupCleared reports if the "group" edge to the Group entity was cleared.

func (*GroupMembershipMutation) GroupID

func (m *GroupMembershipMutation) GroupID() (r uuid.UUID, exists bool)

GroupID returns the value of the "group_id" field in the mutation.

func (*GroupMembershipMutation) GroupIDs

func (m *GroupMembershipMutation) GroupIDs() (ids []uuid.UUID)

GroupIDs returns the "group" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use GroupID instead. It exists only for internal usage by the builders.

func (*GroupMembershipMutation) OldField

func (m *GroupMembershipMutation) 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 (*GroupMembershipMutation) Op

func (m *GroupMembershipMutation) Op() Op

Op returns the operation name.

func (*GroupMembershipMutation) ProjectCleared

func (m *GroupMembershipMutation) ProjectCleared() bool

ProjectCleared reports if the "project" edge to the Project entity was cleared.

func (*GroupMembershipMutation) ProjectID

func (m *GroupMembershipMutation) ProjectID() (r uuid.UUID, exists bool)

ProjectID returns the value of the "project_id" field in the mutation.

func (*GroupMembershipMutation) ProjectIDs

func (m *GroupMembershipMutation) ProjectIDs() (ids []uuid.UUID)

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 (*GroupMembershipMutation) RemovedEdges

func (m *GroupMembershipMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*GroupMembershipMutation) RemovedIDs

func (m *GroupMembershipMutation) 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 (*GroupMembershipMutation) ResetEdge

func (m *GroupMembershipMutation) 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 (*GroupMembershipMutation) ResetField

func (m *GroupMembershipMutation) 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 (*GroupMembershipMutation) ResetGroup

func (m *GroupMembershipMutation) ResetGroup()

ResetGroup resets all changes to the "group" edge.

func (*GroupMembershipMutation) ResetGroupID

func (m *GroupMembershipMutation) ResetGroupID()

ResetGroupID resets all changes to the "group_id" field.

func (*GroupMembershipMutation) ResetProject

func (m *GroupMembershipMutation) ResetProject()

ResetProject resets all changes to the "project" edge.

func (*GroupMembershipMutation) ResetProjectID

func (m *GroupMembershipMutation) ResetProjectID()

ResetProjectID resets all changes to the "project_id" field.

func (*GroupMembershipMutation) ResetRole

func (m *GroupMembershipMutation) ResetRole()

ResetRole resets all changes to the "role" field.

func (*GroupMembershipMutation) Role

func (m *GroupMembershipMutation) Role() (r groupmembership.Role, exists bool)

Role returns the value of the "role" field in the mutation.

func (*GroupMembershipMutation) SetField

func (m *GroupMembershipMutation) 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 (*GroupMembershipMutation) SetGroupID

func (m *GroupMembershipMutation) SetGroupID(u uuid.UUID)

SetGroupID sets the "group_id" field.

func (*GroupMembershipMutation) SetOp

func (m *GroupMembershipMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*GroupMembershipMutation) SetProjectID

func (m *GroupMembershipMutation) SetProjectID(u uuid.UUID)

SetProjectID sets the "project_id" field.

func (*GroupMembershipMutation) SetRole

SetRole sets the "role" field.

func (GroupMembershipMutation) Tx

func (m GroupMembershipMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*GroupMembershipMutation) Type

func (m *GroupMembershipMutation) Type() string

Type returns the node type of this mutation (GroupMembership).

func (*GroupMembershipMutation) Where

Where appends a list predicates to the GroupMembershipMutation builder.

func (*GroupMembershipMutation) WhereP

func (m *GroupMembershipMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the GroupMembershipMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type GroupMembershipQuery

type GroupMembershipQuery struct {
	// contains filtered or unexported fields
}

GroupMembershipQuery is the builder for querying GroupMembership entities.

func (*GroupMembershipQuery) Aggregate

Aggregate returns a GroupMembershipSelect configured with the given aggregations.

func (*GroupMembershipQuery) All

All executes the query and returns a list of GroupMemberships.

func (*GroupMembershipQuery) AllX

AllX is like All, but panics if an error occurs.

func (*GroupMembershipQuery) Clone

Clone returns a duplicate of the GroupMembershipQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*GroupMembershipQuery) Count

func (gmq *GroupMembershipQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*GroupMembershipQuery) CountX

func (gmq *GroupMembershipQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*GroupMembershipQuery) Exist

func (gmq *GroupMembershipQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*GroupMembershipQuery) ExistX

func (gmq *GroupMembershipQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*GroupMembershipQuery) First

First returns the first GroupMembership entity from the query. Returns a *NotFoundError when no GroupMembership was found.

func (*GroupMembershipQuery) FirstX

FirstX is like First, but panics if an error occurs.

func (*GroupMembershipQuery) GroupBy

func (gmq *GroupMembershipQuery) GroupBy(field string, fields ...string) *GroupMembershipGroupBy

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 {
	ProjectID uuid.UUID `json:"project_id,omitempty"`
	Count int `json:"count,omitempty"`
}

client.GroupMembership.Query().
	GroupBy(groupmembership.FieldProjectID).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*GroupMembershipQuery) Limit

func (gmq *GroupMembershipQuery) Limit(limit int) *GroupMembershipQuery

Limit the number of records to be returned by this query.

func (*GroupMembershipQuery) Offset

func (gmq *GroupMembershipQuery) Offset(offset int) *GroupMembershipQuery

Offset to start from.

func (*GroupMembershipQuery) Only

Only returns a single GroupMembership entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one GroupMembership entity is found. Returns a *NotFoundError when no GroupMembership entities are found.

func (*GroupMembershipQuery) OnlyX

OnlyX is like Only, but panics if an error occurs.

func (*GroupMembershipQuery) Order

Order specifies how the records should be ordered.

func (*GroupMembershipQuery) QueryGroup

func (gmq *GroupMembershipQuery) QueryGroup() *GroupQuery

QueryGroup chains the current query on the "group" edge.

func (*GroupMembershipQuery) QueryProject

func (gmq *GroupMembershipQuery) QueryProject() *ProjectQuery

QueryProject chains the current query on the "project" edge.

func (*GroupMembershipQuery) Select

func (gmq *GroupMembershipQuery) Select(fields ...string) *GroupMembershipSelect

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 {
	ProjectID uuid.UUID `json:"project_id,omitempty"`
}

client.GroupMembership.Query().
	Select(groupmembership.FieldProjectID).
	Scan(ctx, &v)

func (*GroupMembershipQuery) Unique

func (gmq *GroupMembershipQuery) Unique(unique bool) *GroupMembershipQuery

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 (*GroupMembershipQuery) Where

Where adds a new predicate for the GroupMembershipQuery builder.

func (*GroupMembershipQuery) WithGroup

func (gmq *GroupMembershipQuery) WithGroup(opts ...func(*GroupQuery)) *GroupMembershipQuery

WithGroup tells the query-builder to eager-load the nodes that are connected to the "group" edge. The optional arguments are used to configure the query builder of the edge.

func (*GroupMembershipQuery) WithProject

func (gmq *GroupMembershipQuery) WithProject(opts ...func(*ProjectQuery)) *GroupMembershipQuery

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 GroupMembershipSelect

type GroupMembershipSelect struct {
	*GroupMembershipQuery
	// contains filtered or unexported fields
}

GroupMembershipSelect is the builder for selecting fields of GroupMembership entities.

func (*GroupMembershipSelect) Aggregate

Aggregate adds the given aggregation functions to the selector query.

func (*GroupMembershipSelect) Bool

func (s *GroupMembershipSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*GroupMembershipSelect) BoolX

func (s *GroupMembershipSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*GroupMembershipSelect) Bools

func (s *GroupMembershipSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*GroupMembershipSelect) BoolsX

func (s *GroupMembershipSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*GroupMembershipSelect) Float64

func (s *GroupMembershipSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*GroupMembershipSelect) Float64X

func (s *GroupMembershipSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*GroupMembershipSelect) Float64s

func (s *GroupMembershipSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*GroupMembershipSelect) Float64sX

func (s *GroupMembershipSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*GroupMembershipSelect) Int

func (s *GroupMembershipSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*GroupMembershipSelect) IntX

func (s *GroupMembershipSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*GroupMembershipSelect) Ints

func (s *GroupMembershipSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*GroupMembershipSelect) IntsX

func (s *GroupMembershipSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*GroupMembershipSelect) Scan

func (gms *GroupMembershipSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*GroupMembershipSelect) ScanX

func (s *GroupMembershipSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*GroupMembershipSelect) String

func (s *GroupMembershipSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*GroupMembershipSelect) StringX

func (s *GroupMembershipSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*GroupMembershipSelect) Strings

func (s *GroupMembershipSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*GroupMembershipSelect) StringsX

func (s *GroupMembershipSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type GroupMembershipUpdate

type GroupMembershipUpdate struct {
	// contains filtered or unexported fields
}

GroupMembershipUpdate is the builder for updating GroupMembership entities.

func (*GroupMembershipUpdate) ClearGroup

func (gmu *GroupMembershipUpdate) ClearGroup() *GroupMembershipUpdate

ClearGroup clears the "group" edge to the Group entity.

func (*GroupMembershipUpdate) ClearProject

func (gmu *GroupMembershipUpdate) ClearProject() *GroupMembershipUpdate

ClearProject clears the "project" edge to the Project entity.

func (*GroupMembershipUpdate) Exec

func (gmu *GroupMembershipUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*GroupMembershipUpdate) ExecX

func (gmu *GroupMembershipUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*GroupMembershipUpdate) Mutation

Mutation returns the GroupMembershipMutation object of the builder.

func (*GroupMembershipUpdate) Save

func (gmu *GroupMembershipUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*GroupMembershipUpdate) SaveX

func (gmu *GroupMembershipUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*GroupMembershipUpdate) SetGroup

SetGroup sets the "group" edge to the Group entity.

func (*GroupMembershipUpdate) SetGroupID

SetGroupID sets the "group_id" field.

func (*GroupMembershipUpdate) SetNillableGroupID

func (gmu *GroupMembershipUpdate) SetNillableGroupID(u *uuid.UUID) *GroupMembershipUpdate

SetNillableGroupID sets the "group_id" field if the given value is not nil.

func (*GroupMembershipUpdate) SetNillableProjectID

func (gmu *GroupMembershipUpdate) SetNillableProjectID(u *uuid.UUID) *GroupMembershipUpdate

SetNillableProjectID sets the "project_id" field if the given value is not nil.

func (*GroupMembershipUpdate) SetNillableRole

SetNillableRole sets the "role" field if the given value is not nil.

func (*GroupMembershipUpdate) SetProject

SetProject sets the "project" edge to the Project entity.

func (*GroupMembershipUpdate) SetProjectID

func (gmu *GroupMembershipUpdate) SetProjectID(u uuid.UUID) *GroupMembershipUpdate

SetProjectID sets the "project_id" field.

func (*GroupMembershipUpdate) SetRole

SetRole sets the "role" field.

func (*GroupMembershipUpdate) Where

Where appends a list predicates to the GroupMembershipUpdate builder.

type GroupMembershipUpdateOne

type GroupMembershipUpdateOne struct {
	// contains filtered or unexported fields
}

GroupMembershipUpdateOne is the builder for updating a single GroupMembership entity.

func (*GroupMembershipUpdateOne) ClearGroup

ClearGroup clears the "group" edge to the Group entity.

func (*GroupMembershipUpdateOne) ClearProject

func (gmuo *GroupMembershipUpdateOne) ClearProject() *GroupMembershipUpdateOne

ClearProject clears the "project" edge to the Project entity.

func (*GroupMembershipUpdateOne) Exec

Exec executes the query on the entity.

func (*GroupMembershipUpdateOne) ExecX

func (gmuo *GroupMembershipUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*GroupMembershipUpdateOne) Mutation

Mutation returns the GroupMembershipMutation object of the builder.

func (*GroupMembershipUpdateOne) Save

Save executes the query and returns the updated GroupMembership entity.

func (*GroupMembershipUpdateOne) SaveX

SaveX is like Save, but panics if an error occurs.

func (*GroupMembershipUpdateOne) Select

func (gmuo *GroupMembershipUpdateOne) Select(field string, fields ...string) *GroupMembershipUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*GroupMembershipUpdateOne) SetGroup

SetGroup sets the "group" edge to the Group entity.

func (*GroupMembershipUpdateOne) SetGroupID

SetGroupID sets the "group_id" field.

func (*GroupMembershipUpdateOne) SetNillableGroupID

func (gmuo *GroupMembershipUpdateOne) SetNillableGroupID(u *uuid.UUID) *GroupMembershipUpdateOne

SetNillableGroupID sets the "group_id" field if the given value is not nil.

func (*GroupMembershipUpdateOne) SetNillableProjectID

func (gmuo *GroupMembershipUpdateOne) SetNillableProjectID(u *uuid.UUID) *GroupMembershipUpdateOne

SetNillableProjectID sets the "project_id" field if the given value is not nil.

func (*GroupMembershipUpdateOne) SetNillableRole

SetNillableRole sets the "role" field if the given value is not nil.

func (*GroupMembershipUpdateOne) SetProject

SetProject sets the "project" edge to the Project entity.

func (*GroupMembershipUpdateOne) SetProjectID

SetProjectID sets the "project_id" field.

func (*GroupMembershipUpdateOne) SetRole

SetRole sets the "role" field.

func (*GroupMembershipUpdateOne) Where

Where appends a list predicates to the GroupMembershipUpdate builder.

type GroupMemberships

type GroupMemberships []*GroupMembership

GroupMemberships is a parsable slice of GroupMembership.

type GroupMutation

type GroupMutation struct {
	// contains filtered or unexported fields
}

GroupMutation represents an operation that mutates the Group nodes in the graph.

func (*GroupMutation) AddField

func (m *GroupMutation) AddField(name string, value ent.Value) error

AddField adds the value to the field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*GroupMutation) AddProjectIDs

func (m *GroupMutation) AddProjectIDs(ids ...uuid.UUID)

AddProjectIDs adds the "projects" edge to the Project entity by ids.

func (*GroupMutation) AddUserIDs

func (m *GroupMutation) AddUserIDs(ids ...uuid.UUID)

AddUserIDs adds the "users" edge to the User entity by ids.

func (*GroupMutation) AddedEdges

func (m *GroupMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*GroupMutation) AddedField

func (m *GroupMutation) AddedField(name string) (ent.Value, bool)

AddedField returns the numeric value that was incremented/decremented on a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*GroupMutation) AddedFields

func (m *GroupMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*GroupMutation) AddedIDs

func (m *GroupMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*GroupMutation) ClearEdge

func (m *GroupMutation) ClearEdge(name string) error

ClearEdge clears the value of the edge with the given name. It returns an error if that edge is not defined in the schema.

func (*GroupMutation) ClearField

func (m *GroupMutation) ClearField(name string) error

ClearField clears the value of the field with the given name. It returns an error if the field is not defined in the schema.

func (*GroupMutation) ClearProjects

func (m *GroupMutation) ClearProjects()

ClearProjects clears the "projects" edge to the Project entity.

func (*GroupMutation) ClearUsers

func (m *GroupMutation) ClearUsers()

ClearUsers clears the "users" edge to the User entity.

func (*GroupMutation) ClearedEdges

func (m *GroupMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*GroupMutation) ClearedFields

func (m *GroupMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (GroupMutation) Client

func (m GroupMutation) Client() *Client

Client returns a new `ent.Client` from the mutation. If the mutation was executed in a transaction (ent.Tx), a transactional client is returned.

func (*GroupMutation) CreatedAt

func (m *GroupMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*GroupMutation) EdgeCleared

func (m *GroupMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*GroupMutation) Field

func (m *GroupMutation) Field(name string) (ent.Value, bool)

Field returns the value of a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*GroupMutation) FieldCleared

func (m *GroupMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*GroupMutation) Fields

func (m *GroupMutation) Fields() []string

Fields returns all fields that were changed during this mutation. Note that in order to get all numeric fields that were incremented/decremented, call AddedFields().

func (*GroupMutation) ID

func (m *GroupMutation) ID() (id uuid.UUID, exists bool)

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.

func (*GroupMutation) IDs

func (m *GroupMutation) IDs(ctx context.Context) ([]uuid.UUID, 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 (*GroupMutation) Name

func (m *GroupMutation) Name() (r string, exists bool)

Name returns the value of the "name" field in the mutation.

func (*GroupMutation) OldCreatedAt

func (m *GroupMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the Group entity. If the Group object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*GroupMutation) OldField

func (m *GroupMutation) OldField(ctx context.Context, name string) (ent.Value, error)

OldField returns the old value of the field from the database. An error is returned if the mutation operation is not UpdateOne, or the query to the database failed.

func (*GroupMutation) OldName

func (m *GroupMutation) OldName(ctx context.Context) (v string, err error)

OldName returns the old "name" field's value of the Group entity. If the Group object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*GroupMutation) OldUpdatedAt

func (m *GroupMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)

OldUpdatedAt returns the old "updated_at" field's value of the Group entity. If the Group object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*GroupMutation) Op

func (m *GroupMutation) Op() Op

Op returns the operation name.

func (*GroupMutation) ProjectsCleared

func (m *GroupMutation) ProjectsCleared() bool

ProjectsCleared reports if the "projects" edge to the Project entity was cleared.

func (*GroupMutation) ProjectsIDs

func (m *GroupMutation) ProjectsIDs() (ids []uuid.UUID)

ProjectsIDs returns the "projects" edge IDs in the mutation.

func (*GroupMutation) RemoveProjectIDs

func (m *GroupMutation) RemoveProjectIDs(ids ...uuid.UUID)

RemoveProjectIDs removes the "projects" edge to the Project entity by IDs.

func (*GroupMutation) RemoveUserIDs

func (m *GroupMutation) RemoveUserIDs(ids ...uuid.UUID)

RemoveUserIDs removes the "users" edge to the User entity by IDs.

func (*GroupMutation) RemovedEdges

func (m *GroupMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*GroupMutation) RemovedIDs

func (m *GroupMutation) RemovedIDs(name string) []ent.Value

RemovedIDs returns all IDs (to other nodes) that were removed for the edge with the given name in this mutation.

func (*GroupMutation) RemovedProjectsIDs

func (m *GroupMutation) RemovedProjectsIDs() (ids []uuid.UUID)

RemovedProjects returns the removed IDs of the "projects" edge to the Project entity.

func (*GroupMutation) RemovedUsersIDs

func (m *GroupMutation) RemovedUsersIDs() (ids []uuid.UUID)

RemovedUsers returns the removed IDs of the "users" edge to the User entity.

func (*GroupMutation) ResetCreatedAt

func (m *GroupMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*GroupMutation) ResetEdge

func (m *GroupMutation) ResetEdge(name string) error

ResetEdge resets all changes to the edge with the given name in this mutation. It returns an error if the edge is not defined in the schema.

func (*GroupMutation) ResetField

func (m *GroupMutation) ResetField(name string) error

ResetField resets all changes in the mutation for the field with the given name. It returns an error if the field is not defined in the schema.

func (*GroupMutation) ResetName

func (m *GroupMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*GroupMutation) ResetProjects

func (m *GroupMutation) ResetProjects()

ResetProjects resets all changes to the "projects" edge.

func (*GroupMutation) ResetUpdatedAt

func (m *GroupMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*GroupMutation) ResetUsers

func (m *GroupMutation) ResetUsers()

ResetUsers resets all changes to the "users" edge.

func (*GroupMutation) SetCreatedAt

func (m *GroupMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*GroupMutation) SetField

func (m *GroupMutation) SetField(name string, value ent.Value) error

SetField sets the value of a field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*GroupMutation) SetID

func (m *GroupMutation) SetID(id uuid.UUID)

SetID sets the value of the id field. Note that this operation is only accepted on creation of Group entities.

func (*GroupMutation) SetName

func (m *GroupMutation) SetName(s string)

SetName sets the "name" field.

func (*GroupMutation) SetOp

func (m *GroupMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*GroupMutation) SetUpdatedAt

func (m *GroupMutation) SetUpdatedAt(t time.Time)

SetUpdatedAt sets the "updated_at" field.

func (GroupMutation) Tx

func (m GroupMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*GroupMutation) Type

func (m *GroupMutation) Type() string

Type returns the node type of this mutation (Group).

func (*GroupMutation) UpdatedAt

func (m *GroupMutation) UpdatedAt() (r time.Time, exists bool)

UpdatedAt returns the value of the "updated_at" field in the mutation.

func (*GroupMutation) UsersCleared

func (m *GroupMutation) UsersCleared() bool

UsersCleared reports if the "users" edge to the User entity was cleared.

func (*GroupMutation) UsersIDs

func (m *GroupMutation) UsersIDs() (ids []uuid.UUID)

UsersIDs returns the "users" edge IDs in the mutation.

func (*GroupMutation) Where

func (m *GroupMutation) Where(ps ...predicate.Group)

Where appends a list predicates to the GroupMutation builder.

func (*GroupMutation) WhereP

func (m *GroupMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the GroupMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type GroupQuery

type GroupQuery struct {
	// contains filtered or unexported fields
}

GroupQuery is the builder for querying Group entities.

func (*GroupQuery) Aggregate

func (gq *GroupQuery) Aggregate(fns ...AggregateFunc) *GroupSelect

Aggregate returns a GroupSelect configured with the given aggregations.

func (*GroupQuery) All

func (gq *GroupQuery) All(ctx context.Context) ([]*Group, error)

All executes the query and returns a list of Groups.

func (*GroupQuery) AllX

func (gq *GroupQuery) AllX(ctx context.Context) []*Group

AllX is like All, but panics if an error occurs.

func (*GroupQuery) Clone

func (gq *GroupQuery) Clone() *GroupQuery

Clone returns a duplicate of the GroupQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*GroupQuery) Count

func (gq *GroupQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*GroupQuery) CountX

func (gq *GroupQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*GroupQuery) Exist

func (gq *GroupQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*GroupQuery) ExistX

func (gq *GroupQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*GroupQuery) First

func (gq *GroupQuery) First(ctx context.Context) (*Group, error)

First returns the first Group entity from the query. Returns a *NotFoundError when no Group was found.

func (*GroupQuery) FirstID

func (gq *GroupQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

FirstID returns the first Group ID from the query. Returns a *NotFoundError when no Group ID was found.

func (*GroupQuery) FirstIDX

func (gq *GroupQuery) FirstIDX(ctx context.Context) uuid.UUID

FirstIDX is like FirstID, but panics if an error occurs.

func (*GroupQuery) FirstX

func (gq *GroupQuery) FirstX(ctx context.Context) *Group

FirstX is like First, but panics if an error occurs.

func (*GroupQuery) GroupBy

func (gq *GroupQuery) GroupBy(field string, fields ...string) *GroupGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

Example:

var v []struct {
	CreatedAt time.Time `json:"created_at,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Group.Query().
	GroupBy(group.FieldCreatedAt).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*GroupQuery) IDs

func (gq *GroupQuery) IDs(ctx context.Context) (ids []uuid.UUID, err error)

IDs executes the query and returns a list of Group IDs.

func (*GroupQuery) IDsX

func (gq *GroupQuery) IDsX(ctx context.Context) []uuid.UUID

IDsX is like IDs, but panics if an error occurs.

func (*GroupQuery) Limit

func (gq *GroupQuery) Limit(limit int) *GroupQuery

Limit the number of records to be returned by this query.

func (*GroupQuery) Offset

func (gq *GroupQuery) Offset(offset int) *GroupQuery

Offset to start from.

func (*GroupQuery) Only

func (gq *GroupQuery) Only(ctx context.Context) (*Group, error)

Only returns a single Group entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Group entity is found. Returns a *NotFoundError when no Group entities are found.

func (*GroupQuery) OnlyID

func (gq *GroupQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

OnlyID is like Only, but returns the only Group ID in the query. Returns a *NotSingularError when more than one Group ID is found. Returns a *NotFoundError when no entities are found.

func (*GroupQuery) OnlyIDX

func (gq *GroupQuery) OnlyIDX(ctx context.Context) uuid.UUID

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*GroupQuery) OnlyX

func (gq *GroupQuery) OnlyX(ctx context.Context) *Group

OnlyX is like Only, but panics if an error occurs.

func (*GroupQuery) Order

func (gq *GroupQuery) Order(o ...group.OrderOption) *GroupQuery

Order specifies how the records should be ordered.

func (*GroupQuery) QueryProjects

func (gq *GroupQuery) QueryProjects() *ProjectQuery

QueryProjects chains the current query on the "projects" edge.

func (*GroupQuery) QueryUsers

func (gq *GroupQuery) QueryUsers() *UserQuery

QueryUsers chains the current query on the "users" edge.

func (*GroupQuery) Select

func (gq *GroupQuery) Select(fields ...string) *GroupSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	CreatedAt time.Time `json:"created_at,omitempty"`
}

client.Group.Query().
	Select(group.FieldCreatedAt).
	Scan(ctx, &v)

func (*GroupQuery) Unique

func (gq *GroupQuery) Unique(unique bool) *GroupQuery

Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.

func (*GroupQuery) Where

func (gq *GroupQuery) Where(ps ...predicate.Group) *GroupQuery

Where adds a new predicate for the GroupQuery builder.

func (*GroupQuery) WithProjects

func (gq *GroupQuery) WithProjects(opts ...func(*ProjectQuery)) *GroupQuery

WithProjects tells the query-builder to eager-load the nodes that are connected to the "projects" edge. The optional arguments are used to configure the query builder of the edge.

func (*GroupQuery) WithUsers

func (gq *GroupQuery) WithUsers(opts ...func(*UserQuery)) *GroupQuery

WithUsers tells the query-builder to eager-load the nodes that are connected to the "users" edge. The optional arguments are used to configure the query builder of the edge.

type GroupSelect

type GroupSelect struct {
	*GroupQuery
	// contains filtered or unexported fields
}

GroupSelect is the builder for selecting fields of Group entities.

func (*GroupSelect) Aggregate

func (gs *GroupSelect) Aggregate(fns ...AggregateFunc) *GroupSelect

Aggregate adds the given aggregation functions to the selector query.

func (*GroupSelect) Bool

func (s *GroupSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*GroupSelect) BoolX

func (s *GroupSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*GroupSelect) Bools

func (s *GroupSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*GroupSelect) BoolsX

func (s *GroupSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*GroupSelect) Float64

func (s *GroupSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*GroupSelect) Float64X

func (s *GroupSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*GroupSelect) Float64s

func (s *GroupSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*GroupSelect) Float64sX

func (s *GroupSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*GroupSelect) Int

func (s *GroupSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*GroupSelect) IntX

func (s *GroupSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*GroupSelect) Ints

func (s *GroupSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*GroupSelect) IntsX

func (s *GroupSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*GroupSelect) Scan

func (gs *GroupSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*GroupSelect) ScanX

func (s *GroupSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*GroupSelect) String

func (s *GroupSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*GroupSelect) StringX

func (s *GroupSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*GroupSelect) Strings

func (s *GroupSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*GroupSelect) StringsX

func (s *GroupSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type GroupUpdate

type GroupUpdate struct {
	// contains filtered or unexported fields
}

GroupUpdate is the builder for updating Group entities.

func (*GroupUpdate) AddProjectIDs

func (gu *GroupUpdate) AddProjectIDs(ids ...uuid.UUID) *GroupUpdate

AddProjectIDs adds the "projects" edge to the Project entity by IDs.

func (*GroupUpdate) AddProjects

func (gu *GroupUpdate) AddProjects(p ...*Project) *GroupUpdate

AddProjects adds the "projects" edges to the Project entity.

func (*GroupUpdate) AddUserIDs

func (gu *GroupUpdate) AddUserIDs(ids ...uuid.UUID) *GroupUpdate

AddUserIDs adds the "users" edge to the User entity by IDs.

func (*GroupUpdate) AddUsers

func (gu *GroupUpdate) AddUsers(u ...*User) *GroupUpdate

AddUsers adds the "users" edges to the User entity.

func (*GroupUpdate) ClearProjects

func (gu *GroupUpdate) ClearProjects() *GroupUpdate

ClearProjects clears all "projects" edges to the Project entity.

func (*GroupUpdate) ClearUsers

func (gu *GroupUpdate) ClearUsers() *GroupUpdate

ClearUsers clears all "users" edges to the User entity.

func (*GroupUpdate) Exec

func (gu *GroupUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*GroupUpdate) ExecX

func (gu *GroupUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*GroupUpdate) Mutation

func (gu *GroupUpdate) Mutation() *GroupMutation

Mutation returns the GroupMutation object of the builder.

func (*GroupUpdate) RemoveProjectIDs

func (gu *GroupUpdate) RemoveProjectIDs(ids ...uuid.UUID) *GroupUpdate

RemoveProjectIDs removes the "projects" edge to Project entities by IDs.

func (*GroupUpdate) RemoveProjects

func (gu *GroupUpdate) RemoveProjects(p ...*Project) *GroupUpdate

RemoveProjects removes "projects" edges to Project entities.

func (*GroupUpdate) RemoveUserIDs

func (gu *GroupUpdate) RemoveUserIDs(ids ...uuid.UUID) *GroupUpdate

RemoveUserIDs removes the "users" edge to User entities by IDs.

func (*GroupUpdate) RemoveUsers

func (gu *GroupUpdate) RemoveUsers(u ...*User) *GroupUpdate

RemoveUsers removes "users" edges to User entities.

func (*GroupUpdate) Save

func (gu *GroupUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*GroupUpdate) SaveX

func (gu *GroupUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*GroupUpdate) SetName

func (gu *GroupUpdate) SetName(s string) *GroupUpdate

SetName sets the "name" field.

func (*GroupUpdate) SetNillableName

func (gu *GroupUpdate) SetNillableName(s *string) *GroupUpdate

SetNillableName sets the "name" field if the given value is not nil.

func (*GroupUpdate) SetUpdatedAt

func (gu *GroupUpdate) SetUpdatedAt(t time.Time) *GroupUpdate

SetUpdatedAt sets the "updated_at" field.

func (*GroupUpdate) Where

func (gu *GroupUpdate) Where(ps ...predicate.Group) *GroupUpdate

Where appends a list predicates to the GroupUpdate builder.

type GroupUpdateOne

type GroupUpdateOne struct {
	// contains filtered or unexported fields
}

GroupUpdateOne is the builder for updating a single Group entity.

func (*GroupUpdateOne) AddProjectIDs

func (guo *GroupUpdateOne) AddProjectIDs(ids ...uuid.UUID) *GroupUpdateOne

AddProjectIDs adds the "projects" edge to the Project entity by IDs.

func (*GroupUpdateOne) AddProjects

func (guo *GroupUpdateOne) AddProjects(p ...*Project) *GroupUpdateOne

AddProjects adds the "projects" edges to the Project entity.

func (*GroupUpdateOne) AddUserIDs

func (guo *GroupUpdateOne) AddUserIDs(ids ...uuid.UUID) *GroupUpdateOne

AddUserIDs adds the "users" edge to the User entity by IDs.

func (*GroupUpdateOne) AddUsers

func (guo *GroupUpdateOne) AddUsers(u ...*User) *GroupUpdateOne

AddUsers adds the "users" edges to the User entity.

func (*GroupUpdateOne) ClearProjects

func (guo *GroupUpdateOne) ClearProjects() *GroupUpdateOne

ClearProjects clears all "projects" edges to the Project entity.

func (*GroupUpdateOne) ClearUsers

func (guo *GroupUpdateOne) ClearUsers() *GroupUpdateOne

ClearUsers clears all "users" edges to the User entity.

func (*GroupUpdateOne) Exec

func (guo *GroupUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*GroupUpdateOne) ExecX

func (guo *GroupUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*GroupUpdateOne) Mutation

func (guo *GroupUpdateOne) Mutation() *GroupMutation

Mutation returns the GroupMutation object of the builder.

func (*GroupUpdateOne) RemoveProjectIDs

func (guo *GroupUpdateOne) RemoveProjectIDs(ids ...uuid.UUID) *GroupUpdateOne

RemoveProjectIDs removes the "projects" edge to Project entities by IDs.

func (*GroupUpdateOne) RemoveProjects

func (guo *GroupUpdateOne) RemoveProjects(p ...*Project) *GroupUpdateOne

RemoveProjects removes "projects" edges to Project entities.

func (*GroupUpdateOne) RemoveUserIDs

func (guo *GroupUpdateOne) RemoveUserIDs(ids ...uuid.UUID) *GroupUpdateOne

RemoveUserIDs removes the "users" edge to User entities by IDs.

func (*GroupUpdateOne) RemoveUsers

func (guo *GroupUpdateOne) RemoveUsers(u ...*User) *GroupUpdateOne

RemoveUsers removes "users" edges to User entities.

func (*GroupUpdateOne) Save

func (guo *GroupUpdateOne) Save(ctx context.Context) (*Group, error)

Save executes the query and returns the updated Group entity.

func (*GroupUpdateOne) SaveX

func (guo *GroupUpdateOne) SaveX(ctx context.Context) *Group

SaveX is like Save, but panics if an error occurs.

func (*GroupUpdateOne) Select

func (guo *GroupUpdateOne) Select(field string, fields ...string) *GroupUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*GroupUpdateOne) SetName

func (guo *GroupUpdateOne) SetName(s string) *GroupUpdateOne

SetName sets the "name" field.

func (*GroupUpdateOne) SetNillableName

func (guo *GroupUpdateOne) SetNillableName(s *string) *GroupUpdateOne

SetNillableName sets the "name" field if the given value is not nil.

func (*GroupUpdateOne) SetUpdatedAt

func (guo *GroupUpdateOne) SetUpdatedAt(t time.Time) *GroupUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*GroupUpdateOne) Where

func (guo *GroupUpdateOne) Where(ps ...predicate.Group) *GroupUpdateOne

Where appends a list predicates to the GroupUpdate builder.

type Groups

type Groups []*Group

Groups is a parsable slice of Group.

type Hook

type Hook = ent.Hook

ent aliases to avoid import conflicts in user's code.

type 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 Membership

type Membership struct {

	// ProjectID holds the value of the "project_id" field.
	ProjectID uuid.UUID `json:"project_id,omitempty"`
	// UserID holds the value of the "user_id" field.
	UserID uuid.UUID `json:"user_id,omitempty"`
	// Role holds the value of the "role" field.
	Role membership.Role `json:"role,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the MembershipQuery when eager-loading is set.
	Edges MembershipEdges `json:"edges"`
	// contains filtered or unexported fields
}

Membership is the model entity for the Membership schema.

func (*Membership) QueryProject

func (m *Membership) QueryProject() *ProjectQuery

QueryProject queries the "project" edge of the Membership entity.

func (*Membership) QueryUser

func (m *Membership) QueryUser() *UserQuery

QueryUser queries the "user" edge of the Membership entity.

func (*Membership) String

func (m *Membership) String() string

String implements the fmt.Stringer.

func (*Membership) Unwrap

func (m *Membership) Unwrap() *Membership

Unwrap unwraps the Membership 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 (*Membership) Update

func (m *Membership) Update() *MembershipUpdateOne

Update returns a builder for updating this Membership. Note that you need to call Membership.Unwrap() before calling this method if this Membership was returned from a transaction, and the transaction was committed or rolled back.

func (*Membership) Value

func (m *Membership) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the Membership. This includes values selected through modifiers, order, etc.

type MembershipClient

type MembershipClient struct {
	// contains filtered or unexported fields
}

MembershipClient is a client for the Membership schema.

func NewMembershipClient

func NewMembershipClient(c config) *MembershipClient

NewMembershipClient returns a client for the Membership from the given config.

func (*MembershipClient) Create

func (c *MembershipClient) Create() *MembershipCreate

Create returns a builder for creating a Membership entity.

func (*MembershipClient) CreateBulk

func (c *MembershipClient) CreateBulk(builders ...*MembershipCreate) *MembershipCreateBulk

CreateBulk returns a builder for creating a bulk of Membership entities.

func (*MembershipClient) Delete

func (c *MembershipClient) Delete() *MembershipDelete

Delete returns a delete builder for Membership.

func (*MembershipClient) Hooks

func (c *MembershipClient) Hooks() []Hook

Hooks returns the client hooks.

func (*MembershipClient) Intercept

func (c *MembershipClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `membership.Intercept(f(g(h())))`.

func (*MembershipClient) Interceptors

func (c *MembershipClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*MembershipClient) MapCreateBulk

func (c *MembershipClient) MapCreateBulk(slice any, setFunc func(*MembershipCreate, int)) *MembershipCreateBulk

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 (*MembershipClient) Query

func (c *MembershipClient) Query() *MembershipQuery

Query returns a query builder for Membership.

func (*MembershipClient) QueryProject

func (c *MembershipClient) QueryProject(m *Membership) *ProjectQuery

QueryProject queries the project edge of a Membership.

func (*MembershipClient) QueryUser

func (c *MembershipClient) QueryUser(m *Membership) *UserQuery

QueryUser queries the user edge of a Membership.

func (*MembershipClient) Update

func (c *MembershipClient) Update() *MembershipUpdate

Update returns an update builder for Membership.

func (*MembershipClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*MembershipClient) Use

func (c *MembershipClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `membership.Hooks(f(g(h())))`.

type MembershipCreate

type MembershipCreate struct {
	// contains filtered or unexported fields
}

MembershipCreate is the builder for creating a Membership entity.

func (*MembershipCreate) Exec

func (mc *MembershipCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*MembershipCreate) ExecX

func (mc *MembershipCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*MembershipCreate) Mutation

func (mc *MembershipCreate) Mutation() *MembershipMutation

Mutation returns the MembershipMutation object of the builder.

func (*MembershipCreate) Save

func (mc *MembershipCreate) Save(ctx context.Context) (*Membership, error)

Save creates the Membership in the database.

func (*MembershipCreate) SaveX

func (mc *MembershipCreate) SaveX(ctx context.Context) *Membership

SaveX calls Save and panics if Save returns an error.

func (*MembershipCreate) SetNillableRole

func (mc *MembershipCreate) SetNillableRole(m *membership.Role) *MembershipCreate

SetNillableRole sets the "role" field if the given value is not nil.

func (*MembershipCreate) SetProject

func (mc *MembershipCreate) SetProject(p *Project) *MembershipCreate

SetProject sets the "project" edge to the Project entity.

func (*MembershipCreate) SetProjectID

func (mc *MembershipCreate) SetProjectID(u uuid.UUID) *MembershipCreate

SetProjectID sets the "project_id" field.

func (*MembershipCreate) SetRole

SetRole sets the "role" field.

func (*MembershipCreate) SetUser

func (mc *MembershipCreate) SetUser(u *User) *MembershipCreate

SetUser sets the "user" edge to the User entity.

func (*MembershipCreate) SetUserID

func (mc *MembershipCreate) SetUserID(u uuid.UUID) *MembershipCreate

SetUserID sets the "user_id" field.

type MembershipCreateBulk

type MembershipCreateBulk struct {
	// contains filtered or unexported fields
}

MembershipCreateBulk is the builder for creating many Membership entities in bulk.

func (*MembershipCreateBulk) Exec

func (mcb *MembershipCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*MembershipCreateBulk) ExecX

func (mcb *MembershipCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*MembershipCreateBulk) Save

func (mcb *MembershipCreateBulk) Save(ctx context.Context) ([]*Membership, error)

Save creates the Membership entities in the database.

func (*MembershipCreateBulk) SaveX

func (mcb *MembershipCreateBulk) SaveX(ctx context.Context) []*Membership

SaveX is like Save, but panics if an error occurs.

type MembershipDelete

type MembershipDelete struct {
	// contains filtered or unexported fields
}

MembershipDelete is the builder for deleting a Membership entity.

func (*MembershipDelete) Exec

func (md *MembershipDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*MembershipDelete) ExecX

func (md *MembershipDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*MembershipDelete) Where

Where appends a list predicates to the MembershipDelete builder.

type MembershipDeleteOne

type MembershipDeleteOne struct {
	// contains filtered or unexported fields
}

MembershipDeleteOne is the builder for deleting a single Membership entity.

func (*MembershipDeleteOne) Exec

func (mdo *MembershipDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*MembershipDeleteOne) ExecX

func (mdo *MembershipDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*MembershipDeleteOne) Where

Where appends a list predicates to the MembershipDelete builder.

type MembershipEdges

type MembershipEdges struct {
	// Project holds the value of the project edge.
	Project *Project `json:"project,omitempty"`
	// User holds the value of the user edge.
	User *User `json:"user,omitempty"`
	// contains filtered or unexported fields
}

MembershipEdges holds the relations/edges for other nodes in the graph.

func (MembershipEdges) ProjectOrErr

func (e MembershipEdges) 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.

func (MembershipEdges) UserOrErr

func (e MembershipEdges) UserOrErr() (*User, error)

UserOrErr returns the User value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

type MembershipGroupBy

type MembershipGroupBy struct {
	// contains filtered or unexported fields
}

MembershipGroupBy is the group-by builder for Membership entities.

func (*MembershipGroupBy) Aggregate

func (mgb *MembershipGroupBy) Aggregate(fns ...AggregateFunc) *MembershipGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*MembershipGroupBy) Bool

func (s *MembershipGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*MembershipGroupBy) BoolX

func (s *MembershipGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*MembershipGroupBy) Bools

func (s *MembershipGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*MembershipGroupBy) BoolsX

func (s *MembershipGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*MembershipGroupBy) Float64

func (s *MembershipGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*MembershipGroupBy) Float64X

func (s *MembershipGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*MembershipGroupBy) Float64s

func (s *MembershipGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*MembershipGroupBy) Float64sX

func (s *MembershipGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*MembershipGroupBy) Int

func (s *MembershipGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*MembershipGroupBy) IntX

func (s *MembershipGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*MembershipGroupBy) Ints

func (s *MembershipGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*MembershipGroupBy) IntsX

func (s *MembershipGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*MembershipGroupBy) Scan

func (mgb *MembershipGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*MembershipGroupBy) ScanX

func (s *MembershipGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*MembershipGroupBy) String

func (s *MembershipGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*MembershipGroupBy) StringX

func (s *MembershipGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*MembershipGroupBy) Strings

func (s *MembershipGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*MembershipGroupBy) StringsX

func (s *MembershipGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type MembershipMutation

type MembershipMutation struct {
	// contains filtered or unexported fields
}

MembershipMutation represents an operation that mutates the Membership nodes in the graph.

func (*MembershipMutation) AddField

func (m *MembershipMutation) 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 (*MembershipMutation) AddedEdges

func (m *MembershipMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*MembershipMutation) AddedField

func (m *MembershipMutation) 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 (*MembershipMutation) AddedFields

func (m *MembershipMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*MembershipMutation) AddedIDs

func (m *MembershipMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*MembershipMutation) ClearEdge

func (m *MembershipMutation) 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 (*MembershipMutation) ClearField

func (m *MembershipMutation) 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 (*MembershipMutation) ClearProject

func (m *MembershipMutation) ClearProject()

ClearProject clears the "project" edge to the Project entity.

func (*MembershipMutation) ClearUser

func (m *MembershipMutation) ClearUser()

ClearUser clears the "user" edge to the User entity.

func (*MembershipMutation) ClearedEdges

func (m *MembershipMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*MembershipMutation) ClearedFields

func (m *MembershipMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (MembershipMutation) Client

func (m MembershipMutation) 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 (*MembershipMutation) EdgeCleared

func (m *MembershipMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*MembershipMutation) Field

func (m *MembershipMutation) 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 (*MembershipMutation) FieldCleared

func (m *MembershipMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*MembershipMutation) Fields

func (m *MembershipMutation) 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 (*MembershipMutation) OldField

func (m *MembershipMutation) 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 (*MembershipMutation) Op

func (m *MembershipMutation) Op() Op

Op returns the operation name.

func (*MembershipMutation) ProjectCleared

func (m *MembershipMutation) ProjectCleared() bool

ProjectCleared reports if the "project" edge to the Project entity was cleared.

func (*MembershipMutation) ProjectID

func (m *MembershipMutation) ProjectID() (r uuid.UUID, exists bool)

ProjectID returns the value of the "project_id" field in the mutation.

func (*MembershipMutation) ProjectIDs

func (m *MembershipMutation) ProjectIDs() (ids []uuid.UUID)

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 (*MembershipMutation) RemovedEdges

func (m *MembershipMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*MembershipMutation) RemovedIDs

func (m *MembershipMutation) 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 (*MembershipMutation) ResetEdge

func (m *MembershipMutation) 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 (*MembershipMutation) ResetField

func (m *MembershipMutation) 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 (*MembershipMutation) ResetProject

func (m *MembershipMutation) ResetProject()

ResetProject resets all changes to the "project" edge.

func (*MembershipMutation) ResetProjectID

func (m *MembershipMutation) ResetProjectID()

ResetProjectID resets all changes to the "project_id" field.

func (*MembershipMutation) ResetRole

func (m *MembershipMutation) ResetRole()

ResetRole resets all changes to the "role" field.

func (*MembershipMutation) ResetUser

func (m *MembershipMutation) ResetUser()

ResetUser resets all changes to the "user" edge.

func (*MembershipMutation) ResetUserID

func (m *MembershipMutation) ResetUserID()

ResetUserID resets all changes to the "user_id" field.

func (*MembershipMutation) Role

func (m *MembershipMutation) Role() (r membership.Role, exists bool)

Role returns the value of the "role" field in the mutation.

func (*MembershipMutation) SetField

func (m *MembershipMutation) 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 (*MembershipMutation) SetOp

func (m *MembershipMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*MembershipMutation) SetProjectID

func (m *MembershipMutation) SetProjectID(u uuid.UUID)

SetProjectID sets the "project_id" field.

func (*MembershipMutation) SetRole

func (m *MembershipMutation) SetRole(value membership.Role)

SetRole sets the "role" field.

func (*MembershipMutation) SetUserID

func (m *MembershipMutation) SetUserID(u uuid.UUID)

SetUserID sets the "user_id" field.

func (MembershipMutation) Tx

func (m MembershipMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*MembershipMutation) Type

func (m *MembershipMutation) Type() string

Type returns the node type of this mutation (Membership).

func (*MembershipMutation) UserCleared

func (m *MembershipMutation) UserCleared() bool

UserCleared reports if the "user" edge to the User entity was cleared.

func (*MembershipMutation) UserID

func (m *MembershipMutation) UserID() (r uuid.UUID, exists bool)

UserID returns the value of the "user_id" field in the mutation.

func (*MembershipMutation) UserIDs

func (m *MembershipMutation) UserIDs() (ids []uuid.UUID)

UserIDs returns the "user" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use UserID instead. It exists only for internal usage by the builders.

func (*MembershipMutation) Where

func (m *MembershipMutation) Where(ps ...predicate.Membership)

Where appends a list predicates to the MembershipMutation builder.

func (*MembershipMutation) WhereP

func (m *MembershipMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the MembershipMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type MembershipQuery

type MembershipQuery struct {
	// contains filtered or unexported fields
}

MembershipQuery is the builder for querying Membership entities.

func (*MembershipQuery) Aggregate

func (mq *MembershipQuery) Aggregate(fns ...AggregateFunc) *MembershipSelect

Aggregate returns a MembershipSelect configured with the given aggregations.

func (*MembershipQuery) All

func (mq *MembershipQuery) All(ctx context.Context) ([]*Membership, error)

All executes the query and returns a list of Memberships.

func (*MembershipQuery) AllX

func (mq *MembershipQuery) AllX(ctx context.Context) []*Membership

AllX is like All, but panics if an error occurs.

func (*MembershipQuery) Clone

func (mq *MembershipQuery) Clone() *MembershipQuery

Clone returns a duplicate of the MembershipQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*MembershipQuery) Count

func (mq *MembershipQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*MembershipQuery) CountX

func (mq *MembershipQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*MembershipQuery) Exist

func (mq *MembershipQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*MembershipQuery) ExistX

func (mq *MembershipQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*MembershipQuery) First

func (mq *MembershipQuery) First(ctx context.Context) (*Membership, error)

First returns the first Membership entity from the query. Returns a *NotFoundError when no Membership was found.

func (*MembershipQuery) FirstX

func (mq *MembershipQuery) FirstX(ctx context.Context) *Membership

FirstX is like First, but panics if an error occurs.

func (*MembershipQuery) GroupBy

func (mq *MembershipQuery) GroupBy(field string, fields ...string) *MembershipGroupBy

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 {
	ProjectID uuid.UUID `json:"project_id,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Membership.Query().
	GroupBy(membership.FieldProjectID).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*MembershipQuery) Limit

func (mq *MembershipQuery) Limit(limit int) *MembershipQuery

Limit the number of records to be returned by this query.

func (*MembershipQuery) Offset

func (mq *MembershipQuery) Offset(offset int) *MembershipQuery

Offset to start from.

func (*MembershipQuery) Only

func (mq *MembershipQuery) Only(ctx context.Context) (*Membership, error)

Only returns a single Membership entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Membership entity is found. Returns a *NotFoundError when no Membership entities are found.

func (*MembershipQuery) OnlyX

func (mq *MembershipQuery) OnlyX(ctx context.Context) *Membership

OnlyX is like Only, but panics if an error occurs.

func (*MembershipQuery) Order

Order specifies how the records should be ordered.

func (*MembershipQuery) QueryProject

func (mq *MembershipQuery) QueryProject() *ProjectQuery

QueryProject chains the current query on the "project" edge.

func (*MembershipQuery) QueryUser

func (mq *MembershipQuery) QueryUser() *UserQuery

QueryUser chains the current query on the "user" edge.

func (*MembershipQuery) Select

func (mq *MembershipQuery) Select(fields ...string) *MembershipSelect

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 {
	ProjectID uuid.UUID `json:"project_id,omitempty"`
}

client.Membership.Query().
	Select(membership.FieldProjectID).
	Scan(ctx, &v)

func (*MembershipQuery) Unique

func (mq *MembershipQuery) Unique(unique bool) *MembershipQuery

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 (*MembershipQuery) Where

Where adds a new predicate for the MembershipQuery builder.

func (*MembershipQuery) WithProject

func (mq *MembershipQuery) WithProject(opts ...func(*ProjectQuery)) *MembershipQuery

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.

func (*MembershipQuery) WithUser

func (mq *MembershipQuery) WithUser(opts ...func(*UserQuery)) *MembershipQuery

WithUser tells the query-builder to eager-load the nodes that are connected to the "user" edge. The optional arguments are used to configure the query builder of the edge.

type MembershipSelect

type MembershipSelect struct {
	*MembershipQuery
	// contains filtered or unexported fields
}

MembershipSelect is the builder for selecting fields of Membership entities.

func (*MembershipSelect) Aggregate

func (ms *MembershipSelect) Aggregate(fns ...AggregateFunc) *MembershipSelect

Aggregate adds the given aggregation functions to the selector query.

func (*MembershipSelect) Bool

func (s *MembershipSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*MembershipSelect) BoolX

func (s *MembershipSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*MembershipSelect) Bools

func (s *MembershipSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*MembershipSelect) BoolsX

func (s *MembershipSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*MembershipSelect) Float64

func (s *MembershipSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*MembershipSelect) Float64X

func (s *MembershipSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*MembershipSelect) Float64s

func (s *MembershipSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*MembershipSelect) Float64sX

func (s *MembershipSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*MembershipSelect) Int

func (s *MembershipSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*MembershipSelect) IntX

func (s *MembershipSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*MembershipSelect) Ints

func (s *MembershipSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*MembershipSelect) IntsX

func (s *MembershipSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*MembershipSelect) Scan

func (ms *MembershipSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*MembershipSelect) ScanX

func (s *MembershipSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*MembershipSelect) String

func (s *MembershipSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*MembershipSelect) StringX

func (s *MembershipSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*MembershipSelect) Strings

func (s *MembershipSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*MembershipSelect) StringsX

func (s *MembershipSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type MembershipUpdate

type MembershipUpdate struct {
	// contains filtered or unexported fields
}

MembershipUpdate is the builder for updating Membership entities.

func (*MembershipUpdate) ClearProject

func (mu *MembershipUpdate) ClearProject() *MembershipUpdate

ClearProject clears the "project" edge to the Project entity.

func (*MembershipUpdate) ClearUser

func (mu *MembershipUpdate) ClearUser() *MembershipUpdate

ClearUser clears the "user" edge to the User entity.

func (*MembershipUpdate) Exec

func (mu *MembershipUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*MembershipUpdate) ExecX

func (mu *MembershipUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*MembershipUpdate) Mutation

func (mu *MembershipUpdate) Mutation() *MembershipMutation

Mutation returns the MembershipMutation object of the builder.

func (*MembershipUpdate) Save

func (mu *MembershipUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*MembershipUpdate) SaveX

func (mu *MembershipUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*MembershipUpdate) SetNillableProjectID

func (mu *MembershipUpdate) SetNillableProjectID(u *uuid.UUID) *MembershipUpdate

SetNillableProjectID sets the "project_id" field if the given value is not nil.

func (*MembershipUpdate) SetNillableRole

func (mu *MembershipUpdate) SetNillableRole(m *membership.Role) *MembershipUpdate

SetNillableRole sets the "role" field if the given value is not nil.

func (*MembershipUpdate) SetNillableUserID

func (mu *MembershipUpdate) SetNillableUserID(u *uuid.UUID) *MembershipUpdate

SetNillableUserID sets the "user_id" field if the given value is not nil.

func (*MembershipUpdate) SetProject

func (mu *MembershipUpdate) SetProject(p *Project) *MembershipUpdate

SetProject sets the "project" edge to the Project entity.

func (*MembershipUpdate) SetProjectID

func (mu *MembershipUpdate) SetProjectID(u uuid.UUID) *MembershipUpdate

SetProjectID sets the "project_id" field.

func (*MembershipUpdate) SetRole

SetRole sets the "role" field.

func (*MembershipUpdate) SetUser

func (mu *MembershipUpdate) SetUser(u *User) *MembershipUpdate

SetUser sets the "user" edge to the User entity.

func (*MembershipUpdate) SetUserID

func (mu *MembershipUpdate) SetUserID(u uuid.UUID) *MembershipUpdate

SetUserID sets the "user_id" field.

func (*MembershipUpdate) Where

Where appends a list predicates to the MembershipUpdate builder.

type MembershipUpdateOne

type MembershipUpdateOne struct {
	// contains filtered or unexported fields
}

MembershipUpdateOne is the builder for updating a single Membership entity.

func (*MembershipUpdateOne) ClearProject

func (muo *MembershipUpdateOne) ClearProject() *MembershipUpdateOne

ClearProject clears the "project" edge to the Project entity.

func (*MembershipUpdateOne) ClearUser

func (muo *MembershipUpdateOne) ClearUser() *MembershipUpdateOne

ClearUser clears the "user" edge to the User entity.

func (*MembershipUpdateOne) Exec

func (muo *MembershipUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*MembershipUpdateOne) ExecX

func (muo *MembershipUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*MembershipUpdateOne) Mutation

func (muo *MembershipUpdateOne) Mutation() *MembershipMutation

Mutation returns the MembershipMutation object of the builder.

func (*MembershipUpdateOne) Save

func (muo *MembershipUpdateOne) Save(ctx context.Context) (*Membership, error)

Save executes the query and returns the updated Membership entity.

func (*MembershipUpdateOne) SaveX

func (muo *MembershipUpdateOne) SaveX(ctx context.Context) *Membership

SaveX is like Save, but panics if an error occurs.

func (*MembershipUpdateOne) Select

func (muo *MembershipUpdateOne) Select(field string, fields ...string) *MembershipUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*MembershipUpdateOne) SetNillableProjectID

func (muo *MembershipUpdateOne) SetNillableProjectID(u *uuid.UUID) *MembershipUpdateOne

SetNillableProjectID sets the "project_id" field if the given value is not nil.

func (*MembershipUpdateOne) SetNillableRole

func (muo *MembershipUpdateOne) SetNillableRole(m *membership.Role) *MembershipUpdateOne

SetNillableRole sets the "role" field if the given value is not nil.

func (*MembershipUpdateOne) SetNillableUserID

func (muo *MembershipUpdateOne) SetNillableUserID(u *uuid.UUID) *MembershipUpdateOne

SetNillableUserID sets the "user_id" field if the given value is not nil.

func (*MembershipUpdateOne) SetProject

func (muo *MembershipUpdateOne) SetProject(p *Project) *MembershipUpdateOne

SetProject sets the "project" edge to the Project entity.

func (*MembershipUpdateOne) SetProjectID

func (muo *MembershipUpdateOne) SetProjectID(u uuid.UUID) *MembershipUpdateOne

SetProjectID sets the "project_id" field.

func (*MembershipUpdateOne) SetRole

SetRole sets the "role" field.

func (*MembershipUpdateOne) SetUser

func (muo *MembershipUpdateOne) SetUser(u *User) *MembershipUpdateOne

SetUser sets the "user" edge to the User entity.

func (*MembershipUpdateOne) SetUserID

func (muo *MembershipUpdateOne) SetUserID(u uuid.UUID) *MembershipUpdateOne

SetUserID sets the "user_id" field.

func (*MembershipUpdateOne) Where

Where appends a list predicates to the MembershipUpdate builder.

type Memberships

type Memberships []*Membership

Memberships is a parsable slice of Membership.

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 uuid.UUID `json:"id,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// UpdatedAt holds the value of the "updated_at" field.
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// The name of the project
	Name string `json:"name,omitempty"`
	// The quota for number of CPU cores
	QuotaCPU int `json:"quota_cpu,omitempty"`
	// The current usage for number of CPU cores
	UsageCPU int `json:"usage_cpu,omitempty"`
	// The quota for total RAM usage (MiB)
	QuotaRAM int `json:"quota_ram,omitempty"`
	// The current usage for total RAM usage (MiB)
	UsageRAM int `json:"usage_ram,omitempty"`
	// The quota for total disk usage (MiB)
	QuotaDisk int `json:"quota_disk,omitempty"`
	// The current usage for total disk usage (MiB)
	UsageDisk int `json:"usage_disk,omitempty"`
	// The quota for number of networks
	QuotaNetwork int `json:"quota_network,omitempty"`
	// The current usage for number of networks
	UsageNetwork int `json:"usage_network,omitempty"`
	// The quota for number of routers
	QuotaRouter int `json:"quota_router,omitempty"`
	// The current usage for number of routers
	UsageRouter int `json:"usage_router,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) QueryBlueprints

func (pr *Project) QueryBlueprints() *BlueprintQuery

QueryBlueprints queries the "blueprints" edge of the Project entity.

func (*Project) QueryDeployments

func (pr *Project) QueryDeployments() *DeploymentQuery

QueryDeployments queries the "deployments" edge of the Project entity.

func (*Project) QueryGroupMembers

func (pr *Project) QueryGroupMembers() *GroupQuery

QueryGroupMembers queries the "group_members" edge of the Project entity.

func (*Project) QueryGroupMemberships

func (pr *Project) QueryGroupMemberships() *GroupMembershipQuery

QueryGroupMemberships queries the "group_memberships" edge of the Project entity.

func (*Project) QueryMembers

func (pr *Project) QueryMembers() *UserQuery

QueryMembers queries the "members" edge of the Project entity.

func (*Project) QueryMemberships

func (pr *Project) QueryMemberships() *MembershipQuery

QueryMemberships queries the "memberships" 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 uuid.UUID) *ProjectDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*ProjectClient) Get

func (c *ProjectClient) Get(ctx context.Context, id uuid.UUID) (*Project, error)

Get returns a Project entity by its id.

func (*ProjectClient) GetX

func (c *ProjectClient) GetX(ctx context.Context, id uuid.UUID) *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) QueryBlueprints

func (c *ProjectClient) QueryBlueprints(pr *Project) *BlueprintQuery

QueryBlueprints queries the blueprints edge of a Project.

func (*ProjectClient) QueryDeployments

func (c *ProjectClient) QueryDeployments(pr *Project) *DeploymentQuery

QueryDeployments queries the deployments edge of a Project.

func (*ProjectClient) QueryGroupMembers

func (c *ProjectClient) QueryGroupMembers(pr *Project) *GroupQuery

QueryGroupMembers queries the group_members edge of a Project.

func (*ProjectClient) QueryGroupMemberships

func (c *ProjectClient) QueryGroupMemberships(pr *Project) *GroupMembershipQuery

QueryGroupMemberships queries the group_memberships edge of a Project.

func (*ProjectClient) QueryMembers

func (c *ProjectClient) QueryMembers(pr *Project) *UserQuery

QueryMembers queries the members edge of a Project.

func (*ProjectClient) QueryMemberships

func (c *ProjectClient) QueryMemberships(pr *Project) *MembershipQuery

QueryMemberships queries the memberships 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 uuid.UUID) *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) AddBlueprintIDs

func (pc *ProjectCreate) AddBlueprintIDs(ids ...uuid.UUID) *ProjectCreate

AddBlueprintIDs adds the "blueprints" edge to the Blueprint entity by IDs.

func (*ProjectCreate) AddBlueprints

func (pc *ProjectCreate) AddBlueprints(b ...*Blueprint) *ProjectCreate

AddBlueprints adds the "blueprints" edges to the Blueprint entity.

func (*ProjectCreate) AddDeploymentIDs

func (pc *ProjectCreate) AddDeploymentIDs(ids ...uuid.UUID) *ProjectCreate

AddDeploymentIDs adds the "deployments" edge to the Deployment entity by IDs.

func (*ProjectCreate) AddDeployments

func (pc *ProjectCreate) AddDeployments(d ...*Deployment) *ProjectCreate

AddDeployments adds the "deployments" edges to the Deployment entity.

func (*ProjectCreate) AddGroupMemberIDs

func (pc *ProjectCreate) AddGroupMemberIDs(ids ...uuid.UUID) *ProjectCreate

AddGroupMemberIDs adds the "group_members" edge to the Group entity by IDs.

func (*ProjectCreate) AddGroupMembers

func (pc *ProjectCreate) AddGroupMembers(g ...*Group) *ProjectCreate

AddGroupMembers adds the "group_members" edges to the Group entity.

func (*ProjectCreate) AddMemberIDs

func (pc *ProjectCreate) AddMemberIDs(ids ...uuid.UUID) *ProjectCreate

AddMemberIDs adds the "members" edge to the User entity by IDs.

func (*ProjectCreate) AddMembers

func (pc *ProjectCreate) AddMembers(u ...*User) *ProjectCreate

AddMembers adds the "members" edges to the User entity.

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) SetCreatedAt

func (pc *ProjectCreate) SetCreatedAt(t time.Time) *ProjectCreate

SetCreatedAt sets the "created_at" field.

func (*ProjectCreate) SetID

func (pc *ProjectCreate) SetID(u uuid.UUID) *ProjectCreate

SetID sets the "id" field.

func (*ProjectCreate) SetName

func (pc *ProjectCreate) SetName(s string) *ProjectCreate

SetName sets the "name" field.

func (*ProjectCreate) SetNillableCreatedAt

func (pc *ProjectCreate) SetNillableCreatedAt(t *time.Time) *ProjectCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*ProjectCreate) SetNillableID

func (pc *ProjectCreate) SetNillableID(u *uuid.UUID) *ProjectCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*ProjectCreate) SetNillableUpdatedAt

func (pc *ProjectCreate) SetNillableUpdatedAt(t *time.Time) *ProjectCreate

SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.

func (*ProjectCreate) SetNillableUsageCPU

func (pc *ProjectCreate) SetNillableUsageCPU(i *int) *ProjectCreate

SetNillableUsageCPU sets the "usage_cpu" field if the given value is not nil.

func (*ProjectCreate) SetNillableUsageDisk

func (pc *ProjectCreate) SetNillableUsageDisk(i *int) *ProjectCreate

SetNillableUsageDisk sets the "usage_disk" field if the given value is not nil.

func (*ProjectCreate) SetNillableUsageNetwork

func (pc *ProjectCreate) SetNillableUsageNetwork(i *int) *ProjectCreate

SetNillableUsageNetwork sets the "usage_network" field if the given value is not nil.

func (*ProjectCreate) SetNillableUsageRAM

func (pc *ProjectCreate) SetNillableUsageRAM(i *int) *ProjectCreate

SetNillableUsageRAM sets the "usage_ram" field if the given value is not nil.

func (*ProjectCreate) SetNillableUsageRouter

func (pc *ProjectCreate) SetNillableUsageRouter(i *int) *ProjectCreate

SetNillableUsageRouter sets the "usage_router" field if the given value is not nil.

func (*ProjectCreate) SetQuotaCPU

func (pc *ProjectCreate) SetQuotaCPU(i int) *ProjectCreate

SetQuotaCPU sets the "quota_cpu" field.

func (*ProjectCreate) SetQuotaDisk

func (pc *ProjectCreate) SetQuotaDisk(i int) *ProjectCreate

SetQuotaDisk sets the "quota_disk" field.

func (*ProjectCreate) SetQuotaNetwork

func (pc *ProjectCreate) SetQuotaNetwork(i int) *ProjectCreate

SetQuotaNetwork sets the "quota_network" field.

func (*ProjectCreate) SetQuotaRAM

func (pc *ProjectCreate) SetQuotaRAM(i int) *ProjectCreate

SetQuotaRAM sets the "quota_ram" field.

func (*ProjectCreate) SetQuotaRouter

func (pc *ProjectCreate) SetQuotaRouter(i int) *ProjectCreate

SetQuotaRouter sets the "quota_router" field.

func (*ProjectCreate) SetUpdatedAt

func (pc *ProjectCreate) SetUpdatedAt(t time.Time) *ProjectCreate

SetUpdatedAt sets the "updated_at" field.

func (*ProjectCreate) SetUsageCPU

func (pc *ProjectCreate) SetUsageCPU(i int) *ProjectCreate

SetUsageCPU sets the "usage_cpu" field.

func (*ProjectCreate) SetUsageDisk

func (pc *ProjectCreate) SetUsageDisk(i int) *ProjectCreate

SetUsageDisk sets the "usage_disk" field.

func (*ProjectCreate) SetUsageNetwork

func (pc *ProjectCreate) SetUsageNetwork(i int) *ProjectCreate

SetUsageNetwork sets the "usage_network" field.

func (*ProjectCreate) SetUsageRAM

func (pc *ProjectCreate) SetUsageRAM(i int) *ProjectCreate

SetUsageRAM sets the "usage_ram" field.

func (*ProjectCreate) SetUsageRouter

func (pc *ProjectCreate) SetUsageRouter(i int) *ProjectCreate

SetUsageRouter sets the "usage_router" 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 {
	// Users who have access to this project
	Members []*User `json:"members,omitempty"`
	// Groups who have access to this project
	GroupMembers []*Group `json:"group_members,omitempty"`
	// Blueprints which belong to this project
	Blueprints []*Blueprint `json:"blueprints,omitempty"`
	// Deployments which belong to this project
	Deployments []*Deployment `json:"deployments,omitempty"`
	// Memberships holds the value of the memberships edge.
	Memberships []*Membership `json:"memberships,omitempty"`
	// GroupMemberships holds the value of the group_memberships edge.
	GroupMemberships []*GroupMembership `json:"group_memberships,omitempty"`
	// contains filtered or unexported fields
}

ProjectEdges holds the relations/edges for other nodes in the graph.

func (ProjectEdges) BlueprintsOrErr

func (e ProjectEdges) BlueprintsOrErr() ([]*Blueprint, error)

BlueprintsOrErr returns the Blueprints value or an error if the edge was not loaded in eager-loading.

func (ProjectEdges) DeploymentsOrErr

func (e ProjectEdges) DeploymentsOrErr() ([]*Deployment, error)

DeploymentsOrErr returns the Deployments value or an error if the edge was not loaded in eager-loading.

func (ProjectEdges) GroupMembersOrErr

func (e ProjectEdges) GroupMembersOrErr() ([]*Group, error)

GroupMembersOrErr returns the GroupMembers value or an error if the edge was not loaded in eager-loading.

func (ProjectEdges) GroupMembershipsOrErr

func (e ProjectEdges) GroupMembershipsOrErr() ([]*GroupMembership, error)

GroupMembershipsOrErr returns the GroupMemberships value or an error if the edge was not loaded in eager-loading.

func (ProjectEdges) MembersOrErr

func (e ProjectEdges) MembersOrErr() ([]*User, error)

MembersOrErr returns the Members value or an error if the edge was not loaded in eager-loading.

func (ProjectEdges) MembershipsOrErr

func (e ProjectEdges) MembershipsOrErr() ([]*Membership, error)

MembershipsOrErr returns the Memberships 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) AddBlueprintIDs

func (m *ProjectMutation) AddBlueprintIDs(ids ...uuid.UUID)

AddBlueprintIDs adds the "blueprints" edge to the Blueprint entity by ids.

func (*ProjectMutation) AddDeploymentIDs

func (m *ProjectMutation) AddDeploymentIDs(ids ...uuid.UUID)

AddDeploymentIDs adds the "deployments" edge to the Deployment entity by ids.

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) AddGroupMemberIDs

func (m *ProjectMutation) AddGroupMemberIDs(ids ...uuid.UUID)

AddGroupMemberIDs adds the "group_members" edge to the Group entity by ids.

func (*ProjectMutation) AddMemberIDs

func (m *ProjectMutation) AddMemberIDs(ids ...uuid.UUID)

AddMemberIDs adds the "members" edge to the User entity by ids.

func (*ProjectMutation) AddQuotaCPU

func (m *ProjectMutation) AddQuotaCPU(i int)

AddQuotaCPU adds i to the "quota_cpu" field.

func (*ProjectMutation) AddQuotaDisk

func (m *ProjectMutation) AddQuotaDisk(i int)

AddQuotaDisk adds i to the "quota_disk" field.

func (*ProjectMutation) AddQuotaNetwork

func (m *ProjectMutation) AddQuotaNetwork(i int)

AddQuotaNetwork adds i to the "quota_network" field.

func (*ProjectMutation) AddQuotaRAM

func (m *ProjectMutation) AddQuotaRAM(i int)

AddQuotaRAM adds i to the "quota_ram" field.

func (*ProjectMutation) AddQuotaRouter

func (m *ProjectMutation) AddQuotaRouter(i int)

AddQuotaRouter adds i to the "quota_router" field.

func (*ProjectMutation) AddUsageCPU

func (m *ProjectMutation) AddUsageCPU(i int)

AddUsageCPU adds i to the "usage_cpu" field.

func (*ProjectMutation) AddUsageDisk

func (m *ProjectMutation) AddUsageDisk(i int)

AddUsageDisk adds i to the "usage_disk" field.

func (*ProjectMutation) AddUsageNetwork

func (m *ProjectMutation) AddUsageNetwork(i int)

AddUsageNetwork adds i to the "usage_network" field.

func (*ProjectMutation) AddUsageRAM

func (m *ProjectMutation) AddUsageRAM(i int)

AddUsageRAM adds i to the "usage_ram" field.

func (*ProjectMutation) AddUsageRouter

func (m *ProjectMutation) AddUsageRouter(i int)

AddUsageRouter adds i to the "usage_router" field.

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) AddedQuotaCPU

func (m *ProjectMutation) AddedQuotaCPU() (r int, exists bool)

AddedQuotaCPU returns the value that was added to the "quota_cpu" field in this mutation.

func (*ProjectMutation) AddedQuotaDisk

func (m *ProjectMutation) AddedQuotaDisk() (r int, exists bool)

AddedQuotaDisk returns the value that was added to the "quota_disk" field in this mutation.

func (*ProjectMutation) AddedQuotaNetwork

func (m *ProjectMutation) AddedQuotaNetwork() (r int, exists bool)

AddedQuotaNetwork returns the value that was added to the "quota_network" field in this mutation.

func (*ProjectMutation) AddedQuotaRAM

func (m *ProjectMutation) AddedQuotaRAM() (r int, exists bool)

AddedQuotaRAM returns the value that was added to the "quota_ram" field in this mutation.

func (*ProjectMutation) AddedQuotaRouter

func (m *ProjectMutation) AddedQuotaRouter() (r int, exists bool)

AddedQuotaRouter returns the value that was added to the "quota_router" field in this mutation.

func (*ProjectMutation) AddedUsageCPU

func (m *ProjectMutation) AddedUsageCPU() (r int, exists bool)

AddedUsageCPU returns the value that was added to the "usage_cpu" field in this mutation.

func (*ProjectMutation) AddedUsageDisk

func (m *ProjectMutation) AddedUsageDisk() (r int, exists bool)

AddedUsageDisk returns the value that was added to the "usage_disk" field in this mutation.

func (*ProjectMutation) AddedUsageNetwork

func (m *ProjectMutation) AddedUsageNetwork() (r int, exists bool)

AddedUsageNetwork returns the value that was added to the "usage_network" field in this mutation.

func (*ProjectMutation) AddedUsageRAM

func (m *ProjectMutation) AddedUsageRAM() (r int, exists bool)

AddedUsageRAM returns the value that was added to the "usage_ram" field in this mutation.

func (*ProjectMutation) AddedUsageRouter

func (m *ProjectMutation) AddedUsageRouter() (r int, exists bool)

AddedUsageRouter returns the value that was added to the "usage_router" field in this mutation.

func (*ProjectMutation) BlueprintsCleared

func (m *ProjectMutation) BlueprintsCleared() bool

BlueprintsCleared reports if the "blueprints" edge to the Blueprint entity was cleared.

func (*ProjectMutation) BlueprintsIDs

func (m *ProjectMutation) BlueprintsIDs() (ids []uuid.UUID)

BlueprintsIDs returns the "blueprints" edge IDs in the mutation.

func (*ProjectMutation) ClearBlueprints

func (m *ProjectMutation) ClearBlueprints()

ClearBlueprints clears the "blueprints" edge to the Blueprint entity.

func (*ProjectMutation) ClearDeployments

func (m *ProjectMutation) ClearDeployments()

ClearDeployments clears the "deployments" edge to the Deployment entity.

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) ClearGroupMembers

func (m *ProjectMutation) ClearGroupMembers()

ClearGroupMembers clears the "group_members" edge to the Group entity.

func (*ProjectMutation) ClearMembers

func (m *ProjectMutation) ClearMembers()

ClearMembers clears the "members" edge to the User 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) CreatedAt

func (m *ProjectMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*ProjectMutation) DeploymentsCleared

func (m *ProjectMutation) DeploymentsCleared() bool

DeploymentsCleared reports if the "deployments" edge to the Deployment entity was cleared.

func (*ProjectMutation) DeploymentsIDs

func (m *ProjectMutation) DeploymentsIDs() (ids []uuid.UUID)

DeploymentsIDs returns the "deployments" edge IDs 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) GroupMembersCleared

func (m *ProjectMutation) GroupMembersCleared() bool

GroupMembersCleared reports if the "group_members" edge to the Group entity was cleared.

func (*ProjectMutation) GroupMembersIDs

func (m *ProjectMutation) GroupMembersIDs() (ids []uuid.UUID)

GroupMembersIDs returns the "group_members" edge IDs in the mutation.

func (*ProjectMutation) ID

func (m *ProjectMutation) ID() (id uuid.UUID, 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) ([]uuid.UUID, 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) MembersCleared

func (m *ProjectMutation) MembersCleared() bool

MembersCleared reports if the "members" edge to the User entity was cleared.

func (*ProjectMutation) MembersIDs

func (m *ProjectMutation) MembersIDs() (ids []uuid.UUID)

MembersIDs returns the "members" edge IDs in the mutation.

func (*ProjectMutation) Name

func (m *ProjectMutation) Name() (r string, exists bool)

Name returns the value of the "name" field in the mutation.

func (*ProjectMutation) OldCreatedAt

func (m *ProjectMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

OldCreatedAt returns the old "created_at" 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) OldName

func (m *ProjectMutation) OldName(ctx context.Context) (v string, err error)

OldName returns the old "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) OldQuotaCPU

func (m *ProjectMutation) OldQuotaCPU(ctx context.Context) (v int, err error)

OldQuotaCPU returns the old "quota_cpu" 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) OldQuotaDisk

func (m *ProjectMutation) OldQuotaDisk(ctx context.Context) (v int, err error)

OldQuotaDisk returns the old "quota_disk" 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) OldQuotaNetwork

func (m *ProjectMutation) OldQuotaNetwork(ctx context.Context) (v int, err error)

OldQuotaNetwork returns the old "quota_network" 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) OldQuotaRAM

func (m *ProjectMutation) OldQuotaRAM(ctx context.Context) (v int, err error)

OldQuotaRAM returns the old "quota_ram" 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) OldQuotaRouter

func (m *ProjectMutation) OldQuotaRouter(ctx context.Context) (v int, err error)

OldQuotaRouter returns the old "quota_router" 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) OldUpdatedAt

func (m *ProjectMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)

OldUpdatedAt returns the old "updated_at" 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) OldUsageCPU

func (m *ProjectMutation) OldUsageCPU(ctx context.Context) (v int, err error)

OldUsageCPU returns the old "usage_cpu" 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) OldUsageDisk

func (m *ProjectMutation) OldUsageDisk(ctx context.Context) (v int, err error)

OldUsageDisk returns the old "usage_disk" 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) OldUsageNetwork

func (m *ProjectMutation) OldUsageNetwork(ctx context.Context) (v int, err error)

OldUsageNetwork returns the old "usage_network" 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) OldUsageRAM

func (m *ProjectMutation) OldUsageRAM(ctx context.Context) (v int, err error)

OldUsageRAM returns the old "usage_ram" 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) OldUsageRouter

func (m *ProjectMutation) OldUsageRouter(ctx context.Context) (v int, err error)

OldUsageRouter returns the old "usage_router" 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) QuotaCPU

func (m *ProjectMutation) QuotaCPU() (r int, exists bool)

QuotaCPU returns the value of the "quota_cpu" field in the mutation.

func (*ProjectMutation) QuotaDisk

func (m *ProjectMutation) QuotaDisk() (r int, exists bool)

QuotaDisk returns the value of the "quota_disk" field in the mutation.

func (*ProjectMutation) QuotaNetwork

func (m *ProjectMutation) QuotaNetwork() (r int, exists bool)

QuotaNetwork returns the value of the "quota_network" field in the mutation.

func (*ProjectMutation) QuotaRAM

func (m *ProjectMutation) QuotaRAM() (r int, exists bool)

QuotaRAM returns the value of the "quota_ram" field in the mutation.

func (*ProjectMutation) QuotaRouter

func (m *ProjectMutation) QuotaRouter() (r int, exists bool)

QuotaRouter returns the value of the "quota_router" field in the mutation.

func (*ProjectMutation) RemoveBlueprintIDs

func (m *ProjectMutation) RemoveBlueprintIDs(ids ...uuid.UUID)

RemoveBlueprintIDs removes the "blueprints" edge to the Blueprint entity by IDs.

func (*ProjectMutation) RemoveDeploymentIDs

func (m *ProjectMutation) RemoveDeploymentIDs(ids ...uuid.UUID)

RemoveDeploymentIDs removes the "deployments" edge to the Deployment entity by IDs.

func (*ProjectMutation) RemoveGroupMemberIDs

func (m *ProjectMutation) RemoveGroupMemberIDs(ids ...uuid.UUID)

RemoveGroupMemberIDs removes the "group_members" edge to the Group entity by IDs.

func (*ProjectMutation) RemoveMemberIDs

func (m *ProjectMutation) RemoveMemberIDs(ids ...uuid.UUID)

RemoveMemberIDs removes the "members" edge to the User entity by IDs.

func (*ProjectMutation) RemovedBlueprintsIDs

func (m *ProjectMutation) RemovedBlueprintsIDs() (ids []uuid.UUID)

RemovedBlueprints returns the removed IDs of the "blueprints" edge to the Blueprint entity.

func (*ProjectMutation) RemovedDeploymentsIDs

func (m *ProjectMutation) RemovedDeploymentsIDs() (ids []uuid.UUID)

RemovedDeployments returns the removed IDs of the "deployments" edge to the Deployment entity.

func (*ProjectMutation) RemovedEdges

func (m *ProjectMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*ProjectMutation) RemovedGroupMembersIDs

func (m *ProjectMutation) RemovedGroupMembersIDs() (ids []uuid.UUID)

RemovedGroupMembers returns the removed IDs of the "group_members" edge to the Group entity.

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) RemovedMembersIDs

func (m *ProjectMutation) RemovedMembersIDs() (ids []uuid.UUID)

RemovedMembers returns the removed IDs of the "members" edge to the User entity.

func (*ProjectMutation) ResetBlueprints

func (m *ProjectMutation) ResetBlueprints()

ResetBlueprints resets all changes to the "blueprints" edge.

func (*ProjectMutation) ResetCreatedAt

func (m *ProjectMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*ProjectMutation) ResetDeployments

func (m *ProjectMutation) ResetDeployments()

ResetDeployments resets all changes to the "deployments" edge.

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) ResetGroupMembers

func (m *ProjectMutation) ResetGroupMembers()

ResetGroupMembers resets all changes to the "group_members" edge.

func (*ProjectMutation) ResetMembers

func (m *ProjectMutation) ResetMembers()

ResetMembers resets all changes to the "members" edge.

func (*ProjectMutation) ResetName

func (m *ProjectMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*ProjectMutation) ResetQuotaCPU

func (m *ProjectMutation) ResetQuotaCPU()

ResetQuotaCPU resets all changes to the "quota_cpu" field.

func (*ProjectMutation) ResetQuotaDisk

func (m *ProjectMutation) ResetQuotaDisk()

ResetQuotaDisk resets all changes to the "quota_disk" field.

func (*ProjectMutation) ResetQuotaNetwork

func (m *ProjectMutation) ResetQuotaNetwork()

ResetQuotaNetwork resets all changes to the "quota_network" field.

func (*ProjectMutation) ResetQuotaRAM

func (m *ProjectMutation) ResetQuotaRAM()

ResetQuotaRAM resets all changes to the "quota_ram" field.

func (*ProjectMutation) ResetQuotaRouter

func (m *ProjectMutation) ResetQuotaRouter()

ResetQuotaRouter resets all changes to the "quota_router" field.

func (*ProjectMutation) ResetUpdatedAt

func (m *ProjectMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*ProjectMutation) ResetUsageCPU

func (m *ProjectMutation) ResetUsageCPU()

ResetUsageCPU resets all changes to the "usage_cpu" field.

func (*ProjectMutation) ResetUsageDisk

func (m *ProjectMutation) ResetUsageDisk()

ResetUsageDisk resets all changes to the "usage_disk" field.

func (*ProjectMutation) ResetUsageNetwork

func (m *ProjectMutation) ResetUsageNetwork()

ResetUsageNetwork resets all changes to the "usage_network" field.

func (*ProjectMutation) ResetUsageRAM

func (m *ProjectMutation) ResetUsageRAM()

ResetUsageRAM resets all changes to the "usage_ram" field.

func (*ProjectMutation) ResetUsageRouter

func (m *ProjectMutation) ResetUsageRouter()

ResetUsageRouter resets all changes to the "usage_router" field.

func (*ProjectMutation) SetCreatedAt

func (m *ProjectMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" 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) SetID

func (m *ProjectMutation) SetID(id uuid.UUID)

SetID sets the value of the id field. Note that this operation is only accepted on creation of Project entities.

func (*ProjectMutation) SetName

func (m *ProjectMutation) SetName(s string)

SetName sets the "name" field.

func (*ProjectMutation) SetOp

func (m *ProjectMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*ProjectMutation) SetQuotaCPU

func (m *ProjectMutation) SetQuotaCPU(i int)

SetQuotaCPU sets the "quota_cpu" field.

func (*ProjectMutation) SetQuotaDisk

func (m *ProjectMutation) SetQuotaDisk(i int)

SetQuotaDisk sets the "quota_disk" field.

func (*ProjectMutation) SetQuotaNetwork

func (m *ProjectMutation) SetQuotaNetwork(i int)

SetQuotaNetwork sets the "quota_network" field.

func (*ProjectMutation) SetQuotaRAM

func (m *ProjectMutation) SetQuotaRAM(i int)

SetQuotaRAM sets the "quota_ram" field.

func (*ProjectMutation) SetQuotaRouter

func (m *ProjectMutation) SetQuotaRouter(i int)

SetQuotaRouter sets the "quota_router" field.

func (*ProjectMutation) SetUpdatedAt

func (m *ProjectMutation) SetUpdatedAt(t time.Time)

SetUpdatedAt sets the "updated_at" field.

func (*ProjectMutation) SetUsageCPU

func (m *ProjectMutation) SetUsageCPU(i int)

SetUsageCPU sets the "usage_cpu" field.

func (*ProjectMutation) SetUsageDisk

func (m *ProjectMutation) SetUsageDisk(i int)

SetUsageDisk sets the "usage_disk" field.

func (*ProjectMutation) SetUsageNetwork

func (m *ProjectMutation) SetUsageNetwork(i int)

SetUsageNetwork sets the "usage_network" field.

func (*ProjectMutation) SetUsageRAM

func (m *ProjectMutation) SetUsageRAM(i int)

SetUsageRAM sets the "usage_ram" field.

func (*ProjectMutation) SetUsageRouter

func (m *ProjectMutation) SetUsageRouter(i int)

SetUsageRouter sets the "usage_router" 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) UpdatedAt

func (m *ProjectMutation) UpdatedAt() (r time.Time, exists bool)

UpdatedAt returns the value of the "updated_at" field in the mutation.

func (*ProjectMutation) UsageCPU

func (m *ProjectMutation) UsageCPU() (r int, exists bool)

UsageCPU returns the value of the "usage_cpu" field in the mutation.

func (*ProjectMutation) UsageDisk

func (m *ProjectMutation) UsageDisk() (r int, exists bool)

UsageDisk returns the value of the "usage_disk" field in the mutation.

func (*ProjectMutation) UsageNetwork

func (m *ProjectMutation) UsageNetwork() (r int, exists bool)

UsageNetwork returns the value of the "usage_network" field in the mutation.

func (*ProjectMutation) UsageRAM

func (m *ProjectMutation) UsageRAM() (r int, exists bool)

UsageRAM returns the value of the "usage_ram" field in the mutation.

func (*ProjectMutation) UsageRouter

func (m *ProjectMutation) UsageRouter() (r int, exists bool)

UsageRouter returns the value of the "usage_router" 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 uuid.UUID, 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) uuid.UUID

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 {
	CreatedAt time.Time `json:"created_at,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Project.Query().
	GroupBy(project.FieldCreatedAt).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*ProjectQuery) IDs

func (pq *ProjectQuery) IDs(ctx context.Context) (ids []uuid.UUID, err error)

IDs executes the query and returns a list of Project IDs.

func (*ProjectQuery) IDsX

func (pq *ProjectQuery) IDsX(ctx context.Context) []uuid.UUID

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 uuid.UUID, 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) uuid.UUID

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) QueryBlueprints

func (pq *ProjectQuery) QueryBlueprints() *BlueprintQuery

QueryBlueprints chains the current query on the "blueprints" edge.

func (*ProjectQuery) QueryDeployments

func (pq *ProjectQuery) QueryDeployments() *DeploymentQuery

QueryDeployments chains the current query on the "deployments" edge.

func (*ProjectQuery) QueryGroupMembers

func (pq *ProjectQuery) QueryGroupMembers() *GroupQuery

QueryGroupMembers chains the current query on the "group_members" edge.

func (*ProjectQuery) QueryGroupMemberships

func (pq *ProjectQuery) QueryGroupMemberships() *GroupMembershipQuery

QueryGroupMemberships chains the current query on the "group_memberships" edge.

func (*ProjectQuery) QueryMembers

func (pq *ProjectQuery) QueryMembers() *UserQuery

QueryMembers chains the current query on the "members" edge.

func (*ProjectQuery) QueryMemberships

func (pq *ProjectQuery) QueryMemberships() *MembershipQuery

QueryMemberships chains the current query on the "memberships" 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 {
	CreatedAt time.Time `json:"created_at,omitempty"`
}

client.Project.Query().
	Select(project.FieldCreatedAt).
	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) WithBlueprints

func (pq *ProjectQuery) WithBlueprints(opts ...func(*BlueprintQuery)) *ProjectQuery

WithBlueprints tells the query-builder to eager-load the nodes that are connected to the "blueprints" edge. The optional arguments are used to configure the query builder of the edge.

func (*ProjectQuery) WithDeployments

func (pq *ProjectQuery) WithDeployments(opts ...func(*DeploymentQuery)) *ProjectQuery

WithDeployments tells the query-builder to eager-load the nodes that are connected to the "deployments" edge. The optional arguments are used to configure the query builder of the edge.

func (*ProjectQuery) WithGroupMembers

func (pq *ProjectQuery) WithGroupMembers(opts ...func(*GroupQuery)) *ProjectQuery

WithGroupMembers tells the query-builder to eager-load the nodes that are connected to the "group_members" edge. The optional arguments are used to configure the query builder of the edge.

func (*ProjectQuery) WithGroupMemberships

func (pq *ProjectQuery) WithGroupMemberships(opts ...func(*GroupMembershipQuery)) *ProjectQuery

WithGroupMemberships tells the query-builder to eager-load the nodes that are connected to the "group_memberships" edge. The optional arguments are used to configure the query builder of the edge.

func (*ProjectQuery) WithMembers

func (pq *ProjectQuery) WithMembers(opts ...func(*UserQuery)) *ProjectQuery

WithMembers tells the query-builder to eager-load the nodes that are connected to the "members" edge. The optional arguments are used to configure the query builder of the edge.

func (*ProjectQuery) WithMemberships

func (pq *ProjectQuery) WithMemberships(opts ...func(*MembershipQuery)) *ProjectQuery

WithMemberships tells the query-builder to eager-load the nodes that are connected to the "memberships" 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) AddBlueprintIDs

func (pu *ProjectUpdate) AddBlueprintIDs(ids ...uuid.UUID) *ProjectUpdate

AddBlueprintIDs adds the "blueprints" edge to the Blueprint entity by IDs.

func (*ProjectUpdate) AddBlueprints

func (pu *ProjectUpdate) AddBlueprints(b ...*Blueprint) *ProjectUpdate

AddBlueprints adds the "blueprints" edges to the Blueprint entity.

func (*ProjectUpdate) AddDeploymentIDs

func (pu *ProjectUpdate) AddDeploymentIDs(ids ...uuid.UUID) *ProjectUpdate

AddDeploymentIDs adds the "deployments" edge to the Deployment entity by IDs.

func (*ProjectUpdate) AddDeployments

func (pu *ProjectUpdate) AddDeployments(d ...*Deployment) *ProjectUpdate

AddDeployments adds the "deployments" edges to the Deployment entity.

func (*ProjectUpdate) AddGroupMemberIDs

func (pu *ProjectUpdate) AddGroupMemberIDs(ids ...uuid.UUID) *ProjectUpdate

AddGroupMemberIDs adds the "group_members" edge to the Group entity by IDs.

func (*ProjectUpdate) AddGroupMembers

func (pu *ProjectUpdate) AddGroupMembers(g ...*Group) *ProjectUpdate

AddGroupMembers adds the "group_members" edges to the Group entity.

func (*ProjectUpdate) AddMemberIDs

func (pu *ProjectUpdate) AddMemberIDs(ids ...uuid.UUID) *ProjectUpdate

AddMemberIDs adds the "members" edge to the User entity by IDs.

func (*ProjectUpdate) AddMembers

func (pu *ProjectUpdate) AddMembers(u ...*User) *ProjectUpdate

AddMembers adds the "members" edges to the User entity.

func (*ProjectUpdate) AddQuotaCPU

func (pu *ProjectUpdate) AddQuotaCPU(i int) *ProjectUpdate

AddQuotaCPU adds i to the "quota_cpu" field.

func (*ProjectUpdate) AddQuotaDisk

func (pu *ProjectUpdate) AddQuotaDisk(i int) *ProjectUpdate

AddQuotaDisk adds i to the "quota_disk" field.

func (*ProjectUpdate) AddQuotaNetwork

func (pu *ProjectUpdate) AddQuotaNetwork(i int) *ProjectUpdate

AddQuotaNetwork adds i to the "quota_network" field.

func (*ProjectUpdate) AddQuotaRAM

func (pu *ProjectUpdate) AddQuotaRAM(i int) *ProjectUpdate

AddQuotaRAM adds i to the "quota_ram" field.

func (*ProjectUpdate) AddQuotaRouter

func (pu *ProjectUpdate) AddQuotaRouter(i int) *ProjectUpdate

AddQuotaRouter adds i to the "quota_router" field.

func (*ProjectUpdate) AddUsageCPU

func (pu *ProjectUpdate) AddUsageCPU(i int) *ProjectUpdate

AddUsageCPU adds i to the "usage_cpu" field.

func (*ProjectUpdate) AddUsageDisk

func (pu *ProjectUpdate) AddUsageDisk(i int) *ProjectUpdate

AddUsageDisk adds i to the "usage_disk" field.

func (*ProjectUpdate) AddUsageNetwork

func (pu *ProjectUpdate) AddUsageNetwork(i int) *ProjectUpdate

AddUsageNetwork adds i to the "usage_network" field.

func (*ProjectUpdate) AddUsageRAM

func (pu *ProjectUpdate) AddUsageRAM(i int) *ProjectUpdate

AddUsageRAM adds i to the "usage_ram" field.

func (*ProjectUpdate) AddUsageRouter

func (pu *ProjectUpdate) AddUsageRouter(i int) *ProjectUpdate

AddUsageRouter adds i to the "usage_router" field.

func (*ProjectUpdate) ClearBlueprints

func (pu *ProjectUpdate) ClearBlueprints() *ProjectUpdate

ClearBlueprints clears all "blueprints" edges to the Blueprint entity.

func (*ProjectUpdate) ClearDeployments

func (pu *ProjectUpdate) ClearDeployments() *ProjectUpdate

ClearDeployments clears all "deployments" edges to the Deployment entity.

func (*ProjectUpdate) ClearGroupMembers

func (pu *ProjectUpdate) ClearGroupMembers() *ProjectUpdate

ClearGroupMembers clears all "group_members" edges to the Group entity.

func (*ProjectUpdate) ClearMembers

func (pu *ProjectUpdate) ClearMembers() *ProjectUpdate

ClearMembers clears all "members" edges to the User 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) RemoveBlueprintIDs

func (pu *ProjectUpdate) RemoveBlueprintIDs(ids ...uuid.UUID) *ProjectUpdate

RemoveBlueprintIDs removes the "blueprints" edge to Blueprint entities by IDs.

func (*ProjectUpdate) RemoveBlueprints

func (pu *ProjectUpdate) RemoveBlueprints(b ...*Blueprint) *ProjectUpdate

RemoveBlueprints removes "blueprints" edges to Blueprint entities.

func (*ProjectUpdate) RemoveDeploymentIDs

func (pu *ProjectUpdate) RemoveDeploymentIDs(ids ...uuid.UUID) *ProjectUpdate

RemoveDeploymentIDs removes the "deployments" edge to Deployment entities by IDs.

func (*ProjectUpdate) RemoveDeployments

func (pu *ProjectUpdate) RemoveDeployments(d ...*Deployment) *ProjectUpdate

RemoveDeployments removes "deployments" edges to Deployment entities.

func (*ProjectUpdate) RemoveGroupMemberIDs

func (pu *ProjectUpdate) RemoveGroupMemberIDs(ids ...uuid.UUID) *ProjectUpdate

RemoveGroupMemberIDs removes the "group_members" edge to Group entities by IDs.

func (*ProjectUpdate) RemoveGroupMembers

func (pu *ProjectUpdate) RemoveGroupMembers(g ...*Group) *ProjectUpdate

RemoveGroupMembers removes "group_members" edges to Group entities.

func (*ProjectUpdate) RemoveMemberIDs

func (pu *ProjectUpdate) RemoveMemberIDs(ids ...uuid.UUID) *ProjectUpdate

RemoveMemberIDs removes the "members" edge to User entities by IDs.

func (*ProjectUpdate) RemoveMembers

func (pu *ProjectUpdate) RemoveMembers(u ...*User) *ProjectUpdate

RemoveMembers removes "members" edges to User entities.

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) SetName

func (pu *ProjectUpdate) SetName(s string) *ProjectUpdate

SetName sets the "name" field.

func (*ProjectUpdate) SetNillableName

func (pu *ProjectUpdate) SetNillableName(s *string) *ProjectUpdate

SetNillableName sets the "name" field if the given value is not nil.

func (*ProjectUpdate) SetNillableQuotaCPU

func (pu *ProjectUpdate) SetNillableQuotaCPU(i *int) *ProjectUpdate

SetNillableQuotaCPU sets the "quota_cpu" field if the given value is not nil.

func (*ProjectUpdate) SetNillableQuotaDisk

func (pu *ProjectUpdate) SetNillableQuotaDisk(i *int) *ProjectUpdate

SetNillableQuotaDisk sets the "quota_disk" field if the given value is not nil.

func (*ProjectUpdate) SetNillableQuotaNetwork

func (pu *ProjectUpdate) SetNillableQuotaNetwork(i *int) *ProjectUpdate

SetNillableQuotaNetwork sets the "quota_network" field if the given value is not nil.

func (*ProjectUpdate) SetNillableQuotaRAM

func (pu *ProjectUpdate) SetNillableQuotaRAM(i *int) *ProjectUpdate

SetNillableQuotaRAM sets the "quota_ram" field if the given value is not nil.

func (*ProjectUpdate) SetNillableQuotaRouter

func (pu *ProjectUpdate) SetNillableQuotaRouter(i *int) *ProjectUpdate

SetNillableQuotaRouter sets the "quota_router" field if the given value is not nil.

func (*ProjectUpdate) SetNillableUsageCPU

func (pu *ProjectUpdate) SetNillableUsageCPU(i *int) *ProjectUpdate

SetNillableUsageCPU sets the "usage_cpu" field if the given value is not nil.

func (*ProjectUpdate) SetNillableUsageDisk

func (pu *ProjectUpdate) SetNillableUsageDisk(i *int) *ProjectUpdate

SetNillableUsageDisk sets the "usage_disk" field if the given value is not nil.

func (*ProjectUpdate) SetNillableUsageNetwork

func (pu *ProjectUpdate) SetNillableUsageNetwork(i *int) *ProjectUpdate

SetNillableUsageNetwork sets the "usage_network" field if the given value is not nil.

func (*ProjectUpdate) SetNillableUsageRAM

func (pu *ProjectUpdate) SetNillableUsageRAM(i *int) *ProjectUpdate

SetNillableUsageRAM sets the "usage_ram" field if the given value is not nil.

func (*ProjectUpdate) SetNillableUsageRouter

func (pu *ProjectUpdate) SetNillableUsageRouter(i *int) *ProjectUpdate

SetNillableUsageRouter sets the "usage_router" field if the given value is not nil.

func (*ProjectUpdate) SetQuotaCPU

func (pu *ProjectUpdate) SetQuotaCPU(i int) *ProjectUpdate

SetQuotaCPU sets the "quota_cpu" field.

func (*ProjectUpdate) SetQuotaDisk

func (pu *ProjectUpdate) SetQuotaDisk(i int) *ProjectUpdate

SetQuotaDisk sets the "quota_disk" field.

func (*ProjectUpdate) SetQuotaNetwork

func (pu *ProjectUpdate) SetQuotaNetwork(i int) *ProjectUpdate

SetQuotaNetwork sets the "quota_network" field.

func (*ProjectUpdate) SetQuotaRAM

func (pu *ProjectUpdate) SetQuotaRAM(i int) *ProjectUpdate

SetQuotaRAM sets the "quota_ram" field.

func (*ProjectUpdate) SetQuotaRouter

func (pu *ProjectUpdate) SetQuotaRouter(i int) *ProjectUpdate

SetQuotaRouter sets the "quota_router" field.

func (*ProjectUpdate) SetUpdatedAt

func (pu *ProjectUpdate) SetUpdatedAt(t time.Time) *ProjectUpdate

SetUpdatedAt sets the "updated_at" field.

func (*ProjectUpdate) SetUsageCPU

func (pu *ProjectUpdate) SetUsageCPU(i int) *ProjectUpdate

SetUsageCPU sets the "usage_cpu" field.

func (*ProjectUpdate) SetUsageDisk

func (pu *ProjectUpdate) SetUsageDisk(i int) *ProjectUpdate

SetUsageDisk sets the "usage_disk" field.

func (*ProjectUpdate) SetUsageNetwork

func (pu *ProjectUpdate) SetUsageNetwork(i int) *ProjectUpdate

SetUsageNetwork sets the "usage_network" field.

func (*ProjectUpdate) SetUsageRAM

func (pu *ProjectUpdate) SetUsageRAM(i int) *ProjectUpdate

SetUsageRAM sets the "usage_ram" field.

func (*ProjectUpdate) SetUsageRouter

func (pu *ProjectUpdate) SetUsageRouter(i int) *ProjectUpdate

SetUsageRouter sets the "usage_router" 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) AddBlueprintIDs

func (puo *ProjectUpdateOne) AddBlueprintIDs(ids ...uuid.UUID) *ProjectUpdateOne

AddBlueprintIDs adds the "blueprints" edge to the Blueprint entity by IDs.

func (*ProjectUpdateOne) AddBlueprints

func (puo *ProjectUpdateOne) AddBlueprints(b ...*Blueprint) *ProjectUpdateOne

AddBlueprints adds the "blueprints" edges to the Blueprint entity.

func (*ProjectUpdateOne) AddDeploymentIDs

func (puo *ProjectUpdateOne) AddDeploymentIDs(ids ...uuid.UUID) *ProjectUpdateOne

AddDeploymentIDs adds the "deployments" edge to the Deployment entity by IDs.

func (*ProjectUpdateOne) AddDeployments

func (puo *ProjectUpdateOne) AddDeployments(d ...*Deployment) *ProjectUpdateOne

AddDeployments adds the "deployments" edges to the Deployment entity.

func (*ProjectUpdateOne) AddGroupMemberIDs

func (puo *ProjectUpdateOne) AddGroupMemberIDs(ids ...uuid.UUID) *ProjectUpdateOne

AddGroupMemberIDs adds the "group_members" edge to the Group entity by IDs.

func (*ProjectUpdateOne) AddGroupMembers

func (puo *ProjectUpdateOne) AddGroupMembers(g ...*Group) *ProjectUpdateOne

AddGroupMembers adds the "group_members" edges to the Group entity.

func (*ProjectUpdateOne) AddMemberIDs

func (puo *ProjectUpdateOne) AddMemberIDs(ids ...uuid.UUID) *ProjectUpdateOne

AddMemberIDs adds the "members" edge to the User entity by IDs.

func (*ProjectUpdateOne) AddMembers

func (puo *ProjectUpdateOne) AddMembers(u ...*User) *ProjectUpdateOne

AddMembers adds the "members" edges to the User entity.

func (*ProjectUpdateOne) AddQuotaCPU

func (puo *ProjectUpdateOne) AddQuotaCPU(i int) *ProjectUpdateOne

AddQuotaCPU adds i to the "quota_cpu" field.

func (*ProjectUpdateOne) AddQuotaDisk

func (puo *ProjectUpdateOne) AddQuotaDisk(i int) *ProjectUpdateOne

AddQuotaDisk adds i to the "quota_disk" field.

func (*ProjectUpdateOne) AddQuotaNetwork

func (puo *ProjectUpdateOne) AddQuotaNetwork(i int) *ProjectUpdateOne

AddQuotaNetwork adds i to the "quota_network" field.

func (*ProjectUpdateOne) AddQuotaRAM

func (puo *ProjectUpdateOne) AddQuotaRAM(i int) *ProjectUpdateOne

AddQuotaRAM adds i to the "quota_ram" field.

func (*ProjectUpdateOne) AddQuotaRouter

func (puo *ProjectUpdateOne) AddQuotaRouter(i int) *ProjectUpdateOne

AddQuotaRouter adds i to the "quota_router" field.

func (*ProjectUpdateOne) AddUsageCPU

func (puo *ProjectUpdateOne) AddUsageCPU(i int) *ProjectUpdateOne

AddUsageCPU adds i to the "usage_cpu" field.

func (*ProjectUpdateOne) AddUsageDisk

func (puo *ProjectUpdateOne) AddUsageDisk(i int) *ProjectUpdateOne

AddUsageDisk adds i to the "usage_disk" field.

func (*ProjectUpdateOne) AddUsageNetwork

func (puo *ProjectUpdateOne) AddUsageNetwork(i int) *ProjectUpdateOne

AddUsageNetwork adds i to the "usage_network" field.

func (*ProjectUpdateOne) AddUsageRAM

func (puo *ProjectUpdateOne) AddUsageRAM(i int) *ProjectUpdateOne

AddUsageRAM adds i to the "usage_ram" field.

func (*ProjectUpdateOne) AddUsageRouter

func (puo *ProjectUpdateOne) AddUsageRouter(i int) *ProjectUpdateOne

AddUsageRouter adds i to the "usage_router" field.

func (*ProjectUpdateOne) ClearBlueprints

func (puo *ProjectUpdateOne) ClearBlueprints() *ProjectUpdateOne

ClearBlueprints clears all "blueprints" edges to the Blueprint entity.

func (*ProjectUpdateOne) ClearDeployments

func (puo *ProjectUpdateOne) ClearDeployments() *ProjectUpdateOne

ClearDeployments clears all "deployments" edges to the Deployment entity.

func (*ProjectUpdateOne) ClearGroupMembers

func (puo *ProjectUpdateOne) ClearGroupMembers() *ProjectUpdateOne

ClearGroupMembers clears all "group_members" edges to the Group entity.

func (*ProjectUpdateOne) ClearMembers

func (puo *ProjectUpdateOne) ClearMembers() *ProjectUpdateOne

ClearMembers clears all "members" edges to the User 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) RemoveBlueprintIDs

func (puo *ProjectUpdateOne) RemoveBlueprintIDs(ids ...uuid.UUID) *ProjectUpdateOne

RemoveBlueprintIDs removes the "blueprints" edge to Blueprint entities by IDs.

func (*ProjectUpdateOne) RemoveBlueprints

func (puo *ProjectUpdateOne) RemoveBlueprints(b ...*Blueprint) *ProjectUpdateOne

RemoveBlueprints removes "blueprints" edges to Blueprint entities.

func (*ProjectUpdateOne) RemoveDeploymentIDs

func (puo *ProjectUpdateOne) RemoveDeploymentIDs(ids ...uuid.UUID) *ProjectUpdateOne

RemoveDeploymentIDs removes the "deployments" edge to Deployment entities by IDs.

func (*ProjectUpdateOne) RemoveDeployments

func (puo *ProjectUpdateOne) RemoveDeployments(d ...*Deployment) *ProjectUpdateOne

RemoveDeployments removes "deployments" edges to Deployment entities.

func (*ProjectUpdateOne) RemoveGroupMemberIDs

func (puo *ProjectUpdateOne) RemoveGroupMemberIDs(ids ...uuid.UUID) *ProjectUpdateOne

RemoveGroupMemberIDs removes the "group_members" edge to Group entities by IDs.

func (*ProjectUpdateOne) RemoveGroupMembers

func (puo *ProjectUpdateOne) RemoveGroupMembers(g ...*Group) *ProjectUpdateOne

RemoveGroupMembers removes "group_members" edges to Group entities.

func (*ProjectUpdateOne) RemoveMemberIDs

func (puo *ProjectUpdateOne) RemoveMemberIDs(ids ...uuid.UUID) *ProjectUpdateOne

RemoveMemberIDs removes the "members" edge to User entities by IDs.

func (*ProjectUpdateOne) RemoveMembers

func (puo *ProjectUpdateOne) RemoveMembers(u ...*User) *ProjectUpdateOne

RemoveMembers removes "members" edges to User entities.

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) SetName

func (puo *ProjectUpdateOne) SetName(s string) *ProjectUpdateOne

SetName sets the "name" field.

func (*ProjectUpdateOne) SetNillableName

func (puo *ProjectUpdateOne) SetNillableName(s *string) *ProjectUpdateOne

SetNillableName sets the "name" field if the given value is not nil.

func (*ProjectUpdateOne) SetNillableQuotaCPU

func (puo *ProjectUpdateOne) SetNillableQuotaCPU(i *int) *ProjectUpdateOne

SetNillableQuotaCPU sets the "quota_cpu" field if the given value is not nil.

func (*ProjectUpdateOne) SetNillableQuotaDisk

func (puo *ProjectUpdateOne) SetNillableQuotaDisk(i *int) *ProjectUpdateOne

SetNillableQuotaDisk sets the "quota_disk" field if the given value is not nil.

func (*ProjectUpdateOne) SetNillableQuotaNetwork

func (puo *ProjectUpdateOne) SetNillableQuotaNetwork(i *int) *ProjectUpdateOne

SetNillableQuotaNetwork sets the "quota_network" field if the given value is not nil.

func (*ProjectUpdateOne) SetNillableQuotaRAM

func (puo *ProjectUpdateOne) SetNillableQuotaRAM(i *int) *ProjectUpdateOne

SetNillableQuotaRAM sets the "quota_ram" field if the given value is not nil.

func (*ProjectUpdateOne) SetNillableQuotaRouter

func (puo *ProjectUpdateOne) SetNillableQuotaRouter(i *int) *ProjectUpdateOne

SetNillableQuotaRouter sets the "quota_router" field if the given value is not nil.

func (*ProjectUpdateOne) SetNillableUsageCPU

func (puo *ProjectUpdateOne) SetNillableUsageCPU(i *int) *ProjectUpdateOne

SetNillableUsageCPU sets the "usage_cpu" field if the given value is not nil.

func (*ProjectUpdateOne) SetNillableUsageDisk

func (puo *ProjectUpdateOne) SetNillableUsageDisk(i *int) *ProjectUpdateOne

SetNillableUsageDisk sets the "usage_disk" field if the given value is not nil.

func (*ProjectUpdateOne) SetNillableUsageNetwork

func (puo *ProjectUpdateOne) SetNillableUsageNetwork(i *int) *ProjectUpdateOne

SetNillableUsageNetwork sets the "usage_network" field if the given value is not nil.

func (*ProjectUpdateOne) SetNillableUsageRAM

func (puo *ProjectUpdateOne) SetNillableUsageRAM(i *int) *ProjectUpdateOne

SetNillableUsageRAM sets the "usage_ram" field if the given value is not nil.

func (*ProjectUpdateOne) SetNillableUsageRouter

func (puo *ProjectUpdateOne) SetNillableUsageRouter(i *int) *ProjectUpdateOne

SetNillableUsageRouter sets the "usage_router" field if the given value is not nil.

func (*ProjectUpdateOne) SetQuotaCPU

func (puo *ProjectUpdateOne) SetQuotaCPU(i int) *ProjectUpdateOne

SetQuotaCPU sets the "quota_cpu" field.

func (*ProjectUpdateOne) SetQuotaDisk

func (puo *ProjectUpdateOne) SetQuotaDisk(i int) *ProjectUpdateOne

SetQuotaDisk sets the "quota_disk" field.

func (*ProjectUpdateOne) SetQuotaNetwork

func (puo *ProjectUpdateOne) SetQuotaNetwork(i int) *ProjectUpdateOne

SetQuotaNetwork sets the "quota_network" field.

func (*ProjectUpdateOne) SetQuotaRAM

func (puo *ProjectUpdateOne) SetQuotaRAM(i int) *ProjectUpdateOne

SetQuotaRAM sets the "quota_ram" field.

func (*ProjectUpdateOne) SetQuotaRouter

func (puo *ProjectUpdateOne) SetQuotaRouter(i int) *ProjectUpdateOne

SetQuotaRouter sets the "quota_router" field.

func (*ProjectUpdateOne) SetUpdatedAt

func (puo *ProjectUpdateOne) SetUpdatedAt(t time.Time) *ProjectUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*ProjectUpdateOne) SetUsageCPU

func (puo *ProjectUpdateOne) SetUsageCPU(i int) *ProjectUpdateOne

SetUsageCPU sets the "usage_cpu" field.

func (*ProjectUpdateOne) SetUsageDisk

func (puo *ProjectUpdateOne) SetUsageDisk(i int) *ProjectUpdateOne

SetUsageDisk sets the "usage_disk" field.

func (*ProjectUpdateOne) SetUsageNetwork

func (puo *ProjectUpdateOne) SetUsageNetwork(i int) *ProjectUpdateOne

SetUsageNetwork sets the "usage_network" field.

func (*ProjectUpdateOne) SetUsageRAM

func (puo *ProjectUpdateOne) SetUsageRAM(i int) *ProjectUpdateOne

SetUsageRAM sets the "usage_ram" field.

func (*ProjectUpdateOne) SetUsageRouter

func (puo *ProjectUpdateOne) SetUsageRouter(i int) *ProjectUpdateOne

SetUsageRouter sets the "usage_router" 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 Provider

type Provider struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// UpdatedAt holds the value of the "updated_at" field.
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// DisplayName holds the value of the "display_name" field.
	DisplayName string `json:"display_name,omitempty"`
	// ProviderGitURL holds the value of the "provider_git_url" field.
	ProviderGitURL string `json:"provider_git_url,omitempty"`
	// ProviderVersion holds the value of the "provider_version" field.
	ProviderVersion string `json:"provider_version,omitempty"`
	// ConfigBytes holds the value of the "config_bytes" field.
	ConfigBytes []byte `json:"config_bytes,omitempty"`
	// IsLoaded holds the value of the "is_loaded" field.
	IsLoaded bool `json:"is_loaded,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the ProviderQuery when eager-loading is set.
	Edges ProviderEdges `json:"edges"`
	// contains filtered or unexported fields
}

Provider is the model entity for the Provider schema.

func (*Provider) QueryBlueprints

func (pr *Provider) QueryBlueprints() *BlueprintQuery

QueryBlueprints queries the "blueprints" edge of the Provider entity.

func (*Provider) String

func (pr *Provider) String() string

String implements the fmt.Stringer.

func (*Provider) Unwrap

func (pr *Provider) Unwrap() *Provider

Unwrap unwraps the Provider 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 (*Provider) Update

func (pr *Provider) Update() *ProviderUpdateOne

Update returns a builder for updating this Provider. Note that you need to call Provider.Unwrap() before calling this method if this Provider was returned from a transaction, and the transaction was committed or rolled back.

func (*Provider) Value

func (pr *Provider) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the Provider. This includes values selected through modifiers, order, etc.

type ProviderClient

type ProviderClient struct {
	// contains filtered or unexported fields
}

ProviderClient is a client for the Provider schema.

func NewProviderClient

func NewProviderClient(c config) *ProviderClient

NewProviderClient returns a client for the Provider from the given config.

func (*ProviderClient) Create

func (c *ProviderClient) Create() *ProviderCreate

Create returns a builder for creating a Provider entity.

func (*ProviderClient) CreateBulk

func (c *ProviderClient) CreateBulk(builders ...*ProviderCreate) *ProviderCreateBulk

CreateBulk returns a builder for creating a bulk of Provider entities.

func (*ProviderClient) Delete

func (c *ProviderClient) Delete() *ProviderDelete

Delete returns a delete builder for Provider.

func (*ProviderClient) DeleteOne

func (c *ProviderClient) DeleteOne(pr *Provider) *ProviderDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*ProviderClient) DeleteOneID

func (c *ProviderClient) DeleteOneID(id uuid.UUID) *ProviderDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*ProviderClient) Get

func (c *ProviderClient) Get(ctx context.Context, id uuid.UUID) (*Provider, error)

Get returns a Provider entity by its id.

func (*ProviderClient) GetX

func (c *ProviderClient) GetX(ctx context.Context, id uuid.UUID) *Provider

GetX is like Get, but panics if an error occurs.

func (*ProviderClient) Hooks

func (c *ProviderClient) Hooks() []Hook

Hooks returns the client hooks.

func (*ProviderClient) Intercept

func (c *ProviderClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `entprovider.Intercept(f(g(h())))`.

func (*ProviderClient) Interceptors

func (c *ProviderClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*ProviderClient) MapCreateBulk

func (c *ProviderClient) MapCreateBulk(slice any, setFunc func(*ProviderCreate, int)) *ProviderCreateBulk

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 (*ProviderClient) Query

func (c *ProviderClient) Query() *ProviderQuery

Query returns a query builder for Provider.

func (*ProviderClient) QueryBlueprints

func (c *ProviderClient) QueryBlueprints(pr *Provider) *BlueprintQuery

QueryBlueprints queries the blueprints edge of a Provider.

func (*ProviderClient) Update

func (c *ProviderClient) Update() *ProviderUpdate

Update returns an update builder for Provider.

func (*ProviderClient) UpdateOne

func (c *ProviderClient) UpdateOne(pr *Provider) *ProviderUpdateOne

UpdateOne returns an update builder for the given entity.

func (*ProviderClient) UpdateOneID

func (c *ProviderClient) UpdateOneID(id uuid.UUID) *ProviderUpdateOne

UpdateOneID returns an update builder for the given id.

func (*ProviderClient) Use

func (c *ProviderClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `entprovider.Hooks(f(g(h())))`.

type ProviderCreate

type ProviderCreate struct {
	// contains filtered or unexported fields
}

ProviderCreate is the builder for creating a Provider entity.

func (*ProviderCreate) AddBlueprintIDs

func (pc *ProviderCreate) AddBlueprintIDs(ids ...uuid.UUID) *ProviderCreate

AddBlueprintIDs adds the "blueprints" edge to the Blueprint entity by IDs.

func (*ProviderCreate) AddBlueprints

func (pc *ProviderCreate) AddBlueprints(b ...*Blueprint) *ProviderCreate

AddBlueprints adds the "blueprints" edges to the Blueprint entity.

func (*ProviderCreate) Exec

func (pc *ProviderCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*ProviderCreate) ExecX

func (pc *ProviderCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ProviderCreate) Mutation

func (pc *ProviderCreate) Mutation() *ProviderMutation

Mutation returns the ProviderMutation object of the builder.

func (*ProviderCreate) Save

func (pc *ProviderCreate) Save(ctx context.Context) (*Provider, error)

Save creates the Provider in the database.

func (*ProviderCreate) SaveX

func (pc *ProviderCreate) SaveX(ctx context.Context) *Provider

SaveX calls Save and panics if Save returns an error.

func (*ProviderCreate) SetConfigBytes

func (pc *ProviderCreate) SetConfigBytes(b []byte) *ProviderCreate

SetConfigBytes sets the "config_bytes" field.

func (*ProviderCreate) SetCreatedAt

func (pc *ProviderCreate) SetCreatedAt(t time.Time) *ProviderCreate

SetCreatedAt sets the "created_at" field.

func (*ProviderCreate) SetDisplayName

func (pc *ProviderCreate) SetDisplayName(s string) *ProviderCreate

SetDisplayName sets the "display_name" field.

func (*ProviderCreate) SetID

func (pc *ProviderCreate) SetID(u uuid.UUID) *ProviderCreate

SetID sets the "id" field.

func (*ProviderCreate) SetIsLoaded

func (pc *ProviderCreate) SetIsLoaded(b bool) *ProviderCreate

SetIsLoaded sets the "is_loaded" field.

func (*ProviderCreate) SetNillableCreatedAt

func (pc *ProviderCreate) SetNillableCreatedAt(t *time.Time) *ProviderCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*ProviderCreate) SetNillableID

func (pc *ProviderCreate) SetNillableID(u *uuid.UUID) *ProviderCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*ProviderCreate) SetNillableIsLoaded

func (pc *ProviderCreate) SetNillableIsLoaded(b *bool) *ProviderCreate

SetNillableIsLoaded sets the "is_loaded" field if the given value is not nil.

func (*ProviderCreate) SetNillableUpdatedAt

func (pc *ProviderCreate) SetNillableUpdatedAt(t *time.Time) *ProviderCreate

SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.

func (*ProviderCreate) SetProviderGitURL

func (pc *ProviderCreate) SetProviderGitURL(s string) *ProviderCreate

SetProviderGitURL sets the "provider_git_url" field.

func (*ProviderCreate) SetProviderVersion

func (pc *ProviderCreate) SetProviderVersion(s string) *ProviderCreate

SetProviderVersion sets the "provider_version" field.

func (*ProviderCreate) SetUpdatedAt

func (pc *ProviderCreate) SetUpdatedAt(t time.Time) *ProviderCreate

SetUpdatedAt sets the "updated_at" field.

type ProviderCreateBulk

type ProviderCreateBulk struct {
	// contains filtered or unexported fields
}

ProviderCreateBulk is the builder for creating many Provider entities in bulk.

func (*ProviderCreateBulk) Exec

func (pcb *ProviderCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*ProviderCreateBulk) ExecX

func (pcb *ProviderCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ProviderCreateBulk) Save

func (pcb *ProviderCreateBulk) Save(ctx context.Context) ([]*Provider, error)

Save creates the Provider entities in the database.

func (*ProviderCreateBulk) SaveX

func (pcb *ProviderCreateBulk) SaveX(ctx context.Context) []*Provider

SaveX is like Save, but panics if an error occurs.

type ProviderDelete

type ProviderDelete struct {
	// contains filtered or unexported fields
}

ProviderDelete is the builder for deleting a Provider entity.

func (*ProviderDelete) Exec

func (pd *ProviderDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*ProviderDelete) ExecX

func (pd *ProviderDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*ProviderDelete) Where

func (pd *ProviderDelete) Where(ps ...predicate.Provider) *ProviderDelete

Where appends a list predicates to the ProviderDelete builder.

type ProviderDeleteOne

type ProviderDeleteOne struct {
	// contains filtered or unexported fields
}

ProviderDeleteOne is the builder for deleting a single Provider entity.

func (*ProviderDeleteOne) Exec

func (pdo *ProviderDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*ProviderDeleteOne) ExecX

func (pdo *ProviderDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ProviderDeleteOne) Where

Where appends a list predicates to the ProviderDelete builder.

type ProviderEdges

type ProviderEdges struct {
	// Blueprints holds the value of the blueprints edge.
	Blueprints []*Blueprint `json:"blueprints,omitempty"`
	// contains filtered or unexported fields
}

ProviderEdges holds the relations/edges for other nodes in the graph.

func (ProviderEdges) BlueprintsOrErr

func (e ProviderEdges) BlueprintsOrErr() ([]*Blueprint, error)

BlueprintsOrErr returns the Blueprints value or an error if the edge was not loaded in eager-loading.

type ProviderGroupBy

type ProviderGroupBy struct {
	// contains filtered or unexported fields
}

ProviderGroupBy is the group-by builder for Provider entities.

func (*ProviderGroupBy) Aggregate

func (pgb *ProviderGroupBy) Aggregate(fns ...AggregateFunc) *ProviderGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*ProviderGroupBy) Bool

func (s *ProviderGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*ProviderGroupBy) BoolX

func (s *ProviderGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*ProviderGroupBy) Bools

func (s *ProviderGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*ProviderGroupBy) BoolsX

func (s *ProviderGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*ProviderGroupBy) Float64

func (s *ProviderGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*ProviderGroupBy) Float64X

func (s *ProviderGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*ProviderGroupBy) Float64s

func (s *ProviderGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*ProviderGroupBy) Float64sX

func (s *ProviderGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*ProviderGroupBy) Int

func (s *ProviderGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*ProviderGroupBy) IntX

func (s *ProviderGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*ProviderGroupBy) Ints

func (s *ProviderGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*ProviderGroupBy) IntsX

func (s *ProviderGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*ProviderGroupBy) Scan

func (pgb *ProviderGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*ProviderGroupBy) ScanX

func (s *ProviderGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*ProviderGroupBy) String

func (s *ProviderGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*ProviderGroupBy) StringX

func (s *ProviderGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*ProviderGroupBy) Strings

func (s *ProviderGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*ProviderGroupBy) StringsX

func (s *ProviderGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type ProviderMutation

type ProviderMutation struct {
	// contains filtered or unexported fields
}

ProviderMutation represents an operation that mutates the Provider nodes in the graph.

func (*ProviderMutation) AddBlueprintIDs

func (m *ProviderMutation) AddBlueprintIDs(ids ...uuid.UUID)

AddBlueprintIDs adds the "blueprints" edge to the Blueprint entity by ids.

func (*ProviderMutation) AddField

func (m *ProviderMutation) 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 (*ProviderMutation) AddedEdges

func (m *ProviderMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*ProviderMutation) AddedField

func (m *ProviderMutation) 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 (*ProviderMutation) AddedFields

func (m *ProviderMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*ProviderMutation) AddedIDs

func (m *ProviderMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*ProviderMutation) BlueprintsCleared

func (m *ProviderMutation) BlueprintsCleared() bool

BlueprintsCleared reports if the "blueprints" edge to the Blueprint entity was cleared.

func (*ProviderMutation) BlueprintsIDs

func (m *ProviderMutation) BlueprintsIDs() (ids []uuid.UUID)

BlueprintsIDs returns the "blueprints" edge IDs in the mutation.

func (*ProviderMutation) ClearBlueprints

func (m *ProviderMutation) ClearBlueprints()

ClearBlueprints clears the "blueprints" edge to the Blueprint entity.

func (*ProviderMutation) ClearEdge

func (m *ProviderMutation) 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 (*ProviderMutation) ClearField

func (m *ProviderMutation) 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 (*ProviderMutation) ClearedEdges

func (m *ProviderMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*ProviderMutation) ClearedFields

func (m *ProviderMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (ProviderMutation) Client

func (m ProviderMutation) 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 (*ProviderMutation) ConfigBytes

func (m *ProviderMutation) ConfigBytes() (r []byte, exists bool)

ConfigBytes returns the value of the "config_bytes" field in the mutation.

func (*ProviderMutation) CreatedAt

func (m *ProviderMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*ProviderMutation) DisplayName

func (m *ProviderMutation) DisplayName() (r string, exists bool)

DisplayName returns the value of the "display_name" field in the mutation.

func (*ProviderMutation) EdgeCleared

func (m *ProviderMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*ProviderMutation) Field

func (m *ProviderMutation) 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 (*ProviderMutation) FieldCleared

func (m *ProviderMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*ProviderMutation) Fields

func (m *ProviderMutation) 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 (*ProviderMutation) ID

func (m *ProviderMutation) ID() (id uuid.UUID, 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 (*ProviderMutation) IDs

func (m *ProviderMutation) IDs(ctx context.Context) ([]uuid.UUID, 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 (*ProviderMutation) IsLoaded

func (m *ProviderMutation) IsLoaded() (r bool, exists bool)

IsLoaded returns the value of the "is_loaded" field in the mutation.

func (*ProviderMutation) OldConfigBytes

func (m *ProviderMutation) OldConfigBytes(ctx context.Context) (v []byte, err error)

OldConfigBytes returns the old "config_bytes" field's value of the Provider entity. If the Provider 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 (*ProviderMutation) OldCreatedAt

func (m *ProviderMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the Provider entity. If the Provider 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 (*ProviderMutation) OldDisplayName

func (m *ProviderMutation) OldDisplayName(ctx context.Context) (v string, err error)

OldDisplayName returns the old "display_name" field's value of the Provider entity. If the Provider 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 (*ProviderMutation) OldField

func (m *ProviderMutation) 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 (*ProviderMutation) OldIsLoaded

func (m *ProviderMutation) OldIsLoaded(ctx context.Context) (v bool, err error)

OldIsLoaded returns the old "is_loaded" field's value of the Provider entity. If the Provider 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 (*ProviderMutation) OldProviderGitURL

func (m *ProviderMutation) OldProviderGitURL(ctx context.Context) (v string, err error)

OldProviderGitURL returns the old "provider_git_url" field's value of the Provider entity. If the Provider 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 (*ProviderMutation) OldProviderVersion

func (m *ProviderMutation) OldProviderVersion(ctx context.Context) (v string, err error)

OldProviderVersion returns the old "provider_version" field's value of the Provider entity. If the Provider 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 (*ProviderMutation) OldUpdatedAt

func (m *ProviderMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)

OldUpdatedAt returns the old "updated_at" field's value of the Provider entity. If the Provider 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 (*ProviderMutation) Op

func (m *ProviderMutation) Op() Op

Op returns the operation name.

func (*ProviderMutation) ProviderGitURL

func (m *ProviderMutation) ProviderGitURL() (r string, exists bool)

ProviderGitURL returns the value of the "provider_git_url" field in the mutation.

func (*ProviderMutation) ProviderVersion

func (m *ProviderMutation) ProviderVersion() (r string, exists bool)

ProviderVersion returns the value of the "provider_version" field in the mutation.

func (*ProviderMutation) RemoveBlueprintIDs

func (m *ProviderMutation) RemoveBlueprintIDs(ids ...uuid.UUID)

RemoveBlueprintIDs removes the "blueprints" edge to the Blueprint entity by IDs.

func (*ProviderMutation) RemovedBlueprintsIDs

func (m *ProviderMutation) RemovedBlueprintsIDs() (ids []uuid.UUID)

RemovedBlueprints returns the removed IDs of the "blueprints" edge to the Blueprint entity.

func (*ProviderMutation) RemovedEdges

func (m *ProviderMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*ProviderMutation) RemovedIDs

func (m *ProviderMutation) 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 (*ProviderMutation) ResetBlueprints

func (m *ProviderMutation) ResetBlueprints()

ResetBlueprints resets all changes to the "blueprints" edge.

func (*ProviderMutation) ResetConfigBytes

func (m *ProviderMutation) ResetConfigBytes()

ResetConfigBytes resets all changes to the "config_bytes" field.

func (*ProviderMutation) ResetCreatedAt

func (m *ProviderMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*ProviderMutation) ResetDisplayName

func (m *ProviderMutation) ResetDisplayName()

ResetDisplayName resets all changes to the "display_name" field.

func (*ProviderMutation) ResetEdge

func (m *ProviderMutation) 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 (*ProviderMutation) ResetField

func (m *ProviderMutation) 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 (*ProviderMutation) ResetIsLoaded

func (m *ProviderMutation) ResetIsLoaded()

ResetIsLoaded resets all changes to the "is_loaded" field.

func (*ProviderMutation) ResetProviderGitURL

func (m *ProviderMutation) ResetProviderGitURL()

ResetProviderGitURL resets all changes to the "provider_git_url" field.

func (*ProviderMutation) ResetProviderVersion

func (m *ProviderMutation) ResetProviderVersion()

ResetProviderVersion resets all changes to the "provider_version" field.

func (*ProviderMutation) ResetUpdatedAt

func (m *ProviderMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*ProviderMutation) SetConfigBytes

func (m *ProviderMutation) SetConfigBytes(b []byte)

SetConfigBytes sets the "config_bytes" field.

func (*ProviderMutation) SetCreatedAt

func (m *ProviderMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*ProviderMutation) SetDisplayName

func (m *ProviderMutation) SetDisplayName(s string)

SetDisplayName sets the "display_name" field.

func (*ProviderMutation) SetField

func (m *ProviderMutation) 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 (*ProviderMutation) SetID

func (m *ProviderMutation) SetID(id uuid.UUID)

SetID sets the value of the id field. Note that this operation is only accepted on creation of Provider entities.

func (*ProviderMutation) SetIsLoaded

func (m *ProviderMutation) SetIsLoaded(b bool)

SetIsLoaded sets the "is_loaded" field.

func (*ProviderMutation) SetOp

func (m *ProviderMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*ProviderMutation) SetProviderGitURL

func (m *ProviderMutation) SetProviderGitURL(s string)

SetProviderGitURL sets the "provider_git_url" field.

func (*ProviderMutation) SetProviderVersion

func (m *ProviderMutation) SetProviderVersion(s string)

SetProviderVersion sets the "provider_version" field.

func (*ProviderMutation) SetUpdatedAt

func (m *ProviderMutation) SetUpdatedAt(t time.Time)

SetUpdatedAt sets the "updated_at" field.

func (ProviderMutation) Tx

func (m ProviderMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*ProviderMutation) Type

func (m *ProviderMutation) Type() string

Type returns the node type of this mutation (Provider).

func (*ProviderMutation) UpdatedAt

func (m *ProviderMutation) UpdatedAt() (r time.Time, exists bool)

UpdatedAt returns the value of the "updated_at" field in the mutation.

func (*ProviderMutation) Where

func (m *ProviderMutation) Where(ps ...predicate.Provider)

Where appends a list predicates to the ProviderMutation builder.

func (*ProviderMutation) WhereP

func (m *ProviderMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the ProviderMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type ProviderQuery

type ProviderQuery struct {
	// contains filtered or unexported fields
}

ProviderQuery is the builder for querying Provider entities.

func (*ProviderQuery) Aggregate

func (pq *ProviderQuery) Aggregate(fns ...AggregateFunc) *ProviderSelect

Aggregate returns a ProviderSelect configured with the given aggregations.

func (*ProviderQuery) All

func (pq *ProviderQuery) All(ctx context.Context) ([]*Provider, error)

All executes the query and returns a list of Providers.

func (*ProviderQuery) AllX

func (pq *ProviderQuery) AllX(ctx context.Context) []*Provider

AllX is like All, but panics if an error occurs.

func (*ProviderQuery) Clone

func (pq *ProviderQuery) Clone() *ProviderQuery

Clone returns a duplicate of the ProviderQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*ProviderQuery) Count

func (pq *ProviderQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*ProviderQuery) CountX

func (pq *ProviderQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*ProviderQuery) Exist

func (pq *ProviderQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*ProviderQuery) ExistX

func (pq *ProviderQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*ProviderQuery) First

func (pq *ProviderQuery) First(ctx context.Context) (*Provider, error)

First returns the first Provider entity from the query. Returns a *NotFoundError when no Provider was found.

func (*ProviderQuery) FirstID

func (pq *ProviderQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

FirstID returns the first Provider ID from the query. Returns a *NotFoundError when no Provider ID was found.

func (*ProviderQuery) FirstIDX

func (pq *ProviderQuery) FirstIDX(ctx context.Context) uuid.UUID

FirstIDX is like FirstID, but panics if an error occurs.

func (*ProviderQuery) FirstX

func (pq *ProviderQuery) FirstX(ctx context.Context) *Provider

FirstX is like First, but panics if an error occurs.

func (*ProviderQuery) GroupBy

func (pq *ProviderQuery) GroupBy(field string, fields ...string) *ProviderGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

Example:

var v []struct {
	CreatedAt time.Time `json:"created_at,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Provider.Query().
	GroupBy(entprovider.FieldCreatedAt).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*ProviderQuery) IDs

func (pq *ProviderQuery) IDs(ctx context.Context) (ids []uuid.UUID, err error)

IDs executes the query and returns a list of Provider IDs.

func (*ProviderQuery) IDsX

func (pq *ProviderQuery) IDsX(ctx context.Context) []uuid.UUID

IDsX is like IDs, but panics if an error occurs.

func (*ProviderQuery) Limit

func (pq *ProviderQuery) Limit(limit int) *ProviderQuery

Limit the number of records to be returned by this query.

func (*ProviderQuery) Offset

func (pq *ProviderQuery) Offset(offset int) *ProviderQuery

Offset to start from.

func (*ProviderQuery) Only

func (pq *ProviderQuery) Only(ctx context.Context) (*Provider, error)

Only returns a single Provider entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Provider entity is found. Returns a *NotFoundError when no Provider entities are found.

func (*ProviderQuery) OnlyID

func (pq *ProviderQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

OnlyID is like Only, but returns the only Provider ID in the query. Returns a *NotSingularError when more than one Provider ID is found. Returns a *NotFoundError when no entities are found.

func (*ProviderQuery) OnlyIDX

func (pq *ProviderQuery) OnlyIDX(ctx context.Context) uuid.UUID

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*ProviderQuery) OnlyX

func (pq *ProviderQuery) OnlyX(ctx context.Context) *Provider

OnlyX is like Only, but panics if an error occurs.

func (*ProviderQuery) Order

Order specifies how the records should be ordered.

func (*ProviderQuery) QueryBlueprints

func (pq *ProviderQuery) QueryBlueprints() *BlueprintQuery

QueryBlueprints chains the current query on the "blueprints" edge.

func (*ProviderQuery) Select

func (pq *ProviderQuery) Select(fields ...string) *ProviderSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	CreatedAt time.Time `json:"created_at,omitempty"`
}

client.Provider.Query().
	Select(entprovider.FieldCreatedAt).
	Scan(ctx, &v)

func (*ProviderQuery) Unique

func (pq *ProviderQuery) Unique(unique bool) *ProviderQuery

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 (*ProviderQuery) Where

func (pq *ProviderQuery) Where(ps ...predicate.Provider) *ProviderQuery

Where adds a new predicate for the ProviderQuery builder.

func (*ProviderQuery) WithBlueprints

func (pq *ProviderQuery) WithBlueprints(opts ...func(*BlueprintQuery)) *ProviderQuery

WithBlueprints tells the query-builder to eager-load the nodes that are connected to the "blueprints" edge. The optional arguments are used to configure the query builder of the edge.

type ProviderSelect

type ProviderSelect struct {
	*ProviderQuery
	// contains filtered or unexported fields
}

ProviderSelect is the builder for selecting fields of Provider entities.

func (*ProviderSelect) Aggregate

func (ps *ProviderSelect) Aggregate(fns ...AggregateFunc) *ProviderSelect

Aggregate adds the given aggregation functions to the selector query.

func (*ProviderSelect) Bool

func (s *ProviderSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*ProviderSelect) BoolX

func (s *ProviderSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*ProviderSelect) Bools

func (s *ProviderSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*ProviderSelect) BoolsX

func (s *ProviderSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*ProviderSelect) Float64

func (s *ProviderSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*ProviderSelect) Float64X

func (s *ProviderSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*ProviderSelect) Float64s

func (s *ProviderSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*ProviderSelect) Float64sX

func (s *ProviderSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*ProviderSelect) Int

func (s *ProviderSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*ProviderSelect) IntX

func (s *ProviderSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*ProviderSelect) Ints

func (s *ProviderSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*ProviderSelect) IntsX

func (s *ProviderSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*ProviderSelect) Scan

func (ps *ProviderSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*ProviderSelect) ScanX

func (s *ProviderSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*ProviderSelect) String

func (s *ProviderSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*ProviderSelect) StringX

func (s *ProviderSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*ProviderSelect) Strings

func (s *ProviderSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*ProviderSelect) StringsX

func (s *ProviderSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type ProviderUpdate

type ProviderUpdate struct {
	// contains filtered or unexported fields
}

ProviderUpdate is the builder for updating Provider entities.

func (*ProviderUpdate) AddBlueprintIDs

func (pu *ProviderUpdate) AddBlueprintIDs(ids ...uuid.UUID) *ProviderUpdate

AddBlueprintIDs adds the "blueprints" edge to the Blueprint entity by IDs.

func (*ProviderUpdate) AddBlueprints

func (pu *ProviderUpdate) AddBlueprints(b ...*Blueprint) *ProviderUpdate

AddBlueprints adds the "blueprints" edges to the Blueprint entity.

func (*ProviderUpdate) ClearBlueprints

func (pu *ProviderUpdate) ClearBlueprints() *ProviderUpdate

ClearBlueprints clears all "blueprints" edges to the Blueprint entity.

func (*ProviderUpdate) Exec

func (pu *ProviderUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*ProviderUpdate) ExecX

func (pu *ProviderUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ProviderUpdate) Mutation

func (pu *ProviderUpdate) Mutation() *ProviderMutation

Mutation returns the ProviderMutation object of the builder.

func (*ProviderUpdate) RemoveBlueprintIDs

func (pu *ProviderUpdate) RemoveBlueprintIDs(ids ...uuid.UUID) *ProviderUpdate

RemoveBlueprintIDs removes the "blueprints" edge to Blueprint entities by IDs.

func (*ProviderUpdate) RemoveBlueprints

func (pu *ProviderUpdate) RemoveBlueprints(b ...*Blueprint) *ProviderUpdate

RemoveBlueprints removes "blueprints" edges to Blueprint entities.

func (*ProviderUpdate) Save

func (pu *ProviderUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*ProviderUpdate) SaveX

func (pu *ProviderUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*ProviderUpdate) SetConfigBytes

func (pu *ProviderUpdate) SetConfigBytes(b []byte) *ProviderUpdate

SetConfigBytes sets the "config_bytes" field.

func (*ProviderUpdate) SetDisplayName

func (pu *ProviderUpdate) SetDisplayName(s string) *ProviderUpdate

SetDisplayName sets the "display_name" field.

func (*ProviderUpdate) SetIsLoaded

func (pu *ProviderUpdate) SetIsLoaded(b bool) *ProviderUpdate

SetIsLoaded sets the "is_loaded" field.

func (*ProviderUpdate) SetNillableDisplayName

func (pu *ProviderUpdate) SetNillableDisplayName(s *string) *ProviderUpdate

SetNillableDisplayName sets the "display_name" field if the given value is not nil.

func (*ProviderUpdate) SetNillableIsLoaded

func (pu *ProviderUpdate) SetNillableIsLoaded(b *bool) *ProviderUpdate

SetNillableIsLoaded sets the "is_loaded" field if the given value is not nil.

func (*ProviderUpdate) SetNillableProviderGitURL

func (pu *ProviderUpdate) SetNillableProviderGitURL(s *string) *ProviderUpdate

SetNillableProviderGitURL sets the "provider_git_url" field if the given value is not nil.

func (*ProviderUpdate) SetNillableProviderVersion

func (pu *ProviderUpdate) SetNillableProviderVersion(s *string) *ProviderUpdate

SetNillableProviderVersion sets the "provider_version" field if the given value is not nil.

func (*ProviderUpdate) SetProviderGitURL

func (pu *ProviderUpdate) SetProviderGitURL(s string) *ProviderUpdate

SetProviderGitURL sets the "provider_git_url" field.

func (*ProviderUpdate) SetProviderVersion

func (pu *ProviderUpdate) SetProviderVersion(s string) *ProviderUpdate

SetProviderVersion sets the "provider_version" field.

func (*ProviderUpdate) SetUpdatedAt

func (pu *ProviderUpdate) SetUpdatedAt(t time.Time) *ProviderUpdate

SetUpdatedAt sets the "updated_at" field.

func (*ProviderUpdate) Where

func (pu *ProviderUpdate) Where(ps ...predicate.Provider) *ProviderUpdate

Where appends a list predicates to the ProviderUpdate builder.

type ProviderUpdateOne

type ProviderUpdateOne struct {
	// contains filtered or unexported fields
}

ProviderUpdateOne is the builder for updating a single Provider entity.

func (*ProviderUpdateOne) AddBlueprintIDs

func (puo *ProviderUpdateOne) AddBlueprintIDs(ids ...uuid.UUID) *ProviderUpdateOne

AddBlueprintIDs adds the "blueprints" edge to the Blueprint entity by IDs.

func (*ProviderUpdateOne) AddBlueprints

func (puo *ProviderUpdateOne) AddBlueprints(b ...*Blueprint) *ProviderUpdateOne

AddBlueprints adds the "blueprints" edges to the Blueprint entity.

func (*ProviderUpdateOne) ClearBlueprints

func (puo *ProviderUpdateOne) ClearBlueprints() *ProviderUpdateOne

ClearBlueprints clears all "blueprints" edges to the Blueprint entity.

func (*ProviderUpdateOne) Exec

func (puo *ProviderUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*ProviderUpdateOne) ExecX

func (puo *ProviderUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ProviderUpdateOne) Mutation

func (puo *ProviderUpdateOne) Mutation() *ProviderMutation

Mutation returns the ProviderMutation object of the builder.

func (*ProviderUpdateOne) RemoveBlueprintIDs

func (puo *ProviderUpdateOne) RemoveBlueprintIDs(ids ...uuid.UUID) *ProviderUpdateOne

RemoveBlueprintIDs removes the "blueprints" edge to Blueprint entities by IDs.

func (*ProviderUpdateOne) RemoveBlueprints

func (puo *ProviderUpdateOne) RemoveBlueprints(b ...*Blueprint) *ProviderUpdateOne

RemoveBlueprints removes "blueprints" edges to Blueprint entities.

func (*ProviderUpdateOne) Save

func (puo *ProviderUpdateOne) Save(ctx context.Context) (*Provider, error)

Save executes the query and returns the updated Provider entity.

func (*ProviderUpdateOne) SaveX

func (puo *ProviderUpdateOne) SaveX(ctx context.Context) *Provider

SaveX is like Save, but panics if an error occurs.

func (*ProviderUpdateOne) Select

func (puo *ProviderUpdateOne) Select(field string, fields ...string) *ProviderUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*ProviderUpdateOne) SetConfigBytes

func (puo *ProviderUpdateOne) SetConfigBytes(b []byte) *ProviderUpdateOne

SetConfigBytes sets the "config_bytes" field.

func (*ProviderUpdateOne) SetDisplayName

func (puo *ProviderUpdateOne) SetDisplayName(s string) *ProviderUpdateOne

SetDisplayName sets the "display_name" field.

func (*ProviderUpdateOne) SetIsLoaded

func (puo *ProviderUpdateOne) SetIsLoaded(b bool) *ProviderUpdateOne

SetIsLoaded sets the "is_loaded" field.

func (*ProviderUpdateOne) SetNillableDisplayName

func (puo *ProviderUpdateOne) SetNillableDisplayName(s *string) *ProviderUpdateOne

SetNillableDisplayName sets the "display_name" field if the given value is not nil.

func (*ProviderUpdateOne) SetNillableIsLoaded

func (puo *ProviderUpdateOne) SetNillableIsLoaded(b *bool) *ProviderUpdateOne

SetNillableIsLoaded sets the "is_loaded" field if the given value is not nil.

func (*ProviderUpdateOne) SetNillableProviderGitURL

func (puo *ProviderUpdateOne) SetNillableProviderGitURL(s *string) *ProviderUpdateOne

SetNillableProviderGitURL sets the "provider_git_url" field if the given value is not nil.

func (*ProviderUpdateOne) SetNillableProviderVersion

func (puo *ProviderUpdateOne) SetNillableProviderVersion(s *string) *ProviderUpdateOne

SetNillableProviderVersion sets the "provider_version" field if the given value is not nil.

func (*ProviderUpdateOne) SetProviderGitURL

func (puo *ProviderUpdateOne) SetProviderGitURL(s string) *ProviderUpdateOne

SetProviderGitURL sets the "provider_git_url" field.

func (*ProviderUpdateOne) SetProviderVersion

func (puo *ProviderUpdateOne) SetProviderVersion(s string) *ProviderUpdateOne

SetProviderVersion sets the "provider_version" field.

func (*ProviderUpdateOne) SetUpdatedAt

func (puo *ProviderUpdateOne) SetUpdatedAt(t time.Time) *ProviderUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*ProviderUpdateOne) Where

Where appends a list predicates to the ProviderUpdate builder.

type Providers

type Providers []*Provider

Providers is a parsable slice of Provider.

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 Resource

type Resource struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// UpdatedAt holds the value of the "updated_at" field.
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// Type holds the value of the "type" field.
	Type resource.Type `json:"type,omitempty"`
	// The resource/data key from the blueprint
	Key string `json:"key,omitempty"`
	// The resource/data string from the blueprint
	ResourceType string `json:"resource_type,omitempty"`
	// The features supported by this resource
	Features provider.Features `json:"features,omitempty"`
	// The quota space required by this resource
	QuotaRequirements provider.QuotaRequirements `json:"quota_requirements,omitempty"`
	// The entire resource/data object from the blueprint
	Object *models.Object `json:"object,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the ResourceQuery when eager-loading is set.
	Edges ResourceEdges `json:"edges"`
	// contains filtered or unexported fields
}

Resource is the model entity for the Resource schema.

func (*Resource) QueryBlueprint

func (r *Resource) QueryBlueprint() *BlueprintQuery

QueryBlueprint queries the "blueprint" edge of the Resource entity.

func (*Resource) QueryDependsOn

func (r *Resource) QueryDependsOn() *ResourceQuery

QueryDependsOn queries the "depends_on" edge of the Resource entity.

func (*Resource) QueryRequiredBy

func (r *Resource) QueryRequiredBy() *ResourceQuery

QueryRequiredBy queries the "required_by" edge of the Resource entity.

func (*Resource) String

func (r *Resource) String() string

String implements the fmt.Stringer.

func (*Resource) Unwrap

func (r *Resource) Unwrap() *Resource

Unwrap unwraps the Resource 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 (*Resource) Update

func (r *Resource) Update() *ResourceUpdateOne

Update returns a builder for updating this Resource. Note that you need to call Resource.Unwrap() before calling this method if this Resource was returned from a transaction, and the transaction was committed or rolled back.

func (*Resource) Value

func (r *Resource) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the Resource. This includes values selected through modifiers, order, etc.

type ResourceClient

type ResourceClient struct {
	// contains filtered or unexported fields
}

ResourceClient is a client for the Resource schema.

func NewResourceClient

func NewResourceClient(c config) *ResourceClient

NewResourceClient returns a client for the Resource from the given config.

func (*ResourceClient) Create

func (c *ResourceClient) Create() *ResourceCreate

Create returns a builder for creating a Resource entity.

func (*ResourceClient) CreateBulk

func (c *ResourceClient) CreateBulk(builders ...*ResourceCreate) *ResourceCreateBulk

CreateBulk returns a builder for creating a bulk of Resource entities.

func (*ResourceClient) Delete

func (c *ResourceClient) Delete() *ResourceDelete

Delete returns a delete builder for Resource.

func (*ResourceClient) DeleteOne

func (c *ResourceClient) DeleteOne(r *Resource) *ResourceDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*ResourceClient) DeleteOneID

func (c *ResourceClient) DeleteOneID(id uuid.UUID) *ResourceDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*ResourceClient) Get

func (c *ResourceClient) Get(ctx context.Context, id uuid.UUID) (*Resource, error)

Get returns a Resource entity by its id.

func (*ResourceClient) GetX

func (c *ResourceClient) GetX(ctx context.Context, id uuid.UUID) *Resource

GetX is like Get, but panics if an error occurs.

func (*ResourceClient) Hooks

func (c *ResourceClient) Hooks() []Hook

Hooks returns the client hooks.

func (*ResourceClient) Intercept

func (c *ResourceClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `resource.Intercept(f(g(h())))`.

func (*ResourceClient) Interceptors

func (c *ResourceClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*ResourceClient) MapCreateBulk

func (c *ResourceClient) MapCreateBulk(slice any, setFunc func(*ResourceCreate, int)) *ResourceCreateBulk

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 (*ResourceClient) Query

func (c *ResourceClient) Query() *ResourceQuery

Query returns a query builder for Resource.

func (*ResourceClient) QueryBlueprint

func (c *ResourceClient) QueryBlueprint(r *Resource) *BlueprintQuery

QueryBlueprint queries the blueprint edge of a Resource.

func (*ResourceClient) QueryDependsOn

func (c *ResourceClient) QueryDependsOn(r *Resource) *ResourceQuery

QueryDependsOn queries the depends_on edge of a Resource.

func (*ResourceClient) QueryRequiredBy

func (c *ResourceClient) QueryRequiredBy(r *Resource) *ResourceQuery

QueryRequiredBy queries the required_by edge of a Resource.

func (*ResourceClient) Update

func (c *ResourceClient) Update() *ResourceUpdate

Update returns an update builder for Resource.

func (*ResourceClient) UpdateOne

func (c *ResourceClient) UpdateOne(r *Resource) *ResourceUpdateOne

UpdateOne returns an update builder for the given entity.

func (*ResourceClient) UpdateOneID

func (c *ResourceClient) UpdateOneID(id uuid.UUID) *ResourceUpdateOne

UpdateOneID returns an update builder for the given id.

func (*ResourceClient) Use

func (c *ResourceClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `resource.Hooks(f(g(h())))`.

type ResourceCreate

type ResourceCreate struct {
	// contains filtered or unexported fields
}

ResourceCreate is the builder for creating a Resource entity.

func (*ResourceCreate) AddDependsOn

func (rc *ResourceCreate) AddDependsOn(r ...*Resource) *ResourceCreate

AddDependsOn adds the "depends_on" edges to the Resource entity.

func (*ResourceCreate) AddDependsOnIDs

func (rc *ResourceCreate) AddDependsOnIDs(ids ...uuid.UUID) *ResourceCreate

AddDependsOnIDs adds the "depends_on" edge to the Resource entity by IDs.

func (*ResourceCreate) AddRequiredBy

func (rc *ResourceCreate) AddRequiredBy(r ...*Resource) *ResourceCreate

AddRequiredBy adds the "required_by" edges to the Resource entity.

func (*ResourceCreate) AddRequiredByIDs

func (rc *ResourceCreate) AddRequiredByIDs(ids ...uuid.UUID) *ResourceCreate

AddRequiredByIDs adds the "required_by" edge to the Resource entity by IDs.

func (*ResourceCreate) Exec

func (rc *ResourceCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*ResourceCreate) ExecX

func (rc *ResourceCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ResourceCreate) Mutation

func (rc *ResourceCreate) Mutation() *ResourceMutation

Mutation returns the ResourceMutation object of the builder.

func (*ResourceCreate) Save

func (rc *ResourceCreate) Save(ctx context.Context) (*Resource, error)

Save creates the Resource in the database.

func (*ResourceCreate) SaveX

func (rc *ResourceCreate) SaveX(ctx context.Context) *Resource

SaveX calls Save and panics if Save returns an error.

func (*ResourceCreate) SetBlueprint

func (rc *ResourceCreate) SetBlueprint(b *Blueprint) *ResourceCreate

SetBlueprint sets the "blueprint" edge to the Blueprint entity.

func (*ResourceCreate) SetBlueprintID

func (rc *ResourceCreate) SetBlueprintID(id uuid.UUID) *ResourceCreate

SetBlueprintID sets the "blueprint" edge to the Blueprint entity by ID.

func (*ResourceCreate) SetCreatedAt

func (rc *ResourceCreate) SetCreatedAt(t time.Time) *ResourceCreate

SetCreatedAt sets the "created_at" field.

func (*ResourceCreate) SetFeatures

func (rc *ResourceCreate) SetFeatures(pr provider.Features) *ResourceCreate

SetFeatures sets the "features" field.

func (*ResourceCreate) SetID

func (rc *ResourceCreate) SetID(u uuid.UUID) *ResourceCreate

SetID sets the "id" field.

func (*ResourceCreate) SetKey

func (rc *ResourceCreate) SetKey(s string) *ResourceCreate

SetKey sets the "key" field.

func (*ResourceCreate) SetNillableCreatedAt

func (rc *ResourceCreate) SetNillableCreatedAt(t *time.Time) *ResourceCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*ResourceCreate) SetNillableFeatures

func (rc *ResourceCreate) SetNillableFeatures(pr *provider.Features) *ResourceCreate

SetNillableFeatures sets the "features" field if the given value is not nil.

func (*ResourceCreate) SetNillableID

func (rc *ResourceCreate) SetNillableID(u *uuid.UUID) *ResourceCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*ResourceCreate) SetNillableQuotaRequirements

func (rc *ResourceCreate) SetNillableQuotaRequirements(pr *provider.QuotaRequirements) *ResourceCreate

SetNillableQuotaRequirements sets the "quota_requirements" field if the given value is not nil.

func (*ResourceCreate) SetNillableType

func (rc *ResourceCreate) SetNillableType(r *resource.Type) *ResourceCreate

SetNillableType sets the "type" field if the given value is not nil.

func (*ResourceCreate) SetNillableUpdatedAt

func (rc *ResourceCreate) SetNillableUpdatedAt(t *time.Time) *ResourceCreate

SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.

func (*ResourceCreate) SetObject

func (rc *ResourceCreate) SetObject(m *models.Object) *ResourceCreate

SetObject sets the "object" field.

func (*ResourceCreate) SetQuotaRequirements

func (rc *ResourceCreate) SetQuotaRequirements(pr provider.QuotaRequirements) *ResourceCreate

SetQuotaRequirements sets the "quota_requirements" field.

func (*ResourceCreate) SetResourceType

func (rc *ResourceCreate) SetResourceType(s string) *ResourceCreate

SetResourceType sets the "resource_type" field.

func (*ResourceCreate) SetType

func (rc *ResourceCreate) SetType(r resource.Type) *ResourceCreate

SetType sets the "type" field.

func (*ResourceCreate) SetUpdatedAt

func (rc *ResourceCreate) SetUpdatedAt(t time.Time) *ResourceCreate

SetUpdatedAt sets the "updated_at" field.

type ResourceCreateBulk

type ResourceCreateBulk struct {
	// contains filtered or unexported fields
}

ResourceCreateBulk is the builder for creating many Resource entities in bulk.

func (*ResourceCreateBulk) Exec

func (rcb *ResourceCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*ResourceCreateBulk) ExecX

func (rcb *ResourceCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ResourceCreateBulk) Save

func (rcb *ResourceCreateBulk) Save(ctx context.Context) ([]*Resource, error)

Save creates the Resource entities in the database.

func (*ResourceCreateBulk) SaveX

func (rcb *ResourceCreateBulk) SaveX(ctx context.Context) []*Resource

SaveX is like Save, but panics if an error occurs.

type ResourceDelete

type ResourceDelete struct {
	// contains filtered or unexported fields
}

ResourceDelete is the builder for deleting a Resource entity.

func (*ResourceDelete) Exec

func (rd *ResourceDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*ResourceDelete) ExecX

func (rd *ResourceDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*ResourceDelete) Where

func (rd *ResourceDelete) Where(ps ...predicate.Resource) *ResourceDelete

Where appends a list predicates to the ResourceDelete builder.

type ResourceDeleteOne

type ResourceDeleteOne struct {
	// contains filtered or unexported fields
}

ResourceDeleteOne is the builder for deleting a single Resource entity.

func (*ResourceDeleteOne) Exec

func (rdo *ResourceDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*ResourceDeleteOne) ExecX

func (rdo *ResourceDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ResourceDeleteOne) Where

Where appends a list predicates to the ResourceDelete builder.

type ResourceEdges

type ResourceEdges struct {
	// Blueprint containing this resource
	Blueprint *Blueprint `json:"blueprint,omitempty"`
	// Stores all dependencies of this resource
	DependsOn []*Resource `json:"depends_on,omitempty"`
	// Stores all dependents of this resource
	RequiredBy []*Resource `json:"required_by,omitempty"`
	// contains filtered or unexported fields
}

ResourceEdges holds the relations/edges for other nodes in the graph.

func (ResourceEdges) BlueprintOrErr

func (e ResourceEdges) BlueprintOrErr() (*Blueprint, error)

BlueprintOrErr returns the Blueprint value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

func (ResourceEdges) DependsOnOrErr

func (e ResourceEdges) DependsOnOrErr() ([]*Resource, error)

DependsOnOrErr returns the DependsOn value or an error if the edge was not loaded in eager-loading.

func (ResourceEdges) RequiredByOrErr

func (e ResourceEdges) RequiredByOrErr() ([]*Resource, error)

RequiredByOrErr returns the RequiredBy value or an error if the edge was not loaded in eager-loading.

type ResourceGroupBy

type ResourceGroupBy struct {
	// contains filtered or unexported fields
}

ResourceGroupBy is the group-by builder for Resource entities.

func (*ResourceGroupBy) Aggregate

func (rgb *ResourceGroupBy) Aggregate(fns ...AggregateFunc) *ResourceGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*ResourceGroupBy) Bool

func (s *ResourceGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*ResourceGroupBy) BoolX

func (s *ResourceGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*ResourceGroupBy) Bools

func (s *ResourceGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*ResourceGroupBy) BoolsX

func (s *ResourceGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*ResourceGroupBy) Float64

func (s *ResourceGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*ResourceGroupBy) Float64X

func (s *ResourceGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*ResourceGroupBy) Float64s

func (s *ResourceGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*ResourceGroupBy) Float64sX

func (s *ResourceGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*ResourceGroupBy) Int

func (s *ResourceGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*ResourceGroupBy) IntX

func (s *ResourceGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*ResourceGroupBy) Ints

func (s *ResourceGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*ResourceGroupBy) IntsX

func (s *ResourceGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*ResourceGroupBy) Scan

func (rgb *ResourceGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*ResourceGroupBy) ScanX

func (s *ResourceGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*ResourceGroupBy) String

func (s *ResourceGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*ResourceGroupBy) StringX

func (s *ResourceGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*ResourceGroupBy) Strings

func (s *ResourceGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*ResourceGroupBy) StringsX

func (s *ResourceGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type ResourceMutation

type ResourceMutation struct {
	// contains filtered or unexported fields
}

ResourceMutation represents an operation that mutates the Resource nodes in the graph.

func (*ResourceMutation) AddDependsOnIDs

func (m *ResourceMutation) AddDependsOnIDs(ids ...uuid.UUID)

AddDependsOnIDs adds the "depends_on" edge to the Resource entity by ids.

func (*ResourceMutation) AddField

func (m *ResourceMutation) 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 (*ResourceMutation) AddRequiredByIDs

func (m *ResourceMutation) AddRequiredByIDs(ids ...uuid.UUID)

AddRequiredByIDs adds the "required_by" edge to the Resource entity by ids.

func (*ResourceMutation) AddedEdges

func (m *ResourceMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*ResourceMutation) AddedField

func (m *ResourceMutation) 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 (*ResourceMutation) AddedFields

func (m *ResourceMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*ResourceMutation) AddedIDs

func (m *ResourceMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*ResourceMutation) BlueprintCleared

func (m *ResourceMutation) BlueprintCleared() bool

BlueprintCleared reports if the "blueprint" edge to the Blueprint entity was cleared.

func (*ResourceMutation) BlueprintID

func (m *ResourceMutation) BlueprintID() (id uuid.UUID, exists bool)

BlueprintID returns the "blueprint" edge ID in the mutation.

func (*ResourceMutation) BlueprintIDs

func (m *ResourceMutation) BlueprintIDs() (ids []uuid.UUID)

BlueprintIDs returns the "blueprint" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use BlueprintID instead. It exists only for internal usage by the builders.

func (*ResourceMutation) ClearBlueprint

func (m *ResourceMutation) ClearBlueprint()

ClearBlueprint clears the "blueprint" edge to the Blueprint entity.

func (*ResourceMutation) ClearDependsOn

func (m *ResourceMutation) ClearDependsOn()

ClearDependsOn clears the "depends_on" edge to the Resource entity.

func (*ResourceMutation) ClearEdge

func (m *ResourceMutation) 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 (*ResourceMutation) ClearFeatures

func (m *ResourceMutation) ClearFeatures()

ClearFeatures clears the value of the "features" field.

func (*ResourceMutation) ClearField

func (m *ResourceMutation) 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 (*ResourceMutation) ClearQuotaRequirements

func (m *ResourceMutation) ClearQuotaRequirements()

ClearQuotaRequirements clears the value of the "quota_requirements" field.

func (*ResourceMutation) ClearRequiredBy

func (m *ResourceMutation) ClearRequiredBy()

ClearRequiredBy clears the "required_by" edge to the Resource entity.

func (*ResourceMutation) ClearedEdges

func (m *ResourceMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*ResourceMutation) ClearedFields

func (m *ResourceMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (ResourceMutation) Client

func (m ResourceMutation) 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 (*ResourceMutation) CreatedAt

func (m *ResourceMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*ResourceMutation) DependsOnCleared

func (m *ResourceMutation) DependsOnCleared() bool

DependsOnCleared reports if the "depends_on" edge to the Resource entity was cleared.

func (*ResourceMutation) DependsOnIDs

func (m *ResourceMutation) DependsOnIDs() (ids []uuid.UUID)

DependsOnIDs returns the "depends_on" edge IDs in the mutation.

func (*ResourceMutation) EdgeCleared

func (m *ResourceMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*ResourceMutation) Features

func (m *ResourceMutation) Features() (r provider.Features, exists bool)

Features returns the value of the "features" field in the mutation.

func (*ResourceMutation) FeaturesCleared

func (m *ResourceMutation) FeaturesCleared() bool

FeaturesCleared returns if the "features" field was cleared in this mutation.

func (*ResourceMutation) Field

func (m *ResourceMutation) 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 (*ResourceMutation) FieldCleared

func (m *ResourceMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*ResourceMutation) Fields

func (m *ResourceMutation) 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 (*ResourceMutation) GetType

func (m *ResourceMutation) GetType() (r resource.Type, exists bool)

GetType returns the value of the "type" field in the mutation.

func (*ResourceMutation) ID

func (m *ResourceMutation) ID() (id uuid.UUID, 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 (*ResourceMutation) IDs

func (m *ResourceMutation) IDs(ctx context.Context) ([]uuid.UUID, 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 (*ResourceMutation) Key

func (m *ResourceMutation) Key() (r string, exists bool)

Key returns the value of the "key" field in the mutation.

func (*ResourceMutation) Object

func (m *ResourceMutation) Object() (r *models.Object, exists bool)

Object returns the value of the "object" field in the mutation.

func (*ResourceMutation) OldCreatedAt

func (m *ResourceMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the Resource entity. If the Resource 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 (*ResourceMutation) OldFeatures

func (m *ResourceMutation) OldFeatures(ctx context.Context) (v provider.Features, err error)

OldFeatures returns the old "features" field's value of the Resource entity. If the Resource 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 (*ResourceMutation) OldField

func (m *ResourceMutation) 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 (*ResourceMutation) OldKey

func (m *ResourceMutation) OldKey(ctx context.Context) (v string, err error)

OldKey returns the old "key" field's value of the Resource entity. If the Resource 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 (*ResourceMutation) OldObject

func (m *ResourceMutation) OldObject(ctx context.Context) (v *models.Object, err error)

OldObject returns the old "object" field's value of the Resource entity. If the Resource 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 (*ResourceMutation) OldQuotaRequirements

func (m *ResourceMutation) OldQuotaRequirements(ctx context.Context) (v provider.QuotaRequirements, err error)

OldQuotaRequirements returns the old "quota_requirements" field's value of the Resource entity. If the Resource 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 (*ResourceMutation) OldResourceType

func (m *ResourceMutation) OldResourceType(ctx context.Context) (v string, err error)

OldResourceType returns the old "resource_type" field's value of the Resource entity. If the Resource 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 (*ResourceMutation) OldType

func (m *ResourceMutation) OldType(ctx context.Context) (v resource.Type, err error)

OldType returns the old "type" field's value of the Resource entity. If the Resource 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 (*ResourceMutation) OldUpdatedAt

func (m *ResourceMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)

OldUpdatedAt returns the old "updated_at" field's value of the Resource entity. If the Resource 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 (*ResourceMutation) Op

func (m *ResourceMutation) Op() Op

Op returns the operation name.

func (*ResourceMutation) QuotaRequirements

func (m *ResourceMutation) QuotaRequirements() (r provider.QuotaRequirements, exists bool)

QuotaRequirements returns the value of the "quota_requirements" field in the mutation.

func (*ResourceMutation) QuotaRequirementsCleared

func (m *ResourceMutation) QuotaRequirementsCleared() bool

QuotaRequirementsCleared returns if the "quota_requirements" field was cleared in this mutation.

func (*ResourceMutation) RemoveDependsOnIDs

func (m *ResourceMutation) RemoveDependsOnIDs(ids ...uuid.UUID)

RemoveDependsOnIDs removes the "depends_on" edge to the Resource entity by IDs.

func (*ResourceMutation) RemoveRequiredByIDs

func (m *ResourceMutation) RemoveRequiredByIDs(ids ...uuid.UUID)

RemoveRequiredByIDs removes the "required_by" edge to the Resource entity by IDs.

func (*ResourceMutation) RemovedDependsOnIDs

func (m *ResourceMutation) RemovedDependsOnIDs() (ids []uuid.UUID)

RemovedDependsOn returns the removed IDs of the "depends_on" edge to the Resource entity.

func (*ResourceMutation) RemovedEdges

func (m *ResourceMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*ResourceMutation) RemovedIDs

func (m *ResourceMutation) 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 (*ResourceMutation) RemovedRequiredByIDs

func (m *ResourceMutation) RemovedRequiredByIDs() (ids []uuid.UUID)

RemovedRequiredBy returns the removed IDs of the "required_by" edge to the Resource entity.

func (*ResourceMutation) RequiredByCleared

func (m *ResourceMutation) RequiredByCleared() bool

RequiredByCleared reports if the "required_by" edge to the Resource entity was cleared.

func (*ResourceMutation) RequiredByIDs

func (m *ResourceMutation) RequiredByIDs() (ids []uuid.UUID)

RequiredByIDs returns the "required_by" edge IDs in the mutation.

func (*ResourceMutation) ResetBlueprint

func (m *ResourceMutation) ResetBlueprint()

ResetBlueprint resets all changes to the "blueprint" edge.

func (*ResourceMutation) ResetCreatedAt

func (m *ResourceMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*ResourceMutation) ResetDependsOn

func (m *ResourceMutation) ResetDependsOn()

ResetDependsOn resets all changes to the "depends_on" edge.

func (*ResourceMutation) ResetEdge

func (m *ResourceMutation) 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 (*ResourceMutation) ResetFeatures

func (m *ResourceMutation) ResetFeatures()

ResetFeatures resets all changes to the "features" field.

func (*ResourceMutation) ResetField

func (m *ResourceMutation) 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 (*ResourceMutation) ResetKey

func (m *ResourceMutation) ResetKey()

ResetKey resets all changes to the "key" field.

func (*ResourceMutation) ResetObject

func (m *ResourceMutation) ResetObject()

ResetObject resets all changes to the "object" field.

func (*ResourceMutation) ResetQuotaRequirements

func (m *ResourceMutation) ResetQuotaRequirements()

ResetQuotaRequirements resets all changes to the "quota_requirements" field.

func (*ResourceMutation) ResetRequiredBy

func (m *ResourceMutation) ResetRequiredBy()

ResetRequiredBy resets all changes to the "required_by" edge.

func (*ResourceMutation) ResetResourceType

func (m *ResourceMutation) ResetResourceType()

ResetResourceType resets all changes to the "resource_type" field.

func (*ResourceMutation) ResetType

func (m *ResourceMutation) ResetType()

ResetType resets all changes to the "type" field.

func (*ResourceMutation) ResetUpdatedAt

func (m *ResourceMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*ResourceMutation) ResourceType

func (m *ResourceMutation) ResourceType() (r string, exists bool)

ResourceType returns the value of the "resource_type" field in the mutation.

func (*ResourceMutation) SetBlueprintID

func (m *ResourceMutation) SetBlueprintID(id uuid.UUID)

SetBlueprintID sets the "blueprint" edge to the Blueprint entity by id.

func (*ResourceMutation) SetCreatedAt

func (m *ResourceMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*ResourceMutation) SetFeatures

func (m *ResourceMutation) SetFeatures(pr provider.Features)

SetFeatures sets the "features" field.

func (*ResourceMutation) SetField

func (m *ResourceMutation) 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 (*ResourceMutation) SetID

func (m *ResourceMutation) SetID(id uuid.UUID)

SetID sets the value of the id field. Note that this operation is only accepted on creation of Resource entities.

func (*ResourceMutation) SetKey

func (m *ResourceMutation) SetKey(s string)

SetKey sets the "key" field.

func (*ResourceMutation) SetObject

func (m *ResourceMutation) SetObject(value *models.Object)

SetObject sets the "object" field.

func (*ResourceMutation) SetOp

func (m *ResourceMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*ResourceMutation) SetQuotaRequirements

func (m *ResourceMutation) SetQuotaRequirements(pr provider.QuotaRequirements)

SetQuotaRequirements sets the "quota_requirements" field.

func (*ResourceMutation) SetResourceType

func (m *ResourceMutation) SetResourceType(s string)

SetResourceType sets the "resource_type" field.

func (*ResourceMutation) SetType

func (m *ResourceMutation) SetType(r resource.Type)

SetType sets the "type" field.

func (*ResourceMutation) SetUpdatedAt

func (m *ResourceMutation) SetUpdatedAt(t time.Time)

SetUpdatedAt sets the "updated_at" field.

func (ResourceMutation) Tx

func (m ResourceMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*ResourceMutation) Type

func (m *ResourceMutation) Type() string

Type returns the node type of this mutation (Resource).

func (*ResourceMutation) UpdatedAt

func (m *ResourceMutation) UpdatedAt() (r time.Time, exists bool)

UpdatedAt returns the value of the "updated_at" field in the mutation.

func (*ResourceMutation) Where

func (m *ResourceMutation) Where(ps ...predicate.Resource)

Where appends a list predicates to the ResourceMutation builder.

func (*ResourceMutation) WhereP

func (m *ResourceMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the ResourceMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type ResourceQuery

type ResourceQuery struct {
	// contains filtered or unexported fields
}

ResourceQuery is the builder for querying Resource entities.

func (*ResourceQuery) Aggregate

func (rq *ResourceQuery) Aggregate(fns ...AggregateFunc) *ResourceSelect

Aggregate returns a ResourceSelect configured with the given aggregations.

func (*ResourceQuery) All

func (rq *ResourceQuery) All(ctx context.Context) ([]*Resource, error)

All executes the query and returns a list of Resources.

func (*ResourceQuery) AllX

func (rq *ResourceQuery) AllX(ctx context.Context) []*Resource

AllX is like All, but panics if an error occurs.

func (*ResourceQuery) Clone

func (rq *ResourceQuery) Clone() *ResourceQuery

Clone returns a duplicate of the ResourceQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*ResourceQuery) Count

func (rq *ResourceQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*ResourceQuery) CountX

func (rq *ResourceQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*ResourceQuery) Exist

func (rq *ResourceQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*ResourceQuery) ExistX

func (rq *ResourceQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*ResourceQuery) First

func (rq *ResourceQuery) First(ctx context.Context) (*Resource, error)

First returns the first Resource entity from the query. Returns a *NotFoundError when no Resource was found.

func (*ResourceQuery) FirstID

func (rq *ResourceQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

FirstID returns the first Resource ID from the query. Returns a *NotFoundError when no Resource ID was found.

func (*ResourceQuery) FirstIDX

func (rq *ResourceQuery) FirstIDX(ctx context.Context) uuid.UUID

FirstIDX is like FirstID, but panics if an error occurs.

func (*ResourceQuery) FirstX

func (rq *ResourceQuery) FirstX(ctx context.Context) *Resource

FirstX is like First, but panics if an error occurs.

func (*ResourceQuery) GroupBy

func (rq *ResourceQuery) GroupBy(field string, fields ...string) *ResourceGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

Example:

var v []struct {
	CreatedAt time.Time `json:"created_at,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Resource.Query().
	GroupBy(resource.FieldCreatedAt).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*ResourceQuery) IDs

func (rq *ResourceQuery) IDs(ctx context.Context) (ids []uuid.UUID, err error)

IDs executes the query and returns a list of Resource IDs.

func (*ResourceQuery) IDsX

func (rq *ResourceQuery) IDsX(ctx context.Context) []uuid.UUID

IDsX is like IDs, but panics if an error occurs.

func (*ResourceQuery) Limit

func (rq *ResourceQuery) Limit(limit int) *ResourceQuery

Limit the number of records to be returned by this query.

func (*ResourceQuery) Offset

func (rq *ResourceQuery) Offset(offset int) *ResourceQuery

Offset to start from.

func (*ResourceQuery) Only

func (rq *ResourceQuery) Only(ctx context.Context) (*Resource, error)

Only returns a single Resource entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Resource entity is found. Returns a *NotFoundError when no Resource entities are found.

func (*ResourceQuery) OnlyID

func (rq *ResourceQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

OnlyID is like Only, but returns the only Resource ID in the query. Returns a *NotSingularError when more than one Resource ID is found. Returns a *NotFoundError when no entities are found.

func (*ResourceQuery) OnlyIDX

func (rq *ResourceQuery) OnlyIDX(ctx context.Context) uuid.UUID

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*ResourceQuery) OnlyX

func (rq *ResourceQuery) OnlyX(ctx context.Context) *Resource

OnlyX is like Only, but panics if an error occurs.

func (*ResourceQuery) Order

Order specifies how the records should be ordered.

func (*ResourceQuery) QueryBlueprint

func (rq *ResourceQuery) QueryBlueprint() *BlueprintQuery

QueryBlueprint chains the current query on the "blueprint" edge.

func (*ResourceQuery) QueryDependsOn

func (rq *ResourceQuery) QueryDependsOn() *ResourceQuery

QueryDependsOn chains the current query on the "depends_on" edge.

func (*ResourceQuery) QueryRequiredBy

func (rq *ResourceQuery) QueryRequiredBy() *ResourceQuery

QueryRequiredBy chains the current query on the "required_by" edge.

func (*ResourceQuery) Select

func (rq *ResourceQuery) Select(fields ...string) *ResourceSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	CreatedAt time.Time `json:"created_at,omitempty"`
}

client.Resource.Query().
	Select(resource.FieldCreatedAt).
	Scan(ctx, &v)

func (*ResourceQuery) Unique

func (rq *ResourceQuery) Unique(unique bool) *ResourceQuery

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 (*ResourceQuery) Where

func (rq *ResourceQuery) Where(ps ...predicate.Resource) *ResourceQuery

Where adds a new predicate for the ResourceQuery builder.

func (*ResourceQuery) WithBlueprint

func (rq *ResourceQuery) WithBlueprint(opts ...func(*BlueprintQuery)) *ResourceQuery

WithBlueprint tells the query-builder to eager-load the nodes that are connected to the "blueprint" edge. The optional arguments are used to configure the query builder of the edge.

func (*ResourceQuery) WithDependsOn

func (rq *ResourceQuery) WithDependsOn(opts ...func(*ResourceQuery)) *ResourceQuery

WithDependsOn tells the query-builder to eager-load the nodes that are connected to the "depends_on" edge. The optional arguments are used to configure the query builder of the edge.

func (*ResourceQuery) WithRequiredBy

func (rq *ResourceQuery) WithRequiredBy(opts ...func(*ResourceQuery)) *ResourceQuery

WithRequiredBy tells the query-builder to eager-load the nodes that are connected to the "required_by" edge. The optional arguments are used to configure the query builder of the edge.

type ResourceSelect

type ResourceSelect struct {
	*ResourceQuery
	// contains filtered or unexported fields
}

ResourceSelect is the builder for selecting fields of Resource entities.

func (*ResourceSelect) Aggregate

func (rs *ResourceSelect) Aggregate(fns ...AggregateFunc) *ResourceSelect

Aggregate adds the given aggregation functions to the selector query.

func (*ResourceSelect) Bool

func (s *ResourceSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*ResourceSelect) BoolX

func (s *ResourceSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*ResourceSelect) Bools

func (s *ResourceSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*ResourceSelect) BoolsX

func (s *ResourceSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*ResourceSelect) Float64

func (s *ResourceSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*ResourceSelect) Float64X

func (s *ResourceSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*ResourceSelect) Float64s

func (s *ResourceSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*ResourceSelect) Float64sX

func (s *ResourceSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*ResourceSelect) Int

func (s *ResourceSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*ResourceSelect) IntX

func (s *ResourceSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*ResourceSelect) Ints

func (s *ResourceSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*ResourceSelect) IntsX

func (s *ResourceSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*ResourceSelect) Scan

func (rs *ResourceSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*ResourceSelect) ScanX

func (s *ResourceSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*ResourceSelect) String

func (s *ResourceSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*ResourceSelect) StringX

func (s *ResourceSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*ResourceSelect) Strings

func (s *ResourceSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*ResourceSelect) StringsX

func (s *ResourceSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type ResourceUpdate

type ResourceUpdate struct {
	// contains filtered or unexported fields
}

ResourceUpdate is the builder for updating Resource entities.

func (*ResourceUpdate) AddDependsOn

func (ru *ResourceUpdate) AddDependsOn(r ...*Resource) *ResourceUpdate

AddDependsOn adds the "depends_on" edges to the Resource entity.

func (*ResourceUpdate) AddDependsOnIDs

func (ru *ResourceUpdate) AddDependsOnIDs(ids ...uuid.UUID) *ResourceUpdate

AddDependsOnIDs adds the "depends_on" edge to the Resource entity by IDs.

func (*ResourceUpdate) AddRequiredBy

func (ru *ResourceUpdate) AddRequiredBy(r ...*Resource) *ResourceUpdate

AddRequiredBy adds the "required_by" edges to the Resource entity.

func (*ResourceUpdate) AddRequiredByIDs

func (ru *ResourceUpdate) AddRequiredByIDs(ids ...uuid.UUID) *ResourceUpdate

AddRequiredByIDs adds the "required_by" edge to the Resource entity by IDs.

func (*ResourceUpdate) ClearBlueprint

func (ru *ResourceUpdate) ClearBlueprint() *ResourceUpdate

ClearBlueprint clears the "blueprint" edge to the Blueprint entity.

func (*ResourceUpdate) ClearDependsOn

func (ru *ResourceUpdate) ClearDependsOn() *ResourceUpdate

ClearDependsOn clears all "depends_on" edges to the Resource entity.

func (*ResourceUpdate) ClearFeatures

func (ru *ResourceUpdate) ClearFeatures() *ResourceUpdate

ClearFeatures clears the value of the "features" field.

func (*ResourceUpdate) ClearQuotaRequirements

func (ru *ResourceUpdate) ClearQuotaRequirements() *ResourceUpdate

ClearQuotaRequirements clears the value of the "quota_requirements" field.

func (*ResourceUpdate) ClearRequiredBy

func (ru *ResourceUpdate) ClearRequiredBy() *ResourceUpdate

ClearRequiredBy clears all "required_by" edges to the Resource entity.

func (*ResourceUpdate) Exec

func (ru *ResourceUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*ResourceUpdate) ExecX

func (ru *ResourceUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ResourceUpdate) Mutation

func (ru *ResourceUpdate) Mutation() *ResourceMutation

Mutation returns the ResourceMutation object of the builder.

func (*ResourceUpdate) RemoveDependsOn

func (ru *ResourceUpdate) RemoveDependsOn(r ...*Resource) *ResourceUpdate

RemoveDependsOn removes "depends_on" edges to Resource entities.

func (*ResourceUpdate) RemoveDependsOnIDs

func (ru *ResourceUpdate) RemoveDependsOnIDs(ids ...uuid.UUID) *ResourceUpdate

RemoveDependsOnIDs removes the "depends_on" edge to Resource entities by IDs.

func (*ResourceUpdate) RemoveRequiredBy

func (ru *ResourceUpdate) RemoveRequiredBy(r ...*Resource) *ResourceUpdate

RemoveRequiredBy removes "required_by" edges to Resource entities.

func (*ResourceUpdate) RemoveRequiredByIDs

func (ru *ResourceUpdate) RemoveRequiredByIDs(ids ...uuid.UUID) *ResourceUpdate

RemoveRequiredByIDs removes the "required_by" edge to Resource entities by IDs.

func (*ResourceUpdate) Save

func (ru *ResourceUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*ResourceUpdate) SaveX

func (ru *ResourceUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*ResourceUpdate) SetBlueprint

func (ru *ResourceUpdate) SetBlueprint(b *Blueprint) *ResourceUpdate

SetBlueprint sets the "blueprint" edge to the Blueprint entity.

func (*ResourceUpdate) SetBlueprintID

func (ru *ResourceUpdate) SetBlueprintID(id uuid.UUID) *ResourceUpdate

SetBlueprintID sets the "blueprint" edge to the Blueprint entity by ID.

func (*ResourceUpdate) SetFeatures

func (ru *ResourceUpdate) SetFeatures(pr provider.Features) *ResourceUpdate

SetFeatures sets the "features" field.

func (*ResourceUpdate) SetKey

func (ru *ResourceUpdate) SetKey(s string) *ResourceUpdate

SetKey sets the "key" field.

func (*ResourceUpdate) SetNillableFeatures

func (ru *ResourceUpdate) SetNillableFeatures(pr *provider.Features) *ResourceUpdate

SetNillableFeatures sets the "features" field if the given value is not nil.

func (*ResourceUpdate) SetNillableKey

func (ru *ResourceUpdate) SetNillableKey(s *string) *ResourceUpdate

SetNillableKey sets the "key" field if the given value is not nil.

func (*ResourceUpdate) SetNillableQuotaRequirements

func (ru *ResourceUpdate) SetNillableQuotaRequirements(pr *provider.QuotaRequirements) *ResourceUpdate

SetNillableQuotaRequirements sets the "quota_requirements" field if the given value is not nil.

func (*ResourceUpdate) SetNillableResourceType

func (ru *ResourceUpdate) SetNillableResourceType(s *string) *ResourceUpdate

SetNillableResourceType sets the "resource_type" field if the given value is not nil.

func (*ResourceUpdate) SetNillableType

func (ru *ResourceUpdate) SetNillableType(r *resource.Type) *ResourceUpdate

SetNillableType sets the "type" field if the given value is not nil.

func (*ResourceUpdate) SetObject

func (ru *ResourceUpdate) SetObject(m *models.Object) *ResourceUpdate

SetObject sets the "object" field.

func (*ResourceUpdate) SetQuotaRequirements

func (ru *ResourceUpdate) SetQuotaRequirements(pr provider.QuotaRequirements) *ResourceUpdate

SetQuotaRequirements sets the "quota_requirements" field.

func (*ResourceUpdate) SetResourceType

func (ru *ResourceUpdate) SetResourceType(s string) *ResourceUpdate

SetResourceType sets the "resource_type" field.

func (*ResourceUpdate) SetType

func (ru *ResourceUpdate) SetType(r resource.Type) *ResourceUpdate

SetType sets the "type" field.

func (*ResourceUpdate) SetUpdatedAt

func (ru *ResourceUpdate) SetUpdatedAt(t time.Time) *ResourceUpdate

SetUpdatedAt sets the "updated_at" field.

func (*ResourceUpdate) Where

func (ru *ResourceUpdate) Where(ps ...predicate.Resource) *ResourceUpdate

Where appends a list predicates to the ResourceUpdate builder.

type ResourceUpdateOne

type ResourceUpdateOne struct {
	// contains filtered or unexported fields
}

ResourceUpdateOne is the builder for updating a single Resource entity.

func (*ResourceUpdateOne) AddDependsOn

func (ruo *ResourceUpdateOne) AddDependsOn(r ...*Resource) *ResourceUpdateOne

AddDependsOn adds the "depends_on" edges to the Resource entity.

func (*ResourceUpdateOne) AddDependsOnIDs

func (ruo *ResourceUpdateOne) AddDependsOnIDs(ids ...uuid.UUID) *ResourceUpdateOne

AddDependsOnIDs adds the "depends_on" edge to the Resource entity by IDs.

func (*ResourceUpdateOne) AddRequiredBy

func (ruo *ResourceUpdateOne) AddRequiredBy(r ...*Resource) *ResourceUpdateOne

AddRequiredBy adds the "required_by" edges to the Resource entity.

func (*ResourceUpdateOne) AddRequiredByIDs

func (ruo *ResourceUpdateOne) AddRequiredByIDs(ids ...uuid.UUID) *ResourceUpdateOne

AddRequiredByIDs adds the "required_by" edge to the Resource entity by IDs.

func (*ResourceUpdateOne) ClearBlueprint

func (ruo *ResourceUpdateOne) ClearBlueprint() *ResourceUpdateOne

ClearBlueprint clears the "blueprint" edge to the Blueprint entity.

func (*ResourceUpdateOne) ClearDependsOn

func (ruo *ResourceUpdateOne) ClearDependsOn() *ResourceUpdateOne

ClearDependsOn clears all "depends_on" edges to the Resource entity.

func (*ResourceUpdateOne) ClearFeatures

func (ruo *ResourceUpdateOne) ClearFeatures() *ResourceUpdateOne

ClearFeatures clears the value of the "features" field.

func (*ResourceUpdateOne) ClearQuotaRequirements

func (ruo *ResourceUpdateOne) ClearQuotaRequirements() *ResourceUpdateOne

ClearQuotaRequirements clears the value of the "quota_requirements" field.

func (*ResourceUpdateOne) ClearRequiredBy

func (ruo *ResourceUpdateOne) ClearRequiredBy() *ResourceUpdateOne

ClearRequiredBy clears all "required_by" edges to the Resource entity.

func (*ResourceUpdateOne) Exec

func (ruo *ResourceUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*ResourceUpdateOne) ExecX

func (ruo *ResourceUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ResourceUpdateOne) Mutation

func (ruo *ResourceUpdateOne) Mutation() *ResourceMutation

Mutation returns the ResourceMutation object of the builder.

func (*ResourceUpdateOne) RemoveDependsOn

func (ruo *ResourceUpdateOne) RemoveDependsOn(r ...*Resource) *ResourceUpdateOne

RemoveDependsOn removes "depends_on" edges to Resource entities.

func (*ResourceUpdateOne) RemoveDependsOnIDs

func (ruo *ResourceUpdateOne) RemoveDependsOnIDs(ids ...uuid.UUID) *ResourceUpdateOne

RemoveDependsOnIDs removes the "depends_on" edge to Resource entities by IDs.

func (*ResourceUpdateOne) RemoveRequiredBy

func (ruo *ResourceUpdateOne) RemoveRequiredBy(r ...*Resource) *ResourceUpdateOne

RemoveRequiredBy removes "required_by" edges to Resource entities.

func (*ResourceUpdateOne) RemoveRequiredByIDs

func (ruo *ResourceUpdateOne) RemoveRequiredByIDs(ids ...uuid.UUID) *ResourceUpdateOne

RemoveRequiredByIDs removes the "required_by" edge to Resource entities by IDs.

func (*ResourceUpdateOne) Save

func (ruo *ResourceUpdateOne) Save(ctx context.Context) (*Resource, error)

Save executes the query and returns the updated Resource entity.

func (*ResourceUpdateOne) SaveX

func (ruo *ResourceUpdateOne) SaveX(ctx context.Context) *Resource

SaveX is like Save, but panics if an error occurs.

func (*ResourceUpdateOne) Select

func (ruo *ResourceUpdateOne) Select(field string, fields ...string) *ResourceUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*ResourceUpdateOne) SetBlueprint

func (ruo *ResourceUpdateOne) SetBlueprint(b *Blueprint) *ResourceUpdateOne

SetBlueprint sets the "blueprint" edge to the Blueprint entity.

func (*ResourceUpdateOne) SetBlueprintID

func (ruo *ResourceUpdateOne) SetBlueprintID(id uuid.UUID) *ResourceUpdateOne

SetBlueprintID sets the "blueprint" edge to the Blueprint entity by ID.

func (*ResourceUpdateOne) SetFeatures

func (ruo *ResourceUpdateOne) SetFeatures(pr provider.Features) *ResourceUpdateOne

SetFeatures sets the "features" field.

func (*ResourceUpdateOne) SetKey

func (ruo *ResourceUpdateOne) SetKey(s string) *ResourceUpdateOne

SetKey sets the "key" field.

func (*ResourceUpdateOne) SetNillableFeatures

func (ruo *ResourceUpdateOne) SetNillableFeatures(pr *provider.Features) *ResourceUpdateOne

SetNillableFeatures sets the "features" field if the given value is not nil.

func (*ResourceUpdateOne) SetNillableKey

func (ruo *ResourceUpdateOne) SetNillableKey(s *string) *ResourceUpdateOne

SetNillableKey sets the "key" field if the given value is not nil.

func (*ResourceUpdateOne) SetNillableQuotaRequirements

func (ruo *ResourceUpdateOne) SetNillableQuotaRequirements(pr *provider.QuotaRequirements) *ResourceUpdateOne

SetNillableQuotaRequirements sets the "quota_requirements" field if the given value is not nil.

func (*ResourceUpdateOne) SetNillableResourceType

func (ruo *ResourceUpdateOne) SetNillableResourceType(s *string) *ResourceUpdateOne

SetNillableResourceType sets the "resource_type" field if the given value is not nil.

func (*ResourceUpdateOne) SetNillableType

func (ruo *ResourceUpdateOne) SetNillableType(r *resource.Type) *ResourceUpdateOne

SetNillableType sets the "type" field if the given value is not nil.

func (*ResourceUpdateOne) SetObject

func (ruo *ResourceUpdateOne) SetObject(m *models.Object) *ResourceUpdateOne

SetObject sets the "object" field.

func (*ResourceUpdateOne) SetQuotaRequirements

func (ruo *ResourceUpdateOne) SetQuotaRequirements(pr provider.QuotaRequirements) *ResourceUpdateOne

SetQuotaRequirements sets the "quota_requirements" field.

func (*ResourceUpdateOne) SetResourceType

func (ruo *ResourceUpdateOne) SetResourceType(s string) *ResourceUpdateOne

SetResourceType sets the "resource_type" field.

func (*ResourceUpdateOne) SetType

SetType sets the "type" field.

func (*ResourceUpdateOne) SetUpdatedAt

func (ruo *ResourceUpdateOne) SetUpdatedAt(t time.Time) *ResourceUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*ResourceUpdateOne) Where

Where appends a list predicates to the ResourceUpdate builder.

type Resources

type Resources []*Resource

Resources is a parsable slice of Resource.

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 {

	// Blueprint is the client for interacting with the Blueprint builders.
	Blueprint *BlueprintClient
	// Deployment is the client for interacting with the Deployment builders.
	Deployment *DeploymentClient
	// DeploymentNode is the client for interacting with the DeploymentNode builders.
	DeploymentNode *DeploymentNodeClient
	// GrantedPermission is the client for interacting with the GrantedPermission builders.
	GrantedPermission *GrantedPermissionClient
	// Group is the client for interacting with the Group builders.
	Group *GroupClient
	// GroupMembership is the client for interacting with the GroupMembership builders.
	GroupMembership *GroupMembershipClient
	// Membership is the client for interacting with the Membership builders.
	Membership *MembershipClient
	// Project is the client for interacting with the Project builders.
	Project *ProjectClient
	// Provider is the client for interacting with the Provider builders.
	Provider *ProviderClient
	// Resource is the client for interacting with the Resource builders.
	Resource *ResourceClient
	// User is the client for interacting with the User builders.
	User *UserClient
	// contains filtered or unexported fields
}

Tx is a transactional client that is created by calling Client.Tx().

func TxFromContext

func TxFromContext(ctx context.Context) *Tx

TxFromContext returns a Tx stored inside a context, or nil if there isn't one.

func (*Tx) Client

func (tx *Tx) Client() *Client

Client returns a Client that binds to current transaction.

func (*Tx) Commit

func (tx *Tx) Commit() error

Commit commits the transaction.

func (*Tx) OnCommit

func (tx *Tx) OnCommit(f CommitHook)

OnCommit adds a hook to call on commit.

func (*Tx) OnRollback

func (tx *Tx) OnRollback(f RollbackHook)

OnRollback adds a hook to call on rollback.

func (*Tx) Rollback

func (tx *Tx) Rollback() error

Rollback rollbacks the transaction.

type User

type User struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// UpdatedAt holds the value of the "updated_at" field.
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// Username holds the value of the "username" field.
	Username string `json:"username,omitempty"`
	// Email holds the value of the "email" field.
	Email string `json:"email,omitempty"`
	// Password holds the value of the "password" field.
	Password string `json:"-"`
	// FirstName holds the value of the "first_name" field.
	FirstName string `json:"first_name,omitempty"`
	// LastName holds the value of the "last_name" field.
	LastName string `json:"last_name,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the UserQuery when eager-loading is set.
	Edges UserEdges `json:"edges"`
	// contains filtered or unexported fields
}

User is the model entity for the User schema.

func (*User) QueryDeployments

func (u *User) QueryDeployments() *DeploymentQuery

QueryDeployments queries the "deployments" edge of the User entity.

func (*User) QueryGroups

func (u *User) QueryGroups() *GroupQuery

QueryGroups queries the "groups" edge of the User entity.

func (*User) QueryProjects

func (u *User) QueryProjects() *ProjectQuery

QueryProjects queries the "projects" edge of the User entity.

func (*User) String

func (u *User) String() string

String implements the fmt.Stringer.

func (*User) Unwrap

func (u *User) Unwrap() *User

Unwrap unwraps the User entity that was returned from a transaction after it was closed, so that all future queries will be executed through the driver which created the transaction.

func (*User) Update

func (u *User) Update() *UserUpdateOne

Update returns a builder for updating this User. Note that you need to call User.Unwrap() before calling this method if this User was returned from a transaction, and the transaction was committed or rolled back.

func (*User) Value

func (u *User) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the User. This includes values selected through modifiers, order, etc.

type UserClient

type UserClient struct {
	// contains filtered or unexported fields
}

UserClient is a client for the User schema.

func NewUserClient

func NewUserClient(c config) *UserClient

NewUserClient returns a client for the User from the given config.

func (*UserClient) Create

func (c *UserClient) Create() *UserCreate

Create returns a builder for creating a User entity.

func (*UserClient) CreateBulk

func (c *UserClient) CreateBulk(builders ...*UserCreate) *UserCreateBulk

CreateBulk returns a builder for creating a bulk of User entities.

func (*UserClient) Delete

func (c *UserClient) Delete() *UserDelete

Delete returns a delete builder for User.

func (*UserClient) DeleteOne

func (c *UserClient) DeleteOne(u *User) *UserDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*UserClient) DeleteOneID

func (c *UserClient) DeleteOneID(id uuid.UUID) *UserDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*UserClient) Get

func (c *UserClient) Get(ctx context.Context, id uuid.UUID) (*User, error)

Get returns a User entity by its id.

func (*UserClient) GetX

func (c *UserClient) GetX(ctx context.Context, id uuid.UUID) *User

GetX is like Get, but panics if an error occurs.

func (*UserClient) Hooks

func (c *UserClient) Hooks() []Hook

Hooks returns the client hooks.

func (*UserClient) Intercept

func (c *UserClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `user.Intercept(f(g(h())))`.

func (*UserClient) Interceptors

func (c *UserClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*UserClient) MapCreateBulk

func (c *UserClient) MapCreateBulk(slice any, setFunc func(*UserCreate, int)) *UserCreateBulk

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 (*UserClient) Query

func (c *UserClient) Query() *UserQuery

Query returns a query builder for User.

func (*UserClient) QueryDeployments

func (c *UserClient) QueryDeployments(u *User) *DeploymentQuery

QueryDeployments queries the deployments edge of a User.

func (*UserClient) QueryGroups

func (c *UserClient) QueryGroups(u *User) *GroupQuery

QueryGroups queries the groups edge of a User.

func (*UserClient) QueryProjects

func (c *UserClient) QueryProjects(u *User) *ProjectQuery

QueryProjects queries the projects edge of a User.

func (*UserClient) Update

func (c *UserClient) Update() *UserUpdate

Update returns an update builder for User.

func (*UserClient) UpdateOne

func (c *UserClient) UpdateOne(u *User) *UserUpdateOne

UpdateOne returns an update builder for the given entity.

func (*UserClient) UpdateOneID

func (c *UserClient) UpdateOneID(id uuid.UUID) *UserUpdateOne

UpdateOneID returns an update builder for the given id.

func (*UserClient) Use

func (c *UserClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `user.Hooks(f(g(h())))`.

type UserCreate

type UserCreate struct {
	// contains filtered or unexported fields
}

UserCreate is the builder for creating a User entity.

func (*UserCreate) AddDeploymentIDs

func (uc *UserCreate) AddDeploymentIDs(ids ...uuid.UUID) *UserCreate

AddDeploymentIDs adds the "deployments" edge to the Deployment entity by IDs.

func (*UserCreate) AddDeployments

func (uc *UserCreate) AddDeployments(d ...*Deployment) *UserCreate

AddDeployments adds the "deployments" edges to the Deployment entity.

func (*UserCreate) AddGroupIDs

func (uc *UserCreate) AddGroupIDs(ids ...uuid.UUID) *UserCreate

AddGroupIDs adds the "groups" edge to the Group entity by IDs.

func (*UserCreate) AddGroups

func (uc *UserCreate) AddGroups(g ...*Group) *UserCreate

AddGroups adds the "groups" edges to the Group entity.

func (*UserCreate) AddProjectIDs

func (uc *UserCreate) AddProjectIDs(ids ...uuid.UUID) *UserCreate

AddProjectIDs adds the "projects" edge to the Project entity by IDs.

func (*UserCreate) AddProjects

func (uc *UserCreate) AddProjects(p ...*Project) *UserCreate

AddProjects adds the "projects" edges to the Project entity.

func (*UserCreate) Exec

func (uc *UserCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*UserCreate) ExecX

func (uc *UserCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserCreate) Mutation

func (uc *UserCreate) Mutation() *UserMutation

Mutation returns the UserMutation object of the builder.

func (*UserCreate) Save

func (uc *UserCreate) Save(ctx context.Context) (*User, error)

Save creates the User in the database.

func (*UserCreate) SaveX

func (uc *UserCreate) SaveX(ctx context.Context) *User

SaveX calls Save and panics if Save returns an error.

func (*UserCreate) SetCreatedAt

func (uc *UserCreate) SetCreatedAt(t time.Time) *UserCreate

SetCreatedAt sets the "created_at" field.

func (*UserCreate) SetEmail

func (uc *UserCreate) SetEmail(s string) *UserCreate

SetEmail sets the "email" field.

func (*UserCreate) SetFirstName

func (uc *UserCreate) SetFirstName(s string) *UserCreate

SetFirstName sets the "first_name" field.

func (*UserCreate) SetID

func (uc *UserCreate) SetID(u uuid.UUID) *UserCreate

SetID sets the "id" field.

func (*UserCreate) SetLastName

func (uc *UserCreate) SetLastName(s string) *UserCreate

SetLastName sets the "last_name" field.

func (*UserCreate) SetNillableCreatedAt

func (uc *UserCreate) SetNillableCreatedAt(t *time.Time) *UserCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*UserCreate) SetNillableID

func (uc *UserCreate) SetNillableID(u *uuid.UUID) *UserCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*UserCreate) SetNillableUpdatedAt

func (uc *UserCreate) SetNillableUpdatedAt(t *time.Time) *UserCreate

SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.

func (*UserCreate) SetPassword

func (uc *UserCreate) SetPassword(s string) *UserCreate

SetPassword sets the "password" field.

func (*UserCreate) SetUpdatedAt

func (uc *UserCreate) SetUpdatedAt(t time.Time) *UserCreate

SetUpdatedAt sets the "updated_at" field.

func (*UserCreate) SetUsername

func (uc *UserCreate) SetUsername(s string) *UserCreate

SetUsername sets the "username" field.

type UserCreateBulk

type UserCreateBulk struct {
	// contains filtered or unexported fields
}

UserCreateBulk is the builder for creating many User entities in bulk.

func (*UserCreateBulk) Exec

func (ucb *UserCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*UserCreateBulk) ExecX

func (ucb *UserCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserCreateBulk) Save

func (ucb *UserCreateBulk) Save(ctx context.Context) ([]*User, error)

Save creates the User entities in the database.

func (*UserCreateBulk) SaveX

func (ucb *UserCreateBulk) SaveX(ctx context.Context) []*User

SaveX is like Save, but panics if an error occurs.

type UserDelete

type UserDelete struct {
	// contains filtered or unexported fields
}

UserDelete is the builder for deleting a User entity.

func (*UserDelete) Exec

func (ud *UserDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*UserDelete) ExecX

func (ud *UserDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*UserDelete) Where

func (ud *UserDelete) Where(ps ...predicate.User) *UserDelete

Where appends a list predicates to the UserDelete builder.

type UserDeleteOne

type UserDeleteOne struct {
	// contains filtered or unexported fields
}

UserDeleteOne is the builder for deleting a single User entity.

func (*UserDeleteOne) Exec

func (udo *UserDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*UserDeleteOne) ExecX

func (udo *UserDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserDeleteOne) Where

func (udo *UserDeleteOne) Where(ps ...predicate.User) *UserDeleteOne

Where appends a list predicates to the UserDelete builder.

type UserEdges

type UserEdges struct {
	// Groups holds the value of the groups edge.
	Groups []*Group `json:"groups,omitempty"`
	// Deployments holds the value of the deployments edge.
	Deployments []*Deployment `json:"deployments,omitempty"`
	// Projects user is a member of
	Projects []*Project `json:"projects,omitempty"`
	// contains filtered or unexported fields
}

UserEdges holds the relations/edges for other nodes in the graph.

func (UserEdges) DeploymentsOrErr

func (e UserEdges) DeploymentsOrErr() ([]*Deployment, error)

DeploymentsOrErr returns the Deployments value or an error if the edge was not loaded in eager-loading.

func (UserEdges) GroupsOrErr

func (e UserEdges) GroupsOrErr() ([]*Group, error)

GroupsOrErr returns the Groups value or an error if the edge was not loaded in eager-loading.

func (UserEdges) ProjectsOrErr

func (e UserEdges) ProjectsOrErr() ([]*Project, error)

ProjectsOrErr returns the Projects value or an error if the edge was not loaded in eager-loading.

type UserGroupBy

type UserGroupBy struct {
	// contains filtered or unexported fields
}

UserGroupBy is the group-by builder for User entities.

func (*UserGroupBy) Aggregate

func (ugb *UserGroupBy) Aggregate(fns ...AggregateFunc) *UserGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*UserGroupBy) Bool

func (s *UserGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) BoolX

func (s *UserGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*UserGroupBy) Bools

func (s *UserGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) BoolsX

func (s *UserGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*UserGroupBy) Float64

func (s *UserGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) Float64X

func (s *UserGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*UserGroupBy) Float64s

func (s *UserGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) Float64sX

func (s *UserGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*UserGroupBy) Int

func (s *UserGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) IntX

func (s *UserGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*UserGroupBy) Ints

func (s *UserGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) IntsX

func (s *UserGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*UserGroupBy) Scan

func (ugb *UserGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*UserGroupBy) ScanX

func (s *UserGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*UserGroupBy) String

func (s *UserGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) StringX

func (s *UserGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*UserGroupBy) Strings

func (s *UserGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) StringsX

func (s *UserGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type UserMutation

type UserMutation struct {
	// contains filtered or unexported fields
}

UserMutation represents an operation that mutates the User nodes in the graph.

func (*UserMutation) AddDeploymentIDs

func (m *UserMutation) AddDeploymentIDs(ids ...uuid.UUID)

AddDeploymentIDs adds the "deployments" edge to the Deployment entity by ids.

func (*UserMutation) AddField

func (m *UserMutation) AddField(name string, value ent.Value) error

AddField adds the value to the field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*UserMutation) AddGroupIDs

func (m *UserMutation) AddGroupIDs(ids ...uuid.UUID)

AddGroupIDs adds the "groups" edge to the Group entity by ids.

func (*UserMutation) AddProjectIDs

func (m *UserMutation) AddProjectIDs(ids ...uuid.UUID)

AddProjectIDs adds the "projects" edge to the Project entity by ids.

func (*UserMutation) AddedEdges

func (m *UserMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*UserMutation) AddedField

func (m *UserMutation) AddedField(name string) (ent.Value, bool)

AddedField returns the numeric value that was incremented/decremented on a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*UserMutation) AddedFields

func (m *UserMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*UserMutation) AddedIDs

func (m *UserMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*UserMutation) ClearDeployments

func (m *UserMutation) ClearDeployments()

ClearDeployments clears the "deployments" edge to the Deployment entity.

func (*UserMutation) ClearEdge

func (m *UserMutation) ClearEdge(name string) error

ClearEdge clears the value of the edge with the given name. It returns an error if that edge is not defined in the schema.

func (*UserMutation) ClearField

func (m *UserMutation) ClearField(name string) error

ClearField clears the value of the field with the given name. It returns an error if the field is not defined in the schema.

func (*UserMutation) ClearGroups

func (m *UserMutation) ClearGroups()

ClearGroups clears the "groups" edge to the Group entity.

func (*UserMutation) ClearProjects

func (m *UserMutation) ClearProjects()

ClearProjects clears the "projects" edge to the Project entity.

func (*UserMutation) ClearedEdges

func (m *UserMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*UserMutation) ClearedFields

func (m *UserMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (UserMutation) Client

func (m UserMutation) Client() *Client

Client returns a new `ent.Client` from the mutation. If the mutation was executed in a transaction (ent.Tx), a transactional client is returned.

func (*UserMutation) CreatedAt

func (m *UserMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*UserMutation) DeploymentsCleared

func (m *UserMutation) DeploymentsCleared() bool

DeploymentsCleared reports if the "deployments" edge to the Deployment entity was cleared.

func (*UserMutation) DeploymentsIDs

func (m *UserMutation) DeploymentsIDs() (ids []uuid.UUID)

DeploymentsIDs returns the "deployments" edge IDs in the mutation.

func (*UserMutation) EdgeCleared

func (m *UserMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*UserMutation) Email

func (m *UserMutation) Email() (r string, exists bool)

Email returns the value of the "email" field in the mutation.

func (*UserMutation) Field

func (m *UserMutation) Field(name string) (ent.Value, bool)

Field returns the value of a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*UserMutation) FieldCleared

func (m *UserMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*UserMutation) Fields

func (m *UserMutation) Fields() []string

Fields returns all fields that were changed during this mutation. Note that in order to get all numeric fields that were incremented/decremented, call AddedFields().

func (*UserMutation) FirstName

func (m *UserMutation) FirstName() (r string, exists bool)

FirstName returns the value of the "first_name" field in the mutation.

func (*UserMutation) GroupsCleared

func (m *UserMutation) GroupsCleared() bool

GroupsCleared reports if the "groups" edge to the Group entity was cleared.

func (*UserMutation) GroupsIDs

func (m *UserMutation) GroupsIDs() (ids []uuid.UUID)

GroupsIDs returns the "groups" edge IDs in the mutation.

func (*UserMutation) ID

func (m *UserMutation) ID() (id uuid.UUID, exists bool)

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.

func (*UserMutation) IDs

func (m *UserMutation) IDs(ctx context.Context) ([]uuid.UUID, 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 (*UserMutation) LastName

func (m *UserMutation) LastName() (r string, exists bool)

LastName returns the value of the "last_name" field in the mutation.

func (*UserMutation) OldCreatedAt

func (m *UserMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*UserMutation) OldEmail

func (m *UserMutation) OldEmail(ctx context.Context) (v string, err error)

OldEmail returns the old "email" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*UserMutation) OldField

func (m *UserMutation) OldField(ctx context.Context, name string) (ent.Value, error)

OldField returns the old value of the field from the database. An error is returned if the mutation operation is not UpdateOne, or the query to the database failed.

func (*UserMutation) OldFirstName

func (m *UserMutation) OldFirstName(ctx context.Context) (v string, err error)

OldFirstName returns the old "first_name" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*UserMutation) OldLastName

func (m *UserMutation) OldLastName(ctx context.Context) (v string, err error)

OldLastName returns the old "last_name" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*UserMutation) OldPassword

func (m *UserMutation) OldPassword(ctx context.Context) (v string, err error)

OldPassword returns the old "password" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*UserMutation) OldUpdatedAt

func (m *UserMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)

OldUpdatedAt returns the old "updated_at" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*UserMutation) OldUsername

func (m *UserMutation) OldUsername(ctx context.Context) (v string, err error)

OldUsername returns the old "username" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*UserMutation) Op

func (m *UserMutation) Op() Op

Op returns the operation name.

func (*UserMutation) Password

func (m *UserMutation) Password() (r string, exists bool)

Password returns the value of the "password" field in the mutation.

func (*UserMutation) ProjectsCleared

func (m *UserMutation) ProjectsCleared() bool

ProjectsCleared reports if the "projects" edge to the Project entity was cleared.

func (*UserMutation) ProjectsIDs

func (m *UserMutation) ProjectsIDs() (ids []uuid.UUID)

ProjectsIDs returns the "projects" edge IDs in the mutation.

func (*UserMutation) RemoveDeploymentIDs

func (m *UserMutation) RemoveDeploymentIDs(ids ...uuid.UUID)

RemoveDeploymentIDs removes the "deployments" edge to the Deployment entity by IDs.

func (*UserMutation) RemoveGroupIDs

func (m *UserMutation) RemoveGroupIDs(ids ...uuid.UUID)

RemoveGroupIDs removes the "groups" edge to the Group entity by IDs.

func (*UserMutation) RemoveProjectIDs

func (m *UserMutation) RemoveProjectIDs(ids ...uuid.UUID)

RemoveProjectIDs removes the "projects" edge to the Project entity by IDs.

func (*UserMutation) RemovedDeploymentsIDs

func (m *UserMutation) RemovedDeploymentsIDs() (ids []uuid.UUID)

RemovedDeployments returns the removed IDs of the "deployments" edge to the Deployment entity.

func (*UserMutation) RemovedEdges

func (m *UserMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*UserMutation) RemovedGroupsIDs

func (m *UserMutation) RemovedGroupsIDs() (ids []uuid.UUID)

RemovedGroups returns the removed IDs of the "groups" edge to the Group entity.

func (*UserMutation) RemovedIDs

func (m *UserMutation) RemovedIDs(name string) []ent.Value

RemovedIDs returns all IDs (to other nodes) that were removed for the edge with the given name in this mutation.

func (*UserMutation) RemovedProjectsIDs

func (m *UserMutation) RemovedProjectsIDs() (ids []uuid.UUID)

RemovedProjects returns the removed IDs of the "projects" edge to the Project entity.

func (*UserMutation) ResetCreatedAt

func (m *UserMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*UserMutation) ResetDeployments

func (m *UserMutation) ResetDeployments()

ResetDeployments resets all changes to the "deployments" edge.

func (*UserMutation) ResetEdge

func (m *UserMutation) ResetEdge(name string) error

ResetEdge resets all changes to the edge with the given name in this mutation. It returns an error if the edge is not defined in the schema.

func (*UserMutation) ResetEmail

func (m *UserMutation) ResetEmail()

ResetEmail resets all changes to the "email" field.

func (*UserMutation) ResetField

func (m *UserMutation) ResetField(name string) error

ResetField resets all changes in the mutation for the field with the given name. It returns an error if the field is not defined in the schema.

func (*UserMutation) ResetFirstName

func (m *UserMutation) ResetFirstName()

ResetFirstName resets all changes to the "first_name" field.

func (*UserMutation) ResetGroups

func (m *UserMutation) ResetGroups()

ResetGroups resets all changes to the "groups" edge.

func (*UserMutation) ResetLastName

func (m *UserMutation) ResetLastName()

ResetLastName resets all changes to the "last_name" field.

func (*UserMutation) ResetPassword

func (m *UserMutation) ResetPassword()

ResetPassword resets all changes to the "password" field.

func (*UserMutation) ResetProjects

func (m *UserMutation) ResetProjects()

ResetProjects resets all changes to the "projects" edge.

func (*UserMutation) ResetUpdatedAt

func (m *UserMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*UserMutation) ResetUsername

func (m *UserMutation) ResetUsername()

ResetUsername resets all changes to the "username" field.

func (*UserMutation) SetCreatedAt

func (m *UserMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*UserMutation) SetEmail

func (m *UserMutation) SetEmail(s string)

SetEmail sets the "email" field.

func (*UserMutation) SetField

func (m *UserMutation) SetField(name string, value ent.Value) error

SetField sets the value of a field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*UserMutation) SetFirstName

func (m *UserMutation) SetFirstName(s string)

SetFirstName sets the "first_name" field.

func (*UserMutation) SetID

func (m *UserMutation) SetID(id uuid.UUID)

SetID sets the value of the id field. Note that this operation is only accepted on creation of User entities.

func (*UserMutation) SetLastName

func (m *UserMutation) SetLastName(s string)

SetLastName sets the "last_name" field.

func (*UserMutation) SetOp

func (m *UserMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*UserMutation) SetPassword

func (m *UserMutation) SetPassword(s string)

SetPassword sets the "password" field.

func (*UserMutation) SetUpdatedAt

func (m *UserMutation) SetUpdatedAt(t time.Time)

SetUpdatedAt sets the "updated_at" field.

func (*UserMutation) SetUsername

func (m *UserMutation) SetUsername(s string)

SetUsername sets the "username" field.

func (UserMutation) Tx

func (m UserMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*UserMutation) Type

func (m *UserMutation) Type() string

Type returns the node type of this mutation (User).

func (*UserMutation) UpdatedAt

func (m *UserMutation) UpdatedAt() (r time.Time, exists bool)

UpdatedAt returns the value of the "updated_at" field in the mutation.

func (*UserMutation) Username

func (m *UserMutation) Username() (r string, exists bool)

Username returns the value of the "username" field in the mutation.

func (*UserMutation) Where

func (m *UserMutation) Where(ps ...predicate.User)

Where appends a list predicates to the UserMutation builder.

func (*UserMutation) WhereP

func (m *UserMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the UserMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type UserQuery

type UserQuery struct {
	// contains filtered or unexported fields
}

UserQuery is the builder for querying User entities.

func (*UserQuery) Aggregate

func (uq *UserQuery) Aggregate(fns ...AggregateFunc) *UserSelect

Aggregate returns a UserSelect configured with the given aggregations.

func (*UserQuery) All

func (uq *UserQuery) All(ctx context.Context) ([]*User, error)

All executes the query and returns a list of Users.

func (*UserQuery) AllX

func (uq *UserQuery) AllX(ctx context.Context) []*User

AllX is like All, but panics if an error occurs.

func (*UserQuery) Clone

func (uq *UserQuery) Clone() *UserQuery

Clone returns a duplicate of the UserQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*UserQuery) Count

func (uq *UserQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*UserQuery) CountX

func (uq *UserQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*UserQuery) Exist

func (uq *UserQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*UserQuery) ExistX

func (uq *UserQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*UserQuery) First

func (uq *UserQuery) First(ctx context.Context) (*User, error)

First returns the first User entity from the query. Returns a *NotFoundError when no User was found.

func (*UserQuery) FirstID

func (uq *UserQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

FirstID returns the first User ID from the query. Returns a *NotFoundError when no User ID was found.

func (*UserQuery) FirstIDX

func (uq *UserQuery) FirstIDX(ctx context.Context) uuid.UUID

FirstIDX is like FirstID, but panics if an error occurs.

func (*UserQuery) FirstX

func (uq *UserQuery) FirstX(ctx context.Context) *User

FirstX is like First, but panics if an error occurs.

func (*UserQuery) GroupBy

func (uq *UserQuery) GroupBy(field string, fields ...string) *UserGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

Example:

var v []struct {
	CreatedAt time.Time `json:"created_at,omitempty"`
	Count int `json:"count,omitempty"`
}

client.User.Query().
	GroupBy(user.FieldCreatedAt).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*UserQuery) IDs

func (uq *UserQuery) IDs(ctx context.Context) (ids []uuid.UUID, err error)

IDs executes the query and returns a list of User IDs.

func (*UserQuery) IDsX

func (uq *UserQuery) IDsX(ctx context.Context) []uuid.UUID

IDsX is like IDs, but panics if an error occurs.

func (*UserQuery) Limit

func (uq *UserQuery) Limit(limit int) *UserQuery

Limit the number of records to be returned by this query.

func (*UserQuery) Offset

func (uq *UserQuery) Offset(offset int) *UserQuery

Offset to start from.

func (*UserQuery) Only

func (uq *UserQuery) Only(ctx context.Context) (*User, error)

Only returns a single User entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one User entity is found. Returns a *NotFoundError when no User entities are found.

func (*UserQuery) OnlyID

func (uq *UserQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

OnlyID is like Only, but returns the only User ID in the query. Returns a *NotSingularError when more than one User ID is found. Returns a *NotFoundError when no entities are found.

func (*UserQuery) OnlyIDX

func (uq *UserQuery) OnlyIDX(ctx context.Context) uuid.UUID

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*UserQuery) OnlyX

func (uq *UserQuery) OnlyX(ctx context.Context) *User

OnlyX is like Only, but panics if an error occurs.

func (*UserQuery) Order

func (uq *UserQuery) Order(o ...user.OrderOption) *UserQuery

Order specifies how the records should be ordered.

func (*UserQuery) QueryDeployments

func (uq *UserQuery) QueryDeployments() *DeploymentQuery

QueryDeployments chains the current query on the "deployments" edge.

func (*UserQuery) QueryGroups

func (uq *UserQuery) QueryGroups() *GroupQuery

QueryGroups chains the current query on the "groups" edge.

func (*UserQuery) QueryProjects

func (uq *UserQuery) QueryProjects() *ProjectQuery

QueryProjects chains the current query on the "projects" edge.

func (*UserQuery) Select

func (uq *UserQuery) Select(fields ...string) *UserSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	CreatedAt time.Time `json:"created_at,omitempty"`
}

client.User.Query().
	Select(user.FieldCreatedAt).
	Scan(ctx, &v)

func (*UserQuery) Unique

func (uq *UserQuery) Unique(unique bool) *UserQuery

Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.

func (*UserQuery) Where

func (uq *UserQuery) Where(ps ...predicate.User) *UserQuery

Where adds a new predicate for the UserQuery builder.

func (*UserQuery) WithDeployments

func (uq *UserQuery) WithDeployments(opts ...func(*DeploymentQuery)) *UserQuery

WithDeployments tells the query-builder to eager-load the nodes that are connected to the "deployments" edge. The optional arguments are used to configure the query builder of the edge.

func (*UserQuery) WithGroups

func (uq *UserQuery) WithGroups(opts ...func(*GroupQuery)) *UserQuery

WithGroups tells the query-builder to eager-load the nodes that are connected to the "groups" edge. The optional arguments are used to configure the query builder of the edge.

func (*UserQuery) WithProjects

func (uq *UserQuery) WithProjects(opts ...func(*ProjectQuery)) *UserQuery

WithProjects tells the query-builder to eager-load the nodes that are connected to the "projects" edge. The optional arguments are used to configure the query builder of the edge.

type UserSelect

type UserSelect struct {
	*UserQuery
	// contains filtered or unexported fields
}

UserSelect is the builder for selecting fields of User entities.

func (*UserSelect) Aggregate

func (us *UserSelect) Aggregate(fns ...AggregateFunc) *UserSelect

Aggregate adds the given aggregation functions to the selector query.

func (*UserSelect) Bool

func (s *UserSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*UserSelect) BoolX

func (s *UserSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*UserSelect) Bools

func (s *UserSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*UserSelect) BoolsX

func (s *UserSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*UserSelect) Float64

func (s *UserSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*UserSelect) Float64X

func (s *UserSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*UserSelect) Float64s

func (s *UserSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*UserSelect) Float64sX

func (s *UserSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*UserSelect) Int

func (s *UserSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*UserSelect) IntX

func (s *UserSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*UserSelect) Ints

func (s *UserSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*UserSelect) IntsX

func (s *UserSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*UserSelect) Scan

func (us *UserSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*UserSelect) ScanX

func (s *UserSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*UserSelect) String

func (s *UserSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*UserSelect) StringX

func (s *UserSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*UserSelect) Strings

func (s *UserSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*UserSelect) StringsX

func (s *UserSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type UserUpdate

type UserUpdate struct {
	// contains filtered or unexported fields
}

UserUpdate is the builder for updating User entities.

func (*UserUpdate) AddDeploymentIDs

func (uu *UserUpdate) AddDeploymentIDs(ids ...uuid.UUID) *UserUpdate

AddDeploymentIDs adds the "deployments" edge to the Deployment entity by IDs.

func (*UserUpdate) AddDeployments

func (uu *UserUpdate) AddDeployments(d ...*Deployment) *UserUpdate

AddDeployments adds the "deployments" edges to the Deployment entity.

func (*UserUpdate) AddGroupIDs

func (uu *UserUpdate) AddGroupIDs(ids ...uuid.UUID) *UserUpdate

AddGroupIDs adds the "groups" edge to the Group entity by IDs.

func (*UserUpdate) AddGroups

func (uu *UserUpdate) AddGroups(g ...*Group) *UserUpdate

AddGroups adds the "groups" edges to the Group entity.

func (*UserUpdate) AddProjectIDs

func (uu *UserUpdate) AddProjectIDs(ids ...uuid.UUID) *UserUpdate

AddProjectIDs adds the "projects" edge to the Project entity by IDs.

func (*UserUpdate) AddProjects

func (uu *UserUpdate) AddProjects(p ...*Project) *UserUpdate

AddProjects adds the "projects" edges to the Project entity.

func (*UserUpdate) ClearDeployments

func (uu *UserUpdate) ClearDeployments() *UserUpdate

ClearDeployments clears all "deployments" edges to the Deployment entity.

func (*UserUpdate) ClearGroups

func (uu *UserUpdate) ClearGroups() *UserUpdate

ClearGroups clears all "groups" edges to the Group entity.

func (*UserUpdate) ClearProjects

func (uu *UserUpdate) ClearProjects() *UserUpdate

ClearProjects clears all "projects" edges to the Project entity.

func (*UserUpdate) Exec

func (uu *UserUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*UserUpdate) ExecX

func (uu *UserUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserUpdate) Mutation

func (uu *UserUpdate) Mutation() *UserMutation

Mutation returns the UserMutation object of the builder.

func (*UserUpdate) RemoveDeploymentIDs

func (uu *UserUpdate) RemoveDeploymentIDs(ids ...uuid.UUID) *UserUpdate

RemoveDeploymentIDs removes the "deployments" edge to Deployment entities by IDs.

func (*UserUpdate) RemoveDeployments

func (uu *UserUpdate) RemoveDeployments(d ...*Deployment) *UserUpdate

RemoveDeployments removes "deployments" edges to Deployment entities.

func (*UserUpdate) RemoveGroupIDs

func (uu *UserUpdate) RemoveGroupIDs(ids ...uuid.UUID) *UserUpdate

RemoveGroupIDs removes the "groups" edge to Group entities by IDs.

func (*UserUpdate) RemoveGroups

func (uu *UserUpdate) RemoveGroups(g ...*Group) *UserUpdate

RemoveGroups removes "groups" edges to Group entities.

func (*UserUpdate) RemoveProjectIDs

func (uu *UserUpdate) RemoveProjectIDs(ids ...uuid.UUID) *UserUpdate

RemoveProjectIDs removes the "projects" edge to Project entities by IDs.

func (*UserUpdate) RemoveProjects

func (uu *UserUpdate) RemoveProjects(p ...*Project) *UserUpdate

RemoveProjects removes "projects" edges to Project entities.

func (*UserUpdate) Save

func (uu *UserUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*UserUpdate) SaveX

func (uu *UserUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*UserUpdate) SetEmail

func (uu *UserUpdate) SetEmail(s string) *UserUpdate

SetEmail sets the "email" field.

func (*UserUpdate) SetFirstName

func (uu *UserUpdate) SetFirstName(s string) *UserUpdate

SetFirstName sets the "first_name" field.

func (*UserUpdate) SetLastName

func (uu *UserUpdate) SetLastName(s string) *UserUpdate

SetLastName sets the "last_name" field.

func (*UserUpdate) SetNillableEmail

func (uu *UserUpdate) SetNillableEmail(s *string) *UserUpdate

SetNillableEmail sets the "email" field if the given value is not nil.

func (*UserUpdate) SetNillableFirstName

func (uu *UserUpdate) SetNillableFirstName(s *string) *UserUpdate

SetNillableFirstName sets the "first_name" field if the given value is not nil.

func (*UserUpdate) SetNillableLastName

func (uu *UserUpdate) SetNillableLastName(s *string) *UserUpdate

SetNillableLastName sets the "last_name" field if the given value is not nil.

func (*UserUpdate) SetNillablePassword

func (uu *UserUpdate) SetNillablePassword(s *string) *UserUpdate

SetNillablePassword sets the "password" field if the given value is not nil.

func (*UserUpdate) SetNillableUsername

func (uu *UserUpdate) SetNillableUsername(s *string) *UserUpdate

SetNillableUsername sets the "username" field if the given value is not nil.

func (*UserUpdate) SetPassword

func (uu *UserUpdate) SetPassword(s string) *UserUpdate

SetPassword sets the "password" field.

func (*UserUpdate) SetUpdatedAt

func (uu *UserUpdate) SetUpdatedAt(t time.Time) *UserUpdate

SetUpdatedAt sets the "updated_at" field.

func (*UserUpdate) SetUsername

func (uu *UserUpdate) SetUsername(s string) *UserUpdate

SetUsername sets the "username" field.

func (*UserUpdate) Where

func (uu *UserUpdate) Where(ps ...predicate.User) *UserUpdate

Where appends a list predicates to the UserUpdate builder.

type UserUpdateOne

type UserUpdateOne struct {
	// contains filtered or unexported fields
}

UserUpdateOne is the builder for updating a single User entity.

func (*UserUpdateOne) AddDeploymentIDs

func (uuo *UserUpdateOne) AddDeploymentIDs(ids ...uuid.UUID) *UserUpdateOne

AddDeploymentIDs adds the "deployments" edge to the Deployment entity by IDs.

func (*UserUpdateOne) AddDeployments

func (uuo *UserUpdateOne) AddDeployments(d ...*Deployment) *UserUpdateOne

AddDeployments adds the "deployments" edges to the Deployment entity.

func (*UserUpdateOne) AddGroupIDs

func (uuo *UserUpdateOne) AddGroupIDs(ids ...uuid.UUID) *UserUpdateOne

AddGroupIDs adds the "groups" edge to the Group entity by IDs.

func (*UserUpdateOne) AddGroups

func (uuo *UserUpdateOne) AddGroups(g ...*Group) *UserUpdateOne

AddGroups adds the "groups" edges to the Group entity.

func (*UserUpdateOne) AddProjectIDs

func (uuo *UserUpdateOne) AddProjectIDs(ids ...uuid.UUID) *UserUpdateOne

AddProjectIDs adds the "projects" edge to the Project entity by IDs.

func (*UserUpdateOne) AddProjects

func (uuo *UserUpdateOne) AddProjects(p ...*Project) *UserUpdateOne

AddProjects adds the "projects" edges to the Project entity.

func (*UserUpdateOne) ClearDeployments

func (uuo *UserUpdateOne) ClearDeployments() *UserUpdateOne

ClearDeployments clears all "deployments" edges to the Deployment entity.

func (*UserUpdateOne) ClearGroups

func (uuo *UserUpdateOne) ClearGroups() *UserUpdateOne

ClearGroups clears all "groups" edges to the Group entity.

func (*UserUpdateOne) ClearProjects

func (uuo *UserUpdateOne) ClearProjects() *UserUpdateOne

ClearProjects clears all "projects" edges to the Project entity.

func (*UserUpdateOne) Exec

func (uuo *UserUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*UserUpdateOne) ExecX

func (uuo *UserUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserUpdateOne) Mutation

func (uuo *UserUpdateOne) Mutation() *UserMutation

Mutation returns the UserMutation object of the builder.

func (*UserUpdateOne) RemoveDeploymentIDs

func (uuo *UserUpdateOne) RemoveDeploymentIDs(ids ...uuid.UUID) *UserUpdateOne

RemoveDeploymentIDs removes the "deployments" edge to Deployment entities by IDs.

func (*UserUpdateOne) RemoveDeployments

func (uuo *UserUpdateOne) RemoveDeployments(d ...*Deployment) *UserUpdateOne

RemoveDeployments removes "deployments" edges to Deployment entities.

func (*UserUpdateOne) RemoveGroupIDs

func (uuo *UserUpdateOne) RemoveGroupIDs(ids ...uuid.UUID) *UserUpdateOne

RemoveGroupIDs removes the "groups" edge to Group entities by IDs.

func (*UserUpdateOne) RemoveGroups

func (uuo *UserUpdateOne) RemoveGroups(g ...*Group) *UserUpdateOne

RemoveGroups removes "groups" edges to Group entities.

func (*UserUpdateOne) RemoveProjectIDs

func (uuo *UserUpdateOne) RemoveProjectIDs(ids ...uuid.UUID) *UserUpdateOne

RemoveProjectIDs removes the "projects" edge to Project entities by IDs.

func (*UserUpdateOne) RemoveProjects

func (uuo *UserUpdateOne) RemoveProjects(p ...*Project) *UserUpdateOne

RemoveProjects removes "projects" edges to Project entities.

func (*UserUpdateOne) Save

func (uuo *UserUpdateOne) Save(ctx context.Context) (*User, error)

Save executes the query and returns the updated User entity.

func (*UserUpdateOne) SaveX

func (uuo *UserUpdateOne) SaveX(ctx context.Context) *User

SaveX is like Save, but panics if an error occurs.

func (*UserUpdateOne) Select

func (uuo *UserUpdateOne) Select(field string, fields ...string) *UserUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*UserUpdateOne) SetEmail

func (uuo *UserUpdateOne) SetEmail(s string) *UserUpdateOne

SetEmail sets the "email" field.

func (*UserUpdateOne) SetFirstName

func (uuo *UserUpdateOne) SetFirstName(s string) *UserUpdateOne

SetFirstName sets the "first_name" field.

func (*UserUpdateOne) SetLastName

func (uuo *UserUpdateOne) SetLastName(s string) *UserUpdateOne

SetLastName sets the "last_name" field.

func (*UserUpdateOne) SetNillableEmail

func (uuo *UserUpdateOne) SetNillableEmail(s *string) *UserUpdateOne

SetNillableEmail sets the "email" field if the given value is not nil.

func (*UserUpdateOne) SetNillableFirstName

func (uuo *UserUpdateOne) SetNillableFirstName(s *string) *UserUpdateOne

SetNillableFirstName sets the "first_name" field if the given value is not nil.

func (*UserUpdateOne) SetNillableLastName

func (uuo *UserUpdateOne) SetNillableLastName(s *string) *UserUpdateOne

SetNillableLastName sets the "last_name" field if the given value is not nil.

func (*UserUpdateOne) SetNillablePassword

func (uuo *UserUpdateOne) SetNillablePassword(s *string) *UserUpdateOne

SetNillablePassword sets the "password" field if the given value is not nil.

func (*UserUpdateOne) SetNillableUsername

func (uuo *UserUpdateOne) SetNillableUsername(s *string) *UserUpdateOne

SetNillableUsername sets the "username" field if the given value is not nil.

func (*UserUpdateOne) SetPassword

func (uuo *UserUpdateOne) SetPassword(s string) *UserUpdateOne

SetPassword sets the "password" field.

func (*UserUpdateOne) SetUpdatedAt

func (uuo *UserUpdateOne) SetUpdatedAt(t time.Time) *UserUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*UserUpdateOne) SetUsername

func (uuo *UserUpdateOne) SetUsername(s string) *UserUpdateOne

SetUsername sets the "username" field.

func (*UserUpdateOne) Where

func (uuo *UserUpdateOne) Where(ps ...predicate.User) *UserUpdateOne

Where appends a list predicates to the UserUpdate builder.

type Users

type Users []*User

Users is a parsable slice of User.

type ValidationError

type ValidationError struct {
	Name string // Field or edge name.
	// contains filtered or unexported fields
}

ValidationError returns when validating a field 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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL