ent

package
v0.0.0-...-fa2c683 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2024 License: MIT Imports: 24 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.
	TypeBlocks          = "Blocks"
	TypeCategories      = "Categories"
	TypeCounter         = "Counter"
	TypeIsps            = "Isps"
	TypeSites           = "Sites"
	TypeSitesCategories = "SitesCategories"
)

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 Blocks

type Blocks struct {

	// ID of the ent.
	ID int `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"`
	// SiteID holds the value of the "site_id" field.
	SiteID int `json:"site_id,omitempty"`
	// IspID holds the value of the "isp_id" field.
	IspID int `json:"isp_id,omitempty"`
	// BlockReports holds the value of the "block_reports" field.
	BlockReports int `json:"block_reports,omitempty"`
	// UnblockReports holds the value of the "unblock_reports" field.
	UnblockReports int `json:"unblock_reports,omitempty"`
	// LastReportedAt holds the value of the "last_reported_at" field.
	LastReportedAt time.Time `json:"last_reported_at,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the BlocksQuery when eager-loading is set.
	Edges BlocksEdges `json:"edges"`
	// contains filtered or unexported fields
}

Blocks is the model entity for the Blocks schema.

func (*Blocks) QueryIsp

func (b *Blocks) QueryIsp() *IspsQuery

QueryIsp queries the "isp" edge of the Blocks entity.

func (*Blocks) QuerySite

func (b *Blocks) QuerySite() *SitesQuery

QuerySite queries the "site" edge of the Blocks entity.

func (*Blocks) String

func (b *Blocks) String() string

String implements the fmt.Stringer.

func (*Blocks) Unwrap

func (b *Blocks) Unwrap() *Blocks

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

func (b *Blocks) Update() *BlocksUpdateOne

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

func (*Blocks) Value

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

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

type BlocksClient

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

BlocksClient is a client for the Blocks schema.

func NewBlocksClient

func NewBlocksClient(c config) *BlocksClient

NewBlocksClient returns a client for the Blocks from the given config.

func (*BlocksClient) Create

func (c *BlocksClient) Create() *BlocksCreate

Create returns a builder for creating a Blocks entity.

func (*BlocksClient) CreateBulk

func (c *BlocksClient) CreateBulk(builders ...*BlocksCreate) *BlocksCreateBulk

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

func (*BlocksClient) Delete

func (c *BlocksClient) Delete() *BlocksDelete

Delete returns a delete builder for Blocks.

func (*BlocksClient) DeleteOne

func (c *BlocksClient) DeleteOne(b *Blocks) *BlocksDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*BlocksClient) DeleteOneID

func (c *BlocksClient) DeleteOneID(id int) *BlocksDeleteOne

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

func (*BlocksClient) Get

func (c *BlocksClient) Get(ctx context.Context, id int) (*Blocks, error)

Get returns a Blocks entity by its id.

func (*BlocksClient) GetX

func (c *BlocksClient) GetX(ctx context.Context, id int) *Blocks

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

func (*BlocksClient) Hooks

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

Hooks returns the client hooks.

func (*BlocksClient) Intercept

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

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

func (*BlocksClient) Interceptors

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

Interceptors returns the client interceptors.

func (*BlocksClient) MapCreateBulk

func (c *BlocksClient) MapCreateBulk(slice any, setFunc func(*BlocksCreate, int)) *BlocksCreateBulk

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

func (c *BlocksClient) Query() *BlocksQuery

Query returns a query builder for Blocks.

func (*BlocksClient) QueryIsp

func (c *BlocksClient) QueryIsp(b *Blocks) *IspsQuery

QueryIsp queries the isp edge of a Blocks.

func (*BlocksClient) QuerySite

func (c *BlocksClient) QuerySite(b *Blocks) *SitesQuery

QuerySite queries the site edge of a Blocks.

func (*BlocksClient) Update

func (c *BlocksClient) Update() *BlocksUpdate

Update returns an update builder for Blocks.

func (*BlocksClient) UpdateOne

func (c *BlocksClient) UpdateOne(b *Blocks) *BlocksUpdateOne

UpdateOne returns an update builder for the given entity.

func (*BlocksClient) UpdateOneID

func (c *BlocksClient) UpdateOneID(id int) *BlocksUpdateOne

UpdateOneID returns an update builder for the given id.

func (*BlocksClient) Use

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

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

type BlocksCreate

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

BlocksCreate is the builder for creating a Blocks entity.

func (*BlocksCreate) Exec

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

Exec executes the query.

func (*BlocksCreate) ExecX

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

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

func (*BlocksCreate) Mutation

func (bc *BlocksCreate) Mutation() *BlocksMutation

Mutation returns the BlocksMutation object of the builder.

func (*BlocksCreate) Save

func (bc *BlocksCreate) Save(ctx context.Context) (*Blocks, error)

Save creates the Blocks in the database.

func (*BlocksCreate) SaveX

func (bc *BlocksCreate) SaveX(ctx context.Context) *Blocks

SaveX calls Save and panics if Save returns an error.

func (*BlocksCreate) SetBlockReports

func (bc *BlocksCreate) SetBlockReports(i int) *BlocksCreate

SetBlockReports sets the "block_reports" field.

func (*BlocksCreate) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*BlocksCreate) SetIsp

func (bc *BlocksCreate) SetIsp(i *Isps) *BlocksCreate

SetIsp sets the "isp" edge to the Isps entity.

func (*BlocksCreate) SetIspID

func (bc *BlocksCreate) SetIspID(i int) *BlocksCreate

SetIspID sets the "isp_id" field.

func (*BlocksCreate) SetLastReportedAt

func (bc *BlocksCreate) SetLastReportedAt(t time.Time) *BlocksCreate

SetLastReportedAt sets the "last_reported_at" field.

func (*BlocksCreate) SetNillableBlockReports

func (bc *BlocksCreate) SetNillableBlockReports(i *int) *BlocksCreate

SetNillableBlockReports sets the "block_reports" field if the given value is not nil.

func (*BlocksCreate) SetNillableCreatedAt

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

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

func (*BlocksCreate) SetNillableUnblockReports

func (bc *BlocksCreate) SetNillableUnblockReports(i *int) *BlocksCreate

SetNillableUnblockReports sets the "unblock_reports" field if the given value is not nil.

func (*BlocksCreate) SetNillableUpdatedAt

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

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

func (*BlocksCreate) SetSite

func (bc *BlocksCreate) SetSite(s *Sites) *BlocksCreate

SetSite sets the "site" edge to the Sites entity.

func (*BlocksCreate) SetSiteID

func (bc *BlocksCreate) SetSiteID(i int) *BlocksCreate

SetSiteID sets the "site_id" field.

func (*BlocksCreate) SetUnblockReports

func (bc *BlocksCreate) SetUnblockReports(i int) *BlocksCreate

SetUnblockReports sets the "unblock_reports" field.

func (*BlocksCreate) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" field.

type BlocksCreateBulk

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

BlocksCreateBulk is the builder for creating many Blocks entities in bulk.

func (*BlocksCreateBulk) Exec

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

Exec executes the query.

func (*BlocksCreateBulk) ExecX

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

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

func (*BlocksCreateBulk) Save

func (bcb *BlocksCreateBulk) Save(ctx context.Context) ([]*Blocks, error)

Save creates the Blocks entities in the database.

func (*BlocksCreateBulk) SaveX

func (bcb *BlocksCreateBulk) SaveX(ctx context.Context) []*Blocks

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

type BlocksDelete

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

BlocksDelete is the builder for deleting a Blocks entity.

func (*BlocksDelete) Exec

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

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

func (*BlocksDelete) ExecX

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

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

func (*BlocksDelete) Where

func (bd *BlocksDelete) Where(ps ...predicate.Blocks) *BlocksDelete

Where appends a list predicates to the BlocksDelete builder.

type BlocksDeleteOne

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

BlocksDeleteOne is the builder for deleting a single Blocks entity.

func (*BlocksDeleteOne) Exec

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

Exec executes the deletion query.

func (*BlocksDeleteOne) ExecX

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

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

func (*BlocksDeleteOne) Where

func (bdo *BlocksDeleteOne) Where(ps ...predicate.Blocks) *BlocksDeleteOne

Where appends a list predicates to the BlocksDelete builder.

type BlocksEdges

type BlocksEdges struct {
	// Site holds the value of the site edge.
	Site *Sites `json:"site,omitempty"`
	// Isp holds the value of the isp edge.
	Isp *Isps `json:"isp,omitempty"`
	// contains filtered or unexported fields
}

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

func (BlocksEdges) IspOrErr

func (e BlocksEdges) IspOrErr() (*Isps, error)

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

func (BlocksEdges) SiteOrErr

func (e BlocksEdges) SiteOrErr() (*Sites, error)

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

type BlocksGroupBy

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

BlocksGroupBy is the group-by builder for Blocks entities.

func (*BlocksGroupBy) Aggregate

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

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

func (*BlocksGroupBy) Bool

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

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

func (*BlocksGroupBy) BoolX

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

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

func (*BlocksGroupBy) Bools

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

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

func (*BlocksGroupBy) BoolsX

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

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

func (*BlocksGroupBy) Float64

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

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

func (*BlocksGroupBy) Float64X

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

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

func (*BlocksGroupBy) Float64s

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

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

func (*BlocksGroupBy) Float64sX

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

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

func (*BlocksGroupBy) Int

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

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

func (*BlocksGroupBy) IntX

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

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

func (*BlocksGroupBy) Ints

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

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

func (*BlocksGroupBy) IntsX

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

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

func (*BlocksGroupBy) Scan

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

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

func (*BlocksGroupBy) ScanX

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

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

func (*BlocksGroupBy) String

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

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

func (*BlocksGroupBy) StringX

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

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

func (*BlocksGroupBy) Strings

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

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

func (*BlocksGroupBy) StringsX

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

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

type BlocksMutation

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

BlocksMutation represents an operation that mutates the Blocks nodes in the graph.

func (*BlocksMutation) AddBlockReports

func (m *BlocksMutation) AddBlockReports(i int)

AddBlockReports adds i to the "block_reports" field.

func (*BlocksMutation) AddField

func (m *BlocksMutation) 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 (*BlocksMutation) AddUnblockReports

func (m *BlocksMutation) AddUnblockReports(i int)

AddUnblockReports adds i to the "unblock_reports" field.

func (*BlocksMutation) AddedBlockReports

func (m *BlocksMutation) AddedBlockReports() (r int, exists bool)

AddedBlockReports returns the value that was added to the "block_reports" field in this mutation.

func (*BlocksMutation) AddedEdges

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

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

func (*BlocksMutation) AddedField

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

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

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

func (*BlocksMutation) AddedIDs

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

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

func (*BlocksMutation) AddedUnblockReports

func (m *BlocksMutation) AddedUnblockReports() (r int, exists bool)

AddedUnblockReports returns the value that was added to the "unblock_reports" field in this mutation.

func (*BlocksMutation) BlockReports

func (m *BlocksMutation) BlockReports() (r int, exists bool)

BlockReports returns the value of the "block_reports" field in the mutation.

func (*BlocksMutation) ClearEdge

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

func (m *BlocksMutation) 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 (*BlocksMutation) ClearIsp

func (m *BlocksMutation) ClearIsp()

ClearIsp clears the "isp" edge to the Isps entity.

func (*BlocksMutation) ClearSite

func (m *BlocksMutation) ClearSite()

ClearSite clears the "site" edge to the Sites entity.

func (*BlocksMutation) ClearedEdges

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

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

func (*BlocksMutation) ClearedFields

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

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

func (BlocksMutation) Client

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

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

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

func (*BlocksMutation) EdgeCleared

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

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

func (*BlocksMutation) Field

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

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

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

func (*BlocksMutation) Fields

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

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

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

func (*BlocksMutation) IDs

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

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

func (*BlocksMutation) IspCleared

func (m *BlocksMutation) IspCleared() bool

IspCleared reports if the "isp" edge to the Isps entity was cleared.

func (*BlocksMutation) IspID

func (m *BlocksMutation) IspID() (r int, exists bool)

IspID returns the value of the "isp_id" field in the mutation.

func (*BlocksMutation) IspIDs

func (m *BlocksMutation) IspIDs() (ids []int)

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

func (*BlocksMutation) LastReportedAt

func (m *BlocksMutation) LastReportedAt() (r time.Time, exists bool)

LastReportedAt returns the value of the "last_reported_at" field in the mutation.

func (*BlocksMutation) OldBlockReports

func (m *BlocksMutation) OldBlockReports(ctx context.Context) (v int, err error)

OldBlockReports returns the old "block_reports" field's value of the Blocks entity. If the Blocks 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 (*BlocksMutation) OldCreatedAt

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

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

func (m *BlocksMutation) 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 (*BlocksMutation) OldIspID

func (m *BlocksMutation) OldIspID(ctx context.Context) (v int, err error)

OldIspID returns the old "isp_id" field's value of the Blocks entity. If the Blocks 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 (*BlocksMutation) OldLastReportedAt

func (m *BlocksMutation) OldLastReportedAt(ctx context.Context) (v time.Time, err error)

OldLastReportedAt returns the old "last_reported_at" field's value of the Blocks entity. If the Blocks 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 (*BlocksMutation) OldSiteID

func (m *BlocksMutation) OldSiteID(ctx context.Context) (v int, err error)

OldSiteID returns the old "site_id" field's value of the Blocks entity. If the Blocks 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 (*BlocksMutation) OldUnblockReports

func (m *BlocksMutation) OldUnblockReports(ctx context.Context) (v int, err error)

OldUnblockReports returns the old "unblock_reports" field's value of the Blocks entity. If the Blocks 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 (*BlocksMutation) OldUpdatedAt

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

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

func (m *BlocksMutation) Op() Op

Op returns the operation name.

func (*BlocksMutation) RemovedEdges

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

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

func (*BlocksMutation) RemovedIDs

func (m *BlocksMutation) 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 (*BlocksMutation) ResetBlockReports

func (m *BlocksMutation) ResetBlockReports()

ResetBlockReports resets all changes to the "block_reports" field.

func (*BlocksMutation) ResetCreatedAt

func (m *BlocksMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*BlocksMutation) ResetEdge

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

func (m *BlocksMutation) 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 (*BlocksMutation) ResetIsp

func (m *BlocksMutation) ResetIsp()

ResetIsp resets all changes to the "isp" edge.

func (*BlocksMutation) ResetIspID

func (m *BlocksMutation) ResetIspID()

ResetIspID resets all changes to the "isp_id" field.

func (*BlocksMutation) ResetLastReportedAt

func (m *BlocksMutation) ResetLastReportedAt()

ResetLastReportedAt resets all changes to the "last_reported_at" field.

func (*BlocksMutation) ResetSite

func (m *BlocksMutation) ResetSite()

ResetSite resets all changes to the "site" edge.

func (*BlocksMutation) ResetSiteID

func (m *BlocksMutation) ResetSiteID()

ResetSiteID resets all changes to the "site_id" field.

func (*BlocksMutation) ResetUnblockReports

func (m *BlocksMutation) ResetUnblockReports()

ResetUnblockReports resets all changes to the "unblock_reports" field.

func (*BlocksMutation) ResetUpdatedAt

func (m *BlocksMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*BlocksMutation) SetBlockReports

func (m *BlocksMutation) SetBlockReports(i int)

SetBlockReports sets the "block_reports" field.

func (*BlocksMutation) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*BlocksMutation) SetField

func (m *BlocksMutation) 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 (*BlocksMutation) SetIspID

func (m *BlocksMutation) SetIspID(i int)

SetIspID sets the "isp_id" field.

func (*BlocksMutation) SetLastReportedAt

func (m *BlocksMutation) SetLastReportedAt(t time.Time)

SetLastReportedAt sets the "last_reported_at" field.

func (*BlocksMutation) SetOp

func (m *BlocksMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*BlocksMutation) SetSiteID

func (m *BlocksMutation) SetSiteID(i int)

SetSiteID sets the "site_id" field.

func (*BlocksMutation) SetUnblockReports

func (m *BlocksMutation) SetUnblockReports(i int)

SetUnblockReports sets the "unblock_reports" field.

func (*BlocksMutation) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" field.

func (*BlocksMutation) SiteCleared

func (m *BlocksMutation) SiteCleared() bool

SiteCleared reports if the "site" edge to the Sites entity was cleared.

func (*BlocksMutation) SiteID

func (m *BlocksMutation) SiteID() (r int, exists bool)

SiteID returns the value of the "site_id" field in the mutation.

func (*BlocksMutation) SiteIDs

func (m *BlocksMutation) SiteIDs() (ids []int)

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

func (BlocksMutation) Tx

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

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

func (*BlocksMutation) Type

func (m *BlocksMutation) Type() string

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

func (*BlocksMutation) UnblockReports

func (m *BlocksMutation) UnblockReports() (r int, exists bool)

UnblockReports returns the value of the "unblock_reports" field in the mutation.

func (*BlocksMutation) UpdatedAt

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

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

func (*BlocksMutation) Where

func (m *BlocksMutation) Where(ps ...predicate.Blocks)

Where appends a list predicates to the BlocksMutation builder.

func (*BlocksMutation) WhereP

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

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

type BlocksQuery

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

BlocksQuery is the builder for querying Blocks entities.

func (*BlocksQuery) Aggregate

func (bq *BlocksQuery) Aggregate(fns ...AggregateFunc) *BlocksSelect

Aggregate returns a BlocksSelect configured with the given aggregations.

func (*BlocksQuery) All

func (bq *BlocksQuery) All(ctx context.Context) ([]*Blocks, error)

All executes the query and returns a list of BlocksSlice.

func (*BlocksQuery) AllX

func (bq *BlocksQuery) AllX(ctx context.Context) []*Blocks

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

func (*BlocksQuery) Clone

func (bq *BlocksQuery) Clone() *BlocksQuery

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

func (*BlocksQuery) Count

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

Count returns the count of the given query.

func (*BlocksQuery) CountX

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

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

func (*BlocksQuery) Exist

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

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

func (*BlocksQuery) ExistX

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

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

func (*BlocksQuery) First

func (bq *BlocksQuery) First(ctx context.Context) (*Blocks, error)

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

func (*BlocksQuery) FirstID

func (bq *BlocksQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*BlocksQuery) FirstIDX

func (bq *BlocksQuery) FirstIDX(ctx context.Context) int

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

func (*BlocksQuery) FirstX

func (bq *BlocksQuery) FirstX(ctx context.Context) *Blocks

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

func (*BlocksQuery) GroupBy

func (bq *BlocksQuery) GroupBy(field string, fields ...string) *BlocksGroupBy

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.Blocks.Query().
	GroupBy(blocks.FieldCreatedAt).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*BlocksQuery) IDs

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

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

func (*BlocksQuery) IDsX

func (bq *BlocksQuery) IDsX(ctx context.Context) []int

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

func (*BlocksQuery) Limit

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

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

func (*BlocksQuery) Offset

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

Offset to start from.

func (*BlocksQuery) Only

func (bq *BlocksQuery) Only(ctx context.Context) (*Blocks, error)

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

func (*BlocksQuery) OnlyID

func (bq *BlocksQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*BlocksQuery) OnlyIDX

func (bq *BlocksQuery) OnlyIDX(ctx context.Context) int

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

func (*BlocksQuery) OnlyX

func (bq *BlocksQuery) OnlyX(ctx context.Context) *Blocks

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

func (*BlocksQuery) Order

func (bq *BlocksQuery) Order(o ...blocks.OrderOption) *BlocksQuery

Order specifies how the records should be ordered.

func (*BlocksQuery) QueryIsp

func (bq *BlocksQuery) QueryIsp() *IspsQuery

QueryIsp chains the current query on the "isp" edge.

func (*BlocksQuery) QuerySite

func (bq *BlocksQuery) QuerySite() *SitesQuery

QuerySite chains the current query on the "site" edge.

func (*BlocksQuery) Select

func (bq *BlocksQuery) Select(fields ...string) *BlocksSelect

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.Blocks.Query().
	Select(blocks.FieldCreatedAt).
	Scan(ctx, &v)

func (*BlocksQuery) Unique

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

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

func (bq *BlocksQuery) Where(ps ...predicate.Blocks) *BlocksQuery

Where adds a new predicate for the BlocksQuery builder.

func (*BlocksQuery) WithIsp

func (bq *BlocksQuery) WithIsp(opts ...func(*IspsQuery)) *BlocksQuery

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

func (*BlocksQuery) WithSite

func (bq *BlocksQuery) WithSite(opts ...func(*SitesQuery)) *BlocksQuery

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

type BlocksSelect

type BlocksSelect struct {
	*BlocksQuery
	// contains filtered or unexported fields
}

BlocksSelect is the builder for selecting fields of Blocks entities.

func (*BlocksSelect) Aggregate

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

Aggregate adds the given aggregation functions to the selector query.

func (*BlocksSelect) Bool

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

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

func (*BlocksSelect) BoolX

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

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

func (*BlocksSelect) Bools

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

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

func (*BlocksSelect) BoolsX

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

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

func (*BlocksSelect) Float64

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

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

func (*BlocksSelect) Float64X

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

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

func (*BlocksSelect) Float64s

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

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

func (*BlocksSelect) Float64sX

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

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

func (*BlocksSelect) Int

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

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

func (*BlocksSelect) IntX

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

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

func (*BlocksSelect) Ints

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

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

func (*BlocksSelect) IntsX

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

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

func (*BlocksSelect) Scan

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

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

func (*BlocksSelect) ScanX

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

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

func (*BlocksSelect) String

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

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

func (*BlocksSelect) StringX

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

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

func (*BlocksSelect) Strings

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

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

func (*BlocksSelect) StringsX

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

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

type BlocksSlice

type BlocksSlice []*Blocks

BlocksSlice is a parsable slice of Blocks.

type BlocksUpdate

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

BlocksUpdate is the builder for updating Blocks entities.

func (*BlocksUpdate) AddBlockReports

func (bu *BlocksUpdate) AddBlockReports(i int) *BlocksUpdate

AddBlockReports adds i to the "block_reports" field.

func (*BlocksUpdate) AddUnblockReports

func (bu *BlocksUpdate) AddUnblockReports(i int) *BlocksUpdate

AddUnblockReports adds i to the "unblock_reports" field.

func (*BlocksUpdate) ClearIsp

func (bu *BlocksUpdate) ClearIsp() *BlocksUpdate

ClearIsp clears the "isp" edge to the Isps entity.

func (*BlocksUpdate) ClearSite

func (bu *BlocksUpdate) ClearSite() *BlocksUpdate

ClearSite clears the "site" edge to the Sites entity.

func (*BlocksUpdate) Exec

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

Exec executes the query.

func (*BlocksUpdate) ExecX

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

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

func (*BlocksUpdate) Mutation

func (bu *BlocksUpdate) Mutation() *BlocksMutation

Mutation returns the BlocksMutation object of the builder.

func (*BlocksUpdate) Save

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

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

func (*BlocksUpdate) SaveX

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

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

func (*BlocksUpdate) SetBlockReports

func (bu *BlocksUpdate) SetBlockReports(i int) *BlocksUpdate

SetBlockReports sets the "block_reports" field.

func (*BlocksUpdate) SetIsp

func (bu *BlocksUpdate) SetIsp(i *Isps) *BlocksUpdate

SetIsp sets the "isp" edge to the Isps entity.

func (*BlocksUpdate) SetIspID

func (bu *BlocksUpdate) SetIspID(i int) *BlocksUpdate

SetIspID sets the "isp_id" field.

func (*BlocksUpdate) SetLastReportedAt

func (bu *BlocksUpdate) SetLastReportedAt(t time.Time) *BlocksUpdate

SetLastReportedAt sets the "last_reported_at" field.

func (*BlocksUpdate) SetNillableBlockReports

func (bu *BlocksUpdate) SetNillableBlockReports(i *int) *BlocksUpdate

SetNillableBlockReports sets the "block_reports" field if the given value is not nil.

func (*BlocksUpdate) SetNillableIspID

func (bu *BlocksUpdate) SetNillableIspID(i *int) *BlocksUpdate

SetNillableIspID sets the "isp_id" field if the given value is not nil.

func (*BlocksUpdate) SetNillableLastReportedAt

func (bu *BlocksUpdate) SetNillableLastReportedAt(t *time.Time) *BlocksUpdate

SetNillableLastReportedAt sets the "last_reported_at" field if the given value is not nil.

func (*BlocksUpdate) SetNillableSiteID

func (bu *BlocksUpdate) SetNillableSiteID(i *int) *BlocksUpdate

SetNillableSiteID sets the "site_id" field if the given value is not nil.

func (*BlocksUpdate) SetNillableUnblockReports

func (bu *BlocksUpdate) SetNillableUnblockReports(i *int) *BlocksUpdate

SetNillableUnblockReports sets the "unblock_reports" field if the given value is not nil.

func (*BlocksUpdate) SetSite

func (bu *BlocksUpdate) SetSite(s *Sites) *BlocksUpdate

SetSite sets the "site" edge to the Sites entity.

func (*BlocksUpdate) SetSiteID

func (bu *BlocksUpdate) SetSiteID(i int) *BlocksUpdate

SetSiteID sets the "site_id" field.

func (*BlocksUpdate) SetUnblockReports

func (bu *BlocksUpdate) SetUnblockReports(i int) *BlocksUpdate

SetUnblockReports sets the "unblock_reports" field.

func (*BlocksUpdate) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" field.

func (*BlocksUpdate) Where

func (bu *BlocksUpdate) Where(ps ...predicate.Blocks) *BlocksUpdate

Where appends a list predicates to the BlocksUpdate builder.

type BlocksUpdateOne

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

BlocksUpdateOne is the builder for updating a single Blocks entity.

func (*BlocksUpdateOne) AddBlockReports

func (buo *BlocksUpdateOne) AddBlockReports(i int) *BlocksUpdateOne

AddBlockReports adds i to the "block_reports" field.

func (*BlocksUpdateOne) AddUnblockReports

func (buo *BlocksUpdateOne) AddUnblockReports(i int) *BlocksUpdateOne

AddUnblockReports adds i to the "unblock_reports" field.

func (*BlocksUpdateOne) ClearIsp

func (buo *BlocksUpdateOne) ClearIsp() *BlocksUpdateOne

ClearIsp clears the "isp" edge to the Isps entity.

func (*BlocksUpdateOne) ClearSite

func (buo *BlocksUpdateOne) ClearSite() *BlocksUpdateOne

ClearSite clears the "site" edge to the Sites entity.

func (*BlocksUpdateOne) Exec

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

Exec executes the query on the entity.

func (*BlocksUpdateOne) ExecX

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

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

func (*BlocksUpdateOne) Mutation

func (buo *BlocksUpdateOne) Mutation() *BlocksMutation

Mutation returns the BlocksMutation object of the builder.

func (*BlocksUpdateOne) Save

func (buo *BlocksUpdateOne) Save(ctx context.Context) (*Blocks, error)

Save executes the query and returns the updated Blocks entity.

func (*BlocksUpdateOne) SaveX

func (buo *BlocksUpdateOne) SaveX(ctx context.Context) *Blocks

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

func (*BlocksUpdateOne) Select

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

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

func (*BlocksUpdateOne) SetBlockReports

func (buo *BlocksUpdateOne) SetBlockReports(i int) *BlocksUpdateOne

SetBlockReports sets the "block_reports" field.

func (*BlocksUpdateOne) SetIsp

func (buo *BlocksUpdateOne) SetIsp(i *Isps) *BlocksUpdateOne

SetIsp sets the "isp" edge to the Isps entity.

func (*BlocksUpdateOne) SetIspID

func (buo *BlocksUpdateOne) SetIspID(i int) *BlocksUpdateOne

SetIspID sets the "isp_id" field.

func (*BlocksUpdateOne) SetLastReportedAt

func (buo *BlocksUpdateOne) SetLastReportedAt(t time.Time) *BlocksUpdateOne

SetLastReportedAt sets the "last_reported_at" field.

func (*BlocksUpdateOne) SetNillableBlockReports

func (buo *BlocksUpdateOne) SetNillableBlockReports(i *int) *BlocksUpdateOne

SetNillableBlockReports sets the "block_reports" field if the given value is not nil.

func (*BlocksUpdateOne) SetNillableIspID

func (buo *BlocksUpdateOne) SetNillableIspID(i *int) *BlocksUpdateOne

SetNillableIspID sets the "isp_id" field if the given value is not nil.

func (*BlocksUpdateOne) SetNillableLastReportedAt

func (buo *BlocksUpdateOne) SetNillableLastReportedAt(t *time.Time) *BlocksUpdateOne

SetNillableLastReportedAt sets the "last_reported_at" field if the given value is not nil.

func (*BlocksUpdateOne) SetNillableSiteID

func (buo *BlocksUpdateOne) SetNillableSiteID(i *int) *BlocksUpdateOne

SetNillableSiteID sets the "site_id" field if the given value is not nil.

func (*BlocksUpdateOne) SetNillableUnblockReports

func (buo *BlocksUpdateOne) SetNillableUnblockReports(i *int) *BlocksUpdateOne

SetNillableUnblockReports sets the "unblock_reports" field if the given value is not nil.

func (*BlocksUpdateOne) SetSite

func (buo *BlocksUpdateOne) SetSite(s *Sites) *BlocksUpdateOne

SetSite sets the "site" edge to the Sites entity.

func (*BlocksUpdateOne) SetSiteID

func (buo *BlocksUpdateOne) SetSiteID(i int) *BlocksUpdateOne

SetSiteID sets the "site_id" field.

func (*BlocksUpdateOne) SetUnblockReports

func (buo *BlocksUpdateOne) SetUnblockReports(i int) *BlocksUpdateOne

SetUnblockReports sets the "unblock_reports" field.

func (*BlocksUpdateOne) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" field.

func (*BlocksUpdateOne) Where

func (buo *BlocksUpdateOne) Where(ps ...predicate.Blocks) *BlocksUpdateOne

Where appends a list predicates to the BlocksUpdate builder.

type Categories

type Categories struct {

	// ID of the ent.
	ID int `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 CategoriesQuery when eager-loading is set.
	Edges CategoriesEdges `json:"edges"`
	// contains filtered or unexported fields
}

