ent

package
v0.0.0-...-296dcb9 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2023 License: MIT Imports: 22 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.
	TypeBook     = "Book"
	TypeCustomer = "Customer"
)

Variables

This section is empty.

Functions

func BookFactory

func BookFactory(opts ...Opt) *factory.Factory

func CustomerFactory

func CustomerFactory(opts ...Opt) *factory.Factory

func EmbedClient

func EmbedClient(ctx *context.Context, v *Client)

func IsConstraintError

func IsConstraintError(err error) bool

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

func IsNotFound

func IsNotFound(err error) bool

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

func IsNotLoaded

func IsNotLoaded(err error) bool

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

func IsNotSingular

func IsNotSingular(err error) bool

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

func IsValidationError

func IsValidationError(err error) bool

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

func MaskNotFound

func MaskNotFound(err error) error

MaskNotFound masks not found error.

func NewContext

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

NewContext returns a new context with the given Client attached.

func NewTxContext

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

NewTxContext returns a new context with the given Tx attached.

func Zero

func Zero[T any]() T

Types

type AggregateFunc

type AggregateFunc func(*sql.Selector) string

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

func As

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

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

func Count

func Count() AggregateFunc

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

func Max

func Max(field string) AggregateFunc

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

func Mean

func Mean(field string) AggregateFunc

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

func Min

func Min(field string) AggregateFunc

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

func Sum

func Sum(field string) AggregateFunc

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

type Book

type Book struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the BookQuery when eager-loading is set.
	Edges BookEdges `json:"edges"`
	// contains filtered or unexported fields
}

Book is the model entity for the Book schema.

func (*Book) QueryOwner

func (b *Book) QueryOwner() *CustomerQuery

QueryOwner queries the "owner" edge of the Book entity.

func (*Book) String

func (b *Book) String() string

String implements the fmt.Stringer.

func (*Book) Unwrap

func (b *Book) Unwrap() *Book

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

func (b *Book) Update() *BookUpdateOne

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

type BookClient

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

BookClient is a client for the Book schema.

func NewBookClient

func NewBookClient(c config) *BookClient

NewBookClient returns a client for the Book from the given config.

func (*BookClient) Create

func (c *BookClient) Create() *BookCreate

Create returns a builder for creating a Book entity.

func (*BookClient) CreateBulk

func (c *BookClient) CreateBulk(builders ...*BookCreate) *BookCreateBulk

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

func (*BookClient) Delete

func (c *BookClient) Delete() *BookDelete

Delete returns a delete builder for Book.

func (*BookClient) DeleteOne

func (c *BookClient) DeleteOne(b *Book) *BookDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*BookClient) DeleteOneID

func (c *BookClient) DeleteOneID(id int) *BookDeleteOne

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

func (*BookClient) Get

func (c *BookClient) Get(ctx context.Context, id int) (*Book, error)

Get returns a Book entity by its id.

func (*BookClient) GetX

func (c *BookClient) GetX(ctx context.Context, id int) *Book

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

func (*BookClient) Hooks

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

Hooks returns the client hooks.

func (*BookClient) Intercept

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

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

func (*BookClient) Interceptors

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

Interceptors returns the client interceptors.

func (*BookClient) Query

func (c *BookClient) Query() *BookQuery

Query returns a query builder for Book.

func (*BookClient) QueryOwner

func (c *BookClient) QueryOwner(b *Book) *CustomerQuery

QueryOwner queries the owner edge of a Book.

func (*BookClient) Update

func (c *BookClient) Update() *BookUpdate

Update returns an update builder for Book.

func (*BookClient) UpdateOne

func (c *BookClient) UpdateOne(b *Book) *BookUpdateOne

UpdateOne returns an update builder for the given entity.

func (*BookClient) UpdateOneID

func (c *BookClient) UpdateOneID(id int) *BookUpdateOne

UpdateOneID returns an update builder for the given id.

func (*BookClient) Use

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

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

type BookCreate

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

BookCreate is the builder for creating a Book entity.

func (*BookCreate) Exec

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

Exec executes the query.

func (*BookCreate) ExecX

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

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

func (*BookCreate) Mutation

func (bc *BookCreate) Mutation() *BookMutation

Mutation returns the BookMutation object of the builder.

func (*BookCreate) Save

func (bc *BookCreate) Save(ctx context.Context) (*Book, error)

Save creates the Book in the database.

func (*BookCreate) SaveX

func (bc *BookCreate) SaveX(ctx context.Context) *Book

SaveX calls Save and panics if Save returns an error.

func (*BookCreate) SetNillableOwnerID

func (bc *BookCreate) SetNillableOwnerID(id *int) *BookCreate

SetNillableOwnerID sets the "owner" edge to the Customer entity by ID if the given value is not nil.

func (*BookCreate) SetOwner

func (bc *BookCreate) SetOwner(c *Customer) *BookCreate

SetOwner sets the "owner" edge to the Customer entity.

func (*BookCreate) SetOwnerID

func (bc *BookCreate) SetOwnerID(id int) *BookCreate

SetOwnerID sets the "owner" edge to the Customer entity by ID.

type BookCreateBulk

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

BookCreateBulk is the builder for creating many Book entities in bulk.

func (*BookCreateBulk) Exec

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

Exec executes the query.

func (*BookCreateBulk) ExecX

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

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

func (*BookCreateBulk) Save

func (bcb *BookCreateBulk) Save(ctx context.Context) ([]*Book, error)

Save creates the Book entities in the database.

func (*BookCreateBulk) SaveX

func (bcb *BookCreateBulk) SaveX(ctx context.Context) []*Book

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

type BookDelete

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

BookDelete is the builder for deleting a Book entity.

func (*BookDelete) Exec

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

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

func (*BookDelete) ExecX

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

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

func (*BookDelete) Where

func (bd *BookDelete) Where(ps ...predicate.Book) *BookDelete

Where appends a list predicates to the BookDelete builder.

type BookDeleteOne

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

BookDeleteOne is the builder for deleting a single Book entity.

func (*BookDeleteOne) Exec

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

Exec executes the deletion query.

func (*BookDeleteOne) ExecX

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

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

func (*BookDeleteOne) Where

func (bdo *BookDeleteOne) Where(ps ...predicate.Book) *BookDeleteOne

Where appends a list predicates to the BookDelete builder.

type BookEdges

type BookEdges struct {
	// Owner holds the value of the owner edge.
	Owner *Customer `json:"owner,omitempty"`
	// contains filtered or unexported fields
}

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

func (BookEdges) OwnerOrErr

func (e BookEdges) OwnerOrErr() (*Customer, error)

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

type BookGroupBy

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

BookGroupBy is the group-by builder for Book entities.

func (*BookGroupBy) Aggregate

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

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

func (*BookGroupBy) Bool

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

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

func (*BookGroupBy) BoolX

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

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

func (*BookGroupBy) Bools

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

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

func (*BookGroupBy) BoolsX

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

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

func (*BookGroupBy) Float64

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

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

func (*BookGroupBy) Float64X

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

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

func (*BookGroupBy) Float64s

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

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

func (*BookGroupBy) Float64sX

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

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

func (*BookGroupBy) Int

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

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

func (*BookGroupBy) IntX

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

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

func (*BookGroupBy) Ints

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

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

func (*BookGroupBy) IntsX

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

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

func (*BookGroupBy) Scan

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

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

func (*BookGroupBy) ScanX

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

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

func (*BookGroupBy) String

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

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

func (*BookGroupBy) StringX

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

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

func (*BookGroupBy) Strings

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

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

func (*BookGroupBy) StringsX

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

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

type BookInput

type BookInput struct {
	OwnerID int
}

All you have to do is define a ModelFactory, you don't need to pay attention to all stuff above. But it's nice for you if you give it a shot. Also this example assumes you have ent installed. if not refer to https://github.com/ent/ent to get everything inplace For example, here is my best practice so far.

type BookMutation

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

BookMutation represents an operation that mutates the Book nodes in the graph.

func (*BookMutation) AddField

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

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

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

func (*BookMutation) AddedField

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

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

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

func (*BookMutation) AddedIDs

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

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

func (*BookMutation) ClearEdge

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

func (m *BookMutation) 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 (*BookMutation) ClearOwner

func (m *BookMutation) ClearOwner()

ClearOwner clears the "owner" edge to the Customer entity.

func (*BookMutation) ClearedEdges

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

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

func (*BookMutation) ClearedFields

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

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

func (BookMutation) Client

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

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

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

func (*BookMutation) Field

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

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

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

func (*BookMutation) Fields

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

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

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

func (*BookMutation) IDs

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

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

func (*BookMutation) OldField

func (m *BookMutation) 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 (*BookMutation) Op

func (m *BookMutation) Op() Op

Op returns the operation name.

func (*BookMutation) OwnerCleared

func (m *BookMutation) OwnerCleared() bool

OwnerCleared reports if the "owner" edge to the Customer entity was cleared.

func (*BookMutation) OwnerID

func (m *BookMutation) OwnerID() (id int, exists bool)

OwnerID returns the "owner" edge ID in the mutation.

func (*BookMutation) OwnerIDs

func (m *BookMutation) OwnerIDs() (ids []int)

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

func (*BookMutation) RemovedEdges

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

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

func (*BookMutation) RemovedIDs

func (m *BookMutation) 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 (*BookMutation) ResetEdge

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

func (m *BookMutation) 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 (*BookMutation) ResetOwner

func (m *BookMutation) ResetOwner()

ResetOwner resets all changes to the "owner" edge.

func (*BookMutation) SetField

func (m *BookMutation) 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 (*BookMutation) SetOp

func (m *BookMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*BookMutation) SetOwnerID

func (m *BookMutation) SetOwnerID(id int)

SetOwnerID sets the "owner" edge to the Customer entity by id.

func (BookMutation) Tx

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

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

func (*BookMutation) Type

func (m *BookMutation) Type() string

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

func (*BookMutation) Where

func (m *BookMutation) Where(ps ...predicate.Book)

Where appends a list predicates to the BookMutation builder.

func (*BookMutation) WhereP

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

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

type BookQuery

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

BookQuery is the builder for querying Book entities.

func (*BookQuery) Aggregate

func (bq *BookQuery) Aggregate(fns ...AggregateFunc) *BookSelect

Aggregate returns a BookSelect configured with the given aggregations.

func (*BookQuery) All

func (bq *BookQuery) All(ctx context.Context) ([]*Book, error)

All executes the query and returns a list of Books.

func (*BookQuery) AllX

func (bq *BookQuery) AllX(ctx context.Context) []*Book

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

func (*BookQuery) Clone

func (bq *BookQuery) Clone() *BookQuery

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

func (*BookQuery) Count

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

Count returns the count of the given query.

func (*BookQuery) CountX

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

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

func (*BookQuery) Exist

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

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

func (*BookQuery) ExistX

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

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

func (*BookQuery) First

func (bq *BookQuery) First(ctx context.Context) (*Book, error)

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

func (*BookQuery) FirstID

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

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

func (*BookQuery) FirstIDX

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

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

func (*BookQuery) FirstX

func (bq *BookQuery) FirstX(ctx context.Context) *Book

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

func (*BookQuery) GroupBy

func (bq *BookQuery) GroupBy(field string, fields ...string) *BookGroupBy

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.

func (*BookQuery) IDs

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

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

func (*BookQuery) IDsX

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

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

func (*BookQuery) Limit

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

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

func (*BookQuery) Offset

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

Offset to start from.

func (*BookQuery) Only

func (bq *BookQuery) Only(ctx context.Context) (*Book, error)

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

func (*BookQuery) OnlyID

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

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

func (*BookQuery) OnlyIDX

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

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

func (*BookQuery) OnlyX

func (bq *BookQuery) OnlyX(ctx context.Context) *Book

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

func (*BookQuery) Order

func (bq *BookQuery) Order(o ...OrderFunc) *BookQuery

Order specifies how the records should be ordered.

func (*BookQuery) QueryOwner

func (bq *BookQuery) QueryOwner() *CustomerQuery

QueryOwner chains the current query on the "owner" edge.

func (*BookQuery) Select

func (bq *BookQuery) Select(fields ...string) *BookSelect

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

func (*BookQuery) Unique

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

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

func (bq *BookQuery) Where(ps ...predicate.Book) *BookQuery

Where adds a new predicate for the BookQuery builder.

func (*BookQuery) WithOwner

func (bq *BookQuery) WithOwner(opts ...func(*CustomerQuery)) *BookQuery

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

type BookSelect

type BookSelect struct {
	*BookQuery
	// contains filtered or unexported fields
}

BookSelect is the builder for selecting fields of Book entities.

func (*BookSelect) Aggregate

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

Aggregate adds the given aggregation functions to the selector query.

func (*BookSelect) Bool

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

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

func (*BookSelect) BoolX

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

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

func (*BookSelect) Bools

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

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

func (*BookSelect) BoolsX

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

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

func (*BookSelect) Float64

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

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

func (*BookSelect) Float64X

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

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

func (*BookSelect) Float64s

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

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

func (*BookSelect) Float64sX

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

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

func (*BookSelect) Int

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

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

func (*BookSelect) IntX

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

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

func (*BookSelect) Ints

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

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

func (*BookSelect) IntsX

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

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

func (*BookSelect) Scan

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

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

func (*BookSelect) ScanX

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

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

func (*BookSelect) String

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

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

func (*BookSelect) StringX

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

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

func (*BookSelect) Strings

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

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

func (*BookSelect) StringsX

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

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

type BookUpdate

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

BookUpdate is the builder for updating Book entities.

func (*BookUpdate) ClearOwner

func (bu *BookUpdate) ClearOwner() *BookUpdate

ClearOwner clears the "owner" edge to the Customer entity.

func (*BookUpdate) Exec

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

Exec executes the query.

func (*BookUpdate) ExecX

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

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

func (*BookUpdate) Mutation

func (bu *BookUpdate) Mutation() *BookMutation

Mutation returns the BookMutation object of the builder.

func (*BookUpdate) Save

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

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

func (*BookUpdate) SaveX

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

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

func (*BookUpdate) SetNillableOwnerID

func (bu *BookUpdate) SetNillableOwnerID(id *int) *BookUpdate

SetNillableOwnerID sets the "owner" edge to the Customer entity by ID if the given value is not nil.

func (*BookUpdate) SetOwner

func (bu *BookUpdate) SetOwner(c *Customer) *BookUpdate

SetOwner sets the "owner" edge to the Customer entity.

func (*BookUpdate) SetOwnerID

func (bu *BookUpdate) SetOwnerID(id int) *BookUpdate

SetOwnerID sets the "owner" edge to the Customer entity by ID.

func (*BookUpdate) Where

func (bu *BookUpdate) Where(ps ...predicate.Book) *BookUpdate

Where appends a list predicates to the BookUpdate builder.

type BookUpdateOne

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

BookUpdateOne is the builder for updating a single Book entity.

func (*BookUpdateOne) ClearOwner

func (buo *BookUpdateOne) ClearOwner() *BookUpdateOne

ClearOwner clears the "owner" edge to the Customer entity.

func (*BookUpdateOne) Exec

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

Exec executes the query on the entity.

func (*BookUpdateOne) ExecX

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

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

func (*BookUpdateOne) Mutation

func (buo *BookUpdateOne) Mutation() *BookMutation

Mutation returns the BookMutation object of the builder.

func (*BookUpdateOne) Save

func (buo *BookUpdateOne) Save(ctx context.Context) (*Book, error)

Save executes the query and returns the updated Book entity.

func (*BookUpdateOne) SaveX

func (buo *BookUpdateOne) SaveX(ctx context.Context) *Book

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

func (*BookUpdateOne) Select

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

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

func (*BookUpdateOne) SetNillableOwnerID

func (buo *BookUpdateOne) SetNillableOwnerID(id *int) *BookUpdateOne

SetNillableOwnerID sets the "owner" edge to the Customer entity by ID if the given value is not nil.

func (*BookUpdateOne) SetOwner

func (buo *BookUpdateOne) SetOwner(c *Customer) *BookUpdateOne

SetOwner sets the "owner" edge to the Customer entity.

func (*BookUpdateOne) SetOwnerID

func (buo *BookUpdateOne) SetOwnerID(id int) *BookUpdateOne

SetOwnerID sets the "owner" edge to the Customer entity by ID.

func (*BookUpdateOne) Where

func (buo *BookUpdateOne) Where(ps ...predicate.Book) *BookUpdateOne

Where appends a list predicates to the BookUpdate builder.

type Books

type Books []*Book

Books is a parsable slice of Book.

type Client

type Client struct {

	// Schema is the client for creating, migrating and dropping schema.
	Schema *migrate.Schema
	// Book is the client for interacting with the Book builders.
	Book *BookClient
	// Customer is the client for interacting with the Customer builders.
	Customer *CustomerClient
	// 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 New

func New() (*Client, error)

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 OpenClient

func OpenClient() (*Client, error)

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().
	Book.
	Query().
	Count(ctx)

func (*Client) Intercept

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

Intercept adds the query interceptors to all the entity clients. In order to add interceptors to a specific client, call: `client.Node.Intercept(...)`.

func (*Client) Mutate

func (c *Client) Mutate(ctx context.Context, m Mutation) (Value, error)

Mutate implements the ent.Mutator interface.

func (*Client) Tx

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

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

func (*Client) Use

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

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

type ClientCtxType

type ClientCtxType string
const ClientCtxKey ClientCtxType = "client"

type CommitFunc

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

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

func (CommitFunc) Commit

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

Commit calls f(ctx, m).

type CommitHook

type CommitHook func(Committer) Committer

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

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

type Committer

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

Committer is the interface that wraps the Commit method.

type ConstraintError

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

ConstraintError returns when trying to create/update one or more entities and one or more of their constraints failed. For example, violation of edge or field uniqueness.

func (ConstraintError) Error

func (e ConstraintError) Error() string

Error implements the error interface.

func (*ConstraintError) Unwrap

func (e *ConstraintError) Unwrap() error

Unwrap implements the errors.Wrapper interface.

type Customer

type Customer struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// Name holds the value of the "name" field.
	Name string `json:"name,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the CustomerQuery when eager-loading is set.
	Edges CustomerEdges `json:"edges"`
	// contains filtered or unexported fields
}

Customer is the model entity for the Customer schema.

func (*Customer) QueryBooks

func (c *Customer) QueryBooks() *BookQuery

QueryBooks queries the "books" edge of the Customer entity.

func (*Customer) String

func (c *Customer) String() string

String implements the fmt.Stringer.

func (*Customer) Unwrap

func (c *Customer) Unwrap() *Customer

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

func (c *Customer) Update() *CustomerUpdateOne

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

type CustomerClient

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

CustomerClient is a client for the Customer schema.

func NewCustomerClient

func NewCustomerClient(c config) *CustomerClient

NewCustomerClient returns a client for the Customer from the given config.

func (*CustomerClient) Create

func (c *CustomerClient) Create() *CustomerCreate

Create returns a builder for creating a Customer entity.

func (*CustomerClient) CreateBulk

func (c *CustomerClient) CreateBulk(builders ...*CustomerCreate) *CustomerCreateBulk

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

func (*CustomerClient) Delete

func (c *CustomerClient) Delete() *CustomerDelete

Delete returns a delete builder for Customer.

func (*CustomerClient) DeleteOne

func (c *CustomerClient) DeleteOne(cu *Customer) *CustomerDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*CustomerClient) DeleteOneID

func (c *CustomerClient) DeleteOneID(id int) *CustomerDeleteOne

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

func (*CustomerClient) Get

func (c *CustomerClient) Get(ctx context.Context, id int) (*Customer, error)

Get returns a Customer entity by its id.

func (*CustomerClient) GetX

func (c *CustomerClient) GetX(ctx context.Context, id int) *Customer

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

func (*CustomerClient) Hooks

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

Hooks returns the client hooks.

func (*CustomerClient) Intercept

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

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

func (*CustomerClient) Interceptors

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

Interceptors returns the client interceptors.

func (*CustomerClient) Query

func (c *CustomerClient) Query() *CustomerQuery

Query returns a query builder for Customer.

func (*CustomerClient) QueryBooks

func (c *CustomerClient) QueryBooks(cu *Customer) *BookQuery

QueryBooks queries the books edge of a Customer.

func (*CustomerClient) Update

func (c *CustomerClient) Update() *CustomerUpdate

Update returns an update builder for Customer.

func (*CustomerClient) UpdateOne

func (c *CustomerClient) UpdateOne(cu *Customer) *CustomerUpdateOne

UpdateOne returns an update builder for the given entity.

func (*CustomerClient) UpdateOneID

func (c *CustomerClient) UpdateOneID(id int) *CustomerUpdateOne

UpdateOneID returns an update builder for the given id.

func (*CustomerClient) Use

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

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

type CustomerCreate

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

CustomerCreate is the builder for creating a Customer entity.

func (*CustomerCreate) AddBookIDs

func (cc *CustomerCreate) AddBookIDs(ids ...int) *CustomerCreate

AddBookIDs adds the "books" edge to the Book entity by IDs.

func (*CustomerCreate) AddBooks

func (cc *CustomerCreate) AddBooks(b ...*Book) *CustomerCreate

AddBooks adds the "books" edges to the Book entity.

func (*CustomerCreate) Exec

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

Exec executes the query.

func (*CustomerCreate) ExecX

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

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

func (*CustomerCreate) Mutation

func (cc *CustomerCreate) Mutation() *CustomerMutation

Mutation returns the CustomerMutation object of the builder.

func (*CustomerCreate) Save

func (cc *CustomerCreate) Save(ctx context.Context) (*Customer, error)

Save creates the Customer in the database.

func (*CustomerCreate) SaveX

func (cc *CustomerCreate) SaveX(ctx context.Context) *Customer

SaveX calls Save and panics if Save returns an error.

func (*CustomerCreate) SetName

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

SetName sets the "name" field.

type CustomerCreateBulk

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

CustomerCreateBulk is the builder for creating many Customer entities in bulk.

func (*CustomerCreateBulk) Exec

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

Exec executes the query.

func (*CustomerCreateBulk) ExecX

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

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

func (*CustomerCreateBulk) Save

func (ccb *CustomerCreateBulk) Save(ctx context.Context) ([]*Customer, error)

Save creates the Customer entities in the database.

func (*CustomerCreateBulk) SaveX

func (ccb *CustomerCreateBulk) SaveX(ctx context.Context) []*Customer

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

type CustomerDelete

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

CustomerDelete is the builder for deleting a Customer entity.

func (*CustomerDelete) Exec

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

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

func (*CustomerDelete) ExecX

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

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

func (*CustomerDelete) Where

func (cd *CustomerDelete) Where(ps ...predicate.Customer) *CustomerDelete

Where appends a list predicates to the CustomerDelete builder.

type CustomerDeleteOne

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

CustomerDeleteOne is the builder for deleting a single Customer entity.

func (*CustomerDeleteOne) Exec

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

Exec executes the deletion query.

func (*CustomerDeleteOne) ExecX

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

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

func (*CustomerDeleteOne) Where

Where appends a list predicates to the CustomerDelete builder.

type CustomerEdges

type CustomerEdges struct {
	// Books holds the value of the books edge.
	Books []*Book `json:"books,omitempty"`
	// contains filtered or unexported fields
}

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

func (CustomerEdges) BooksOrErr

func (e CustomerEdges) BooksOrErr() ([]*Book, error)

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

type CustomerGroupBy

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

CustomerGroupBy is the group-by builder for Customer entities.

func (*CustomerGroupBy) Aggregate

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

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

func (*CustomerGroupBy) Bool

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

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

func (*CustomerGroupBy) BoolX

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

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

func (*CustomerGroupBy) Bools

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

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

func (*CustomerGroupBy) BoolsX

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

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

func (*CustomerGroupBy) Float64

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

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

func (*CustomerGroupBy) Float64X

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

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

func (*CustomerGroupBy) Float64s

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

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

func (*CustomerGroupBy) Float64sX

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

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

func (*CustomerGroupBy) Int

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

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

func (*CustomerGroupBy) IntX

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

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

func (*CustomerGroupBy) Ints

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

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

func (*CustomerGroupBy) IntsX

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

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

func (*CustomerGroupBy) Scan

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

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

func (*CustomerGroupBy) ScanX

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

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

func (*CustomerGroupBy) String

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

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

func (*CustomerGroupBy) StringX

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

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

func (*CustomerGroupBy) Strings

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

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

func (*CustomerGroupBy) StringsX

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

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

type CustomerInput

type CustomerInput struct {
	Name string
}

All you have to do is define a ModelFactory, you don't need to pay attention to all stuff above. But it's nice for you if you give it a shot. Also this example assumes you have ent installed. if not refer to https://github.com/ent/ent to get everything inplace For example, here is my best practice so far.

type CustomerMutation

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

CustomerMutation represents an operation that mutates the Customer nodes in the graph.

func (*CustomerMutation) AddBookIDs

func (m *CustomerMutation) AddBookIDs(ids ...int)

AddBookIDs adds the "books" edge to the Book entity by ids.

func (*CustomerMutation) AddField

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

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

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

func (*CustomerMutation) AddedField

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

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

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

func (*CustomerMutation) AddedIDs

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

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

func (*CustomerMutation) BooksCleared

func (m *CustomerMutation) BooksCleared() bool

BooksCleared reports if the "books" edge to the Book entity was cleared.

func (*CustomerMutation) BooksIDs

func (m *CustomerMutation) BooksIDs() (ids []int)

BooksIDs returns the "books" edge IDs in the mutation.

func (*CustomerMutation) ClearBooks

func (m *CustomerMutation) ClearBooks()

ClearBooks clears the "books" edge to the Book entity.

func (*CustomerMutation) ClearEdge

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

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

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

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

func (*CustomerMutation) ClearedFields

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

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

func (CustomerMutation) Client

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

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

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

func (*CustomerMutation) Field

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

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

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

func (*CustomerMutation) Fields

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

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

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

func (*CustomerMutation) IDs

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

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

func (*CustomerMutation) Name

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

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

func (*CustomerMutation) OldField

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

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

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

func (m *CustomerMutation) Op() Op

Op returns the operation name.

func (*CustomerMutation) RemoveBookIDs

func (m *CustomerMutation) RemoveBookIDs(ids ...int)

RemoveBookIDs removes the "books" edge to the Book entity by IDs.

func (*CustomerMutation) RemovedBooksIDs

func (m *CustomerMutation) RemovedBooksIDs() (ids []int)

RemovedBooks returns the removed IDs of the "books" edge to the Book entity.

func (*CustomerMutation) RemovedEdges

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

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

func (*CustomerMutation) RemovedIDs

func (m *CustomerMutation) 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 (*CustomerMutation) ResetBooks

func (m *CustomerMutation) ResetBooks()

ResetBooks resets all changes to the "books" edge.

func (*CustomerMutation) ResetEdge

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

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

func (m *CustomerMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*CustomerMutation) SetField

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

func (m *CustomerMutation) SetName(s string)

SetName sets the "name" field.

func (*CustomerMutation) SetOp

func (m *CustomerMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (CustomerMutation) Tx

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

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

func (*CustomerMutation) Type

func (m *CustomerMutation) Type() string

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

func (*CustomerMutation) Where

func (m *CustomerMutation) Where(ps ...predicate.Customer)

Where appends a list predicates to the CustomerMutation builder.

func (*CustomerMutation) WhereP

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

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

type CustomerQuery

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

CustomerQuery is the builder for querying Customer entities.

func (*CustomerQuery) Aggregate

func (cq *CustomerQuery) Aggregate(fns ...AggregateFunc) *CustomerSelect

Aggregate returns a CustomerSelect configured with the given aggregations.

func (*CustomerQuery) All

func (cq *CustomerQuery) All(ctx context.Context) ([]*Customer, error)

All executes the query and returns a list of Customers.

func (*CustomerQuery) AllX

func (cq *CustomerQuery) AllX(ctx context.Context) []*Customer

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

func (*CustomerQuery) Clone

func (cq *CustomerQuery) Clone() *CustomerQuery

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

func (*CustomerQuery) Count

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

Count returns the count of the given query.

func (*CustomerQuery) CountX

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

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

func (*CustomerQuery) Exist

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

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

func (*CustomerQuery) ExistX

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

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

func (*CustomerQuery) First

func (cq *CustomerQuery) First(ctx context.Context) (*Customer, error)

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

func (*CustomerQuery) FirstID

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

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

func (*CustomerQuery) FirstIDX

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

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

func (*CustomerQuery) FirstX

func (cq *CustomerQuery) FirstX(ctx context.Context) *Customer

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

func (*CustomerQuery) GroupBy

func (cq *CustomerQuery) GroupBy(field string, fields ...string) *CustomerGroupBy

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

client.Customer.Query().
	GroupBy(customer.FieldName).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*CustomerQuery) IDs

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

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

func (*CustomerQuery) IDsX

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

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

func (*CustomerQuery) Limit

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

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

func (*CustomerQuery) Offset

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

Offset to start from.

func (*CustomerQuery) Only

func (cq *CustomerQuery) Only(ctx context.Context) (*Customer, error)

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

func (*CustomerQuery) OnlyID

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

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

func (*CustomerQuery) OnlyIDX

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

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

func (*CustomerQuery) OnlyX

func (cq *CustomerQuery) OnlyX(ctx context.Context) *Customer

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

func (*CustomerQuery) Order

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

Order specifies how the records should be ordered.

func (*CustomerQuery) QueryBooks

func (cq *CustomerQuery) QueryBooks() *BookQuery

QueryBooks chains the current query on the "books" edge.

func (*CustomerQuery) Select

func (cq *CustomerQuery) Select(fields ...string) *CustomerSelect

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

client.Customer.Query().
	Select(customer.FieldName).
	Scan(ctx, &v)

func (*CustomerQuery) Unique

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

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

func (cq *CustomerQuery) Where(ps ...predicate.Customer) *CustomerQuery

Where adds a new predicate for the CustomerQuery builder.

func (*CustomerQuery) WithBooks

func (cq *CustomerQuery) WithBooks(opts ...func(*BookQuery)) *CustomerQuery

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

type CustomerSelect

type CustomerSelect struct {
	*CustomerQuery
	// contains filtered or unexported fields
}

CustomerSelect is the builder for selecting fields of Customer entities.

func (*CustomerSelect) Aggregate

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

Aggregate adds the given aggregation functions to the selector query.

func (*CustomerSelect) Bool

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

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

func (*CustomerSelect) BoolX

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

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

func (*CustomerSelect) Bools

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

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

func (*CustomerSelect) BoolsX

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

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

func (*CustomerSelect) Float64

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

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

func (*CustomerSelect) Float64X

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

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

func (*CustomerSelect) Float64s

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

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

func (*CustomerSelect) Float64sX

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

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

func (*CustomerSelect) Int

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

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

func (*CustomerSelect) IntX

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

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

func (*CustomerSelect) Ints

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

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

func (*CustomerSelect) IntsX

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

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

func (*CustomerSelect) Scan

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

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

func (*CustomerSelect) ScanX

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

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

func (*CustomerSelect) String

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

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

func (*CustomerSelect) StringX

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

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

func (*CustomerSelect) Strings

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

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

func (*CustomerSelect) StringsX

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

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

type CustomerUpdate

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

CustomerUpdate is the builder for updating Customer entities.

func (*CustomerUpdate) AddBookIDs

func (cu *CustomerUpdate) AddBookIDs(ids ...int) *CustomerUpdate

AddBookIDs adds the "books" edge to the Book entity by IDs.

func (*CustomerUpdate) AddBooks

func (cu *CustomerUpdate) AddBooks(b ...*Book) *CustomerUpdate

AddBooks adds the "books" edges to the Book entity.

func (*CustomerUpdate) ClearBooks

func (cu *CustomerUpdate) ClearBooks() *CustomerUpdate

ClearBooks clears all "books" edges to the Book entity.

func (*CustomerUpdate) Exec

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

Exec executes the query.

func (*CustomerUpdate) ExecX

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

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

func (*CustomerUpdate) Mutation

func (cu *CustomerUpdate) Mutation() *CustomerMutation

Mutation returns the CustomerMutation object of the builder.

func (*CustomerUpdate) RemoveBookIDs

func (cu *CustomerUpdate) RemoveBookIDs(ids ...int) *CustomerUpdate

RemoveBookIDs removes the "books" edge to Book entities by IDs.

func (*CustomerUpdate) RemoveBooks

func (cu *CustomerUpdate) RemoveBooks(b ...*Book) *CustomerUpdate

RemoveBooks removes "books" edges to Book entities.

func (*CustomerUpdate) Save

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

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

func (*CustomerUpdate) SaveX

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

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

func (*CustomerUpdate) SetName

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

SetName sets the "name" field.

func (*CustomerUpdate) Where

func (cu *CustomerUpdate) Where(ps ...predicate.Customer) *CustomerUpdate

Where appends a list predicates to the CustomerUpdate builder.

type CustomerUpdateOne

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

CustomerUpdateOne is the builder for updating a single Customer entity.

func (*CustomerUpdateOne) AddBookIDs

func (cuo *CustomerUpdateOne) AddBookIDs(ids ...int) *CustomerUpdateOne

AddBookIDs adds the "books" edge to the Book entity by IDs.

func (*CustomerUpdateOne) AddBooks

func (cuo *CustomerUpdateOne) AddBooks(b ...*Book) *CustomerUpdateOne

AddBooks adds the "books" edges to the Book entity.

func (*CustomerUpdateOne) ClearBooks

func (cuo *CustomerUpdateOne) ClearBooks() *CustomerUpdateOne

ClearBooks clears all "books" edges to the Book entity.

func (*CustomerUpdateOne) Exec

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

Exec executes the query on the entity.

func (*CustomerUpdateOne) ExecX

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

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

func (*CustomerUpdateOne) Mutation

func (cuo *CustomerUpdateOne) Mutation() *CustomerMutation

Mutation returns the CustomerMutation object of the builder.

func (*CustomerUpdateOne) RemoveBookIDs

func (cuo *CustomerUpdateOne) RemoveBookIDs(ids ...int) *CustomerUpdateOne

RemoveBookIDs removes the "books" edge to Book entities by IDs.

func (*CustomerUpdateOne) RemoveBooks

func (cuo *CustomerUpdateOne) RemoveBooks(b ...*Book) *CustomerUpdateOne

RemoveBooks removes "books" edges to Book entities.

func (*CustomerUpdateOne) Save

func (cuo *CustomerUpdateOne) Save(ctx context.Context) (*Customer, error)

Save executes the query and returns the updated Customer entity.

func (*CustomerUpdateOne) SaveX

func (cuo *CustomerUpdateOne) SaveX(ctx context.Context) *Customer

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

func (*CustomerUpdateOne) Select

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

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

func (*CustomerUpdateOne) SetName

func (cuo *CustomerUpdateOne) SetName(s string) *CustomerUpdateOne

SetName sets the "name" field.

func (*CustomerUpdateOne) Where

Where appends a list predicates to the CustomerUpdate builder.

type Customers

type Customers []*Customer

Customers is a parsable slice of Customer.

type Factory

type Factory[ModelType any] struct {
	// contains filtered or unexported fields
}

func (*Factory[ModelType]) Create

func (s *Factory[ModelType]) Create(ctx context.Context) (ModelType, error)

func (*Factory[ModelType]) CreateWithClient

func (s *Factory[ModelType]) CreateWithClient(ctx context.Context, client *Client) (ModelType, error)

type Hook

type Hook = ent.Hook

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

type IFactory

type IFactory[ModelType any] interface {
	Create(context.Context) (ModelType, error)
	CreateWithClient(context.Context, *Client) (ModelType, error)
}

func MustBookFactory

func MustBookFactory(opts ...Opt) IFactory[*Book]

func MustCustomerFactory

func MustCustomerFactory(opts ...Opt) IFactory[*Customer]

type InterceptFunc

type InterceptFunc = ent.InterceptFunc

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

type Interceptor

type Interceptor = ent.Interceptor

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

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

type Opt struct {
	Key   string
	Value any
}

type Option

type Option func(*config)

Option function to configure the client.

func Debug

func Debug() Option

Debug enables debug logging on the ent.Driver.

func Driver

func Driver(driver dialect.Driver) Option

Driver configures the client driver.

func Log

func Log(fn func(...any)) Option

Log sets the logging function for debug mode.

type OrderFunc

type OrderFunc func(*sql.Selector)

OrderFunc applies an ordering on the sql selector.

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 Querier

type Querier = ent.Querier

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

type QuerierFunc

type QuerierFunc = ent.QuerierFunc

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

type Query

type Query = ent.Query

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

type QueryContext

type QueryContext = ent.QueryContext

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

type RollbackFunc

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

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

func (RollbackFunc) Rollback

func (f RollbackFunc) Rollback(ctx context.Context, tx *Tx) error

Rollback calls f(ctx, m).

type RollbackHook

type RollbackHook func(Rollbacker) Rollbacker

RollbackHook defines the "rollback middleware". A function that gets a Rollbacker and returns a Rollbacker. For example:

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

type Rollbacker

type Rollbacker interface {
	Rollback(context.Context, *Tx) error
}

Rollbacker is the interface that wraps the Rollback method.

type TraverseFunc

type TraverseFunc = ent.TraverseFunc

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

type Traverser

type Traverser = ent.Traverser

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

type Tx

type Tx struct {

	// Book is the client for interacting with the Book builders.
	Book *BookClient
	// Customer is the client for interacting with the Customer builders.
	Customer *CustomerClient
	// contains filtered or unexported fields
}

Tx is a transactional client that is created by calling Client.Tx().

func TxFromContext

func TxFromContext(ctx context.Context) *Tx

TxFromContext returns a Tx stored inside a context, or nil if there isn't one.

func (*Tx) Client

func (tx *Tx) Client() *Client

Client returns a Client that binds to current transaction.

func (*Tx) Commit

func (tx *Tx) Commit() error

Commit commits the transaction.

func (*Tx) OnCommit

func (tx *Tx) OnCommit(f CommitHook)

OnCommit adds a hook to call on commit.

func (*Tx) OnRollback

func (tx *Tx) OnRollback(f RollbackHook)

OnRollback adds a hook to call on rollback.

func (*Tx) Rollback

func (tx *Tx) Rollback() error

Rollback rollbacks the transaction.

type ValidationError

type ValidationError struct {
	Name string // Field or edge name.
	// contains filtered or unexported fields
}

ValidationError returns when validating a field or edge fails.

func (*ValidationError) Error

func (e *ValidationError) Error() string

Error implements the error interface.

func (*ValidationError) Unwrap

func (e *ValidationError) Unwrap() error

Unwrap implements the errors.Wrapper interface.

type Value

type Value = ent.Value

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL