ent

package
v0.0.0-...-b7d53eb Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2021 License: Apache-2.0 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.
	TypeAPIAudit = "APIAudit"
	TypeFact     = "Fact"
	TypeFactType = "FactType"
	TypeGrant    = "Grant"
	TypeScope    = "Scope"
)

Variables

This section is empty.

Functions

func IsConstraintError

func IsConstraintError(err error) bool

IsConstraintError returns a boolean indicating whether the error is a constraint failure.

func IsNotFound

func IsNotFound(err error) bool

IsNotFound returns a boolean indicating whether the error is a not found error.

func IsNotLoaded

func IsNotLoaded(err error) bool

IsNotLoaded returns a boolean indicating whether the error is a not loaded error.

func IsNotSingular

func IsNotSingular(err error) bool

IsNotSingular returns a boolean indicating whether the error is a not singular error.

func IsValidationError

func IsValidationError(err error) bool

IsValidationError returns a boolean indicating whether the error is a validaton 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 APIAudit

type APIAudit struct {

	// ID of the ent.
	ID string `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"`
	// DeletedAt holds the value of the "deleted_at" field.
	DeletedAt *time.Time `json:"deleted_at,omitempty"`
	// Plane holds the value of the "plane" field.
	Plane string `json:"plane,omitempty"`
	// HashedGrantToken holds the value of the "hashed_grant_token" field.
	HashedGrantToken string `json:"-"`
	// Domain holds the value of the "domain" field.
	Domain string `json:"domain,omitempty"`
	// HTTPPath holds the value of the "http_path" field.
	HTTPPath string `json:"http_path,omitempty"`
	// HTTPMethod holds the value of the "http_method" field.
	HTTPMethod string `json:"http_method,omitempty"`
	// SentHTTPStatus holds the value of the "sent_http_status" field.
	SentHTTPStatus int `json:"sent_http_status,omitempty"`
	// contains filtered or unexported fields
}

APIAudit is the model entity for the APIAudit schema.

func (*APIAudit) String

func (aa *APIAudit) String() string

String implements the fmt.Stringer.

func (*APIAudit) Unwrap

func (aa *APIAudit) Unwrap() *APIAudit

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

func (aa *APIAudit) Update() *APIAuditUpdateOne

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

type APIAuditClient

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

APIAuditClient is a client for the APIAudit schema.

func NewAPIAuditClient

func NewAPIAuditClient(c config) *APIAuditClient

NewAPIAuditClient returns a client for the APIAudit from the given config.

func (*APIAuditClient) Create

func (c *APIAuditClient) Create() *APIAuditCreate

Create returns a create builder for APIAudit.

func (*APIAuditClient) CreateBulk

func (c *APIAuditClient) CreateBulk(builders ...*APIAuditCreate) *APIAuditCreateBulk

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

func (*APIAuditClient) Delete

func (c *APIAuditClient) Delete() *APIAuditDelete

Delete returns a delete builder for APIAudit.

func (*APIAuditClient) DeleteOne

func (c *APIAuditClient) DeleteOne(aa *APIAudit) *APIAuditDeleteOne

DeleteOne returns a delete builder for the given entity.

func (*APIAuditClient) DeleteOneID

func (c *APIAuditClient) DeleteOneID(id string) *APIAuditDeleteOne

DeleteOneID returns a delete builder for the given id.

func (*APIAuditClient) Get

func (c *APIAuditClient) Get(ctx context.Context, id string) (*APIAudit, error)

Get returns a APIAudit entity by its id.

func (*APIAuditClient) GetX

func (c *APIAuditClient) GetX(ctx context.Context, id string) *APIAudit

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

func (*APIAuditClient) Hooks

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

Hooks returns the client hooks.

func (*APIAuditClient) Query

func (c *APIAuditClient) Query() *APIAuditQuery

Query returns a query builder for APIAudit.

func (*APIAuditClient) Update

func (c *APIAuditClient) Update() *APIAuditUpdate

Update returns an update builder for APIAudit.

func (*APIAuditClient) UpdateOne

func (c *APIAuditClient) UpdateOne(aa *APIAudit) *APIAuditUpdateOne

UpdateOne returns an update builder for the given entity.

func (*APIAuditClient) UpdateOneID

func (c *APIAuditClient) UpdateOneID(id string) *APIAuditUpdateOne

UpdateOneID returns an update builder for the given id.

func (*APIAuditClient) Use

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

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

type APIAuditCreate

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

APIAuditCreate is the builder for creating a APIAudit entity.

func (*APIAuditCreate) Mutation

func (aac *APIAuditCreate) Mutation() *APIAuditMutation

Mutation returns the APIAuditMutation object of the builder.

func (*APIAuditCreate) Save

func (aac *APIAuditCreate) Save(ctx context.Context) (*APIAudit, error)

Save creates the APIAudit in the database.

func (*APIAuditCreate) SaveX

func (aac *APIAuditCreate) SaveX(ctx context.Context) *APIAudit

SaveX calls Save and panics if Save returns an error.

func (*APIAuditCreate) SetCreatedAt

func (aac *APIAuditCreate) SetCreatedAt(t time.Time) *APIAuditCreate

SetCreatedAt sets the "created_at" field.

func (*APIAuditCreate) SetDeletedAt

func (aac *APIAuditCreate) SetDeletedAt(t time.Time) *APIAuditCreate

SetDeletedAt sets the "deleted_at" field.

func (*APIAuditCreate) SetDomain

func (aac *APIAuditCreate) SetDomain(s string) *APIAuditCreate

SetDomain sets the "domain" field.

func (*APIAuditCreate) SetHTTPMethod

func (aac *APIAuditCreate) SetHTTPMethod(s string) *APIAuditCreate

SetHTTPMethod sets the "http_method" field.

func (*APIAuditCreate) SetHTTPPath

func (aac *APIAuditCreate) SetHTTPPath(s string) *APIAuditCreate

SetHTTPPath sets the "http_path" field.

func (*APIAuditCreate) SetHashedGrantToken

func (aac *APIAuditCreate) SetHashedGrantToken(s string) *APIAuditCreate

SetHashedGrantToken sets the "hashed_grant_token" field.

func (*APIAuditCreate) SetID

func (aac *APIAuditCreate) SetID(s string) *APIAuditCreate

SetID sets the "id" field.

func (*APIAuditCreate) SetNillableCreatedAt

func (aac *APIAuditCreate) SetNillableCreatedAt(t *time.Time) *APIAuditCreate

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

func (*APIAuditCreate) SetNillableDeletedAt

func (aac *APIAuditCreate) SetNillableDeletedAt(t *time.Time) *APIAuditCreate

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*APIAuditCreate) SetNillableDomain

func (aac *APIAuditCreate) SetNillableDomain(s *string) *APIAuditCreate

SetNillableDomain sets the "domain" field if the given value is not nil.

func (*APIAuditCreate) SetNillableHTTPMethod

func (aac *APIAuditCreate) SetNillableHTTPMethod(s *string) *APIAuditCreate

SetNillableHTTPMethod sets the "http_method" field if the given value is not nil.

func (*APIAuditCreate) SetNillableHTTPPath

func (aac *APIAuditCreate) SetNillableHTTPPath(s *string) *APIAuditCreate

SetNillableHTTPPath sets the "http_path" field if the given value is not nil.

func (*APIAuditCreate) SetNillableHashedGrantToken

func (aac *APIAuditCreate) SetNillableHashedGrantToken(s *string) *APIAuditCreate

SetNillableHashedGrantToken sets the "hashed_grant_token" field if the given value is not nil.

func (*APIAuditCreate) SetNillableID

func (aac *APIAuditCreate) SetNillableID(s *string) *APIAuditCreate

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

func (*APIAuditCreate) SetNillableSentHTTPStatus

func (aac *APIAuditCreate) SetNillableSentHTTPStatus(i *int) *APIAuditCreate

SetNillableSentHTTPStatus sets the "sent_http_status" field if the given value is not nil.

func (*APIAuditCreate) SetNillableUpdatedAt

func (aac *APIAuditCreate) SetNillableUpdatedAt(t *time.Time) *APIAuditCreate

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

func (*APIAuditCreate) SetPlane

func (aac *APIAuditCreate) SetPlane(s string) *APIAuditCreate

SetPlane sets the "plane" field.

func (*APIAuditCreate) SetSentHTTPStatus

func (aac *APIAuditCreate) SetSentHTTPStatus(i int) *APIAuditCreate

SetSentHTTPStatus sets the "sent_http_status" field.

func (*APIAuditCreate) SetUpdatedAt

func (aac *APIAuditCreate) SetUpdatedAt(t time.Time) *APIAuditCreate

SetUpdatedAt sets the "updated_at" field.

type APIAuditCreateBulk

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

APIAuditCreateBulk is the builder for creating many APIAudit entities in bulk.

func (*APIAuditCreateBulk) Save

func (aacb *APIAuditCreateBulk) Save(ctx context.Context) ([]*APIAudit, error)

Save creates the APIAudit entities in the database.

func (*APIAuditCreateBulk) SaveX

func (aacb *APIAuditCreateBulk) SaveX(ctx context.Context) []*APIAudit

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

type APIAuditDelete

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

APIAuditDelete is the builder for deleting a APIAudit entity.

func (*APIAuditDelete) Exec

func (aad *APIAuditDelete) Exec(ctx context.Context) (int, error)

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

func (*APIAuditDelete) ExecX

func (aad *APIAuditDelete) ExecX(ctx context.Context) int

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

func (*APIAuditDelete) Where

func (aad *APIAuditDelete) Where(ps ...predicate.APIAudit) *APIAuditDelete

Where adds a new predicate to the APIAuditDelete builder.

type APIAuditDeleteOne

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

APIAuditDeleteOne is the builder for deleting a single APIAudit entity.

func (*APIAuditDeleteOne) Exec

func (aado *APIAuditDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*APIAuditDeleteOne) ExecX

func (aado *APIAuditDeleteOne) ExecX(ctx context.Context)

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

type APIAuditFilter

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

APIAuditFilter provides a generic filtering capability at runtime for APIAuditQuery.

func (*APIAuditFilter) Where

func (f *APIAuditFilter) Where(p entql.P)

Where applies the entql predicate on the query filter.

func (*APIAuditFilter) WhereCreatedAt

func (f *APIAuditFilter) WhereCreatedAt(p entql.TimeP)

WhereCreatedAt applies the entql time.Time predicate on the created_at field.

func (*APIAuditFilter) WhereDeletedAt

func (f *APIAuditFilter) WhereDeletedAt(p entql.TimeP)

WhereDeletedAt applies the entql time.Time predicate on the deleted_at field.

func (*APIAuditFilter) WhereDomain

func (f *APIAuditFilter) WhereDomain(p entql.StringP)

WhereDomain applies the entql string predicate on the domain field.

func (*APIAuditFilter) WhereHTTPMethod

func (f *APIAuditFilter) WhereHTTPMethod(p entql.StringP)

WhereHTTPMethod applies the entql string predicate on the http_method field.

func (*APIAuditFilter) WhereHTTPPath

func (f *APIAuditFilter) WhereHTTPPath(p entql.StringP)

WhereHTTPPath applies the entql string predicate on the http_path field.

func (*APIAuditFilter) WhereHashedGrantToken

func (f *APIAuditFilter) WhereHashedGrantToken(p entql.StringP)

WhereHashedGrantToken applies the entql string predicate on the hashed_grant_token field.

func (*APIAuditFilter) WhereID

func (f *APIAuditFilter) WhereID(p entql.StringP)

WhereID applies the entql string predicate on the id field.

func (*APIAuditFilter) WherePlane

func (f *APIAuditFilter) WherePlane(p entql.StringP)

WherePlane applies the entql string predicate on the plane field.

func (*APIAuditFilter) WhereSentHTTPStatus

func (f *APIAuditFilter) WhereSentHTTPStatus(p entql.IntP)

WhereSentHTTPStatus applies the entql int predicate on the sent_http_status field.

func (*APIAuditFilter) WhereUpdatedAt

func (f *APIAuditFilter) WhereUpdatedAt(p entql.TimeP)

WhereUpdatedAt applies the entql time.Time predicate on the updated_at field.

type APIAuditGroupBy

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

APIAuditGroupBy is the group-by builder for APIAudit entities.

func (*APIAuditGroupBy) Aggregate

func (aagb *APIAuditGroupBy) Aggregate(fns ...AggregateFunc) *APIAuditGroupBy

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

func (*APIAuditGroupBy) Bool

func (aagb *APIAuditGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a group-by query. It is only allowed when executing a group-by query with one field.

func (*APIAuditGroupBy) BoolX

func (aagb *APIAuditGroupBy) BoolX(ctx context.Context) bool

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

func (*APIAuditGroupBy) Bools

func (aagb *APIAuditGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from group-by. It is only allowed when executing a group-by query with one field.

func (*APIAuditGroupBy) BoolsX

func (aagb *APIAuditGroupBy) BoolsX(ctx context.Context) []bool

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

func (*APIAuditGroupBy) Float64

func (aagb *APIAuditGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a group-by query. It is only allowed when executing a group-by query with one field.

func (*APIAuditGroupBy) Float64X

func (aagb *APIAuditGroupBy) Float64X(ctx context.Context) float64

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

func (*APIAuditGroupBy) Float64s

func (aagb *APIAuditGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from group-by. It is only allowed when executing a group-by query with one field.

func (*APIAuditGroupBy) Float64sX

func (aagb *APIAuditGroupBy) Float64sX(ctx context.Context) []float64

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

func (*APIAuditGroupBy) Int

func (aagb *APIAuditGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a group-by query. It is only allowed when executing a group-by query with one field.

func (*APIAuditGroupBy) IntX

func (aagb *APIAuditGroupBy) IntX(ctx context.Context) int

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

func (*APIAuditGroupBy) Ints

func (aagb *APIAuditGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from group-by. It is only allowed when executing a group-by query with one field.

func (*APIAuditGroupBy) IntsX

func (aagb *APIAuditGroupBy) IntsX(ctx context.Context) []int

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

func (*APIAuditGroupBy) Scan

func (aagb *APIAuditGroupBy) Scan(ctx context.Context, v interface{}) error

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

func (*APIAuditGroupBy) ScanX

func (aagb *APIAuditGroupBy) ScanX(ctx context.Context, v interface{})

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

func (*APIAuditGroupBy) String

func (aagb *APIAuditGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a group-by query. It is only allowed when executing a group-by query with one field.

func (*APIAuditGroupBy) StringX

func (aagb *APIAuditGroupBy) StringX(ctx context.Context) string

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

func (*APIAuditGroupBy) Strings

func (aagb *APIAuditGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from group-by. It is only allowed when executing a group-by query with one field.

func (*APIAuditGroupBy) StringsX

func (aagb *APIAuditGroupBy) StringsX(ctx context.Context) []string

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

type APIAuditMutation

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

APIAuditMutation represents an operation that mutates the APIAudit nodes in the graph.

func (*APIAuditMutation) AddField

func (m *APIAuditMutation) 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 (*APIAuditMutation) AddSentHTTPStatus

func (m *APIAuditMutation) AddSentHTTPStatus(i int)

AddSentHTTPStatus adds i to the "sent_http_status" field.

func (*APIAuditMutation) AddedEdges

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

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

func (*APIAuditMutation) AddedField

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

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

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

func (*APIAuditMutation) AddedIDs

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

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

func (*APIAuditMutation) AddedSentHTTPStatus

func (m *APIAuditMutation) AddedSentHTTPStatus() (r int, exists bool)

AddedSentHTTPStatus returns the value that was added to the "sent_http_status" field in this mutation.

func (*APIAuditMutation) ClearDeletedAt

func (m *APIAuditMutation) ClearDeletedAt()

ClearDeletedAt clears the value of the "deleted_at" field.

func (*APIAuditMutation) ClearDomain

func (m *APIAuditMutation) ClearDomain()

ClearDomain clears the value of the "domain" field.

func (*APIAuditMutation) ClearEdge

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

func (m *APIAuditMutation) 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 (*APIAuditMutation) ClearHTTPMethod

func (m *APIAuditMutation) ClearHTTPMethod()

ClearHTTPMethod clears the value of the "http_method" field.

func (*APIAuditMutation) ClearHTTPPath

func (m *APIAuditMutation) ClearHTTPPath()

ClearHTTPPath clears the value of the "http_path" field.

func (*APIAuditMutation) ClearHashedGrantToken

func (m *APIAuditMutation) ClearHashedGrantToken()

ClearHashedGrantToken clears the value of the "hashed_grant_token" field.

func (*APIAuditMutation) ClearSentHTTPStatus

func (m *APIAuditMutation) ClearSentHTTPStatus()

ClearSentHTTPStatus clears the value of the "sent_http_status" field.

func (*APIAuditMutation) ClearedEdges

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

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

func (*APIAuditMutation) ClearedFields

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

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

func (APIAuditMutation) Client

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

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

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

func (*APIAuditMutation) DeletedAt

func (m *APIAuditMutation) DeletedAt() (r time.Time, exists bool)

DeletedAt returns the value of the "deleted_at" field in the mutation.

func (*APIAuditMutation) DeletedAtCleared

func (m *APIAuditMutation) DeletedAtCleared() bool

DeletedAtCleared returns if the "deleted_at" field was cleared in this mutation.

func (*APIAuditMutation) Domain

func (m *APIAuditMutation) Domain() (r string, exists bool)

Domain returns the value of the "domain" field in the mutation.

func (*APIAuditMutation) DomainCleared

func (m *APIAuditMutation) DomainCleared() bool

DomainCleared returns if the "domain" field was cleared in this mutation.

func (*APIAuditMutation) EdgeCleared

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

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

func (*APIAuditMutation) Field

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

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

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

func (*APIAuditMutation) Fields

func (m *APIAuditMutation) 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 (*APIAuditMutation) Filter

func (m *APIAuditMutation) Filter() *APIAuditFilter

Filter returns an entql.Where implementation to apply filters on the APIAuditMutation builder.

func (*APIAuditMutation) HTTPMethod

func (m *APIAuditMutation) HTTPMethod() (r string, exists bool)

HTTPMethod returns the value of the "http_method" field in the mutation.

func (*APIAuditMutation) HTTPMethodCleared

func (m *APIAuditMutation) HTTPMethodCleared() bool

HTTPMethodCleared returns if the "http_method" field was cleared in this mutation.

func (*APIAuditMutation) HTTPPath

func (m *APIAuditMutation) HTTPPath() (r string, exists bool)

HTTPPath returns the value of the "http_path" field in the mutation.

func (*APIAuditMutation) HTTPPathCleared

func (m *APIAuditMutation) HTTPPathCleared() bool

HTTPPathCleared returns if the "http_path" field was cleared in this mutation.

func (*APIAuditMutation) HashedGrantToken

func (m *APIAuditMutation) HashedGrantToken() (r string, exists bool)

HashedGrantToken returns the value of the "hashed_grant_token" field in the mutation.

func (*APIAuditMutation) HashedGrantTokenCleared

func (m *APIAuditMutation) HashedGrantTokenCleared() bool

HashedGrantTokenCleared returns if the "hashed_grant_token" field was cleared in this mutation.

func (*APIAuditMutation) ID

func (m *APIAuditMutation) ID() (id string, exists bool)

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder.

func (*APIAuditMutation) OldCreatedAt

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

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

func (m *APIAuditMutation) OldDeletedAt(ctx context.Context) (v *time.Time, err error)

OldDeletedAt returns the old "deleted_at" field's value of the APIAudit entity. If the APIAudit 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 (*APIAuditMutation) OldDomain

func (m *APIAuditMutation) OldDomain(ctx context.Context) (v string, err error)

OldDomain returns the old "domain" field's value of the APIAudit entity. If the APIAudit 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 (*APIAuditMutation) OldField

func (m *APIAuditMutation) 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 (*APIAuditMutation) OldHTTPMethod

func (m *APIAuditMutation) OldHTTPMethod(ctx context.Context) (v string, err error)

OldHTTPMethod returns the old "http_method" field's value of the APIAudit entity. If the APIAudit 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 (*APIAuditMutation) OldHTTPPath

func (m *APIAuditMutation) OldHTTPPath(ctx context.Context) (v string, err error)

OldHTTPPath returns the old "http_path" field's value of the APIAudit entity. If the APIAudit 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 (*APIAuditMutation) OldHashedGrantToken

func (m *APIAuditMutation) OldHashedGrantToken(ctx context.Context) (v string, err error)

OldHashedGrantToken returns the old "hashed_grant_token" field's value of the APIAudit entity. If the APIAudit 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 (*APIAuditMutation) OldPlane

func (m *APIAuditMutation) OldPlane(ctx context.Context) (v string, err error)

OldPlane returns the old "plane" field's value of the APIAudit entity. If the APIAudit 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 (*APIAuditMutation) OldSentHTTPStatus

func (m *APIAuditMutation) OldSentHTTPStatus(ctx context.Context) (v int, err error)

OldSentHTTPStatus returns the old "sent_http_status" field's value of the APIAudit entity. If the APIAudit 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 (*APIAuditMutation) OldUpdatedAt

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

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

func (m *APIAuditMutation) Op() Op

Op returns the operation name.

func (*APIAuditMutation) Plane

func (m *APIAuditMutation) Plane() (r string, exists bool)

Plane returns the value of the "plane" field in the mutation.

func (*APIAuditMutation) RemovedEdges

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

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

func (*APIAuditMutation) RemovedIDs

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

func (m *APIAuditMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*APIAuditMutation) ResetDeletedAt

func (m *APIAuditMutation) ResetDeletedAt()

ResetDeletedAt resets all changes to the "deleted_at" field.

func (*APIAuditMutation) ResetDomain

func (m *APIAuditMutation) ResetDomain()

ResetDomain resets all changes to the "domain" field.

func (*APIAuditMutation) ResetEdge

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

func (m *APIAuditMutation) 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 (*APIAuditMutation) ResetHTTPMethod

func (m *APIAuditMutation) ResetHTTPMethod()

ResetHTTPMethod resets all changes to the "http_method" field.

func (*APIAuditMutation) ResetHTTPPath

func (m *APIAuditMutation) ResetHTTPPath()

ResetHTTPPath resets all changes to the "http_path" field.

func (*APIAuditMutation) ResetHashedGrantToken

func (m *APIAuditMutation) ResetHashedGrantToken()

ResetHashedGrantToken resets all changes to the "hashed_grant_token" field.

func (*APIAuditMutation) ResetPlane

func (m *APIAuditMutation) ResetPlane()

ResetPlane resets all changes to the "plane" field.

func (*APIAuditMutation) ResetSentHTTPStatus

func (m *APIAuditMutation) ResetSentHTTPStatus()

ResetSentHTTPStatus resets all changes to the "sent_http_status" field.

func (*APIAuditMutation) ResetUpdatedAt

func (m *APIAuditMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*APIAuditMutation) SentHTTPStatus

func (m *APIAuditMutation) SentHTTPStatus() (r int, exists bool)

SentHTTPStatus returns the value of the "sent_http_status" field in the mutation.

func (*APIAuditMutation) SentHTTPStatusCleared

func (m *APIAuditMutation) SentHTTPStatusCleared() bool

SentHTTPStatusCleared returns if the "sent_http_status" field was cleared in this mutation.

func (*APIAuditMutation) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*APIAuditMutation) SetDeletedAt

func (m *APIAuditMutation) SetDeletedAt(t time.Time)

SetDeletedAt sets the "deleted_at" field.

func (*APIAuditMutation) SetDomain

func (m *APIAuditMutation) SetDomain(s string)

SetDomain sets the "domain" field.

func (*APIAuditMutation) SetField

func (m *APIAuditMutation) 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 (*APIAuditMutation) SetHTTPMethod

func (m *APIAuditMutation) SetHTTPMethod(s string)

SetHTTPMethod sets the "http_method" field.

func (*APIAuditMutation) SetHTTPPath

func (m *APIAuditMutation) SetHTTPPath(s string)

SetHTTPPath sets the "http_path" field.

func (*APIAuditMutation) SetHashedGrantToken

func (m *APIAuditMutation) SetHashedGrantToken(s string)

SetHashedGrantToken sets the "hashed_grant_token" field.

func (*APIAuditMutation) SetID

func (m *APIAuditMutation) SetID(id string)

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

func (*APIAuditMutation) SetPlane

func (m *APIAuditMutation) SetPlane(s string)

SetPlane sets the "plane" field.

func (*APIAuditMutation) SetSentHTTPStatus

func (m *APIAuditMutation) SetSentHTTPStatus(i int)

SetSentHTTPStatus sets the "sent_http_status" field.

func (*APIAuditMutation) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" field.

func (APIAuditMutation) Tx

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

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

func (*APIAuditMutation) Type

func (m *APIAuditMutation) Type() string

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

func (*APIAuditMutation) UpdatedAt

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

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

type APIAuditQuery

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

APIAuditQuery is the builder for querying APIAudit entities.

func (*APIAuditQuery) All

func (aaq *APIAuditQuery) All(ctx context.Context) ([]*APIAudit, error)

All executes the query and returns a list of APIAudits.

func (*APIAuditQuery) AllX

func (aaq *APIAuditQuery) AllX(ctx context.Context) []*APIAudit

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

func (*APIAuditQuery) Clone

func (aaq *APIAuditQuery) Clone() *APIAuditQuery

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

func (*APIAuditQuery) Count

func (aaq *APIAuditQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*APIAuditQuery) CountX

func (aaq *APIAuditQuery) CountX(ctx context.Context) int

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

func (*APIAuditQuery) Exist

func (aaq *APIAuditQuery) Exist(ctx context.Context) (bool, error)

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

func (*APIAuditQuery) ExistX

func (aaq *APIAuditQuery) ExistX(ctx context.Context) bool

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

func (*APIAuditQuery) Filter

func (aaq *APIAuditQuery) Filter() *APIAuditFilter

Filter returns a Filter implementation to apply filters on the APIAuditQuery builder.

func (*APIAuditQuery) First

func (aaq *APIAuditQuery) First(ctx context.Context) (*APIAudit, error)

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

func (*APIAuditQuery) FirstID

func (aaq *APIAuditQuery) FirstID(ctx context.Context) (id string, err error)

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

func (*APIAuditQuery) FirstIDX

func (aaq *APIAuditQuery) FirstIDX(ctx context.Context) string

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

func (*APIAuditQuery) FirstX

func (aaq *APIAuditQuery) FirstX(ctx context.Context) *APIAudit

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

func (*APIAuditQuery) GroupBy

func (aaq *APIAuditQuery) GroupBy(field string, fields ...string) *APIAuditGroupBy

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

func (*APIAuditQuery) IDs

func (aaq *APIAuditQuery) IDs(ctx context.Context) ([]string, error)

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

func (*APIAuditQuery) IDsX

func (aaq *APIAuditQuery) IDsX(ctx context.Context) []string

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

func (*APIAuditQuery) Limit

func (aaq *APIAuditQuery) Limit(limit int) *APIAuditQuery

Limit adds a limit step to the query.

func (*APIAuditQuery) Offset

func (aaq *APIAuditQuery) Offset(offset int) *APIAuditQuery

Offset adds an offset step to the query.

func (*APIAuditQuery) Only

func (aaq *APIAuditQuery) Only(ctx context.Context) (*APIAudit, error)

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

func (*APIAuditQuery) OnlyID

func (aaq *APIAuditQuery) OnlyID(ctx context.Context) (id string, err error)

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

func (*APIAuditQuery) OnlyIDX

func (aaq *APIAuditQuery) OnlyIDX(ctx context.Context) string

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

func (*APIAuditQuery) OnlyX

func (aaq *APIAuditQuery) OnlyX(ctx context.Context) *APIAudit

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

func (*APIAuditQuery) Order

func (aaq *APIAuditQuery) Order(o ...OrderFunc) *APIAuditQuery

Order adds an order step to the query.

func (*APIAuditQuery) Select

func (aaq *APIAuditQuery) Select(field string, fields ...string) *APIAuditSelect

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

func (*APIAuditQuery) Where

func (aaq *APIAuditQuery) Where(ps ...predicate.APIAudit) *APIAuditQuery

Where adds a new predicate for the APIAuditQuery builder.

type APIAuditSelect

type APIAuditSelect struct {
	*APIAuditQuery
	// contains filtered or unexported fields
}

APIAuditSelect is the builder for selecting fields of APIAudit entities.

func (*APIAuditSelect) Bool

func (aas *APIAuditSelect) Bool(ctx context.Context) (_ bool, err error)

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

func (*APIAuditSelect) BoolX

func (aas *APIAuditSelect) BoolX(ctx context.Context) bool

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

func (*APIAuditSelect) Bools

func (aas *APIAuditSelect) Bools(ctx context.Context) ([]bool, error)

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

func (*APIAuditSelect) BoolsX

func (aas *APIAuditSelect) BoolsX(ctx context.Context) []bool

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

func (*APIAuditSelect) Float64

func (aas *APIAuditSelect) Float64(ctx context.Context) (_ float64, err error)

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

func (*APIAuditSelect) Float64X

func (aas *APIAuditSelect) Float64X(ctx context.Context) float64

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

func (*APIAuditSelect) Float64s

func (aas *APIAuditSelect) Float64s(ctx context.Context) ([]float64, error)

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

func (*APIAuditSelect) Float64sX

func (aas *APIAuditSelect) Float64sX(ctx context.Context) []float64

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

func (*APIAuditSelect) Int

func (aas *APIAuditSelect) Int(ctx context.Context) (_ int, err error)

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

func (*APIAuditSelect) IntX

func (aas *APIAuditSelect) IntX(ctx context.Context) int

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

func (*APIAuditSelect) Ints

func (aas *APIAuditSelect) Ints(ctx context.Context) ([]int, error)

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

func (*APIAuditSelect) IntsX

func (aas *APIAuditSelect) IntsX(ctx context.Context) []int

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

func (*APIAuditSelect) Scan

func (aas *APIAuditSelect) Scan(ctx context.Context, v interface{}) error

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

func (*APIAuditSelect) ScanX

func (aas *APIAuditSelect) ScanX(ctx context.Context, v interface{})

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

func (*APIAuditSelect) String

func (aas *APIAuditSelect) String(ctx context.Context) (_ string, err error)

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

func (*APIAuditSelect) StringX

func (aas *APIAuditSelect) StringX(ctx context.Context) string

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

func (*APIAuditSelect) Strings

func (aas *APIAuditSelect) Strings(ctx context.Context) ([]string, error)

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

func (*APIAuditSelect) StringsX

func (aas *APIAuditSelect) StringsX(ctx context.Context) []string

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

type APIAuditUpdate

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

APIAuditUpdate is the builder for updating APIAudit entities.

func (*APIAuditUpdate) AddSentHTTPStatus

func (aau *APIAuditUpdate) AddSentHTTPStatus(i int) *APIAuditUpdate

AddSentHTTPStatus adds i to the "sent_http_status" field.

func (*APIAuditUpdate) ClearDeletedAt

func (aau *APIAuditUpdate) ClearDeletedAt() *APIAuditUpdate

ClearDeletedAt clears the value of the "deleted_at" field.

func (*APIAuditUpdate) ClearDomain

func (aau *APIAuditUpdate) ClearDomain() *APIAuditUpdate

ClearDomain clears the value of the "domain" field.

func (*APIAuditUpdate) ClearHTTPMethod

func (aau *APIAuditUpdate) ClearHTTPMethod() *APIAuditUpdate

ClearHTTPMethod clears the value of the "http_method" field.

func (*APIAuditUpdate) ClearHTTPPath

func (aau *APIAuditUpdate) ClearHTTPPath() *APIAuditUpdate

ClearHTTPPath clears the value of the "http_path" field.

func (*APIAuditUpdate) ClearHashedGrantToken

func (aau *APIAuditUpdate) ClearHashedGrantToken() *APIAuditUpdate

ClearHashedGrantToken clears the value of the "hashed_grant_token" field.

func (*APIAuditUpdate) ClearSentHTTPStatus

func (aau *APIAuditUpdate) ClearSentHTTPStatus() *APIAuditUpdate

ClearSentHTTPStatus clears the value of the "sent_http_status" field.

func (*APIAuditUpdate) Exec

func (aau *APIAuditUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*APIAuditUpdate) ExecX

func (aau *APIAuditUpdate) ExecX(ctx context.Context)

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

func (*APIAuditUpdate) Mutation

func (aau *APIAuditUpdate) Mutation() *APIAuditMutation

Mutation returns the APIAuditMutation object of the builder.

func (*APIAuditUpdate) Save

func (aau *APIAuditUpdate) Save(ctx context.Context) (int, error)

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

func (*APIAuditUpdate) SaveX

func (aau *APIAuditUpdate) SaveX(ctx context.Context) int

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

func (*APIAuditUpdate) SetDeletedAt

func (aau *APIAuditUpdate) SetDeletedAt(t time.Time) *APIAuditUpdate

SetDeletedAt sets the "deleted_at" field.

func (*APIAuditUpdate) SetDomain

func (aau *APIAuditUpdate) SetDomain(s string) *APIAuditUpdate

SetDomain sets the "domain" field.

func (*APIAuditUpdate) SetHTTPMethod

func (aau *APIAuditUpdate) SetHTTPMethod(s string) *APIAuditUpdate

SetHTTPMethod sets the "http_method" field.

func (*APIAuditUpdate) SetHTTPPath

func (aau *APIAuditUpdate) SetHTTPPath(s string) *APIAuditUpdate

SetHTTPPath sets the "http_path" field.

func (*APIAuditUpdate) SetHashedGrantToken

func (aau *APIAuditUpdate) SetHashedGrantToken(s string) *APIAuditUpdate

SetHashedGrantToken sets the "hashed_grant_token" field.

func (*APIAuditUpdate) SetNillableDeletedAt

func (aau *APIAuditUpdate) SetNillableDeletedAt(t *time.Time) *APIAuditUpdate

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*APIAuditUpdate) SetNillableDomain

func (aau *APIAuditUpdate) SetNillableDomain(s *string) *APIAuditUpdate

SetNillableDomain sets the "domain" field if the given value is not nil.

func (*APIAuditUpdate) SetNillableHTTPMethod

func (aau *APIAuditUpdate) SetNillableHTTPMethod(s *string) *APIAuditUpdate

SetNillableHTTPMethod sets the "http_method" field if the given value is not nil.

func (*APIAuditUpdate) SetNillableHTTPPath

func (aau *APIAuditUpdate) SetNillableHTTPPath(s *string) *APIAuditUpdate

SetNillableHTTPPath sets the "http_path" field if the given value is not nil.

func (*APIAuditUpdate) SetNillableHashedGrantToken

func (aau *APIAuditUpdate) SetNillableHashedGrantToken(s *string) *APIAuditUpdate

SetNillableHashedGrantToken sets the "hashed_grant_token" field if the given value is not nil.

func (*APIAuditUpdate) SetNillableSentHTTPStatus

func (aau *APIAuditUpdate) SetNillableSentHTTPStatus(i *int) *APIAuditUpdate

SetNillableSentHTTPStatus sets the "sent_http_status" field if the given value is not nil.

func (*APIAuditUpdate) SetPlane

func (aau *APIAuditUpdate) SetPlane(s string) *APIAuditUpdate

SetPlane sets the "plane" field.

func (*APIAuditUpdate) SetSentHTTPStatus

func (aau *APIAuditUpdate) SetSentHTTPStatus(i int) *APIAuditUpdate

SetSentHTTPStatus sets the "sent_http_status" field.

func (*APIAuditUpdate) Where

func (aau *APIAuditUpdate) Where(ps ...predicate.APIAudit) *APIAuditUpdate

Where adds a new predicate for the APIAuditUpdate builder.

type APIAuditUpdateOne

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

APIAuditUpdateOne is the builder for updating a single APIAudit entity.

func (*APIAuditUpdateOne) AddSentHTTPStatus

func (aauo *APIAuditUpdateOne) AddSentHTTPStatus(i int) *APIAuditUpdateOne

AddSentHTTPStatus adds i to the "sent_http_status" field.

func (*APIAuditUpdateOne) ClearDeletedAt

func (aauo *APIAuditUpdateOne) ClearDeletedAt() *APIAuditUpdateOne

ClearDeletedAt clears the value of the "deleted_at" field.

func (*APIAuditUpdateOne) ClearDomain

func (aauo *APIAuditUpdateOne) ClearDomain() *APIAuditUpdateOne

ClearDomain clears the value of the "domain" field.

func (*APIAuditUpdateOne) ClearHTTPMethod

func (aauo *APIAuditUpdateOne) ClearHTTPMethod() *APIAuditUpdateOne

ClearHTTPMethod clears the value of the "http_method" field.

func (*APIAuditUpdateOne) ClearHTTPPath

func (aauo *APIAuditUpdateOne) ClearHTTPPath() *APIAuditUpdateOne

ClearHTTPPath clears the value of the "http_path" field.

func (*APIAuditUpdateOne) ClearHashedGrantToken

func (aauo *APIAuditUpdateOne) ClearHashedGrantToken() *APIAuditUpdateOne

ClearHashedGrantToken clears the value of the "hashed_grant_token" field.

func (*APIAuditUpdateOne) ClearSentHTTPStatus

func (aauo *APIAuditUpdateOne) ClearSentHTTPStatus() *APIAuditUpdateOne

ClearSentHTTPStatus clears the value of the "sent_http_status" field.

func (*APIAuditUpdateOne) Exec

func (aauo *APIAuditUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*APIAuditUpdateOne) ExecX

func (aauo *APIAuditUpdateOne) ExecX(ctx context.Context)

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

func (*APIAuditUpdateOne) Mutation

func (aauo *APIAuditUpdateOne) Mutation() *APIAuditMutation

Mutation returns the APIAuditMutation object of the builder.

func (*APIAuditUpdateOne) Save

func (aauo *APIAuditUpdateOne) Save(ctx context.Context) (*APIAudit, error)

Save executes the query and returns the updated APIAudit entity.

func (*APIAuditUpdateOne) SaveX

func (aauo *APIAuditUpdateOne) SaveX(ctx context.Context) *APIAudit

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

func (*APIAuditUpdateOne) SetDeletedAt

func (aauo *APIAuditUpdateOne) SetDeletedAt(t time.Time) *APIAuditUpdateOne

SetDeletedAt sets the "deleted_at" field.

func (*APIAuditUpdateOne) SetDomain

func (aauo *APIAuditUpdateOne) SetDomain(s string) *APIAuditUpdateOne

SetDomain sets the "domain" field.

func (*APIAuditUpdateOne) SetHTTPMethod

func (aauo *APIAuditUpdateOne) SetHTTPMethod(s string) *APIAuditUpdateOne

SetHTTPMethod sets the "http_method" field.

func (*APIAuditUpdateOne) SetHTTPPath

func (aauo *APIAuditUpdateOne) SetHTTPPath(s string) *APIAuditUpdateOne

SetHTTPPath sets the "http_path" field.

func (*APIAuditUpdateOne) SetHashedGrantToken

func (aauo *APIAuditUpdateOne) SetHashedGrantToken(s string) *APIAuditUpdateOne

SetHashedGrantToken sets the "hashed_grant_token" field.

func (*APIAuditUpdateOne) SetNillableDeletedAt

func (aauo *APIAuditUpdateOne) SetNillableDeletedAt(t *time.Time) *APIAuditUpdateOne

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*APIAuditUpdateOne) SetNillableDomain

func (aauo *APIAuditUpdateOne) SetNillableDomain(s *string) *APIAuditUpdateOne

SetNillableDomain sets the "domain" field if the given value is not nil.

func (*APIAuditUpdateOne) SetNillableHTTPMethod

func (aauo *APIAuditUpdateOne) SetNillableHTTPMethod(s *string) *APIAuditUpdateOne

SetNillableHTTPMethod sets the "http_method" field if the given value is not nil.

func (*APIAuditUpdateOne) SetNillableHTTPPath

func (aauo *APIAuditUpdateOne) SetNillableHTTPPath(s *string) *APIAuditUpdateOne

SetNillableHTTPPath sets the "http_path" field if the given value is not nil.

func (*APIAuditUpdateOne) SetNillableHashedGrantToken

func (aauo *APIAuditUpdateOne) SetNillableHashedGrantToken(s *string) *APIAuditUpdateOne

SetNillableHashedGrantToken sets the "hashed_grant_token" field if the given value is not nil.

func (*APIAuditUpdateOne) SetNillableSentHTTPStatus

func (aauo *APIAuditUpdateOne) SetNillableSentHTTPStatus(i *int) *APIAuditUpdateOne

SetNillableSentHTTPStatus sets the "sent_http_status" field if the given value is not nil.

func (*APIAuditUpdateOne) SetPlane

func (aauo *APIAuditUpdateOne) SetPlane(s string) *APIAuditUpdateOne

SetPlane sets the "plane" field.

func (*APIAuditUpdateOne) SetSentHTTPStatus

func (aauo *APIAuditUpdateOne) SetSentHTTPStatus(i int) *APIAuditUpdateOne

SetSentHTTPStatus sets the "sent_http_status" field.

type APIAudits

type APIAudits []*APIAudit

APIAudits is a parsable slice of APIAudit.

type AggregateFunc

type AggregateFunc func(*sql.Selector, func(string) bool) string

AggregateFunc applies an aggregation step on the group-by traversal/selector.

func As

As is a pseudo aggregation function for renaming another other functions with custom names. For example:

GroupBy(field1, field2).
Aggregate(ent.As(ent.Sum(field1), "sum_field1"), (ent.As(ent.Sum(field2), "sum_field2")).
Scan(ctx, &v)

func Count

func Count() AggregateFunc

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

func Max

func Max(field string) AggregateFunc

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

func Mean

func Mean(field string) AggregateFunc

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

func Min

func Min(field string) AggregateFunc

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

func Sum

func Sum(field string) AggregateFunc

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

type Client

type Client struct {

	// Schema is the client for creating, migrating and dropping schema.
	Schema *migrate.Schema
	// APIAudit is the client for interacting with the APIAudit builders.
	APIAudit *APIAuditClient
	// Fact is the client for interacting with the Fact builders.
	Fact *FactClient
	// FactType is the client for interacting with the FactType builders.
	FactType *FactTypeClient
	// Grant is the client for interacting with the Grant builders.
	Grant *GrantClient
	// Scope is the client for interacting with the Scope builders.
	Scope *ScopeClient
	// 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().
	APIAudit.
	Query().
	Count(ctx)

func (*Client) Tx

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

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

func (*Client) Use

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

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

type CommitFunc

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

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

func (CommitFunc) Commit

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

Commit calls f(ctx, m).

type CommitHook

type CommitHook func(Committer) Committer

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

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

type Committer

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

Committer is the interface that wraps the Committer method.

type 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 Fact

type Fact struct {

	// ID of the ent.
	ID string `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"`
	// DeletedAt holds the value of the "deleted_at" field.
	DeletedAt *time.Time `json:"deleted_at,omitempty"`
	// HashedValue holds the value of the "hashed_value" field.
	HashedValue string `json:"-"`
	// EncryptedValue holds the value of the "encrypted_value" field.
	EncryptedValue string `json:"-"`
	// 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 FactQuery when eager-loading is set.
	Edges FactEdges `json:"edges"`
	// contains filtered or unexported fields
}

Fact is the model entity for the Fact schema.

func (*Fact) QueryFactType

func (f *Fact) QueryFactType() *FactTypeQuery

QueryFactType queries the "fact_type" edge of the Fact entity.

func (*Fact) QueryScope

func (f *Fact) QueryScope() *ScopeQuery

QueryScope queries the "scope" edge of the Fact entity.

func (*Fact) String

func (f *Fact) String() string

String implements the fmt.Stringer.

func (*Fact) Unwrap

func (f *Fact) Unwrap() *Fact

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

func (f *Fact) Update() *FactUpdateOne

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

type FactClient

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

FactClient is a client for the Fact schema.

func NewFactClient

func NewFactClient(c config) *FactClient

NewFactClient returns a client for the Fact from the given config.

func (*FactClient) Create

func (c *FactClient) Create() *FactCreate

Create returns a create builder for Fact.

func (*FactClient) CreateBulk

func (c *FactClient) CreateBulk(builders ...*FactCreate) *FactCreateBulk

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

func (*FactClient) Delete

func (c *FactClient) Delete() *FactDelete

Delete returns a delete builder for Fact.

func (*FactClient) DeleteOne

func (c *FactClient) DeleteOne(f *Fact) *FactDeleteOne

DeleteOne returns a delete builder for the given entity.

func (*FactClient) DeleteOneID

func (c *FactClient) DeleteOneID(id string) *FactDeleteOne

DeleteOneID returns a delete builder for the given id.

func (*FactClient) Get

func (c *FactClient) Get(ctx context.Context, id string) (*Fact, error)

Get returns a Fact entity by its id.

func (*FactClient) GetX

func (c *FactClient) GetX(ctx context.Context, id string) *Fact

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

func (*FactClient) Hooks

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

Hooks returns the client hooks.

func (*FactClient) Query

func (c *FactClient) Query() *FactQuery

Query returns a query builder for Fact.

func (*FactClient) QueryFactType

func (c *FactClient) QueryFactType(f *Fact) *FactTypeQuery

QueryFactType queries the fact_type edge of a Fact.

func (*FactClient) QueryScope

func (c *FactClient) QueryScope(f *Fact) *ScopeQuery

QueryScope queries the scope edge of a Fact.

func (*FactClient) Update

func (c *FactClient) Update() *FactUpdate

Update returns an update builder for Fact.

func (*FactClient) UpdateOne

func (c *FactClient) UpdateOne(f *Fact) *FactUpdateOne

UpdateOne returns an update builder for the given entity.

func (*FactClient) UpdateOneID

func (c *FactClient) UpdateOneID(id string) *FactUpdateOne

UpdateOneID returns an update builder for the given id.

func (*FactClient) Use

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

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

type FactCreate

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

FactCreate is the builder for creating a Fact entity.

func (*FactCreate) Mutation

func (fc *FactCreate) Mutation() *FactMutation

Mutation returns the FactMutation object of the builder.

func (*FactCreate) Save

func (fc *FactCreate) Save(ctx context.Context) (*Fact, error)

Save creates the Fact in the database.

func (*FactCreate) SaveX

func (fc *FactCreate) SaveX(ctx context.Context) *Fact

SaveX calls Save and panics if Save returns an error.

func (*FactCreate) SetCreatedAt

func (fc *FactCreate) SetCreatedAt(t time.Time) *FactCreate

SetCreatedAt sets the "created_at" field.

func (*FactCreate) SetDeletedAt

func (fc *FactCreate) SetDeletedAt(t time.Time) *FactCreate

SetDeletedAt sets the "deleted_at" field.

func (*FactCreate) SetDomain

func (fc *FactCreate) SetDomain(s string) *FactCreate

SetDomain sets the "domain" field.

func (*FactCreate) SetEncryptedValue

func (fc *FactCreate) SetEncryptedValue(s string) *FactCreate

SetEncryptedValue sets the "encrypted_value" field.

func (*FactCreate) SetFactType

func (fc *FactCreate) SetFactType(f *FactType) *FactCreate

SetFactType sets the "fact_type" edge to the FactType entity.

func (*FactCreate) SetFactTypeID

func (fc *FactCreate) SetFactTypeID(id string) *FactCreate

SetFactTypeID sets the "fact_type" edge to the FactType entity by ID.

func (*FactCreate) SetHashedValue

func (fc *FactCreate) SetHashedValue(s string) *FactCreate

SetHashedValue sets the "hashed_value" field.

func (*FactCreate) SetID

func (fc *FactCreate) SetID(s string) *FactCreate

SetID sets the "id" field.

func (*FactCreate) SetNillableCreatedAt

func (fc *FactCreate) SetNillableCreatedAt(t *time.Time) *FactCreate

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

func (*FactCreate) SetNillableDeletedAt

func (fc *FactCreate) SetNillableDeletedAt(t *time.Time) *FactCreate

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*FactCreate) SetNillableFactTypeID

func (fc *FactCreate) SetNillableFactTypeID(id *string) *FactCreate

SetNillableFactTypeID sets the "fact_type" edge to the FactType entity by ID if the given value is not nil.

func (*FactCreate) SetNillableID

func (fc *FactCreate) SetNillableID(s *string) *FactCreate

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

func (*FactCreate) SetNillableScopeID

func (fc *FactCreate) SetNillableScopeID(id *string) *FactCreate

SetNillableScopeID sets the "scope" edge to the Scope entity by ID if the given value is not nil.

func (*FactCreate) SetNillableUpdatedAt

func (fc *FactCreate) SetNillableUpdatedAt(t *time.Time) *FactCreate

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

func (*FactCreate) SetScope

func (fc *FactCreate) SetScope(s *Scope) *FactCreate

SetScope sets the "scope" edge to the Scope entity.

func (*FactCreate) SetScopeID

func (fc *FactCreate) SetScopeID(id string) *FactCreate

SetScopeID sets the "scope" edge to the Scope entity by ID.

func (*FactCreate) SetUpdatedAt

func (fc *FactCreate) SetUpdatedAt(t time.Time) *FactCreate

SetUpdatedAt sets the "updated_at" field.

type FactCreateBulk

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

FactCreateBulk is the builder for creating many Fact entities in bulk.

func (*FactCreateBulk) Save

func (fcb *FactCreateBulk) Save(ctx context.Context) ([]*Fact, error)

Save creates the Fact entities in the database.

func (*FactCreateBulk) SaveX

func (fcb *FactCreateBulk) SaveX(ctx context.Context) []*Fact

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

type FactDelete

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

FactDelete is the builder for deleting a Fact entity.

func (*FactDelete) Exec

func (fd *FactDelete) Exec(ctx context.Context) (int, error)

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

func (*FactDelete) ExecX

func (fd *FactDelete) ExecX(ctx context.Context) int

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

func (*FactDelete) Where

func (fd *FactDelete) Where(ps ...predicate.Fact) *FactDelete

Where adds a new predicate to the FactDelete builder.

type FactDeleteOne

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

FactDeleteOne is the builder for deleting a single Fact entity.

func (*FactDeleteOne) Exec

func (fdo *FactDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*FactDeleteOne) ExecX

func (fdo *FactDeleteOne) ExecX(ctx context.Context)

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

type FactEdges

type FactEdges struct {
	// Scope holds the value of the scope edge.
	Scope *Scope `json:"scope,omitempty"`
	// FactType holds the value of the fact_type edge.
	FactType *FactType `json:"fact_type,omitempty"`
	// contains filtered or unexported fields
}

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

func (FactEdges) FactTypeOrErr

func (e FactEdges) FactTypeOrErr() (*FactType, error)

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

func (FactEdges) ScopeOrErr

func (e FactEdges) ScopeOrErr() (*Scope, error)

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

type FactFilter

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

FactFilter provides a generic filtering capability at runtime for FactQuery.

func (*FactFilter) Where

func (f *FactFilter) Where(p entql.P)

Where applies the entql predicate on the query filter.

func (*FactFilter) WhereCreatedAt

func (f *FactFilter) WhereCreatedAt(p entql.TimeP)

WhereCreatedAt applies the entql time.Time predicate on the created_at field.

func (*FactFilter) WhereDeletedAt

func (f *FactFilter) WhereDeletedAt(p entql.TimeP)

WhereDeletedAt applies the entql time.Time predicate on the deleted_at field.

func (*FactFilter) WhereDomain

func (f *FactFilter) WhereDomain(p entql.StringP)

WhereDomain applies the entql string predicate on the domain field.

func (*FactFilter) WhereEncryptedValue

func (f *FactFilter) WhereEncryptedValue(p entql.StringP)

WhereEncryptedValue applies the entql string predicate on the encrypted_value field.

func (*FactFilter) WhereHasFactType

func (f *FactFilter) WhereHasFactType()

WhereHasFactType applies a predicate to check if query has an edge fact_type.

func (*FactFilter) WhereHasFactTypeWith

func (f *FactFilter) WhereHasFactTypeWith(preds ...predicate.FactType)

WhereHasFactTypeWith applies a predicate to check if query has an edge fact_type with a given conditions (other predicates).

func (*FactFilter) WhereHasScope

func (f *FactFilter) WhereHasScope()

WhereHasScope applies a predicate to check if query has an edge scope.

func (*FactFilter) WhereHasScopeWith

func (f *FactFilter) WhereHasScopeWith(preds ...predicate.Scope)

WhereHasScopeWith applies a predicate to check if query has an edge scope with a given conditions (other predicates).

func (*FactFilter) WhereHashedValue

func (f *FactFilter) WhereHashedValue(p entql.StringP)

WhereHashedValue applies the entql string predicate on the hashed_value field.

func (*FactFilter) WhereID

func (f *FactFilter) WhereID(p entql.StringP)

WhereID applies the entql string predicate on the id field.

func (*FactFilter) WhereUpdatedAt

func (f *FactFilter) WhereUpdatedAt(p entql.TimeP)

WhereUpdatedAt applies the entql time.Time predicate on the updated_at field.

type FactGroupBy

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

FactGroupBy is the group-by builder for Fact entities.

func (*FactGroupBy) Aggregate

func (fgb *FactGroupBy) Aggregate(fns ...AggregateFunc) *FactGroupBy

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

func (*FactGroupBy) Bool

func (fgb *FactGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a group-by query. It is only allowed when executing a group-by query with one field.

func (*FactGroupBy) BoolX

func (fgb *FactGroupBy) BoolX(ctx context.Context) bool

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

func (*FactGroupBy) Bools

func (fgb *FactGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from group-by. It is only allowed when executing a group-by query with one field.

func (*FactGroupBy) BoolsX

func (fgb *FactGroupBy) BoolsX(ctx context.Context) []bool

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

func (*FactGroupBy) Float64

func (fgb *FactGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a group-by query. It is only allowed when executing a group-by query with one field.

func (*FactGroupBy) Float64X

func (fgb *FactGroupBy) Float64X(ctx context.Context) float64

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

func (*FactGroupBy) Float64s

func (fgb *FactGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from group-by. It is only allowed when executing a group-by query with one field.

func (*FactGroupBy) Float64sX

func (fgb *FactGroupBy) Float64sX(ctx context.Context) []float64

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

func (*FactGroupBy) Int

func (fgb *FactGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a group-by query. It is only allowed when executing a group-by query with one field.

func (*FactGroupBy) IntX

func (fgb *FactGroupBy) IntX(ctx context.Context) int

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

func (*FactGroupBy) Ints

func (fgb *FactGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from group-by. It is only allowed when executing a group-by query with one field.

func (*FactGroupBy) IntsX

func (fgb *FactGroupBy) IntsX(ctx context.Context) []int

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

func (*FactGroupBy) Scan

func (fgb *FactGroupBy) Scan(ctx context.Context, v interface{}) error

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

func (*FactGroupBy) ScanX

func (fgb *FactGroupBy) ScanX(ctx context.Context, v interface{})

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

func (*FactGroupBy) String

func (fgb *FactGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a group-by query. It is only allowed when executing a group-by query with one field.

func (*FactGroupBy) StringX

func (fgb *FactGroupBy) StringX(ctx context.Context) string

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

func (*FactGroupBy) Strings

func (fgb *FactGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from group-by. It is only allowed when executing a group-by query with one field.

func (*FactGroupBy) StringsX

func (fgb *FactGroupBy) StringsX(ctx context.Context) []string

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

type FactMutation

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

FactMutation represents an operation that mutates the Fact nodes in the graph.

func (*FactMutation) AddField

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

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

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

func (*FactMutation) AddedField

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

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

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

func (*FactMutation) AddedIDs

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

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

func (*FactMutation) ClearDeletedAt

func (m *FactMutation) ClearDeletedAt()

ClearDeletedAt clears the value of the "deleted_at" field.

func (*FactMutation) ClearEdge

func (m *FactMutation) 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 (*FactMutation) ClearFactType

func (m *FactMutation) ClearFactType()

ClearFactType clears the "fact_type" edge to the FactType entity.

func (*FactMutation) ClearField

func (m *FactMutation) 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 (*FactMutation) ClearScope

func (m *FactMutation) ClearScope()

ClearScope clears the "scope" edge to the Scope entity.

func (*FactMutation) ClearedEdges

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

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

func (*FactMutation) ClearedFields

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

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

func (FactMutation) Client

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

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

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

func (*FactMutation) DeletedAt

func (m *FactMutation) DeletedAt() (r time.Time, exists bool)

DeletedAt returns the value of the "deleted_at" field in the mutation.

func (*FactMutation) DeletedAtCleared

func (m *FactMutation) DeletedAtCleared() bool

DeletedAtCleared returns if the "deleted_at" field was cleared in this mutation.

func (*FactMutation) Domain

func (m *FactMutation) Domain() (r string, exists bool)

Domain returns the value of the "domain" field in the mutation.

func (*FactMutation) EdgeCleared

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

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

func (*FactMutation) EncryptedValue

func (m *FactMutation) EncryptedValue() (r string, exists bool)

EncryptedValue returns the value of the "encrypted_value" field in the mutation.

func (*FactMutation) FactTypeCleared

func (m *FactMutation) FactTypeCleared() bool

FactTypeCleared returns if the "fact_type" edge to the FactType entity was cleared.

func (*FactMutation) FactTypeID

func (m *FactMutation) FactTypeID() (id string, exists bool)

FactTypeID returns the "fact_type" edge ID in the mutation.

func (*FactMutation) FactTypeIDs

func (m *FactMutation) FactTypeIDs() (ids []string)

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

func (*FactMutation) Field

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

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

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

func (*FactMutation) Fields

func (m *FactMutation) 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 (*FactMutation) Filter

func (m *FactMutation) Filter() *FactFilter

Filter returns an entql.Where implementation to apply filters on the FactMutation builder.

func (*FactMutation) HashedValue

func (m *FactMutation) HashedValue() (r string, exists bool)

HashedValue returns the value of the "hashed_value" field in the mutation.

func (*FactMutation) ID

func (m *FactMutation) ID() (id string, exists bool)

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder.

func (*FactMutation) OldCreatedAt

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

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

func (m *FactMutation) OldDeletedAt(ctx context.Context) (v *time.Time, err error)

OldDeletedAt returns the old "deleted_at" field's value of the Fact entity. If the Fact 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 (*FactMutation) OldDomain

func (m *FactMutation) OldDomain(ctx context.Context) (v string, err error)

OldDomain returns the old "domain" field's value of the Fact entity. If the Fact 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 (*FactMutation) OldEncryptedValue

func (m *FactMutation) OldEncryptedValue(ctx context.Context) (v string, err error)

OldEncryptedValue returns the old "encrypted_value" field's value of the Fact entity. If the Fact 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 (*FactMutation) OldField

func (m *FactMutation) 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 (*FactMutation) OldHashedValue

func (m *FactMutation) OldHashedValue(ctx context.Context) (v string, err error)

OldHashedValue returns the old "hashed_value" field's value of the Fact entity. If the Fact 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 (*FactMutation) OldUpdatedAt

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

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

func (m *FactMutation) Op() Op

Op returns the operation name.

func (*FactMutation) RemovedEdges

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

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

func (*FactMutation) RemovedIDs

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

func (m *FactMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*FactMutation) ResetDeletedAt

func (m *FactMutation) ResetDeletedAt()

ResetDeletedAt resets all changes to the "deleted_at" field.

func (*FactMutation) ResetDomain

func (m *FactMutation) ResetDomain()

ResetDomain resets all changes to the "domain" field.

func (*FactMutation) ResetEdge

func (m *FactMutation) 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 (*FactMutation) ResetEncryptedValue

func (m *FactMutation) ResetEncryptedValue()

ResetEncryptedValue resets all changes to the "encrypted_value" field.

func (*FactMutation) ResetFactType

func (m *FactMutation) ResetFactType()

ResetFactType resets all changes to the "fact_type" edge.

func (*FactMutation) ResetField

func (m *FactMutation) 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 (*FactMutation) ResetHashedValue

func (m *FactMutation) ResetHashedValue()

ResetHashedValue resets all changes to the "hashed_value" field.

func (*FactMutation) ResetScope

func (m *FactMutation) ResetScope()

ResetScope resets all changes to the "scope" edge.

func (*FactMutation) ResetUpdatedAt

func (m *FactMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*FactMutation) ScopeCleared

func (m *FactMutation) ScopeCleared() bool

ScopeCleared returns if the "scope" edge to the Scope entity was cleared.

func (*FactMutation) ScopeID

func (m *FactMutation) ScopeID() (id string, exists bool)

ScopeID returns the "scope" edge ID in the mutation.

func (*FactMutation) ScopeIDs

func (m *FactMutation) ScopeIDs() (ids []string)

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

func (*FactMutation) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*FactMutation) SetDeletedAt

func (m *FactMutation) SetDeletedAt(t time.Time)

SetDeletedAt sets the "deleted_at" field.

func (*FactMutation) SetDomain

func (m *FactMutation) SetDomain(s string)

SetDomain sets the "domain" field.

func (*FactMutation) SetEncryptedValue

func (m *FactMutation) SetEncryptedValue(s string)

SetEncryptedValue sets the "encrypted_value" field.

func (*FactMutation) SetFactTypeID

func (m *FactMutation) SetFactTypeID(id string)

SetFactTypeID sets the "fact_type" edge to the FactType entity by id.

func (*FactMutation) SetField

func (m *FactMutation) 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 (*FactMutation) SetHashedValue

func (m *FactMutation) SetHashedValue(s string)

SetHashedValue sets the "hashed_value" field.

func (*FactMutation) SetID

func (m *FactMutation) SetID(id string)

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

func (*FactMutation) SetScopeID

func (m *FactMutation) SetScopeID(id string)

SetScopeID sets the "scope" edge to the Scope entity by id.

func (*FactMutation) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" field.

func (FactMutation) Tx

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

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

func (*FactMutation) Type

func (m *FactMutation) Type() string

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

func (*FactMutation) UpdatedAt

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

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

type FactQuery

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

FactQuery is the builder for querying Fact entities.

func (*FactQuery) All

func (fq *FactQuery) All(ctx context.Context) ([]*Fact, error)

All executes the query and returns a list of Facts.

func (*FactQuery) AllX

func (fq *FactQuery) AllX(ctx context.Context) []*Fact

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

func (*FactQuery) Clone

func (fq *FactQuery) Clone() *FactQuery

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

func (*FactQuery) Count

func (fq *FactQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*FactQuery) CountX

func (fq *FactQuery) CountX(ctx context.Context) int

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

func (*FactQuery) Exist

func (fq *FactQuery) Exist(ctx context.Context) (bool, error)

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

func (*FactQuery) ExistX

func (fq *FactQuery) ExistX(ctx context.Context) bool

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

func (*FactQuery) Filter

func (fq *FactQuery) Filter() *FactFilter

Filter returns a Filter implementation to apply filters on the FactQuery builder.

func (*FactQuery) First

func (fq *FactQuery) First(ctx context.Context) (*Fact, error)

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

func (*FactQuery) FirstID

func (fq *FactQuery) FirstID(ctx context.Context) (id string, err error)

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

func (*FactQuery) FirstIDX

func (fq *FactQuery) FirstIDX(ctx context.Context) string

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

func (*FactQuery) FirstX

func (fq *FactQuery) FirstX(ctx context.Context) *Fact

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

func (*FactQuery) GroupBy

func (fq *FactQuery) GroupBy(field string, fields ...string) *FactGroupBy

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

func (*FactQuery) IDs

func (fq *FactQuery) IDs(ctx context.Context) ([]string, error)

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

func (*FactQuery) IDsX

func (fq *FactQuery) IDsX(ctx context.Context) []string

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

func (*FactQuery) Limit

func (fq *FactQuery) Limit(limit int) *FactQuery

Limit adds a limit step to the query.

func (*FactQuery) Offset

func (fq *FactQuery) Offset(offset int) *FactQuery

Offset adds an offset step to the query.

func (*FactQuery) Only

func (fq *FactQuery) Only(ctx context.Context) (*Fact, error)

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

func (*FactQuery) OnlyID

func (fq *FactQuery) OnlyID(ctx context.Context) (id string, err error)

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

func (*FactQuery) OnlyIDX

func (fq *FactQuery) OnlyIDX(ctx context.Context) string

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

func (*FactQuery) OnlyX

func (fq *FactQuery) OnlyX(ctx context.Context) *Fact

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

func (*FactQuery) Order

func (fq *FactQuery) Order(o ...OrderFunc) *FactQuery

Order adds an order step to the query.

func (*FactQuery) QueryFactType

func (fq *FactQuery) QueryFactType() *FactTypeQuery

QueryFactType chains the current query on the "fact_type" edge.

func (*FactQuery) QueryScope

func (fq *FactQuery) QueryScope() *ScopeQuery

QueryScope chains the current query on the "scope" edge.

func (*FactQuery) Select

func (fq *FactQuery) Select(field string, fields ...string) *FactSelect

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

func (*FactQuery) Where

func (fq *FactQuery) Where(ps ...predicate.Fact) *FactQuery

Where adds a new predicate for the FactQuery builder.

func (*FactQuery) WithFactType

func (fq *FactQuery) WithFactType(opts ...func(*FactTypeQuery)) *FactQuery

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

func (*FactQuery) WithScope

func (fq *FactQuery) WithScope(opts ...func(*ScopeQuery)) *FactQuery

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

type FactSelect

type FactSelect struct {
	*FactQuery
	// contains filtered or unexported fields
}

FactSelect is the builder for selecting fields of Fact entities.

func (*FactSelect) Bool

func (fs *FactSelect) Bool(ctx context.Context) (_ bool, err error)

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

func (*FactSelect) BoolX

func (fs *FactSelect) BoolX(ctx context.Context) bool

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

func (*FactSelect) Bools

func (fs *FactSelect) Bools(ctx context.Context) ([]bool, error)

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

func (*FactSelect) BoolsX

func (fs *FactSelect) BoolsX(ctx context.Context) []bool

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

func (*FactSelect) Float64

func (fs *FactSelect) Float64(ctx context.Context) (_ float64, err error)

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

func (*FactSelect) Float64X

func (fs *FactSelect) Float64X(ctx context.Context) float64

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

func (*FactSelect) Float64s

func (fs *FactSelect) Float64s(ctx context.Context) ([]float64, error)

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

func (*FactSelect) Float64sX

func (fs *FactSelect) Float64sX(ctx context.Context) []float64

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

func (*FactSelect) Int

func (fs *FactSelect) Int(ctx context.Context) (_ int, err error)

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

func (*FactSelect) IntX

func (fs *FactSelect) IntX(ctx context.Context) int

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

func (*FactSelect) Ints

func (fs *FactSelect) Ints(ctx context.Context) ([]int, error)

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

func (*FactSelect) IntsX

func (fs *FactSelect) IntsX(ctx context.Context) []int

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

func (*FactSelect) Scan

func (fs *FactSelect) Scan(ctx context.Context, v interface{}) error

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

func (*FactSelect) ScanX

func (fs *FactSelect) ScanX(ctx context.Context, v interface{})

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

func (*FactSelect) String

func (fs *FactSelect) String(ctx context.Context) (_ string, err error)

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

func (*FactSelect) StringX

func (fs *FactSelect) StringX(ctx context.Context) string

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

func (*FactSelect) Strings

func (fs *FactSelect) Strings(ctx context.Context) ([]string, error)

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

func (*FactSelect) StringsX

func (fs *FactSelect) StringsX(ctx context.Context) []string

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

type FactType

type FactType struct {

	// ID of the ent.
	ID string `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"`
	// DeletedAt holds the value of the "deleted_at" field.
	DeletedAt *time.Time `json:"deleted_at,omitempty"`
	// Slug holds the value of the "slug" field.
	Slug string `json:"slug,omitempty"`
	// BuiltIn holds the value of the "built_in" field.
	BuiltIn bool `json:"built_in,omitempty"`
	// Validation holds the value of the "validation" field.
	Validation string `json:"validation,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the FactTypeQuery when eager-loading is set.
	Edges FactTypeEdges `json:"edges"`
	// contains filtered or unexported fields
}

FactType is the model entity for the FactType schema.

func (*FactType) QueryFacts

func (ft *FactType) QueryFacts() *FactQuery

QueryFacts queries the "facts" edge of the FactType entity.

func (*FactType) String

func (ft *FactType) String() string

String implements the fmt.Stringer.

func (*FactType) Unwrap

func (ft *FactType) Unwrap() *FactType

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

func (ft *FactType) Update() *FactTypeUpdateOne

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

type FactTypeClient

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

FactTypeClient is a client for the FactType schema.

func NewFactTypeClient

func NewFactTypeClient(c config) *FactTypeClient

NewFactTypeClient returns a client for the FactType from the given config.

func (*FactTypeClient) Create

func (c *FactTypeClient) Create() *FactTypeCreate

Create returns a create builder for FactType.

func (*FactTypeClient) CreateBulk

func (c *FactTypeClient) CreateBulk(builders ...*FactTypeCreate) *FactTypeCreateBulk

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

func (*FactTypeClient) Delete

func (c *FactTypeClient) Delete() *FactTypeDelete

Delete returns a delete builder for FactType.

func (*FactTypeClient) DeleteOne

func (c *FactTypeClient) DeleteOne(ft *FactType) *FactTypeDeleteOne

DeleteOne returns a delete builder for the given entity.

func (*FactTypeClient) DeleteOneID

func (c *FactTypeClient) DeleteOneID(id string) *FactTypeDeleteOne

DeleteOneID returns a delete builder for the given id.

func (*FactTypeClient) Get

func (c *FactTypeClient) Get(ctx context.Context, id string) (*FactType, error)

Get returns a FactType entity by its id.

func (*FactTypeClient) GetX

func (c *FactTypeClient) GetX(ctx context.Context, id string) *FactType

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

func (*FactTypeClient) Hooks

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

Hooks returns the client hooks.

func (*FactTypeClient) Query

func (c *FactTypeClient) Query() *FactTypeQuery

Query returns a query builder for FactType.

func (*FactTypeClient) QueryFacts

func (c *FactTypeClient) QueryFacts(ft *FactType) *FactQuery

QueryFacts queries the facts edge of a FactType.

func (*FactTypeClient) Update

func (c *FactTypeClient) Update() *FactTypeUpdate

Update returns an update builder for FactType.

func (*FactTypeClient) UpdateOne

func (c *FactTypeClient) UpdateOne(ft *FactType) *FactTypeUpdateOne

UpdateOne returns an update builder for the given entity.

func (*FactTypeClient) UpdateOneID

func (c *FactTypeClient) UpdateOneID(id string) *FactTypeUpdateOne

UpdateOneID returns an update builder for the given id.

func (*FactTypeClient) Use

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

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

type FactTypeCreate

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

FactTypeCreate is the builder for creating a FactType entity.

func (*FactTypeCreate) AddFactIDs

func (ftc *FactTypeCreate) AddFactIDs(ids ...string) *FactTypeCreate

AddFactIDs adds the "facts" edge to the Fact entity by IDs.

func (*FactTypeCreate) AddFacts

func (ftc *FactTypeCreate) AddFacts(f ...*Fact) *FactTypeCreate

AddFacts adds the "facts" edges to the Fact entity.

func (*FactTypeCreate) Mutation

func (ftc *FactTypeCreate) Mutation() *FactTypeMutation

Mutation returns the FactTypeMutation object of the builder.

func (*FactTypeCreate) Save

func (ftc *FactTypeCreate) Save(ctx context.Context) (*FactType, error)

Save creates the FactType in the database.

func (*FactTypeCreate) SaveX

func (ftc *FactTypeCreate) SaveX(ctx context.Context) *FactType

SaveX calls Save and panics if Save returns an error.

func (*FactTypeCreate) SetBuiltIn

func (ftc *FactTypeCreate) SetBuiltIn(b bool) *FactTypeCreate

SetBuiltIn sets the "built_in" field.

func (*FactTypeCreate) SetCreatedAt

func (ftc *FactTypeCreate) SetCreatedAt(t time.Time) *FactTypeCreate

SetCreatedAt sets the "created_at" field.

func (*FactTypeCreate) SetDeletedAt

func (ftc *FactTypeCreate) SetDeletedAt(t time.Time) *FactTypeCreate

SetDeletedAt sets the "deleted_at" field.

func (*FactTypeCreate) SetID

func (ftc *FactTypeCreate) SetID(s string) *FactTypeCreate

SetID sets the "id" field.

func (*FactTypeCreate) SetNillableBuiltIn

func (ftc *FactTypeCreate) SetNillableBuiltIn(b *bool) *FactTypeCreate

SetNillableBuiltIn sets the "built_in" field if the given value is not nil.

func (*FactTypeCreate) SetNillableCreatedAt

func (ftc *FactTypeCreate) SetNillableCreatedAt(t *time.Time) *FactTypeCreate

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

func (*FactTypeCreate) SetNillableDeletedAt

func (ftc *FactTypeCreate) SetNillableDeletedAt(t *time.Time) *FactTypeCreate

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*FactTypeCreate) SetNillableID

func (ftc *FactTypeCreate) SetNillableID(s *string) *FactTypeCreate

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

func (*FactTypeCreate) SetNillableUpdatedAt

func (ftc *FactTypeCreate) SetNillableUpdatedAt(t *time.Time) *FactTypeCreate

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

func (*FactTypeCreate) SetNillableValidation

func (ftc *FactTypeCreate) SetNillableValidation(s *string) *FactTypeCreate

SetNillableValidation sets the "validation" field if the given value is not nil.

func (*FactTypeCreate) SetSlug

func (ftc *FactTypeCreate) SetSlug(s string) *FactTypeCreate

SetSlug sets the "slug" field.

func (*FactTypeCreate) SetUpdatedAt

func (ftc *FactTypeCreate) SetUpdatedAt(t time.Time) *FactTypeCreate

SetUpdatedAt sets the "updated_at" field.

func (*FactTypeCreate) SetValidation

func (ftc *FactTypeCreate) SetValidation(s string) *FactTypeCreate

SetValidation sets the "validation" field.

type FactTypeCreateBulk

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

FactTypeCreateBulk is the builder for creating many FactType entities in bulk.

func (*FactTypeCreateBulk) Save

func (ftcb *FactTypeCreateBulk) Save(ctx context.Context) ([]*FactType, error)

Save creates the FactType entities in the database.

func (*FactTypeCreateBulk) SaveX

func (ftcb *FactTypeCreateBulk) SaveX(ctx context.Context) []*FactType

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

type FactTypeDelete

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

FactTypeDelete is the builder for deleting a FactType entity.

func (*FactTypeDelete) Exec

func (ftd *FactTypeDelete) Exec(ctx context.Context) (int, error)

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

func (*FactTypeDelete) ExecX

func (ftd *FactTypeDelete) ExecX(ctx context.Context) int

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

func (*FactTypeDelete) Where

func (ftd *FactTypeDelete) Where(ps ...predicate.FactType) *FactTypeDelete

Where adds a new predicate to the FactTypeDelete builder.

type FactTypeDeleteOne

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

FactTypeDeleteOne is the builder for deleting a single FactType entity.

func (*FactTypeDeleteOne) Exec

func (ftdo *FactTypeDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*FactTypeDeleteOne) ExecX

func (ftdo *FactTypeDeleteOne) ExecX(ctx context.Context)

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

type FactTypeEdges

type FactTypeEdges struct {
	// Facts holds the value of the facts edge.
	Facts []*Fact `json:"facts,omitempty"`
	// contains filtered or unexported fields
}

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

func (FactTypeEdges) FactsOrErr

func (e FactTypeEdges) FactsOrErr() ([]*Fact, error)

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

type FactTypeFilter

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

FactTypeFilter provides a generic filtering capability at runtime for FactTypeQuery.

func (*FactTypeFilter) Where

func (f *FactTypeFilter) Where(p entql.P)

Where applies the entql predicate on the query filter.

func (*FactTypeFilter) WhereBuiltIn

func (f *FactTypeFilter) WhereBuiltIn(p entql.BoolP)

WhereBuiltIn applies the entql bool predicate on the built_in field.

func (*FactTypeFilter) WhereCreatedAt

func (f *FactTypeFilter) WhereCreatedAt(p entql.TimeP)

WhereCreatedAt applies the entql time.Time predicate on the created_at field.

func (*FactTypeFilter) WhereDeletedAt

func (f *FactTypeFilter) WhereDeletedAt(p entql.TimeP)

WhereDeletedAt applies the entql time.Time predicate on the deleted_at field.

func (*FactTypeFilter) WhereHasFacts

func (f *FactTypeFilter) WhereHasFacts()

WhereHasFacts applies a predicate to check if query has an edge facts.

func (*FactTypeFilter) WhereHasFactsWith

func (f *FactTypeFilter) WhereHasFactsWith(preds ...predicate.Fact)

WhereHasFactsWith applies a predicate to check if query has an edge facts with a given conditions (other predicates).

func (*FactTypeFilter) WhereID

func (f *FactTypeFilter) WhereID(p entql.StringP)

WhereID applies the entql string predicate on the id field.

func (*FactTypeFilter) WhereSlug

func (f *FactTypeFilter) WhereSlug(p entql.StringP)

WhereSlug applies the entql string predicate on the slug field.

func (*FactTypeFilter) WhereUpdatedAt

func (f *FactTypeFilter) WhereUpdatedAt(p entql.TimeP)

WhereUpdatedAt applies the entql time.Time predicate on the updated_at field.

func (*FactTypeFilter) WhereValidation

func (f *FactTypeFilter) WhereValidation(p entql.StringP)

WhereValidation applies the entql string predicate on the validation field.

type FactTypeGroupBy

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

FactTypeGroupBy is the group-by builder for FactType entities.

func (*FactTypeGroupBy) Aggregate

func (ftgb *FactTypeGroupBy) Aggregate(fns ...AggregateFunc) *FactTypeGroupBy

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

func (*FactTypeGroupBy) Bool

func (ftgb *FactTypeGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a group-by query. It is only allowed when executing a group-by query with one field.

func (*FactTypeGroupBy) BoolX

func (ftgb *FactTypeGroupBy) BoolX(ctx context.Context) bool

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

func (*FactTypeGroupBy) Bools

func (ftgb *FactTypeGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from group-by. It is only allowed when executing a group-by query with one field.

func (*FactTypeGroupBy) BoolsX

func (ftgb *FactTypeGroupBy) BoolsX(ctx context.Context) []bool

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

func (*FactTypeGroupBy) Float64

func (ftgb *FactTypeGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a group-by query. It is only allowed when executing a group-by query with one field.

func (*FactTypeGroupBy) Float64X

func (ftgb *FactTypeGroupBy) Float64X(ctx context.Context) float64

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

func (*FactTypeGroupBy) Float64s

func (ftgb *FactTypeGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from group-by. It is only allowed when executing a group-by query with one field.

func (*FactTypeGroupBy) Float64sX

func (ftgb *FactTypeGroupBy) Float64sX(ctx context.Context) []float64

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

func (*FactTypeGroupBy) Int

func (ftgb *FactTypeGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a group-by query. It is only allowed when executing a group-by query with one field.

func (*FactTypeGroupBy) IntX

func (ftgb *FactTypeGroupBy) IntX(ctx context.Context) int

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

func (*FactTypeGroupBy) Ints

func (ftgb *FactTypeGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from group-by. It is only allowed when executing a group-by query with one field.

func (*FactTypeGroupBy) IntsX

func (ftgb *FactTypeGroupBy) IntsX(ctx context.Context) []int

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

func (*FactTypeGroupBy) Scan

func (ftgb *FactTypeGroupBy) Scan(ctx context.Context, v interface{}) error

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

func (*FactTypeGroupBy) ScanX

func (ftgb *FactTypeGroupBy) ScanX(ctx context.Context, v interface{})

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

func (*FactTypeGroupBy) String

func (ftgb *FactTypeGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a group-by query. It is only allowed when executing a group-by query with one field.

func (*FactTypeGroupBy) StringX

func (ftgb *FactTypeGroupBy) StringX(ctx context.Context) string

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

func (*FactTypeGroupBy) Strings

func (ftgb *FactTypeGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from group-by. It is only allowed when executing a group-by query with one field.

func (*FactTypeGroupBy) StringsX

func (ftgb *FactTypeGroupBy) StringsX(ctx context.Context) []string

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

type FactTypeMutation

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

FactTypeMutation represents an operation that mutates the FactType nodes in the graph.

func (*FactTypeMutation) AddFactIDs

func (m *FactTypeMutation) AddFactIDs(ids ...string)

AddFactIDs adds the "facts" edge to the Fact entity by ids.

func (*FactTypeMutation) AddField

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

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

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

func (*FactTypeMutation) AddedField

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

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

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

func (*FactTypeMutation) AddedIDs

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

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

func (*FactTypeMutation) BuiltIn

func (m *FactTypeMutation) BuiltIn() (r bool, exists bool)

BuiltIn returns the value of the "built_in" field in the mutation.

func (*FactTypeMutation) ClearDeletedAt

func (m *FactTypeMutation) ClearDeletedAt()

ClearDeletedAt clears the value of the "deleted_at" field.

func (*FactTypeMutation) ClearEdge

func (m *FactTypeMutation) 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 (*FactTypeMutation) ClearFacts

func (m *FactTypeMutation) ClearFacts()

ClearFacts clears the "facts" edge to the Fact entity.

func (*FactTypeMutation) ClearField

func (m *FactTypeMutation) 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 (*FactTypeMutation) ClearValidation

func (m *FactTypeMutation) ClearValidation()

ClearValidation clears the value of the "validation" field.

func (*FactTypeMutation) ClearedEdges

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

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

func (*FactTypeMutation) ClearedFields

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

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

func (FactTypeMutation) Client

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

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

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

func (*FactTypeMutation) DeletedAt

func (m *FactTypeMutation) DeletedAt() (r time.Time, exists bool)

DeletedAt returns the value of the "deleted_at" field in the mutation.

func (*FactTypeMutation) DeletedAtCleared

func (m *FactTypeMutation) DeletedAtCleared() bool

DeletedAtCleared returns if the "deleted_at" field was cleared in this mutation.

func (*FactTypeMutation) EdgeCleared

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

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

func (*FactTypeMutation) FactsCleared

func (m *FactTypeMutation) FactsCleared() bool

FactsCleared returns if the "facts" edge to the Fact entity was cleared.

func (*FactTypeMutation) FactsIDs

func (m *FactTypeMutation) FactsIDs() (ids []string)

FactsIDs returns the "facts" edge IDs in the mutation.

func (*FactTypeMutation) Field

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

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

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

func (*FactTypeMutation) Fields

func (m *FactTypeMutation) 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 (*FactTypeMutation) Filter

func (m *FactTypeMutation) Filter() *FactTypeFilter

Filter returns an entql.Where implementation to apply filters on the FactTypeMutation builder.

func (*FactTypeMutation) ID

func (m *FactTypeMutation) ID() (id string, exists bool)

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder.

func (*FactTypeMutation) OldBuiltIn

func (m *FactTypeMutation) OldBuiltIn(ctx context.Context) (v bool, err error)

OldBuiltIn returns the old "built_in" field's value of the FactType entity. If the FactType 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 (*FactTypeMutation) OldCreatedAt

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

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

func (m *FactTypeMutation) OldDeletedAt(ctx context.Context) (v *time.Time, err error)

OldDeletedAt returns the old "deleted_at" field's value of the FactType entity. If the FactType 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 (*FactTypeMutation) OldField

func (m *FactTypeMutation) 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 (*FactTypeMutation) OldSlug

func (m *FactTypeMutation) OldSlug(ctx context.Context) (v string, err error)

OldSlug returns the old "slug" field's value of the FactType entity. If the FactType 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 (*FactTypeMutation) OldUpdatedAt

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

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

func (m *FactTypeMutation) OldValidation(ctx context.Context) (v string, err error)

OldValidation returns the old "validation" field's value of the FactType entity. If the FactType 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 (*FactTypeMutation) Op

func (m *FactTypeMutation) Op() Op

Op returns the operation name.

func (*FactTypeMutation) RemoveFactIDs

func (m *FactTypeMutation) RemoveFactIDs(ids ...string)

RemoveFactIDs removes the "facts" edge to the Fact entity by IDs.

func (*FactTypeMutation) RemovedEdges

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

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

func (*FactTypeMutation) RemovedFactsIDs

func (m *FactTypeMutation) RemovedFactsIDs() (ids []string)

RemovedFacts returns the removed IDs of the "facts" edge to the Fact entity.

func (*FactTypeMutation) RemovedIDs

func (m *FactTypeMutation) 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 (*FactTypeMutation) ResetBuiltIn

func (m *FactTypeMutation) ResetBuiltIn()

ResetBuiltIn resets all changes to the "built_in" field.

func (*FactTypeMutation) ResetCreatedAt

func (m *FactTypeMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*FactTypeMutation) ResetDeletedAt

func (m *FactTypeMutation) ResetDeletedAt()

ResetDeletedAt resets all changes to the "deleted_at" field.

func (*FactTypeMutation) ResetEdge

func (m *FactTypeMutation) 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 (*FactTypeMutation) ResetFacts

func (m *FactTypeMutation) ResetFacts()

ResetFacts resets all changes to the "facts" edge.

func (*FactTypeMutation) ResetField

func (m *FactTypeMutation) 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 (*FactTypeMutation) ResetSlug

func (m *FactTypeMutation) ResetSlug()

ResetSlug resets all changes to the "slug" field.

func (*FactTypeMutation) ResetUpdatedAt

func (m *FactTypeMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*FactTypeMutation) ResetValidation

func (m *FactTypeMutation) ResetValidation()

ResetValidation resets all changes to the "validation" field.

func (*FactTypeMutation) SetBuiltIn

func (m *FactTypeMutation) SetBuiltIn(b bool)

SetBuiltIn sets the "built_in" field.

func (*FactTypeMutation) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*FactTypeMutation) SetDeletedAt

func (m *FactTypeMutation) SetDeletedAt(t time.Time)

SetDeletedAt sets the "deleted_at" field.

func (*FactTypeMutation) SetField

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

func (m *FactTypeMutation) SetID(id string)

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

func (*FactTypeMutation) SetSlug

func (m *FactTypeMutation) SetSlug(s string)

SetSlug sets the "slug" field.

func (*FactTypeMutation) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" field.

func (*FactTypeMutation) SetValidation

func (m *FactTypeMutation) SetValidation(s string)

SetValidation sets the "validation" field.

func (*FactTypeMutation) Slug

func (m *FactTypeMutation) Slug() (r string, exists bool)

Slug returns the value of the "slug" field in the mutation.

func (FactTypeMutation) Tx

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

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

func (*FactTypeMutation) Type

func (m *FactTypeMutation) Type() string

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

func (*FactTypeMutation) UpdatedAt

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

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

func (*FactTypeMutation) Validation

func (m *FactTypeMutation) Validation() (r string, exists bool)

Validation returns the value of the "validation" field in the mutation.

func (*FactTypeMutation) ValidationCleared

func (m *FactTypeMutation) ValidationCleared() bool

ValidationCleared returns if the "validation" field was cleared in this mutation.

type FactTypeQuery

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

FactTypeQuery is the builder for querying FactType entities.

func (*FactTypeQuery) All

func (ftq *FactTypeQuery) All(ctx context.Context) ([]*FactType, error)

All executes the query and returns a list of FactTypes.

func (*FactTypeQuery) AllX

func (ftq *FactTypeQuery) AllX(ctx context.Context) []*FactType

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

func (*FactTypeQuery) Clone

func (ftq *FactTypeQuery) Clone() *FactTypeQuery

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

func (*FactTypeQuery) Count

func (ftq *FactTypeQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*FactTypeQuery) CountX

func (ftq *FactTypeQuery) CountX(ctx context.Context) int

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

func (*FactTypeQuery) Exist

func (ftq *FactTypeQuery) Exist(ctx context.Context) (bool, error)

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

func (*FactTypeQuery) ExistX

func (ftq *FactTypeQuery) ExistX(ctx context.Context) bool

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

func (*FactTypeQuery) Filter

func (ftq *FactTypeQuery) Filter() *FactTypeFilter

Filter returns a Filter implementation to apply filters on the FactTypeQuery builder.

func (*FactTypeQuery) First

func (ftq *FactTypeQuery) First(ctx context.Context) (*FactType, error)

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

func (*FactTypeQuery) FirstID

func (ftq *FactTypeQuery) FirstID(ctx context.Context) (id string, err error)

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

func (*FactTypeQuery) FirstIDX

func (ftq *FactTypeQuery) FirstIDX(ctx context.Context) string

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

func (*FactTypeQuery) FirstX

func (ftq *FactTypeQuery) FirstX(ctx context.Context) *FactType

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

func (*FactTypeQuery) GroupBy

func (ftq *FactTypeQuery) GroupBy(field string, fields ...string) *FactTypeGroupBy

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

func (*FactTypeQuery) IDs

func (ftq *FactTypeQuery) IDs(ctx context.Context) ([]string, error)

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

func (*FactTypeQuery) IDsX

func (ftq *FactTypeQuery) IDsX(ctx context.Context) []string

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

func (*FactTypeQuery) Limit

func (ftq *FactTypeQuery) Limit(limit int) *FactTypeQuery

Limit adds a limit step to the query.

func (*FactTypeQuery) Offset

func (ftq *FactTypeQuery) Offset(offset int) *FactTypeQuery

Offset adds an offset step to the query.

func (*FactTypeQuery) Only

func (ftq *FactTypeQuery) Only(ctx context.Context) (*FactType, error)

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

func (*FactTypeQuery) OnlyID

func (ftq *FactTypeQuery) OnlyID(ctx context.Context) (id string, err error)

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

func (*FactTypeQuery) OnlyIDX

func (ftq *FactTypeQuery) OnlyIDX(ctx context.Context) string

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

func (*FactTypeQuery) OnlyX

func (ftq *FactTypeQuery) OnlyX(ctx context.Context) *FactType

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

func (*FactTypeQuery) Order

func (ftq *FactTypeQuery) Order(o ...OrderFunc) *FactTypeQuery

Order adds an order step to the query.

func (*FactTypeQuery) QueryFacts

func (ftq *FactTypeQuery) QueryFacts() *FactQuery

QueryFacts chains the current query on the "facts" edge.

func (*FactTypeQuery) Select

func (ftq *FactTypeQuery) Select(field string, fields ...string) *FactTypeSelect

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

func (*FactTypeQuery) Where

func (ftq *FactTypeQuery) Where(ps ...predicate.FactType) *FactTypeQuery

Where adds a new predicate for the FactTypeQuery builder.

func (*FactTypeQuery) WithFacts

func (ftq *FactTypeQuery) WithFacts(opts ...func(*FactQuery)) *FactTypeQuery

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

type FactTypeSelect

type FactTypeSelect struct {
	*FactTypeQuery
	// contains filtered or unexported fields
}

FactTypeSelect is the builder for selecting fields of FactType entities.

func (*FactTypeSelect) Bool

func (fts *FactTypeSelect) Bool(ctx context.Context) (_ bool, err error)

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

func (*FactTypeSelect) BoolX

func (fts *FactTypeSelect) BoolX(ctx context.Context) bool

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

func (*FactTypeSelect) Bools

func (fts *FactTypeSelect) Bools(ctx context.Context) ([]bool, error)

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

func (*FactTypeSelect) BoolsX

func (fts *FactTypeSelect) BoolsX(ctx context.Context) []bool

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

func (*FactTypeSelect) Float64

func (fts *FactTypeSelect) Float64(ctx context.Context) (_ float64, err error)

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

func (*FactTypeSelect) Float64X

func (fts *FactTypeSelect) Float64X(ctx context.Context) float64

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

func (*FactTypeSelect) Float64s

func (fts *FactTypeSelect) Float64s(ctx context.Context) ([]float64, error)

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

func (*FactTypeSelect) Float64sX

func (fts *FactTypeSelect) Float64sX(ctx context.Context) []float64

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

func (*FactTypeSelect) Int

func (fts *FactTypeSelect) Int(ctx context.Context) (_ int, err error)

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

func (*FactTypeSelect) IntX

func (fts *FactTypeSelect) IntX(ctx context.Context) int

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

func (*FactTypeSelect) Ints

func (fts *FactTypeSelect) Ints(ctx context.Context) ([]int, error)

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

func (*FactTypeSelect) IntsX

func (fts *FactTypeSelect) IntsX(ctx context.Context) []int

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

func (*FactTypeSelect) Scan

func (fts *FactTypeSelect) Scan(ctx context.Context, v interface{}) error

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

func (*FactTypeSelect) ScanX

func (fts *FactTypeSelect) ScanX(ctx context.Context, v interface{})

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

func (*FactTypeSelect) String

func (fts *FactTypeSelect) String(ctx context.Context) (_ string, err error)

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

func (*FactTypeSelect) StringX

func (fts *FactTypeSelect) StringX(ctx context.Context) string

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

func (*FactTypeSelect) Strings

func (fts *FactTypeSelect) Strings(ctx context.Context) ([]string, error)

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

func (*FactTypeSelect) StringsX

func (fts *FactTypeSelect) StringsX(ctx context.Context) []string

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

type FactTypeUpdate

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

FactTypeUpdate is the builder for updating FactType entities.

func (*FactTypeUpdate) AddFactIDs

func (ftu *FactTypeUpdate) AddFactIDs(ids ...string) *FactTypeUpdate

AddFactIDs adds the "facts" edge to the Fact entity by IDs.

func (*FactTypeUpdate) AddFacts

func (ftu *FactTypeUpdate) AddFacts(f ...*Fact) *FactTypeUpdate

AddFacts adds the "facts" edges to the Fact entity.

func (*FactTypeUpdate) ClearDeletedAt

func (ftu *FactTypeUpdate) ClearDeletedAt() *FactTypeUpdate

ClearDeletedAt clears the value of the "deleted_at" field.

func (*FactTypeUpdate) ClearFacts

func (ftu *FactTypeUpdate) ClearFacts() *FactTypeUpdate

ClearFacts clears all "facts" edges to the Fact entity.

func (*FactTypeUpdate) ClearValidation

func (ftu *FactTypeUpdate) ClearValidation() *FactTypeUpdate

ClearValidation clears the value of the "validation" field.

func (*FactTypeUpdate) Exec

func (ftu *FactTypeUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*FactTypeUpdate) ExecX

func (ftu *FactTypeUpdate) ExecX(ctx context.Context)

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

func (*FactTypeUpdate) Mutation

func (ftu *FactTypeUpdate) Mutation() *FactTypeMutation

Mutation returns the FactTypeMutation object of the builder.

func (*FactTypeUpdate) RemoveFactIDs

func (ftu *FactTypeUpdate) RemoveFactIDs(ids ...string) *FactTypeUpdate

RemoveFactIDs removes the "facts" edge to Fact entities by IDs.

func (*FactTypeUpdate) RemoveFacts

func (ftu *FactTypeUpdate) RemoveFacts(f ...*Fact) *FactTypeUpdate

RemoveFacts removes "facts" edges to Fact entities.

func (*FactTypeUpdate) Save

func (ftu *FactTypeUpdate) Save(ctx context.Context) (int, error)

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

func (*FactTypeUpdate) SaveX

func (ftu *FactTypeUpdate) SaveX(ctx context.Context) int

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

func (*FactTypeUpdate) SetBuiltIn

func (ftu *FactTypeUpdate) SetBuiltIn(b bool) *FactTypeUpdate

SetBuiltIn sets the "built_in" field.

func (*FactTypeUpdate) SetDeletedAt

func (ftu *FactTypeUpdate) SetDeletedAt(t time.Time) *FactTypeUpdate

SetDeletedAt sets the "deleted_at" field.

func (*FactTypeUpdate) SetNillableBuiltIn

func (ftu *FactTypeUpdate) SetNillableBuiltIn(b *bool) *FactTypeUpdate

SetNillableBuiltIn sets the "built_in" field if the given value is not nil.

func (*FactTypeUpdate) SetNillableDeletedAt

func (ftu *FactTypeUpdate) SetNillableDeletedAt(t *time.Time) *FactTypeUpdate

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*FactTypeUpdate) SetNillableValidation

func (ftu *FactTypeUpdate) SetNillableValidation(s *string) *FactTypeUpdate

SetNillableValidation sets the "validation" field if the given value is not nil.

func (*FactTypeUpdate) SetSlug

func (ftu *FactTypeUpdate) SetSlug(s string) *FactTypeUpdate

SetSlug sets the "slug" field.

func (*FactTypeUpdate) SetValidation

func (ftu *FactTypeUpdate) SetValidation(s string) *FactTypeUpdate

SetValidation sets the "validation" field.

func (*FactTypeUpdate) Where

func (ftu *FactTypeUpdate) Where(ps ...predicate.FactType) *FactTypeUpdate

Where adds a new predicate for the FactTypeUpdate builder.

type FactTypeUpdateOne

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

FactTypeUpdateOne is the builder for updating a single FactType entity.

func (*FactTypeUpdateOne) AddFactIDs

func (ftuo *FactTypeUpdateOne) AddFactIDs(ids ...string) *FactTypeUpdateOne

AddFactIDs adds the "facts" edge to the Fact entity by IDs.

func (*FactTypeUpdateOne) AddFacts

func (ftuo *FactTypeUpdateOne) AddFacts(f ...*Fact) *FactTypeUpdateOne

AddFacts adds the "facts" edges to the Fact entity.

func (*FactTypeUpdateOne) ClearDeletedAt

func (ftuo *FactTypeUpdateOne) ClearDeletedAt() *FactTypeUpdateOne

ClearDeletedAt clears the value of the "deleted_at" field.

func (*FactTypeUpdateOne) ClearFacts

func (ftuo *FactTypeUpdateOne) ClearFacts() *FactTypeUpdateOne

ClearFacts clears all "facts" edges to the Fact entity.

func (*FactTypeUpdateOne) ClearValidation

func (ftuo *FactTypeUpdateOne) ClearValidation() *FactTypeUpdateOne

ClearValidation clears the value of the "validation" field.

func (*FactTypeUpdateOne) Exec

func (ftuo *FactTypeUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*FactTypeUpdateOne) ExecX

func (ftuo *FactTypeUpdateOne) ExecX(ctx context.Context)

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

func (*FactTypeUpdateOne) Mutation

func (ftuo *FactTypeUpdateOne) Mutation() *FactTypeMutation

Mutation returns the FactTypeMutation object of the builder.

func (*FactTypeUpdateOne) RemoveFactIDs

func (ftuo *FactTypeUpdateOne) RemoveFactIDs(ids ...string) *FactTypeUpdateOne

RemoveFactIDs removes the "facts" edge to Fact entities by IDs.

func (*FactTypeUpdateOne) RemoveFacts

func (ftuo *FactTypeUpdateOne) RemoveFacts(f ...*Fact) *FactTypeUpdateOne

RemoveFacts removes "facts" edges to Fact entities.

func (*FactTypeUpdateOne) Save

func (ftuo *FactTypeUpdateOne) Save(ctx context.Context) (*FactType, error)

Save executes the query and returns the updated FactType entity.

func (*FactTypeUpdateOne) SaveX

func (ftuo *FactTypeUpdateOne) SaveX(ctx context.Context) *FactType

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

func (*FactTypeUpdateOne) SetBuiltIn

func (ftuo *FactTypeUpdateOne) SetBuiltIn(b bool) *FactTypeUpdateOne

SetBuiltIn sets the "built_in" field.

func (*FactTypeUpdateOne) SetDeletedAt

func (ftuo *FactTypeUpdateOne) SetDeletedAt(t time.Time) *FactTypeUpdateOne

SetDeletedAt sets the "deleted_at" field.

func (*FactTypeUpdateOne) SetNillableBuiltIn

func (ftuo *FactTypeUpdateOne) SetNillableBuiltIn(b *bool) *FactTypeUpdateOne

SetNillableBuiltIn sets the "built_in" field if the given value is not nil.

func (*FactTypeUpdateOne) SetNillableDeletedAt

func (ftuo *FactTypeUpdateOne) SetNillableDeletedAt(t *time.Time) *FactTypeUpdateOne

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*FactTypeUpdateOne) SetNillableValidation

func (ftuo *FactTypeUpdateOne) SetNillableValidation(s *string) *FactTypeUpdateOne

SetNillableValidation sets the "validation" field if the given value is not nil.

func (*FactTypeUpdateOne) SetSlug

func (ftuo *FactTypeUpdateOne) SetSlug(s string) *FactTypeUpdateOne

SetSlug sets the "slug" field.

func (*FactTypeUpdateOne) SetValidation

func (ftuo *FactTypeUpdateOne) SetValidation(s string) *FactTypeUpdateOne

SetValidation sets the "validation" field.

type FactTypes

type FactTypes []*FactType

FactTypes is a parsable slice of FactType.

type FactUpdate

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

FactUpdate is the builder for updating Fact entities.

func (*FactUpdate) ClearDeletedAt

func (fu *FactUpdate) ClearDeletedAt() *FactUpdate

ClearDeletedAt clears the value of the "deleted_at" field.

func (*FactUpdate) ClearFactType

func (fu *FactUpdate) ClearFactType() *FactUpdate

ClearFactType clears the "fact_type" edge to the FactType entity.

func (*FactUpdate) ClearScope

func (fu *FactUpdate) ClearScope() *FactUpdate

ClearScope clears the "scope" edge to the Scope entity.

func (*FactUpdate) Exec

func (fu *FactUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*FactUpdate) ExecX

func (fu *FactUpdate) ExecX(ctx context.Context)

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

func (*FactUpdate) Mutation

func (fu *FactUpdate) Mutation() *FactMutation

Mutation returns the FactMutation object of the builder.

func (*FactUpdate) Save

func (fu *FactUpdate) Save(ctx context.Context) (int, error)

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

func (*FactUpdate) SaveX

func (fu *FactUpdate) SaveX(ctx context.Context) int

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

func (*FactUpdate) SetDeletedAt

func (fu *FactUpdate) SetDeletedAt(t time.Time) *FactUpdate

SetDeletedAt sets the "deleted_at" field.

func (*FactUpdate) SetDomain

func (fu *FactUpdate) SetDomain(s string) *FactUpdate

SetDomain sets the "domain" field.

func (*FactUpdate) SetEncryptedValue

func (fu *FactUpdate) SetEncryptedValue(s string) *FactUpdate

SetEncryptedValue sets the "encrypted_value" field.

func (*FactUpdate) SetFactType

func (fu *FactUpdate) SetFactType(f *FactType) *FactUpdate

SetFactType sets the "fact_type" edge to the FactType entity.

func (*FactUpdate) SetFactTypeID

func (fu *FactUpdate) SetFactTypeID(id string) *FactUpdate

SetFactTypeID sets the "fact_type" edge to the FactType entity by ID.

func (*FactUpdate) SetHashedValue

func (fu *FactUpdate) SetHashedValue(s string) *FactUpdate

SetHashedValue sets the "hashed_value" field.

func (*FactUpdate) SetNillableDeletedAt

func (fu *FactUpdate) SetNillableDeletedAt(t *time.Time) *FactUpdate

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*FactUpdate) SetNillableFactTypeID

func (fu *FactUpdate) SetNillableFactTypeID(id *string) *FactUpdate

SetNillableFactTypeID sets the "fact_type" edge to the FactType entity by ID if the given value is not nil.

func (*FactUpdate) SetNillableScopeID

func (fu *FactUpdate) SetNillableScopeID(id *string) *FactUpdate

SetNillableScopeID sets the "scope" edge to the Scope entity by ID if the given value is not nil.

func (*FactUpdate) SetScope

func (fu *FactUpdate) SetScope(s *Scope) *FactUpdate

SetScope sets the "scope" edge to the Scope entity.

func (*FactUpdate) SetScopeID

func (fu *FactUpdate) SetScopeID(id string) *FactUpdate

SetScopeID sets the "scope" edge to the Scope entity by ID.

func (*FactUpdate) Where

func (fu *FactUpdate) Where(ps ...predicate.Fact) *FactUpdate

Where adds a new predicate for the FactUpdate builder.

type FactUpdateOne

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

FactUpdateOne is the builder for updating a single Fact entity.

func (*FactUpdateOne) ClearDeletedAt

func (fuo *FactUpdateOne) ClearDeletedAt() *FactUpdateOne

ClearDeletedAt clears the value of the "deleted_at" field.

func (*FactUpdateOne) ClearFactType

func (fuo *FactUpdateOne) ClearFactType() *FactUpdateOne

ClearFactType clears the "fact_type" edge to the FactType entity.

func (*FactUpdateOne) ClearScope

func (fuo *FactUpdateOne) ClearScope() *FactUpdateOne

ClearScope clears the "scope" edge to the Scope entity.

func (*FactUpdateOne) Exec

func (fuo *FactUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*FactUpdateOne) ExecX

func (fuo *FactUpdateOne) ExecX(ctx context.Context)

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

func (*FactUpdateOne) Mutation

func (fuo *FactUpdateOne) Mutation() *FactMutation

Mutation returns the FactMutation object of the builder.

func (*FactUpdateOne) Save

func (fuo *FactUpdateOne) Save(ctx context.Context) (*Fact, error)

Save executes the query and returns the updated Fact entity.

func (*FactUpdateOne) SaveX

func (fuo *FactUpdateOne) SaveX(ctx context.Context) *Fact

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

func (*FactUpdateOne) SetDeletedAt

func (fuo *FactUpdateOne) SetDeletedAt(t time.Time) *FactUpdateOne

SetDeletedAt sets the "deleted_at" field.

func (*FactUpdateOne) SetDomain

func (fuo *FactUpdateOne) SetDomain(s string) *FactUpdateOne

SetDomain sets the "domain" field.

func (*FactUpdateOne) SetEncryptedValue

func (fuo *FactUpdateOne) SetEncryptedValue(s string) *FactUpdateOne

SetEncryptedValue sets the "encrypted_value" field.

func (*FactUpdateOne) SetFactType

func (fuo *FactUpdateOne) SetFactType(f *FactType) *FactUpdateOne

SetFactType sets the "fact_type" edge to the FactType entity.

func (*FactUpdateOne) SetFactTypeID

func (fuo *FactUpdateOne) SetFactTypeID(id string) *FactUpdateOne

SetFactTypeID sets the "fact_type" edge to the FactType entity by ID.

func (*FactUpdateOne) SetHashedValue

func (fuo *FactUpdateOne) SetHashedValue(s string) *FactUpdateOne

SetHashedValue sets the "hashed_value" field.

func (*FactUpdateOne) SetNillableDeletedAt

func (fuo *FactUpdateOne) SetNillableDeletedAt(t *time.Time) *FactUpdateOne

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*FactUpdateOne) SetNillableFactTypeID

func (fuo *FactUpdateOne) SetNillableFactTypeID(id *string) *FactUpdateOne

SetNillableFactTypeID sets the "fact_type" edge to the FactType entity by ID if the given value is not nil.

func (*FactUpdateOne) SetNillableScopeID

func (fuo *FactUpdateOne) SetNillableScopeID(id *string) *FactUpdateOne

SetNillableScopeID sets the "scope" edge to the Scope entity by ID if the given value is not nil.

func (*FactUpdateOne) SetScope

func (fuo *FactUpdateOne) SetScope(s *Scope) *FactUpdateOne

SetScope sets the "scope" edge to the Scope entity.

func (*FactUpdateOne) SetScopeID

func (fuo *FactUpdateOne) SetScopeID(id string) *FactUpdateOne

SetScopeID sets the "scope" edge to the Scope entity by ID.

type Facts

type Facts []*Fact

Facts is a parsable slice of Fact.

type Grant

type Grant struct {

	// ID of the ent.
	ID string `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"`
	// DeletedAt holds the value of the "deleted_at" field.
	DeletedAt *time.Time `json:"deleted_at,omitempty"`
	// HashedGrantToken holds the value of the "hashed_grant_token" field.
	HashedGrantToken string `json:"-"`
	// Domain holds the value of the "domain" field.
	Domain string `json:"domain,omitempty"`
	// Version holds the value of the "version" field.
	Version string `json:"version,omitempty"`
	// AllowedHTTPMethods holds the value of the "allowed_http_methods" field.
	AllowedHTTPMethods string `json:"allowed_http_methods,omitempty"`
	// Paths holds the value of the "paths" field.
	Paths []string `json:"paths,omitempty"`
	// contains filtered or unexported fields
}

Grant is the model entity for the Grant schema.

func (*Grant) String

func (gr *Grant) String() string

String implements the fmt.Stringer.

func (*Grant) Unwrap

func (gr *Grant) Unwrap() *Grant

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

func (gr *Grant) Update() *GrantUpdateOne

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

type GrantClient

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

GrantClient is a client for the Grant schema.

func NewGrantClient

func NewGrantClient(c config) *GrantClient

NewGrantClient returns a client for the Grant from the given config.

func (*GrantClient) Create

func (c *GrantClient) Create() *GrantCreate

Create returns a create builder for Grant.

func (*GrantClient) CreateBulk

func (c *GrantClient) CreateBulk(builders ...*GrantCreate) *GrantCreateBulk

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

func (*GrantClient) Delete

func (c *GrantClient) Delete() *GrantDelete

Delete returns a delete builder for Grant.

func (*GrantClient) DeleteOne

func (c *GrantClient) DeleteOne(gr *Grant) *GrantDeleteOne

DeleteOne returns a delete builder for the given entity.

func (*GrantClient) DeleteOneID

func (c *GrantClient) DeleteOneID(id string) *GrantDeleteOne

DeleteOneID returns a delete builder for the given id.

func (*GrantClient) Get

func (c *GrantClient) Get(ctx context.Context, id string) (*Grant, error)

Get returns a Grant entity by its id.

func (*GrantClient) GetX

func (c *GrantClient) GetX(ctx context.Context, id string) *Grant

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

func (*GrantClient) Hooks

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

Hooks returns the client hooks.

func (*GrantClient) Query

func (c *GrantClient) Query() *GrantQuery

Query returns a query builder for Grant.

func (*GrantClient) Update

func (c *GrantClient) Update() *GrantUpdate

Update returns an update builder for Grant.

func (*GrantClient) UpdateOne

func (c *GrantClient) UpdateOne(gr *Grant) *GrantUpdateOne

UpdateOne returns an update builder for the given entity.

func (*GrantClient) UpdateOneID

func (c *GrantClient) UpdateOneID(id string) *GrantUpdateOne

UpdateOneID returns an update builder for the given id.

func (*GrantClient) Use

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

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

type GrantCreate

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

GrantCreate is the builder for creating a Grant entity.

func (*GrantCreate) Mutation

func (gc *GrantCreate) Mutation() *GrantMutation

Mutation returns the GrantMutation object of the builder.

func (*GrantCreate) Save

func (gc *GrantCreate) Save(ctx context.Context) (*Grant, error)

Save creates the Grant in the database.

func (*GrantCreate) SaveX

func (gc *GrantCreate) SaveX(ctx context.Context) *Grant

SaveX calls Save and panics if Save returns an error.

func (*GrantCreate) SetAllowedHTTPMethods

func (gc *GrantCreate) SetAllowedHTTPMethods(s string) *GrantCreate

SetAllowedHTTPMethods sets the "allowed_http_methods" field.

func (*GrantCreate) SetCreatedAt

func (gc *GrantCreate) SetCreatedAt(t time.Time) *GrantCreate

SetCreatedAt sets the "created_at" field.

func (*GrantCreate) SetDeletedAt

func (gc *GrantCreate) SetDeletedAt(t time.Time) *GrantCreate

SetDeletedAt sets the "deleted_at" field.

func (*GrantCreate) SetDomain

func (gc *GrantCreate) SetDomain(s string) *GrantCreate

SetDomain sets the "domain" field.

func (*GrantCreate) SetHashedGrantToken

func (gc *GrantCreate) SetHashedGrantToken(s string) *GrantCreate

SetHashedGrantToken sets the "hashed_grant_token" field.

func (*GrantCreate) SetID

func (gc *GrantCreate) SetID(s string) *GrantCreate

SetID sets the "id" field.

func (*GrantCreate) SetNillableCreatedAt

func (gc *GrantCreate) SetNillableCreatedAt(t *time.Time) *GrantCreate

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

func (*GrantCreate) SetNillableDeletedAt

func (gc *GrantCreate) SetNillableDeletedAt(t *time.Time) *GrantCreate

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*GrantCreate) SetNillableID

func (gc *GrantCreate) SetNillableID(s *string) *GrantCreate

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

func (*GrantCreate) SetNillableUpdatedAt

func (gc *GrantCreate) SetNillableUpdatedAt(t *time.Time) *GrantCreate

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

func (*GrantCreate) SetPaths

func (gc *GrantCreate) SetPaths(s []string) *GrantCreate

SetPaths sets the "paths" field.

func (*GrantCreate) SetUpdatedAt

func (gc *GrantCreate) SetUpdatedAt(t time.Time) *GrantCreate

SetUpdatedAt sets the "updated_at" field.

func (*GrantCreate) SetVersion

func (gc *GrantCreate) SetVersion(s string) *GrantCreate

SetVersion sets the "version" field.

type GrantCreateBulk

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

GrantCreateBulk is the builder for creating many Grant entities in bulk.

func (*GrantCreateBulk) Save

func (gcb *GrantCreateBulk) Save(ctx context.Context) ([]*Grant, error)

Save creates the Grant entities in the database.

func (*GrantCreateBulk) SaveX

func (gcb *GrantCreateBulk) SaveX(ctx context.Context) []*Grant

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

type GrantDelete

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

GrantDelete is the builder for deleting a Grant entity.

func (*GrantDelete) Exec

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

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

func (*GrantDelete) ExecX

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

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

func (*GrantDelete) Where

func (gd *GrantDelete) Where(ps ...predicate.Grant) *GrantDelete

Where adds a new predicate to the GrantDelete builder.

type GrantDeleteOne

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

GrantDeleteOne is the builder for deleting a single Grant entity.

func (*GrantDeleteOne) Exec

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

Exec executes the deletion query.

func (*GrantDeleteOne) ExecX

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

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

type GrantFilter

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

GrantFilter provides a generic filtering capability at runtime for GrantQuery.

func (*GrantFilter) Where

func (f *GrantFilter) Where(p entql.P)

Where applies the entql predicate on the query filter.

func (*GrantFilter) WhereAllowedHTTPMethods

func (f *GrantFilter) WhereAllowedHTTPMethods(p entql.StringP)

WhereAllowedHTTPMethods applies the entql string predicate on the allowed_http_methods field.

func (*GrantFilter) WhereCreatedAt

func (f *GrantFilter) WhereCreatedAt(p entql.TimeP)

WhereCreatedAt applies the entql time.Time predicate on the created_at field.

func (*GrantFilter) WhereDeletedAt

func (f *GrantFilter) WhereDeletedAt(p entql.TimeP)

WhereDeletedAt applies the entql time.Time predicate on the deleted_at field.

func (*GrantFilter) WhereDomain

func (f *GrantFilter) WhereDomain(p entql.StringP)

WhereDomain applies the entql string predicate on the domain field.

func (*GrantFilter) WhereHashedGrantToken

func (f *GrantFilter) WhereHashedGrantToken(p entql.StringP)

WhereHashedGrantToken applies the entql string predicate on the hashed_grant_token field.

func (*GrantFilter) WhereID

func (f *GrantFilter) WhereID(p entql.StringP)

WhereID applies the entql string predicate on the id field.

func (*GrantFilter) WherePaths

func (f *GrantFilter) WherePaths(p entql.BytesP)

WherePaths applies the entql json.RawMessage predicate on the paths field.

func (*GrantFilter) WhereUpdatedAt

func (f *GrantFilter) WhereUpdatedAt(p entql.TimeP)

WhereUpdatedAt applies the entql time.Time predicate on the updated_at field.

func (*GrantFilter) WhereVersion

func (f *GrantFilter) WhereVersion(p entql.StringP)

WhereVersion applies the entql string predicate on the version field.

type GrantGroupBy

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

GrantGroupBy is the group-by builder for Grant entities.

func (*GrantGroupBy) Aggregate

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

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

func (*GrantGroupBy) Bool

func (ggb *GrantGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a group-by query. It is only allowed when executing a group-by query with one field.

func (*GrantGroupBy) BoolX

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

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

func (*GrantGroupBy) Bools

func (ggb *GrantGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from group-by. It is only allowed when executing a group-by query with one field.

func (*GrantGroupBy) BoolsX

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

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

func (*GrantGroupBy) Float64

func (ggb *GrantGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a group-by query. It is only allowed when executing a group-by query with one field.

func (*GrantGroupBy) Float64X

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

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

func (*GrantGroupBy) Float64s

func (ggb *GrantGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from group-by. It is only allowed when executing a group-by query with one field.

func (*GrantGroupBy) Float64sX

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

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

func (*GrantGroupBy) Int

func (ggb *GrantGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a group-by query. It is only allowed when executing a group-by query with one field.

func (*GrantGroupBy) IntX

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

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

func (*GrantGroupBy) Ints

func (ggb *GrantGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from group-by. It is only allowed when executing a group-by query with one field.

func (*GrantGroupBy) IntsX

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

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

func (*GrantGroupBy) Scan

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

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

func (*GrantGroupBy) ScanX

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

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

func (*GrantGroupBy) String

func (ggb *GrantGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a group-by query. It is only allowed when executing a group-by query with one field.

func (*GrantGroupBy) StringX

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

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

func (*GrantGroupBy) Strings

func (ggb *GrantGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from group-by. It is only allowed when executing a group-by query with one field.

func (*GrantGroupBy) StringsX

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

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

type GrantMutation

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

GrantMutation represents an operation that mutates the Grant nodes in the graph.

func (*GrantMutation) AddField

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

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

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

func (*GrantMutation) AddedField

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

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

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

func (*GrantMutation) AddedIDs

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

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

func (*GrantMutation) AllowedHTTPMethods

func (m *GrantMutation) AllowedHTTPMethods() (r string, exists bool)

AllowedHTTPMethods returns the value of the "allowed_http_methods" field in the mutation.

func (*GrantMutation) ClearDeletedAt

func (m *GrantMutation) ClearDeletedAt()

ClearDeletedAt clears the value of the "deleted_at" field.

func (*GrantMutation) ClearEdge

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

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

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

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

func (*GrantMutation) ClearedFields

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

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

func (GrantMutation) Client

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

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

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

func (*GrantMutation) DeletedAt

func (m *GrantMutation) DeletedAt() (r time.Time, exists bool)

DeletedAt returns the value of the "deleted_at" field in the mutation.

func (*GrantMutation) DeletedAtCleared

func (m *GrantMutation) DeletedAtCleared() bool

DeletedAtCleared returns if the "deleted_at" field was cleared in this mutation.

func (*GrantMutation) Domain

func (m *GrantMutation) Domain() (r string, exists bool)

Domain returns the value of the "domain" field in the mutation.

func (*GrantMutation) EdgeCleared

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

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

func (*GrantMutation) Field

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

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

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

func (*GrantMutation) Fields

func (m *GrantMutation) 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 (*GrantMutation) Filter

func (m *GrantMutation) Filter() *GrantFilter

Filter returns an entql.Where implementation to apply filters on the GrantMutation builder.

func (*GrantMutation) HashedGrantToken

func (m *GrantMutation) HashedGrantToken() (r string, exists bool)

HashedGrantToken returns the value of the "hashed_grant_token" field in the mutation.

func (*GrantMutation) ID

func (m *GrantMutation) ID() (id string, exists bool)

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder.

func (*GrantMutation) OldAllowedHTTPMethods

func (m *GrantMutation) OldAllowedHTTPMethods(ctx context.Context) (v string, err error)

OldAllowedHTTPMethods returns the old "allowed_http_methods" field's value of the Grant entity. If the Grant 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 (*GrantMutation) OldCreatedAt

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

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

func (m *GrantMutation) OldDeletedAt(ctx context.Context) (v *time.Time, err error)

OldDeletedAt returns the old "deleted_at" field's value of the Grant entity. If the Grant 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 (*GrantMutation) OldDomain

func (m *GrantMutation) OldDomain(ctx context.Context) (v string, err error)

OldDomain returns the old "domain" field's value of the Grant entity. If the Grant 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 (*GrantMutation) OldField

func (m *GrantMutation) 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 (*GrantMutation) OldHashedGrantToken

func (m *GrantMutation) OldHashedGrantToken(ctx context.Context) (v string, err error)

OldHashedGrantToken returns the old "hashed_grant_token" field's value of the Grant entity. If the Grant 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 (*GrantMutation) OldPaths

func (m *GrantMutation) OldPaths(ctx context.Context) (v []string, err error)

OldPaths returns the old "paths" field's value of the Grant entity. If the Grant 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 (*GrantMutation) OldUpdatedAt

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

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

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

OldVersion returns the old "version" field's value of the Grant entity. If the Grant 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 (*GrantMutation) Op

func (m *GrantMutation) Op() Op

Op returns the operation name.

func (*GrantMutation) Paths

func (m *GrantMutation) Paths() (r []string, exists bool)

Paths returns the value of the "paths" field in the mutation.

func (*GrantMutation) RemovedEdges

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

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

func (*GrantMutation) RemovedIDs

func (m *GrantMutation) 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 (*GrantMutation) ResetAllowedHTTPMethods

func (m *GrantMutation) ResetAllowedHTTPMethods()

ResetAllowedHTTPMethods resets all changes to the "allowed_http_methods" field.

func (*GrantMutation) ResetCreatedAt

func (m *GrantMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*GrantMutation) ResetDeletedAt

func (m *GrantMutation) ResetDeletedAt()

ResetDeletedAt resets all changes to the "deleted_at" field.

func (*GrantMutation) ResetDomain

func (m *GrantMutation) ResetDomain()

ResetDomain resets all changes to the "domain" field.

func (*GrantMutation) ResetEdge

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

func (m *GrantMutation) 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 (*GrantMutation) ResetHashedGrantToken

func (m *GrantMutation) ResetHashedGrantToken()

ResetHashedGrantToken resets all changes to the "hashed_grant_token" field.

func (*GrantMutation) ResetPaths

func (m *GrantMutation) ResetPaths()

ResetPaths resets all changes to the "paths" field.

func (*GrantMutation) ResetUpdatedAt

func (m *GrantMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*GrantMutation) ResetVersion

func (m *GrantMutation) ResetVersion()

ResetVersion resets all changes to the "version" field.

func (*GrantMutation) SetAllowedHTTPMethods

func (m *GrantMutation) SetAllowedHTTPMethods(s string)

SetAllowedHTTPMethods sets the "allowed_http_methods" field.

func (*GrantMutation) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*GrantMutation) SetDeletedAt

func (m *GrantMutation) SetDeletedAt(t time.Time)

SetDeletedAt sets the "deleted_at" field.

func (*GrantMutation) SetDomain

func (m *GrantMutation) SetDomain(s string)

SetDomain sets the "domain" field.

func (*GrantMutation) SetField

func (m *GrantMutation) 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 (*GrantMutation) SetHashedGrantToken

func (m *GrantMutation) SetHashedGrantToken(s string)

SetHashedGrantToken sets the "hashed_grant_token" field.

func (*GrantMutation) SetID

func (m *GrantMutation) SetID(id string)

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

func (*GrantMutation) SetPaths

func (m *GrantMutation) SetPaths(s []string)

SetPaths sets the "paths" field.

func (*GrantMutation) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" field.

func (*GrantMutation) SetVersion

func (m *GrantMutation) SetVersion(s string)

SetVersion sets the "version" field.

func (GrantMutation) Tx

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

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

func (*GrantMutation) Type

func (m *GrantMutation) Type() string

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

func (*GrantMutation) UpdatedAt

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

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

func (*GrantMutation) Version

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

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

type GrantQuery

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

GrantQuery is the builder for querying Grant entities.

func (*GrantQuery) All

func (gq *GrantQuery) All(ctx context.Context) ([]*Grant, error)

All executes the query and returns a list of Grants.

func (*GrantQuery) AllX

func (gq *GrantQuery) AllX(ctx context.Context) []*Grant

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

func (*GrantQuery) Clone

func (gq *GrantQuery) Clone() *GrantQuery

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

func (*GrantQuery) Count

func (gq *GrantQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*GrantQuery) CountX

func (gq *GrantQuery) CountX(ctx context.Context) int

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

func (*GrantQuery) Exist

func (gq *GrantQuery) Exist(ctx context.Context) (bool, error)

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

func (*GrantQuery) ExistX

func (gq *GrantQuery) ExistX(ctx context.Context) bool

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

func (*GrantQuery) Filter

func (gq *GrantQuery) Filter() *GrantFilter

Filter returns a Filter implementation to apply filters on the GrantQuery builder.

func (*GrantQuery) First

func (gq *GrantQuery) First(ctx context.Context) (*Grant, error)

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

func (*GrantQuery) FirstID

func (gq *GrantQuery) FirstID(ctx context.Context) (id string, err error)

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

func (*GrantQuery) FirstIDX

func (gq *GrantQuery) FirstIDX(ctx context.Context) string

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

func (*GrantQuery) FirstX

func (gq *GrantQuery) FirstX(ctx context.Context) *Grant

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

func (*GrantQuery) GroupBy

func (gq *GrantQuery) GroupBy(field string, fields ...string) *GrantGroupBy

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

func (*GrantQuery) IDs

func (gq *GrantQuery) IDs(ctx context.Context) ([]string, error)

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

func (*GrantQuery) IDsX

func (gq *GrantQuery) IDsX(ctx context.Context) []string

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

func (*GrantQuery) Limit

func (gq *GrantQuery) Limit(limit int) *GrantQuery

Limit adds a limit step to the query.

func (*GrantQuery) Offset

func (gq *GrantQuery) Offset(offset int) *GrantQuery

Offset adds an offset step to the query.

func (*GrantQuery) Only

func (gq *GrantQuery) Only(ctx context.Context) (*Grant, error)

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

func (*GrantQuery) OnlyID

func (gq *GrantQuery) OnlyID(ctx context.Context) (id string, err error)

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

func (*GrantQuery) OnlyIDX

func (gq *GrantQuery) OnlyIDX(ctx context.Context) string

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

func (*GrantQuery) OnlyX

func (gq *GrantQuery) OnlyX(ctx context.Context) *Grant

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

func (*GrantQuery) Order

func (gq *GrantQuery) Order(o ...OrderFunc) *GrantQuery

Order adds an order step to the query.

func (*GrantQuery) Select

func (gq *GrantQuery) Select(field string, fields ...string) *GrantSelect

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

func (*GrantQuery) Where

func (gq *GrantQuery) Where(ps ...predicate.Grant) *GrantQuery

Where adds a new predicate for the GrantQuery builder.

type GrantSelect

type GrantSelect struct {
	*GrantQuery
	// contains filtered or unexported fields
}

GrantSelect is the builder for selecting fields of Grant entities.

func (*GrantSelect) Bool

func (gs *GrantSelect) Bool(ctx context.Context) (_ bool, err error)

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

func (*GrantSelect) BoolX

func (gs *GrantSelect) BoolX(ctx context.Context) bool

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

func (*GrantSelect) Bools

func (gs *GrantSelect) Bools(ctx context.Context) ([]bool, error)

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

func (*GrantSelect) BoolsX

func (gs *GrantSelect) BoolsX(ctx context.Context) []bool

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

func (*GrantSelect) Float64

func (gs *GrantSelect) Float64(ctx context.Context) (_ float64, err error)

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

func (*GrantSelect) Float64X

func (gs *GrantSelect) Float64X(ctx context.Context) float64

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

func (*GrantSelect) Float64s

func (gs *GrantSelect) Float64s(ctx context.Context) ([]float64, error)

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

func (*GrantSelect) Float64sX

func (gs *GrantSelect) Float64sX(ctx context.Context) []float64

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

func (*GrantSelect) Int

func (gs *GrantSelect) Int(ctx context.Context) (_ int, err error)

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

func (*GrantSelect) IntX

func (gs *GrantSelect) IntX(ctx context.Context) int

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

func (*GrantSelect) Ints

func (gs *GrantSelect) Ints(ctx context.Context) ([]int, error)

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

func (*GrantSelect) IntsX

func (gs *GrantSelect) IntsX(ctx context.Context) []int

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

func (*GrantSelect) Scan

func (gs *GrantSelect) Scan(ctx context.Context, v interface{}) error

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

func (*GrantSelect) ScanX

func (gs *GrantSelect) ScanX(ctx context.Context, v interface{})

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

func (*GrantSelect) String

func (gs *GrantSelect) String(ctx context.Context) (_ string, err error)

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

func (*GrantSelect) StringX

func (gs *GrantSelect) StringX(ctx context.Context) string

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

func (*GrantSelect) Strings

func (gs *GrantSelect) Strings(ctx context.Context) ([]string, error)

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

func (*GrantSelect) StringsX

func (gs *GrantSelect) StringsX(ctx context.Context) []string

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

type GrantUpdate

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

GrantUpdate is the builder for updating Grant entities.

func (*GrantUpdate) ClearDeletedAt

func (gu *GrantUpdate) ClearDeletedAt() *GrantUpdate

ClearDeletedAt clears the value of the "deleted_at" field.

func (*GrantUpdate) Exec

func (gu *GrantUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*GrantUpdate) ExecX

func (gu *GrantUpdate) ExecX(ctx context.Context)

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

func (*GrantUpdate) Mutation

func (gu *GrantUpdate) Mutation() *GrantMutation

Mutation returns the GrantMutation object of the builder.

func (*GrantUpdate) Save

func (gu *GrantUpdate) Save(ctx context.Context) (int, error)

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

func (*GrantUpdate) SaveX

func (gu *GrantUpdate) SaveX(ctx context.Context) int

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

func (*GrantUpdate) SetAllowedHTTPMethods

func (gu *GrantUpdate) SetAllowedHTTPMethods(s string) *GrantUpdate

SetAllowedHTTPMethods sets the "allowed_http_methods" field.

func (*GrantUpdate) SetDeletedAt

func (gu *GrantUpdate) SetDeletedAt(t time.Time) *GrantUpdate

SetDeletedAt sets the "deleted_at" field.

func (*GrantUpdate) SetDomain

func (gu *GrantUpdate) SetDomain(s string) *GrantUpdate

SetDomain sets the "domain" field.

func (*GrantUpdate) SetHashedGrantToken

func (gu *GrantUpdate) SetHashedGrantToken(s string) *GrantUpdate

SetHashedGrantToken sets the "hashed_grant_token" field.

func (*GrantUpdate) SetNillableDeletedAt

func (gu *GrantUpdate) SetNillableDeletedAt(t *time.Time) *GrantUpdate

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*GrantUpdate) SetPaths

func (gu *GrantUpdate) SetPaths(s []string) *GrantUpdate

SetPaths sets the "paths" field.

func (*GrantUpdate) SetVersion

func (gu *GrantUpdate) SetVersion(s string) *GrantUpdate

SetVersion sets the "version" field.

func (*GrantUpdate) Where

func (gu *GrantUpdate) Where(ps ...predicate.Grant) *GrantUpdate

Where adds a new predicate for the GrantUpdate builder.

type GrantUpdateOne

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

GrantUpdateOne is the builder for updating a single Grant entity.

func (*GrantUpdateOne) ClearDeletedAt

func (guo *GrantUpdateOne) ClearDeletedAt() *GrantUpdateOne

ClearDeletedAt clears the value of the "deleted_at" field.

func (*GrantUpdateOne) Exec

func (guo *GrantUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*GrantUpdateOne) ExecX

func (guo *GrantUpdateOne) ExecX(ctx context.Context)

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

func (*GrantUpdateOne) Mutation

func (guo *GrantUpdateOne) Mutation() *GrantMutation

Mutation returns the GrantMutation object of the builder.

func (*GrantUpdateOne) Save

func (guo *GrantUpdateOne) Save(ctx context.Context) (*Grant, error)

Save executes the query and returns the updated Grant entity.

func (*GrantUpdateOne) SaveX

func (guo *GrantUpdateOne) SaveX(ctx context.Context) *Grant

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

func (*GrantUpdateOne) SetAllowedHTTPMethods

func (guo *GrantUpdateOne) SetAllowedHTTPMethods(s string) *GrantUpdateOne

SetAllowedHTTPMethods sets the "allowed_http_methods" field.

func (*GrantUpdateOne) SetDeletedAt

func (guo *GrantUpdateOne) SetDeletedAt(t time.Time) *GrantUpdateOne

SetDeletedAt sets the "deleted_at" field.

func (*GrantUpdateOne) SetDomain

func (guo *GrantUpdateOne) SetDomain(s string) *GrantUpdateOne

SetDomain sets the "domain" field.

func (*GrantUpdateOne) SetHashedGrantToken

func (guo *GrantUpdateOne) SetHashedGrantToken(s string) *GrantUpdateOne

SetHashedGrantToken sets the "hashed_grant_token" field.

func (*GrantUpdateOne) SetNillableDeletedAt

func (guo *GrantUpdateOne) SetNillableDeletedAt(t *time.Time) *GrantUpdateOne

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*GrantUpdateOne) SetPaths

func (guo *GrantUpdateOne) SetPaths(s []string) *GrantUpdateOne

SetPaths sets the "paths" field.

func (*GrantUpdateOne) SetVersion

func (guo *GrantUpdateOne) SetVersion(s string) *GrantUpdateOne

SetVersion sets the "version" field.

type Grants

type Grants []*Grant

Grants is a parsable slice of Grant.

type Hook

type Hook = ent.Hook

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

type MutateFunc

type MutateFunc = ent.MutateFunc

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

type Mutation

type Mutation = ent.Mutation

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

type Mutator

type Mutator = ent.Mutator

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

type NotFoundError

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

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

func (*NotFoundError) Error

func (e *NotFoundError) Error() string

Error implements the error interface.

type NotLoadedError

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

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

func (*NotLoadedError) Error

func (e *NotLoadedError) Error() string

Error implements the error interface.

type NotSingularError

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

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

func (*NotSingularError) Error

func (e *NotSingularError) Error() string

Error implements the error interface.

type Op

type Op = ent.Op

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

type Option

type Option func(*config)

Option function to configure the client.

func Debug

func Debug() Option

Debug enables debug logging on the ent.Driver.

func Driver

func Driver(driver dialect.Driver) Option

Driver configures the client driver.

func Log

func Log(fn func(...interface{})) Option

Log sets the logging function for debug mode.

type OrderFunc

type OrderFunc func(*sql.Selector, func(string) bool)

OrderFunc applies an ordering on the sql selector.

func Asc

func Asc(fields ...string) OrderFunc

Asc applies the given fields in ASC order.

func Desc

func Desc(fields ...string) OrderFunc

Desc applies the given fields in DESC order.

type Policy

type Policy = ent.Policy

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

type Query

type Query = ent.Query

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

type RollbackFunc

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

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

func (RollbackFunc) Rollback

func (f RollbackFunc) Rollback(ctx context.Context, tx *Tx) error

Rollback calls f(ctx, m).

type RollbackHook

type RollbackHook func(Rollbacker) Rollbacker

RollbackHook defines the "rollback middleware". A function that gets a Rollbacker and returns a Rollbacker. For example:

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

type Rollbacker

type Rollbacker interface {
	Rollback(context.Context, *Tx) error
}

Rollbacker is the interface that wraps the Rollbacker method.

type Scope

type Scope struct {

	// ID of the ent.
	ID string `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"`
	// DeletedAt holds the value of the "deleted_at" field.
	DeletedAt *time.Time `json:"deleted_at,omitempty"`
	// CustomID holds the value of the "custom_id" field.
	CustomID string `json:"custom_id,omitempty"`
	// Nonce holds the value of the "nonce" field.
	Nonce string `json:"-"`
	// 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 ScopeQuery when eager-loading is set.
	Edges ScopeEdges `json:"edges"`
	// contains filtered or unexported fields
}

Scope is the model entity for the Scope schema.

func (*Scope) QueryFacts

func (s *Scope) QueryFacts() *FactQuery

QueryFacts queries the "facts" edge of the Scope entity.

func (*Scope) String

func (s *Scope) String() string

String implements the fmt.Stringer.

func (*Scope) Unwrap

func (s *Scope) Unwrap() *Scope

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

func (s *Scope) Update() *ScopeUpdateOne

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

type ScopeClient

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

ScopeClient is a client for the Scope schema.

func NewScopeClient

func NewScopeClient(c config) *ScopeClient

NewScopeClient returns a client for the Scope from the given config.

func (*ScopeClient) Create

func (c *ScopeClient) Create() *ScopeCreate

Create returns a create builder for Scope.

func (*ScopeClient) CreateBulk

func (c *ScopeClient) CreateBulk(builders ...*ScopeCreate) *ScopeCreateBulk

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

func (*ScopeClient) Delete

func (c *ScopeClient) Delete() *ScopeDelete

Delete returns a delete builder for Scope.

func (*ScopeClient) DeleteOne

func (c *ScopeClient) DeleteOne(s *Scope) *ScopeDeleteOne

DeleteOne returns a delete builder for the given entity.

func (*ScopeClient) DeleteOneID

func (c *ScopeClient) DeleteOneID(id string) *ScopeDeleteOne

DeleteOneID returns a delete builder for the given id.

func (*ScopeClient) Get

func (c *ScopeClient) Get(ctx context.Context, id string) (*Scope, error)

Get returns a Scope entity by its id.

func (*ScopeClient) GetX

func (c *ScopeClient) GetX(ctx context.Context, id string) *Scope

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

func (*ScopeClient) Hooks

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

Hooks returns the client hooks.

func (*ScopeClient) Query

func (c *ScopeClient) Query() *ScopeQuery

Query returns a query builder for Scope.

func (*ScopeClient) QueryFacts

func (c *ScopeClient) QueryFacts(s *Scope) *FactQuery

QueryFacts queries the facts edge of a Scope.

func (*ScopeClient) Update

func (c *ScopeClient) Update() *ScopeUpdate

Update returns an update builder for Scope.

func (*ScopeClient) UpdateOne

func (c *ScopeClient) UpdateOne(s *Scope) *ScopeUpdateOne

UpdateOne returns an update builder for the given entity.

func (*ScopeClient) UpdateOneID

func (c *ScopeClient) UpdateOneID(id string) *ScopeUpdateOne

UpdateOneID returns an update builder for the given id.

func (*ScopeClient) Use

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

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

type ScopeCreate

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

ScopeCreate is the builder for creating a Scope entity.

func (*ScopeCreate) AddFactIDs

func (sc *ScopeCreate) AddFactIDs(ids ...string) *ScopeCreate

AddFactIDs adds the "facts" edge to the Fact entity by IDs.

func (*ScopeCreate) AddFacts

func (sc *ScopeCreate) AddFacts(f ...*Fact) *ScopeCreate

AddFacts adds the "facts" edges to the Fact entity.

func (*ScopeCreate) Mutation

func (sc *ScopeCreate) Mutation() *ScopeMutation

Mutation returns the ScopeMutation object of the builder.

func (*ScopeCreate) Save

func (sc *ScopeCreate) Save(ctx context.Context) (*Scope, error)

Save creates the Scope in the database.

func (*ScopeCreate) SaveX

func (sc *ScopeCreate) SaveX(ctx context.Context) *Scope

SaveX calls Save and panics if Save returns an error.

func (*ScopeCreate) SetCreatedAt

func (sc *ScopeCreate) SetCreatedAt(t time.Time) *ScopeCreate

SetCreatedAt sets the "created_at" field.

func (*ScopeCreate) SetCustomID

func (sc *ScopeCreate) SetCustomID(s string) *ScopeCreate

SetCustomID sets the "custom_id" field.

func (*ScopeCreate) SetDeletedAt

func (sc *ScopeCreate) SetDeletedAt(t time.Time) *ScopeCreate

SetDeletedAt sets the "deleted_at" field.

func (*ScopeCreate) SetDomain

func (sc *ScopeCreate) SetDomain(s string) *ScopeCreate

SetDomain sets the "domain" field.

func (*ScopeCreate) SetID

func (sc *ScopeCreate) SetID(s string) *ScopeCreate

SetID sets the "id" field.

func (*ScopeCreate) SetNillableCreatedAt

func (sc *ScopeCreate) SetNillableCreatedAt(t *time.Time) *ScopeCreate

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

func (*ScopeCreate) SetNillableDeletedAt

func (sc *ScopeCreate) SetNillableDeletedAt(t *time.Time) *ScopeCreate

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*ScopeCreate) SetNillableID

func (sc *ScopeCreate) SetNillableID(s *string) *ScopeCreate

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

func (*ScopeCreate) SetNillableNonce

func (sc *ScopeCreate) SetNillableNonce(s *string) *ScopeCreate

SetNillableNonce sets the "nonce" field if the given value is not nil.

func (*ScopeCreate) SetNillableUpdatedAt

func (sc *ScopeCreate) SetNillableUpdatedAt(t *time.Time) *ScopeCreate

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

func (*ScopeCreate) SetNonce

func (sc *ScopeCreate) SetNonce(s string) *ScopeCreate

SetNonce sets the "nonce" field.

func (*ScopeCreate) SetUpdatedAt

func (sc *ScopeCreate) SetUpdatedAt(t time.Time) *ScopeCreate

SetUpdatedAt sets the "updated_at" field.

type ScopeCreateBulk

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

ScopeCreateBulk is the builder for creating many Scope entities in bulk.

func (*ScopeCreateBulk) Save

func (scb *ScopeCreateBulk) Save(ctx context.Context) ([]*Scope, error)

Save creates the Scope entities in the database.

func (*ScopeCreateBulk) SaveX

func (scb *ScopeCreateBulk) SaveX(ctx context.Context) []*Scope

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

type ScopeDelete

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

ScopeDelete is the builder for deleting a Scope entity.

func (*ScopeDelete) Exec

func (sd *ScopeDelete) Exec(ctx context.Context) (int, error)

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

func (*ScopeDelete) ExecX

func (sd *ScopeDelete) ExecX(ctx context.Context) int

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

func (*ScopeDelete) Where

func (sd *ScopeDelete) Where(ps ...predicate.Scope) *ScopeDelete

Where adds a new predicate to the ScopeDelete builder.

type ScopeDeleteOne

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

ScopeDeleteOne is the builder for deleting a single Scope entity.

func (*ScopeDeleteOne) Exec

func (sdo *ScopeDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*ScopeDeleteOne) ExecX

func (sdo *ScopeDeleteOne) ExecX(ctx context.Context)

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

type ScopeEdges

type ScopeEdges struct {
	// Facts holds the value of the facts edge.
	Facts []*Fact `json:"facts,omitempty"`
	// contains filtered or unexported fields
}

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

func (ScopeEdges) FactsOrErr

func (e ScopeEdges) FactsOrErr() ([]*Fact, error)

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

type ScopeFilter

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

ScopeFilter provides a generic filtering capability at runtime for ScopeQuery.

func (*ScopeFilter) Where

func (f *ScopeFilter) Where(p entql.P)

Where applies the entql predicate on the query filter.

func (*ScopeFilter) WhereCreatedAt

func (f *ScopeFilter) WhereCreatedAt(p entql.TimeP)

WhereCreatedAt applies the entql time.Time predicate on the created_at field.

func (*ScopeFilter) WhereCustomID

func (f *ScopeFilter) WhereCustomID(p entql.StringP)

WhereCustomID applies the entql string predicate on the custom_id field.

func (*ScopeFilter) WhereDeletedAt

func (f *ScopeFilter) WhereDeletedAt(p entql.TimeP)

WhereDeletedAt applies the entql time.Time predicate on the deleted_at field.

func (*ScopeFilter) WhereDomain

func (f *ScopeFilter) WhereDomain(p entql.StringP)

WhereDomain applies the entql string predicate on the domain field.

func (*ScopeFilter) WhereHasFacts

func (f *ScopeFilter) WhereHasFacts()

WhereHasFacts applies a predicate to check if query has an edge facts.

func (*ScopeFilter) WhereHasFactsWith

func (f *ScopeFilter) WhereHasFactsWith(preds ...predicate.Fact)

WhereHasFactsWith applies a predicate to check if query has an edge facts with a given conditions (other predicates).

func (*ScopeFilter) WhereID

func (f *ScopeFilter) WhereID(p entql.StringP)

WhereID applies the entql string predicate on the id field.

func (*ScopeFilter) WhereNonce

func (f *ScopeFilter) WhereNonce(p entql.StringP)

WhereNonce applies the entql string predicate on the nonce field.

func (*ScopeFilter) WhereUpdatedAt

func (f *ScopeFilter) WhereUpdatedAt(p entql.TimeP)

WhereUpdatedAt applies the entql time.Time predicate on the updated_at field.

type ScopeGroupBy

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

ScopeGroupBy is the group-by builder for Scope entities.

func (*ScopeGroupBy) Aggregate

func (sgb *ScopeGroupBy) Aggregate(fns ...AggregateFunc) *ScopeGroupBy

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

func (*ScopeGroupBy) Bool

func (sgb *ScopeGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a group-by query. It is only allowed when executing a group-by query with one field.

func (*ScopeGroupBy) BoolX

func (sgb *ScopeGroupBy) BoolX(ctx context.Context) bool

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

func (*ScopeGroupBy) Bools

func (sgb *ScopeGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from group-by. It is only allowed when executing a group-by query with one field.

func (*ScopeGroupBy) BoolsX

func (sgb *ScopeGroupBy) BoolsX(ctx context.Context) []bool

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

func (*ScopeGroupBy) Float64

func (sgb *ScopeGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a group-by query. It is only allowed when executing a group-by query with one field.

func (*ScopeGroupBy) Float64X

func (sgb *ScopeGroupBy) Float64X(ctx context.Context) float64

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

func (*ScopeGroupBy) Float64s

func (sgb *ScopeGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from group-by. It is only allowed when executing a group-by query with one field.

func (*ScopeGroupBy) Float64sX

func (sgb *ScopeGroupBy) Float64sX(ctx context.Context) []float64

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

func (*ScopeGroupBy) Int

func (sgb *ScopeGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a group-by query. It is only allowed when executing a group-by query with one field.

func (*ScopeGroupBy) IntX

func (sgb *ScopeGroupBy) IntX(ctx context.Context) int

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

func (*ScopeGroupBy) Ints

func (sgb *ScopeGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from group-by. It is only allowed when executing a group-by query with one field.

func (*ScopeGroupBy) IntsX

func (sgb *ScopeGroupBy) IntsX(ctx context.Context) []int

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

func (*ScopeGroupBy) Scan

func (sgb *ScopeGroupBy) Scan(ctx context.Context, v interface{}) error

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

func (*ScopeGroupBy) ScanX

func (sgb *ScopeGroupBy) ScanX(ctx context.Context, v interface{})

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

func (*ScopeGroupBy) String

func (sgb *ScopeGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a group-by query. It is only allowed when executing a group-by query with one field.

func (*ScopeGroupBy) StringX

func (sgb *ScopeGroupBy) StringX(ctx context.Context) string

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

func (*ScopeGroupBy) Strings

func (sgb *ScopeGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from group-by. It is only allowed when executing a group-by query with one field.

func (*ScopeGroupBy) StringsX

func (sgb *ScopeGroupBy) StringsX(ctx context.Context) []string

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

type ScopeMutation

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

ScopeMutation represents an operation that mutates the Scope nodes in the graph.

func (*ScopeMutation) AddFactIDs

func (m *ScopeMutation) AddFactIDs(ids ...string)

AddFactIDs adds the "facts" edge to the Fact entity by ids.

func (*ScopeMutation) AddField

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

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

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

func (*ScopeMutation) AddedField

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

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

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

func (*ScopeMutation) AddedIDs

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

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

func (*ScopeMutation) ClearDeletedAt

func (m *ScopeMutation) ClearDeletedAt()

ClearDeletedAt clears the value of the "deleted_at" field.

func (*ScopeMutation) ClearEdge

func (m *ScopeMutation) 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 (*ScopeMutation) ClearFacts

func (m *ScopeMutation) ClearFacts()

ClearFacts clears the "facts" edge to the Fact entity.

func (*ScopeMutation) ClearField

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

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

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

func (*ScopeMutation) ClearedFields

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

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

func (ScopeMutation) Client

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

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

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

func (*ScopeMutation) CustomID

func (m *ScopeMutation) CustomID() (r string, exists bool)

CustomID returns the value of the "custom_id" field in the mutation.

func (*ScopeMutation) DeletedAt

func (m *ScopeMutation) DeletedAt() (r time.Time, exists bool)

DeletedAt returns the value of the "deleted_at" field in the mutation.

func (*ScopeMutation) DeletedAtCleared

func (m *ScopeMutation) DeletedAtCleared() bool

DeletedAtCleared returns if the "deleted_at" field was cleared in this mutation.

func (*ScopeMutation) Domain

func (m *ScopeMutation) Domain() (r string, exists bool)

Domain returns the value of the "domain" field in the mutation.

func (*ScopeMutation) EdgeCleared

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

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

func (*ScopeMutation) FactsCleared

func (m *ScopeMutation) FactsCleared() bool

FactsCleared returns if the "facts" edge to the Fact entity was cleared.

func (*ScopeMutation) FactsIDs

func (m *ScopeMutation) FactsIDs() (ids []string)

FactsIDs returns the "facts" edge IDs in the mutation.

func (*ScopeMutation) Field

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

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

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

func (*ScopeMutation) Fields

func (m *ScopeMutation) 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 (*ScopeMutation) Filter

func (m *ScopeMutation) Filter() *ScopeFilter

Filter returns an entql.Where implementation to apply filters on the ScopeMutation builder.

func (*ScopeMutation) ID

func (m *ScopeMutation) ID() (id string, exists bool)

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder.

func (*ScopeMutation) Nonce

func (m *ScopeMutation) Nonce() (r string, exists bool)

Nonce returns the value of the "nonce" field in the mutation.

func (*ScopeMutation) OldCreatedAt

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

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

func (m *ScopeMutation) OldCustomID(ctx context.Context) (v string, err error)

OldCustomID returns the old "custom_id" field's value of the Scope entity. If the Scope 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 (*ScopeMutation) OldDeletedAt

func (m *ScopeMutation) OldDeletedAt(ctx context.Context) (v *time.Time, err error)

OldDeletedAt returns the old "deleted_at" field's value of the Scope entity. If the Scope 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 (*ScopeMutation) OldDomain

func (m *ScopeMutation) OldDomain(ctx context.Context) (v string, err error)

OldDomain returns the old "domain" field's value of the Scope entity. If the Scope 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 (*ScopeMutation) OldField

func (m *ScopeMutation) 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 (*ScopeMutation) OldNonce

func (m *ScopeMutation) OldNonce(ctx context.Context) (v string, err error)

OldNonce returns the old "nonce" field's value of the Scope entity. If the Scope 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 (*ScopeMutation) OldUpdatedAt

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

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

func (m *ScopeMutation) Op() Op

Op returns the operation name.

func (*ScopeMutation) RemoveFactIDs

func (m *ScopeMutation) RemoveFactIDs(ids ...string)

RemoveFactIDs removes the "facts" edge to the Fact entity by IDs.

func (*ScopeMutation) RemovedEdges

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

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

func (*ScopeMutation) RemovedFactsIDs

func (m *ScopeMutation) RemovedFactsIDs() (ids []string)

RemovedFacts returns the removed IDs of the "facts" edge to the Fact entity.

func (*ScopeMutation) RemovedIDs

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

func (m *ScopeMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*ScopeMutation) ResetCustomID

func (m *ScopeMutation) ResetCustomID()

ResetCustomID resets all changes to the "custom_id" field.

func (*ScopeMutation) ResetDeletedAt

func (m *ScopeMutation) ResetDeletedAt()

ResetDeletedAt resets all changes to the "deleted_at" field.

func (*ScopeMutation) ResetDomain

func (m *ScopeMutation) ResetDomain()

ResetDomain resets all changes to the "domain" field.

func (*ScopeMutation) ResetEdge

func (m *ScopeMutation) 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 (*ScopeMutation) ResetFacts

func (m *ScopeMutation) ResetFacts()

ResetFacts resets all changes to the "facts" edge.

func (*ScopeMutation) ResetField

func (m *ScopeMutation) 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 (*ScopeMutation) ResetNonce

func (m *ScopeMutation) ResetNonce()

ResetNonce resets all changes to the "nonce" field.

func (*ScopeMutation) ResetUpdatedAt

func (m *ScopeMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*ScopeMutation) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*ScopeMutation) SetCustomID

func (m *ScopeMutation) SetCustomID(s string)

SetCustomID sets the "custom_id" field.

func (*ScopeMutation) SetDeletedAt

func (m *ScopeMutation) SetDeletedAt(t time.Time)

SetDeletedAt sets the "deleted_at" field.

func (*ScopeMutation) SetDomain

func (m *ScopeMutation) SetDomain(s string)

SetDomain sets the "domain" field.

func (*ScopeMutation) SetField

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

func (m *ScopeMutation) SetID(id string)

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

func (*ScopeMutation) SetNonce

func (m *ScopeMutation) SetNonce(s string)

SetNonce sets the "nonce" field.

func (*ScopeMutation) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" field.

func (ScopeMutation) Tx

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

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

func (*ScopeMutation) Type

func (m *ScopeMutation) Type() string

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

func (*ScopeMutation) UpdatedAt

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

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

type ScopeQuery

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

ScopeQuery is the builder for querying Scope entities.

func (*ScopeQuery) All

func (sq *ScopeQuery) All(ctx context.Context) ([]*Scope, error)

All executes the query and returns a list of Scopes.

func (*ScopeQuery) AllX

func (sq *ScopeQuery) AllX(ctx context.Context) []*Scope

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

func (*ScopeQuery) Clone

func (sq *ScopeQuery) Clone() *ScopeQuery

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

func (*ScopeQuery) Count

func (sq *ScopeQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*ScopeQuery) CountX

func (sq *ScopeQuery) CountX(ctx context.Context) int

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

func (*ScopeQuery) Exist

func (sq *ScopeQuery) Exist(ctx context.Context) (bool, error)

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

func (*ScopeQuery) ExistX

func (sq *ScopeQuery) ExistX(ctx context.Context) bool

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

func (*ScopeQuery) Filter

func (sq *ScopeQuery) Filter() *ScopeFilter

Filter returns a Filter implementation to apply filters on the ScopeQuery builder.

func (*ScopeQuery) First

func (sq *ScopeQuery) First(ctx context.Context) (*Scope, error)

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

func (*ScopeQuery) FirstID

func (sq *ScopeQuery) FirstID(ctx context.Context) (id string, err error)

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

func (*ScopeQuery) FirstIDX

func (sq *ScopeQuery) FirstIDX(ctx context.Context) string

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

func (*ScopeQuery) FirstX

func (sq *ScopeQuery) FirstX(ctx context.Context) *Scope

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

func (*ScopeQuery) GroupBy

func (sq *ScopeQuery) GroupBy(field string, fields ...string) *ScopeGroupBy

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

func (*ScopeQuery) IDs

func (sq *ScopeQuery) IDs(ctx context.Context) ([]string, error)

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

func (*ScopeQuery) IDsX

func (sq *ScopeQuery) IDsX(ctx context.Context) []string

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

func (*ScopeQuery) Limit

func (sq *ScopeQuery) Limit(limit int) *ScopeQuery

Limit adds a limit step to the query.

func (*ScopeQuery) Offset

func (sq *ScopeQuery) Offset(offset int) *ScopeQuery

Offset adds an offset step to the query.

func (*ScopeQuery) Only

func (sq *ScopeQuery) Only(ctx context.Context) (*Scope, error)

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

func (*ScopeQuery) OnlyID

func (sq *ScopeQuery) OnlyID(ctx context.Context) (id string, err error)

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

func (*ScopeQuery) OnlyIDX

func (sq *ScopeQuery) OnlyIDX(ctx context.Context) string

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

func (*ScopeQuery) OnlyX

func (sq *ScopeQuery) OnlyX(ctx context.Context) *Scope

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

func (*ScopeQuery) Order

func (sq *ScopeQuery) Order(o ...OrderFunc) *ScopeQuery

Order adds an order step to the query.

func (*ScopeQuery) QueryFacts

func (sq *ScopeQuery) QueryFacts() *FactQuery

QueryFacts chains the current query on the "facts" edge.

func (*ScopeQuery) Select

func (sq *ScopeQuery) Select(field string, fields ...string) *ScopeSelect

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

func (*ScopeQuery) Where

func (sq *ScopeQuery) Where(ps ...predicate.Scope) *ScopeQuery

Where adds a new predicate for the ScopeQuery builder.

func (*ScopeQuery) WithFacts

func (sq *ScopeQuery) WithFacts(opts ...func(*FactQuery)) *ScopeQuery

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

type ScopeSelect

type ScopeSelect struct {
	*ScopeQuery
	// contains filtered or unexported fields
}

ScopeSelect is the builder for selecting fields of Scope entities.

func (*ScopeSelect) Bool

func (ss *ScopeSelect) Bool(ctx context.Context) (_ bool, err error)

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

func (*ScopeSelect) BoolX

func (ss *ScopeSelect) BoolX(ctx context.Context) bool

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

func (*ScopeSelect) Bools

func (ss *ScopeSelect) Bools(ctx context.Context) ([]bool, error)

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

func (*ScopeSelect) BoolsX

func (ss *ScopeSelect) BoolsX(ctx context.Context) []bool

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

func (*ScopeSelect) Float64

func (ss *ScopeSelect) Float64(ctx context.Context) (_ float64, err error)

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

func (*ScopeSelect) Float64X

func (ss *ScopeSelect) Float64X(ctx context.Context) float64

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

func (*ScopeSelect) Float64s

func (ss *ScopeSelect) Float64s(ctx context.Context) ([]float64, error)

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

func (*ScopeSelect) Float64sX

func (ss *ScopeSelect) Float64sX(ctx context.Context) []float64

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

func (*ScopeSelect) Int

func (ss *ScopeSelect) Int(ctx context.Context) (_ int, err error)

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

func (*ScopeSelect) IntX

func (ss *ScopeSelect) IntX(ctx context.Context) int

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

func (*ScopeSelect) Ints

func (ss *ScopeSelect) Ints(ctx context.Context) ([]int, error)

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

func (*ScopeSelect) IntsX

func (ss *ScopeSelect) IntsX(ctx context.Context) []int

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

func (*ScopeSelect) Scan

func (ss *ScopeSelect) Scan(ctx context.Context, v interface{}) error

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

func (*ScopeSelect) ScanX

func (ss *ScopeSelect) ScanX(ctx context.Context, v interface{})

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

func (*ScopeSelect) String

func (ss *ScopeSelect) String(ctx context.Context) (_ string, err error)

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

func (*ScopeSelect) StringX

func (ss *ScopeSelect) StringX(ctx context.Context) string

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

func (*ScopeSelect) Strings

func (ss *ScopeSelect) Strings(ctx context.Context) ([]string, error)

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

func (*ScopeSelect) StringsX

func (ss *ScopeSelect) StringsX(ctx context.Context) []string

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

type ScopeUpdate

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

ScopeUpdate is the builder for updating Scope entities.

func (*ScopeUpdate) AddFactIDs

func (su *ScopeUpdate) AddFactIDs(ids ...string) *ScopeUpdate

AddFactIDs adds the "facts" edge to the Fact entity by IDs.

func (*ScopeUpdate) AddFacts

func (su *ScopeUpdate) AddFacts(f ...*Fact) *ScopeUpdate

AddFacts adds the "facts" edges to the Fact entity.

func (*ScopeUpdate) ClearDeletedAt

func (su *ScopeUpdate) ClearDeletedAt() *ScopeUpdate

ClearDeletedAt clears the value of the "deleted_at" field.

func (*ScopeUpdate) ClearFacts

func (su *ScopeUpdate) ClearFacts() *ScopeUpdate

ClearFacts clears all "facts" edges to the Fact entity.

func (*ScopeUpdate) Exec

func (su *ScopeUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*ScopeUpdate) ExecX

func (su *ScopeUpdate) ExecX(ctx context.Context)

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

func (*ScopeUpdate) Mutation

func (su *ScopeUpdate) Mutation() *ScopeMutation

Mutation returns the ScopeMutation object of the builder.

func (*ScopeUpdate) RemoveFactIDs

func (su *ScopeUpdate) RemoveFactIDs(ids ...string) *ScopeUpdate

RemoveFactIDs removes the "facts" edge to Fact entities by IDs.

func (*ScopeUpdate) RemoveFacts

func (su *ScopeUpdate) RemoveFacts(f ...*Fact) *ScopeUpdate

RemoveFacts removes "facts" edges to Fact entities.

func (*ScopeUpdate) Save

func (su *ScopeUpdate) Save(ctx context.Context) (int, error)

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

func (*ScopeUpdate) SaveX

func (su *ScopeUpdate) SaveX(ctx context.Context) int

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

func (*ScopeUpdate) SetCustomID

func (su *ScopeUpdate) SetCustomID(s string) *ScopeUpdate

SetCustomID sets the "custom_id" field.

func (*ScopeUpdate) SetDeletedAt

func (su *ScopeUpdate) SetDeletedAt(t time.Time) *ScopeUpdate

SetDeletedAt sets the "deleted_at" field.

func (*ScopeUpdate) SetDomain

func (su *ScopeUpdate) SetDomain(s string) *ScopeUpdate

SetDomain sets the "domain" field.

func (*ScopeUpdate) SetNillableDeletedAt

func (su *ScopeUpdate) SetNillableDeletedAt(t *time.Time) *ScopeUpdate

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*ScopeUpdate) SetNillableNonce

func (su *ScopeUpdate) SetNillableNonce(s *string) *ScopeUpdate

SetNillableNonce sets the "nonce" field if the given value is not nil.

func (*ScopeUpdate) SetNonce

func (su *ScopeUpdate) SetNonce(s string) *ScopeUpdate

SetNonce sets the "nonce" field.

func (*ScopeUpdate) Where

func (su *ScopeUpdate) Where(ps ...predicate.Scope) *ScopeUpdate

Where adds a new predicate for the ScopeUpdate builder.

type ScopeUpdateOne

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

ScopeUpdateOne is the builder for updating a single Scope entity.

func (*ScopeUpdateOne) AddFactIDs

func (suo *ScopeUpdateOne) AddFactIDs(ids ...string) *ScopeUpdateOne

AddFactIDs adds the "facts" edge to the Fact entity by IDs.

func (*ScopeUpdateOne) AddFacts

func (suo *ScopeUpdateOne) AddFacts(f ...*Fact) *ScopeUpdateOne

AddFacts adds the "facts" edges to the Fact entity.

func (*ScopeUpdateOne) ClearDeletedAt

func (suo *ScopeUpdateOne) ClearDeletedAt() *ScopeUpdateOne

ClearDeletedAt clears the value of the "deleted_at" field.

func (*ScopeUpdateOne) ClearFacts

func (suo *ScopeUpdateOne) ClearFacts() *ScopeUpdateOne

ClearFacts clears all "facts" edges to the Fact entity.

func (*ScopeUpdateOne) Exec

func (suo *ScopeUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*ScopeUpdateOne) ExecX

func (suo *ScopeUpdateOne) ExecX(ctx context.Context)

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

func (*ScopeUpdateOne) Mutation

func (suo *ScopeUpdateOne) Mutation() *ScopeMutation

Mutation returns the ScopeMutation object of the builder.

func (*ScopeUpdateOne) RemoveFactIDs

func (suo *ScopeUpdateOne) RemoveFactIDs(ids ...string) *ScopeUpdateOne

RemoveFactIDs removes the "facts" edge to Fact entities by IDs.

func (*ScopeUpdateOne) RemoveFacts

func (suo *ScopeUpdateOne) RemoveFacts(f ...*Fact) *ScopeUpdateOne

RemoveFacts removes "facts" edges to Fact entities.

func (*ScopeUpdateOne) Save

func (suo *ScopeUpdateOne) Save(ctx context.Context) (*Scope, error)

Save executes the query and returns the updated Scope entity.

func (*ScopeUpdateOne) SaveX

func (suo *ScopeUpdateOne) SaveX(ctx context.Context) *Scope

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

func (*ScopeUpdateOne) SetCustomID

func (suo *ScopeUpdateOne) SetCustomID(s string) *ScopeUpdateOne

SetCustomID sets the "custom_id" field.

func (*ScopeUpdateOne) SetDeletedAt

func (suo *ScopeUpdateOne) SetDeletedAt(t time.Time) *ScopeUpdateOne

SetDeletedAt sets the "deleted_at" field.

func (*ScopeUpdateOne) SetDomain

func (suo *ScopeUpdateOne) SetDomain(s string) *ScopeUpdateOne

SetDomain sets the "domain" field.

func (*ScopeUpdateOne) SetNillableDeletedAt

func (suo *ScopeUpdateOne) SetNillableDeletedAt(t *time.Time) *ScopeUpdateOne

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*ScopeUpdateOne) SetNillableNonce

func (suo *ScopeUpdateOne) SetNillableNonce(s *string) *ScopeUpdateOne

SetNillableNonce sets the "nonce" field if the given value is not nil.

func (*ScopeUpdateOne) SetNonce

func (suo *ScopeUpdateOne) SetNonce(s string) *ScopeUpdateOne

SetNonce sets the "nonce" field.

type Scopes

type Scopes []*Scope

Scopes is a parsable slice of Scope.

type Tx

type Tx struct {

	// APIAudit is the client for interacting with the APIAudit builders.
	APIAudit *APIAuditClient
	// Fact is the client for interacting with the Fact builders.
	Fact *FactClient
	// FactType is the client for interacting with the FactType builders.
	FactType *FactTypeClient
	// Grant is the client for interacting with the Grant builders.
	Grant *GrantClient
	// Scope is the client for interacting with the Scope builders.
	Scope *ScopeClient
	// 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 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