Categories is the model entity for the Categories schema.

func (*Categories) QuerySites

func (c *Categories) QuerySites() *SitesQuery

QuerySites queries the "sites" edge of the Categories entity.

func (*Categories) QuerySitesCategories

func (c *Categories) QuerySitesCategories() *SitesCategoriesQuery

QuerySitesCategories queries the "sites_categories" edge of the Categories entity.

func (*Categories) String

func (c *Categories) String() string

String implements the fmt.Stringer.

func (*Categories) Unwrap

func (c *Categories) Unwrap() *Categories

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

func (c *Categories) Update() *CategoriesUpdateOne

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

func (*Categories) Value

func (c *Categories) Value(name string) (ent.Value, error)

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

type CategoriesClient

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

CategoriesClient is a client for the Categories schema.

func NewCategoriesClient

func NewCategoriesClient(c config) *CategoriesClient

NewCategoriesClient returns a client for the Categories from the given config.

func (*CategoriesClient) Create

func (c *CategoriesClient) Create() *CategoriesCreate

Create returns a builder for creating a Categories entity.

func (*CategoriesClient) CreateBulk

func (c *CategoriesClient) CreateBulk(builders ...*CategoriesCreate) *CategoriesCreateBulk

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

func (*CategoriesClient) Delete

func (c *CategoriesClient) Delete() *CategoriesDelete

Delete returns a delete builder for Categories.

func (*CategoriesClient) DeleteOne

func (c *CategoriesClient) DeleteOne(ca *Categories) *CategoriesDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*CategoriesClient) DeleteOneID

func (c *CategoriesClient) DeleteOneID(id int) *CategoriesDeleteOne

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

func (*CategoriesClient) Get

func (c *CategoriesClient) Get(ctx context.Context, id int) (*Categories, error)

Get returns a Categories entity by its id.

func (*CategoriesClient) GetX

func (c *CategoriesClient) GetX(ctx context.Context, id int) *Categories

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

func (*CategoriesClient) Hooks

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

Hooks returns the client hooks.

func (*CategoriesClient) Intercept

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

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

func (*CategoriesClient) Interceptors

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

Interceptors returns the client interceptors.

func (*CategoriesClient) MapCreateBulk

func (c *CategoriesClient) MapCreateBulk(slice any, setFunc func(*CategoriesCreate, int)) *CategoriesCreateBulk

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

func (c *CategoriesClient) Query() *CategoriesQuery

Query returns a query builder for Categories.

func (*CategoriesClient) QuerySites

func (c *CategoriesClient) QuerySites(ca *Categories) *SitesQuery

QuerySites queries the sites edge of a Categories.

func (*CategoriesClient) QuerySitesCategories

func (c *CategoriesClient) QuerySitesCategories(ca *Categories) *SitesCategoriesQuery

QuerySitesCategories queries the sites_categories edge of a Categories.

func (*CategoriesClient) Update

func (c *CategoriesClient) Update() *CategoriesUpdate

Update returns an update builder for Categories.

func (*CategoriesClient) UpdateOne

func (c *CategoriesClient) UpdateOne(ca *Categories) *CategoriesUpdateOne

UpdateOne returns an update builder for the given entity.

func (*CategoriesClient) UpdateOneID

func (c *CategoriesClient) UpdateOneID(id int) *CategoriesUpdateOne

UpdateOneID returns an update builder for the given id.

func (*CategoriesClient) Use

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

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

type CategoriesCreate

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

CategoriesCreate is the builder for creating a Categories entity.

func (*CategoriesCreate) AddSiteIDs

func (cc *CategoriesCreate) AddSiteIDs(ids ...int) *CategoriesCreate

AddSiteIDs adds the "sites" edge to the Sites entity by IDs.

func (*CategoriesCreate) AddSites

func (cc *CategoriesCreate) AddSites(s ...*Sites) *CategoriesCreate

AddSites adds the "sites" edges to the Sites entity.

func (*CategoriesCreate) AddSitesCategories

func (cc *CategoriesCreate) AddSitesCategories(s ...*SitesCategories) *CategoriesCreate

AddSitesCategories adds the "sites_categories" edges to the SitesCategories entity.

func (*CategoriesCreate) AddSitesCategoryIDs

func (cc *CategoriesCreate) AddSitesCategoryIDs(ids ...int) *CategoriesCreate

AddSitesCategoryIDs adds the "sites_categories" edge to the SitesCategories entity by IDs.

func (*CategoriesCreate) Exec

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

Exec executes the query.

func (*CategoriesCreate) ExecX

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

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

func (*CategoriesCreate) Mutation

func (cc *CategoriesCreate) Mutation() *CategoriesMutation

Mutation returns the CategoriesMutation object of the builder.

func (*CategoriesCreate) Save

func (cc *CategoriesCreate) Save(ctx context.Context) (*Categories, error)

Save creates the Categories in the database.

func (*CategoriesCreate) SaveX

func (cc *CategoriesCreate) SaveX(ctx context.Context) *Categories

SaveX calls Save and panics if Save returns an error.

func (*CategoriesCreate) SetCreatedAt

func (cc *CategoriesCreate) SetCreatedAt(t time.Time) *CategoriesCreate

SetCreatedAt sets the "created_at" field.

func (*CategoriesCreate) SetName

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

SetName sets the "name" field.

func (*CategoriesCreate) SetNillableCreatedAt

func (cc *CategoriesCreate) SetNillableCreatedAt(t *time.Time) *CategoriesCreate

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

func (*CategoriesCreate) SetNillableUpdatedAt

func (cc *CategoriesCreate) SetNillableUpdatedAt(t *time.Time) *CategoriesCreate

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

func (*CategoriesCreate) SetUpdatedAt

func (cc *CategoriesCreate) SetUpdatedAt(t time.Time) *CategoriesCreate

SetUpdatedAt sets the "updated_at" field.

type CategoriesCreateBulk

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

CategoriesCreateBulk is the builder for creating many Categories entities in bulk.

func (*CategoriesCreateBulk) Exec

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

Exec executes the query.

func (*CategoriesCreateBulk) ExecX

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

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

func (*CategoriesCreateBulk) Save

func (ccb *CategoriesCreateBulk) Save(ctx context.Context) ([]*Categories, error)

Save creates the Categories entities in the database.

func (*CategoriesCreateBulk) SaveX

func (ccb *CategoriesCreateBulk) SaveX(ctx context.Context) []*Categories

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

type CategoriesDelete

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

CategoriesDelete is the builder for deleting a Categories entity.

func (*CategoriesDelete) Exec

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

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

func (*CategoriesDelete) ExecX

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

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

func (*CategoriesDelete) Where

Where appends a list predicates to the CategoriesDelete builder.

type CategoriesDeleteOne

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

CategoriesDeleteOne is the builder for deleting a single Categories entity.

func (*CategoriesDeleteOne) Exec

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

Exec executes the deletion query.

func (*CategoriesDeleteOne) ExecX

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

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

func (*CategoriesDeleteOne) Where

Where appends a list predicates to the CategoriesDelete builder.

type CategoriesEdges

type CategoriesEdges struct {
	// Sites holds the value of the sites edge.
	Sites []*Sites `json:"sites,omitempty"`
	// SitesCategories holds the value of the sites_categories edge.
	SitesCategories []*SitesCategories `json:"sites_categories,omitempty"`
	// contains filtered or unexported fields
}

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

func (CategoriesEdges) SitesCategoriesOrErr

func (e CategoriesEdges) SitesCategoriesOrErr() ([]*SitesCategories, error)

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

func (CategoriesEdges) SitesOrErr

func (e CategoriesEdges) SitesOrErr() ([]*Sites, error)

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

type CategoriesGroupBy

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

CategoriesGroupBy is the group-by builder for Categories entities.

func (*CategoriesGroupBy) Aggregate

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

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

func (*CategoriesGroupBy) Bool

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

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

func (*CategoriesGroupBy) BoolX

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

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

func (*CategoriesGroupBy) Bools

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

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

func (*CategoriesGroupBy) BoolsX

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

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

func (*CategoriesGroupBy) Float64

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

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

func (*CategoriesGroupBy) Float64X

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

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

func (*CategoriesGroupBy) Float64s

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

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

func (*CategoriesGroupBy) Float64sX

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

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

func (*CategoriesGroupBy) Int

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

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

func (*CategoriesGroupBy) IntX

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

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

func (*CategoriesGroupBy) Ints

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

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

func (*CategoriesGroupBy) IntsX

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

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

func (*CategoriesGroupBy) Scan

func (cgb *CategoriesGroupBy) Scan(ctx context.Context, v any) error

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

func (*CategoriesGroupBy) ScanX

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

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

func (*CategoriesGroupBy) String

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

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

func (*CategoriesGroupBy) StringX

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

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

func (*CategoriesGroupBy) Strings

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

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

func (*CategoriesGroupBy) StringsX

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

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

type CategoriesMutation

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

CategoriesMutation represents an operation that mutates the Categories nodes in the graph.

func (*CategoriesMutation) AddField

func (m *CategoriesMutation) 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 (*CategoriesMutation) AddSiteIDs

func (m *CategoriesMutation) AddSiteIDs(ids ...int)

AddSiteIDs adds the "sites" edge to the Sites entity by ids.

func (*CategoriesMutation) AddSitesCategoryIDs

func (m *CategoriesMutation) AddSitesCategoryIDs(ids ...int)

AddSitesCategoryIDs adds the "sites_categories" edge to the SitesCategories entity by ids.

func (*CategoriesMutation) AddedEdges

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

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

func (*CategoriesMutation) AddedField

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

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

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

func (*CategoriesMutation) AddedIDs

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

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

func (*CategoriesMutation) ClearEdge

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

func (m *CategoriesMutation) 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 (*CategoriesMutation) ClearSites

func (m *CategoriesMutation) ClearSites()

ClearSites clears the "sites" edge to the Sites entity.

func (*CategoriesMutation) ClearSitesCategories

func (m *CategoriesMutation) ClearSitesCategories()

ClearSitesCategories clears the "sites_categories" edge to the SitesCategories entity.

func (*CategoriesMutation) ClearedEdges

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

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

func (*CategoriesMutation) ClearedFields

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

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

func (CategoriesMutation) Client

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

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

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

func (*CategoriesMutation) EdgeCleared

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

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

func (*CategoriesMutation) Field

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

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

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

func (*CategoriesMutation) Fields

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

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

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

func (*CategoriesMutation) IDs

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

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

func (*CategoriesMutation) Name

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

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

func (*CategoriesMutation) OldCreatedAt

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

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

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

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

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

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

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

func (m *CategoriesMutation) Op() Op

Op returns the operation name.

func (*CategoriesMutation) RemoveSiteIDs

func (m *CategoriesMutation) RemoveSiteIDs(ids ...int)

RemoveSiteIDs removes the "sites" edge to the Sites entity by IDs.

func (*CategoriesMutation) RemoveSitesCategoryIDs

func (m *CategoriesMutation) RemoveSitesCategoryIDs(ids ...int)

RemoveSitesCategoryIDs removes the "sites_categories" edge to the SitesCategories entity by IDs.

func (*CategoriesMutation) RemovedEdges

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

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

func (*CategoriesMutation) RemovedIDs

func (m *CategoriesMutation) 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 (*CategoriesMutation) RemovedSitesCategoriesIDs

func (m *CategoriesMutation) RemovedSitesCategoriesIDs() (ids []int)

RemovedSitesCategories returns the removed IDs of the "sites_categories" edge to the SitesCategories entity.

func (*CategoriesMutation) RemovedSitesIDs

func (m *CategoriesMutation) RemovedSitesIDs() (ids []int)

RemovedSites returns the removed IDs of the "sites" edge to the Sites entity.

func (*CategoriesMutation) ResetCreatedAt

func (m *CategoriesMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*CategoriesMutation) ResetEdge

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

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

func (m *CategoriesMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*CategoriesMutation) ResetSites

func (m *CategoriesMutation) ResetSites()

ResetSites resets all changes to the "sites" edge.

func (*CategoriesMutation) ResetSitesCategories

func (m *CategoriesMutation) ResetSitesCategories()

ResetSitesCategories resets all changes to the "sites_categories" edge.

func (*CategoriesMutation) ResetUpdatedAt

func (m *CategoriesMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*CategoriesMutation) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*CategoriesMutation) SetField

func (m *CategoriesMutation) 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 (*CategoriesMutation) SetName

func (m *CategoriesMutation) SetName(s string)

SetName sets the "name" field.

func (*CategoriesMutation) SetOp

func (m *CategoriesMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*CategoriesMutation) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" field.

func (*CategoriesMutation) SitesCategoriesCleared

func (m *CategoriesMutation) SitesCategoriesCleared() bool

SitesCategoriesCleared reports if the "sites_categories" edge to the SitesCategories entity was cleared.

func (*CategoriesMutation) SitesCategoriesIDs

func (m *CategoriesMutation) SitesCategoriesIDs() (ids []int)

SitesCategoriesIDs returns the "sites_categories" edge IDs in the mutation.

func (*CategoriesMutation) SitesCleared

func (m *CategoriesMutation) SitesCleared() bool

SitesCleared reports if the "sites" edge to the Sites entity was cleared.

func (*CategoriesMutation) SitesIDs

func (m *CategoriesMutation) SitesIDs() (ids []int)

SitesIDs returns the "sites" edge IDs in the mutation.

func (CategoriesMutation) Tx

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

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

func (*CategoriesMutation) Type

func (m *CategoriesMutation) Type() string

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

func (*CategoriesMutation) UpdatedAt

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

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

func (*CategoriesMutation) Where

func (m *CategoriesMutation) Where(ps ...predicate.Categories)

Where appends a list predicates to the CategoriesMutation builder.

func (*CategoriesMutation) WhereP

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

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

type CategoriesQuery

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

CategoriesQuery is the builder for querying Categories entities.

func (*CategoriesQuery) Aggregate

func (cq *CategoriesQuery) Aggregate(fns ...AggregateFunc) *CategoriesSelect

Aggregate returns a CategoriesSelect configured with the given aggregations.

func (*CategoriesQuery) All

func (cq *CategoriesQuery) All(ctx context.Context) ([]*Categories, error)

All executes the query and returns a list of CategoriesSlice.

func (*CategoriesQuery) AllX

func (cq *CategoriesQuery) AllX(ctx context.Context) []*Categories

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

func (*CategoriesQuery) Clone

func (cq *CategoriesQuery) Clone() *CategoriesQuery

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

func (*CategoriesQuery) Count

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

Count returns the count of the given query.

func (*CategoriesQuery) CountX

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

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

func (*CategoriesQuery) Exist

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

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

func (*CategoriesQuery) ExistX

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

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

func (*CategoriesQuery) First

func (cq *CategoriesQuery) First(ctx context.Context) (*Categories, error)

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

func (*CategoriesQuery) FirstID

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

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

func (*CategoriesQuery) FirstIDX

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

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

func (*CategoriesQuery) FirstX

func (cq *CategoriesQuery) FirstX(ctx context.Context) *Categories

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

func (*CategoriesQuery) GroupBy

func (cq *CategoriesQuery) GroupBy(field string, fields ...string) *CategoriesGroupBy

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.Categories.Query().
	GroupBy(categories.FieldCreatedAt).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*CategoriesQuery) IDs

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

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

func (*CategoriesQuery) IDsX

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

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

func (*CategoriesQuery) Limit

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

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

func (*CategoriesQuery) Offset

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

Offset to start from.

func (*CategoriesQuery) Only

func (cq *CategoriesQuery) Only(ctx context.Context) (*Categories, error)

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

func (*CategoriesQuery) OnlyID

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

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

func (*CategoriesQuery) OnlyIDX

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

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

func (*CategoriesQuery) OnlyX

func (cq *CategoriesQuery) OnlyX(ctx context.Context) *Categories

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

func (*CategoriesQuery) Order

Order specifies how the records should be ordered.

func (*CategoriesQuery) QuerySites

func (cq *CategoriesQuery) QuerySites() *SitesQuery

QuerySites chains the current query on the "sites" edge.

func (*CategoriesQuery) QuerySitesCategories

func (cq *CategoriesQuery) QuerySitesCategories() *SitesCategoriesQuery

QuerySitesCategories chains the current query on the "sites_categories" edge.

func (*CategoriesQuery) Select

func (cq *CategoriesQuery) Select(fields ...string) *CategoriesSelect

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.Categories.Query().
	Select(categories.FieldCreatedAt).
	Scan(ctx, &v)

func (*CategoriesQuery) Unique

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

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

Where adds a new predicate for the CategoriesQuery builder.

func (*CategoriesQuery) WithSites

func (cq *CategoriesQuery) WithSites(opts ...func(*SitesQuery)) *CategoriesQuery

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

func (*CategoriesQuery) WithSitesCategories

func (cq *CategoriesQuery) WithSitesCategories(opts ...func(*SitesCategoriesQuery)) *CategoriesQuery

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

type CategoriesSelect

type CategoriesSelect struct {
	*CategoriesQuery
	// contains filtered or unexported fields
}

CategoriesSelect is the builder for selecting fields of Categories entities.

func (*CategoriesSelect) Aggregate

func (cs *CategoriesSelect) Aggregate(fns ...AggregateFunc) *CategoriesSelect

Aggregate adds the given aggregation functions to the selector query.

func (*CategoriesSelect) Bool

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

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

func (*CategoriesSelect) BoolX

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

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

func (*CategoriesSelect) Bools

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

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

func (*CategoriesSelect) BoolsX

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

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

func (*CategoriesSelect) Float64

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

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

func (*CategoriesSelect) Float64X

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

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

func (*CategoriesSelect) Float64s

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

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

func (*CategoriesSelect) Float64sX

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

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

func (*CategoriesSelect) Int

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

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

func (*CategoriesSelect) IntX

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

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

func (*CategoriesSelect) Ints

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

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

func (*CategoriesSelect) IntsX

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

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

func (*CategoriesSelect) Scan

func (cs *CategoriesSelect) Scan(ctx context.Context, v any) error

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

func (*CategoriesSelect) ScanX

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

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

func (*CategoriesSelect) String

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

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

func (*CategoriesSelect) StringX

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

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

func (*CategoriesSelect) Strings

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

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

func (*CategoriesSelect) StringsX

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

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

type CategoriesSlice

type CategoriesSlice []*Categories

CategoriesSlice is a parsable slice of Categories.

type CategoriesUpdate

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

CategoriesUpdate is the builder for updating Categories entities.

func (*CategoriesUpdate) AddSiteIDs

func (cu *CategoriesUpdate) AddSiteIDs(ids ...int) *CategoriesUpdate

AddSiteIDs adds the "sites" edge to the Sites entity by IDs.

func (*CategoriesUpdate) AddSites

func (cu *CategoriesUpdate) AddSites(s ...*Sites) *CategoriesUpdate

AddSites adds the "sites" edges to the Sites entity.

func (*CategoriesUpdate) AddSitesCategories

func (cu *CategoriesUpdate) AddSitesCategories(s ...*SitesCategories) *CategoriesUpdate

AddSitesCategories adds the "sites_categories" edges to the SitesCategories entity.

func (*CategoriesUpdate) AddSitesCategoryIDs

func (cu *CategoriesUpdate) AddSitesCategoryIDs(ids ...int) *CategoriesUpdate

AddSitesCategoryIDs adds the "sites_categories" edge to the SitesCategories entity by IDs.

func (*CategoriesUpdate) ClearSites

func (cu *CategoriesUpdate) ClearSites() *CategoriesUpdate

ClearSites clears all "sites" edges to the Sites entity.

func (*CategoriesUpdate) ClearSitesCategories

func (cu *CategoriesUpdate) ClearSitesCategories() *CategoriesUpdate

ClearSitesCategories clears all "sites_categories" edges to the SitesCategories entity.

func (*CategoriesUpdate) Exec

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

Exec executes the query.

func (*CategoriesUpdate) ExecX

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

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

func (*CategoriesUpdate) Mutation

func (cu *CategoriesUpdate) Mutation() *CategoriesMutation

Mutation returns the CategoriesMutation object of the builder.

func (*CategoriesUpdate) RemoveSiteIDs

func (cu *CategoriesUpdate) RemoveSiteIDs(ids ...int) *CategoriesUpdate

RemoveSiteIDs removes the "sites" edge to Sites entities by IDs.

func (*CategoriesUpdate) RemoveSites

func (cu *CategoriesUpdate) RemoveSites(s ...*Sites) *CategoriesUpdate

RemoveSites removes "sites" edges to Sites entities.

func (*CategoriesUpdate) RemoveSitesCategories

func (cu *CategoriesUpdate) RemoveSitesCategories(s ...*SitesCategories) *CategoriesUpdate

RemoveSitesCategories removes "sites_categories" edges to SitesCategories entities.

func (*CategoriesUpdate) RemoveSitesCategoryIDs

func (cu *CategoriesUpdate) RemoveSitesCategoryIDs(ids ...int) *CategoriesUpdate

RemoveSitesCategoryIDs removes the "sites_categories" edge to SitesCategories entities by IDs.

func (*CategoriesUpdate) Save

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

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

func (*CategoriesUpdate) SaveX

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

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

func (*CategoriesUpdate) SetName

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

SetName sets the "name" field.

func (*CategoriesUpdate) SetNillableName

func (cu *CategoriesUpdate) SetNillableName(s *string) *CategoriesUpdate

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

func (*CategoriesUpdate) SetUpdatedAt

func (cu *CategoriesUpdate) SetUpdatedAt(t time.Time) *CategoriesUpdate

SetUpdatedAt sets the "updated_at" field.

func (*CategoriesUpdate) Where

Where appends a list predicates to the CategoriesUpdate builder.

type CategoriesUpdateOne

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

CategoriesUpdateOne is the builder for updating a single Categories entity.

func (*CategoriesUpdateOne) AddSiteIDs

func (cuo *CategoriesUpdateOne) AddSiteIDs(ids ...int) *CategoriesUpdateOne

AddSiteIDs adds the "sites" edge to the Sites entity by IDs.

func (*CategoriesUpdateOne) AddSites

func (cuo *CategoriesUpdateOne) AddSites(s ...*Sites) *CategoriesUpdateOne

AddSites adds the "sites" edges to the Sites entity.

func (*CategoriesUpdateOne) AddSitesCategories

func (cuo *CategoriesUpdateOne) AddSitesCategories(s ...*SitesCategories) *CategoriesUpdateOne

AddSitesCategories adds the "sites_categories" edges to the SitesCategories entity.

func (*CategoriesUpdateOne) AddSitesCategoryIDs

func (cuo *CategoriesUpdateOne) AddSitesCategoryIDs(ids ...int) *CategoriesUpdateOne

AddSitesCategoryIDs adds the "sites_categories" edge to the SitesCategories entity by IDs.

func (*CategoriesUpdateOne) ClearSites

func (cuo *CategoriesUpdateOne) ClearSites() *CategoriesUpdateOne

ClearSites clears all "sites" edges to the Sites entity.

func (*CategoriesUpdateOne) ClearSitesCategories

func (cuo *CategoriesUpdateOne) ClearSitesCategories() *CategoriesUpdateOne

ClearSitesCategories clears all "sites_categories" edges to the SitesCategories entity.

func (*CategoriesUpdateOne) Exec

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

Exec executes the query on the entity.

func (*CategoriesUpdateOne) ExecX

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

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

func (*CategoriesUpdateOne) Mutation

func (cuo *CategoriesUpdateOne) Mutation() *CategoriesMutation

Mutation returns the CategoriesMutation object of the builder.

func (*CategoriesUpdateOne) RemoveSiteIDs

func (cuo *CategoriesUpdateOne) RemoveSiteIDs(ids ...int) *CategoriesUpdateOne

RemoveSiteIDs removes the "sites" edge to Sites entities by IDs.

func (*CategoriesUpdateOne) RemoveSites

func (cuo *CategoriesUpdateOne) RemoveSites(s ...*Sites) *CategoriesUpdateOne

RemoveSites removes "sites" edges to Sites entities.

func (*CategoriesUpdateOne) RemoveSitesCategories

func (cuo *CategoriesUpdateOne) RemoveSitesCategories(s ...*SitesCategories) *CategoriesUpdateOne

RemoveSitesCategories removes "sites_categories" edges to SitesCategories entities.

func (*CategoriesUpdateOne) RemoveSitesCategoryIDs

func (cuo *CategoriesUpdateOne) RemoveSitesCategoryIDs(ids ...int) *CategoriesUpdateOne

RemoveSitesCategoryIDs removes the "sites_categories" edge to SitesCategories entities by IDs.

func (*CategoriesUpdateOne) Save

func (cuo *CategoriesUpdateOne) Save(ctx context.Context) (*Categories, error)

Save executes the query and returns the updated Categories entity.

func (*CategoriesUpdateOne) SaveX

func (cuo *CategoriesUpdateOne) SaveX(ctx context.Context) *Categories

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

func (*CategoriesUpdateOne) Select

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

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

func (*CategoriesUpdateOne) SetName

SetName sets the "name" field.

func (*CategoriesUpdateOne) SetNillableName

func (cuo *CategoriesUpdateOne) SetNillableName(s *string) *CategoriesUpdateOne

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

func (*CategoriesUpdateOne) SetUpdatedAt

func (cuo *CategoriesUpdateOne) SetUpdatedAt(t time.Time) *CategoriesUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*CategoriesUpdateOne) Where

Where appends a list predicates to the CategoriesUpdate builder.

type Client

type Client struct {

	// Schema is the client for creating, migrating and dropping schema.
	Schema *migrate.Schema
	// Blocks is the client for interacting with the Blocks builders.
	Blocks *BlocksClient
	// Categories is the client for interacting with the Categories builders.
	Categories *CategoriesClient
	// Counter is the client for interacting with the Counter builders.
	Counter *CounterClient
	// Isps is the client for interacting with the Isps builders.
	Isps *IspsClient
	// Sites is the client for interacting with the Sites builders.
	Sites *SitesClient
	// SitesCategories is the client for interacting with the SitesCategories builders.
	SitesCategories *SitesCategoriesClient
	// 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().
	Blocks.
	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 Counter

type Counter struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// Count holds the value of the "count" field.
	Count int `json:"count,omitempty"`
	// contains filtered or unexported fields
}

Counter is the model entity for the Counter schema.

func (*Counter) String

func (c *Counter) String() string

String implements the fmt.Stringer.

func (*Counter) Unwrap

func (c *Counter) Unwrap() *Counter

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

func (c *Counter) Update() *CounterUpdateOne

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

func (*Counter) Value

func (c *Counter) Value(name string) (ent.Value, error)

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

type CounterClient

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

CounterClient is a client for the Counter schema.

func NewCounterClient

func NewCounterClient(c config) *CounterClient

NewCounterClient returns a client for the Counter from the given config.

func (*CounterClient) Create

func (c *CounterClient) Create() *CounterCreate

Create returns a builder for creating a Counter entity.

func (*CounterClient) CreateBulk

func (c *CounterClient) CreateBulk(builders ...*CounterCreate) *CounterCreateBulk

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

func (*CounterClient) Delete

func (c *CounterClient) Delete() *CounterDelete

Delete returns a delete builder for Counter.

func (*CounterClient) DeleteOne

func (c *CounterClient) DeleteOne(co *Counter) *CounterDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*CounterClient) DeleteOneID

func (c *CounterClient) DeleteOneID(id int) *CounterDeleteOne

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

func (*CounterClient) Get

func (c *CounterClient) Get(ctx context.Context, id int) (*Counter, error)

Get returns a Counter entity by its id.

func (*CounterClient) GetX

func (c *CounterClient) GetX(ctx context.Context, id int) *Counter

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

func (*CounterClient) Hooks

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

Hooks returns the client hooks.

func (*CounterClient) Intercept

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

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

func (*CounterClient) Interceptors

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

Interceptors returns the client interceptors.

func (*CounterClient) MapCreateBulk

func (c *CounterClient) MapCreateBulk(slice any, setFunc func(*CounterCreate, int)) *CounterCreateBulk

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

func (c *CounterClient) Query() *CounterQuery

Query returns a query builder for Counter.

func (*CounterClient) Update

func (c *CounterClient) Update() *CounterUpdate

Update returns an update builder for Counter.

func (*CounterClient) UpdateOne

func (c *CounterClient) UpdateOne(co *Counter) *CounterUpdateOne

UpdateOne returns an update builder for the given entity.

func (*CounterClient) UpdateOneID

func (c *CounterClient) UpdateOneID(id int) *CounterUpdateOne

UpdateOneID returns an update builder for the given id.

func (*CounterClient) Use

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

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

type CounterCreate

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

CounterCreate is the builder for creating a Counter entity.

func (*CounterCreate) Exec

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

Exec executes the query.

func (*CounterCreate) ExecX

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

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

func (*CounterCreate) Mutation

func (cc *CounterCreate) Mutation() *CounterMutation

Mutation returns the CounterMutation object of the builder.

func (*CounterCreate) Save

func (cc *CounterCreate) Save(ctx context.Context) (*Counter, error)

Save creates the Counter in the database.

func (*CounterCreate) SaveX

func (cc *CounterCreate) SaveX(ctx context.Context) *Counter

SaveX calls Save and panics if Save returns an error.

func (*CounterCreate) SetCount

func (cc *CounterCreate) SetCount(i int) *CounterCreate

SetCount sets the "count" field.

func (*CounterCreate) SetNillableCount

func (cc *CounterCreate) SetNillableCount(i *int) *CounterCreate

SetNillableCount sets the "count" field if the given value is not nil.

type CounterCreateBulk

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

CounterCreateBulk is the builder for creating many Counter entities in bulk.

func (*CounterCreateBulk) Exec

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

Exec executes the query.

func (*CounterCreateBulk) ExecX

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

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

func (*CounterCreateBulk) Save

func (ccb *CounterCreateBulk) Save(ctx context.Context) ([]*Counter, error)

Save creates the Counter entities in the database.

func (*CounterCreateBulk) SaveX

func (ccb *CounterCreateBulk) SaveX(ctx context.Context) []*Counter

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

type CounterDelete

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

CounterDelete is the builder for deleting a Counter entity.

func (*CounterDelete) Exec

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

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

func (*CounterDelete) ExecX

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

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

func (*CounterDelete) Where

func (cd *CounterDelete) Where(ps ...predicate.Counter) *CounterDelete

Where appends a list predicates to the CounterDelete builder.

type CounterDeleteOne

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

CounterDeleteOne is the builder for deleting a single Counter entity.

func (*CounterDeleteOne) Exec

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

Exec executes the deletion query.

func (*CounterDeleteOne) ExecX

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

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

func (*CounterDeleteOne) Where

Where appends a list predicates to the CounterDelete builder.

type CounterGroupBy

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

CounterGroupBy is the group-by builder for Counter entities.

func (*CounterGroupBy) Aggregate

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

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

func (*CounterGroupBy) Bool

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

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

func (*CounterGroupBy) BoolX

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

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

func (*CounterGroupBy) Bools

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

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

func (*CounterGroupBy) BoolsX

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

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

func (*CounterGroupBy) Float64

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

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

func (*CounterGroupBy) Float64X

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

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

func (*CounterGroupBy) Float64s

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

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

func (*CounterGroupBy) Float64sX

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

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

func (*CounterGroupBy) Int

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

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

func (*CounterGroupBy) IntX

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

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

func (*CounterGroupBy) Ints

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

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

func (*CounterGroupBy) IntsX

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

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

func (*CounterGroupBy) Scan

func (cgb *CounterGroupBy) Scan(ctx context.Context, v any) error

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

func (*CounterGroupBy) ScanX

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

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

func (*CounterGroupBy) String

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

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

func (*CounterGroupBy) StringX

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

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

func (*CounterGroupBy) Strings

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

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

func (*CounterGroupBy) StringsX

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

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

type CounterMutation

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

CounterMutation represents an operation that mutates the Counter nodes in the graph.

func (*CounterMutation) AddCount

func (m *CounterMutation) AddCount(i int)

AddCount adds i to the "count" field.

func (*CounterMutation) AddField

func (m *CounterMutation) 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 (*CounterMutation) AddedCount

func (m *CounterMutation) AddedCount() (r int, exists bool)

AddedCount returns the value that was added to the "count" field in this mutation.

func (*CounterMutation) AddedEdges

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

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

func (*CounterMutation) AddedField

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

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

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

func (*CounterMutation) AddedIDs

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

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

func (*CounterMutation) ClearEdge

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

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

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

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

func (*CounterMutation) ClearedFields

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

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

func (CounterMutation) Client

func (m CounterMutation) 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 (*CounterMutation) Count

func (m *CounterMutation) Count() (r int, exists bool)

Count returns the value of the "count" field in the mutation.

func (*CounterMutation) EdgeCleared

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

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

func (*CounterMutation) Field

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

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

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

func (*CounterMutation) Fields

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

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

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

func (*CounterMutation) IDs

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

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

func (*CounterMutation) OldCount

func (m *CounterMutation) OldCount(ctx context.Context) (v int, err error)

OldCount returns the old "count" field's value of the Counter entity. If the Counter 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 (*CounterMutation) OldField

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

func (m *CounterMutation) Op() Op

Op returns the operation name.

func (*CounterMutation) RemovedEdges

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

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

func (*CounterMutation) RemovedIDs

func (m *CounterMutation) 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 (*CounterMutation) ResetCount

func (m *CounterMutation) ResetCount()

ResetCount resets all changes to the "count" field.

func (*CounterMutation) ResetEdge

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

func (m *CounterMutation) 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 (*CounterMutation) SetCount

func (m *CounterMutation) SetCount(i int)

SetCount sets the "count" field.

func (*CounterMutation) SetField

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

func (m *CounterMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (CounterMutation) Tx

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

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

func (*CounterMutation) Type

func (m *CounterMutation) Type() string

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

func (*CounterMutation) Where

func (m *CounterMutation) Where(ps ...predicate.Counter)

Where appends a list predicates to the CounterMutation builder.

func (*CounterMutation) WhereP

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

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

type CounterQuery

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

CounterQuery is the builder for querying Counter entities.

func (*CounterQuery) Aggregate

func (cq *CounterQuery) Aggregate(fns ...AggregateFunc) *CounterSelect

Aggregate returns a CounterSelect configured with the given aggregations.

func (*CounterQuery) All

func (cq *CounterQuery) All(ctx context.Context) ([]*Counter, error)

All executes the query and returns a list of Counters.

func (*CounterQuery) AllX

func (cq *CounterQuery) AllX(ctx context.Context) []*Counter

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

func (*CounterQuery) Clone

func (cq *CounterQuery) Clone() *CounterQuery

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

func (*CounterQuery) Count

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

Count returns the count of the given query.

func (*CounterQuery) CountX

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

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

func (*CounterQuery) Exist

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

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

func (*CounterQuery) ExistX

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

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

func (*CounterQuery) First

func (cq *CounterQuery) First(ctx context.Context) (*Counter, error)

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

func (*CounterQuery) FirstID

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

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

func (*CounterQuery) FirstIDX

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

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

func (*CounterQuery) FirstX

func (cq *CounterQuery) FirstX(ctx context.Context) *Counter

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

func (*CounterQuery) GroupBy

func (cq *CounterQuery) GroupBy(field string, fields ...string) *CounterGroupBy

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

client.Counter.Query().
	GroupBy(counter.FieldCount).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*CounterQuery) IDs

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

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

func (*CounterQuery) IDsX

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

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

func (*CounterQuery) Limit

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

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

func (*CounterQuery) Offset

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

Offset to start from.

func (*CounterQuery) Only

func (cq *CounterQuery) Only(ctx context.Context) (*Counter, error)

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

func (*CounterQuery) OnlyID

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

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

func (*CounterQuery) OnlyIDX

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

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

func (*CounterQuery) OnlyX

func (cq *CounterQuery) OnlyX(ctx context.Context) *Counter

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

func (*CounterQuery) Order

func (cq *CounterQuery) Order(o ...counter.OrderOption) *CounterQuery

Order specifies how the records should be ordered.

func (*CounterQuery) Select

func (cq *CounterQuery) Select(fields ...string) *CounterSelect

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

client.Counter.Query().
	Select(counter.FieldCount).
	Scan(ctx, &v)

func (*CounterQuery) Unique

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

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

func (cq *CounterQuery) Where(ps ...predicate.Counter) *CounterQuery

Where adds a new predicate for the CounterQuery builder.

type CounterSelect

type CounterSelect struct {
	*CounterQuery
	// contains filtered or unexported fields
}

CounterSelect is the builder for selecting fields of Counter entities.

func (*CounterSelect) Aggregate

func (cs *CounterSelect) Aggregate(fns ...AggregateFunc) *CounterSelect

Aggregate adds the given aggregation functions to the selector query.

func (*CounterSelect) Bool

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

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

func (*CounterSelect) BoolX

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

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

func (*CounterSelect) Bools

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

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

func (*CounterSelect) BoolsX

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

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

func (*CounterSelect) Float64

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

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

func (*CounterSelect) Float64X

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

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

func (*CounterSelect) Float64s

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

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

func (*CounterSelect) Float64sX

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

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

func (*CounterSelect) Int

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

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

func (*CounterSelect) IntX

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

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

func (*CounterSelect) Ints

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

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

func (*CounterSelect) IntsX

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

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

func (*CounterSelect) Scan

func (cs *CounterSelect) Scan(ctx context.Context, v any) error

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

func (*CounterSelect) ScanX

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

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

func (*CounterSelect) String

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

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

func (*CounterSelect) StringX

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

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

func (*CounterSelect) Strings

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

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

func (*CounterSelect) StringsX

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

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

type CounterUpdate

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

CounterUpdate is the builder for updating Counter entities.

func (*CounterUpdate) AddCount

func (cu *CounterUpdate) AddCount(i int) *CounterUpdate

AddCount adds i to the "count" field.

func (*CounterUpdate) Exec

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

Exec executes the query.

func (*CounterUpdate) ExecX

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

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

func (*CounterUpdate) Mutation

func (cu *CounterUpdate) Mutation() *CounterMutation

Mutation returns the CounterMutation object of the builder.

func (*CounterUpdate) Save

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

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

func (*CounterUpdate) SaveX

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

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

func (*CounterUpdate) SetCount

func (cu *CounterUpdate) SetCount(i int) *CounterUpdate

SetCount sets the "count" field.

func (*CounterUpdate) SetNillableCount

func (cu *CounterUpdate) SetNillableCount(i *int) *CounterUpdate

SetNillableCount sets the "count" field if the given value is not nil.

func (*CounterUpdate) Where

func (cu *CounterUpdate) Where(ps ...predicate.Counter) *CounterUpdate

Where appends a list predicates to the CounterUpdate builder.

type CounterUpdateOne

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

CounterUpdateOne is the builder for updating a single Counter entity.

func (*CounterUpdateOne) AddCount

func (cuo *CounterUpdateOne) AddCount(i int) *CounterUpdateOne

AddCount adds i to the "count" field.

func (*CounterUpdateOne) Exec

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

Exec executes the query on the entity.

func (*CounterUpdateOne) ExecX

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

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

func (*CounterUpdateOne) Mutation

func (cuo *CounterUpdateOne) Mutation() *CounterMutation

Mutation returns the CounterMutation object of the builder.

func (*CounterUpdateOne) Save

func (cuo *CounterUpdateOne) Save(ctx context.Context) (*Counter, error)

Save executes the query and returns the updated Counter entity.

func (*CounterUpdateOne) SaveX

func (cuo *CounterUpdateOne) SaveX(ctx context.Context) *Counter

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

func (*CounterUpdateOne) Select

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

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

func (*CounterUpdateOne) SetCount

func (cuo *CounterUpdateOne) SetCount(i int) *CounterUpdateOne

SetCount sets the "count" field.

func (*CounterUpdateOne) SetNillableCount

func (cuo *CounterUpdateOne) SetNillableCount(i *int) *CounterUpdateOne

SetNillableCount sets the "count" field if the given value is not nil.

func (*CounterUpdateOne) Where

Where appends a list predicates to the CounterUpdate builder.

type Counters

type Counters []*Counter

Counters is a parsable slice of Counter.

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 Isps

type Isps struct {

	// ID of the ent.
	ID int `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"`
	// Latitude holds the value of the "latitude" field.
	Latitude float64 `json:"latitude,omitempty"`
	// Longitude holds the value of the "longitude" field.
	Longitude float64 `json:"longitude,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 IspsQuery when eager-loading is set.
	Edges IspsEdges `json:"edges"`
	// contains filtered or unexported fields
}

Isps is the model entity for the Isps schema.

func (*Isps) QueryIspBlocks

func (i *Isps) QueryIspBlocks() *BlocksQuery

QueryIspBlocks queries the "isp_blocks" edge of the Isps entity.

func (*Isps) String

func (i *Isps) String() string

String implements the fmt.Stringer.

func (*Isps) Unwrap

func (i *Isps) Unwrap() *Isps

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

func (i *Isps) Update() *IspsUpdateOne

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

func (*Isps) Value

func (i *Isps) Value(name string) (ent.Value, error)

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

type IspsClient

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

IspsClient is a client for the Isps schema.

func NewIspsClient

func NewIspsClient(c config) *IspsClient

NewIspsClient returns a client for the Isps from the given config.

func (*IspsClient) Create

func (c *IspsClient) Create() *IspsCreate

Create returns a builder for creating a Isps entity.

func (*IspsClient) CreateBulk

func (c *IspsClient) CreateBulk(builders ...*IspsCreate) *IspsCreateBulk

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

func (*IspsClient) Delete

func (c *IspsClient) Delete() *IspsDelete

Delete returns a delete builder for Isps.

func (*IspsClient) DeleteOne

func (c *IspsClient) DeleteOne(i *Isps) *IspsDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*IspsClient) DeleteOneID

func (c *IspsClient) DeleteOneID(id int) *IspsDeleteOne

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

func (*IspsClient) Get

func (c *IspsClient) Get(ctx context.Context, id int) (*Isps, error)

Get returns a Isps entity by its id.

func (*IspsClient) GetX

func (c *IspsClient) GetX(ctx context.Context, id int) *Isps

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

func (*IspsClient) Hooks

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

Hooks returns the client hooks.

func (*IspsClient) Intercept

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

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

func (*IspsClient) Interceptors

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

Interceptors returns the client interceptors.

func (*IspsClient) MapCreateBulk

func (c *IspsClient) MapCreateBulk(slice any, setFunc func(*IspsCreate, int)) *IspsCreateBulk

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

func (c *IspsClient) Query() *IspsQuery

Query returns a query builder for Isps.

func (*IspsClient) QueryIspBlocks

func (c *IspsClient) QueryIspBlocks(i *Isps) *BlocksQuery

QueryIspBlocks queries the isp_blocks edge of a Isps.

func (*IspsClient) Update

func (c *IspsClient) Update() *IspsUpdate

Update returns an update builder for Isps.

func (*IspsClient) UpdateOne

func (c *IspsClient) UpdateOne(i *Isps) *IspsUpdateOne

UpdateOne returns an update builder for the given entity.

func (*IspsClient) UpdateOneID

func (c *IspsClient) UpdateOneID(id int) *IspsUpdateOne

UpdateOneID returns an update builder for the given id.

func (*IspsClient) Use

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

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

type IspsCreate

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

IspsCreate is the builder for creating a Isps entity.

func (*IspsCreate) AddIspBlockIDs

func (ic *IspsCreate) AddIspBlockIDs(ids ...int) *IspsCreate

AddIspBlockIDs adds the "isp_blocks" edge to the Blocks entity by IDs.

func (*IspsCreate) AddIspBlocks

func (ic *IspsCreate) AddIspBlocks(b ...*Blocks) *IspsCreate

AddIspBlocks adds the "isp_blocks" edges to the Blocks entity.

func (*IspsCreate) Exec

func (ic *IspsCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*IspsCreate) ExecX

func (ic *IspsCreate) ExecX(ctx context.Context)

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

func (*IspsCreate) Mutation

func (ic *IspsCreate) Mutation() *IspsMutation

Mutation returns the IspsMutation object of the builder.

func (*IspsCreate) Save

func (ic *IspsCreate) Save(ctx context.Context) (*Isps, error)

Save creates the Isps in the database.

func (*IspsCreate) SaveX

func (ic *IspsCreate) SaveX(ctx context.Context) *Isps

SaveX calls Save and panics if Save returns an error.

func (*IspsCreate) SetCreatedAt

func (ic *IspsCreate) SetCreatedAt(t time.Time) *IspsCreate

SetCreatedAt sets the "created_at" field.

func (*IspsCreate) SetLatitude

func (ic *IspsCreate) SetLatitude(f float64) *IspsCreate

SetLatitude sets the "latitude" field.

func (*IspsCreate) SetLongitude

func (ic *IspsCreate) SetLongitude(f float64) *IspsCreate

SetLongitude sets the "longitude" field.

func (*IspsCreate) SetName

func (ic *IspsCreate) SetName(s string) *IspsCreate

SetName sets the "name" field.

func (*IspsCreate) SetNillableCreatedAt

func (ic *IspsCreate) SetNillableCreatedAt(t *time.Time) *IspsCreate

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

func (*IspsCreate) SetNillableUpdatedAt

func (ic *IspsCreate) SetNillableUpdatedAt(t *time.Time) *IspsCreate

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

func (*IspsCreate) SetUpdatedAt

func (ic *IspsCreate) SetUpdatedAt(t time.Time) *IspsCreate

SetUpdatedAt sets the "updated_at" field.

type IspsCreateBulk

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

IspsCreateBulk is the builder for creating many Isps entities in bulk.

func (*IspsCreateBulk) Exec

func (icb *IspsCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*IspsCreateBulk) ExecX

func (icb *IspsCreateBulk) ExecX(ctx context.Context)

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

func (*IspsCreateBulk) Save

func (icb *IspsCreateBulk) Save(ctx context.Context) ([]*Isps, error)

Save creates the Isps entities in the database.

func (*IspsCreateBulk) SaveX

func (icb *IspsCreateBulk) SaveX(ctx context.Context) []*Isps

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

type IspsDelete

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

IspsDelete is the builder for deleting a Isps entity.

func (*IspsDelete) Exec

func (id *IspsDelete) Exec(ctx context.Context) (int, error)

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

func (*IspsDelete) ExecX

func (id *IspsDelete) ExecX(ctx context.Context) int

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

func (*IspsDelete) Where

func (id *IspsDelete) Where(ps ...predicate.Isps) *IspsDelete

Where appends a list predicates to the IspsDelete builder.

type IspsDeleteOne

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

IspsDeleteOne is the builder for deleting a single Isps entity.

func (*IspsDeleteOne) Exec

func (ido *IspsDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*IspsDeleteOne) ExecX

func (ido *IspsDeleteOne) ExecX(ctx context.Context)

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

func (*IspsDeleteOne) Where

func (ido *IspsDeleteOne) Where(ps ...predicate.Isps) *IspsDeleteOne

Where appends a list predicates to the IspsDelete builder.

type IspsEdges

type IspsEdges struct {
	// IspBlocks holds the value of the isp_blocks edge.
	IspBlocks []*Blocks `json:"isp_blocks,omitempty"`
	// contains filtered or unexported fields
}

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

func (IspsEdges) IspBlocksOrErr

func (e IspsEdges) IspBlocksOrErr() ([]*Blocks, error)

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

type IspsGroupBy

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

IspsGroupBy is the group-by builder for Isps entities.

func (*IspsGroupBy) Aggregate

func (igb *IspsGroupBy) Aggregate(fns ...AggregateFunc) *IspsGroupBy

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

func (*IspsGroupBy) Bool

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

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

func (*IspsGroupBy) BoolX

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

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

func (*IspsGroupBy) Bools

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

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

func (*IspsGroupBy) BoolsX

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

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

func (*IspsGroupBy) Float64

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

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

func (*IspsGroupBy) Float64X

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

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

func (*IspsGroupBy) Float64s

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

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

func (*IspsGroupBy) Float64sX

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

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

func (*IspsGroupBy) Int

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

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

func (*IspsGroupBy) IntX

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

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

func (*IspsGroupBy) Ints

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

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

func (*IspsGroupBy) IntsX

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

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

func (*IspsGroupBy) Scan

func (igb *IspsGroupBy) Scan(ctx context.Context, v any) error

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

func (*IspsGroupBy) ScanX

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

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

func (*IspsGroupBy) String

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

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

func (*IspsGroupBy) StringX

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

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

func (*IspsGroupBy) Strings

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

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

func (*IspsGroupBy) StringsX

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

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

type IspsMutation

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

IspsMutation represents an operation that mutates the Isps nodes in the graph.

func (*IspsMutation) AddField

func (m *IspsMutation) 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 (*IspsMutation) AddIspBlockIDs

func (m *IspsMutation) AddIspBlockIDs(ids ...int)

AddIspBlockIDs adds the "isp_blocks" edge to the Blocks entity by ids.

func (*IspsMutation) AddLatitude

func (m *IspsMutation) AddLatitude(f float64)

AddLatitude adds f to the "latitude" field.

func (*IspsMutation) AddLongitude

func (m *IspsMutation) AddLongitude(f float64)

AddLongitude adds f to the "longitude" field.

func (*IspsMutation) AddedEdges

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

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

func (*IspsMutation) AddedField

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

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

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

func (*IspsMutation) AddedIDs

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

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

func (*IspsMutation) AddedLatitude

func (m *IspsMutation) AddedLatitude() (r float64, exists bool)

AddedLatitude returns the value that was added to the "latitude" field in this mutation.

func (*IspsMutation) AddedLongitude

func (m *IspsMutation) AddedLongitude() (r float64, exists bool)

AddedLongitude returns the value that was added to the "longitude" field in this mutation.

func (*IspsMutation) ClearEdge

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

func (m *IspsMutation) 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 (*IspsMutation) ClearIspBlocks

func (m *IspsMutation) ClearIspBlocks()

ClearIspBlocks clears the "isp_blocks" edge to the Blocks entity.

func (*IspsMutation) ClearedEdges

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

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

func (*IspsMutation) ClearedFields

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

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

func (IspsMutation) Client

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

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

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

func (*IspsMutation) EdgeCleared

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

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

func (*IspsMutation) Field

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

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

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

func (*IspsMutation) Fields

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

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

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

func (*IspsMutation) IDs

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

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

func (*IspsMutation) IspBlocksCleared

func (m *IspsMutation) IspBlocksCleared() bool

IspBlocksCleared reports if the "isp_blocks" edge to the Blocks entity was cleared.

func (*IspsMutation) IspBlocksIDs

func (m *IspsMutation) IspBlocksIDs() (ids []int)

IspBlocksIDs returns the "isp_blocks" edge IDs in the mutation.

func (*IspsMutation) Latitude

func (m *IspsMutation) Latitude() (r float64, exists bool)

Latitude returns the value of the "latitude" field in the mutation.

func (*IspsMutation) Longitude

func (m *IspsMutation) Longitude() (r float64, exists bool)

Longitude returns the value of the "longitude" field in the mutation.

func (*IspsMutation) Name

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

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

func (*IspsMutation) OldCreatedAt

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

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

func (m *IspsMutation) 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 (*IspsMutation) OldLatitude

func (m *IspsMutation) OldLatitude(ctx context.Context) (v float64, err error)

OldLatitude returns the old "latitude" field's value of the Isps entity. If the Isps 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 (*IspsMutation) OldLongitude

func (m *IspsMutation) OldLongitude(ctx context.Context) (v float64, err error)

OldLongitude returns the old "longitude" field's value of the Isps entity. If the Isps 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 (*IspsMutation) OldName

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

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

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

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

func (m *IspsMutation) Op() Op

Op returns the operation name.

func (*IspsMutation) RemoveIspBlockIDs

func (m *IspsMutation) RemoveIspBlockIDs(ids ...int)

RemoveIspBlockIDs removes the "isp_blocks" edge to the Blocks entity by IDs.

func (*IspsMutation) RemovedEdges

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

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

func (*IspsMutation) RemovedIDs

func (m *IspsMutation) 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 (*IspsMutation) RemovedIspBlocksIDs

func (m *IspsMutation) RemovedIspBlocksIDs() (ids []int)

RemovedIspBlocks returns the removed IDs of the "isp_blocks" edge to the Blocks entity.

func (*IspsMutation) ResetCreatedAt

func (m *IspsMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*IspsMutation) ResetEdge

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

func (m *IspsMutation) 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 (*IspsMutation) ResetIspBlocks

func (m *IspsMutation) ResetIspBlocks()

ResetIspBlocks resets all changes to the "isp_blocks" edge.

func (*IspsMutation) ResetLatitude

func (m *IspsMutation) ResetLatitude()

ResetLatitude resets all changes to the "latitude" field.

func (*IspsMutation) ResetLongitude

func (m *IspsMutation) ResetLongitude()

ResetLongitude resets all changes to the "longitude" field.

func (*IspsMutation) ResetName

func (m *IspsMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*IspsMutation) ResetUpdatedAt

func (m *IspsMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*IspsMutation) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*IspsMutation) SetField

func (m *IspsMutation) 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 (*IspsMutation) SetLatitude

func (m *IspsMutation) SetLatitude(f float64)

SetLatitude sets the "latitude" field.

func (*IspsMutation) SetLongitude

func (m *IspsMutation) SetLongitude(f float64)

SetLongitude sets the "longitude" field.

func (*IspsMutation) SetName

func (m *IspsMutation) SetName(s string)

SetName sets the "name" field.

func (*IspsMutation) SetOp

func (m *IspsMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*IspsMutation) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" field.

func (IspsMutation) Tx

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

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

func (*IspsMutation) Type

func (m *IspsMutation) Type() string

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

func (*IspsMutation) UpdatedAt

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

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

func (*IspsMutation) Where

func (m *IspsMutation) Where(ps ...predicate.Isps)

Where appends a list predicates to the IspsMutation builder.

func (*IspsMutation) WhereP

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

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

type IspsQuery

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

IspsQuery is the builder for querying Isps entities.

func (*IspsQuery) Aggregate

func (iq *IspsQuery) Aggregate(fns ...AggregateFunc) *IspsSelect

Aggregate returns a IspsSelect configured with the given aggregations.

func (*IspsQuery) All

func (iq *IspsQuery) All(ctx context.Context) ([]*Isps, error)

All executes the query and returns a list of IspsSlice.

func (*IspsQuery) AllX

func (iq *IspsQuery) AllX(ctx context.Context) []*Isps

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

func (*IspsQuery) Clone

func (iq *IspsQuery) Clone() *IspsQuery

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

func (*IspsQuery) Count

func (iq *IspsQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*IspsQuery) CountX

func (iq *IspsQuery) CountX(ctx context.Context) int

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

func (*IspsQuery) Exist

func (iq *IspsQuery) Exist(ctx context.Context) (bool, error)

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

func (*IspsQuery) ExistX

func (iq *IspsQuery) ExistX(ctx context.Context) bool

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

func (*IspsQuery) First

func (iq *IspsQuery) First(ctx context.Context) (*Isps, error)

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

func (*IspsQuery) FirstID

func (iq *IspsQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*IspsQuery) FirstIDX

func (iq *IspsQuery) FirstIDX(ctx context.Context) int

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

func (*IspsQuery) FirstX

func (iq *IspsQuery) FirstX(ctx context.Context) *Isps

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

func (*IspsQuery) GroupBy

func (iq *IspsQuery) GroupBy(field string, fields ...string) *IspsGroupBy

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.Isps.Query().
	GroupBy(isps.FieldCreatedAt).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*IspsQuery) IDs

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

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

func (*IspsQuery) IDsX

func (iq *IspsQuery) IDsX(ctx context.Context) []int

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

func (*IspsQuery) Limit

func (iq *IspsQuery) Limit(limit int) *IspsQuery

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

func (*IspsQuery) Offset

func (iq *IspsQuery) Offset(offset int) *IspsQuery

Offset to start from.

func (*IspsQuery) Only

func (iq *IspsQuery) Only(ctx context.Context) (*Isps, error)

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

func (*IspsQuery) OnlyID

func (iq *IspsQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*IspsQuery) OnlyIDX

func (iq *IspsQuery) OnlyIDX(ctx context.Context) int

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

func (*IspsQuery) OnlyX

func (iq *IspsQuery) OnlyX(ctx context.Context) *Isps

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

func (*IspsQuery) Order

func (iq *IspsQuery) Order(o ...isps.OrderOption) *IspsQuery

Order specifies how the records should be ordered.

func (*IspsQuery) QueryIspBlocks

func (iq *IspsQuery) QueryIspBlocks() *BlocksQuery

QueryIspBlocks chains the current query on the "isp_blocks" edge.

func (*IspsQuery) Select

func (iq *IspsQuery) Select(fields ...string) *IspsSelect

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.Isps.Query().
	Select(isps.FieldCreatedAt).
	Scan(ctx, &v)

func (*IspsQuery) Unique

func (iq *IspsQuery) Unique(unique bool) *IspsQuery

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

func (iq *IspsQuery) Where(ps ...predicate.Isps) *IspsQuery

Where adds a new predicate for the IspsQuery builder.

func (*IspsQuery) WithIspBlocks

func (iq *IspsQuery) WithIspBlocks(opts ...func(*BlocksQuery)) *IspsQuery

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

type IspsSelect

type IspsSelect struct {
	*IspsQuery
	// contains filtered or unexported fields
}

IspsSelect is the builder for selecting fields of Isps entities.

func (*IspsSelect) Aggregate

func (is *IspsSelect) Aggregate(fns ...AggregateFunc) *IspsSelect

Aggregate adds the given aggregation functions to the selector query.

func (*IspsSelect) Bool

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

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

func (*IspsSelect) BoolX

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

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

func (*IspsSelect) Bools

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

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

func (*IspsSelect) BoolsX

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

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

func (*IspsSelect) Float64

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

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

func (*IspsSelect) Float64X

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

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

func (*IspsSelect) Float64s

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

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

func (*IspsSelect) Float64sX

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

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

func (*IspsSelect) Int

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

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

func (*IspsSelect) IntX

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

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

func (*IspsSelect) Ints

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

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

func (*IspsSelect) IntsX

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

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

func (*IspsSelect) Scan

func (is *IspsSelect) Scan(ctx context.Context, v any) error

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

func (*IspsSelect) ScanX

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

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

func (*IspsSelect) String

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

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

func (*IspsSelect) StringX

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

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

func (*IspsSelect) Strings

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

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

func (*IspsSelect) StringsX

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

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

type IspsSlice

type IspsSlice []*Isps

IspsSlice is a parsable slice of Isps.

type IspsUpdate

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

IspsUpdate is the builder for updating Isps entities.

func (*IspsUpdate) AddIspBlockIDs

func (iu *IspsUpdate) AddIspBlockIDs(ids ...int) *IspsUpdate

AddIspBlockIDs adds the "isp_blocks" edge to the Blocks entity by IDs.

func (*IspsUpdate) AddIspBlocks

func (iu *IspsUpdate) AddIspBlocks(b ...*Blocks) *IspsUpdate

AddIspBlocks adds the "isp_blocks" edges to the Blocks entity.

func (*IspsUpdate) AddLatitude

func (iu *IspsUpdate) AddLatitude(f float64) *IspsUpdate

AddLatitude adds f to the "latitude" field.

func (*IspsUpdate) AddLongitude

func (iu *IspsUpdate) AddLongitude(f float64) *IspsUpdate

AddLongitude adds f to the "longitude" field.

func (*IspsUpdate) ClearIspBlocks

func (iu *IspsUpdate) ClearIspBlocks() *IspsUpdate

ClearIspBlocks clears all "isp_blocks" edges to the Blocks entity.

func (*IspsUpdate) Exec

func (iu *IspsUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*IspsUpdate) ExecX

func (iu *IspsUpdate) ExecX(ctx context.Context)

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

func (*IspsUpdate) Mutation

func (iu *IspsUpdate) Mutation() *IspsMutation

Mutation returns the IspsMutation object of the builder.

func (*IspsUpdate) RemoveIspBlockIDs

func (iu *IspsUpdate) RemoveIspBlockIDs(ids ...int) *IspsUpdate

RemoveIspBlockIDs removes the "isp_blocks" edge to Blocks entities by IDs.

func (*IspsUpdate) RemoveIspBlocks

func (iu *IspsUpdate) RemoveIspBlocks(b ...*Blocks) *IspsUpdate

RemoveIspBlocks removes "isp_blocks" edges to Blocks entities.

func (*IspsUpdate) Save

func (iu *IspsUpdate) Save(ctx context.Context) (int, error)

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

func (*IspsUpdate) SaveX

func (iu *IspsUpdate) SaveX(ctx context.Context) int

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

func (*IspsUpdate) SetLatitude

func (iu *IspsUpdate) SetLatitude(f float64) *IspsUpdate

SetLatitude sets the "latitude" field.

func (*IspsUpdate) SetLongitude

func (iu *IspsUpdate) SetLongitude(f float64) *IspsUpdate

SetLongitude sets the "longitude" field.

func (*IspsUpdate) SetName

func (iu *IspsUpdate) SetName(s string) *IspsUpdate

SetName sets the "name" field.

func (*IspsUpdate) SetNillableLatitude

func (iu *IspsUpdate) SetNillableLatitude(f *float64) *IspsUpdate

SetNillableLatitude sets the "latitude" field if the given value is not nil.

func (*IspsUpdate) SetNillableLongitude

func (iu *IspsUpdate) SetNillableLongitude(f *float64) *IspsUpdate

SetNillableLongitude sets the "longitude" field if the given value is not nil.

func (*IspsUpdate) SetNillableName

func (iu *IspsUpdate) SetNillableName(s *string) *IspsUpdate

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

func (*IspsUpdate) SetUpdatedAt

func (iu *IspsUpdate) SetUpdatedAt(t time.Time) *IspsUpdate

SetUpdatedAt sets the "updated_at" field.

func (*IspsUpdate) Where

func (iu *IspsUpdate) Where(ps ...predicate.Isps) *IspsUpdate

Where appends a list predicates to the IspsUpdate builder.

type IspsUpdateOne

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

IspsUpdateOne is the builder for updating a single Isps entity.

func (*IspsUpdateOne) AddIspBlockIDs

func (iuo *IspsUpdateOne) AddIspBlockIDs(ids ...int) *IspsUpdateOne

AddIspBlockIDs adds the "isp_blocks" edge to the Blocks entity by IDs.

func (*IspsUpdateOne) AddIspBlocks

func (iuo *IspsUpdateOne) AddIspBlocks(b ...*Blocks) *IspsUpdateOne

AddIspBlocks adds the "isp_blocks" edges to the Blocks entity.

func (*IspsUpdateOne) AddLatitude

func (iuo *IspsUpdateOne) AddLatitude(f float64) *IspsUpdateOne

AddLatitude adds f to the "latitude" field.

func (*IspsUpdateOne) AddLongitude

func (iuo *IspsUpdateOne) AddLongitude(f float64) *IspsUpdateOne

AddLongitude adds f to the "longitude" field.

func (*IspsUpdateOne) ClearIspBlocks

func (iuo *IspsUpdateOne) ClearIspBlocks() *IspsUpdateOne

ClearIspBlocks clears all "isp_blocks" edges to the Blocks entity.

func (*IspsUpdateOne) Exec

func (iuo *IspsUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*IspsUpdateOne) ExecX

func (iuo *IspsUpdateOne) ExecX(ctx context.Context)

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

func (*IspsUpdateOne) Mutation

func (iuo *IspsUpdateOne) Mutation() *IspsMutation

Mutation returns the IspsMutation object of the builder.

func (*IspsUpdateOne) RemoveIspBlockIDs

func (iuo *IspsUpdateOne) RemoveIspBlockIDs(ids ...int) *IspsUpdateOne

RemoveIspBlockIDs removes the "isp_blocks" edge to Blocks entities by IDs.

func (*IspsUpdateOne) RemoveIspBlocks

func (iuo *IspsUpdateOne) RemoveIspBlocks(b ...*Blocks) *IspsUpdateOne

RemoveIspBlocks removes "isp_blocks" edges to Blocks entities.

func (*IspsUpdateOne) Save

func (iuo *IspsUpdateOne) Save(ctx context.Context) (*Isps, error)

Save executes the query and returns the updated Isps entity.

func (*IspsUpdateOne) SaveX

func (iuo *IspsUpdateOne) SaveX(ctx context.Context) *Isps

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

func (*IspsUpdateOne) Select

func (iuo *IspsUpdateOne) Select(field string, fields ...string) *IspsUpdateOne

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

func (*IspsUpdateOne) SetLatitude

func (iuo *IspsUpdateOne) SetLatitude(f float64) *IspsUpdateOne

SetLatitude sets the "latitude" field.

func (*IspsUpdateOne) SetLongitude

func (iuo *IspsUpdateOne) SetLongitude(f float64) *IspsUpdateOne

SetLongitude sets the "longitude" field.

func (*IspsUpdateOne) SetName

func (iuo *IspsUpdateOne) SetName(s string) *IspsUpdateOne

SetName sets the "name" field.

func (*IspsUpdateOne) SetNillableLatitude

func (iuo *IspsUpdateOne) SetNillableLatitude(f *float64) *IspsUpdateOne

SetNillableLatitude sets the "latitude" field if the given value is not nil.

func (*IspsUpdateOne) SetNillableLongitude

func (iuo *IspsUpdateOne) SetNillableLongitude(f *float64) *IspsUpdateOne

SetNillableLongitude sets the "longitude" field if the given value is not nil.

func (*IspsUpdateOne) SetNillableName

func (iuo *IspsUpdateOne) SetNillableName(s *string) *IspsUpdateOne

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

func (*IspsUpdateOne) SetUpdatedAt

func (iuo *IspsUpdateOne) SetUpdatedAt(t time.Time) *IspsUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*IspsUpdateOne) Where

func (iuo *IspsUpdateOne) Where(ps ...predicate.Isps) *IspsUpdateOne

Where appends a list predicates to the IspsUpdate builder.

type MutateFunc

type MutateFunc = ent.MutateFunc

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

type Mutation

type Mutation = ent.Mutation

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

type Mutator

type Mutator = ent.Mutator

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

type NotFoundError

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

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

func (*NotFoundError) Error

func (e *NotFoundError) Error() string

Error implements the error interface.

type NotLoadedError

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

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

func (*NotLoadedError) Error

func (e *NotLoadedError) Error() string

Error implements the error interface.

type NotSingularError

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

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

func (*NotSingularError) Error

func (e *NotSingularError) Error() string

Error implements the error interface.

type Op

type Op = ent.Op

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

type Option

type Option func(*config)

Option function to configure the client.

func Debug

func Debug() Option

Debug enables debug logging on the ent.Driver.

func Driver

func Driver(driver dialect.Driver) Option

Driver configures the client driver.

func Log

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

Log sets the logging function for debug mode.

type OrderFunc

type OrderFunc func(*sql.Selector)

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

type Policy

type Policy = ent.Policy

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

type Querier

type Querier = ent.Querier

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

type QuerierFunc

type QuerierFunc = ent.QuerierFunc

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

type Query

type Query = ent.Query

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

type QueryContext

type QueryContext = ent.QueryContext

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

type RollbackFunc

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

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

func (RollbackFunc) Rollback

func (f RollbackFunc) Rollback(ctx context.Context, tx *Tx) error

Rollback calls f(ctx, m).

type RollbackHook

type RollbackHook func(Rollbacker) Rollbacker

RollbackHook defines the "rollback middleware". A function that gets a Rollbacker and returns a Rollbacker. For example:

hook := func(next ent.Rollbacker) ent.Rollbacker {
	return ent.RollbackFunc(func(ctx context.Context, tx *ent.Tx) error {
		// Do some stuff before.
		if err := next.Rollback(ctx, tx); err != nil {
			return err
		}
		// Do some stuff after.
		return nil
	})
}

type Rollbacker

type Rollbacker interface {
	Rollback(context.Context, *Tx) error
}

Rollbacker is the interface that wraps the Rollback method.

type Sites

type Sites struct {

	// ID of the ent.
	ID int `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"`
	// Domain holds the value of the "domain" field.
	Domain string `json:"domain,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the SitesQuery when eager-loading is set.
	Edges SitesEdges `json:"edges"`
	// contains filtered or unexported fields
}

Sites is the model entity for the Sites schema.

func (*Sites) QueryBlocks

func (s *Sites) QueryBlocks() *BlocksQuery

QueryBlocks queries the "blocks" edge of the Sites entity.

func (*Sites) QueryCategories

func (s *Sites) QueryCategories() *CategoriesQuery

QueryCategories queries the "categories" edge of the Sites entity.

func (*Sites) QuerySitesCategories

func (s *Sites) QuerySitesCategories() *SitesCategoriesQuery

QuerySitesCategories queries the "sites_categories" edge of the Sites entity.

func (*Sites) String

func (s *Sites) String() string

String implements the fmt.Stringer.

func (*Sites) Unwrap

func (s *Sites) Unwrap() *Sites

Unwrap unwraps the Sites 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 (*Sites) Update

func (s *Sites) Update() *SitesUpdateOne

Update returns a builder for updating this Sites. Note that you need to call Sites.Unwrap() before calling this method if this Sites was returned from a transaction, and the transaction was committed or rolled back.

func (*Sites) Value

func (s *Sites) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the Sites. This includes values selected through modifiers, order, etc.

type SitesCategories

type SitesCategories struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// SitesID holds the value of the "sites_id" field.
	SitesID int `json:"sites_id,omitempty"`
	// CategoriesID holds the value of the "categories_id" field.
	CategoriesID int `json:"categories_id,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the SitesCategoriesQuery when eager-loading is set.
	Edges SitesCategoriesEdges `json:"edges"`
	// contains filtered or unexported fields
}

SitesCategories is the model entity for the SitesCategories schema.

func (*SitesCategories) QueryCategories

func (sc *SitesCategories) QueryCategories() *CategoriesQuery

QueryCategories queries the "categories" edge of the SitesCategories entity.

func (*SitesCategories) QuerySites

func (sc *SitesCategories) QuerySites() *SitesQuery

QuerySites queries the "sites" edge of the SitesCategories entity.

func (*SitesCategories) String

func (sc *SitesCategories) String() string

String implements the fmt.Stringer.

func (*SitesCategories) Unwrap

func (sc *SitesCategories) Unwrap() *SitesCategories

Unwrap unwraps the SitesCategories 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 (*SitesCategories) Update

Update returns a builder for updating this SitesCategories. Note that you need to call SitesCategories.Unwrap() before calling this method if this SitesCategories was returned from a transaction, and the transaction was committed or rolled back.

func (*SitesCategories) Value

func (sc *SitesCategories) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the SitesCategories. This includes values selected through modifiers, order, etc.

type SitesCategoriesClient

type SitesCategoriesClient struct {
	// contains filtered or unexported fields
}

SitesCategoriesClient is a client for the SitesCategories schema.

func NewSitesCategoriesClient

func NewSitesCategoriesClient(c config) *SitesCategoriesClient

NewSitesCategoriesClient returns a client for the SitesCategories from the given config.

func (*SitesCategoriesClient) Create

Create returns a builder for creating a SitesCategories entity.

func (*SitesCategoriesClient) CreateBulk

CreateBulk returns a builder for creating a bulk of SitesCategories entities.

func (*SitesCategoriesClient) Delete

Delete returns a delete builder for SitesCategories.

func (*SitesCategoriesClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*SitesCategoriesClient) DeleteOneID

DeleteOneID returns a builder for deleting the given entity by its id.

func (*SitesCategoriesClient) Get

Get returns a SitesCategories entity by its id.

func (*SitesCategoriesClient) GetX

GetX is like Get, but panics if an error occurs.

func (*SitesCategoriesClient) Hooks

func (c *SitesCategoriesClient) Hooks() []Hook

Hooks returns the client hooks.

func (*SitesCategoriesClient) Intercept

func (c *SitesCategoriesClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `sitescategories.Intercept(f(g(h())))`.

func (*SitesCategoriesClient) Interceptors

func (c *SitesCategoriesClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*SitesCategoriesClient) MapCreateBulk

func (c *SitesCategoriesClient) MapCreateBulk(slice any, setFunc func(*SitesCategoriesCreate, int)) *SitesCategoriesCreateBulk

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 (*SitesCategoriesClient) Query

Query returns a query builder for SitesCategories.

func (*SitesCategoriesClient) QueryCategories

func (c *SitesCategoriesClient) QueryCategories(sc *SitesCategories) *CategoriesQuery

QueryCategories queries the categories edge of a SitesCategories.

func (*SitesCategoriesClient) QuerySites

func (c *SitesCategoriesClient) QuerySites(sc *SitesCategories) *SitesQuery

QuerySites queries the sites edge of a SitesCategories.

func (*SitesCategoriesClient) Update

Update returns an update builder for SitesCategories.

func (*SitesCategoriesClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*SitesCategoriesClient) UpdateOneID

UpdateOneID returns an update builder for the given id.

func (*SitesCategoriesClient) Use

func (c *SitesCategoriesClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `sitescategories.Hooks(f(g(h())))`.

type SitesCategoriesCreate

type SitesCategoriesCreate struct {
	// contains filtered or unexported fields
}

SitesCategoriesCreate is the builder for creating a SitesCategories entity.

func (*SitesCategoriesCreate) Exec

func (scc *SitesCategoriesCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*SitesCategoriesCreate) ExecX

func (scc *SitesCategoriesCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*SitesCategoriesCreate) Mutation

Mutation returns the SitesCategoriesMutation object of the builder.

func (*SitesCategoriesCreate) Save

Save creates the SitesCategories in the database.

func (*SitesCategoriesCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*SitesCategoriesCreate) SetCategories

func (scc *SitesCategoriesCreate) SetCategories(c *Categories) *SitesCategoriesCreate

SetCategories sets the "categories" edge to the Categories entity.

func (*SitesCategoriesCreate) SetCategoriesID

func (scc *SitesCategoriesCreate) SetCategoriesID(i int) *SitesCategoriesCreate

SetCategoriesID sets the "categories_id" field.

func (*SitesCategoriesCreate) SetSites

SetSites sets the "sites" edge to the Sites entity.

func (*SitesCategoriesCreate) SetSitesID

func (scc *SitesCategoriesCreate) SetSitesID(i int) *SitesCategoriesCreate

SetSitesID sets the "sites_id" field.

type SitesCategoriesCreateBulk

type SitesCategoriesCreateBulk struct {
	// contains filtered or unexported fields
}

SitesCategoriesCreateBulk is the builder for creating many SitesCategories entities in bulk.

func (*SitesCategoriesCreateBulk) Exec

Exec executes the query.

func (*SitesCategoriesCreateBulk) ExecX

func (sccb *SitesCategoriesCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*SitesCategoriesCreateBulk) Save

Save creates the SitesCategories entities in the database.

func (*SitesCategoriesCreateBulk) SaveX

SaveX is like Save, but panics if an error occurs.

type SitesCategoriesDelete

type SitesCategoriesDelete struct {
	// contains filtered or unexported fields
}

SitesCategoriesDelete is the builder for deleting a SitesCategories entity.

func (*SitesCategoriesDelete) Exec

func (scd *SitesCategoriesDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*SitesCategoriesDelete) ExecX

func (scd *SitesCategoriesDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*SitesCategoriesDelete) Where

Where appends a list predicates to the SitesCategoriesDelete builder.

type SitesCategoriesDeleteOne

type SitesCategoriesDeleteOne struct {
	// contains filtered or unexported fields
}

SitesCategoriesDeleteOne is the builder for deleting a single SitesCategories entity.

func (*SitesCategoriesDeleteOne) Exec

Exec executes the deletion query.

func (*SitesCategoriesDeleteOne) ExecX

func (scdo *SitesCategoriesDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*SitesCategoriesDeleteOne) Where

Where appends a list predicates to the SitesCategoriesDelete builder.

type SitesCategoriesEdges

type SitesCategoriesEdges struct {
	// Sites holds the value of the sites edge.
	Sites *Sites `json:"sites,omitempty"`
	// Categories holds the value of the categories edge.
	Categories *Categories `json:"categories,omitempty"`
	// contains filtered or unexported fields
}

SitesCategoriesEdges holds the relations/edges for other nodes in the graph.

func (SitesCategoriesEdges) CategoriesOrErr

func (e SitesCategoriesEdges) CategoriesOrErr() (*Categories, error)

CategoriesOrErr returns the Categories value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

func (SitesCategoriesEdges) SitesOrErr

func (e SitesCategoriesEdges) SitesOrErr() (*Sites, error)

SitesOrErr returns the Sites value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

type SitesCategoriesGroupBy

type SitesCategoriesGroupBy struct {
	// contains filtered or unexported fields
}

SitesCategoriesGroupBy is the group-by builder for SitesCategories entities.

func (*SitesCategoriesGroupBy) Aggregate

Aggregate adds the given aggregation functions to the group-by query.

func (*SitesCategoriesGroupBy) Bool

func (s *SitesCategoriesGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*SitesCategoriesGroupBy) BoolX

func (s *SitesCategoriesGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*SitesCategoriesGroupBy) Bools

func (s *SitesCategoriesGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*SitesCategoriesGroupBy) BoolsX

func (s *SitesCategoriesGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*SitesCategoriesGroupBy) Float64

func (s *SitesCategoriesGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*SitesCategoriesGroupBy) Float64X

func (s *SitesCategoriesGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*SitesCategoriesGroupBy) Float64s

func (s *SitesCategoriesGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*SitesCategoriesGroupBy) Float64sX

func (s *SitesCategoriesGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*SitesCategoriesGroupBy) Int

func (s *SitesCategoriesGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*SitesCategoriesGroupBy) IntX

func (s *SitesCategoriesGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*SitesCategoriesGroupBy) Ints

func (s *SitesCategoriesGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*SitesCategoriesGroupBy) IntsX

func (s *SitesCategoriesGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*SitesCategoriesGroupBy) Scan

func (scgb *SitesCategoriesGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*SitesCategoriesGroupBy) ScanX

func (s *SitesCategoriesGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*SitesCategoriesGroupBy) String

func (s *SitesCategoriesGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*SitesCategoriesGroupBy) StringX

func (s *SitesCategoriesGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*SitesCategoriesGroupBy) Strings

func (s *SitesCategoriesGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*SitesCategoriesGroupBy) StringsX

func (s *SitesCategoriesGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type SitesCategoriesMutation

type SitesCategoriesMutation struct {
	// contains filtered or unexported fields
}

SitesCategoriesMutation represents an operation that mutates the SitesCategories nodes in the graph.

func (*SitesCategoriesMutation) AddField

func (m *SitesCategoriesMutation) 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 (*SitesCategoriesMutation) AddedEdges

func (m *SitesCategoriesMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*SitesCategoriesMutation) AddedField

func (m *SitesCategoriesMutation) 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 (*SitesCategoriesMutation) AddedFields

func (m *SitesCategoriesMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*SitesCategoriesMutation) AddedIDs

func (m *SitesCategoriesMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*SitesCategoriesMutation) CategoriesCleared

func (m *SitesCategoriesMutation) CategoriesCleared() bool

CategoriesCleared reports if the "categories" edge to the Categories entity was cleared.

func (*SitesCategoriesMutation) CategoriesID

func (m *SitesCategoriesMutation) CategoriesID() (r int, exists bool)

CategoriesID returns the value of the "categories_id" field in the mutation.

func (*SitesCategoriesMutation) CategoriesIDs

func (m *SitesCategoriesMutation) CategoriesIDs() (ids []int)

CategoriesIDs returns the "categories" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use CategoriesID instead. It exists only for internal usage by the builders.

func (*SitesCategoriesMutation) ClearCategories

func (m *SitesCategoriesMutation) ClearCategories()

ClearCategories clears the "categories" edge to the Categories entity.

func (*SitesCategoriesMutation) ClearEdge

func (m *SitesCategoriesMutation) 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 (*SitesCategoriesMutation) ClearField

func (m *SitesCategoriesMutation) 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 (*SitesCategoriesMutation) ClearSites

func (m *SitesCategoriesMutation) ClearSites()

ClearSites clears the "sites" edge to the Sites entity.

func (*SitesCategoriesMutation) ClearedEdges

func (m *SitesCategoriesMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*SitesCategoriesMutation) ClearedFields

func (m *SitesCategoriesMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (SitesCategoriesMutation) Client

func (m SitesCategoriesMutation) 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 (*SitesCategoriesMutation) EdgeCleared

func (m *SitesCategoriesMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*SitesCategoriesMutation) Field

func (m *SitesCategoriesMutation) 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 (*SitesCategoriesMutation) FieldCleared

func (m *SitesCategoriesMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*SitesCategoriesMutation) Fields

func (m *SitesCategoriesMutation) 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 (*SitesCategoriesMutation) ID

func (m *SitesCategoriesMutation) ID() (id int, exists bool)

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.

func (*SitesCategoriesMutation) IDs

func (m *SitesCategoriesMutation) IDs(ctx context.Context) ([]int, error)

IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.

func (*SitesCategoriesMutation) OldCategoriesID

func (m *SitesCategoriesMutation) OldCategoriesID(ctx context.Context) (v int, err error)

OldCategoriesID returns the old "categories_id" field's value of the SitesCategories entity. If the SitesCategories 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 (*SitesCategoriesMutation) OldField

func (m *SitesCategoriesMutation) 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 (*SitesCategoriesMutation) OldSitesID

func (m *SitesCategoriesMutation) OldSitesID(ctx context.Context) (v int, err error)

OldSitesID returns the old "sites_id" field's value of the SitesCategories entity. If the SitesCategories 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 (*SitesCategoriesMutation) Op

func (m *SitesCategoriesMutation) Op() Op

Op returns the operation name.

func (*SitesCategoriesMutation) RemovedEdges

func (m *SitesCategoriesMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*SitesCategoriesMutation) RemovedIDs

func (m *SitesCategoriesMutation) 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 (*SitesCategoriesMutation) ResetCategories

func (m *SitesCategoriesMutation) ResetCategories()

ResetCategories resets all changes to the "categories" edge.

func (*SitesCategoriesMutation) ResetCategoriesID

func (m *SitesCategoriesMutation) ResetCategoriesID()

ResetCategoriesID resets all changes to the "categories_id" field.

func (*SitesCategoriesMutation) ResetEdge

func (m *SitesCategoriesMutation) 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 (*SitesCategoriesMutation) ResetField

func (m *SitesCategoriesMutation) 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 (*SitesCategoriesMutation) ResetSites

func (m *SitesCategoriesMutation) ResetSites()

ResetSites resets all changes to the "sites" edge.

func (*SitesCategoriesMutation) ResetSitesID

func (m *SitesCategoriesMutation) ResetSitesID()

ResetSitesID resets all changes to the "sites_id" field.

func (*SitesCategoriesMutation) SetCategoriesID

func (m *SitesCategoriesMutation) SetCategoriesID(i int)

SetCategoriesID sets the "categories_id" field.

func (*SitesCategoriesMutation) SetField

func (m *SitesCategoriesMutation) 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 (*SitesCategoriesMutation) SetOp

func (m *SitesCategoriesMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*SitesCategoriesMutation) SetSitesID

func (m *SitesCategoriesMutation) SetSitesID(i int)

SetSitesID sets the "sites_id" field.

func (*SitesCategoriesMutation) SitesCleared

func (m *SitesCategoriesMutation) SitesCleared() bool

SitesCleared reports if the "sites" edge to the Sites entity was cleared.

func (*SitesCategoriesMutation) SitesID

func (m *SitesCategoriesMutation) SitesID() (r int, exists bool)

SitesID returns the value of the "sites_id" field in the mutation.

func (*SitesCategoriesMutation) SitesIDs

func (m *SitesCategoriesMutation) SitesIDs() (ids []int)

SitesIDs returns the "sites" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use SitesID instead. It exists only for internal usage by the builders.

func (SitesCategoriesMutation) Tx

func (m SitesCategoriesMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*SitesCategoriesMutation) Type

func (m *SitesCategoriesMutation) Type() string

Type returns the node type of this mutation (SitesCategories).

func (*SitesCategoriesMutation) Where

Where appends a list predicates to the SitesCategoriesMutation builder.

func (*SitesCategoriesMutation) WhereP

func (m *SitesCategoriesMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the SitesCategoriesMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type SitesCategoriesQuery

type SitesCategoriesQuery struct {
	// contains filtered or unexported fields
}

SitesCategoriesQuery is the builder for querying SitesCategories entities.

func (*SitesCategoriesQuery) Aggregate

Aggregate returns a SitesCategoriesSelect configured with the given aggregations.

func (*SitesCategoriesQuery) All

All executes the query and returns a list of SitesCategoriesSlice.

func (*SitesCategoriesQuery) AllX

AllX is like All, but panics if an error occurs.

func (*SitesCategoriesQuery) Clone

Clone returns a duplicate of the SitesCategoriesQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*SitesCategoriesQuery) Count

func (scq *SitesCategoriesQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*SitesCategoriesQuery) CountX

func (scq *SitesCategoriesQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*SitesCategoriesQuery) Exist

func (scq *SitesCategoriesQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*SitesCategoriesQuery) ExistX

func (scq *SitesCategoriesQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*SitesCategoriesQuery) First

First returns the first SitesCategories entity from the query. Returns a *NotFoundError when no SitesCategories was found.

func (*SitesCategoriesQuery) FirstID

func (scq *SitesCategoriesQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first SitesCategories ID from the query. Returns a *NotFoundError when no SitesCategories ID was found.

func (*SitesCategoriesQuery) FirstIDX

func (scq *SitesCategoriesQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*SitesCategoriesQuery) FirstX

FirstX is like First, but panics if an error occurs.

func (*SitesCategoriesQuery) GroupBy

func (scq *SitesCategoriesQuery) GroupBy(field string, fields ...string) *SitesCategoriesGroupBy

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 {
	SitesID int `json:"sites_id,omitempty"`
	Count int `json:"count,omitempty"`
}

client.SitesCategories.Query().
	GroupBy(sitescategories.FieldSitesID).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*SitesCategoriesQuery) IDs

func (scq *SitesCategoriesQuery) IDs(ctx context.Context) (ids []int, err error)

IDs executes the query and returns a list of SitesCategories IDs.

func (*SitesCategoriesQuery) IDsX

func (scq *SitesCategoriesQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*SitesCategoriesQuery) Limit

func (scq *SitesCategoriesQuery) Limit(limit int) *SitesCategoriesQuery

Limit the number of records to be returned by this query.

func (*SitesCategoriesQuery) Offset

func (scq *SitesCategoriesQuery) Offset(offset int) *SitesCategoriesQuery

Offset to start from.

func (*SitesCategoriesQuery) Only

Only returns a single SitesCategories entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one SitesCategories entity is found. Returns a *NotFoundError when no SitesCategories entities are found.

func (*SitesCategoriesQuery) OnlyID

func (scq *SitesCategoriesQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only SitesCategories ID in the query. Returns a *NotSingularError when more than one SitesCategories ID is found. Returns a *NotFoundError when no entities are found.

func (*SitesCategoriesQuery) OnlyIDX

func (scq *SitesCategoriesQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*SitesCategoriesQuery) OnlyX

OnlyX is like Only, but panics if an error occurs.

func (*SitesCategoriesQuery) Order

Order specifies how the records should be ordered.

func (*SitesCategoriesQuery) QueryCategories

func (scq *SitesCategoriesQuery) QueryCategories() *CategoriesQuery

QueryCategories chains the current query on the "categories" edge.

func (*SitesCategoriesQuery) QuerySites

func (scq *SitesCategoriesQuery) QuerySites() *SitesQuery

QuerySites chains the current query on the "sites" edge.

func (*SitesCategoriesQuery) Select

func (scq *SitesCategoriesQuery) Select(fields ...string) *SitesCategoriesSelect

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 {
	SitesID int `json:"sites_id,omitempty"`
}

client.SitesCategories.Query().
	Select(sitescategories.FieldSitesID).
	Scan(ctx, &v)

func (*SitesCategoriesQuery) Unique

func (scq *SitesCategoriesQuery) Unique(unique bool) *SitesCategoriesQuery

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 (*SitesCategoriesQuery) Where

Where adds a new predicate for the SitesCategoriesQuery builder.

func (*SitesCategoriesQuery) WithCategories

func (scq *SitesCategoriesQuery) WithCategories(opts ...func(*CategoriesQuery)) *SitesCategoriesQuery

WithCategories tells the query-builder to eager-load the nodes that are connected to the "categories" edge. The optional arguments are used to configure the query builder of the edge.

func (*SitesCategoriesQuery) WithSites

func (scq *SitesCategoriesQuery) WithSites(opts ...func(*SitesQuery)) *SitesCategoriesQuery

WithSites tells the query-builder to eager-load the nodes that are connected to the "sites" edge. The optional arguments are used to configure the query builder of the edge.

type SitesCategoriesSelect

type SitesCategoriesSelect struct {
	*SitesCategoriesQuery
	// contains filtered or unexported fields
}

SitesCategoriesSelect is the builder for selecting fields of SitesCategories entities.

func (*SitesCategoriesSelect) Aggregate

Aggregate adds the given aggregation functions to the selector query.

func (*SitesCategoriesSelect) Bool

func (s *SitesCategoriesSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*SitesCategoriesSelect) BoolX

func (s *SitesCategoriesSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*SitesCategoriesSelect) Bools

func (s *SitesCategoriesSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*SitesCategoriesSelect) BoolsX

func (s *SitesCategoriesSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*SitesCategoriesSelect) Float64

func (s *SitesCategoriesSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*SitesCategoriesSelect) Float64X

func (s *SitesCategoriesSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*SitesCategoriesSelect) Float64s

func (s *SitesCategoriesSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*SitesCategoriesSelect) Float64sX

func (s *SitesCategoriesSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*SitesCategoriesSelect) Int

func (s *SitesCategoriesSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*SitesCategoriesSelect) IntX

func (s *SitesCategoriesSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*SitesCategoriesSelect) Ints

func (s *SitesCategoriesSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*SitesCategoriesSelect) IntsX

func (s *SitesCategoriesSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*SitesCategoriesSelect) Scan

func (scs *SitesCategoriesSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*SitesCategoriesSelect) ScanX

func (s *SitesCategoriesSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*SitesCategoriesSelect) String

func (s *SitesCategoriesSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*SitesCategoriesSelect) StringX

func (s *SitesCategoriesSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*SitesCategoriesSelect) Strings

func (s *SitesCategoriesSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*SitesCategoriesSelect) StringsX

func (s *SitesCategoriesSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type SitesCategoriesSlice

type SitesCategoriesSlice []*SitesCategories

SitesCategoriesSlice is a parsable slice of SitesCategories.

type SitesCategoriesUpdate

type SitesCategoriesUpdate struct {
	// contains filtered or unexported fields
}

SitesCategoriesUpdate is the builder for updating SitesCategories entities.

func (*SitesCategoriesUpdate) ClearCategories

func (scu *SitesCategoriesUpdate) ClearCategories() *SitesCategoriesUpdate

ClearCategories clears the "categories" edge to the Categories entity.

func (*SitesCategoriesUpdate) ClearSites

func (scu *SitesCategoriesUpdate) ClearSites() *SitesCategoriesUpdate

ClearSites clears the "sites" edge to the Sites entity.

func (*SitesCategoriesUpdate) Exec

func (scu *SitesCategoriesUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*SitesCategoriesUpdate) ExecX

func (scu *SitesCategoriesUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*SitesCategoriesUpdate) Mutation

Mutation returns the SitesCategoriesMutation object of the builder.

func (*SitesCategoriesUpdate) Save

func (scu *SitesCategoriesUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*SitesCategoriesUpdate) SaveX

func (scu *SitesCategoriesUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*SitesCategoriesUpdate) SetCategories

func (scu *SitesCategoriesUpdate) SetCategories(c *Categories) *SitesCategoriesUpdate

SetCategories sets the "categories" edge to the Categories entity.

func (*SitesCategoriesUpdate) SetCategoriesID

func (scu *SitesCategoriesUpdate) SetCategoriesID(i int) *SitesCategoriesUpdate

SetCategoriesID sets the "categories_id" field.

func (*SitesCategoriesUpdate) SetNillableCategoriesID

func (scu *SitesCategoriesUpdate) SetNillableCategoriesID(i *int) *SitesCategoriesUpdate

SetNillableCategoriesID sets the "categories_id" field if the given value is not nil.

func (*SitesCategoriesUpdate) SetNillableSitesID

func (scu *SitesCategoriesUpdate) SetNillableSitesID(i *int) *SitesCategoriesUpdate

SetNillableSitesID sets the "sites_id" field if the given value is not nil.

func (*SitesCategoriesUpdate) SetSites

SetSites sets the "sites" edge to the Sites entity.

func (*SitesCategoriesUpdate) SetSitesID

func (scu *SitesCategoriesUpdate) SetSitesID(i int) *SitesCategoriesUpdate

SetSitesID sets the "sites_id" field.

func (*SitesCategoriesUpdate) Where

Where appends a list predicates to the SitesCategoriesUpdate builder.

type SitesCategoriesUpdateOne

type SitesCategoriesUpdateOne struct {
	// contains filtered or unexported fields
}

SitesCategoriesUpdateOne is the builder for updating a single SitesCategories entity.

func (*SitesCategoriesUpdateOne) ClearCategories

func (scuo *SitesCategoriesUpdateOne) ClearCategories() *SitesCategoriesUpdateOne

ClearCategories clears the "categories" edge to the Categories entity.

func (*SitesCategoriesUpdateOne) ClearSites

ClearSites clears the "sites" edge to the Sites entity.

func (*SitesCategoriesUpdateOne) Exec

Exec executes the query on the entity.

func (*SitesCategoriesUpdateOne) ExecX

func (scuo *SitesCategoriesUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*SitesCategoriesUpdateOne) Mutation

Mutation returns the SitesCategoriesMutation object of the builder.

func (*SitesCategoriesUpdateOne) Save

Save executes the query and returns the updated SitesCategories entity.

func (*SitesCategoriesUpdateOne) SaveX

SaveX is like Save, but panics if an error occurs.

func (*SitesCategoriesUpdateOne) Select

func (scuo *SitesCategoriesUpdateOne) Select(field string, fields ...string) *SitesCategoriesUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*SitesCategoriesUpdateOne) SetCategories

SetCategories sets the "categories" edge to the Categories entity.

func (*SitesCategoriesUpdateOne) SetCategoriesID

func (scuo *SitesCategoriesUpdateOne) SetCategoriesID(i int) *SitesCategoriesUpdateOne

SetCategoriesID sets the "categories_id" field.

func (*SitesCategoriesUpdateOne) SetNillableCategoriesID

func (scuo *SitesCategoriesUpdateOne) SetNillableCategoriesID(i *int) *SitesCategoriesUpdateOne

SetNillableCategoriesID sets the "categories_id" field if the given value is not nil.

func (*SitesCategoriesUpdateOne) SetNillableSitesID

func (scuo *SitesCategoriesUpdateOne) SetNillableSitesID(i *int) *SitesCategoriesUpdateOne

SetNillableSitesID sets the "sites_id" field if the given value is not nil.

func (*SitesCategoriesUpdateOne) SetSites

SetSites sets the "sites" edge to the Sites entity.

func (*SitesCategoriesUpdateOne) SetSitesID

SetSitesID sets the "sites_id" field.

func (*SitesCategoriesUpdateOne) Where

Where appends a list predicates to the SitesCategoriesUpdate builder.

type SitesClient

type SitesClient struct {
	// contains filtered or unexported fields
}

SitesClient is a client for the Sites schema.

func NewSitesClient

func NewSitesClient(c config) *SitesClient

NewSitesClient returns a client for the Sites from the given config.

func (*SitesClient) Create

func (c *SitesClient) Create() *SitesCreate

Create returns a builder for creating a Sites entity.

func (*SitesClient) CreateBulk

func (c *SitesClient) CreateBulk(builders ...*SitesCreate) *SitesCreateBulk

CreateBulk returns a builder for creating a bulk of Sites entities.

func (*SitesClient) Delete

func (c *SitesClient) Delete() *SitesDelete

Delete returns a delete builder for Sites.

func (*SitesClient) DeleteOne

func (c *SitesClient) DeleteOne(s *Sites) *SitesDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*SitesClient) DeleteOneID

func (c *SitesClient) DeleteOneID(id int) *SitesDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*SitesClient) Get

func (c *SitesClient) Get(ctx context.Context, id int) (*Sites, error)

Get returns a Sites entity by its id.

func (*SitesClient) GetX

func (c *SitesClient) GetX(ctx context.Context, id int) *Sites

GetX is like Get, but panics if an error occurs.

func (*SitesClient) Hooks

func (c *SitesClient) Hooks() []Hook

Hooks returns the client hooks.

func (*SitesClient) Intercept

func (c *SitesClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `sites.Intercept(f(g(h())))`.

func (*SitesClient) Interceptors

func (c *SitesClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*SitesClient) MapCreateBulk

func (c *SitesClient) MapCreateBulk(slice any, setFunc func(*SitesCreate, int)) *SitesCreateBulk

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 (*SitesClient) Query

func (c *SitesClient) Query() *SitesQuery

Query returns a query builder for Sites.

func (*SitesClient) QueryBlocks

func (c *SitesClient) QueryBlocks(s *Sites) *BlocksQuery

QueryBlocks queries the blocks edge of a Sites.

func (*SitesClient) QueryCategories

func (c *SitesClient) QueryCategories(s *Sites) *CategoriesQuery

QueryCategories queries the categories edge of a Sites.

func (*SitesClient) QuerySitesCategories

func (c *SitesClient) QuerySitesCategories(s *Sites) *SitesCategoriesQuery

QuerySitesCategories queries the sites_categories edge of a Sites.

func (*SitesClient) Update

func (c *SitesClient) Update() *SitesUpdate

Update returns an update builder for Sites.

func (*SitesClient) UpdateOne

func (c *SitesClient) UpdateOne(s *Sites) *SitesUpdateOne

UpdateOne returns an update builder for the given entity.

func (*SitesClient) UpdateOneID

func (c *SitesClient) UpdateOneID(id int) *SitesUpdateOne

UpdateOneID returns an update builder for the given id.

func (*SitesClient) Use

func (c *SitesClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `sites.Hooks(f(g(h())))`.

type SitesCreate

type SitesCreate struct {
	// contains filtered or unexported fields
}

SitesCreate is the builder for creating a Sites entity.

func (*SitesCreate) AddBlockIDs

func (sc *SitesCreate) AddBlockIDs(ids ...int) *SitesCreate

AddBlockIDs adds the "blocks" edge to the Blocks entity by IDs.

func (*SitesCreate) AddBlocks

func (sc *SitesCreate) AddBlocks(b ...*Blocks) *SitesCreate

AddBlocks adds the "blocks" edges to the Blocks entity.

func (*SitesCreate) AddCategories

func (sc *SitesCreate) AddCategories(c ...*Categories) *SitesCreate

AddCategories adds the "categories" edges to the Categories entity.

func (*SitesCreate) AddCategoryIDs

func (sc *SitesCreate) AddCategoryIDs(ids ...int) *SitesCreate

AddCategoryIDs adds the "categories" edge to the Categories entity by IDs.

func (*SitesCreate) AddSitesCategories

func (sc *SitesCreate) AddSitesCategories(s ...*SitesCategories) *SitesCreate

AddSitesCategories adds the "sites_categories" edges to the SitesCategories entity.

func (*SitesCreate) AddSitesCategoryIDs

func (sc *SitesCreate) AddSitesCategoryIDs(ids ...int) *SitesCreate

AddSitesCategoryIDs adds the "sites_categories" edge to the SitesCategories entity by IDs.

func (*SitesCreate) Exec

func (sc *SitesCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*SitesCreate) ExecX

func (sc *SitesCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*SitesCreate) Mutation

func (sc *SitesCreate) Mutation() *SitesMutation

Mutation returns the SitesMutation object of the builder.

func (*SitesCreate) Save

func (sc *SitesCreate) Save(ctx context.Context) (*Sites, error)

Save creates the Sites in the database.

func (*SitesCreate) SaveX

func (sc *SitesCreate) SaveX(ctx context.Context) *Sites

SaveX calls Save and panics if Save returns an error.

func (*SitesCreate) SetCreatedAt

func (sc *SitesCreate) SetCreatedAt(t time.Time) *SitesCreate

SetCreatedAt sets the "created_at" field.

func (*SitesCreate) SetDomain

func (sc *SitesCreate) SetDomain(s string) *SitesCreate

SetDomain sets the "domain" field.

func (*SitesCreate) SetNillableCreatedAt

func (sc *SitesCreate) SetNillableCreatedAt(t *time.Time) *SitesCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*SitesCreate) SetNillableUpdatedAt

func (sc *SitesCreate) SetNillableUpdatedAt(t *time.Time) *SitesCreate

SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.

func (*SitesCreate) SetUpdatedAt

func (sc *SitesCreate) SetUpdatedAt(t time.Time) *SitesCreate

SetUpdatedAt sets the "updated_at" field.

type SitesCreateBulk

type SitesCreateBulk struct {
	// contains filtered or unexported fields
}

SitesCreateBulk is the builder for creating many Sites entities in bulk.

func (*SitesCreateBulk) Exec

func (scb *SitesCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*SitesCreateBulk) ExecX

func (scb *SitesCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*SitesCreateBulk) Save

func (scb *SitesCreateBulk) Save(ctx context.Context) ([]*Sites, error)

Save creates the Sites entities in the database.

func (*SitesCreateBulk) SaveX

func (scb *SitesCreateBulk) SaveX(ctx context.Context) []*Sites

SaveX is like Save, but panics if an error occurs.

type SitesDelete

type SitesDelete struct {
	// contains filtered or unexported fields
}

SitesDelete is the builder for deleting a Sites entity.

func (*SitesDelete) Exec

func (sd *SitesDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*SitesDelete) ExecX

func (sd *SitesDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*SitesDelete) Where

func (sd *SitesDelete) Where(ps ...predicate.Sites) *SitesDelete

Where appends a list predicates to the SitesDelete builder.

type SitesDeleteOne

type SitesDeleteOne struct {
	// contains filtered or unexported fields
}

SitesDeleteOne is the builder for deleting a single Sites entity.

func (*SitesDeleteOne) Exec

func (sdo *SitesDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*SitesDeleteOne) ExecX

func (sdo *SitesDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*SitesDeleteOne) Where

func (sdo *SitesDeleteOne) Where(ps ...predicate.Sites) *SitesDeleteOne

Where appends a list predicates to the SitesDelete builder.

type SitesEdges

type SitesEdges struct {
	// Blocks holds the value of the blocks edge.
	Blocks []*Blocks `json:"blocks,omitempty"`
	// Categories holds the value of the categories edge.
	Categories []*Categories `json:"categories,omitempty"`
	// SitesCategories holds the value of the sites_categories edge.
	SitesCategories []*SitesCategories `json:"sites_categories,omitempty"`
	// contains filtered or unexported fields
}

SitesEdges holds the relations/edges for other nodes in the graph.

func (SitesEdges) BlocksOrErr

func (e SitesEdges) BlocksOrErr() ([]*Blocks, error)

BlocksOrErr returns the Blocks value or an error if the edge was not loaded in eager-loading.

func (SitesEdges) CategoriesOrErr

func (e SitesEdges) CategoriesOrErr() ([]*Categories, error)

CategoriesOrErr returns the Categories value or an error if the edge was not loaded in eager-loading.

func (SitesEdges) SitesCategoriesOrErr

func (e SitesEdges) SitesCategoriesOrErr() ([]*SitesCategories, error)

SitesCategoriesOrErr returns the SitesCategories value or an error if the edge was not loaded in eager-loading.

type SitesGroupBy

type SitesGroupBy struct {
	// contains filtered or unexported fields
}

SitesGroupBy is the group-by builder for Sites entities.

func (*SitesGroupBy) Aggregate

func (sgb *SitesGroupBy) Aggregate(fns ...AggregateFunc) *SitesGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*SitesGroupBy) Bool

func (s *SitesGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*SitesGroupBy) BoolX

func (s *SitesGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*SitesGroupBy) Bools

func (s *SitesGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*SitesGroupBy) BoolsX

func (s *SitesGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*SitesGroupBy) Float64

func (s *SitesGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*SitesGroupBy) Float64X

func (s *SitesGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*SitesGroupBy) Float64s

func (s *SitesGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*SitesGroupBy) Float64sX

func (s *SitesGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*SitesGroupBy) Int

func (s *SitesGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*SitesGroupBy) IntX

func (s *SitesGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*SitesGroupBy) Ints

func (s *SitesGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*SitesGroupBy) IntsX

func (s *SitesGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*SitesGroupBy) Scan

func (sgb *SitesGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*SitesGroupBy) ScanX

func (s *SitesGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*SitesGroupBy) String

func (s *SitesGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*SitesGroupBy) StringX

func (s *SitesGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*SitesGroupBy) Strings

func (s *SitesGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*SitesGroupBy) StringsX

func (s *SitesGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type SitesMutation

type SitesMutation struct {
	// contains filtered or unexported fields
}

SitesMutation represents an operation that mutates the Sites nodes in the graph.

func (*SitesMutation) AddBlockIDs

func (m *SitesMutation) AddBlockIDs(ids ...int)

AddBlockIDs adds the "blocks" edge to the Blocks entity by ids.

func (*SitesMutation) AddCategoryIDs

func (m *SitesMutation) AddCategoryIDs(ids ...int)

AddCategoryIDs adds the "categories" edge to the Categories entity by ids.

func (*SitesMutation) AddField

func (m *SitesMutation) 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 (*SitesMutation) AddSitesCategoryIDs

func (m *SitesMutation) AddSitesCategoryIDs(ids ...int)

AddSitesCategoryIDs adds the "sites_categories" edge to the SitesCategories entity by ids.

func (*SitesMutation) AddedEdges

func (m *SitesMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*SitesMutation) AddedField

func (m *SitesMutation) 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 (*SitesMutation) AddedFields

func (m *SitesMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*SitesMutation) AddedIDs

func (m *SitesMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*SitesMutation) BlocksCleared

func (m *SitesMutation) BlocksCleared() bool

BlocksCleared reports if the "blocks" edge to the Blocks entity was cleared.

func (*SitesMutation) BlocksIDs

func (m *SitesMutation) BlocksIDs() (ids []int)

BlocksIDs returns the "blocks" edge IDs in the mutation.

func (*SitesMutation) CategoriesCleared

func (m *SitesMutation) CategoriesCleared() bool

CategoriesCleared reports if the "categories" edge to the Categories entity was cleared.

func (*SitesMutation) CategoriesIDs

func (m *SitesMutation) CategoriesIDs() (ids []int)

CategoriesIDs returns the "categories" edge IDs in the mutation.

func (*SitesMutation) ClearBlocks

func (m *SitesMutation) ClearBlocks()

ClearBlocks clears the "blocks" edge to the Blocks entity.

func (*SitesMutation) ClearCategories

func (m *SitesMutation) ClearCategories()

ClearCategories clears the "categories" edge to the Categories entity.

func (*SitesMutation) ClearEdge

func (m *SitesMutation) 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 (*SitesMutation) ClearField

func (m *SitesMutation) 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 (*SitesMutation) ClearSitesCategories

func (m *SitesMutation) ClearSitesCategories()

ClearSitesCategories clears the "sites_categories" edge to the SitesCategories entity.

func (*SitesMutation) ClearedEdges

func (m *SitesMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*SitesMutation) ClearedFields

func (m *SitesMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (SitesMutation) Client

func (m SitesMutation) 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 (*SitesMutation) CreatedAt

func (m *SitesMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*SitesMutation) Domain

func (m *SitesMutation) Domain() (r string, exists bool)

Domain returns the value of the "domain" field in the mutation.

func (*SitesMutation) EdgeCleared

func (m *SitesMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*SitesMutation) Field

func (m *SitesMutation) 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 (*SitesMutation) FieldCleared

func (m *SitesMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*SitesMutation) Fields

func (m *SitesMutation) 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 (*SitesMutation) ID

func (m *SitesMutation) ID() (id int, exists bool)

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.

func (*SitesMutation) IDs

func (m *SitesMutation) IDs(ctx context.Context) ([]int, error)

IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.

func (*SitesMutation) OldCreatedAt

func (m *SitesMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the Sites entity. If the Sites 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 (*SitesMutation) OldDomain

func (m *SitesMutation) OldDomain(ctx context.Context) (v string, err error)

OldDomain returns the old "domain" field's value of the Sites entity. If the Sites 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 (*SitesMutation) OldField

func (m *SitesMutation) 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 (*SitesMutation) OldUpdatedAt

func (m *SitesMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)

OldUpdatedAt returns the old "updated_at" field's value of the Sites entity. If the Sites 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 (*SitesMutation) Op

func (m *SitesMutation) Op() Op

Op returns the operation name.

func (*SitesMutation) RemoveBlockIDs

func (m *SitesMutation) RemoveBlockIDs(ids ...int)

RemoveBlockIDs removes the "blocks" edge to the Blocks entity by IDs.

func (*SitesMutation) RemoveCategoryIDs

func (m *SitesMutation) RemoveCategoryIDs(ids ...int)

RemoveCategoryIDs removes the "categories" edge to the Categories entity by IDs.

func (*SitesMutation) RemoveSitesCategoryIDs

func (m *SitesMutation) RemoveSitesCategoryIDs(ids ...int)

RemoveSitesCategoryIDs removes the "sites_categories" edge to the SitesCategories entity by IDs.

func (*SitesMutation) RemovedBlocksIDs

func (m *SitesMutation) RemovedBlocksIDs() (ids []int)

RemovedBlocks returns the removed IDs of the "blocks" edge to the Blocks entity.

func (*SitesMutation) RemovedCategoriesIDs

func (m *SitesMutation) RemovedCategoriesIDs() (ids []int)

RemovedCategories returns the removed IDs of the "categories" edge to the Categories entity.

func (*SitesMutation) RemovedEdges

func (m *SitesMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*SitesMutation) RemovedIDs

func (m *SitesMutation) 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 (*SitesMutation) RemovedSitesCategoriesIDs

func (m *SitesMutation) RemovedSitesCategoriesIDs() (ids []int)

RemovedSitesCategories returns the removed IDs of the "sites_categories" edge to the SitesCategories entity.

func (*SitesMutation) ResetBlocks

func (m *SitesMutation) ResetBlocks()

ResetBlocks resets all changes to the "blocks" edge.

func (*SitesMutation) ResetCategories

func (m *SitesMutation) ResetCategories()

ResetCategories resets all changes to the "categories" edge.

func (*SitesMutation) ResetCreatedAt

func (m *SitesMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*SitesMutation) ResetDomain

func (m *SitesMutation) ResetDomain()

ResetDomain resets all changes to the "domain" field.

func (*SitesMutation) ResetEdge

func (m *SitesMutation) 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 (*SitesMutation) ResetField

func (m *SitesMutation) 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 (*SitesMutation) ResetSitesCategories

func (m *SitesMutation) ResetSitesCategories()

ResetSitesCategories resets all changes to the "sites_categories" edge.

func (*SitesMutation) ResetUpdatedAt

func (m *SitesMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*SitesMutation) SetCreatedAt

func (m *SitesMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*SitesMutation) SetDomain

func (m *SitesMutation) SetDomain(s string)

SetDomain sets the "domain" field.

func (*SitesMutation) SetField

func (m *SitesMutation) 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 (*SitesMutation) SetOp

func (m *SitesMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*SitesMutation) SetUpdatedAt

func (m *SitesMutation) SetUpdatedAt(t time.Time)

SetUpdatedAt sets the "updated_at" field.

func (*SitesMutation) SitesCategoriesCleared

func (m *SitesMutation) SitesCategoriesCleared() bool

SitesCategoriesCleared reports if the "sites_categories" edge to the SitesCategories entity was cleared.

func (*SitesMutation) SitesCategoriesIDs

func (m *SitesMutation) SitesCategoriesIDs() (ids []int)

SitesCategoriesIDs returns the "sites_categories" edge IDs in the mutation.

func (SitesMutation) Tx

func (m SitesMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*SitesMutation) Type

func (m *SitesMutation) Type() string

Type returns the node type of this mutation (Sites).

func (*SitesMutation) UpdatedAt

func (m *SitesMutation) UpdatedAt() (r time.Time, exists bool)

UpdatedAt returns the value of the "updated_at" field in the mutation.

func (*SitesMutation) Where

func (m *SitesMutation) Where(ps ...predicate.Sites)

Where appends a list predicates to the SitesMutation builder.

func (*SitesMutation) WhereP

func (m *SitesMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the SitesMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type SitesQuery

type SitesQuery struct {
	// contains filtered or unexported fields
}

SitesQuery is the builder for querying Sites entities.

func (*SitesQuery) Aggregate

func (sq *SitesQuery) Aggregate(fns ...AggregateFunc) *SitesSelect

Aggregate returns a SitesSelect configured with the given aggregations.

func (*SitesQuery) All

func (sq *SitesQuery) All(ctx context.Context) ([]*Sites, error)

All executes the query and returns a list of SitesSlice.

func (*SitesQuery) AllX

func (sq *SitesQuery) AllX(ctx context.Context) []*Sites

AllX is like All, but panics if an error occurs.

func (*SitesQuery) Clone

func (sq *SitesQuery) Clone() *SitesQuery

Clone returns a duplicate of the SitesQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*SitesQuery) Count

func (sq *SitesQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*SitesQuery) CountX

func (sq *SitesQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*SitesQuery) Exist

func (sq *SitesQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*SitesQuery) ExistX

func (sq *SitesQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*SitesQuery) First

func (sq *SitesQuery) First(ctx context.Context) (*Sites, error)

First returns the first Sites entity from the query. Returns a *NotFoundError when no Sites was found.

func (*SitesQuery) FirstID

func (sq *SitesQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first Sites ID from the query. Returns a *NotFoundError when no Sites ID was found.

func (*SitesQuery) FirstIDX

func (sq *SitesQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*SitesQuery) FirstX

func (sq *SitesQuery) FirstX(ctx context.Context) *Sites

FirstX is like First, but panics if an error occurs.

func (*SitesQuery) GroupBy

func (sq *SitesQuery) GroupBy(field string, fields ...string) *SitesGroupBy

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.Sites.Query().
	GroupBy(sites.FieldCreatedAt).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*SitesQuery) IDs

func (sq *SitesQuery) IDs(ctx context.Context) (ids []int, err error)

IDs executes the query and returns a list of Sites IDs.

func (*SitesQuery) IDsX

func (sq *SitesQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*SitesQuery) Limit

func (sq *SitesQuery) Limit(limit int) *SitesQuery

Limit the number of records to be returned by this query.

func (*SitesQuery) Offset

func (sq *SitesQuery) Offset(offset int) *SitesQuery

Offset to start from.

func (*SitesQuery) Only

func (sq *SitesQuery) Only(ctx context.Context) (*Sites, error)

Only returns a single Sites entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Sites entity is found. Returns a *NotFoundError when no Sites entities are found.

func (*SitesQuery) OnlyID

func (sq *SitesQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only Sites ID in the query. Returns a *NotSingularError when more than one Sites ID is found. Returns a *NotFoundError when no entities are found.

func (*SitesQuery) OnlyIDX

func (sq *SitesQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*SitesQuery) OnlyX

func (sq *SitesQuery) OnlyX(ctx context.Context) *Sites

OnlyX is like Only, but panics if an error occurs.

func (*SitesQuery) Order

func (sq *SitesQuery) Order(o ...sites.OrderOption) *SitesQuery

Order specifies how the records should be ordered.

func (*SitesQuery) QueryBlocks

func (sq *SitesQuery) QueryBlocks() *BlocksQuery

QueryBlocks chains the current query on the "blocks" edge.

func (*SitesQuery) QueryCategories

func (sq *SitesQuery) QueryCategories() *CategoriesQuery

QueryCategories chains the current query on the "categories" edge.

func (*SitesQuery) QuerySitesCategories

func (sq *SitesQuery) QuerySitesCategories() *SitesCategoriesQuery

QuerySitesCategories chains the current query on the "sites_categories" edge.

func (*SitesQuery) Select

func (sq *SitesQuery) Select(fields ...string) *SitesSelect

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.Sites.Query().
	Select(sites.FieldCreatedAt).
	Scan(ctx, &v)

func (*SitesQuery) Unique

func (sq *SitesQuery) Unique(unique bool) *SitesQuery

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 (*SitesQuery) Where

func (sq *SitesQuery) Where(ps ...predicate.Sites) *SitesQuery

Where adds a new predicate for the SitesQuery builder.

func (*SitesQuery) WithBlocks

func (sq *SitesQuery) WithBlocks(opts ...func(*BlocksQuery)) *SitesQuery

WithBlocks tells the query-builder to eager-load the nodes that are connected to the "blocks" edge. The optional arguments are used to configure the query builder of the edge.

func (*SitesQuery) WithCategories

func (sq *SitesQuery) WithCategories(opts ...func(*CategoriesQuery)) *SitesQuery

WithCategories tells the query-builder to eager-load the nodes that are connected to the "categories" edge. The optional arguments are used to configure the query builder of the edge.

func (*SitesQuery) WithSitesCategories

func (sq *SitesQuery) WithSitesCategories(opts ...func(*SitesCategoriesQuery)) *SitesQuery

WithSitesCategories tells the query-builder to eager-load the nodes that are connected to the "sites_categories" edge. The optional arguments are used to configure the query builder of the edge.

type SitesSelect

type SitesSelect struct {
	*SitesQuery
	// contains filtered or unexported fields
}

SitesSelect is the builder for selecting fields of Sites entities.

func (*SitesSelect) Aggregate

func (ss *SitesSelect) Aggregate(fns ...AggregateFunc) *SitesSelect

Aggregate adds the given aggregation functions to the selector query.

func (*SitesSelect) Bool

func (s *SitesSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*SitesSelect) BoolX

func (s *SitesSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*SitesSelect) Bools

func (s *SitesSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*SitesSelect) BoolsX

func (s *SitesSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*SitesSelect) Float64

func (s *SitesSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*SitesSelect) Float64X

func (s *SitesSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*SitesSelect) Float64s

func (s *SitesSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*SitesSelect) Float64sX

func (s *SitesSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*SitesSelect) Int

func (s *SitesSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*SitesSelect) IntX

func (s *SitesSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*SitesSelect) Ints

func (s *SitesSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*SitesSelect) IntsX

func (s *SitesSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*SitesSelect) Scan

func (ss *SitesSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*SitesSelect) ScanX

func (s *SitesSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*SitesSelect) String

func (s *SitesSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*SitesSelect) StringX

func (s *SitesSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*SitesSelect) Strings

func (s *SitesSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*SitesSelect) StringsX

func (s *SitesSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type SitesSlice

type SitesSlice []*Sites

SitesSlice is a parsable slice of Sites.

type SitesUpdate

type SitesUpdate struct {
	// contains filtered or unexported fields
}

SitesUpdate is the builder for updating Sites entities.

func (*SitesUpdate) AddBlockIDs

func (su *SitesUpdate) AddBlockIDs(ids ...int) *SitesUpdate

AddBlockIDs adds the "blocks" edge to the Blocks entity by IDs.

func (*SitesUpdate) AddBlocks

func (su *SitesUpdate) AddBlocks(b ...*Blocks) *SitesUpdate

AddBlocks adds the "blocks" edges to the Blocks entity.

func (*SitesUpdate) AddCategories

func (su *SitesUpdate) AddCategories(c ...*Categories) *SitesUpdate

AddCategories adds the "categories" edges to the Categories entity.

func (*SitesUpdate) AddCategoryIDs

func (su *SitesUpdate) AddCategoryIDs(ids ...int) *SitesUpdate

AddCategoryIDs adds the "categories" edge to the Categories entity by IDs.

func (*SitesUpdate) AddSitesCategories

func (su *SitesUpdate) AddSitesCategories(s ...*SitesCategories) *SitesUpdate

AddSitesCategories adds the "sites_categories" edges to the SitesCategories entity.

func (*SitesUpdate) AddSitesCategoryIDs

func (su *SitesUpdate) AddSitesCategoryIDs(ids ...int) *SitesUpdate

AddSitesCategoryIDs adds the "sites_categories" edge to the SitesCategories entity by IDs.

func (*SitesUpdate) ClearBlocks

func (su *SitesUpdate) ClearBlocks() *SitesUpdate

ClearBlocks clears all "blocks" edges to the Blocks entity.

func (*SitesUpdate) ClearCategories

func (su *SitesUpdate) ClearCategories() *SitesUpdate

ClearCategories clears all "categories" edges to the Categories entity.

func (*SitesUpdate) ClearSitesCategories

func (su *SitesUpdate) ClearSitesCategories() *SitesUpdate

ClearSitesCategories clears all "sites_categories" edges to the SitesCategories entity.

func (*SitesUpdate) Exec

func (su *SitesUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*SitesUpdate) ExecX

func (su *SitesUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*SitesUpdate) Mutation

func (su *SitesUpdate) Mutation() *SitesMutation

Mutation returns the SitesMutation object of the builder.

func (*SitesUpdate) RemoveBlockIDs

func (su *SitesUpdate) RemoveBlockIDs(ids ...int) *SitesUpdate

RemoveBlockIDs removes the "blocks" edge to Blocks entities by IDs.

func (*SitesUpdate) RemoveBlocks

func (su *SitesUpdate) RemoveBlocks(b ...*Blocks) *SitesUpdate

RemoveBlocks removes "blocks" edges to Blocks entities.

func (*SitesUpdate) RemoveCategories

func (su *SitesUpdate) RemoveCategories(c ...*Categories) *SitesUpdate

RemoveCategories removes "categories" edges to Categories entities.

func (*SitesUpdate) RemoveCategoryIDs

func (su *SitesUpdate) RemoveCategoryIDs(ids ...int) *SitesUpdate

RemoveCategoryIDs removes the "categories" edge to Categories entities by IDs.

func (*SitesUpdate) RemoveSitesCategories

func (su *SitesUpdate) RemoveSitesCategories(s ...*SitesCategories) *SitesUpdate

RemoveSitesCategories removes "sites_categories" edges to SitesCategories entities.

func (*SitesUpdate) RemoveSitesCategoryIDs

func (su *SitesUpdate) RemoveSitesCategoryIDs(ids ...int) *SitesUpdate

RemoveSitesCategoryIDs removes the "sites_categories" edge to SitesCategories entities by IDs.

func (*SitesUpdate) Save

func (su *SitesUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*SitesUpdate) SaveX

func (su *SitesUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*SitesUpdate) SetDomain

func (su *SitesUpdate) SetDomain(s string) *SitesUpdate

SetDomain sets the "domain" field.

func (*SitesUpdate) SetNillableDomain

func (su *SitesUpdate) SetNillableDomain(s *string) *SitesUpdate

SetNillableDomain sets the "domain" field if the given value is not nil.

func (*SitesUpdate) SetUpdatedAt

func (su *SitesUpdate) SetUpdatedAt(t time.Time) *SitesUpdate

SetUpdatedAt sets the "updated_at" field.

func (*SitesUpdate) Where

func (su *SitesUpdate) Where(ps ...predicate.Sites) *SitesUpdate

Where appends a list predicates to the SitesUpdate builder.

type SitesUpdateOne

type SitesUpdateOne struct {
	// contains filtered or unexported fields
}

SitesUpdateOne is the builder for updating a single Sites entity.

func (*SitesUpdateOne) AddBlockIDs

func (suo *SitesUpdateOne) AddBlockIDs(ids ...int) *SitesUpdateOne

AddBlockIDs adds the "blocks" edge to the Blocks entity by IDs.

func (*SitesUpdateOne) AddBlocks

func (suo *SitesUpdateOne) AddBlocks(b ...*Blocks) *SitesUpdateOne

AddBlocks adds the "blocks" edges to the Blocks entity.

func (*SitesUpdateOne) AddCategories

func (suo *SitesUpdateOne) AddCategories(c ...*Categories) *SitesUpdateOne

AddCategories adds the "categories" edges to the Categories entity.

func (*SitesUpdateOne) AddCategoryIDs

func (suo *SitesUpdateOne) AddCategoryIDs(ids ...int) *SitesUpdateOne

AddCategoryIDs adds the "categories" edge to the Categories entity by IDs.

func (*SitesUpdateOne) AddSitesCategories

func (suo *SitesUpdateOne) AddSitesCategories(s ...*SitesCategories) *SitesUpdateOne

AddSitesCategories adds the "sites_categories" edges to the SitesCategories entity.

func (*SitesUpdateOne) AddSitesCategoryIDs

func (suo *SitesUpdateOne) AddSitesCategoryIDs(ids ...int) *SitesUpdateOne

AddSitesCategoryIDs adds the "sites_categories" edge to the SitesCategories entity by IDs.

func (*SitesUpdateOne) ClearBlocks

func (suo *SitesUpdateOne) ClearBlocks() *SitesUpdateOne

ClearBlocks clears all "blocks" edges to the Blocks entity.

func (*SitesUpdateOne) ClearCategories

func (suo *SitesUpdateOne) ClearCategories() *SitesUpdateOne

ClearCategories clears all "categories" edges to the Categories entity.

func (*SitesUpdateOne) ClearSitesCategories

func (suo *SitesUpdateOne) ClearSitesCategories() *SitesUpdateOne

ClearSitesCategories clears all "sites_categories" edges to the SitesCategories entity.

func (*SitesUpdateOne) Exec

func (suo *SitesUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*SitesUpdateOne) ExecX

func (suo *SitesUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*SitesUpdateOne) Mutation

func (suo *SitesUpdateOne) Mutation() *SitesMutation

Mutation returns the SitesMutation object of the builder.

func (*SitesUpdateOne) RemoveBlockIDs

func (suo *SitesUpdateOne) RemoveBlockIDs(ids ...int) *SitesUpdateOne

RemoveBlockIDs removes the "blocks" edge to Blocks entities by IDs.

func (*SitesUpdateOne) RemoveBlocks

func (suo *SitesUpdateOne) RemoveBlocks(b ...*Blocks) *SitesUpdateOne

RemoveBlocks removes "blocks" edges to Blocks entities.

func (*SitesUpdateOne) RemoveCategories

func (suo *SitesUpdateOne) RemoveCategories(c ...*Categories) *SitesUpdateOne

RemoveCategories removes "categories" edges to Categories entities.

func (*SitesUpdateOne) RemoveCategoryIDs

func (suo *SitesUpdateOne) RemoveCategoryIDs(ids ...int) *SitesUpdateOne

RemoveCategoryIDs removes the "categories" edge to Categories entities by IDs.

func (*SitesUpdateOne) RemoveSitesCategories

func (suo *SitesUpdateOne) RemoveSitesCategories(s ...*SitesCategories) *SitesUpdateOne

RemoveSitesCategories removes "sites_categories" edges to SitesCategories entities.

func (*SitesUpdateOne) RemoveSitesCategoryIDs

func (suo *SitesUpdateOne) RemoveSitesCategoryIDs(ids ...int) *SitesUpdateOne

RemoveSitesCategoryIDs removes the "sites_categories" edge to SitesCategories entities by IDs.

func (*SitesUpdateOne) Save

func (suo *SitesUpdateOne) Save(ctx context.Context) (*Sites, error)

Save executes the query and returns the updated Sites entity.

func (*SitesUpdateOne) SaveX

func (suo *SitesUpdateOne) SaveX(ctx context.Context) *Sites

SaveX is like Save, but panics if an error occurs.

func (*SitesUpdateOne) Select

func (suo *SitesUpdateOne) Select(field string, fields ...string) *SitesUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*SitesUpdateOne) SetDomain

func (suo *SitesUpdateOne) SetDomain(s string) *SitesUpdateOne

SetDomain sets the "domain" field.

func (*SitesUpdateOne) SetNillableDomain

func (suo *SitesUpdateOne) SetNillableDomain(s *string) *SitesUpdateOne

SetNillableDomain sets the "domain" field if the given value is not nil.

func (*SitesUpdateOne) SetUpdatedAt

func (suo *SitesUpdateOne) SetUpdatedAt(t time.Time) *SitesUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*SitesUpdateOne) Where

func (suo *SitesUpdateOne) Where(ps ...predicate.Sites) *SitesUpdateOne

Where appends a list predicates to the SitesUpdate builder.

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 {

	// Blocks is the client for interacting with the Blocks builders.
	Blocks *BlocksClient
	// Categories is the client for interacting with the Categories builders.
	Categories *CategoriesClient
	// Counter is the client for interacting with the Counter builders.
	Counter *CounterClient
	// Isps is the client for interacting with the Isps builders.
	Isps *IspsClient
	// Sites is the client for interacting with the Sites builders.
	Sites *SitesClient
	// SitesCategories is the client for interacting with the SitesCategories builders.
	SitesCategories *SitesCategoriesClient
	// contains filtered or unexported fields
}

Tx is a transactional client that is created by calling Client.Tx().

func TxFromContext

func TxFromContext(ctx context.Context) *Tx

TxFromContext returns a Tx stored inside a context, or nil if there isn't one.

func (*Tx) Client

func (tx *Tx) Client() *Client

Client returns a Client that binds to current transaction.

func (*Tx) Commit

func (tx *Tx) Commit() error

Commit commits the transaction.

func (*Tx) OnCommit

func (tx *Tx) OnCommit(f CommitHook)

OnCommit adds a hook to call on commit.

func (*Tx) OnRollback

func (tx *Tx) OnRollback(f RollbackHook)

OnRollback adds a hook to call on rollback.

func (*Tx) Rollback

func (tx *Tx) Rollback() error

Rollback rollbacks the transaction.

type ValidationError

type ValidationError struct {
	Name string // Field or edge name.
	// contains filtered or unexported fields
}

ValidationError returns when validating a field or edge fails.

func (*ValidationError) Error

func (e *ValidationError) Error() string

Error implements the error interface.

func (*ValidationError) Unwrap

func (e *ValidationError) Unwrap() error

Unwrap implements the errors.Wrapper interface.

type Value

type Value = ent.Value

ent aliases to avoid import conflicts in user's code.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL