ent

package
v0.0.0-...-2eeffc0 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2020 License: Apache-2.0 Imports: 25 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.
	TypeApplication = "Application"
	TypeCounter     = "Counter"
	TypeGauge       = "Gauge"
	TypeGraph       = "Graph"
	TypeGroup       = "Group"
	TypeHistogram   = "Histogram"
	TypeMetric      = "Metric"
	TypeTag         = "Tag"
)

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 nor 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 Client attached.

Types

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 Application

type Application struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// Name holds the value of the "name" field.
	Name string `json:"name,omitempty"`
	// Status holds the value of the "status" field.
	Status string `json:"status,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// StartedAt holds the value of the "started_at" field.
	StartedAt time.Time `json:"started_at,omitempty"`
	// UpdatedAt holds the value of the "updated_at" field.
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// Scenario holds the value of the "scenario" field.
	Scenario string `json:"scenario,omitempty"`
	// Gomod holds the value of the "gomod" field.
	Gomod string `json:"gomod,omitempty"`
	// Gosum holds the value of the "gosum" field.
	Gosum string `json:"gosum,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the ApplicationQuery when eager-loading is set.
	Edges ApplicationEdges `json:"edges"`
	// contains filtered or unexported fields
}

Application is the model entity for the Application schema.

func (*Application) QueryGroups

func (a *Application) QueryGroups() *GroupQuery

QueryGroups queries the groups edge of the Application.

func (*Application) QueryTags

func (a *Application) QueryTags() *TagQuery

QueryTags queries the tags edge of the Application.

func (*Application) String

func (a *Application) String() string

String implements the fmt.Stringer.

func (*Application) Unwrap

func (a *Application) Unwrap() *Application

Unwrap unwraps the entity that was returned from a transaction after it was closed, so that all next queries will be executed through the driver which created the transaction.

func (*Application) Update

func (a *Application) Update() *ApplicationUpdateOne

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

type ApplicationClient

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

ApplicationClient is a client for the Application schema.

func NewApplicationClient

func NewApplicationClient(c config) *ApplicationClient

NewApplicationClient returns a client for the Application from the given config.

func (*ApplicationClient) Create

func (c *ApplicationClient) Create() *ApplicationCreate

Create returns a create builder for Application.

func (*ApplicationClient) CreateBulk

func (c *ApplicationClient) CreateBulk(builders ...*ApplicationCreate) *ApplicationCreateBulk

BulkCreate returns a builder for creating a bulk of Application entities.

func (*ApplicationClient) Delete

func (c *ApplicationClient) Delete() *ApplicationDelete

Delete returns a delete builder for Application.

func (*ApplicationClient) DeleteOne

DeleteOne returns a delete builder for the given entity.

func (*ApplicationClient) DeleteOneID

func (c *ApplicationClient) DeleteOneID(id int) *ApplicationDeleteOne

DeleteOneID returns a delete builder for the given id.

func (*ApplicationClient) Get

func (c *ApplicationClient) Get(ctx context.Context, id int) (*Application, error)

Get returns a Application entity by its id.

func (*ApplicationClient) GetX

func (c *ApplicationClient) GetX(ctx context.Context, id int) *Application

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

func (*ApplicationClient) Hooks

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

Hooks returns the client hooks.

func (*ApplicationClient) Query

func (c *ApplicationClient) Query() *ApplicationQuery

Query returns a query builder for Application.

func (*ApplicationClient) QueryGroups

func (c *ApplicationClient) QueryGroups(a *Application) *GroupQuery

QueryGroups queries the groups edge of a Application.

func (*ApplicationClient) QueryTags

func (c *ApplicationClient) QueryTags(a *Application) *TagQuery

QueryTags queries the tags edge of a Application.

func (*ApplicationClient) Update

func (c *ApplicationClient) Update() *ApplicationUpdate

Update returns an update builder for Application.

func (*ApplicationClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*ApplicationClient) UpdateOneID

func (c *ApplicationClient) UpdateOneID(id int) *ApplicationUpdateOne

UpdateOneID returns an update builder for the given id.

func (*ApplicationClient) Use

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

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

type ApplicationCreate

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

ApplicationCreate is the builder for creating a Application entity.

func (*ApplicationCreate) AddGroupIDs

func (ac *ApplicationCreate) AddGroupIDs(ids ...int) *ApplicationCreate

AddGroupIDs adds the groups edge to Group by ids.

func (*ApplicationCreate) AddGroups

func (ac *ApplicationCreate) AddGroups(g ...*Group) *ApplicationCreate

AddGroups adds the groups edges to Group.

func (*ApplicationCreate) AddTagIDs

func (ac *ApplicationCreate) AddTagIDs(ids ...int) *ApplicationCreate

AddTagIDs adds the tags edge to Tag by ids.

func (*ApplicationCreate) AddTags

func (ac *ApplicationCreate) AddTags(t ...*Tag) *ApplicationCreate

AddTags adds the tags edges to Tag.

func (*ApplicationCreate) Mutation

func (ac *ApplicationCreate) Mutation() *ApplicationMutation

Mutation returns the ApplicationMutation object of the builder.

func (*ApplicationCreate) Save

Save creates the Application in the database.

func (*ApplicationCreate) SaveX

func (ac *ApplicationCreate) SaveX(ctx context.Context) *Application

SaveX calls Save and panics if Save returns an error.

func (*ApplicationCreate) SetCreatedAt

func (ac *ApplicationCreate) SetCreatedAt(t time.Time) *ApplicationCreate

SetCreatedAt sets the created_at field.

func (*ApplicationCreate) SetGomod

func (ac *ApplicationCreate) SetGomod(s string) *ApplicationCreate

SetGomod sets the gomod field.

func (*ApplicationCreate) SetGosum

func (ac *ApplicationCreate) SetGosum(s string) *ApplicationCreate

SetGosum sets the gosum field.

func (*ApplicationCreate) SetName

func (ac *ApplicationCreate) SetName(s string) *ApplicationCreate

SetName sets the name field.

func (*ApplicationCreate) SetNillableCreatedAt

func (ac *ApplicationCreate) SetNillableCreatedAt(t *time.Time) *ApplicationCreate

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

func (*ApplicationCreate) SetNillableGomod

func (ac *ApplicationCreate) SetNillableGomod(s *string) *ApplicationCreate

SetNillableGomod sets the gomod field if the given value is not nil.

func (*ApplicationCreate) SetNillableGosum

func (ac *ApplicationCreate) SetNillableGosum(s *string) *ApplicationCreate

SetNillableGosum sets the gosum field if the given value is not nil.

func (*ApplicationCreate) SetNillableStartedAt

func (ac *ApplicationCreate) SetNillableStartedAt(t *time.Time) *ApplicationCreate

SetNillableStartedAt sets the started_at field if the given value is not nil.

func (*ApplicationCreate) SetNillableUpdatedAt

func (ac *ApplicationCreate) SetNillableUpdatedAt(t *time.Time) *ApplicationCreate

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

func (*ApplicationCreate) SetScenario

func (ac *ApplicationCreate) SetScenario(s string) *ApplicationCreate

SetScenario sets the scenario field.

func (*ApplicationCreate) SetStartedAt

func (ac *ApplicationCreate) SetStartedAt(t time.Time) *ApplicationCreate

SetStartedAt sets the started_at field.

func (*ApplicationCreate) SetStatus

func (ac *ApplicationCreate) SetStatus(s string) *ApplicationCreate

SetStatus sets the status field.

func (*ApplicationCreate) SetUpdatedAt

func (ac *ApplicationCreate) SetUpdatedAt(t time.Time) *ApplicationCreate

SetUpdatedAt sets the updated_at field.

type ApplicationCreateBulk

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

ApplicationCreateBulk is the builder for creating a bulk of Application entities.

func (*ApplicationCreateBulk) Save

func (acb *ApplicationCreateBulk) Save(ctx context.Context) ([]*Application, error)

Save creates the Application entities in the database.

func (*ApplicationCreateBulk) SaveX

func (acb *ApplicationCreateBulk) SaveX(ctx context.Context) []*Application

SaveX calls Save and panics if Save returns an error.

type ApplicationDelete

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

ApplicationDelete is the builder for deleting a Application entity.

func (*ApplicationDelete) Exec

func (ad *ApplicationDelete) Exec(ctx context.Context) (int, error)

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

func (*ApplicationDelete) ExecX

func (ad *ApplicationDelete) ExecX(ctx context.Context) int

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

func (*ApplicationDelete) Where

Where adds a new predicate to the delete builder.

type ApplicationDeleteOne

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

ApplicationDeleteOne is the builder for deleting a single Application entity.

func (*ApplicationDeleteOne) Exec

func (ado *ApplicationDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*ApplicationDeleteOne) ExecX

func (ado *ApplicationDeleteOne) ExecX(ctx context.Context)

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

type ApplicationEdges

type ApplicationEdges struct {
	// Groups holds the value of the groups edge.
	Groups []*Group
	// Tags holds the value of the tags edge.
	Tags []*Tag
	// contains filtered or unexported fields
}

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

func (ApplicationEdges) GroupsOrErr

func (e ApplicationEdges) GroupsOrErr() ([]*Group, error)

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

func (ApplicationEdges) TagsOrErr

func (e ApplicationEdges) TagsOrErr() ([]*Tag, error)

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

type ApplicationGroupBy

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

ApplicationGroupBy is the builder for group-by Application entities.

func (*ApplicationGroupBy) Aggregate

func (agb *ApplicationGroupBy) Aggregate(fns ...AggregateFunc) *ApplicationGroupBy

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

func (*ApplicationGroupBy) Bool

func (agb *ApplicationGroupBy) Bool(ctx context.Context) (_ bool, err error)

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

func (*ApplicationGroupBy) BoolX

func (agb *ApplicationGroupBy) BoolX(ctx context.Context) bool

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

func (*ApplicationGroupBy) Bools

func (agb *ApplicationGroupBy) Bools(ctx context.Context) ([]bool, error)

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

func (*ApplicationGroupBy) BoolsX

func (agb *ApplicationGroupBy) BoolsX(ctx context.Context) []bool

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

func (*ApplicationGroupBy) Float64

func (agb *ApplicationGroupBy) Float64(ctx context.Context) (_ float64, err error)

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

func (*ApplicationGroupBy) Float64X

func (agb *ApplicationGroupBy) Float64X(ctx context.Context) float64

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

func (*ApplicationGroupBy) Float64s

func (agb *ApplicationGroupBy) Float64s(ctx context.Context) ([]float64, error)

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

func (*ApplicationGroupBy) Float64sX

func (agb *ApplicationGroupBy) Float64sX(ctx context.Context) []float64

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

func (*ApplicationGroupBy) Int

func (agb *ApplicationGroupBy) Int(ctx context.Context) (_ int, err error)

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

func (*ApplicationGroupBy) IntX

func (agb *ApplicationGroupBy) IntX(ctx context.Context) int

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

func (*ApplicationGroupBy) Ints

func (agb *ApplicationGroupBy) Ints(ctx context.Context) ([]int, error)

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

func (*ApplicationGroupBy) IntsX

func (agb *ApplicationGroupBy) IntsX(ctx context.Context) []int

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

func (*ApplicationGroupBy) Scan

func (agb *ApplicationGroupBy) Scan(ctx context.Context, v interface{}) error

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

func (*ApplicationGroupBy) ScanX

func (agb *ApplicationGroupBy) ScanX(ctx context.Context, v interface{})

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

func (*ApplicationGroupBy) String

func (agb *ApplicationGroupBy) String(ctx context.Context) (_ string, err error)

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

func (*ApplicationGroupBy) StringX

func (agb *ApplicationGroupBy) StringX(ctx context.Context) string

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

func (*ApplicationGroupBy) Strings

func (agb *ApplicationGroupBy) Strings(ctx context.Context) ([]string, error)

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

func (*ApplicationGroupBy) StringsX

func (agb *ApplicationGroupBy) StringsX(ctx context.Context) []string

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

type ApplicationMutation

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

ApplicationMutation represents an operation that mutate the Applications nodes in the graph.

func (*ApplicationMutation) AddField

func (m *ApplicationMutation) AddField(name string, value ent.Value) error

AddField adds the value for the given name. It returns an error if the field is not defined in the schema, or if the type mismatch the field type.

func (*ApplicationMutation) AddGroupIDs

func (m *ApplicationMutation) AddGroupIDs(ids ...int)

AddGroupIDs adds the groups edge to Group by ids.

func (*ApplicationMutation) AddTagIDs

func (m *ApplicationMutation) AddTagIDs(ids ...int)

AddTagIDs adds the tags edge to Tag by ids.

func (*ApplicationMutation) AddedEdges

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

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

func (*ApplicationMutation) AddedField

func (m *ApplicationMutation) AddedField(name string) (ent.Value, bool)

AddedField returns the numeric value that was in/decremented from a field with the given name. The second value indicates that this field was not set, or was not define in the schema.

func (*ApplicationMutation) AddedFields

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

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

func (*ApplicationMutation) AddedIDs

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

AddedIDs returns all ids (to other nodes) that were added for the given edge name.

func (*ApplicationMutation) ClearEdge

func (m *ApplicationMutation) ClearEdge(name string) error

ClearEdge clears the value for the given name. It returns an error if the edge name is not defined in the schema.

func (*ApplicationMutation) ClearField

func (m *ApplicationMutation) ClearField(name string) error

ClearField clears the value for the given name. It returns an error if the field is not defined in the schema.

func (*ApplicationMutation) ClearGroups

func (m *ApplicationMutation) ClearGroups()

ClearGroups clears the groups edge to Group.

func (*ApplicationMutation) ClearStartedAt

func (m *ApplicationMutation) ClearStartedAt()

ClearStartedAt clears the value of started_at.

func (*ApplicationMutation) ClearTags

func (m *ApplicationMutation) ClearTags()

ClearTags clears the tags edge to Tag.

func (*ApplicationMutation) ClearedEdges

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

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

func (*ApplicationMutation) ClearedFields

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

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

func (ApplicationMutation) Client

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

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

CreatedAt returns the created_at value in the mutation.

func (*ApplicationMutation) EdgeCleared

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

EdgeCleared returns a boolean indicates if this edge was cleared in this mutation.

func (*ApplicationMutation) Field

func (m *ApplicationMutation) Field(name string) (ent.Value, bool)

Field returns the value of a field with the given name. The second boolean value indicates that this field was not set, or was not define in the schema.

func (*ApplicationMutation) FieldCleared

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

FieldCleared returns a boolean indicates if this field was cleared in this mutation.

func (*ApplicationMutation) Fields

func (m *ApplicationMutation) Fields() []string

Fields returns all fields that were changed during this mutation. Note that, in order to get all numeric fields that were in/decremented, call AddedFields().

func (*ApplicationMutation) Gomod

func (m *ApplicationMutation) Gomod() (r string, exists bool)

Gomod returns the gomod value in the mutation.

func (*ApplicationMutation) Gosum

func (m *ApplicationMutation) Gosum() (r string, exists bool)

Gosum returns the gosum value in the mutation.

func (*ApplicationMutation) GroupsCleared

func (m *ApplicationMutation) GroupsCleared() bool

GroupsCleared returns if the edge groups was cleared.

func (*ApplicationMutation) GroupsIDs

func (m *ApplicationMutation) GroupsIDs() (ids []int)

GroupsIDs returns the groups ids in the mutation.

func (*ApplicationMutation) ID

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

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

func (*ApplicationMutation) Name

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

Name returns the name value in the mutation.

func (*ApplicationMutation) OldCreatedAt

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

OldCreatedAt returns the old created_at value of the Application. If the Application 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 database query fails.

func (*ApplicationMutation) OldField

func (m *ApplicationMutation) 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 was failed.

func (*ApplicationMutation) OldGomod

func (m *ApplicationMutation) OldGomod(ctx context.Context) (v string, err error)

OldGomod returns the old gomod value of the Application. If the Application 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 database query fails.

func (*ApplicationMutation) OldGosum

func (m *ApplicationMutation) OldGosum(ctx context.Context) (v string, err error)

OldGosum returns the old gosum value of the Application. If the Application 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 database query fails.

func (*ApplicationMutation) OldName

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

OldName returns the old name value of the Application. If the Application 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 database query fails.

func (*ApplicationMutation) OldScenario

func (m *ApplicationMutation) OldScenario(ctx context.Context) (v string, err error)

OldScenario returns the old scenario value of the Application. If the Application 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 database query fails.

func (*ApplicationMutation) OldStartedAt

func (m *ApplicationMutation) OldStartedAt(ctx context.Context) (v time.Time, err error)

OldStartedAt returns the old started_at value of the Application. If the Application 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 database query fails.

func (*ApplicationMutation) OldStatus

func (m *ApplicationMutation) OldStatus(ctx context.Context) (v string, err error)

OldStatus returns the old status value of the Application. If the Application 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 database query fails.

func (*ApplicationMutation) OldUpdatedAt

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

OldUpdatedAt returns the old updated_at value of the Application. If the Application 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 database query fails.

func (*ApplicationMutation) Op

func (m *ApplicationMutation) Op() Op

Op returns the operation name.

func (*ApplicationMutation) RemoveGroupIDs

func (m *ApplicationMutation) RemoveGroupIDs(ids ...int)

RemoveGroupIDs removes the groups edge to Group by ids.

func (*ApplicationMutation) RemoveTagIDs

func (m *ApplicationMutation) RemoveTagIDs(ids ...int)

RemoveTagIDs removes the tags edge to Tag by ids.

func (*ApplicationMutation) RemovedEdges

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

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

func (*ApplicationMutation) RemovedGroupsIDs

func (m *ApplicationMutation) RemovedGroupsIDs() (ids []int)

RemovedGroups returns the removed ids of groups.

func (*ApplicationMutation) RemovedIDs

func (m *ApplicationMutation) RemovedIDs(name string) []ent.Value

RemovedIDs returns all ids (to other nodes) that were removed for the given edge name.

func (*ApplicationMutation) RemovedTagsIDs

func (m *ApplicationMutation) RemovedTagsIDs() (ids []int)

RemovedTags returns the removed ids of tags.

func (*ApplicationMutation) ResetCreatedAt

func (m *ApplicationMutation) ResetCreatedAt()

ResetCreatedAt reset all changes of the "created_at" field.

func (*ApplicationMutation) ResetEdge

func (m *ApplicationMutation) ResetEdge(name string) error

ResetEdge resets all changes in the mutation regarding the given edge name. It returns an error if the edge is not defined in the schema.

func (*ApplicationMutation) ResetField

func (m *ApplicationMutation) ResetField(name string) error

ResetField resets all changes in the mutation regarding the given field name. It returns an error if the field is not defined in the schema.

func (*ApplicationMutation) ResetGomod

func (m *ApplicationMutation) ResetGomod()

ResetGomod reset all changes of the "gomod" field.

func (*ApplicationMutation) ResetGosum

func (m *ApplicationMutation) ResetGosum()

ResetGosum reset all changes of the "gosum" field.

func (*ApplicationMutation) ResetGroups

func (m *ApplicationMutation) ResetGroups()

ResetGroups reset all changes of the "groups" edge.

func (*ApplicationMutation) ResetName

func (m *ApplicationMutation) ResetName()

ResetName reset all changes of the "name" field.

func (*ApplicationMutation) ResetScenario

func (m *ApplicationMutation) ResetScenario()

ResetScenario reset all changes of the "scenario" field.

func (*ApplicationMutation) ResetStartedAt

func (m *ApplicationMutation) ResetStartedAt()

ResetStartedAt reset all changes of the "started_at" field.

func (*ApplicationMutation) ResetStatus

func (m *ApplicationMutation) ResetStatus()

ResetStatus reset all changes of the "status" field.

func (*ApplicationMutation) ResetTags

func (m *ApplicationMutation) ResetTags()

ResetTags reset all changes of the "tags" edge.

func (*ApplicationMutation) ResetUpdatedAt

func (m *ApplicationMutation) ResetUpdatedAt()

ResetUpdatedAt reset all changes of the "updated_at" field.

func (*ApplicationMutation) Scenario

func (m *ApplicationMutation) Scenario() (r string, exists bool)

Scenario returns the scenario value in the mutation.

func (*ApplicationMutation) SetCreatedAt

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

SetCreatedAt sets the created_at field.

func (*ApplicationMutation) SetField

func (m *ApplicationMutation) SetField(name string, value ent.Value) error

SetField sets the value for the given name. It returns an error if the field is not defined in the schema, or if the type mismatch the field type.

func (*ApplicationMutation) SetGomod

func (m *ApplicationMutation) SetGomod(s string)

SetGomod sets the gomod field.

func (*ApplicationMutation) SetGosum

func (m *ApplicationMutation) SetGosum(s string)

SetGosum sets the gosum field.

func (*ApplicationMutation) SetName

func (m *ApplicationMutation) SetName(s string)

SetName sets the name field.

func (*ApplicationMutation) SetScenario

func (m *ApplicationMutation) SetScenario(s string)

SetScenario sets the scenario field.

func (*ApplicationMutation) SetStartedAt

func (m *ApplicationMutation) SetStartedAt(t time.Time)

SetStartedAt sets the started_at field.

func (*ApplicationMutation) SetStatus

func (m *ApplicationMutation) SetStatus(s string)

SetStatus sets the status field.

func (*ApplicationMutation) SetUpdatedAt

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

SetUpdatedAt sets the updated_at field.

func (*ApplicationMutation) StartedAt

func (m *ApplicationMutation) StartedAt() (r time.Time, exists bool)

StartedAt returns the started_at value in the mutation.

func (*ApplicationMutation) StartedAtCleared

func (m *ApplicationMutation) StartedAtCleared() bool

StartedAtCleared returns if the field started_at was cleared in this mutation.

func (*ApplicationMutation) Status

func (m *ApplicationMutation) Status() (r string, exists bool)

Status returns the status value in the mutation.

func (*ApplicationMutation) TagsCleared

func (m *ApplicationMutation) TagsCleared() bool

TagsCleared returns if the edge tags was cleared.

func (*ApplicationMutation) TagsIDs

func (m *ApplicationMutation) TagsIDs() (ids []int)

TagsIDs returns the tags ids in the mutation.

func (ApplicationMutation) Tx

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

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

func (*ApplicationMutation) Type

func (m *ApplicationMutation) Type() string

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

func (*ApplicationMutation) UpdatedAt

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

UpdatedAt returns the updated_at value in the mutation.

type ApplicationQuery

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

ApplicationQuery is the builder for querying Application entities.

func (*ApplicationQuery) All

func (aq *ApplicationQuery) All(ctx context.Context) ([]*Application, error)

All executes the query and returns a list of Applications.

func (*ApplicationQuery) AllX

func (aq *ApplicationQuery) AllX(ctx context.Context) []*Application

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

func (*ApplicationQuery) Clone

func (aq *ApplicationQuery) Clone() *ApplicationQuery

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

func (*ApplicationQuery) Count

func (aq *ApplicationQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*ApplicationQuery) CountX

func (aq *ApplicationQuery) CountX(ctx context.Context) int

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

func (*ApplicationQuery) Exist

func (aq *ApplicationQuery) Exist(ctx context.Context) (bool, error)

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

func (*ApplicationQuery) ExistX

func (aq *ApplicationQuery) ExistX(ctx context.Context) bool

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

func (*ApplicationQuery) First

func (aq *ApplicationQuery) First(ctx context.Context) (*Application, error)

First returns the first Application entity in the query. Returns *NotFoundError when no application was found.

func (*ApplicationQuery) FirstID

func (aq *ApplicationQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first Application id in the query. Returns *NotFoundError when no id was found.

func (*ApplicationQuery) FirstX

func (aq *ApplicationQuery) FirstX(ctx context.Context) *Application

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

func (*ApplicationQuery) FirstXID

func (aq *ApplicationQuery) FirstXID(ctx context.Context) int

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

func (*ApplicationQuery) GroupBy

func (aq *ApplicationQuery) GroupBy(field string, fields ...string) *ApplicationGroupBy

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

client.Application.Query().
	GroupBy(application.FieldName).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*ApplicationQuery) IDs

func (aq *ApplicationQuery) IDs(ctx context.Context) ([]int, error)

IDs executes the query and returns a list of Application ids.

func (*ApplicationQuery) IDsX

func (aq *ApplicationQuery) IDsX(ctx context.Context) []int

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

func (*ApplicationQuery) Limit

func (aq *ApplicationQuery) Limit(limit int) *ApplicationQuery

Limit adds a limit step to the query.

func (*ApplicationQuery) Offset

func (aq *ApplicationQuery) Offset(offset int) *ApplicationQuery

Offset adds an offset step to the query.

func (*ApplicationQuery) Only

func (aq *ApplicationQuery) Only(ctx context.Context) (*Application, error)

Only returns the only Application entity in the query, returns an error if not exactly one entity was returned.

func (*ApplicationQuery) OnlyID

func (aq *ApplicationQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID returns the only Application id in the query, returns an error if not exactly one id was returned.

func (*ApplicationQuery) OnlyIDX

func (aq *ApplicationQuery) OnlyIDX(ctx context.Context) int

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

func (*ApplicationQuery) OnlyX

func (aq *ApplicationQuery) OnlyX(ctx context.Context) *Application

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

func (*ApplicationQuery) Order

func (aq *ApplicationQuery) Order(o ...OrderFunc) *ApplicationQuery

Order adds an order step to the query.

func (*ApplicationQuery) QueryGroups

func (aq *ApplicationQuery) QueryGroups() *GroupQuery

QueryGroups chains the current query on the groups edge.

func (*ApplicationQuery) QueryTags

func (aq *ApplicationQuery) QueryTags() *TagQuery

QueryTags chains the current query on the tags edge.

func (*ApplicationQuery) Select

func (aq *ApplicationQuery) Select(field string, fields ...string) *ApplicationSelect

Select one or more fields from the given query.

Example:

var v []struct {
	Name string `json:"name,omitempty"`
}

client.Application.Query().
	Select(application.FieldName).
	Scan(ctx, &v)

func (*ApplicationQuery) Where

Where adds a new predicate for the builder.

func (*ApplicationQuery) WithGroups

func (aq *ApplicationQuery) WithGroups(opts ...func(*GroupQuery)) *ApplicationQuery
WithGroups tells the query-builder to eager-loads the nodes that are connected to

the "groups" edge. The optional arguments used to configure the query builder of the edge.

func (*ApplicationQuery) WithTags

func (aq *ApplicationQuery) WithTags(opts ...func(*TagQuery)) *ApplicationQuery
WithTags tells the query-builder to eager-loads the nodes that are connected to

the "tags" edge. The optional arguments used to configure the query builder of the edge.

type ApplicationSelect

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

ApplicationSelect is the builder for select fields of Application entities.

func (*ApplicationSelect) Bool

func (as *ApplicationSelect) Bool(ctx context.Context) (_ bool, err error)

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

func (*ApplicationSelect) BoolX

func (as *ApplicationSelect) BoolX(ctx context.Context) bool

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

func (*ApplicationSelect) Bools

func (as *ApplicationSelect) Bools(ctx context.Context) ([]bool, error)

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

func (*ApplicationSelect) BoolsX

func (as *ApplicationSelect) BoolsX(ctx context.Context) []bool

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

func (*ApplicationSelect) Float64

func (as *ApplicationSelect) Float64(ctx context.Context) (_ float64, err error)

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

func (*ApplicationSelect) Float64X

func (as *ApplicationSelect) Float64X(ctx context.Context) float64

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

func (*ApplicationSelect) Float64s

func (as *ApplicationSelect) Float64s(ctx context.Context) ([]float64, error)

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

func (*ApplicationSelect) Float64sX

func (as *ApplicationSelect) Float64sX(ctx context.Context) []float64

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

func (*ApplicationSelect) Int

func (as *ApplicationSelect) Int(ctx context.Context) (_ int, err error)

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

func (*ApplicationSelect) IntX

func (as *ApplicationSelect) IntX(ctx context.Context) int

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

func (*ApplicationSelect) Ints

func (as *ApplicationSelect) Ints(ctx context.Context) ([]int, error)

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

func (*ApplicationSelect) IntsX

func (as *ApplicationSelect) IntsX(ctx context.Context) []int

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

func (*ApplicationSelect) Scan

func (as *ApplicationSelect) Scan(ctx context.Context, v interface{}) error

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

func (*ApplicationSelect) ScanX

func (as *ApplicationSelect) ScanX(ctx context.Context, v interface{})

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

func (*ApplicationSelect) String

func (as *ApplicationSelect) String(ctx context.Context) (_ string, err error)

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

func (*ApplicationSelect) StringX

func (as *ApplicationSelect) StringX(ctx context.Context) string

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

func (*ApplicationSelect) Strings

func (as *ApplicationSelect) Strings(ctx context.Context) ([]string, error)

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

func (*ApplicationSelect) StringsX

func (as *ApplicationSelect) StringsX(ctx context.Context) []string

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

type ApplicationUpdate

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

ApplicationUpdate is the builder for updating Application entities.

func (*ApplicationUpdate) AddGroupIDs

func (au *ApplicationUpdate) AddGroupIDs(ids ...int) *ApplicationUpdate

AddGroupIDs adds the groups edge to Group by ids.

func (*ApplicationUpdate) AddGroups

func (au *ApplicationUpdate) AddGroups(g ...*Group) *ApplicationUpdate

AddGroups adds the groups edges to Group.

func (*ApplicationUpdate) AddTagIDs

func (au *ApplicationUpdate) AddTagIDs(ids ...int) *ApplicationUpdate

AddTagIDs adds the tags edge to Tag by ids.

func (*ApplicationUpdate) AddTags

func (au *ApplicationUpdate) AddTags(t ...*Tag) *ApplicationUpdate

AddTags adds the tags edges to Tag.

func (*ApplicationUpdate) ClearGroups

func (au *ApplicationUpdate) ClearGroups() *ApplicationUpdate

ClearGroups clears all "groups" edges to type Group.

func (*ApplicationUpdate) ClearStartedAt

func (au *ApplicationUpdate) ClearStartedAt() *ApplicationUpdate

ClearStartedAt clears the value of started_at.

func (*ApplicationUpdate) ClearTags

func (au *ApplicationUpdate) ClearTags() *ApplicationUpdate

ClearTags clears all "tags" edges to type Tag.

func (*ApplicationUpdate) Exec

func (au *ApplicationUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*ApplicationUpdate) ExecX

func (au *ApplicationUpdate) ExecX(ctx context.Context)

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

func (*ApplicationUpdate) Mutation

func (au *ApplicationUpdate) Mutation() *ApplicationMutation

Mutation returns the ApplicationMutation object of the builder.

func (*ApplicationUpdate) RemoveGroupIDs

func (au *ApplicationUpdate) RemoveGroupIDs(ids ...int) *ApplicationUpdate

RemoveGroupIDs removes the groups edge to Group by ids.

func (*ApplicationUpdate) RemoveGroups

func (au *ApplicationUpdate) RemoveGroups(g ...*Group) *ApplicationUpdate

RemoveGroups removes groups edges to Group.

func (*ApplicationUpdate) RemoveTagIDs

func (au *ApplicationUpdate) RemoveTagIDs(ids ...int) *ApplicationUpdate

RemoveTagIDs removes the tags edge to Tag by ids.

func (*ApplicationUpdate) RemoveTags

func (au *ApplicationUpdate) RemoveTags(t ...*Tag) *ApplicationUpdate

RemoveTags removes tags edges to Tag.

func (*ApplicationUpdate) Save

func (au *ApplicationUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of rows/vertices matched by this operation.

func (*ApplicationUpdate) SaveX

func (au *ApplicationUpdate) SaveX(ctx context.Context) int

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

func (*ApplicationUpdate) SetCreatedAt

func (au *ApplicationUpdate) SetCreatedAt(t time.Time) *ApplicationUpdate

SetCreatedAt sets the created_at field.

func (*ApplicationUpdate) SetGomod

func (au *ApplicationUpdate) SetGomod(s string) *ApplicationUpdate

SetGomod sets the gomod field.

func (*ApplicationUpdate) SetGosum

func (au *ApplicationUpdate) SetGosum(s string) *ApplicationUpdate

SetGosum sets the gosum field.

func (*ApplicationUpdate) SetName

func (au *ApplicationUpdate) SetName(s string) *ApplicationUpdate

SetName sets the name field.

func (*ApplicationUpdate) SetNillableCreatedAt

func (au *ApplicationUpdate) SetNillableCreatedAt(t *time.Time) *ApplicationUpdate

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

func (*ApplicationUpdate) SetNillableGomod

func (au *ApplicationUpdate) SetNillableGomod(s *string) *ApplicationUpdate

SetNillableGomod sets the gomod field if the given value is not nil.

func (*ApplicationUpdate) SetNillableGosum

func (au *ApplicationUpdate) SetNillableGosum(s *string) *ApplicationUpdate

SetNillableGosum sets the gosum field if the given value is not nil.

func (*ApplicationUpdate) SetNillableStartedAt

func (au *ApplicationUpdate) SetNillableStartedAt(t *time.Time) *ApplicationUpdate

SetNillableStartedAt sets the started_at field if the given value is not nil.

func (*ApplicationUpdate) SetScenario

func (au *ApplicationUpdate) SetScenario(s string) *ApplicationUpdate

SetScenario sets the scenario field.

func (*ApplicationUpdate) SetStartedAt

func (au *ApplicationUpdate) SetStartedAt(t time.Time) *ApplicationUpdate

SetStartedAt sets the started_at field.

func (*ApplicationUpdate) SetStatus

func (au *ApplicationUpdate) SetStatus(s string) *ApplicationUpdate

SetStatus sets the status field.

func (*ApplicationUpdate) SetUpdatedAt

func (au *ApplicationUpdate) SetUpdatedAt(t time.Time) *ApplicationUpdate

SetUpdatedAt sets the updated_at field.

func (*ApplicationUpdate) Where

Where adds a new predicate for the builder.

type ApplicationUpdateOne

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

ApplicationUpdateOne is the builder for updating a single Application entity.

func (*ApplicationUpdateOne) AddGroupIDs

func (auo *ApplicationUpdateOne) AddGroupIDs(ids ...int) *ApplicationUpdateOne

AddGroupIDs adds the groups edge to Group by ids.

func (*ApplicationUpdateOne) AddGroups

func (auo *ApplicationUpdateOne) AddGroups(g ...*Group) *ApplicationUpdateOne

AddGroups adds the groups edges to Group.

func (*ApplicationUpdateOne) AddTagIDs

func (auo *ApplicationUpdateOne) AddTagIDs(ids ...int) *ApplicationUpdateOne

AddTagIDs adds the tags edge to Tag by ids.

func (*ApplicationUpdateOne) AddTags

func (auo *ApplicationUpdateOne) AddTags(t ...*Tag) *ApplicationUpdateOne

AddTags adds the tags edges to Tag.

func (*ApplicationUpdateOne) ClearGroups

func (auo *ApplicationUpdateOne) ClearGroups() *ApplicationUpdateOne

ClearGroups clears all "groups" edges to type Group.

func (*ApplicationUpdateOne) ClearStartedAt

func (auo *ApplicationUpdateOne) ClearStartedAt() *ApplicationUpdateOne

ClearStartedAt clears the value of started_at.

func (*ApplicationUpdateOne) ClearTags

func (auo *ApplicationUpdateOne) ClearTags() *ApplicationUpdateOne

ClearTags clears all "tags" edges to type Tag.

func (*ApplicationUpdateOne) Exec

func (auo *ApplicationUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*ApplicationUpdateOne) ExecX

func (auo *ApplicationUpdateOne) ExecX(ctx context.Context)

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

func (*ApplicationUpdateOne) Mutation

func (auo *ApplicationUpdateOne) Mutation() *ApplicationMutation

Mutation returns the ApplicationMutation object of the builder.

func (*ApplicationUpdateOne) RemoveGroupIDs

func (auo *ApplicationUpdateOne) RemoveGroupIDs(ids ...int) *ApplicationUpdateOne

RemoveGroupIDs removes the groups edge to Group by ids.

func (*ApplicationUpdateOne) RemoveGroups

func (auo *ApplicationUpdateOne) RemoveGroups(g ...*Group) *ApplicationUpdateOne

RemoveGroups removes groups edges to Group.

func (*ApplicationUpdateOne) RemoveTagIDs

func (auo *ApplicationUpdateOne) RemoveTagIDs(ids ...int) *ApplicationUpdateOne

RemoveTagIDs removes the tags edge to Tag by ids.

func (*ApplicationUpdateOne) RemoveTags

func (auo *ApplicationUpdateOne) RemoveTags(t ...*Tag) *ApplicationUpdateOne

RemoveTags removes tags edges to Tag.

func (*ApplicationUpdateOne) Save

Save executes the query and returns the updated entity.

func (*ApplicationUpdateOne) SaveX

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

func (*ApplicationUpdateOne) SetCreatedAt

func (auo *ApplicationUpdateOne) SetCreatedAt(t time.Time) *ApplicationUpdateOne

SetCreatedAt sets the created_at field.

func (*ApplicationUpdateOne) SetGomod

SetGomod sets the gomod field.

func (*ApplicationUpdateOne) SetGosum

SetGosum sets the gosum field.

func (*ApplicationUpdateOne) SetName

SetName sets the name field.

func (*ApplicationUpdateOne) SetNillableCreatedAt

func (auo *ApplicationUpdateOne) SetNillableCreatedAt(t *time.Time) *ApplicationUpdateOne

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

func (*ApplicationUpdateOne) SetNillableGomod

func (auo *ApplicationUpdateOne) SetNillableGomod(s *string) *ApplicationUpdateOne

SetNillableGomod sets the gomod field if the given value is not nil.

func (*ApplicationUpdateOne) SetNillableGosum

func (auo *ApplicationUpdateOne) SetNillableGosum(s *string) *ApplicationUpdateOne

SetNillableGosum sets the gosum field if the given value is not nil.

func (*ApplicationUpdateOne) SetNillableStartedAt

func (auo *ApplicationUpdateOne) SetNillableStartedAt(t *time.Time) *ApplicationUpdateOne

SetNillableStartedAt sets the started_at field if the given value is not nil.

func (*ApplicationUpdateOne) SetScenario

func (auo *ApplicationUpdateOne) SetScenario(s string) *ApplicationUpdateOne

SetScenario sets the scenario field.

func (*ApplicationUpdateOne) SetStartedAt

func (auo *ApplicationUpdateOne) SetStartedAt(t time.Time) *ApplicationUpdateOne

SetStartedAt sets the started_at field.

func (*ApplicationUpdateOne) SetStatus

SetStatus sets the status field.

func (*ApplicationUpdateOne) SetUpdatedAt

func (auo *ApplicationUpdateOne) SetUpdatedAt(t time.Time) *ApplicationUpdateOne

SetUpdatedAt sets the updated_at field.

type Applications

type Applications []*Application

Applications is a parsable slice of Application.

type Client

type Client struct {

	// Schema is the client for creating, migrating and dropping schema.
	Schema *migrate.Schema
	// Application is the client for interacting with the Application builders.
	Application *ApplicationClient
	// Counter is the client for interacting with the Counter builders.
	Counter *CounterClient
	// Gauge is the client for interacting with the Gauge builders.
	Gauge *GaugeClient
	// Graph is the client for interacting with the Graph builders.
	Graph *GraphClient
	// Group is the client for interacting with the Group builders.
	Group *GroupClient
	// Histogram is the client for interacting with the Histogram builders.
	Histogram *HistogramClient
	// Metric is the client for interacting with the Metric builders.
	Metric *MetricClient
	// Tag is the client for interacting with the Tag builders.
	Tag *TagClient
	// contains filtered or unexported fields
}

Client is the client that holds all ent builders.

func FromContext

func FromContext(ctx context.Context) *Client

FromContext returns the Client stored in 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 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().
	Application.
	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 Counter

type Counter struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// Time holds the value of the "time" field.
	Time int64 `json:"time"`
	// Count holds the value of the "count" field.
	Count int64 `json:"count"`
	// WID holds the value of the "wID" field.
	WID string `json:"wId"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the CounterQuery when eager-loading is set.
	Edges CounterEdges `json:"edges"`
	// contains filtered or unexported fields
}

Counter is the model entity for the Counter schema.

func (*Counter) QueryMetric

func (c *Counter) QueryMetric() *MetricQuery

QueryMetric queries the metric edge of the Counter.

func (*Counter) String

func (c *Counter) String() string

String implements the fmt.Stringer.

func (*Counter) Unwrap

func (c *Counter) Unwrap() *Counter

Unwrap unwraps the entity that was returned from a transaction after it was closed, so that all next queries will be executed through the driver which created the transaction.

func (*Counter) Update

func (c *Counter) Update() *CounterUpdateOne

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

type CounterClient

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

CounterClient is a client for the Counter schema.

func NewCounterClient

func NewCounterClient(c config) *CounterClient

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

func (*CounterClient) Create

func (c *CounterClient) Create() *CounterCreate

Create returns a create builder for Counter.

func (*CounterClient) CreateBulk

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

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

func (*CounterClient) Delete

func (c *CounterClient) Delete() *CounterDelete

Delete returns a delete builder for Counter.

func (*CounterClient) DeleteOne

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

DeleteOne returns a delete builder for the given entity.

func (*CounterClient) DeleteOneID

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

DeleteOneID returns a delete builder for the given id.

func (*CounterClient) Get

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

Get returns a Counter entity by its id.

func (*CounterClient) GetX

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

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

func (*CounterClient) Hooks

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

Hooks returns the client hooks.

func (*CounterClient) Query

func (c *CounterClient) Query() *CounterQuery

Query returns a query builder for Counter.

func (*CounterClient) QueryMetric

func (c *CounterClient) QueryMetric(co *Counter) *MetricQuery

QueryMetric queries the metric edge of a Counter.

func (*CounterClient) Update

func (c *CounterClient) Update() *CounterUpdate

Update returns an update builder for Counter.

func (*CounterClient) UpdateOne

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

UpdateOne returns an update builder for the given entity.

func (*CounterClient) UpdateOneID

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

UpdateOneID returns an update builder for the given id.

func (*CounterClient) Use

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

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

type CounterCreate

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

CounterCreate is the builder for creating a Counter entity.

func (*CounterCreate) Mutation

func (cc *CounterCreate) Mutation() *CounterMutation

Mutation returns the CounterMutation object of the builder.

func (*CounterCreate) Save

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

Save creates the Counter in the database.

func (*CounterCreate) SaveX

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

SaveX calls Save and panics if Save returns an error.

func (*CounterCreate) SetCount

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

SetCount sets the count field.

func (*CounterCreate) SetMetric

func (cc *CounterCreate) SetMetric(m *Metric) *CounterCreate

SetMetric sets the metric edge to Metric.

func (*CounterCreate) SetMetricID

func (cc *CounterCreate) SetMetricID(id int) *CounterCreate

SetMetricID sets the metric edge to Metric by id.

func (*CounterCreate) SetNillableMetricID

func (cc *CounterCreate) SetNillableMetricID(id *int) *CounterCreate

SetNillableMetricID sets the metric edge to Metric by id if the given value is not nil.

func (*CounterCreate) SetTime

func (cc *CounterCreate) SetTime(i int64) *CounterCreate

SetTime sets the time field.

func (*CounterCreate) SetWID

func (cc *CounterCreate) SetWID(s string) *CounterCreate

SetWID sets the wID field.

type CounterCreateBulk

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

CounterCreateBulk is the builder for creating a bulk of Counter entities.

func (*CounterCreateBulk) Save

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

Save creates the Counter entities in the database.

func (*CounterCreateBulk) SaveX

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

SaveX calls Save and panics if Save returns an error.

type CounterDelete

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

CounterDelete is the builder for deleting a Counter entity.

func (*CounterDelete) Exec

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

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

func (*CounterDelete) ExecX

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

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

func (*CounterDelete) Where

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

Where adds a new predicate to the delete builder.

type CounterDeleteOne

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

CounterDeleteOne is the builder for deleting a single Counter entity.

func (*CounterDeleteOne) Exec

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

Exec executes the deletion query.

func (*CounterDeleteOne) ExecX

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

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

type CounterEdges

type CounterEdges struct {
	// Metric holds the value of the metric edge.
	Metric *Metric
	// contains filtered or unexported fields
}

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

func (CounterEdges) MetricOrErr

func (e CounterEdges) MetricOrErr() (*Metric, error)

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

type CounterGroupBy

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

CounterGroupBy is the builder for group-by Counter entities.

func (*CounterGroupBy) Aggregate

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

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

func (*CounterGroupBy) Bool

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

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

func (*CounterGroupBy) BoolX

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

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

func (*CounterGroupBy) Bools

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

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

func (*CounterGroupBy) BoolsX

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

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

func (*CounterGroupBy) Float64

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

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

func (*CounterGroupBy) Float64X

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

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

func (*CounterGroupBy) Float64s

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

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

func (*CounterGroupBy) Float64sX

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

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

func (*CounterGroupBy) Int

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

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

func (*CounterGroupBy) IntX

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

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

func (*CounterGroupBy) Ints

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

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

func (*CounterGroupBy) IntsX

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

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

func (*CounterGroupBy) Scan

func (cgb *CounterGroupBy) Scan(ctx context.Context, v interface{}) error

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

func (*CounterGroupBy) ScanX

func (cgb *CounterGroupBy) ScanX(ctx context.Context, v interface{})

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

func (*CounterGroupBy) String

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

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

func (*CounterGroupBy) StringX

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

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

func (*CounterGroupBy) Strings

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

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

func (*CounterGroupBy) StringsX

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

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

type CounterMutation

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

CounterMutation represents an operation that mutate the Counters nodes in the graph.

func (*CounterMutation) AddCount

func (m *CounterMutation) AddCount(i int64)

AddCount adds i to count.

func (*CounterMutation) AddField

func (m *CounterMutation) AddField(name string, value ent.Value) error

AddField adds the value for the given name. It returns an error if the field is not defined in the schema, or if the type mismatch the field type.

func (*CounterMutation) AddTime

func (m *CounterMutation) AddTime(i int64)

AddTime adds i to time.

func (*CounterMutation) AddedCount

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

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

func (*CounterMutation) AddedEdges

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

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

func (*CounterMutation) AddedField

func (m *CounterMutation) AddedField(name string) (ent.Value, bool)

AddedField returns the numeric value that was in/decremented from a field with the given name. The second value indicates that this field was not set, or was not define in the schema.

func (*CounterMutation) AddedFields

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

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

func (*CounterMutation) AddedIDs

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

AddedIDs returns all ids (to other nodes) that were added for the given edge name.

func (*CounterMutation) AddedTime

func (m *CounterMutation) AddedTime() (r int64, exists bool)

AddedTime returns the value that was added to the time field in this mutation.

func (*CounterMutation) ClearEdge

func (m *CounterMutation) ClearEdge(name string) error

ClearEdge clears the value for the given name. It returns an error if the edge name is not defined in the schema.

func (*CounterMutation) ClearField

func (m *CounterMutation) ClearField(name string) error

ClearField clears the value for the given name. It returns an error if the field is not defined in the schema.

func (*CounterMutation) ClearMetric

func (m *CounterMutation) ClearMetric()

ClearMetric clears the metric edge to Metric.

func (*CounterMutation) ClearedEdges

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

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

func (*CounterMutation) ClearedFields

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

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

func (CounterMutation) Client

func (m CounterMutation) Client() *Client

Client returns a new `ent.Client` from the mutation. If the mutation was executed in a transaction (ent.Tx), a transactional client is returned.

func (*CounterMutation) Count

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

Count returns the count value in the mutation.

func (*CounterMutation) EdgeCleared

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

EdgeCleared returns a boolean indicates if this edge was cleared in this mutation.

func (*CounterMutation) Field

func (m *CounterMutation) Field(name string) (ent.Value, bool)

Field returns the value of a field with the given name. The second boolean value indicates that this field was not set, or was not define in the schema.

func (*CounterMutation) FieldCleared

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

FieldCleared returns a boolean indicates if this field was cleared in this mutation.

func (*CounterMutation) Fields

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

Fields returns all fields that were changed during this mutation. Note that, in order to get all numeric fields that were in/decremented, call AddedFields().

func (*CounterMutation) ID

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

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

func (*CounterMutation) MetricCleared

func (m *CounterMutation) MetricCleared() bool

MetricCleared returns if the edge metric was cleared.

func (*CounterMutation) MetricID

func (m *CounterMutation) MetricID() (id int, exists bool)

MetricID returns the metric id in the mutation.

func (*CounterMutation) MetricIDs

func (m *CounterMutation) MetricIDs() (ids []int)

MetricIDs returns the metric ids in the mutation. Note that ids always returns len(ids) <= 1 for unique edges, and you should use MetricID instead. It exists only for internal usage by the builders.

func (*CounterMutation) OldCount

func (m *CounterMutation) OldCount(ctx context.Context) (v int64, err error)

OldCount returns the old count value of the Counter. If the Counter object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or database query fails.

func (*CounterMutation) OldField

func (m *CounterMutation) OldField(ctx context.Context, name string) (ent.Value, error)

OldField returns the old value of the field from the database. An error is returned if the mutation operation is not UpdateOne, or the query to the database was failed.

func (*CounterMutation) OldTime

func (m *CounterMutation) OldTime(ctx context.Context) (v int64, err error)

OldTime returns the old time value of the Counter. If the Counter object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or database query fails.

func (*CounterMutation) OldWID

func (m *CounterMutation) OldWID(ctx context.Context) (v string, err error)

OldWID returns the old wID value of the Counter. If the Counter object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or database query fails.

func (*CounterMutation) Op

func (m *CounterMutation) Op() Op

Op returns the operation name.

func (*CounterMutation) RemovedEdges

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

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

func (*CounterMutation) RemovedIDs

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

RemovedIDs returns all ids (to other nodes) that were removed for the given edge name.

func (*CounterMutation) ResetCount

func (m *CounterMutation) ResetCount()

ResetCount reset all changes of the "count" field.

func (*CounterMutation) ResetEdge

func (m *CounterMutation) ResetEdge(name string) error

ResetEdge resets all changes in the mutation regarding the given edge name. It returns an error if the edge is not defined in the schema.

func (*CounterMutation) ResetField

func (m *CounterMutation) ResetField(name string) error

ResetField resets all changes in the mutation regarding the given field name. It returns an error if the field is not defined in the schema.

func (*CounterMutation) ResetMetric

func (m *CounterMutation) ResetMetric()

ResetMetric reset all changes of the "metric" edge.

func (*CounterMutation) ResetTime

func (m *CounterMutation) ResetTime()

ResetTime reset all changes of the "time" field.

func (*CounterMutation) ResetWID

func (m *CounterMutation) ResetWID()

ResetWID reset all changes of the "wID" field.

func (*CounterMutation) SetCount

func (m *CounterMutation) SetCount(i int64)

SetCount sets the count field.

func (*CounterMutation) SetField

func (m *CounterMutation) SetField(name string, value ent.Value) error

SetField sets the value for the given name. It returns an error if the field is not defined in the schema, or if the type mismatch the field type.

func (*CounterMutation) SetMetricID

func (m *CounterMutation) SetMetricID(id int)

SetMetricID sets the metric edge to Metric by id.

func (*CounterMutation) SetTime

func (m *CounterMutation) SetTime(i int64)

SetTime sets the time field.

func (*CounterMutation) SetWID

func (m *CounterMutation) SetWID(s string)

SetWID sets the wID field.

func (*CounterMutation) Time

func (m *CounterMutation) Time() (r int64, exists bool)

Time returns the time value in the mutation.

func (CounterMutation) Tx

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

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

func (*CounterMutation) Type

func (m *CounterMutation) Type() string

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

func (*CounterMutation) WID

func (m *CounterMutation) WID() (r string, exists bool)

WID returns the wID value in the mutation.

type CounterQuery

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

CounterQuery is the builder for querying Counter entities.

func (*CounterQuery) All

func (cq *CounterQuery) All(ctx context.Context) ([]*Counter, error)

All executes the query and returns a list of Counters.

func (*CounterQuery) AllX

func (cq *CounterQuery) AllX(ctx context.Context) []*Counter

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

func (*CounterQuery) Clone

func (cq *CounterQuery) Clone() *CounterQuery

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

func (*CounterQuery) Count

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

Count returns the count of the given query.

func (*CounterQuery) CountX

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

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

func (*CounterQuery) Exist

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

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

func (*CounterQuery) ExistX

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

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

func (*CounterQuery) First

func (cq *CounterQuery) First(ctx context.Context) (*Counter, error)

First returns the first Counter entity in the query. Returns *NotFoundError when no counter was found.

func (*CounterQuery) FirstID

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

FirstID returns the first Counter id in the query. Returns *NotFoundError when no id was found.

func (*CounterQuery) FirstX

func (cq *CounterQuery) FirstX(ctx context.Context) *Counter

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

func (*CounterQuery) FirstXID

func (cq *CounterQuery) FirstXID(ctx context.Context) int

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

func (*CounterQuery) GroupBy

func (cq *CounterQuery) GroupBy(field string, fields ...string) *CounterGroupBy

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

client.Counter.Query().
	GroupBy(counter.FieldTime).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*CounterQuery) IDs

func (cq *CounterQuery) IDs(ctx context.Context) ([]int, error)

IDs executes the query and returns a list of Counter ids.

func (*CounterQuery) IDsX

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

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

func (*CounterQuery) Limit

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

Limit adds a limit step to the query.

func (*CounterQuery) Offset

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

Offset adds an offset step to the query.

func (*CounterQuery) Only

func (cq *CounterQuery) Only(ctx context.Context) (*Counter, error)

Only returns the only Counter entity in the query, returns an error if not exactly one entity was returned.

func (*CounterQuery) OnlyID

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

OnlyID returns the only Counter id in the query, returns an error if not exactly one id was returned.

func (*CounterQuery) OnlyIDX

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

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

func (*CounterQuery) OnlyX

func (cq *CounterQuery) OnlyX(ctx context.Context) *Counter

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

func (*CounterQuery) Order

func (cq *CounterQuery) Order(o ...OrderFunc) *CounterQuery

Order adds an order step to the query.

func (*CounterQuery) QueryMetric

func (cq *CounterQuery) QueryMetric() *MetricQuery

QueryMetric chains the current query on the metric edge.

func (*CounterQuery) Select

func (cq *CounterQuery) Select(field string, fields ...string) *CounterSelect

Select one or more fields from the given query.

Example:

var v []struct {
	Time int64 `json:"time"`
}

client.Counter.Query().
	Select(counter.FieldTime).
	Scan(ctx, &v)

func (*CounterQuery) Where

func (cq *CounterQuery) Where(ps ...predicate.Counter) *CounterQuery

Where adds a new predicate for the builder.

func (*CounterQuery) WithMetric

func (cq *CounterQuery) WithMetric(opts ...func(*MetricQuery)) *CounterQuery
WithMetric tells the query-builder to eager-loads the nodes that are connected to

the "metric" edge. The optional arguments used to configure the query builder of the edge.

type CounterSelect

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

CounterSelect is the builder for select fields of Counter entities.

func (*CounterSelect) Bool

func (cs *CounterSelect) Bool(ctx context.Context) (_ bool, err error)

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

func (*CounterSelect) BoolX

func (cs *CounterSelect) BoolX(ctx context.Context) bool

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

func (*CounterSelect) Bools

func (cs *CounterSelect) Bools(ctx context.Context) ([]bool, error)

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

func (*CounterSelect) BoolsX

func (cs *CounterSelect) BoolsX(ctx context.Context) []bool

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

func (*CounterSelect) Float64

func (cs *CounterSelect) Float64(ctx context.Context) (_ float64, err error)

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

func (*CounterSelect) Float64X

func (cs *CounterSelect) Float64X(ctx context.Context) float64

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

func (*CounterSelect) Float64s

func (cs *CounterSelect) Float64s(ctx context.Context) ([]float64, error)

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

func (*CounterSelect) Float64sX

func (cs *CounterSelect) Float64sX(ctx context.Context) []float64

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

func (*CounterSelect) Int

func (cs *CounterSelect) Int(ctx context.Context) (_ int, err error)

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

func (*CounterSelect) IntX

func (cs *CounterSelect) IntX(ctx context.Context) int

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

func (*CounterSelect) Ints

func (cs *CounterSelect) Ints(ctx context.Context) ([]int, error)

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

func (*CounterSelect) IntsX

func (cs *CounterSelect) IntsX(ctx context.Context) []int

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

func (*CounterSelect) Scan

func (cs *CounterSelect) Scan(ctx context.Context, v interface{}) error

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

func (*CounterSelect) ScanX

func (cs *CounterSelect) ScanX(ctx context.Context, v interface{})

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

func (*CounterSelect) String

func (cs *CounterSelect) String(ctx context.Context) (_ string, err error)

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

func (*CounterSelect) StringX

func (cs *CounterSelect) StringX(ctx context.Context) string

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

func (*CounterSelect) Strings

func (cs *CounterSelect) Strings(ctx context.Context) ([]string, error)

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

func (*CounterSelect) StringsX

func (cs *CounterSelect) StringsX(ctx context.Context) []string

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

type CounterUpdate

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

CounterUpdate is the builder for updating Counter entities.

func (*CounterUpdate) AddCount

func (cu *CounterUpdate) AddCount(i int64) *CounterUpdate

AddCount adds i to count.

func (*CounterUpdate) AddTime

func (cu *CounterUpdate) AddTime(i int64) *CounterUpdate

AddTime adds i to time.

func (*CounterUpdate) ClearMetric

func (cu *CounterUpdate) ClearMetric() *CounterUpdate

ClearMetric clears the "metric" edge to type Metric.

func (*CounterUpdate) Exec

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

Exec executes the query.

func (*CounterUpdate) ExecX

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

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

func (*CounterUpdate) Mutation

func (cu *CounterUpdate) Mutation() *CounterMutation

Mutation returns the CounterMutation object of the builder.

func (*CounterUpdate) Save

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

Save executes the query and returns the number of rows/vertices matched by this operation.

func (*CounterUpdate) SaveX

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

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

func (*CounterUpdate) SetCount

func (cu *CounterUpdate) SetCount(i int64) *CounterUpdate

SetCount sets the count field.

func (*CounterUpdate) SetMetric

func (cu *CounterUpdate) SetMetric(m *Metric) *CounterUpdate

SetMetric sets the metric edge to Metric.

func (*CounterUpdate) SetMetricID

func (cu *CounterUpdate) SetMetricID(id int) *CounterUpdate

SetMetricID sets the metric edge to Metric by id.

func (*CounterUpdate) SetNillableMetricID

func (cu *CounterUpdate) SetNillableMetricID(id *int) *CounterUpdate

SetNillableMetricID sets the metric edge to Metric by id if the given value is not nil.

func (*CounterUpdate) SetTime

func (cu *CounterUpdate) SetTime(i int64) *CounterUpdate

SetTime sets the time field.

func (*CounterUpdate) SetWID

func (cu *CounterUpdate) SetWID(s string) *CounterUpdate

SetWID sets the wID field.

func (*CounterUpdate) Where

func (cu *CounterUpdate) Where(ps ...predicate.Counter) *CounterUpdate

Where adds a new predicate for the builder.

type CounterUpdateOne

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

CounterUpdateOne is the builder for updating a single Counter entity.

func (*CounterUpdateOne) AddCount

func (cuo *CounterUpdateOne) AddCount(i int64) *CounterUpdateOne

AddCount adds i to count.

func (*CounterUpdateOne) AddTime

func (cuo *CounterUpdateOne) AddTime(i int64) *CounterUpdateOne

AddTime adds i to time.

func (*CounterUpdateOne) ClearMetric

func (cuo *CounterUpdateOne) ClearMetric() *CounterUpdateOne

ClearMetric clears the "metric" edge to type Metric.

func (*CounterUpdateOne) Exec

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

Exec executes the query on the entity.

func (*CounterUpdateOne) ExecX

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

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

func (*CounterUpdateOne) Mutation

func (cuo *CounterUpdateOne) Mutation() *CounterMutation

Mutation returns the CounterMutation object of the builder.

func (*CounterUpdateOne) Save

func (cuo *CounterUpdateOne) Save(ctx context.Context) (*Counter, error)

Save executes the query and returns the updated entity.

func (*CounterUpdateOne) SaveX

func (cuo *CounterUpdateOne) SaveX(ctx context.Context) *Counter

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

func (*CounterUpdateOne) SetCount

func (cuo *CounterUpdateOne) SetCount(i int64) *CounterUpdateOne

SetCount sets the count field.

func (*CounterUpdateOne) SetMetric

func (cuo *CounterUpdateOne) SetMetric(m *Metric) *CounterUpdateOne

SetMetric sets the metric edge to Metric.

func (*CounterUpdateOne) SetMetricID

func (cuo *CounterUpdateOne) SetMetricID(id int) *CounterUpdateOne

SetMetricID sets the metric edge to Metric by id.

func (*CounterUpdateOne) SetNillableMetricID

func (cuo *CounterUpdateOne) SetNillableMetricID(id *int) *CounterUpdateOne

SetNillableMetricID sets the metric edge to Metric by id if the given value is not nil.

func (*CounterUpdateOne) SetTime

func (cuo *CounterUpdateOne) SetTime(i int64) *CounterUpdateOne

SetTime sets the time field.

func (*CounterUpdateOne) SetWID

func (cuo *CounterUpdateOne) SetWID(s string) *CounterUpdateOne

SetWID sets the wID field.

type Counters

type Counters []*Counter

Counters is a parsable slice of Counter.

type Gauge

type Gauge struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// Time holds the value of the "time" field.
	Time int64 `json:"time"`
	// Value holds the value of the "value" field.
	Value int64 `json:"value"`
	// WID holds the value of the "wID" field.
	WID string `json:"wId"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the GaugeQuery when eager-loading is set.
	Edges GaugeEdges `json:"edges"`
	// contains filtered or unexported fields
}

Gauge is the model entity for the Gauge schema.

func (*Gauge) QueryMetric

func (ga *Gauge) QueryMetric() *MetricQuery

QueryMetric queries the metric edge of the Gauge.

func (*Gauge) String

func (ga *Gauge) String() string

String implements the fmt.Stringer.

func (*Gauge) Unwrap

func (ga *Gauge) Unwrap() *Gauge

Unwrap unwraps the entity that was returned from a transaction after it was closed, so that all next queries will be executed through the driver which created the transaction.

func (*Gauge) Update

func (ga *Gauge) Update() *GaugeUpdateOne

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

type GaugeClient

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

GaugeClient is a client for the Gauge schema.

func NewGaugeClient

func NewGaugeClient(c config) *GaugeClient

NewGaugeClient returns a client for the Gauge from the given config.

func (*GaugeClient) Create

func (c *GaugeClient) Create() *GaugeCreate

Create returns a create builder for Gauge.

func (*GaugeClient) CreateBulk

func (c *GaugeClient) CreateBulk(builders ...*GaugeCreate) *GaugeCreateBulk

BulkCreate returns a builder for creating a bulk of Gauge entities.

func (*GaugeClient) Delete

func (c *GaugeClient) Delete() *GaugeDelete

Delete returns a delete builder for Gauge.

func (*GaugeClient) DeleteOne

func (c *GaugeClient) DeleteOne(ga *Gauge) *GaugeDeleteOne

DeleteOne returns a delete builder for the given entity.

func (*GaugeClient) DeleteOneID

func (c *GaugeClient) DeleteOneID(id int) *GaugeDeleteOne

DeleteOneID returns a delete builder for the given id.

func (*GaugeClient) Get

func (c *GaugeClient) Get(ctx context.Context, id int) (*Gauge, error)

Get returns a Gauge entity by its id.

func (*GaugeClient) GetX

func (c *GaugeClient) GetX(ctx context.Context, id int) *Gauge

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

func (*GaugeClient) Hooks

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

Hooks returns the client hooks.

func (*GaugeClient) Query

func (c *GaugeClient) Query() *GaugeQuery

Query returns a query builder for Gauge.

func (*GaugeClient) QueryMetric

func (c *GaugeClient) QueryMetric(ga *Gauge) *MetricQuery

QueryMetric queries the metric edge of a Gauge.

func (*GaugeClient) Update

func (c *GaugeClient) Update() *GaugeUpdate

Update returns an update builder for Gauge.

func (*GaugeClient) UpdateOne

func (c *GaugeClient) UpdateOne(ga *Gauge) *GaugeUpdateOne

UpdateOne returns an update builder for the given entity.

func (*GaugeClient) UpdateOneID

func (c *GaugeClient) UpdateOneID(id int) *GaugeUpdateOne

UpdateOneID returns an update builder for the given id.

func (*GaugeClient) Use

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

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

type GaugeCreate

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

GaugeCreate is the builder for creating a Gauge entity.

func (*GaugeCreate) Mutation

func (gc *GaugeCreate) Mutation() *GaugeMutation

Mutation returns the GaugeMutation object of the builder.

func (*GaugeCreate) Save

func (gc *GaugeCreate) Save(ctx context.Context) (*Gauge, error)

Save creates the Gauge in the database.

func (*GaugeCreate) SaveX

func (gc *GaugeCreate) SaveX(ctx context.Context) *Gauge

SaveX calls Save and panics if Save returns an error.

func (*GaugeCreate) SetMetric

func (gc *GaugeCreate) SetMetric(m *Metric) *GaugeCreate

SetMetric sets the metric edge to Metric.

func (*GaugeCreate) SetMetricID

func (gc *GaugeCreate) SetMetricID(id int) *GaugeCreate

SetMetricID sets the metric edge to Metric by id.

func (*GaugeCreate) SetNillableMetricID

func (gc *GaugeCreate) SetNillableMetricID(id *int) *GaugeCreate

SetNillableMetricID sets the metric edge to Metric by id if the given value is not nil.

func (*GaugeCreate) SetTime

func (gc *GaugeCreate) SetTime(i int64) *GaugeCreate

SetTime sets the time field.

func (*GaugeCreate) SetValue

func (gc *GaugeCreate) SetValue(i int64) *GaugeCreate

SetValue sets the value field.

func (*GaugeCreate) SetWID

func (gc *GaugeCreate) SetWID(s string) *GaugeCreate

SetWID sets the wID field.

type GaugeCreateBulk

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

GaugeCreateBulk is the builder for creating a bulk of Gauge entities.

func (*GaugeCreateBulk) Save

func (gcb *GaugeCreateBulk) Save(ctx context.Context) ([]*Gauge, error)

Save creates the Gauge entities in the database.

func (*GaugeCreateBulk) SaveX

func (gcb *GaugeCreateBulk) SaveX(ctx context.Context) []*Gauge

SaveX calls Save and panics if Save returns an error.

type GaugeDelete

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

GaugeDelete is the builder for deleting a Gauge entity.

func (*GaugeDelete) Exec

func (gd *GaugeDelete) Exec(ctx context.Context) (int, error)

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

func (*GaugeDelete) ExecX

func (gd *GaugeDelete) ExecX(ctx context.Context) int

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

func (*GaugeDelete) Where

func (gd *GaugeDelete) Where(ps ...predicate.Gauge) *GaugeDelete

Where adds a new predicate to the delete builder.

type GaugeDeleteOne

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

GaugeDeleteOne is the builder for deleting a single Gauge entity.

func (*GaugeDeleteOne) Exec

func (gdo *GaugeDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*GaugeDeleteOne) ExecX

func (gdo *GaugeDeleteOne) ExecX(ctx context.Context)

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

type GaugeEdges

type GaugeEdges struct {
	// Metric holds the value of the metric edge.
	Metric *Metric
	// contains filtered or unexported fields
}

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

func (GaugeEdges) MetricOrErr

func (e GaugeEdges) MetricOrErr() (*Metric, error)

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

type GaugeGroupBy

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

GaugeGroupBy is the builder for group-by Gauge entities.

func (*GaugeGroupBy) Aggregate

func (ggb *GaugeGroupBy) Aggregate(fns ...AggregateFunc) *GaugeGroupBy

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

func (*GaugeGroupBy) Bool

func (ggb *GaugeGroupBy) Bool(ctx context.Context) (_ bool, err error)

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

func (*GaugeGroupBy) BoolX

func (ggb *GaugeGroupBy) BoolX(ctx context.Context) bool

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

func (*GaugeGroupBy) Bools

func (ggb *GaugeGroupBy) Bools(ctx context.Context) ([]bool, error)

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

func (*GaugeGroupBy) BoolsX

func (ggb *GaugeGroupBy) BoolsX(ctx context.Context) []bool

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

func (*GaugeGroupBy) Float64

func (ggb *GaugeGroupBy) Float64(ctx context.Context) (_ float64, err error)

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

func (*GaugeGroupBy) Float64X

func (ggb *GaugeGroupBy) Float64X(ctx context.Context) float64

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

func (*GaugeGroupBy) Float64s

func (ggb *GaugeGroupBy) Float64s(ctx context.Context) ([]float64, error)

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

func (*GaugeGroupBy) Float64sX

func (ggb *GaugeGroupBy) Float64sX(ctx context.Context) []float64

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

func (*GaugeGroupBy) Int

func (ggb *GaugeGroupBy) Int(ctx context.Context) (_ int, err error)

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

func (*GaugeGroupBy) IntX

func (ggb *GaugeGroupBy) IntX(ctx context.Context) int

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

func (*GaugeGroupBy) Ints

func (ggb *GaugeGroupBy) Ints(ctx context.Context) ([]int, error)

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

func (*GaugeGroupBy) IntsX

func (ggb *GaugeGroupBy) IntsX(ctx context.Context) []int

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

func (*GaugeGroupBy) Scan

func (ggb *GaugeGroupBy) Scan(ctx context.Context, v interface{}) error

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

func (*GaugeGroupBy) ScanX

func (ggb *GaugeGroupBy) ScanX(ctx context.Context, v interface{})

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

func (*GaugeGroupBy) String

func (ggb *GaugeGroupBy) String(ctx context.Context) (_ string, err error)

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

func (*GaugeGroupBy) StringX

func (ggb *GaugeGroupBy) StringX(ctx context.Context) string

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

func (*GaugeGroupBy) Strings

func (ggb *GaugeGroupBy) Strings(ctx context.Context) ([]string, error)

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

func (*GaugeGroupBy) StringsX

func (ggb *GaugeGroupBy) StringsX(ctx context.Context) []string

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

type GaugeMutation

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

GaugeMutation represents an operation that mutate the Gauges nodes in the graph.

func (*GaugeMutation) AddField

func (m *GaugeMutation) AddField(name string, value ent.Value) error

AddField adds the value for the given name. It returns an error if the field is not defined in the schema, or if the type mismatch the field type.

func (*GaugeMutation) AddTime

func (m *GaugeMutation) AddTime(i int64)

AddTime adds i to time.

func (*GaugeMutation) AddValue

func (m *GaugeMutation) AddValue(i int64)

AddValue adds i to value.

func (*GaugeMutation) AddedEdges

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

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

func (*GaugeMutation) AddedField

func (m *GaugeMutation) AddedField(name string) (ent.Value, bool)

AddedField returns the numeric value that was in/decremented from a field with the given name. The second value indicates that this field was not set, or was not define in the schema.

func (*GaugeMutation) AddedFields

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

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

func (*GaugeMutation) AddedIDs

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

AddedIDs returns all ids (to other nodes) that were added for the given edge name.

func (*GaugeMutation) AddedTime

func (m *GaugeMutation) AddedTime() (r int64, exists bool)

AddedTime returns the value that was added to the time field in this mutation.

func (*GaugeMutation) AddedValue

func (m *GaugeMutation) AddedValue() (r int64, exists bool)

AddedValue returns the value that was added to the value field in this mutation.

func (*GaugeMutation) ClearEdge

func (m *GaugeMutation) ClearEdge(name string) error

ClearEdge clears the value for the given name. It returns an error if the edge name is not defined in the schema.

func (*GaugeMutation) ClearField

func (m *GaugeMutation) ClearField(name string) error

ClearField clears the value for the given name. It returns an error if the field is not defined in the schema.

func (*GaugeMutation) ClearMetric

func (m *GaugeMutation) ClearMetric()

ClearMetric clears the metric edge to Metric.

func (*GaugeMutation) ClearedEdges

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

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

func (*GaugeMutation) ClearedFields

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

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

func (GaugeMutation) Client

func (m GaugeMutation) 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 (*GaugeMutation) EdgeCleared

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

EdgeCleared returns a boolean indicates if this edge was cleared in this mutation.

func (*GaugeMutation) Field

func (m *GaugeMutation) Field(name string) (ent.Value, bool)

Field returns the value of a field with the given name. The second boolean value indicates that this field was not set, or was not define in the schema.

func (*GaugeMutation) FieldCleared

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

FieldCleared returns a boolean indicates if this field was cleared in this mutation.

func (*GaugeMutation) Fields

func (m *GaugeMutation) Fields() []string

Fields returns all fields that were changed during this mutation. Note that, in order to get all numeric fields that were in/decremented, call AddedFields().

func (*GaugeMutation) ID

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

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

func (*GaugeMutation) MetricCleared

func (m *GaugeMutation) MetricCleared() bool

MetricCleared returns if the edge metric was cleared.

func (*GaugeMutation) MetricID

func (m *GaugeMutation) MetricID() (id int, exists bool)

MetricID returns the metric id in the mutation.

func (*GaugeMutation) MetricIDs

func (m *GaugeMutation) MetricIDs() (ids []int)

MetricIDs returns the metric ids in the mutation. Note that ids always returns len(ids) <= 1 for unique edges, and you should use MetricID instead. It exists only for internal usage by the builders.

func (*GaugeMutation) OldField

func (m *GaugeMutation) 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 was failed.

func (*GaugeMutation) OldTime

func (m *GaugeMutation) OldTime(ctx context.Context) (v int64, err error)

OldTime returns the old time value of the Gauge. If the Gauge 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 database query fails.

func (*GaugeMutation) OldValue

func (m *GaugeMutation) OldValue(ctx context.Context) (v int64, err error)

OldValue returns the old value value of the Gauge. If the Gauge 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 database query fails.

func (*GaugeMutation) OldWID

func (m *GaugeMutation) OldWID(ctx context.Context) (v string, err error)

OldWID returns the old wID value of the Gauge. If the Gauge 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 database query fails.

func (*GaugeMutation) Op

func (m *GaugeMutation) Op() Op

Op returns the operation name.

func (*GaugeMutation) RemovedEdges

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

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

func (*GaugeMutation) RemovedIDs

func (m *GaugeMutation) RemovedIDs(name string) []ent.Value

RemovedIDs returns all ids (to other nodes) that were removed for the given edge name.

func (*GaugeMutation) ResetEdge

func (m *GaugeMutation) ResetEdge(name string) error

ResetEdge resets all changes in the mutation regarding the given edge name. It returns an error if the edge is not defined in the schema.

func (*GaugeMutation) ResetField

func (m *GaugeMutation) ResetField(name string) error

ResetField resets all changes in the mutation regarding the given field name. It returns an error if the field is not defined in the schema.

func (*GaugeMutation) ResetMetric

func (m *GaugeMutation) ResetMetric()

ResetMetric reset all changes of the "metric" edge.

func (*GaugeMutation) ResetTime

func (m *GaugeMutation) ResetTime()

ResetTime reset all changes of the "time" field.

func (*GaugeMutation) ResetValue

func (m *GaugeMutation) ResetValue()

ResetValue reset all changes of the "value" field.

func (*GaugeMutation) ResetWID

func (m *GaugeMutation) ResetWID()

ResetWID reset all changes of the "wID" field.

func (*GaugeMutation) SetField

func (m *GaugeMutation) SetField(name string, value ent.Value) error

SetField sets the value for the given name. It returns an error if the field is not defined in the schema, or if the type mismatch the field type.

func (*GaugeMutation) SetMetricID

func (m *GaugeMutation) SetMetricID(id int)

SetMetricID sets the metric edge to Metric by id.

func (*GaugeMutation) SetTime

func (m *GaugeMutation) SetTime(i int64)

SetTime sets the time field.

func (*GaugeMutation) SetValue

func (m *GaugeMutation) SetValue(i int64)

SetValue sets the value field.

func (*GaugeMutation) SetWID

func (m *GaugeMutation) SetWID(s string)

SetWID sets the wID field.

func (*GaugeMutation) Time

func (m *GaugeMutation) Time() (r int64, exists bool)

Time returns the time value in the mutation.

func (GaugeMutation) Tx

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

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

func (*GaugeMutation) Type

func (m *GaugeMutation) Type() string

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

func (*GaugeMutation) Value

func (m *GaugeMutation) Value() (r int64, exists bool)

Value returns the value value in the mutation.

func (*GaugeMutation) WID

func (m *GaugeMutation) WID() (r string, exists bool)

WID returns the wID value in the mutation.

type GaugeQuery

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

GaugeQuery is the builder for querying Gauge entities.

func (*GaugeQuery) All

func (gq *GaugeQuery) All(ctx context.Context) ([]*Gauge, error)

All executes the query and returns a list of Gauges.

func (*GaugeQuery) AllX

func (gq *GaugeQuery) AllX(ctx context.Context) []*Gauge

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

func (*GaugeQuery) Clone

func (gq *GaugeQuery) Clone() *GaugeQuery

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

func (*GaugeQuery) Count

func (gq *GaugeQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*GaugeQuery) CountX

func (gq *GaugeQuery) CountX(ctx context.Context) int

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

func (*GaugeQuery) Exist

func (gq *GaugeQuery) Exist(ctx context.Context) (bool, error)

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

func (*GaugeQuery) ExistX

func (gq *GaugeQuery) ExistX(ctx context.Context) bool

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

func (*GaugeQuery) First

func (gq *GaugeQuery) First(ctx context.Context) (*Gauge, error)

First returns the first Gauge entity in the query. Returns *NotFoundError when no gauge was found.

func (*GaugeQuery) FirstID

func (gq *GaugeQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first Gauge id in the query. Returns *NotFoundError when no id was found.

func (*GaugeQuery) FirstX

func (gq *GaugeQuery) FirstX(ctx context.Context) *Gauge

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

func (*GaugeQuery) FirstXID

func (gq *GaugeQuery) FirstXID(ctx context.Context) int

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

func (*GaugeQuery) GroupBy

func (gq *GaugeQuery) GroupBy(field string, fields ...string) *GaugeGroupBy

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

client.Gauge.Query().
	GroupBy(gauge.FieldTime).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*GaugeQuery) IDs

func (gq *GaugeQuery) IDs(ctx context.Context) ([]int, error)

IDs executes the query and returns a list of Gauge ids.

func (*GaugeQuery) IDsX

func (gq *GaugeQuery) IDsX(ctx context.Context) []int

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

func (*GaugeQuery) Limit

func (gq *GaugeQuery) Limit(limit int) *GaugeQuery

Limit adds a limit step to the query.

func (*GaugeQuery) Offset

func (gq *GaugeQuery) Offset(offset int) *GaugeQuery

Offset adds an offset step to the query.

func (*GaugeQuery) Only

func (gq *GaugeQuery) Only(ctx context.Context) (*Gauge, error)

Only returns the only Gauge entity in the query, returns an error if not exactly one entity was returned.

func (*GaugeQuery) OnlyID

func (gq *GaugeQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID returns the only Gauge id in the query, returns an error if not exactly one id was returned.

func (*GaugeQuery) OnlyIDX

func (gq *GaugeQuery) OnlyIDX(ctx context.Context) int

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

func (*GaugeQuery) OnlyX

func (gq *GaugeQuery) OnlyX(ctx context.Context) *Gauge

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

func (*GaugeQuery) Order

func (gq *GaugeQuery) Order(o ...OrderFunc) *GaugeQuery

Order adds an order step to the query.

func (*GaugeQuery) QueryMetric

func (gq *GaugeQuery) QueryMetric() *MetricQuery

QueryMetric chains the current query on the metric edge.

func (*GaugeQuery) Select

func (gq *GaugeQuery) Select(field string, fields ...string) *GaugeSelect

Select one or more fields from the given query.

Example:

var v []struct {
	Time int64 `json:"time"`
}

client.Gauge.Query().
	Select(gauge.FieldTime).
	Scan(ctx, &v)

func (*GaugeQuery) Where

func (gq *GaugeQuery) Where(ps ...predicate.Gauge) *GaugeQuery

Where adds a new predicate for the builder.

func (*GaugeQuery) WithMetric

func (gq *GaugeQuery) WithMetric(opts ...func(*MetricQuery)) *GaugeQuery
WithMetric tells the query-builder to eager-loads the nodes that are connected to

the "metric" edge. The optional arguments used to configure the query builder of the edge.

type GaugeSelect

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

GaugeSelect is the builder for select fields of Gauge entities.

func (*GaugeSelect) Bool

func (gs *GaugeSelect) Bool(ctx context.Context) (_ bool, err error)

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

func (*GaugeSelect) BoolX

func (gs *GaugeSelect) BoolX(ctx context.Context) bool

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

func (*GaugeSelect) Bools

func (gs *GaugeSelect) Bools(ctx context.Context) ([]bool, error)

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

func (*GaugeSelect) BoolsX

func (gs *GaugeSelect) BoolsX(ctx context.Context) []bool

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

func (*GaugeSelect) Float64

func (gs *GaugeSelect) Float64(ctx context.Context) (_ float64, err error)

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

func (*GaugeSelect) Float64X

func (gs *GaugeSelect) Float64X(ctx context.Context) float64

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

func (*GaugeSelect) Float64s

func (gs *GaugeSelect) Float64s(ctx context.Context) ([]float64, error)

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

func (*GaugeSelect) Float64sX

func (gs *GaugeSelect) Float64sX(ctx context.Context) []float64

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

func (*GaugeSelect) Int

func (gs *GaugeSelect) Int(ctx context.Context) (_ int, err error)

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

func (*GaugeSelect) IntX

func (gs *GaugeSelect) IntX(ctx context.Context) int

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

func (*GaugeSelect) Ints

func (gs *GaugeSelect) Ints(ctx context.Context) ([]int, error)

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

func (*GaugeSelect) IntsX

func (gs *GaugeSelect) IntsX(ctx context.Context) []int

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

func (*GaugeSelect) Scan

func (gs *GaugeSelect) Scan(ctx context.Context, v interface{}) error

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

func (*GaugeSelect) ScanX

func (gs *GaugeSelect) ScanX(ctx context.Context, v interface{})

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

func (*GaugeSelect) String

func (gs *GaugeSelect) String(ctx context.Context) (_ string, err error)

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

func (*GaugeSelect) StringX

func (gs *GaugeSelect) StringX(ctx context.Context) string

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

func (*GaugeSelect) Strings

func (gs *GaugeSelect) Strings(ctx context.Context) ([]string, error)

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

func (*GaugeSelect) StringsX

func (gs *GaugeSelect) StringsX(ctx context.Context) []string

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

type GaugeUpdate

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

GaugeUpdate is the builder for updating Gauge entities.

func (*GaugeUpdate) AddTime

func (gu *GaugeUpdate) AddTime(i int64) *GaugeUpdate

AddTime adds i to time.

func (*GaugeUpdate) AddValue

func (gu *GaugeUpdate) AddValue(i int64) *GaugeUpdate

AddValue adds i to value.

func (*GaugeUpdate) ClearMetric

func (gu *GaugeUpdate) ClearMetric() *GaugeUpdate

ClearMetric clears the "metric" edge to type Metric.

func (*GaugeUpdate) Exec

func (gu *GaugeUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*GaugeUpdate) ExecX

func (gu *GaugeUpdate) ExecX(ctx context.Context)

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

func (*GaugeUpdate) Mutation

func (gu *GaugeUpdate) Mutation() *GaugeMutation

Mutation returns the GaugeMutation object of the builder.

func (*GaugeUpdate) Save

func (gu *GaugeUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of rows/vertices matched by this operation.

func (*GaugeUpdate) SaveX

func (gu *GaugeUpdate) SaveX(ctx context.Context) int

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

func (*GaugeUpdate) SetMetric

func (gu *GaugeUpdate) SetMetric(m *Metric) *GaugeUpdate

SetMetric sets the metric edge to Metric.

func (*GaugeUpdate) SetMetricID

func (gu *GaugeUpdate) SetMetricID(id int) *GaugeUpdate

SetMetricID sets the metric edge to Metric by id.

func (*GaugeUpdate) SetNillableMetricID

func (gu *GaugeUpdate) SetNillableMetricID(id *int) *GaugeUpdate

SetNillableMetricID sets the metric edge to Metric by id if the given value is not nil.

func (*GaugeUpdate) SetTime

func (gu *GaugeUpdate) SetTime(i int64) *GaugeUpdate

SetTime sets the time field.

func (*GaugeUpdate) SetValue

func (gu *GaugeUpdate) SetValue(i int64) *GaugeUpdate

SetValue sets the value field.

func (*GaugeUpdate) SetWID

func (gu *GaugeUpdate) SetWID(s string) *GaugeUpdate

SetWID sets the wID field.

func (*GaugeUpdate) Where

func (gu *GaugeUpdate) Where(ps ...predicate.Gauge) *GaugeUpdate

Where adds a new predicate for the builder.

type GaugeUpdateOne

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

GaugeUpdateOne is the builder for updating a single Gauge entity.

func (*GaugeUpdateOne) AddTime

func (guo *GaugeUpdateOne) AddTime(i int64) *GaugeUpdateOne

AddTime adds i to time.

func (*GaugeUpdateOne) AddValue

func (guo *GaugeUpdateOne) AddValue(i int64) *GaugeUpdateOne

AddValue adds i to value.

func (*GaugeUpdateOne) ClearMetric

func (guo *GaugeUpdateOne) ClearMetric() *GaugeUpdateOne

ClearMetric clears the "metric" edge to type Metric.

func (*GaugeUpdateOne) Exec

func (guo *GaugeUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*GaugeUpdateOne) ExecX

func (guo *GaugeUpdateOne) ExecX(ctx context.Context)

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

func (*GaugeUpdateOne) Mutation

func (guo *GaugeUpdateOne) Mutation() *GaugeMutation

Mutation returns the GaugeMutation object of the builder.

func (*GaugeUpdateOne) Save

func (guo *GaugeUpdateOne) Save(ctx context.Context) (*Gauge, error)

Save executes the query and returns the updated entity.

func (*GaugeUpdateOne) SaveX

func (guo *GaugeUpdateOne) SaveX(ctx context.Context) *Gauge

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

func (*GaugeUpdateOne) SetMetric

func (guo *GaugeUpdateOne) SetMetric(m *Metric) *GaugeUpdateOne

SetMetric sets the metric edge to Metric.

func (*GaugeUpdateOne) SetMetricID

func (guo *GaugeUpdateOne) SetMetricID(id int) *GaugeUpdateOne

SetMetricID sets the metric edge to Metric by id.

func (*GaugeUpdateOne) SetNillableMetricID

func (guo *GaugeUpdateOne) SetNillableMetricID(id *int) *GaugeUpdateOne

SetNillableMetricID sets the metric edge to Metric by id if the given value is not nil.

func (*GaugeUpdateOne) SetTime

func (guo *GaugeUpdateOne) SetTime(i int64) *GaugeUpdateOne

SetTime sets the time field.

func (*GaugeUpdateOne) SetValue

func (guo *GaugeUpdateOne) SetValue(i int64) *GaugeUpdateOne

SetValue sets the value field.

func (*GaugeUpdateOne) SetWID

func (guo *GaugeUpdateOne) SetWID(s string) *GaugeUpdateOne

SetWID sets the wID field.

type Gauges

type Gauges []*Gauge

Gauges is a parsable slice of Gauge.

type Graph

type Graph struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// Title holds the value of the "title" field.
	Title string `json:"title"`
	// Unit holds the value of the "unit" field.
	Unit string `json:"unit"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the GraphQuery when eager-loading is set.
	Edges GraphEdges `json:"edges"`
	// contains filtered or unexported fields
}

Graph is the model entity for the Graph schema.

func (*Graph) QueryGroup

func (gr *Graph) QueryGroup() *GroupQuery

QueryGroup queries the group edge of the Graph.

func (*Graph) QueryMetrics

func (gr *Graph) QueryMetrics() *MetricQuery

QueryMetrics queries the metrics edge of the Graph.

func (*Graph) String

func (gr *Graph) String() string

String implements the fmt.Stringer.

func (*Graph) Unwrap

func (gr *Graph) Unwrap() *Graph

Unwrap unwraps the entity that was returned from a transaction after it was closed, so that all next queries will be executed through the driver which created the transaction.

func (*Graph) Update

func (gr *Graph) Update() *GraphUpdateOne

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

type GraphClient

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

GraphClient is a client for the Graph schema.

func NewGraphClient

func NewGraphClient(c config) *GraphClient

NewGraphClient returns a client for the Graph from the given config.

func (*GraphClient) Create

func (c *GraphClient) Create() *GraphCreate

Create returns a create builder for Graph.

func (*GraphClient) CreateBulk

func (c *GraphClient) CreateBulk(builders ...*GraphCreate) *GraphCreateBulk

BulkCreate returns a builder for creating a bulk of Graph entities.

func (*GraphClient) Delete

func (c *GraphClient) Delete() *GraphDelete

Delete returns a delete builder for Graph.

func (*GraphClient) DeleteOne

func (c *GraphClient) DeleteOne(gr *Graph) *GraphDeleteOne

DeleteOne returns a delete builder for the given entity.

func (*GraphClient) DeleteOneID

func (c *GraphClient) DeleteOneID(id int) *GraphDeleteOne

DeleteOneID returns a delete builder for the given id.

func (*GraphClient) Get

func (c *GraphClient) Get(ctx context.Context, id int) (*Graph, error)

Get returns a Graph entity by its id.

func (*GraphClient) GetX

func (c *GraphClient) GetX(ctx context.Context, id int) *Graph

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

func (*GraphClient) Hooks

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

Hooks returns the client hooks.

func (*GraphClient) Query

func (c *GraphClient) Query() *GraphQuery

Query returns a query builder for Graph.

func (*GraphClient) QueryGroup

func (c *GraphClient) QueryGroup(gr *Graph) *GroupQuery

QueryGroup queries the group edge of a Graph.

func (*GraphClient) QueryMetrics

func (c *GraphClient) QueryMetrics(gr *Graph) *MetricQuery

QueryMetrics queries the metrics edge of a Graph.

func (*GraphClient) Update

func (c *GraphClient) Update() *GraphUpdate

Update returns an update builder for Graph.

func (*GraphClient) UpdateOne

func (c *GraphClient) UpdateOne(gr *Graph) *GraphUpdateOne

UpdateOne returns an update builder for the given entity.

func (*GraphClient) UpdateOneID

func (c *GraphClient) UpdateOneID(id int) *GraphUpdateOne

UpdateOneID returns an update builder for the given id.

func (*GraphClient) Use

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

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

type GraphCreate

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

GraphCreate is the builder for creating a Graph entity.

func (*GraphCreate) AddMetricIDs

func (gc *GraphCreate) AddMetricIDs(ids ...int) *GraphCreate

AddMetricIDs adds the metrics edge to Metric by ids.

func (*GraphCreate) AddMetrics

func (gc *GraphCreate) AddMetrics(m ...*Metric) *GraphCreate

AddMetrics adds the metrics edges to Metric.

func (*GraphCreate) Mutation

func (gc *GraphCreate) Mutation() *GraphMutation

Mutation returns the GraphMutation object of the builder.

func (*GraphCreate) Save

func (gc *GraphCreate) Save(ctx context.Context) (*Graph, error)

Save creates the Graph in the database.

func (*GraphCreate) SaveX

func (gc *GraphCreate) SaveX(ctx context.Context) *Graph

SaveX calls Save and panics if Save returns an error.

func (*GraphCreate) SetGroup

func (gc *GraphCreate) SetGroup(g *Group) *GraphCreate

SetGroup sets the group edge to Group.

func (*GraphCreate) SetGroupID

func (gc *GraphCreate) SetGroupID(id int) *GraphCreate

SetGroupID sets the group edge to Group by id.

func (*GraphCreate) SetNillableGroupID

func (gc *GraphCreate) SetNillableGroupID(id *int) *GraphCreate

SetNillableGroupID sets the group edge to Group by id if the given value is not nil.

func (*GraphCreate) SetTitle

func (gc *GraphCreate) SetTitle(s string) *GraphCreate

SetTitle sets the title field.

func (*GraphCreate) SetUnit

func (gc *GraphCreate) SetUnit(s string) *GraphCreate

SetUnit sets the unit field.

type GraphCreateBulk

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

GraphCreateBulk is the builder for creating a bulk of Graph entities.

func (*GraphCreateBulk) Save

func (gcb *GraphCreateBulk) Save(ctx context.Context) ([]*Graph, error)

Save creates the Graph entities in the database.

func (*GraphCreateBulk) SaveX

func (gcb *GraphCreateBulk) SaveX(ctx context.Context) []*Graph

SaveX calls Save and panics if Save returns an error.

type GraphDelete

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

GraphDelete is the builder for deleting a Graph entity.

func (*GraphDelete) Exec

func (gd *GraphDelete) Exec(ctx context.Context) (int, error)

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

func (*GraphDelete) ExecX

func (gd *GraphDelete) ExecX(ctx context.Context) int

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

func (*GraphDelete) Where

func (gd *GraphDelete) Where(ps ...predicate.Graph) *GraphDelete

Where adds a new predicate to the delete builder.

type GraphDeleteOne

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

GraphDeleteOne is the builder for deleting a single Graph entity.

func (*GraphDeleteOne) Exec

func (gdo *GraphDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*GraphDeleteOne) ExecX

func (gdo *GraphDeleteOne) ExecX(ctx context.Context)

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

type GraphEdges

type GraphEdges struct {
	// Group holds the value of the group edge.
	Group *Group
	// Metrics holds the value of the metrics edge.
	Metrics []*Metric
	// contains filtered or unexported fields
}

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

func (GraphEdges) GroupOrErr

func (e GraphEdges) GroupOrErr() (*Group, error)

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

func (GraphEdges) MetricsOrErr

func (e GraphEdges) MetricsOrErr() ([]*Metric, error)

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

type GraphGroupBy

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

GraphGroupBy is the builder for group-by Graph entities.

func (*GraphGroupBy) Aggregate

func (ggb *GraphGroupBy) Aggregate(fns ...AggregateFunc) *GraphGroupBy

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

func (*GraphGroupBy) Bool

func (ggb *GraphGroupBy) Bool(ctx context.Context) (_ bool, err error)

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

func (*GraphGroupBy) BoolX

func (ggb *GraphGroupBy) BoolX(ctx context.Context) bool

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

func (*GraphGroupBy) Bools

func (ggb *GraphGroupBy) Bools(ctx context.Context) ([]bool, error)

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

func (*GraphGroupBy) BoolsX

func (ggb *GraphGroupBy) BoolsX(ctx context.Context) []bool

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

func (*GraphGroupBy) Float64

func (ggb *GraphGroupBy) Float64(ctx context.Context) (_ float64, err error)

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

func (*GraphGroupBy) Float64X

func (ggb *GraphGroupBy) Float64X(ctx context.Context) float64

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

func (*GraphGroupBy) Float64s

func (ggb *GraphGroupBy) Float64s(ctx context.Context) ([]float64, error)

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

func (*GraphGroupBy) Float64sX

func (ggb *GraphGroupBy) Float64sX(ctx context.Context) []float64

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

func (*GraphGroupBy) Int

func (ggb *GraphGroupBy) Int(ctx context.Context) (_ int, err error)

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

func (*GraphGroupBy) IntX

func (ggb *GraphGroupBy) IntX(ctx context.Context) int

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

func (*GraphGroupBy) Ints

func (ggb *GraphGroupBy) Ints(ctx context.Context) ([]int, error)

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

func (*GraphGroupBy) IntsX

func (ggb *GraphGroupBy) IntsX(ctx context.Context) []int

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

func (*GraphGroupBy) Scan

func (ggb *GraphGroupBy) Scan(ctx context.Context, v interface{}) error

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

func (*GraphGroupBy) ScanX

func (ggb *GraphGroupBy) ScanX(ctx context.Context, v interface{})

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

func (*GraphGroupBy) String

func (ggb *GraphGroupBy) String(ctx context.Context) (_ string, err error)

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

func (*GraphGroupBy) StringX

func (ggb *GraphGroupBy) StringX(ctx context.Context) string

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

func (*GraphGroupBy) Strings

func (ggb *GraphGroupBy) Strings(ctx context.Context) ([]string, error)

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

func (*GraphGroupBy) StringsX

func (ggb *GraphGroupBy) StringsX(ctx context.Context) []string

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

type GraphMutation

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

GraphMutation represents an operation that mutate the Graphs nodes in the graph.

func (*GraphMutation) AddField

func (m *GraphMutation) AddField(name string, value ent.Value) error

AddField adds the value for the given name. It returns an error if the field is not defined in the schema, or if the type mismatch the field type.

func (*GraphMutation) AddMetricIDs

func (m *GraphMutation) AddMetricIDs(ids ...int)

AddMetricIDs adds the metrics edge to Metric by ids.

func (*GraphMutation) AddedEdges

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

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

func (*GraphMutation) AddedField

func (m *GraphMutation) AddedField(name string) (ent.Value, bool)

AddedField returns the numeric value that was in/decremented from a field with the given name. The second value indicates that this field was not set, or was not define in the schema.

func (*GraphMutation) AddedFields

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

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

func (*GraphMutation) AddedIDs

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

AddedIDs returns all ids (to other nodes) that were added for the given edge name.

func (*GraphMutation) ClearEdge

func (m *GraphMutation) ClearEdge(name string) error

ClearEdge clears the value for the given name. It returns an error if the edge name is not defined in the schema.

func (*GraphMutation) ClearField

func (m *GraphMutation) ClearField(name string) error

ClearField clears the value for the given name. It returns an error if the field is not defined in the schema.

func (*GraphMutation) ClearGroup

func (m *GraphMutation) ClearGroup()

ClearGroup clears the group edge to Group.

func (*GraphMutation) ClearMetrics

func (m *GraphMutation) ClearMetrics()

ClearMetrics clears the metrics edge to Metric.

func (*GraphMutation) ClearedEdges

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

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

func (*GraphMutation) ClearedFields

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

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

func (GraphMutation) Client

func (m GraphMutation) 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 (*GraphMutation) EdgeCleared

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

EdgeCleared returns a boolean indicates if this edge was cleared in this mutation.

func (*GraphMutation) Field

func (m *GraphMutation) Field(name string) (ent.Value, bool)

Field returns the value of a field with the given name. The second boolean value indicates that this field was not set, or was not define in the schema.

func (*GraphMutation) FieldCleared

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

FieldCleared returns a boolean indicates if this field was cleared in this mutation.

func (*GraphMutation) Fields

func (m *GraphMutation) Fields() []string

Fields returns all fields that were changed during this mutation. Note that, in order to get all numeric fields that were in/decremented, call AddedFields().

func (*GraphMutation) GroupCleared

func (m *GraphMutation) GroupCleared() bool

GroupCleared returns if the edge group was cleared.

func (*GraphMutation) GroupID

func (m *GraphMutation) GroupID() (id int, exists bool)

GroupID returns the group id in the mutation.

func (*GraphMutation) GroupIDs

func (m *GraphMutation) GroupIDs() (ids []int)

GroupIDs returns the group ids in the mutation. Note that ids always returns len(ids) <= 1 for unique edges, and you should use GroupID instead. It exists only for internal usage by the builders.

func (*GraphMutation) ID

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

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

func (*GraphMutation) MetricsCleared

func (m *GraphMutation) MetricsCleared() bool

MetricsCleared returns if the edge metrics was cleared.

func (*GraphMutation) MetricsIDs

func (m *GraphMutation) MetricsIDs() (ids []int)

MetricsIDs returns the metrics ids in the mutation.

func (*GraphMutation) OldField

func (m *GraphMutation) 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 was failed.

func (*GraphMutation) OldTitle

func (m *GraphMutation) OldTitle(ctx context.Context) (v string, err error)

OldTitle returns the old title value of the Graph. If the Graph 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 database query fails.

func (*GraphMutation) OldUnit

func (m *GraphMutation) OldUnit(ctx context.Context) (v string, err error)

OldUnit returns the old unit value of the Graph. If the Graph 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 database query fails.

func (*GraphMutation) Op

func (m *GraphMutation) Op() Op

Op returns the operation name.

func (*GraphMutation) RemoveMetricIDs

func (m *GraphMutation) RemoveMetricIDs(ids ...int)

RemoveMetricIDs removes the metrics edge to Metric by ids.

func (*GraphMutation) RemovedEdges

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

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

func (*GraphMutation) RemovedIDs

func (m *GraphMutation) RemovedIDs(name string) []ent.Value

RemovedIDs returns all ids (to other nodes) that were removed for the given edge name.

func (*GraphMutation) RemovedMetricsIDs

func (m *GraphMutation) RemovedMetricsIDs() (ids []int)

RemovedMetrics returns the removed ids of metrics.

func (*GraphMutation) ResetEdge

func (m *GraphMutation) ResetEdge(name string) error

ResetEdge resets all changes in the mutation regarding the given edge name. It returns an error if the edge is not defined in the schema.

func (*GraphMutation) ResetField

func (m *GraphMutation) ResetField(name string) error

ResetField resets all changes in the mutation regarding the given field name. It returns an error if the field is not defined in the schema.

func (*GraphMutation) ResetGroup

func (m *GraphMutation) ResetGroup()

ResetGroup reset all changes of the "group" edge.

func (*GraphMutation) ResetMetrics

func (m *GraphMutation) ResetMetrics()

ResetMetrics reset all changes of the "metrics" edge.

func (*GraphMutation) ResetTitle

func (m *GraphMutation) ResetTitle()

ResetTitle reset all changes of the "title" field.

func (*GraphMutation) ResetUnit

func (m *GraphMutation) ResetUnit()

ResetUnit reset all changes of the "unit" field.

func (*GraphMutation) SetField

func (m *GraphMutation) SetField(name string, value ent.Value) error

SetField sets the value for the given name. It returns an error if the field is not defined in the schema, or if the type mismatch the field type.

func (*GraphMutation) SetGroupID

func (m *GraphMutation) SetGroupID(id int)

SetGroupID sets the group edge to Group by id.

func (*GraphMutation) SetTitle

func (m *GraphMutation) SetTitle(s string)

SetTitle sets the title field.

func (*GraphMutation) SetUnit

func (m *GraphMutation) SetUnit(s string)

SetUnit sets the unit field.

func (*GraphMutation) Title

func (m *GraphMutation) Title() (r string, exists bool)

Title returns the title value in the mutation.

func (GraphMutation) Tx

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

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

func (*GraphMutation) Type

func (m *GraphMutation) Type() string

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

func (*GraphMutation) Unit

func (m *GraphMutation) Unit() (r string, exists bool)

Unit returns the unit value in the mutation.

type GraphQuery

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

GraphQuery is the builder for querying Graph entities.

func (*GraphQuery) All

func (gq *GraphQuery) All(ctx context.Context) ([]*Graph, error)

All executes the query and returns a list of Graphs.

func (*GraphQuery) AllX

func (gq *GraphQuery) AllX(ctx context.Context) []*Graph

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

func (*GraphQuery) Clone

func (gq *GraphQuery) Clone() *GraphQuery

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

func (*GraphQuery) Count

func (gq *GraphQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*GraphQuery) CountX

func (gq *GraphQuery) CountX(ctx context.Context) int

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

func (*GraphQuery) Exist

func (gq *GraphQuery) Exist(ctx context.Context) (bool, error)

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

func (*GraphQuery) ExistX

func (gq *GraphQuery) ExistX(ctx context.Context) bool

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

func (*GraphQuery) First

func (gq *GraphQuery) First(ctx context.Context) (*Graph, error)

First returns the first Graph entity in the query. Returns *NotFoundError when no graph was found.

func (*GraphQuery) FirstID

func (gq *GraphQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first Graph id in the query. Returns *NotFoundError when no id was found.

func (*GraphQuery) FirstX

func (gq *GraphQuery) FirstX(ctx context.Context) *Graph

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

func (*GraphQuery) FirstXID

func (gq *GraphQuery) FirstXID(ctx context.Context) int

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

func (*GraphQuery) GroupBy

func (gq *GraphQuery) GroupBy(field string, fields ...string) *GraphGroupBy

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

client.Graph.Query().
	GroupBy(graph.FieldTitle).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*GraphQuery) IDs

func (gq *GraphQuery) IDs(ctx context.Context) ([]int, error)

IDs executes the query and returns a list of Graph ids.

func (*GraphQuery) IDsX

func (gq *GraphQuery) IDsX(ctx context.Context) []int

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

func (*GraphQuery) Limit

func (gq *GraphQuery) Limit(limit int) *GraphQuery

Limit adds a limit step to the query.

func (*GraphQuery) Offset

func (gq *GraphQuery) Offset(offset int) *GraphQuery

Offset adds an offset step to the query.

func (*GraphQuery) Only

func (gq *GraphQuery) Only(ctx context.Context) (*Graph, error)

Only returns the only Graph entity in the query, returns an error if not exactly one entity was returned.

func (*GraphQuery) OnlyID

func (gq *GraphQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID returns the only Graph id in the query, returns an error if not exactly one id was returned.

func (*GraphQuery) OnlyIDX

func (gq *GraphQuery) OnlyIDX(ctx context.Context) int

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

func (*GraphQuery) OnlyX

func (gq *GraphQuery) OnlyX(ctx context.Context) *Graph

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

func (*GraphQuery) Order

func (gq *GraphQuery) Order(o ...OrderFunc) *GraphQuery

Order adds an order step to the query.

func (*GraphQuery) QueryGroup

func (gq *GraphQuery) QueryGroup() *GroupQuery

QueryGroup chains the current query on the group edge.

func (*GraphQuery) QueryMetrics

func (gq *GraphQuery) QueryMetrics() *MetricQuery

QueryMetrics chains the current query on the metrics edge.

func (*GraphQuery) Select

func (gq *GraphQuery) Select(field string, fields ...string) *GraphSelect

Select one or more fields from the given query.

Example:

var v []struct {
	Title string `json:"title"`
}

client.Graph.Query().
	Select(graph.FieldTitle).
	Scan(ctx, &v)

func (*GraphQuery) Where

func (gq *GraphQuery) Where(ps ...predicate.Graph) *GraphQuery

Where adds a new predicate for the builder.

func (*GraphQuery) WithGroup

func (gq *GraphQuery) WithGroup(opts ...func(*GroupQuery)) *GraphQuery
WithGroup tells the query-builder to eager-loads the nodes that are connected to

the "group" edge. The optional arguments used to configure the query builder of the edge.

func (*GraphQuery) WithMetrics

func (gq *GraphQuery) WithMetrics(opts ...func(*MetricQuery)) *GraphQuery
WithMetrics tells the query-builder to eager-loads the nodes that are connected to

the "metrics" edge. The optional arguments used to configure the query builder of the edge.

type GraphSelect

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

GraphSelect is the builder for select fields of Graph entities.

func (*GraphSelect) Bool

func (gs *GraphSelect) Bool(ctx context.Context) (_ bool, err error)

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

func (*GraphSelect) BoolX

func (gs *GraphSelect) BoolX(ctx context.Context) bool

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

func (*GraphSelect) Bools

func (gs *GraphSelect) Bools(ctx context.Context) ([]bool, error)

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

func (*GraphSelect) BoolsX

func (gs *GraphSelect) BoolsX(ctx context.Context) []bool

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

func (*GraphSelect) Float64

func (gs *GraphSelect) Float64(ctx context.Context) (_ float64, err error)

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

func (*GraphSelect) Float64X

func (gs *GraphSelect) Float64X(ctx context.Context) float64

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

func (*GraphSelect) Float64s

func (gs *GraphSelect) Float64s(ctx context.Context) ([]float64, error)

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

func (*GraphSelect) Float64sX

func (gs *GraphSelect) Float64sX(ctx context.Context) []float64

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

func (*GraphSelect) Int

func (gs *GraphSelect) Int(ctx context.Context) (_ int, err error)

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

func (*GraphSelect) IntX

func (gs *GraphSelect) IntX(ctx context.Context) int

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

func (*GraphSelect) Ints

func (gs *GraphSelect) Ints(ctx context.Context) ([]int, error)

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

func (*GraphSelect) IntsX

func (gs *GraphSelect) IntsX(ctx context.Context) []int

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

func (*GraphSelect) Scan

func (gs *GraphSelect) Scan(ctx context.Context, v interface{}) error

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

func (*GraphSelect) ScanX

func (gs *GraphSelect) ScanX(ctx context.Context, v interface{})

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

func (*GraphSelect) String

func (gs *GraphSelect) String(ctx context.Context) (_ string, err error)

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

func (*GraphSelect) StringX

func (gs *GraphSelect) StringX(ctx context.Context) string

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

func (*GraphSelect) Strings

func (gs *GraphSelect) Strings(ctx context.Context) ([]string, error)

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

func (*GraphSelect) StringsX

func (gs *GraphSelect) StringsX(ctx context.Context) []string

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

type GraphUpdate

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

GraphUpdate is the builder for updating Graph entities.

func (*GraphUpdate) AddMetricIDs

func (gu *GraphUpdate) AddMetricIDs(ids ...int) *GraphUpdate

AddMetricIDs adds the metrics edge to Metric by ids.

func (*GraphUpdate) AddMetrics

func (gu *GraphUpdate) AddMetrics(m ...*Metric) *GraphUpdate

AddMetrics adds the metrics edges to Metric.

func (*GraphUpdate) ClearGroup

func (gu *GraphUpdate) ClearGroup() *GraphUpdate

ClearGroup clears the "group" edge to type Group.

func (*GraphUpdate) ClearMetrics

func (gu *GraphUpdate) ClearMetrics() *GraphUpdate

ClearMetrics clears all "metrics" edges to type Metric.

func (*GraphUpdate) Exec

func (gu *GraphUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*GraphUpdate) ExecX

func (gu *GraphUpdate) ExecX(ctx context.Context)

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

func (*GraphUpdate) Mutation

func (gu *GraphUpdate) Mutation() *GraphMutation

Mutation returns the GraphMutation object of the builder.

func (*GraphUpdate) RemoveMetricIDs

func (gu *GraphUpdate) RemoveMetricIDs(ids ...int) *GraphUpdate

RemoveMetricIDs removes the metrics edge to Metric by ids.

func (*GraphUpdate) RemoveMetrics

func (gu *GraphUpdate) RemoveMetrics(m ...*Metric) *GraphUpdate

RemoveMetrics removes metrics edges to Metric.

func (*GraphUpdate) Save

func (gu *GraphUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of rows/vertices matched by this operation.

func (*GraphUpdate) SaveX

func (gu *GraphUpdate) SaveX(ctx context.Context) int

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

func (*GraphUpdate) SetGroup

func (gu *GraphUpdate) SetGroup(g *Group) *GraphUpdate

SetGroup sets the group edge to Group.

func (*GraphUpdate) SetGroupID

func (gu *GraphUpdate) SetGroupID(id int) *GraphUpdate

SetGroupID sets the group edge to Group by id.

func (*GraphUpdate) SetNillableGroupID

func (gu *GraphUpdate) SetNillableGroupID(id *int) *GraphUpdate

SetNillableGroupID sets the group edge to Group by id if the given value is not nil.

func (*GraphUpdate) SetUnit

func (gu *GraphUpdate) SetUnit(s string) *GraphUpdate

SetUnit sets the unit field.

func (*GraphUpdate) Where

func (gu *GraphUpdate) Where(ps ...predicate.Graph) *GraphUpdate

Where adds a new predicate for the builder.

type GraphUpdateOne

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

GraphUpdateOne is the builder for updating a single Graph entity.

func (*GraphUpdateOne) AddMetricIDs

func (guo *GraphUpdateOne) AddMetricIDs(ids ...int) *GraphUpdateOne

AddMetricIDs adds the metrics edge to Metric by ids.

func (*GraphUpdateOne) AddMetrics

func (guo *GraphUpdateOne) AddMetrics(m ...*Metric) *GraphUpdateOne

AddMetrics adds the metrics edges to Metric.

func (*GraphUpdateOne) ClearGroup

func (guo *GraphUpdateOne) ClearGroup() *GraphUpdateOne

ClearGroup clears the "group" edge to type Group.

func (*GraphUpdateOne) ClearMetrics

func (guo *GraphUpdateOne) ClearMetrics() *GraphUpdateOne

ClearMetrics clears all "metrics" edges to type Metric.

func (*GraphUpdateOne) Exec

func (guo *GraphUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*GraphUpdateOne) ExecX

func (guo *GraphUpdateOne) ExecX(ctx context.Context)

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

func (*GraphUpdateOne) Mutation

func (guo *GraphUpdateOne) Mutation() *GraphMutation

Mutation returns the GraphMutation object of the builder.

func (*GraphUpdateOne) RemoveMetricIDs

func (guo *GraphUpdateOne) RemoveMetricIDs(ids ...int) *GraphUpdateOne

RemoveMetricIDs removes the metrics edge to Metric by ids.

func (*GraphUpdateOne) RemoveMetrics

func (guo *GraphUpdateOne) RemoveMetrics(m ...*Metric) *GraphUpdateOne

RemoveMetrics removes metrics edges to Metric.

func (*GraphUpdateOne) Save

func (guo *GraphUpdateOne) Save(ctx context.Context) (*Graph, error)

Save executes the query and returns the updated entity.

func (*GraphUpdateOne) SaveX

func (guo *GraphUpdateOne) SaveX(ctx context.Context) *Graph

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

func (*GraphUpdateOne) SetGroup

func (guo *GraphUpdateOne) SetGroup(g *Group) *GraphUpdateOne

SetGroup sets the group edge to Group.

func (*GraphUpdateOne) SetGroupID

func (guo *GraphUpdateOne) SetGroupID(id int) *GraphUpdateOne

SetGroupID sets the group edge to Group by id.

func (*GraphUpdateOne) SetNillableGroupID

func (guo *GraphUpdateOne) SetNillableGroupID(id *int) *GraphUpdateOne

SetNillableGroupID sets the group edge to Group by id if the given value is not nil.

func (*GraphUpdateOne) SetUnit

func (guo *GraphUpdateOne) SetUnit(s string) *GraphUpdateOne

SetUnit sets the unit field.

type Graphs

type Graphs []*Graph

Graphs is a parsable slice of Graph.

type Group

type Group struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// Name holds the value of the "name" field.
	Name string `json:"name"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the GroupQuery when eager-loading is set.
	Edges GroupEdges `json:"edges"`
	// contains filtered or unexported fields
}

Group is the model entity for the Group schema.

func (*Group) QueryApplication

func (gr *Group) QueryApplication() *ApplicationQuery

QueryApplication queries the application edge of the Group.

func (*Group) QueryGraphs

func (gr *Group) QueryGraphs() *GraphQuery

QueryGraphs queries the graphs edge of the Group.

func (*Group) String

func (gr *Group) String() string

String implements the fmt.Stringer.

func (*Group) Unwrap

func (gr *Group) Unwrap() *Group

Unwrap unwraps the entity that was returned from a transaction after it was closed, so that all next queries will be executed through the driver which created the transaction.

func (*Group) Update

func (gr *Group) Update() *GroupUpdateOne

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

type GroupClient

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

GroupClient is a client for the Group schema.

func NewGroupClient

func NewGroupClient(c config) *GroupClient

NewGroupClient returns a client for the Group from the given config.

func (*GroupClient) Create

func (c *GroupClient) Create() *GroupCreate

Create returns a create builder for Group.

func (*GroupClient) CreateBulk

func (c *GroupClient) CreateBulk(builders ...*GroupCreate) *GroupCreateBulk

BulkCreate returns a builder for creating a bulk of Group entities.

func (*GroupClient) Delete

func (c *GroupClient) Delete() *GroupDelete

Delete returns a delete builder for Group.

func (*GroupClient) DeleteOne

func (c *GroupClient) DeleteOne(gr *Group) *GroupDeleteOne

DeleteOne returns a delete builder for the given entity.

func (*GroupClient) DeleteOneID

func (c *GroupClient) DeleteOneID(id int) *GroupDeleteOne

DeleteOneID returns a delete builder for the given id.

func (*GroupClient) Get

func (c *GroupClient) Get(ctx context.Context, id int) (*Group, error)

Get returns a Group entity by its id.

func (*GroupClient) GetX

func (c *GroupClient) GetX(ctx context.Context, id int) *Group

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

func (*GroupClient) Hooks

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

Hooks returns the client hooks.

func (*GroupClient) Query

func (c *GroupClient) Query() *GroupQuery

Query returns a query builder for Group.

func (*GroupClient) QueryApplication

func (c *GroupClient) QueryApplication(gr *Group) *ApplicationQuery

QueryApplication queries the application edge of a Group.

func (*GroupClient) QueryGraphs

func (c *GroupClient) QueryGraphs(gr *Group) *GraphQuery

QueryGraphs queries the graphs edge of a Group.

func (*GroupClient) Update

func (c *GroupClient) Update() *GroupUpdate

Update returns an update builder for Group.

func (*GroupClient) UpdateOne

func (c *GroupClient) UpdateOne(gr *Group) *GroupUpdateOne

UpdateOne returns an update builder for the given entity.

func (*GroupClient) UpdateOneID

func (c *GroupClient) UpdateOneID(id int) *GroupUpdateOne

UpdateOneID returns an update builder for the given id.

func (*GroupClient) Use

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

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

type GroupCreate

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

GroupCreate is the builder for creating a Group entity.

func (*GroupCreate) AddGraphIDs

func (gc *GroupCreate) AddGraphIDs(ids ...int) *GroupCreate

AddGraphIDs adds the graphs edge to Graph by ids.

func (*GroupCreate) AddGraphs

func (gc *GroupCreate) AddGraphs(g ...*Graph) *GroupCreate

AddGraphs adds the graphs edges to Graph.

func (*GroupCreate) Mutation

func (gc *GroupCreate) Mutation() *GroupMutation

Mutation returns the GroupMutation object of the builder.

func (*GroupCreate) Save

func (gc *GroupCreate) Save(ctx context.Context) (*Group, error)

Save creates the Group in the database.

func (*GroupCreate) SaveX

func (gc *GroupCreate) SaveX(ctx context.Context) *Group

SaveX calls Save and panics if Save returns an error.

func (*GroupCreate) SetApplication

func (gc *GroupCreate) SetApplication(a *Application) *GroupCreate

SetApplication sets the application edge to Application.

func (*GroupCreate) SetApplicationID

func (gc *GroupCreate) SetApplicationID(id int) *GroupCreate

SetApplicationID sets the application edge to Application by id.

func (*GroupCreate) SetName

func (gc *GroupCreate) SetName(s string) *GroupCreate

SetName sets the name field.

func (*GroupCreate) SetNillableApplicationID

func (gc *GroupCreate) SetNillableApplicationID(id *int) *GroupCreate

SetNillableApplicationID sets the application edge to Application by id if the given value is not nil.

type GroupCreateBulk

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

GroupCreateBulk is the builder for creating a bulk of Group entities.

func (*GroupCreateBulk) Save

func (gcb *GroupCreateBulk) Save(ctx context.Context) ([]*Group, error)

Save creates the Group entities in the database.

func (*GroupCreateBulk) SaveX

func (gcb *GroupCreateBulk) SaveX(ctx context.Context) []*Group

SaveX calls Save and panics if Save returns an error.

type GroupDelete

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

GroupDelete is the builder for deleting a Group entity.

func (*GroupDelete) Exec

func (gd *GroupDelete) Exec(ctx context.Context) (int, error)

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

func (*GroupDelete) ExecX

func (gd *GroupDelete) ExecX(ctx context.Context) int

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

func (*GroupDelete) Where

func (gd *GroupDelete) Where(ps ...predicate.Group) *GroupDelete

Where adds a new predicate to the delete builder.

type GroupDeleteOne

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

GroupDeleteOne is the builder for deleting a single Group entity.

func (*GroupDeleteOne) Exec

func (gdo *GroupDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*GroupDeleteOne) ExecX

func (gdo *GroupDeleteOne) ExecX(ctx context.Context)

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

type GroupEdges

type GroupEdges struct {
	// Application holds the value of the application edge.
	Application *Application
	// Graphs holds the value of the graphs edge.
	Graphs []*Graph
	// contains filtered or unexported fields
}

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

func (GroupEdges) ApplicationOrErr

func (e GroupEdges) ApplicationOrErr() (*Application, error)

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

func (GroupEdges) GraphsOrErr

func (e GroupEdges) GraphsOrErr() ([]*Graph, error)

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

type GroupGroupBy

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

GroupGroupBy is the builder for group-by Group entities.

func (*GroupGroupBy) Aggregate

func (ggb *GroupGroupBy) Aggregate(fns ...AggregateFunc) *GroupGroupBy

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

func (*GroupGroupBy) Bool

func (ggb *GroupGroupBy) Bool(ctx context.Context) (_ bool, err error)

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

func (*GroupGroupBy) BoolX

func (ggb *GroupGroupBy) BoolX(ctx context.Context) bool

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

func (*GroupGroupBy) Bools

func (ggb *GroupGroupBy) Bools(ctx context.Context) ([]bool, error)

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

func (*GroupGroupBy) BoolsX

func (ggb *GroupGroupBy) BoolsX(ctx context.Context) []bool

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

func (*GroupGroupBy) Float64

func (ggb *GroupGroupBy) Float64(ctx context.Context) (_ float64, err error)

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

func (*GroupGroupBy) Float64X

func (ggb *GroupGroupBy) Float64X(ctx context.Context) float64

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

func (*GroupGroupBy) Float64s

func (ggb *GroupGroupBy) Float64s(ctx context.Context) ([]float64, error)

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

func (*GroupGroupBy) Float64sX

func (ggb *GroupGroupBy) Float64sX(ctx context.Context) []float64

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

func (*GroupGroupBy) Int

func (ggb *GroupGroupBy) Int(ctx context.Context) (_ int, err error)

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

func (*GroupGroupBy) IntX

func (ggb *GroupGroupBy) IntX(ctx context.Context) int

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

func (*GroupGroupBy) Ints

func (ggb *GroupGroupBy) Ints(ctx context.Context) ([]int, error)

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

func (*GroupGroupBy) IntsX

func (ggb *GroupGroupBy) IntsX(ctx context.Context) []int

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

func (*GroupGroupBy) Scan

func (ggb *GroupGroupBy) Scan(ctx context.Context, v interface{}) error

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

func (*GroupGroupBy) ScanX

func (ggb *GroupGroupBy) ScanX(ctx context.Context, v interface{})

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

func (*GroupGroupBy) String

func (ggb *GroupGroupBy) String(ctx context.Context) (_ string, err error)

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

func (*GroupGroupBy) StringX

func (ggb *GroupGroupBy) StringX(ctx context.Context) string

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

func (*GroupGroupBy) Strings

func (ggb *GroupGroupBy) Strings(ctx context.Context) ([]string, error)

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

func (*GroupGroupBy) StringsX

func (ggb *GroupGroupBy) StringsX(ctx context.Context) []string

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

type GroupMutation

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

GroupMutation represents an operation that mutate the Groups nodes in the graph.

func (*GroupMutation) AddField

func (m *GroupMutation) AddField(name string, value ent.Value) error

AddField adds the value for the given name. It returns an error if the field is not defined in the schema, or if the type mismatch the field type.

func (*GroupMutation) AddGraphIDs

func (m *GroupMutation) AddGraphIDs(ids ...int)

AddGraphIDs adds the graphs edge to Graph by ids.

func (*GroupMutation) AddedEdges

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

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

func (*GroupMutation) AddedField

func (m *GroupMutation) AddedField(name string) (ent.Value, bool)

AddedField returns the numeric value that was in/decremented from a field with the given name. The second value indicates that this field was not set, or was not define in the schema.

func (*GroupMutation) AddedFields

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

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

func (*GroupMutation) AddedIDs

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

AddedIDs returns all ids (to other nodes) that were added for the given edge name.

func (*GroupMutation) ApplicationCleared

func (m *GroupMutation) ApplicationCleared() bool

ApplicationCleared returns if the edge application was cleared.

func (*GroupMutation) ApplicationID

func (m *GroupMutation) ApplicationID() (id int, exists bool)

ApplicationID returns the application id in the mutation.

func (*GroupMutation) ApplicationIDs

func (m *GroupMutation) ApplicationIDs() (ids []int)

ApplicationIDs returns the application ids in the mutation. Note that ids always returns len(ids) <= 1 for unique edges, and you should use ApplicationID instead. It exists only for internal usage by the builders.

func (*GroupMutation) ClearApplication

func (m *GroupMutation) ClearApplication()

ClearApplication clears the application edge to Application.

func (*GroupMutation) ClearEdge

func (m *GroupMutation) ClearEdge(name string) error

ClearEdge clears the value for the given name. It returns an error if the edge name is not defined in the schema.

func (*GroupMutation) ClearField

func (m *GroupMutation) ClearField(name string) error

ClearField clears the value for the given name. It returns an error if the field is not defined in the schema.

func (*GroupMutation) ClearGraphs

func (m *GroupMutation) ClearGraphs()

ClearGraphs clears the graphs edge to Graph.

func (*GroupMutation) ClearedEdges

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

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

func (*GroupMutation) ClearedFields

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

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

func (GroupMutation) Client

func (m GroupMutation) Client() *Client

Client returns a new `ent.Client` from the mutation. If the mutation was executed in a transaction (ent.Tx), a transactional client is returned.

func (*GroupMutation) EdgeCleared

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

EdgeCleared returns a boolean indicates if this edge was cleared in this mutation.

func (*GroupMutation) Field

func (m *GroupMutation) Field(name string) (ent.Value, bool)

Field returns the value of a field with the given name. The second boolean value indicates that this field was not set, or was not define in the schema.

func (*GroupMutation) FieldCleared

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

FieldCleared returns a boolean indicates if this field was cleared in this mutation.

func (*GroupMutation) Fields

func (m *GroupMutation) Fields() []string

Fields returns all fields that were changed during this mutation. Note that, in order to get all numeric fields that were in/decremented, call AddedFields().

func (*GroupMutation) GraphsCleared

func (m *GroupMutation) GraphsCleared() bool

GraphsCleared returns if the edge graphs was cleared.

func (*GroupMutation) GraphsIDs

func (m *GroupMutation) GraphsIDs() (ids []int)

GraphsIDs returns the graphs ids in the mutation.

func (*GroupMutation) ID

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

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

func (*GroupMutation) Name

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

Name returns the name value in the mutation.

func (*GroupMutation) OldField

func (m *GroupMutation) OldField(ctx context.Context, name string) (ent.Value, error)

OldField returns the old value of the field from the database. An error is returned if the mutation operation is not UpdateOne, or the query to the database was failed.

func (*GroupMutation) OldName

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

OldName returns the old name value of the Group. If the Group object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or database query fails.

func (*GroupMutation) Op

func (m *GroupMutation) Op() Op

Op returns the operation name.

func (*GroupMutation) RemoveGraphIDs

func (m *GroupMutation) RemoveGraphIDs(ids ...int)

RemoveGraphIDs removes the graphs edge to Graph by ids.

func (*GroupMutation) RemovedEdges

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

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

func (*GroupMutation) RemovedGraphsIDs

func (m *GroupMutation) RemovedGraphsIDs() (ids []int)

RemovedGraphs returns the removed ids of graphs.

func (*GroupMutation) RemovedIDs

func (m *GroupMutation) RemovedIDs(name string) []ent.Value

RemovedIDs returns all ids (to other nodes) that were removed for the given edge name.

func (*GroupMutation) ResetApplication

func (m *GroupMutation) ResetApplication()

ResetApplication reset all changes of the "application" edge.

func (*GroupMutation) ResetEdge

func (m *GroupMutation) ResetEdge(name string) error

ResetEdge resets all changes in the mutation regarding the given edge name. It returns an error if the edge is not defined in the schema.

func (*GroupMutation) ResetField

func (m *GroupMutation) ResetField(name string) error

ResetField resets all changes in the mutation regarding the given field name. It returns an error if the field is not defined in the schema.

func (*GroupMutation) ResetGraphs

func (m *GroupMutation) ResetGraphs()

ResetGraphs reset all changes of the "graphs" edge.

func (*GroupMutation) ResetName

func (m *GroupMutation) ResetName()

ResetName reset all changes of the "name" field.

func (*GroupMutation) SetApplicationID

func (m *GroupMutation) SetApplicationID(id int)

SetApplicationID sets the application edge to Application by id.

func (*GroupMutation) SetField

func (m *GroupMutation) SetField(name string, value ent.Value) error

SetField sets the value for the given name. It returns an error if the field is not defined in the schema, or if the type mismatch the field type.

func (*GroupMutation) SetName

func (m *GroupMutation) SetName(s string)

SetName sets the name field.

func (GroupMutation) Tx

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

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

func (*GroupMutation) Type

func (m *GroupMutation) Type() string

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

type GroupQuery

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

GroupQuery is the builder for querying Group entities.

func (*GroupQuery) All

func (gq *GroupQuery) All(ctx context.Context) ([]*Group, error)

All executes the query and returns a list of Groups.

func (*GroupQuery) AllX

func (gq *GroupQuery) AllX(ctx context.Context) []*Group

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

func (*GroupQuery) Clone

func (gq *GroupQuery) Clone() *GroupQuery

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

func (*GroupQuery) Count

func (gq *GroupQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*GroupQuery) CountX

func (gq *GroupQuery) CountX(ctx context.Context) int

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

func (*GroupQuery) Exist

func (gq *GroupQuery) Exist(ctx context.Context) (bool, error)

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

func (*GroupQuery) ExistX

func (gq *GroupQuery) ExistX(ctx context.Context) bool

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

func (*GroupQuery) First

func (gq *GroupQuery) First(ctx context.Context) (*Group, error)

First returns the first Group entity in the query. Returns *NotFoundError when no group was found.

func (*GroupQuery) FirstID

func (gq *GroupQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first Group id in the query. Returns *NotFoundError when no id was found.

func (*GroupQuery) FirstX

func (gq *GroupQuery) FirstX(ctx context.Context) *Group

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

func (*GroupQuery) FirstXID

func (gq *GroupQuery) FirstXID(ctx context.Context) int

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

func (*GroupQuery) GroupBy

func (gq *GroupQuery) GroupBy(field string, fields ...string) *GroupGroupBy

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

client.Group.Query().
	GroupBy(group.FieldName).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*GroupQuery) IDs

func (gq *GroupQuery) IDs(ctx context.Context) ([]int, error)

IDs executes the query and returns a list of Group ids.

func (*GroupQuery) IDsX

func (gq *GroupQuery) IDsX(ctx context.Context) []int

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

func (*GroupQuery) Limit

func (gq *GroupQuery) Limit(limit int) *GroupQuery

Limit adds a limit step to the query.

func (*GroupQuery) Offset

func (gq *GroupQuery) Offset(offset int) *GroupQuery

Offset adds an offset step to the query.

func (*GroupQuery) Only

func (gq *GroupQuery) Only(ctx context.Context) (*Group, error)

Only returns the only Group entity in the query, returns an error if not exactly one entity was returned.

func (*GroupQuery) OnlyID

func (gq *GroupQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID returns the only Group id in the query, returns an error if not exactly one id was returned.

func (*GroupQuery) OnlyIDX

func (gq *GroupQuery) OnlyIDX(ctx context.Context) int

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

func (*GroupQuery) OnlyX

func (gq *GroupQuery) OnlyX(ctx context.Context) *Group

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

func (*GroupQuery) Order

func (gq *GroupQuery) Order(o ...OrderFunc) *GroupQuery

Order adds an order step to the query.

func (*GroupQuery) QueryApplication

func (gq *GroupQuery) QueryApplication() *ApplicationQuery

QueryApplication chains the current query on the application edge.

func (*GroupQuery) QueryGraphs

func (gq *GroupQuery) QueryGraphs() *GraphQuery

QueryGraphs chains the current query on the graphs edge.

func (*GroupQuery) Select

func (gq *GroupQuery) Select(field string, fields ...string) *GroupSelect

Select one or more fields from the given query.

Example:

var v []struct {
	Name string `json:"name"`
}

client.Group.Query().
	Select(group.FieldName).
	Scan(ctx, &v)

func (*GroupQuery) Where

func (gq *GroupQuery) Where(ps ...predicate.Group) *GroupQuery

Where adds a new predicate for the builder.

func (*GroupQuery) WithApplication

func (gq *GroupQuery) WithApplication(opts ...func(*ApplicationQuery)) *GroupQuery
WithApplication tells the query-builder to eager-loads the nodes that are connected to

the "application" edge. The optional arguments used to configure the query builder of the edge.

func (*GroupQuery) WithGraphs

func (gq *GroupQuery) WithGraphs(opts ...func(*GraphQuery)) *GroupQuery
WithGraphs tells the query-builder to eager-loads the nodes that are connected to

the "graphs" edge. The optional arguments used to configure the query builder of the edge.

type GroupSelect

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

GroupSelect is the builder for select fields of Group entities.

func (*GroupSelect) Bool

func (gs *GroupSelect) Bool(ctx context.Context) (_ bool, err error)

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

func (*GroupSelect) BoolX

func (gs *GroupSelect) BoolX(ctx context.Context) bool

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

func (*GroupSelect) Bools

func (gs *GroupSelect) Bools(ctx context.Context) ([]bool, error)

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

func (*GroupSelect) BoolsX

func (gs *GroupSelect) BoolsX(ctx context.Context) []bool

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

func (*GroupSelect) Float64

func (gs *GroupSelect) Float64(ctx context.Context) (_ float64, err error)

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

func (*GroupSelect) Float64X

func (gs *GroupSelect) Float64X(ctx context.Context) float64

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

func (*GroupSelect) Float64s

func (gs *GroupSelect) Float64s(ctx context.Context) ([]float64, error)

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

func (*GroupSelect) Float64sX

func (gs *GroupSelect) Float64sX(ctx context.Context) []float64

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

func (*GroupSelect) Int

func (gs *GroupSelect) Int(ctx context.Context) (_ int, err error)

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

func (*GroupSelect) IntX

func (gs *GroupSelect) IntX(ctx context.Context) int

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

func (*GroupSelect) Ints

func (gs *GroupSelect) Ints(ctx context.Context) ([]int, error)

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

func (*GroupSelect) IntsX

func (gs *GroupSelect) IntsX(ctx context.Context) []int

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

func (*GroupSelect) Scan

func (gs *GroupSelect) Scan(ctx context.Context, v interface{}) error

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

func (*GroupSelect) ScanX

func (gs *GroupSelect) ScanX(ctx context.Context, v interface{})

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

func (*GroupSelect) String

func (gs *GroupSelect) String(ctx context.Context) (_ string, err error)

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

func (*GroupSelect) StringX

func (gs *GroupSelect) StringX(ctx context.Context) string

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

func (*GroupSelect) Strings

func (gs *GroupSelect) Strings(ctx context.Context) ([]string, error)

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

func (*GroupSelect) StringsX

func (gs *GroupSelect) StringsX(ctx context.Context) []string

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

type GroupUpdate

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

GroupUpdate is the builder for updating Group entities.

func (*GroupUpdate) AddGraphIDs

func (gu *GroupUpdate) AddGraphIDs(ids ...int) *GroupUpdate

AddGraphIDs adds the graphs edge to Graph by ids.

func (*GroupUpdate) AddGraphs

func (gu *GroupUpdate) AddGraphs(g ...*Graph) *GroupUpdate

AddGraphs adds the graphs edges to Graph.

func (*GroupUpdate) ClearApplication

func (gu *GroupUpdate) ClearApplication() *GroupUpdate

ClearApplication clears the "application" edge to type Application.

func (*GroupUpdate) ClearGraphs

func (gu *GroupUpdate) ClearGraphs() *GroupUpdate

ClearGraphs clears all "graphs" edges to type Graph.

func (*GroupUpdate) Exec

func (gu *GroupUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*GroupUpdate) ExecX

func (gu *GroupUpdate) ExecX(ctx context.Context)

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

func (*GroupUpdate) Mutation

func (gu *GroupUpdate) Mutation() *GroupMutation

Mutation returns the GroupMutation object of the builder.

func (*GroupUpdate) RemoveGraphIDs

func (gu *GroupUpdate) RemoveGraphIDs(ids ...int) *GroupUpdate

RemoveGraphIDs removes the graphs edge to Graph by ids.

func (*GroupUpdate) RemoveGraphs

func (gu *GroupUpdate) RemoveGraphs(g ...*Graph) *GroupUpdate

RemoveGraphs removes graphs edges to Graph.

func (*GroupUpdate) Save

func (gu *GroupUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of rows/vertices matched by this operation.

func (*GroupUpdate) SaveX

func (gu *GroupUpdate) SaveX(ctx context.Context) int

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

func (*GroupUpdate) SetApplication

func (gu *GroupUpdate) SetApplication(a *Application) *GroupUpdate

SetApplication sets the application edge to Application.

func (*GroupUpdate) SetApplicationID

func (gu *GroupUpdate) SetApplicationID(id int) *GroupUpdate

SetApplicationID sets the application edge to Application by id.

func (*GroupUpdate) SetNillableApplicationID

func (gu *GroupUpdate) SetNillableApplicationID(id *int) *GroupUpdate

SetNillableApplicationID sets the application edge to Application by id if the given value is not nil.

func (*GroupUpdate) Where

func (gu *GroupUpdate) Where(ps ...predicate.Group) *GroupUpdate

Where adds a new predicate for the builder.

type GroupUpdateOne

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

GroupUpdateOne is the builder for updating a single Group entity.

func (*GroupUpdateOne) AddGraphIDs

func (guo *GroupUpdateOne) AddGraphIDs(ids ...int) *GroupUpdateOne

AddGraphIDs adds the graphs edge to Graph by ids.

func (*GroupUpdateOne) AddGraphs

func (guo *GroupUpdateOne) AddGraphs(g ...*Graph) *GroupUpdateOne

AddGraphs adds the graphs edges to Graph.

func (*GroupUpdateOne) ClearApplication

func (guo *GroupUpdateOne) ClearApplication() *GroupUpdateOne

ClearApplication clears the "application" edge to type Application.

func (*GroupUpdateOne) ClearGraphs

func (guo *GroupUpdateOne) ClearGraphs() *GroupUpdateOne

ClearGraphs clears all "graphs" edges to type Graph.

func (*GroupUpdateOne) Exec

func (guo *GroupUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*GroupUpdateOne) ExecX

func (guo *GroupUpdateOne) ExecX(ctx context.Context)

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

func (*GroupUpdateOne) Mutation

func (guo *GroupUpdateOne) Mutation() *GroupMutation

Mutation returns the GroupMutation object of the builder.

func (*GroupUpdateOne) RemoveGraphIDs

func (guo *GroupUpdateOne) RemoveGraphIDs(ids ...int) *GroupUpdateOne

RemoveGraphIDs removes the graphs edge to Graph by ids.

func (*GroupUpdateOne) RemoveGraphs

func (guo *GroupUpdateOne) RemoveGraphs(g ...*Graph) *GroupUpdateOne

RemoveGraphs removes graphs edges to Graph.

func (*GroupUpdateOne) Save

func (guo *GroupUpdateOne) Save(ctx context.Context) (*Group, error)

Save executes the query and returns the updated entity.

func (*GroupUpdateOne) SaveX

func (guo *GroupUpdateOne) SaveX(ctx context.Context) *Group

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

func (*GroupUpdateOne) SetApplication

func (guo *GroupUpdateOne) SetApplication(a *Application) *GroupUpdateOne

SetApplication sets the application edge to Application.

func (*GroupUpdateOne) SetApplicationID

func (guo *GroupUpdateOne) SetApplicationID(id int) *GroupUpdateOne

SetApplicationID sets the application edge to Application by id.

func (*GroupUpdateOne) SetNillableApplicationID

func (guo *GroupUpdateOne) SetNillableApplicationID(id *int) *GroupUpdateOne

SetNillableApplicationID sets the application edge to Application by id if the given value is not nil.

type Groups

type Groups []*Group

Groups is a parsable slice of Group.

type Histogram

type Histogram struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// Time holds the value of the "time" field.
	Time int64 `json:"time"`
	// Count holds the value of the "count" field.
	Count int64 `json:"count"`
	// Min holds the value of the "min" field.
	Min int64 `json:"min"`
	// Max holds the value of the "max" field.
	Max int64 `json:"max"`
	// Mean holds the value of the "mean" field.
	Mean float64 `json:"mean"`
	// Stddev holds the value of the "stddev" field.
	Stddev float64 `json:"stddev"`
	// Median holds the value of the "median" field.
	Median float64 `json:"median"`
	// P75 holds the value of the "p75" field.
	P75 float64 `json:"p75"`
	// P95 holds the value of the "p95" field.
	P95 float64 `json:"p95"`
	// P99 holds the value of the "p99" field.
	P99 float64 `json:"p99"`
	// P999 holds the value of the "p999" field.
	P999 float64 `json:"p999"`
	// WID holds the value of the "wID" field.
	WID string `json:"wId"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the HistogramQuery when eager-loading is set.
	Edges HistogramEdges `json:"edges"`
	// contains filtered or unexported fields
}

Histogram is the model entity for the Histogram schema.

func (*Histogram) QueryMetric

func (h *Histogram) QueryMetric() *MetricQuery

QueryMetric queries the metric edge of the Histogram.

func (*Histogram) String

func (h *Histogram) String() string

String implements the fmt.Stringer.

func (*Histogram) Unwrap

func (h *Histogram) Unwrap() *Histogram

Unwrap unwraps the entity that was returned from a transaction after it was closed, so that all next queries will be executed through the driver which created the transaction.

func (*Histogram) Update

func (h *Histogram) Update() *HistogramUpdateOne

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

type HistogramClient

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

HistogramClient is a client for the Histogram schema.

func NewHistogramClient

func NewHistogramClient(c config) *HistogramClient

NewHistogramClient returns a client for the Histogram from the given config.

func (*HistogramClient) Create

func (c *HistogramClient) Create() *HistogramCreate

Create returns a create builder for Histogram.

func (*HistogramClient) CreateBulk

func (c *HistogramClient) CreateBulk(builders ...*HistogramCreate) *HistogramCreateBulk

BulkCreate returns a builder for creating a bulk of Histogram entities.

func (*HistogramClient) Delete

func (c *HistogramClient) Delete() *HistogramDelete

Delete returns a delete builder for Histogram.

func (*HistogramClient) DeleteOne

func (c *HistogramClient) DeleteOne(h *Histogram) *HistogramDeleteOne

DeleteOne returns a delete builder for the given entity.

func (*HistogramClient) DeleteOneID

func (c *HistogramClient) DeleteOneID(id int) *HistogramDeleteOne

DeleteOneID returns a delete builder for the given id.

func (*HistogramClient) Get

func (c *HistogramClient) Get(ctx context.Context, id int) (*Histogram, error)

Get returns a Histogram entity by its id.

func (*HistogramClient) GetX

func (c *HistogramClient) GetX(ctx context.Context, id int) *Histogram

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

func (*HistogramClient) Hooks

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

Hooks returns the client hooks.

func (*HistogramClient) Query

func (c *HistogramClient) Query() *HistogramQuery

Query returns a query builder for Histogram.

func (*HistogramClient) QueryMetric

func (c *HistogramClient) QueryMetric(h *Histogram) *MetricQuery

QueryMetric queries the metric edge of a Histogram.

func (*HistogramClient) Update

func (c *HistogramClient) Update() *HistogramUpdate

Update returns an update builder for Histogram.

func (*HistogramClient) UpdateOne

func (c *HistogramClient) UpdateOne(h *Histogram) *HistogramUpdateOne

UpdateOne returns an update builder for the given entity.

func (*HistogramClient) UpdateOneID

func (c *HistogramClient) UpdateOneID(id int) *HistogramUpdateOne

UpdateOneID returns an update builder for the given id.

func (*HistogramClient) Use

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

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

type HistogramCreate

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

HistogramCreate is the builder for creating a Histogram entity.

func (*HistogramCreate) Mutation

func (hc *HistogramCreate) Mutation() *HistogramMutation

Mutation returns the HistogramMutation object of the builder.

func (*HistogramCreate) Save

func (hc *HistogramCreate) Save(ctx context.Context) (*Histogram, error)

Save creates the Histogram in the database.

func (*HistogramCreate) SaveX

func (hc *HistogramCreate) SaveX(ctx context.Context) *Histogram

SaveX calls Save and panics if Save returns an error.

func (*HistogramCreate) SetCount

func (hc *HistogramCreate) SetCount(i int64) *HistogramCreate

SetCount sets the count field.

func (*HistogramCreate) SetMax

func (hc *HistogramCreate) SetMax(i int64) *HistogramCreate

SetMax sets the max field.

func (*HistogramCreate) SetMean

func (hc *HistogramCreate) SetMean(f float64) *HistogramCreate

SetMean sets the mean field.

func (*HistogramCreate) SetMedian

func (hc *HistogramCreate) SetMedian(f float64) *HistogramCreate

SetMedian sets the median field.

func (*HistogramCreate) SetMetric

func (hc *HistogramCreate) SetMetric(m *Metric) *HistogramCreate

SetMetric sets the metric edge to Metric.

func (*HistogramCreate) SetMetricID

func (hc *HistogramCreate) SetMetricID(id int) *HistogramCreate

SetMetricID sets the metric edge to Metric by id.

func (*HistogramCreate) SetMin

func (hc *HistogramCreate) SetMin(i int64) *HistogramCreate

SetMin sets the min field.

func (*HistogramCreate) SetNillableMetricID

func (hc *HistogramCreate) SetNillableMetricID(id *int) *HistogramCreate

SetNillableMetricID sets the metric edge to Metric by id if the given value is not nil.

func (*HistogramCreate) SetP75

func (hc *HistogramCreate) SetP75(f float64) *HistogramCreate

SetP75 sets the p75 field.

func (*HistogramCreate) SetP95

func (hc *HistogramCreate) SetP95(f float64) *HistogramCreate

SetP95 sets the p95 field.

func (*HistogramCreate) SetP99

func (hc *HistogramCreate) SetP99(f float64) *HistogramCreate

SetP99 sets the p99 field.

func (*HistogramCreate) SetP999

func (hc *HistogramCreate) SetP999(f float64) *HistogramCreate

SetP999 sets the p999 field.

func (*HistogramCreate) SetStddev

func (hc *HistogramCreate) SetStddev(f float64) *HistogramCreate

SetStddev sets the stddev field.

func (*HistogramCreate) SetTime

func (hc *HistogramCreate) SetTime(i int64) *HistogramCreate

SetTime sets the time field.

func (*HistogramCreate) SetWID

func (hc *HistogramCreate) SetWID(s string) *HistogramCreate

SetWID sets the wID field.

type HistogramCreateBulk

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

HistogramCreateBulk is the builder for creating a bulk of Histogram entities.

func (*HistogramCreateBulk) Save

func (hcb *HistogramCreateBulk) Save(ctx context.Context) ([]*Histogram, error)

Save creates the Histogram entities in the database.

func (*HistogramCreateBulk) SaveX

func (hcb *HistogramCreateBulk) SaveX(ctx context.Context) []*Histogram

SaveX calls Save and panics if Save returns an error.

type HistogramDelete

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

HistogramDelete is the builder for deleting a Histogram entity.

func (*HistogramDelete) Exec

func (hd *HistogramDelete) Exec(ctx context.Context) (int, error)

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

func (*HistogramDelete) ExecX

func (hd *HistogramDelete) ExecX(ctx context.Context) int

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

func (*HistogramDelete) Where

Where adds a new predicate to the delete builder.

type HistogramDeleteOne

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

HistogramDeleteOne is the builder for deleting a single Histogram entity.

func (*HistogramDeleteOne) Exec

func (hdo *HistogramDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*HistogramDeleteOne) ExecX

func (hdo *HistogramDeleteOne) ExecX(ctx context.Context)

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

type HistogramEdges

type HistogramEdges struct {
	// Metric holds the value of the metric edge.
	Metric *Metric
	// contains filtered or unexported fields
}

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

func (HistogramEdges) MetricOrErr

func (e HistogramEdges) MetricOrErr() (*Metric, error)

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

type HistogramGroupBy

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

HistogramGroupBy is the builder for group-by Histogram entities.

func (*HistogramGroupBy) Aggregate

func (hgb *HistogramGroupBy) Aggregate(fns ...AggregateFunc) *HistogramGroupBy

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

func (*HistogramGroupBy) Bool

func (hgb *HistogramGroupBy) Bool(ctx context.Context) (_ bool, err error)

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

func (*HistogramGroupBy) BoolX

func (hgb *HistogramGroupBy) BoolX(ctx context.Context) bool

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

func (*HistogramGroupBy) Bools

func (hgb *HistogramGroupBy) Bools(ctx context.Context) ([]bool, error)

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

func (*HistogramGroupBy) BoolsX

func (hgb *HistogramGroupBy) BoolsX(ctx context.Context) []bool

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

func (*HistogramGroupBy) Float64

func (hgb *HistogramGroupBy) Float64(ctx context.Context) (_ float64, err error)

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

func (*HistogramGroupBy) Float64X

func (hgb *HistogramGroupBy) Float64X(ctx context.Context) float64

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

func (*HistogramGroupBy) Float64s

func (hgb *HistogramGroupBy) Float64s(ctx context.Context) ([]float64, error)

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

func (*HistogramGroupBy) Float64sX

func (hgb *HistogramGroupBy) Float64sX(ctx context.Context) []float64

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

func (*HistogramGroupBy) Int

func (hgb *HistogramGroupBy) Int(ctx context.Context) (_ int, err error)

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

func (*HistogramGroupBy) IntX

func (hgb *HistogramGroupBy) IntX(ctx context.Context) int

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

func (*HistogramGroupBy) Ints

func (hgb *HistogramGroupBy) Ints(ctx context.Context) ([]int, error)

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

func (*HistogramGroupBy) IntsX

func (hgb *HistogramGroupBy) IntsX(ctx context.Context) []int

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

func (*HistogramGroupBy) Scan

func (hgb *HistogramGroupBy) Scan(ctx context.Context, v interface{}) error

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

func (*HistogramGroupBy) ScanX

func (hgb *HistogramGroupBy) ScanX(ctx context.Context, v interface{})

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

func (*HistogramGroupBy) String

func (hgb *HistogramGroupBy) String(ctx context.Context) (_ string, err error)

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

func (*HistogramGroupBy) StringX

func (hgb *HistogramGroupBy) StringX(ctx context.Context) string

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

func (*HistogramGroupBy) Strings

func (hgb *HistogramGroupBy) Strings(ctx context.Context) ([]string, error)

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

func (*HistogramGroupBy) StringsX

func (hgb *HistogramGroupBy) StringsX(ctx context.Context) []string

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

type HistogramMutation

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

HistogramMutation represents an operation that mutate the Histograms nodes in the graph.

func (*HistogramMutation) AddCount

func (m *HistogramMutation) AddCount(i int64)

AddCount adds i to count.

func (*HistogramMutation) AddField

func (m *HistogramMutation) AddField(name string, value ent.Value) error

AddField adds the value for the given name. It returns an error if the field is not defined in the schema, or if the type mismatch the field type.

func (*HistogramMutation) AddMax

func (m *HistogramMutation) AddMax(i int64)

AddMax adds i to max.

func (*HistogramMutation) AddMean

func (m *HistogramMutation) AddMean(f float64)

AddMean adds f to mean.

func (*HistogramMutation) AddMedian

func (m *HistogramMutation) AddMedian(f float64)

AddMedian adds f to median.

func (*HistogramMutation) AddMin

func (m *HistogramMutation) AddMin(i int64)

AddMin adds i to min.

func (*HistogramMutation) AddP75

func (m *HistogramMutation) AddP75(f float64)

AddP75 adds f to p75.

func (*HistogramMutation) AddP95

func (m *HistogramMutation) AddP95(f float64)

AddP95 adds f to p95.

func (*HistogramMutation) AddP99

func (m *HistogramMutation) AddP99(f float64)

AddP99 adds f to p99.

func (*HistogramMutation) AddP999

func (m *HistogramMutation) AddP999(f float64)

AddP999 adds f to p999.

func (*HistogramMutation) AddStddev

func (m *HistogramMutation) AddStddev(f float64)

AddStddev adds f to stddev.

func (*HistogramMutation) AddTime

func (m *HistogramMutation) AddTime(i int64)

AddTime adds i to time.

func (*HistogramMutation) AddedCount

func (m *HistogramMutation) AddedCount() (r int64, exists bool)

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

func (*HistogramMutation) AddedEdges

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

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

func (*HistogramMutation) AddedField

func (m *HistogramMutation) AddedField(name string) (ent.Value, bool)

AddedField returns the numeric value that was in/decremented from a field with the given name. The second value indicates that this field was not set, or was not define in the schema.

func (*HistogramMutation) AddedFields

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

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

func (*HistogramMutation) AddedIDs

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

AddedIDs returns all ids (to other nodes) that were added for the given edge name.

func (*HistogramMutation) AddedMax

func (m *HistogramMutation) AddedMax() (r int64, exists bool)

AddedMax returns the value that was added to the max field in this mutation.

func (*HistogramMutation) AddedMean

func (m *HistogramMutation) AddedMean() (r float64, exists bool)

AddedMean returns the value that was added to the mean field in this mutation.

func (*HistogramMutation) AddedMedian

func (m *HistogramMutation) AddedMedian() (r float64, exists bool)

AddedMedian returns the value that was added to the median field in this mutation.

func (*HistogramMutation) AddedMin

func (m *HistogramMutation) AddedMin() (r int64, exists bool)

AddedMin returns the value that was added to the min field in this mutation.

func (*HistogramMutation) AddedP75

func (m *HistogramMutation) AddedP75() (r float64, exists bool)

AddedP75 returns the value that was added to the p75 field in this mutation.

func (*HistogramMutation) AddedP95

func (m *HistogramMutation) AddedP95() (r float64, exists bool)

AddedP95 returns the value that was added to the p95 field in this mutation.

func (*HistogramMutation) AddedP99

func (m *HistogramMutation) AddedP99() (r float64, exists bool)

AddedP99 returns the value that was added to the p99 field in this mutation.

func (*HistogramMutation) AddedP999

func (m *HistogramMutation) AddedP999() (r float64, exists bool)

AddedP999 returns the value that was added to the p999 field in this mutation.

func (*HistogramMutation) AddedStddev

func (m *HistogramMutation) AddedStddev() (r float64, exists bool)

AddedStddev returns the value that was added to the stddev field in this mutation.

func (*HistogramMutation) AddedTime

func (m *HistogramMutation) AddedTime() (r int64, exists bool)

AddedTime returns the value that was added to the time field in this mutation.

func (*HistogramMutation) ClearEdge

func (m *HistogramMutation) ClearEdge(name string) error

ClearEdge clears the value for the given name. It returns an error if the edge name is not defined in the schema.

func (*HistogramMutation) ClearField

func (m *HistogramMutation) ClearField(name string) error

ClearField clears the value for the given name. It returns an error if the field is not defined in the schema.

func (*HistogramMutation) ClearMetric

func (m *HistogramMutation) ClearMetric()

ClearMetric clears the metric edge to Metric.

func (*HistogramMutation) ClearedEdges

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

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

func (*HistogramMutation) ClearedFields

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

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

func (HistogramMutation) Client

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

func (m *HistogramMutation) Count() (r int64, exists bool)

Count returns the count value in the mutation.

func (*HistogramMutation) EdgeCleared

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

EdgeCleared returns a boolean indicates if this edge was cleared in this mutation.

func (*HistogramMutation) Field

func (m *HistogramMutation) Field(name string) (ent.Value, bool)

Field returns the value of a field with the given name. The second boolean value indicates that this field was not set, or was not define in the schema.

func (*HistogramMutation) FieldCleared

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

FieldCleared returns a boolean indicates if this field was cleared in this mutation.

func (*HistogramMutation) Fields

func (m *HistogramMutation) Fields() []string

Fields returns all fields that were changed during this mutation. Note that, in order to get all numeric fields that were in/decremented, call AddedFields().

func (*HistogramMutation) ID

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

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

func (*HistogramMutation) Max

func (m *HistogramMutation) Max() (r int64, exists bool)

Max returns the max value in the mutation.

func (*HistogramMutation) Mean

func (m *HistogramMutation) Mean() (r float64, exists bool)

Mean returns the mean value in the mutation.

func (*HistogramMutation) Median

func (m *HistogramMutation) Median() (r float64, exists bool)

Median returns the median value in the mutation.

func (*HistogramMutation) MetricCleared

func (m *HistogramMutation) MetricCleared() bool

MetricCleared returns if the edge metric was cleared.

func (*HistogramMutation) MetricID

func (m *HistogramMutation) MetricID() (id int, exists bool)

MetricID returns the metric id in the mutation.

func (*HistogramMutation) MetricIDs

func (m *HistogramMutation) MetricIDs() (ids []int)

MetricIDs returns the metric ids in the mutation. Note that ids always returns len(ids) <= 1 for unique edges, and you should use MetricID instead. It exists only for internal usage by the builders.

func (*HistogramMutation) Min

func (m *HistogramMutation) Min() (r int64, exists bool)

Min returns the min value in the mutation.

func (*HistogramMutation) OldCount

func (m *HistogramMutation) OldCount(ctx context.Context) (v int64, err error)

OldCount returns the old count value of the Histogram. If the Histogram 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 database query fails.

func (*HistogramMutation) OldField

func (m *HistogramMutation) 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 was failed.

func (*HistogramMutation) OldMax

func (m *HistogramMutation) OldMax(ctx context.Context) (v int64, err error)

OldMax returns the old max value of the Histogram. If the Histogram 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 database query fails.

func (*HistogramMutation) OldMean

func (m *HistogramMutation) OldMean(ctx context.Context) (v float64, err error)

OldMean returns the old mean value of the Histogram. If the Histogram 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 database query fails.

func (*HistogramMutation) OldMedian

func (m *HistogramMutation) OldMedian(ctx context.Context) (v float64, err error)

OldMedian returns the old median value of the Histogram. If the Histogram 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 database query fails.

func (*HistogramMutation) OldMin

func (m *HistogramMutation) OldMin(ctx context.Context) (v int64, err error)

OldMin returns the old min value of the Histogram. If the Histogram 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 database query fails.

func (*HistogramMutation) OldP75

func (m *HistogramMutation) OldP75(ctx context.Context) (v float64, err error)

OldP75 returns the old p75 value of the Histogram. If the Histogram 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 database query fails.

func (*HistogramMutation) OldP95

func (m *HistogramMutation) OldP95(ctx context.Context) (v float64, err error)

OldP95 returns the old p95 value of the Histogram. If the Histogram 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 database query fails.

func (*HistogramMutation) OldP99

func (m *HistogramMutation) OldP99(ctx context.Context) (v float64, err error)

OldP99 returns the old p99 value of the Histogram. If the Histogram 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 database query fails.

func (*HistogramMutation) OldP999

func (m *HistogramMutation) OldP999(ctx context.Context) (v float64, err error)

OldP999 returns the old p999 value of the Histogram. If the Histogram 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 database query fails.

func (*HistogramMutation) OldStddev

func (m *HistogramMutation) OldStddev(ctx context.Context) (v float64, err error)

OldStddev returns the old stddev value of the Histogram. If the Histogram 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 database query fails.

func (*HistogramMutation) OldTime

func (m *HistogramMutation) OldTime(ctx context.Context) (v int64, err error)

OldTime returns the old time value of the Histogram. If the Histogram 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 database query fails.

func (*HistogramMutation) OldWID

func (m *HistogramMutation) OldWID(ctx context.Context) (v string, err error)

OldWID returns the old wID value of the Histogram. If the Histogram 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 database query fails.

func (*HistogramMutation) Op

func (m *HistogramMutation) Op() Op

Op returns the operation name.

func (*HistogramMutation) P75

func (m *HistogramMutation) P75() (r float64, exists bool)

P75 returns the p75 value in the mutation.

func (*HistogramMutation) P95

func (m *HistogramMutation) P95() (r float64, exists bool)

P95 returns the p95 value in the mutation.

func (*HistogramMutation) P99

func (m *HistogramMutation) P99() (r float64, exists bool)

P99 returns the p99 value in the mutation.

func (*HistogramMutation) P999

func (m *HistogramMutation) P999() (r float64, exists bool)

P999 returns the p999 value in the mutation.

func (*HistogramMutation) RemovedEdges

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

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

func (*HistogramMutation) RemovedIDs

func (m *HistogramMutation) RemovedIDs(name string) []ent.Value

RemovedIDs returns all ids (to other nodes) that were removed for the given edge name.

func (*HistogramMutation) ResetCount

func (m *HistogramMutation) ResetCount()

ResetCount reset all changes of the "count" field.

func (*HistogramMutation) ResetEdge

func (m *HistogramMutation) ResetEdge(name string) error

ResetEdge resets all changes in the mutation regarding the given edge name. It returns an error if the edge is not defined in the schema.

func (*HistogramMutation) ResetField

func (m *HistogramMutation) ResetField(name string) error

ResetField resets all changes in the mutation regarding the given field name. It returns an error if the field is not defined in the schema.

func (*HistogramMutation) ResetMax

func (m *HistogramMutation) ResetMax()

ResetMax reset all changes of the "max" field.

func (*HistogramMutation) ResetMean

func (m *HistogramMutation) ResetMean()

ResetMean reset all changes of the "mean" field.

func (*HistogramMutation) ResetMedian

func (m *HistogramMutation) ResetMedian()

ResetMedian reset all changes of the "median" field.

func (*HistogramMutation) ResetMetric

func (m *HistogramMutation) ResetMetric()

ResetMetric reset all changes of the "metric" edge.

func (*HistogramMutation) ResetMin

func (m *HistogramMutation) ResetMin()

ResetMin reset all changes of the "min" field.

func (*HistogramMutation) ResetP75

func (m *HistogramMutation) ResetP75()

ResetP75 reset all changes of the "p75" field.

func (*HistogramMutation) ResetP95

func (m *HistogramMutation) ResetP95()

ResetP95 reset all changes of the "p95" field.

func (*HistogramMutation) ResetP99

func (m *HistogramMutation) ResetP99()

ResetP99 reset all changes of the "p99" field.

func (*HistogramMutation) ResetP999

func (m *HistogramMutation) ResetP999()

ResetP999 reset all changes of the "p999" field.

func (*HistogramMutation) ResetStddev

func (m *HistogramMutation) ResetStddev()

ResetStddev reset all changes of the "stddev" field.

func (*HistogramMutation) ResetTime

func (m *HistogramMutation) ResetTime()

ResetTime reset all changes of the "time" field.

func (*HistogramMutation) ResetWID

func (m *HistogramMutation) ResetWID()

ResetWID reset all changes of the "wID" field.

func (*HistogramMutation) SetCount

func (m *HistogramMutation) SetCount(i int64)

SetCount sets the count field.

func (*HistogramMutation) SetField

func (m *HistogramMutation) SetField(name string, value ent.Value) error

SetField sets the value for the given name. It returns an error if the field is not defined in the schema, or if the type mismatch the field type.

func (*HistogramMutation) SetMax

func (m *HistogramMutation) SetMax(i int64)

SetMax sets the max field.

func (*HistogramMutation) SetMean

func (m *HistogramMutation) SetMean(f float64)

SetMean sets the mean field.

func (*HistogramMutation) SetMedian

func (m *HistogramMutation) SetMedian(f float64)

SetMedian sets the median field.

func (*HistogramMutation) SetMetricID

func (m *HistogramMutation) SetMetricID(id int)

SetMetricID sets the metric edge to Metric by id.

func (*HistogramMutation) SetMin

func (m *HistogramMutation) SetMin(i int64)

SetMin sets the min field.

func (*HistogramMutation) SetP75

func (m *HistogramMutation) SetP75(f float64)

SetP75 sets the p75 field.

func (*HistogramMutation) SetP95

func (m *HistogramMutation) SetP95(f float64)

SetP95 sets the p95 field.

func (*HistogramMutation) SetP99

func (m *HistogramMutation) SetP99(f float64)

SetP99 sets the p99 field.

func (*HistogramMutation) SetP999

func (m *HistogramMutation) SetP999(f float64)

SetP999 sets the p999 field.

func (*HistogramMutation) SetStddev

func (m *HistogramMutation) SetStddev(f float64)

SetStddev sets the stddev field.

func (*HistogramMutation) SetTime

func (m *HistogramMutation) SetTime(i int64)

SetTime sets the time field.

func (*HistogramMutation) SetWID

func (m *HistogramMutation) SetWID(s string)

SetWID sets the wID field.

func (*HistogramMutation) Stddev

func (m *HistogramMutation) Stddev() (r float64, exists bool)

Stddev returns the stddev value in the mutation.

func (*HistogramMutation) Time

func (m *HistogramMutation) Time() (r int64, exists bool)

Time returns the time value in the mutation.

func (HistogramMutation) Tx

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

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

func (*HistogramMutation) Type

func (m *HistogramMutation) Type() string

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

func (*HistogramMutation) WID

func (m *HistogramMutation) WID() (r string, exists bool)

WID returns the wID value in the mutation.

type HistogramQuery

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

HistogramQuery is the builder for querying Histogram entities.

func (*HistogramQuery) All

func (hq *HistogramQuery) All(ctx context.Context) ([]*Histogram, error)

All executes the query and returns a list of Histograms.

func (*HistogramQuery) AllX

func (hq *HistogramQuery) AllX(ctx context.Context) []*Histogram

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

func (*HistogramQuery) Clone

func (hq *HistogramQuery) Clone() *HistogramQuery

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

func (*HistogramQuery) Count

func (hq *HistogramQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*HistogramQuery) CountX

func (hq *HistogramQuery) CountX(ctx context.Context) int

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

func (*HistogramQuery) Exist

func (hq *HistogramQuery) Exist(ctx context.Context) (bool, error)

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

func (*HistogramQuery) ExistX

func (hq *HistogramQuery) ExistX(ctx context.Context) bool

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

func (*HistogramQuery) First

func (hq *HistogramQuery) First(ctx context.Context) (*Histogram, error)

First returns the first Histogram entity in the query. Returns *NotFoundError when no histogram was found.

func (*HistogramQuery) FirstID

func (hq *HistogramQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first Histogram id in the query. Returns *NotFoundError when no id was found.

func (*HistogramQuery) FirstX

func (hq *HistogramQuery) FirstX(ctx context.Context) *Histogram

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

func (*HistogramQuery) FirstXID

func (hq *HistogramQuery) FirstXID(ctx context.Context) int

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

func (*HistogramQuery) GroupBy

func (hq *HistogramQuery) GroupBy(field string, fields ...string) *HistogramGroupBy

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

client.Histogram.Query().
	GroupBy(histogram.FieldTime).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*HistogramQuery) IDs

func (hq *HistogramQuery) IDs(ctx context.Context) ([]int, error)

IDs executes the query and returns a list of Histogram ids.

func (*HistogramQuery) IDsX

func (hq *HistogramQuery) IDsX(ctx context.Context) []int

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

func (*HistogramQuery) Limit

func (hq *HistogramQuery) Limit(limit int) *HistogramQuery

Limit adds a limit step to the query.

func (*HistogramQuery) Offset

func (hq *HistogramQuery) Offset(offset int) *HistogramQuery

Offset adds an offset step to the query.

func (*HistogramQuery) Only

func (hq *HistogramQuery) Only(ctx context.Context) (*Histogram, error)

Only returns the only Histogram entity in the query, returns an error if not exactly one entity was returned.

func (*HistogramQuery) OnlyID

func (hq *HistogramQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID returns the only Histogram id in the query, returns an error if not exactly one id was returned.

func (*HistogramQuery) OnlyIDX

func (hq *HistogramQuery) OnlyIDX(ctx context.Context) int

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

func (*HistogramQuery) OnlyX

func (hq *HistogramQuery) OnlyX(ctx context.Context) *Histogram

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

func (*HistogramQuery) Order

func (hq *HistogramQuery) Order(o ...OrderFunc) *HistogramQuery

Order adds an order step to the query.

func (*HistogramQuery) QueryMetric

func (hq *HistogramQuery) QueryMetric() *MetricQuery

QueryMetric chains the current query on the metric edge.

func (*HistogramQuery) Select

func (hq *HistogramQuery) Select(field string, fields ...string) *HistogramSelect

Select one or more fields from the given query.

Example:

var v []struct {
	Time int64 `json:"time"`
}

client.Histogram.Query().
	Select(histogram.FieldTime).
	Scan(ctx, &v)

func (*HistogramQuery) Where

Where adds a new predicate for the builder.

func (*HistogramQuery) WithMetric

func (hq *HistogramQuery) WithMetric(opts ...func(*MetricQuery)) *HistogramQuery
WithMetric tells the query-builder to eager-loads the nodes that are connected to

the "metric" edge. The optional arguments used to configure the query builder of the edge.

type HistogramSelect

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

HistogramSelect is the builder for select fields of Histogram entities.

func (*HistogramSelect) Bool

func (hs *HistogramSelect) Bool(ctx context.Context) (_ bool, err error)

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

func (*HistogramSelect) BoolX

func (hs *HistogramSelect) BoolX(ctx context.Context) bool

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

func (*HistogramSelect) Bools

func (hs *HistogramSelect) Bools(ctx context.Context) ([]bool, error)

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

func (*HistogramSelect) BoolsX

func (hs *HistogramSelect) BoolsX(ctx context.Context) []bool

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

func (*HistogramSelect) Float64

func (hs *HistogramSelect) Float64(ctx context.Context) (_ float64, err error)

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

func (*HistogramSelect) Float64X

func (hs *HistogramSelect) Float64X(ctx context.Context) float64

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

func (*HistogramSelect) Float64s

func (hs *HistogramSelect) Float64s(ctx context.Context) ([]float64, error)

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

func (*HistogramSelect) Float64sX

func (hs *HistogramSelect) Float64sX(ctx context.Context) []float64

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

func (*HistogramSelect) Int

func (hs *HistogramSelect) Int(ctx context.Context) (_ int, err error)

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

func (*HistogramSelect) IntX

func (hs *HistogramSelect) IntX(ctx context.Context) int

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

func (*HistogramSelect) Ints

func (hs *HistogramSelect) Ints(ctx context.Context) ([]int, error)

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

func (*HistogramSelect) IntsX

func (hs *HistogramSelect) IntsX(ctx context.Context) []int

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

func (*HistogramSelect) Scan

func (hs *HistogramSelect) Scan(ctx context.Context, v interface{}) error

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

func (*HistogramSelect) ScanX

func (hs *HistogramSelect) ScanX(ctx context.Context, v interface{})

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

func (*HistogramSelect) String

func (hs *HistogramSelect) String(ctx context.Context) (_ string, err error)

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

func (*HistogramSelect) StringX

func (hs *HistogramSelect) StringX(ctx context.Context) string

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

func (*HistogramSelect) Strings

func (hs *HistogramSelect) Strings(ctx context.Context) ([]string, error)

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

func (*HistogramSelect) StringsX

func (hs *HistogramSelect) StringsX(ctx context.Context) []string

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

type HistogramUpdate

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

HistogramUpdate is the builder for updating Histogram entities.

func (*HistogramUpdate) AddCount

func (hu *HistogramUpdate) AddCount(i int64) *HistogramUpdate

AddCount adds i to count.

func (*HistogramUpdate) AddMax

func (hu *HistogramUpdate) AddMax(i int64) *HistogramUpdate

AddMax adds i to max.

func (*HistogramUpdate) AddMean

func (hu *HistogramUpdate) AddMean(f float64) *HistogramUpdate

AddMean adds f to mean.

func (*HistogramUpdate) AddMedian

func (hu *HistogramUpdate) AddMedian(f float64) *HistogramUpdate

AddMedian adds f to median.

func (*HistogramUpdate) AddMin

func (hu *HistogramUpdate) AddMin(i int64) *HistogramUpdate

AddMin adds i to min.

func (*HistogramUpdate) AddP75

func (hu *HistogramUpdate) AddP75(f float64) *HistogramUpdate

AddP75 adds f to p75.

func (*HistogramUpdate) AddP95

func (hu *HistogramUpdate) AddP95(f float64) *HistogramUpdate

AddP95 adds f to p95.

func (*HistogramUpdate) AddP99

func (hu *HistogramUpdate) AddP99(f float64) *HistogramUpdate

AddP99 adds f to p99.

func (*HistogramUpdate) AddP999

func (hu *HistogramUpdate) AddP999(f float64) *HistogramUpdate

AddP999 adds f to p999.

func (*HistogramUpdate) AddStddev

func (hu *HistogramUpdate) AddStddev(f float64) *HistogramUpdate

AddStddev adds f to stddev.

func (*HistogramUpdate) AddTime

func (hu *HistogramUpdate) AddTime(i int64) *HistogramUpdate

AddTime adds i to time.

func (*HistogramUpdate) ClearMetric

func (hu *HistogramUpdate) ClearMetric() *HistogramUpdate

ClearMetric clears the "metric" edge to type Metric.

func (*HistogramUpdate) Exec

func (hu *HistogramUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*HistogramUpdate) ExecX

func (hu *HistogramUpdate) ExecX(ctx context.Context)

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

func (*HistogramUpdate) Mutation

func (hu *HistogramUpdate) Mutation() *HistogramMutation

Mutation returns the HistogramMutation object of the builder.

func (*HistogramUpdate) Save

func (hu *HistogramUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of rows/vertices matched by this operation.

func (*HistogramUpdate) SaveX

func (hu *HistogramUpdate) SaveX(ctx context.Context) int

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

func (*HistogramUpdate) SetCount

func (hu *HistogramUpdate) SetCount(i int64) *HistogramUpdate

SetCount sets the count field.

func (*HistogramUpdate) SetMax

func (hu *HistogramUpdate) SetMax(i int64) *HistogramUpdate

SetMax sets the max field.

func (*HistogramUpdate) SetMean

func (hu *HistogramUpdate) SetMean(f float64) *HistogramUpdate

SetMean sets the mean field.

func (*HistogramUpdate) SetMedian

func (hu *HistogramUpdate) SetMedian(f float64) *HistogramUpdate

SetMedian sets the median field.

func (*HistogramUpdate) SetMetric

func (hu *HistogramUpdate) SetMetric(m *Metric) *HistogramUpdate

SetMetric sets the metric edge to Metric.

func (*HistogramUpdate) SetMetricID

func (hu *HistogramUpdate) SetMetricID(id int) *HistogramUpdate

SetMetricID sets the metric edge to Metric by id.

func (*HistogramUpdate) SetMin

func (hu *HistogramUpdate) SetMin(i int64) *HistogramUpdate

SetMin sets the min field.

func (*HistogramUpdate) SetNillableMetricID

func (hu *HistogramUpdate) SetNillableMetricID(id *int) *HistogramUpdate

SetNillableMetricID sets the metric edge to Metric by id if the given value is not nil.

func (*HistogramUpdate) SetP75

func (hu *HistogramUpdate) SetP75(f float64) *HistogramUpdate

SetP75 sets the p75 field.

func (*HistogramUpdate) SetP95

func (hu *HistogramUpdate) SetP95(f float64) *HistogramUpdate

SetP95 sets the p95 field.

func (*HistogramUpdate) SetP99

func (hu *HistogramUpdate) SetP99(f float64) *HistogramUpdate

SetP99 sets the p99 field.

func (*HistogramUpdate) SetP999

func (hu *HistogramUpdate) SetP999(f float64) *HistogramUpdate

SetP999 sets the p999 field.

func (*HistogramUpdate) SetStddev

func (hu *HistogramUpdate) SetStddev(f float64) *HistogramUpdate

SetStddev sets the stddev field.

func (*HistogramUpdate) SetTime

func (hu *HistogramUpdate) SetTime(i int64) *HistogramUpdate

SetTime sets the time field.

func (*HistogramUpdate) SetWID

func (hu *HistogramUpdate) SetWID(s string) *HistogramUpdate

SetWID sets the wID field.

func (*HistogramUpdate) Where

Where adds a new predicate for the builder.

type HistogramUpdateOne

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

HistogramUpdateOne is the builder for updating a single Histogram entity.

func (*HistogramUpdateOne) AddCount

func (huo *HistogramUpdateOne) AddCount(i int64) *HistogramUpdateOne

AddCount adds i to count.

func (*HistogramUpdateOne) AddMax

AddMax adds i to max.

func (*HistogramUpdateOne) AddMean

AddMean adds f to mean.

func (*HistogramUpdateOne) AddMedian

func (huo *HistogramUpdateOne) AddMedian(f float64) *HistogramUpdateOne

AddMedian adds f to median.

func (*HistogramUpdateOne) AddMin

AddMin adds i to min.

func (*HistogramUpdateOne) AddP75

AddP75 adds f to p75.

func (*HistogramUpdateOne) AddP95

AddP95 adds f to p95.

func (*HistogramUpdateOne) AddP99

AddP99 adds f to p99.

func (*HistogramUpdateOne) AddP999

AddP999 adds f to p999.

func (*HistogramUpdateOne) AddStddev

func (huo *HistogramUpdateOne) AddStddev(f float64) *HistogramUpdateOne

AddStddev adds f to stddev.

func (*HistogramUpdateOne) AddTime

func (huo *HistogramUpdateOne) AddTime(i int64) *HistogramUpdateOne

AddTime adds i to time.

func (*HistogramUpdateOne) ClearMetric

func (huo *HistogramUpdateOne) ClearMetric() *HistogramUpdateOne

ClearMetric clears the "metric" edge to type Metric.

func (*HistogramUpdateOne) Exec

func (huo *HistogramUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*HistogramUpdateOne) ExecX

func (huo *HistogramUpdateOne) ExecX(ctx context.Context)

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

func (*HistogramUpdateOne) Mutation

func (huo *HistogramUpdateOne) Mutation() *HistogramMutation

Mutation returns the HistogramMutation object of the builder.

func (*HistogramUpdateOne) Save

func (huo *HistogramUpdateOne) Save(ctx context.Context) (*Histogram, error)

Save executes the query and returns the updated entity.

func (*HistogramUpdateOne) SaveX

func (huo *HistogramUpdateOne) SaveX(ctx context.Context) *Histogram

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

func (*HistogramUpdateOne) SetCount

func (huo *HistogramUpdateOne) SetCount(i int64) *HistogramUpdateOne

SetCount sets the count field.

func (*HistogramUpdateOne) SetMax

SetMax sets the max field.

func (*HistogramUpdateOne) SetMean

SetMean sets the mean field.

func (*HistogramUpdateOne) SetMedian

func (huo *HistogramUpdateOne) SetMedian(f float64) *HistogramUpdateOne

SetMedian sets the median field.

func (*HistogramUpdateOne) SetMetric

func (huo *HistogramUpdateOne) SetMetric(m *Metric) *HistogramUpdateOne

SetMetric sets the metric edge to Metric.

func (*HistogramUpdateOne) SetMetricID

func (huo *HistogramUpdateOne) SetMetricID(id int) *HistogramUpdateOne

SetMetricID sets the metric edge to Metric by id.

func (*HistogramUpdateOne) SetMin

SetMin sets the min field.

func (*HistogramUpdateOne) SetNillableMetricID

func (huo *HistogramUpdateOne) SetNillableMetricID(id *int) *HistogramUpdateOne

SetNillableMetricID sets the metric edge to Metric by id if the given value is not nil.

func (*HistogramUpdateOne) SetP75

SetP75 sets the p75 field.

func (*HistogramUpdateOne) SetP95

SetP95 sets the p95 field.

func (*HistogramUpdateOne) SetP99

SetP99 sets the p99 field.

func (*HistogramUpdateOne) SetP999

SetP999 sets the p999 field.

func (*HistogramUpdateOne) SetStddev

func (huo *HistogramUpdateOne) SetStddev(f float64) *HistogramUpdateOne

SetStddev sets the stddev field.

func (*HistogramUpdateOne) SetTime

func (huo *HistogramUpdateOne) SetTime(i int64) *HistogramUpdateOne

SetTime sets the time field.

func (*HistogramUpdateOne) SetWID

SetWID sets the wID field.

type Histograms

type Histograms []*Histogram

Histograms is a parsable slice of Histogram.

type Hook

type Hook = ent.Hook

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

type Metric

type Metric struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// Title holds the value of the "title" field.
	Title string `json:"title"`
	// Type holds the value of the "type" field.
	Type string `json:"type"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the MetricQuery when eager-loading is set.
	Edges MetricEdges `json:"edges"`
	// contains filtered or unexported fields
}

Metric is the model entity for the Metric schema.

func (*Metric) QueryCounters

func (m *Metric) QueryCounters() *CounterQuery

QueryCounters queries the counters edge of the Metric.

func (*Metric) QueryGauges

func (m *Metric) QueryGauges() *GaugeQuery

QueryGauges queries the gauges edge of the Metric.

func (*Metric) QueryGraph

func (m *Metric) QueryGraph() *GraphQuery

QueryGraph queries the graph edge of the Metric.

func (*Metric) QueryHistograms

func (m *Metric) QueryHistograms() *HistogramQuery

QueryHistograms queries the histograms edge of the Metric.

func (*Metric) String

func (m *Metric) String() string

String implements the fmt.Stringer.

func (*Metric) Unwrap

func (m *Metric) Unwrap() *Metric

Unwrap unwraps the entity that was returned from a transaction after it was closed, so that all next queries will be executed through the driver which created the transaction.

func (*Metric) Update

func (m *Metric) Update() *MetricUpdateOne

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

type MetricClient

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

MetricClient is a client for the Metric schema.

func NewMetricClient

func NewMetricClient(c config) *MetricClient

NewMetricClient returns a client for the Metric from the given config.

func (*MetricClient) Create

func (c *MetricClient) Create() *MetricCreate

Create returns a create builder for Metric.

func (*MetricClient) CreateBulk

func (c *MetricClient) CreateBulk(builders ...*MetricCreate) *MetricCreateBulk

BulkCreate returns a builder for creating a bulk of Metric entities.

func (*MetricClient) Delete

func (c *MetricClient) Delete() *MetricDelete

Delete returns a delete builder for Metric.

func (*MetricClient) DeleteOne

func (c *MetricClient) DeleteOne(m *Metric) *MetricDeleteOne

DeleteOne returns a delete builder for the given entity.

func (*MetricClient) DeleteOneID

func (c *MetricClient) DeleteOneID(id int) *MetricDeleteOne

DeleteOneID returns a delete builder for the given id.

func (*MetricClient) Get

func (c *MetricClient) Get(ctx context.Context, id int) (*Metric, error)

Get returns a Metric entity by its id.

func (*MetricClient) GetX

func (c *MetricClient) GetX(ctx context.Context, id int) *Metric

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

func (*MetricClient) Hooks

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

Hooks returns the client hooks.

func (*MetricClient) Query

func (c *MetricClient) Query() *MetricQuery

Query returns a query builder for Metric.

func (*MetricClient) QueryCounters

func (c *MetricClient) QueryCounters(m *Metric) *CounterQuery

QueryCounters queries the counters edge of a Metric.

func (*MetricClient) QueryGauges

func (c *MetricClient) QueryGauges(m *Metric) *GaugeQuery

QueryGauges queries the gauges edge of a Metric.

func (*MetricClient) QueryGraph

func (c *MetricClient) QueryGraph(m *Metric) *GraphQuery

QueryGraph queries the graph edge of a Metric.

func (*MetricClient) QueryHistograms

func (c *MetricClient) QueryHistograms(m *Metric) *HistogramQuery

QueryHistograms queries the histograms edge of a Metric.

func (*MetricClient) Update

func (c *MetricClient) Update() *MetricUpdate

Update returns an update builder for Metric.

func (*MetricClient) UpdateOne

func (c *MetricClient) UpdateOne(m *Metric) *MetricUpdateOne

UpdateOne returns an update builder for the given entity.

func (*MetricClient) UpdateOneID

func (c *MetricClient) UpdateOneID(id int) *MetricUpdateOne

UpdateOneID returns an update builder for the given id.

func (*MetricClient) Use

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

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

type MetricCreate

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

MetricCreate is the builder for creating a Metric entity.

func (*MetricCreate) AddCounterIDs

func (mc *MetricCreate) AddCounterIDs(ids ...int) *MetricCreate

AddCounterIDs adds the counters edge to Counter by ids.

func (*MetricCreate) AddCounters

func (mc *MetricCreate) AddCounters(c ...*Counter) *MetricCreate

AddCounters adds the counters edges to Counter.

func (*MetricCreate) AddGaugeIDs

func (mc *MetricCreate) AddGaugeIDs(ids ...int) *MetricCreate

AddGaugeIDs adds the gauges edge to Gauge by ids.

func (*MetricCreate) AddGauges

func (mc *MetricCreate) AddGauges(g ...*Gauge) *MetricCreate

AddGauges adds the gauges edges to Gauge.

func (*MetricCreate) AddHistogramIDs

func (mc *MetricCreate) AddHistogramIDs(ids ...int) *MetricCreate

AddHistogramIDs adds the histograms edge to Histogram by ids.

func (*MetricCreate) AddHistograms

func (mc *MetricCreate) AddHistograms(h ...*Histogram) *MetricCreate

AddHistograms adds the histograms edges to Histogram.

func (*MetricCreate) Mutation

func (mc *MetricCreate) Mutation() *MetricMutation

Mutation returns the MetricMutation object of the builder.

func (*MetricCreate) Save

func (mc *MetricCreate) Save(ctx context.Context) (*Metric, error)

Save creates the Metric in the database.

func (*MetricCreate) SaveX

func (mc *MetricCreate) SaveX(ctx context.Context) *Metric

SaveX calls Save and panics if Save returns an error.

func (*MetricCreate) SetGraph

func (mc *MetricCreate) SetGraph(g *Graph) *MetricCreate

SetGraph sets the graph edge to Graph.

func (*MetricCreate) SetGraphID

func (mc *MetricCreate) SetGraphID(id int) *MetricCreate

SetGraphID sets the graph edge to Graph by id.

func (*MetricCreate) SetNillableGraphID

func (mc *MetricCreate) SetNillableGraphID(id *int) *MetricCreate

SetNillableGraphID sets the graph edge to Graph by id if the given value is not nil.

func (*MetricCreate) SetTitle

func (mc *MetricCreate) SetTitle(s string) *MetricCreate

SetTitle sets the title field.

func (*MetricCreate) SetType

func (mc *MetricCreate) SetType(s string) *MetricCreate

SetType sets the type field.

type MetricCreateBulk

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

MetricCreateBulk is the builder for creating a bulk of Metric entities.

func (*MetricCreateBulk) Save

func (mcb *MetricCreateBulk) Save(ctx context.Context) ([]*Metric, error)

Save creates the Metric entities in the database.

func (*MetricCreateBulk) SaveX

func (mcb *MetricCreateBulk) SaveX(ctx context.Context) []*Metric

SaveX calls Save and panics if Save returns an error.

type MetricDelete

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

MetricDelete is the builder for deleting a Metric entity.

func (*MetricDelete) Exec

func (md *MetricDelete) Exec(ctx context.Context) (int, error)

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

func (*MetricDelete) ExecX

func (md *MetricDelete) ExecX(ctx context.Context) int

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

func (*MetricDelete) Where

func (md *MetricDelete) Where(ps ...predicate.Metric) *MetricDelete

Where adds a new predicate to the delete builder.

type MetricDeleteOne

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

MetricDeleteOne is the builder for deleting a single Metric entity.

func (*MetricDeleteOne) Exec

func (mdo *MetricDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*MetricDeleteOne) ExecX

func (mdo *MetricDeleteOne) ExecX(ctx context.Context)

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

type MetricEdges

type MetricEdges struct {
	// Graph holds the value of the graph edge.
	Graph *Graph
	// Histograms holds the value of the histograms edge.
	Histograms []*Histogram
	// Counters holds the value of the counters edge.
	Counters []*Counter
	// Gauges holds the value of the gauges edge.
	Gauges []*Gauge
	// contains filtered or unexported fields
}

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

func (MetricEdges) CountersOrErr

func (e MetricEdges) CountersOrErr() ([]*Counter, error)

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

func (MetricEdges) GaugesOrErr

func (e MetricEdges) GaugesOrErr() ([]*Gauge, error)

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

func (MetricEdges) GraphOrErr

func (e MetricEdges) GraphOrErr() (*Graph, error)

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

func (MetricEdges) HistogramsOrErr

func (e MetricEdges) HistogramsOrErr() ([]*Histogram, error)

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

type MetricGroupBy

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

MetricGroupBy is the builder for group-by Metric entities.

func (*MetricGroupBy) Aggregate

func (mgb *MetricGroupBy) Aggregate(fns ...AggregateFunc) *MetricGroupBy

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

func (*MetricGroupBy) Bool

func (mgb *MetricGroupBy) Bool(ctx context.Context) (_ bool, err error)

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

func (*MetricGroupBy) BoolX

func (mgb *MetricGroupBy) BoolX(ctx context.Context) bool

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

func (*MetricGroupBy) Bools

func (mgb *MetricGroupBy) Bools(ctx context.Context) ([]bool, error)

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

func (*MetricGroupBy) BoolsX

func (mgb *MetricGroupBy) BoolsX(ctx context.Context) []bool

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

func (*MetricGroupBy) Float64

func (mgb *MetricGroupBy) Float64(ctx context.Context) (_ float64, err error)

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

func (*MetricGroupBy) Float64X

func (mgb *MetricGroupBy) Float64X(ctx context.Context) float64

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

func (*MetricGroupBy) Float64s

func (mgb *MetricGroupBy) Float64s(ctx context.Context) ([]float64, error)

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

func (*MetricGroupBy) Float64sX

func (mgb *MetricGroupBy) Float64sX(ctx context.Context) []float64

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

func (*MetricGroupBy) Int

func (mgb *MetricGroupBy) Int(ctx context.Context) (_ int, err error)

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

func (*MetricGroupBy) IntX

func (mgb *MetricGroupBy) IntX(ctx context.Context) int

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

func (*MetricGroupBy) Ints

func (mgb *MetricGroupBy) Ints(ctx context.Context) ([]int, error)

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

func (*MetricGroupBy) IntsX

func (mgb *MetricGroupBy) IntsX(ctx context.Context) []int

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

func (*MetricGroupBy) Scan

func (mgb *MetricGroupBy) Scan(ctx context.Context, v interface{}) error

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

func (*MetricGroupBy) ScanX

func (mgb *MetricGroupBy) ScanX(ctx context.Context, v interface{})

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

func (*MetricGroupBy) String

func (mgb *MetricGroupBy) String(ctx context.Context) (_ string, err error)

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

func (*MetricGroupBy) StringX

func (mgb *MetricGroupBy) StringX(ctx context.Context) string

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

func (*MetricGroupBy) Strings

func (mgb *MetricGroupBy) Strings(ctx context.Context) ([]string, error)

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

func (*MetricGroupBy) StringsX

func (mgb *MetricGroupBy) StringsX(ctx context.Context) []string

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

type MetricMutation

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

MetricMutation represents an operation that mutate the Metrics nodes in the graph.

func (*MetricMutation) AddCounterIDs

func (m *MetricMutation) AddCounterIDs(ids ...int)

AddCounterIDs adds the counters edge to Counter by ids.

func (*MetricMutation) AddField

func (m *MetricMutation) AddField(name string, value ent.Value) error

AddField adds the value for the given name. It returns an error if the field is not defined in the schema, or if the type mismatch the field type.

func (*MetricMutation) AddGaugeIDs

func (m *MetricMutation) AddGaugeIDs(ids ...int)

AddGaugeIDs adds the gauges edge to Gauge by ids.

func (*MetricMutation) AddHistogramIDs

func (m *MetricMutation) AddHistogramIDs(ids ...int)

AddHistogramIDs adds the histograms edge to Histogram by ids.

func (*MetricMutation) AddedEdges

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

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

func (*MetricMutation) AddedField

func (m *MetricMutation) AddedField(name string) (ent.Value, bool)

AddedField returns the numeric value that was in/decremented from a field with the given name. The second value indicates that this field was not set, or was not define in the schema.

func (*MetricMutation) AddedFields

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

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

func (*MetricMutation) AddedIDs

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

AddedIDs returns all ids (to other nodes) that were added for the given edge name.

func (*MetricMutation) ClearCounters

func (m *MetricMutation) ClearCounters()

ClearCounters clears the counters edge to Counter.

func (*MetricMutation) ClearEdge

func (m *MetricMutation) ClearEdge(name string) error

ClearEdge clears the value for the given name. It returns an error if the edge name is not defined in the schema.

func (*MetricMutation) ClearField

func (m *MetricMutation) ClearField(name string) error

ClearField clears the value for the given name. It returns an error if the field is not defined in the schema.

func (*MetricMutation) ClearGauges

func (m *MetricMutation) ClearGauges()

ClearGauges clears the gauges edge to Gauge.

func (*MetricMutation) ClearGraph

func (m *MetricMutation) ClearGraph()

ClearGraph clears the graph edge to Graph.

func (*MetricMutation) ClearHistograms

func (m *MetricMutation) ClearHistograms()

ClearHistograms clears the histograms edge to Histogram.

func (*MetricMutation) ClearedEdges

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

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

func (*MetricMutation) ClearedFields

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

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

func (MetricMutation) Client

func (m MetricMutation) 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 (*MetricMutation) CountersCleared

func (m *MetricMutation) CountersCleared() bool

CountersCleared returns if the edge counters was cleared.

func (*MetricMutation) CountersIDs

func (m *MetricMutation) CountersIDs() (ids []int)

CountersIDs returns the counters ids in the mutation.

func (*MetricMutation) EdgeCleared

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

EdgeCleared returns a boolean indicates if this edge was cleared in this mutation.

func (*MetricMutation) Field

func (m *MetricMutation) Field(name string) (ent.Value, bool)

Field returns the value of a field with the given name. The second boolean value indicates that this field was not set, or was not define in the schema.

func (*MetricMutation) FieldCleared

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

FieldCleared returns a boolean indicates if this field was cleared in this mutation.

func (*MetricMutation) Fields

func (m *MetricMutation) Fields() []string

Fields returns all fields that were changed during this mutation. Note that, in order to get all numeric fields that were in/decremented, call AddedFields().

func (*MetricMutation) GaugesCleared

func (m *MetricMutation) GaugesCleared() bool

GaugesCleared returns if the edge gauges was cleared.

func (*MetricMutation) GaugesIDs

func (m *MetricMutation) GaugesIDs() (ids []int)

GaugesIDs returns the gauges ids in the mutation.

func (*MetricMutation) GetType

func (m *MetricMutation) GetType() (r string, exists bool)

GetType returns the type value in the mutation.

func (*MetricMutation) GraphCleared

func (m *MetricMutation) GraphCleared() bool

GraphCleared returns if the edge graph was cleared.

func (*MetricMutation) GraphID

func (m *MetricMutation) GraphID() (id int, exists bool)

GraphID returns the graph id in the mutation.

func (*MetricMutation) GraphIDs

func (m *MetricMutation) GraphIDs() (ids []int)

GraphIDs returns the graph ids in the mutation. Note that ids always returns len(ids) <= 1 for unique edges, and you should use GraphID instead. It exists only for internal usage by the builders.

func (*MetricMutation) HistogramsCleared

func (m *MetricMutation) HistogramsCleared() bool

HistogramsCleared returns if the edge histograms was cleared.

func (*MetricMutation) HistogramsIDs

func (m *MetricMutation) HistogramsIDs() (ids []int)

HistogramsIDs returns the histograms ids in the mutation.

func (*MetricMutation) ID

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

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

func (*MetricMutation) OldField

func (m *MetricMutation) 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 was failed.

func (*MetricMutation) OldTitle

func (m *MetricMutation) OldTitle(ctx context.Context) (v string, err error)

OldTitle returns the old title value of the Metric. If the Metric 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 database query fails.

func (*MetricMutation) OldType

func (m *MetricMutation) OldType(ctx context.Context) (v string, err error)

OldType returns the old type value of the Metric. If the Metric 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 database query fails.

func (*MetricMutation) Op

func (m *MetricMutation) Op() Op

Op returns the operation name.

func (*MetricMutation) RemoveCounterIDs

func (m *MetricMutation) RemoveCounterIDs(ids ...int)

RemoveCounterIDs removes the counters edge to Counter by ids.

func (*MetricMutation) RemoveGaugeIDs

func (m *MetricMutation) RemoveGaugeIDs(ids ...int)

RemoveGaugeIDs removes the gauges edge to Gauge by ids.

func (*MetricMutation) RemoveHistogramIDs

func (m *MetricMutation) RemoveHistogramIDs(ids ...int)

RemoveHistogramIDs removes the histograms edge to Histogram by ids.

func (*MetricMutation) RemovedCountersIDs

func (m *MetricMutation) RemovedCountersIDs() (ids []int)

RemovedCounters returns the removed ids of counters.

func (*MetricMutation) RemovedEdges

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

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

func (*MetricMutation) RemovedGaugesIDs

func (m *MetricMutation) RemovedGaugesIDs() (ids []int)

RemovedGauges returns the removed ids of gauges.

func (*MetricMutation) RemovedHistogramsIDs

func (m *MetricMutation) RemovedHistogramsIDs() (ids []int)

RemovedHistograms returns the removed ids of histograms.

func (*MetricMutation) RemovedIDs

func (m *MetricMutation) RemovedIDs(name string) []ent.Value

RemovedIDs returns all ids (to other nodes) that were removed for the given edge name.

func (*MetricMutation) ResetCounters

func (m *MetricMutation) ResetCounters()

ResetCounters reset all changes of the "counters" edge.

func (*MetricMutation) ResetEdge

func (m *MetricMutation) ResetEdge(name string) error

ResetEdge resets all changes in the mutation regarding the given edge name. It returns an error if the edge is not defined in the schema.

func (*MetricMutation) ResetField

func (m *MetricMutation) ResetField(name string) error

ResetField resets all changes in the mutation regarding the given field name. It returns an error if the field is not defined in the schema.

func (*MetricMutation) ResetGauges

func (m *MetricMutation) ResetGauges()

ResetGauges reset all changes of the "gauges" edge.

func (*MetricMutation) ResetGraph

func (m *MetricMutation) ResetGraph()

ResetGraph reset all changes of the "graph" edge.

func (*MetricMutation) ResetHistograms

func (m *MetricMutation) ResetHistograms()

ResetHistograms reset all changes of the "histograms" edge.

func (*MetricMutation) ResetTitle

func (m *MetricMutation) ResetTitle()

ResetTitle reset all changes of the "title" field.

func (*MetricMutation) ResetType

func (m *MetricMutation) ResetType()

ResetType reset all changes of the "type" field.

func (*MetricMutation) SetField

func (m *MetricMutation) SetField(name string, value ent.Value) error

SetField sets the value for the given name. It returns an error if the field is not defined in the schema, or if the type mismatch the field type.

func (*MetricMutation) SetGraphID

func (m *MetricMutation) SetGraphID(id int)

SetGraphID sets the graph edge to Graph by id.

func (*MetricMutation) SetTitle

func (m *MetricMutation) SetTitle(s string)

SetTitle sets the title field.

func (*MetricMutation) SetType

func (m *MetricMutation) SetType(s string)

SetType sets the type field.

func (*MetricMutation) Title

func (m *MetricMutation) Title() (r string, exists bool)

Title returns the title value in the mutation.

func (MetricMutation) Tx

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

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

func (*MetricMutation) Type

func (m *MetricMutation) Type() string

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

type MetricQuery

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

MetricQuery is the builder for querying Metric entities.

func (*MetricQuery) All

func (mq *MetricQuery) All(ctx context.Context) ([]*Metric, error)

All executes the query and returns a list of Metrics.

func (*MetricQuery) AllX

func (mq *MetricQuery) AllX(ctx context.Context) []*Metric

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

func (*MetricQuery) Clone

func (mq *MetricQuery) Clone() *MetricQuery

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

func (*MetricQuery) Count

func (mq *MetricQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*MetricQuery) CountX

func (mq *MetricQuery) CountX(ctx context.Context) int

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

func (*MetricQuery) Exist

func (mq *MetricQuery) Exist(ctx context.Context) (bool, error)

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

func (*MetricQuery) ExistX

func (mq *MetricQuery) ExistX(ctx context.Context) bool

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

func (*MetricQuery) First

func (mq *MetricQuery) First(ctx context.Context) (*Metric, error)

First returns the first Metric entity in the query. Returns *NotFoundError when no metric was found.

func (*MetricQuery) FirstID

func (mq *MetricQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first Metric id in the query. Returns *NotFoundError when no id was found.

func (*MetricQuery) FirstX

func (mq *MetricQuery) FirstX(ctx context.Context) *Metric

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

func (*MetricQuery) FirstXID

func (mq *MetricQuery) FirstXID(ctx context.Context) int

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

func (*MetricQuery) GroupBy

func (mq *MetricQuery) GroupBy(field string, fields ...string) *MetricGroupBy

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

client.Metric.Query().
	GroupBy(metric.FieldTitle).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*MetricQuery) IDs

func (mq *MetricQuery) IDs(ctx context.Context) ([]int, error)

IDs executes the query and returns a list of Metric ids.

func (*MetricQuery) IDsX

func (mq *MetricQuery) IDsX(ctx context.Context) []int

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

func (*MetricQuery) Limit

func (mq *MetricQuery) Limit(limit int) *MetricQuery

Limit adds a limit step to the query.

func (*MetricQuery) Offset

func (mq *MetricQuery) Offset(offset int) *MetricQuery

Offset adds an offset step to the query.

func (*MetricQuery) Only

func (mq *MetricQuery) Only(ctx context.Context) (*Metric, error)

Only returns the only Metric entity in the query, returns an error if not exactly one entity was returned.

func (*MetricQuery) OnlyID

func (mq *MetricQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID returns the only Metric id in the query, returns an error if not exactly one id was returned.

func (*MetricQuery) OnlyIDX

func (mq *MetricQuery) OnlyIDX(ctx context.Context) int

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

func (*MetricQuery) OnlyX

func (mq *MetricQuery) OnlyX(ctx context.Context) *Metric

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

func (*MetricQuery) Order

func (mq *MetricQuery) Order(o ...OrderFunc) *MetricQuery

Order adds an order step to the query.

func (*MetricQuery) QueryCounters

func (mq *MetricQuery) QueryCounters() *CounterQuery

QueryCounters chains the current query on the counters edge.

func (*MetricQuery) QueryGauges

func (mq *MetricQuery) QueryGauges() *GaugeQuery

QueryGauges chains the current query on the gauges edge.

func (*MetricQuery) QueryGraph

func (mq *MetricQuery) QueryGraph() *GraphQuery

QueryGraph chains the current query on the graph edge.

func (*MetricQuery) QueryHistograms

func (mq *MetricQuery) QueryHistograms() *HistogramQuery

QueryHistograms chains the current query on the histograms edge.

func (*MetricQuery) Select

func (mq *MetricQuery) Select(field string, fields ...string) *MetricSelect

Select one or more fields from the given query.

Example:

var v []struct {
	Title string `json:"title"`
}

client.Metric.Query().
	Select(metric.FieldTitle).
	Scan(ctx, &v)

func (*MetricQuery) Where

func (mq *MetricQuery) Where(ps ...predicate.Metric) *MetricQuery

Where adds a new predicate for the builder.

func (*MetricQuery) WithCounters

func (mq *MetricQuery) WithCounters(opts ...func(*CounterQuery)) *MetricQuery
WithCounters tells the query-builder to eager-loads the nodes that are connected to

the "counters" edge. The optional arguments used to configure the query builder of the edge.

func (*MetricQuery) WithGauges

func (mq *MetricQuery) WithGauges(opts ...func(*GaugeQuery)) *MetricQuery
WithGauges tells the query-builder to eager-loads the nodes that are connected to

the "gauges" edge. The optional arguments used to configure the query builder of the edge.

func (*MetricQuery) WithGraph

func (mq *MetricQuery) WithGraph(opts ...func(*GraphQuery)) *MetricQuery
WithGraph tells the query-builder to eager-loads the nodes that are connected to

the "graph" edge. The optional arguments used to configure the query builder of the edge.

func (*MetricQuery) WithHistograms

func (mq *MetricQuery) WithHistograms(opts ...func(*HistogramQuery)) *MetricQuery
WithHistograms tells the query-builder to eager-loads the nodes that are connected to

the "histograms" edge. The optional arguments used to configure the query builder of the edge.

type MetricSelect

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

MetricSelect is the builder for select fields of Metric entities.

func (*MetricSelect) Bool

func (ms *MetricSelect) Bool(ctx context.Context) (_ bool, err error)

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

func (*MetricSelect) BoolX

func (ms *MetricSelect) BoolX(ctx context.Context) bool

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

func (*MetricSelect) Bools

func (ms *MetricSelect) Bools(ctx context.Context) ([]bool, error)

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

func (*MetricSelect) BoolsX

func (ms *MetricSelect) BoolsX(ctx context.Context) []bool

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

func (*MetricSelect) Float64

func (ms *MetricSelect) Float64(ctx context.Context) (_ float64, err error)

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

func (*MetricSelect) Float64X

func (ms *MetricSelect) Float64X(ctx context.Context) float64

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

func (*MetricSelect) Float64s

func (ms *MetricSelect) Float64s(ctx context.Context) ([]float64, error)

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

func (*MetricSelect) Float64sX

func (ms *MetricSelect) Float64sX(ctx context.Context) []float64

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

func (*MetricSelect) Int

func (ms *MetricSelect) Int(ctx context.Context) (_ int, err error)

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

func (*MetricSelect) IntX

func (ms *MetricSelect) IntX(ctx context.Context) int

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

func (*MetricSelect) Ints

func (ms *MetricSelect) Ints(ctx context.Context) ([]int, error)

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

func (*MetricSelect) IntsX

func (ms *MetricSelect) IntsX(ctx context.Context) []int

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

func (*MetricSelect) Scan

func (ms *MetricSelect) Scan(ctx context.Context, v interface{}) error

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

func (*MetricSelect) ScanX

func (ms *MetricSelect) ScanX(ctx context.Context, v interface{})

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

func (*MetricSelect) String

func (ms *MetricSelect) String(ctx context.Context) (_ string, err error)

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

func (*MetricSelect) StringX

func (ms *MetricSelect) StringX(ctx context.Context) string

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

func (*MetricSelect) Strings

func (ms *MetricSelect) Strings(ctx context.Context) ([]string, error)

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

func (*MetricSelect) StringsX

func (ms *MetricSelect) StringsX(ctx context.Context) []string

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

type MetricUpdate

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

MetricUpdate is the builder for updating Metric entities.

func (*MetricUpdate) AddCounterIDs

func (mu *MetricUpdate) AddCounterIDs(ids ...int) *MetricUpdate

AddCounterIDs adds the counters edge to Counter by ids.

func (*MetricUpdate) AddCounters

func (mu *MetricUpdate) AddCounters(c ...*Counter) *MetricUpdate

AddCounters adds the counters edges to Counter.

func (*MetricUpdate) AddGaugeIDs

func (mu *MetricUpdate) AddGaugeIDs(ids ...int) *MetricUpdate

AddGaugeIDs adds the gauges edge to Gauge by ids.

func (*MetricUpdate) AddGauges

func (mu *MetricUpdate) AddGauges(g ...*Gauge) *MetricUpdate

AddGauges adds the gauges edges to Gauge.

func (*MetricUpdate) AddHistogramIDs

func (mu *MetricUpdate) AddHistogramIDs(ids ...int) *MetricUpdate

AddHistogramIDs adds the histograms edge to Histogram by ids.

func (*MetricUpdate) AddHistograms

func (mu *MetricUpdate) AddHistograms(h ...*Histogram) *MetricUpdate

AddHistograms adds the histograms edges to Histogram.

func (*MetricUpdate) ClearCounters

func (mu *MetricUpdate) ClearCounters() *MetricUpdate

ClearCounters clears all "counters" edges to type Counter.

func (*MetricUpdate) ClearGauges

func (mu *MetricUpdate) ClearGauges() *MetricUpdate

ClearGauges clears all "gauges" edges to type Gauge.

func (*MetricUpdate) ClearGraph

func (mu *MetricUpdate) ClearGraph() *MetricUpdate

ClearGraph clears the "graph" edge to type Graph.

func (*MetricUpdate) ClearHistograms

func (mu *MetricUpdate) ClearHistograms() *MetricUpdate

ClearHistograms clears all "histograms" edges to type Histogram.

func (*MetricUpdate) Exec

func (mu *MetricUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*MetricUpdate) ExecX

func (mu *MetricUpdate) ExecX(ctx context.Context)

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

func (*MetricUpdate) Mutation

func (mu *MetricUpdate) Mutation() *MetricMutation

Mutation returns the MetricMutation object of the builder.

func (*MetricUpdate) RemoveCounterIDs

func (mu *MetricUpdate) RemoveCounterIDs(ids ...int) *MetricUpdate

RemoveCounterIDs removes the counters edge to Counter by ids.

func (*MetricUpdate) RemoveCounters

func (mu *MetricUpdate) RemoveCounters(c ...*Counter) *MetricUpdate

RemoveCounters removes counters edges to Counter.

func (*MetricUpdate) RemoveGaugeIDs

func (mu *MetricUpdate) RemoveGaugeIDs(ids ...int) *MetricUpdate

RemoveGaugeIDs removes the gauges edge to Gauge by ids.

func (*MetricUpdate) RemoveGauges

func (mu *MetricUpdate) RemoveGauges(g ...*Gauge) *MetricUpdate

RemoveGauges removes gauges edges to Gauge.

func (*MetricUpdate) RemoveHistogramIDs

func (mu *MetricUpdate) RemoveHistogramIDs(ids ...int) *MetricUpdate

RemoveHistogramIDs removes the histograms edge to Histogram by ids.

func (*MetricUpdate) RemoveHistograms

func (mu *MetricUpdate) RemoveHistograms(h ...*Histogram) *MetricUpdate

RemoveHistograms removes histograms edges to Histogram.

func (*MetricUpdate) Save

func (mu *MetricUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of rows/vertices matched by this operation.

func (*MetricUpdate) SaveX

func (mu *MetricUpdate) SaveX(ctx context.Context) int

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

func (*MetricUpdate) SetGraph

func (mu *MetricUpdate) SetGraph(g *Graph) *MetricUpdate

SetGraph sets the graph edge to Graph.

func (*MetricUpdate) SetGraphID

func (mu *MetricUpdate) SetGraphID(id int) *MetricUpdate

SetGraphID sets the graph edge to Graph by id.

func (*MetricUpdate) SetNillableGraphID

func (mu *MetricUpdate) SetNillableGraphID(id *int) *MetricUpdate

SetNillableGraphID sets the graph edge to Graph by id if the given value is not nil.

func (*MetricUpdate) SetType

func (mu *MetricUpdate) SetType(s string) *MetricUpdate

SetType sets the type field.

func (*MetricUpdate) Where

func (mu *MetricUpdate) Where(ps ...predicate.Metric) *MetricUpdate

Where adds a new predicate for the builder.

type MetricUpdateOne

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

MetricUpdateOne is the builder for updating a single Metric entity.

func (*MetricUpdateOne) AddCounterIDs

func (muo *MetricUpdateOne) AddCounterIDs(ids ...int) *MetricUpdateOne

AddCounterIDs adds the counters edge to Counter by ids.

func (*MetricUpdateOne) AddCounters

func (muo *MetricUpdateOne) AddCounters(c ...*Counter) *MetricUpdateOne

AddCounters adds the counters edges to Counter.

func (*MetricUpdateOne) AddGaugeIDs

func (muo *MetricUpdateOne) AddGaugeIDs(ids ...int) *MetricUpdateOne

AddGaugeIDs adds the gauges edge to Gauge by ids.

func (*MetricUpdateOne) AddGauges

func (muo *MetricUpdateOne) AddGauges(g ...*Gauge) *MetricUpdateOne

AddGauges adds the gauges edges to Gauge.

func (*MetricUpdateOne) AddHistogramIDs

func (muo *MetricUpdateOne) AddHistogramIDs(ids ...int) *MetricUpdateOne

AddHistogramIDs adds the histograms edge to Histogram by ids.

func (*MetricUpdateOne) AddHistograms

func (muo *MetricUpdateOne) AddHistograms(h ...*Histogram) *MetricUpdateOne

AddHistograms adds the histograms edges to Histogram.

func (*MetricUpdateOne) ClearCounters

func (muo *MetricUpdateOne) ClearCounters() *MetricUpdateOne

ClearCounters clears all "counters" edges to type Counter.

func (*MetricUpdateOne) ClearGauges

func (muo *MetricUpdateOne) ClearGauges() *MetricUpdateOne

ClearGauges clears all "gauges" edges to type Gauge.

func (*MetricUpdateOne) ClearGraph

func (muo *MetricUpdateOne) ClearGraph() *MetricUpdateOne

ClearGraph clears the "graph" edge to type Graph.

func (*MetricUpdateOne) ClearHistograms

func (muo *MetricUpdateOne) ClearHistograms() *MetricUpdateOne

ClearHistograms clears all "histograms" edges to type Histogram.

func (*MetricUpdateOne) Exec

func (muo *MetricUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*MetricUpdateOne) ExecX

func (muo *MetricUpdateOne) ExecX(ctx context.Context)

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

func (*MetricUpdateOne) Mutation

func (muo *MetricUpdateOne) Mutation() *MetricMutation

Mutation returns the MetricMutation object of the builder.

func (*MetricUpdateOne) RemoveCounterIDs

func (muo *MetricUpdateOne) RemoveCounterIDs(ids ...int) *MetricUpdateOne

RemoveCounterIDs removes the counters edge to Counter by ids.

func (*MetricUpdateOne) RemoveCounters

func (muo *MetricUpdateOne) RemoveCounters(c ...*Counter) *MetricUpdateOne

RemoveCounters removes counters edges to Counter.

func (*MetricUpdateOne) RemoveGaugeIDs

func (muo *MetricUpdateOne) RemoveGaugeIDs(ids ...int) *MetricUpdateOne

RemoveGaugeIDs removes the gauges edge to Gauge by ids.

func (*MetricUpdateOne) RemoveGauges

func (muo *MetricUpdateOne) RemoveGauges(g ...*Gauge) *MetricUpdateOne

RemoveGauges removes gauges edges to Gauge.

func (*MetricUpdateOne) RemoveHistogramIDs

func (muo *MetricUpdateOne) RemoveHistogramIDs(ids ...int) *MetricUpdateOne

RemoveHistogramIDs removes the histograms edge to Histogram by ids.

func (*MetricUpdateOne) RemoveHistograms

func (muo *MetricUpdateOne) RemoveHistograms(h ...*Histogram) *MetricUpdateOne

RemoveHistograms removes histograms edges to Histogram.

func (*MetricUpdateOne) Save

func (muo *MetricUpdateOne) Save(ctx context.Context) (*Metric, error)

Save executes the query and returns the updated entity.

func (*MetricUpdateOne) SaveX

func (muo *MetricUpdateOne) SaveX(ctx context.Context) *Metric

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

func (*MetricUpdateOne) SetGraph

func (muo *MetricUpdateOne) SetGraph(g *Graph) *MetricUpdateOne

SetGraph sets the graph edge to Graph.

func (*MetricUpdateOne) SetGraphID

func (muo *MetricUpdateOne) SetGraphID(id int) *MetricUpdateOne

SetGraphID sets the graph edge to Graph by id.

func (*MetricUpdateOne) SetNillableGraphID

func (muo *MetricUpdateOne) SetNillableGraphID(id *int) *MetricUpdateOne

SetNillableGraphID sets the graph edge to Graph by id if the given value is not nil.

func (*MetricUpdateOne) SetType

func (muo *MetricUpdateOne) SetType(s string) *MetricUpdateOne

SetType sets the type field.

type Metrics

type Metrics []*Metric

Metrics is a parsable slice of Metric.

type MutateFunc

type MutateFunc = ent.MutateFunc

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

type Mutation

type Mutation = ent.Mutation

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

type Mutator

type Mutator = ent.Mutator

ent aliases to avoid import conflict 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 conflict 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 conflict in user's code.

type Query

type Query = ent.Query

ent aliases to avoid import conflict 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 Tag

type Tag struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// Name holds the value of the "name" field.
	Name string `json:"name,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the TagQuery when eager-loading is set.
	Edges TagEdges `json:"edges"`
	// contains filtered or unexported fields
}

Tag is the model entity for the Tag schema.

func (*Tag) QueryApplication

func (t *Tag) QueryApplication() *ApplicationQuery

QueryApplication queries the application edge of the Tag.

func (*Tag) String

func (t *Tag) String() string

String implements the fmt.Stringer.

func (*Tag) Unwrap

func (t *Tag) Unwrap() *Tag

Unwrap unwraps the entity that was returned from a transaction after it was closed, so that all next queries will be executed through the driver which created the transaction.

func (*Tag) Update

func (t *Tag) Update() *TagUpdateOne

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

type TagClient

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

TagClient is a client for the Tag schema.

func NewTagClient

func NewTagClient(c config) *TagClient

NewTagClient returns a client for the Tag from the given config.

func (*TagClient) Create

func (c *TagClient) Create() *TagCreate

Create returns a create builder for Tag.

func (*TagClient) CreateBulk

func (c *TagClient) CreateBulk(builders ...*TagCreate) *TagCreateBulk

BulkCreate returns a builder for creating a bulk of Tag entities.

func (*TagClient) Delete

func (c *TagClient) Delete() *TagDelete

Delete returns a delete builder for Tag.

func (*TagClient) DeleteOne

func (c *TagClient) DeleteOne(t *Tag) *TagDeleteOne

DeleteOne returns a delete builder for the given entity.

func (*TagClient) DeleteOneID

func (c *TagClient) DeleteOneID(id int) *TagDeleteOne

DeleteOneID returns a delete builder for the given id.

func (*TagClient) Get

func (c *TagClient) Get(ctx context.Context, id int) (*Tag, error)

Get returns a Tag entity by its id.

func (*TagClient) GetX

func (c *TagClient) GetX(ctx context.Context, id int) *Tag

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

func (*TagClient) Hooks

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

Hooks returns the client hooks.

func (*TagClient) Query

func (c *TagClient) Query() *TagQuery

Query returns a query builder for Tag.

func (*TagClient) QueryApplication

func (c *TagClient) QueryApplication(t *Tag) *ApplicationQuery

QueryApplication queries the application edge of a Tag.

func (*TagClient) Update

func (c *TagClient) Update() *TagUpdate

Update returns an update builder for Tag.

func (*TagClient) UpdateOne

func (c *TagClient) UpdateOne(t *Tag) *TagUpdateOne

UpdateOne returns an update builder for the given entity.

func (*TagClient) UpdateOneID

func (c *TagClient) UpdateOneID(id int) *TagUpdateOne

UpdateOneID returns an update builder for the given id.

func (*TagClient) Use

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

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

type TagCreate

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

TagCreate is the builder for creating a Tag entity.

func (*TagCreate) Mutation

func (tc *TagCreate) Mutation() *TagMutation

Mutation returns the TagMutation object of the builder.

func (*TagCreate) Save

func (tc *TagCreate) Save(ctx context.Context) (*Tag, error)

Save creates the Tag in the database.

func (*TagCreate) SaveX

func (tc *TagCreate) SaveX(ctx context.Context) *Tag

SaveX calls Save and panics if Save returns an error.

func (*TagCreate) SetApplication

func (tc *TagCreate) SetApplication(a *Application) *TagCreate

SetApplication sets the application edge to Application.

func (*TagCreate) SetApplicationID

func (tc *TagCreate) SetApplicationID(id int) *TagCreate

SetApplicationID sets the application edge to Application by id.

func (*TagCreate) SetName

func (tc *TagCreate) SetName(s string) *TagCreate

SetName sets the name field.

func (*TagCreate) SetNillableApplicationID

func (tc *TagCreate) SetNillableApplicationID(id *int) *TagCreate

SetNillableApplicationID sets the application edge to Application by id if the given value is not nil.

type TagCreateBulk

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

TagCreateBulk is the builder for creating a bulk of Tag entities.

func (*TagCreateBulk) Save

func (tcb *TagCreateBulk) Save(ctx context.Context) ([]*Tag, error)

Save creates the Tag entities in the database.

func (*TagCreateBulk) SaveX

func (tcb *TagCreateBulk) SaveX(ctx context.Context) []*Tag

SaveX calls Save and panics if Save returns an error.

type TagDelete

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

TagDelete is the builder for deleting a Tag entity.

func (*TagDelete) Exec

func (td *TagDelete) Exec(ctx context.Context) (int, error)

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

func (*TagDelete) ExecX

func (td *TagDelete) ExecX(ctx context.Context) int

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

func (*TagDelete) Where

func (td *TagDelete) Where(ps ...predicate.Tag) *TagDelete

Where adds a new predicate to the delete builder.

type TagDeleteOne

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

TagDeleteOne is the builder for deleting a single Tag entity.

func (*TagDeleteOne) Exec

func (tdo *TagDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*TagDeleteOne) ExecX

func (tdo *TagDeleteOne) ExecX(ctx context.Context)

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

type TagEdges

type TagEdges struct {
	// Application holds the value of the application edge.
	Application *Application
	// contains filtered or unexported fields
}

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

func (TagEdges) ApplicationOrErr

func (e TagEdges) ApplicationOrErr() (*Application, error)

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

type TagGroupBy

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

TagGroupBy is the builder for group-by Tag entities.

func (*TagGroupBy) Aggregate

func (tgb *TagGroupBy) Aggregate(fns ...AggregateFunc) *TagGroupBy

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

func (*TagGroupBy) Bool

func (tgb *TagGroupBy) Bool(ctx context.Context) (_ bool, err error)

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

func (*TagGroupBy) BoolX

func (tgb *TagGroupBy) BoolX(ctx context.Context) bool

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

func (*TagGroupBy) Bools

func (tgb *TagGroupBy) Bools(ctx context.Context) ([]bool, error)

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

func (*TagGroupBy) BoolsX

func (tgb *TagGroupBy) BoolsX(ctx context.Context) []bool

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

func (*TagGroupBy) Float64

func (tgb *TagGroupBy) Float64(ctx context.Context) (_ float64, err error)

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

func (*TagGroupBy) Float64X

func (tgb *TagGroupBy) Float64X(ctx context.Context) float64

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

func (*TagGroupBy) Float64s

func (tgb *TagGroupBy) Float64s(ctx context.Context) ([]float64, error)

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

func (*TagGroupBy) Float64sX

func (tgb *TagGroupBy) Float64sX(ctx context.Context) []float64

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

func (*TagGroupBy) Int

func (tgb *TagGroupBy) Int(ctx context.Context) (_ int, err error)

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

func (*TagGroupBy) IntX

func (tgb *TagGroupBy) IntX(ctx context.Context) int

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

func (*TagGroupBy) Ints

func (tgb *TagGroupBy) Ints(ctx context.Context) ([]int, error)

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

func (*TagGroupBy) IntsX

func (tgb *TagGroupBy) IntsX(ctx context.Context) []int

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

func (*TagGroupBy) Scan

func (tgb *TagGroupBy) Scan(ctx context.Context, v interface{}) error

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

func (*TagGroupBy) ScanX

func (tgb *TagGroupBy) ScanX(ctx context.Context, v interface{})

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

func (*TagGroupBy) String

func (tgb *TagGroupBy) String(ctx context.Context) (_ string, err error)

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

func (*TagGroupBy) StringX

func (tgb *TagGroupBy) StringX(ctx context.Context) string

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

func (*TagGroupBy) Strings

func (tgb *TagGroupBy) Strings(ctx context.Context) ([]string, error)

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

func (*TagGroupBy) StringsX

func (tgb *TagGroupBy) StringsX(ctx context.Context) []string

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

type TagMutation

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

TagMutation represents an operation that mutate the Tags nodes in the graph.

func (*TagMutation) AddField

func (m *TagMutation) AddField(name string, value ent.Value) error

AddField adds the value for the given name. It returns an error if the field is not defined in the schema, or if the type mismatch the field type.

func (*TagMutation) AddedEdges

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

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

func (*TagMutation) AddedField

func (m *TagMutation) AddedField(name string) (ent.Value, bool)

AddedField returns the numeric value that was in/decremented from a field with the given name. The second value indicates that this field was not set, or was not define in the schema.

func (*TagMutation) AddedFields

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

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

func (*TagMutation) AddedIDs

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

AddedIDs returns all ids (to other nodes) that were added for the given edge name.

func (*TagMutation) ApplicationCleared

func (m *TagMutation) ApplicationCleared() bool

ApplicationCleared returns if the edge application was cleared.

func (*TagMutation) ApplicationID

func (m *TagMutation) ApplicationID() (id int, exists bool)

ApplicationID returns the application id in the mutation.

func (*TagMutation) ApplicationIDs

func (m *TagMutation) ApplicationIDs() (ids []int)

ApplicationIDs returns the application ids in the mutation. Note that ids always returns len(ids) <= 1 for unique edges, and you should use ApplicationID instead. It exists only for internal usage by the builders.

func (*TagMutation) ClearApplication

func (m *TagMutation) ClearApplication()

ClearApplication clears the application edge to Application.

func (*TagMutation) ClearEdge

func (m *TagMutation) ClearEdge(name string) error

ClearEdge clears the value for the given name. It returns an error if the edge name is not defined in the schema.

func (*TagMutation) ClearField

func (m *TagMutation) ClearField(name string) error

ClearField clears the value for the given name. It returns an error if the field is not defined in the schema.

func (*TagMutation) ClearedEdges

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

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

func (*TagMutation) ClearedFields

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

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

func (TagMutation) Client

func (m TagMutation) 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 (*TagMutation) EdgeCleared

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

EdgeCleared returns a boolean indicates if this edge was cleared in this mutation.

func (*TagMutation) Field

func (m *TagMutation) Field(name string) (ent.Value, bool)

Field returns the value of a field with the given name. The second boolean value indicates that this field was not set, or was not define in the schema.

func (*TagMutation) FieldCleared

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

FieldCleared returns a boolean indicates if this field was cleared in this mutation.

func (*TagMutation) Fields

func (m *TagMutation) Fields() []string

Fields returns all fields that were changed during this mutation. Note that, in order to get all numeric fields that were in/decremented, call AddedFields().

func (*TagMutation) ID

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

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

func (*TagMutation) Name

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

Name returns the name value in the mutation.

func (*TagMutation) OldField

func (m *TagMutation) 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 was failed.

func (*TagMutation) OldName

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

OldName returns the old name value of the Tag. If the Tag 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 database query fails.

func (*TagMutation) Op

func (m *TagMutation) Op() Op

Op returns the operation name.

func (*TagMutation) RemovedEdges

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

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

func (*TagMutation) RemovedIDs

func (m *TagMutation) RemovedIDs(name string) []ent.Value

RemovedIDs returns all ids (to other nodes) that were removed for the given edge name.

func (*TagMutation) ResetApplication

func (m *TagMutation) ResetApplication()

ResetApplication reset all changes of the "application" edge.

func (*TagMutation) ResetEdge

func (m *TagMutation) ResetEdge(name string) error

ResetEdge resets all changes in the mutation regarding the given edge name. It returns an error if the edge is not defined in the schema.

func (*TagMutation) ResetField

func (m *TagMutation) ResetField(name string) error

ResetField resets all changes in the mutation regarding the given field name. It returns an error if the field is not defined in the schema.

func (*TagMutation) ResetName

func (m *TagMutation) ResetName()

ResetName reset all changes of the "name" field.

func (*TagMutation) SetApplicationID

func (m *TagMutation) SetApplicationID(id int)

SetApplicationID sets the application edge to Application by id.

func (*TagMutation) SetField

func (m *TagMutation) SetField(name string, value ent.Value) error

SetField sets the value for the given name. It returns an error if the field is not defined in the schema, or if the type mismatch the field type.

func (*TagMutation) SetName

func (m *TagMutation) SetName(s string)

SetName sets the name field.

func (TagMutation) Tx

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

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

func (*TagMutation) Type

func (m *TagMutation) Type() string

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

type TagQuery

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

TagQuery is the builder for querying Tag entities.

func (*TagQuery) All

func (tq *TagQuery) All(ctx context.Context) ([]*Tag, error)

All executes the query and returns a list of Tags.

func (*TagQuery) AllX

func (tq *TagQuery) AllX(ctx context.Context) []*Tag

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

func (*TagQuery) Clone

func (tq *TagQuery) Clone() *TagQuery

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

func (*TagQuery) Count

func (tq *TagQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*TagQuery) CountX

func (tq *TagQuery) CountX(ctx context.Context) int

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

func (*TagQuery) Exist

func (tq *TagQuery) Exist(ctx context.Context) (bool, error)

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

func (*TagQuery) ExistX

func (tq *TagQuery) ExistX(ctx context.Context) bool

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

func (*TagQuery) First

func (tq *TagQuery) First(ctx context.Context) (*Tag, error)

First returns the first Tag entity in the query. Returns *NotFoundError when no tag was found.

func (*TagQuery) FirstID

func (tq *TagQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first Tag id in the query. Returns *NotFoundError when no id was found.

func (*TagQuery) FirstX

func (tq *TagQuery) FirstX(ctx context.Context) *Tag

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

func (*TagQuery) FirstXID

func (tq *TagQuery) FirstXID(ctx context.Context) int

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

func (*TagQuery) GroupBy

func (tq *TagQuery) GroupBy(field string, fields ...string) *TagGroupBy

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

client.Tag.Query().
	GroupBy(tag.FieldName).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*TagQuery) IDs

func (tq *TagQuery) IDs(ctx context.Context) ([]int, error)

IDs executes the query and returns a list of Tag ids.

func (*TagQuery) IDsX

func (tq *TagQuery) IDsX(ctx context.Context) []int

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

func (*TagQuery) Limit

func (tq *TagQuery) Limit(limit int) *TagQuery

Limit adds a limit step to the query.

func (*TagQuery) Offset

func (tq *TagQuery) Offset(offset int) *TagQuery

Offset adds an offset step to the query.

func (*TagQuery) Only

func (tq *TagQuery) Only(ctx context.Context) (*Tag, error)

Only returns the only Tag entity in the query, returns an error if not exactly one entity was returned.

func (*TagQuery) OnlyID

func (tq *TagQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID returns the only Tag id in the query, returns an error if not exactly one id was returned.

func (*TagQuery) OnlyIDX

func (tq *TagQuery) OnlyIDX(ctx context.Context) int

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

func (*TagQuery) OnlyX

func (tq *TagQuery) OnlyX(ctx context.Context) *Tag

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

func (*TagQuery) Order

func (tq *TagQuery) Order(o ...OrderFunc) *TagQuery

Order adds an order step to the query.

func (*TagQuery) QueryApplication

func (tq *TagQuery) QueryApplication() *ApplicationQuery

QueryApplication chains the current query on the application edge.

func (*TagQuery) Select

func (tq *TagQuery) Select(field string, fields ...string) *TagSelect

Select one or more fields from the given query.

Example:

var v []struct {
	Name string `json:"name,omitempty"`
}

client.Tag.Query().
	Select(tag.FieldName).
	Scan(ctx, &v)

func (*TagQuery) Where

func (tq *TagQuery) Where(ps ...predicate.Tag) *TagQuery

Where adds a new predicate for the builder.

func (*TagQuery) WithApplication

func (tq *TagQuery) WithApplication(opts ...func(*ApplicationQuery)) *TagQuery
WithApplication tells the query-builder to eager-loads the nodes that are connected to

the "application" edge. The optional arguments used to configure the query builder of the edge.

type TagSelect

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

TagSelect is the builder for select fields of Tag entities.

func (*TagSelect) Bool

func (ts *TagSelect) Bool(ctx context.Context) (_ bool, err error)

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

func (*TagSelect) BoolX

func (ts *TagSelect) BoolX(ctx context.Context) bool

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

func (*TagSelect) Bools

func (ts *TagSelect) Bools(ctx context.Context) ([]bool, error)

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

func (*TagSelect) BoolsX

func (ts *TagSelect) BoolsX(ctx context.Context) []bool

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

func (*TagSelect) Float64

func (ts *TagSelect) Float64(ctx context.Context) (_ float64, err error)

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

func (*TagSelect) Float64X

func (ts *TagSelect) Float64X(ctx context.Context) float64

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

func (*TagSelect) Float64s

func (ts *TagSelect) Float64s(ctx context.Context) ([]float64, error)

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

func (*TagSelect) Float64sX

func (ts *TagSelect) Float64sX(ctx context.Context) []float64

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

func (*TagSelect) Int

func (ts *TagSelect) Int(ctx context.Context) (_ int, err error)

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

func (*TagSelect) IntX

func (ts *TagSelect) IntX(ctx context.Context) int

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

func (*TagSelect) Ints

func (ts *TagSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from selector. It is only allowed when selecting one field.

func (*TagSelect) IntsX

func (ts *TagSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*TagSelect) Scan

func (ts *TagSelect) Scan(ctx context.Context, v interface{}) error

Scan applies the selector query and scan the result into the given value.

func (*TagSelect) ScanX

func (ts *TagSelect) ScanX(ctx context.Context, v interface{})

ScanX is like Scan, but panics if an error occurs.

func (*TagSelect) String

func (ts *TagSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from selector. It is only allowed when selecting one field.

func (*TagSelect) StringX

func (ts *TagSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*TagSelect) Strings

func (ts *TagSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from selector. It is only allowed when selecting one field.

func (*TagSelect) StringsX

func (ts *TagSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type TagUpdate

type TagUpdate struct {
	// contains filtered or unexported fields
}

TagUpdate is the builder for updating Tag entities.

func (*TagUpdate) ClearApplication

func (tu *TagUpdate) ClearApplication() *TagUpdate

ClearApplication clears the "application" edge to type Application.

func (*TagUpdate) Exec

func (tu *TagUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*TagUpdate) ExecX

func (tu *TagUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TagUpdate) Mutation

func (tu *TagUpdate) Mutation() *TagMutation

Mutation returns the TagMutation object of the builder.

func (*TagUpdate) Save

func (tu *TagUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of rows/vertices matched by this operation.

func (*TagUpdate) SaveX

func (tu *TagUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*TagUpdate) SetApplication

func (tu *TagUpdate) SetApplication(a *Application) *TagUpdate

SetApplication sets the application edge to Application.

func (*TagUpdate) SetApplicationID

func (tu *TagUpdate) SetApplicationID(id int) *TagUpdate

SetApplicationID sets the application edge to Application by id.

func (*TagUpdate) SetName

func (tu *TagUpdate) SetName(s string) *TagUpdate

SetName sets the name field.

func (*TagUpdate) SetNillableApplicationID

func (tu *TagUpdate) SetNillableApplicationID(id *int) *TagUpdate

SetNillableApplicationID sets the application edge to Application by id if the given value is not nil.

func (*TagUpdate) Where

func (tu *TagUpdate) Where(ps ...predicate.Tag) *TagUpdate

Where adds a new predicate for the builder.

type TagUpdateOne

type TagUpdateOne struct {
	// contains filtered or unexported fields
}

TagUpdateOne is the builder for updating a single Tag entity.

func (*TagUpdateOne) ClearApplication

func (tuo *TagUpdateOne) ClearApplication() *TagUpdateOne

ClearApplication clears the "application" edge to type Application.

func (*TagUpdateOne) Exec

func (tuo *TagUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*TagUpdateOne) ExecX

func (tuo *TagUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TagUpdateOne) Mutation

func (tuo *TagUpdateOne) Mutation() *TagMutation

Mutation returns the TagMutation object of the builder.

func (*TagUpdateOne) Save

func (tuo *TagUpdateOne) Save(ctx context.Context) (*Tag, error)

Save executes the query and returns the updated entity.

func (*TagUpdateOne) SaveX

func (tuo *TagUpdateOne) SaveX(ctx context.Context) *Tag

SaveX is like Save, but panics if an error occurs.

func (*TagUpdateOne) SetApplication

func (tuo *TagUpdateOne) SetApplication(a *Application) *TagUpdateOne

SetApplication sets the application edge to Application.

func (*TagUpdateOne) SetApplicationID

func (tuo *TagUpdateOne) SetApplicationID(id int) *TagUpdateOne

SetApplicationID sets the application edge to Application by id.

func (*TagUpdateOne) SetName

func (tuo *TagUpdateOne) SetName(s string) *TagUpdateOne

SetName sets the name field.

func (*TagUpdateOne) SetNillableApplicationID

func (tuo *TagUpdateOne) SetNillableApplicationID(id *int) *TagUpdateOne

SetNillableApplicationID sets the application edge to Application by id if the given value is not nil.

type Tags

type Tags []*Tag

Tags is a parsable slice of Tag.

type Tx

type Tx struct {

	// Application is the client for interacting with the Application builders.
	Application *ApplicationClient
	// Counter is the client for interacting with the Counter builders.
	Counter *CounterClient
	// Gauge is the client for interacting with the Gauge builders.
	Gauge *GaugeClient
	// Graph is the client for interacting with the Graph builders.
	Graph *GraphClient
	// Group is the client for interacting with the Group builders.
	Group *GroupClient
	// Histogram is the client for interacting with the Histogram builders.
	Histogram *HistogramClient
	// Metric is the client for interacting with the Metric builders.
	Metric *MetricClient
	// Tag is the client for interacting with the Tag builders.
	Tag *TagClient
	// 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 the Tx stored in 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 conflict 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