ent

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2021 License: MIT Imports: 21 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.
	TypeCategory = "Category"
	TypeClub     = "Club"
	TypeLikeClub = "LikeClub"
)

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 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 Categories

type Categories []*Category

Categories is a parsable slice of Category.

type Category

type Category struct {

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

Category is the model entity for the Category schema.

func (*Category) QueryClubs

func (c *Category) QueryClubs() *ClubQuery

QueryClubs queries the "clubs" edge of the Category entity.

func (*Category) String

func (c *Category) String() string

String implements the fmt.Stringer.

func (*Category) Unwrap

func (c *Category) Unwrap() *Category

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

func (c *Category) Update() *CategoryUpdateOne

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

type CategoryClient

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

CategoryClient is a client for the Category schema.

func NewCategoryClient

func NewCategoryClient(c config) *CategoryClient

NewCategoryClient returns a client for the Category from the given config.

func (*CategoryClient) Create

func (c *CategoryClient) Create() *CategoryCreate

Create returns a create builder for Category.

func (*CategoryClient) CreateBulk

func (c *CategoryClient) CreateBulk(builders ...*CategoryCreate) *CategoryCreateBulk

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

func (*CategoryClient) Delete

func (c *CategoryClient) Delete() *CategoryDelete

Delete returns a delete builder for Category.

func (*CategoryClient) DeleteOne

func (c *CategoryClient) DeleteOne(ca *Category) *CategoryDeleteOne

DeleteOne returns a delete builder for the given entity.

func (*CategoryClient) DeleteOneID

func (c *CategoryClient) DeleteOneID(id string) *CategoryDeleteOne

DeleteOneID returns a delete builder for the given id.

func (*CategoryClient) Get

func (c *CategoryClient) Get(ctx context.Context, id string) (*Category, error)

Get returns a Category entity by its id.

func (*CategoryClient) GetX

func (c *CategoryClient) GetX(ctx context.Context, id string) *Category

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

func (*CategoryClient) Hooks

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

Hooks returns the client hooks.

func (*CategoryClient) Query

func (c *CategoryClient) Query() *CategoryQuery

Query returns a query builder for Category.

func (*CategoryClient) QueryClubs

func (c *CategoryClient) QueryClubs(ca *Category) *ClubQuery

QueryClubs queries the clubs edge of a Category.

func (*CategoryClient) Update

func (c *CategoryClient) Update() *CategoryUpdate

Update returns an update builder for Category.

func (*CategoryClient) UpdateOne

func (c *CategoryClient) UpdateOne(ca *Category) *CategoryUpdateOne

UpdateOne returns an update builder for the given entity.

func (*CategoryClient) UpdateOneID

func (c *CategoryClient) UpdateOneID(id string) *CategoryUpdateOne

UpdateOneID returns an update builder for the given id.

func (*CategoryClient) Use

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

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

type CategoryCreate

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

CategoryCreate is the builder for creating a Category entity.

func (*CategoryCreate) AddClubIDs

func (cc *CategoryCreate) AddClubIDs(ids ...int) *CategoryCreate

AddClubIDs adds the "clubs" edge to the Club entity by IDs.

func (*CategoryCreate) AddClubs

func (cc *CategoryCreate) AddClubs(c ...*Club) *CategoryCreate

AddClubs adds the "clubs" edges to the Club entity.

func (*CategoryCreate) Mutation

func (cc *CategoryCreate) Mutation() *CategoryMutation

Mutation returns the CategoryMutation object of the builder.

func (*CategoryCreate) Save

func (cc *CategoryCreate) Save(ctx context.Context) (*Category, error)

Save creates the Category in the database.

func (*CategoryCreate) SaveX

func (cc *CategoryCreate) SaveX(ctx context.Context) *Category

SaveX calls Save and panics if Save returns an error.

func (*CategoryCreate) SetID

func (cc *CategoryCreate) SetID(s string) *CategoryCreate

SetID sets the "id" field.

type CategoryCreateBulk

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

CategoryCreateBulk is the builder for creating many Category entities in bulk.

func (*CategoryCreateBulk) Save

func (ccb *CategoryCreateBulk) Save(ctx context.Context) ([]*Category, error)

Save creates the Category entities in the database.

func (*CategoryCreateBulk) SaveX

func (ccb *CategoryCreateBulk) SaveX(ctx context.Context) []*Category

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

type CategoryDelete

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

CategoryDelete is the builder for deleting a Category entity.

func (*CategoryDelete) Exec

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

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

func (*CategoryDelete) ExecX

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

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

func (*CategoryDelete) Where

func (cd *CategoryDelete) Where(ps ...predicate.Category) *CategoryDelete

Where adds a new predicate to the CategoryDelete builder.

type CategoryDeleteOne

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

CategoryDeleteOne is the builder for deleting a single Category entity.

func (*CategoryDeleteOne) Exec

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

Exec executes the deletion query.

func (*CategoryDeleteOne) ExecX

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

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

type CategoryEdges

type CategoryEdges struct {
	// Clubs holds the value of the clubs edge.
	Clubs []*Club `json:"clubs,omitempty"`
	// contains filtered or unexported fields
}

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

func (CategoryEdges) ClubsOrErr

func (e CategoryEdges) ClubsOrErr() ([]*Club, error)

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

type CategoryGroupBy

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

CategoryGroupBy is the group-by builder for Category entities.

func (*CategoryGroupBy) Aggregate

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

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

func (*CategoryGroupBy) Bool

func (cgb *CategoryGroupBy) 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 (*CategoryGroupBy) BoolX

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

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

func (*CategoryGroupBy) Bools

func (cgb *CategoryGroupBy) 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 (*CategoryGroupBy) BoolsX

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

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

func (*CategoryGroupBy) Float64

func (cgb *CategoryGroupBy) 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 (*CategoryGroupBy) Float64X

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

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

func (*CategoryGroupBy) Float64s

func (cgb *CategoryGroupBy) 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 (*CategoryGroupBy) Float64sX

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

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

func (*CategoryGroupBy) Int

func (cgb *CategoryGroupBy) 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 (*CategoryGroupBy) IntX

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

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

func (*CategoryGroupBy) Ints

func (cgb *CategoryGroupBy) 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 (*CategoryGroupBy) IntsX

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

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

func (*CategoryGroupBy) Scan

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

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

func (*CategoryGroupBy) ScanX

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

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

func (*CategoryGroupBy) String

func (cgb *CategoryGroupBy) 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 (*CategoryGroupBy) StringX

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

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

func (*CategoryGroupBy) Strings

func (cgb *CategoryGroupBy) 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 (*CategoryGroupBy) StringsX

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

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

type CategoryMutation

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

CategoryMutation represents an operation that mutates the Category nodes in the graph.

func (*CategoryMutation) AddClubIDs

func (m *CategoryMutation) AddClubIDs(ids ...int)

AddClubIDs adds the "clubs" edge to the Club entity by ids.

func (*CategoryMutation) AddField

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

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

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

func (*CategoryMutation) AddedField

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

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

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

func (*CategoryMutation) AddedIDs

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

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

func (*CategoryMutation) ClearClubs

func (m *CategoryMutation) ClearClubs()

ClearClubs clears the "clubs" edge to the Club entity.

func (*CategoryMutation) ClearEdge

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

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

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

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

func (*CategoryMutation) ClearedFields

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

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

func (CategoryMutation) Client

func (m CategoryMutation) 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 (*CategoryMutation) ClubsCleared

func (m *CategoryMutation) ClubsCleared() bool

ClubsCleared reports if the "clubs" edge to the Club entity was cleared.

func (*CategoryMutation) ClubsIDs

func (m *CategoryMutation) ClubsIDs() (ids []int)

ClubsIDs returns the "clubs" edge IDs in the mutation.

func (*CategoryMutation) EdgeCleared

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

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

func (*CategoryMutation) Field

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

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

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

func (*CategoryMutation) Fields

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

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

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

func (*CategoryMutation) OldField

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

func (m *CategoryMutation) Op() Op

Op returns the operation name.

func (*CategoryMutation) RemoveClubIDs

func (m *CategoryMutation) RemoveClubIDs(ids ...int)

RemoveClubIDs removes the "clubs" edge to the Club entity by IDs.

func (*CategoryMutation) RemovedClubsIDs

func (m *CategoryMutation) RemovedClubsIDs() (ids []int)

RemovedClubs returns the removed IDs of the "clubs" edge to the Club entity.

func (*CategoryMutation) RemovedEdges

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

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

func (*CategoryMutation) RemovedIDs

func (m *CategoryMutation) 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 (*CategoryMutation) ResetClubs

func (m *CategoryMutation) ResetClubs()

ResetClubs resets all changes to the "clubs" edge.

func (*CategoryMutation) ResetEdge

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

func (m *CategoryMutation) 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 (*CategoryMutation) SetField

func (m *CategoryMutation) 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 (*CategoryMutation) SetID

func (m *CategoryMutation) SetID(id string)

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

func (CategoryMutation) Tx

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

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

func (*CategoryMutation) Type

func (m *CategoryMutation) Type() string

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

type CategoryQuery

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

CategoryQuery is the builder for querying Category entities.

func (*CategoryQuery) All

func (cq *CategoryQuery) All(ctx context.Context) ([]*Category, error)

All executes the query and returns a list of Categories.

func (*CategoryQuery) AllX

func (cq *CategoryQuery) AllX(ctx context.Context) []*Category

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

func (*CategoryQuery) Clone

func (cq *CategoryQuery) Clone() *CategoryQuery

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

func (*CategoryQuery) Count

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

Count returns the count of the given query.

func (*CategoryQuery) CountX

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

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

func (*CategoryQuery) Exist

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

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

func (*CategoryQuery) ExistX

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

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

func (*CategoryQuery) First

func (cq *CategoryQuery) First(ctx context.Context) (*Category, error)

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

func (*CategoryQuery) FirstID

func (cq *CategoryQuery) FirstID(ctx context.Context) (id string, err error)

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

func (*CategoryQuery) FirstIDX

func (cq *CategoryQuery) FirstIDX(ctx context.Context) string

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

func (*CategoryQuery) FirstX

func (cq *CategoryQuery) FirstX(ctx context.Context) *Category

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

func (*CategoryQuery) GroupBy

func (cq *CategoryQuery) GroupBy(field string, fields ...string) *CategoryGroupBy

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 (*CategoryQuery) IDs

func (cq *CategoryQuery) IDs(ctx context.Context) ([]string, error)

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

func (*CategoryQuery) IDsX

func (cq *CategoryQuery) IDsX(ctx context.Context) []string

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

func (*CategoryQuery) Limit

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

Limit adds a limit step to the query.

func (*CategoryQuery) Offset

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

Offset adds an offset step to the query.

func (*CategoryQuery) Only

func (cq *CategoryQuery) Only(ctx context.Context) (*Category, error)

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

func (*CategoryQuery) OnlyID

func (cq *CategoryQuery) OnlyID(ctx context.Context) (id string, err error)

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

func (*CategoryQuery) OnlyIDX

func (cq *CategoryQuery) OnlyIDX(ctx context.Context) string

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

func (*CategoryQuery) OnlyX

func (cq *CategoryQuery) OnlyX(ctx context.Context) *Category

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

func (*CategoryQuery) Order

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

Order adds an order step to the query.

func (*CategoryQuery) QueryClubs

func (cq *CategoryQuery) QueryClubs() *ClubQuery

QueryClubs chains the current query on the "clubs" edge.

func (*CategoryQuery) Select

func (cq *CategoryQuery) Select(field string, fields ...string) *CategorySelect

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

func (*CategoryQuery) Unique

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

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

func (cq *CategoryQuery) Where(ps ...predicate.Category) *CategoryQuery

Where adds a new predicate for the CategoryQuery builder.

func (*CategoryQuery) WithClubs

func (cq *CategoryQuery) WithClubs(opts ...func(*ClubQuery)) *CategoryQuery

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

type CategorySelect

type CategorySelect struct {
	*CategoryQuery
	// contains filtered or unexported fields
}

CategorySelect is the builder for selecting fields of Category entities.

func (*CategorySelect) Bool

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

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

func (*CategorySelect) BoolX

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

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

func (*CategorySelect) Bools

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

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

func (*CategorySelect) BoolsX

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

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

func (*CategorySelect) Float64

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

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

func (*CategorySelect) Float64X

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

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

func (*CategorySelect) Float64s

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

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

func (*CategorySelect) Float64sX

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

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

func (*CategorySelect) Int

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

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

func (*CategorySelect) IntX

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

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

func (*CategorySelect) Ints

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

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

func (*CategorySelect) IntsX

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

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

func (*CategorySelect) Scan

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

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

func (*CategorySelect) ScanX

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

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

func (*CategorySelect) String

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

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

func (*CategorySelect) StringX

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

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

func (*CategorySelect) Strings

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

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

func (*CategorySelect) StringsX

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

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

type CategoryUpdate

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

CategoryUpdate is the builder for updating Category entities.

func (*CategoryUpdate) AddClubIDs

func (cu *CategoryUpdate) AddClubIDs(ids ...int) *CategoryUpdate

AddClubIDs adds the "clubs" edge to the Club entity by IDs.

func (*CategoryUpdate) AddClubs

func (cu *CategoryUpdate) AddClubs(c ...*Club) *CategoryUpdate

AddClubs adds the "clubs" edges to the Club entity.

func (*CategoryUpdate) ClearClubs

func (cu *CategoryUpdate) ClearClubs() *CategoryUpdate

ClearClubs clears all "clubs" edges to the Club entity.

func (*CategoryUpdate) Exec

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

Exec executes the query.

func (*CategoryUpdate) ExecX

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

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

func (*CategoryUpdate) Mutation

func (cu *CategoryUpdate) Mutation() *CategoryMutation

Mutation returns the CategoryMutation object of the builder.

func (*CategoryUpdate) RemoveClubIDs

func (cu *CategoryUpdate) RemoveClubIDs(ids ...int) *CategoryUpdate

RemoveClubIDs removes the "clubs" edge to Club entities by IDs.

func (*CategoryUpdate) RemoveClubs

func (cu *CategoryUpdate) RemoveClubs(c ...*Club) *CategoryUpdate

RemoveClubs removes "clubs" edges to Club entities.

func (*CategoryUpdate) Save

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

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

func (*CategoryUpdate) SaveX

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

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

func (*CategoryUpdate) Where

func (cu *CategoryUpdate) Where(ps ...predicate.Category) *CategoryUpdate

Where adds a new predicate for the CategoryUpdate builder.

type CategoryUpdateOne

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

CategoryUpdateOne is the builder for updating a single Category entity.

func (*CategoryUpdateOne) AddClubIDs

func (cuo *CategoryUpdateOne) AddClubIDs(ids ...int) *CategoryUpdateOne

AddClubIDs adds the "clubs" edge to the Club entity by IDs.

func (*CategoryUpdateOne) AddClubs

func (cuo *CategoryUpdateOne) AddClubs(c ...*Club) *CategoryUpdateOne

AddClubs adds the "clubs" edges to the Club entity.

func (*CategoryUpdateOne) ClearClubs

func (cuo *CategoryUpdateOne) ClearClubs() *CategoryUpdateOne

ClearClubs clears all "clubs" edges to the Club entity.

func (*CategoryUpdateOne) Exec

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

Exec executes the query on the entity.

func (*CategoryUpdateOne) ExecX

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

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

func (*CategoryUpdateOne) Mutation

func (cuo *CategoryUpdateOne) Mutation() *CategoryMutation

Mutation returns the CategoryMutation object of the builder.

func (*CategoryUpdateOne) RemoveClubIDs

func (cuo *CategoryUpdateOne) RemoveClubIDs(ids ...int) *CategoryUpdateOne

RemoveClubIDs removes the "clubs" edge to Club entities by IDs.

func (*CategoryUpdateOne) RemoveClubs

func (cuo *CategoryUpdateOne) RemoveClubs(c ...*Club) *CategoryUpdateOne

RemoveClubs removes "clubs" edges to Club entities.

func (*CategoryUpdateOne) Save

func (cuo *CategoryUpdateOne) Save(ctx context.Context) (*Category, error)

Save executes the query and returns the updated Category entity.

func (*CategoryUpdateOne) SaveX

func (cuo *CategoryUpdateOne) SaveX(ctx context.Context) *Category

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

func (*CategoryUpdateOne) Select

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

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

type Client

type Client struct {

	// Schema is the client for creating, migrating and dropping schema.
	Schema *migrate.Schema
	// Category is the client for interacting with the Category builders.
	Category *CategoryClient
	// Club is the client for interacting with the Club builders.
	Club *ClubClient
	// LikeClub is the client for interacting with the LikeClub builders.
	LikeClub *LikeClubClient
	// 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().
	Category.
	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 Club

type Club struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// Name holds the value of the "name" field.
	Name string `json:"name,omitempty"`
	// Summary holds the value of the "summary" field.
	Summary string `json:"summary,omitempty"`
	// Description holds the value of the "description" field.
	Description string `json:"description,omitempty"`
	// Images holds the value of the "images" field.
	Images []string `json:"images,omitempty"`
	// Homepage holds the value of the "homepage" field.
	Homepage string `json:"homepage,omitempty"`
	// Instagram holds the value of the "instagram" field.
	Instagram string `json:"instagram,omitempty"`
	// Facebook holds the value of the "facebook" field.
	Facebook string `json:"facebook,omitempty"`
	// Phone holds the value of the "phone" field.
	Phone string `json:"phone,omitempty"`
	// Email holds the value of the "email" field.
	Email string `json:"email,omitempty"`
	// Recommended holds the value of the "recommended" field.
	Recommended bool `json:"recommended,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the ClubQuery when eager-loading is set.
	Edges ClubEdges `json:"edges"`
	// contains filtered or unexported fields
}

Club is the model entity for the Club schema.

func (*Club) QueryCategories

func (c *Club) QueryCategories() *CategoryQuery

QueryCategories queries the "categories" edge of the Club entity.

func (*Club) QueryLikes

func (c *Club) QueryLikes() *LikeClubQuery

QueryLikes queries the "likes" edge of the Club entity.

func (*Club) String

func (c *Club) String() string

String implements the fmt.Stringer.

func (*Club) Unwrap

func (c *Club) Unwrap() *Club

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

func (c *Club) Update() *ClubUpdateOne

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

type ClubClient

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

ClubClient is a client for the Club schema.

func NewClubClient

func NewClubClient(c config) *ClubClient

NewClubClient returns a client for the Club from the given config.

func (*ClubClient) Create

func (c *ClubClient) Create() *ClubCreate

Create returns a create builder for Club.

func (*ClubClient) CreateBulk

func (c *ClubClient) CreateBulk(builders ...*ClubCreate) *ClubCreateBulk

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

func (*ClubClient) Delete

func (c *ClubClient) Delete() *ClubDelete

Delete returns a delete builder for Club.

func (*ClubClient) DeleteOne

func (c *ClubClient) DeleteOne(cl *Club) *ClubDeleteOne

DeleteOne returns a delete builder for the given entity.

func (*ClubClient) DeleteOneID

func (c *ClubClient) DeleteOneID(id int) *ClubDeleteOne

DeleteOneID returns a delete builder for the given id.

func (*ClubClient) Get

func (c *ClubClient) Get(ctx context.Context, id int) (*Club, error)

Get returns a Club entity by its id.

func (*ClubClient) GetX

func (c *ClubClient) GetX(ctx context.Context, id int) *Club

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

func (*ClubClient) Hooks

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

Hooks returns the client hooks.

func (*ClubClient) Query

func (c *ClubClient) Query() *ClubQuery

Query returns a query builder for Club.

func (*ClubClient) QueryCategories

func (c *ClubClient) QueryCategories(cl *Club) *CategoryQuery

QueryCategories queries the categories edge of a Club.

func (*ClubClient) QueryLikes

func (c *ClubClient) QueryLikes(cl *Club) *LikeClubQuery

QueryLikes queries the likes edge of a Club.

func (*ClubClient) Update

func (c *ClubClient) Update() *ClubUpdate

Update returns an update builder for Club.

func (*ClubClient) UpdateOne

func (c *ClubClient) UpdateOne(cl *Club) *ClubUpdateOne

UpdateOne returns an update builder for the given entity.

func (*ClubClient) UpdateOneID

func (c *ClubClient) UpdateOneID(id int) *ClubUpdateOne

UpdateOneID returns an update builder for the given id.

func (*ClubClient) Use

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

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

type ClubCreate

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

ClubCreate is the builder for creating a Club entity.

func (*ClubCreate) AddCategories

func (cc *ClubCreate) AddCategories(c ...*Category) *ClubCreate

AddCategories adds the "categories" edges to the Category entity.

func (*ClubCreate) AddCategoryIDs

func (cc *ClubCreate) AddCategoryIDs(ids ...string) *ClubCreate

AddCategoryIDs adds the "categories" edge to the Category entity by IDs.

func (*ClubCreate) AddLikeIDs

func (cc *ClubCreate) AddLikeIDs(ids ...int) *ClubCreate

AddLikeIDs adds the "likes" edge to the LikeClub entity by IDs.

func (*ClubCreate) AddLikes

func (cc *ClubCreate) AddLikes(l ...*LikeClub) *ClubCreate

AddLikes adds the "likes" edges to the LikeClub entity.

func (*ClubCreate) Mutation

func (cc *ClubCreate) Mutation() *ClubMutation

Mutation returns the ClubMutation object of the builder.

func (*ClubCreate) Save

func (cc *ClubCreate) Save(ctx context.Context) (*Club, error)

Save creates the Club in the database.

func (*ClubCreate) SaveX

func (cc *ClubCreate) SaveX(ctx context.Context) *Club

SaveX calls Save and panics if Save returns an error.

func (*ClubCreate) SetDescription

func (cc *ClubCreate) SetDescription(s string) *ClubCreate

SetDescription sets the "description" field.

func (*ClubCreate) SetEmail

func (cc *ClubCreate) SetEmail(s string) *ClubCreate

SetEmail sets the "email" field.

func (*ClubCreate) SetFacebook

func (cc *ClubCreate) SetFacebook(s string) *ClubCreate

SetFacebook sets the "facebook" field.

func (*ClubCreate) SetHomepage

func (cc *ClubCreate) SetHomepage(s string) *ClubCreate

SetHomepage sets the "homepage" field.

func (*ClubCreate) SetImages

func (cc *ClubCreate) SetImages(s []string) *ClubCreate

SetImages sets the "images" field.

func (*ClubCreate) SetInstagram

func (cc *ClubCreate) SetInstagram(s string) *ClubCreate

SetInstagram sets the "instagram" field.

func (*ClubCreate) SetName

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

SetName sets the "name" field.

func (*ClubCreate) SetNillableEmail

func (cc *ClubCreate) SetNillableEmail(s *string) *ClubCreate

SetNillableEmail sets the "email" field if the given value is not nil.

func (*ClubCreate) SetNillableFacebook

func (cc *ClubCreate) SetNillableFacebook(s *string) *ClubCreate

SetNillableFacebook sets the "facebook" field if the given value is not nil.

func (*ClubCreate) SetNillableHomepage

func (cc *ClubCreate) SetNillableHomepage(s *string) *ClubCreate

SetNillableHomepage sets the "homepage" field if the given value is not nil.

func (*ClubCreate) SetNillableInstagram

func (cc *ClubCreate) SetNillableInstagram(s *string) *ClubCreate

SetNillableInstagram sets the "instagram" field if the given value is not nil.

func (*ClubCreate) SetNillablePhone

func (cc *ClubCreate) SetNillablePhone(s *string) *ClubCreate

SetNillablePhone sets the "phone" field if the given value is not nil.

func (*ClubCreate) SetNillableRecommended

func (cc *ClubCreate) SetNillableRecommended(b *bool) *ClubCreate

SetNillableRecommended sets the "recommended" field if the given value is not nil.

func (*ClubCreate) SetPhone

func (cc *ClubCreate) SetPhone(s string) *ClubCreate

SetPhone sets the "phone" field.

func (*ClubCreate) SetRecommended

func (cc *ClubCreate) SetRecommended(b bool) *ClubCreate

SetRecommended sets the "recommended" field.

func (*ClubCreate) SetSummary

func (cc *ClubCreate) SetSummary(s string) *ClubCreate

SetSummary sets the "summary" field.

type ClubCreateBulk

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

ClubCreateBulk is the builder for creating many Club entities in bulk.

func (*ClubCreateBulk) Save

func (ccb *ClubCreateBulk) Save(ctx context.Context) ([]*Club, error)

Save creates the Club entities in the database.

func (*ClubCreateBulk) SaveX

func (ccb *ClubCreateBulk) SaveX(ctx context.Context) []*Club

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

type ClubDelete

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

ClubDelete is the builder for deleting a Club entity.

func (*ClubDelete) Exec

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

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

func (*ClubDelete) ExecX

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

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

func (*ClubDelete) Where

func (cd *ClubDelete) Where(ps ...predicate.Club) *ClubDelete

Where adds a new predicate to the ClubDelete builder.

type ClubDeleteOne

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

ClubDeleteOne is the builder for deleting a single Club entity.

func (*ClubDeleteOne) Exec

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

Exec executes the deletion query.

func (*ClubDeleteOne) ExecX

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

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

type ClubEdges

type ClubEdges struct {
	// Likes holds the value of the likes edge.
	Likes []*LikeClub `json:"likes,omitempty"`
	// Categories holds the value of the categories edge.
	Categories []*Category `json:"categories,omitempty"`
	// contains filtered or unexported fields
}

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

func (ClubEdges) CategoriesOrErr

func (e ClubEdges) CategoriesOrErr() ([]*Category, error)

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

func (ClubEdges) LikesOrErr

func (e ClubEdges) LikesOrErr() ([]*LikeClub, error)

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

type ClubGroupBy

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

ClubGroupBy is the group-by builder for Club entities.

func (*ClubGroupBy) Aggregate

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

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

func (*ClubGroupBy) Bool

func (cgb *ClubGroupBy) 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 (*ClubGroupBy) BoolX

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

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

func (*ClubGroupBy) Bools

func (cgb *ClubGroupBy) 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 (*ClubGroupBy) BoolsX

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

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

func (*ClubGroupBy) Float64

func (cgb *ClubGroupBy) 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 (*ClubGroupBy) Float64X

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

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

func (*ClubGroupBy) Float64s

func (cgb *ClubGroupBy) 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 (*ClubGroupBy) Float64sX

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

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

func (*ClubGroupBy) Int

func (cgb *ClubGroupBy) 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 (*ClubGroupBy) IntX

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

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

func (*ClubGroupBy) Ints

func (cgb *ClubGroupBy) 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 (*ClubGroupBy) IntsX

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

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

func (*ClubGroupBy) Scan

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

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

func (*ClubGroupBy) ScanX

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

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

func (*ClubGroupBy) String

func (cgb *ClubGroupBy) 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 (*ClubGroupBy) StringX

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

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

func (*ClubGroupBy) Strings

func (cgb *ClubGroupBy) 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 (*ClubGroupBy) StringsX

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

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

type ClubMutation

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

ClubMutation represents an operation that mutates the Club nodes in the graph.

func (*ClubMutation) AddCategoryIDs

func (m *ClubMutation) AddCategoryIDs(ids ...string)

AddCategoryIDs adds the "categories" edge to the Category entity by ids.

func (*ClubMutation) AddField

func (m *ClubMutation) 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 (*ClubMutation) AddLikeIDs

func (m *ClubMutation) AddLikeIDs(ids ...int)

AddLikeIDs adds the "likes" edge to the LikeClub entity by ids.

func (*ClubMutation) AddedEdges

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

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

func (*ClubMutation) AddedField

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

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

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

func (*ClubMutation) AddedIDs

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

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

func (*ClubMutation) CategoriesCleared

func (m *ClubMutation) CategoriesCleared() bool

CategoriesCleared reports if the "categories" edge to the Category entity was cleared.

func (*ClubMutation) CategoriesIDs

func (m *ClubMutation) CategoriesIDs() (ids []string)

CategoriesIDs returns the "categories" edge IDs in the mutation.

func (*ClubMutation) ClearCategories

func (m *ClubMutation) ClearCategories()

ClearCategories clears the "categories" edge to the Category entity.

func (*ClubMutation) ClearEdge

func (m *ClubMutation) 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 (*ClubMutation) ClearEmail

func (m *ClubMutation) ClearEmail()

ClearEmail clears the value of the "email" field.

func (*ClubMutation) ClearFacebook

func (m *ClubMutation) ClearFacebook()

ClearFacebook clears the value of the "facebook" field.

func (*ClubMutation) ClearField

func (m *ClubMutation) 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 (*ClubMutation) ClearHomepage

func (m *ClubMutation) ClearHomepage()

ClearHomepage clears the value of the "homepage" field.

func (*ClubMutation) ClearImages

func (m *ClubMutation) ClearImages()

ClearImages clears the value of the "images" field.

func (*ClubMutation) ClearInstagram

func (m *ClubMutation) ClearInstagram()

ClearInstagram clears the value of the "instagram" field.

func (*ClubMutation) ClearLikes

func (m *ClubMutation) ClearLikes()

ClearLikes clears the "likes" edge to the LikeClub entity.

func (*ClubMutation) ClearPhone

func (m *ClubMutation) ClearPhone()

ClearPhone clears the value of the "phone" field.

func (*ClubMutation) ClearedEdges

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

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

func (*ClubMutation) ClearedFields

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

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

func (ClubMutation) Client

func (m ClubMutation) 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 (*ClubMutation) Description

func (m *ClubMutation) Description() (r string, exists bool)

Description returns the value of the "description" field in the mutation.

func (*ClubMutation) EdgeCleared

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

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

func (*ClubMutation) Email

func (m *ClubMutation) Email() (r string, exists bool)

Email returns the value of the "email" field in the mutation.

func (*ClubMutation) EmailCleared

func (m *ClubMutation) EmailCleared() bool

EmailCleared returns if the "email" field was cleared in this mutation.

func (*ClubMutation) Facebook

func (m *ClubMutation) Facebook() (r string, exists bool)

Facebook returns the value of the "facebook" field in the mutation.

func (*ClubMutation) FacebookCleared

func (m *ClubMutation) FacebookCleared() bool

FacebookCleared returns if the "facebook" field was cleared in this mutation.

func (*ClubMutation) Field

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

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

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

func (*ClubMutation) Fields

func (m *ClubMutation) 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 (*ClubMutation) Homepage

func (m *ClubMutation) Homepage() (r string, exists bool)

Homepage returns the value of the "homepage" field in the mutation.

func (*ClubMutation) HomepageCleared

func (m *ClubMutation) HomepageCleared() bool

HomepageCleared returns if the "homepage" field was cleared in this mutation.

func (*ClubMutation) ID

func (m *ClubMutation) 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 (*ClubMutation) Images

func (m *ClubMutation) Images() (r []string, exists bool)

Images returns the value of the "images" field in the mutation.

func (*ClubMutation) ImagesCleared

func (m *ClubMutation) ImagesCleared() bool

ImagesCleared returns if the "images" field was cleared in this mutation.

func (*ClubMutation) Instagram

func (m *ClubMutation) Instagram() (r string, exists bool)

Instagram returns the value of the "instagram" field in the mutation.

func (*ClubMutation) InstagramCleared

func (m *ClubMutation) InstagramCleared() bool

InstagramCleared returns if the "instagram" field was cleared in this mutation.

func (*ClubMutation) LikesCleared

func (m *ClubMutation) LikesCleared() bool

LikesCleared reports if the "likes" edge to the LikeClub entity was cleared.

func (*ClubMutation) LikesIDs

func (m *ClubMutation) LikesIDs() (ids []int)

LikesIDs returns the "likes" edge IDs in the mutation.

func (*ClubMutation) Name

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

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

func (*ClubMutation) OldDescription

func (m *ClubMutation) OldDescription(ctx context.Context) (v string, err error)

OldDescription returns the old "description" field's value of the Club entity. If the Club 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 (*ClubMutation) OldEmail

func (m *ClubMutation) OldEmail(ctx context.Context) (v string, err error)

OldEmail returns the old "email" field's value of the Club entity. If the Club 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 (*ClubMutation) OldFacebook

func (m *ClubMutation) OldFacebook(ctx context.Context) (v string, err error)

OldFacebook returns the old "facebook" field's value of the Club entity. If the Club 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 (*ClubMutation) OldField

func (m *ClubMutation) 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 (*ClubMutation) OldHomepage

func (m *ClubMutation) OldHomepage(ctx context.Context) (v string, err error)

OldHomepage returns the old "homepage" field's value of the Club entity. If the Club 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 (*ClubMutation) OldImages

func (m *ClubMutation) OldImages(ctx context.Context) (v []string, err error)

OldImages returns the old "images" field's value of the Club entity. If the Club 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 (*ClubMutation) OldInstagram

func (m *ClubMutation) OldInstagram(ctx context.Context) (v string, err error)

OldInstagram returns the old "instagram" field's value of the Club entity. If the Club 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 (*ClubMutation) OldName

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

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

func (m *ClubMutation) OldPhone(ctx context.Context) (v string, err error)

OldPhone returns the old "phone" field's value of the Club entity. If the Club 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 (*ClubMutation) OldRecommended

func (m *ClubMutation) OldRecommended(ctx context.Context) (v bool, err error)

OldRecommended returns the old "recommended" field's value of the Club entity. If the Club 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 (*ClubMutation) OldSummary

func (m *ClubMutation) OldSummary(ctx context.Context) (v string, err error)

OldSummary returns the old "summary" field's value of the Club entity. If the Club 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 (*ClubMutation) Op

func (m *ClubMutation) Op() Op

Op returns the operation name.

func (*ClubMutation) Phone

func (m *ClubMutation) Phone() (r string, exists bool)

Phone returns the value of the "phone" field in the mutation.

func (*ClubMutation) PhoneCleared

func (m *ClubMutation) PhoneCleared() bool

PhoneCleared returns if the "phone" field was cleared in this mutation.

func (*ClubMutation) Recommended

func (m *ClubMutation) Recommended() (r bool, exists bool)

Recommended returns the value of the "recommended" field in the mutation.

func (*ClubMutation) RemoveCategoryIDs

func (m *ClubMutation) RemoveCategoryIDs(ids ...string)

RemoveCategoryIDs removes the "categories" edge to the Category entity by IDs.

func (*ClubMutation) RemoveLikeIDs

func (m *ClubMutation) RemoveLikeIDs(ids ...int)

RemoveLikeIDs removes the "likes" edge to the LikeClub entity by IDs.

func (*ClubMutation) RemovedCategoriesIDs

func (m *ClubMutation) RemovedCategoriesIDs() (ids []string)

RemovedCategories returns the removed IDs of the "categories" edge to the Category entity.

func (*ClubMutation) RemovedEdges

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

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

func (*ClubMutation) RemovedIDs

func (m *ClubMutation) 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 (*ClubMutation) RemovedLikesIDs

func (m *ClubMutation) RemovedLikesIDs() (ids []int)

RemovedLikes returns the removed IDs of the "likes" edge to the LikeClub entity.

func (*ClubMutation) ResetCategories

func (m *ClubMutation) ResetCategories()

ResetCategories resets all changes to the "categories" edge.

func (*ClubMutation) ResetDescription

func (m *ClubMutation) ResetDescription()

ResetDescription resets all changes to the "description" field.

func (*ClubMutation) ResetEdge

func (m *ClubMutation) 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 (*ClubMutation) ResetEmail

func (m *ClubMutation) ResetEmail()

ResetEmail resets all changes to the "email" field.

func (*ClubMutation) ResetFacebook

func (m *ClubMutation) ResetFacebook()

ResetFacebook resets all changes to the "facebook" field.

func (*ClubMutation) ResetField

func (m *ClubMutation) 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 (*ClubMutation) ResetHomepage

func (m *ClubMutation) ResetHomepage()

ResetHomepage resets all changes to the "homepage" field.

func (*ClubMutation) ResetImages

func (m *ClubMutation) ResetImages()

ResetImages resets all changes to the "images" field.

func (*ClubMutation) ResetInstagram

func (m *ClubMutation) ResetInstagram()

ResetInstagram resets all changes to the "instagram" field.

func (*ClubMutation) ResetLikes

func (m *ClubMutation) ResetLikes()

ResetLikes resets all changes to the "likes" edge.

func (*ClubMutation) ResetName

func (m *ClubMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*ClubMutation) ResetPhone

func (m *ClubMutation) ResetPhone()

ResetPhone resets all changes to the "phone" field.

func (*ClubMutation) ResetRecommended

func (m *ClubMutation) ResetRecommended()

ResetRecommended resets all changes to the "recommended" field.

func (*ClubMutation) ResetSummary

func (m *ClubMutation) ResetSummary()

ResetSummary resets all changes to the "summary" field.

func (*ClubMutation) SetDescription

func (m *ClubMutation) SetDescription(s string)

SetDescription sets the "description" field.

func (*ClubMutation) SetEmail

func (m *ClubMutation) SetEmail(s string)

SetEmail sets the "email" field.

func (*ClubMutation) SetFacebook

func (m *ClubMutation) SetFacebook(s string)

SetFacebook sets the "facebook" field.

func (*ClubMutation) SetField

func (m *ClubMutation) 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 (*ClubMutation) SetHomepage

func (m *ClubMutation) SetHomepage(s string)

SetHomepage sets the "homepage" field.

func (*ClubMutation) SetImages

func (m *ClubMutation) SetImages(s []string)

SetImages sets the "images" field.

func (*ClubMutation) SetInstagram

func (m *ClubMutation) SetInstagram(s string)

SetInstagram sets the "instagram" field.

func (*ClubMutation) SetName

func (m *ClubMutation) SetName(s string)

SetName sets the "name" field.

func (*ClubMutation) SetPhone

func (m *ClubMutation) SetPhone(s string)

SetPhone sets the "phone" field.

func (*ClubMutation) SetRecommended

func (m *ClubMutation) SetRecommended(b bool)

SetRecommended sets the "recommended" field.

func (*ClubMutation) SetSummary

func (m *ClubMutation) SetSummary(s string)

SetSummary sets the "summary" field.

func (*ClubMutation) Summary

func (m *ClubMutation) Summary() (r string, exists bool)

Summary returns the value of the "summary" field in the mutation.

func (ClubMutation) Tx

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

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

func (*ClubMutation) Type

func (m *ClubMutation) Type() string

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

type ClubQuery

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

ClubQuery is the builder for querying Club entities.

func (*ClubQuery) All

func (cq *ClubQuery) All(ctx context.Context) ([]*Club, error)

All executes the query and returns a list of Clubs.

func (*ClubQuery) AllX

func (cq *ClubQuery) AllX(ctx context.Context) []*Club

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

func (*ClubQuery) Clone

func (cq *ClubQuery) Clone() *ClubQuery

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

func (*ClubQuery) Count

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

Count returns the count of the given query.

func (*ClubQuery) CountX

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

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

func (*ClubQuery) Exist

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

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

func (*ClubQuery) ExistX

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

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

func (*ClubQuery) First

func (cq *ClubQuery) First(ctx context.Context) (*Club, error)

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

func (*ClubQuery) FirstID

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

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

func (*ClubQuery) FirstIDX

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

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

func (*ClubQuery) FirstX

func (cq *ClubQuery) FirstX(ctx context.Context) *Club

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

func (*ClubQuery) GroupBy

func (cq *ClubQuery) GroupBy(field string, fields ...string) *ClubGroupBy

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.Club.Query().
	GroupBy(club.FieldName).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*ClubQuery) IDs

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

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

func (*ClubQuery) IDsX

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

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

func (*ClubQuery) Limit

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

Limit adds a limit step to the query.

func (*ClubQuery) Offset

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

Offset adds an offset step to the query.

func (*ClubQuery) Only

func (cq *ClubQuery) Only(ctx context.Context) (*Club, error)

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

func (*ClubQuery) OnlyID

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

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

func (*ClubQuery) OnlyIDX

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

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

func (*ClubQuery) OnlyX

func (cq *ClubQuery) OnlyX(ctx context.Context) *Club

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

func (*ClubQuery) Order

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

Order adds an order step to the query.

func (*ClubQuery) QueryCategories

func (cq *ClubQuery) QueryCategories() *CategoryQuery

QueryCategories chains the current query on the "categories" edge.

func (*ClubQuery) QueryLikes

func (cq *ClubQuery) QueryLikes() *LikeClubQuery

QueryLikes chains the current query on the "likes" edge.

func (*ClubQuery) Select

func (cq *ClubQuery) Select(field string, fields ...string) *ClubSelect

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.Club.Query().
	Select(club.FieldName).
	Scan(ctx, &v)

func (*ClubQuery) Unique

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

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

func (cq *ClubQuery) Where(ps ...predicate.Club) *ClubQuery

Where adds a new predicate for the ClubQuery builder.

func (*ClubQuery) WithCategories

func (cq *ClubQuery) WithCategories(opts ...func(*CategoryQuery)) *ClubQuery

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

func (*ClubQuery) WithLikes

func (cq *ClubQuery) WithLikes(opts ...func(*LikeClubQuery)) *ClubQuery

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

type ClubSelect

type ClubSelect struct {
	*ClubQuery
	// contains filtered or unexported fields
}

ClubSelect is the builder for selecting fields of Club entities.

func (*ClubSelect) Bool

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

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

func (*ClubSelect) BoolX

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

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

func (*ClubSelect) Bools

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

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

func (*ClubSelect) BoolsX

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

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

func (*ClubSelect) Float64

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

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

func (*ClubSelect) Float64X

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

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

func (*ClubSelect) Float64s

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

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

func (*ClubSelect) Float64sX

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

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

func (*ClubSelect) Int

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

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

func (*ClubSelect) IntX

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

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

func (*ClubSelect) Ints

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

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

func (*ClubSelect) IntsX

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

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

func (*ClubSelect) Scan

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

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

func (*ClubSelect) ScanX

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

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

func (*ClubSelect) String

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

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

func (*ClubSelect) StringX

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

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

func (*ClubSelect) Strings

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

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

func (*ClubSelect) StringsX

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

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

type ClubUpdate

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

ClubUpdate is the builder for updating Club entities.

func (*ClubUpdate) AddCategories

func (cu *ClubUpdate) AddCategories(c ...*Category) *ClubUpdate

AddCategories adds the "categories" edges to the Category entity.

func (*ClubUpdate) AddCategoryIDs

func (cu *ClubUpdate) AddCategoryIDs(ids ...string) *ClubUpdate

AddCategoryIDs adds the "categories" edge to the Category entity by IDs.

func (*ClubUpdate) AddLikeIDs

func (cu *ClubUpdate) AddLikeIDs(ids ...int) *ClubUpdate

AddLikeIDs adds the "likes" edge to the LikeClub entity by IDs.

func (*ClubUpdate) AddLikes

func (cu *ClubUpdate) AddLikes(l ...*LikeClub) *ClubUpdate

AddLikes adds the "likes" edges to the LikeClub entity.

func (*ClubUpdate) ClearCategories

func (cu *ClubUpdate) ClearCategories() *ClubUpdate

ClearCategories clears all "categories" edges to the Category entity.

func (*ClubUpdate) ClearEmail

func (cu *ClubUpdate) ClearEmail() *ClubUpdate

ClearEmail clears the value of the "email" field.

func (*ClubUpdate) ClearFacebook

func (cu *ClubUpdate) ClearFacebook() *ClubUpdate

ClearFacebook clears the value of the "facebook" field.

func (*ClubUpdate) ClearHomepage

func (cu *ClubUpdate) ClearHomepage() *ClubUpdate

ClearHomepage clears the value of the "homepage" field.

func (*ClubUpdate) ClearImages

func (cu *ClubUpdate) ClearImages() *ClubUpdate

ClearImages clears the value of the "images" field.

func (*ClubUpdate) ClearInstagram

func (cu *ClubUpdate) ClearInstagram() *ClubUpdate

ClearInstagram clears the value of the "instagram" field.

func (*ClubUpdate) ClearLikes

func (cu *ClubUpdate) ClearLikes() *ClubUpdate

ClearLikes clears all "likes" edges to the LikeClub entity.

func (*ClubUpdate) ClearPhone

func (cu *ClubUpdate) ClearPhone() *ClubUpdate

ClearPhone clears the value of the "phone" field.

func (*ClubUpdate) Exec

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

Exec executes the query.

func (*ClubUpdate) ExecX

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

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

func (*ClubUpdate) Mutation

func (cu *ClubUpdate) Mutation() *ClubMutation

Mutation returns the ClubMutation object of the builder.

func (*ClubUpdate) RemoveCategories

func (cu *ClubUpdate) RemoveCategories(c ...*Category) *ClubUpdate

RemoveCategories removes "categories" edges to Category entities.

func (*ClubUpdate) RemoveCategoryIDs

func (cu *ClubUpdate) RemoveCategoryIDs(ids ...string) *ClubUpdate

RemoveCategoryIDs removes the "categories" edge to Category entities by IDs.

func (*ClubUpdate) RemoveLikeIDs

func (cu *ClubUpdate) RemoveLikeIDs(ids ...int) *ClubUpdate

RemoveLikeIDs removes the "likes" edge to LikeClub entities by IDs.

func (*ClubUpdate) RemoveLikes

func (cu *ClubUpdate) RemoveLikes(l ...*LikeClub) *ClubUpdate

RemoveLikes removes "likes" edges to LikeClub entities.

func (*ClubUpdate) Save

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

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

func (*ClubUpdate) SaveX

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

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

func (*ClubUpdate) SetDescription

func (cu *ClubUpdate) SetDescription(s string) *ClubUpdate

SetDescription sets the "description" field.

func (*ClubUpdate) SetEmail

func (cu *ClubUpdate) SetEmail(s string) *ClubUpdate

SetEmail sets the "email" field.

func (*ClubUpdate) SetFacebook

func (cu *ClubUpdate) SetFacebook(s string) *ClubUpdate

SetFacebook sets the "facebook" field.

func (*ClubUpdate) SetHomepage

func (cu *ClubUpdate) SetHomepage(s string) *ClubUpdate

SetHomepage sets the "homepage" field.

func (*ClubUpdate) SetImages

func (cu *ClubUpdate) SetImages(s []string) *ClubUpdate

SetImages sets the "images" field.

func (*ClubUpdate) SetInstagram

func (cu *ClubUpdate) SetInstagram(s string) *ClubUpdate

SetInstagram sets the "instagram" field.

func (*ClubUpdate) SetName

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

SetName sets the "name" field.

func (*ClubUpdate) SetNillableEmail

func (cu *ClubUpdate) SetNillableEmail(s *string) *ClubUpdate

SetNillableEmail sets the "email" field if the given value is not nil.

func (*ClubUpdate) SetNillableFacebook

func (cu *ClubUpdate) SetNillableFacebook(s *string) *ClubUpdate

SetNillableFacebook sets the "facebook" field if the given value is not nil.

func (*ClubUpdate) SetNillableHomepage

func (cu *ClubUpdate) SetNillableHomepage(s *string) *ClubUpdate

SetNillableHomepage sets the "homepage" field if the given value is not nil.

func (*ClubUpdate) SetNillableInstagram

func (cu *ClubUpdate) SetNillableInstagram(s *string) *ClubUpdate

SetNillableInstagram sets the "instagram" field if the given value is not nil.

func (*ClubUpdate) SetNillablePhone

func (cu *ClubUpdate) SetNillablePhone(s *string) *ClubUpdate

SetNillablePhone sets the "phone" field if the given value is not nil.

func (*ClubUpdate) SetNillableRecommended

func (cu *ClubUpdate) SetNillableRecommended(b *bool) *ClubUpdate

SetNillableRecommended sets the "recommended" field if the given value is not nil.

func (*ClubUpdate) SetPhone

func (cu *ClubUpdate) SetPhone(s string) *ClubUpdate

SetPhone sets the "phone" field.

func (*ClubUpdate) SetRecommended

func (cu *ClubUpdate) SetRecommended(b bool) *ClubUpdate

SetRecommended sets the "recommended" field.

func (*ClubUpdate) SetSummary

func (cu *ClubUpdate) SetSummary(s string) *ClubUpdate

SetSummary sets the "summary" field.

func (*ClubUpdate) Where

func (cu *ClubUpdate) Where(ps ...predicate.Club) *ClubUpdate

Where adds a new predicate for the ClubUpdate builder.

type ClubUpdateOne

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

ClubUpdateOne is the builder for updating a single Club entity.

func (*ClubUpdateOne) AddCategories

func (cuo *ClubUpdateOne) AddCategories(c ...*Category) *ClubUpdateOne

AddCategories adds the "categories" edges to the Category entity.

func (*ClubUpdateOne) AddCategoryIDs

func (cuo *ClubUpdateOne) AddCategoryIDs(ids ...string) *ClubUpdateOne

AddCategoryIDs adds the "categories" edge to the Category entity by IDs.

func (*ClubUpdateOne) AddLikeIDs

func (cuo *ClubUpdateOne) AddLikeIDs(ids ...int) *ClubUpdateOne

AddLikeIDs adds the "likes" edge to the LikeClub entity by IDs.

func (*ClubUpdateOne) AddLikes

func (cuo *ClubUpdateOne) AddLikes(l ...*LikeClub) *ClubUpdateOne

AddLikes adds the "likes" edges to the LikeClub entity.

func (*ClubUpdateOne) ClearCategories

func (cuo *ClubUpdateOne) ClearCategories() *ClubUpdateOne

ClearCategories clears all "categories" edges to the Category entity.

func (*ClubUpdateOne) ClearEmail

func (cuo *ClubUpdateOne) ClearEmail() *ClubUpdateOne

ClearEmail clears the value of the "email" field.

func (*ClubUpdateOne) ClearFacebook

func (cuo *ClubUpdateOne) ClearFacebook() *ClubUpdateOne

ClearFacebook clears the value of the "facebook" field.

func (*ClubUpdateOne) ClearHomepage

func (cuo *ClubUpdateOne) ClearHomepage() *ClubUpdateOne

ClearHomepage clears the value of the "homepage" field.

func (*ClubUpdateOne) ClearImages

func (cuo *ClubUpdateOne) ClearImages() *ClubUpdateOne

ClearImages clears the value of the "images" field.

func (*ClubUpdateOne) ClearInstagram

func (cuo *ClubUpdateOne) ClearInstagram() *ClubUpdateOne

ClearInstagram clears the value of the "instagram" field.

func (*ClubUpdateOne) ClearLikes

func (cuo *ClubUpdateOne) ClearLikes() *ClubUpdateOne

ClearLikes clears all "likes" edges to the LikeClub entity.

func (*ClubUpdateOne) ClearPhone

func (cuo *ClubUpdateOne) ClearPhone() *ClubUpdateOne

ClearPhone clears the value of the "phone" field.

func (*ClubUpdateOne) Exec

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

Exec executes the query on the entity.

func (*ClubUpdateOne) ExecX

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

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

func (*ClubUpdateOne) Mutation

func (cuo *ClubUpdateOne) Mutation() *ClubMutation

Mutation returns the ClubMutation object of the builder.

func (*ClubUpdateOne) RemoveCategories

func (cuo *ClubUpdateOne) RemoveCategories(c ...*Category) *ClubUpdateOne

RemoveCategories removes "categories" edges to Category entities.

func (*ClubUpdateOne) RemoveCategoryIDs

func (cuo *ClubUpdateOne) RemoveCategoryIDs(ids ...string) *ClubUpdateOne

RemoveCategoryIDs removes the "categories" edge to Category entities by IDs.

func (*ClubUpdateOne) RemoveLikeIDs

func (cuo *ClubUpdateOne) RemoveLikeIDs(ids ...int) *ClubUpdateOne

RemoveLikeIDs removes the "likes" edge to LikeClub entities by IDs.

func (*ClubUpdateOne) RemoveLikes

func (cuo *ClubUpdateOne) RemoveLikes(l ...*LikeClub) *ClubUpdateOne

RemoveLikes removes "likes" edges to LikeClub entities.

func (*ClubUpdateOne) Save

func (cuo *ClubUpdateOne) Save(ctx context.Context) (*Club, error)

Save executes the query and returns the updated Club entity.

func (*ClubUpdateOne) SaveX

func (cuo *ClubUpdateOne) SaveX(ctx context.Context) *Club

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

func (*ClubUpdateOne) Select

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

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

func (*ClubUpdateOne) SetDescription

func (cuo *ClubUpdateOne) SetDescription(s string) *ClubUpdateOne

SetDescription sets the "description" field.

func (*ClubUpdateOne) SetEmail

func (cuo *ClubUpdateOne) SetEmail(s string) *ClubUpdateOne

SetEmail sets the "email" field.

func (*ClubUpdateOne) SetFacebook

func (cuo *ClubUpdateOne) SetFacebook(s string) *ClubUpdateOne

SetFacebook sets the "facebook" field.

func (*ClubUpdateOne) SetHomepage

func (cuo *ClubUpdateOne) SetHomepage(s string) *ClubUpdateOne

SetHomepage sets the "homepage" field.

func (*ClubUpdateOne) SetImages

func (cuo *ClubUpdateOne) SetImages(s []string) *ClubUpdateOne

SetImages sets the "images" field.

func (*ClubUpdateOne) SetInstagram

func (cuo *ClubUpdateOne) SetInstagram(s string) *ClubUpdateOne

SetInstagram sets the "instagram" field.

func (*ClubUpdateOne) SetName

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

SetName sets the "name" field.

func (*ClubUpdateOne) SetNillableEmail

func (cuo *ClubUpdateOne) SetNillableEmail(s *string) *ClubUpdateOne

SetNillableEmail sets the "email" field if the given value is not nil.

func (*ClubUpdateOne) SetNillableFacebook

func (cuo *ClubUpdateOne) SetNillableFacebook(s *string) *ClubUpdateOne

SetNillableFacebook sets the "facebook" field if the given value is not nil.

func (*ClubUpdateOne) SetNillableHomepage

func (cuo *ClubUpdateOne) SetNillableHomepage(s *string) *ClubUpdateOne

SetNillableHomepage sets the "homepage" field if the given value is not nil.

func (*ClubUpdateOne) SetNillableInstagram

func (cuo *ClubUpdateOne) SetNillableInstagram(s *string) *ClubUpdateOne

SetNillableInstagram sets the "instagram" field if the given value is not nil.

func (*ClubUpdateOne) SetNillablePhone

func (cuo *ClubUpdateOne) SetNillablePhone(s *string) *ClubUpdateOne

SetNillablePhone sets the "phone" field if the given value is not nil.

func (*ClubUpdateOne) SetNillableRecommended

func (cuo *ClubUpdateOne) SetNillableRecommended(b *bool) *ClubUpdateOne

SetNillableRecommended sets the "recommended" field if the given value is not nil.

func (*ClubUpdateOne) SetPhone

func (cuo *ClubUpdateOne) SetPhone(s string) *ClubUpdateOne

SetPhone sets the "phone" field.

func (*ClubUpdateOne) SetRecommended

func (cuo *ClubUpdateOne) SetRecommended(b bool) *ClubUpdateOne

SetRecommended sets the "recommended" field.

func (*ClubUpdateOne) SetSummary

func (cuo *ClubUpdateOne) SetSummary(s string) *ClubUpdateOne

SetSummary sets the "summary" field.

type Clubs

type Clubs []*Club

Clubs is a parsable slice of Club.

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 Hook

type Hook = ent.Hook

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

type LikeClub

type LikeClub struct {

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

LikeClub is the model entity for the LikeClub schema.

func (*LikeClub) QueryClub

func (lc *LikeClub) QueryClub() *ClubQuery

QueryClub queries the "club" edge of the LikeClub entity.

func (*LikeClub) String

func (lc *LikeClub) String() string

String implements the fmt.Stringer.

func (*LikeClub) Unwrap

func (lc *LikeClub) Unwrap() *LikeClub

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

func (lc *LikeClub) Update() *LikeClubUpdateOne

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

type LikeClubClient

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

LikeClubClient is a client for the LikeClub schema.

func NewLikeClubClient

func NewLikeClubClient(c config) *LikeClubClient

NewLikeClubClient returns a client for the LikeClub from the given config.

func (*LikeClubClient) Create

func (c *LikeClubClient) Create() *LikeClubCreate

Create returns a create builder for LikeClub.

func (*LikeClubClient) CreateBulk

func (c *LikeClubClient) CreateBulk(builders ...*LikeClubCreate) *LikeClubCreateBulk

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

func (*LikeClubClient) Delete

func (c *LikeClubClient) Delete() *LikeClubDelete

Delete returns a delete builder for LikeClub.

func (*LikeClubClient) DeleteOne

func (c *LikeClubClient) DeleteOne(lc *LikeClub) *LikeClubDeleteOne

DeleteOne returns a delete builder for the given entity.

func (*LikeClubClient) DeleteOneID

func (c *LikeClubClient) DeleteOneID(id int) *LikeClubDeleteOne

DeleteOneID returns a delete builder for the given id.

func (*LikeClubClient) Get

func (c *LikeClubClient) Get(ctx context.Context, id int) (*LikeClub, error)

Get returns a LikeClub entity by its id.

func (*LikeClubClient) GetX

func (c *LikeClubClient) GetX(ctx context.Context, id int) *LikeClub

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

func (*LikeClubClient) Hooks

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

Hooks returns the client hooks.

func (*LikeClubClient) Query

func (c *LikeClubClient) Query() *LikeClubQuery

Query returns a query builder for LikeClub.

func (*LikeClubClient) QueryClub

func (c *LikeClubClient) QueryClub(lc *LikeClub) *ClubQuery

QueryClub queries the club edge of a LikeClub.

func (*LikeClubClient) Update

func (c *LikeClubClient) Update() *LikeClubUpdate

Update returns an update builder for LikeClub.

func (*LikeClubClient) UpdateOne

func (c *LikeClubClient) UpdateOne(lc *LikeClub) *LikeClubUpdateOne

UpdateOne returns an update builder for the given entity.

func (*LikeClubClient) UpdateOneID

func (c *LikeClubClient) UpdateOneID(id int) *LikeClubUpdateOne

UpdateOneID returns an update builder for the given id.

func (*LikeClubClient) Use

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

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

type LikeClubCreate

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

LikeClubCreate is the builder for creating a LikeClub entity.

func (*LikeClubCreate) Mutation

func (lcc *LikeClubCreate) Mutation() *LikeClubMutation

Mutation returns the LikeClubMutation object of the builder.

func (*LikeClubCreate) Save

func (lcc *LikeClubCreate) Save(ctx context.Context) (*LikeClub, error)

Save creates the LikeClub in the database.

func (*LikeClubCreate) SaveX

func (lcc *LikeClubCreate) SaveX(ctx context.Context) *LikeClub

SaveX calls Save and panics if Save returns an error.

func (*LikeClubCreate) SetClub

func (lcc *LikeClubCreate) SetClub(c *Club) *LikeClubCreate

SetClub sets the "club" edge to the Club entity.

func (*LikeClubCreate) SetClubID

func (lcc *LikeClubCreate) SetClubID(id int) *LikeClubCreate

SetClubID sets the "club" edge to the Club entity by ID.

func (*LikeClubCreate) SetCreatedAt

func (lcc *LikeClubCreate) SetCreatedAt(t time.Time) *LikeClubCreate

SetCreatedAt sets the "created_at" field.

func (*LikeClubCreate) SetNillableClubID

func (lcc *LikeClubCreate) SetNillableClubID(id *int) *LikeClubCreate

SetNillableClubID sets the "club" edge to the Club entity by ID if the given value is not nil.

func (*LikeClubCreate) SetUsername

func (lcc *LikeClubCreate) SetUsername(s string) *LikeClubCreate

SetUsername sets the "username" field.

type LikeClubCreateBulk

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

LikeClubCreateBulk is the builder for creating many LikeClub entities in bulk.

func (*LikeClubCreateBulk) Save

func (lccb *LikeClubCreateBulk) Save(ctx context.Context) ([]*LikeClub, error)

Save creates the LikeClub entities in the database.

func (*LikeClubCreateBulk) SaveX

func (lccb *LikeClubCreateBulk) SaveX(ctx context.Context) []*LikeClub

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

type LikeClubDelete

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

LikeClubDelete is the builder for deleting a LikeClub entity.

func (*LikeClubDelete) Exec

func (lcd *LikeClubDelete) Exec(ctx context.Context) (int, error)

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

func (*LikeClubDelete) ExecX

func (lcd *LikeClubDelete) ExecX(ctx context.Context) int

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

func (*LikeClubDelete) Where

func (lcd *LikeClubDelete) Where(ps ...predicate.LikeClub) *LikeClubDelete

Where adds a new predicate to the LikeClubDelete builder.

type LikeClubDeleteOne

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

LikeClubDeleteOne is the builder for deleting a single LikeClub entity.

func (*LikeClubDeleteOne) Exec

func (lcdo *LikeClubDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*LikeClubDeleteOne) ExecX

func (lcdo *LikeClubDeleteOne) ExecX(ctx context.Context)

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

type LikeClubEdges

type LikeClubEdges struct {
	// Club holds the value of the club edge.
	Club *Club `json:"club,omitempty"`
	// contains filtered or unexported fields
}

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

func (LikeClubEdges) ClubOrErr

func (e LikeClubEdges) ClubOrErr() (*Club, error)

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

type LikeClubGroupBy

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

LikeClubGroupBy is the group-by builder for LikeClub entities.

func (*LikeClubGroupBy) Aggregate

func (lcgb *LikeClubGroupBy) Aggregate(fns ...AggregateFunc) *LikeClubGroupBy

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

func (*LikeClubGroupBy) Bool

func (lcgb *LikeClubGroupBy) 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 (*LikeClubGroupBy) BoolX

func (lcgb *LikeClubGroupBy) BoolX(ctx context.Context) bool

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

func (*LikeClubGroupBy) Bools

func (lcgb *LikeClubGroupBy) 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 (*LikeClubGroupBy) BoolsX

func (lcgb *LikeClubGroupBy) BoolsX(ctx context.Context) []bool

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

func (*LikeClubGroupBy) Float64

func (lcgb *LikeClubGroupBy) 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 (*LikeClubGroupBy) Float64X

func (lcgb *LikeClubGroupBy) Float64X(ctx context.Context) float64

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

func (*LikeClubGroupBy) Float64s

func (lcgb *LikeClubGroupBy) 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 (*LikeClubGroupBy) Float64sX

func (lcgb *LikeClubGroupBy) Float64sX(ctx context.Context) []float64

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

func (*LikeClubGroupBy) Int

func (lcgb *LikeClubGroupBy) 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 (*LikeClubGroupBy) IntX

func (lcgb *LikeClubGroupBy) IntX(ctx context.Context) int

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

func (*LikeClubGroupBy) Ints

func (lcgb *LikeClubGroupBy) 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 (*LikeClubGroupBy) IntsX

func (lcgb *LikeClubGroupBy) IntsX(ctx context.Context) []int

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

func (*LikeClubGroupBy) Scan

func (lcgb *LikeClubGroupBy) Scan(ctx context.Context, v interface{}) error

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

func (*LikeClubGroupBy) ScanX

func (lcgb *LikeClubGroupBy) ScanX(ctx context.Context, v interface{})

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

func (*LikeClubGroupBy) String

func (lcgb *LikeClubGroupBy) 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 (*LikeClubGroupBy) StringX

func (lcgb *LikeClubGroupBy) StringX(ctx context.Context) string

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

func (*LikeClubGroupBy) Strings

func (lcgb *LikeClubGroupBy) 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 (*LikeClubGroupBy) StringsX

func (lcgb *LikeClubGroupBy) StringsX(ctx context.Context) []string

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

type LikeClubMutation

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

LikeClubMutation represents an operation that mutates the LikeClub nodes in the graph.

func (*LikeClubMutation) AddField

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

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

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

func (*LikeClubMutation) AddedField

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

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

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

func (*LikeClubMutation) AddedIDs

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

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

func (*LikeClubMutation) ClearClub

func (m *LikeClubMutation) ClearClub()

ClearClub clears the "club" edge to the Club entity.

func (*LikeClubMutation) ClearEdge

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

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

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

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

func (*LikeClubMutation) ClearedFields

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

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

func (LikeClubMutation) Client

func (m LikeClubMutation) 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 (*LikeClubMutation) ClubCleared

func (m *LikeClubMutation) ClubCleared() bool

ClubCleared reports if the "club" edge to the Club entity was cleared.

func (*LikeClubMutation) ClubID

func (m *LikeClubMutation) ClubID() (id int, exists bool)

ClubID returns the "club" edge ID in the mutation.

func (*LikeClubMutation) ClubIDs

func (m *LikeClubMutation) ClubIDs() (ids []int)

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

func (*LikeClubMutation) CreatedAt

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

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

func (*LikeClubMutation) EdgeCleared

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

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

func (*LikeClubMutation) Field

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

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

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

func (*LikeClubMutation) Fields

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

func (m *LikeClubMutation) 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 (*LikeClubMutation) OldCreatedAt

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

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

func (m *LikeClubMutation) 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 (*LikeClubMutation) OldUsername

func (m *LikeClubMutation) OldUsername(ctx context.Context) (v string, err error)

OldUsername returns the old "username" field's value of the LikeClub entity. If the LikeClub 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 (*LikeClubMutation) Op

func (m *LikeClubMutation) Op() Op

Op returns the operation name.

func (*LikeClubMutation) RemovedEdges

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

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

func (*LikeClubMutation) RemovedIDs

func (m *LikeClubMutation) 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 (*LikeClubMutation) ResetClub

func (m *LikeClubMutation) ResetClub()

ResetClub resets all changes to the "club" edge.

func (*LikeClubMutation) ResetCreatedAt

func (m *LikeClubMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*LikeClubMutation) ResetEdge

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

func (m *LikeClubMutation) 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 (*LikeClubMutation) ResetUsername

func (m *LikeClubMutation) ResetUsername()

ResetUsername resets all changes to the "username" field.

func (*LikeClubMutation) SetClubID

func (m *LikeClubMutation) SetClubID(id int)

SetClubID sets the "club" edge to the Club entity by id.

func (*LikeClubMutation) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*LikeClubMutation) SetField

func (m *LikeClubMutation) 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 (*LikeClubMutation) SetUsername

func (m *LikeClubMutation) SetUsername(s string)

SetUsername sets the "username" field.

func (LikeClubMutation) Tx

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

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

func (*LikeClubMutation) Type

func (m *LikeClubMutation) Type() string

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

func (*LikeClubMutation) Username

func (m *LikeClubMutation) Username() (r string, exists bool)

Username returns the value of the "username" field in the mutation.

type LikeClubQuery

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

LikeClubQuery is the builder for querying LikeClub entities.

func (*LikeClubQuery) All

func (lcq *LikeClubQuery) All(ctx context.Context) ([]*LikeClub, error)

All executes the query and returns a list of LikeClubs.

func (*LikeClubQuery) AllX

func (lcq *LikeClubQuery) AllX(ctx context.Context) []*LikeClub

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

func (*LikeClubQuery) Clone

func (lcq *LikeClubQuery) Clone() *LikeClubQuery

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

func (*LikeClubQuery) Count

func (lcq *LikeClubQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*LikeClubQuery) CountX

func (lcq *LikeClubQuery) CountX(ctx context.Context) int

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

func (*LikeClubQuery) Exist

func (lcq *LikeClubQuery) Exist(ctx context.Context) (bool, error)

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

func (*LikeClubQuery) ExistX

func (lcq *LikeClubQuery) ExistX(ctx context.Context) bool

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

func (*LikeClubQuery) First

func (lcq *LikeClubQuery) First(ctx context.Context) (*LikeClub, error)

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

func (*LikeClubQuery) FirstID

func (lcq *LikeClubQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*LikeClubQuery) FirstIDX

func (lcq *LikeClubQuery) FirstIDX(ctx context.Context) int

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

func (*LikeClubQuery) FirstX

func (lcq *LikeClubQuery) FirstX(ctx context.Context) *LikeClub

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

func (*LikeClubQuery) GroupBy

func (lcq *LikeClubQuery) GroupBy(field string, fields ...string) *LikeClubGroupBy

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.LikeClub.Query().
	GroupBy(likeclub.FieldUsername).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*LikeClubQuery) IDs

func (lcq *LikeClubQuery) IDs(ctx context.Context) ([]int, error)

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

func (*LikeClubQuery) IDsX

func (lcq *LikeClubQuery) IDsX(ctx context.Context) []int

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

func (*LikeClubQuery) Limit

func (lcq *LikeClubQuery) Limit(limit int) *LikeClubQuery

Limit adds a limit step to the query.

func (*LikeClubQuery) Offset

func (lcq *LikeClubQuery) Offset(offset int) *LikeClubQuery

Offset adds an offset step to the query.

func (*LikeClubQuery) Only

func (lcq *LikeClubQuery) Only(ctx context.Context) (*LikeClub, error)

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

func (*LikeClubQuery) OnlyID

func (lcq *LikeClubQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*LikeClubQuery) OnlyIDX

func (lcq *LikeClubQuery) OnlyIDX(ctx context.Context) int

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

func (*LikeClubQuery) OnlyX

func (lcq *LikeClubQuery) OnlyX(ctx context.Context) *LikeClub

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

func (*LikeClubQuery) Order

func (lcq *LikeClubQuery) Order(o ...OrderFunc) *LikeClubQuery

Order adds an order step to the query.

func (*LikeClubQuery) QueryClub

func (lcq *LikeClubQuery) QueryClub() *ClubQuery

QueryClub chains the current query on the "club" edge.

func (*LikeClubQuery) Select

func (lcq *LikeClubQuery) Select(field string, fields ...string) *LikeClubSelect

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.LikeClub.Query().
	Select(likeclub.FieldUsername).
	Scan(ctx, &v)

func (*LikeClubQuery) Unique

func (lcq *LikeClubQuery) Unique(unique bool) *LikeClubQuery

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

func (lcq *LikeClubQuery) Where(ps ...predicate.LikeClub) *LikeClubQuery

Where adds a new predicate for the LikeClubQuery builder.

func (*LikeClubQuery) WithClub

func (lcq *LikeClubQuery) WithClub(opts ...func(*ClubQuery)) *LikeClubQuery

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

type LikeClubSelect

type LikeClubSelect struct {
	*LikeClubQuery
	// contains filtered or unexported fields
}

LikeClubSelect is the builder for selecting fields of LikeClub entities.

func (*LikeClubSelect) Bool

func (lcs *LikeClubSelect) Bool(ctx context.Context) (_ bool, err error)

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

func (*LikeClubSelect) BoolX

func (lcs *LikeClubSelect) BoolX(ctx context.Context) bool

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

func (*LikeClubSelect) Bools

func (lcs *LikeClubSelect) Bools(ctx context.Context) ([]bool, error)

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

func (*LikeClubSelect) BoolsX

func (lcs *LikeClubSelect) BoolsX(ctx context.Context) []bool

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

func (*LikeClubSelect) Float64

func (lcs *LikeClubSelect) Float64(ctx context.Context) (_ float64, err error)

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

func (*LikeClubSelect) Float64X

func (lcs *LikeClubSelect) Float64X(ctx context.Context) float64

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

func (*LikeClubSelect) Float64s

func (lcs *LikeClubSelect) Float64s(ctx context.Context) ([]float64, error)

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

func (*LikeClubSelect) Float64sX

func (lcs *LikeClubSelect) Float64sX(ctx context.Context) []float64

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

func (*LikeClubSelect) Int

func (lcs *LikeClubSelect) Int(ctx context.Context) (_ int, err error)

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

func (*LikeClubSelect) IntX

func (lcs *LikeClubSelect) IntX(ctx context.Context) int

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

func (*LikeClubSelect) Ints

func (lcs *LikeClubSelect) Ints(ctx context.Context) ([]int, error)

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

func (*LikeClubSelect) IntsX

func (lcs *LikeClubSelect) IntsX(ctx context.Context) []int

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

func (*LikeClubSelect) Scan

func (lcs *LikeClubSelect) Scan(ctx context.Context, v interface{}) error

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

func (*LikeClubSelect) ScanX

func (lcs *LikeClubSelect) ScanX(ctx context.Context, v interface{})

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

func (*LikeClubSelect) String

func (lcs *LikeClubSelect) String(ctx context.Context) (_ string, err error)

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

func (*LikeClubSelect) StringX

func (lcs *LikeClubSelect) StringX(ctx context.Context) string

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

func (*LikeClubSelect) Strings

func (lcs *LikeClubSelect) Strings(ctx context.Context) ([]string, error)

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

func (*LikeClubSelect) StringsX

func (lcs *LikeClubSelect) StringsX(ctx context.Context) []string

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

type LikeClubUpdate

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

LikeClubUpdate is the builder for updating LikeClub entities.

func (*LikeClubUpdate) ClearClub

func (lcu *LikeClubUpdate) ClearClub() *LikeClubUpdate

ClearClub clears the "club" edge to the Club entity.

func (*LikeClubUpdate) Exec

func (lcu *LikeClubUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*LikeClubUpdate) ExecX

func (lcu *LikeClubUpdate) ExecX(ctx context.Context)

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

func (*LikeClubUpdate) Mutation

func (lcu *LikeClubUpdate) Mutation() *LikeClubMutation

Mutation returns the LikeClubMutation object of the builder.

func (*LikeClubUpdate) Save

func (lcu *LikeClubUpdate) Save(ctx context.Context) (int, error)

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

func (*LikeClubUpdate) SaveX

func (lcu *LikeClubUpdate) SaveX(ctx context.Context) int

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

func (*LikeClubUpdate) SetClub

func (lcu *LikeClubUpdate) SetClub(c *Club) *LikeClubUpdate

SetClub sets the "club" edge to the Club entity.

func (*LikeClubUpdate) SetClubID

func (lcu *LikeClubUpdate) SetClubID(id int) *LikeClubUpdate

SetClubID sets the "club" edge to the Club entity by ID.

func (*LikeClubUpdate) SetCreatedAt

func (lcu *LikeClubUpdate) SetCreatedAt(t time.Time) *LikeClubUpdate

SetCreatedAt sets the "created_at" field.

func (*LikeClubUpdate) SetNillableClubID

func (lcu *LikeClubUpdate) SetNillableClubID(id *int) *LikeClubUpdate

SetNillableClubID sets the "club" edge to the Club entity by ID if the given value is not nil.

func (*LikeClubUpdate) SetUsername

func (lcu *LikeClubUpdate) SetUsername(s string) *LikeClubUpdate

SetUsername sets the "username" field.

func (*LikeClubUpdate) Where

func (lcu *LikeClubUpdate) Where(ps ...predicate.LikeClub) *LikeClubUpdate

Where adds a new predicate for the LikeClubUpdate builder.

type LikeClubUpdateOne

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

LikeClubUpdateOne is the builder for updating a single LikeClub entity.

func (*LikeClubUpdateOne) ClearClub

func (lcuo *LikeClubUpdateOne) ClearClub() *LikeClubUpdateOne

ClearClub clears the "club" edge to the Club entity.

func (*LikeClubUpdateOne) Exec

func (lcuo *LikeClubUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*LikeClubUpdateOne) ExecX

func (lcuo *LikeClubUpdateOne) ExecX(ctx context.Context)

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

func (*LikeClubUpdateOne) Mutation

func (lcuo *LikeClubUpdateOne) Mutation() *LikeClubMutation

Mutation returns the LikeClubMutation object of the builder.

func (*LikeClubUpdateOne) Save

func (lcuo *LikeClubUpdateOne) Save(ctx context.Context) (*LikeClub, error)

Save executes the query and returns the updated LikeClub entity.

func (*LikeClubUpdateOne) SaveX

func (lcuo *LikeClubUpdateOne) SaveX(ctx context.Context) *LikeClub

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

func (*LikeClubUpdateOne) Select

func (lcuo *LikeClubUpdateOne) Select(field string, fields ...string) *LikeClubUpdateOne

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

func (*LikeClubUpdateOne) SetClub

func (lcuo *LikeClubUpdateOne) SetClub(c *Club) *LikeClubUpdateOne

SetClub sets the "club" edge to the Club entity.

func (*LikeClubUpdateOne) SetClubID

func (lcuo *LikeClubUpdateOne) SetClubID(id int) *LikeClubUpdateOne

SetClubID sets the "club" edge to the Club entity by ID.

func (*LikeClubUpdateOne) SetCreatedAt

func (lcuo *LikeClubUpdateOne) SetCreatedAt(t time.Time) *LikeClubUpdateOne

SetCreatedAt sets the "created_at" field.

func (*LikeClubUpdateOne) SetNillableClubID

func (lcuo *LikeClubUpdateOne) SetNillableClubID(id *int) *LikeClubUpdateOne

SetNillableClubID sets the "club" edge to the Club entity by ID if the given value is not nil.

func (*LikeClubUpdateOne) SetUsername

func (lcuo *LikeClubUpdateOne) SetUsername(s string) *LikeClubUpdateOne

SetUsername sets the "username" field.

type LikeClubs

type LikeClubs []*LikeClub

LikeClubs is a parsable slice of LikeClub.

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 Tx

type Tx struct {

	// Category is the client for interacting with the Category builders.
	Category *CategoryClient
	// Club is the client for interacting with the Club builders.
	Club *ClubClient
	// LikeClub is the client for interacting with the LikeClub builders.
	LikeClub *LikeClubClient
	// contains filtered or unexported fields
}

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

func TxFromContext

func TxFromContext(ctx context.Context) *Tx

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

func (*Tx) Client

func (tx *Tx) Client() *Client

Client returns a Client that binds to current transaction.

func (*Tx) Commit

func (tx *Tx) Commit() error

Commit commits the transaction.

func (*Tx) OnCommit

func (tx *Tx) OnCommit(f CommitHook)

OnCommit adds a hook to call on commit.

func (*Tx) OnRollback

func (tx *Tx) OnRollback(f RollbackHook)

OnRollback adds a hook to call on rollback.

func (*Tx) Rollback

func (tx *Tx) Rollback() error

Rollback rollbacks the transaction.

type ValidationError

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

ValidationError returns when validating a field fails.

func (*ValidationError) Error

func (e *ValidationError) Error() string

Error implements the error interface.

func (*ValidationError) Unwrap

func (e *ValidationError) Unwrap() error

Unwrap implements the errors.Wrapper interface.

type Value

type Value = ent.Value

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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