ent

package
v0.0.0-...-52a3571 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2022 License: MIT Imports: 37 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.
	TypeAnnouncement = "Announcement"
	TypeJudgeRecord  = "JudgeRecord"
	TypeProblem      = "Problem"
	TypeTag          = "Tag"
	TypeTeam         = "Team"
	TypeTodo         = "Todo"
	TypeUser         = "User"
)

Variables

View Source
var DefaultAnnouncementOrder = &AnnouncementOrder{
	Direction: OrderDirectionAsc,
	Field: &AnnouncementOrderField{
		field: announcement.FieldID,
		toCursor: func(a *Announcement) Cursor {
			return Cursor{ID: a.ID}
		},
	},
}

DefaultAnnouncementOrder is the default ordering of Announcement.

View Source
var DefaultJudgeRecordOrder = &JudgeRecordOrder{
	Direction: OrderDirectionAsc,
	Field: &JudgeRecordOrderField{
		field: judgerecord.FieldID,
		toCursor: func(jr *JudgeRecord) Cursor {
			return Cursor{ID: jr.ID}
		},
	},
}

DefaultJudgeRecordOrder is the default ordering of JudgeRecord.

View Source
var DefaultProblemOrder = &ProblemOrder{
	Direction: OrderDirectionAsc,
	Field: &ProblemOrderField{
		field: problem.FieldID,
		toCursor: func(pr *Problem) Cursor {
			return Cursor{ID: pr.ID}
		},
	},
}

DefaultProblemOrder is the default ordering of Problem.

View Source
var DefaultTagOrder = &TagOrder{
	Direction: OrderDirectionAsc,
	Field: &TagOrderField{
		field: tag.FieldID,
		toCursor: func(t *Tag) Cursor {
			return Cursor{ID: t.ID}
		},
	},
}

DefaultTagOrder is the default ordering of Tag.

View Source
var DefaultTeamOrder = &TeamOrder{
	Direction: OrderDirectionAsc,
	Field: &TeamOrderField{
		field: team.FieldID,
		toCursor: func(t *Team) Cursor {
			return Cursor{ID: t.ID}
		},
	},
}

DefaultTeamOrder is the default ordering of Team.

View Source
var DefaultTodoOrder = &TodoOrder{
	Direction: OrderDirectionAsc,
	Field: &TodoOrderField{
		field: todo.FieldID,
		toCursor: func(t *Todo) Cursor {
			return Cursor{ID: t.ID}
		},
	},
}

DefaultTodoOrder is the default ordering of Todo.

View Source
var DefaultUserOrder = &UserOrder{
	Direction: OrderDirectionAsc,
	Field: &UserOrderField{
		field: user.FieldID,
		toCursor: func(u *User) Cursor {
			return Cursor{ID: u.ID}
		},
	},
}

DefaultUserOrder is the default ordering of User.

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 validation error.

func MaskNotFound

func MaskNotFound(err error) error

MaskNotFound masks not found error.

func NewContext

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

NewContext returns a new context with the given Client attached.

func NewTxContext

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

NewTxContext returns a new context with the given Tx attached.

func OpenTxFromContext

func OpenTxFromContext(ctx context.Context) (context.Context, driver.Tx, error)

OpenTxFromContext open transactions from client stored in context.

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 Announcement

type Announcement struct {

	// ID of the ent.
	ID int64 `json:"id,omitempty"`
	// Title holds the value of the "title" field.
	Title string `json:"title,omitempty"`
	// Content holds the value of the "content" field.
	Content string `json:"content,omitempty"`
	// CreatedTime holds the value of the "createdTime" field.
	CreatedTime time.Time `json:"createdTime,omitempty"`
	// ModifiedTime holds the value of the "modifiedTime" field.
	ModifiedTime time.Time `json:"modifiedTime,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the AnnouncementQuery when eager-loading is set.
	Edges AnnouncementEdges `json:"edges"`
	// contains filtered or unexported fields
}

Announcement is the model entity for the Announcement schema.

func (*Announcement) Author

func (a *Announcement) Author(ctx context.Context) (*User, error)

func (*Announcement) Node

func (a *Announcement) Node(ctx context.Context) (node *Node, err error)

func (*Announcement) QueryAuthor

func (a *Announcement) QueryAuthor() *UserQuery

QueryAuthor queries the "author" edge of the Announcement entity.

func (*Announcement) QueryTeam

func (a *Announcement) QueryTeam() *TeamQuery

QueryTeam queries the "team" edge of the Announcement entity.

func (*Announcement) String

func (a *Announcement) String() string

String implements the fmt.Stringer.

func (*Announcement) Team

func (a *Announcement) Team(ctx context.Context) (*Team, error)

func (*Announcement) ToEdge

func (a *Announcement) ToEdge(order *AnnouncementOrder) *AnnouncementEdge

ToEdge converts Announcement into AnnouncementEdge.

func (*Announcement) Unwrap

func (a *Announcement) Unwrap() *Announcement

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

func (a *Announcement) Update() *AnnouncementUpdateOne

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

type AnnouncementClient

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

AnnouncementClient is a client for the Announcement schema.

func NewAnnouncementClient

func NewAnnouncementClient(c config) *AnnouncementClient

NewAnnouncementClient returns a client for the Announcement from the given config.

func (*AnnouncementClient) Create

Create returns a create builder for Announcement.

func (*AnnouncementClient) CreateBulk

func (c *AnnouncementClient) CreateBulk(builders ...*AnnouncementCreate) *AnnouncementCreateBulk

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

func (*AnnouncementClient) Delete

Delete returns a delete builder for Announcement.

func (*AnnouncementClient) DeleteOne

DeleteOne returns a delete builder for the given entity.

func (*AnnouncementClient) DeleteOneID

func (c *AnnouncementClient) DeleteOneID(id int64) *AnnouncementDeleteOne

DeleteOneID returns a delete builder for the given id.

func (*AnnouncementClient) Get

Get returns a Announcement entity by its id.

func (*AnnouncementClient) GetX

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

func (*AnnouncementClient) Hooks

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

Hooks returns the client hooks.

func (*AnnouncementClient) Query

Query returns a query builder for Announcement.

func (*AnnouncementClient) QueryAuthor

func (c *AnnouncementClient) QueryAuthor(a *Announcement) *UserQuery

QueryAuthor queries the author edge of a Announcement.

func (*AnnouncementClient) QueryTeam

func (c *AnnouncementClient) QueryTeam(a *Announcement) *TeamQuery

QueryTeam queries the team edge of a Announcement.

func (*AnnouncementClient) Update

Update returns an update builder for Announcement.

func (*AnnouncementClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*AnnouncementClient) UpdateOneID

func (c *AnnouncementClient) UpdateOneID(id int64) *AnnouncementUpdateOne

UpdateOneID returns an update builder for the given id.

func (*AnnouncementClient) Use

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

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

type AnnouncementConnection

type AnnouncementConnection struct {
	Edges      []*AnnouncementEdge `json:"edges"`
	PageInfo   PageInfo            `json:"pageInfo"`
	TotalCount int                 `json:"totalCount"`
}

AnnouncementConnection is the connection containing edges to Announcement.

type AnnouncementCreate

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

AnnouncementCreate is the builder for creating a Announcement entity.

func (*AnnouncementCreate) Exec

func (ac *AnnouncementCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*AnnouncementCreate) ExecX

func (ac *AnnouncementCreate) ExecX(ctx context.Context)

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

func (*AnnouncementCreate) Mutation

func (ac *AnnouncementCreate) Mutation() *AnnouncementMutation

Mutation returns the AnnouncementMutation object of the builder.

func (*AnnouncementCreate) Save

Save creates the Announcement in the database.

func (*AnnouncementCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*AnnouncementCreate) SetAuthor

func (ac *AnnouncementCreate) SetAuthor(u *User) *AnnouncementCreate

SetAuthor sets the "author" edge to the User entity.

func (*AnnouncementCreate) SetAuthorID

func (ac *AnnouncementCreate) SetAuthorID(id int64) *AnnouncementCreate

SetAuthorID sets the "author" edge to the User entity by ID.

func (*AnnouncementCreate) SetContent

func (ac *AnnouncementCreate) SetContent(s string) *AnnouncementCreate

SetContent sets the "content" field.

func (*AnnouncementCreate) SetCreatedTime

func (ac *AnnouncementCreate) SetCreatedTime(t time.Time) *AnnouncementCreate

SetCreatedTime sets the "createdTime" field.

func (*AnnouncementCreate) SetID

SetID sets the "id" field.

func (*AnnouncementCreate) SetModifiedTime

func (ac *AnnouncementCreate) SetModifiedTime(t time.Time) *AnnouncementCreate

SetModifiedTime sets the "modifiedTime" field.

func (*AnnouncementCreate) SetNillableAuthorID

func (ac *AnnouncementCreate) SetNillableAuthorID(id *int64) *AnnouncementCreate

SetNillableAuthorID sets the "author" edge to the User entity by ID if the given value is not nil.

func (*AnnouncementCreate) SetNillableCreatedTime

func (ac *AnnouncementCreate) SetNillableCreatedTime(t *time.Time) *AnnouncementCreate

SetNillableCreatedTime sets the "createdTime" field if the given value is not nil.

func (*AnnouncementCreate) SetNillableModifiedTime

func (ac *AnnouncementCreate) SetNillableModifiedTime(t *time.Time) *AnnouncementCreate

SetNillableModifiedTime sets the "modifiedTime" field if the given value is not nil.

func (*AnnouncementCreate) SetNillableTeamID

func (ac *AnnouncementCreate) SetNillableTeamID(id *int64) *AnnouncementCreate

SetNillableTeamID sets the "team" edge to the Team entity by ID if the given value is not nil.

func (*AnnouncementCreate) SetTeam

func (ac *AnnouncementCreate) SetTeam(t *Team) *AnnouncementCreate

SetTeam sets the "team" edge to the Team entity.

func (*AnnouncementCreate) SetTeamID

func (ac *AnnouncementCreate) SetTeamID(id int64) *AnnouncementCreate

SetTeamID sets the "team" edge to the Team entity by ID.

func (*AnnouncementCreate) SetTitle

func (ac *AnnouncementCreate) SetTitle(s string) *AnnouncementCreate

SetTitle sets the "title" field.

type AnnouncementCreateBulk

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

AnnouncementCreateBulk is the builder for creating many Announcement entities in bulk.

func (*AnnouncementCreateBulk) Exec

Exec executes the query.

func (*AnnouncementCreateBulk) ExecX

func (acb *AnnouncementCreateBulk) ExecX(ctx context.Context)

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

func (*AnnouncementCreateBulk) Save

Save creates the Announcement entities in the database.

func (*AnnouncementCreateBulk) SaveX

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

type AnnouncementDelete

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

AnnouncementDelete is the builder for deleting a Announcement entity.

func (*AnnouncementDelete) Exec

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

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

func (*AnnouncementDelete) ExecX

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

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

func (*AnnouncementDelete) Where

Where appends a list predicates to the AnnouncementDelete builder.

type AnnouncementDeleteOne

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

AnnouncementDeleteOne is the builder for deleting a single Announcement entity.

func (*AnnouncementDeleteOne) Exec

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

Exec executes the deletion query.

func (*AnnouncementDeleteOne) ExecX

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

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

type AnnouncementEdge

type AnnouncementEdge struct {
	Node   *Announcement `json:"node"`
	Cursor Cursor        `json:"cursor"`
}

AnnouncementEdge is the edge representation of Announcement.

type AnnouncementEdges

type AnnouncementEdges struct {
	// Author holds the value of the author edge.
	Author *User `json:"author,omitempty"`
	// Team holds the value of the team edge.
	Team *Team `json:"team,omitempty"`
	// contains filtered or unexported fields
}

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

func (AnnouncementEdges) AuthorOrErr

func (e AnnouncementEdges) AuthorOrErr() (*User, error)

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

func (AnnouncementEdges) TeamOrErr

func (e AnnouncementEdges) TeamOrErr() (*Team, error)

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

type AnnouncementGroupBy

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

AnnouncementGroupBy is the group-by builder for Announcement entities.

func (*AnnouncementGroupBy) Aggregate

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

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

func (*AnnouncementGroupBy) Bool

func (agb *AnnouncementGroupBy) 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 (*AnnouncementGroupBy) BoolX

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

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

func (*AnnouncementGroupBy) Bools

func (agb *AnnouncementGroupBy) 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 (*AnnouncementGroupBy) BoolsX

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

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

func (*AnnouncementGroupBy) Float64

func (agb *AnnouncementGroupBy) 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 (*AnnouncementGroupBy) Float64X

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

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

func (*AnnouncementGroupBy) Float64s

func (agb *AnnouncementGroupBy) 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 (*AnnouncementGroupBy) Float64sX

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

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

func (*AnnouncementGroupBy) Int

func (agb *AnnouncementGroupBy) 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 (*AnnouncementGroupBy) IntX

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

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

func (*AnnouncementGroupBy) Ints

func (agb *AnnouncementGroupBy) 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 (*AnnouncementGroupBy) IntsX

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

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

func (*AnnouncementGroupBy) Scan

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

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

func (*AnnouncementGroupBy) ScanX

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

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

func (*AnnouncementGroupBy) String

func (agb *AnnouncementGroupBy) 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 (*AnnouncementGroupBy) StringX

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

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

func (*AnnouncementGroupBy) Strings

func (agb *AnnouncementGroupBy) 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 (*AnnouncementGroupBy) StringsX

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

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

type AnnouncementMutation

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

AnnouncementMutation represents an operation that mutates the Announcement nodes in the graph.

func (*AnnouncementMutation) AddField

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

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

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

func (*AnnouncementMutation) AddedField

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

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

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

func (*AnnouncementMutation) AddedIDs

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

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

func (*AnnouncementMutation) AuthorCleared

func (m *AnnouncementMutation) AuthorCleared() bool

AuthorCleared reports if the "author" edge to the User entity was cleared.

func (*AnnouncementMutation) AuthorID

func (m *AnnouncementMutation) AuthorID() (id int64, exists bool)

AuthorID returns the "author" edge ID in the mutation.

func (*AnnouncementMutation) AuthorIDs

func (m *AnnouncementMutation) AuthorIDs() (ids []int64)

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

func (*AnnouncementMutation) ClearAuthor

func (m *AnnouncementMutation) ClearAuthor()

ClearAuthor clears the "author" edge to the User entity.

func (*AnnouncementMutation) ClearEdge

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

func (m *AnnouncementMutation) 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 (*AnnouncementMutation) ClearTeam

func (m *AnnouncementMutation) ClearTeam()

ClearTeam clears the "team" edge to the Team entity.

func (*AnnouncementMutation) ClearedEdges

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

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

func (*AnnouncementMutation) ClearedFields

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

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

func (AnnouncementMutation) Client

func (m AnnouncementMutation) 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 (*AnnouncementMutation) Content

func (m *AnnouncementMutation) Content() (r string, exists bool)

Content returns the value of the "content" field in the mutation.

func (*AnnouncementMutation) CreatedTime

func (m *AnnouncementMutation) CreatedTime() (r time.Time, exists bool)

CreatedTime returns the value of the "createdTime" field in the mutation.

func (*AnnouncementMutation) EdgeCleared

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

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

func (*AnnouncementMutation) Field

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

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

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

func (*AnnouncementMutation) Fields

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

func (m *AnnouncementMutation) ID() (id int64, exists bool)

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

func (*AnnouncementMutation) IDs

func (m *AnnouncementMutation) IDs(ctx context.Context) ([]int64, error)

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

func (*AnnouncementMutation) ModifiedTime

func (m *AnnouncementMutation) ModifiedTime() (r time.Time, exists bool)

ModifiedTime returns the value of the "modifiedTime" field in the mutation.

func (*AnnouncementMutation) OldContent

func (m *AnnouncementMutation) OldContent(ctx context.Context) (v string, err error)

OldContent returns the old "content" field's value of the Announcement entity. If the Announcement 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 (*AnnouncementMutation) OldCreatedTime

func (m *AnnouncementMutation) OldCreatedTime(ctx context.Context) (v time.Time, err error)

OldCreatedTime returns the old "createdTime" field's value of the Announcement entity. If the Announcement 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 (*AnnouncementMutation) OldField

func (m *AnnouncementMutation) 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 (*AnnouncementMutation) OldModifiedTime

func (m *AnnouncementMutation) OldModifiedTime(ctx context.Context) (v time.Time, err error)

OldModifiedTime returns the old "modifiedTime" field's value of the Announcement entity. If the Announcement 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 (*AnnouncementMutation) OldTitle

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

OldTitle returns the old "title" field's value of the Announcement entity. If the Announcement 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 (*AnnouncementMutation) Op

func (m *AnnouncementMutation) Op() Op

Op returns the operation name.

func (*AnnouncementMutation) RemovedEdges

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

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

func (*AnnouncementMutation) RemovedIDs

func (m *AnnouncementMutation) 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 (*AnnouncementMutation) ResetAuthor

func (m *AnnouncementMutation) ResetAuthor()

ResetAuthor resets all changes to the "author" edge.

func (*AnnouncementMutation) ResetContent

func (m *AnnouncementMutation) ResetContent()

ResetContent resets all changes to the "content" field.

func (*AnnouncementMutation) ResetCreatedTime

func (m *AnnouncementMutation) ResetCreatedTime()

ResetCreatedTime resets all changes to the "createdTime" field.

func (*AnnouncementMutation) ResetEdge

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

func (m *AnnouncementMutation) 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 (*AnnouncementMutation) ResetModifiedTime

func (m *AnnouncementMutation) ResetModifiedTime()

ResetModifiedTime resets all changes to the "modifiedTime" field.

func (*AnnouncementMutation) ResetTeam

func (m *AnnouncementMutation) ResetTeam()

ResetTeam resets all changes to the "team" edge.

func (*AnnouncementMutation) ResetTitle

func (m *AnnouncementMutation) ResetTitle()

ResetTitle resets all changes to the "title" field.

func (*AnnouncementMutation) SetAuthorID

func (m *AnnouncementMutation) SetAuthorID(id int64)

SetAuthorID sets the "author" edge to the User entity by id.

func (*AnnouncementMutation) SetContent

func (m *AnnouncementMutation) SetContent(s string)

SetContent sets the "content" field.

func (*AnnouncementMutation) SetCreatedTime

func (m *AnnouncementMutation) SetCreatedTime(t time.Time)

SetCreatedTime sets the "createdTime" field.

func (*AnnouncementMutation) SetField

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

func (m *AnnouncementMutation) SetID(id int64)

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

func (*AnnouncementMutation) SetModifiedTime

func (m *AnnouncementMutation) SetModifiedTime(t time.Time)

SetModifiedTime sets the "modifiedTime" field.

func (*AnnouncementMutation) SetTeamID

func (m *AnnouncementMutation) SetTeamID(id int64)

SetTeamID sets the "team" edge to the Team entity by id.

func (*AnnouncementMutation) SetTitle

func (m *AnnouncementMutation) SetTitle(s string)

SetTitle sets the "title" field.

func (*AnnouncementMutation) TeamCleared

func (m *AnnouncementMutation) TeamCleared() bool

TeamCleared reports if the "team" edge to the Team entity was cleared.

func (*AnnouncementMutation) TeamID

func (m *AnnouncementMutation) TeamID() (id int64, exists bool)

TeamID returns the "team" edge ID in the mutation.

func (*AnnouncementMutation) TeamIDs

func (m *AnnouncementMutation) TeamIDs() (ids []int64)

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

func (*AnnouncementMutation) Title

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

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

func (AnnouncementMutation) Tx

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

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

func (*AnnouncementMutation) Type

func (m *AnnouncementMutation) Type() string

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

func (*AnnouncementMutation) Where

Where appends a list predicates to the AnnouncementMutation builder.

type AnnouncementOrder

type AnnouncementOrder struct {
	Direction OrderDirection          `json:"direction"`
	Field     *AnnouncementOrderField `json:"field"`
}

AnnouncementOrder defines the ordering of Announcement.

type AnnouncementOrderField

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

AnnouncementOrderField defines the ordering field of Announcement.

type AnnouncementPaginateOption

type AnnouncementPaginateOption func(*announcementPager) error

AnnouncementPaginateOption enables pagination customization.

func WithAnnouncementFilter

func WithAnnouncementFilter(filter func(*AnnouncementQuery) (*AnnouncementQuery, error)) AnnouncementPaginateOption

WithAnnouncementFilter configures pagination filter.

func WithAnnouncementOrder

func WithAnnouncementOrder(order *AnnouncementOrder) AnnouncementPaginateOption

WithAnnouncementOrder configures pagination ordering.

type AnnouncementQuery

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

AnnouncementQuery is the builder for querying Announcement entities.

func (*AnnouncementQuery) All

func (aq *AnnouncementQuery) All(ctx context.Context) ([]*Announcement, error)

All executes the query and returns a list of Announcements.

func (*AnnouncementQuery) AllX

func (aq *AnnouncementQuery) AllX(ctx context.Context) []*Announcement

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

func (*AnnouncementQuery) Clone

func (aq *AnnouncementQuery) Clone() *AnnouncementQuery

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

func (*AnnouncementQuery) CollectFields

func (a *AnnouncementQuery) CollectFields(ctx context.Context, satisfies ...string) *AnnouncementQuery

CollectFields tells the query-builder to eagerly load connected nodes by resolver context.

func (*AnnouncementQuery) Count

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

Count returns the count of the given query.

func (*AnnouncementQuery) CountX

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

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

func (*AnnouncementQuery) Exist

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

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

func (*AnnouncementQuery) ExistX

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

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

func (*AnnouncementQuery) First

func (aq *AnnouncementQuery) First(ctx context.Context) (*Announcement, error)

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

func (*AnnouncementQuery) FirstID

func (aq *AnnouncementQuery) FirstID(ctx context.Context) (id int64, err error)

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

func (*AnnouncementQuery) FirstIDX

func (aq *AnnouncementQuery) FirstIDX(ctx context.Context) int64

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

func (*AnnouncementQuery) FirstX

func (aq *AnnouncementQuery) FirstX(ctx context.Context) *Announcement

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

func (*AnnouncementQuery) GroupBy

func (aq *AnnouncementQuery) GroupBy(field string, fields ...string) *AnnouncementGroupBy

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

Example:

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

client.Announcement.Query().
	GroupBy(announcement.FieldTitle).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*AnnouncementQuery) IDs

func (aq *AnnouncementQuery) IDs(ctx context.Context) ([]int64, error)

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

func (*AnnouncementQuery) IDsX

func (aq *AnnouncementQuery) IDsX(ctx context.Context) []int64

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

func (*AnnouncementQuery) Limit

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

Limit adds a limit step to the query.

func (*AnnouncementQuery) Offset

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

Offset adds an offset step to the query.

func (*AnnouncementQuery) Only

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

func (*AnnouncementQuery) OnlyID

func (aq *AnnouncementQuery) OnlyID(ctx context.Context) (id int64, err error)

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

func (*AnnouncementQuery) OnlyIDX

func (aq *AnnouncementQuery) OnlyIDX(ctx context.Context) int64

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

func (*AnnouncementQuery) OnlyX

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

func (*AnnouncementQuery) Order

Order adds an order step to the query.

func (*AnnouncementQuery) Paginate

func (a *AnnouncementQuery) Paginate(
	ctx context.Context, after *Cursor, first *int,
	before *Cursor, last *int, opts ...AnnouncementPaginateOption,
) (*AnnouncementConnection, error)

Paginate executes the query and returns a relay based cursor connection to Announcement.

func (*AnnouncementQuery) QueryAuthor

func (aq *AnnouncementQuery) QueryAuthor() *UserQuery

QueryAuthor chains the current query on the "author" edge.

func (*AnnouncementQuery) QueryTeam

func (aq *AnnouncementQuery) QueryTeam() *TeamQuery

QueryTeam chains the current query on the "team" edge.

func (*AnnouncementQuery) Select

func (aq *AnnouncementQuery) Select(fields ...string) *AnnouncementSelect

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

Example:

var v []struct {
	Title string `json:"title,omitempty"`
}

client.Announcement.Query().
	Select(announcement.FieldTitle).
	Scan(ctx, &v)

func (*AnnouncementQuery) Unique

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

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

Where adds a new predicate for the AnnouncementQuery builder.

func (*AnnouncementQuery) WithAuthor

func (aq *AnnouncementQuery) WithAuthor(opts ...func(*UserQuery)) *AnnouncementQuery

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

func (*AnnouncementQuery) WithTeam

func (aq *AnnouncementQuery) WithTeam(opts ...func(*TeamQuery)) *AnnouncementQuery

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

type AnnouncementSelect

type AnnouncementSelect struct {
	*AnnouncementQuery
	// contains filtered or unexported fields
}

AnnouncementSelect is the builder for selecting fields of Announcement entities.

func (*AnnouncementSelect) Bool

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

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

func (*AnnouncementSelect) BoolX

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

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

func (*AnnouncementSelect) Bools

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

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

func (*AnnouncementSelect) BoolsX

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

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

func (*AnnouncementSelect) Float64

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

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

func (*AnnouncementSelect) Float64X

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

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

func (*AnnouncementSelect) Float64s

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

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

func (*AnnouncementSelect) Float64sX

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

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

func (*AnnouncementSelect) Int

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

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

func (*AnnouncementSelect) IntX

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

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

func (*AnnouncementSelect) Ints

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

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

func (*AnnouncementSelect) IntsX

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

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

func (*AnnouncementSelect) Scan

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

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

func (*AnnouncementSelect) ScanX

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

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

func (*AnnouncementSelect) String

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

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

func (*AnnouncementSelect) StringX

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

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

func (*AnnouncementSelect) Strings

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

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

func (*AnnouncementSelect) StringsX

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

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

type AnnouncementUpdate

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

AnnouncementUpdate is the builder for updating Announcement entities.

func (*AnnouncementUpdate) ClearAuthor

func (au *AnnouncementUpdate) ClearAuthor() *AnnouncementUpdate

ClearAuthor clears the "author" edge to the User entity.

func (*AnnouncementUpdate) ClearTeam

func (au *AnnouncementUpdate) ClearTeam() *AnnouncementUpdate

ClearTeam clears the "team" edge to the Team entity.

func (*AnnouncementUpdate) Exec

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

Exec executes the query.

func (*AnnouncementUpdate) ExecX

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

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

func (*AnnouncementUpdate) Mutation

func (au *AnnouncementUpdate) Mutation() *AnnouncementMutation

Mutation returns the AnnouncementMutation object of the builder.

func (*AnnouncementUpdate) Save

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

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

func (*AnnouncementUpdate) SaveX

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

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

func (*AnnouncementUpdate) SetAuthor

func (au *AnnouncementUpdate) SetAuthor(u *User) *AnnouncementUpdate

SetAuthor sets the "author" edge to the User entity.

func (*AnnouncementUpdate) SetAuthorID

func (au *AnnouncementUpdate) SetAuthorID(id int64) *AnnouncementUpdate

SetAuthorID sets the "author" edge to the User entity by ID.

func (*AnnouncementUpdate) SetContent

func (au *AnnouncementUpdate) SetContent(s string) *AnnouncementUpdate

SetContent sets the "content" field.

func (*AnnouncementUpdate) SetModifiedTime

func (au *AnnouncementUpdate) SetModifiedTime(t time.Time) *AnnouncementUpdate

SetModifiedTime sets the "modifiedTime" field.

func (*AnnouncementUpdate) SetNillableAuthorID

func (au *AnnouncementUpdate) SetNillableAuthorID(id *int64) *AnnouncementUpdate

SetNillableAuthorID sets the "author" edge to the User entity by ID if the given value is not nil.

func (*AnnouncementUpdate) SetNillableModifiedTime

func (au *AnnouncementUpdate) SetNillableModifiedTime(t *time.Time) *AnnouncementUpdate

SetNillableModifiedTime sets the "modifiedTime" field if the given value is not nil.

func (*AnnouncementUpdate) SetNillableTeamID

func (au *AnnouncementUpdate) SetNillableTeamID(id *int64) *AnnouncementUpdate

SetNillableTeamID sets the "team" edge to the Team entity by ID if the given value is not nil.

func (*AnnouncementUpdate) SetTeam

func (au *AnnouncementUpdate) SetTeam(t *Team) *AnnouncementUpdate

SetTeam sets the "team" edge to the Team entity.

func (*AnnouncementUpdate) SetTeamID

func (au *AnnouncementUpdate) SetTeamID(id int64) *AnnouncementUpdate

SetTeamID sets the "team" edge to the Team entity by ID.

func (*AnnouncementUpdate) SetTitle

func (au *AnnouncementUpdate) SetTitle(s string) *AnnouncementUpdate

SetTitle sets the "title" field.

func (*AnnouncementUpdate) Where

Where appends a list predicates to the AnnouncementUpdate builder.

type AnnouncementUpdateOne

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

AnnouncementUpdateOne is the builder for updating a single Announcement entity.

func (*AnnouncementUpdateOne) ClearAuthor

func (auo *AnnouncementUpdateOne) ClearAuthor() *AnnouncementUpdateOne

ClearAuthor clears the "author" edge to the User entity.

func (*AnnouncementUpdateOne) ClearTeam

func (auo *AnnouncementUpdateOne) ClearTeam() *AnnouncementUpdateOne

ClearTeam clears the "team" edge to the Team entity.

func (*AnnouncementUpdateOne) Exec

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

Exec executes the query on the entity.

func (*AnnouncementUpdateOne) ExecX

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

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

func (*AnnouncementUpdateOne) Mutation

Mutation returns the AnnouncementMutation object of the builder.

func (*AnnouncementUpdateOne) Save

Save executes the query and returns the updated Announcement entity.

func (*AnnouncementUpdateOne) SaveX

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

func (*AnnouncementUpdateOne) Select

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

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

func (*AnnouncementUpdateOne) SetAuthor

func (auo *AnnouncementUpdateOne) SetAuthor(u *User) *AnnouncementUpdateOne

SetAuthor sets the "author" edge to the User entity.

func (*AnnouncementUpdateOne) SetAuthorID

func (auo *AnnouncementUpdateOne) SetAuthorID(id int64) *AnnouncementUpdateOne

SetAuthorID sets the "author" edge to the User entity by ID.

func (*AnnouncementUpdateOne) SetContent

SetContent sets the "content" field.

func (*AnnouncementUpdateOne) SetModifiedTime

func (auo *AnnouncementUpdateOne) SetModifiedTime(t time.Time) *AnnouncementUpdateOne

SetModifiedTime sets the "modifiedTime" field.

func (*AnnouncementUpdateOne) SetNillableAuthorID

func (auo *AnnouncementUpdateOne) SetNillableAuthorID(id *int64) *AnnouncementUpdateOne

SetNillableAuthorID sets the "author" edge to the User entity by ID if the given value is not nil.

func (*AnnouncementUpdateOne) SetNillableModifiedTime

func (auo *AnnouncementUpdateOne) SetNillableModifiedTime(t *time.Time) *AnnouncementUpdateOne

SetNillableModifiedTime sets the "modifiedTime" field if the given value is not nil.

func (*AnnouncementUpdateOne) SetNillableTeamID

func (auo *AnnouncementUpdateOne) SetNillableTeamID(id *int64) *AnnouncementUpdateOne

SetNillableTeamID sets the "team" edge to the Team entity by ID if the given value is not nil.

func (*AnnouncementUpdateOne) SetTeam

SetTeam sets the "team" edge to the Team entity.

func (*AnnouncementUpdateOne) SetTeamID

SetTeamID sets the "team" edge to the Team entity by ID.

func (*AnnouncementUpdateOne) SetTitle

SetTitle sets the "title" field.

type AnnouncementWhereInput

type AnnouncementWhereInput struct {
	Not *AnnouncementWhereInput   `json:"not,omitempty"`
	Or  []*AnnouncementWhereInput `json:"or,omitempty"`
	And []*AnnouncementWhereInput `json:"and,omitempty"`

	// "id" field predicates.
	ID      *int64  `json:"id,omitempty"`
	IDNEQ   *int64  `json:"idNEQ,omitempty"`
	IDIn    []int64 `json:"idIn,omitempty"`
	IDNotIn []int64 `json:"idNotIn,omitempty"`
	IDGT    *int64  `json:"idGT,omitempty"`
	IDGTE   *int64  `json:"idGTE,omitempty"`
	IDLT    *int64  `json:"idLT,omitempty"`
	IDLTE   *int64  `json:"idLTE,omitempty"`

	// "title" field predicates.
	Title             *string  `json:"title,omitempty"`
	TitleNEQ          *string  `json:"titleNEQ,omitempty"`
	TitleIn           []string `json:"titleIn,omitempty"`
	TitleNotIn        []string `json:"titleNotIn,omitempty"`
	TitleGT           *string  `json:"titleGT,omitempty"`
	TitleGTE          *string  `json:"titleGTE,omitempty"`
	TitleLT           *string  `json:"titleLT,omitempty"`
	TitleLTE          *string  `json:"titleLTE,omitempty"`
	TitleContains     *string  `json:"titleContains,omitempty"`
	TitleHasPrefix    *string  `json:"titleHasPrefix,omitempty"`
	TitleHasSuffix    *string  `json:"titleHasSuffix,omitempty"`
	TitleEqualFold    *string  `json:"titleEqualFold,omitempty"`
	TitleContainsFold *string  `json:"titleContainsFold,omitempty"`

	// "content" field predicates.
	Content             *string  `json:"content,omitempty"`
	ContentNEQ          *string  `json:"contentNEQ,omitempty"`
	ContentIn           []string `json:"contentIn,omitempty"`
	ContentNotIn        []string `json:"contentNotIn,omitempty"`
	ContentGT           *string  `json:"contentGT,omitempty"`
	ContentGTE          *string  `json:"contentGTE,omitempty"`
	ContentLT           *string  `json:"contentLT,omitempty"`
	ContentLTE          *string  `json:"contentLTE,omitempty"`
	ContentContains     *string  `json:"contentContains,omitempty"`
	ContentHasPrefix    *string  `json:"contentHasPrefix,omitempty"`
	ContentHasSuffix    *string  `json:"contentHasSuffix,omitempty"`
	ContentEqualFold    *string  `json:"contentEqualFold,omitempty"`
	ContentContainsFold *string  `json:"contentContainsFold,omitempty"`

	// "createdTime" field predicates.
	CreatedTime      *time.Time  `json:"createdtime,omitempty"`
	CreatedTimeNEQ   *time.Time  `json:"createdtimeNEQ,omitempty"`
	CreatedTimeIn    []time.Time `json:"createdtimeIn,omitempty"`
	CreatedTimeNotIn []time.Time `json:"createdtimeNotIn,omitempty"`
	CreatedTimeGT    *time.Time  `json:"createdtimeGT,omitempty"`
	CreatedTimeGTE   *time.Time  `json:"createdtimeGTE,omitempty"`
	CreatedTimeLT    *time.Time  `json:"createdtimeLT,omitempty"`
	CreatedTimeLTE   *time.Time  `json:"createdtimeLTE,omitempty"`

	// "modifiedTime" field predicates.
	ModifiedTime      *time.Time  `json:"modifiedtime,omitempty"`
	ModifiedTimeNEQ   *time.Time  `json:"modifiedtimeNEQ,omitempty"`
	ModifiedTimeIn    []time.Time `json:"modifiedtimeIn,omitempty"`
	ModifiedTimeNotIn []time.Time `json:"modifiedtimeNotIn,omitempty"`
	ModifiedTimeGT    *time.Time  `json:"modifiedtimeGT,omitempty"`
	ModifiedTimeGTE   *time.Time  `json:"modifiedtimeGTE,omitempty"`
	ModifiedTimeLT    *time.Time  `json:"modifiedtimeLT,omitempty"`
	ModifiedTimeLTE   *time.Time  `json:"modifiedtimeLTE,omitempty"`

	// "author" edge predicates.
	HasAuthor     *bool             `json:"hasAuthor,omitempty"`
	HasAuthorWith []*UserWhereInput `json:"hasAuthorWith,omitempty"`

	// "team" edge predicates.
	HasTeam     *bool             `json:"hasTeam,omitempty"`
	HasTeamWith []*TeamWhereInput `json:"hasTeamWith,omitempty"`
}

AnnouncementWhereInput represents a where input for filtering Announcement queries.

func (*AnnouncementWhereInput) Filter

Filter applies the AnnouncementWhereInput filter on the AnnouncementQuery builder.

func (*AnnouncementWhereInput) P

P returns a predicate for filtering announcements. An error is returned if the input is empty or invalid.

type Announcements

type Announcements []*Announcement

Announcements is a parsable slice of Announcement.

type Client

type Client struct {

	// Schema is the client for creating, migrating and dropping schema.
	Schema *migrate.Schema
	// Announcement is the client for interacting with the Announcement builders.
	Announcement *AnnouncementClient
	// JudgeRecord is the client for interacting with the JudgeRecord builders.
	JudgeRecord *JudgeRecordClient
	// Problem is the client for interacting with the Problem builders.
	Problem *ProblemClient
	// Tag is the client for interacting with the Tag builders.
	Tag *TagClient
	// Team is the client for interacting with the Team builders.
	Team *TeamClient
	// Todo is the client for interacting with the Todo builders.
	Todo *TodoClient
	// User is the client for interacting with the User builders.
	User *UserClient
	// 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().
	Announcement.
	Query().
	Count(ctx)

func (*Client) Node

func (c *Client) Node(ctx context.Context, id int64) (*Node, error)

func (*Client) Noder

func (c *Client) Noder(ctx context.Context, id int64, opts ...NodeOption) (_ Noder, err error)

Noder returns a Node by its id. If the NodeType was not provided, it will be derived from the id value according to the universal-id configuration.

c.Noder(ctx, id)
c.Noder(ctx, id, ent.WithNodeType(pet.Table))

func (*Client) Noders

func (c *Client) Noders(ctx context.Context, ids []int64, opts ...NodeOption) ([]Noder, error)

func (*Client) OpenTx

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

OpenTx opens a transaction and returns a transactional context along with the created transaction.

func (*Client) Tx

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

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

func (*Client) Use

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

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

type CommitFunc

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

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

func (CommitFunc) Commit

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

Commit calls f(ctx, m).

type CommitHook

type CommitHook func(Committer) Committer

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

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

type Committer

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

Committer is the interface that wraps the Commit method.

type ConstraintError

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

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

func (ConstraintError) Error

func (e ConstraintError) Error() string

Error implements the error interface.

func (*ConstraintError) Unwrap

func (e *ConstraintError) Unwrap() error

Unwrap implements the errors.Wrapper interface.

type Cursor

type Cursor struct {
	ID    int64 `msgpack:"i"`
	Value Value `msgpack:"v,omitempty"`
}

Cursor of an edge type.

func (Cursor) MarshalGQL

func (c Cursor) MarshalGQL(w io.Writer)

MarshalGQL implements graphql.Marshaler interface.

func (*Cursor) UnmarshalGQL

func (c *Cursor) UnmarshalGQL(v interface{}) error

UnmarshalGQL implements graphql.Unmarshaler interface.

type Edge

type Edge struct {
	Type string  `json:"type,omitempty"` // edge type.
	Name string  `json:"name,omitempty"` // edge name.
	IDs  []int64 `json:"ids,omitempty"`  // node ids (where this edge point to).
}

Edges between two nodes.

type Field

type Field struct {
	Type  string `json:"type,omitempty"`  // field type.
	Name  string `json:"name,omitempty"`  // field name (as in struct).
	Value string `json:"value,omitempty"` // stringified value.
}

Field of a node.

type Hook

type Hook = ent.Hook

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

type JudgeRecord

type JudgeRecord struct {

	// ID of the ent.
	ID int64 `json:"id,omitempty"`
	// JudgeTime holds the value of the "judge_time" field.
	JudgeTime time.Time `json:"judge_time,omitempty"`
	// FinishedTime holds the value of the "finished_time" field.
	FinishedTime time.Time `json:"finished_time,omitempty"`
	// TimeCost holds the value of the "time_cost" field.
	TimeCost int64 `json:"time_cost,omitempty"`
	// MemoryCost holds the value of the "memory_cost" field.
	MemoryCost int64 `json:"memory_cost,omitempty"`
	// Status holds the value of the "status" field.
	Status int64 `json:"status,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the JudgeRecordQuery when eager-loading is set.
	Edges JudgeRecordEdges `json:"edges"`
	// contains filtered or unexported fields
}

JudgeRecord is the model entity for the JudgeRecord schema.

func (*JudgeRecord) Node

func (jr *JudgeRecord) Node(ctx context.Context) (node *Node, err error)

func (*JudgeRecord) QueryUser

func (jr *JudgeRecord) QueryUser() *UserQuery

QueryUser queries the "user" edge of the JudgeRecord entity.

func (*JudgeRecord) String

func (jr *JudgeRecord) String() string

String implements the fmt.Stringer.

func (*JudgeRecord) ToEdge

func (jr *JudgeRecord) ToEdge(order *JudgeRecordOrder) *JudgeRecordEdge

ToEdge converts JudgeRecord into JudgeRecordEdge.

func (*JudgeRecord) Unwrap

func (jr *JudgeRecord) Unwrap() *JudgeRecord

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

func (jr *JudgeRecord) Update() *JudgeRecordUpdateOne

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

func (*JudgeRecord) User

func (jr *JudgeRecord) User(ctx context.Context) ([]*User, error)

type JudgeRecordClient

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

JudgeRecordClient is a client for the JudgeRecord schema.

func NewJudgeRecordClient

func NewJudgeRecordClient(c config) *JudgeRecordClient

NewJudgeRecordClient returns a client for the JudgeRecord from the given config.

func (*JudgeRecordClient) Create

func (c *JudgeRecordClient) Create() *JudgeRecordCreate

Create returns a create builder for JudgeRecord.

func (*JudgeRecordClient) CreateBulk

func (c *JudgeRecordClient) CreateBulk(builders ...*JudgeRecordCreate) *JudgeRecordCreateBulk

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

func (*JudgeRecordClient) Delete

func (c *JudgeRecordClient) Delete() *JudgeRecordDelete

Delete returns a delete builder for JudgeRecord.

func (*JudgeRecordClient) DeleteOne

DeleteOne returns a delete builder for the given entity.

func (*JudgeRecordClient) DeleteOneID

func (c *JudgeRecordClient) DeleteOneID(id int64) *JudgeRecordDeleteOne

DeleteOneID returns a delete builder for the given id.

func (*JudgeRecordClient) Get

Get returns a JudgeRecord entity by its id.

func (*JudgeRecordClient) GetX

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

func (*JudgeRecordClient) Hooks

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

Hooks returns the client hooks.

func (*JudgeRecordClient) Query

func (c *JudgeRecordClient) Query() *JudgeRecordQuery

Query returns a query builder for JudgeRecord.

func (*JudgeRecordClient) QueryUser

func (c *JudgeRecordClient) QueryUser(jr *JudgeRecord) *UserQuery

QueryUser queries the user edge of a JudgeRecord.

func (*JudgeRecordClient) Update

func (c *JudgeRecordClient) Update() *JudgeRecordUpdate

Update returns an update builder for JudgeRecord.

func (*JudgeRecordClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*JudgeRecordClient) UpdateOneID

func (c *JudgeRecordClient) UpdateOneID(id int64) *JudgeRecordUpdateOne

UpdateOneID returns an update builder for the given id.

func (*JudgeRecordClient) Use

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

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

type JudgeRecordConnection

type JudgeRecordConnection struct {
	Edges      []*JudgeRecordEdge `json:"edges"`
	PageInfo   PageInfo           `json:"pageInfo"`
	TotalCount int                `json:"totalCount"`
}

JudgeRecordConnection is the connection containing edges to JudgeRecord.

type JudgeRecordCreate

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

JudgeRecordCreate is the builder for creating a JudgeRecord entity.

func (*JudgeRecordCreate) AddUser

func (jrc *JudgeRecordCreate) AddUser(u ...*User) *JudgeRecordCreate

AddUser adds the "user" edges to the User entity.

func (*JudgeRecordCreate) AddUserIDs

func (jrc *JudgeRecordCreate) AddUserIDs(ids ...int64) *JudgeRecordCreate

AddUserIDs adds the "user" edge to the User entity by IDs.

func (*JudgeRecordCreate) Exec

func (jrc *JudgeRecordCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*JudgeRecordCreate) ExecX

func (jrc *JudgeRecordCreate) ExecX(ctx context.Context)

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

func (*JudgeRecordCreate) Mutation

func (jrc *JudgeRecordCreate) Mutation() *JudgeRecordMutation

Mutation returns the JudgeRecordMutation object of the builder.

func (*JudgeRecordCreate) Save

func (jrc *JudgeRecordCreate) Save(ctx context.Context) (*JudgeRecord, error)

Save creates the JudgeRecord in the database.

func (*JudgeRecordCreate) SaveX

func (jrc *JudgeRecordCreate) SaveX(ctx context.Context) *JudgeRecord

SaveX calls Save and panics if Save returns an error.

func (*JudgeRecordCreate) SetFinishedTime

func (jrc *JudgeRecordCreate) SetFinishedTime(t time.Time) *JudgeRecordCreate

SetFinishedTime sets the "finished_time" field.

func (*JudgeRecordCreate) SetID

func (jrc *JudgeRecordCreate) SetID(i int64) *JudgeRecordCreate

SetID sets the "id" field.

func (*JudgeRecordCreate) SetJudgeTime

func (jrc *JudgeRecordCreate) SetJudgeTime(t time.Time) *JudgeRecordCreate

SetJudgeTime sets the "judge_time" field.

func (*JudgeRecordCreate) SetMemoryCost

func (jrc *JudgeRecordCreate) SetMemoryCost(i int64) *JudgeRecordCreate

SetMemoryCost sets the "memory_cost" field.

func (*JudgeRecordCreate) SetNillableStatus

func (jrc *JudgeRecordCreate) SetNillableStatus(i *int64) *JudgeRecordCreate

SetNillableStatus sets the "status" field if the given value is not nil.

func (*JudgeRecordCreate) SetStatus

func (jrc *JudgeRecordCreate) SetStatus(i int64) *JudgeRecordCreate

SetStatus sets the "status" field.

func (*JudgeRecordCreate) SetTimeCost

func (jrc *JudgeRecordCreate) SetTimeCost(i int64) *JudgeRecordCreate

SetTimeCost sets the "time_cost" field.

type JudgeRecordCreateBulk

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

JudgeRecordCreateBulk is the builder for creating many JudgeRecord entities in bulk.

func (*JudgeRecordCreateBulk) Exec

func (jrcb *JudgeRecordCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*JudgeRecordCreateBulk) ExecX

func (jrcb *JudgeRecordCreateBulk) ExecX(ctx context.Context)

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

func (*JudgeRecordCreateBulk) Save

func (jrcb *JudgeRecordCreateBulk) Save(ctx context.Context) ([]*JudgeRecord, error)

Save creates the JudgeRecord entities in the database.

func (*JudgeRecordCreateBulk) SaveX

func (jrcb *JudgeRecordCreateBulk) SaveX(ctx context.Context) []*JudgeRecord

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

type JudgeRecordDelete

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

JudgeRecordDelete is the builder for deleting a JudgeRecord entity.

func (*JudgeRecordDelete) Exec

func (jrd *JudgeRecordDelete) Exec(ctx context.Context) (int, error)

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

func (*JudgeRecordDelete) ExecX

func (jrd *JudgeRecordDelete) ExecX(ctx context.Context) int

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

func (*JudgeRecordDelete) Where

Where appends a list predicates to the JudgeRecordDelete builder.

type JudgeRecordDeleteOne

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

JudgeRecordDeleteOne is the builder for deleting a single JudgeRecord entity.

func (*JudgeRecordDeleteOne) Exec

func (jrdo *JudgeRecordDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*JudgeRecordDeleteOne) ExecX

func (jrdo *JudgeRecordDeleteOne) ExecX(ctx context.Context)

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

type JudgeRecordEdge

type JudgeRecordEdge struct {
	Node   *JudgeRecord `json:"node"`
	Cursor Cursor       `json:"cursor"`
}

JudgeRecordEdge is the edge representation of JudgeRecord.

type JudgeRecordEdges

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

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

func (JudgeRecordEdges) UserOrErr

func (e JudgeRecordEdges) UserOrErr() ([]*User, error)

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

type JudgeRecordGroupBy

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

JudgeRecordGroupBy is the group-by builder for JudgeRecord entities.

func (*JudgeRecordGroupBy) Aggregate

func (jrgb *JudgeRecordGroupBy) Aggregate(fns ...AggregateFunc) *JudgeRecordGroupBy

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

func (*JudgeRecordGroupBy) Bool

func (jrgb *JudgeRecordGroupBy) 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 (*JudgeRecordGroupBy) BoolX

func (jrgb *JudgeRecordGroupBy) BoolX(ctx context.Context) bool

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

func (*JudgeRecordGroupBy) Bools

func (jrgb *JudgeRecordGroupBy) 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 (*JudgeRecordGroupBy) BoolsX

func (jrgb *JudgeRecordGroupBy) BoolsX(ctx context.Context) []bool

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

func (*JudgeRecordGroupBy) Float64

func (jrgb *JudgeRecordGroupBy) 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 (*JudgeRecordGroupBy) Float64X

func (jrgb *JudgeRecordGroupBy) Float64X(ctx context.Context) float64

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

func (*JudgeRecordGroupBy) Float64s

func (jrgb *JudgeRecordGroupBy) 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 (*JudgeRecordGroupBy) Float64sX

func (jrgb *JudgeRecordGroupBy) Float64sX(ctx context.Context) []float64

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

func (*JudgeRecordGroupBy) Int

func (jrgb *JudgeRecordGroupBy) 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 (*JudgeRecordGroupBy) IntX

func (jrgb *JudgeRecordGroupBy) IntX(ctx context.Context) int

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

func (*JudgeRecordGroupBy) Ints

func (jrgb *JudgeRecordGroupBy) 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 (*JudgeRecordGroupBy) IntsX

func (jrgb *JudgeRecordGroupBy) IntsX(ctx context.Context) []int

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

func (*JudgeRecordGroupBy) Scan

func (jrgb *JudgeRecordGroupBy) Scan(ctx context.Context, v interface{}) error

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

func (*JudgeRecordGroupBy) ScanX

func (jrgb *JudgeRecordGroupBy) ScanX(ctx context.Context, v interface{})

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

func (*JudgeRecordGroupBy) String

func (jrgb *JudgeRecordGroupBy) 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 (*JudgeRecordGroupBy) StringX

func (jrgb *JudgeRecordGroupBy) StringX(ctx context.Context) string

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

func (*JudgeRecordGroupBy) Strings

func (jrgb *JudgeRecordGroupBy) 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 (*JudgeRecordGroupBy) StringsX

func (jrgb *JudgeRecordGroupBy) StringsX(ctx context.Context) []string

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

type JudgeRecordMutation

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

JudgeRecordMutation represents an operation that mutates the JudgeRecord nodes in the graph.

func (*JudgeRecordMutation) AddField

func (m *JudgeRecordMutation) 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 (*JudgeRecordMutation) AddMemoryCost

func (m *JudgeRecordMutation) AddMemoryCost(i int64)

AddMemoryCost adds i to the "memory_cost" field.

func (*JudgeRecordMutation) AddStatus

func (m *JudgeRecordMutation) AddStatus(i int64)

AddStatus adds i to the "status" field.

func (*JudgeRecordMutation) AddTimeCost

func (m *JudgeRecordMutation) AddTimeCost(i int64)

AddTimeCost adds i to the "time_cost" field.

func (*JudgeRecordMutation) AddUserIDs

func (m *JudgeRecordMutation) AddUserIDs(ids ...int64)

AddUserIDs adds the "user" edge to the User entity by ids.

func (*JudgeRecordMutation) AddedEdges

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

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

func (*JudgeRecordMutation) AddedField

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

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

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

func (*JudgeRecordMutation) AddedIDs

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

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

func (*JudgeRecordMutation) AddedMemoryCost

func (m *JudgeRecordMutation) AddedMemoryCost() (r int64, exists bool)

AddedMemoryCost returns the value that was added to the "memory_cost" field in this mutation.

func (*JudgeRecordMutation) AddedStatus

func (m *JudgeRecordMutation) AddedStatus() (r int64, exists bool)

AddedStatus returns the value that was added to the "status" field in this mutation.

func (*JudgeRecordMutation) AddedTimeCost

func (m *JudgeRecordMutation) AddedTimeCost() (r int64, exists bool)

AddedTimeCost returns the value that was added to the "time_cost" field in this mutation.

func (*JudgeRecordMutation) ClearEdge

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

func (m *JudgeRecordMutation) 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 (*JudgeRecordMutation) ClearUser

func (m *JudgeRecordMutation) ClearUser()

ClearUser clears the "user" edge to the User entity.

func (*JudgeRecordMutation) ClearedEdges

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

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

func (*JudgeRecordMutation) ClearedFields

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

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

func (JudgeRecordMutation) Client

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

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

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

func (*JudgeRecordMutation) Field

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

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

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

func (*JudgeRecordMutation) Fields

func (m *JudgeRecordMutation) 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 (*JudgeRecordMutation) FinishedTime

func (m *JudgeRecordMutation) FinishedTime() (r time.Time, exists bool)

FinishedTime returns the value of the "finished_time" field in the mutation.

func (*JudgeRecordMutation) ID

func (m *JudgeRecordMutation) ID() (id int64, exists bool)

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

func (*JudgeRecordMutation) IDs

func (m *JudgeRecordMutation) IDs(ctx context.Context) ([]int64, error)

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

func (*JudgeRecordMutation) JudgeTime

func (m *JudgeRecordMutation) JudgeTime() (r time.Time, exists bool)

JudgeTime returns the value of the "judge_time" field in the mutation.

func (*JudgeRecordMutation) MemoryCost

func (m *JudgeRecordMutation) MemoryCost() (r int64, exists bool)

MemoryCost returns the value of the "memory_cost" field in the mutation.

func (*JudgeRecordMutation) OldField

func (m *JudgeRecordMutation) 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 (*JudgeRecordMutation) OldFinishedTime

func (m *JudgeRecordMutation) OldFinishedTime(ctx context.Context) (v time.Time, err error)

OldFinishedTime returns the old "finished_time" field's value of the JudgeRecord entity. If the JudgeRecord 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 (*JudgeRecordMutation) OldJudgeTime

func (m *JudgeRecordMutation) OldJudgeTime(ctx context.Context) (v time.Time, err error)

OldJudgeTime returns the old "judge_time" field's value of the JudgeRecord entity. If the JudgeRecord 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 (*JudgeRecordMutation) OldMemoryCost

func (m *JudgeRecordMutation) OldMemoryCost(ctx context.Context) (v int64, err error)

OldMemoryCost returns the old "memory_cost" field's value of the JudgeRecord entity. If the JudgeRecord 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 (*JudgeRecordMutation) OldStatus

func (m *JudgeRecordMutation) OldStatus(ctx context.Context) (v int64, err error)

OldStatus returns the old "status" field's value of the JudgeRecord entity. If the JudgeRecord 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 (*JudgeRecordMutation) OldTimeCost

func (m *JudgeRecordMutation) OldTimeCost(ctx context.Context) (v int64, err error)

OldTimeCost returns the old "time_cost" field's value of the JudgeRecord entity. If the JudgeRecord 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 (*JudgeRecordMutation) Op

func (m *JudgeRecordMutation) Op() Op

Op returns the operation name.

func (*JudgeRecordMutation) RemoveUserIDs

func (m *JudgeRecordMutation) RemoveUserIDs(ids ...int64)

RemoveUserIDs removes the "user" edge to the User entity by IDs.

func (*JudgeRecordMutation) RemovedEdges

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

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

func (*JudgeRecordMutation) RemovedIDs

func (m *JudgeRecordMutation) 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 (*JudgeRecordMutation) RemovedUserIDs

func (m *JudgeRecordMutation) RemovedUserIDs() (ids []int64)

RemovedUser returns the removed IDs of the "user" edge to the User entity.

func (*JudgeRecordMutation) ResetEdge

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

func (m *JudgeRecordMutation) 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 (*JudgeRecordMutation) ResetFinishedTime

func (m *JudgeRecordMutation) ResetFinishedTime()

ResetFinishedTime resets all changes to the "finished_time" field.

func (*JudgeRecordMutation) ResetJudgeTime

func (m *JudgeRecordMutation) ResetJudgeTime()

ResetJudgeTime resets all changes to the "judge_time" field.

func (*JudgeRecordMutation) ResetMemoryCost

func (m *JudgeRecordMutation) ResetMemoryCost()

ResetMemoryCost resets all changes to the "memory_cost" field.

func (*JudgeRecordMutation) ResetStatus

func (m *JudgeRecordMutation) ResetStatus()

ResetStatus resets all changes to the "status" field.

func (*JudgeRecordMutation) ResetTimeCost

func (m *JudgeRecordMutation) ResetTimeCost()

ResetTimeCost resets all changes to the "time_cost" field.

func (*JudgeRecordMutation) ResetUser

func (m *JudgeRecordMutation) ResetUser()

ResetUser resets all changes to the "user" edge.

func (*JudgeRecordMutation) SetField

func (m *JudgeRecordMutation) 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 (*JudgeRecordMutation) SetFinishedTime

func (m *JudgeRecordMutation) SetFinishedTime(t time.Time)

SetFinishedTime sets the "finished_time" field.

func (*JudgeRecordMutation) SetID

func (m *JudgeRecordMutation) SetID(id int64)

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

func (*JudgeRecordMutation) SetJudgeTime

func (m *JudgeRecordMutation) SetJudgeTime(t time.Time)

SetJudgeTime sets the "judge_time" field.

func (*JudgeRecordMutation) SetMemoryCost

func (m *JudgeRecordMutation) SetMemoryCost(i int64)

SetMemoryCost sets the "memory_cost" field.

func (*JudgeRecordMutation) SetStatus

func (m *JudgeRecordMutation) SetStatus(i int64)

SetStatus sets the "status" field.

func (*JudgeRecordMutation) SetTimeCost

func (m *JudgeRecordMutation) SetTimeCost(i int64)

SetTimeCost sets the "time_cost" field.

func (*JudgeRecordMutation) Status

func (m *JudgeRecordMutation) Status() (r int64, exists bool)

Status returns the value of the "status" field in the mutation.

func (*JudgeRecordMutation) TimeCost

func (m *JudgeRecordMutation) TimeCost() (r int64, exists bool)

TimeCost returns the value of the "time_cost" field in the mutation.

func (JudgeRecordMutation) Tx

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

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

func (*JudgeRecordMutation) Type

func (m *JudgeRecordMutation) Type() string

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

func (*JudgeRecordMutation) UserCleared

func (m *JudgeRecordMutation) UserCleared() bool

UserCleared reports if the "user" edge to the User entity was cleared.

func (*JudgeRecordMutation) UserIDs

func (m *JudgeRecordMutation) UserIDs() (ids []int64)

UserIDs returns the "user" edge IDs in the mutation.

func (*JudgeRecordMutation) Where

func (m *JudgeRecordMutation) Where(ps ...predicate.JudgeRecord)

Where appends a list predicates to the JudgeRecordMutation builder.

type JudgeRecordOrder

type JudgeRecordOrder struct {
	Direction OrderDirection         `json:"direction"`
	Field     *JudgeRecordOrderField `json:"field"`
}

JudgeRecordOrder defines the ordering of JudgeRecord.

type JudgeRecordOrderField

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

JudgeRecordOrderField defines the ordering field of JudgeRecord.

type JudgeRecordPaginateOption

type JudgeRecordPaginateOption func(*judgeRecordPager) error

JudgeRecordPaginateOption enables pagination customization.

func WithJudgeRecordFilter

func WithJudgeRecordFilter(filter func(*JudgeRecordQuery) (*JudgeRecordQuery, error)) JudgeRecordPaginateOption

WithJudgeRecordFilter configures pagination filter.

func WithJudgeRecordOrder

func WithJudgeRecordOrder(order *JudgeRecordOrder) JudgeRecordPaginateOption

WithJudgeRecordOrder configures pagination ordering.

type JudgeRecordQuery

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

JudgeRecordQuery is the builder for querying JudgeRecord entities.

func (*JudgeRecordQuery) All

func (jrq *JudgeRecordQuery) All(ctx context.Context) ([]*JudgeRecord, error)

All executes the query and returns a list of JudgeRecords.

func (*JudgeRecordQuery) AllX

func (jrq *JudgeRecordQuery) AllX(ctx context.Context) []*JudgeRecord

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

func (*JudgeRecordQuery) Clone

func (jrq *JudgeRecordQuery) Clone() *JudgeRecordQuery

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

func (*JudgeRecordQuery) CollectFields

func (jr *JudgeRecordQuery) CollectFields(ctx context.Context, satisfies ...string) *JudgeRecordQuery

CollectFields tells the query-builder to eagerly load connected nodes by resolver context.

func (*JudgeRecordQuery) Count

func (jrq *JudgeRecordQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*JudgeRecordQuery) CountX

func (jrq *JudgeRecordQuery) CountX(ctx context.Context) int

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

func (*JudgeRecordQuery) Exist

func (jrq *JudgeRecordQuery) Exist(ctx context.Context) (bool, error)

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

func (*JudgeRecordQuery) ExistX

func (jrq *JudgeRecordQuery) ExistX(ctx context.Context) bool

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

func (*JudgeRecordQuery) First

func (jrq *JudgeRecordQuery) First(ctx context.Context) (*JudgeRecord, error)

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

func (*JudgeRecordQuery) FirstID

func (jrq *JudgeRecordQuery) FirstID(ctx context.Context) (id int64, err error)

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

func (*JudgeRecordQuery) FirstIDX

func (jrq *JudgeRecordQuery) FirstIDX(ctx context.Context) int64

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

func (*JudgeRecordQuery) FirstX

func (jrq *JudgeRecordQuery) FirstX(ctx context.Context) *JudgeRecord

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

func (*JudgeRecordQuery) GroupBy

func (jrq *JudgeRecordQuery) GroupBy(field string, fields ...string) *JudgeRecordGroupBy

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

client.JudgeRecord.Query().
	GroupBy(judgerecord.FieldJudgeTime).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*JudgeRecordQuery) IDs

func (jrq *JudgeRecordQuery) IDs(ctx context.Context) ([]int64, error)

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

func (*JudgeRecordQuery) IDsX

func (jrq *JudgeRecordQuery) IDsX(ctx context.Context) []int64

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

func (*JudgeRecordQuery) Limit

func (jrq *JudgeRecordQuery) Limit(limit int) *JudgeRecordQuery

Limit adds a limit step to the query.

func (*JudgeRecordQuery) Offset

func (jrq *JudgeRecordQuery) Offset(offset int) *JudgeRecordQuery

Offset adds an offset step to the query.

func (*JudgeRecordQuery) Only

func (jrq *JudgeRecordQuery) Only(ctx context.Context) (*JudgeRecord, error)

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

func (*JudgeRecordQuery) OnlyID

func (jrq *JudgeRecordQuery) OnlyID(ctx context.Context) (id int64, err error)

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

func (*JudgeRecordQuery) OnlyIDX

func (jrq *JudgeRecordQuery) OnlyIDX(ctx context.Context) int64

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

func (*JudgeRecordQuery) OnlyX

func (jrq *JudgeRecordQuery) OnlyX(ctx context.Context) *JudgeRecord

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

func (*JudgeRecordQuery) Order

func (jrq *JudgeRecordQuery) Order(o ...OrderFunc) *JudgeRecordQuery

Order adds an order step to the query.

func (*JudgeRecordQuery) Paginate

func (jr *JudgeRecordQuery) Paginate(
	ctx context.Context, after *Cursor, first *int,
	before *Cursor, last *int, opts ...JudgeRecordPaginateOption,
) (*JudgeRecordConnection, error)

Paginate executes the query and returns a relay based cursor connection to JudgeRecord.

func (*JudgeRecordQuery) QueryUser

func (jrq *JudgeRecordQuery) QueryUser() *UserQuery

QueryUser chains the current query on the "user" edge.

func (*JudgeRecordQuery) Select

func (jrq *JudgeRecordQuery) Select(fields ...string) *JudgeRecordSelect

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 {
	JudgeTime time.Time `json:"judge_time,omitempty"`
}

client.JudgeRecord.Query().
	Select(judgerecord.FieldJudgeTime).
	Scan(ctx, &v)

func (*JudgeRecordQuery) Unique

func (jrq *JudgeRecordQuery) Unique(unique bool) *JudgeRecordQuery

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

Where adds a new predicate for the JudgeRecordQuery builder.

func (*JudgeRecordQuery) WithUser

func (jrq *JudgeRecordQuery) WithUser(opts ...func(*UserQuery)) *JudgeRecordQuery

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

type JudgeRecordSelect

type JudgeRecordSelect struct {
	*JudgeRecordQuery
	// contains filtered or unexported fields
}

JudgeRecordSelect is the builder for selecting fields of JudgeRecord entities.

func (*JudgeRecordSelect) Bool

func (jrs *JudgeRecordSelect) Bool(ctx context.Context) (_ bool, err error)

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

func (*JudgeRecordSelect) BoolX

func (jrs *JudgeRecordSelect) BoolX(ctx context.Context) bool

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

func (*JudgeRecordSelect) Bools

func (jrs *JudgeRecordSelect) Bools(ctx context.Context) ([]bool, error)

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

func (*JudgeRecordSelect) BoolsX

func (jrs *JudgeRecordSelect) BoolsX(ctx context.Context) []bool

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

func (*JudgeRecordSelect) Float64

func (jrs *JudgeRecordSelect) Float64(ctx context.Context) (_ float64, err error)

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

func (*JudgeRecordSelect) Float64X

func (jrs *JudgeRecordSelect) Float64X(ctx context.Context) float64

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

func (*JudgeRecordSelect) Float64s

func (jrs *JudgeRecordSelect) Float64s(ctx context.Context) ([]float64, error)

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

func (*JudgeRecordSelect) Float64sX

func (jrs *JudgeRecordSelect) Float64sX(ctx context.Context) []float64

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

func (*JudgeRecordSelect) Int

func (jrs *JudgeRecordSelect) Int(ctx context.Context) (_ int, err error)

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

func (*JudgeRecordSelect) IntX

func (jrs *JudgeRecordSelect) IntX(ctx context.Context) int

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

func (*JudgeRecordSelect) Ints

func (jrs *JudgeRecordSelect) Ints(ctx context.Context) ([]int, error)

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

func (*JudgeRecordSelect) IntsX

func (jrs *JudgeRecordSelect) IntsX(ctx context.Context) []int

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

func (*JudgeRecordSelect) Scan

func (jrs *JudgeRecordSelect) Scan(ctx context.Context, v interface{}) error

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

func (*JudgeRecordSelect) ScanX

func (jrs *JudgeRecordSelect) ScanX(ctx context.Context, v interface{})

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

func (*JudgeRecordSelect) String

func (jrs *JudgeRecordSelect) String(ctx context.Context) (_ string, err error)

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

func (*JudgeRecordSelect) StringX

func (jrs *JudgeRecordSelect) StringX(ctx context.Context) string

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

func (*JudgeRecordSelect) Strings

func (jrs *JudgeRecordSelect) Strings(ctx context.Context) ([]string, error)

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

func (*JudgeRecordSelect) StringsX

func (jrs *JudgeRecordSelect) StringsX(ctx context.Context) []string

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

type JudgeRecordUpdate

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

JudgeRecordUpdate is the builder for updating JudgeRecord entities.

func (*JudgeRecordUpdate) AddMemoryCost

func (jru *JudgeRecordUpdate) AddMemoryCost(i int64) *JudgeRecordUpdate

AddMemoryCost adds i to the "memory_cost" field.

func (*JudgeRecordUpdate) AddStatus

func (jru *JudgeRecordUpdate) AddStatus(i int64) *JudgeRecordUpdate

AddStatus adds i to the "status" field.

func (*JudgeRecordUpdate) AddTimeCost

func (jru *JudgeRecordUpdate) AddTimeCost(i int64) *JudgeRecordUpdate

AddTimeCost adds i to the "time_cost" field.

func (*JudgeRecordUpdate) AddUser

func (jru *JudgeRecordUpdate) AddUser(u ...*User) *JudgeRecordUpdate

AddUser adds the "user" edges to the User entity.

func (*JudgeRecordUpdate) AddUserIDs

func (jru *JudgeRecordUpdate) AddUserIDs(ids ...int64) *JudgeRecordUpdate

AddUserIDs adds the "user" edge to the User entity by IDs.

func (*JudgeRecordUpdate) ClearUser

func (jru *JudgeRecordUpdate) ClearUser() *JudgeRecordUpdate

ClearUser clears all "user" edges to the User entity.

func (*JudgeRecordUpdate) Exec

func (jru *JudgeRecordUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*JudgeRecordUpdate) ExecX

func (jru *JudgeRecordUpdate) ExecX(ctx context.Context)

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

func (*JudgeRecordUpdate) Mutation

func (jru *JudgeRecordUpdate) Mutation() *JudgeRecordMutation

Mutation returns the JudgeRecordMutation object of the builder.

func (*JudgeRecordUpdate) RemoveUser

func (jru *JudgeRecordUpdate) RemoveUser(u ...*User) *JudgeRecordUpdate

RemoveUser removes "user" edges to User entities.

func (*JudgeRecordUpdate) RemoveUserIDs

func (jru *JudgeRecordUpdate) RemoveUserIDs(ids ...int64) *JudgeRecordUpdate

RemoveUserIDs removes the "user" edge to User entities by IDs.

func (*JudgeRecordUpdate) Save

func (jru *JudgeRecordUpdate) Save(ctx context.Context) (int, error)

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

func (*JudgeRecordUpdate) SaveX

func (jru *JudgeRecordUpdate) SaveX(ctx context.Context) int

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

func (*JudgeRecordUpdate) SetFinishedTime

func (jru *JudgeRecordUpdate) SetFinishedTime(t time.Time) *JudgeRecordUpdate

SetFinishedTime sets the "finished_time" field.

func (*JudgeRecordUpdate) SetJudgeTime

func (jru *JudgeRecordUpdate) SetJudgeTime(t time.Time) *JudgeRecordUpdate

SetJudgeTime sets the "judge_time" field.

func (*JudgeRecordUpdate) SetMemoryCost

func (jru *JudgeRecordUpdate) SetMemoryCost(i int64) *JudgeRecordUpdate

SetMemoryCost sets the "memory_cost" field.

func (*JudgeRecordUpdate) SetNillableStatus

func (jru *JudgeRecordUpdate) SetNillableStatus(i *int64) *JudgeRecordUpdate

SetNillableStatus sets the "status" field if the given value is not nil.

func (*JudgeRecordUpdate) SetStatus

func (jru *JudgeRecordUpdate) SetStatus(i int64) *JudgeRecordUpdate

SetStatus sets the "status" field.

func (*JudgeRecordUpdate) SetTimeCost

func (jru *JudgeRecordUpdate) SetTimeCost(i int64) *JudgeRecordUpdate

SetTimeCost sets the "time_cost" field.

func (*JudgeRecordUpdate) Where

Where appends a list predicates to the JudgeRecordUpdate builder.

type JudgeRecordUpdateOne

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

JudgeRecordUpdateOne is the builder for updating a single JudgeRecord entity.

func (*JudgeRecordUpdateOne) AddMemoryCost

func (jruo *JudgeRecordUpdateOne) AddMemoryCost(i int64) *JudgeRecordUpdateOne

AddMemoryCost adds i to the "memory_cost" field.

func (*JudgeRecordUpdateOne) AddStatus

func (jruo *JudgeRecordUpdateOne) AddStatus(i int64) *JudgeRecordUpdateOne

AddStatus adds i to the "status" field.

func (*JudgeRecordUpdateOne) AddTimeCost

func (jruo *JudgeRecordUpdateOne) AddTimeCost(i int64) *JudgeRecordUpdateOne

AddTimeCost adds i to the "time_cost" field.

func (*JudgeRecordUpdateOne) AddUser

func (jruo *JudgeRecordUpdateOne) AddUser(u ...*User) *JudgeRecordUpdateOne

AddUser adds the "user" edges to the User entity.

func (*JudgeRecordUpdateOne) AddUserIDs

func (jruo *JudgeRecordUpdateOne) AddUserIDs(ids ...int64) *JudgeRecordUpdateOne

AddUserIDs adds the "user" edge to the User entity by IDs.

func (*JudgeRecordUpdateOne) ClearUser

func (jruo *JudgeRecordUpdateOne) ClearUser() *JudgeRecordUpdateOne

ClearUser clears all "user" edges to the User entity.

func (*JudgeRecordUpdateOne) Exec

func (jruo *JudgeRecordUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*JudgeRecordUpdateOne) ExecX

func (jruo *JudgeRecordUpdateOne) ExecX(ctx context.Context)

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

func (*JudgeRecordUpdateOne) Mutation

func (jruo *JudgeRecordUpdateOne) Mutation() *JudgeRecordMutation

Mutation returns the JudgeRecordMutation object of the builder.

func (*JudgeRecordUpdateOne) RemoveUser

func (jruo *JudgeRecordUpdateOne) RemoveUser(u ...*User) *JudgeRecordUpdateOne

RemoveUser removes "user" edges to User entities.

func (*JudgeRecordUpdateOne) RemoveUserIDs

func (jruo *JudgeRecordUpdateOne) RemoveUserIDs(ids ...int64) *JudgeRecordUpdateOne

RemoveUserIDs removes the "user" edge to User entities by IDs.

func (*JudgeRecordUpdateOne) Save

Save executes the query and returns the updated JudgeRecord entity.

func (*JudgeRecordUpdateOne) SaveX

func (jruo *JudgeRecordUpdateOne) SaveX(ctx context.Context) *JudgeRecord

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

func (*JudgeRecordUpdateOne) Select

func (jruo *JudgeRecordUpdateOne) Select(field string, fields ...string) *JudgeRecordUpdateOne

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

func (*JudgeRecordUpdateOne) SetFinishedTime

func (jruo *JudgeRecordUpdateOne) SetFinishedTime(t time.Time) *JudgeRecordUpdateOne

SetFinishedTime sets the "finished_time" field.

func (*JudgeRecordUpdateOne) SetJudgeTime

func (jruo *JudgeRecordUpdateOne) SetJudgeTime(t time.Time) *JudgeRecordUpdateOne

SetJudgeTime sets the "judge_time" field.

func (*JudgeRecordUpdateOne) SetMemoryCost

func (jruo *JudgeRecordUpdateOne) SetMemoryCost(i int64) *JudgeRecordUpdateOne

SetMemoryCost sets the "memory_cost" field.

func (*JudgeRecordUpdateOne) SetNillableStatus

func (jruo *JudgeRecordUpdateOne) SetNillableStatus(i *int64) *JudgeRecordUpdateOne

SetNillableStatus sets the "status" field if the given value is not nil.

func (*JudgeRecordUpdateOne) SetStatus

func (jruo *JudgeRecordUpdateOne) SetStatus(i int64) *JudgeRecordUpdateOne

SetStatus sets the "status" field.

func (*JudgeRecordUpdateOne) SetTimeCost

func (jruo *JudgeRecordUpdateOne) SetTimeCost(i int64) *JudgeRecordUpdateOne

SetTimeCost sets the "time_cost" field.

type JudgeRecordWhereInput

type JudgeRecordWhereInput struct {
	Not *JudgeRecordWhereInput   `json:"not,omitempty"`
	Or  []*JudgeRecordWhereInput `json:"or,omitempty"`
	And []*JudgeRecordWhereInput `json:"and,omitempty"`

	// "id" field predicates.
	ID      *int64  `json:"id,omitempty"`
	IDNEQ   *int64  `json:"idNEQ,omitempty"`
	IDIn    []int64 `json:"idIn,omitempty"`
	IDNotIn []int64 `json:"idNotIn,omitempty"`
	IDGT    *int64  `json:"idGT,omitempty"`
	IDGTE   *int64  `json:"idGTE,omitempty"`
	IDLT    *int64  `json:"idLT,omitempty"`
	IDLTE   *int64  `json:"idLTE,omitempty"`

	// "judge_time" field predicates.
	JudgeTime      *time.Time  `json:"judgeTime,omitempty"`
	JudgeTimeNEQ   *time.Time  `json:"judgeTimeNEQ,omitempty"`
	JudgeTimeIn    []time.Time `json:"judgeTimeIn,omitempty"`
	JudgeTimeNotIn []time.Time `json:"judgeTimeNotIn,omitempty"`
	JudgeTimeGT    *time.Time  `json:"judgeTimeGT,omitempty"`
	JudgeTimeGTE   *time.Time  `json:"judgeTimeGTE,omitempty"`
	JudgeTimeLT    *time.Time  `json:"judgeTimeLT,omitempty"`
	JudgeTimeLTE   *time.Time  `json:"judgeTimeLTE,omitempty"`

	// "finished_time" field predicates.
	FinishedTime      *time.Time  `json:"finishedTime,omitempty"`
	FinishedTimeNEQ   *time.Time  `json:"finishedTimeNEQ,omitempty"`
	FinishedTimeIn    []time.Time `json:"finishedTimeIn,omitempty"`
	FinishedTimeNotIn []time.Time `json:"finishedTimeNotIn,omitempty"`
	FinishedTimeGT    *time.Time  `json:"finishedTimeGT,omitempty"`
	FinishedTimeGTE   *time.Time  `json:"finishedTimeGTE,omitempty"`
	FinishedTimeLT    *time.Time  `json:"finishedTimeLT,omitempty"`
	FinishedTimeLTE   *time.Time  `json:"finishedTimeLTE,omitempty"`

	// "time_cost" field predicates.
	TimeCost      *int64  `json:"timeCost,omitempty"`
	TimeCostNEQ   *int64  `json:"timeCostNEQ,omitempty"`
	TimeCostIn    []int64 `json:"timeCostIn,omitempty"`
	TimeCostNotIn []int64 `json:"timeCostNotIn,omitempty"`
	TimeCostGT    *int64  `json:"timeCostGT,omitempty"`
	TimeCostGTE   *int64  `json:"timeCostGTE,omitempty"`
	TimeCostLT    *int64  `json:"timeCostLT,omitempty"`
	TimeCostLTE   *int64  `json:"timeCostLTE,omitempty"`

	// "memory_cost" field predicates.
	MemoryCost      *int64  `json:"memoryCost,omitempty"`
	MemoryCostNEQ   *int64  `json:"memoryCostNEQ,omitempty"`
	MemoryCostIn    []int64 `json:"memoryCostIn,omitempty"`
	MemoryCostNotIn []int64 `json:"memoryCostNotIn,omitempty"`
	MemoryCostGT    *int64  `json:"memoryCostGT,omitempty"`
	MemoryCostGTE   *int64  `json:"memoryCostGTE,omitempty"`
	MemoryCostLT    *int64  `json:"memoryCostLT,omitempty"`
	MemoryCostLTE   *int64  `json:"memoryCostLTE,omitempty"`

	// "status" field predicates.
	Status      *int64  `json:"status,omitempty"`
	StatusNEQ   *int64  `json:"statusNEQ,omitempty"`
	StatusIn    []int64 `json:"statusIn,omitempty"`
	StatusNotIn []int64 `json:"statusNotIn,omitempty"`
	StatusGT    *int64  `json:"statusGT,omitempty"`
	StatusGTE   *int64  `json:"statusGTE,omitempty"`
	StatusLT    *int64  `json:"statusLT,omitempty"`
	StatusLTE   *int64  `json:"statusLTE,omitempty"`

	// "user" edge predicates.
	HasUser     *bool             `json:"hasUser,omitempty"`
	HasUserWith []*UserWhereInput `json:"hasUserWith,omitempty"`
}

JudgeRecordWhereInput represents a where input for filtering JudgeRecord queries.

func (*JudgeRecordWhereInput) Filter

Filter applies the JudgeRecordWhereInput filter on the JudgeRecordQuery builder.

func (*JudgeRecordWhereInput) P

P returns a predicate for filtering judgerecords. An error is returned if the input is empty or invalid.

type JudgeRecords

type JudgeRecords []*JudgeRecord

JudgeRecords is a parsable slice of JudgeRecord.

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 Node

type Node struct {
	ID     int64    `json:"id,omitempty"`     // node id.
	Type   string   `json:"type,omitempty"`   // node type.
	Fields []*Field `json:"fields,omitempty"` // node fields.
	Edges  []*Edge  `json:"edges,omitempty"`  // node edges.
}

Node in the graph.

type NodeOption

type NodeOption func(*nodeOptions)

NodeOption allows configuring the Noder execution using functional options.

func WithFixedNodeType

func WithFixedNodeType(t string) NodeOption

WithFixedNodeType sets the Type of the node to a fixed value.

func WithNodeType

func WithNodeType(f func(context.Context, int64) (string, error)) NodeOption

WithNodeType sets the node Type resolver function (i.e. the table to query). If was not provided, the table will be derived from the universal-id configuration as described in: https://entgo.io/docs/migrate/#universal-ids.

type Noder

type Noder interface {
	Node(context.Context) (*Node, error)
}

Noder wraps the basic Node method.

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 OrderDirection

type OrderDirection string

OrderDirection defines the directions in which to order a list of items.

const (
	// OrderDirectionAsc specifies an ascending order.
	OrderDirectionAsc OrderDirection = "ASC"
	// OrderDirectionDesc specifies a descending order.
	OrderDirectionDesc OrderDirection = "DESC"
)

func (OrderDirection) MarshalGQL

func (o OrderDirection) MarshalGQL(w io.Writer)

MarshalGQL implements graphql.Marshaler interface.

func (OrderDirection) String

func (o OrderDirection) String() string

String implements fmt.Stringer interface.

func (*OrderDirection) UnmarshalGQL

func (o *OrderDirection) UnmarshalGQL(val interface{}) error

UnmarshalGQL implements graphql.Unmarshaler interface.

func (OrderDirection) Validate

func (o OrderDirection) Validate() error

Validate the order direction value.

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 PageInfo

type PageInfo struct {
	HasNextPage     bool    `json:"hasNextPage"`
	HasPreviousPage bool    `json:"hasPreviousPage"`
	StartCursor     *Cursor `json:"startCursor"`
	EndCursor       *Cursor `json:"endCursor"`
}

PageInfo of a connection type.

type Policy

type Policy = ent.Policy

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

type Problem

type Problem struct {

	// ID of the ent.
	ID int64 `json:"id,omitempty"`
	// Title holds the value of the "title" field.
	Title string `json:"title,omitempty"`
	// Content holds the value of the "content" field.
	Content string `json:"content,omitempty"`
	// CreatedTime holds the value of the "created_time" field.
	CreatedTime time.Time `json:"created_time,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the ProblemQuery when eager-loading is set.
	Edges ProblemEdges `json:"edges"`
	// contains filtered or unexported fields
}

Problem is the model entity for the Problem schema.

func (*Problem) Author

func (pr *Problem) Author(ctx context.Context) (*User, error)

func (*Problem) Node

func (pr *Problem) Node(ctx context.Context) (node *Node, err error)

func (*Problem) QueryAuthor

func (pr *Problem) QueryAuthor() *UserQuery

QueryAuthor queries the "author" edge of the Problem entity.

func (*Problem) QuerySolvedBy

func (pr *Problem) QuerySolvedBy() *UserQuery

QuerySolvedBy queries the "solved_by" edge of the Problem entity.

func (*Problem) QueryTags

func (pr *Problem) QueryTags() *TagQuery

QueryTags queries the "tags" edge of the Problem entity.

func (*Problem) SolvedBy

func (pr *Problem) SolvedBy(ctx context.Context) ([]*User, error)

func (*Problem) String

func (pr *Problem) String() string

String implements the fmt.Stringer.

func (*Problem) Tags

func (pr *Problem) Tags(ctx context.Context) ([]*Tag, error)

func (*Problem) ToEdge

func (pr *Problem) ToEdge(order *ProblemOrder) *ProblemEdge

ToEdge converts Problem into ProblemEdge.

func (*Problem) Unwrap

func (pr *Problem) Unwrap() *Problem

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

func (pr *Problem) Update() *ProblemUpdateOne

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

type ProblemClient

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

ProblemClient is a client for the Problem schema.

func NewProblemClient

func NewProblemClient(c config) *ProblemClient

NewProblemClient returns a client for the Problem from the given config.

func (*ProblemClient) Create

func (c *ProblemClient) Create() *ProblemCreate

Create returns a create builder for Problem.

func (*ProblemClient) CreateBulk

func (c *ProblemClient) CreateBulk(builders ...*ProblemCreate) *ProblemCreateBulk

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

func (*ProblemClient) Delete

func (c *ProblemClient) Delete() *ProblemDelete

Delete returns a delete builder for Problem.

func (*ProblemClient) DeleteOne

func (c *ProblemClient) DeleteOne(pr *Problem) *ProblemDeleteOne

DeleteOne returns a delete builder for the given entity.

func (*ProblemClient) DeleteOneID

func (c *ProblemClient) DeleteOneID(id int64) *ProblemDeleteOne

DeleteOneID returns a delete builder for the given id.

func (*ProblemClient) Get

func (c *ProblemClient) Get(ctx context.Context, id int64) (*Problem, error)

Get returns a Problem entity by its id.

func (*ProblemClient) GetX

func (c *ProblemClient) GetX(ctx context.Context, id int64) *Problem

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

func (*ProblemClient) Hooks

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

Hooks returns the client hooks.

func (*ProblemClient) Query

func (c *ProblemClient) Query() *ProblemQuery

Query returns a query builder for Problem.

func (*ProblemClient) QueryAuthor

func (c *ProblemClient) QueryAuthor(pr *Problem) *UserQuery

QueryAuthor queries the author edge of a Problem.

func (*ProblemClient) QuerySolvedBy

func (c *ProblemClient) QuerySolvedBy(pr *Problem) *UserQuery

QuerySolvedBy queries the solved_by edge of a Problem.

func (*ProblemClient) QueryTags

func (c *ProblemClient) QueryTags(pr *Problem) *TagQuery

QueryTags queries the tags edge of a Problem.

func (*ProblemClient) Update

func (c *ProblemClient) Update() *ProblemUpdate

Update returns an update builder for Problem.

func (*ProblemClient) UpdateOne

func (c *ProblemClient) UpdateOne(pr *Problem) *ProblemUpdateOne

UpdateOne returns an update builder for the given entity.

func (*ProblemClient) UpdateOneID

func (c *ProblemClient) UpdateOneID(id int64) *ProblemUpdateOne

UpdateOneID returns an update builder for the given id.

func (*ProblemClient) Use

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

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

type ProblemConnection

type ProblemConnection struct {
	Edges      []*ProblemEdge `json:"edges"`
	PageInfo   PageInfo       `json:"pageInfo"`
	TotalCount int            `json:"totalCount"`
}

ProblemConnection is the connection containing edges to Problem.

type ProblemCreate

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

ProblemCreate is the builder for creating a Problem entity.

func (*ProblemCreate) AddSolvedBy

func (pc *ProblemCreate) AddSolvedBy(u ...*User) *ProblemCreate

AddSolvedBy adds the "solved_by" edges to the User entity.

func (*ProblemCreate) AddSolvedByIDs

func (pc *ProblemCreate) AddSolvedByIDs(ids ...int64) *ProblemCreate

AddSolvedByIDs adds the "solved_by" edge to the User entity by IDs.

func (*ProblemCreate) AddTagIDs

func (pc *ProblemCreate) AddTagIDs(ids ...int64) *ProblemCreate

AddTagIDs adds the "tags" edge to the Tag entity by IDs.

func (*ProblemCreate) AddTags

func (pc *ProblemCreate) AddTags(t ...*Tag) *ProblemCreate

AddTags adds the "tags" edges to the Tag entity.

func (*ProblemCreate) Exec

func (pc *ProblemCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*ProblemCreate) ExecX

func (pc *ProblemCreate) ExecX(ctx context.Context)

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

func (*ProblemCreate) Mutation

func (pc *ProblemCreate) Mutation() *ProblemMutation

Mutation returns the ProblemMutation object of the builder.

func (*ProblemCreate) Save

func (pc *ProblemCreate) Save(ctx context.Context) (*Problem, error)

Save creates the Problem in the database.

func (*ProblemCreate) SaveX

func (pc *ProblemCreate) SaveX(ctx context.Context) *Problem

SaveX calls Save and panics if Save returns an error.

func (*ProblemCreate) SetAuthor

func (pc *ProblemCreate) SetAuthor(u *User) *ProblemCreate

SetAuthor sets the "author" edge to the User entity.

func (*ProblemCreate) SetAuthorID

func (pc *ProblemCreate) SetAuthorID(id int64) *ProblemCreate

SetAuthorID sets the "author" edge to the User entity by ID.

func (*ProblemCreate) SetContent

func (pc *ProblemCreate) SetContent(s string) *ProblemCreate

SetContent sets the "content" field.

func (*ProblemCreate) SetCreatedTime

func (pc *ProblemCreate) SetCreatedTime(t time.Time) *ProblemCreate

SetCreatedTime sets the "created_time" field.

func (*ProblemCreate) SetID

func (pc *ProblemCreate) SetID(i int64) *ProblemCreate

SetID sets the "id" field.

func (*ProblemCreate) SetNillableAuthorID

func (pc *ProblemCreate) SetNillableAuthorID(id *int64) *ProblemCreate

SetNillableAuthorID sets the "author" edge to the User entity by ID if the given value is not nil.

func (*ProblemCreate) SetNillableCreatedTime

func (pc *ProblemCreate) SetNillableCreatedTime(t *time.Time) *ProblemCreate

SetNillableCreatedTime sets the "created_time" field if the given value is not nil.

func (*ProblemCreate) SetTitle

func (pc *ProblemCreate) SetTitle(s string) *ProblemCreate

SetTitle sets the "title" field.

type ProblemCreateBulk

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

ProblemCreateBulk is the builder for creating many Problem entities in bulk.

func (*ProblemCreateBulk) Exec

func (pcb *ProblemCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*ProblemCreateBulk) ExecX

func (pcb *ProblemCreateBulk) ExecX(ctx context.Context)

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

func (*ProblemCreateBulk) Save

func (pcb *ProblemCreateBulk) Save(ctx context.Context) ([]*Problem, error)

Save creates the Problem entities in the database.

func (*ProblemCreateBulk) SaveX

func (pcb *ProblemCreateBulk) SaveX(ctx context.Context) []*Problem

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

type ProblemDelete

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

ProblemDelete is the builder for deleting a Problem entity.

func (*ProblemDelete) Exec

func (pd *ProblemDelete) Exec(ctx context.Context) (int, error)

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

func (*ProblemDelete) ExecX

func (pd *ProblemDelete) ExecX(ctx context.Context) int

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

func (*ProblemDelete) Where

func (pd *ProblemDelete) Where(ps ...predicate.Problem) *ProblemDelete

Where appends a list predicates to the ProblemDelete builder.

type ProblemDeleteOne

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

ProblemDeleteOne is the builder for deleting a single Problem entity.

func (*ProblemDeleteOne) Exec

func (pdo *ProblemDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*ProblemDeleteOne) ExecX

func (pdo *ProblemDeleteOne) ExecX(ctx context.Context)

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

type ProblemEdge

type ProblemEdge struct {
	Node   *Problem `json:"node"`
	Cursor Cursor   `json:"cursor"`
}

ProblemEdge is the edge representation of Problem.

type ProblemEdges

type ProblemEdges struct {
	// Author holds the value of the author edge.
	Author *User `json:"author,omitempty"`
	// SolvedBy holds the value of the solved_by edge.
	SolvedBy []*User `json:"solved_by,omitempty"`
	// Tags holds the value of the tags edge.
	Tags []*Tag `json:"tags,omitempty"`
	// contains filtered or unexported fields
}

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

func (ProblemEdges) AuthorOrErr

func (e ProblemEdges) AuthorOrErr() (*User, error)

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

func (ProblemEdges) SolvedByOrErr

func (e ProblemEdges) SolvedByOrErr() ([]*User, error)

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

func (ProblemEdges) TagsOrErr

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

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

type ProblemGroupBy

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

ProblemGroupBy is the group-by builder for Problem entities.

func (*ProblemGroupBy) Aggregate

func (pgb *ProblemGroupBy) Aggregate(fns ...AggregateFunc) *ProblemGroupBy

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

func (*ProblemGroupBy) Bool

func (pgb *ProblemGroupBy) 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 (*ProblemGroupBy) BoolX

func (pgb *ProblemGroupBy) BoolX(ctx context.Context) bool

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

func (*ProblemGroupBy) Bools

func (pgb *ProblemGroupBy) 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 (*ProblemGroupBy) BoolsX

func (pgb *ProblemGroupBy) BoolsX(ctx context.Context) []bool

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

func (*ProblemGroupBy) Float64

func (pgb *ProblemGroupBy) 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 (*ProblemGroupBy) Float64X

func (pgb *ProblemGroupBy) Float64X(ctx context.Context) float64

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

func (*ProblemGroupBy) Float64s

func (pgb *ProblemGroupBy) 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 (*ProblemGroupBy) Float64sX

func (pgb *ProblemGroupBy) Float64sX(ctx context.Context) []float64

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

func (*ProblemGroupBy) Int

func (pgb *ProblemGroupBy) 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 (*ProblemGroupBy) IntX

func (pgb *ProblemGroupBy) IntX(ctx context.Context) int

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

func (*ProblemGroupBy) Ints

func (pgb *ProblemGroupBy) 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 (*ProblemGroupBy) IntsX

func (pgb *ProblemGroupBy) IntsX(ctx context.Context) []int

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

func (*ProblemGroupBy) Scan

func (pgb *ProblemGroupBy) Scan(ctx context.Context, v interface{}) error

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

func (*ProblemGroupBy) ScanX

func (pgb *ProblemGroupBy) ScanX(ctx context.Context, v interface{})

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

func (*ProblemGroupBy) String

func (pgb *ProblemGroupBy) 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 (*ProblemGroupBy) StringX

func (pgb *ProblemGroupBy) StringX(ctx context.Context) string

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

func (*ProblemGroupBy) Strings

func (pgb *ProblemGroupBy) 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 (*ProblemGroupBy) StringsX

func (pgb *ProblemGroupBy) StringsX(ctx context.Context) []string

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

type ProblemMutation

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

ProblemMutation represents an operation that mutates the Problem nodes in the graph.

func (*ProblemMutation) AddField

func (m *ProblemMutation) 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 (*ProblemMutation) AddSolvedByIDs

func (m *ProblemMutation) AddSolvedByIDs(ids ...int64)

AddSolvedByIDs adds the "solved_by" edge to the User entity by ids.

func (*ProblemMutation) AddTagIDs

func (m *ProblemMutation) AddTagIDs(ids ...int64)

AddTagIDs adds the "tags" edge to the Tag entity by ids.

func (*ProblemMutation) AddedEdges

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

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

func (*ProblemMutation) AddedField

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

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

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

func (*ProblemMutation) AddedIDs

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

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

func (*ProblemMutation) AuthorCleared

func (m *ProblemMutation) AuthorCleared() bool

AuthorCleared reports if the "author" edge to the User entity was cleared.

func (*ProblemMutation) AuthorID

func (m *ProblemMutation) AuthorID() (id int64, exists bool)

AuthorID returns the "author" edge ID in the mutation.

func (*ProblemMutation) AuthorIDs

func (m *ProblemMutation) AuthorIDs() (ids []int64)

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

func (*ProblemMutation) ClearAuthor

func (m *ProblemMutation) ClearAuthor()

ClearAuthor clears the "author" edge to the User entity.

func (*ProblemMutation) ClearEdge

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

func (m *ProblemMutation) 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 (*ProblemMutation) ClearSolvedBy

func (m *ProblemMutation) ClearSolvedBy()

ClearSolvedBy clears the "solved_by" edge to the User entity.

func (*ProblemMutation) ClearTags

func (m *ProblemMutation) ClearTags()

ClearTags clears the "tags" edge to the Tag entity.

func (*ProblemMutation) ClearedEdges

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

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

func (*ProblemMutation) ClearedFields

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

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

func (ProblemMutation) Client

func (m ProblemMutation) 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 (*ProblemMutation) Content

func (m *ProblemMutation) Content() (r string, exists bool)

Content returns the value of the "content" field in the mutation.

func (*ProblemMutation) CreatedTime

func (m *ProblemMutation) CreatedTime() (r time.Time, exists bool)

CreatedTime returns the value of the "created_time" field in the mutation.

func (*ProblemMutation) EdgeCleared

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

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

func (*ProblemMutation) Field

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

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

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

func (*ProblemMutation) Fields

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

func (m *ProblemMutation) ID() (id int64, exists bool)

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

func (*ProblemMutation) IDs

func (m *ProblemMutation) IDs(ctx context.Context) ([]int64, error)

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

func (*ProblemMutation) OldContent

func (m *ProblemMutation) OldContent(ctx context.Context) (v string, err error)

OldContent returns the old "content" field's value of the Problem entity. If the Problem 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 (*ProblemMutation) OldCreatedTime

func (m *ProblemMutation) OldCreatedTime(ctx context.Context) (v time.Time, err error)

OldCreatedTime returns the old "created_time" field's value of the Problem entity. If the Problem 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 (*ProblemMutation) OldField

func (m *ProblemMutation) 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 (*ProblemMutation) OldTitle

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

OldTitle returns the old "title" field's value of the Problem entity. If the Problem 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 (*ProblemMutation) Op

func (m *ProblemMutation) Op() Op

Op returns the operation name.

func (*ProblemMutation) RemoveSolvedByIDs

func (m *ProblemMutation) RemoveSolvedByIDs(ids ...int64)

RemoveSolvedByIDs removes the "solved_by" edge to the User entity by IDs.

func (*ProblemMutation) RemoveTagIDs

func (m *ProblemMutation) RemoveTagIDs(ids ...int64)

RemoveTagIDs removes the "tags" edge to the Tag entity by IDs.

func (*ProblemMutation) RemovedEdges

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

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

func (*ProblemMutation) RemovedIDs

func (m *ProblemMutation) 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 (*ProblemMutation) RemovedSolvedByIDs

func (m *ProblemMutation) RemovedSolvedByIDs() (ids []int64)

RemovedSolvedBy returns the removed IDs of the "solved_by" edge to the User entity.

func (*ProblemMutation) RemovedTagsIDs

func (m *ProblemMutation) RemovedTagsIDs() (ids []int64)

RemovedTags returns the removed IDs of the "tags" edge to the Tag entity.

func (*ProblemMutation) ResetAuthor

func (m *ProblemMutation) ResetAuthor()

ResetAuthor resets all changes to the "author" edge.

func (*ProblemMutation) ResetContent

func (m *ProblemMutation) ResetContent()

ResetContent resets all changes to the "content" field.

func (*ProblemMutation) ResetCreatedTime

func (m *ProblemMutation) ResetCreatedTime()

ResetCreatedTime resets all changes to the "created_time" field.

func (*ProblemMutation) ResetEdge

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

func (m *ProblemMutation) 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 (*ProblemMutation) ResetSolvedBy

func (m *ProblemMutation) ResetSolvedBy()

ResetSolvedBy resets all changes to the "solved_by" edge.

func (*ProblemMutation) ResetTags

func (m *ProblemMutation) ResetTags()

ResetTags resets all changes to the "tags" edge.

func (*ProblemMutation) ResetTitle

func (m *ProblemMutation) ResetTitle()

ResetTitle resets all changes to the "title" field.

func (*ProblemMutation) SetAuthorID

func (m *ProblemMutation) SetAuthorID(id int64)

SetAuthorID sets the "author" edge to the User entity by id.

func (*ProblemMutation) SetContent

func (m *ProblemMutation) SetContent(s string)

SetContent sets the "content" field.

func (*ProblemMutation) SetCreatedTime

func (m *ProblemMutation) SetCreatedTime(t time.Time)

SetCreatedTime sets the "created_time" field.

func (*ProblemMutation) SetField

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

func (m *ProblemMutation) SetID(id int64)

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

func (*ProblemMutation) SetTitle

func (m *ProblemMutation) SetTitle(s string)

SetTitle sets the "title" field.

func (*ProblemMutation) SolvedByCleared

func (m *ProblemMutation) SolvedByCleared() bool

SolvedByCleared reports if the "solved_by" edge to the User entity was cleared.

func (*ProblemMutation) SolvedByIDs

func (m *ProblemMutation) SolvedByIDs() (ids []int64)

SolvedByIDs returns the "solved_by" edge IDs in the mutation.

func (*ProblemMutation) TagsCleared

func (m *ProblemMutation) TagsCleared() bool

TagsCleared reports if the "tags" edge to the Tag entity was cleared.

func (*ProblemMutation) TagsIDs

func (m *ProblemMutation) TagsIDs() (ids []int64)

TagsIDs returns the "tags" edge IDs in the mutation.

func (*ProblemMutation) Title

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

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

func (ProblemMutation) Tx

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

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

func (*ProblemMutation) Type

func (m *ProblemMutation) Type() string

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

func (*ProblemMutation) Where

func (m *ProblemMutation) Where(ps ...predicate.Problem)

Where appends a list predicates to the ProblemMutation builder.

type ProblemOrder

type ProblemOrder struct {
	Direction OrderDirection     `json:"direction"`
	Field     *ProblemOrderField `json:"field"`
}

ProblemOrder defines the ordering of Problem.

type ProblemOrderField

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

ProblemOrderField defines the ordering field of Problem.

type ProblemPaginateOption

type ProblemPaginateOption func(*problemPager) error

ProblemPaginateOption enables pagination customization.

func WithProblemFilter

func WithProblemFilter(filter func(*ProblemQuery) (*ProblemQuery, error)) ProblemPaginateOption

WithProblemFilter configures pagination filter.

func WithProblemOrder

func WithProblemOrder(order *ProblemOrder) ProblemPaginateOption

WithProblemOrder configures pagination ordering.

type ProblemQuery

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

ProblemQuery is the builder for querying Problem entities.

func (*ProblemQuery) All

func (pq *ProblemQuery) All(ctx context.Context) ([]*Problem, error)

All executes the query and returns a list of Problems.

func (*ProblemQuery) AllX

func (pq *ProblemQuery) AllX(ctx context.Context) []*Problem

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

func (*ProblemQuery) Clone

func (pq *ProblemQuery) Clone() *ProblemQuery

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

func (*ProblemQuery) CollectFields

func (pr *ProblemQuery) CollectFields(ctx context.Context, satisfies ...string) *ProblemQuery

CollectFields tells the query-builder to eagerly load connected nodes by resolver context.

func (*ProblemQuery) Count

func (pq *ProblemQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*ProblemQuery) CountX

func (pq *ProblemQuery) CountX(ctx context.Context) int

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

func (*ProblemQuery) Exist

func (pq *ProblemQuery) Exist(ctx context.Context) (bool, error)

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

func (*ProblemQuery) ExistX

func (pq *ProblemQuery) ExistX(ctx context.Context) bool

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

func (*ProblemQuery) First

func (pq *ProblemQuery) First(ctx context.Context) (*Problem, error)

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

func (*ProblemQuery) FirstID

func (pq *ProblemQuery) FirstID(ctx context.Context) (id int64, err error)

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

func (*ProblemQuery) FirstIDX

func (pq *ProblemQuery) FirstIDX(ctx context.Context) int64

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

func (*ProblemQuery) FirstX

func (pq *ProblemQuery) FirstX(ctx context.Context) *Problem

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

func (*ProblemQuery) GroupBy

func (pq *ProblemQuery) GroupBy(field string, fields ...string) *ProblemGroupBy

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

Example:

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

client.Problem.Query().
	GroupBy(problem.FieldTitle).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*ProblemQuery) IDs

func (pq *ProblemQuery) IDs(ctx context.Context) ([]int64, error)

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

func (*ProblemQuery) IDsX

func (pq *ProblemQuery) IDsX(ctx context.Context) []int64

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

func (*ProblemQuery) Limit

func (pq *ProblemQuery) Limit(limit int) *ProblemQuery

Limit adds a limit step to the query.

func (*ProblemQuery) Offset

func (pq *ProblemQuery) Offset(offset int) *ProblemQuery

Offset adds an offset step to the query.

func (*ProblemQuery) Only

func (pq *ProblemQuery) Only(ctx context.Context) (*Problem, error)

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

func (*ProblemQuery) OnlyID

func (pq *ProblemQuery) OnlyID(ctx context.Context) (id int64, err error)

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

func (*ProblemQuery) OnlyIDX

func (pq *ProblemQuery) OnlyIDX(ctx context.Context) int64

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

func (*ProblemQuery) OnlyX

func (pq *ProblemQuery) OnlyX(ctx context.Context) *Problem

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

func (*ProblemQuery) Order

func (pq *ProblemQuery) Order(o ...OrderFunc) *ProblemQuery

Order adds an order step to the query.

func (*ProblemQuery) Paginate

func (pr *ProblemQuery) Paginate(
	ctx context.Context, after *Cursor, first *int,
	before *Cursor, last *int, opts ...ProblemPaginateOption,
) (*ProblemConnection, error)

Paginate executes the query and returns a relay based cursor connection to Problem.

func (*ProblemQuery) QueryAuthor

func (pq *ProblemQuery) QueryAuthor() *UserQuery

QueryAuthor chains the current query on the "author" edge.

func (*ProblemQuery) QuerySolvedBy

func (pq *ProblemQuery) QuerySolvedBy() *UserQuery

QuerySolvedBy chains the current query on the "solved_by" edge.

func (*ProblemQuery) QueryTags

func (pq *ProblemQuery) QueryTags() *TagQuery

QueryTags chains the current query on the "tags" edge.

func (*ProblemQuery) Select

func (pq *ProblemQuery) Select(fields ...string) *ProblemSelect

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

Example:

var v []struct {
	Title string `json:"title,omitempty"`
}

client.Problem.Query().
	Select(problem.FieldTitle).
	Scan(ctx, &v)

func (*ProblemQuery) Unique

func (pq *ProblemQuery) Unique(unique bool) *ProblemQuery

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

func (pq *ProblemQuery) Where(ps ...predicate.Problem) *ProblemQuery

Where adds a new predicate for the ProblemQuery builder.

func (*ProblemQuery) WithAuthor

func (pq *ProblemQuery) WithAuthor(opts ...func(*UserQuery)) *ProblemQuery

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

func (*ProblemQuery) WithSolvedBy

func (pq *ProblemQuery) WithSolvedBy(opts ...func(*UserQuery)) *ProblemQuery

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

func (*ProblemQuery) WithTags

func (pq *ProblemQuery) WithTags(opts ...func(*TagQuery)) *ProblemQuery

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

type ProblemSelect

type ProblemSelect struct {
	*ProblemQuery
	// contains filtered or unexported fields
}

ProblemSelect is the builder for selecting fields of Problem entities.

func (*ProblemSelect) Bool

func (ps *ProblemSelect) Bool(ctx context.Context) (_ bool, err error)

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

func (*ProblemSelect) BoolX

func (ps *ProblemSelect) BoolX(ctx context.Context) bool

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

func (*ProblemSelect) Bools

func (ps *ProblemSelect) Bools(ctx context.Context) ([]bool, error)

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

func (*ProblemSelect) BoolsX

func (ps *ProblemSelect) BoolsX(ctx context.Context) []bool

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

func (*ProblemSelect) Float64

func (ps *ProblemSelect) Float64(ctx context.Context) (_ float64, err error)

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

func (*ProblemSelect) Float64X

func (ps *ProblemSelect) Float64X(ctx context.Context) float64

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

func (*ProblemSelect) Float64s

func (ps *ProblemSelect) Float64s(ctx context.Context) ([]float64, error)

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

func (*ProblemSelect) Float64sX

func (ps *ProblemSelect) Float64sX(ctx context.Context) []float64

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

func (*ProblemSelect) Int

func (ps *ProblemSelect) Int(ctx context.Context) (_ int, err error)

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

func (*ProblemSelect) IntX

func (ps *ProblemSelect) IntX(ctx context.Context) int

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

func (*ProblemSelect) Ints

func (ps *ProblemSelect) Ints(ctx context.Context) ([]int, error)

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

func (*ProblemSelect) IntsX

func (ps *ProblemSelect) IntsX(ctx context.Context) []int

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

func (*ProblemSelect) Scan

func (ps *ProblemSelect) Scan(ctx context.Context, v interface{}) error

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

func (*ProblemSelect) ScanX

func (ps *ProblemSelect) ScanX(ctx context.Context, v interface{})

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

func (*ProblemSelect) String

func (ps *ProblemSelect) String(ctx context.Context) (_ string, err error)

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

func (*ProblemSelect) StringX

func (ps *ProblemSelect) StringX(ctx context.Context) string

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

func (*ProblemSelect) Strings

func (ps *ProblemSelect) Strings(ctx context.Context) ([]string, error)

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

func (*ProblemSelect) StringsX

func (ps *ProblemSelect) StringsX(ctx context.Context) []string

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

type ProblemUpdate

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

ProblemUpdate is the builder for updating Problem entities.

func (*ProblemUpdate) AddSolvedBy

func (pu *ProblemUpdate) AddSolvedBy(u ...*User) *ProblemUpdate

AddSolvedBy adds the "solved_by" edges to the User entity.

func (*ProblemUpdate) AddSolvedByIDs

func (pu *ProblemUpdate) AddSolvedByIDs(ids ...int64) *ProblemUpdate

AddSolvedByIDs adds the "solved_by" edge to the User entity by IDs.

func (*ProblemUpdate) AddTagIDs

func (pu *ProblemUpdate) AddTagIDs(ids ...int64) *ProblemUpdate

AddTagIDs adds the "tags" edge to the Tag entity by IDs.

func (*ProblemUpdate) AddTags

func (pu *ProblemUpdate) AddTags(t ...*Tag) *ProblemUpdate

AddTags adds the "tags" edges to the Tag entity.

func (*ProblemUpdate) ClearAuthor

func (pu *ProblemUpdate) ClearAuthor() *ProblemUpdate

ClearAuthor clears the "author" edge to the User entity.

func (*ProblemUpdate) ClearSolvedBy

func (pu *ProblemUpdate) ClearSolvedBy() *ProblemUpdate

ClearSolvedBy clears all "solved_by" edges to the User entity.

func (*ProblemUpdate) ClearTags

func (pu *ProblemUpdate) ClearTags() *ProblemUpdate

ClearTags clears all "tags" edges to the Tag entity.

func (*ProblemUpdate) Exec

func (pu *ProblemUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*ProblemUpdate) ExecX

func (pu *ProblemUpdate) ExecX(ctx context.Context)

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

func (*ProblemUpdate) Mutation

func (pu *ProblemUpdate) Mutation() *ProblemMutation

Mutation returns the ProblemMutation object of the builder.

func (*ProblemUpdate) RemoveSolvedBy

func (pu *ProblemUpdate) RemoveSolvedBy(u ...*User) *ProblemUpdate

RemoveSolvedBy removes "solved_by" edges to User entities.

func (*ProblemUpdate) RemoveSolvedByIDs

func (pu *ProblemUpdate) RemoveSolvedByIDs(ids ...int64) *ProblemUpdate

RemoveSolvedByIDs removes the "solved_by" edge to User entities by IDs.

func (*ProblemUpdate) RemoveTagIDs

func (pu *ProblemUpdate) RemoveTagIDs(ids ...int64) *ProblemUpdate

RemoveTagIDs removes the "tags" edge to Tag entities by IDs.

func (*ProblemUpdate) RemoveTags

func (pu *ProblemUpdate) RemoveTags(t ...*Tag) *ProblemUpdate

RemoveTags removes "tags" edges to Tag entities.

func (*ProblemUpdate) Save

func (pu *ProblemUpdate) Save(ctx context.Context) (int, error)

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

func (*ProblemUpdate) SaveX

func (pu *ProblemUpdate) SaveX(ctx context.Context) int

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

func (*ProblemUpdate) SetAuthor

func (pu *ProblemUpdate) SetAuthor(u *User) *ProblemUpdate

SetAuthor sets the "author" edge to the User entity.

func (*ProblemUpdate) SetAuthorID

func (pu *ProblemUpdate) SetAuthorID(id int64) *ProblemUpdate

SetAuthorID sets the "author" edge to the User entity by ID.

func (*ProblemUpdate) SetContent

func (pu *ProblemUpdate) SetContent(s string) *ProblemUpdate

SetContent sets the "content" field.

func (*ProblemUpdate) SetNillableAuthorID

func (pu *ProblemUpdate) SetNillableAuthorID(id *int64) *ProblemUpdate

SetNillableAuthorID sets the "author" edge to the User entity by ID if the given value is not nil.

func (*ProblemUpdate) SetTitle

func (pu *ProblemUpdate) SetTitle(s string) *ProblemUpdate

SetTitle sets the "title" field.

func (*ProblemUpdate) Where

func (pu *ProblemUpdate) Where(ps ...predicate.Problem) *ProblemUpdate

Where appends a list predicates to the ProblemUpdate builder.

type ProblemUpdateOne

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

ProblemUpdateOne is the builder for updating a single Problem entity.

func (*ProblemUpdateOne) AddSolvedBy

func (puo *ProblemUpdateOne) AddSolvedBy(u ...*User) *ProblemUpdateOne

AddSolvedBy adds the "solved_by" edges to the User entity.

func (*ProblemUpdateOne) AddSolvedByIDs

func (puo *ProblemUpdateOne) AddSolvedByIDs(ids ...int64) *ProblemUpdateOne

AddSolvedByIDs adds the "solved_by" edge to the User entity by IDs.

func (*ProblemUpdateOne) AddTagIDs

func (puo *ProblemUpdateOne) AddTagIDs(ids ...int64) *ProblemUpdateOne

AddTagIDs adds the "tags" edge to the Tag entity by IDs.

func (*ProblemUpdateOne) AddTags

func (puo *ProblemUpdateOne) AddTags(t ...*Tag) *ProblemUpdateOne

AddTags adds the "tags" edges to the Tag entity.

func (*ProblemUpdateOne) ClearAuthor

func (puo *ProblemUpdateOne) ClearAuthor() *ProblemUpdateOne

ClearAuthor clears the "author" edge to the User entity.

func (*ProblemUpdateOne) ClearSolvedBy

func (puo *ProblemUpdateOne) ClearSolvedBy() *ProblemUpdateOne

ClearSolvedBy clears all "solved_by" edges to the User entity.

func (*ProblemUpdateOne) ClearTags

func (puo *ProblemUpdateOne) ClearTags() *ProblemUpdateOne

ClearTags clears all "tags" edges to the Tag entity.

func (*ProblemUpdateOne) Exec

func (puo *ProblemUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*ProblemUpdateOne) ExecX

func (puo *ProblemUpdateOne) ExecX(ctx context.Context)

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

func (*ProblemUpdateOne) Mutation

func (puo *ProblemUpdateOne) Mutation() *ProblemMutation

Mutation returns the ProblemMutation object of the builder.

func (*ProblemUpdateOne) RemoveSolvedBy

func (puo *ProblemUpdateOne) RemoveSolvedBy(u ...*User) *ProblemUpdateOne

RemoveSolvedBy removes "solved_by" edges to User entities.

func (*ProblemUpdateOne) RemoveSolvedByIDs

func (puo *ProblemUpdateOne) RemoveSolvedByIDs(ids ...int64) *ProblemUpdateOne

RemoveSolvedByIDs removes the "solved_by" edge to User entities by IDs.

func (*ProblemUpdateOne) RemoveTagIDs

func (puo *ProblemUpdateOne) RemoveTagIDs(ids ...int64) *ProblemUpdateOne

RemoveTagIDs removes the "tags" edge to Tag entities by IDs.

func (*ProblemUpdateOne) RemoveTags

func (puo *ProblemUpdateOne) RemoveTags(t ...*Tag) *ProblemUpdateOne

RemoveTags removes "tags" edges to Tag entities.

func (*ProblemUpdateOne) Save

func (puo *ProblemUpdateOne) Save(ctx context.Context) (*Problem, error)

Save executes the query and returns the updated Problem entity.

func (*ProblemUpdateOne) SaveX

func (puo *ProblemUpdateOne) SaveX(ctx context.Context) *Problem

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

func (*ProblemUpdateOne) Select

func (puo *ProblemUpdateOne) Select(field string, fields ...string) *ProblemUpdateOne

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

func (*ProblemUpdateOne) SetAuthor

func (puo *ProblemUpdateOne) SetAuthor(u *User) *ProblemUpdateOne

SetAuthor sets the "author" edge to the User entity.

func (*ProblemUpdateOne) SetAuthorID

func (puo *ProblemUpdateOne) SetAuthorID(id int64) *ProblemUpdateOne

SetAuthorID sets the "author" edge to the User entity by ID.

func (*ProblemUpdateOne) SetContent

func (puo *ProblemUpdateOne) SetContent(s string) *ProblemUpdateOne

SetContent sets the "content" field.

func (*ProblemUpdateOne) SetNillableAuthorID

func (puo *ProblemUpdateOne) SetNillableAuthorID(id *int64) *ProblemUpdateOne

SetNillableAuthorID sets the "author" edge to the User entity by ID if the given value is not nil.

func (*ProblemUpdateOne) SetTitle

func (puo *ProblemUpdateOne) SetTitle(s string) *ProblemUpdateOne

SetTitle sets the "title" field.

type ProblemWhereInput

type ProblemWhereInput struct {
	Not *ProblemWhereInput   `json:"not,omitempty"`
	Or  []*ProblemWhereInput `json:"or,omitempty"`
	And []*ProblemWhereInput `json:"and,omitempty"`

	// "id" field predicates.
	ID      *int64  `json:"id,omitempty"`
	IDNEQ   *int64  `json:"idNEQ,omitempty"`
	IDIn    []int64 `json:"idIn,omitempty"`
	IDNotIn []int64 `json:"idNotIn,omitempty"`
	IDGT    *int64  `json:"idGT,omitempty"`
	IDGTE   *int64  `json:"idGTE,omitempty"`
	IDLT    *int64  `json:"idLT,omitempty"`
	IDLTE   *int64  `json:"idLTE,omitempty"`

	// "title" field predicates.
	Title             *string  `json:"title,omitempty"`
	TitleNEQ          *string  `json:"titleNEQ,omitempty"`
	TitleIn           []string `json:"titleIn,omitempty"`
	TitleNotIn        []string `json:"titleNotIn,omitempty"`
	TitleGT           *string  `json:"titleGT,omitempty"`
	TitleGTE          *string  `json:"titleGTE,omitempty"`
	TitleLT           *string  `json:"titleLT,omitempty"`
	TitleLTE          *string  `json:"titleLTE,omitempty"`
	TitleContains     *string  `json:"titleContains,omitempty"`
	TitleHasPrefix    *string  `json:"titleHasPrefix,omitempty"`
	TitleHasSuffix    *string  `json:"titleHasSuffix,omitempty"`
	TitleEqualFold    *string  `json:"titleEqualFold,omitempty"`
	TitleContainsFold *string  `json:"titleContainsFold,omitempty"`

	// "content" field predicates.
	Content             *string  `json:"content,omitempty"`
	ContentNEQ          *string  `json:"contentNEQ,omitempty"`
	ContentIn           []string `json:"contentIn,omitempty"`
	ContentNotIn        []string `json:"contentNotIn,omitempty"`
	ContentGT           *string  `json:"contentGT,omitempty"`
	ContentGTE          *string  `json:"contentGTE,omitempty"`
	ContentLT           *string  `json:"contentLT,omitempty"`
	ContentLTE          *string  `json:"contentLTE,omitempty"`
	ContentContains     *string  `json:"contentContains,omitempty"`
	ContentHasPrefix    *string  `json:"contentHasPrefix,omitempty"`
	ContentHasSuffix    *string  `json:"contentHasSuffix,omitempty"`
	ContentEqualFold    *string  `json:"contentEqualFold,omitempty"`
	ContentContainsFold *string  `json:"contentContainsFold,omitempty"`

	// "created_time" field predicates.
	CreatedTime      *time.Time  `json:"createdTime,omitempty"`
	CreatedTimeNEQ   *time.Time  `json:"createdTimeNEQ,omitempty"`
	CreatedTimeIn    []time.Time `json:"createdTimeIn,omitempty"`
	CreatedTimeNotIn []time.Time `json:"createdTimeNotIn,omitempty"`
	CreatedTimeGT    *time.Time  `json:"createdTimeGT,omitempty"`
	CreatedTimeGTE   *time.Time  `json:"createdTimeGTE,omitempty"`
	CreatedTimeLT    *time.Time  `json:"createdTimeLT,omitempty"`
	CreatedTimeLTE   *time.Time  `json:"createdTimeLTE,omitempty"`

	// "author" edge predicates.
	HasAuthor     *bool             `json:"hasAuthor,omitempty"`
	HasAuthorWith []*UserWhereInput `json:"hasAuthorWith,omitempty"`

	// "solved_by" edge predicates.
	HasSolvedBy     *bool             `json:"hasSolvedBy,omitempty"`
	HasSolvedByWith []*UserWhereInput `json:"hasSolvedByWith,omitempty"`

	// "tags" edge predicates.
	HasTags     *bool            `json:"hasTags,omitempty"`
	HasTagsWith []*TagWhereInput `json:"hasTagsWith,omitempty"`
}

ProblemWhereInput represents a where input for filtering Problem queries.

func (*ProblemWhereInput) Filter

Filter applies the ProblemWhereInput filter on the ProblemQuery builder.

func (*ProblemWhereInput) P

P returns a predicate for filtering problems. An error is returned if the input is empty or invalid.

type Problems

type Problems []*Problem

Problems is a parsable slice of Problem.

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(ctx context.Context, tx *ent.Tx) error {
		// Do some stuff before.
		if err := next.Rollback(ctx, tx); err != nil {
			return err
		}
		// Do some stuff after.
		return nil
	})
}

type Rollbacker

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

Rollbacker is the interface that wraps the Rollback method.

type Tag

type Tag struct {

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

Tag is the model entity for the Tag schema.

func (*Tag) Node

func (t *Tag) Node(ctx context.Context) (node *Node, err error)

func (*Tag) Problems

func (t *Tag) Problems(ctx context.Context) ([]*Problem, error)

func (*Tag) QueryProblems

func (t *Tag) QueryProblems() *ProblemQuery

QueryProblems queries the "problems" edge of the Tag entity.

func (*Tag) String

func (t *Tag) String() string

String implements the fmt.Stringer.

func (*Tag) ToEdge

func (t *Tag) ToEdge(order *TagOrder) *TagEdge

ToEdge converts Tag into TagEdge.

func (*Tag) Unwrap

func (t *Tag) Unwrap() *Tag

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

func (t *Tag) Update() *TagUpdateOne

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

type TagClient

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

TagClient is a client for the Tag schema.

func NewTagClient

func NewTagClient(c config) *TagClient

NewTagClient returns a client for the Tag from the given config.

func (*TagClient) Create

func (c *TagClient) Create() *TagCreate

Create returns a create builder for Tag.

func (*TagClient) CreateBulk

func (c *TagClient) CreateBulk(builders ...*TagCreate) *TagCreateBulk

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

func (*TagClient) Delete

func (c *TagClient) Delete() *TagDelete

Delete returns a delete builder for Tag.

func (*TagClient) DeleteOne

func (c *TagClient) DeleteOne(t *Tag) *TagDeleteOne

DeleteOne returns a delete builder for the given entity.

func (*TagClient) DeleteOneID

func (c *TagClient) DeleteOneID(id int64) *TagDeleteOne

DeleteOneID returns a delete builder for the given id.

func (*TagClient) Get

func (c *TagClient) Get(ctx context.Context, id int64) (*Tag, error)

Get returns a Tag entity by its id.

func (*TagClient) GetX

func (c *TagClient) GetX(ctx context.Context, id int64) *Tag

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

func (*TagClient) Hooks

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

Hooks returns the client hooks.

func (*TagClient) Query

func (c *TagClient) Query() *TagQuery

Query returns a query builder for Tag.

func (*TagClient) QueryProblems

func (c *TagClient) QueryProblems(t *Tag) *ProblemQuery

QueryProblems queries the problems edge of a Tag.

func (*TagClient) Update

func (c *TagClient) Update() *TagUpdate

Update returns an update builder for Tag.

func (*TagClient) UpdateOne

func (c *TagClient) UpdateOne(t *Tag) *TagUpdateOne

UpdateOne returns an update builder for the given entity.

func (*TagClient) UpdateOneID

func (c *TagClient) UpdateOneID(id int64) *TagUpdateOne

UpdateOneID returns an update builder for the given id.

func (*TagClient) Use

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

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

type TagConnection

type TagConnection struct {
	Edges      []*TagEdge `json:"edges"`
	PageInfo   PageInfo   `json:"pageInfo"`
	TotalCount int        `json:"totalCount"`
}

TagConnection is the connection containing edges to Tag.

type TagCreate

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

TagCreate is the builder for creating a Tag entity.

func (*TagCreate) AddProblemIDs

func (tc *TagCreate) AddProblemIDs(ids ...int64) *TagCreate

AddProblemIDs adds the "problems" edge to the Problem entity by IDs.

func (*TagCreate) AddProblems

func (tc *TagCreate) AddProblems(p ...*Problem) *TagCreate

AddProblems adds the "problems" edges to the Problem entity.

func (*TagCreate) Exec

func (tc *TagCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*TagCreate) ExecX

func (tc *TagCreate) ExecX(ctx context.Context)

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

func (*TagCreate) Mutation

func (tc *TagCreate) Mutation() *TagMutation

Mutation returns the TagMutation object of the builder.

func (*TagCreate) Save

func (tc *TagCreate) Save(ctx context.Context) (*Tag, error)

Save creates the Tag in the database.

func (*TagCreate) SaveX

func (tc *TagCreate) SaveX(ctx context.Context) *Tag

SaveX calls Save and panics if Save returns an error.

func (*TagCreate) SetCreatedTime

func (tc *TagCreate) SetCreatedTime(t time.Time) *TagCreate

SetCreatedTime sets the "created_time" field.

func (*TagCreate) SetID

func (tc *TagCreate) SetID(i int64) *TagCreate

SetID sets the "id" field.

func (*TagCreate) SetName

func (tc *TagCreate) SetName(s string) *TagCreate

SetName sets the "name" field.

func (*TagCreate) SetNillableCreatedTime

func (tc *TagCreate) SetNillableCreatedTime(t *time.Time) *TagCreate

SetNillableCreatedTime sets the "created_time" field if the given value is not nil.

type TagCreateBulk

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

TagCreateBulk is the builder for creating many Tag entities in bulk.

func (*TagCreateBulk) Exec

func (tcb *TagCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*TagCreateBulk) ExecX

func (tcb *TagCreateBulk) ExecX(ctx context.Context)

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

func (*TagCreateBulk) Save

func (tcb *TagCreateBulk) Save(ctx context.Context) ([]*Tag, error)

Save creates the Tag entities in the database.

func (*TagCreateBulk) SaveX

func (tcb *TagCreateBulk) SaveX(ctx context.Context) []*Tag

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

type TagDelete

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

TagDelete is the builder for deleting a Tag entity.

func (*TagDelete) Exec

func (td *TagDelete) Exec(ctx context.Context) (int, error)

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

func (*TagDelete) ExecX

func (td *TagDelete) ExecX(ctx context.Context) int

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

func (*TagDelete) Where

func (td *TagDelete) Where(ps ...predicate.Tag) *TagDelete

Where appends a list predicates to the TagDelete builder.

type TagDeleteOne

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

TagDeleteOne is the builder for deleting a single Tag entity.

func (*TagDeleteOne) Exec

func (tdo *TagDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*TagDeleteOne) ExecX

func (tdo *TagDeleteOne) ExecX(ctx context.Context)

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

type TagEdge

type TagEdge struct {
	Node   *Tag   `json:"node"`
	Cursor Cursor `json:"cursor"`
}

TagEdge is the edge representation of Tag.

type TagEdges

type TagEdges struct {
	// Problems holds the value of the problems edge.
	Problems []*Problem `json:"problems,omitempty"`
	// contains filtered or unexported fields
}

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

func (TagEdges) ProblemsOrErr

func (e TagEdges) ProblemsOrErr() ([]*Problem, error)

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

type TagGroupBy

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

TagGroupBy is the group-by builder for Tag entities.

func (*TagGroupBy) Aggregate

func (tgb *TagGroupBy) Aggregate(fns ...AggregateFunc) *TagGroupBy

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

func (*TagGroupBy) Bool

func (tgb *TagGroupBy) Bool(ctx context.Context) (_ bool, err error)

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

func (*TagGroupBy) BoolX

func (tgb *TagGroupBy) BoolX(ctx context.Context) bool

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

func (*TagGroupBy) Bools

func (tgb *TagGroupBy) Bools(ctx context.Context) ([]bool, error)

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

func (*TagGroupBy) BoolsX

func (tgb *TagGroupBy) BoolsX(ctx context.Context) []bool

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

func (*TagGroupBy) Float64

func (tgb *TagGroupBy) Float64(ctx context.Context) (_ float64, err error)

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

func (*TagGroupBy) Float64X

func (tgb *TagGroupBy) Float64X(ctx context.Context) float64

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

func (*TagGroupBy) Float64s

func (tgb *TagGroupBy) Float64s(ctx context.Context) ([]float64, error)

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

func (*TagGroupBy) Float64sX

func (tgb *TagGroupBy) Float64sX(ctx context.Context) []float64

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

func (*TagGroupBy) Int

func (tgb *TagGroupBy) Int(ctx context.Context) (_ int, err error)

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

func (*TagGroupBy) IntX

func (tgb *TagGroupBy) IntX(ctx context.Context) int

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

func (*TagGroupBy) Ints

func (tgb *TagGroupBy) Ints(ctx context.Context) ([]int, error)

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

func (*TagGroupBy) IntsX

func (tgb *TagGroupBy) IntsX(ctx context.Context) []int

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

func (*TagGroupBy) Scan

func (tgb *TagGroupBy) Scan(ctx context.Context, v interface{}) error

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

func (*TagGroupBy) ScanX

func (tgb *TagGroupBy) ScanX(ctx context.Context, v interface{})

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

func (*TagGroupBy) String

func (tgb *TagGroupBy) String(ctx context.Context) (_ string, err error)

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

func (*TagGroupBy) StringX

func (tgb *TagGroupBy) StringX(ctx context.Context) string

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

func (*TagGroupBy) Strings

func (tgb *TagGroupBy) Strings(ctx context.Context) ([]string, error)

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

func (*TagGroupBy) StringsX

func (tgb *TagGroupBy) StringsX(ctx context.Context) []string

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

type TagMutation

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

TagMutation represents an operation that mutates the Tag nodes in the graph.

func (*TagMutation) AddField

func (m *TagMutation) 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 (*TagMutation) AddProblemIDs

func (m *TagMutation) AddProblemIDs(ids ...int64)

AddProblemIDs adds the "problems" edge to the Problem entity by ids.

func (*TagMutation) AddedEdges

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

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

func (*TagMutation) AddedField

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

AddedField returns the numeric value that was 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 (*TagMutation) AddedFields

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

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

func (*TagMutation) AddedIDs

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

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

func (*TagMutation) ClearEdge

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

func (m *TagMutation) 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 (*TagMutation) ClearProblems

func (m *TagMutation) ClearProblems()

ClearProblems clears the "problems" edge to the Problem entity.

func (*TagMutation) ClearedEdges

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

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

func (*TagMutation) ClearedFields

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

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

func (TagMutation) Client

func (m TagMutation) Client() *Client

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

func (*TagMutation) CreatedTime

func (m *TagMutation) CreatedTime() (r time.Time, exists bool)

CreatedTime returns the value of the "created_time" field in the mutation.

func (*TagMutation) EdgeCleared

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

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

func (*TagMutation) Field

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

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

func (*TagMutation) FieldCleared

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

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

func (*TagMutation) Fields

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

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

func (*TagMutation) ID

func (m *TagMutation) ID() (id int64, exists bool)

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

func (*TagMutation) IDs

func (m *TagMutation) IDs(ctx context.Context) ([]int64, error)

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

func (*TagMutation) Name

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

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

func (*TagMutation) OldCreatedTime

func (m *TagMutation) OldCreatedTime(ctx context.Context) (v time.Time, err error)

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

func (*TagMutation) OldField

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

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

func (*TagMutation) OldName

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

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

func (*TagMutation) Op

func (m *TagMutation) Op() Op

Op returns the operation name.

func (*TagMutation) ProblemsCleared

func (m *TagMutation) ProblemsCleared() bool

ProblemsCleared reports if the "problems" edge to the Problem entity was cleared.

func (*TagMutation) ProblemsIDs

func (m *TagMutation) ProblemsIDs() (ids []int64)

ProblemsIDs returns the "problems" edge IDs in the mutation.

func (*TagMutation) RemoveProblemIDs

func (m *TagMutation) RemoveProblemIDs(ids ...int64)

RemoveProblemIDs removes the "problems" edge to the Problem entity by IDs.

func (*TagMutation) RemovedEdges

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

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

func (*TagMutation) RemovedIDs

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

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

func (*TagMutation) RemovedProblemsIDs

func (m *TagMutation) RemovedProblemsIDs() (ids []int64)

RemovedProblems returns the removed IDs of the "problems" edge to the Problem entity.

func (*TagMutation) ResetCreatedTime

func (m *TagMutation) ResetCreatedTime()

ResetCreatedTime resets all changes to the "created_time" field.

func (*TagMutation) ResetEdge

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

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

func (m *TagMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*TagMutation) ResetProblems

func (m *TagMutation) ResetProblems()

ResetProblems resets all changes to the "problems" edge.

func (*TagMutation) SetCreatedTime

func (m *TagMutation) SetCreatedTime(t time.Time)

SetCreatedTime sets the "created_time" field.

func (*TagMutation) SetField

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

func (m *TagMutation) SetID(id int64)

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

func (*TagMutation) SetName

func (m *TagMutation) SetName(s string)

SetName sets the "name" field.

func (TagMutation) Tx

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

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

func (*TagMutation) Type

func (m *TagMutation) Type() string

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

func (*TagMutation) Where

func (m *TagMutation) Where(ps ...predicate.Tag)

Where appends a list predicates to the TagMutation builder.

type TagOrder

type TagOrder struct {
	Direction OrderDirection `json:"direction"`
	Field     *TagOrderField `json:"field"`
}

TagOrder defines the ordering of Tag.

type TagOrderField

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

TagOrderField defines the ordering field of Tag.

type TagPaginateOption

type TagPaginateOption func(*tagPager) error

TagPaginateOption enables pagination customization.

func WithTagFilter

func WithTagFilter(filter func(*TagQuery) (*TagQuery, error)) TagPaginateOption

WithTagFilter configures pagination filter.

func WithTagOrder

func WithTagOrder(order *TagOrder) TagPaginateOption

WithTagOrder configures pagination ordering.

type TagQuery

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

TagQuery is the builder for querying Tag entities.

func (*TagQuery) All

func (tq *TagQuery) All(ctx context.Context) ([]*Tag, error)

All executes the query and returns a list of Tags.

func (*TagQuery) AllX

func (tq *TagQuery) AllX(ctx context.Context) []*Tag

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

func (*TagQuery) Clone

func (tq *TagQuery) Clone() *TagQuery

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

func (*TagQuery) CollectFields

func (t *TagQuery) CollectFields(ctx context.Context, satisfies ...string) *TagQuery

CollectFields tells the query-builder to eagerly load connected nodes by resolver context.

func (*TagQuery) Count

func (tq *TagQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*TagQuery) CountX

func (tq *TagQuery) CountX(ctx context.Context) int

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

func (*TagQuery) Exist

func (tq *TagQuery) Exist(ctx context.Context) (bool, error)

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

func (*TagQuery) ExistX

func (tq *TagQuery) ExistX(ctx context.Context) bool

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

func (*TagQuery) First

func (tq *TagQuery) First(ctx context.Context) (*Tag, error)

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

func (*TagQuery) FirstID

func (tq *TagQuery) FirstID(ctx context.Context) (id int64, err error)

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

func (*TagQuery) FirstIDX

func (tq *TagQuery) FirstIDX(ctx context.Context) int64

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

func (*TagQuery) FirstX

func (tq *TagQuery) FirstX(ctx context.Context) *Tag

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

func (*TagQuery) GroupBy

func (tq *TagQuery) GroupBy(field string, fields ...string) *TagGroupBy

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

func (*TagQuery) IDs

func (tq *TagQuery) IDs(ctx context.Context) ([]int64, error)

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

func (*TagQuery) IDsX

func (tq *TagQuery) IDsX(ctx context.Context) []int64

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

func (*TagQuery) Limit

func (tq *TagQuery) Limit(limit int) *TagQuery

Limit adds a limit step to the query.

func (*TagQuery) Offset

func (tq *TagQuery) Offset(offset int) *TagQuery

Offset adds an offset step to the query.

func (*TagQuery) Only

func (tq *TagQuery) Only(ctx context.Context) (*Tag, error)

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

func (*TagQuery) OnlyID

func (tq *TagQuery) OnlyID(ctx context.Context) (id int64, err error)

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

func (*TagQuery) OnlyIDX

func (tq *TagQuery) OnlyIDX(ctx context.Context) int64

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

func (*TagQuery) OnlyX

func (tq *TagQuery) OnlyX(ctx context.Context) *Tag

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

func (*TagQuery) Order

func (tq *TagQuery) Order(o ...OrderFunc) *TagQuery

Order adds an order step to the query.

func (*TagQuery) Paginate

func (t *TagQuery) Paginate(
	ctx context.Context, after *Cursor, first *int,
	before *Cursor, last *int, opts ...TagPaginateOption,
) (*TagConnection, error)

Paginate executes the query and returns a relay based cursor connection to Tag.

func (*TagQuery) QueryProblems

func (tq *TagQuery) QueryProblems() *ProblemQuery

QueryProblems chains the current query on the "problems" edge.

func (*TagQuery) Select

func (tq *TagQuery) Select(fields ...string) *TagSelect

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

func (*TagQuery) Unique

func (tq *TagQuery) Unique(unique bool) *TagQuery

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

func (tq *TagQuery) Where(ps ...predicate.Tag) *TagQuery

Where adds a new predicate for the TagQuery builder.

func (*TagQuery) WithProblems

func (tq *TagQuery) WithProblems(opts ...func(*ProblemQuery)) *TagQuery

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

type TagSelect

type TagSelect struct {
	*TagQuery
	// contains filtered or unexported fields
}

TagSelect is the builder for selecting fields of Tag entities.

func (*TagSelect) Bool

func (ts *TagSelect) Bool(ctx context.Context) (_ bool, err error)

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

func (*TagSelect) BoolX

func (ts *TagSelect) BoolX(ctx context.Context) bool

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

func (*TagSelect) Bools

func (ts *TagSelect) Bools(ctx context.Context) ([]bool, error)

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

func (*TagSelect) BoolsX

func (ts *TagSelect) BoolsX(ctx context.Context) []bool

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

func (*TagSelect) Float64

func (ts *TagSelect) Float64(ctx context.Context) (_ float64, err error)

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

func (*TagSelect) Float64X

func (ts *TagSelect) Float64X(ctx context.Context) float64

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

func (*TagSelect) Float64s

func (ts *TagSelect) Float64s(ctx context.Context) ([]float64, error)

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

func (*TagSelect) Float64sX

func (ts *TagSelect) Float64sX(ctx context.Context) []float64

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

func (*TagSelect) Int

func (ts *TagSelect) Int(ctx context.Context) (_ int, err error)

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

func (*TagSelect) IntX

func (ts *TagSelect) IntX(ctx context.Context) int

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

func (*TagSelect) Ints

func (ts *TagSelect) Ints(ctx context.Context) ([]int, error)

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

func (*TagSelect) IntsX

func (ts *TagSelect) IntsX(ctx context.Context) []int

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

func (*TagSelect) Scan

func (ts *TagSelect) Scan(ctx context.Context, v interface{}) error

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

func (*TagSelect) ScanX

func (ts *TagSelect) ScanX(ctx context.Context, v interface{})

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

func (*TagSelect) String

func (ts *TagSelect) String(ctx context.Context) (_ string, err error)

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

func (*TagSelect) StringX

func (ts *TagSelect) StringX(ctx context.Context) string

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

func (*TagSelect) Strings

func (ts *TagSelect) Strings(ctx context.Context) ([]string, error)

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

func (*TagSelect) StringsX

func (ts *TagSelect) StringsX(ctx context.Context) []string

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

type TagUpdate

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

TagUpdate is the builder for updating Tag entities.

func (*TagUpdate) AddProblemIDs

func (tu *TagUpdate) AddProblemIDs(ids ...int64) *TagUpdate

AddProblemIDs adds the "problems" edge to the Problem entity by IDs.

func (*TagUpdate) AddProblems

func (tu *TagUpdate) AddProblems(p ...*Problem) *TagUpdate

AddProblems adds the "problems" edges to the Problem entity.

func (*TagUpdate) ClearProblems

func (tu *TagUpdate) ClearProblems() *TagUpdate

ClearProblems clears all "problems" edges to the Problem entity.

func (*TagUpdate) Exec

func (tu *TagUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*TagUpdate) ExecX

func (tu *TagUpdate) ExecX(ctx context.Context)

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

func (*TagUpdate) Mutation

func (tu *TagUpdate) Mutation() *TagMutation

Mutation returns the TagMutation object of the builder.

func (*TagUpdate) RemoveProblemIDs

func (tu *TagUpdate) RemoveProblemIDs(ids ...int64) *TagUpdate

RemoveProblemIDs removes the "problems" edge to Problem entities by IDs.

func (*TagUpdate) RemoveProblems

func (tu *TagUpdate) RemoveProblems(p ...*Problem) *TagUpdate

RemoveProblems removes "problems" edges to Problem entities.

func (*TagUpdate) Save

func (tu *TagUpdate) Save(ctx context.Context) (int, error)

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

func (*TagUpdate) SaveX

func (tu *TagUpdate) SaveX(ctx context.Context) int

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

func (*TagUpdate) SetName

func (tu *TagUpdate) SetName(s string) *TagUpdate

SetName sets the "name" field.

func (*TagUpdate) Where

func (tu *TagUpdate) Where(ps ...predicate.Tag) *TagUpdate

Where appends a list predicates to the TagUpdate builder.

type TagUpdateOne

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

TagUpdateOne is the builder for updating a single Tag entity.

func (*TagUpdateOne) AddProblemIDs

func (tuo *TagUpdateOne) AddProblemIDs(ids ...int64) *TagUpdateOne

AddProblemIDs adds the "problems" edge to the Problem entity by IDs.

func (*TagUpdateOne) AddProblems

func (tuo *TagUpdateOne) AddProblems(p ...*Problem) *TagUpdateOne

AddProblems adds the "problems" edges to the Problem entity.

func (*TagUpdateOne) ClearProblems

func (tuo *TagUpdateOne) ClearProblems() *TagUpdateOne

ClearProblems clears all "problems" edges to the Problem entity.

func (*TagUpdateOne) Exec

func (tuo *TagUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*TagUpdateOne) ExecX

func (tuo *TagUpdateOne) ExecX(ctx context.Context)

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

func (*TagUpdateOne) Mutation

func (tuo *TagUpdateOne) Mutation() *TagMutation

Mutation returns the TagMutation object of the builder.

func (*TagUpdateOne) RemoveProblemIDs

func (tuo *TagUpdateOne) RemoveProblemIDs(ids ...int64) *TagUpdateOne

RemoveProblemIDs removes the "problems" edge to Problem entities by IDs.

func (*TagUpdateOne) RemoveProblems

func (tuo *TagUpdateOne) RemoveProblems(p ...*Problem) *TagUpdateOne

RemoveProblems removes "problems" edges to Problem entities.

func (*TagUpdateOne) Save

func (tuo *TagUpdateOne) Save(ctx context.Context) (*Tag, error)

Save executes the query and returns the updated Tag entity.

func (*TagUpdateOne) SaveX

func (tuo *TagUpdateOne) SaveX(ctx context.Context) *Tag

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

func (*TagUpdateOne) Select

func (tuo *TagUpdateOne) Select(field string, fields ...string) *TagUpdateOne

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

func (*TagUpdateOne) SetName

func (tuo *TagUpdateOne) SetName(s string) *TagUpdateOne

SetName sets the "name" field.

type TagWhereInput

type TagWhereInput struct {
	Not *TagWhereInput   `json:"not,omitempty"`
	Or  []*TagWhereInput `json:"or,omitempty"`
	And []*TagWhereInput `json:"and,omitempty"`

	// "id" field predicates.
	ID      *int64  `json:"id,omitempty"`
	IDNEQ   *int64  `json:"idNEQ,omitempty"`
	IDIn    []int64 `json:"idIn,omitempty"`
	IDNotIn []int64 `json:"idNotIn,omitempty"`
	IDGT    *int64  `json:"idGT,omitempty"`
	IDGTE   *int64  `json:"idGTE,omitempty"`
	IDLT    *int64  `json:"idLT,omitempty"`
	IDLTE   *int64  `json:"idLTE,omitempty"`

	// "name" field predicates.
	Name             *string  `json:"name,omitempty"`
	NameNEQ          *string  `json:"nameNEQ,omitempty"`
	NameIn           []string `json:"nameIn,omitempty"`
	NameNotIn        []string `json:"nameNotIn,omitempty"`
	NameGT           *string  `json:"nameGT,omitempty"`
	NameGTE          *string  `json:"nameGTE,omitempty"`
	NameLT           *string  `json:"nameLT,omitempty"`
	NameLTE          *string  `json:"nameLTE,omitempty"`
	NameContains     *string  `json:"nameContains,omitempty"`
	NameHasPrefix    *string  `json:"nameHasPrefix,omitempty"`
	NameHasSuffix    *string  `json:"nameHasSuffix,omitempty"`
	NameEqualFold    *string  `json:"nameEqualFold,omitempty"`
	NameContainsFold *string  `json:"nameContainsFold,omitempty"`

	// "created_time" field predicates.
	CreatedTime      *time.Time  `json:"createdTime,omitempty"`
	CreatedTimeNEQ   *time.Time  `json:"createdTimeNEQ,omitempty"`
	CreatedTimeIn    []time.Time `json:"createdTimeIn,omitempty"`
	CreatedTimeNotIn []time.Time `json:"createdTimeNotIn,omitempty"`
	CreatedTimeGT    *time.Time  `json:"createdTimeGT,omitempty"`
	CreatedTimeGTE   *time.Time  `json:"createdTimeGTE,omitempty"`
	CreatedTimeLT    *time.Time  `json:"createdTimeLT,omitempty"`
	CreatedTimeLTE   *time.Time  `json:"createdTimeLTE,omitempty"`

	// "problems" edge predicates.
	HasProblems     *bool                `json:"hasProblems,omitempty"`
	HasProblemsWith []*ProblemWhereInput `json:"hasProblemsWith,omitempty"`
}

TagWhereInput represents a where input for filtering Tag queries.

func (*TagWhereInput) Filter

func (i *TagWhereInput) Filter(q *TagQuery) (*TagQuery, error)

Filter applies the TagWhereInput filter on the TagQuery builder.

func (*TagWhereInput) P

func (i *TagWhereInput) P() (predicate.Tag, error)

P returns a predicate for filtering tags. An error is returned if the input is empty or invalid.

type Tags

type Tags []*Tag

Tags is a parsable slice of Tag.

type Team

type Team struct {

	// ID of the ent.
	ID int64 `json:"id,omitempty"`
	// Name holds the value of the "name" field.
	Name string `json:"name,omitempty"`
	// Description holds the value of the "description" field.
	Description string `json:"description,omitempty"`
	// CreatedTime holds the value of the "created_time" field.
	CreatedTime time.Time `json:"created_time,omitempty"`
	// Private holds the value of the "private" field.
	Private bool `json:"private,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the TeamQuery when eager-loading is set.
	Edges TeamEdges `json:"edges"`
	// contains filtered or unexported fields
}

Team is the model entity for the Team schema.

func (*Team) Admins

func (t *Team) Admins(ctx context.Context) ([]*User, error)

func (*Team) Announcements

func (t *Team) Announcements(ctx context.Context) ([]*Announcement, error)

func (*Team) Creator

func (t *Team) Creator(ctx context.Context) (*User, error)

func (*Team) Members

func (t *Team) Members(ctx context.Context) ([]*User, error)

func (*Team) Node

func (t *Team) Node(ctx context.Context) (node *Node, err error)

func (*Team) QueryAdmins

func (t *Team) QueryAdmins() *UserQuery

QueryAdmins queries the "admins" edge of the Team entity.

func (*Team) QueryAnnouncements

func (t *Team) QueryAnnouncements() *AnnouncementQuery

QueryAnnouncements queries the "announcements" edge of the Team entity.

func (*Team) QueryCreator

func (t *Team) QueryCreator() *UserQuery

QueryCreator queries the "creator" edge of the Team entity.

func (*Team) QueryMembers

func (t *Team) QueryMembers() *UserQuery

QueryMembers queries the "members" edge of the Team entity.

func (*Team) String

func (t *Team) String() string

String implements the fmt.Stringer.

func (*Team) ToEdge

func (t *Team) ToEdge(order *TeamOrder) *TeamEdge

ToEdge converts Team into TeamEdge.

func (*Team) Unwrap

func (t *Team) Unwrap() *Team

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

func (t *Team) Update() *TeamUpdateOne

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

type TeamClient

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

TeamClient is a client for the Team schema.

func NewTeamClient

func NewTeamClient(c config) *TeamClient

NewTeamClient returns a client for the Team from the given config.

func (*TeamClient) Create

func (c *TeamClient) Create() *TeamCreate

Create returns a create builder for Team.

func (*TeamClient) CreateBulk

func (c *TeamClient) CreateBulk(builders ...*TeamCreate) *TeamCreateBulk

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

func (*TeamClient) Delete

func (c *TeamClient) Delete() *TeamDelete

Delete returns a delete builder for Team.

func (*TeamClient) DeleteOne

func (c *TeamClient) DeleteOne(t *Team) *TeamDeleteOne

DeleteOne returns a delete builder for the given entity.

func (*TeamClient) DeleteOneID

func (c *TeamClient) DeleteOneID(id int64) *TeamDeleteOne

DeleteOneID returns a delete builder for the given id.

func (*TeamClient) Get

func (c *TeamClient) Get(ctx context.Context, id int64) (*Team, error)

Get returns a Team entity by its id.

func (*TeamClient) GetX

func (c *TeamClient) GetX(ctx context.Context, id int64) *Team

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

func (*TeamClient) Hooks

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

Hooks returns the client hooks.

func (*TeamClient) Query

func (c *TeamClient) Query() *TeamQuery

Query returns a query builder for Team.

func (*TeamClient) QueryAdmins

func (c *TeamClient) QueryAdmins(t *Team) *UserQuery

QueryAdmins queries the admins edge of a Team.

func (*TeamClient) QueryAnnouncements

func (c *TeamClient) QueryAnnouncements(t *Team) *AnnouncementQuery

QueryAnnouncements queries the announcements edge of a Team.

func (*TeamClient) QueryCreator

func (c *TeamClient) QueryCreator(t *Team) *UserQuery

QueryCreator queries the creator edge of a Team.

func (*TeamClient) QueryMembers

func (c *TeamClient) QueryMembers(t *Team) *UserQuery

QueryMembers queries the members edge of a Team.

func (*TeamClient) Update

func (c *TeamClient) Update() *TeamUpdate

Update returns an update builder for Team.

func (*TeamClient) UpdateOne

func (c *TeamClient) UpdateOne(t *Team) *TeamUpdateOne

UpdateOne returns an update builder for the given entity.

func (*TeamClient) UpdateOneID

func (c *TeamClient) UpdateOneID(id int64) *TeamUpdateOne

UpdateOneID returns an update builder for the given id.

func (*TeamClient) Use

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

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

type TeamConnection

type TeamConnection struct {
	Edges      []*TeamEdge `json:"edges"`
	PageInfo   PageInfo    `json:"pageInfo"`
	TotalCount int         `json:"totalCount"`
}

TeamConnection is the connection containing edges to Team.

type TeamCreate

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

TeamCreate is the builder for creating a Team entity.

func (*TeamCreate) AddAdminIDs

func (tc *TeamCreate) AddAdminIDs(ids ...int64) *TeamCreate

AddAdminIDs adds the "admins" edge to the User entity by IDs.

func (*TeamCreate) AddAdmins

func (tc *TeamCreate) AddAdmins(u ...*User) *TeamCreate

AddAdmins adds the "admins" edges to the User entity.

func (*TeamCreate) AddAnnouncementIDs

func (tc *TeamCreate) AddAnnouncementIDs(ids ...int64) *TeamCreate

AddAnnouncementIDs adds the "announcements" edge to the Announcement entity by IDs.

func (*TeamCreate) AddAnnouncements

func (tc *TeamCreate) AddAnnouncements(a ...*Announcement) *TeamCreate

AddAnnouncements adds the "announcements" edges to the Announcement entity.

func (*TeamCreate) AddMemberIDs

func (tc *TeamCreate) AddMemberIDs(ids ...int64) *TeamCreate

AddMemberIDs adds the "members" edge to the User entity by IDs.

func (*TeamCreate) AddMembers

func (tc *TeamCreate) AddMembers(u ...*User) *TeamCreate

AddMembers adds the "members" edges to the User entity.

func (*TeamCreate) Exec

func (tc *TeamCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*TeamCreate) ExecX

func (tc *TeamCreate) ExecX(ctx context.Context)

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

func (*TeamCreate) Mutation

func (tc *TeamCreate) Mutation() *TeamMutation

Mutation returns the TeamMutation object of the builder.

func (*TeamCreate) Save

func (tc *TeamCreate) Save(ctx context.Context) (*Team, error)

Save creates the Team in the database.

func (*TeamCreate) SaveX

func (tc *TeamCreate) SaveX(ctx context.Context) *Team

SaveX calls Save and panics if Save returns an error.

func (*TeamCreate) SetCreatedTime

func (tc *TeamCreate) SetCreatedTime(t time.Time) *TeamCreate

SetCreatedTime sets the "created_time" field.

func (*TeamCreate) SetCreator

func (tc *TeamCreate) SetCreator(u *User) *TeamCreate

SetCreator sets the "creator" edge to the User entity.

func (*TeamCreate) SetCreatorID

func (tc *TeamCreate) SetCreatorID(id int64) *TeamCreate

SetCreatorID sets the "creator" edge to the User entity by ID.

func (*TeamCreate) SetDescription

func (tc *TeamCreate) SetDescription(s string) *TeamCreate

SetDescription sets the "description" field.

func (*TeamCreate) SetID

func (tc *TeamCreate) SetID(i int64) *TeamCreate

SetID sets the "id" field.

func (*TeamCreate) SetName

func (tc *TeamCreate) SetName(s string) *TeamCreate

SetName sets the "name" field.

func (*TeamCreate) SetNillableCreatedTime

func (tc *TeamCreate) SetNillableCreatedTime(t *time.Time) *TeamCreate

SetNillableCreatedTime sets the "created_time" field if the given value is not nil.

func (*TeamCreate) SetNillableCreatorID

func (tc *TeamCreate) SetNillableCreatorID(id *int64) *TeamCreate

SetNillableCreatorID sets the "creator" edge to the User entity by ID if the given value is not nil.

func (*TeamCreate) SetNillablePrivate

func (tc *TeamCreate) SetNillablePrivate(b *bool) *TeamCreate

SetNillablePrivate sets the "private" field if the given value is not nil.

func (*TeamCreate) SetPrivate

func (tc *TeamCreate) SetPrivate(b bool) *TeamCreate

SetPrivate sets the "private" field.

type TeamCreateBulk

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

TeamCreateBulk is the builder for creating many Team entities in bulk.

func (*TeamCreateBulk) Exec

func (tcb *TeamCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*TeamCreateBulk) ExecX

func (tcb *TeamCreateBulk) ExecX(ctx context.Context)

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

func (*TeamCreateBulk) Save

func (tcb *TeamCreateBulk) Save(ctx context.Context) ([]*Team, error)

Save creates the Team entities in the database.

func (*TeamCreateBulk) SaveX

func (tcb *TeamCreateBulk) SaveX(ctx context.Context) []*Team

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

type TeamDelete

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

TeamDelete is the builder for deleting a Team entity.

func (*TeamDelete) Exec

func (td *TeamDelete) Exec(ctx context.Context) (int, error)

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

func (*TeamDelete) ExecX

func (td *TeamDelete) ExecX(ctx context.Context) int

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

func (*TeamDelete) Where

func (td *TeamDelete) Where(ps ...predicate.Team) *TeamDelete

Where appends a list predicates to the TeamDelete builder.

type TeamDeleteOne

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

TeamDeleteOne is the builder for deleting a single Team entity.

func (*TeamDeleteOne) Exec

func (tdo *TeamDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*TeamDeleteOne) ExecX

func (tdo *TeamDeleteOne) ExecX(ctx context.Context)

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

type TeamEdge

type TeamEdge struct {
	Node   *Team  `json:"node"`
	Cursor Cursor `json:"cursor"`
}

TeamEdge is the edge representation of Team.

type TeamEdges

type TeamEdges struct {
	// Members holds the value of the members edge.
	Members []*User `json:"members,omitempty"`
	// Announcements holds the value of the announcements edge.
	Announcements []*Announcement `json:"announcements,omitempty"`
	// Creator holds the value of the creator edge.
	Creator *User `json:"creator,omitempty"`
	// Admins holds the value of the admins edge.
	Admins []*User `json:"admins,omitempty"`
	// contains filtered or unexported fields
}

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

func (TeamEdges) AdminsOrErr

func (e TeamEdges) AdminsOrErr() ([]*User, error)

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

func (TeamEdges) AnnouncementsOrErr

func (e TeamEdges) AnnouncementsOrErr() ([]*Announcement, error)

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

func (TeamEdges) CreatorOrErr

func (e TeamEdges) CreatorOrErr() (*User, error)

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

func (TeamEdges) MembersOrErr

func (e TeamEdges) MembersOrErr() ([]*User, error)

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

type TeamGroupBy

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

TeamGroupBy is the group-by builder for Team entities.

func (*TeamGroupBy) Aggregate

func (tgb *TeamGroupBy) Aggregate(fns ...AggregateFunc) *TeamGroupBy

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

func (*TeamGroupBy) Bool

func (tgb *TeamGroupBy) 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 (*TeamGroupBy) BoolX

func (tgb *TeamGroupBy) BoolX(ctx context.Context) bool

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

func (*TeamGroupBy) Bools

func (tgb *TeamGroupBy) 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 (*TeamGroupBy) BoolsX

func (tgb *TeamGroupBy) BoolsX(ctx context.Context) []bool

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

func (*TeamGroupBy) Float64

func (tgb *TeamGroupBy) 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 (*TeamGroupBy) Float64X

func (tgb *TeamGroupBy) Float64X(ctx context.Context) float64

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

func (*TeamGroupBy) Float64s

func (tgb *TeamGroupBy) 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 (*TeamGroupBy) Float64sX

func (tgb *TeamGroupBy) Float64sX(ctx context.Context) []float64

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

func (*TeamGroupBy) Int

func (tgb *TeamGroupBy) 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 (*TeamGroupBy) IntX

func (tgb *TeamGroupBy) IntX(ctx context.Context) int

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

func (*TeamGroupBy) Ints

func (tgb *TeamGroupBy) 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 (*TeamGroupBy) IntsX

func (tgb *TeamGroupBy) IntsX(ctx context.Context) []int

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

func (*TeamGroupBy) Scan

func (tgb *TeamGroupBy) Scan(ctx context.Context, v interface{}) error

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

func (*TeamGroupBy) ScanX

func (tgb *TeamGroupBy) ScanX(ctx context.Context, v interface{})

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

func (*TeamGroupBy) String

func (tgb *TeamGroupBy) 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 (*TeamGroupBy) StringX

func (tgb *TeamGroupBy) StringX(ctx context.Context) string

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

func (*TeamGroupBy) Strings

func (tgb *TeamGroupBy) 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 (*TeamGroupBy) StringsX

func (tgb *TeamGroupBy) StringsX(ctx context.Context) []string

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

type TeamMutation

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

TeamMutation represents an operation that mutates the Team nodes in the graph.

func (*TeamMutation) AddAdminIDs

func (m *TeamMutation) AddAdminIDs(ids ...int64)

AddAdminIDs adds the "admins" edge to the User entity by ids.

func (*TeamMutation) AddAnnouncementIDs

func (m *TeamMutation) AddAnnouncementIDs(ids ...int64)

AddAnnouncementIDs adds the "announcements" edge to the Announcement entity by ids.

func (*TeamMutation) AddField

func (m *TeamMutation) 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 (*TeamMutation) AddMemberIDs

func (m *TeamMutation) AddMemberIDs(ids ...int64)

AddMemberIDs adds the "members" edge to the User entity by ids.

func (*TeamMutation) AddedEdges

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

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

func (*TeamMutation) AddedField

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

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

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

func (*TeamMutation) AddedIDs

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

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

func (*TeamMutation) AdminsCleared

func (m *TeamMutation) AdminsCleared() bool

AdminsCleared reports if the "admins" edge to the User entity was cleared.

func (*TeamMutation) AdminsIDs

func (m *TeamMutation) AdminsIDs() (ids []int64)

AdminsIDs returns the "admins" edge IDs in the mutation.

func (*TeamMutation) AnnouncementsCleared

func (m *TeamMutation) AnnouncementsCleared() bool

AnnouncementsCleared reports if the "announcements" edge to the Announcement entity was cleared.

func (*TeamMutation) AnnouncementsIDs

func (m *TeamMutation) AnnouncementsIDs() (ids []int64)

AnnouncementsIDs returns the "announcements" edge IDs in the mutation.

func (*TeamMutation) ClearAdmins

func (m *TeamMutation) ClearAdmins()

ClearAdmins clears the "admins" edge to the User entity.

func (*TeamMutation) ClearAnnouncements

func (m *TeamMutation) ClearAnnouncements()

ClearAnnouncements clears the "announcements" edge to the Announcement entity.

func (*TeamMutation) ClearCreator

func (m *TeamMutation) ClearCreator()

ClearCreator clears the "creator" edge to the User entity.

func (*TeamMutation) ClearEdge

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

func (m *TeamMutation) 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 (*TeamMutation) ClearMembers

func (m *TeamMutation) ClearMembers()

ClearMembers clears the "members" edge to the User entity.

func (*TeamMutation) ClearedEdges

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

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

func (*TeamMutation) ClearedFields

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

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

func (TeamMutation) Client

func (m TeamMutation) 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 (*TeamMutation) CreatedTime

func (m *TeamMutation) CreatedTime() (r time.Time, exists bool)

CreatedTime returns the value of the "created_time" field in the mutation.

func (*TeamMutation) CreatorCleared

func (m *TeamMutation) CreatorCleared() bool

CreatorCleared reports if the "creator" edge to the User entity was cleared.

func (*TeamMutation) CreatorID

func (m *TeamMutation) CreatorID() (id int64, exists bool)

CreatorID returns the "creator" edge ID in the mutation.

func (*TeamMutation) CreatorIDs

func (m *TeamMutation) CreatorIDs() (ids []int64)

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

func (*TeamMutation) Description

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

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

func (*TeamMutation) EdgeCleared

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

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

func (*TeamMutation) Field

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

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

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

func (*TeamMutation) Fields

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

func (m *TeamMutation) ID() (id int64, exists bool)

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

func (*TeamMutation) IDs

func (m *TeamMutation) IDs(ctx context.Context) ([]int64, error)

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

func (*TeamMutation) MembersCleared

func (m *TeamMutation) MembersCleared() bool

MembersCleared reports if the "members" edge to the User entity was cleared.

func (*TeamMutation) MembersIDs

func (m *TeamMutation) MembersIDs() (ids []int64)

MembersIDs returns the "members" edge IDs in the mutation.

func (*TeamMutation) Name

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

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

func (*TeamMutation) OldCreatedTime

func (m *TeamMutation) OldCreatedTime(ctx context.Context) (v time.Time, err error)

OldCreatedTime returns the old "created_time" field's value of the Team entity. If the Team 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 (*TeamMutation) OldDescription

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

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

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

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

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

func (m *TeamMutation) OldPrivate(ctx context.Context) (v bool, err error)

OldPrivate returns the old "private" field's value of the Team entity. If the Team 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 (*TeamMutation) Op

func (m *TeamMutation) Op() Op

Op returns the operation name.

func (*TeamMutation) Private

func (m *TeamMutation) Private() (r bool, exists bool)

Private returns the value of the "private" field in the mutation.

func (*TeamMutation) RemoveAdminIDs

func (m *TeamMutation) RemoveAdminIDs(ids ...int64)

RemoveAdminIDs removes the "admins" edge to the User entity by IDs.

func (*TeamMutation) RemoveAnnouncementIDs

func (m *TeamMutation) RemoveAnnouncementIDs(ids ...int64)

RemoveAnnouncementIDs removes the "announcements" edge to the Announcement entity by IDs.

func (*TeamMutation) RemoveMemberIDs

func (m *TeamMutation) RemoveMemberIDs(ids ...int64)

RemoveMemberIDs removes the "members" edge to the User entity by IDs.

func (*TeamMutation) RemovedAdminsIDs

func (m *TeamMutation) RemovedAdminsIDs() (ids []int64)

RemovedAdmins returns the removed IDs of the "admins" edge to the User entity.

func (*TeamMutation) RemovedAnnouncementsIDs

func (m *TeamMutation) RemovedAnnouncementsIDs() (ids []int64)

RemovedAnnouncements returns the removed IDs of the "announcements" edge to the Announcement entity.

func (*TeamMutation) RemovedEdges

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

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

func (*TeamMutation) RemovedIDs

func (m *TeamMutation) 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 (*TeamMutation) RemovedMembersIDs

func (m *TeamMutation) RemovedMembersIDs() (ids []int64)

RemovedMembers returns the removed IDs of the "members" edge to the User entity.

func (*TeamMutation) ResetAdmins

func (m *TeamMutation) ResetAdmins()

ResetAdmins resets all changes to the "admins" edge.

func (*TeamMutation) ResetAnnouncements

func (m *TeamMutation) ResetAnnouncements()

ResetAnnouncements resets all changes to the "announcements" edge.

func (*TeamMutation) ResetCreatedTime

func (m *TeamMutation) ResetCreatedTime()

ResetCreatedTime resets all changes to the "created_time" field.

func (*TeamMutation) ResetCreator

func (m *TeamMutation) ResetCreator()

ResetCreator resets all changes to the "creator" edge.

func (*TeamMutation) ResetDescription

func (m *TeamMutation) ResetDescription()

ResetDescription resets all changes to the "description" field.

func (*TeamMutation) ResetEdge

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

func (m *TeamMutation) 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 (*TeamMutation) ResetMembers

func (m *TeamMutation) ResetMembers()

ResetMembers resets all changes to the "members" edge.

func (*TeamMutation) ResetName

func (m *TeamMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*TeamMutation) ResetPrivate

func (m *TeamMutation) ResetPrivate()

ResetPrivate resets all changes to the "private" field.

func (*TeamMutation) SetCreatedTime

func (m *TeamMutation) SetCreatedTime(t time.Time)

SetCreatedTime sets the "created_time" field.

func (*TeamMutation) SetCreatorID

func (m *TeamMutation) SetCreatorID(id int64)

SetCreatorID sets the "creator" edge to the User entity by id.

func (*TeamMutation) SetDescription

func (m *TeamMutation) SetDescription(s string)

SetDescription sets the "description" field.

func (*TeamMutation) SetField

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

func (m *TeamMutation) SetID(id int64)

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

func (*TeamMutation) SetName

func (m *TeamMutation) SetName(s string)

SetName sets the "name" field.

func (*TeamMutation) SetPrivate

func (m *TeamMutation) SetPrivate(b bool)

SetPrivate sets the "private" field.

func (TeamMutation) Tx

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

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

func (*TeamMutation) Type

func (m *TeamMutation) Type() string

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

func (*TeamMutation) Where

func (m *TeamMutation) Where(ps ...predicate.Team)

Where appends a list predicates to the TeamMutation builder.

type TeamOrder

type TeamOrder struct {
	Direction OrderDirection  `json:"direction"`
	Field     *TeamOrderField `json:"field"`
}

TeamOrder defines the ordering of Team.

type TeamOrderField

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

TeamOrderField defines the ordering field of Team.

type TeamPaginateOption

type TeamPaginateOption func(*teamPager) error

TeamPaginateOption enables pagination customization.

func WithTeamFilter

func WithTeamFilter(filter func(*TeamQuery) (*TeamQuery, error)) TeamPaginateOption

WithTeamFilter configures pagination filter.

func WithTeamOrder

func WithTeamOrder(order *TeamOrder) TeamPaginateOption

WithTeamOrder configures pagination ordering.

type TeamQuery

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

TeamQuery is the builder for querying Team entities.

func (*TeamQuery) All

func (tq *TeamQuery) All(ctx context.Context) ([]*Team, error)

All executes the query and returns a list of Teams.

func (*TeamQuery) AllX

func (tq *TeamQuery) AllX(ctx context.Context) []*Team

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

func (*TeamQuery) Clone

func (tq *TeamQuery) Clone() *TeamQuery

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

func (*TeamQuery) CollectFields

func (t *TeamQuery) CollectFields(ctx context.Context, satisfies ...string) *TeamQuery

CollectFields tells the query-builder to eagerly load connected nodes by resolver context.

func (*TeamQuery) Count

func (tq *TeamQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*TeamQuery) CountX

func (tq *TeamQuery) CountX(ctx context.Context) int

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

func (*TeamQuery) Exist

func (tq *TeamQuery) Exist(ctx context.Context) (bool, error)

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

func (*TeamQuery) ExistX

func (tq *TeamQuery) ExistX(ctx context.Context) bool

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

func (*TeamQuery) First

func (tq *TeamQuery) First(ctx context.Context) (*Team, error)

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

func (*TeamQuery) FirstID

func (tq *TeamQuery) FirstID(ctx context.Context) (id int64, err error)

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

func (*TeamQuery) FirstIDX

func (tq *TeamQuery) FirstIDX(ctx context.Context) int64

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

func (*TeamQuery) FirstX

func (tq *TeamQuery) FirstX(ctx context.Context) *Team

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

func (*TeamQuery) GroupBy

func (tq *TeamQuery) GroupBy(field string, fields ...string) *TeamGroupBy

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

func (*TeamQuery) IDs

func (tq *TeamQuery) IDs(ctx context.Context) ([]int64, error)

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

func (*TeamQuery) IDsX

func (tq *TeamQuery) IDsX(ctx context.Context) []int64

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

func (*TeamQuery) Limit

func (tq *TeamQuery) Limit(limit int) *TeamQuery

Limit adds a limit step to the query.

func (*TeamQuery) Offset

func (tq *TeamQuery) Offset(offset int) *TeamQuery

Offset adds an offset step to the query.

func (*TeamQuery) Only

func (tq *TeamQuery) Only(ctx context.Context) (*Team, error)

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

func (*TeamQuery) OnlyID

func (tq *TeamQuery) OnlyID(ctx context.Context) (id int64, err error)

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

func (*TeamQuery) OnlyIDX

func (tq *TeamQuery) OnlyIDX(ctx context.Context) int64

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

func (*TeamQuery) OnlyX

func (tq *TeamQuery) OnlyX(ctx context.Context) *Team

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

func (*TeamQuery) Order

func (tq *TeamQuery) Order(o ...OrderFunc) *TeamQuery

Order adds an order step to the query.

func (*TeamQuery) Paginate

func (t *TeamQuery) Paginate(
	ctx context.Context, after *Cursor, first *int,
	before *Cursor, last *int, opts ...TeamPaginateOption,
) (*TeamConnection, error)

Paginate executes the query and returns a relay based cursor connection to Team.

func (*TeamQuery) QueryAdmins

func (tq *TeamQuery) QueryAdmins() *UserQuery

QueryAdmins chains the current query on the "admins" edge.

func (*TeamQuery) QueryAnnouncements

func (tq *TeamQuery) QueryAnnouncements() *AnnouncementQuery

QueryAnnouncements chains the current query on the "announcements" edge.

func (*TeamQuery) QueryCreator

func (tq *TeamQuery) QueryCreator() *UserQuery

QueryCreator chains the current query on the "creator" edge.

func (*TeamQuery) QueryMembers

func (tq *TeamQuery) QueryMembers() *UserQuery

QueryMembers chains the current query on the "members" edge.

func (*TeamQuery) Select

func (tq *TeamQuery) Select(fields ...string) *TeamSelect

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

func (*TeamQuery) Unique

func (tq *TeamQuery) Unique(unique bool) *TeamQuery

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

func (tq *TeamQuery) Where(ps ...predicate.Team) *TeamQuery

Where adds a new predicate for the TeamQuery builder.

func (*TeamQuery) WithAdmins

func (tq *TeamQuery) WithAdmins(opts ...func(*UserQuery)) *TeamQuery

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

func (*TeamQuery) WithAnnouncements

func (tq *TeamQuery) WithAnnouncements(opts ...func(*AnnouncementQuery)) *TeamQuery

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

func (*TeamQuery) WithCreator

func (tq *TeamQuery) WithCreator(opts ...func(*UserQuery)) *TeamQuery

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

func (*TeamQuery) WithMembers

func (tq *TeamQuery) WithMembers(opts ...func(*UserQuery)) *TeamQuery

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

type TeamSelect

type TeamSelect struct {
	*TeamQuery
	// contains filtered or unexported fields
}

TeamSelect is the builder for selecting fields of Team entities.

func (*TeamSelect) Bool

func (ts *TeamSelect) Bool(ctx context.Context) (_ bool, err error)

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

func (*TeamSelect) BoolX

func (ts *TeamSelect) BoolX(ctx context.Context) bool

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

func (*TeamSelect) Bools

func (ts *TeamSelect) Bools(ctx context.Context) ([]bool, error)

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

func (*TeamSelect) BoolsX

func (ts *TeamSelect) BoolsX(ctx context.Context) []bool

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

func (*TeamSelect) Float64

func (ts *TeamSelect) Float64(ctx context.Context) (_ float64, err error)

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

func (*TeamSelect) Float64X

func (ts *TeamSelect) Float64X(ctx context.Context) float64

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

func (*TeamSelect) Float64s

func (ts *TeamSelect) Float64s(ctx context.Context) ([]float64, error)

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

func (*TeamSelect) Float64sX

func (ts *TeamSelect) Float64sX(ctx context.Context) []float64

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

func (*TeamSelect) Int

func (ts *TeamSelect) Int(ctx context.Context) (_ int, err error)

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

func (*TeamSelect) IntX

func (ts *TeamSelect) IntX(ctx context.Context) int

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

func (*TeamSelect) Ints

func (ts *TeamSelect) Ints(ctx context.Context) ([]int, error)

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

func (*TeamSelect) IntsX

func (ts *TeamSelect) IntsX(ctx context.Context) []int

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

func (*TeamSelect) Scan

func (ts *TeamSelect) Scan(ctx context.Context, v interface{}) error

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

func (*TeamSelect) ScanX

func (ts *TeamSelect) ScanX(ctx context.Context, v interface{})

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

func (*TeamSelect) String

func (ts *TeamSelect) String(ctx context.Context) (_ string, err error)

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

func (*TeamSelect) StringX

func (ts *TeamSelect) StringX(ctx context.Context) string

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

func (*TeamSelect) Strings

func (ts *TeamSelect) Strings(ctx context.Context) ([]string, error)

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

func (*TeamSelect) StringsX

func (ts *TeamSelect) StringsX(ctx context.Context) []string

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

type TeamUpdate

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

TeamUpdate is the builder for updating Team entities.

func (*TeamUpdate) AddAdminIDs

func (tu *TeamUpdate) AddAdminIDs(ids ...int64) *TeamUpdate

AddAdminIDs adds the "admins" edge to the User entity by IDs.

func (*TeamUpdate) AddAdmins

func (tu *TeamUpdate) AddAdmins(u ...*User) *TeamUpdate

AddAdmins adds the "admins" edges to the User entity.

func (*TeamUpdate) AddAnnouncementIDs

func (tu *TeamUpdate) AddAnnouncementIDs(ids ...int64) *TeamUpdate

AddAnnouncementIDs adds the "announcements" edge to the Announcement entity by IDs.

func (*TeamUpdate) AddAnnouncements

func (tu *TeamUpdate) AddAnnouncements(a ...*Announcement) *TeamUpdate

AddAnnouncements adds the "announcements" edges to the Announcement entity.

func (*TeamUpdate) AddMemberIDs

func (tu *TeamUpdate) AddMemberIDs(ids ...int64) *TeamUpdate

AddMemberIDs adds the "members" edge to the User entity by IDs.

func (*TeamUpdate) AddMembers

func (tu *TeamUpdate) AddMembers(u ...*User) *TeamUpdate

AddMembers adds the "members" edges to the User entity.

func (*TeamUpdate) ClearAdmins

func (tu *TeamUpdate) ClearAdmins() *TeamUpdate

ClearAdmins clears all "admins" edges to the User entity.

func (*TeamUpdate) ClearAnnouncements

func (tu *TeamUpdate) ClearAnnouncements() *TeamUpdate

ClearAnnouncements clears all "announcements" edges to the Announcement entity.

func (*TeamUpdate) ClearCreator

func (tu *TeamUpdate) ClearCreator() *TeamUpdate

ClearCreator clears the "creator" edge to the User entity.

func (*TeamUpdate) ClearMembers

func (tu *TeamUpdate) ClearMembers() *TeamUpdate

ClearMembers clears all "members" edges to the User entity.

func (*TeamUpdate) Exec

func (tu *TeamUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*TeamUpdate) ExecX

func (tu *TeamUpdate) ExecX(ctx context.Context)

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

func (*TeamUpdate) Mutation

func (tu *TeamUpdate) Mutation() *TeamMutation

Mutation returns the TeamMutation object of the builder.

func (*TeamUpdate) RemoveAdminIDs

func (tu *TeamUpdate) RemoveAdminIDs(ids ...int64) *TeamUpdate

RemoveAdminIDs removes the "admins" edge to User entities by IDs.

func (*TeamUpdate) RemoveAdmins

func (tu *TeamUpdate) RemoveAdmins(u ...*User) *TeamUpdate

RemoveAdmins removes "admins" edges to User entities.

func (*TeamUpdate) RemoveAnnouncementIDs

func (tu *TeamUpdate) RemoveAnnouncementIDs(ids ...int64) *TeamUpdate

RemoveAnnouncementIDs removes the "announcements" edge to Announcement entities by IDs.

func (*TeamUpdate) RemoveAnnouncements

func (tu *TeamUpdate) RemoveAnnouncements(a ...*Announcement) *TeamUpdate

RemoveAnnouncements removes "announcements" edges to Announcement entities.

func (*TeamUpdate) RemoveMemberIDs

func (tu *TeamUpdate) RemoveMemberIDs(ids ...int64) *TeamUpdate

RemoveMemberIDs removes the "members" edge to User entities by IDs.

func (*TeamUpdate) RemoveMembers

func (tu *TeamUpdate) RemoveMembers(u ...*User) *TeamUpdate

RemoveMembers removes "members" edges to User entities.

func (*TeamUpdate) Save

func (tu *TeamUpdate) Save(ctx context.Context) (int, error)

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

func (*TeamUpdate) SaveX

func (tu *TeamUpdate) SaveX(ctx context.Context) int

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

func (*TeamUpdate) SetCreator

func (tu *TeamUpdate) SetCreator(u *User) *TeamUpdate

SetCreator sets the "creator" edge to the User entity.

func (*TeamUpdate) SetCreatorID

func (tu *TeamUpdate) SetCreatorID(id int64) *TeamUpdate

SetCreatorID sets the "creator" edge to the User entity by ID.

func (*TeamUpdate) SetDescription

func (tu *TeamUpdate) SetDescription(s string) *TeamUpdate

SetDescription sets the "description" field.

func (*TeamUpdate) SetName

func (tu *TeamUpdate) SetName(s string) *TeamUpdate

SetName sets the "name" field.

func (*TeamUpdate) SetNillableCreatorID

func (tu *TeamUpdate) SetNillableCreatorID(id *int64) *TeamUpdate

SetNillableCreatorID sets the "creator" edge to the User entity by ID if the given value is not nil.

func (*TeamUpdate) SetNillablePrivate

func (tu *TeamUpdate) SetNillablePrivate(b *bool) *TeamUpdate

SetNillablePrivate sets the "private" field if the given value is not nil.

func (*TeamUpdate) SetPrivate

func (tu *TeamUpdate) SetPrivate(b bool) *TeamUpdate

SetPrivate sets the "private" field.

func (*TeamUpdate) Where

func (tu *TeamUpdate) Where(ps ...predicate.Team) *TeamUpdate

Where appends a list predicates to the TeamUpdate builder.

type TeamUpdateOne

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

TeamUpdateOne is the builder for updating a single Team entity.

func (*TeamUpdateOne) AddAdminIDs

func (tuo *TeamUpdateOne) AddAdminIDs(ids ...int64) *TeamUpdateOne

AddAdminIDs adds the "admins" edge to the User entity by IDs.

func (*TeamUpdateOne) AddAdmins

func (tuo *TeamUpdateOne) AddAdmins(u ...*User) *TeamUpdateOne

AddAdmins adds the "admins" edges to the User entity.

func (*TeamUpdateOne) AddAnnouncementIDs

func (tuo *TeamUpdateOne) AddAnnouncementIDs(ids ...int64) *TeamUpdateOne

AddAnnouncementIDs adds the "announcements" edge to the Announcement entity by IDs.

func (*TeamUpdateOne) AddAnnouncements

func (tuo *TeamUpdateOne) AddAnnouncements(a ...*Announcement) *TeamUpdateOne

AddAnnouncements adds the "announcements" edges to the Announcement entity.

func (*TeamUpdateOne) AddMemberIDs

func (tuo *TeamUpdateOne) AddMemberIDs(ids ...int64) *TeamUpdateOne

AddMemberIDs adds the "members" edge to the User entity by IDs.

func (*TeamUpdateOne) AddMembers

func (tuo *TeamUpdateOne) AddMembers(u ...*User) *TeamUpdateOne

AddMembers adds the "members" edges to the User entity.

func (*TeamUpdateOne) ClearAdmins

func (tuo *TeamUpdateOne) ClearAdmins() *TeamUpdateOne

ClearAdmins clears all "admins" edges to the User entity.

func (*TeamUpdateOne) ClearAnnouncements

func (tuo *TeamUpdateOne) ClearAnnouncements() *TeamUpdateOne

ClearAnnouncements clears all "announcements" edges to the Announcement entity.

func (*TeamUpdateOne) ClearCreator

func (tuo *TeamUpdateOne) ClearCreator() *TeamUpdateOne

ClearCreator clears the "creator" edge to the User entity.

func (*TeamUpdateOne) ClearMembers

func (tuo *TeamUpdateOne) ClearMembers() *TeamUpdateOne

ClearMembers clears all "members" edges to the User entity.

func (*TeamUpdateOne) Exec

func (tuo *TeamUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*TeamUpdateOne) ExecX

func (tuo *TeamUpdateOne) ExecX(ctx context.Context)

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

func (*TeamUpdateOne) Mutation

func (tuo *TeamUpdateOne) Mutation() *TeamMutation

Mutation returns the TeamMutation object of the builder.

func (*TeamUpdateOne) RemoveAdminIDs

func (tuo *TeamUpdateOne) RemoveAdminIDs(ids ...int64) *TeamUpdateOne

RemoveAdminIDs removes the "admins" edge to User entities by IDs.

func (*TeamUpdateOne) RemoveAdmins

func (tuo *TeamUpdateOne) RemoveAdmins(u ...*User) *TeamUpdateOne

RemoveAdmins removes "admins" edges to User entities.

func (*TeamUpdateOne) RemoveAnnouncementIDs

func (tuo *TeamUpdateOne) RemoveAnnouncementIDs(ids ...int64) *TeamUpdateOne

RemoveAnnouncementIDs removes the "announcements" edge to Announcement entities by IDs.

func (*TeamUpdateOne) RemoveAnnouncements

func (tuo *TeamUpdateOne) RemoveAnnouncements(a ...*Announcement) *TeamUpdateOne

RemoveAnnouncements removes "announcements" edges to Announcement entities.

func (*TeamUpdateOne) RemoveMemberIDs

func (tuo *TeamUpdateOne) RemoveMemberIDs(ids ...int64) *TeamUpdateOne

RemoveMemberIDs removes the "members" edge to User entities by IDs.

func (*TeamUpdateOne) RemoveMembers

func (tuo *TeamUpdateOne) RemoveMembers(u ...*User) *TeamUpdateOne

RemoveMembers removes "members" edges to User entities.

func (*TeamUpdateOne) Save

func (tuo *TeamUpdateOne) Save(ctx context.Context) (*Team, error)

Save executes the query and returns the updated Team entity.

func (*TeamUpdateOne) SaveX

func (tuo *TeamUpdateOne) SaveX(ctx context.Context) *Team

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

func (*TeamUpdateOne) Select

func (tuo *TeamUpdateOne) Select(field string, fields ...string) *TeamUpdateOne

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

func (*TeamUpdateOne) SetCreator

func (tuo *TeamUpdateOne) SetCreator(u *User) *TeamUpdateOne

SetCreator sets the "creator" edge to the User entity.

func (*TeamUpdateOne) SetCreatorID

func (tuo *TeamUpdateOne) SetCreatorID(id int64) *TeamUpdateOne

SetCreatorID sets the "creator" edge to the User entity by ID.

func (*TeamUpdateOne) SetDescription

func (tuo *TeamUpdateOne) SetDescription(s string) *TeamUpdateOne

SetDescription sets the "description" field.

func (*TeamUpdateOne) SetName

func (tuo *TeamUpdateOne) SetName(s string) *TeamUpdateOne

SetName sets the "name" field.

func (*TeamUpdateOne) SetNillableCreatorID

func (tuo *TeamUpdateOne) SetNillableCreatorID(id *int64) *TeamUpdateOne

SetNillableCreatorID sets the "creator" edge to the User entity by ID if the given value is not nil.

func (*TeamUpdateOne) SetNillablePrivate

func (tuo *TeamUpdateOne) SetNillablePrivate(b *bool) *TeamUpdateOne

SetNillablePrivate sets the "private" field if the given value is not nil.

func (*TeamUpdateOne) SetPrivate

func (tuo *TeamUpdateOne) SetPrivate(b bool) *TeamUpdateOne

SetPrivate sets the "private" field.

type TeamWhereInput

type TeamWhereInput struct {
	Not *TeamWhereInput   `json:"not,omitempty"`
	Or  []*TeamWhereInput `json:"or,omitempty"`
	And []*TeamWhereInput `json:"and,omitempty"`

	// "id" field predicates.
	ID      *int64  `json:"id,omitempty"`
	IDNEQ   *int64  `json:"idNEQ,omitempty"`
	IDIn    []int64 `json:"idIn,omitempty"`
	IDNotIn []int64 `json:"idNotIn,omitempty"`
	IDGT    *int64  `json:"idGT,omitempty"`
	IDGTE   *int64  `json:"idGTE,omitempty"`
	IDLT    *int64  `json:"idLT,omitempty"`
	IDLTE   *int64  `json:"idLTE,omitempty"`

	// "name" field predicates.
	Name             *string  `json:"name,omitempty"`
	NameNEQ          *string  `json:"nameNEQ,omitempty"`
	NameIn           []string `json:"nameIn,omitempty"`
	NameNotIn        []string `json:"nameNotIn,omitempty"`
	NameGT           *string  `json:"nameGT,omitempty"`
	NameGTE          *string  `json:"nameGTE,omitempty"`
	NameLT           *string  `json:"nameLT,omitempty"`
	NameLTE          *string  `json:"nameLTE,omitempty"`
	NameContains     *string  `json:"nameContains,omitempty"`
	NameHasPrefix    *string  `json:"nameHasPrefix,omitempty"`
	NameHasSuffix    *string  `json:"nameHasSuffix,omitempty"`
	NameEqualFold    *string  `json:"nameEqualFold,omitempty"`
	NameContainsFold *string  `json:"nameContainsFold,omitempty"`

	// "description" field predicates.
	Description             *string  `json:"description,omitempty"`
	DescriptionNEQ          *string  `json:"descriptionNEQ,omitempty"`
	DescriptionIn           []string `json:"descriptionIn,omitempty"`
	DescriptionNotIn        []string `json:"descriptionNotIn,omitempty"`
	DescriptionGT           *string  `json:"descriptionGT,omitempty"`
	DescriptionGTE          *string  `json:"descriptionGTE,omitempty"`
	DescriptionLT           *string  `json:"descriptionLT,omitempty"`
	DescriptionLTE          *string  `json:"descriptionLTE,omitempty"`
	DescriptionContains     *string  `json:"descriptionContains,omitempty"`
	DescriptionHasPrefix    *string  `json:"descriptionHasPrefix,omitempty"`
	DescriptionHasSuffix    *string  `json:"descriptionHasSuffix,omitempty"`
	DescriptionEqualFold    *string  `json:"descriptionEqualFold,omitempty"`
	DescriptionContainsFold *string  `json:"descriptionContainsFold,omitempty"`

	// "created_time" field predicates.
	CreatedTime      *time.Time  `json:"createdTime,omitempty"`
	CreatedTimeNEQ   *time.Time  `json:"createdTimeNEQ,omitempty"`
	CreatedTimeIn    []time.Time `json:"createdTimeIn,omitempty"`
	CreatedTimeNotIn []time.Time `json:"createdTimeNotIn,omitempty"`
	CreatedTimeGT    *time.Time  `json:"createdTimeGT,omitempty"`
	CreatedTimeGTE   *time.Time  `json:"createdTimeGTE,omitempty"`
	CreatedTimeLT    *time.Time  `json:"createdTimeLT,omitempty"`
	CreatedTimeLTE   *time.Time  `json:"createdTimeLTE,omitempty"`

	// "private" field predicates.
	Private    *bool `json:"private,omitempty"`
	PrivateNEQ *bool `json:"privateNEQ,omitempty"`

	// "members" edge predicates.
	HasMembers     *bool             `json:"hasMembers,omitempty"`
	HasMembersWith []*UserWhereInput `json:"hasMembersWith,omitempty"`

	// "announcements" edge predicates.
	HasAnnouncements     *bool                     `json:"hasAnnouncements,omitempty"`
	HasAnnouncementsWith []*AnnouncementWhereInput `json:"hasAnnouncementsWith,omitempty"`

	// "creator" edge predicates.
	HasCreator     *bool             `json:"hasCreator,omitempty"`
	HasCreatorWith []*UserWhereInput `json:"hasCreatorWith,omitempty"`

	// "admins" edge predicates.
	HasAdmins     *bool             `json:"hasAdmins,omitempty"`
	HasAdminsWith []*UserWhereInput `json:"hasAdminsWith,omitempty"`
}

TeamWhereInput represents a where input for filtering Team queries.

func (*TeamWhereInput) Filter

func (i *TeamWhereInput) Filter(q *TeamQuery) (*TeamQuery, error)

Filter applies the TeamWhereInput filter on the TeamQuery builder.

func (*TeamWhereInput) P

func (i *TeamWhereInput) P() (predicate.Team, error)

P returns a predicate for filtering teams. An error is returned if the input is empty or invalid.

type Teams

type Teams []*Team

Teams is a parsable slice of Team.

type Todo

type Todo struct {

	// ID of the ent.
	ID int64 `json:"id,omitempty"`
	// Text holds the value of the "text" field.
	Text string `json:"text,omitempty"`
	// Done holds the value of the "done" field.
	Done bool `json:"done,omitempty"`
	// contains filtered or unexported fields
}

Todo is the model entity for the Todo schema.

func (*Todo) Node

func (t *Todo) Node(ctx context.Context) (node *Node, err error)

func (*Todo) String

func (t *Todo) String() string

String implements the fmt.Stringer.

func (*Todo) ToEdge

func (t *Todo) ToEdge(order *TodoOrder) *TodoEdge

ToEdge converts Todo into TodoEdge.

func (*Todo) Unwrap

func (t *Todo) Unwrap() *Todo

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

func (t *Todo) Update() *TodoUpdateOne

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

type TodoClient

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

TodoClient is a client for the Todo schema.

func NewTodoClient

func NewTodoClient(c config) *TodoClient

NewTodoClient returns a client for the Todo from the given config.

func (*TodoClient) Create

func (c *TodoClient) Create() *TodoCreate

Create returns a create builder for Todo.

func (*TodoClient) CreateBulk

func (c *TodoClient) CreateBulk(builders ...*TodoCreate) *TodoCreateBulk

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

func (*TodoClient) Delete

func (c *TodoClient) Delete() *TodoDelete

Delete returns a delete builder for Todo.

func (*TodoClient) DeleteOne

func (c *TodoClient) DeleteOne(t *Todo) *TodoDeleteOne

DeleteOne returns a delete builder for the given entity.

func (*TodoClient) DeleteOneID

func (c *TodoClient) DeleteOneID(id int64) *TodoDeleteOne

DeleteOneID returns a delete builder for the given id.

func (*TodoClient) Get

func (c *TodoClient) Get(ctx context.Context, id int64) (*Todo, error)

Get returns a Todo entity by its id.

func (*TodoClient) GetX

func (c *TodoClient) GetX(ctx context.Context, id int64) *Todo

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

func (*TodoClient) Hooks

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

Hooks returns the client hooks.

func (*TodoClient) Query

func (c *TodoClient) Query() *TodoQuery

Query returns a query builder for Todo.

func (*TodoClient) Update

func (c *TodoClient) Update() *TodoUpdate

Update returns an update builder for Todo.

func (*TodoClient) UpdateOne

func (c *TodoClient) UpdateOne(t *Todo) *TodoUpdateOne

UpdateOne returns an update builder for the given entity.

func (*TodoClient) UpdateOneID

func (c *TodoClient) UpdateOneID(id int64) *TodoUpdateOne

UpdateOneID returns an update builder for the given id.

func (*TodoClient) Use

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

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

type TodoConnection

type TodoConnection struct {
	Edges      []*TodoEdge `json:"edges"`
	PageInfo   PageInfo    `json:"pageInfo"`
	TotalCount int         `json:"totalCount"`
}

TodoConnection is the connection containing edges to Todo.

type TodoCreate

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

TodoCreate is the builder for creating a Todo entity.

func (*TodoCreate) Exec

func (tc *TodoCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*TodoCreate) ExecX

func (tc *TodoCreate) ExecX(ctx context.Context)

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

func (*TodoCreate) Mutation

func (tc *TodoCreate) Mutation() *TodoMutation

Mutation returns the TodoMutation object of the builder.

func (*TodoCreate) Save

func (tc *TodoCreate) Save(ctx context.Context) (*Todo, error)

Save creates the Todo in the database.

func (*TodoCreate) SaveX

func (tc *TodoCreate) SaveX(ctx context.Context) *Todo

SaveX calls Save and panics if Save returns an error.

func (*TodoCreate) SetDone

func (tc *TodoCreate) SetDone(b bool) *TodoCreate

SetDone sets the "done" field.

func (*TodoCreate) SetID

func (tc *TodoCreate) SetID(i int64) *TodoCreate

SetID sets the "id" field.

func (*TodoCreate) SetNillableDone

func (tc *TodoCreate) SetNillableDone(b *bool) *TodoCreate

SetNillableDone sets the "done" field if the given value is not nil.

func (*TodoCreate) SetText

func (tc *TodoCreate) SetText(s string) *TodoCreate

SetText sets the "text" field.

type TodoCreateBulk

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

TodoCreateBulk is the builder for creating many Todo entities in bulk.

func (*TodoCreateBulk) Exec

func (tcb *TodoCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*TodoCreateBulk) ExecX

func (tcb *TodoCreateBulk) ExecX(ctx context.Context)

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

func (*TodoCreateBulk) Save

func (tcb *TodoCreateBulk) Save(ctx context.Context) ([]*Todo, error)

Save creates the Todo entities in the database.

func (*TodoCreateBulk) SaveX

func (tcb *TodoCreateBulk) SaveX(ctx context.Context) []*Todo

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

type TodoDelete

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

TodoDelete is the builder for deleting a Todo entity.

func (*TodoDelete) Exec

func (td *TodoDelete) Exec(ctx context.Context) (int, error)

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

func (*TodoDelete) ExecX

func (td *TodoDelete) ExecX(ctx context.Context) int

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

func (*TodoDelete) Where

func (td *TodoDelete) Where(ps ...predicate.Todo) *TodoDelete

Where appends a list predicates to the TodoDelete builder.

type TodoDeleteOne

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

TodoDeleteOne is the builder for deleting a single Todo entity.

func (*TodoDeleteOne) Exec

func (tdo *TodoDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*TodoDeleteOne) ExecX

func (tdo *TodoDeleteOne) ExecX(ctx context.Context)

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

type TodoEdge

type TodoEdge struct {
	Node   *Todo  `json:"node"`
	Cursor Cursor `json:"cursor"`
}

TodoEdge is the edge representation of Todo.

type TodoGroupBy

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

TodoGroupBy is the group-by builder for Todo entities.

func (*TodoGroupBy) Aggregate

func (tgb *TodoGroupBy) Aggregate(fns ...AggregateFunc) *TodoGroupBy

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

func (*TodoGroupBy) Bool

func (tgb *TodoGroupBy) 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 (*TodoGroupBy) BoolX

func (tgb *TodoGroupBy) BoolX(ctx context.Context) bool

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

func (*TodoGroupBy) Bools

func (tgb *TodoGroupBy) 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 (*TodoGroupBy) BoolsX

func (tgb *TodoGroupBy) BoolsX(ctx context.Context) []bool

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

func (*TodoGroupBy) Float64

func (tgb *TodoGroupBy) 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 (*TodoGroupBy) Float64X

func (tgb *TodoGroupBy) Float64X(ctx context.Context) float64

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

func (*TodoGroupBy) Float64s

func (tgb *TodoGroupBy) 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 (*TodoGroupBy) Float64sX

func (tgb *TodoGroupBy) Float64sX(ctx context.Context) []float64

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

func (*TodoGroupBy) Int

func (tgb *TodoGroupBy) 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 (*TodoGroupBy) IntX

func (tgb *TodoGroupBy) IntX(ctx context.Context) int

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

func (*TodoGroupBy) Ints

func (tgb *TodoGroupBy) 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 (*TodoGroupBy) IntsX

func (tgb *TodoGroupBy) IntsX(ctx context.Context) []int

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

func (*TodoGroupBy) Scan

func (tgb *TodoGroupBy) Scan(ctx context.Context, v interface{}) error

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

func (*TodoGroupBy) ScanX

func (tgb *TodoGroupBy) ScanX(ctx context.Context, v interface{})

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

func (*TodoGroupBy) String

func (tgb *TodoGroupBy) 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 (*TodoGroupBy) StringX

func (tgb *TodoGroupBy) StringX(ctx context.Context) string

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

func (*TodoGroupBy) Strings

func (tgb *TodoGroupBy) 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 (*TodoGroupBy) StringsX

func (tgb *TodoGroupBy) StringsX(ctx context.Context) []string

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

type TodoMutation

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

TodoMutation represents an operation that mutates the Todo nodes in the graph.

func (*TodoMutation) AddField

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

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

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

func (*TodoMutation) AddedField

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

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

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

func (*TodoMutation) AddedIDs

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

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

func (*TodoMutation) ClearEdge

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

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

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

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

func (*TodoMutation) ClearedFields

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

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

func (TodoMutation) Client

func (m TodoMutation) 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 (*TodoMutation) Done

func (m *TodoMutation) Done() (r bool, exists bool)

Done returns the value of the "done" field in the mutation.

func (*TodoMutation) EdgeCleared

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

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

func (*TodoMutation) Field

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

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

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

func (*TodoMutation) Fields

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

func (m *TodoMutation) ID() (id int64, exists bool)

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

func (*TodoMutation) IDs

func (m *TodoMutation) IDs(ctx context.Context) ([]int64, error)

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

func (*TodoMutation) OldDone

func (m *TodoMutation) OldDone(ctx context.Context) (v bool, err error)

OldDone returns the old "done" field's value of the Todo entity. If the Todo 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 (*TodoMutation) OldField

func (m *TodoMutation) 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 (*TodoMutation) OldText

func (m *TodoMutation) OldText(ctx context.Context) (v string, err error)

OldText returns the old "text" field's value of the Todo entity. If the Todo 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 (*TodoMutation) Op

func (m *TodoMutation) Op() Op

Op returns the operation name.

func (*TodoMutation) RemovedEdges

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

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

func (*TodoMutation) RemovedIDs

func (m *TodoMutation) 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 (*TodoMutation) ResetDone

func (m *TodoMutation) ResetDone()

ResetDone resets all changes to the "done" field.

func (*TodoMutation) ResetEdge

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

func (m *TodoMutation) 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 (*TodoMutation) ResetText

func (m *TodoMutation) ResetText()

ResetText resets all changes to the "text" field.

func (*TodoMutation) SetDone

func (m *TodoMutation) SetDone(b bool)

SetDone sets the "done" field.

func (*TodoMutation) SetField

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

func (m *TodoMutation) SetID(id int64)

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

func (*TodoMutation) SetText

func (m *TodoMutation) SetText(s string)

SetText sets the "text" field.

func (*TodoMutation) Text

func (m *TodoMutation) Text() (r string, exists bool)

Text returns the value of the "text" field in the mutation.

func (TodoMutation) Tx

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

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

func (*TodoMutation) Type

func (m *TodoMutation) Type() string

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

func (*TodoMutation) Where

func (m *TodoMutation) Where(ps ...predicate.Todo)

Where appends a list predicates to the TodoMutation builder.

type TodoOrder

type TodoOrder struct {
	Direction OrderDirection  `json:"direction"`
	Field     *TodoOrderField `json:"field"`
}

TodoOrder defines the ordering of Todo.

type TodoOrderField

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

TodoOrderField defines the ordering field of Todo.

type TodoPaginateOption

type TodoPaginateOption func(*todoPager) error

TodoPaginateOption enables pagination customization.

func WithTodoFilter

func WithTodoFilter(filter func(*TodoQuery) (*TodoQuery, error)) TodoPaginateOption

WithTodoFilter configures pagination filter.

func WithTodoOrder

func WithTodoOrder(order *TodoOrder) TodoPaginateOption

WithTodoOrder configures pagination ordering.

type TodoQuery

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

TodoQuery is the builder for querying Todo entities.

func (*TodoQuery) All

func (tq *TodoQuery) All(ctx context.Context) ([]*Todo, error)

All executes the query and returns a list of Todos.

func (*TodoQuery) AllX

func (tq *TodoQuery) AllX(ctx context.Context) []*Todo

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

func (*TodoQuery) Clone

func (tq *TodoQuery) Clone() *TodoQuery

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

func (*TodoQuery) CollectFields

func (t *TodoQuery) CollectFields(ctx context.Context, satisfies ...string) *TodoQuery

CollectFields tells the query-builder to eagerly load connected nodes by resolver context.

func (*TodoQuery) Count

func (tq *TodoQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*TodoQuery) CountX

func (tq *TodoQuery) CountX(ctx context.Context) int

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

func (*TodoQuery) Exist

func (tq *TodoQuery) Exist(ctx context.Context) (bool, error)

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

func (*TodoQuery) ExistX

func (tq *TodoQuery) ExistX(ctx context.Context) bool

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

func (*TodoQuery) First

func (tq *TodoQuery) First(ctx context.Context) (*Todo, error)

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

func (*TodoQuery) FirstID

func (tq *TodoQuery) FirstID(ctx context.Context) (id int64, err error)

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

func (*TodoQuery) FirstIDX

func (tq *TodoQuery) FirstIDX(ctx context.Context) int64

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

func (*TodoQuery) FirstX

func (tq *TodoQuery) FirstX(ctx context.Context) *Todo

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

func (*TodoQuery) GroupBy

func (tq *TodoQuery) GroupBy(field string, fields ...string) *TodoGroupBy

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

client.Todo.Query().
	GroupBy(todo.FieldText).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*TodoQuery) IDs

func (tq *TodoQuery) IDs(ctx context.Context) ([]int64, error)

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

func (*TodoQuery) IDsX

func (tq *TodoQuery) IDsX(ctx context.Context) []int64

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

func (*TodoQuery) Limit

func (tq *TodoQuery) Limit(limit int) *TodoQuery

Limit adds a limit step to the query.

func (*TodoQuery) Offset

func (tq *TodoQuery) Offset(offset int) *TodoQuery

Offset adds an offset step to the query.

func (*TodoQuery) Only

func (tq *TodoQuery) Only(ctx context.Context) (*Todo, error)

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

func (*TodoQuery) OnlyID

func (tq *TodoQuery) OnlyID(ctx context.Context) (id int64, err error)

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

func (*TodoQuery) OnlyIDX

func (tq *TodoQuery) OnlyIDX(ctx context.Context) int64

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

func (*TodoQuery) OnlyX

func (tq *TodoQuery) OnlyX(ctx context.Context) *Todo

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

func (*TodoQuery) Order

func (tq *TodoQuery) Order(o ...OrderFunc) *TodoQuery

Order adds an order step to the query.

func (*TodoQuery) Paginate

func (t *TodoQuery) Paginate(
	ctx context.Context, after *Cursor, first *int,
	before *Cursor, last *int, opts ...TodoPaginateOption,
) (*TodoConnection, error)

Paginate executes the query and returns a relay based cursor connection to Todo.

func (*TodoQuery) Select

func (tq *TodoQuery) Select(fields ...string) *TodoSelect

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

client.Todo.Query().
	Select(todo.FieldText).
	Scan(ctx, &v)

func (*TodoQuery) Unique

func (tq *TodoQuery) Unique(unique bool) *TodoQuery

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

func (tq *TodoQuery) Where(ps ...predicate.Todo) *TodoQuery

Where adds a new predicate for the TodoQuery builder.

type TodoSelect

type TodoSelect struct {
	*TodoQuery
	// contains filtered or unexported fields
}

TodoSelect is the builder for selecting fields of Todo entities.

func (*TodoSelect) Bool

func (ts *TodoSelect) Bool(ctx context.Context) (_ bool, err error)

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

func (*TodoSelect) BoolX

func (ts *TodoSelect) BoolX(ctx context.Context) bool

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

func (*TodoSelect) Bools

func (ts *TodoSelect) Bools(ctx context.Context) ([]bool, error)

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

func (*TodoSelect) BoolsX

func (ts *TodoSelect) BoolsX(ctx context.Context) []bool

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

func (*TodoSelect) Float64

func (ts *TodoSelect) Float64(ctx context.Context) (_ float64, err error)

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

func (*TodoSelect) Float64X

func (ts *TodoSelect) Float64X(ctx context.Context) float64

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

func (*TodoSelect) Float64s

func (ts *TodoSelect) Float64s(ctx context.Context) ([]float64, error)

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

func (*TodoSelect) Float64sX

func (ts *TodoSelect) Float64sX(ctx context.Context) []float64

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

func (*TodoSelect) Int

func (ts *TodoSelect) Int(ctx context.Context) (_ int, err error)

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

func (*TodoSelect) IntX

func (ts *TodoSelect) IntX(ctx context.Context) int

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

func (*TodoSelect) Ints

func (ts *TodoSelect) Ints(ctx context.Context) ([]int, error)

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

func (*TodoSelect) IntsX

func (ts *TodoSelect) IntsX(ctx context.Context) []int

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

func (*TodoSelect) Scan

func (ts *TodoSelect) Scan(ctx context.Context, v interface{}) error

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

func (*TodoSelect) ScanX

func (ts *TodoSelect) ScanX(ctx context.Context, v interface{})

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

func (*TodoSelect) String

func (ts *TodoSelect) String(ctx context.Context) (_ string, err error)

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

func (*TodoSelect) StringX

func (ts *TodoSelect) StringX(ctx context.Context) string

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

func (*TodoSelect) Strings

func (ts *TodoSelect) Strings(ctx context.Context) ([]string, error)

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

func (*TodoSelect) StringsX

func (ts *TodoSelect) StringsX(ctx context.Context) []string

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

type TodoUpdate

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

TodoUpdate is the builder for updating Todo entities.

func (*TodoUpdate) Exec

func (tu *TodoUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*TodoUpdate) ExecX

func (tu *TodoUpdate) ExecX(ctx context.Context)

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

func (*TodoUpdate) Mutation

func (tu *TodoUpdate) Mutation() *TodoMutation

Mutation returns the TodoMutation object of the builder.

func (*TodoUpdate) Save

func (tu *TodoUpdate) Save(ctx context.Context) (int, error)

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

func (*TodoUpdate) SaveX

func (tu *TodoUpdate) SaveX(ctx context.Context) int

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

func (*TodoUpdate) SetDone

func (tu *TodoUpdate) SetDone(b bool) *TodoUpdate

SetDone sets the "done" field.

func (*TodoUpdate) SetNillableDone

func (tu *TodoUpdate) SetNillableDone(b *bool) *TodoUpdate

SetNillableDone sets the "done" field if the given value is not nil.

func (*TodoUpdate) SetText

func (tu *TodoUpdate) SetText(s string) *TodoUpdate

SetText sets the "text" field.

func (*TodoUpdate) Where

func (tu *TodoUpdate) Where(ps ...predicate.Todo) *TodoUpdate

Where appends a list predicates to the TodoUpdate builder.

type TodoUpdateOne

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

TodoUpdateOne is the builder for updating a single Todo entity.

func (*TodoUpdateOne) Exec

func (tuo *TodoUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*TodoUpdateOne) ExecX

func (tuo *TodoUpdateOne) ExecX(ctx context.Context)

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

func (*TodoUpdateOne) Mutation

func (tuo *TodoUpdateOne) Mutation() *TodoMutation

Mutation returns the TodoMutation object of the builder.

func (*TodoUpdateOne) Save

func (tuo *TodoUpdateOne) Save(ctx context.Context) (*Todo, error)

Save executes the query and returns the updated Todo entity.

func (*TodoUpdateOne) SaveX

func (tuo *TodoUpdateOne) SaveX(ctx context.Context) *Todo

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

func (*TodoUpdateOne) Select

func (tuo *TodoUpdateOne) Select(field string, fields ...string) *TodoUpdateOne

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

func (*TodoUpdateOne) SetDone

func (tuo *TodoUpdateOne) SetDone(b bool) *TodoUpdateOne

SetDone sets the "done" field.

func (*TodoUpdateOne) SetNillableDone

func (tuo *TodoUpdateOne) SetNillableDone(b *bool) *TodoUpdateOne

SetNillableDone sets the "done" field if the given value is not nil.

func (*TodoUpdateOne) SetText

func (tuo *TodoUpdateOne) SetText(s string) *TodoUpdateOne

SetText sets the "text" field.

type TodoWhereInput

type TodoWhereInput struct {
	Not *TodoWhereInput   `json:"not,omitempty"`
	Or  []*TodoWhereInput `json:"or,omitempty"`
	And []*TodoWhereInput `json:"and,omitempty"`

	// "id" field predicates.
	ID      *int64  `json:"id,omitempty"`
	IDNEQ   *int64  `json:"idNEQ,omitempty"`
	IDIn    []int64 `json:"idIn,omitempty"`
	IDNotIn []int64 `json:"idNotIn,omitempty"`
	IDGT    *int64  `json:"idGT,omitempty"`
	IDGTE   *int64  `json:"idGTE,omitempty"`
	IDLT    *int64  `json:"idLT,omitempty"`
	IDLTE   *int64  `json:"idLTE,omitempty"`

	// "text" field predicates.
	Text             *string  `json:"text,omitempty"`
	TextNEQ          *string  `json:"textNEQ,omitempty"`
	TextIn           []string `json:"textIn,omitempty"`
	TextNotIn        []string `json:"textNotIn,omitempty"`
	TextGT           *string  `json:"textGT,omitempty"`
	TextGTE          *string  `json:"textGTE,omitempty"`
	TextLT           *string  `json:"textLT,omitempty"`
	TextLTE          *string  `json:"textLTE,omitempty"`
	TextContains     *string  `json:"textContains,omitempty"`
	TextHasPrefix    *string  `json:"textHasPrefix,omitempty"`
	TextHasSuffix    *string  `json:"textHasSuffix,omitempty"`
	TextEqualFold    *string  `json:"textEqualFold,omitempty"`
	TextContainsFold *string  `json:"textContainsFold,omitempty"`

	// "done" field predicates.
	Done    *bool `json:"done,omitempty"`
	DoneNEQ *bool `json:"doneNEQ,omitempty"`
}

TodoWhereInput represents a where input for filtering Todo queries.

func (*TodoWhereInput) Filter

func (i *TodoWhereInput) Filter(q *TodoQuery) (*TodoQuery, error)

Filter applies the TodoWhereInput filter on the TodoQuery builder.

func (*TodoWhereInput) P

func (i *TodoWhereInput) P() (predicate.Todo, error)

P returns a predicate for filtering todos. An error is returned if the input is empty or invalid.

type Todos

type Todos []*Todo

Todos is a parsable slice of Todo.

type Tx

type Tx struct {

	// Announcement is the client for interacting with the Announcement builders.
	Announcement *AnnouncementClient
	// JudgeRecord is the client for interacting with the JudgeRecord builders.
	JudgeRecord *JudgeRecordClient
	// Problem is the client for interacting with the Problem builders.
	Problem *ProblemClient
	// Tag is the client for interacting with the Tag builders.
	Tag *TagClient
	// Team is the client for interacting with the Team builders.
	Team *TeamClient
	// Todo is the client for interacting with the Todo builders.
	Todo *TodoClient
	// User is the client for interacting with the User builders.
	User *UserClient
	// 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 User

type User struct {

	// ID of the ent.
	ID int64 `json:"id,omitempty"`
	// Nickname holds the value of the "nickname" field.
	Nickname string `json:"nickname,omitempty"`
	// Email holds the value of the "email" field.
	Email string `json:"email,omitempty"`
	// Password holds the value of the "password" field.
	Password string `json:"password,omitempty"`
	// Avatar holds the value of the "avatar" field.
	Avatar string `json:"avatar,omitempty"`
	// CreatedTime holds the value of the "created_time" field.
	CreatedTime time.Time `json:"created_time,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the UserQuery when eager-loading is set.
	Edges UserEdges `json:"edges"`
	// contains filtered or unexported fields
}

User is the model entity for the User schema.

func (*User) Announcements

func (u *User) Announcements(ctx context.Context) (*Announcement, error)

func (*User) CreatedProblems

func (u *User) CreatedProblems(ctx context.Context) ([]*Problem, error)

func (*User) Managed

func (u *User) Managed(ctx context.Context) ([]*Team, error)

func (*User) Node

func (u *User) Node(ctx context.Context) (node *Node, err error)

func (*User) Owned

func (u *User) Owned(ctx context.Context) ([]*Team, error)

func (*User) QueryAnnouncements

func (u *User) QueryAnnouncements() *AnnouncementQuery

QueryAnnouncements queries the "announcements" edge of the User entity.

func (*User) QueryCreatedProblems

func (u *User) QueryCreatedProblems() *ProblemQuery

QueryCreatedProblems queries the "created_problems" edge of the User entity.

func (*User) QueryManaged

func (u *User) QueryManaged() *TeamQuery

QueryManaged queries the "managed" edge of the User entity.

func (*User) QueryOwned

func (u *User) QueryOwned() *TeamQuery

QueryOwned queries the "owned" edge of the User entity.

func (*User) QueryRecords

func (u *User) QueryRecords() *JudgeRecordQuery

QueryRecords queries the "records" edge of the User entity.

func (*User) QuerySolvedProblems

func (u *User) QuerySolvedProblems() *ProblemQuery

QuerySolvedProblems queries the "solved_problems" edge of the User entity.

func (*User) QueryTeams

func (u *User) QueryTeams() *TeamQuery

QueryTeams queries the "teams" edge of the User entity.

func (*User) Records

func (u *User) Records(ctx context.Context) (*JudgeRecord, error)

func (*User) SolvedProblems

func (u *User) SolvedProblems(ctx context.Context) ([]*Problem, error)

func (*User) String

func (u *User) String() string

String implements the fmt.Stringer.

func (*User) Teams

func (u *User) Teams(ctx context.Context) ([]*Team, error)

func (*User) ToEdge

func (u *User) ToEdge(order *UserOrder) *UserEdge

ToEdge converts User into UserEdge.

func (*User) Unwrap

func (u *User) Unwrap() *User

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

func (*User) Update

func (u *User) Update() *UserUpdateOne

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

type UserClient

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

UserClient is a client for the User schema.

func NewUserClient

func NewUserClient(c config) *UserClient

NewUserClient returns a client for the User from the given config.

func (*UserClient) Create

func (c *UserClient) Create() *UserCreate

Create returns a create builder for User.

func (*UserClient) CreateBulk

func (c *UserClient) CreateBulk(builders ...*UserCreate) *UserCreateBulk

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

func (*UserClient) Delete

func (c *UserClient) Delete() *UserDelete

Delete returns a delete builder for User.

func (*UserClient) DeleteOne

func (c *UserClient) DeleteOne(u *User) *UserDeleteOne

DeleteOne returns a delete builder for the given entity.

func (*UserClient) DeleteOneID

func (c *UserClient) DeleteOneID(id int64) *UserDeleteOne

DeleteOneID returns a delete builder for the given id.

func (*UserClient) Get

func (c *UserClient) Get(ctx context.Context, id int64) (*User, error)

Get returns a User entity by its id.

func (*UserClient) GetX

func (c *UserClient) GetX(ctx context.Context, id int64) *User

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

func (*UserClient) Hooks

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

Hooks returns the client hooks.

func (*UserClient) Query

func (c *UserClient) Query() *UserQuery

Query returns a query builder for User.

func (*UserClient) QueryAnnouncements

func (c *UserClient) QueryAnnouncements(u *User) *AnnouncementQuery

QueryAnnouncements queries the announcements edge of a User.

func (*UserClient) QueryCreatedProblems

func (c *UserClient) QueryCreatedProblems(u *User) *ProblemQuery

QueryCreatedProblems queries the created_problems edge of a User.

func (*UserClient) QueryManaged

func (c *UserClient) QueryManaged(u *User) *TeamQuery

QueryManaged queries the managed edge of a User.

func (*UserClient) QueryOwned

func (c *UserClient) QueryOwned(u *User) *TeamQuery

QueryOwned queries the owned edge of a User.

func (*UserClient) QueryRecords

func (c *UserClient) QueryRecords(u *User) *JudgeRecordQuery

QueryRecords queries the records edge of a User.

func (*UserClient) QuerySolvedProblems

func (c *UserClient) QuerySolvedProblems(u *User) *ProblemQuery

QuerySolvedProblems queries the solved_problems edge of a User.

func (*UserClient) QueryTeams

func (c *UserClient) QueryTeams(u *User) *TeamQuery

QueryTeams queries the teams edge of a User.

func (*UserClient) Update

func (c *UserClient) Update() *UserUpdate

Update returns an update builder for User.

func (*UserClient) UpdateOne

func (c *UserClient) UpdateOne(u *User) *UserUpdateOne

UpdateOne returns an update builder for the given entity.

func (*UserClient) UpdateOneID

func (c *UserClient) UpdateOneID(id int64) *UserUpdateOne

UpdateOneID returns an update builder for the given id.

func (*UserClient) Use

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

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

type UserConnection

type UserConnection struct {
	Edges      []*UserEdge `json:"edges"`
	PageInfo   PageInfo    `json:"pageInfo"`
	TotalCount int         `json:"totalCount"`
}

UserConnection is the connection containing edges to User.

type UserCreate

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

UserCreate is the builder for creating a User entity.

func (*UserCreate) AddCreatedProblemIDs

func (uc *UserCreate) AddCreatedProblemIDs(ids ...int64) *UserCreate

AddCreatedProblemIDs adds the "created_problems" edge to the Problem entity by IDs.

func (*UserCreate) AddCreatedProblems

func (uc *UserCreate) AddCreatedProblems(p ...*Problem) *UserCreate

AddCreatedProblems adds the "created_problems" edges to the Problem entity.

func (*UserCreate) AddManaged

func (uc *UserCreate) AddManaged(t ...*Team) *UserCreate

AddManaged adds the "managed" edges to the Team entity.

func (*UserCreate) AddManagedIDs

func (uc *UserCreate) AddManagedIDs(ids ...int64) *UserCreate

AddManagedIDs adds the "managed" edge to the Team entity by IDs.

func (*UserCreate) AddOwned

func (uc *UserCreate) AddOwned(t ...*Team) *UserCreate

AddOwned adds the "owned" edges to the Team entity.

func (*UserCreate) AddOwnedIDs

func (uc *UserCreate) AddOwnedIDs(ids ...int64) *UserCreate

AddOwnedIDs adds the "owned" edge to the Team entity by IDs.

func (*UserCreate) AddSolvedProblemIDs

func (uc *UserCreate) AddSolvedProblemIDs(ids ...int64) *UserCreate

AddSolvedProblemIDs adds the "solved_problems" edge to the Problem entity by IDs.

func (*UserCreate) AddSolvedProblems

func (uc *UserCreate) AddSolvedProblems(p ...*Problem) *UserCreate

AddSolvedProblems adds the "solved_problems" edges to the Problem entity.

func (*UserCreate) AddTeamIDs

func (uc *UserCreate) AddTeamIDs(ids ...int64) *UserCreate

AddTeamIDs adds the "teams" edge to the Team entity by IDs.

func (*UserCreate) AddTeams

func (uc *UserCreate) AddTeams(t ...*Team) *UserCreate

AddTeams adds the "teams" edges to the Team entity.

func (*UserCreate) Exec

func (uc *UserCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*UserCreate) ExecX

func (uc *UserCreate) ExecX(ctx context.Context)

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

func (*UserCreate) Mutation

func (uc *UserCreate) Mutation() *UserMutation

Mutation returns the UserMutation object of the builder.

func (*UserCreate) Save

func (uc *UserCreate) Save(ctx context.Context) (*User, error)

Save creates the User in the database.

func (*UserCreate) SaveX

func (uc *UserCreate) SaveX(ctx context.Context) *User

SaveX calls Save and panics if Save returns an error.

func (*UserCreate) SetAnnouncements

func (uc *UserCreate) SetAnnouncements(a *Announcement) *UserCreate

SetAnnouncements sets the "announcements" edge to the Announcement entity.

func (*UserCreate) SetAnnouncementsID

func (uc *UserCreate) SetAnnouncementsID(id int64) *UserCreate

SetAnnouncementsID sets the "announcements" edge to the Announcement entity by ID.

func (*UserCreate) SetAvatar

func (uc *UserCreate) SetAvatar(s string) *UserCreate

SetAvatar sets the "avatar" field.

func (*UserCreate) SetCreatedTime

func (uc *UserCreate) SetCreatedTime(t time.Time) *UserCreate

SetCreatedTime sets the "created_time" field.

func (*UserCreate) SetEmail

func (uc *UserCreate) SetEmail(s string) *UserCreate

SetEmail sets the "email" field.

func (*UserCreate) SetID

func (uc *UserCreate) SetID(i int64) *UserCreate

SetID sets the "id" field.

func (*UserCreate) SetNickname

func (uc *UserCreate) SetNickname(s string) *UserCreate

SetNickname sets the "nickname" field.

func (*UserCreate) SetNillableAnnouncementsID

func (uc *UserCreate) SetNillableAnnouncementsID(id *int64) *UserCreate

SetNillableAnnouncementsID sets the "announcements" edge to the Announcement entity by ID if the given value is not nil.

func (*UserCreate) SetNillableAvatar

func (uc *UserCreate) SetNillableAvatar(s *string) *UserCreate

SetNillableAvatar sets the "avatar" field if the given value is not nil.

func (*UserCreate) SetNillableCreatedTime

func (uc *UserCreate) SetNillableCreatedTime(t *time.Time) *UserCreate

SetNillableCreatedTime sets the "created_time" field if the given value is not nil.

func (*UserCreate) SetNillableRecordsID

func (uc *UserCreate) SetNillableRecordsID(id *int64) *UserCreate

SetNillableRecordsID sets the "records" edge to the JudgeRecord entity by ID if the given value is not nil.

func (*UserCreate) SetPassword

func (uc *UserCreate) SetPassword(s string) *UserCreate

SetPassword sets the "password" field.

func (*UserCreate) SetRecords

func (uc *UserCreate) SetRecords(j *JudgeRecord) *UserCreate

SetRecords sets the "records" edge to the JudgeRecord entity.

func (*UserCreate) SetRecordsID

func (uc *UserCreate) SetRecordsID(id int64) *UserCreate

SetRecordsID sets the "records" edge to the JudgeRecord entity by ID.

type UserCreateBulk

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

UserCreateBulk is the builder for creating many User entities in bulk.

func (*UserCreateBulk) Exec

func (ucb *UserCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*UserCreateBulk) ExecX

func (ucb *UserCreateBulk) ExecX(ctx context.Context)

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

func (*UserCreateBulk) Save

func (ucb *UserCreateBulk) Save(ctx context.Context) ([]*User, error)

Save creates the User entities in the database.

func (*UserCreateBulk) SaveX

func (ucb *UserCreateBulk) SaveX(ctx context.Context) []*User

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

type UserDelete

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

UserDelete is the builder for deleting a User entity.

func (*UserDelete) Exec

func (ud *UserDelete) Exec(ctx context.Context) (int, error)

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

func (*UserDelete) ExecX

func (ud *UserDelete) ExecX(ctx context.Context) int

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

func (*UserDelete) Where

func (ud *UserDelete) Where(ps ...predicate.User) *UserDelete

Where appends a list predicates to the UserDelete builder.

type UserDeleteOne

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

UserDeleteOne is the builder for deleting a single User entity.

func (*UserDeleteOne) Exec

func (udo *UserDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*UserDeleteOne) ExecX

func (udo *UserDeleteOne) ExecX(ctx context.Context)

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

type UserEdge

type UserEdge struct {
	Node   *User  `json:"node"`
	Cursor Cursor `json:"cursor"`
}

UserEdge is the edge representation of User.

type UserEdges

type UserEdges struct {
	// Teams holds the value of the teams edge.
	Teams []*Team `json:"teams,omitempty"`
	// Announcements holds the value of the announcements edge.
	Announcements *Announcement `json:"announcements,omitempty"`
	// Records holds the value of the records edge.
	Records *JudgeRecord `json:"records,omitempty"`
	// CreatedProblems holds the value of the created_problems edge.
	CreatedProblems []*Problem `json:"created_problems,omitempty"`
	// SolvedProblems holds the value of the solved_problems edge.
	SolvedProblems []*Problem `json:"solved_problems,omitempty"`
	// Managed holds the value of the managed edge.
	Managed []*Team `json:"managed,omitempty"`
	// Owned holds the value of the owned edge.
	Owned []*Team `json:"owned,omitempty"`
	// contains filtered or unexported fields
}

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

func (UserEdges) AnnouncementsOrErr

func (e UserEdges) AnnouncementsOrErr() (*Announcement, error)

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

func (UserEdges) CreatedProblemsOrErr

func (e UserEdges) CreatedProblemsOrErr() ([]*Problem, error)

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

func (UserEdges) ManagedOrErr

func (e UserEdges) ManagedOrErr() ([]*Team, error)

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

func (UserEdges) OwnedOrErr

func (e UserEdges) OwnedOrErr() ([]*Team, error)

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

func (UserEdges) RecordsOrErr

func (e UserEdges) RecordsOrErr() (*JudgeRecord, error)

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

func (UserEdges) SolvedProblemsOrErr

func (e UserEdges) SolvedProblemsOrErr() ([]*Problem, error)

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

func (UserEdges) TeamsOrErr

func (e UserEdges) TeamsOrErr() ([]*Team, error)

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

type UserGroupBy

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

UserGroupBy is the group-by builder for User entities.

func (*UserGroupBy) Aggregate

func (ugb *UserGroupBy) Aggregate(fns ...AggregateFunc) *UserGroupBy

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

func (*UserGroupBy) Bool

func (ugb *UserGroupBy) Bool(ctx context.Context) (_ bool, err error)

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

func (*UserGroupBy) BoolX

func (ugb *UserGroupBy) BoolX(ctx context.Context) bool

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

func (*UserGroupBy) Bools

func (ugb *UserGroupBy) Bools(ctx context.Context) ([]bool, error)

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

func (*UserGroupBy) BoolsX

func (ugb *UserGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*UserGroupBy) Float64

func (ugb *UserGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a group-by query. It is only allowed when executing a group-by query with one field.

func (*UserGroupBy) Float64X

func (ugb *UserGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*UserGroupBy) Float64s

func (ugb *UserGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from group-by. It is only allowed when executing a group-by query with one field.

func (*UserGroupBy) Float64sX

func (ugb *UserGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*UserGroupBy) Int

func (ugb *UserGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a group-by query. It is only allowed when executing a group-by query with one field.

func (*UserGroupBy) IntX

func (ugb *UserGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*UserGroupBy) Ints

func (ugb *UserGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from group-by. It is only allowed when executing a group-by query with one field.

func (*UserGroupBy) IntsX

func (ugb *UserGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*UserGroupBy) Scan

func (ugb *UserGroupBy) Scan(ctx context.Context, v interface{}) error

Scan applies the group-by query and scans the result into the given value.

func (*UserGroupBy) ScanX

func (ugb *UserGroupBy) ScanX(ctx context.Context, v interface{})

ScanX is like Scan, but panics if an error occurs.

func (*UserGroupBy) String

func (ugb *UserGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a group-by query. It is only allowed when executing a group-by query with one field.

func (*UserGroupBy) StringX

func (ugb *UserGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*UserGroupBy) Strings

func (ugb *UserGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from group-by. It is only allowed when executing a group-by query with one field.

func (*UserGroupBy) StringsX

func (ugb *UserGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type UserMutation

type UserMutation struct {
	// contains filtered or unexported fields
}

UserMutation represents an operation that mutates the User nodes in the graph.

func (*UserMutation) AddCreatedProblemIDs

func (m *UserMutation) AddCreatedProblemIDs(ids ...int64)

AddCreatedProblemIDs adds the "created_problems" edge to the Problem entity by ids.

func (*UserMutation) AddField

func (m *UserMutation) AddField(name string, value ent.Value) error

AddField adds the value to the field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*UserMutation) AddManagedIDs

func (m *UserMutation) AddManagedIDs(ids ...int64)

AddManagedIDs adds the "managed" edge to the Team entity by ids.

func (*UserMutation) AddOwnedIDs

func (m *UserMutation) AddOwnedIDs(ids ...int64)

AddOwnedIDs adds the "owned" edge to the Team entity by ids.

func (*UserMutation) AddSolvedProblemIDs

func (m *UserMutation) AddSolvedProblemIDs(ids ...int64)

AddSolvedProblemIDs adds the "solved_problems" edge to the Problem entity by ids.

func (*UserMutation) AddTeamIDs

func (m *UserMutation) AddTeamIDs(ids ...int64)

AddTeamIDs adds the "teams" edge to the Team entity by ids.

func (*UserMutation) AddedEdges

func (m *UserMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*UserMutation) AddedField

func (m *UserMutation) AddedField(name string) (ent.Value, bool)

AddedField returns the numeric value that was incremented/decremented on a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*UserMutation) AddedFields

func (m *UserMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*UserMutation) AddedIDs

func (m *UserMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*UserMutation) AnnouncementsCleared

func (m *UserMutation) AnnouncementsCleared() bool

AnnouncementsCleared reports if the "announcements" edge to the Announcement entity was cleared.

func (*UserMutation) AnnouncementsID

func (m *UserMutation) AnnouncementsID() (id int64, exists bool)

AnnouncementsID returns the "announcements" edge ID in the mutation.

func (*UserMutation) AnnouncementsIDs

func (m *UserMutation) AnnouncementsIDs() (ids []int64)

AnnouncementsIDs returns the "announcements" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use AnnouncementsID instead. It exists only for internal usage by the builders.

func (*UserMutation) Avatar

func (m *UserMutation) Avatar() (r string, exists bool)

Avatar returns the value of the "avatar" field in the mutation.

func (*UserMutation) ClearAnnouncements

func (m *UserMutation) ClearAnnouncements()

ClearAnnouncements clears the "announcements" edge to the Announcement entity.

func (*UserMutation) ClearCreatedProblems

func (m *UserMutation) ClearCreatedProblems()

ClearCreatedProblems clears the "created_problems" edge to the Problem entity.

func (*UserMutation) ClearEdge

func (m *UserMutation) ClearEdge(name string) error

ClearEdge clears the value of the edge with the given name. It returns an error if that edge is not defined in the schema.

func (*UserMutation) ClearField

func (m *UserMutation) ClearField(name string) error

ClearField clears the value of the field with the given name. It returns an error if the field is not defined in the schema.

func (*UserMutation) ClearManaged

func (m *UserMutation) ClearManaged()

ClearManaged clears the "managed" edge to the Team entity.

func (*UserMutation) ClearOwned

func (m *UserMutation) ClearOwned()

ClearOwned clears the "owned" edge to the Team entity.

func (*UserMutation) ClearRecords

func (m *UserMutation) ClearRecords()

ClearRecords clears the "records" edge to the JudgeRecord entity.

func (*UserMutation) ClearSolvedProblems

func (m *UserMutation) ClearSolvedProblems()

ClearSolvedProblems clears the "solved_problems" edge to the Problem entity.

func (*UserMutation) ClearTeams

func (m *UserMutation) ClearTeams()

ClearTeams clears the "teams" edge to the Team entity.

func (*UserMutation) ClearedEdges

func (m *UserMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*UserMutation) ClearedFields

func (m *UserMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (UserMutation) Client

func (m UserMutation) Client() *Client

Client returns a new `ent.Client` from the mutation. If the mutation was executed in a transaction (ent.Tx), a transactional client is returned.

func (*UserMutation) CreatedProblemsCleared

func (m *UserMutation) CreatedProblemsCleared() bool

CreatedProblemsCleared reports if the "created_problems" edge to the Problem entity was cleared.

func (*UserMutation) CreatedProblemsIDs

func (m *UserMutation) CreatedProblemsIDs() (ids []int64)

CreatedProblemsIDs returns the "created_problems" edge IDs in the mutation.

func (*UserMutation) CreatedTime

func (m *UserMutation) CreatedTime() (r time.Time, exists bool)

CreatedTime returns the value of the "created_time" field in the mutation.

func (*UserMutation) EdgeCleared

func (m *UserMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*UserMutation) Email

func (m *UserMutation) Email() (r string, exists bool)

Email returns the value of the "email" field in the mutation.

func (*UserMutation) Field

func (m *UserMutation) Field(name string) (ent.Value, bool)

Field returns the value of a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*UserMutation) FieldCleared

func (m *UserMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*UserMutation) Fields

func (m *UserMutation) Fields() []string

Fields returns all fields that were changed during this mutation. Note that in order to get all numeric fields that were incremented/decremented, call AddedFields().

func (*UserMutation) ID

func (m *UserMutation) ID() (id int64, exists bool)

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.

func (*UserMutation) IDs

func (m *UserMutation) IDs(ctx context.Context) ([]int64, error)

IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.

func (*UserMutation) ManagedCleared

func (m *UserMutation) ManagedCleared() bool

ManagedCleared reports if the "managed" edge to the Team entity was cleared.

func (*UserMutation) ManagedIDs

func (m *UserMutation) ManagedIDs() (ids []int64)

ManagedIDs returns the "managed" edge IDs in the mutation.

func (*UserMutation) Nickname

func (m *UserMutation) Nickname() (r string, exists bool)

Nickname returns the value of the "nickname" field in the mutation.

func (*UserMutation) OldAvatar

func (m *UserMutation) OldAvatar(ctx context.Context) (v string, err error)

OldAvatar returns the old "avatar" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*UserMutation) OldCreatedTime

func (m *UserMutation) OldCreatedTime(ctx context.Context) (v time.Time, err error)

OldCreatedTime returns the old "created_time" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*UserMutation) OldEmail

func (m *UserMutation) OldEmail(ctx context.Context) (v string, err error)

OldEmail returns the old "email" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*UserMutation) OldField

func (m *UserMutation) OldField(ctx context.Context, name string) (ent.Value, error)

OldField returns the old value of the field from the database. An error is returned if the mutation operation is not UpdateOne, or the query to the database failed.

func (*UserMutation) OldNickname

func (m *UserMutation) OldNickname(ctx context.Context) (v string, err error)

OldNickname returns the old "nickname" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*UserMutation) OldPassword

func (m *UserMutation) OldPassword(ctx context.Context) (v string, err error)

OldPassword returns the old "password" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*UserMutation) Op

func (m *UserMutation) Op() Op

Op returns the operation name.

func (*UserMutation) OwnedCleared

func (m *UserMutation) OwnedCleared() bool

OwnedCleared reports if the "owned" edge to the Team entity was cleared.

func (*UserMutation) OwnedIDs

func (m *UserMutation) OwnedIDs() (ids []int64)

OwnedIDs returns the "owned" edge IDs in the mutation.

func (*UserMutation) Password

func (m *UserMutation) Password() (r string, exists bool)

Password returns the value of the "password" field in the mutation.

func (*UserMutation) RecordsCleared

func (m *UserMutation) RecordsCleared() bool

RecordsCleared reports if the "records" edge to the JudgeRecord entity was cleared.

func (*UserMutation) RecordsID

func (m *UserMutation) RecordsID() (id int64, exists bool)

RecordsID returns the "records" edge ID in the mutation.

func (*UserMutation) RecordsIDs

func (m *UserMutation) RecordsIDs() (ids []int64)

RecordsIDs returns the "records" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use RecordsID instead. It exists only for internal usage by the builders.

func (*UserMutation) RemoveCreatedProblemIDs

func (m *UserMutation) RemoveCreatedProblemIDs(ids ...int64)

RemoveCreatedProblemIDs removes the "created_problems" edge to the Problem entity by IDs.

func (*UserMutation) RemoveManagedIDs

func (m *UserMutation) RemoveManagedIDs(ids ...int64)

RemoveManagedIDs removes the "managed" edge to the Team entity by IDs.

func (*UserMutation) RemoveOwnedIDs

func (m *UserMutation) RemoveOwnedIDs(ids ...int64)

RemoveOwnedIDs removes the "owned" edge to the Team entity by IDs.

func (*UserMutation) RemoveSolvedProblemIDs

func (m *UserMutation) RemoveSolvedProblemIDs(ids ...int64)

RemoveSolvedProblemIDs removes the "solved_problems" edge to the Problem entity by IDs.

func (*UserMutation) RemoveTeamIDs

func (m *UserMutation) RemoveTeamIDs(ids ...int64)

RemoveTeamIDs removes the "teams" edge to the Team entity by IDs.

func (*UserMutation) RemovedCreatedProblemsIDs

func (m *UserMutation) RemovedCreatedProblemsIDs() (ids []int64)

RemovedCreatedProblems returns the removed IDs of the "created_problems" edge to the Problem entity.

func (*UserMutation) RemovedEdges

func (m *UserMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*UserMutation) RemovedIDs

func (m *UserMutation) RemovedIDs(name string) []ent.Value

RemovedIDs returns all IDs (to other nodes) that were removed for the edge with the given name in this mutation.

func (*UserMutation) RemovedManagedIDs

func (m *UserMutation) RemovedManagedIDs() (ids []int64)

RemovedManaged returns the removed IDs of the "managed" edge to the Team entity.

func (*UserMutation) RemovedOwnedIDs

func (m *UserMutation) RemovedOwnedIDs() (ids []int64)

RemovedOwned returns the removed IDs of the "owned" edge to the Team entity.

func (*UserMutation) RemovedSolvedProblemsIDs

func (m *UserMutation) RemovedSolvedProblemsIDs() (ids []int64)

RemovedSolvedProblems returns the removed IDs of the "solved_problems" edge to the Problem entity.

func (*UserMutation) RemovedTeamsIDs

func (m *UserMutation) RemovedTeamsIDs() (ids []int64)

RemovedTeams returns the removed IDs of the "teams" edge to the Team entity.

func (*UserMutation) ResetAnnouncements

func (m *UserMutation) ResetAnnouncements()

ResetAnnouncements resets all changes to the "announcements" edge.

func (*UserMutation) ResetAvatar

func (m *UserMutation) ResetAvatar()

ResetAvatar resets all changes to the "avatar" field.

func (*UserMutation) ResetCreatedProblems

func (m *UserMutation) ResetCreatedProblems()

ResetCreatedProblems resets all changes to the "created_problems" edge.

func (*UserMutation) ResetCreatedTime

func (m *UserMutation) ResetCreatedTime()

ResetCreatedTime resets all changes to the "created_time" field.

func (*UserMutation) ResetEdge

func (m *UserMutation) ResetEdge(name string) error

ResetEdge resets all changes to the edge with the given name in this mutation. It returns an error if the edge is not defined in the schema.

func (*UserMutation) ResetEmail

func (m *UserMutation) ResetEmail()

ResetEmail resets all changes to the "email" field.

func (*UserMutation) ResetField

func (m *UserMutation) ResetField(name string) error

ResetField resets all changes in the mutation for the field with the given name. It returns an error if the field is not defined in the schema.

func (*UserMutation) ResetManaged

func (m *UserMutation) ResetManaged()

ResetManaged resets all changes to the "managed" edge.

func (*UserMutation) ResetNickname

func (m *UserMutation) ResetNickname()

ResetNickname resets all changes to the "nickname" field.

func (*UserMutation) ResetOwned

func (m *UserMutation) ResetOwned()

ResetOwned resets all changes to the "owned" edge.

func (*UserMutation) ResetPassword

func (m *UserMutation) ResetPassword()

ResetPassword resets all changes to the "password" field.

func (*UserMutation) ResetRecords

func (m *UserMutation) ResetRecords()

ResetRecords resets all changes to the "records" edge.

func (*UserMutation) ResetSolvedProblems

func (m *UserMutation) ResetSolvedProblems()

ResetSolvedProblems resets all changes to the "solved_problems" edge.

func (*UserMutation) ResetTeams

func (m *UserMutation) ResetTeams()

ResetTeams resets all changes to the "teams" edge.

func (*UserMutation) SetAnnouncementsID

func (m *UserMutation) SetAnnouncementsID(id int64)

SetAnnouncementsID sets the "announcements" edge to the Announcement entity by id.

func (*UserMutation) SetAvatar

func (m *UserMutation) SetAvatar(s string)

SetAvatar sets the "avatar" field.

func (*UserMutation) SetCreatedTime

func (m *UserMutation) SetCreatedTime(t time.Time)

SetCreatedTime sets the "created_time" field.

func (*UserMutation) SetEmail

func (m *UserMutation) SetEmail(s string)

SetEmail sets the "email" field.

func (*UserMutation) SetField

func (m *UserMutation) SetField(name string, value ent.Value) error

SetField sets the value of a field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*UserMutation) SetID

func (m *UserMutation) SetID(id int64)

SetID sets the value of the id field. Note that this operation is only accepted on creation of User entities.

func (*UserMutation) SetNickname

func (m *UserMutation) SetNickname(s string)

SetNickname sets the "nickname" field.

func (*UserMutation) SetPassword

func (m *UserMutation) SetPassword(s string)

SetPassword sets the "password" field.

func (*UserMutation) SetRecordsID

func (m *UserMutation) SetRecordsID(id int64)

SetRecordsID sets the "records" edge to the JudgeRecord entity by id.

func (*UserMutation) SolvedProblemsCleared

func (m *UserMutation) SolvedProblemsCleared() bool

SolvedProblemsCleared reports if the "solved_problems" edge to the Problem entity was cleared.

func (*UserMutation) SolvedProblemsIDs

func (m *UserMutation) SolvedProblemsIDs() (ids []int64)

SolvedProblemsIDs returns the "solved_problems" edge IDs in the mutation.

func (*UserMutation) TeamsCleared

func (m *UserMutation) TeamsCleared() bool

TeamsCleared reports if the "teams" edge to the Team entity was cleared.

func (*UserMutation) TeamsIDs

func (m *UserMutation) TeamsIDs() (ids []int64)

TeamsIDs returns the "teams" edge IDs in the mutation.

func (UserMutation) Tx

func (m UserMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*UserMutation) Type

func (m *UserMutation) Type() string

Type returns the node type of this mutation (User).

func (*UserMutation) Where

func (m *UserMutation) Where(ps ...predicate.User)

Where appends a list predicates to the UserMutation builder.

type UserOrder

type UserOrder struct {
	Direction OrderDirection  `json:"direction"`
	Field     *UserOrderField `json:"field"`
}

UserOrder defines the ordering of User.

type UserOrderField

type UserOrderField struct {
	// contains filtered or unexported fields
}

UserOrderField defines the ordering field of User.

type UserPaginateOption

type UserPaginateOption func(*userPager) error

UserPaginateOption enables pagination customization.

func WithUserFilter

func WithUserFilter(filter func(*UserQuery) (*UserQuery, error)) UserPaginateOption

WithUserFilter configures pagination filter.

func WithUserOrder

func WithUserOrder(order *UserOrder) UserPaginateOption

WithUserOrder configures pagination ordering.

type UserQuery

type UserQuery struct {
	// contains filtered or unexported fields
}

UserQuery is the builder for querying User entities.

func (*UserQuery) All

func (uq *UserQuery) All(ctx context.Context) ([]*User, error)

All executes the query and returns a list of Users.

func (*UserQuery) AllX

func (uq *UserQuery) AllX(ctx context.Context) []*User

AllX is like All, but panics if an error occurs.

func (*UserQuery) Clone

func (uq *UserQuery) Clone() *UserQuery

Clone returns a duplicate of the UserQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*UserQuery) CollectFields

func (u *UserQuery) CollectFields(ctx context.Context, satisfies ...string) *UserQuery

CollectFields tells the query-builder to eagerly load connected nodes by resolver context.

func (*UserQuery) Count

func (uq *UserQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*UserQuery) CountX

func (uq *UserQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*UserQuery) Exist

func (uq *UserQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*UserQuery) ExistX

func (uq *UserQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*UserQuery) First

func (uq *UserQuery) First(ctx context.Context) (*User, error)

First returns the first User entity from the query. Returns a *NotFoundError when no User was found.

func (*UserQuery) FirstID

func (uq *UserQuery) FirstID(ctx context.Context) (id int64, err error)

FirstID returns the first User ID from the query. Returns a *NotFoundError when no User ID was found.

func (*UserQuery) FirstIDX

func (uq *UserQuery) FirstIDX(ctx context.Context) int64

FirstIDX is like FirstID, but panics if an error occurs.

func (*UserQuery) FirstX

func (uq *UserQuery) FirstX(ctx context.Context) *User

FirstX is like First, but panics if an error occurs.

func (*UserQuery) GroupBy

func (uq *UserQuery) GroupBy(field string, fields ...string) *UserGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

Example:

var v []struct {
	Nickname string `json:"nickname,omitempty"`
	Count int `json:"count,omitempty"`
}

client.User.Query().
	GroupBy(user.FieldNickname).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*UserQuery) IDs

func (uq *UserQuery) IDs(ctx context.Context) ([]int64, error)

IDs executes the query and returns a list of User IDs.

func (*UserQuery) IDsX

func (uq *UserQuery) IDsX(ctx context.Context) []int64

IDsX is like IDs, but panics if an error occurs.

func (*UserQuery) Limit

func (uq *UserQuery) Limit(limit int) *UserQuery

Limit adds a limit step to the query.

func (*UserQuery) Offset

func (uq *UserQuery) Offset(offset int) *UserQuery

Offset adds an offset step to the query.

func (*UserQuery) Only

func (uq *UserQuery) Only(ctx context.Context) (*User, error)

Only returns a single User entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one User entity is found. Returns a *NotFoundError when no User entities are found.

func (*UserQuery) OnlyID

func (uq *UserQuery) OnlyID(ctx context.Context) (id int64, err error)

OnlyID is like Only, but returns the only User ID in the query. Returns a *NotSingularError when more than one User ID is found. Returns a *NotFoundError when no entities are found.

func (*UserQuery) OnlyIDX

func (uq *UserQuery) OnlyIDX(ctx context.Context) int64

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*UserQuery) OnlyX

func (uq *UserQuery) OnlyX(ctx context.Context) *User

OnlyX is like Only, but panics if an error occurs.

func (*UserQuery) Order

func (uq *UserQuery) Order(o ...OrderFunc) *UserQuery

Order adds an order step to the query.

func (*UserQuery) Paginate

func (u *UserQuery) Paginate(
	ctx context.Context, after *Cursor, first *int,
	before *Cursor, last *int, opts ...UserPaginateOption,
) (*UserConnection, error)

Paginate executes the query and returns a relay based cursor connection to User.

func (*UserQuery) QueryAnnouncements

func (uq *UserQuery) QueryAnnouncements() *AnnouncementQuery

QueryAnnouncements chains the current query on the "announcements" edge.

func (*UserQuery) QueryCreatedProblems

func (uq *UserQuery) QueryCreatedProblems() *ProblemQuery

QueryCreatedProblems chains the current query on the "created_problems" edge.

func (*UserQuery) QueryManaged

func (uq *UserQuery) QueryManaged() *TeamQuery

QueryManaged chains the current query on the "managed" edge.

func (*UserQuery) QueryOwned

func (uq *UserQuery) QueryOwned() *TeamQuery

QueryOwned chains the current query on the "owned" edge.

func (*UserQuery) QueryRecords

func (uq *UserQuery) QueryRecords() *JudgeRecordQuery

QueryRecords chains the current query on the "records" edge.

func (*UserQuery) QuerySolvedProblems

func (uq *UserQuery) QuerySolvedProblems() *ProblemQuery

QuerySolvedProblems chains the current query on the "solved_problems" edge.

func (*UserQuery) QueryTeams

func (uq *UserQuery) QueryTeams() *TeamQuery

QueryTeams chains the current query on the "teams" edge.

func (*UserQuery) Select

func (uq *UserQuery) Select(fields ...string) *UserSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	Nickname string `json:"nickname,omitempty"`
}

client.User.Query().
	Select(user.FieldNickname).
	Scan(ctx, &v)

func (*UserQuery) Unique

func (uq *UserQuery) Unique(unique bool) *UserQuery

Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.

func (*UserQuery) Where

func (uq *UserQuery) Where(ps ...predicate.User) *UserQuery

Where adds a new predicate for the UserQuery builder.

func (*UserQuery) WithAnnouncements

func (uq *UserQuery) WithAnnouncements(opts ...func(*AnnouncementQuery)) *UserQuery

WithAnnouncements tells the query-builder to eager-load the nodes that are connected to the "announcements" edge. The optional arguments are used to configure the query builder of the edge.

func (*UserQuery) WithCreatedProblems

func (uq *UserQuery) WithCreatedProblems(opts ...func(*ProblemQuery)) *UserQuery

WithCreatedProblems tells the query-builder to eager-load the nodes that are connected to the "created_problems" edge. The optional arguments are used to configure the query builder of the edge.

func (*UserQuery) WithManaged

func (uq *UserQuery) WithManaged(opts ...func(*TeamQuery)) *UserQuery

WithManaged tells the query-builder to eager-load the nodes that are connected to the "managed" edge. The optional arguments are used to configure the query builder of the edge.

func (*UserQuery) WithOwned

func (uq *UserQuery) WithOwned(opts ...func(*TeamQuery)) *UserQuery

WithOwned tells the query-builder to eager-load the nodes that are connected to the "owned" edge. The optional arguments are used to configure the query builder of the edge.

func (*UserQuery) WithRecords

func (uq *UserQuery) WithRecords(opts ...func(*JudgeRecordQuery)) *UserQuery

WithRecords tells the query-builder to eager-load the nodes that are connected to the "records" edge. The optional arguments are used to configure the query builder of the edge.

func (*UserQuery) WithSolvedProblems

func (uq *UserQuery) WithSolvedProblems(opts ...func(*ProblemQuery)) *UserQuery

WithSolvedProblems tells the query-builder to eager-load the nodes that are connected to the "solved_problems" edge. The optional arguments are used to configure the query builder of the edge.

func (*UserQuery) WithTeams

func (uq *UserQuery) WithTeams(opts ...func(*TeamQuery)) *UserQuery

WithTeams tells the query-builder to eager-load the nodes that are connected to the "teams" edge. The optional arguments are used to configure the query builder of the edge.

type UserSelect

type UserSelect struct {
	*UserQuery
	// contains filtered or unexported fields
}

UserSelect is the builder for selecting fields of User entities.

func (*UserSelect) Bool

func (us *UserSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*UserSelect) BoolX

func (us *UserSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*UserSelect) Bools

func (us *UserSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*UserSelect) BoolsX

func (us *UserSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*UserSelect) Float64

func (us *UserSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*UserSelect) Float64X

func (us *UserSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*UserSelect) Float64s

func (us *UserSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*UserSelect) Float64sX

func (us *UserSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*UserSelect) Int

func (us *UserSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*UserSelect) IntX

func (us *UserSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*UserSelect) Ints

func (us *UserSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*UserSelect) IntsX

func (us *UserSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*UserSelect) Scan

func (us *UserSelect) Scan(ctx context.Context, v interface{}) error

Scan applies the selector query and scans the result into the given value.

func (*UserSelect) ScanX

func (us *UserSelect) ScanX(ctx context.Context, v interface{})

ScanX is like Scan, but panics if an error occurs.

func (*UserSelect) String

func (us *UserSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*UserSelect) StringX

func (us *UserSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*UserSelect) Strings

func (us *UserSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*UserSelect) StringsX

func (us *UserSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type UserUpdate

type UserUpdate struct {
	// contains filtered or unexported fields
}

UserUpdate is the builder for updating User entities.

func (*UserUpdate) AddCreatedProblemIDs

func (uu *UserUpdate) AddCreatedProblemIDs(ids ...int64) *UserUpdate

AddCreatedProblemIDs adds the "created_problems" edge to the Problem entity by IDs.

func (*UserUpdate) AddCreatedProblems

func (uu *UserUpdate) AddCreatedProblems(p ...*Problem) *UserUpdate

AddCreatedProblems adds the "created_problems" edges to the Problem entity.

func (*UserUpdate) AddManaged

func (uu *UserUpdate) AddManaged(t ...*Team) *UserUpdate

AddManaged adds the "managed" edges to the Team entity.

func (*UserUpdate) AddManagedIDs

func (uu *UserUpdate) AddManagedIDs(ids ...int64) *UserUpdate

AddManagedIDs adds the "managed" edge to the Team entity by IDs.

func (*UserUpdate) AddOwned

func (uu *UserUpdate) AddOwned(t ...*Team) *UserUpdate

AddOwned adds the "owned" edges to the Team entity.

func (*UserUpdate) AddOwnedIDs

func (uu *UserUpdate) AddOwnedIDs(ids ...int64) *UserUpdate

AddOwnedIDs adds the "owned" edge to the Team entity by IDs.

func (*UserUpdate) AddSolvedProblemIDs

func (uu *UserUpdate) AddSolvedProblemIDs(ids ...int64) *UserUpdate

AddSolvedProblemIDs adds the "solved_problems" edge to the Problem entity by IDs.

func (*UserUpdate) AddSolvedProblems

func (uu *UserUpdate) AddSolvedProblems(p ...*Problem) *UserUpdate

AddSolvedProblems adds the "solved_problems" edges to the Problem entity.

func (*UserUpdate) AddTeamIDs

func (uu *UserUpdate) AddTeamIDs(ids ...int64) *UserUpdate

AddTeamIDs adds the "teams" edge to the Team entity by IDs.

func (*UserUpdate) AddTeams

func (uu *UserUpdate) AddTeams(t ...*Team) *UserUpdate

AddTeams adds the "teams" edges to the Team entity.

func (*UserUpdate) ClearAnnouncements

func (uu *UserUpdate) ClearAnnouncements() *UserUpdate

ClearAnnouncements clears the "announcements" edge to the Announcement entity.

func (*UserUpdate) ClearCreatedProblems

func (uu *UserUpdate) ClearCreatedProblems() *UserUpdate

ClearCreatedProblems clears all "created_problems" edges to the Problem entity.

func (*UserUpdate) ClearManaged

func (uu *UserUpdate) ClearManaged() *UserUpdate

ClearManaged clears all "managed" edges to the Team entity.

func (*UserUpdate) ClearOwned

func (uu *UserUpdate) ClearOwned() *UserUpdate

ClearOwned clears all "owned" edges to the Team entity.

func (*UserUpdate) ClearRecords

func (uu *UserUpdate) ClearRecords() *UserUpdate

ClearRecords clears the "records" edge to the JudgeRecord entity.

func (*UserUpdate) ClearSolvedProblems

func (uu *UserUpdate) ClearSolvedProblems() *UserUpdate

ClearSolvedProblems clears all "solved_problems" edges to the Problem entity.

func (*UserUpdate) ClearTeams

func (uu *UserUpdate) ClearTeams() *UserUpdate

ClearTeams clears all "teams" edges to the Team entity.

func (*UserUpdate) Exec

func (uu *UserUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*UserUpdate) ExecX

func (uu *UserUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserUpdate) Mutation

func (uu *UserUpdate) Mutation() *UserMutation

Mutation returns the UserMutation object of the builder.

func (*UserUpdate) RemoveCreatedProblemIDs

func (uu *UserUpdate) RemoveCreatedProblemIDs(ids ...int64) *UserUpdate

RemoveCreatedProblemIDs removes the "created_problems" edge to Problem entities by IDs.

func (*UserUpdate) RemoveCreatedProblems

func (uu *UserUpdate) RemoveCreatedProblems(p ...*Problem) *UserUpdate

RemoveCreatedProblems removes "created_problems" edges to Problem entities.

func (*UserUpdate) RemoveManaged

func (uu *UserUpdate) RemoveManaged(t ...*Team) *UserUpdate

RemoveManaged removes "managed" edges to Team entities.

func (*UserUpdate) RemoveManagedIDs

func (uu *UserUpdate) RemoveManagedIDs(ids ...int64) *UserUpdate

RemoveManagedIDs removes the "managed" edge to Team entities by IDs.

func (*UserUpdate) RemoveOwned

func (uu *UserUpdate) RemoveOwned(t ...*Team) *UserUpdate

RemoveOwned removes "owned" edges to Team entities.

func (*UserUpdate) RemoveOwnedIDs

func (uu *UserUpdate) RemoveOwnedIDs(ids ...int64) *UserUpdate

RemoveOwnedIDs removes the "owned" edge to Team entities by IDs.

func (*UserUpdate) RemoveSolvedProblemIDs

func (uu *UserUpdate) RemoveSolvedProblemIDs(ids ...int64) *UserUpdate

RemoveSolvedProblemIDs removes the "solved_problems" edge to Problem entities by IDs.

func (*UserUpdate) RemoveSolvedProblems

func (uu *UserUpdate) RemoveSolvedProblems(p ...*Problem) *UserUpdate

RemoveSolvedProblems removes "solved_problems" edges to Problem entities.

func (*UserUpdate) RemoveTeamIDs

func (uu *UserUpdate) RemoveTeamIDs(ids ...int64) *UserUpdate

RemoveTeamIDs removes the "teams" edge to Team entities by IDs.

func (*UserUpdate) RemoveTeams

func (uu *UserUpdate) RemoveTeams(t ...*Team) *UserUpdate

RemoveTeams removes "teams" edges to Team entities.

func (*UserUpdate) Save

func (uu *UserUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*UserUpdate) SaveX

func (uu *UserUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*UserUpdate) SetAnnouncements

func (uu *UserUpdate) SetAnnouncements(a *Announcement) *UserUpdate

SetAnnouncements sets the "announcements" edge to the Announcement entity.

func (*UserUpdate) SetAnnouncementsID

func (uu *UserUpdate) SetAnnouncementsID(id int64) *UserUpdate

SetAnnouncementsID sets the "announcements" edge to the Announcement entity by ID.

func (*UserUpdate) SetAvatar

func (uu *UserUpdate) SetAvatar(s string) *UserUpdate

SetAvatar sets the "avatar" field.

func (*UserUpdate) SetEmail

func (uu *UserUpdate) SetEmail(s string) *UserUpdate

SetEmail sets the "email" field.

func (*UserUpdate) SetNickname

func (uu *UserUpdate) SetNickname(s string) *UserUpdate

SetNickname sets the "nickname" field.

func (*UserUpdate) SetNillableAnnouncementsID

func (uu *UserUpdate) SetNillableAnnouncementsID(id *int64) *UserUpdate

SetNillableAnnouncementsID sets the "announcements" edge to the Announcement entity by ID if the given value is not nil.

func (*UserUpdate) SetNillableAvatar

func (uu *UserUpdate) SetNillableAvatar(s *string) *UserUpdate

SetNillableAvatar sets the "avatar" field if the given value is not nil.

func (*UserUpdate) SetNillableRecordsID

func (uu *UserUpdate) SetNillableRecordsID(id *int64) *UserUpdate

SetNillableRecordsID sets the "records" edge to the JudgeRecord entity by ID if the given value is not nil.

func (*UserUpdate) SetPassword

func (uu *UserUpdate) SetPassword(s string) *UserUpdate

SetPassword sets the "password" field.

func (*UserUpdate) SetRecords

func (uu *UserUpdate) SetRecords(j *JudgeRecord) *UserUpdate

SetRecords sets the "records" edge to the JudgeRecord entity.

func (*UserUpdate) SetRecordsID

func (uu *UserUpdate) SetRecordsID(id int64) *UserUpdate

SetRecordsID sets the "records" edge to the JudgeRecord entity by ID.

func (*UserUpdate) Where

func (uu *UserUpdate) Where(ps ...predicate.User) *UserUpdate

Where appends a list predicates to the UserUpdate builder.

type UserUpdateOne

type UserUpdateOne struct {
	// contains filtered or unexported fields
}

UserUpdateOne is the builder for updating a single User entity.

func (*UserUpdateOne) AddCreatedProblemIDs

func (uuo *UserUpdateOne) AddCreatedProblemIDs(ids ...int64) *UserUpdateOne

AddCreatedProblemIDs adds the "created_problems" edge to the Problem entity by IDs.

func (*UserUpdateOne) AddCreatedProblems

func (uuo *UserUpdateOne) AddCreatedProblems(p ...*Problem) *UserUpdateOne

AddCreatedProblems adds the "created_problems" edges to the Problem entity.

func (*UserUpdateOne) AddManaged

func (uuo *UserUpdateOne) AddManaged(t ...*Team) *UserUpdateOne

AddManaged adds the "managed" edges to the Team entity.

func (*UserUpdateOne) AddManagedIDs

func (uuo *UserUpdateOne) AddManagedIDs(ids ...int64) *UserUpdateOne

AddManagedIDs adds the "managed" edge to the Team entity by IDs.

func (*UserUpdateOne) AddOwned

func (uuo *UserUpdateOne) AddOwned(t ...*Team) *UserUpdateOne

AddOwned adds the "owned" edges to the Team entity.

func (*UserUpdateOne) AddOwnedIDs

func (uuo *UserUpdateOne) AddOwnedIDs(ids ...int64) *UserUpdateOne

AddOwnedIDs adds the "owned" edge to the Team entity by IDs.

func (*UserUpdateOne) AddSolvedProblemIDs

func (uuo *UserUpdateOne) AddSolvedProblemIDs(ids ...int64) *UserUpdateOne

AddSolvedProblemIDs adds the "solved_problems" edge to the Problem entity by IDs.

func (*UserUpdateOne) AddSolvedProblems

func (uuo *UserUpdateOne) AddSolvedProblems(p ...*Problem) *UserUpdateOne

AddSolvedProblems adds the "solved_problems" edges to the Problem entity.

func (*UserUpdateOne) AddTeamIDs

func (uuo *UserUpdateOne) AddTeamIDs(ids ...int64) *UserUpdateOne

AddTeamIDs adds the "teams" edge to the Team entity by IDs.

func (*UserUpdateOne) AddTeams

func (uuo *UserUpdateOne) AddTeams(t ...*Team) *UserUpdateOne

AddTeams adds the "teams" edges to the Team entity.

func (*UserUpdateOne) ClearAnnouncements

func (uuo *UserUpdateOne) ClearAnnouncements() *UserUpdateOne

ClearAnnouncements clears the "announcements" edge to the Announcement entity.

func (*UserUpdateOne) ClearCreatedProblems

func (uuo *UserUpdateOne) ClearCreatedProblems() *UserUpdateOne

ClearCreatedProblems clears all "created_problems" edges to the Problem entity.

func (*UserUpdateOne) ClearManaged

func (uuo *UserUpdateOne) ClearManaged() *UserUpdateOne

ClearManaged clears all "managed" edges to the Team entity.

func (*UserUpdateOne) ClearOwned

func (uuo *UserUpdateOne) ClearOwned() *UserUpdateOne

ClearOwned clears all "owned" edges to the Team entity.

func (*UserUpdateOne) ClearRecords

func (uuo *UserUpdateOne) ClearRecords() *UserUpdateOne

ClearRecords clears the "records" edge to the JudgeRecord entity.

func (*UserUpdateOne) ClearSolvedProblems

func (uuo *UserUpdateOne) ClearSolvedProblems() *UserUpdateOne

ClearSolvedProblems clears all "solved_problems" edges to the Problem entity.

func (*UserUpdateOne) ClearTeams

func (uuo *UserUpdateOne) ClearTeams() *UserUpdateOne

ClearTeams clears all "teams" edges to the Team entity.

func (*UserUpdateOne) Exec

func (uuo *UserUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*UserUpdateOne) ExecX

func (uuo *UserUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserUpdateOne) Mutation

func (uuo *UserUpdateOne) Mutation() *UserMutation

Mutation returns the UserMutation object of the builder.

func (*UserUpdateOne) RemoveCreatedProblemIDs

func (uuo *UserUpdateOne) RemoveCreatedProblemIDs(ids ...int64) *UserUpdateOne

RemoveCreatedProblemIDs removes the "created_problems" edge to Problem entities by IDs.

func (*UserUpdateOne) RemoveCreatedProblems

func (uuo *UserUpdateOne) RemoveCreatedProblems(p ...*Problem) *UserUpdateOne

RemoveCreatedProblems removes "created_problems" edges to Problem entities.

func (*UserUpdateOne) RemoveManaged

func (uuo *UserUpdateOne) RemoveManaged(t ...*Team) *UserUpdateOne

RemoveManaged removes "managed" edges to Team entities.

func (*UserUpdateOne) RemoveManagedIDs

func (uuo *UserUpdateOne) RemoveManagedIDs(ids ...int64) *UserUpdateOne

RemoveManagedIDs removes the "managed" edge to Team entities by IDs.

func (*UserUpdateOne) RemoveOwned

func (uuo *UserUpdateOne) RemoveOwned(t ...*Team) *UserUpdateOne

RemoveOwned removes "owned" edges to Team entities.

func (*UserUpdateOne) RemoveOwnedIDs

func (uuo *UserUpdateOne) RemoveOwnedIDs(ids ...int64) *UserUpdateOne

RemoveOwnedIDs removes the "owned" edge to Team entities by IDs.

func (*UserUpdateOne) RemoveSolvedProblemIDs

func (uuo *UserUpdateOne) RemoveSolvedProblemIDs(ids ...int64) *UserUpdateOne

RemoveSolvedProblemIDs removes the "solved_problems" edge to Problem entities by IDs.

func (*UserUpdateOne) RemoveSolvedProblems

func (uuo *UserUpdateOne) RemoveSolvedProblems(p ...*Problem) *UserUpdateOne

RemoveSolvedProblems removes "solved_problems" edges to Problem entities.

func (*UserUpdateOne) RemoveTeamIDs

func (uuo *UserUpdateOne) RemoveTeamIDs(ids ...int64) *UserUpdateOne

RemoveTeamIDs removes the "teams" edge to Team entities by IDs.

func (*UserUpdateOne) RemoveTeams

func (uuo *UserUpdateOne) RemoveTeams(t ...*Team) *UserUpdateOne

RemoveTeams removes "teams" edges to Team entities.

func (*UserUpdateOne) Save

func (uuo *UserUpdateOne) Save(ctx context.Context) (*User, error)

Save executes the query and returns the updated User entity.

func (*UserUpdateOne) SaveX

func (uuo *UserUpdateOne) SaveX(ctx context.Context) *User

SaveX is like Save, but panics if an error occurs.

func (*UserUpdateOne) Select

func (uuo *UserUpdateOne) Select(field string, fields ...string) *UserUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*UserUpdateOne) SetAnnouncements

func (uuo *UserUpdateOne) SetAnnouncements(a *Announcement) *UserUpdateOne

SetAnnouncements sets the "announcements" edge to the Announcement entity.

func (*UserUpdateOne) SetAnnouncementsID

func (uuo *UserUpdateOne) SetAnnouncementsID(id int64) *UserUpdateOne

SetAnnouncementsID sets the "announcements" edge to the Announcement entity by ID.

func (*UserUpdateOne) SetAvatar

func (uuo *UserUpdateOne) SetAvatar(s string) *UserUpdateOne

SetAvatar sets the "avatar" field.

func (*UserUpdateOne) SetEmail

func (uuo *UserUpdateOne) SetEmail(s string) *UserUpdateOne

SetEmail sets the "email" field.

func (*UserUpdateOne) SetNickname

func (uuo *UserUpdateOne) SetNickname(s string) *UserUpdateOne

SetNickname sets the "nickname" field.

func (*UserUpdateOne) SetNillableAnnouncementsID

func (uuo *UserUpdateOne) SetNillableAnnouncementsID(id *int64) *UserUpdateOne

SetNillableAnnouncementsID sets the "announcements" edge to the Announcement entity by ID if the given value is not nil.

func (*UserUpdateOne) SetNillableAvatar

func (uuo *UserUpdateOne) SetNillableAvatar(s *string) *UserUpdateOne

SetNillableAvatar sets the "avatar" field if the given value is not nil.

func (*UserUpdateOne) SetNillableRecordsID

func (uuo *UserUpdateOne) SetNillableRecordsID(id *int64) *UserUpdateOne

SetNillableRecordsID sets the "records" edge to the JudgeRecord entity by ID if the given value is not nil.

func (*UserUpdateOne) SetPassword

func (uuo *UserUpdateOne) SetPassword(s string) *UserUpdateOne

SetPassword sets the "password" field.

func (*UserUpdateOne) SetRecords

func (uuo *UserUpdateOne) SetRecords(j *JudgeRecord) *UserUpdateOne

SetRecords sets the "records" edge to the JudgeRecord entity.

func (*UserUpdateOne) SetRecordsID

func (uuo *UserUpdateOne) SetRecordsID(id int64) *UserUpdateOne

SetRecordsID sets the "records" edge to the JudgeRecord entity by ID.

type UserWhereInput

type UserWhereInput struct {
	Not *UserWhereInput   `json:"not,omitempty"`
	Or  []*UserWhereInput `json:"or,omitempty"`
	And []*UserWhereInput `json:"and,omitempty"`

	// "id" field predicates.
	ID      *int64  `json:"id,omitempty"`
	IDNEQ   *int64  `json:"idNEQ,omitempty"`
	IDIn    []int64 `json:"idIn,omitempty"`
	IDNotIn []int64 `json:"idNotIn,omitempty"`
	IDGT    *int64  `json:"idGT,omitempty"`
	IDGTE   *int64  `json:"idGTE,omitempty"`
	IDLT    *int64  `json:"idLT,omitempty"`
	IDLTE   *int64  `json:"idLTE,omitempty"`

	// "nickname" field predicates.
	Nickname             *string  `json:"nickname,omitempty"`
	NicknameNEQ          *string  `json:"nicknameNEQ,omitempty"`
	NicknameIn           []string `json:"nicknameIn,omitempty"`
	NicknameNotIn        []string `json:"nicknameNotIn,omitempty"`
	NicknameGT           *string  `json:"nicknameGT,omitempty"`
	NicknameGTE          *string  `json:"nicknameGTE,omitempty"`
	NicknameLT           *string  `json:"nicknameLT,omitempty"`
	NicknameLTE          *string  `json:"nicknameLTE,omitempty"`
	NicknameContains     *string  `json:"nicknameContains,omitempty"`
	NicknameHasPrefix    *string  `json:"nicknameHasPrefix,omitempty"`
	NicknameHasSuffix    *string  `json:"nicknameHasSuffix,omitempty"`
	NicknameEqualFold    *string  `json:"nicknameEqualFold,omitempty"`
	NicknameContainsFold *string  `json:"nicknameContainsFold,omitempty"`

	// "email" field predicates.
	Email             *string  `json:"email,omitempty"`
	EmailNEQ          *string  `json:"emailNEQ,omitempty"`
	EmailIn           []string `json:"emailIn,omitempty"`
	EmailNotIn        []string `json:"emailNotIn,omitempty"`
	EmailGT           *string  `json:"emailGT,omitempty"`
	EmailGTE          *string  `json:"emailGTE,omitempty"`
	EmailLT           *string  `json:"emailLT,omitempty"`
	EmailLTE          *string  `json:"emailLTE,omitempty"`
	EmailContains     *string  `json:"emailContains,omitempty"`
	EmailHasPrefix    *string  `json:"emailHasPrefix,omitempty"`
	EmailHasSuffix    *string  `json:"emailHasSuffix,omitempty"`
	EmailEqualFold    *string  `json:"emailEqualFold,omitempty"`
	EmailContainsFold *string  `json:"emailContainsFold,omitempty"`

	// "password" field predicates.
	Password             *string  `json:"password,omitempty"`
	PasswordNEQ          *string  `json:"passwordNEQ,omitempty"`
	PasswordIn           []string `json:"passwordIn,omitempty"`
	PasswordNotIn        []string `json:"passwordNotIn,omitempty"`
	PasswordGT           *string  `json:"passwordGT,omitempty"`
	PasswordGTE          *string  `json:"passwordGTE,omitempty"`
	PasswordLT           *string  `json:"passwordLT,omitempty"`
	PasswordLTE          *string  `json:"passwordLTE,omitempty"`
	PasswordContains     *string  `json:"passwordContains,omitempty"`
	PasswordHasPrefix    *string  `json:"passwordHasPrefix,omitempty"`
	PasswordHasSuffix    *string  `json:"passwordHasSuffix,omitempty"`
	PasswordEqualFold    *string  `json:"passwordEqualFold,omitempty"`
	PasswordContainsFold *string  `json:"passwordContainsFold,omitempty"`

	// "avatar" field predicates.
	Avatar             *string  `json:"avatar,omitempty"`
	AvatarNEQ          *string  `json:"avatarNEQ,omitempty"`
	AvatarIn           []string `json:"avatarIn,omitempty"`
	AvatarNotIn        []string `json:"avatarNotIn,omitempty"`
	AvatarGT           *string  `json:"avatarGT,omitempty"`
	AvatarGTE          *string  `json:"avatarGTE,omitempty"`
	AvatarLT           *string  `json:"avatarLT,omitempty"`
	AvatarLTE          *string  `json:"avatarLTE,omitempty"`
	AvatarContains     *string  `json:"avatarContains,omitempty"`
	AvatarHasPrefix    *string  `json:"avatarHasPrefix,omitempty"`
	AvatarHasSuffix    *string  `json:"avatarHasSuffix,omitempty"`
	AvatarEqualFold    *string  `json:"avatarEqualFold,omitempty"`
	AvatarContainsFold *string  `json:"avatarContainsFold,omitempty"`

	// "created_time" field predicates.
	CreatedTime      *time.Time  `json:"createdTime,omitempty"`
	CreatedTimeNEQ   *time.Time  `json:"createdTimeNEQ,omitempty"`
	CreatedTimeIn    []time.Time `json:"createdTimeIn,omitempty"`
	CreatedTimeNotIn []time.Time `json:"createdTimeNotIn,omitempty"`
	CreatedTimeGT    *time.Time  `json:"createdTimeGT,omitempty"`
	CreatedTimeGTE   *time.Time  `json:"createdTimeGTE,omitempty"`
	CreatedTimeLT    *time.Time  `json:"createdTimeLT,omitempty"`
	CreatedTimeLTE   *time.Time  `json:"createdTimeLTE,omitempty"`

	// "teams" edge predicates.
	HasTeams     *bool             `json:"hasTeams,omitempty"`
	HasTeamsWith []*TeamWhereInput `json:"hasTeamsWith,omitempty"`

	// "announcements" edge predicates.
	HasAnnouncements     *bool                     `json:"hasAnnouncements,omitempty"`
	HasAnnouncementsWith []*AnnouncementWhereInput `json:"hasAnnouncementsWith,omitempty"`

	// "records" edge predicates.
	HasRecords     *bool                    `json:"hasRecords,omitempty"`
	HasRecordsWith []*JudgeRecordWhereInput `json:"hasRecordsWith,omitempty"`

	// "created_problems" edge predicates.
	HasCreatedProblems     *bool                `json:"hasCreatedProblems,omitempty"`
	HasCreatedProblemsWith []*ProblemWhereInput `json:"hasCreatedProblemsWith,omitempty"`

	// "solved_problems" edge predicates.
	HasSolvedProblems     *bool                `json:"hasSolvedProblems,omitempty"`
	HasSolvedProblemsWith []*ProblemWhereInput `json:"hasSolvedProblemsWith,omitempty"`

	// "managed" edge predicates.
	HasManaged     *bool             `json:"hasManaged,omitempty"`
	HasManagedWith []*TeamWhereInput `json:"hasManagedWith,omitempty"`

	// "owned" edge predicates.
	HasOwned     *bool             `json:"hasOwned,omitempty"`
	HasOwnedWith []*TeamWhereInput `json:"hasOwnedWith,omitempty"`
}

UserWhereInput represents a where input for filtering User queries.

func (*UserWhereInput) Filter

func (i *UserWhereInput) Filter(q *UserQuery) (*UserQuery, error)

Filter applies the UserWhereInput filter on the UserQuery builder.

func (*UserWhereInput) P

func (i *UserWhereInput) P() (predicate.User, error)

P returns a predicate for filtering users. An error is returned if the input is empty or invalid.

type Users

type Users []*User

Users is a parsable slice of User.

type ValidationError

type ValidationError struct {
	Name string // Field or edge name.
	// contains filtered or unexported fields
}

ValidationError returns when validating a field or edge fails.

func (*ValidationError) Error

func (e *ValidationError) Error() string

Error implements the error interface.

func (*ValidationError) Unwrap

func (e *ValidationError) Unwrap() error

Unwrap implements the errors.Wrapper interface.

type Value

type Value = ent.Value

ent aliases to avoid import conflicts in user's code.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL