model

package
v0.0.0-...-bf2c6c7 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2022 License: GPL-3.0 Imports: 29 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.
	TypeAssets     = "Assets"
	TypeDataSet    = "DataSet"
	TypeMenu       = "Menu"
	TypeShare      = "Share"
	TypeTypeConfig = "TypeConfig"
	TypeUser       = "User"
	TypeView       = "View"
	TypeViewBlock  = "ViewBlock"
)

Variables

This section is empty.

Functions

func IsConstraintError

func IsConstraintError(err error) bool

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

func IsNotFound

func IsNotFound(err error) bool

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

func IsNotLoaded

func IsNotLoaded(err error) bool

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

func IsNotSingular

func IsNotSingular(err error) bool

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

func IsValidationError

func IsValidationError(err error) bool

IsValidationError returns a boolean indicating whether the error is a validaton error.

func MaskNotFound

func MaskNotFound(err error) error

MaskNotFound masks not found error.

func NewContext

func NewContext(parent context.Context, c *Client) context.Context

NewContext returns a new context with the given Client attached.

func NewTxContext

func NewTxContext(parent context.Context, tx *Tx) context.Context

NewTxContext returns a new context with the given Tx attached.

Types

type ActionFields

type ActionFields struct {
	Has    bool
	Fields map[string]bool
}

func (*ActionFields) SetFields

func (af *ActionFields) SetFields(fields []string)

type AggregateFunc

type AggregateFunc func(*sql.Selector) string

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

func As

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

GroupBy(field1, field2).
Aggregate(model.As(model.Sum(field1), "sum_field1"), (model.As(model.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 Api

type Api struct {
	Fields struct {
		Create ActionFields
		Update ActionFields
	}
	Client *Client
}

type ApiOption

type ApiOption struct {
	Fields map[string][]string
}

type Assets

type Assets struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// Path holds the value of the "path" field.
	Path string `json:"path,omitempty"`
	// Ext holds the value of the "ext" field.
	Ext string `json:"ext,omitempty"`
	// Type holds the value of the "type" field.
	Type string `json:"type,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the AssetsQuery when eager-loading is set.
	Edges AssetsEdges `json:"edges"`
	// contains filtered or unexported fields
}

Assets is the model entity for the Assets schema.

func (*Assets) QueryView

func (a *Assets) QueryView() *ViewQuery

QueryView queries the "view" edge of the Assets entity.

func (*Assets) String

func (a *Assets) String() string

String implements the fmt.Stringer.

func (*Assets) Unwrap

func (a *Assets) Unwrap() *Assets

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

func (*Assets) Update

func (a *Assets) Update() *AssetsUpdateOne

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

type AssetsApi

type AssetsApi struct {
	*Api
	Filter             AssetsApiFilter
	SkipCreateAutoEdge bool
	SkipUpdateAutoEdge bool
}

func NewAssetsApi

func NewAssetsApi(client *Client, opt *ApiOption) *AssetsApi

func (*AssetsApi) Create

func (c *AssetsApi) Create(help *contact.GinHelp)

func (*AssetsApi) Delete

func (c *AssetsApi) Delete(help *contact.GinHelp)

func (*AssetsApi) Get

func (c *AssetsApi) Get(help *contact.GinHelp)

func (*AssetsApi) List

func (c *AssetsApi) List(help *contact.GinHelp)

func (*AssetsApi) Update

func (c *AssetsApi) Update(help *contact.GinHelp)

type AssetsApiFilter

type AssetsApiFilter struct {
	CreatePipe   func(help *contact.GinHelp, createPipe *AssetsCreate, edges AssetsEdges)
	CreateAfter  func(help *contact.GinHelp, item *Assets, edges AssetsEdges)
	UpdatePipe   func(help *contact.GinHelp, old *Assets, updatePipe *AssetsUpdateOne, edges AssetsEdges)
	UpdateAfter  func(help *contact.GinHelp, old *Assets, item *Assets, edges AssetsEdges)
	ListPipe     func(help *contact.GinHelp, listPipe *AssetsQuery)
	ListData     func(help *contact.GinHelp, items []*Assets) interface{}
	DeleteBefore func(help *contact.GinHelp, item *Assets)
	GetPipe      func(help *contact.GinHelp, getPipe *AssetsQuery)
	GetData      func(help *contact.GinHelp, item *Assets) *Assets
}

type AssetsClient

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

AssetsClient is a client for the Assets schema.

func NewAssetsClient

func NewAssetsClient(c config) *AssetsClient

NewAssetsClient returns a client for the Assets from the given config.

func (*AssetsClient) Create

func (c *AssetsClient) Create() *AssetsCreate

Create returns a create builder for Assets.

func (*AssetsClient) CreateBulk

func (c *AssetsClient) CreateBulk(builders ...*AssetsCreate) *AssetsCreateBulk

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

func (*AssetsClient) Delete

func (c *AssetsClient) Delete() *AssetsDelete

Delete returns a delete builder for Assets.

func (*AssetsClient) DeleteOne

func (c *AssetsClient) DeleteOne(a *Assets) *AssetsDeleteOne

DeleteOne returns a delete builder for the given entity.

func (*AssetsClient) DeleteOneID

func (c *AssetsClient) DeleteOneID(id int) *AssetsDeleteOne

DeleteOneID returns a delete builder for the given id.

func (*AssetsClient) Get

func (c *AssetsClient) Get(ctx context.Context, id int) (*Assets, error)

Get returns a Assets entity by its id.

func (*AssetsClient) GetX

func (c *AssetsClient) GetX(ctx context.Context, id int) *Assets

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

func (*AssetsClient) Hooks

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

Hooks returns the client hooks.

func (*AssetsClient) Query

func (c *AssetsClient) Query() *AssetsQuery

Query returns a query builder for Assets.

func (*AssetsClient) QueryView

func (c *AssetsClient) QueryView(a *Assets) *ViewQuery

QueryView queries the view edge of a Assets.

func (*AssetsClient) Update

func (c *AssetsClient) Update() *AssetsUpdate

Update returns an update builder for Assets.

func (*AssetsClient) UpdateOne

func (c *AssetsClient) UpdateOne(a *Assets) *AssetsUpdateOne

UpdateOne returns an update builder for the given entity.

func (*AssetsClient) UpdateOneID

func (c *AssetsClient) UpdateOneID(id int) *AssetsUpdateOne

UpdateOneID returns an update builder for the given id.

func (*AssetsClient) Use

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

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

type AssetsCreate

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

AssetsCreate is the builder for creating a Assets entity.

func (*AssetsCreate) AddView

func (ac *AssetsCreate) AddView(v ...*View) *AssetsCreate

AddView adds the "view" edges to the View entity.

func (*AssetsCreate) AddViewIDs

func (ac *AssetsCreate) AddViewIDs(ids ...int) *AssetsCreate

AddViewIDs adds the "view" edge to the View entity by IDs.

func (*AssetsCreate) Mutation

func (ac *AssetsCreate) Mutation() *AssetsMutation

Mutation returns the AssetsMutation object of the builder.

func (*AssetsCreate) Save

func (ac *AssetsCreate) Save(ctx context.Context) (*Assets, error)

Save creates the Assets in the database.

func (*AssetsCreate) SaveX

func (ac *AssetsCreate) SaveX(ctx context.Context) *Assets

SaveX calls Save and panics if Save returns an error.

func (*AssetsCreate) SetExt

func (ac *AssetsCreate) SetExt(s string) *AssetsCreate

SetExt sets the "ext" field.

func (*AssetsCreate) SetPath

func (ac *AssetsCreate) SetPath(s string) *AssetsCreate

SetPath sets the "path" field.

func (*AssetsCreate) SetType

func (ac *AssetsCreate) SetType(s string) *AssetsCreate

SetType sets the "type" field.

type AssetsCreateBulk

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

AssetsCreateBulk is the builder for creating many Assets entities in bulk.

func (*AssetsCreateBulk) Save

func (acb *AssetsCreateBulk) Save(ctx context.Context) ([]*Assets, error)

Save creates the Assets entities in the database.

func (*AssetsCreateBulk) SaveX

func (acb *AssetsCreateBulk) SaveX(ctx context.Context) []*Assets

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

type AssetsDelete

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

AssetsDelete is the builder for deleting a Assets entity.

func (*AssetsDelete) Exec

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

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

func (*AssetsDelete) ExecX

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

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

func (*AssetsDelete) Where

func (ad *AssetsDelete) Where(ps ...predicate.Assets) *AssetsDelete

Where adds a new predicate to the AssetsDelete builder.

type AssetsDeleteOne

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

AssetsDeleteOne is the builder for deleting a single Assets entity.

func (*AssetsDeleteOne) Exec

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

Exec executes the deletion query.

func (*AssetsDeleteOne) ExecX

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

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

type AssetsEdges

type AssetsEdges struct {
	// View holds the value of the view edge.
	View []*View `json:"view,omitempty"`
	// contains filtered or unexported fields
}

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

func (AssetsEdges) ViewOrErr

func (e AssetsEdges) ViewOrErr() ([]*View, error)

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

type AssetsGroupBy

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

AssetsGroupBy is the group-by builder for Assets entities.

func (*AssetsGroupBy) Aggregate

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

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

func (*AssetsGroupBy) Bool

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

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

func (*AssetsGroupBy) BoolX

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

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

func (*AssetsGroupBy) Bools

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

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

func (*AssetsGroupBy) BoolsX

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

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

func (*AssetsGroupBy) Float64

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

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

func (*AssetsGroupBy) Float64X

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

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

func (*AssetsGroupBy) Float64s

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

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

func (*AssetsGroupBy) Float64sX

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

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

func (*AssetsGroupBy) Int

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

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

func (*AssetsGroupBy) IntX

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

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

func (*AssetsGroupBy) Ints

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

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

func (*AssetsGroupBy) IntsX

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

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

func (*AssetsGroupBy) Scan

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

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

func (*AssetsGroupBy) ScanX

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

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

func (*AssetsGroupBy) String

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

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

func (*AssetsGroupBy) StringX

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

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

func (*AssetsGroupBy) Strings

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

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

func (*AssetsGroupBy) StringsX

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

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

type AssetsMutation

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

AssetsMutation represents an operation that mutates the Assets nodes in the graph.

func (*AssetsMutation) AddField

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

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

func (*AssetsMutation) AddViewIDs

func (m *AssetsMutation) AddViewIDs(ids ...int)

AddViewIDs adds the "view" edge to the View entity by ids.

func (*AssetsMutation) AddedEdges

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

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

func (*AssetsMutation) AddedField

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

AddedField returns the numeric value that was incremented/decremented on a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*AssetsMutation) AddedFields

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

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

func (*AssetsMutation) AddedIDs

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

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

func (*AssetsMutation) ClearEdge

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

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

func (*AssetsMutation) ClearField

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

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

func (*AssetsMutation) ClearView

func (m *AssetsMutation) ClearView()

ClearView clears the "view" edge to the View entity.

func (*AssetsMutation) ClearedEdges

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

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

func (*AssetsMutation) ClearedFields

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

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

func (AssetsMutation) Client

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

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

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

func (*AssetsMutation) Ext

func (m *AssetsMutation) Ext() (r string, exists bool)

Ext returns the value of the "ext" field in the mutation.

func (*AssetsMutation) Field

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

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

func (*AssetsMutation) FieldCleared

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

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

func (*AssetsMutation) Fields

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

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

func (*AssetsMutation) GetType

func (m *AssetsMutation) GetType() (r string, exists bool)

GetType returns the value of the "type" field in the mutation.

func (*AssetsMutation) ID

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

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

func (*AssetsMutation) OldExt

func (m *AssetsMutation) OldExt(ctx context.Context) (v string, err error)

OldExt returns the old "ext" field's value of the Assets entity. If the Assets object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*AssetsMutation) OldField

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

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

func (*AssetsMutation) OldPath

func (m *AssetsMutation) OldPath(ctx context.Context) (v string, err error)

OldPath returns the old "path" field's value of the Assets entity. If the Assets object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*AssetsMutation) OldType

func (m *AssetsMutation) OldType(ctx context.Context) (v string, err error)

OldType returns the old "type" field's value of the Assets entity. If the Assets object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*AssetsMutation) Op

func (m *AssetsMutation) Op() Op

Op returns the operation name.

func (*AssetsMutation) Path

func (m *AssetsMutation) Path() (r string, exists bool)

Path returns the value of the "path" field in the mutation.

func (*AssetsMutation) RemoveViewIDs

func (m *AssetsMutation) RemoveViewIDs(ids ...int)

RemoveViewIDs removes the "view" edge to the View entity by IDs.

func (*AssetsMutation) RemovedEdges

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

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

func (*AssetsMutation) RemovedIDs

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

RemovedIDs returns all IDs (to other nodes) that were removed for the edge with the given name in this mutation.

func (*AssetsMutation) RemovedViewIDs

func (m *AssetsMutation) RemovedViewIDs() (ids []int)

RemovedView returns the removed IDs of the "view" edge to the View entity.

func (*AssetsMutation) ResetEdge

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

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

func (*AssetsMutation) ResetExt

func (m *AssetsMutation) ResetExt()

ResetExt resets all changes to the "ext" field.

func (*AssetsMutation) ResetField

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

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

func (*AssetsMutation) ResetPath

func (m *AssetsMutation) ResetPath()

ResetPath resets all changes to the "path" field.

func (*AssetsMutation) ResetType

func (m *AssetsMutation) ResetType()

ResetType resets all changes to the "type" field.

func (*AssetsMutation) ResetView

func (m *AssetsMutation) ResetView()

ResetView resets all changes to the "view" edge.

func (*AssetsMutation) SetExt

func (m *AssetsMutation) SetExt(s string)

SetExt sets the "ext" field.

func (*AssetsMutation) SetField

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

SetField sets the value of a field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*AssetsMutation) SetPath

func (m *AssetsMutation) SetPath(s string)

SetPath sets the "path" field.

func (*AssetsMutation) SetType

func (m *AssetsMutation) SetType(s string)

SetType sets the "type" field.

func (AssetsMutation) Tx

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

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

func (*AssetsMutation) Type

func (m *AssetsMutation) Type() string

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

func (*AssetsMutation) ViewCleared

func (m *AssetsMutation) ViewCleared() bool

ViewCleared reports if the "view" edge to the View entity was cleared.

func (*AssetsMutation) ViewIDs

func (m *AssetsMutation) ViewIDs() (ids []int)

ViewIDs returns the "view" edge IDs in the mutation.

type AssetsQuery

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

AssetsQuery is the builder for querying Assets entities.

func (*AssetsQuery) All

func (aq *AssetsQuery) All(ctx context.Context) ([]*Assets, error)

All executes the query and returns a list of AssetsSlice.

func (*AssetsQuery) AllX

func (aq *AssetsQuery) AllX(ctx context.Context) []*Assets

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

func (*AssetsQuery) Clone

func (aq *AssetsQuery) Clone() *AssetsQuery

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

func (*AssetsQuery) Count

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

Count returns the count of the given query.

func (*AssetsQuery) CountX

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

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

func (*AssetsQuery) Exist

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

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

func (*AssetsQuery) ExistX

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

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

func (*AssetsQuery) First

func (aq *AssetsQuery) First(ctx context.Context) (*Assets, error)

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

func (*AssetsQuery) FirstID

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

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

func (*AssetsQuery) FirstIDX

func (aq *AssetsQuery) FirstIDX(ctx context.Context) int

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

func (*AssetsQuery) FirstX

func (aq *AssetsQuery) FirstX(ctx context.Context) *Assets

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

func (*AssetsQuery) GroupBy

func (aq *AssetsQuery) GroupBy(field string, fields ...string) *AssetsGroupBy

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

Example:

var v []struct {
	Path string `json:"path,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Assets.Query().
	GroupBy(assets.FieldPath).
	Aggregate(model.Count()).
	Scan(ctx, &v)

func (*AssetsQuery) IDs

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

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

func (*AssetsQuery) IDsX

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

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

func (*AssetsQuery) Limit

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

Limit adds a limit step to the query.

func (*AssetsQuery) Offset

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

Offset adds an offset step to the query.

func (*AssetsQuery) Only

func (aq *AssetsQuery) Only(ctx context.Context) (*Assets, error)

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

func (*AssetsQuery) OnlyID

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

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

func (*AssetsQuery) OnlyIDX

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

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

func (*AssetsQuery) OnlyX

func (aq *AssetsQuery) OnlyX(ctx context.Context) *Assets

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

func (*AssetsQuery) Order

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

Order adds an order step to the query.

func (*AssetsQuery) QueryView

func (aq *AssetsQuery) QueryView() *ViewQuery

QueryView chains the current query on the "view" edge.

func (*AssetsQuery) Select

func (aq *AssetsQuery) Select(field string, fields ...string) *AssetsSelect

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

Example:

var v []struct {
	Path string `json:"path,omitempty"`
}

client.Assets.Query().
	Select(assets.FieldPath).
	Scan(ctx, &v)

func (*AssetsQuery) Unique

func (aq *AssetsQuery) Unique(unique bool) *AssetsQuery

Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.

func (*AssetsQuery) Where

func (aq *AssetsQuery) Where(ps ...predicate.Assets) *AssetsQuery

Where adds a new predicate for the AssetsQuery builder.

func (*AssetsQuery) WithView

func (aq *AssetsQuery) WithView(opts ...func(*ViewQuery)) *AssetsQuery

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

type AssetsSelect

type AssetsSelect struct {
	*AssetsQuery
	// contains filtered or unexported fields
}

AssetsSelect is the builder for selecting fields of Assets entities.

func (*AssetsSelect) Bool

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

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

func (*AssetsSelect) BoolX

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

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

func (*AssetsSelect) Bools

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

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

func (*AssetsSelect) BoolsX

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

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

func (*AssetsSelect) Float64

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

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

func (*AssetsSelect) Float64X

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

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

func (*AssetsSelect) Float64s

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

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

func (*AssetsSelect) Float64sX

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

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

func (*AssetsSelect) Int

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

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

func (*AssetsSelect) IntX

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

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

func (*AssetsSelect) Ints

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

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

func (*AssetsSelect) IntsX

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

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

func (*AssetsSelect) Scan

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

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

func (*AssetsSelect) ScanX

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

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

func (*AssetsSelect) String

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

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

func (*AssetsSelect) StringX

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

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

func (*AssetsSelect) Strings

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

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

func (*AssetsSelect) StringsX

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

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

type AssetsSlice

type AssetsSlice []*Assets

AssetsSlice is a parsable slice of Assets.

type AssetsUpdate

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

AssetsUpdate is the builder for updating Assets entities.

func (*AssetsUpdate) AddView

func (au *AssetsUpdate) AddView(v ...*View) *AssetsUpdate

AddView adds the "view" edges to the View entity.

func (*AssetsUpdate) AddViewIDs

func (au *AssetsUpdate) AddViewIDs(ids ...int) *AssetsUpdate

AddViewIDs adds the "view" edge to the View entity by IDs.

func (*AssetsUpdate) ClearView

func (au *AssetsUpdate) ClearView() *AssetsUpdate

ClearView clears all "view" edges to the View entity.

func (*AssetsUpdate) Exec

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

Exec executes the query.

func (*AssetsUpdate) ExecX

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

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

func (*AssetsUpdate) Mutation

func (au *AssetsUpdate) Mutation() *AssetsMutation

Mutation returns the AssetsMutation object of the builder.

func (*AssetsUpdate) RemoveView

func (au *AssetsUpdate) RemoveView(v ...*View) *AssetsUpdate

RemoveView removes "view" edges to View entities.

func (*AssetsUpdate) RemoveViewIDs

func (au *AssetsUpdate) RemoveViewIDs(ids ...int) *AssetsUpdate

RemoveViewIDs removes the "view" edge to View entities by IDs.

func (*AssetsUpdate) Save

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

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

func (*AssetsUpdate) SaveX

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

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

func (*AssetsUpdate) SetExt

func (au *AssetsUpdate) SetExt(s string) *AssetsUpdate

SetExt sets the "ext" field.

func (*AssetsUpdate) SetPath

func (au *AssetsUpdate) SetPath(s string) *AssetsUpdate

SetPath sets the "path" field.

func (*AssetsUpdate) SetType

func (au *AssetsUpdate) SetType(s string) *AssetsUpdate

SetType sets the "type" field.

func (*AssetsUpdate) Where

func (au *AssetsUpdate) Where(ps ...predicate.Assets) *AssetsUpdate

Where adds a new predicate for the AssetsUpdate builder.

type AssetsUpdateOne

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

AssetsUpdateOne is the builder for updating a single Assets entity.

func (*AssetsUpdateOne) AddView

func (auo *AssetsUpdateOne) AddView(v ...*View) *AssetsUpdateOne

AddView adds the "view" edges to the View entity.

func (*AssetsUpdateOne) AddViewIDs

func (auo *AssetsUpdateOne) AddViewIDs(ids ...int) *AssetsUpdateOne

AddViewIDs adds the "view" edge to the View entity by IDs.

func (*AssetsUpdateOne) ClearView

func (auo *AssetsUpdateOne) ClearView() *AssetsUpdateOne

ClearView clears all "view" edges to the View entity.

func (*AssetsUpdateOne) Exec

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

Exec executes the query on the entity.

func (*AssetsUpdateOne) ExecX

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

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

func (*AssetsUpdateOne) Mutation

func (auo *AssetsUpdateOne) Mutation() *AssetsMutation

Mutation returns the AssetsMutation object of the builder.

func (*AssetsUpdateOne) RemoveView

func (auo *AssetsUpdateOne) RemoveView(v ...*View) *AssetsUpdateOne

RemoveView removes "view" edges to View entities.

func (*AssetsUpdateOne) RemoveViewIDs

func (auo *AssetsUpdateOne) RemoveViewIDs(ids ...int) *AssetsUpdateOne

RemoveViewIDs removes the "view" edge to View entities by IDs.

func (*AssetsUpdateOne) Save

func (auo *AssetsUpdateOne) Save(ctx context.Context) (*Assets, error)

Save executes the query and returns the updated Assets entity.

func (*AssetsUpdateOne) SaveX

func (auo *AssetsUpdateOne) SaveX(ctx context.Context) *Assets

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

func (*AssetsUpdateOne) Select

func (auo *AssetsUpdateOne) Select(field string, fields ...string) *AssetsUpdateOne

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

func (*AssetsUpdateOne) SetExt

func (auo *AssetsUpdateOne) SetExt(s string) *AssetsUpdateOne

SetExt sets the "ext" field.

func (*AssetsUpdateOne) SetPath

func (auo *AssetsUpdateOne) SetPath(s string) *AssetsUpdateOne

SetPath sets the "path" field.

func (*AssetsUpdateOne) SetType

func (auo *AssetsUpdateOne) SetType(s string) *AssetsUpdateOne

SetType sets the "type" field.

type Client

type Client struct {

	// Schema is the client for creating, migrating and dropping schema.
	Schema *migrate.Schema
	// Assets is the client for interacting with the Assets builders.
	Assets *AssetsClient
	// DataSet is the client for interacting with the DataSet builders.
	DataSet *DataSetClient
	// Menu is the client for interacting with the Menu builders.
	Menu *MenuClient
	// Share is the client for interacting with the Share builders.
	Share *ShareClient
	// TypeConfig is the client for interacting with the TypeConfig builders.
	TypeConfig *TypeConfigClient
	// User is the client for interacting with the User builders.
	User *UserClient
	// View is the client for interacting with the View builders.
	View *ViewClient
	// ViewBlock is the client for interacting with the ViewBlock builders.
	ViewBlock *ViewBlockClient
	// contains filtered or unexported fields
}

Client is the client that holds all ent builders.

func FromContext

func FromContext(ctx context.Context) *Client

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

func NewClient

func NewClient(opts ...Option) *Client

NewClient creates a new client configured with the given options.

func Open

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

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

func (*Client) BeginTx

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

BeginTx returns a transactional client with specified options.

func (*Client) Close

func (c *Client) Close() error

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

func (*Client) Debug

func (c *Client) Debug() *Client

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

client.Debug().
	Assets.
	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 CurdBuilder

type CurdBuilder struct {
	Apis struct {
		Assets     *AssetsApi
		DataSet    *DataSetApi
		Menu       *MenuApi
		Share      *ShareApi
		TypeConfig *TypeConfigApi
		User       *UserApi
		View       *ViewApi
		ViewBlock  *ViewBlockApi
	}
}

func NewCurdBuilder

func NewCurdBuilder(client *Client) *CurdBuilder

func (*CurdBuilder) Group

func (cb *CurdBuilder) Group(group *gin.RouterGroup, path string, api Endpoint)

func (*CurdBuilder) Route

func (cb *CurdBuilder) Route(prefix string, r gin.IRouter, pick []string) *gin.RouterGroup

type DataSet

type DataSet struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// Type holds the value of the "type" field.
	Type string `json:"type,omitempty"`
	// Title holds the value of the "title" field.
	Title string `json:"title,omitempty"`
	// Config holds the value of the "config" field.
	Config string `json:"config,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the DataSetQuery when eager-loading is set.
	Edges DataSetEdges `json:"edges"`
	// contains filtered or unexported fields
}

DataSet is the model entity for the DataSet schema.

func (*DataSet) QueryBlock

func (ds *DataSet) QueryBlock() *ViewBlockQuery

QueryBlock queries the "block" edge of the DataSet entity.

func (*DataSet) String

func (ds *DataSet) String() string

String implements the fmt.Stringer.

func (*DataSet) Unwrap

func (ds *DataSet) Unwrap() *DataSet

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

func (*DataSet) Update

func (ds *DataSet) Update() *DataSetUpdateOne

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

type DataSetApi

type DataSetApi struct {
	*Api
	Filter             DataSetApiFilter
	SkipCreateAutoEdge bool
	SkipUpdateAutoEdge bool
}

func NewDataSetApi

func NewDataSetApi(client *Client, opt *ApiOption) *DataSetApi

func (*DataSetApi) Create

func (c *DataSetApi) Create(help *contact.GinHelp)

func (*DataSetApi) Delete

func (c *DataSetApi) Delete(help *contact.GinHelp)

func (*DataSetApi) Get

func (c *DataSetApi) Get(help *contact.GinHelp)

func (*DataSetApi) List

func (c *DataSetApi) List(help *contact.GinHelp)

func (*DataSetApi) Update

func (c *DataSetApi) Update(help *contact.GinHelp)

type DataSetApiFilter

type DataSetApiFilter struct {
	CreatePipe   func(help *contact.GinHelp, createPipe *DataSetCreate, edges DataSetEdges)
	CreateAfter  func(help *contact.GinHelp, item *DataSet, edges DataSetEdges)
	UpdatePipe   func(help *contact.GinHelp, old *DataSet, updatePipe *DataSetUpdateOne, edges DataSetEdges)
	UpdateAfter  func(help *contact.GinHelp, old *DataSet, item *DataSet, edges DataSetEdges)
	ListPipe     func(help *contact.GinHelp, listPipe *DataSetQuery)
	ListData     func(help *contact.GinHelp, items []*DataSet) interface{}
	DeleteBefore func(help *contact.GinHelp, item *DataSet)
	GetPipe      func(help *contact.GinHelp, getPipe *DataSetQuery)
	GetData      func(help *contact.GinHelp, item *DataSet) *DataSet
}

type DataSetClient

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

DataSetClient is a client for the DataSet schema.

func NewDataSetClient

func NewDataSetClient(c config) *DataSetClient

NewDataSetClient returns a client for the DataSet from the given config.

func (*DataSetClient) Create

func (c *DataSetClient) Create() *DataSetCreate

Create returns a create builder for DataSet.

func (*DataSetClient) CreateBulk

func (c *DataSetClient) CreateBulk(builders ...*DataSetCreate) *DataSetCreateBulk

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

func (*DataSetClient) Delete

func (c *DataSetClient) Delete() *DataSetDelete

Delete returns a delete builder for DataSet.

func (*DataSetClient) DeleteOne

func (c *DataSetClient) DeleteOne(ds *DataSet) *DataSetDeleteOne

DeleteOne returns a delete builder for the given entity.

func (*DataSetClient) DeleteOneID

func (c *DataSetClient) DeleteOneID(id int) *DataSetDeleteOne

DeleteOneID returns a delete builder for the given id.

func (*DataSetClient) Get

func (c *DataSetClient) Get(ctx context.Context, id int) (*DataSet, error)

Get returns a DataSet entity by its id.

func (*DataSetClient) GetX

func (c *DataSetClient) GetX(ctx context.Context, id int) *DataSet

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

func (*DataSetClient) Hooks

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

Hooks returns the client hooks.

func (*DataSetClient) Query

func (c *DataSetClient) Query() *DataSetQuery

Query returns a query builder for DataSet.

func (*DataSetClient) QueryBlock

func (c *DataSetClient) QueryBlock(ds *DataSet) *ViewBlockQuery

QueryBlock queries the block edge of a DataSet.

func (*DataSetClient) Update

func (c *DataSetClient) Update() *DataSetUpdate

Update returns an update builder for DataSet.

func (*DataSetClient) UpdateOne

func (c *DataSetClient) UpdateOne(ds *DataSet) *DataSetUpdateOne

UpdateOne returns an update builder for the given entity.

func (*DataSetClient) UpdateOneID

func (c *DataSetClient) UpdateOneID(id int) *DataSetUpdateOne

UpdateOneID returns an update builder for the given id.

func (*DataSetClient) Use

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

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

type DataSetCreate

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

DataSetCreate is the builder for creating a DataSet entity.

func (*DataSetCreate) Mutation

func (dsc *DataSetCreate) Mutation() *DataSetMutation

Mutation returns the DataSetMutation object of the builder.

func (*DataSetCreate) Save

func (dsc *DataSetCreate) Save(ctx context.Context) (*DataSet, error)

Save creates the DataSet in the database.

func (*DataSetCreate) SaveX

func (dsc *DataSetCreate) SaveX(ctx context.Context) *DataSet

SaveX calls Save and panics if Save returns an error.

func (*DataSetCreate) SetBlock

func (dsc *DataSetCreate) SetBlock(v *ViewBlock) *DataSetCreate

SetBlock sets the "block" edge to the ViewBlock entity.

func (*DataSetCreate) SetBlockID

func (dsc *DataSetCreate) SetBlockID(id int) *DataSetCreate

SetBlockID sets the "block" edge to the ViewBlock entity by ID.

func (*DataSetCreate) SetConfig

func (dsc *DataSetCreate) SetConfig(s string) *DataSetCreate

SetConfig sets the "config" field.

func (*DataSetCreate) SetNillableBlockID

func (dsc *DataSetCreate) SetNillableBlockID(id *int) *DataSetCreate

SetNillableBlockID sets the "block" edge to the ViewBlock entity by ID if the given value is not nil.

func (*DataSetCreate) SetTitle

func (dsc *DataSetCreate) SetTitle(s string) *DataSetCreate

SetTitle sets the "title" field.

func (*DataSetCreate) SetType

func (dsc *DataSetCreate) SetType(s string) *DataSetCreate

SetType sets the "type" field.

type DataSetCreateBulk

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

DataSetCreateBulk is the builder for creating many DataSet entities in bulk.

func (*DataSetCreateBulk) Save

func (dscb *DataSetCreateBulk) Save(ctx context.Context) ([]*DataSet, error)

Save creates the DataSet entities in the database.

func (*DataSetCreateBulk) SaveX

func (dscb *DataSetCreateBulk) SaveX(ctx context.Context) []*DataSet

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

type DataSetDelete

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

DataSetDelete is the builder for deleting a DataSet entity.

func (*DataSetDelete) Exec

func (dsd *DataSetDelete) Exec(ctx context.Context) (int, error)

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

func (*DataSetDelete) ExecX

func (dsd *DataSetDelete) ExecX(ctx context.Context) int

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

func (*DataSetDelete) Where

func (dsd *DataSetDelete) Where(ps ...predicate.DataSet) *DataSetDelete

Where adds a new predicate to the DataSetDelete builder.

type DataSetDeleteOne

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

DataSetDeleteOne is the builder for deleting a single DataSet entity.

func (*DataSetDeleteOne) Exec

func (dsdo *DataSetDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*DataSetDeleteOne) ExecX

func (dsdo *DataSetDeleteOne) ExecX(ctx context.Context)

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

type DataSetEdges

type DataSetEdges struct {
	// Block holds the value of the block edge.
	Block *ViewBlock `json:"block,omitempty"`
	// contains filtered or unexported fields
}

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

func (DataSetEdges) BlockOrErr

func (e DataSetEdges) BlockOrErr() (*ViewBlock, error)

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

type DataSetGroupBy

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

DataSetGroupBy is the group-by builder for DataSet entities.

func (*DataSetGroupBy) Aggregate

func (dsgb *DataSetGroupBy) Aggregate(fns ...AggregateFunc) *DataSetGroupBy

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

func (*DataSetGroupBy) Bool

func (dsgb *DataSetGroupBy) Bool(ctx context.Context) (_ bool, err error)

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

func (*DataSetGroupBy) BoolX

func (dsgb *DataSetGroupBy) BoolX(ctx context.Context) bool

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

func (*DataSetGroupBy) Bools

func (dsgb *DataSetGroupBy) Bools(ctx context.Context) ([]bool, error)

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

func (*DataSetGroupBy) BoolsX

func (dsgb *DataSetGroupBy) BoolsX(ctx context.Context) []bool

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

func (*DataSetGroupBy) Float64

func (dsgb *DataSetGroupBy) Float64(ctx context.Context) (_ float64, err error)

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

func (*DataSetGroupBy) Float64X

func (dsgb *DataSetGroupBy) Float64X(ctx context.Context) float64

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

func (*DataSetGroupBy) Float64s

func (dsgb *DataSetGroupBy) Float64s(ctx context.Context) ([]float64, error)

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

func (*DataSetGroupBy) Float64sX

func (dsgb *DataSetGroupBy) Float64sX(ctx context.Context) []float64

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

func (*DataSetGroupBy) Int

func (dsgb *DataSetGroupBy) Int(ctx context.Context) (_ int, err error)

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

func (*DataSetGroupBy) IntX

func (dsgb *DataSetGroupBy) IntX(ctx context.Context) int

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

func (*DataSetGroupBy) Ints

func (dsgb *DataSetGroupBy) Ints(ctx context.Context) ([]int, error)

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

func (*DataSetGroupBy) IntsX

func (dsgb *DataSetGroupBy) IntsX(ctx context.Context) []int

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

func (*DataSetGroupBy) Scan

func (dsgb *DataSetGroupBy) Scan(ctx context.Context, v interface{}) error

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

func (*DataSetGroupBy) ScanX

func (dsgb *DataSetGroupBy) ScanX(ctx context.Context, v interface{})

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

func (*DataSetGroupBy) String

func (dsgb *DataSetGroupBy) String(ctx context.Context) (_ string, err error)

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

func (*DataSetGroupBy) StringX

func (dsgb *DataSetGroupBy) StringX(ctx context.Context) string

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

func (*DataSetGroupBy) Strings

func (dsgb *DataSetGroupBy) Strings(ctx context.Context) ([]string, error)

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

func (*DataSetGroupBy) StringsX

func (dsgb *DataSetGroupBy) StringsX(ctx context.Context) []string

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

type DataSetMutation

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

DataSetMutation represents an operation that mutates the DataSet nodes in the graph.

func (*DataSetMutation) AddField

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

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

func (*DataSetMutation) AddedEdges

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

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

func (*DataSetMutation) AddedField

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

AddedField returns the numeric value that was incremented/decremented on a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*DataSetMutation) AddedFields

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

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

func (*DataSetMutation) AddedIDs

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

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

func (*DataSetMutation) BlockCleared

func (m *DataSetMutation) BlockCleared() bool

BlockCleared reports if the "block" edge to the ViewBlock entity was cleared.

func (*DataSetMutation) BlockID

func (m *DataSetMutation) BlockID() (id int, exists bool)

BlockID returns the "block" edge ID in the mutation.

func (*DataSetMutation) BlockIDs

func (m *DataSetMutation) BlockIDs() (ids []int)

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

func (*DataSetMutation) ClearBlock

func (m *DataSetMutation) ClearBlock()

ClearBlock clears the "block" edge to the ViewBlock entity.

func (*DataSetMutation) ClearEdge

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

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

func (*DataSetMutation) ClearField

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

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

func (*DataSetMutation) ClearedEdges

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

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

func (*DataSetMutation) ClearedFields

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

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

func (DataSetMutation) Client

func (m DataSetMutation) 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 (*DataSetMutation) Config

func (m *DataSetMutation) Config() (r string, exists bool)

Config returns the value of the "config" field in the mutation.

func (*DataSetMutation) EdgeCleared

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

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

func (*DataSetMutation) Field

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

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

func (*DataSetMutation) FieldCleared

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

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

func (*DataSetMutation) Fields

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

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

func (*DataSetMutation) GetType

func (m *DataSetMutation) GetType() (r string, exists bool)

GetType returns the value of the "type" field in the mutation.

func (*DataSetMutation) ID

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

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

func (*DataSetMutation) OldConfig

func (m *DataSetMutation) OldConfig(ctx context.Context) (v string, err error)

OldConfig returns the old "config" field's value of the DataSet entity. If the DataSet object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*DataSetMutation) OldField

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

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

func (*DataSetMutation) OldTitle

func (m *DataSetMutation) OldTitle(ctx context.Context) (v string, err error)

OldTitle returns the old "title" field's value of the DataSet entity. If the DataSet object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*DataSetMutation) OldType

func (m *DataSetMutation) OldType(ctx context.Context) (v string, err error)

OldType returns the old "type" field's value of the DataSet entity. If the DataSet object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*DataSetMutation) Op

func (m *DataSetMutation) Op() Op

Op returns the operation name.

func (*DataSetMutation) RemovedEdges

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

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

func (*DataSetMutation) RemovedIDs

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

RemovedIDs returns all IDs (to other nodes) that were removed for the edge with the given name in this mutation.

func (*DataSetMutation) ResetBlock

func (m *DataSetMutation) ResetBlock()

ResetBlock resets all changes to the "block" edge.

func (*DataSetMutation) ResetConfig

func (m *DataSetMutation) ResetConfig()

ResetConfig resets all changes to the "config" field.

func (*DataSetMutation) ResetEdge

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

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

func (*DataSetMutation) ResetField

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

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

func (*DataSetMutation) ResetTitle

func (m *DataSetMutation) ResetTitle()

ResetTitle resets all changes to the "title" field.

func (*DataSetMutation) ResetType

func (m *DataSetMutation) ResetType()

ResetType resets all changes to the "type" field.

func (*DataSetMutation) SetBlockID

func (m *DataSetMutation) SetBlockID(id int)

SetBlockID sets the "block" edge to the ViewBlock entity by id.

func (*DataSetMutation) SetConfig

func (m *DataSetMutation) SetConfig(s string)

SetConfig sets the "config" field.

func (*DataSetMutation) SetField

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

SetField sets the value of a field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*DataSetMutation) SetTitle

func (m *DataSetMutation) SetTitle(s string)

SetTitle sets the "title" field.

func (*DataSetMutation) SetType

func (m *DataSetMutation) SetType(s string)

SetType sets the "type" field.

func (*DataSetMutation) Title

func (m *DataSetMutation) Title() (r string, exists bool)

Title returns the value of the "title" field in the mutation.

func (DataSetMutation) Tx

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

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

func (*DataSetMutation) Type

func (m *DataSetMutation) Type() string

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

type DataSetQuery

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

DataSetQuery is the builder for querying DataSet entities.

func (*DataSetQuery) All

func (dsq *DataSetQuery) All(ctx context.Context) ([]*DataSet, error)

All executes the query and returns a list of DataSets.

func (*DataSetQuery) AllX

func (dsq *DataSetQuery) AllX(ctx context.Context) []*DataSet

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

func (*DataSetQuery) Clone

func (dsq *DataSetQuery) Clone() *DataSetQuery

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

func (*DataSetQuery) Count

func (dsq *DataSetQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*DataSetQuery) CountX

func (dsq *DataSetQuery) CountX(ctx context.Context) int

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

func (*DataSetQuery) Exist

func (dsq *DataSetQuery) Exist(ctx context.Context) (bool, error)

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

func (*DataSetQuery) ExistX

func (dsq *DataSetQuery) ExistX(ctx context.Context) bool

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

func (*DataSetQuery) First

func (dsq *DataSetQuery) First(ctx context.Context) (*DataSet, error)

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

func (*DataSetQuery) FirstID

func (dsq *DataSetQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*DataSetQuery) FirstIDX

func (dsq *DataSetQuery) FirstIDX(ctx context.Context) int

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

func (*DataSetQuery) FirstX

func (dsq *DataSetQuery) FirstX(ctx context.Context) *DataSet

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

func (*DataSetQuery) GroupBy

func (dsq *DataSetQuery) GroupBy(field string, fields ...string) *DataSetGroupBy

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

Example:

var v []struct {
	Type string `json:"type,omitempty"`
	Count int `json:"count,omitempty"`
}

client.DataSet.Query().
	GroupBy(dataset.FieldType).
	Aggregate(model.Count()).
	Scan(ctx, &v)

func (*DataSetQuery) IDs

func (dsq *DataSetQuery) IDs(ctx context.Context) ([]int, error)

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

func (*DataSetQuery) IDsX

func (dsq *DataSetQuery) IDsX(ctx context.Context) []int

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

func (*DataSetQuery) Limit

func (dsq *DataSetQuery) Limit(limit int) *DataSetQuery

Limit adds a limit step to the query.

func (*DataSetQuery) Offset

func (dsq *DataSetQuery) Offset(offset int) *DataSetQuery

Offset adds an offset step to the query.

func (*DataSetQuery) Only

func (dsq *DataSetQuery) Only(ctx context.Context) (*DataSet, error)

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

func (*DataSetQuery) OnlyID

func (dsq *DataSetQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*DataSetQuery) OnlyIDX

func (dsq *DataSetQuery) OnlyIDX(ctx context.Context) int

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

func (*DataSetQuery) OnlyX

func (dsq *DataSetQuery) OnlyX(ctx context.Context) *DataSet

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

func (*DataSetQuery) Order

func (dsq *DataSetQuery) Order(o ...OrderFunc) *DataSetQuery

Order adds an order step to the query.

func (*DataSetQuery) QueryBlock

func (dsq *DataSetQuery) QueryBlock() *ViewBlockQuery

QueryBlock chains the current query on the "block" edge.

func (*DataSetQuery) Select

func (dsq *DataSetQuery) Select(field string, fields ...string) *DataSetSelect

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

Example:

var v []struct {
	Type string `json:"type,omitempty"`
}

client.DataSet.Query().
	Select(dataset.FieldType).
	Scan(ctx, &v)

func (*DataSetQuery) Unique

func (dsq *DataSetQuery) Unique(unique bool) *DataSetQuery

Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.

func (*DataSetQuery) Where

func (dsq *DataSetQuery) Where(ps ...predicate.DataSet) *DataSetQuery

Where adds a new predicate for the DataSetQuery builder.

func (*DataSetQuery) WithBlock

func (dsq *DataSetQuery) WithBlock(opts ...func(*ViewBlockQuery)) *DataSetQuery

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

type DataSetSelect

type DataSetSelect struct {
	*DataSetQuery
	// contains filtered or unexported fields
}

DataSetSelect is the builder for selecting fields of DataSet entities.

func (*DataSetSelect) Bool

func (dss *DataSetSelect) Bool(ctx context.Context) (_ bool, err error)

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

func (*DataSetSelect) BoolX

func (dss *DataSetSelect) BoolX(ctx context.Context) bool

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

func (*DataSetSelect) Bools

func (dss *DataSetSelect) Bools(ctx context.Context) ([]bool, error)

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

func (*DataSetSelect) BoolsX

func (dss *DataSetSelect) BoolsX(ctx context.Context) []bool

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

func (*DataSetSelect) Float64

func (dss *DataSetSelect) Float64(ctx context.Context) (_ float64, err error)

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

func (*DataSetSelect) Float64X

func (dss *DataSetSelect) Float64X(ctx context.Context) float64

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

func (*DataSetSelect) Float64s

func (dss *DataSetSelect) Float64s(ctx context.Context) ([]float64, error)

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

func (*DataSetSelect) Float64sX

func (dss *DataSetSelect) Float64sX(ctx context.Context) []float64

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

func (*DataSetSelect) Int

func (dss *DataSetSelect) Int(ctx context.Context) (_ int, err error)

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

func (*DataSetSelect) IntX

func (dss *DataSetSelect) IntX(ctx context.Context) int

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

func (*DataSetSelect) Ints

func (dss *DataSetSelect) Ints(ctx context.Context) ([]int, error)

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

func (*DataSetSelect) IntsX

func (dss *DataSetSelect) IntsX(ctx context.Context) []int

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

func (*DataSetSelect) Scan

func (dss *DataSetSelect) Scan(ctx context.Context, v interface{}) error

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

func (*DataSetSelect) ScanX

func (dss *DataSetSelect) ScanX(ctx context.Context, v interface{})

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

func (*DataSetSelect) String

func (dss *DataSetSelect) String(ctx context.Context) (_ string, err error)

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

func (*DataSetSelect) StringX

func (dss *DataSetSelect) StringX(ctx context.Context) string

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

func (*DataSetSelect) Strings

func (dss *DataSetSelect) Strings(ctx context.Context) ([]string, error)

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

func (*DataSetSelect) StringsX

func (dss *DataSetSelect) StringsX(ctx context.Context) []string

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

type DataSetUpdate

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

DataSetUpdate is the builder for updating DataSet entities.

func (*DataSetUpdate) ClearBlock

func (dsu *DataSetUpdate) ClearBlock() *DataSetUpdate

ClearBlock clears the "block" edge to the ViewBlock entity.

func (*DataSetUpdate) Exec

func (dsu *DataSetUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*DataSetUpdate) ExecX

func (dsu *DataSetUpdate) ExecX(ctx context.Context)

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

func (*DataSetUpdate) Mutation

func (dsu *DataSetUpdate) Mutation() *DataSetMutation

Mutation returns the DataSetMutation object of the builder.

func (*DataSetUpdate) Save

func (dsu *DataSetUpdate) Save(ctx context.Context) (int, error)

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

func (*DataSetUpdate) SaveX

func (dsu *DataSetUpdate) SaveX(ctx context.Context) int

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

func (*DataSetUpdate) SetBlock

func (dsu *DataSetUpdate) SetBlock(v *ViewBlock) *DataSetUpdate

SetBlock sets the "block" edge to the ViewBlock entity.

func (*DataSetUpdate) SetBlockID

func (dsu *DataSetUpdate) SetBlockID(id int) *DataSetUpdate

SetBlockID sets the "block" edge to the ViewBlock entity by ID.

func (*DataSetUpdate) SetConfig

func (dsu *DataSetUpdate) SetConfig(s string) *DataSetUpdate

SetConfig sets the "config" field.

func (*DataSetUpdate) SetNillableBlockID

func (dsu *DataSetUpdate) SetNillableBlockID(id *int) *DataSetUpdate

SetNillableBlockID sets the "block" edge to the ViewBlock entity by ID if the given value is not nil.

func (*DataSetUpdate) SetTitle

func (dsu *DataSetUpdate) SetTitle(s string) *DataSetUpdate

SetTitle sets the "title" field.

func (*DataSetUpdate) SetType

func (dsu *DataSetUpdate) SetType(s string) *DataSetUpdate

SetType sets the "type" field.

func (*DataSetUpdate) Where

func (dsu *DataSetUpdate) Where(ps ...predicate.DataSet) *DataSetUpdate

Where adds a new predicate for the DataSetUpdate builder.

type DataSetUpdateOne

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

DataSetUpdateOne is the builder for updating a single DataSet entity.

func (*DataSetUpdateOne) ClearBlock

func (dsuo *DataSetUpdateOne) ClearBlock() *DataSetUpdateOne

ClearBlock clears the "block" edge to the ViewBlock entity.

func (*DataSetUpdateOne) Exec

func (dsuo *DataSetUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*DataSetUpdateOne) ExecX

func (dsuo *DataSetUpdateOne) ExecX(ctx context.Context)

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

func (*DataSetUpdateOne) Mutation

func (dsuo *DataSetUpdateOne) Mutation() *DataSetMutation

Mutation returns the DataSetMutation object of the builder.

func (*DataSetUpdateOne) Save

func (dsuo *DataSetUpdateOne) Save(ctx context.Context) (*DataSet, error)

Save executes the query and returns the updated DataSet entity.

func (*DataSetUpdateOne) SaveX

func (dsuo *DataSetUpdateOne) SaveX(ctx context.Context) *DataSet

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

func (*DataSetUpdateOne) Select

func (dsuo *DataSetUpdateOne) Select(field string, fields ...string) *DataSetUpdateOne

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

func (*DataSetUpdateOne) SetBlock

func (dsuo *DataSetUpdateOne) SetBlock(v *ViewBlock) *DataSetUpdateOne

SetBlock sets the "block" edge to the ViewBlock entity.

func (*DataSetUpdateOne) SetBlockID

func (dsuo *DataSetUpdateOne) SetBlockID(id int) *DataSetUpdateOne

SetBlockID sets the "block" edge to the ViewBlock entity by ID.

func (*DataSetUpdateOne) SetConfig

func (dsuo *DataSetUpdateOne) SetConfig(s string) *DataSetUpdateOne

SetConfig sets the "config" field.

func (*DataSetUpdateOne) SetNillableBlockID

func (dsuo *DataSetUpdateOne) SetNillableBlockID(id *int) *DataSetUpdateOne

SetNillableBlockID sets the "block" edge to the ViewBlock entity by ID if the given value is not nil.

func (*DataSetUpdateOne) SetTitle

func (dsuo *DataSetUpdateOne) SetTitle(s string) *DataSetUpdateOne

SetTitle sets the "title" field.

func (*DataSetUpdateOne) SetType

func (dsuo *DataSetUpdateOne) SetType(s string) *DataSetUpdateOne

SetType sets the "type" field.

type DataSets

type DataSets []*DataSet

DataSets is a parsable slice of DataSet.

type Endpoint

type Endpoint interface {
	List(*contact.GinHelp)
	Update(*contact.GinHelp)
	Create(*contact.GinHelp)
	Get(*contact.GinHelp)
	Delete(*contact.GinHelp)
}

type Hook

type Hook = ent.Hook

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

type Menu struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// Title holds the value of the "title" field.
	Title string `json:"title,omitempty"`
	// URL holds the value of the "url" field.
	URL string `json:"url,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// UpdatedAt holds the value of the "updated_at" field.
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the MenuQuery when eager-loading is set.
	Edges MenuEdges `json:"edges"`
	// contains filtered or unexported fields
}

Menu is the model entity for the Menu schema.

func (m *Menu) QueryChildren() *MenuQuery

QueryChildren queries the "children" edge of the Menu entity.

func (m *Menu) QueryParent() *MenuQuery

QueryParent queries the "parent" edge of the Menu entity.

func (m *Menu) String() string

String implements the fmt.Stringer.

func (m *Menu) Unwrap() *Menu

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

func (m *Menu) Update() *MenuUpdateOne

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

type MenuApi struct {
	*Api
	Filter             MenuApiFilter
	SkipCreateAutoEdge bool
	SkipUpdateAutoEdge bool
}

func NewMenuApi

func NewMenuApi(client *Client, opt *ApiOption) *MenuApi
func (c *MenuApi) Create(help *contact.GinHelp)
func (c *MenuApi) Delete(help *contact.GinHelp)
func (c *MenuApi) Get(help *contact.GinHelp)
func (c *MenuApi) List(help *contact.GinHelp)
func (c *MenuApi) Update(help *contact.GinHelp)
type MenuApiFilter struct {
	CreatePipe   func(help *contact.GinHelp, createPipe *MenuCreate, edges MenuEdges)
	CreateAfter  func(help *contact.GinHelp, item *Menu, edges MenuEdges)
	UpdatePipe   func(help *contact.GinHelp, old *Menu, updatePipe *MenuUpdateOne, edges MenuEdges)
	UpdateAfter  func(help *contact.GinHelp, old *Menu, item *Menu, edges MenuEdges)
	ListPipe     func(help *contact.GinHelp, listPipe *MenuQuery)
	ListData     func(help *contact.GinHelp, items []*Menu) interface{}
	DeleteBefore func(help *contact.GinHelp, item *Menu)
	GetPipe      func(help *contact.GinHelp, getPipe *MenuQuery)
	GetData      func(help *contact.GinHelp, item *Menu) *Menu
}
type MenuClient struct {
	// contains filtered or unexported fields
}

MenuClient is a client for the Menu schema.

func NewMenuClient

func NewMenuClient(c config) *MenuClient

NewMenuClient returns a client for the Menu from the given config.

func (c *MenuClient) Create() *MenuCreate

Create returns a create builder for Menu.

func (c *MenuClient) CreateBulk(builders ...*MenuCreate) *MenuCreateBulk

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

func (c *MenuClient) Delete() *MenuDelete

Delete returns a delete builder for Menu.

func (c *MenuClient) DeleteOne(m *Menu) *MenuDeleteOne

DeleteOne returns a delete builder for the given entity.

func (c *MenuClient) DeleteOneID(id int) *MenuDeleteOne

DeleteOneID returns a delete builder for the given id.

func (c *MenuClient) Get(ctx context.Context, id int) (*Menu, error)

Get returns a Menu entity by its id.

func (c *MenuClient) GetX(ctx context.Context, id int) *Menu

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

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

Hooks returns the client hooks.

func (c *MenuClient) Query() *MenuQuery

Query returns a query builder for Menu.

func (c *MenuClient) QueryChildren(m *Menu) *MenuQuery

QueryChildren queries the children edge of a Menu.

func (c *MenuClient) QueryParent(m *Menu) *MenuQuery

QueryParent queries the parent edge of a Menu.

func (c *MenuClient) Update() *MenuUpdate

Update returns an update builder for Menu.

func (c *MenuClient) UpdateOne(m *Menu) *MenuUpdateOne

UpdateOne returns an update builder for the given entity.

func (c *MenuClient) UpdateOneID(id int) *MenuUpdateOne

UpdateOneID returns an update builder for the given id.

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

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

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

MenuCreate is the builder for creating a Menu entity.

func (mc *MenuCreate) AddChildIDs(ids ...int) *MenuCreate

AddChildIDs adds the "children" edge to the Menu entity by IDs.

func (mc *MenuCreate) AddChildren(m ...*Menu) *MenuCreate

AddChildren adds the "children" edges to the Menu entity.

func (mc *MenuCreate) Mutation() *MenuMutation

Mutation returns the MenuMutation object of the builder.

func (mc *MenuCreate) Save(ctx context.Context) (*Menu, error)

Save creates the Menu in the database.

func (mc *MenuCreate) SaveX(ctx context.Context) *Menu

SaveX calls Save and panics if Save returns an error.

func (mc *MenuCreate) SetCreatedAt(t time.Time) *MenuCreate

SetCreatedAt sets the "created_at" field.

func (mc *MenuCreate) SetNillableCreatedAt(t *time.Time) *MenuCreate

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

func (mc *MenuCreate) SetNillableParentID(id *int) *MenuCreate

SetNillableParentID sets the "parent" edge to the Menu entity by ID if the given value is not nil.

func (mc *MenuCreate) SetNillableUpdatedAt(t *time.Time) *MenuCreate

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

func (mc *MenuCreate) SetParent(m *Menu) *MenuCreate

SetParent sets the "parent" edge to the Menu entity.

func (mc *MenuCreate) SetParentID(id int) *MenuCreate

SetParentID sets the "parent" edge to the Menu entity by ID.

func (mc *MenuCreate) SetTitle(s string) *MenuCreate

SetTitle sets the "title" field.

func (mc *MenuCreate) SetURL(s string) *MenuCreate

SetURL sets the "url" field.

func (mc *MenuCreate) SetUpdatedAt(t time.Time) *MenuCreate

SetUpdatedAt sets the "updated_at" field.

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

MenuCreateBulk is the builder for creating many Menu entities in bulk.

func (mcb *MenuCreateBulk) Save(ctx context.Context) ([]*Menu, error)

Save creates the Menu entities in the database.

func (mcb *MenuCreateBulk) SaveX(ctx context.Context) []*Menu

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

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

MenuDelete is the builder for deleting a Menu entity.

func (md *MenuDelete) Exec(ctx context.Context) (int, error)

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

func (md *MenuDelete) ExecX(ctx context.Context) int

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

func (md *MenuDelete) Where(ps ...predicate.Menu) *MenuDelete

Where adds a new predicate to the MenuDelete builder.

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

MenuDeleteOne is the builder for deleting a single Menu entity.

func (mdo *MenuDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (mdo *MenuDeleteOne) ExecX(ctx context.Context)

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

type MenuEdges struct {
	// Parent holds the value of the parent edge.
	Parent *Menu `json:"parent,omitempty"`
	// Children holds the value of the children edge.
	Children []*Menu `json:"children,omitempty"`
	// contains filtered or unexported fields
}

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

func (e MenuEdges) ChildrenOrErr() ([]*Menu, error)

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

func (e MenuEdges) ParentOrErr() (*Menu, error)

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

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

MenuGroupBy is the group-by builder for Menu entities.

func (mgb *MenuGroupBy) Aggregate(fns ...AggregateFunc) *MenuGroupBy

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

func (mgb *MenuGroupBy) Bool(ctx context.Context) (_ bool, err error)

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

func (mgb *MenuGroupBy) BoolX(ctx context.Context) bool

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

func (mgb *MenuGroupBy) Bools(ctx context.Context) ([]bool, error)

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

func (mgb *MenuGroupBy) BoolsX(ctx context.Context) []bool

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

func (mgb *MenuGroupBy) Float64(ctx context.Context) (_ float64, err error)

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

func (mgb *MenuGroupBy) Float64X(ctx context.Context) float64

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

func (mgb *MenuGroupBy) Float64s(ctx context.Context) ([]float64, error)

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

func (mgb *MenuGroupBy) Float64sX(ctx context.Context) []float64

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

func (mgb *MenuGroupBy) Int(ctx context.Context) (_ int, err error)

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

func (mgb *MenuGroupBy) IntX(ctx context.Context) int

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

func (mgb *MenuGroupBy) Ints(ctx context.Context) ([]int, error)

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

func (mgb *MenuGroupBy) IntsX(ctx context.Context) []int

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

func (mgb *MenuGroupBy) Scan(ctx context.Context, v interface{}) error

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

func (mgb *MenuGroupBy) ScanX(ctx context.Context, v interface{})

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

func (mgb *MenuGroupBy) String(ctx context.Context) (_ string, err error)

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

func (mgb *MenuGroupBy) StringX(ctx context.Context) string

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

func (mgb *MenuGroupBy) Strings(ctx context.Context) ([]string, error)

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

func (mgb *MenuGroupBy) StringsX(ctx context.Context) []string

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

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

MenuMutation represents an operation that mutates the Menu nodes in the graph.

func (m *MenuMutation) AddChildIDs(ids ...int)

AddChildIDs adds the "children" edge to the Menu entity by ids.

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

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

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

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

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

AddedField returns the numeric value that was incremented/decremented on a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

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

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

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

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

func (m *MenuMutation) ChildrenCleared() bool

ChildrenCleared reports if the "children" edge to the Menu entity was cleared.

func (m *MenuMutation) ChildrenIDs() (ids []int)

ChildrenIDs returns the "children" edge IDs in the mutation.

func (m *MenuMutation) ClearChildren()

ClearChildren clears the "children" edge to the Menu entity.

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

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

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

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

func (m *MenuMutation) ClearParent()

ClearParent clears the "parent" edge to the Menu entity.

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

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

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

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

func (m MenuMutation) 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 (m *MenuMutation) CreatedAt() (r time.Time, exists bool)

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

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

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

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

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

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

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

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

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

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

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

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

OldCreatedAt returns the old "created_at" field's value of the Menu entity. If the Menu object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

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

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

func (m *MenuMutation) OldTitle(ctx context.Context) (v string, err error)

OldTitle returns the old "title" field's value of the Menu entity. If the Menu object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (m *MenuMutation) OldURL(ctx context.Context) (v string, err error)

OldURL returns the old "url" field's value of the Menu entity. If the Menu object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

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

OldUpdatedAt returns the old "updated_at" field's value of the Menu entity. If the Menu object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (m *MenuMutation) Op() Op

Op returns the operation name.

func (m *MenuMutation) ParentCleared() bool

ParentCleared reports if the "parent" edge to the Menu entity was cleared.

func (m *MenuMutation) ParentID() (id int, exists bool)

ParentID returns the "parent" edge ID in the mutation.

func (m *MenuMutation) ParentIDs() (ids []int)

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

func (m *MenuMutation) RemoveChildIDs(ids ...int)

RemoveChildIDs removes the "children" edge to the Menu entity by IDs.

func (m *MenuMutation) RemovedChildrenIDs() (ids []int)

RemovedChildren returns the removed IDs of the "children" edge to the Menu entity.

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

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

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

RemovedIDs returns all IDs (to other nodes) that were removed for the edge with the given name in this mutation.

func (m *MenuMutation) ResetChildren()

ResetChildren resets all changes to the "children" edge.

func (m *MenuMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

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

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

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

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

func (m *MenuMutation) ResetParent()

ResetParent resets all changes to the "parent" edge.

func (m *MenuMutation) ResetTitle()

ResetTitle resets all changes to the "title" field.

func (m *MenuMutation) ResetURL()

ResetURL resets all changes to the "url" field.

func (m *MenuMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

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

SetCreatedAt sets the "created_at" field.

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

SetField sets the value of a field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (m *MenuMutation) SetParentID(id int)

SetParentID sets the "parent" edge to the Menu entity by id.

func (m *MenuMutation) SetTitle(s string)

SetTitle sets the "title" field.

func (m *MenuMutation) SetURL(s string)

SetURL sets the "url" field.

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

SetUpdatedAt sets the "updated_at" field.

func (m *MenuMutation) Title() (r string, exists bool)

Title returns the value of the "title" field in the mutation.

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

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

func (m *MenuMutation) Type() string

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

func (m *MenuMutation) URL() (r string, exists bool)

URL returns the value of the "url" field in the mutation.

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

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

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

MenuQuery is the builder for querying Menu entities.

func (mq *MenuQuery) All(ctx context.Context) ([]*Menu, error)

All executes the query and returns a list of Menus.

func (mq *MenuQuery) AllX(ctx context.Context) []*Menu

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

func (mq *MenuQuery) Clone() *MenuQuery

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

func (mq *MenuQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (mq *MenuQuery) CountX(ctx context.Context) int

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

func (mq *MenuQuery) Exist(ctx context.Context) (bool, error)

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

func (mq *MenuQuery) ExistX(ctx context.Context) bool

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

func (mq *MenuQuery) First(ctx context.Context) (*Menu, error)

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

func (mq *MenuQuery) FirstID(ctx context.Context) (id int, err error)

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

func (mq *MenuQuery) FirstIDX(ctx context.Context) int

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

func (mq *MenuQuery) FirstX(ctx context.Context) *Menu

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

func (mq *MenuQuery) GroupBy(field string, fields ...string) *MenuGroupBy

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

Example:

var v []struct {
	Title string `json:"title,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Menu.Query().
	GroupBy(menu.FieldTitle).
	Aggregate(model.Count()).
	Scan(ctx, &v)
func (mq *MenuQuery) IDs(ctx context.Context) ([]int, error)

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

func (mq *MenuQuery) IDsX(ctx context.Context) []int

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

func (mq *MenuQuery) Limit(limit int) *MenuQuery

Limit adds a limit step to the query.

func (mq *MenuQuery) Offset(offset int) *MenuQuery

Offset adds an offset step to the query.

func (mq *MenuQuery) Only(ctx context.Context) (*Menu, error)

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

func (mq *MenuQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (mq *MenuQuery) OnlyIDX(ctx context.Context) int

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

func (mq *MenuQuery) OnlyX(ctx context.Context) *Menu

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

func (mq *MenuQuery) Order(o ...OrderFunc) *MenuQuery

Order adds an order step to the query.

func (mq *MenuQuery) QueryChildren() *MenuQuery

QueryChildren chains the current query on the "children" edge.

func (mq *MenuQuery) QueryParent() *MenuQuery

QueryParent chains the current query on the "parent" edge.

func (mq *MenuQuery) Select(field string, fields ...string) *MenuSelect

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

Example:

var v []struct {
	Title string `json:"title,omitempty"`
}

client.Menu.Query().
	Select(menu.FieldTitle).
	Scan(ctx, &v)
func (mq *MenuQuery) Unique(unique bool) *MenuQuery

Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.

func (mq *MenuQuery) Where(ps ...predicate.Menu) *MenuQuery

Where adds a new predicate for the MenuQuery builder.

func (mq *MenuQuery) WithChildren(opts ...func(*MenuQuery)) *MenuQuery

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

func (mq *MenuQuery) WithParent(opts ...func(*MenuQuery)) *MenuQuery

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

type MenuSelect struct {
	*MenuQuery
	// contains filtered or unexported fields
}

MenuSelect is the builder for selecting fields of Menu entities.

func (ms *MenuSelect) Bool(ctx context.Context) (_ bool, err error)

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

func (ms *MenuSelect) BoolX(ctx context.Context) bool

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

func (ms *MenuSelect) Bools(ctx context.Context) ([]bool, error)

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

func (ms *MenuSelect) BoolsX(ctx context.Context) []bool

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

func (ms *MenuSelect) Float64(ctx context.Context) (_ float64, err error)

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

func (ms *MenuSelect) Float64X(ctx context.Context) float64

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

func (ms *MenuSelect) Float64s(ctx context.Context) ([]float64, error)

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

func (ms *MenuSelect) Float64sX(ctx context.Context) []float64

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

func (ms *MenuSelect) Int(ctx context.Context) (_ int, err error)

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

func (ms *MenuSelect) IntX(ctx context.Context) int

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

func (ms *MenuSelect) Ints(ctx context.Context) ([]int, error)

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

func (ms *MenuSelect) IntsX(ctx context.Context) []int

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

func (ms *MenuSelect) Scan(ctx context.Context, v interface{}) error

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

func (ms *MenuSelect) ScanX(ctx context.Context, v interface{})

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

func (ms *MenuSelect) String(ctx context.Context) (_ string, err error)

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

func (ms *MenuSelect) StringX(ctx context.Context) string

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

func (ms *MenuSelect) Strings(ctx context.Context) ([]string, error)

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

func (ms *MenuSelect) StringsX(ctx context.Context) []string

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

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

MenuUpdate is the builder for updating Menu entities.

func (mu *MenuUpdate) AddChildIDs(ids ...int) *MenuUpdate

AddChildIDs adds the "children" edge to the Menu entity by IDs.

func (mu *MenuUpdate) AddChildren(m ...*Menu) *MenuUpdate

AddChildren adds the "children" edges to the Menu entity.

func (mu *MenuUpdate) ClearChildren() *MenuUpdate

ClearChildren clears all "children" edges to the Menu entity.

func (mu *MenuUpdate) ClearParent() *MenuUpdate

ClearParent clears the "parent" edge to the Menu entity.

func (mu *MenuUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (mu *MenuUpdate) ExecX(ctx context.Context)

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

func (mu *MenuUpdate) Mutation() *MenuMutation

Mutation returns the MenuMutation object of the builder.

func (mu *MenuUpdate) RemoveChildIDs(ids ...int) *MenuUpdate

RemoveChildIDs removes the "children" edge to Menu entities by IDs.

func (mu *MenuUpdate) RemoveChildren(m ...*Menu) *MenuUpdate

RemoveChildren removes "children" edges to Menu entities.

func (mu *MenuUpdate) Save(ctx context.Context) (int, error)

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

func (mu *MenuUpdate) SaveX(ctx context.Context) int

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

func (mu *MenuUpdate) SetCreatedAt(t time.Time) *MenuUpdate

SetCreatedAt sets the "created_at" field.

func (mu *MenuUpdate) SetNillableCreatedAt(t *time.Time) *MenuUpdate

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

func (mu *MenuUpdate) SetNillableParentID(id *int) *MenuUpdate

SetNillableParentID sets the "parent" edge to the Menu entity by ID if the given value is not nil.

func (mu *MenuUpdate) SetParent(m *Menu) *MenuUpdate

SetParent sets the "parent" edge to the Menu entity.

func (mu *MenuUpdate) SetParentID(id int) *MenuUpdate

SetParentID sets the "parent" edge to the Menu entity by ID.

func (mu *MenuUpdate) SetTitle(s string) *MenuUpdate

SetTitle sets the "title" field.

func (mu *MenuUpdate) SetURL(s string) *MenuUpdate

SetURL sets the "url" field.

func (mu *MenuUpdate) SetUpdatedAt(t time.Time) *MenuUpdate

SetUpdatedAt sets the "updated_at" field.

func (mu *MenuUpdate) Where(ps ...predicate.Menu) *MenuUpdate

Where adds a new predicate for the MenuUpdate builder.

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

MenuUpdateOne is the builder for updating a single Menu entity.

func (muo *MenuUpdateOne) AddChildIDs(ids ...int) *MenuUpdateOne

AddChildIDs adds the "children" edge to the Menu entity by IDs.

func (muo *MenuUpdateOne) AddChildren(m ...*Menu) *MenuUpdateOne

AddChildren adds the "children" edges to the Menu entity.

func (muo *MenuUpdateOne) ClearChildren() *MenuUpdateOne

ClearChildren clears all "children" edges to the Menu entity.

func (muo *MenuUpdateOne) ClearParent() *MenuUpdateOne

ClearParent clears the "parent" edge to the Menu entity.

func (muo *MenuUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (muo *MenuUpdateOne) ExecX(ctx context.Context)

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

func (muo *MenuUpdateOne) Mutation() *MenuMutation

Mutation returns the MenuMutation object of the builder.

func (muo *MenuUpdateOne) RemoveChildIDs(ids ...int) *MenuUpdateOne

RemoveChildIDs removes the "children" edge to Menu entities by IDs.

func (muo *MenuUpdateOne) RemoveChildren(m ...*Menu) *MenuUpdateOne

RemoveChildren removes "children" edges to Menu entities.

func (muo *MenuUpdateOne) Save(ctx context.Context) (*Menu, error)

Save executes the query and returns the updated Menu entity.

func (muo *MenuUpdateOne) SaveX(ctx context.Context) *Menu

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

func (muo *MenuUpdateOne) Select(field string, fields ...string) *MenuUpdateOne

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

func (muo *MenuUpdateOne) SetCreatedAt(t time.Time) *MenuUpdateOne

SetCreatedAt sets the "created_at" field.

func (muo *MenuUpdateOne) SetNillableCreatedAt(t *time.Time) *MenuUpdateOne

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

func (muo *MenuUpdateOne) SetNillableParentID(id *int) *MenuUpdateOne

SetNillableParentID sets the "parent" edge to the Menu entity by ID if the given value is not nil.

func (muo *MenuUpdateOne) SetParent(m *Menu) *MenuUpdateOne

SetParent sets the "parent" edge to the Menu entity.

func (muo *MenuUpdateOne) SetParentID(id int) *MenuUpdateOne

SetParentID sets the "parent" edge to the Menu entity by ID.

func (muo *MenuUpdateOne) SetTitle(s string) *MenuUpdateOne

SetTitle sets the "title" field.

func (muo *MenuUpdateOne) SetURL(s string) *MenuUpdateOne

SetURL sets the "url" field.

func (muo *MenuUpdateOne) SetUpdatedAt(t time.Time) *MenuUpdateOne

SetUpdatedAt sets the "updated_at" field.

type Menus []*Menu

Menus is a parsable slice of Menu.

type MutateFunc

type MutateFunc = ent.MutateFunc

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

type Mutation

type Mutation = ent.Mutation

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

type Mutator

type Mutator = ent.Mutator

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

type NotFoundError

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

NotFoundError returns when trying to fetch a specific entity and it was not found in the database.

func (*NotFoundError) Error

func (e *NotFoundError) Error() string

Error implements the error interface.

type NotLoadedError

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

NotLoadedError returns when trying to get a node that was not loaded by the query.

func (*NotLoadedError) Error

func (e *NotLoadedError) Error() string

Error implements the error interface.

type NotSingularError

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

NotSingularError returns when trying to fetch a singular entity and more then one was found in the database.

func (*NotSingularError) Error

func (e *NotSingularError) Error() string

Error implements the error interface.

type Op

type Op = ent.Op

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

type Option

type Option func(*config)

Option function to configure the client.

func Debug

func Debug() Option

Debug enables debug logging on the ent.Driver.

func Driver

func Driver(driver dialect.Driver) Option

Driver configures the client driver.

func Log

func Log(fn func(...interface{})) Option

Log sets the logging function for debug mode.

type OrderFunc

type OrderFunc func(*sql.Selector)

OrderFunc applies an ordering on the sql selector.

func Asc

func Asc(fields ...string) OrderFunc

Asc applies the given fields in ASC order.

func Desc

func Desc(fields ...string) OrderFunc

Desc applies the given fields in DESC order.

type Policy

type Policy = ent.Policy

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

type Query

type Query = ent.Query

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

type RollbackFunc

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

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

func (RollbackFunc) Rollback

func (f RollbackFunc) Rollback(ctx context.Context, tx *Tx) error

Rollback calls f(ctx, m).

type RollbackHook

type RollbackHook func(Rollbacker) Rollbacker

RollbackHook defines the "rollback middleware". A function that gets a Rollbacker and returns a Rollbacker. For example:

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

type Rollbacker

type Rollbacker interface {
	Rollback(context.Context, *Tx) error
}

Rollbacker is the interface that wraps the Rollbacker method.

type Share

type Share struct {

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

Share is the model entity for the Share schema.

func (*Share) QueryCreator

func (s *Share) QueryCreator() *UserQuery

QueryCreator queries the "creator" edge of the Share entity.

func (*Share) QueryView

func (s *Share) QueryView() *ViewQuery

QueryView queries the "view" edge of the Share entity.

func (*Share) String

func (s *Share) String() string

String implements the fmt.Stringer.

func (*Share) Unwrap

func (s *Share) Unwrap() *Share

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

func (*Share) Update

func (s *Share) Update() *ShareUpdateOne

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

type ShareApi

type ShareApi struct {
	*Api
	Filter             ShareApiFilter
	SkipCreateAutoEdge bool
	SkipUpdateAutoEdge bool
}

func NewShareApi

func NewShareApi(client *Client, opt *ApiOption) *ShareApi

func (*ShareApi) Create

func (c *ShareApi) Create(help *contact.GinHelp)

func (*ShareApi) Delete

func (c *ShareApi) Delete(help *contact.GinHelp)

func (*ShareApi) Get

func (c *ShareApi) Get(help *contact.GinHelp)

func (*ShareApi) List

func (c *ShareApi) List(help *contact.GinHelp)

func (*ShareApi) Update

func (c *ShareApi) Update(help *contact.GinHelp)

type ShareApiFilter

type ShareApiFilter struct {
	CreatePipe   func(help *contact.GinHelp, createPipe *ShareCreate, edges ShareEdges)
	CreateAfter  func(help *contact.GinHelp, item *Share, edges ShareEdges)
	UpdatePipe   func(help *contact.GinHelp, old *Share, updatePipe *ShareUpdateOne, edges ShareEdges)
	UpdateAfter  func(help *contact.GinHelp, old *Share, item *Share, edges ShareEdges)
	ListPipe     func(help *contact.GinHelp, listPipe *ShareQuery)
	ListData     func(help *contact.GinHelp, items []*Share) interface{}
	DeleteBefore func(help *contact.GinHelp, item *Share)
	GetPipe      func(help *contact.GinHelp, getPipe *ShareQuery)
	GetData      func(help *contact.GinHelp, item *Share) *Share
}

type ShareClient

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

ShareClient is a client for the Share schema.

func NewShareClient

func NewShareClient(c config) *ShareClient

NewShareClient returns a client for the Share from the given config.

func (*ShareClient) Create

func (c *ShareClient) Create() *ShareCreate

Create returns a create builder for Share.

func (*ShareClient) CreateBulk

func (c *ShareClient) CreateBulk(builders ...*ShareCreate) *ShareCreateBulk

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

func (*ShareClient) Delete

func (c *ShareClient) Delete() *ShareDelete

Delete returns a delete builder for Share.

func (*ShareClient) DeleteOne

func (c *ShareClient) DeleteOne(s *Share) *ShareDeleteOne

DeleteOne returns a delete builder for the given entity.

func (*ShareClient) DeleteOneID

func (c *ShareClient) DeleteOneID(id int) *ShareDeleteOne

DeleteOneID returns a delete builder for the given id.

func (*ShareClient) Get

func (c *ShareClient) Get(ctx context.Context, id int) (*Share, error)

Get returns a Share entity by its id.

func (*ShareClient) GetX

func (c *ShareClient) GetX(ctx context.Context, id int) *Share

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

func (*ShareClient) Hooks

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

Hooks returns the client hooks.

func (*ShareClient) Query

func (c *ShareClient) Query() *ShareQuery

Query returns a query builder for Share.

func (*ShareClient) QueryCreator

func (c *ShareClient) QueryCreator(s *Share) *UserQuery

QueryCreator queries the creator edge of a Share.

func (*ShareClient) QueryView

func (c *ShareClient) QueryView(s *Share) *ViewQuery

QueryView queries the view edge of a Share.

func (*ShareClient) Update

func (c *ShareClient) Update() *ShareUpdate

Update returns an update builder for Share.

func (*ShareClient) UpdateOne

func (c *ShareClient) UpdateOne(s *Share) *ShareUpdateOne

UpdateOne returns an update builder for the given entity.

func (*ShareClient) UpdateOneID

func (c *ShareClient) UpdateOneID(id int) *ShareUpdateOne

UpdateOneID returns an update builder for the given id.

func (*ShareClient) Use

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

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

type ShareCreate

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

ShareCreate is the builder for creating a Share entity.

func (*ShareCreate) Mutation

func (sc *ShareCreate) Mutation() *ShareMutation

Mutation returns the ShareMutation object of the builder.

func (*ShareCreate) Save

func (sc *ShareCreate) Save(ctx context.Context) (*Share, error)

Save creates the Share in the database.

func (*ShareCreate) SaveX

func (sc *ShareCreate) SaveX(ctx context.Context) *Share

SaveX calls Save and panics if Save returns an error.

func (*ShareCreate) SetCreator

func (sc *ShareCreate) SetCreator(u *User) *ShareCreate

SetCreator sets the "creator" edge to the User entity.

func (*ShareCreate) SetCreatorID

func (sc *ShareCreate) SetCreatorID(id int) *ShareCreate

SetCreatorID sets the "creator" edge to the User entity by ID.

func (*ShareCreate) SetEndAt

func (sc *ShareCreate) SetEndAt(t time.Time) *ShareCreate

SetEndAt sets the "end_at" field.

func (*ShareCreate) SetNillableCreatorID

func (sc *ShareCreate) SetNillableCreatorID(id *int) *ShareCreate

SetNillableCreatorID sets the "creator" edge to the User entity by ID if the given value is not nil.

func (*ShareCreate) SetNillableViewID

func (sc *ShareCreate) SetNillableViewID(id *int) *ShareCreate

SetNillableViewID sets the "view" edge to the View entity by ID if the given value is not nil.

func (*ShareCreate) SetView

func (sc *ShareCreate) SetView(v *View) *ShareCreate

SetView sets the "view" edge to the View entity.

func (*ShareCreate) SetViewID

func (sc *ShareCreate) SetViewID(id int) *ShareCreate

SetViewID sets the "view" edge to the View entity by ID.

type ShareCreateBulk

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

ShareCreateBulk is the builder for creating many Share entities in bulk.

func (*ShareCreateBulk) Save

func (scb *ShareCreateBulk) Save(ctx context.Context) ([]*Share, error)

Save creates the Share entities in the database.

func (*ShareCreateBulk) SaveX

func (scb *ShareCreateBulk) SaveX(ctx context.Context) []*Share

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

type ShareDelete

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

ShareDelete is the builder for deleting a Share entity.

func (*ShareDelete) Exec

func (sd *ShareDelete) Exec(ctx context.Context) (int, error)

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

func (*ShareDelete) ExecX

func (sd *ShareDelete) ExecX(ctx context.Context) int

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

func (*ShareDelete) Where

func (sd *ShareDelete) Where(ps ...predicate.Share) *ShareDelete

Where adds a new predicate to the ShareDelete builder.

type ShareDeleteOne

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

ShareDeleteOne is the builder for deleting a single Share entity.

func (*ShareDeleteOne) Exec

func (sdo *ShareDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*ShareDeleteOne) ExecX

func (sdo *ShareDeleteOne) ExecX(ctx context.Context)

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

type ShareEdges

type ShareEdges struct {
	// View holds the value of the view edge.
	View *View `json:"view,omitempty"`
	// Creator holds the value of the creator edge.
	Creator *User `json:"creator,omitempty"`
	// contains filtered or unexported fields
}

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

func (ShareEdges) CreatorOrErr

func (e ShareEdges) CreatorOrErr() (*User, error)

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

func (ShareEdges) ViewOrErr

func (e ShareEdges) ViewOrErr() (*View, error)

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

type ShareGroupBy

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

ShareGroupBy is the group-by builder for Share entities.

func (*ShareGroupBy) Aggregate

func (sgb *ShareGroupBy) Aggregate(fns ...AggregateFunc) *ShareGroupBy

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

func (*ShareGroupBy) Bool

func (sgb *ShareGroupBy) Bool(ctx context.Context) (_ bool, err error)

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

func (*ShareGroupBy) BoolX

func (sgb *ShareGroupBy) BoolX(ctx context.Context) bool

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

func (*ShareGroupBy) Bools

func (sgb *ShareGroupBy) Bools(ctx context.Context) ([]bool, error)

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

func (*ShareGroupBy) BoolsX

func (sgb *ShareGroupBy) BoolsX(ctx context.Context) []bool

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

func (*ShareGroupBy) Float64

func (sgb *ShareGroupBy) Float64(ctx context.Context) (_ float64, err error)

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

func (*ShareGroupBy) Float64X

func (sgb *ShareGroupBy) Float64X(ctx context.Context) float64

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

func (*ShareGroupBy) Float64s

func (sgb *ShareGroupBy) Float64s(ctx context.Context) ([]float64, error)

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

func (*ShareGroupBy) Float64sX

func (sgb *ShareGroupBy) Float64sX(ctx context.Context) []float64

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

func (*ShareGroupBy) Int

func (sgb *ShareGroupBy) Int(ctx context.Context) (_ int, err error)

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

func (*ShareGroupBy) IntX

func (sgb *ShareGroupBy) IntX(ctx context.Context) int

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

func (*ShareGroupBy) Ints

func (sgb *ShareGroupBy) Ints(ctx context.Context) ([]int, error)

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

func (*ShareGroupBy) IntsX

func (sgb *ShareGroupBy) IntsX(ctx context.Context) []int

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

func (*ShareGroupBy) Scan

func (sgb *ShareGroupBy) Scan(ctx context.Context, v interface{}) error

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

func (*ShareGroupBy) ScanX

func (sgb *ShareGroupBy) ScanX(ctx context.Context, v interface{})

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

func (*ShareGroupBy) String

func (sgb *ShareGroupBy) String(ctx context.Context) (_ string, err error)

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

func (*ShareGroupBy) StringX

func (sgb *ShareGroupBy) StringX(ctx context.Context) string

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

func (*ShareGroupBy) Strings

func (sgb *ShareGroupBy) Strings(ctx context.Context) ([]string, error)

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

func (*ShareGroupBy) StringsX

func (sgb *ShareGroupBy) StringsX(ctx context.Context) []string

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

type ShareMutation

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

ShareMutation represents an operation that mutates the Share nodes in the graph.

func (*ShareMutation) AddField

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

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

func (*ShareMutation) AddedEdges

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

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

func (*ShareMutation) AddedField

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

AddedField returns the numeric value that was incremented/decremented on a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*ShareMutation) AddedFields

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

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

func (*ShareMutation) AddedIDs

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

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

func (*ShareMutation) ClearCreator

func (m *ShareMutation) ClearCreator()

ClearCreator clears the "creator" edge to the User entity.

func (*ShareMutation) ClearEdge

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

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

func (*ShareMutation) ClearField

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

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

func (*ShareMutation) ClearView

func (m *ShareMutation) ClearView()

ClearView clears the "view" edge to the View entity.

func (*ShareMutation) ClearedEdges

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

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

func (*ShareMutation) ClearedFields

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

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

func (ShareMutation) Client

func (m ShareMutation) 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 (*ShareMutation) CreatorCleared

func (m *ShareMutation) CreatorCleared() bool

CreatorCleared reports if the "creator" edge to the User entity was cleared.

func (*ShareMutation) CreatorID

func (m *ShareMutation) CreatorID() (id int, exists bool)

CreatorID returns the "creator" edge ID in the mutation.

func (*ShareMutation) CreatorIDs

func (m *ShareMutation) CreatorIDs() (ids []int)

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

func (*ShareMutation) EdgeCleared

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

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

func (*ShareMutation) EndAt

func (m *ShareMutation) EndAt() (r time.Time, exists bool)

EndAt returns the value of the "end_at" field in the mutation.

func (*ShareMutation) Field

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

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

func (*ShareMutation) FieldCleared

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

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

func (*ShareMutation) Fields

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

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

func (*ShareMutation) ID

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

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

func (*ShareMutation) OldEndAt

func (m *ShareMutation) OldEndAt(ctx context.Context) (v time.Time, err error)

OldEndAt returns the old "end_at" field's value of the Share entity. If the Share object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*ShareMutation) OldField

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

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

func (*ShareMutation) Op

func (m *ShareMutation) Op() Op

Op returns the operation name.

func (*ShareMutation) RemovedEdges

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

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

func (*ShareMutation) RemovedIDs

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

RemovedIDs returns all IDs (to other nodes) that were removed for the edge with the given name in this mutation.

func (*ShareMutation) ResetCreator

func (m *ShareMutation) ResetCreator()

ResetCreator resets all changes to the "creator" edge.

func (*ShareMutation) ResetEdge

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

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

func (*ShareMutation) ResetEndAt

func (m *ShareMutation) ResetEndAt()

ResetEndAt resets all changes to the "end_at" field.

func (*ShareMutation) ResetField

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

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

func (*ShareMutation) ResetView

func (m *ShareMutation) ResetView()

ResetView resets all changes to the "view" edge.

func (*ShareMutation) SetCreatorID

func (m *ShareMutation) SetCreatorID(id int)

SetCreatorID sets the "creator" edge to the User entity by id.

func (*ShareMutation) SetEndAt

func (m *ShareMutation) SetEndAt(t time.Time)

SetEndAt sets the "end_at" field.

func (*ShareMutation) SetField

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

SetField sets the value of a field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*ShareMutation) SetViewID

func (m *ShareMutation) SetViewID(id int)

SetViewID sets the "view" edge to the View entity by id.

func (ShareMutation) Tx

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

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

func (*ShareMutation) Type

func (m *ShareMutation) Type() string

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

func (*ShareMutation) ViewCleared

func (m *ShareMutation) ViewCleared() bool

ViewCleared reports if the "view" edge to the View entity was cleared.

func (*ShareMutation) ViewID

func (m *ShareMutation) ViewID() (id int, exists bool)

ViewID returns the "view" edge ID in the mutation.

func (*ShareMutation) ViewIDs

func (m *ShareMutation) ViewIDs() (ids []int)

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

type ShareQuery

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

ShareQuery is the builder for querying Share entities.

func (*ShareQuery) All

func (sq *ShareQuery) All(ctx context.Context) ([]*Share, error)

All executes the query and returns a list of Shares.

func (*ShareQuery) AllX

func (sq *ShareQuery) AllX(ctx context.Context) []*Share

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

func (*ShareQuery) Clone

func (sq *ShareQuery) Clone() *ShareQuery

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

func (*ShareQuery) Count

func (sq *ShareQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*ShareQuery) CountX

func (sq *ShareQuery) CountX(ctx context.Context) int

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

func (*ShareQuery) Exist

func (sq *ShareQuery) Exist(ctx context.Context) (bool, error)

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

func (*ShareQuery) ExistX

func (sq *ShareQuery) ExistX(ctx context.Context) bool

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

func (*ShareQuery) First

func (sq *ShareQuery) First(ctx context.Context) (*Share, error)

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

func (*ShareQuery) FirstID

func (sq *ShareQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*ShareQuery) FirstIDX

func (sq *ShareQuery) FirstIDX(ctx context.Context) int

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

func (*ShareQuery) FirstX

func (sq *ShareQuery) FirstX(ctx context.Context) *Share

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

func (*ShareQuery) GroupBy

func (sq *ShareQuery) GroupBy(field string, fields ...string) *ShareGroupBy

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

Example:

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

client.Share.Query().
	GroupBy(share.FieldEndAt).
	Aggregate(model.Count()).
	Scan(ctx, &v)

func (*ShareQuery) IDs

func (sq *ShareQuery) IDs(ctx context.Context) ([]int, error)

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

func (*ShareQuery) IDsX

func (sq *ShareQuery) IDsX(ctx context.Context) []int

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

func (*ShareQuery) Limit

func (sq *ShareQuery) Limit(limit int) *ShareQuery

Limit adds a limit step to the query.

func (*ShareQuery) Offset

func (sq *ShareQuery) Offset(offset int) *ShareQuery

Offset adds an offset step to the query.

func (*ShareQuery) Only

func (sq *ShareQuery) Only(ctx context.Context) (*Share, error)

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

func (*ShareQuery) OnlyID

func (sq *ShareQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*ShareQuery) OnlyIDX

func (sq *ShareQuery) OnlyIDX(ctx context.Context) int

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

func (*ShareQuery) OnlyX

func (sq *ShareQuery) OnlyX(ctx context.Context) *Share

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

func (*ShareQuery) Order

func (sq *ShareQuery) Order(o ...OrderFunc) *ShareQuery

Order adds an order step to the query.

func (*ShareQuery) QueryCreator

func (sq *ShareQuery) QueryCreator() *UserQuery

QueryCreator chains the current query on the "creator" edge.

func (*ShareQuery) QueryView

func (sq *ShareQuery) QueryView() *ViewQuery

QueryView chains the current query on the "view" edge.

func (*ShareQuery) Select

func (sq *ShareQuery) Select(field string, fields ...string) *ShareSelect

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

Example:

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

client.Share.Query().
	Select(share.FieldEndAt).
	Scan(ctx, &v)

func (*ShareQuery) Unique

func (sq *ShareQuery) Unique(unique bool) *ShareQuery

Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.

func (*ShareQuery) Where

func (sq *ShareQuery) Where(ps ...predicate.Share) *ShareQuery

Where adds a new predicate for the ShareQuery builder.

func (*ShareQuery) WithCreator

func (sq *ShareQuery) WithCreator(opts ...func(*UserQuery)) *ShareQuery

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

func (*ShareQuery) WithView

func (sq *ShareQuery) WithView(opts ...func(*ViewQuery)) *ShareQuery

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

type ShareSelect

type ShareSelect struct {
	*ShareQuery
	// contains filtered or unexported fields
}

ShareSelect is the builder for selecting fields of Share entities.

func (*ShareSelect) Bool

func (ss *ShareSelect) Bool(ctx context.Context) (_ bool, err error)

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

func (*ShareSelect) BoolX

func (ss *ShareSelect) BoolX(ctx context.Context) bool

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

func (*ShareSelect) Bools

func (ss *ShareSelect) Bools(ctx context.Context) ([]bool, error)

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

func (*ShareSelect) BoolsX

func (ss *ShareSelect) BoolsX(ctx context.Context) []bool

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

func (*ShareSelect) Float64

func (ss *ShareSelect) Float64(ctx context.Context) (_ float64, err error)

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

func (*ShareSelect) Float64X

func (ss *ShareSelect) Float64X(ctx context.Context) float64

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

func (*ShareSelect) Float64s

func (ss *ShareSelect) Float64s(ctx context.Context) ([]float64, error)

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

func (*ShareSelect) Float64sX

func (ss *ShareSelect) Float64sX(ctx context.Context) []float64

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

func (*ShareSelect) Int

func (ss *ShareSelect) Int(ctx context.Context) (_ int, err error)

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

func (*ShareSelect) IntX

func (ss *ShareSelect) IntX(ctx context.Context) int

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

func (*ShareSelect) Ints

func (ss *ShareSelect) Ints(ctx context.Context) ([]int, error)

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

func (*ShareSelect) IntsX

func (ss *ShareSelect) IntsX(ctx context.Context) []int

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

func (*ShareSelect) Scan

func (ss *ShareSelect) Scan(ctx context.Context, v interface{}) error

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

func (*ShareSelect) ScanX

func (ss *ShareSelect) ScanX(ctx context.Context, v interface{})

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

func (*ShareSelect) String

func (ss *ShareSelect) String(ctx context.Context) (_ string, err error)

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

func (*ShareSelect) StringX

func (ss *ShareSelect) StringX(ctx context.Context) string

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

func (*ShareSelect) Strings

func (ss *ShareSelect) Strings(ctx context.Context) ([]string, error)

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

func (*ShareSelect) StringsX

func (ss *ShareSelect) StringsX(ctx context.Context) []string

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

type ShareUpdate

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

ShareUpdate is the builder for updating Share entities.

func (*ShareUpdate) ClearCreator

func (su *ShareUpdate) ClearCreator() *ShareUpdate

ClearCreator clears the "creator" edge to the User entity.

func (*ShareUpdate) ClearView

func (su *ShareUpdate) ClearView() *ShareUpdate

ClearView clears the "view" edge to the View entity.

func (*ShareUpdate) Exec

func (su *ShareUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*ShareUpdate) ExecX

func (su *ShareUpdate) ExecX(ctx context.Context)

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

func (*ShareUpdate) Mutation

func (su *ShareUpdate) Mutation() *ShareMutation

Mutation returns the ShareMutation object of the builder.

func (*ShareUpdate) Save

func (su *ShareUpdate) Save(ctx context.Context) (int, error)

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

func (*ShareUpdate) SaveX

func (su *ShareUpdate) SaveX(ctx context.Context) int

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

func (*ShareUpdate) SetCreator

func (su *ShareUpdate) SetCreator(u *User) *ShareUpdate

SetCreator sets the "creator" edge to the User entity.

func (*ShareUpdate) SetCreatorID

func (su *ShareUpdate) SetCreatorID(id int) *ShareUpdate

SetCreatorID sets the "creator" edge to the User entity by ID.

func (*ShareUpdate) SetEndAt

func (su *ShareUpdate) SetEndAt(t time.Time) *ShareUpdate

SetEndAt sets the "end_at" field.

func (*ShareUpdate) SetNillableCreatorID

func (su *ShareUpdate) SetNillableCreatorID(id *int) *ShareUpdate

SetNillableCreatorID sets the "creator" edge to the User entity by ID if the given value is not nil.

func (*ShareUpdate) SetNillableViewID

func (su *ShareUpdate) SetNillableViewID(id *int) *ShareUpdate

SetNillableViewID sets the "view" edge to the View entity by ID if the given value is not nil.

func (*ShareUpdate) SetView

func (su *ShareUpdate) SetView(v *View) *ShareUpdate

SetView sets the "view" edge to the View entity.

func (*ShareUpdate) SetViewID

func (su *ShareUpdate) SetViewID(id int) *ShareUpdate

SetViewID sets the "view" edge to the View entity by ID.

func (*ShareUpdate) Where

func (su *ShareUpdate) Where(ps ...predicate.Share) *ShareUpdate

Where adds a new predicate for the ShareUpdate builder.

type ShareUpdateOne

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

ShareUpdateOne is the builder for updating a single Share entity.

func (*ShareUpdateOne) ClearCreator

func (suo *ShareUpdateOne) ClearCreator() *ShareUpdateOne

ClearCreator clears the "creator" edge to the User entity.

func (*ShareUpdateOne) ClearView

func (suo *ShareUpdateOne) ClearView() *ShareUpdateOne

ClearView clears the "view" edge to the View entity.

func (*ShareUpdateOne) Exec

func (suo *ShareUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*ShareUpdateOne) ExecX

func (suo *ShareUpdateOne) ExecX(ctx context.Context)

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

func (*ShareUpdateOne) Mutation

func (suo *ShareUpdateOne) Mutation() *ShareMutation

Mutation returns the ShareMutation object of the builder.

func (*ShareUpdateOne) Save

func (suo *ShareUpdateOne) Save(ctx context.Context) (*Share, error)

Save executes the query and returns the updated Share entity.

func (*ShareUpdateOne) SaveX

func (suo *ShareUpdateOne) SaveX(ctx context.Context) *Share

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

func (*ShareUpdateOne) Select

func (suo *ShareUpdateOne) Select(field string, fields ...string) *ShareUpdateOne

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

func (*ShareUpdateOne) SetCreator

func (suo *ShareUpdateOne) SetCreator(u *User) *ShareUpdateOne

SetCreator sets the "creator" edge to the User entity.

func (*ShareUpdateOne) SetCreatorID

func (suo *ShareUpdateOne) SetCreatorID(id int) *ShareUpdateOne

SetCreatorID sets the "creator" edge to the User entity by ID.

func (*ShareUpdateOne) SetEndAt

func (suo *ShareUpdateOne) SetEndAt(t time.Time) *ShareUpdateOne

SetEndAt sets the "end_at" field.

func (*ShareUpdateOne) SetNillableCreatorID

func (suo *ShareUpdateOne) SetNillableCreatorID(id *int) *ShareUpdateOne

SetNillableCreatorID sets the "creator" edge to the User entity by ID if the given value is not nil.

func (*ShareUpdateOne) SetNillableViewID

func (suo *ShareUpdateOne) SetNillableViewID(id *int) *ShareUpdateOne

SetNillableViewID sets the "view" edge to the View entity by ID if the given value is not nil.

func (*ShareUpdateOne) SetView

func (suo *ShareUpdateOne) SetView(v *View) *ShareUpdateOne

SetView sets the "view" edge to the View entity.

func (*ShareUpdateOne) SetViewID

func (suo *ShareUpdateOne) SetViewID(id int) *ShareUpdateOne

SetViewID sets the "view" edge to the View entity by ID.

type Shares

type Shares []*Share

Shares is a parsable slice of Share.

type Tx

type Tx struct {

	// Assets is the client for interacting with the Assets builders.
	Assets *AssetsClient
	// DataSet is the client for interacting with the DataSet builders.
	DataSet *DataSetClient
	// Menu is the client for interacting with the Menu builders.
	Menu *MenuClient
	// Share is the client for interacting with the Share builders.
	Share *ShareClient
	// TypeConfig is the client for interacting with the TypeConfig builders.
	TypeConfig *TypeConfigClient
	// User is the client for interacting with the User builders.
	User *UserClient
	// View is the client for interacting with the View builders.
	View *ViewClient
	// ViewBlock is the client for interacting with the ViewBlock builders.
	ViewBlock *ViewBlockClient
	// contains filtered or unexported fields
}

Tx is a transactional client that is created by calling Client.Tx().

func TxFromContext

func TxFromContext(ctx context.Context) *Tx

TxFromContext returns a Tx stored inside a context, or nil if there isn't one.

func (*Tx) Client

func (tx *Tx) Client() *Client

Client returns a Client that binds to current transaction.

func (*Tx) Commit

func (tx *Tx) Commit() error

Commit commits the transaction.

func (*Tx) OnCommit

func (tx *Tx) OnCommit(f CommitHook)

OnCommit adds a hook to call on commit.

func (*Tx) OnRollback

func (tx *Tx) OnRollback(f RollbackHook)

OnRollback adds a hook to call on rollback.

func (*Tx) Rollback

func (tx *Tx) Rollback() error

Rollback rollbacks the transaction.

type TypeConfig

type TypeConfig struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// Type holds the value of the "type" field.
	Type string `json:"type,omitempty"`
	// Title holds the value of the "title" field.
	Title string `json:"title,omitempty"`
	// Config holds the value of the "config" field.
	Config string `json:"config,omitempty"`
	// contains filtered or unexported fields
}

TypeConfig is the model entity for the TypeConfig schema.

func (*TypeConfig) String

func (tc *TypeConfig) String() string

String implements the fmt.Stringer.

func (*TypeConfig) Unwrap

func (tc *TypeConfig) Unwrap() *TypeConfig

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

func (*TypeConfig) Update

func (tc *TypeConfig) Update() *TypeConfigUpdateOne

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

type TypeConfigApi

type TypeConfigApi struct {
	*Api
	Filter             TypeConfigApiFilter
	SkipCreateAutoEdge bool
	SkipUpdateAutoEdge bool
}

func NewTypeConfigApi

func NewTypeConfigApi(client *Client, opt *ApiOption) *TypeConfigApi

func (*TypeConfigApi) Create

func (c *TypeConfigApi) Create(help *contact.GinHelp)

func (*TypeConfigApi) Delete

func (c *TypeConfigApi) Delete(help *contact.GinHelp)

func (*TypeConfigApi) Get

func (c *TypeConfigApi) Get(help *contact.GinHelp)

func (*TypeConfigApi) List

func (c *TypeConfigApi) List(help *contact.GinHelp)

func (*TypeConfigApi) Update

func (c *TypeConfigApi) Update(help *contact.GinHelp)

type TypeConfigApiFilter

type TypeConfigApiFilter struct {
	CreatePipe   func(help *contact.GinHelp, createPipe *TypeConfigCreate)
	CreateAfter  func(help *contact.GinHelp, item *TypeConfig)
	UpdatePipe   func(help *contact.GinHelp, old *TypeConfig, updatePipe *TypeConfigUpdateOne)
	UpdateAfter  func(help *contact.GinHelp, old *TypeConfig, item *TypeConfig)
	ListPipe     func(help *contact.GinHelp, listPipe *TypeConfigQuery)
	ListData     func(help *contact.GinHelp, items []*TypeConfig) interface{}
	DeleteBefore func(help *contact.GinHelp, item *TypeConfig)
	GetPipe      func(help *contact.GinHelp, getPipe *TypeConfigQuery)
	GetData      func(help *contact.GinHelp, item *TypeConfig) *TypeConfig
}

type TypeConfigClient

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

TypeConfigClient is a client for the TypeConfig schema.

func NewTypeConfigClient

func NewTypeConfigClient(c config) *TypeConfigClient

NewTypeConfigClient returns a client for the TypeConfig from the given config.

func (*TypeConfigClient) Create

func (c *TypeConfigClient) Create() *TypeConfigCreate

Create returns a create builder for TypeConfig.

func (*TypeConfigClient) CreateBulk

func (c *TypeConfigClient) CreateBulk(builders ...*TypeConfigCreate) *TypeConfigCreateBulk

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

func (*TypeConfigClient) Delete

func (c *TypeConfigClient) Delete() *TypeConfigDelete

Delete returns a delete builder for TypeConfig.

func (*TypeConfigClient) DeleteOne

func (c *TypeConfigClient) DeleteOne(tc *TypeConfig) *TypeConfigDeleteOne

DeleteOne returns a delete builder for the given entity.

func (*TypeConfigClient) DeleteOneID

func (c *TypeConfigClient) DeleteOneID(id int) *TypeConfigDeleteOne

DeleteOneID returns a delete builder for the given id.

func (*TypeConfigClient) Get

func (c *TypeConfigClient) Get(ctx context.Context, id int) (*TypeConfig, error)

Get returns a TypeConfig entity by its id.

func (*TypeConfigClient) GetX

func (c *TypeConfigClient) GetX(ctx context.Context, id int) *TypeConfig

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

func (*TypeConfigClient) Hooks

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

Hooks returns the client hooks.

func (*TypeConfigClient) Query

func (c *TypeConfigClient) Query() *TypeConfigQuery

Query returns a query builder for TypeConfig.

func (*TypeConfigClient) Update

func (c *TypeConfigClient) Update() *TypeConfigUpdate

Update returns an update builder for TypeConfig.

func (*TypeConfigClient) UpdateOne

func (c *TypeConfigClient) UpdateOne(tc *TypeConfig) *TypeConfigUpdateOne

UpdateOne returns an update builder for the given entity.

func (*TypeConfigClient) UpdateOneID

func (c *TypeConfigClient) UpdateOneID(id int) *TypeConfigUpdateOne

UpdateOneID returns an update builder for the given id.

func (*TypeConfigClient) Use

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

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

type TypeConfigCreate

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

TypeConfigCreate is the builder for creating a TypeConfig entity.

func (*TypeConfigCreate) Mutation

func (tcc *TypeConfigCreate) Mutation() *TypeConfigMutation

Mutation returns the TypeConfigMutation object of the builder.

func (*TypeConfigCreate) Save

func (tcc *TypeConfigCreate) Save(ctx context.Context) (*TypeConfig, error)

Save creates the TypeConfig in the database.

func (*TypeConfigCreate) SaveX

func (tcc *TypeConfigCreate) SaveX(ctx context.Context) *TypeConfig

SaveX calls Save and panics if Save returns an error.

func (*TypeConfigCreate) SetConfig

func (tcc *TypeConfigCreate) SetConfig(s string) *TypeConfigCreate

SetConfig sets the "config" field.

func (*TypeConfigCreate) SetID

func (tcc *TypeConfigCreate) SetID(i int) *TypeConfigCreate

SetID sets the "id" field.

func (*TypeConfigCreate) SetTitle

func (tcc *TypeConfigCreate) SetTitle(s string) *TypeConfigCreate

SetTitle sets the "title" field.

func (*TypeConfigCreate) SetType

func (tcc *TypeConfigCreate) SetType(s string) *TypeConfigCreate

SetType sets the "type" field.

type TypeConfigCreateBulk

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

TypeConfigCreateBulk is the builder for creating many TypeConfig entities in bulk.

func (*TypeConfigCreateBulk) Save

func (tccb *TypeConfigCreateBulk) Save(ctx context.Context) ([]*TypeConfig, error)

Save creates the TypeConfig entities in the database.

func (*TypeConfigCreateBulk) SaveX

func (tccb *TypeConfigCreateBulk) SaveX(ctx context.Context) []*TypeConfig

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

type TypeConfigDelete

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

TypeConfigDelete is the builder for deleting a TypeConfig entity.

func (*TypeConfigDelete) Exec

func (tcd *TypeConfigDelete) Exec(ctx context.Context) (int, error)

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

func (*TypeConfigDelete) ExecX

func (tcd *TypeConfigDelete) ExecX(ctx context.Context) int

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

func (*TypeConfigDelete) Where

Where adds a new predicate to the TypeConfigDelete builder.

type TypeConfigDeleteOne

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

TypeConfigDeleteOne is the builder for deleting a single TypeConfig entity.

func (*TypeConfigDeleteOne) Exec

func (tcdo *TypeConfigDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*TypeConfigDeleteOne) ExecX

func (tcdo *TypeConfigDeleteOne) ExecX(ctx context.Context)

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

type TypeConfigGroupBy

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

TypeConfigGroupBy is the group-by builder for TypeConfig entities.

func (*TypeConfigGroupBy) Aggregate

func (tcgb *TypeConfigGroupBy) Aggregate(fns ...AggregateFunc) *TypeConfigGroupBy

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

func (*TypeConfigGroupBy) Bool

func (tcgb *TypeConfigGroupBy) Bool(ctx context.Context) (_ bool, err error)

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

func (*TypeConfigGroupBy) BoolX

func (tcgb *TypeConfigGroupBy) BoolX(ctx context.Context) bool

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

func (*TypeConfigGroupBy) Bools

func (tcgb *TypeConfigGroupBy) Bools(ctx context.Context) ([]bool, error)

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

func (*TypeConfigGroupBy) BoolsX

func (tcgb *TypeConfigGroupBy) BoolsX(ctx context.Context) []bool

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

func (*TypeConfigGroupBy) Float64

func (tcgb *TypeConfigGroupBy) Float64(ctx context.Context) (_ float64, err error)

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

func (*TypeConfigGroupBy) Float64X

func (tcgb *TypeConfigGroupBy) Float64X(ctx context.Context) float64

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

func (*TypeConfigGroupBy) Float64s

func (tcgb *TypeConfigGroupBy) Float64s(ctx context.Context) ([]float64, error)

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

func (*TypeConfigGroupBy) Float64sX

func (tcgb *TypeConfigGroupBy) Float64sX(ctx context.Context) []float64

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

func (*TypeConfigGroupBy) Int

func (tcgb *TypeConfigGroupBy) Int(ctx context.Context) (_ int, err error)

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

func (*TypeConfigGroupBy) IntX

func (tcgb *TypeConfigGroupBy) IntX(ctx context.Context) int

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

func (*TypeConfigGroupBy) Ints

func (tcgb *TypeConfigGroupBy) Ints(ctx context.Context) ([]int, error)

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

func (*TypeConfigGroupBy) IntsX

func (tcgb *TypeConfigGroupBy) IntsX(ctx context.Context) []int

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

func (*TypeConfigGroupBy) Scan

func (tcgb *TypeConfigGroupBy) Scan(ctx context.Context, v interface{}) error

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

func (*TypeConfigGroupBy) ScanX

func (tcgb *TypeConfigGroupBy) ScanX(ctx context.Context, v interface{})

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

func (*TypeConfigGroupBy) String

func (tcgb *TypeConfigGroupBy) String(ctx context.Context) (_ string, err error)

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

func (*TypeConfigGroupBy) StringX

func (tcgb *TypeConfigGroupBy) StringX(ctx context.Context) string

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

func (*TypeConfigGroupBy) Strings

func (tcgb *TypeConfigGroupBy) Strings(ctx context.Context) ([]string, error)

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

func (*TypeConfigGroupBy) StringsX

func (tcgb *TypeConfigGroupBy) StringsX(ctx context.Context) []string

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

type TypeConfigMutation

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

TypeConfigMutation represents an operation that mutates the TypeConfig nodes in the graph.

func (*TypeConfigMutation) AddField

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

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

func (*TypeConfigMutation) AddedEdges

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

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

func (*TypeConfigMutation) AddedField

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

AddedField returns the numeric value that was incremented/decremented on a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*TypeConfigMutation) AddedFields

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

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

func (*TypeConfigMutation) AddedIDs

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

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

func (*TypeConfigMutation) ClearEdge

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

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

func (*TypeConfigMutation) ClearField

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

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

func (*TypeConfigMutation) ClearedEdges

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

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

func (*TypeConfigMutation) ClearedFields

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

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

func (TypeConfigMutation) Client

func (m TypeConfigMutation) 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 (*TypeConfigMutation) Config

func (m *TypeConfigMutation) Config() (r string, exists bool)

Config returns the value of the "config" field in the mutation.

func (*TypeConfigMutation) EdgeCleared

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

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

func (*TypeConfigMutation) Field

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

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

func (*TypeConfigMutation) FieldCleared

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

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

func (*TypeConfigMutation) Fields

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

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

func (*TypeConfigMutation) GetType

func (m *TypeConfigMutation) GetType() (r string, exists bool)

GetType returns the value of the "type" field in the mutation.

func (*TypeConfigMutation) ID

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

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

func (*TypeConfigMutation) OldConfig

func (m *TypeConfigMutation) OldConfig(ctx context.Context) (v string, err error)

OldConfig returns the old "config" field's value of the TypeConfig entity. If the TypeConfig object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*TypeConfigMutation) OldField

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

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

func (*TypeConfigMutation) OldTitle

func (m *TypeConfigMutation) OldTitle(ctx context.Context) (v string, err error)

OldTitle returns the old "title" field's value of the TypeConfig entity. If the TypeConfig object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*TypeConfigMutation) OldType

func (m *TypeConfigMutation) OldType(ctx context.Context) (v string, err error)

OldType returns the old "type" field's value of the TypeConfig entity. If the TypeConfig object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*TypeConfigMutation) Op

func (m *TypeConfigMutation) Op() Op

Op returns the operation name.

func (*TypeConfigMutation) RemovedEdges

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

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

func (*TypeConfigMutation) RemovedIDs

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

RemovedIDs returns all IDs (to other nodes) that were removed for the edge with the given name in this mutation.

func (*TypeConfigMutation) ResetConfig

func (m *TypeConfigMutation) ResetConfig()

ResetConfig resets all changes to the "config" field.

func (*TypeConfigMutation) ResetEdge

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

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

func (*TypeConfigMutation) ResetField

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

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

func (*TypeConfigMutation) ResetTitle

func (m *TypeConfigMutation) ResetTitle()

ResetTitle resets all changes to the "title" field.

func (*TypeConfigMutation) ResetType

func (m *TypeConfigMutation) ResetType()

ResetType resets all changes to the "type" field.

func (*TypeConfigMutation) SetConfig

func (m *TypeConfigMutation) SetConfig(s string)

SetConfig sets the "config" field.

func (*TypeConfigMutation) SetField

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

SetField sets the value of a field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*TypeConfigMutation) SetID

func (m *TypeConfigMutation) SetID(id int)

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

func (*TypeConfigMutation) SetTitle

func (m *TypeConfigMutation) SetTitle(s string)

SetTitle sets the "title" field.

func (*TypeConfigMutation) SetType

func (m *TypeConfigMutation) SetType(s string)

SetType sets the "type" field.

func (*TypeConfigMutation) Title

func (m *TypeConfigMutation) Title() (r string, exists bool)

Title returns the value of the "title" field in the mutation.

func (TypeConfigMutation) Tx

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

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

func (*TypeConfigMutation) Type

func (m *TypeConfigMutation) Type() string

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

type TypeConfigQuery

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

TypeConfigQuery is the builder for querying TypeConfig entities.

func (*TypeConfigQuery) All

func (tcq *TypeConfigQuery) All(ctx context.Context) ([]*TypeConfig, error)

All executes the query and returns a list of TypeConfigs.

func (*TypeConfigQuery) AllX

func (tcq *TypeConfigQuery) AllX(ctx context.Context) []*TypeConfig

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

func (*TypeConfigQuery) Clone

func (tcq *TypeConfigQuery) Clone() *TypeConfigQuery

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

func (*TypeConfigQuery) Count

func (tcq *TypeConfigQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*TypeConfigQuery) CountX

func (tcq *TypeConfigQuery) CountX(ctx context.Context) int

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

func (*TypeConfigQuery) Exist

func (tcq *TypeConfigQuery) Exist(ctx context.Context) (bool, error)

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

func (*TypeConfigQuery) ExistX

func (tcq *TypeConfigQuery) ExistX(ctx context.Context) bool

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

func (*TypeConfigQuery) First

func (tcq *TypeConfigQuery) First(ctx context.Context) (*TypeConfig, error)

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

func (*TypeConfigQuery) FirstID

func (tcq *TypeConfigQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*TypeConfigQuery) FirstIDX

func (tcq *TypeConfigQuery) FirstIDX(ctx context.Context) int

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

func (*TypeConfigQuery) FirstX

func (tcq *TypeConfigQuery) FirstX(ctx context.Context) *TypeConfig

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

func (*TypeConfigQuery) GroupBy

func (tcq *TypeConfigQuery) GroupBy(field string, fields ...string) *TypeConfigGroupBy

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

Example:

var v []struct {
	Type string `json:"type,omitempty"`
	Count int `json:"count,omitempty"`
}

client.TypeConfig.Query().
	GroupBy(typeconfig.FieldType).
	Aggregate(model.Count()).
	Scan(ctx, &v)

func (*TypeConfigQuery) IDs

func (tcq *TypeConfigQuery) IDs(ctx context.Context) ([]int, error)

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

func (*TypeConfigQuery) IDsX

func (tcq *TypeConfigQuery) IDsX(ctx context.Context) []int

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

func (*TypeConfigQuery) Limit

func (tcq *TypeConfigQuery) Limit(limit int) *TypeConfigQuery

Limit adds a limit step to the query.

func (*TypeConfigQuery) Offset

func (tcq *TypeConfigQuery) Offset(offset int) *TypeConfigQuery

Offset adds an offset step to the query.

func (*TypeConfigQuery) Only

func (tcq *TypeConfigQuery) Only(ctx context.Context) (*TypeConfig, error)

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

func (*TypeConfigQuery) OnlyID

func (tcq *TypeConfigQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*TypeConfigQuery) OnlyIDX

func (tcq *TypeConfigQuery) OnlyIDX(ctx context.Context) int

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

func (*TypeConfigQuery) OnlyX

func (tcq *TypeConfigQuery) OnlyX(ctx context.Context) *TypeConfig

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

func (*TypeConfigQuery) Order

func (tcq *TypeConfigQuery) Order(o ...OrderFunc) *TypeConfigQuery

Order adds an order step to the query.

func (*TypeConfigQuery) Select

func (tcq *TypeConfigQuery) Select(field string, fields ...string) *TypeConfigSelect

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

Example:

var v []struct {
	Type string `json:"type,omitempty"`
}

client.TypeConfig.Query().
	Select(typeconfig.FieldType).
	Scan(ctx, &v)

func (*TypeConfigQuery) Unique

func (tcq *TypeConfigQuery) Unique(unique bool) *TypeConfigQuery

Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.

func (*TypeConfigQuery) Where

Where adds a new predicate for the TypeConfigQuery builder.

type TypeConfigSelect

type TypeConfigSelect struct {
	*TypeConfigQuery
	// contains filtered or unexported fields
}

TypeConfigSelect is the builder for selecting fields of TypeConfig entities.

func (*TypeConfigSelect) Bool

func (tcs *TypeConfigSelect) Bool(ctx context.Context) (_ bool, err error)

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

func (*TypeConfigSelect) BoolX

func (tcs *TypeConfigSelect) BoolX(ctx context.Context) bool

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

func (*TypeConfigSelect) Bools

func (tcs *TypeConfigSelect) Bools(ctx context.Context) ([]bool, error)

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

func (*TypeConfigSelect) BoolsX

func (tcs *TypeConfigSelect) BoolsX(ctx context.Context) []bool

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

func (*TypeConfigSelect) Float64

func (tcs *TypeConfigSelect) Float64(ctx context.Context) (_ float64, err error)

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

func (*TypeConfigSelect) Float64X

func (tcs *TypeConfigSelect) Float64X(ctx context.Context) float64

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

func (*TypeConfigSelect) Float64s

func (tcs *TypeConfigSelect) Float64s(ctx context.Context) ([]float64, error)

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

func (*TypeConfigSelect) Float64sX

func (tcs *TypeConfigSelect) Float64sX(ctx context.Context) []float64

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

func (*TypeConfigSelect) Int

func (tcs *TypeConfigSelect) Int(ctx context.Context) (_ int, err error)

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

func (*TypeConfigSelect) IntX

func (tcs *TypeConfigSelect) IntX(ctx context.Context) int

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

func (*TypeConfigSelect) Ints

func (tcs *TypeConfigSelect) Ints(ctx context.Context) ([]int, error)

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

func (*TypeConfigSelect) IntsX

func (tcs *TypeConfigSelect) IntsX(ctx context.Context) []int

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

func (*TypeConfigSelect) Scan

func (tcs *TypeConfigSelect) Scan(ctx context.Context, v interface{}) error

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

func (*TypeConfigSelect) ScanX

func (tcs *TypeConfigSelect) ScanX(ctx context.Context, v interface{})

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

func (*TypeConfigSelect) String

func (tcs *TypeConfigSelect) String(ctx context.Context) (_ string, err error)

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

func (*TypeConfigSelect) StringX

func (tcs *TypeConfigSelect) StringX(ctx context.Context) string

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

func (*TypeConfigSelect) Strings

func (tcs *TypeConfigSelect) Strings(ctx context.Context) ([]string, error)

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

func (*TypeConfigSelect) StringsX

func (tcs *TypeConfigSelect) StringsX(ctx context.Context) []string

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

type TypeConfigUpdate

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

TypeConfigUpdate is the builder for updating TypeConfig entities.

func (*TypeConfigUpdate) Exec

func (tcu *TypeConfigUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*TypeConfigUpdate) ExecX

func (tcu *TypeConfigUpdate) ExecX(ctx context.Context)

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

func (*TypeConfigUpdate) Mutation

func (tcu *TypeConfigUpdate) Mutation() *TypeConfigMutation

Mutation returns the TypeConfigMutation object of the builder.

func (*TypeConfigUpdate) Save

func (tcu *TypeConfigUpdate) Save(ctx context.Context) (int, error)

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

func (*TypeConfigUpdate) SaveX

func (tcu *TypeConfigUpdate) SaveX(ctx context.Context) int

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

func (*TypeConfigUpdate) SetConfig

func (tcu *TypeConfigUpdate) SetConfig(s string) *TypeConfigUpdate

SetConfig sets the "config" field.

func (*TypeConfigUpdate) SetTitle

func (tcu *TypeConfigUpdate) SetTitle(s string) *TypeConfigUpdate

SetTitle sets the "title" field.

func (*TypeConfigUpdate) SetType

func (tcu *TypeConfigUpdate) SetType(s string) *TypeConfigUpdate

SetType sets the "type" field.

func (*TypeConfigUpdate) Where

Where adds a new predicate for the TypeConfigUpdate builder.

type TypeConfigUpdateOne

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

TypeConfigUpdateOne is the builder for updating a single TypeConfig entity.

func (*TypeConfigUpdateOne) Exec

func (tcuo *TypeConfigUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*TypeConfigUpdateOne) ExecX

func (tcuo *TypeConfigUpdateOne) ExecX(ctx context.Context)

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

func (*TypeConfigUpdateOne) Mutation

func (tcuo *TypeConfigUpdateOne) Mutation() *TypeConfigMutation

Mutation returns the TypeConfigMutation object of the builder.

func (*TypeConfigUpdateOne) Save

func (tcuo *TypeConfigUpdateOne) Save(ctx context.Context) (*TypeConfig, error)

Save executes the query and returns the updated TypeConfig entity.

func (*TypeConfigUpdateOne) SaveX

func (tcuo *TypeConfigUpdateOne) SaveX(ctx context.Context) *TypeConfig

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

func (*TypeConfigUpdateOne) Select

func (tcuo *TypeConfigUpdateOne) Select(field string, fields ...string) *TypeConfigUpdateOne

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

func (*TypeConfigUpdateOne) SetConfig

func (tcuo *TypeConfigUpdateOne) SetConfig(s string) *TypeConfigUpdateOne

SetConfig sets the "config" field.

func (*TypeConfigUpdateOne) SetTitle

func (tcuo *TypeConfigUpdateOne) SetTitle(s string) *TypeConfigUpdateOne

SetTitle sets the "title" field.

func (*TypeConfigUpdateOne) SetType

SetType sets the "type" field.

type TypeConfigs

type TypeConfigs []*TypeConfig

TypeConfigs is a parsable slice of TypeConfig.

type User

type User struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// Username holds the value of the "username" field.
	Username string `json:"username,omitempty"`
	// Password holds the value of the "password" field.
	Password string `json:"password,omitempty"`
	// Enable holds the value of the "enable" field.
	Enable *contact.BoolField `json:"enable,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the UserQuery when eager-loading is set.
	Edges UserEdges `json:"edges"`
	// contains filtered or unexported fields
}

User is the model entity for the User schema.

func (*User) QueryShare

func (u *User) QueryShare() *ShareQuery

QueryShare queries the "share" edge of the User entity.

func (*User) String

func (u *User) String() string

String implements the fmt.Stringer.

func (*User) Unwrap

func (u *User) Unwrap() *User

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

func (*User) Update

func (u *User) Update() *UserUpdateOne

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

type UserApi

type UserApi struct {
	*Api
	Filter             UserApiFilter
	SkipCreateAutoEdge bool
	SkipUpdateAutoEdge bool
}

func NewUserApi

func NewUserApi(client *Client, opt *ApiOption) *UserApi

func (*UserApi) Create

func (c *UserApi) Create(help *contact.GinHelp)

func (*UserApi) Delete

func (c *UserApi) Delete(help *contact.GinHelp)

func (*UserApi) Get

func (c *UserApi) Get(help *contact.GinHelp)

func (*UserApi) List

func (c *UserApi) List(help *contact.GinHelp)

func (*UserApi) Update

func (c *UserApi) Update(help *contact.GinHelp)

type UserApiFilter

type UserApiFilter struct {
	CreatePipe   func(help *contact.GinHelp, createPipe *UserCreate, edges UserEdges)
	CreateAfter  func(help *contact.GinHelp, item *User, edges UserEdges)
	UpdatePipe   func(help *contact.GinHelp, old *User, updatePipe *UserUpdateOne, edges UserEdges)
	UpdateAfter  func(help *contact.GinHelp, old *User, item *User, edges UserEdges)
	ListPipe     func(help *contact.GinHelp, listPipe *UserQuery)
	ListData     func(help *contact.GinHelp, items []*User) interface{}
	DeleteBefore func(help *contact.GinHelp, item *User)
	GetPipe      func(help *contact.GinHelp, getPipe *UserQuery)
	GetData      func(help *contact.GinHelp, item *User) *User
}

type UserClient

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

UserClient is a client for the User schema.

func NewUserClient

func NewUserClient(c config) *UserClient

NewUserClient returns a client for the User from the given config.

func (*UserClient) Create

func (c *UserClient) Create() *UserCreate

Create returns a create builder for User.

func (*UserClient) CreateBulk

func (c *UserClient) CreateBulk(builders ...*UserCreate) *UserCreateBulk

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

func (*UserClient) Delete

func (c *UserClient) Delete() *UserDelete

Delete returns a delete builder for User.

func (*UserClient) DeleteOne

func (c *UserClient) DeleteOne(u *User) *UserDeleteOne

DeleteOne returns a delete builder for the given entity.

func (*UserClient) DeleteOneID

func (c *UserClient) DeleteOneID(id int) *UserDeleteOne

DeleteOneID returns a delete builder for the given id.

func (*UserClient) Get

func (c *UserClient) Get(ctx context.Context, id int) (*User, error)

Get returns a User entity by its id.

func (*UserClient) GetX

func (c *UserClient) GetX(ctx context.Context, id int) *User

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

func (*UserClient) Hooks

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

Hooks returns the client hooks.

func (*UserClient) Query

func (c *UserClient) Query() *UserQuery

Query returns a query builder for User.

func (*UserClient) QueryShare

func (c *UserClient) QueryShare(u *User) *ShareQuery

QueryShare queries the share edge of a User.

func (*UserClient) Update

func (c *UserClient) Update() *UserUpdate

Update returns an update builder for User.

func (*UserClient) UpdateOne

func (c *UserClient) UpdateOne(u *User) *UserUpdateOne

UpdateOne returns an update builder for the given entity.

func (*UserClient) UpdateOneID

func (c *UserClient) UpdateOneID(id int) *UserUpdateOne

UpdateOneID returns an update builder for the given id.

func (*UserClient) Use

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

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

type UserCreate

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

UserCreate is the builder for creating a User entity.

func (*UserCreate) AddShare

func (uc *UserCreate) AddShare(s ...*Share) *UserCreate

AddShare adds the "share" edges to the Share entity.

func (*UserCreate) AddShareIDs

func (uc *UserCreate) AddShareIDs(ids ...int) *UserCreate

AddShareIDs adds the "share" edge to the Share entity by IDs.

func (*UserCreate) Mutation

func (uc *UserCreate) Mutation() *UserMutation

Mutation returns the UserMutation object of the builder.

func (*UserCreate) Save

func (uc *UserCreate) Save(ctx context.Context) (*User, error)

Save creates the User in the database.

func (*UserCreate) SaveX

func (uc *UserCreate) SaveX(ctx context.Context) *User

SaveX calls Save and panics if Save returns an error.

func (*UserCreate) SetEnable

func (uc *UserCreate) SetEnable(cf *contact.BoolField) *UserCreate

SetEnable sets the "enable" field.

func (*UserCreate) SetPassword

func (uc *UserCreate) SetPassword(s string) *UserCreate

SetPassword sets the "password" field.

func (*UserCreate) SetUsername

func (uc *UserCreate) SetUsername(s string) *UserCreate

SetUsername sets the "username" field.

type UserCreateBulk

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

UserCreateBulk is the builder for creating many User entities in bulk.

func (*UserCreateBulk) Save

func (ucb *UserCreateBulk) Save(ctx context.Context) ([]*User, error)

Save creates the User entities in the database.

func (*UserCreateBulk) SaveX

func (ucb *UserCreateBulk) SaveX(ctx context.Context) []*User

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

type UserDelete

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

UserDelete is the builder for deleting a User entity.

func (*UserDelete) Exec

func (ud *UserDelete) Exec(ctx context.Context) (int, error)

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

func (*UserDelete) ExecX

func (ud *UserDelete) ExecX(ctx context.Context) int

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

func (*UserDelete) Where

func (ud *UserDelete) Where(ps ...predicate.User) *UserDelete

Where adds a new predicate to the UserDelete builder.

type UserDeleteOne

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

UserDeleteOne is the builder for deleting a single User entity.

func (*UserDeleteOne) Exec

func (udo *UserDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*UserDeleteOne) ExecX

func (udo *UserDeleteOne) ExecX(ctx context.Context)

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

type UserEdges

type UserEdges struct {
	// Share holds the value of the share edge.
	Share []*Share `json:"share,omitempty"`
	// contains filtered or unexported fields
}

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

func (UserEdges) ShareOrErr

func (e UserEdges) ShareOrErr() ([]*Share, error)

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

type UserGroupBy

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

UserGroupBy is the group-by builder for User entities.

func (*UserGroupBy) Aggregate

func (ugb *UserGroupBy) Aggregate(fns ...AggregateFunc) *UserGroupBy

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

func (*UserGroupBy) Bool

func (ugb *UserGroupBy) Bool(ctx context.Context) (_ bool, err error)

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

func (*UserGroupBy) BoolX

func (ugb *UserGroupBy) BoolX(ctx context.Context) bool

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

func (*UserGroupBy) Bools

func (ugb *UserGroupBy) Bools(ctx context.Context) ([]bool, error)

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

func (*UserGroupBy) BoolsX

func (ugb *UserGroupBy) BoolsX(ctx context.Context) []bool

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

func (*UserGroupBy) Float64

func (ugb *UserGroupBy) Float64(ctx context.Context) (_ float64, err error)

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

func (*UserGroupBy) Float64X

func (ugb *UserGroupBy) Float64X(ctx context.Context) float64

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

func (*UserGroupBy) Float64s

func (ugb *UserGroupBy) Float64s(ctx context.Context) ([]float64, error)

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

func (*UserGroupBy) Float64sX

func (ugb *UserGroupBy) Float64sX(ctx context.Context) []float64

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

func (*UserGroupBy) Int

func (ugb *UserGroupBy) Int(ctx context.Context) (_ int, err error)

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

func (*UserGroupBy) IntX

func (ugb *UserGroupBy) IntX(ctx context.Context) int

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

func (*UserGroupBy) Ints

func (ugb *UserGroupBy) Ints(ctx context.Context) ([]int, error)

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

func (*UserGroupBy) IntsX

func (ugb *UserGroupBy) IntsX(ctx context.Context) []int

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

func (*UserGroupBy) Scan

func (ugb *UserGroupBy) Scan(ctx context.Context, v interface{}) error

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

func (*UserGroupBy) ScanX

func (ugb *UserGroupBy) ScanX(ctx context.Context, v interface{})

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

func (*UserGroupBy) String

func (ugb *UserGroupBy) String(ctx context.Context) (_ string, err error)

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

func (*UserGroupBy) StringX

func (ugb *UserGroupBy) StringX(ctx context.Context) string

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

func (*UserGroupBy) Strings

func (ugb *UserGroupBy) Strings(ctx context.Context) ([]string, error)

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

func (*UserGroupBy) StringsX

func (ugb *UserGroupBy) StringsX(ctx context.Context) []string

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

type UserMutation

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

UserMutation represents an operation that mutates the User nodes in the graph.

func (*UserMutation) AddField

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

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

func (*UserMutation) AddShareIDs

func (m *UserMutation) AddShareIDs(ids ...int)

AddShareIDs adds the "share" edge to the Share entity by ids.

func (*UserMutation) AddedEdges

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

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

func (*UserMutation) AddedField

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

AddedField returns the numeric value that was incremented/decremented on a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*UserMutation) AddedFields

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

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

func (*UserMutation) AddedIDs

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

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

func (*UserMutation) ClearEdge

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

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

func (*UserMutation) ClearField

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

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

func (*UserMutation) ClearShare

func (m *UserMutation) ClearShare()

ClearShare clears the "share" edge to the Share entity.

func (*UserMutation) ClearedEdges

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

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

func (*UserMutation) ClearedFields

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

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

func (UserMutation) Client

func (m UserMutation) Client() *Client

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

func (*UserMutation) EdgeCleared

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

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

func (*UserMutation) Enable

func (m *UserMutation) Enable() (r *contact.BoolField, exists bool)

Enable returns the value of the "enable" field in the mutation.

func (*UserMutation) Field

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

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

func (*UserMutation) FieldCleared

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

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

func (*UserMutation) Fields

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

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

func (*UserMutation) ID

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

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

func (*UserMutation) OldEnable

func (m *UserMutation) OldEnable(ctx context.Context) (v *contact.BoolField, err error)

OldEnable returns the old "enable" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*UserMutation) OldField

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

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

func (*UserMutation) OldPassword

func (m *UserMutation) OldPassword(ctx context.Context) (v string, err error)

OldPassword returns the old "password" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*UserMutation) OldUsername

func (m *UserMutation) OldUsername(ctx context.Context) (v string, err error)

OldUsername returns the old "username" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*UserMutation) Op

func (m *UserMutation) Op() Op

Op returns the operation name.

func (*UserMutation) Password

func (m *UserMutation) Password() (r string, exists bool)

Password returns the value of the "password" field in the mutation.

func (*UserMutation) RemoveShareIDs

func (m *UserMutation) RemoveShareIDs(ids ...int)

RemoveShareIDs removes the "share" edge to the Share entity by IDs.

func (*UserMutation) RemovedEdges

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

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

func (*UserMutation) RemovedIDs

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

RemovedIDs returns all IDs (to other nodes) that were removed for the edge with the given name in this mutation.

func (*UserMutation) RemovedShareIDs

func (m *UserMutation) RemovedShareIDs() (ids []int)

RemovedShare returns the removed IDs of the "share" edge to the Share entity.

func (*UserMutation) ResetEdge

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

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

func (*UserMutation) ResetEnable

func (m *UserMutation) ResetEnable()

ResetEnable resets all changes to the "enable" field.

func (*UserMutation) ResetField

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

ResetField resets all changes in the mutation for the field with the given name. It returns an error if the field is not defined in the schema.

func (*UserMutation) ResetPassword

func (m *UserMutation) ResetPassword()

ResetPassword resets all changes to the "password" field.

func (*UserMutation) ResetShare

func (m *UserMutation) ResetShare()

ResetShare resets all changes to the "share" edge.

func (*UserMutation) ResetUsername

func (m *UserMutation) ResetUsername()

ResetUsername resets all changes to the "username" field.

func (*UserMutation) SetEnable

func (m *UserMutation) SetEnable(cf *contact.BoolField)

SetEnable sets the "enable" field.

func (*UserMutation) SetField

func (m *UserMutation) SetField(name string, value ent.Value) error

SetField sets the value of a field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*UserMutation) SetPassword

func (m *UserMutation) SetPassword(s string)

SetPassword sets the "password" field.

func (*UserMutation) SetUsername

func (m *UserMutation) SetUsername(s string)

SetUsername sets the "username" field.

func (*UserMutation) ShareCleared

func (m *UserMutation) ShareCleared() bool

ShareCleared reports if the "share" edge to the Share entity was cleared.

func (*UserMutation) ShareIDs

func (m *UserMutation) ShareIDs() (ids []int)

ShareIDs returns the "share" edge IDs in the mutation.

func (UserMutation) Tx

func (m UserMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*UserMutation) Type

func (m *UserMutation) Type() string

Type returns the node type of this mutation (User).

func (*UserMutation) Username

func (m *UserMutation) Username() (r string, exists bool)

Username returns the value of the "username" field in the mutation.

type UserQuery

type UserQuery struct {
	// contains filtered or unexported fields
}

UserQuery is the builder for querying User entities.

func (*UserQuery) All

func (uq *UserQuery) All(ctx context.Context) ([]*User, error)

All executes the query and returns a list of Users.

func (*UserQuery) AllX

func (uq *UserQuery) AllX(ctx context.Context) []*User

AllX is like All, but panics if an error occurs.

func (*UserQuery) Clone

func (uq *UserQuery) Clone() *UserQuery

Clone returns a duplicate of the UserQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*UserQuery) Count

func (uq *UserQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*UserQuery) CountX

func (uq *UserQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*UserQuery) Exist

func (uq *UserQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*UserQuery) ExistX

func (uq *UserQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*UserQuery) First

func (uq *UserQuery) First(ctx context.Context) (*User, error)

First returns the first User entity from the query. Returns a *NotFoundError when no User was found.

func (*UserQuery) FirstID

func (uq *UserQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first User ID from the query. Returns a *NotFoundError when no User ID was found.

func (*UserQuery) FirstIDX

func (uq *UserQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*UserQuery) FirstX

func (uq *UserQuery) FirstX(ctx context.Context) *User

FirstX is like First, but panics if an error occurs.

func (*UserQuery) GroupBy

func (uq *UserQuery) GroupBy(field string, fields ...string) *UserGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

Example:

var v []struct {
	Username string `json:"username,omitempty"`
	Count int `json:"count,omitempty"`
}

client.User.Query().
	GroupBy(user.FieldUsername).
	Aggregate(model.Count()).
	Scan(ctx, &v)

func (*UserQuery) IDs

func (uq *UserQuery) IDs(ctx context.Context) ([]int, error)

IDs executes the query and returns a list of User IDs.

func (*UserQuery) IDsX

func (uq *UserQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*UserQuery) Limit

func (uq *UserQuery) Limit(limit int) *UserQuery

Limit adds a limit step to the query.

func (*UserQuery) Offset

func (uq *UserQuery) Offset(offset int) *UserQuery

Offset adds an offset step to the query.

func (*UserQuery) Only

func (uq *UserQuery) Only(ctx context.Context) (*User, error)

Only returns a single User entity found by the query, ensuring it only returns one. Returns a *NotSingularError when exactly one User entity is not found. Returns a *NotFoundError when no User entities are found.

func (*UserQuery) OnlyID

func (uq *UserQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only User ID in the query. Returns a *NotSingularError when exactly one User ID is not found. Returns a *NotFoundError when no entities are found.

func (*UserQuery) OnlyIDX

func (uq *UserQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*UserQuery) OnlyX

func (uq *UserQuery) OnlyX(ctx context.Context) *User

OnlyX is like Only, but panics if an error occurs.

func (*UserQuery) Order

func (uq *UserQuery) Order(o ...OrderFunc) *UserQuery

Order adds an order step to the query.

func (*UserQuery) QueryShare

func (uq *UserQuery) QueryShare() *ShareQuery

QueryShare chains the current query on the "share" edge.

func (*UserQuery) Select

func (uq *UserQuery) Select(field string, fields ...string) *UserSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	Username string `json:"username,omitempty"`
}

client.User.Query().
	Select(user.FieldUsername).
	Scan(ctx, &v)

func (*UserQuery) Unique

func (uq *UserQuery) Unique(unique bool) *UserQuery

Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.

func (*UserQuery) Where

func (uq *UserQuery) Where(ps ...predicate.User) *UserQuery

Where adds a new predicate for the UserQuery builder.

func (*UserQuery) WithShare

func (uq *UserQuery) WithShare(opts ...func(*ShareQuery)) *UserQuery

WithShare tells the query-builder to eager-load the nodes that are connected to the "share" edge. The optional arguments are used to configure the query builder of the edge.

type UserSelect

type UserSelect struct {
	*UserQuery
	// contains filtered or unexported fields
}

UserSelect is the builder for selecting fields of User entities.

func (*UserSelect) Bool

func (us *UserSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*UserSelect) BoolX

func (us *UserSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*UserSelect) Bools

func (us *UserSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*UserSelect) BoolsX

func (us *UserSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*UserSelect) Float64

func (us *UserSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*UserSelect) Float64X

func (us *UserSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*UserSelect) Float64s

func (us *UserSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*UserSelect) Float64sX

func (us *UserSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*UserSelect) Int

func (us *UserSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*UserSelect) IntX

func (us *UserSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*UserSelect) Ints

func (us *UserSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*UserSelect) IntsX

func (us *UserSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*UserSelect) Scan

func (us *UserSelect) Scan(ctx context.Context, v interface{}) error

Scan applies the selector query and scans the result into the given value.

func (*UserSelect) ScanX

func (us *UserSelect) ScanX(ctx context.Context, v interface{})

ScanX is like Scan, but panics if an error occurs.

func (*UserSelect) String

func (us *UserSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*UserSelect) StringX

func (us *UserSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*UserSelect) Strings

func (us *UserSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*UserSelect) StringsX

func (us *UserSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type UserUpdate

type UserUpdate struct {
	// contains filtered or unexported fields
}

UserUpdate is the builder for updating User entities.

func (*UserUpdate) AddShare

func (uu *UserUpdate) AddShare(s ...*Share) *UserUpdate

AddShare adds the "share" edges to the Share entity.

func (*UserUpdate) AddShareIDs

func (uu *UserUpdate) AddShareIDs(ids ...int) *UserUpdate

AddShareIDs adds the "share" edge to the Share entity by IDs.

func (*UserUpdate) ClearShare

func (uu *UserUpdate) ClearShare() *UserUpdate

ClearShare clears all "share" edges to the Share entity.

func (*UserUpdate) Exec

func (uu *UserUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*UserUpdate) ExecX

func (uu *UserUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserUpdate) Mutation

func (uu *UserUpdate) Mutation() *UserMutation

Mutation returns the UserMutation object of the builder.

func (*UserUpdate) RemoveShare

func (uu *UserUpdate) RemoveShare(s ...*Share) *UserUpdate

RemoveShare removes "share" edges to Share entities.

func (*UserUpdate) RemoveShareIDs

func (uu *UserUpdate) RemoveShareIDs(ids ...int) *UserUpdate

RemoveShareIDs removes the "share" edge to Share entities by IDs.

func (*UserUpdate) Save

func (uu *UserUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*UserUpdate) SaveX

func (uu *UserUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*UserUpdate) SetEnable

func (uu *UserUpdate) SetEnable(cf *contact.BoolField) *UserUpdate

SetEnable sets the "enable" field.

func (*UserUpdate) SetPassword

func (uu *UserUpdate) SetPassword(s string) *UserUpdate

SetPassword sets the "password" field.

func (*UserUpdate) SetUsername

func (uu *UserUpdate) SetUsername(s string) *UserUpdate

SetUsername sets the "username" field.

func (*UserUpdate) Where

func (uu *UserUpdate) Where(ps ...predicate.User) *UserUpdate

Where adds a new predicate for the UserUpdate builder.

type UserUpdateOne

type UserUpdateOne struct {
	// contains filtered or unexported fields
}

UserUpdateOne is the builder for updating a single User entity.

func (*UserUpdateOne) AddShare

func (uuo *UserUpdateOne) AddShare(s ...*Share) *UserUpdateOne

AddShare adds the "share" edges to the Share entity.

func (*UserUpdateOne) AddShareIDs

func (uuo *UserUpdateOne) AddShareIDs(ids ...int) *UserUpdateOne

AddShareIDs adds the "share" edge to the Share entity by IDs.

func (*UserUpdateOne) ClearShare

func (uuo *UserUpdateOne) ClearShare() *UserUpdateOne

ClearShare clears all "share" edges to the Share entity.

func (*UserUpdateOne) Exec

func (uuo *UserUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*UserUpdateOne) ExecX

func (uuo *UserUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserUpdateOne) Mutation

func (uuo *UserUpdateOne) Mutation() *UserMutation

Mutation returns the UserMutation object of the builder.

func (*UserUpdateOne) RemoveShare

func (uuo *UserUpdateOne) RemoveShare(s ...*Share) *UserUpdateOne

RemoveShare removes "share" edges to Share entities.

func (*UserUpdateOne) RemoveShareIDs

func (uuo *UserUpdateOne) RemoveShareIDs(ids ...int) *UserUpdateOne

RemoveShareIDs removes the "share" edge to Share entities by IDs.

func (*UserUpdateOne) Save

func (uuo *UserUpdateOne) Save(ctx context.Context) (*User, error)

Save executes the query and returns the updated User entity.

func (*UserUpdateOne) SaveX

func (uuo *UserUpdateOne) SaveX(ctx context.Context) *User

SaveX is like Save, but panics if an error occurs.

func (*UserUpdateOne) Select

func (uuo *UserUpdateOne) Select(field string, fields ...string) *UserUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*UserUpdateOne) SetEnable

func (uuo *UserUpdateOne) SetEnable(cf *contact.BoolField) *UserUpdateOne

SetEnable sets the "enable" field.

func (*UserUpdateOne) SetPassword

func (uuo *UserUpdateOne) SetPassword(s string) *UserUpdateOne

SetPassword sets the "password" field.

func (*UserUpdateOne) SetUsername

func (uuo *UserUpdateOne) SetUsername(s string) *UserUpdateOne

SetUsername sets the "username" field.

type Users

type Users []*User

Users is a parsable slice of User.

type ValidationError

type ValidationError struct {
	Name string // Field or edge name.
	// contains filtered or unexported fields
}

ValidationError returns when validating a field fails.

func (*ValidationError) Error

func (e *ValidationError) Error() string

Error implements the error interface.

func (*ValidationError) Unwrap

func (e *ValidationError) Unwrap() error

Unwrap implements the errors.Wrapper interface.

type Value

type Value = ent.Value

ent aliases to avoid import conflicts in user's code.

type View

type View struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// Desc holds the value of the "desc" field.
	Desc string `json:"desc,omitempty"`
	// Config holds the value of the "config" field.
	Config string `json:"config,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the ViewQuery when eager-loading is set.
	Edges ViewEdges `json:"edges"`
	// contains filtered or unexported fields
}

View is the model entity for the View schema.

func (*View) QueryBg

func (v *View) QueryBg() *AssetsQuery

QueryBg queries the "bg" edge of the View entity.

func (*View) QueryBlocks

func (v *View) QueryBlocks() *ViewBlockQuery

QueryBlocks queries the "blocks" edge of the View entity.

func (*View) QueryShare

func (v *View) QueryShare() *ShareQuery

QueryShare queries the "share" edge of the View entity.

func (*View) String

func (v *View) String() string

String implements the fmt.Stringer.

func (*View) Unwrap

func (v *View) Unwrap() *View

Unwrap unwraps the View entity that was returned from a transaction after it was closed, so that all future queries will be executed through the driver which created the transaction.

func (*View) Update

func (v *View) Update() *ViewUpdateOne

Update returns a builder for updating this View. Note that you need to call View.Unwrap() before calling this method if this View was returned from a transaction, and the transaction was committed or rolled back.

type ViewApi

type ViewApi struct {
	*Api
	Filter             ViewApiFilter
	SkipCreateAutoEdge bool
	SkipUpdateAutoEdge bool
}

func NewViewApi

func NewViewApi(client *Client, opt *ApiOption) *ViewApi

func (*ViewApi) Create

func (c *ViewApi) Create(help *contact.GinHelp)

func (*ViewApi) Delete

func (c *ViewApi) Delete(help *contact.GinHelp)

func (*ViewApi) Get

func (c *ViewApi) Get(help *contact.GinHelp)

func (*ViewApi) List

func (c *ViewApi) List(help *contact.GinHelp)

func (*ViewApi) Update

func (c *ViewApi) Update(help *contact.GinHelp)

type ViewApiFilter

type ViewApiFilter struct {
	CreatePipe   func(help *contact.GinHelp, createPipe *ViewCreate, edges ViewEdges)
	CreateAfter  func(help *contact.GinHelp, item *View, edges ViewEdges)
	UpdatePipe   func(help *contact.GinHelp, old *View, updatePipe *ViewUpdateOne, edges ViewEdges)
	UpdateAfter  func(help *contact.GinHelp, old *View, item *View, edges ViewEdges)
	ListPipe     func(help *contact.GinHelp, listPipe *ViewQuery)
	ListData     func(help *contact.GinHelp, items []*View) interface{}
	DeleteBefore func(help *contact.GinHelp, item *View)
	GetPipe      func(help *contact.GinHelp, getPipe *ViewQuery)
	GetData      func(help *contact.GinHelp, item *View) *View
}

type ViewBlock

type ViewBlock struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// Type holds the value of the "type" field.
	Type string `json:"type,omitempty"`
	// Config holds the value of the "config" field.
	Config string `json:"config,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the ViewBlockQuery when eager-loading is set.
	Edges ViewBlockEdges `json:"edges"`
	// contains filtered or unexported fields
}

ViewBlock is the model entity for the ViewBlock schema.

func (*ViewBlock) QueryDataset

func (vb *ViewBlock) QueryDataset() *DataSetQuery

QueryDataset queries the "dataset" edge of the ViewBlock entity.

func (*ViewBlock) QueryView

func (vb *ViewBlock) QueryView() *ViewQuery

QueryView queries the "view" edge of the ViewBlock entity.

func (*ViewBlock) String

func (vb *ViewBlock) String() string

String implements the fmt.Stringer.

func (*ViewBlock) Unwrap

func (vb *ViewBlock) Unwrap() *ViewBlock

Unwrap unwraps the ViewBlock entity that was returned from a transaction after it was closed, so that all future queries will be executed through the driver which created the transaction.

func (*ViewBlock) Update

func (vb *ViewBlock) Update() *ViewBlockUpdateOne

Update returns a builder for updating this ViewBlock. Note that you need to call ViewBlock.Unwrap() before calling this method if this ViewBlock was returned from a transaction, and the transaction was committed or rolled back.

type ViewBlockApi

type ViewBlockApi struct {
	*Api
	Filter             ViewBlockApiFilter
	SkipCreateAutoEdge bool
	SkipUpdateAutoEdge bool
}

func NewViewBlockApi

func NewViewBlockApi(client *Client, opt *ApiOption) *ViewBlockApi

func (*ViewBlockApi) Create

func (c *ViewBlockApi) Create(help *contact.GinHelp)

func (*ViewBlockApi) Delete

func (c *ViewBlockApi) Delete(help *contact.GinHelp)

func (*ViewBlockApi) Get

func (c *ViewBlockApi) Get(help *contact.GinHelp)

func (*ViewBlockApi) List

func (c *ViewBlockApi) List(help *contact.GinHelp)

func (*ViewBlockApi) Update

func (c *ViewBlockApi) Update(help *contact.GinHelp)

type ViewBlockApiFilter

type ViewBlockApiFilter struct {
	CreatePipe   func(help *contact.GinHelp, createPipe *ViewBlockCreate, edges ViewBlockEdges)
	CreateAfter  func(help *contact.GinHelp, item *ViewBlock, edges ViewBlockEdges)
	UpdatePipe   func(help *contact.GinHelp, old *ViewBlock, updatePipe *ViewBlockUpdateOne, edges ViewBlockEdges)
	UpdateAfter  func(help *contact.GinHelp, old *ViewBlock, item *ViewBlock, edges ViewBlockEdges)
	ListPipe     func(help *contact.GinHelp, listPipe *ViewBlockQuery)
	ListData     func(help *contact.GinHelp, items []*ViewBlock) interface{}
	DeleteBefore func(help *contact.GinHelp, item *ViewBlock)
	GetPipe      func(help *contact.GinHelp, getPipe *ViewBlockQuery)
	GetData      func(help *contact.GinHelp, item *ViewBlock) *ViewBlock
}

type ViewBlockClient

type ViewBlockClient struct {
	// contains filtered or unexported fields
}

ViewBlockClient is a client for the ViewBlock schema.

func NewViewBlockClient

func NewViewBlockClient(c config) *ViewBlockClient

NewViewBlockClient returns a client for the ViewBlock from the given config.

func (*ViewBlockClient) Create

func (c *ViewBlockClient) Create() *ViewBlockCreate

Create returns a create builder for ViewBlock.

func (*ViewBlockClient) CreateBulk

func (c *ViewBlockClient) CreateBulk(builders ...*ViewBlockCreate) *ViewBlockCreateBulk

CreateBulk returns a builder for creating a bulk of ViewBlock entities.

func (*ViewBlockClient) Delete

func (c *ViewBlockClient) Delete() *ViewBlockDelete

Delete returns a delete builder for ViewBlock.

func (*ViewBlockClient) DeleteOne

func (c *ViewBlockClient) DeleteOne(vb *ViewBlock) *ViewBlockDeleteOne

DeleteOne returns a delete builder for the given entity.

func (*ViewBlockClient) DeleteOneID

func (c *ViewBlockClient) DeleteOneID(id int) *ViewBlockDeleteOne

DeleteOneID returns a delete builder for the given id.

func (*ViewBlockClient) Get

func (c *ViewBlockClient) Get(ctx context.Context, id int) (*ViewBlock, error)

Get returns a ViewBlock entity by its id.

func (*ViewBlockClient) GetX

func (c *ViewBlockClient) GetX(ctx context.Context, id int) *ViewBlock

GetX is like Get, but panics if an error occurs.

func (*ViewBlockClient) Hooks

func (c *ViewBlockClient) Hooks() []Hook

Hooks returns the client hooks.

func (*ViewBlockClient) Query

func (c *ViewBlockClient) Query() *ViewBlockQuery

Query returns a query builder for ViewBlock.

func (*ViewBlockClient) QueryDataset

func (c *ViewBlockClient) QueryDataset(vb *ViewBlock) *DataSetQuery

QueryDataset queries the dataset edge of a ViewBlock.

func (*ViewBlockClient) QueryView

func (c *ViewBlockClient) QueryView(vb *ViewBlock) *ViewQuery

QueryView queries the view edge of a ViewBlock.

func (*ViewBlockClient) Update

func (c *ViewBlockClient) Update() *ViewBlockUpdate

Update returns an update builder for ViewBlock.

func (*ViewBlockClient) UpdateOne

func (c *ViewBlockClient) UpdateOne(vb *ViewBlock) *ViewBlockUpdateOne

UpdateOne returns an update builder for the given entity.

func (*ViewBlockClient) UpdateOneID

func (c *ViewBlockClient) UpdateOneID(id int) *ViewBlockUpdateOne

UpdateOneID returns an update builder for the given id.

func (*ViewBlockClient) Use

func (c *ViewBlockClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `viewblock.Hooks(f(g(h())))`.

type ViewBlockCreate

type ViewBlockCreate struct {
	// contains filtered or unexported fields
}

ViewBlockCreate is the builder for creating a ViewBlock entity.

func (*ViewBlockCreate) AddDataset

func (vbc *ViewBlockCreate) AddDataset(d ...*DataSet) *ViewBlockCreate

AddDataset adds the "dataset" edges to the DataSet entity.

func (*ViewBlockCreate) AddDatasetIDs

func (vbc *ViewBlockCreate) AddDatasetIDs(ids ...int) *ViewBlockCreate

AddDatasetIDs adds the "dataset" edge to the DataSet entity by IDs.

func (*ViewBlockCreate) Mutation

func (vbc *ViewBlockCreate) Mutation() *ViewBlockMutation

Mutation returns the ViewBlockMutation object of the builder.

func (*ViewBlockCreate) Save

func (vbc *ViewBlockCreate) Save(ctx context.Context) (*ViewBlock, error)

Save creates the ViewBlock in the database.

func (*ViewBlockCreate) SaveX

func (vbc *ViewBlockCreate) SaveX(ctx context.Context) *ViewBlock

SaveX calls Save and panics if Save returns an error.

func (*ViewBlockCreate) SetConfig

func (vbc *ViewBlockCreate) SetConfig(s string) *ViewBlockCreate

SetConfig sets the "config" field.

func (*ViewBlockCreate) SetNillableViewID

func (vbc *ViewBlockCreate) SetNillableViewID(id *int) *ViewBlockCreate

SetNillableViewID sets the "view" edge to the View entity by ID if the given value is not nil.

func (*ViewBlockCreate) SetType

func (vbc *ViewBlockCreate) SetType(s string) *ViewBlockCreate

SetType sets the "type" field.

func (*ViewBlockCreate) SetView

func (vbc *ViewBlockCreate) SetView(v *View) *ViewBlockCreate

SetView sets the "view" edge to the View entity.

func (*ViewBlockCreate) SetViewID

func (vbc *ViewBlockCreate) SetViewID(id int) *ViewBlockCreate

SetViewID sets the "view" edge to the View entity by ID.

type ViewBlockCreateBulk

type ViewBlockCreateBulk struct {
	// contains filtered or unexported fields
}

ViewBlockCreateBulk is the builder for creating many ViewBlock entities in bulk.

func (*ViewBlockCreateBulk) Save

func (vbcb *ViewBlockCreateBulk) Save(ctx context.Context) ([]*ViewBlock, error)

Save creates the ViewBlock entities in the database.

func (*ViewBlockCreateBulk) SaveX

func (vbcb *ViewBlockCreateBulk) SaveX(ctx context.Context) []*ViewBlock

SaveX is like Save, but panics if an error occurs.

type ViewBlockDelete

type ViewBlockDelete struct {
	// contains filtered or unexported fields
}

ViewBlockDelete is the builder for deleting a ViewBlock entity.

func (*ViewBlockDelete) Exec

func (vbd *ViewBlockDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*ViewBlockDelete) ExecX

func (vbd *ViewBlockDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*ViewBlockDelete) Where

Where adds a new predicate to the ViewBlockDelete builder.

type ViewBlockDeleteOne

type ViewBlockDeleteOne struct {
	// contains filtered or unexported fields
}

ViewBlockDeleteOne is the builder for deleting a single ViewBlock entity.

func (*ViewBlockDeleteOne) Exec

func (vbdo *ViewBlockDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*ViewBlockDeleteOne) ExecX

func (vbdo *ViewBlockDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

type ViewBlockEdges

type ViewBlockEdges struct {
	// View holds the value of the view edge.
	View *View `json:"view,omitempty"`
	// Dataset holds the value of the dataset edge.
	Dataset []*DataSet `json:"dataset,omitempty"`
	// contains filtered or unexported fields
}

ViewBlockEdges holds the relations/edges for other nodes in the graph.

func (ViewBlockEdges) DatasetOrErr

func (e ViewBlockEdges) DatasetOrErr() ([]*DataSet, error)

DatasetOrErr returns the Dataset value or an error if the edge was not loaded in eager-loading.

func (ViewBlockEdges) ViewOrErr

func (e ViewBlockEdges) ViewOrErr() (*View, error)

ViewOrErr returns the View value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

type ViewBlockGroupBy

type ViewBlockGroupBy struct {
	// contains filtered or unexported fields
}

ViewBlockGroupBy is the group-by builder for ViewBlock entities.

func (*ViewBlockGroupBy) Aggregate

func (vbgb *ViewBlockGroupBy) Aggregate(fns ...AggregateFunc) *ViewBlockGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*ViewBlockGroupBy) Bool

func (vbgb *ViewBlockGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a group-by query. It is only allowed when executing a group-by query with one field.

func (*ViewBlockGroupBy) BoolX

func (vbgb *ViewBlockGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*ViewBlockGroupBy) Bools

func (vbgb *ViewBlockGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from group-by. It is only allowed when executing a group-by query with one field.

func (*ViewBlockGroupBy) BoolsX

func (vbgb *ViewBlockGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*ViewBlockGroupBy) Float64

func (vbgb *ViewBlockGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a group-by query. It is only allowed when executing a group-by query with one field.

func (*ViewBlockGroupBy) Float64X

func (vbgb *ViewBlockGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*ViewBlockGroupBy) Float64s

func (vbgb *ViewBlockGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from group-by. It is only allowed when executing a group-by query with one field.

func (*ViewBlockGroupBy) Float64sX

func (vbgb *ViewBlockGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*ViewBlockGroupBy) Int

func (vbgb *ViewBlockGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a group-by query. It is only allowed when executing a group-by query with one field.

func (*ViewBlockGroupBy) IntX

func (vbgb *ViewBlockGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*ViewBlockGroupBy) Ints

func (vbgb *ViewBlockGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from group-by. It is only allowed when executing a group-by query with one field.

func (*ViewBlockGroupBy) IntsX

func (vbgb *ViewBlockGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*ViewBlockGroupBy) Scan

func (vbgb *ViewBlockGroupBy) Scan(ctx context.Context, v interface{}) error

Scan applies the group-by query and scans the result into the given value.

func (*ViewBlockGroupBy) ScanX

func (vbgb *ViewBlockGroupBy) ScanX(ctx context.Context, v interface{})

ScanX is like Scan, but panics if an error occurs.

func (*ViewBlockGroupBy) String

func (vbgb *ViewBlockGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a group-by query. It is only allowed when executing a group-by query with one field.

func (*ViewBlockGroupBy) StringX

func (vbgb *ViewBlockGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*ViewBlockGroupBy) Strings

func (vbgb *ViewBlockGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from group-by. It is only allowed when executing a group-by query with one field.

func (*ViewBlockGroupBy) StringsX

func (vbgb *ViewBlockGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type ViewBlockMutation

type ViewBlockMutation struct {
	// contains filtered or unexported fields
}

ViewBlockMutation represents an operation that mutates the ViewBlock nodes in the graph.

func (*ViewBlockMutation) AddDatasetIDs

func (m *ViewBlockMutation) AddDatasetIDs(ids ...int)

AddDatasetIDs adds the "dataset" edge to the DataSet entity by ids.

func (*ViewBlockMutation) AddField

func (m *ViewBlockMutation) AddField(name string, value ent.Value) error

AddField adds the value to the field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*ViewBlockMutation) AddedEdges

func (m *ViewBlockMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*ViewBlockMutation) AddedField

func (m *ViewBlockMutation) AddedField(name string) (ent.Value, bool)

AddedField returns the numeric value that was incremented/decremented on a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*ViewBlockMutation) AddedFields

func (m *ViewBlockMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*ViewBlockMutation) AddedIDs

func (m *ViewBlockMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*ViewBlockMutation) ClearDataset

func (m *ViewBlockMutation) ClearDataset()

ClearDataset clears the "dataset" edge to the DataSet entity.

func (*ViewBlockMutation) ClearEdge

func (m *ViewBlockMutation) ClearEdge(name string) error

ClearEdge clears the value of the edge with the given name. It returns an error if that edge is not defined in the schema.

func (*ViewBlockMutation) ClearField

func (m *ViewBlockMutation) ClearField(name string) error

ClearField clears the value of the field with the given name. It returns an error if the field is not defined in the schema.

func (*ViewBlockMutation) ClearView

func (m *ViewBlockMutation) ClearView()

ClearView clears the "view" edge to the View entity.

func (*ViewBlockMutation) ClearedEdges

func (m *ViewBlockMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*ViewBlockMutation) ClearedFields

func (m *ViewBlockMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (ViewBlockMutation) Client

func (m ViewBlockMutation) 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 (*ViewBlockMutation) Config

func (m *ViewBlockMutation) Config() (r string, exists bool)

Config returns the value of the "config" field in the mutation.

func (*ViewBlockMutation) DatasetCleared

func (m *ViewBlockMutation) DatasetCleared() bool

DatasetCleared reports if the "dataset" edge to the DataSet entity was cleared.

func (*ViewBlockMutation) DatasetIDs

func (m *ViewBlockMutation) DatasetIDs() (ids []int)

DatasetIDs returns the "dataset" edge IDs in the mutation.

func (*ViewBlockMutation) EdgeCleared

func (m *ViewBlockMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*ViewBlockMutation) Field

func (m *ViewBlockMutation) Field(name string) (ent.Value, bool)

Field returns the value of a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*ViewBlockMutation) FieldCleared

func (m *ViewBlockMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*ViewBlockMutation) Fields

func (m *ViewBlockMutation) Fields() []string

Fields returns all fields that were changed during this mutation. Note that in order to get all numeric fields that were incremented/decremented, call AddedFields().

func (*ViewBlockMutation) GetType

func (m *ViewBlockMutation) GetType() (r string, exists bool)

GetType returns the value of the "type" field in the mutation.

func (*ViewBlockMutation) ID

func (m *ViewBlockMutation) ID() (id int, exists bool)

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder.

func (*ViewBlockMutation) OldConfig

func (m *ViewBlockMutation) OldConfig(ctx context.Context) (v string, err error)

OldConfig returns the old "config" field's value of the ViewBlock entity. If the ViewBlock object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*ViewBlockMutation) OldField

func (m *ViewBlockMutation) OldField(ctx context.Context, name string) (ent.Value, error)

OldField returns the old value of the field from the database. An error is returned if the mutation operation is not UpdateOne, or the query to the database failed.

func (*ViewBlockMutation) OldType

func (m *ViewBlockMutation) OldType(ctx context.Context) (v string, err error)

OldType returns the old "type" field's value of the ViewBlock entity. If the ViewBlock object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*ViewBlockMutation) Op

func (m *ViewBlockMutation) Op() Op

Op returns the operation name.

func (*ViewBlockMutation) RemoveDatasetIDs

func (m *ViewBlockMutation) RemoveDatasetIDs(ids ...int)

RemoveDatasetIDs removes the "dataset" edge to the DataSet entity by IDs.

func (*ViewBlockMutation) RemovedDatasetIDs

func (m *ViewBlockMutation) RemovedDatasetIDs() (ids []int)

RemovedDataset returns the removed IDs of the "dataset" edge to the DataSet entity.

func (*ViewBlockMutation) RemovedEdges

func (m *ViewBlockMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*ViewBlockMutation) RemovedIDs

func (m *ViewBlockMutation) RemovedIDs(name string) []ent.Value

RemovedIDs returns all IDs (to other nodes) that were removed for the edge with the given name in this mutation.

func (*ViewBlockMutation) ResetConfig

func (m *ViewBlockMutation) ResetConfig()

ResetConfig resets all changes to the "config" field.

func (*ViewBlockMutation) ResetDataset

func (m *ViewBlockMutation) ResetDataset()

ResetDataset resets all changes to the "dataset" edge.

func (*ViewBlockMutation) ResetEdge

func (m *ViewBlockMutation) ResetEdge(name string) error

ResetEdge resets all changes to the edge with the given name in this mutation. It returns an error if the edge is not defined in the schema.

func (*ViewBlockMutation) ResetField

func (m *ViewBlockMutation) ResetField(name string) error

ResetField resets all changes in the mutation for the field with the given name. It returns an error if the field is not defined in the schema.

func (*ViewBlockMutation) ResetType

func (m *ViewBlockMutation) ResetType()

ResetType resets all changes to the "type" field.

func (*ViewBlockMutation) ResetView

func (m *ViewBlockMutation) ResetView()

ResetView resets all changes to the "view" edge.

func (*ViewBlockMutation) SetConfig

func (m *ViewBlockMutation) SetConfig(s string)

SetConfig sets the "config" field.

func (*ViewBlockMutation) SetField

func (m *ViewBlockMutation) SetField(name string, value ent.Value) error

SetField sets the value of a field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*ViewBlockMutation) SetType

func (m *ViewBlockMutation) SetType(s string)

SetType sets the "type" field.

func (*ViewBlockMutation) SetViewID

func (m *ViewBlockMutation) SetViewID(id int)

SetViewID sets the "view" edge to the View entity by id.

func (ViewBlockMutation) Tx

func (m ViewBlockMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*ViewBlockMutation) Type

func (m *ViewBlockMutation) Type() string

Type returns the node type of this mutation (ViewBlock).

func (*ViewBlockMutation) ViewCleared

func (m *ViewBlockMutation) ViewCleared() bool

ViewCleared reports if the "view" edge to the View entity was cleared.

func (*ViewBlockMutation) ViewID

func (m *ViewBlockMutation) ViewID() (id int, exists bool)

ViewID returns the "view" edge ID in the mutation.

func (*ViewBlockMutation) ViewIDs

func (m *ViewBlockMutation) ViewIDs() (ids []int)

ViewIDs returns the "view" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use ViewID instead. It exists only for internal usage by the builders.

type ViewBlockQuery

type ViewBlockQuery struct {
	// contains filtered or unexported fields
}

ViewBlockQuery is the builder for querying ViewBlock entities.

func (*ViewBlockQuery) All

func (vbq *ViewBlockQuery) All(ctx context.Context) ([]*ViewBlock, error)

All executes the query and returns a list of ViewBlocks.

func (*ViewBlockQuery) AllX

func (vbq *ViewBlockQuery) AllX(ctx context.Context) []*ViewBlock

AllX is like All, but panics if an error occurs.

func (*ViewBlockQuery) Clone

func (vbq *ViewBlockQuery) Clone() *ViewBlockQuery

Clone returns a duplicate of the ViewBlockQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*ViewBlockQuery) Count

func (vbq *ViewBlockQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*ViewBlockQuery) CountX

func (vbq *ViewBlockQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*ViewBlockQuery) Exist

func (vbq *ViewBlockQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*ViewBlockQuery) ExistX

func (vbq *ViewBlockQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*ViewBlockQuery) First

func (vbq *ViewBlockQuery) First(ctx context.Context) (*ViewBlock, error)

First returns the first ViewBlock entity from the query. Returns a *NotFoundError when no ViewBlock was found.

func (*ViewBlockQuery) FirstID

func (vbq *ViewBlockQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first ViewBlock ID from the query. Returns a *NotFoundError when no ViewBlock ID was found.

func (*ViewBlockQuery) FirstIDX

func (vbq *ViewBlockQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*ViewBlockQuery) FirstX

func (vbq *ViewBlockQuery) FirstX(ctx context.Context) *ViewBlock

FirstX is like First, but panics if an error occurs.

func (*ViewBlockQuery) GroupBy

func (vbq *ViewBlockQuery) GroupBy(field string, fields ...string) *ViewBlockGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

Example:

var v []struct {
	Type string `json:"type,omitempty"`
	Count int `json:"count,omitempty"`
}

client.ViewBlock.Query().
	GroupBy(viewblock.FieldType).
	Aggregate(model.Count()).
	Scan(ctx, &v)

func (*ViewBlockQuery) IDs

func (vbq *ViewBlockQuery) IDs(ctx context.Context) ([]int, error)

IDs executes the query and returns a list of ViewBlock IDs.

func (*ViewBlockQuery) IDsX

func (vbq *ViewBlockQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*ViewBlockQuery) Limit

func (vbq *ViewBlockQuery) Limit(limit int) *ViewBlockQuery

Limit adds a limit step to the query.

func (*ViewBlockQuery) Offset

func (vbq *ViewBlockQuery) Offset(offset int) *ViewBlockQuery

Offset adds an offset step to the query.

func (*ViewBlockQuery) Only

func (vbq *ViewBlockQuery) Only(ctx context.Context) (*ViewBlock, error)

Only returns a single ViewBlock entity found by the query, ensuring it only returns one. Returns a *NotSingularError when exactly one ViewBlock entity is not found. Returns a *NotFoundError when no ViewBlock entities are found.

func (*ViewBlockQuery) OnlyID

func (vbq *ViewBlockQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only ViewBlock ID in the query. Returns a *NotSingularError when exactly one ViewBlock ID is not found. Returns a *NotFoundError when no entities are found.

func (*ViewBlockQuery) OnlyIDX

func (vbq *ViewBlockQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*ViewBlockQuery) OnlyX

func (vbq *ViewBlockQuery) OnlyX(ctx context.Context) *ViewBlock

OnlyX is like Only, but panics if an error occurs.

func (*ViewBlockQuery) Order

func (vbq *ViewBlockQuery) Order(o ...OrderFunc) *ViewBlockQuery

Order adds an order step to the query.

func (*ViewBlockQuery) QueryDataset

func (vbq *ViewBlockQuery) QueryDataset() *DataSetQuery

QueryDataset chains the current query on the "dataset" edge.

func (*ViewBlockQuery) QueryView

func (vbq *ViewBlockQuery) QueryView() *ViewQuery

QueryView chains the current query on the "view" edge.

func (*ViewBlockQuery) Select

func (vbq *ViewBlockQuery) Select(field string, fields ...string) *ViewBlockSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	Type string `json:"type,omitempty"`
}

client.ViewBlock.Query().
	Select(viewblock.FieldType).
	Scan(ctx, &v)

func (*ViewBlockQuery) Unique

func (vbq *ViewBlockQuery) Unique(unique bool) *ViewBlockQuery

Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.

func (*ViewBlockQuery) Where

func (vbq *ViewBlockQuery) Where(ps ...predicate.ViewBlock) *ViewBlockQuery

Where adds a new predicate for the ViewBlockQuery builder.

func (*ViewBlockQuery) WithDataset

func (vbq *ViewBlockQuery) WithDataset(opts ...func(*DataSetQuery)) *ViewBlockQuery

WithDataset tells the query-builder to eager-load the nodes that are connected to the "dataset" edge. The optional arguments are used to configure the query builder of the edge.

func (*ViewBlockQuery) WithView

func (vbq *ViewBlockQuery) WithView(opts ...func(*ViewQuery)) *ViewBlockQuery

WithView tells the query-builder to eager-load the nodes that are connected to the "view" edge. The optional arguments are used to configure the query builder of the edge.

type ViewBlockSelect

type ViewBlockSelect struct {
	*ViewBlockQuery
	// contains filtered or unexported fields
}

ViewBlockSelect is the builder for selecting fields of ViewBlock entities.

func (*ViewBlockSelect) Bool

func (vbs *ViewBlockSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*ViewBlockSelect) BoolX

func (vbs *ViewBlockSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*ViewBlockSelect) Bools

func (vbs *ViewBlockSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*ViewBlockSelect) BoolsX

func (vbs *ViewBlockSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*ViewBlockSelect) Float64

func (vbs *ViewBlockSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*ViewBlockSelect) Float64X

func (vbs *ViewBlockSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*ViewBlockSelect) Float64s

func (vbs *ViewBlockSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*ViewBlockSelect) Float64sX

func (vbs *ViewBlockSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*ViewBlockSelect) Int

func (vbs *ViewBlockSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*ViewBlockSelect) IntX

func (vbs *ViewBlockSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*ViewBlockSelect) Ints

func (vbs *ViewBlockSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*ViewBlockSelect) IntsX

func (vbs *ViewBlockSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*ViewBlockSelect) Scan

func (vbs *ViewBlockSelect) Scan(ctx context.Context, v interface{}) error

Scan applies the selector query and scans the result into the given value.

func (*ViewBlockSelect) ScanX

func (vbs *ViewBlockSelect) ScanX(ctx context.Context, v interface{})

ScanX is like Scan, but panics if an error occurs.

func (*ViewBlockSelect) String

func (vbs *ViewBlockSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*ViewBlockSelect) StringX

func (vbs *ViewBlockSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*ViewBlockSelect) Strings

func (vbs *ViewBlockSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*ViewBlockSelect) StringsX

func (vbs *ViewBlockSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type ViewBlockUpdate

type ViewBlockUpdate struct {
	// contains filtered or unexported fields
}

ViewBlockUpdate is the builder for updating ViewBlock entities.

func (*ViewBlockUpdate) AddDataset

func (vbu *ViewBlockUpdate) AddDataset(d ...*DataSet) *ViewBlockUpdate

AddDataset adds the "dataset" edges to the DataSet entity.

func (*ViewBlockUpdate) AddDatasetIDs

func (vbu *ViewBlockUpdate) AddDatasetIDs(ids ...int) *ViewBlockUpdate

AddDatasetIDs adds the "dataset" edge to the DataSet entity by IDs.

func (*ViewBlockUpdate) ClearDataset

func (vbu *ViewBlockUpdate) ClearDataset() *ViewBlockUpdate

ClearDataset clears all "dataset" edges to the DataSet entity.

func (*ViewBlockUpdate) ClearView

func (vbu *ViewBlockUpdate) ClearView() *ViewBlockUpdate

ClearView clears the "view" edge to the View entity.

func (*ViewBlockUpdate) Exec

func (vbu *ViewBlockUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*ViewBlockUpdate) ExecX

func (vbu *ViewBlockUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ViewBlockUpdate) Mutation

func (vbu *ViewBlockUpdate) Mutation() *ViewBlockMutation

Mutation returns the ViewBlockMutation object of the builder.

func (*ViewBlockUpdate) RemoveDataset

func (vbu *ViewBlockUpdate) RemoveDataset(d ...*DataSet) *ViewBlockUpdate

RemoveDataset removes "dataset" edges to DataSet entities.

func (*ViewBlockUpdate) RemoveDatasetIDs

func (vbu *ViewBlockUpdate) RemoveDatasetIDs(ids ...int) *ViewBlockUpdate

RemoveDatasetIDs removes the "dataset" edge to DataSet entities by IDs.

func (*ViewBlockUpdate) Save

func (vbu *ViewBlockUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*ViewBlockUpdate) SaveX

func (vbu *ViewBlockUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*ViewBlockUpdate) SetConfig

func (vbu *ViewBlockUpdate) SetConfig(s string) *ViewBlockUpdate

SetConfig sets the "config" field.

func (*ViewBlockUpdate) SetNillableViewID

func (vbu *ViewBlockUpdate) SetNillableViewID(id *int) *ViewBlockUpdate

SetNillableViewID sets the "view" edge to the View entity by ID if the given value is not nil.

func (*ViewBlockUpdate) SetType

func (vbu *ViewBlockUpdate) SetType(s string) *ViewBlockUpdate

SetType sets the "type" field.

func (*ViewBlockUpdate) SetView

func (vbu *ViewBlockUpdate) SetView(v *View) *ViewBlockUpdate

SetView sets the "view" edge to the View entity.

func (*ViewBlockUpdate) SetViewID

func (vbu *ViewBlockUpdate) SetViewID(id int) *ViewBlockUpdate

SetViewID sets the "view" edge to the View entity by ID.

func (*ViewBlockUpdate) Where

Where adds a new predicate for the ViewBlockUpdate builder.

type ViewBlockUpdateOne

type ViewBlockUpdateOne struct {
	// contains filtered or unexported fields
}

ViewBlockUpdateOne is the builder for updating a single ViewBlock entity.

func (*ViewBlockUpdateOne) AddDataset

func (vbuo *ViewBlockUpdateOne) AddDataset(d ...*DataSet) *ViewBlockUpdateOne

AddDataset adds the "dataset" edges to the DataSet entity.

func (*ViewBlockUpdateOne) AddDatasetIDs

func (vbuo *ViewBlockUpdateOne) AddDatasetIDs(ids ...int) *ViewBlockUpdateOne

AddDatasetIDs adds the "dataset" edge to the DataSet entity by IDs.

func (*ViewBlockUpdateOne) ClearDataset

func (vbuo *ViewBlockUpdateOne) ClearDataset() *ViewBlockUpdateOne

ClearDataset clears all "dataset" edges to the DataSet entity.

func (*ViewBlockUpdateOne) ClearView

func (vbuo *ViewBlockUpdateOne) ClearView() *ViewBlockUpdateOne

ClearView clears the "view" edge to the View entity.

func (*ViewBlockUpdateOne) Exec

func (vbuo *ViewBlockUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*ViewBlockUpdateOne) ExecX

func (vbuo *ViewBlockUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ViewBlockUpdateOne) Mutation

func (vbuo *ViewBlockUpdateOne) Mutation() *ViewBlockMutation

Mutation returns the ViewBlockMutation object of the builder.

func (*ViewBlockUpdateOne) RemoveDataset

func (vbuo *ViewBlockUpdateOne) RemoveDataset(d ...*DataSet) *ViewBlockUpdateOne

RemoveDataset removes "dataset" edges to DataSet entities.

func (*ViewBlockUpdateOne) RemoveDatasetIDs

func (vbuo *ViewBlockUpdateOne) RemoveDatasetIDs(ids ...int) *ViewBlockUpdateOne

RemoveDatasetIDs removes the "dataset" edge to DataSet entities by IDs.

func (*ViewBlockUpdateOne) Save

func (vbuo *ViewBlockUpdateOne) Save(ctx context.Context) (*ViewBlock, error)

Save executes the query and returns the updated ViewBlock entity.

func (*ViewBlockUpdateOne) SaveX

func (vbuo *ViewBlockUpdateOne) SaveX(ctx context.Context) *ViewBlock

SaveX is like Save, but panics if an error occurs.

func (*ViewBlockUpdateOne) Select

func (vbuo *ViewBlockUpdateOne) Select(field string, fields ...string) *ViewBlockUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*ViewBlockUpdateOne) SetConfig

func (vbuo *ViewBlockUpdateOne) SetConfig(s string) *ViewBlockUpdateOne

SetConfig sets the "config" field.

func (*ViewBlockUpdateOne) SetNillableViewID

func (vbuo *ViewBlockUpdateOne) SetNillableViewID(id *int) *ViewBlockUpdateOne

SetNillableViewID sets the "view" edge to the View entity by ID if the given value is not nil.

func (*ViewBlockUpdateOne) SetType

func (vbuo *ViewBlockUpdateOne) SetType(s string) *ViewBlockUpdateOne

SetType sets the "type" field.

func (*ViewBlockUpdateOne) SetView

func (vbuo *ViewBlockUpdateOne) SetView(v *View) *ViewBlockUpdateOne

SetView sets the "view" edge to the View entity.

func (*ViewBlockUpdateOne) SetViewID

func (vbuo *ViewBlockUpdateOne) SetViewID(id int) *ViewBlockUpdateOne

SetViewID sets the "view" edge to the View entity by ID.

type ViewBlocks

type ViewBlocks []*ViewBlock

ViewBlocks is a parsable slice of ViewBlock.

type ViewClient

type ViewClient struct {
	// contains filtered or unexported fields
}

ViewClient is a client for the View schema.

func NewViewClient

func NewViewClient(c config) *ViewClient

NewViewClient returns a client for the View from the given config.

func (*ViewClient) Create

func (c *ViewClient) Create() *ViewCreate

Create returns a create builder for View.

func (*ViewClient) CreateBulk

func (c *ViewClient) CreateBulk(builders ...*ViewCreate) *ViewCreateBulk

CreateBulk returns a builder for creating a bulk of View entities.

func (*ViewClient) Delete

func (c *ViewClient) Delete() *ViewDelete

Delete returns a delete builder for View.

func (*ViewClient) DeleteOne

func (c *ViewClient) DeleteOne(v *View) *ViewDeleteOne

DeleteOne returns a delete builder for the given entity.

func (*ViewClient) DeleteOneID

func (c *ViewClient) DeleteOneID(id int) *ViewDeleteOne

DeleteOneID returns a delete builder for the given id.

func (*ViewClient) Get

func (c *ViewClient) Get(ctx context.Context, id int) (*View, error)

Get returns a View entity by its id.

func (*ViewClient) GetX

func (c *ViewClient) GetX(ctx context.Context, id int) *View

GetX is like Get, but panics if an error occurs.

func (*ViewClient) Hooks

func (c *ViewClient) Hooks() []Hook

Hooks returns the client hooks.

func (*ViewClient) Query

func (c *ViewClient) Query() *ViewQuery

Query returns a query builder for View.

func (*ViewClient) QueryBg

func (c *ViewClient) QueryBg(v *View) *AssetsQuery

QueryBg queries the bg edge of a View.

func (*ViewClient) QueryBlocks

func (c *ViewClient) QueryBlocks(v *View) *ViewBlockQuery

QueryBlocks queries the blocks edge of a View.

func (*ViewClient) QueryShare

func (c *ViewClient) QueryShare(v *View) *ShareQuery

QueryShare queries the share edge of a View.

func (*ViewClient) Update

func (c *ViewClient) Update() *ViewUpdate

Update returns an update builder for View.

func (*ViewClient) UpdateOne

func (c *ViewClient) UpdateOne(v *View) *ViewUpdateOne

UpdateOne returns an update builder for the given entity.

func (*ViewClient) UpdateOneID

func (c *ViewClient) UpdateOneID(id int) *ViewUpdateOne

UpdateOneID returns an update builder for the given id.

func (*ViewClient) Use

func (c *ViewClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `view.Hooks(f(g(h())))`.

type ViewCreate

type ViewCreate struct {
	// contains filtered or unexported fields
}

ViewCreate is the builder for creating a View entity.

func (*ViewCreate) AddBlockIDs

func (vc *ViewCreate) AddBlockIDs(ids ...int) *ViewCreate

AddBlockIDs adds the "blocks" edge to the ViewBlock entity by IDs.

func (*ViewCreate) AddBlocks

func (vc *ViewCreate) AddBlocks(v ...*ViewBlock) *ViewCreate

AddBlocks adds the "blocks" edges to the ViewBlock entity.

func (*ViewCreate) AddShare

func (vc *ViewCreate) AddShare(s ...*Share) *ViewCreate

AddShare adds the "share" edges to the Share entity.

func (*ViewCreate) AddShareIDs

func (vc *ViewCreate) AddShareIDs(ids ...int) *ViewCreate

AddShareIDs adds the "share" edge to the Share entity by IDs.

func (*ViewCreate) Mutation

func (vc *ViewCreate) Mutation() *ViewMutation

Mutation returns the ViewMutation object of the builder.

func (*ViewCreate) Save

func (vc *ViewCreate) Save(ctx context.Context) (*View, error)

Save creates the View in the database.

func (*ViewCreate) SaveX

func (vc *ViewCreate) SaveX(ctx context.Context) *View

SaveX calls Save and panics if Save returns an error.

func (*ViewCreate) SetBg

func (vc *ViewCreate) SetBg(a *Assets) *ViewCreate

SetBg sets the "bg" edge to the Assets entity.

func (*ViewCreate) SetBgID

func (vc *ViewCreate) SetBgID(id int) *ViewCreate

SetBgID sets the "bg" edge to the Assets entity by ID.

func (*ViewCreate) SetConfig

func (vc *ViewCreate) SetConfig(s string) *ViewCreate

SetConfig sets the "config" field.

func (*ViewCreate) SetDesc

func (vc *ViewCreate) SetDesc(s string) *ViewCreate

SetDesc sets the "desc" field.

func (*ViewCreate) SetNillableBgID

func (vc *ViewCreate) SetNillableBgID(id *int) *ViewCreate

SetNillableBgID sets the "bg" edge to the Assets entity by ID if the given value is not nil.

type ViewCreateBulk

type ViewCreateBulk struct {
	// contains filtered or unexported fields
}

ViewCreateBulk is the builder for creating many View entities in bulk.

func (*ViewCreateBulk) Save

func (vcb *ViewCreateBulk) Save(ctx context.Context) ([]*View, error)

Save creates the View entities in the database.

func (*ViewCreateBulk) SaveX

func (vcb *ViewCreateBulk) SaveX(ctx context.Context) []*View

SaveX is like Save, but panics if an error occurs.

type ViewDelete

type ViewDelete struct {
	// contains filtered or unexported fields
}

ViewDelete is the builder for deleting a View entity.

func (*ViewDelete) Exec

func (vd *ViewDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*ViewDelete) ExecX

func (vd *ViewDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*ViewDelete) Where

func (vd *ViewDelete) Where(ps ...predicate.View) *ViewDelete

Where adds a new predicate to the ViewDelete builder.

type ViewDeleteOne

type ViewDeleteOne struct {
	// contains filtered or unexported fields
}

ViewDeleteOne is the builder for deleting a single View entity.

func (*ViewDeleteOne) Exec

func (vdo *ViewDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*ViewDeleteOne) ExecX

func (vdo *ViewDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

type ViewEdges

type ViewEdges struct {
	// Bg holds the value of the bg edge.
	Bg *Assets `json:"bg,omitempty"`
	// Blocks holds the value of the blocks edge.
	Blocks []*ViewBlock `json:"blocks,omitempty"`
	// Share holds the value of the share edge.
	Share []*Share `json:"share,omitempty"`
	// contains filtered or unexported fields
}

ViewEdges holds the relations/edges for other nodes in the graph.

func (ViewEdges) BgOrErr

func (e ViewEdges) BgOrErr() (*Assets, error)

BgOrErr returns the Bg value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

func (ViewEdges) BlocksOrErr

func (e ViewEdges) BlocksOrErr() ([]*ViewBlock, error)

BlocksOrErr returns the Blocks value or an error if the edge was not loaded in eager-loading.

func (ViewEdges) ShareOrErr

func (e ViewEdges) ShareOrErr() ([]*Share, error)

ShareOrErr returns the Share value or an error if the edge was not loaded in eager-loading.

type ViewGroupBy

type ViewGroupBy struct {
	// contains filtered or unexported fields
}

ViewGroupBy is the group-by builder for View entities.

func (*ViewGroupBy) Aggregate

func (vgb *ViewGroupBy) Aggregate(fns ...AggregateFunc) *ViewGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*ViewGroupBy) Bool

func (vgb *ViewGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a group-by query. It is only allowed when executing a group-by query with one field.

func (*ViewGroupBy) BoolX

func (vgb *ViewGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*ViewGroupBy) Bools

func (vgb *ViewGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from group-by. It is only allowed when executing a group-by query with one field.

func (*ViewGroupBy) BoolsX

func (vgb *ViewGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*ViewGroupBy) Float64

func (vgb *ViewGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a group-by query. It is only allowed when executing a group-by query with one field.

func (*ViewGroupBy) Float64X

func (vgb *ViewGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*ViewGroupBy) Float64s

func (vgb *ViewGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from group-by. It is only allowed when executing a group-by query with one field.

func (*ViewGroupBy) Float64sX

func (vgb *ViewGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*ViewGroupBy) Int

func (vgb *ViewGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a group-by query. It is only allowed when executing a group-by query with one field.

func (*ViewGroupBy) IntX

func (vgb *ViewGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*ViewGroupBy) Ints

func (vgb *ViewGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from group-by. It is only allowed when executing a group-by query with one field.

func (*ViewGroupBy) IntsX

func (vgb *ViewGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*ViewGroupBy) Scan

func (vgb *ViewGroupBy) Scan(ctx context.Context, v interface{}) error

Scan applies the group-by query and scans the result into the given value.

func (*ViewGroupBy) ScanX

func (vgb *ViewGroupBy) ScanX(ctx context.Context, v interface{})

ScanX is like Scan, but panics if an error occurs.

func (*ViewGroupBy) String

func (vgb *ViewGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a group-by query. It is only allowed when executing a group-by query with one field.

func (*ViewGroupBy) StringX

func (vgb *ViewGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*ViewGroupBy) Strings

func (vgb *ViewGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from group-by. It is only allowed when executing a group-by query with one field.

func (*ViewGroupBy) StringsX

func (vgb *ViewGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type ViewMutation

type ViewMutation struct {
	// contains filtered or unexported fields
}

ViewMutation represents an operation that mutates the View nodes in the graph.

func (*ViewMutation) AddBlockIDs

func (m *ViewMutation) AddBlockIDs(ids ...int)

AddBlockIDs adds the "blocks" edge to the ViewBlock entity by ids.

func (*ViewMutation) AddField

func (m *ViewMutation) AddField(name string, value ent.Value) error

AddField adds the value to the field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*ViewMutation) AddShareIDs

func (m *ViewMutation) AddShareIDs(ids ...int)

AddShareIDs adds the "share" edge to the Share entity by ids.

func (*ViewMutation) AddedEdges

func (m *ViewMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*ViewMutation) AddedField

func (m *ViewMutation) AddedField(name string) (ent.Value, bool)

AddedField returns the numeric value that was incremented/decremented on a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*ViewMutation) AddedFields

func (m *ViewMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*ViewMutation) AddedIDs

func (m *ViewMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*ViewMutation) BgCleared

func (m *ViewMutation) BgCleared() bool

BgCleared reports if the "bg" edge to the Assets entity was cleared.

func (*ViewMutation) BgID

func (m *ViewMutation) BgID() (id int, exists bool)

BgID returns the "bg" edge ID in the mutation.

func (*ViewMutation) BgIDs

func (m *ViewMutation) BgIDs() (ids []int)

BgIDs returns the "bg" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use BgID instead. It exists only for internal usage by the builders.

func (*ViewMutation) BlocksCleared

func (m *ViewMutation) BlocksCleared() bool

BlocksCleared reports if the "blocks" edge to the ViewBlock entity was cleared.

func (*ViewMutation) BlocksIDs

func (m *ViewMutation) BlocksIDs() (ids []int)

BlocksIDs returns the "blocks" edge IDs in the mutation.

func (*ViewMutation) ClearBg

func (m *ViewMutation) ClearBg()

ClearBg clears the "bg" edge to the Assets entity.

func (*ViewMutation) ClearBlocks

func (m *ViewMutation) ClearBlocks()

ClearBlocks clears the "blocks" edge to the ViewBlock entity.

func (*ViewMutation) ClearEdge

func (m *ViewMutation) ClearEdge(name string) error

ClearEdge clears the value of the edge with the given name. It returns an error if that edge is not defined in the schema.

func (*ViewMutation) ClearField

func (m *ViewMutation) ClearField(name string) error

ClearField clears the value of the field with the given name. It returns an error if the field is not defined in the schema.

func (*ViewMutation) ClearShare

func (m *ViewMutation) ClearShare()

ClearShare clears the "share" edge to the Share entity.

func (*ViewMutation) ClearedEdges

func (m *ViewMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*ViewMutation) ClearedFields

func (m *ViewMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (ViewMutation) Client

func (m ViewMutation) 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 (*ViewMutation) Config

func (m *ViewMutation) Config() (r string, exists bool)

Config returns the value of the "config" field in the mutation.

func (*ViewMutation) Desc

func (m *ViewMutation) Desc() (r string, exists bool)

Desc returns the value of the "desc" field in the mutation.

func (*ViewMutation) EdgeCleared

func (m *ViewMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*ViewMutation) Field

func (m *ViewMutation) Field(name string) (ent.Value, bool)

Field returns the value of a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*ViewMutation) FieldCleared

func (m *ViewMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*ViewMutation) Fields

func (m *ViewMutation) Fields() []string

Fields returns all fields that were changed during this mutation. Note that in order to get all numeric fields that were incremented/decremented, call AddedFields().

func (*ViewMutation) ID

func (m *ViewMutation) ID() (id int, exists bool)

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder.

func (*ViewMutation) OldConfig

func (m *ViewMutation) OldConfig(ctx context.Context) (v string, err error)

OldConfig returns the old "config" field's value of the View entity. If the View object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*ViewMutation) OldDesc

func (m *ViewMutation) OldDesc(ctx context.Context) (v string, err error)

OldDesc returns the old "desc" field's value of the View entity. If the View object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*ViewMutation) OldField

func (m *ViewMutation) OldField(ctx context.Context, name string) (ent.Value, error)

OldField returns the old value of the field from the database. An error is returned if the mutation operation is not UpdateOne, or the query to the database failed.

func (*ViewMutation) Op

func (m *ViewMutation) Op() Op

Op returns the operation name.

func (*ViewMutation) RemoveBlockIDs

func (m *ViewMutation) RemoveBlockIDs(ids ...int)

RemoveBlockIDs removes the "blocks" edge to the ViewBlock entity by IDs.

func (*ViewMutation) RemoveShareIDs

func (m *ViewMutation) RemoveShareIDs(ids ...int)

RemoveShareIDs removes the "share" edge to the Share entity by IDs.

func (*ViewMutation) RemovedBlocksIDs

func (m *ViewMutation) RemovedBlocksIDs() (ids []int)

RemovedBlocks returns the removed IDs of the "blocks" edge to the ViewBlock entity.

func (*ViewMutation) RemovedEdges

func (m *ViewMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*ViewMutation) RemovedIDs

func (m *ViewMutation) RemovedIDs(name string) []ent.Value

RemovedIDs returns all IDs (to other nodes) that were removed for the edge with the given name in this mutation.

func (*ViewMutation) RemovedShareIDs

func (m *ViewMutation) RemovedShareIDs() (ids []int)

RemovedShare returns the removed IDs of the "share" edge to the Share entity.

func (*ViewMutation) ResetBg

func (m *ViewMutation) ResetBg()

ResetBg resets all changes to the "bg" edge.

func (*ViewMutation) ResetBlocks

func (m *ViewMutation) ResetBlocks()

ResetBlocks resets all changes to the "blocks" edge.

func (*ViewMutation) ResetConfig

func (m *ViewMutation) ResetConfig()

ResetConfig resets all changes to the "config" field.

func (*ViewMutation) ResetDesc

func (m *ViewMutation) ResetDesc()

ResetDesc resets all changes to the "desc" field.

func (*ViewMutation) ResetEdge

func (m *ViewMutation) ResetEdge(name string) error

ResetEdge resets all changes to the edge with the given name in this mutation. It returns an error if the edge is not defined in the schema.

func (*ViewMutation) ResetField

func (m *ViewMutation) ResetField(name string) error

ResetField resets all changes in the mutation for the field with the given name. It returns an error if the field is not defined in the schema.

func (*ViewMutation) ResetShare

func (m *ViewMutation) ResetShare()

ResetShare resets all changes to the "share" edge.

func (*ViewMutation) SetBgID

func (m *ViewMutation) SetBgID(id int)

SetBgID sets the "bg" edge to the Assets entity by id.

func (*ViewMutation) SetConfig

func (m *ViewMutation) SetConfig(s string)

SetConfig sets the "config" field.

func (*ViewMutation) SetDesc

func (m *ViewMutation) SetDesc(s string)

SetDesc sets the "desc" field.

func (*ViewMutation) SetField

func (m *ViewMutation) SetField(name string, value ent.Value) error

SetField sets the value of a field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*ViewMutation) ShareCleared

func (m *ViewMutation) ShareCleared() bool

ShareCleared reports if the "share" edge to the Share entity was cleared.

func (*ViewMutation) ShareIDs

func (m *ViewMutation) ShareIDs() (ids []int)

ShareIDs returns the "share" edge IDs in the mutation.

func (ViewMutation) Tx

func (m ViewMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*ViewMutation) Type

func (m *ViewMutation) Type() string

Type returns the node type of this mutation (View).

type ViewQuery

type ViewQuery struct {
	// contains filtered or unexported fields
}

ViewQuery is the builder for querying View entities.

func (*ViewQuery) All

func (vq *ViewQuery) All(ctx context.Context) ([]*View, error)

All executes the query and returns a list of Views.

func (*ViewQuery) AllX

func (vq *ViewQuery) AllX(ctx context.Context) []*View

AllX is like All, but panics if an error occurs.

func (*ViewQuery) Clone

func (vq *ViewQuery) Clone() *ViewQuery

Clone returns a duplicate of the ViewQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*ViewQuery) Count

func (vq *ViewQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*ViewQuery) CountX

func (vq *ViewQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*ViewQuery) Exist

func (vq *ViewQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*ViewQuery) ExistX

func (vq *ViewQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*ViewQuery) First

func (vq *ViewQuery) First(ctx context.Context) (*View, error)

First returns the first View entity from the query. Returns a *NotFoundError when no View was found.

func (*ViewQuery) FirstID

func (vq *ViewQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first View ID from the query. Returns a *NotFoundError when no View ID was found.

func (*ViewQuery) FirstIDX

func (vq *ViewQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*ViewQuery) FirstX

func (vq *ViewQuery) FirstX(ctx context.Context) *View

FirstX is like First, but panics if an error occurs.

func (*ViewQuery) GroupBy

func (vq *ViewQuery) GroupBy(field string, fields ...string) *ViewGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

Example:

var v []struct {
	Desc string `json:"desc,omitempty"`
	Count int `json:"count,omitempty"`
}

client.View.Query().
	GroupBy(view.FieldDesc).
	Aggregate(model.Count()).
	Scan(ctx, &v)

func (*ViewQuery) IDs

func (vq *ViewQuery) IDs(ctx context.Context) ([]int, error)

IDs executes the query and returns a list of View IDs.

func (*ViewQuery) IDsX

func (vq *ViewQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*ViewQuery) Limit

func (vq *ViewQuery) Limit(limit int) *ViewQuery

Limit adds a limit step to the query.

func (*ViewQuery) Offset

func (vq *ViewQuery) Offset(offset int) *ViewQuery

Offset adds an offset step to the query.

func (*ViewQuery) Only

func (vq *ViewQuery) Only(ctx context.Context) (*View, error)

Only returns a single View entity found by the query, ensuring it only returns one. Returns a *NotSingularError when exactly one View entity is not found. Returns a *NotFoundError when no View entities are found.

func (*ViewQuery) OnlyID

func (vq *ViewQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only View ID in the query. Returns a *NotSingularError when exactly one View ID is not found. Returns a *NotFoundError when no entities are found.

func (*ViewQuery) OnlyIDX

func (vq *ViewQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*ViewQuery) OnlyX

func (vq *ViewQuery) OnlyX(ctx context.Context) *View

OnlyX is like Only, but panics if an error occurs.

func (*ViewQuery) Order

func (vq *ViewQuery) Order(o ...OrderFunc) *ViewQuery

Order adds an order step to the query.

func (*ViewQuery) QueryBg

func (vq *ViewQuery) QueryBg() *AssetsQuery

QueryBg chains the current query on the "bg" edge.

func (*ViewQuery) QueryBlocks

func (vq *ViewQuery) QueryBlocks() *ViewBlockQuery

QueryBlocks chains the current query on the "blocks" edge.

func (*ViewQuery) QueryShare

func (vq *ViewQuery) QueryShare() *ShareQuery

QueryShare chains the current query on the "share" edge.

func (*ViewQuery) Select

func (vq *ViewQuery) Select(field string, fields ...string) *ViewSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	Desc string `json:"desc,omitempty"`
}

client.View.Query().
	Select(view.FieldDesc).
	Scan(ctx, &v)

func (*ViewQuery) Unique

func (vq *ViewQuery) Unique(unique bool) *ViewQuery

Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.

func (*ViewQuery) Where

func (vq *ViewQuery) Where(ps ...predicate.View) *ViewQuery

Where adds a new predicate for the ViewQuery builder.

func (*ViewQuery) WithBg

func (vq *ViewQuery) WithBg(opts ...func(*AssetsQuery)) *ViewQuery

WithBg tells the query-builder to eager-load the nodes that are connected to the "bg" edge. The optional arguments are used to configure the query builder of the edge.

func (*ViewQuery) WithBlocks

func (vq *ViewQuery) WithBlocks(opts ...func(*ViewBlockQuery)) *ViewQuery

WithBlocks tells the query-builder to eager-load the nodes that are connected to the "blocks" edge. The optional arguments are used to configure the query builder of the edge.

func (*ViewQuery) WithShare

func (vq *ViewQuery) WithShare(opts ...func(*ShareQuery)) *ViewQuery

WithShare tells the query-builder to eager-load the nodes that are connected to the "share" edge. The optional arguments are used to configure the query builder of the edge.

type ViewSelect

type ViewSelect struct {
	*ViewQuery
	// contains filtered or unexported fields
}

ViewSelect is the builder for selecting fields of View entities.

func (*ViewSelect) Bool

func (vs *ViewSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*ViewSelect) BoolX

func (vs *ViewSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*ViewSelect) Bools

func (vs *ViewSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*ViewSelect) BoolsX

func (vs *ViewSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*ViewSelect) Float64

func (vs *ViewSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*ViewSelect) Float64X

func (vs *ViewSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*ViewSelect) Float64s

func (vs *ViewSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*ViewSelect) Float64sX

func (vs *ViewSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*ViewSelect) Int

func (vs *ViewSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*ViewSelect) IntX

func (vs *ViewSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*ViewSelect) Ints

func (vs *ViewSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*ViewSelect) IntsX

func (vs *ViewSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*ViewSelect) Scan

func (vs *ViewSelect) Scan(ctx context.Context, v interface{}) error

Scan applies the selector query and scans the result into the given value.

func (*ViewSelect) ScanX

func (vs *ViewSelect) ScanX(ctx context.Context, v interface{})

ScanX is like Scan, but panics if an error occurs.

func (*ViewSelect) String

func (vs *ViewSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*ViewSelect) StringX

func (vs *ViewSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*ViewSelect) Strings

func (vs *ViewSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*ViewSelect) StringsX

func (vs *ViewSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type ViewUpdate

type ViewUpdate struct {
	// contains filtered or unexported fields
}

ViewUpdate is the builder for updating View entities.

func (*ViewUpdate) AddBlockIDs

func (vu *ViewUpdate) AddBlockIDs(ids ...int) *ViewUpdate

AddBlockIDs adds the "blocks" edge to the ViewBlock entity by IDs.

func (*ViewUpdate) AddBlocks

func (vu *ViewUpdate) AddBlocks(v ...*ViewBlock) *ViewUpdate

AddBlocks adds the "blocks" edges to the ViewBlock entity.

func (*ViewUpdate) AddShare

func (vu *ViewUpdate) AddShare(s ...*Share) *ViewUpdate

AddShare adds the "share" edges to the Share entity.

func (*ViewUpdate) AddShareIDs

func (vu *ViewUpdate) AddShareIDs(ids ...int) *ViewUpdate

AddShareIDs adds the "share" edge to the Share entity by IDs.

func (*ViewUpdate) ClearBg

func (vu *ViewUpdate) ClearBg() *ViewUpdate

ClearBg clears the "bg" edge to the Assets entity.

func (*ViewUpdate) ClearBlocks

func (vu *ViewUpdate) ClearBlocks() *ViewUpdate

ClearBlocks clears all "blocks" edges to the ViewBlock entity.

func (*ViewUpdate) ClearShare

func (vu *ViewUpdate) ClearShare() *ViewUpdate

ClearShare clears all "share" edges to the Share entity.

func (*ViewUpdate) Exec

func (vu *ViewUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*ViewUpdate) ExecX

func (vu *ViewUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ViewUpdate) Mutation

func (vu *ViewUpdate) Mutation() *ViewMutation

Mutation returns the ViewMutation object of the builder.

func (*ViewUpdate) RemoveBlockIDs

func (vu *ViewUpdate) RemoveBlockIDs(ids ...int) *ViewUpdate

RemoveBlockIDs removes the "blocks" edge to ViewBlock entities by IDs.

func (*ViewUpdate) RemoveBlocks

func (vu *ViewUpdate) RemoveBlocks(v ...*ViewBlock) *ViewUpdate

RemoveBlocks removes "blocks" edges to ViewBlock entities.

func (*ViewUpdate) RemoveShare

func (vu *ViewUpdate) RemoveShare(s ...*Share) *ViewUpdate

RemoveShare removes "share" edges to Share entities.

func (*ViewUpdate) RemoveShareIDs

func (vu *ViewUpdate) RemoveShareIDs(ids ...int) *ViewUpdate

RemoveShareIDs removes the "share" edge to Share entities by IDs.

func (*ViewUpdate) Save

func (vu *ViewUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*ViewUpdate) SaveX

func (vu *ViewUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*ViewUpdate) SetBg

func (vu *ViewUpdate) SetBg(a *Assets) *ViewUpdate

SetBg sets the "bg" edge to the Assets entity.

func (*ViewUpdate) SetBgID

func (vu *ViewUpdate) SetBgID(id int) *ViewUpdate

SetBgID sets the "bg" edge to the Assets entity by ID.

func (*ViewUpdate) SetConfig

func (vu *ViewUpdate) SetConfig(s string) *ViewUpdate

SetConfig sets the "config" field.

func (*ViewUpdate) SetDesc

func (vu *ViewUpdate) SetDesc(s string) *ViewUpdate

SetDesc sets the "desc" field.

func (*ViewUpdate) SetNillableBgID

func (vu *ViewUpdate) SetNillableBgID(id *int) *ViewUpdate

SetNillableBgID sets the "bg" edge to the Assets entity by ID if the given value is not nil.

func (*ViewUpdate) Where

func (vu *ViewUpdate) Where(ps ...predicate.View) *ViewUpdate

Where adds a new predicate for the ViewUpdate builder.

type ViewUpdateOne

type ViewUpdateOne struct {
	// contains filtered or unexported fields
}

ViewUpdateOne is the builder for updating a single View entity.

func (*ViewUpdateOne) AddBlockIDs

func (vuo *ViewUpdateOne) AddBlockIDs(ids ...int) *ViewUpdateOne

AddBlockIDs adds the "blocks" edge to the ViewBlock entity by IDs.

func (*ViewUpdateOne) AddBlocks

func (vuo *ViewUpdateOne) AddBlocks(v ...*ViewBlock) *ViewUpdateOne

AddBlocks adds the "blocks" edges to the ViewBlock entity.

func (*ViewUpdateOne) AddShare

func (vuo *ViewUpdateOne) AddShare(s ...*Share) *ViewUpdateOne

AddShare adds the "share" edges to the Share entity.

func (*ViewUpdateOne) AddShareIDs

func (vuo *ViewUpdateOne) AddShareIDs(ids ...int) *ViewUpdateOne

AddShareIDs adds the "share" edge to the Share entity by IDs.

func (*ViewUpdateOne) ClearBg

func (vuo *ViewUpdateOne) ClearBg() *ViewUpdateOne

ClearBg clears the "bg" edge to the Assets entity.

func (*ViewUpdateOne) ClearBlocks

func (vuo *ViewUpdateOne) ClearBlocks() *ViewUpdateOne

ClearBlocks clears all "blocks" edges to the ViewBlock entity.

func (*ViewUpdateOne) ClearShare

func (vuo *ViewUpdateOne) ClearShare() *ViewUpdateOne

ClearShare clears all "share" edges to the Share entity.

func (*ViewUpdateOne) Exec

func (vuo *ViewUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*ViewUpdateOne) ExecX

func (vuo *ViewUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ViewUpdateOne) Mutation

func (vuo *ViewUpdateOne) Mutation() *ViewMutation

Mutation returns the ViewMutation object of the builder.

func (*ViewUpdateOne) RemoveBlockIDs

func (vuo *ViewUpdateOne) RemoveBlockIDs(ids ...int) *ViewUpdateOne

RemoveBlockIDs removes the "blocks" edge to ViewBlock entities by IDs.

func (*ViewUpdateOne) RemoveBlocks

func (vuo *ViewUpdateOne) RemoveBlocks(v ...*ViewBlock) *ViewUpdateOne

RemoveBlocks removes "blocks" edges to ViewBlock entities.

func (*ViewUpdateOne) RemoveShare

func (vuo *ViewUpdateOne) RemoveShare(s ...*Share) *ViewUpdateOne

RemoveShare removes "share" edges to Share entities.

func (*ViewUpdateOne) RemoveShareIDs

func (vuo *ViewUpdateOne) RemoveShareIDs(ids ...int) *ViewUpdateOne

RemoveShareIDs removes the "share" edge to Share entities by IDs.

func (*ViewUpdateOne) Save

func (vuo *ViewUpdateOne) Save(ctx context.Context) (*View, error)

Save executes the query and returns the updated View entity.

func (*ViewUpdateOne) SaveX

func (vuo *ViewUpdateOne) SaveX(ctx context.Context) *View

SaveX is like Save, but panics if an error occurs.

func (*ViewUpdateOne) Select

func (vuo *ViewUpdateOne) Select(field string, fields ...string) *ViewUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*ViewUpdateOne) SetBg

func (vuo *ViewUpdateOne) SetBg(a *Assets) *ViewUpdateOne

SetBg sets the "bg" edge to the Assets entity.

func (*ViewUpdateOne) SetBgID

func (vuo *ViewUpdateOne) SetBgID(id int) *ViewUpdateOne

SetBgID sets the "bg" edge to the Assets entity by ID.

func (*ViewUpdateOne) SetConfig

func (vuo *ViewUpdateOne) SetConfig(s string) *ViewUpdateOne

SetConfig sets the "config" field.

func (*ViewUpdateOne) SetDesc

func (vuo *ViewUpdateOne) SetDesc(s string) *ViewUpdateOne

SetDesc sets the "desc" field.

func (*ViewUpdateOne) SetNillableBgID

func (vuo *ViewUpdateOne) SetNillableBgID(id *int) *ViewUpdateOne

SetNillableBgID sets the "bg" edge to the Assets entity by ID if the given value is not nil.

type Views

type Views []*View

Views is a parsable slice of View.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL