model

package module
v1.0.10 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2021 License: Apache-2.0 Imports: 27 Imported by: 0

README

model

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.
	TypeGroup             = "Group"
	TypeMember            = "Member"
	TypeMemberEmail       = "MemberEmail"
	TypeMemberSecurityLog = "MemberSecurityLog"
	TypeMemberSetting     = "MemberSetting"
	TypeSnippet           = "Snippet"
	TypeSnippetDocument   = "SnippetDocument"
	TypeSnippetFolder     = "SnippetFolder"
	TypeSnippetTag        = "SnippetTag"
	TypeSystemSetting     = "SystemSetting"
)
View Source
const Version string = "1.0.10"

Variables

This section is empty.

Functions

func IsConstraintError

func IsConstraintError(err error) bool

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

func IsNotFound

func IsNotFound(err error) bool

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

func IsNotLoaded

func IsNotLoaded(err error) bool

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

func IsNotSingular

func IsNotSingular(err error) bool

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

func IsValidationError

func IsValidationError(err error) bool

IsValidationError returns a boolean indicating whether the error is a 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.

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(model.As(model.Sum(field1), "sum_field1"), (model.As(model.Sum(field2), "sum_field2")).
Scan(ctx, &v)

func Count

func Count() AggregateFunc

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

func Max

func Max(field string) AggregateFunc

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

func Mean

func Mean(field string) AggregateFunc

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

func Min

func Min(field string) AggregateFunc

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

func Sum

func Sum(field string) AggregateFunc

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

type Client

type Client struct {

	// Schema is the client for creating, migrating and dropping schema.
	Schema *migrate.Schema
	// Group is the client for interacting with the Group builders.
	Group *GroupClient
	// Member is the client for interacting with the Member builders.
	Member *MemberClient
	// MemberEmail is the client for interacting with the MemberEmail builders.
	MemberEmail *MemberEmailClient
	// MemberSecurityLog is the client for interacting with the MemberSecurityLog builders.
	MemberSecurityLog *MemberSecurityLogClient
	// MemberSetting is the client for interacting with the MemberSetting builders.
	MemberSetting *MemberSettingClient
	// Snippet is the client for interacting with the Snippet builders.
	Snippet *SnippetClient
	// SnippetDocument is the client for interacting with the SnippetDocument builders.
	SnippetDocument *SnippetDocumentClient
	// SnippetFolder is the client for interacting with the SnippetFolder builders.
	SnippetFolder *SnippetFolderClient
	// SnippetTag is the client for interacting with the SnippetTag builders.
	SnippetTag *SnippetTagClient
	// SystemSetting is the client for interacting with the SystemSetting builders.
	SystemSetting *SystemSettingClient
	// 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().
	Group.
	Query().
	Count(ctx)

func (*Client) Tx

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

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

func (*Client) Use

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

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

type CommitFunc

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

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

func (CommitFunc) Commit

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

Commit calls f(ctx, m).

type CommitHook

type CommitHook func(Committer) Committer

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

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

type Committer

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

Committer is the interface that wraps the Committer method.

type ConstraintError

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

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

func (ConstraintError) Error

func (e ConstraintError) Error() string

Error implements the error interface.

func (*ConstraintError) Unwrap

func (e *ConstraintError) Unwrap() error

Unwrap implements the errors.Wrapper interface.

type Group added in v1.0.2

type Group struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// Sn holds the value of the "sn" field.
	Sn string `json:"-"`
	// 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"`
	// CreateTime holds the value of the "create_time" field.
	CreateTime time.Time `json:"-"`
	// UpdateTime holds the value of the "update_time" field.
	UpdateTime time.Time `json:"-"`
	// DeleteTime holds the value of the "delete_time" field.
	DeleteTime *time.Time `json:"-"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the GroupQuery when eager-loading is set.
	Edges GroupEdges `json:"edges"`
	// contains filtered or unexported fields
}

Group is the model entity for the Group schema.

func (*Group) QueryGroupMembers added in v1.0.10

func (gr *Group) QueryGroupMembers() *MemberQuery

QueryGroupMembers queries the "group_members" edge of the Group entity.

func (*Group) String added in v1.0.2

func (gr *Group) String() string

String implements the fmt.Stringer.

func (*Group) Unwrap added in v1.0.2

func (gr *Group) Unwrap() *Group

Unwrap unwraps the Group 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 (*Group) Update added in v1.0.2

func (gr *Group) Update() *GroupUpdateOne

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

type GroupClient added in v1.0.2

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

GroupClient is a client for the Group schema.

func NewGroupClient added in v1.0.2

func NewGroupClient(c config) *GroupClient

NewGroupClient returns a client for the Group from the given config.

func (*GroupClient) Create added in v1.0.2

func (c *GroupClient) Create() *GroupCreate

Create returns a create builder for Group.

func (*GroupClient) CreateBulk added in v1.0.2

func (c *GroupClient) CreateBulk(builders ...*GroupCreate) *GroupCreateBulk

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

func (*GroupClient) Delete added in v1.0.2

func (c *GroupClient) Delete() *GroupDelete

Delete returns a delete builder for Group.

func (*GroupClient) DeleteOne added in v1.0.2

func (c *GroupClient) DeleteOne(gr *Group) *GroupDeleteOne

DeleteOne returns a delete builder for the given entity.

func (*GroupClient) DeleteOneID added in v1.0.2

func (c *GroupClient) DeleteOneID(id int) *GroupDeleteOne

DeleteOneID returns a delete builder for the given id.

func (*GroupClient) Get added in v1.0.2

func (c *GroupClient) Get(ctx context.Context, id int) (*Group, error)

Get returns a Group entity by its id.

func (*GroupClient) GetX added in v1.0.2

func (c *GroupClient) GetX(ctx context.Context, id int) *Group

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

func (*GroupClient) Hooks added in v1.0.2

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

Hooks returns the client hooks.

func (*GroupClient) Query added in v1.0.2

func (c *GroupClient) Query() *GroupQuery

Query returns a query builder for Group.

func (*GroupClient) QueryGroupMembers added in v1.0.10

func (c *GroupClient) QueryGroupMembers(gr *Group) *MemberQuery

QueryGroupMembers queries the group_members edge of a Group.

func (*GroupClient) Update added in v1.0.2

func (c *GroupClient) Update() *GroupUpdate

Update returns an update builder for Group.

func (*GroupClient) UpdateOne added in v1.0.2

func (c *GroupClient) UpdateOne(gr *Group) *GroupUpdateOne

UpdateOne returns an update builder for the given entity.

func (*GroupClient) UpdateOneID added in v1.0.2

func (c *GroupClient) UpdateOneID(id int) *GroupUpdateOne

UpdateOneID returns an update builder for the given id.

func (*GroupClient) Use added in v1.0.2

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

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

type GroupCreate added in v1.0.2

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

GroupCreate is the builder for creating a Group entity.

func (*GroupCreate) AddGroupMemberIDs added in v1.0.10

func (gc *GroupCreate) AddGroupMemberIDs(ids ...int) *GroupCreate

AddGroupMemberIDs adds the "group_members" edge to the Member entity by IDs.

func (*GroupCreate) AddGroupMembers added in v1.0.10

func (gc *GroupCreate) AddGroupMembers(m ...*Member) *GroupCreate

AddGroupMembers adds the "group_members" edges to the Member entity.

func (*GroupCreate) Exec added in v1.0.8

func (gc *GroupCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*GroupCreate) ExecX added in v1.0.8

func (gc *GroupCreate) ExecX(ctx context.Context)

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

func (*GroupCreate) Mutation added in v1.0.2

func (gc *GroupCreate) Mutation() *GroupMutation

Mutation returns the GroupMutation object of the builder.

func (*GroupCreate) Save added in v1.0.2

func (gc *GroupCreate) Save(ctx context.Context) (*Group, error)

Save creates the Group in the database.

func (*GroupCreate) SaveX added in v1.0.2

func (gc *GroupCreate) SaveX(ctx context.Context) *Group

SaveX calls Save and panics if Save returns an error.

func (*GroupCreate) SetCreateTime added in v1.0.2

func (gc *GroupCreate) SetCreateTime(t time.Time) *GroupCreate

SetCreateTime sets the "create_time" field.

func (*GroupCreate) SetDeleteTime added in v1.0.2

func (gc *GroupCreate) SetDeleteTime(t time.Time) *GroupCreate

SetDeleteTime sets the "delete_time" field.

func (*GroupCreate) SetDescription added in v1.0.10

func (gc *GroupCreate) SetDescription(s string) *GroupCreate

SetDescription sets the "description" field.

func (*GroupCreate) SetID added in v1.0.2

func (gc *GroupCreate) SetID(i int) *GroupCreate

SetID sets the "id" field.

func (*GroupCreate) SetName added in v1.0.2

func (gc *GroupCreate) SetName(s string) *GroupCreate

SetName sets the "name" field.

func (*GroupCreate) SetNillableCreateTime added in v1.0.2

func (gc *GroupCreate) SetNillableCreateTime(t *time.Time) *GroupCreate

SetNillableCreateTime sets the "create_time" field if the given value is not nil.

func (*GroupCreate) SetNillableDeleteTime added in v1.0.2

func (gc *GroupCreate) SetNillableDeleteTime(t *time.Time) *GroupCreate

SetNillableDeleteTime sets the "delete_time" field if the given value is not nil.

func (*GroupCreate) SetNillableSn added in v1.0.2

func (gc *GroupCreate) SetNillableSn(s *string) *GroupCreate

SetNillableSn sets the "sn" field if the given value is not nil.

func (*GroupCreate) SetNillableUpdateTime added in v1.0.2

func (gc *GroupCreate) SetNillableUpdateTime(t *time.Time) *GroupCreate

SetNillableUpdateTime sets the "update_time" field if the given value is not nil.

func (*GroupCreate) SetSn added in v1.0.2

func (gc *GroupCreate) SetSn(s string) *GroupCreate

SetSn sets the "sn" field.

func (*GroupCreate) SetUpdateTime added in v1.0.2

func (gc *GroupCreate) SetUpdateTime(t time.Time) *GroupCreate

SetUpdateTime sets the "update_time" field.

type GroupCreateBulk added in v1.0.2

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

GroupCreateBulk is the builder for creating many Group entities in bulk.

func (*GroupCreateBulk) Exec added in v1.0.8

func (gcb *GroupCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*GroupCreateBulk) ExecX added in v1.0.8

func (gcb *GroupCreateBulk) ExecX(ctx context.Context)

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

func (*GroupCreateBulk) Save added in v1.0.2

func (gcb *GroupCreateBulk) Save(ctx context.Context) ([]*Group, error)

Save creates the Group entities in the database.

func (*GroupCreateBulk) SaveX added in v1.0.2

func (gcb *GroupCreateBulk) SaveX(ctx context.Context) []*Group

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

type GroupDelete added in v1.0.2

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

GroupDelete is the builder for deleting a Group entity.

func (*GroupDelete) Exec added in v1.0.2

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

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

func (*GroupDelete) ExecX added in v1.0.2

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

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

func (*GroupDelete) Where added in v1.0.2

func (gd *GroupDelete) Where(ps ...predicate.Group) *GroupDelete

Where appends a list predicates to the GroupDelete builder.

type GroupDeleteOne added in v1.0.2

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

GroupDeleteOne is the builder for deleting a single Group entity.

func (*GroupDeleteOne) Exec added in v1.0.2

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

Exec executes the deletion query.

func (*GroupDeleteOne) ExecX added in v1.0.2

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

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

type GroupEdges added in v1.0.2

type GroupEdges struct {
	// GroupMembers holds the value of the group_members edge.
	GroupMembers []*Member `json:"group_members,omitempty"`
	// contains filtered or unexported fields
}

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

func (GroupEdges) GroupMembersOrErr added in v1.0.10

func (e GroupEdges) GroupMembersOrErr() ([]*Member, error)

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

type GroupGroupBy added in v1.0.2

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

GroupGroupBy is the group-by builder for Group entities.

func (*GroupGroupBy) Aggregate added in v1.0.2

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

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

func (*GroupGroupBy) Bool added in v1.0.2

func (ggb *GroupGroupBy) 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 (*GroupGroupBy) BoolX added in v1.0.2

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

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

func (*GroupGroupBy) Bools added in v1.0.2

func (ggb *GroupGroupBy) 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 (*GroupGroupBy) BoolsX added in v1.0.2

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

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

func (*GroupGroupBy) Float64 added in v1.0.2

func (ggb *GroupGroupBy) 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 (*GroupGroupBy) Float64X added in v1.0.2

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

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

func (*GroupGroupBy) Float64s added in v1.0.2

func (ggb *GroupGroupBy) 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 (*GroupGroupBy) Float64sX added in v1.0.2

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

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

func (*GroupGroupBy) Int added in v1.0.2

func (ggb *GroupGroupBy) 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 (*GroupGroupBy) IntX added in v1.0.2

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

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

func (*GroupGroupBy) Ints added in v1.0.2

func (ggb *GroupGroupBy) 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 (*GroupGroupBy) IntsX added in v1.0.2

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

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

func (*GroupGroupBy) Scan added in v1.0.2

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

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

func (*GroupGroupBy) ScanX added in v1.0.2

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

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

func (*GroupGroupBy) String added in v1.0.2

func (ggb *GroupGroupBy) 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 (*GroupGroupBy) StringX added in v1.0.2

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

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

func (*GroupGroupBy) Strings added in v1.0.2

func (ggb *GroupGroupBy) 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 (*GroupGroupBy) StringsX added in v1.0.2

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

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

type GroupMutation added in v1.0.2

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

GroupMutation represents an operation that mutates the Group nodes in the graph.

func (*GroupMutation) AddField added in v1.0.2

func (m *GroupMutation) 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 (*GroupMutation) AddGroupMemberIDs added in v1.0.10

func (m *GroupMutation) AddGroupMemberIDs(ids ...int)

AddGroupMemberIDs adds the "group_members" edge to the Member entity by ids.

func (*GroupMutation) AddedEdges added in v1.0.2

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

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

func (*GroupMutation) AddedField added in v1.0.2

func (m *GroupMutation) 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 (*GroupMutation) AddedFields added in v1.0.2

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

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

func (*GroupMutation) AddedIDs added in v1.0.2

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

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

func (*GroupMutation) ClearDeleteTime added in v1.0.2

func (m *GroupMutation) ClearDeleteTime()

ClearDeleteTime clears the value of the "delete_time" field.

func (*GroupMutation) ClearEdge added in v1.0.2

func (m *GroupMutation) 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 (*GroupMutation) ClearField added in v1.0.2

func (m *GroupMutation) 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 (*GroupMutation) ClearGroupMembers added in v1.0.10

func (m *GroupMutation) ClearGroupMembers()

ClearGroupMembers clears the "group_members" edge to the Member entity.

func (*GroupMutation) ClearedEdges added in v1.0.2

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

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

func (*GroupMutation) ClearedFields added in v1.0.2

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

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

func (GroupMutation) Client added in v1.0.2

func (m GroupMutation) Client() *Client

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

func (*GroupMutation) CreateTime added in v1.0.2

func (m *GroupMutation) CreateTime() (r time.Time, exists bool)

CreateTime returns the value of the "create_time" field in the mutation.

func (*GroupMutation) DeleteTime added in v1.0.2

func (m *GroupMutation) DeleteTime() (r time.Time, exists bool)

DeleteTime returns the value of the "delete_time" field in the mutation.

func (*GroupMutation) DeleteTimeCleared added in v1.0.2

func (m *GroupMutation) DeleteTimeCleared() bool

DeleteTimeCleared returns if the "delete_time" field was cleared in this mutation.

func (*GroupMutation) Description added in v1.0.10

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

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

func (*GroupMutation) EdgeCleared added in v1.0.2

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

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

func (*GroupMutation) Field added in v1.0.2

func (m *GroupMutation) 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 (*GroupMutation) FieldCleared added in v1.0.2

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

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

func (*GroupMutation) Fields added in v1.0.2

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

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

func (*GroupMutation) GroupMembersCleared added in v1.0.10

func (m *GroupMutation) GroupMembersCleared() bool

GroupMembersCleared reports if the "group_members" edge to the Member entity was cleared.

func (*GroupMutation) GroupMembersIDs added in v1.0.10

func (m *GroupMutation) GroupMembersIDs() (ids []int)

GroupMembersIDs returns the "group_members" edge IDs in the mutation.

func (*GroupMutation) ID added in v1.0.2

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

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

func (*GroupMutation) Name added in v1.0.2

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

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

func (*GroupMutation) OldCreateTime added in v1.0.2

func (m *GroupMutation) OldCreateTime(ctx context.Context) (v time.Time, err error)

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

func (*GroupMutation) OldDeleteTime added in v1.0.2

func (m *GroupMutation) OldDeleteTime(ctx context.Context) (v *time.Time, err error)

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

func (*GroupMutation) OldDescription added in v1.0.10

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

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

func (*GroupMutation) OldField added in v1.0.2

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

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

func (*GroupMutation) OldName added in v1.0.2

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

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

func (*GroupMutation) OldSn added in v1.0.2

func (m *GroupMutation) OldSn(ctx context.Context) (v string, err error)

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

func (*GroupMutation) OldUpdateTime added in v1.0.2

func (m *GroupMutation) OldUpdateTime(ctx context.Context) (v time.Time, err error)

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

func (*GroupMutation) Op added in v1.0.2

func (m *GroupMutation) Op() Op

Op returns the operation name.

func (*GroupMutation) RemoveGroupMemberIDs added in v1.0.10

func (m *GroupMutation) RemoveGroupMemberIDs(ids ...int)

RemoveGroupMemberIDs removes the "group_members" edge to the Member entity by IDs.

func (*GroupMutation) RemovedEdges added in v1.0.2

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

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

func (*GroupMutation) RemovedGroupMembersIDs added in v1.0.10

func (m *GroupMutation) RemovedGroupMembersIDs() (ids []int)

RemovedGroupMembers returns the removed IDs of the "group_members" edge to the Member entity.

func (*GroupMutation) RemovedIDs added in v1.0.2

func (m *GroupMutation) 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 (*GroupMutation) ResetCreateTime added in v1.0.2

func (m *GroupMutation) ResetCreateTime()

ResetCreateTime resets all changes to the "create_time" field.

func (*GroupMutation) ResetDeleteTime added in v1.0.2

func (m *GroupMutation) ResetDeleteTime()

ResetDeleteTime resets all changes to the "delete_time" field.

func (*GroupMutation) ResetDescription added in v1.0.10

func (m *GroupMutation) ResetDescription()

ResetDescription resets all changes to the "description" field.

func (*GroupMutation) ResetEdge added in v1.0.2

func (m *GroupMutation) 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 (*GroupMutation) ResetField added in v1.0.2

func (m *GroupMutation) 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 (*GroupMutation) ResetGroupMembers added in v1.0.10

func (m *GroupMutation) ResetGroupMembers()

ResetGroupMembers resets all changes to the "group_members" edge.

func (*GroupMutation) ResetName added in v1.0.2

func (m *GroupMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*GroupMutation) ResetSn added in v1.0.2

func (m *GroupMutation) ResetSn()

ResetSn resets all changes to the "sn" field.

func (*GroupMutation) ResetUpdateTime added in v1.0.2

func (m *GroupMutation) ResetUpdateTime()

ResetUpdateTime resets all changes to the "update_time" field.

func (*GroupMutation) SetCreateTime added in v1.0.2

func (m *GroupMutation) SetCreateTime(t time.Time)

SetCreateTime sets the "create_time" field.

func (*GroupMutation) SetDeleteTime added in v1.0.2

func (m *GroupMutation) SetDeleteTime(t time.Time)

SetDeleteTime sets the "delete_time" field.

func (*GroupMutation) SetDescription added in v1.0.10

func (m *GroupMutation) SetDescription(s string)

SetDescription sets the "description" field.

func (*GroupMutation) SetField added in v1.0.2

func (m *GroupMutation) 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 (*GroupMutation) SetID added in v1.0.2

func (m *GroupMutation) SetID(id int)

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

func (*GroupMutation) SetName added in v1.0.2

func (m *GroupMutation) SetName(s string)

SetName sets the "name" field.

func (*GroupMutation) SetSn added in v1.0.2

func (m *GroupMutation) SetSn(s string)

SetSn sets the "sn" field.

func (*GroupMutation) SetUpdateTime added in v1.0.2

func (m *GroupMutation) SetUpdateTime(t time.Time)

SetUpdateTime sets the "update_time" field.

func (*GroupMutation) Sn added in v1.0.2

func (m *GroupMutation) Sn() (r string, exists bool)

Sn returns the value of the "sn" field in the mutation.

func (GroupMutation) Tx added in v1.0.2

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

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

func (*GroupMutation) Type added in v1.0.2

func (m *GroupMutation) Type() string

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

func (*GroupMutation) UpdateTime added in v1.0.2

func (m *GroupMutation) UpdateTime() (r time.Time, exists bool)

UpdateTime returns the value of the "update_time" field in the mutation.

func (*GroupMutation) Where added in v1.0.8

func (m *GroupMutation) Where(ps ...predicate.Group)

Where appends a list predicates to the GroupMutation builder.

type GroupQuery added in v1.0.2

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

GroupQuery is the builder for querying Group entities.

func (*GroupQuery) All added in v1.0.2

func (gq *GroupQuery) All(ctx context.Context) ([]*Group, error)

All executes the query and returns a list of Groups.

func (*GroupQuery) AllX added in v1.0.2

func (gq *GroupQuery) AllX(ctx context.Context) []*Group

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

func (*GroupQuery) Clone added in v1.0.2

func (gq *GroupQuery) Clone() *GroupQuery

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

func (*GroupQuery) Count added in v1.0.2

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

Count returns the count of the given query.

func (*GroupQuery) CountX added in v1.0.2

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

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

func (*GroupQuery) Exist added in v1.0.2

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

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

func (*GroupQuery) ExistX added in v1.0.2

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

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

func (*GroupQuery) First added in v1.0.2

func (gq *GroupQuery) First(ctx context.Context) (*Group, error)

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

func (*GroupQuery) FirstID added in v1.0.2

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

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

func (*GroupQuery) FirstIDX added in v1.0.2

func (gq *GroupQuery) FirstIDX(ctx context.Context) int

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

func (*GroupQuery) FirstX added in v1.0.2

func (gq *GroupQuery) FirstX(ctx context.Context) *Group

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

func (*GroupQuery) GroupBy added in v1.0.2

func (gq *GroupQuery) GroupBy(field string, fields ...string) *GroupGroupBy

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

client.Group.Query().
	GroupBy(group.FieldSn).
	Aggregate(model.Count()).
	Scan(ctx, &v)

func (*GroupQuery) IDs added in v1.0.2

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

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

func (*GroupQuery) IDsX added in v1.0.2

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

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

func (*GroupQuery) Limit added in v1.0.2

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

Limit adds a limit step to the query.

func (*GroupQuery) Offset added in v1.0.2

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

Offset adds an offset step to the query.

func (*GroupQuery) Only added in v1.0.2

func (gq *GroupQuery) Only(ctx context.Context) (*Group, error)

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

func (*GroupQuery) OnlyID added in v1.0.2

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

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

func (*GroupQuery) OnlyIDX added in v1.0.2

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

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

func (*GroupQuery) OnlyX added in v1.0.2

func (gq *GroupQuery) OnlyX(ctx context.Context) *Group

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

func (*GroupQuery) Order added in v1.0.2

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

Order adds an order step to the query.

func (*GroupQuery) QueryGroupMembers added in v1.0.10

func (gq *GroupQuery) QueryGroupMembers() *MemberQuery

QueryGroupMembers chains the current query on the "group_members" edge.

func (*GroupQuery) Select added in v1.0.2

func (gq *GroupQuery) Select(fields ...string) *GroupSelect

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 {
	Sn string `json:"-"`
}

client.Group.Query().
	Select(group.FieldSn).
	Scan(ctx, &v)

func (*GroupQuery) Unique added in v1.0.2

func (gq *GroupQuery) Unique(unique bool) *GroupQuery

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 (*GroupQuery) Where added in v1.0.2

func (gq *GroupQuery) Where(ps ...predicate.Group) *GroupQuery

Where adds a new predicate for the GroupQuery builder.

func (*GroupQuery) WithGroupMembers added in v1.0.10

func (gq *GroupQuery) WithGroupMembers(opts ...func(*MemberQuery)) *GroupQuery

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

type GroupSelect added in v1.0.2

type GroupSelect struct {
	*GroupQuery
	// contains filtered or unexported fields
}

GroupSelect is the builder for selecting fields of Group entities.

func (*GroupSelect) Bool added in v1.0.2

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

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

func (*GroupSelect) BoolX added in v1.0.2

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

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

func (*GroupSelect) Bools added in v1.0.2

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

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

func (*GroupSelect) BoolsX added in v1.0.2

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

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

func (*GroupSelect) Float64 added in v1.0.2

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

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

func (*GroupSelect) Float64X added in v1.0.2

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

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

func (*GroupSelect) Float64s added in v1.0.2

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

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

func (*GroupSelect) Float64sX added in v1.0.2

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

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

func (*GroupSelect) Int added in v1.0.2

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

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

func (*GroupSelect) IntX added in v1.0.2

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

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

func (*GroupSelect) Ints added in v1.0.2

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

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

func (*GroupSelect) IntsX added in v1.0.2

func (gs *GroupSelect) IntsX(ctx context.Context) []int

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

func (*GroupSelect) Scan added in v1.0.2

func (gs *GroupSelect) Scan(ctx context.Context, v interface{}) error

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

func (*GroupSelect) ScanX added in v1.0.2

func (gs *GroupSelect) ScanX(ctx context.Context, v interface{})

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

func (*GroupSelect) String added in v1.0.2

func (gs *GroupSelect) String(ctx context.Context) (_ string, err error)

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

func (*GroupSelect) StringX added in v1.0.2

func (gs *GroupSelect) StringX(ctx context.Context) string

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

func (*GroupSelect) Strings added in v1.0.2

func (gs *GroupSelect) Strings(ctx context.Context) ([]string, error)

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

func (*GroupSelect) StringsX added in v1.0.2

func (gs *GroupSelect) StringsX(ctx context.Context) []string

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

type GroupUpdate added in v1.0.2

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

GroupUpdate is the builder for updating Group entities.

func (*GroupUpdate) AddGroupMemberIDs added in v1.0.10

func (gu *GroupUpdate) AddGroupMemberIDs(ids ...int) *GroupUpdate

AddGroupMemberIDs adds the "group_members" edge to the Member entity by IDs.

func (*GroupUpdate) AddGroupMembers added in v1.0.10

func (gu *GroupUpdate) AddGroupMembers(m ...*Member) *GroupUpdate

AddGroupMembers adds the "group_members" edges to the Member entity.

func (*GroupUpdate) ClearDeleteTime added in v1.0.2

func (gu *GroupUpdate) ClearDeleteTime() *GroupUpdate

ClearDeleteTime clears the value of the "delete_time" field.

func (*GroupUpdate) ClearGroupMembers added in v1.0.10

func (gu *GroupUpdate) ClearGroupMembers() *GroupUpdate

ClearGroupMembers clears all "group_members" edges to the Member entity.

func (*GroupUpdate) Exec added in v1.0.2

func (gu *GroupUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*GroupUpdate) ExecX added in v1.0.2

func (gu *GroupUpdate) ExecX(ctx context.Context)

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

func (*GroupUpdate) Mutation added in v1.0.2

func (gu *GroupUpdate) Mutation() *GroupMutation

Mutation returns the GroupMutation object of the builder.

func (*GroupUpdate) RemoveGroupMemberIDs added in v1.0.10

func (gu *GroupUpdate) RemoveGroupMemberIDs(ids ...int) *GroupUpdate

RemoveGroupMemberIDs removes the "group_members" edge to Member entities by IDs.

func (*GroupUpdate) RemoveGroupMembers added in v1.0.10

func (gu *GroupUpdate) RemoveGroupMembers(m ...*Member) *GroupUpdate

RemoveGroupMembers removes "group_members" edges to Member entities.

func (*GroupUpdate) Save added in v1.0.2

func (gu *GroupUpdate) Save(ctx context.Context) (int, error)

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

func (*GroupUpdate) SaveX added in v1.0.2

func (gu *GroupUpdate) SaveX(ctx context.Context) int

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

func (*GroupUpdate) SetDeleteTime added in v1.0.2

func (gu *GroupUpdate) SetDeleteTime(t time.Time) *GroupUpdate

SetDeleteTime sets the "delete_time" field.

func (*GroupUpdate) SetDescription added in v1.0.10

func (gu *GroupUpdate) SetDescription(s string) *GroupUpdate

SetDescription sets the "description" field.

func (*GroupUpdate) SetName added in v1.0.2

func (gu *GroupUpdate) SetName(s string) *GroupUpdate

SetName sets the "name" field.

func (*GroupUpdate) SetNillableDeleteTime added in v1.0.2

func (gu *GroupUpdate) SetNillableDeleteTime(t *time.Time) *GroupUpdate

SetNillableDeleteTime sets the "delete_time" field if the given value is not nil.

func (*GroupUpdate) SetUpdateTime added in v1.0.2

func (gu *GroupUpdate) SetUpdateTime(t time.Time) *GroupUpdate

SetUpdateTime sets the "update_time" field.

func (*GroupUpdate) Where added in v1.0.2

func (gu *GroupUpdate) Where(ps ...predicate.Group) *GroupUpdate

Where appends a list predicates to the GroupUpdate builder.

type GroupUpdateOne added in v1.0.2

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

GroupUpdateOne is the builder for updating a single Group entity.

func (*GroupUpdateOne) AddGroupMemberIDs added in v1.0.10

func (guo *GroupUpdateOne) AddGroupMemberIDs(ids ...int) *GroupUpdateOne

AddGroupMemberIDs adds the "group_members" edge to the Member entity by IDs.

func (*GroupUpdateOne) AddGroupMembers added in v1.0.10

func (guo *GroupUpdateOne) AddGroupMembers(m ...*Member) *GroupUpdateOne

AddGroupMembers adds the "group_members" edges to the Member entity.

func (*GroupUpdateOne) ClearDeleteTime added in v1.0.2

func (guo *GroupUpdateOne) ClearDeleteTime() *GroupUpdateOne

ClearDeleteTime clears the value of the "delete_time" field.

func (*GroupUpdateOne) ClearGroupMembers added in v1.0.10

func (guo *GroupUpdateOne) ClearGroupMembers() *GroupUpdateOne

ClearGroupMembers clears all "group_members" edges to the Member entity.

func (*GroupUpdateOne) Exec added in v1.0.2

func (guo *GroupUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*GroupUpdateOne) ExecX added in v1.0.2

func (guo *GroupUpdateOne) ExecX(ctx context.Context)

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

func (*GroupUpdateOne) Mutation added in v1.0.2

func (guo *GroupUpdateOne) Mutation() *GroupMutation

Mutation returns the GroupMutation object of the builder.

func (*GroupUpdateOne) RemoveGroupMemberIDs added in v1.0.10

func (guo *GroupUpdateOne) RemoveGroupMemberIDs(ids ...int) *GroupUpdateOne

RemoveGroupMemberIDs removes the "group_members" edge to Member entities by IDs.

func (*GroupUpdateOne) RemoveGroupMembers added in v1.0.10

func (guo *GroupUpdateOne) RemoveGroupMembers(m ...*Member) *GroupUpdateOne

RemoveGroupMembers removes "group_members" edges to Member entities.

func (*GroupUpdateOne) Save added in v1.0.2

func (guo *GroupUpdateOne) Save(ctx context.Context) (*Group, error)

Save executes the query and returns the updated Group entity.

func (*GroupUpdateOne) SaveX added in v1.0.2

func (guo *GroupUpdateOne) SaveX(ctx context.Context) *Group

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

func (*GroupUpdateOne) Select added in v1.0.2

func (guo *GroupUpdateOne) Select(field string, fields ...string) *GroupUpdateOne

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

func (*GroupUpdateOne) SetDeleteTime added in v1.0.2

func (guo *GroupUpdateOne) SetDeleteTime(t time.Time) *GroupUpdateOne

SetDeleteTime sets the "delete_time" field.

func (*GroupUpdateOne) SetDescription added in v1.0.10

func (guo *GroupUpdateOne) SetDescription(s string) *GroupUpdateOne

SetDescription sets the "description" field.

func (*GroupUpdateOne) SetName added in v1.0.2

func (guo *GroupUpdateOne) SetName(s string) *GroupUpdateOne

SetName sets the "name" field.

func (*GroupUpdateOne) SetNillableDeleteTime added in v1.0.2

func (guo *GroupUpdateOne) SetNillableDeleteTime(t *time.Time) *GroupUpdateOne

SetNillableDeleteTime sets the "delete_time" field if the given value is not nil.

func (*GroupUpdateOne) SetUpdateTime added in v1.0.2

func (guo *GroupUpdateOne) SetUpdateTime(t time.Time) *GroupUpdateOne

SetUpdateTime sets the "update_time" field.

type Groups added in v1.0.2

type Groups []*Group

Groups is a parsable slice of Group.

type Hook

type Hook = ent.Hook

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

type Member

type Member struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// Sn holds the value of the "sn" field.
	Sn string `json:"-"`
	// Nickname holds the value of the "nickname" field.
	Nickname string `json:"nickname,omitempty"`
	// Phone holds the value of the "phone" field.
	Phone *string `json:"phone,omitempty"`
	// Password holds the value of the "password" field.
	Password *string `json:"-"`
	// Status holds the value of the "status" field.
	Status *member.Status `json:"-"`
	// Signature holds the value of the "signature" field.
	Signature string `json:"-"`
	// LastPwdAuth holds the value of the "last_pwd_auth" field.
	LastPwdAuth *time.Time `json:"-"`
	// GroupID holds the value of the "group_id" field.
	GroupID *int `json:"-"`
	// CreateTime holds the value of the "create_time" field.
	CreateTime time.Time `json:"-"`
	// UpdateTime holds the value of the "update_time" field.
	UpdateTime time.Time `json:"-"`
	// DeleteTime holds the value of the "delete_time" field.
	DeleteTime *time.Time `json:"-"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the MemberQuery when eager-loading is set.
	Edges MemberEdges `json:"edges"`
	// contains filtered or unexported fields
}

Member is the model entity for the Member schema.

func (*Member) QueryMemberEmails added in v1.0.8

func (m *Member) QueryMemberEmails() *MemberEmailQuery

QueryMemberEmails queries the "member_emails" edge of the Member entity.

func (*Member) QueryMemberGroup added in v1.0.10

func (m *Member) QueryMemberGroup() *GroupQuery

QueryMemberGroup queries the "member_group" edge of the Member entity.

func (*Member) QueryMemberSecurityLogs added in v1.0.10

func (m *Member) QueryMemberSecurityLogs() *MemberSecurityLogQuery

QueryMemberSecurityLogs queries the "member_security_logs" edge of the Member entity.

func (*Member) QueryMemberSettings added in v1.0.8

func (m *Member) QueryMemberSettings() *MemberSettingQuery

QueryMemberSettings queries the "member_settings" edge of the Member entity.

func (*Member) QueryMemberSnippetDocs added in v1.0.9

func (m *Member) QueryMemberSnippetDocs() *SnippetDocumentQuery

QueryMemberSnippetDocs queries the "member_snippet_docs" edge of the Member entity.

func (*Member) QueryMemberSnippetFolders added in v1.0.9

func (m *Member) QueryMemberSnippetFolders() *SnippetFolderQuery

QueryMemberSnippetFolders queries the "member_snippet_folders" edge of the Member entity.

func (*Member) QueryMemberSnippetTags added in v1.0.9

func (m *Member) QueryMemberSnippetTags() *SnippetTagQuery

QueryMemberSnippetTags queries the "member_snippet_tags" edge of the Member entity.

func (*Member) QueryMemberSnippets added in v1.0.9

func (m *Member) QueryMemberSnippets() *SnippetQuery

QueryMemberSnippets queries the "member_snippets" edge of the Member entity.

func (*Member) String

func (m *Member) String() string

String implements the fmt.Stringer.

func (*Member) Unwrap

func (m *Member) Unwrap() *Member

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

func (m *Member) Update() *MemberUpdateOne

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

type MemberClient

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

MemberClient is a client for the Member schema.

func NewMemberClient

func NewMemberClient(c config) *MemberClient

NewMemberClient returns a client for the Member from the given config.

func (*MemberClient) Create

func (c *MemberClient) Create() *MemberCreate

Create returns a create builder for Member.

func (*MemberClient) CreateBulk

func (c *MemberClient) CreateBulk(builders ...*MemberCreate) *MemberCreateBulk

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

func (*MemberClient) Delete

func (c *MemberClient) Delete() *MemberDelete

Delete returns a delete builder for Member.

func (*MemberClient) DeleteOne

func (c *MemberClient) DeleteOne(m *Member) *MemberDeleteOne

DeleteOne returns a delete builder for the given entity.

func (*MemberClient) DeleteOneID

func (c *MemberClient) DeleteOneID(id int) *MemberDeleteOne

DeleteOneID returns a delete builder for the given id.

func (*MemberClient) Get

func (c *MemberClient) Get(ctx context.Context, id int) (*Member, error)

Get returns a Member entity by its id.

func (*MemberClient) GetX

func (c *MemberClient) GetX(ctx context.Context, id int) *Member

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

func (*MemberClient) Hooks

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

Hooks returns the client hooks.

func (*MemberClient) Query

func (c *MemberClient) Query() *MemberQuery

Query returns a query builder for Member.

func (*MemberClient) QueryMemberEmails added in v1.0.8

func (c *MemberClient) QueryMemberEmails(m *Member) *MemberEmailQuery

QueryMemberEmails queries the member_emails edge of a Member.

func (*MemberClient) QueryMemberGroup added in v1.0.10

func (c *MemberClient) QueryMemberGroup(m *Member) *GroupQuery

QueryMemberGroup queries the member_group edge of a Member.

func (*MemberClient) QueryMemberSecurityLogs added in v1.0.10

func (c *MemberClient) QueryMemberSecurityLogs(m *Member) *MemberSecurityLogQuery

QueryMemberSecurityLogs queries the member_security_logs edge of a Member.

func (*MemberClient) QueryMemberSettings added in v1.0.8

func (c *MemberClient) QueryMemberSettings(m *Member) *MemberSettingQuery

QueryMemberSettings queries the member_settings edge of a Member.

func (*MemberClient) QueryMemberSnippetDocs added in v1.0.9

func (c *MemberClient) QueryMemberSnippetDocs(m *Member) *SnippetDocumentQuery

QueryMemberSnippetDocs queries the member_snippet_docs edge of a Member.

func (*MemberClient) QueryMemberSnippetFolders added in v1.0.9

func (c *MemberClient) QueryMemberSnippetFolders(m *Member) *SnippetFolderQuery

QueryMemberSnippetFolders queries the member_snippet_folders edge of a Member.

func (*MemberClient) QueryMemberSnippetTags added in v1.0.9

func (c *MemberClient) QueryMemberSnippetTags(m *Member) *SnippetTagQuery

QueryMemberSnippetTags queries the member_snippet_tags edge of a Member.

func (*MemberClient) QueryMemberSnippets added in v1.0.9

func (c *MemberClient) QueryMemberSnippets(m *Member) *SnippetQuery

QueryMemberSnippets queries the member_snippets edge of a Member.

func (*MemberClient) Update

func (c *MemberClient) Update() *MemberUpdate

Update returns an update builder for Member.

func (*MemberClient) UpdateOne

func (c *MemberClient) UpdateOne(m *Member) *MemberUpdateOne

UpdateOne returns an update builder for the given entity.

func (*MemberClient) UpdateOneID

func (c *MemberClient) UpdateOneID(id int) *MemberUpdateOne

UpdateOneID returns an update builder for the given id.

func (*MemberClient) Use

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

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

type MemberCreate

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

MemberCreate is the builder for creating a Member entity.

func (*MemberCreate) AddMemberEmailIDs added in v1.0.8

func (mc *MemberCreate) AddMemberEmailIDs(ids ...int) *MemberCreate

AddMemberEmailIDs adds the "member_emails" edge to the MemberEmail entity by IDs.

func (*MemberCreate) AddMemberEmails added in v1.0.8

func (mc *MemberCreate) AddMemberEmails(m ...*MemberEmail) *MemberCreate

AddMemberEmails adds the "member_emails" edges to the MemberEmail entity.

func (*MemberCreate) AddMemberSecurityLogIDs added in v1.0.10

func (mc *MemberCreate) AddMemberSecurityLogIDs(ids ...int) *MemberCreate

AddMemberSecurityLogIDs adds the "member_security_logs" edge to the MemberSecurityLog entity by IDs.

func (*MemberCreate) AddMemberSecurityLogs added in v1.0.10

func (mc *MemberCreate) AddMemberSecurityLogs(m ...*MemberSecurityLog) *MemberCreate

AddMemberSecurityLogs adds the "member_security_logs" edges to the MemberSecurityLog entity.

func (*MemberCreate) AddMemberSettingIDs added in v1.0.8

func (mc *MemberCreate) AddMemberSettingIDs(ids ...int) *MemberCreate

AddMemberSettingIDs adds the "member_settings" edge to the MemberSetting entity by IDs.

func (*MemberCreate) AddMemberSettings added in v1.0.8

func (mc *MemberCreate) AddMemberSettings(m ...*MemberSetting) *MemberCreate

AddMemberSettings adds the "member_settings" edges to the MemberSetting entity.

func (*MemberCreate) AddMemberSnippetDocIDs added in v1.0.9

func (mc *MemberCreate) AddMemberSnippetDocIDs(ids ...int) *MemberCreate

AddMemberSnippetDocIDs adds the "member_snippet_docs" edge to the SnippetDocument entity by IDs.

func (*MemberCreate) AddMemberSnippetDocs added in v1.0.9

func (mc *MemberCreate) AddMemberSnippetDocs(s ...*SnippetDocument) *MemberCreate

AddMemberSnippetDocs adds the "member_snippet_docs" edges to the SnippetDocument entity.

func (*MemberCreate) AddMemberSnippetFolderIDs added in v1.0.9

func (mc *MemberCreate) AddMemberSnippetFolderIDs(ids ...int) *MemberCreate

AddMemberSnippetFolderIDs adds the "member_snippet_folders" edge to the SnippetFolder entity by IDs.

func (*MemberCreate) AddMemberSnippetFolders added in v1.0.9

func (mc *MemberCreate) AddMemberSnippetFolders(s ...*SnippetFolder) *MemberCreate

AddMemberSnippetFolders adds the "member_snippet_folders" edges to the SnippetFolder entity.

func (*MemberCreate) AddMemberSnippetIDs added in v1.0.9

func (mc *MemberCreate) AddMemberSnippetIDs(ids ...int) *MemberCreate

AddMemberSnippetIDs adds the "member_snippets" edge to the Snippet entity by IDs.

func (*MemberCreate) AddMemberSnippetTagIDs added in v1.0.9

func (mc *MemberCreate) AddMemberSnippetTagIDs(ids ...int) *MemberCreate

AddMemberSnippetTagIDs adds the "member_snippet_tags" edge to the SnippetTag entity by IDs.

func (*MemberCreate) AddMemberSnippetTags added in v1.0.9

func (mc *MemberCreate) AddMemberSnippetTags(s ...*SnippetTag) *MemberCreate

AddMemberSnippetTags adds the "member_snippet_tags" edges to the SnippetTag entity.

func (*MemberCreate) AddMemberSnippets added in v1.0.9

func (mc *MemberCreate) AddMemberSnippets(s ...*Snippet) *MemberCreate

AddMemberSnippets adds the "member_snippets" edges to the Snippet entity.

func (*MemberCreate) Exec

func (mc *MemberCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*MemberCreate) ExecX

func (mc *MemberCreate) ExecX(ctx context.Context)

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

func (*MemberCreate) Mutation

func (mc *MemberCreate) Mutation() *MemberMutation

Mutation returns the MemberMutation object of the builder.

func (*MemberCreate) Save

func (mc *MemberCreate) Save(ctx context.Context) (*Member, error)

Save creates the Member in the database.

func (*MemberCreate) SaveX

func (mc *MemberCreate) SaveX(ctx context.Context) *Member

SaveX calls Save and panics if Save returns an error.

func (*MemberCreate) SetCreateTime

func (mc *MemberCreate) SetCreateTime(t time.Time) *MemberCreate

SetCreateTime sets the "create_time" field.

func (*MemberCreate) SetDeleteTime

func (mc *MemberCreate) SetDeleteTime(t time.Time) *MemberCreate

SetDeleteTime sets the "delete_time" field.

func (*MemberCreate) SetGroupID added in v1.0.2

func (mc *MemberCreate) SetGroupID(i int) *MemberCreate

SetGroupID sets the "group_id" field.

func (*MemberCreate) SetID

func (mc *MemberCreate) SetID(i int) *MemberCreate

SetID sets the "id" field.

func (*MemberCreate) SetLastPwdAuth

func (mc *MemberCreate) SetLastPwdAuth(t time.Time) *MemberCreate

SetLastPwdAuth sets the "last_pwd_auth" field.

func (*MemberCreate) SetMemberGroup added in v1.0.10

func (mc *MemberCreate) SetMemberGroup(g *Group) *MemberCreate

SetMemberGroup sets the "member_group" edge to the Group entity.

func (*MemberCreate) SetMemberGroupID added in v1.0.10

func (mc *MemberCreate) SetMemberGroupID(id int) *MemberCreate

SetMemberGroupID sets the "member_group" edge to the Group entity by ID.

func (*MemberCreate) SetNickname

func (mc *MemberCreate) SetNickname(s string) *MemberCreate

SetNickname sets the "nickname" field.

func (*MemberCreate) SetNillableCreateTime

func (mc *MemberCreate) SetNillableCreateTime(t *time.Time) *MemberCreate

SetNillableCreateTime sets the "create_time" field if the given value is not nil.

func (*MemberCreate) SetNillableDeleteTime

func (mc *MemberCreate) SetNillableDeleteTime(t *time.Time) *MemberCreate

SetNillableDeleteTime sets the "delete_time" field if the given value is not nil.

func (*MemberCreate) SetNillableGroupID added in v1.0.2

func (mc *MemberCreate) SetNillableGroupID(i *int) *MemberCreate

SetNillableGroupID sets the "group_id" field if the given value is not nil.

func (*MemberCreate) SetNillableLastPwdAuth

func (mc *MemberCreate) SetNillableLastPwdAuth(t *time.Time) *MemberCreate

SetNillableLastPwdAuth sets the "last_pwd_auth" field if the given value is not nil.

func (*MemberCreate) SetNillableMemberGroupID added in v1.0.10

func (mc *MemberCreate) SetNillableMemberGroupID(id *int) *MemberCreate

SetNillableMemberGroupID sets the "member_group" edge to the Group entity by ID if the given value is not nil.

func (*MemberCreate) SetNillablePassword added in v1.0.4

func (mc *MemberCreate) SetNillablePassword(s *string) *MemberCreate

SetNillablePassword sets the "password" field if the given value is not nil.

func (*MemberCreate) SetNillablePhone

func (mc *MemberCreate) SetNillablePhone(s *string) *MemberCreate

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

func (*MemberCreate) SetNillableSn added in v1.0.2

func (mc *MemberCreate) SetNillableSn(s *string) *MemberCreate

SetNillableSn sets the "sn" field if the given value is not nil.

func (*MemberCreate) SetNillableStatus

func (mc *MemberCreate) SetNillableStatus(m *member.Status) *MemberCreate

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

func (*MemberCreate) SetNillableUpdateTime

func (mc *MemberCreate) SetNillableUpdateTime(t *time.Time) *MemberCreate

SetNillableUpdateTime sets the "update_time" field if the given value is not nil.

func (*MemberCreate) SetPassword

func (mc *MemberCreate) SetPassword(s string) *MemberCreate

SetPassword sets the "password" field.

func (*MemberCreate) SetPhone

func (mc *MemberCreate) SetPhone(s string) *MemberCreate

SetPhone sets the "phone" field.

func (*MemberCreate) SetSignature

func (mc *MemberCreate) SetSignature(s string) *MemberCreate

SetSignature sets the "signature" field.

func (*MemberCreate) SetSn added in v1.0.2

func (mc *MemberCreate) SetSn(s string) *MemberCreate

SetSn sets the "sn" field.

func (*MemberCreate) SetStatus

func (mc *MemberCreate) SetStatus(m member.Status) *MemberCreate

SetStatus sets the "status" field.

func (*MemberCreate) SetUpdateTime

func (mc *MemberCreate) SetUpdateTime(t time.Time) *MemberCreate

SetUpdateTime sets the "update_time" field.

type MemberCreateBulk

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

MemberCreateBulk is the builder for creating many Member entities in bulk.

func (*MemberCreateBulk) Exec

func (mcb *MemberCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*MemberCreateBulk) ExecX

func (mcb *MemberCreateBulk) ExecX(ctx context.Context)

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

func (*MemberCreateBulk) Save

func (mcb *MemberCreateBulk) Save(ctx context.Context) ([]*Member, error)

Save creates the Member entities in the database.

func (*MemberCreateBulk) SaveX

func (mcb *MemberCreateBulk) SaveX(ctx context.Context) []*Member

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

type MemberDelete

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

MemberDelete is the builder for deleting a Member entity.

func (*MemberDelete) Exec

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

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

func (*MemberDelete) ExecX

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

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

func (*MemberDelete) Where

func (md *MemberDelete) Where(ps ...predicate.Member) *MemberDelete

Where appends a list predicates to the MemberDelete builder.

type MemberDeleteOne

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

MemberDeleteOne is the builder for deleting a single Member entity.

func (*MemberDeleteOne) Exec

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

Exec executes the deletion query.

func (*MemberDeleteOne) ExecX

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

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

type MemberEdges added in v1.0.2

type MemberEdges struct {
	// MemberGroup holds the value of the member_group edge.
	MemberGroup *Group `json:"member_group,omitempty"`
	// MemberEmails holds the value of the member_emails edge.
	MemberEmails []*MemberEmail `json:"member_emails,omitempty"`
	// MemberSettings holds the value of the member_settings edge.
	MemberSettings []*MemberSetting `json:"member_settings,omitempty"`
	// MemberSecurityLogs holds the value of the member_security_logs edge.
	MemberSecurityLogs []*MemberSecurityLog `json:"member_security_logs,omitempty"`
	// MemberSnippets holds the value of the member_snippets edge.
	MemberSnippets []*Snippet `json:"member_snippets,omitempty"`
	// MemberSnippetFolders holds the value of the member_snippet_folders edge.
	MemberSnippetFolders []*SnippetFolder `json:"member_snippet_folders,omitempty"`
	// MemberSnippetTags holds the value of the member_snippet_tags edge.
	MemberSnippetTags []*SnippetTag `json:"member_snippet_tags,omitempty"`
	// MemberSnippetDocs holds the value of the member_snippet_docs edge.
	MemberSnippetDocs []*SnippetDocument `json:"member_snippet_docs,omitempty"`
	// contains filtered or unexported fields
}

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

func (MemberEdges) MemberEmailsOrErr added in v1.0.8

func (e MemberEdges) MemberEmailsOrErr() ([]*MemberEmail, error)

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

func (MemberEdges) MemberGroupOrErr added in v1.0.10

func (e MemberEdges) MemberGroupOrErr() (*Group, error)

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

func (MemberEdges) MemberSecurityLogsOrErr added in v1.0.10

func (e MemberEdges) MemberSecurityLogsOrErr() ([]*MemberSecurityLog, error)

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

func (MemberEdges) MemberSettingsOrErr added in v1.0.8

func (e MemberEdges) MemberSettingsOrErr() ([]*MemberSetting, error)

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

func (MemberEdges) MemberSnippetDocsOrErr added in v1.0.9

func (e MemberEdges) MemberSnippetDocsOrErr() ([]*SnippetDocument, error)

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

func (MemberEdges) MemberSnippetFoldersOrErr added in v1.0.9

func (e MemberEdges) MemberSnippetFoldersOrErr() ([]*SnippetFolder, error)

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

func (MemberEdges) MemberSnippetTagsOrErr added in v1.0.9

func (e MemberEdges) MemberSnippetTagsOrErr() ([]*SnippetTag, error)

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

func (MemberEdges) MemberSnippetsOrErr added in v1.0.9

func (e MemberEdges) MemberSnippetsOrErr() ([]*Snippet, error)

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

type MemberEmail added in v1.0.2

type MemberEmail struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// OwnerID holds the value of the "owner_id" field.
	OwnerID int `json:"-"`
	// Email holds the value of the "email" field.
	Email string `json:"email,omitempty"`
	// Verify holds the value of the "verify" field.
	Verify bool `json:"-"`
	// VerifyTicket holds the value of the "verify_ticket" field.
	VerifyTicket *string `json:"-"`
	// VerifyTime holds the value of the "verify_time" field.
	VerifyTime *time.Time `json:"-"`
	// IsPrimary holds the value of the "is_primary" field.
	IsPrimary bool `json:"is_primary,omitempty"`
	// CreateTime holds the value of the "create_time" field.
	CreateTime time.Time `json:"-"`
	// UpdateTime holds the value of the "update_time" field.
	UpdateTime time.Time `json:"-"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the MemberEmailQuery when eager-loading is set.
	Edges MemberEmailEdges `json:"edges"`
	// contains filtered or unexported fields
}

MemberEmail is the model entity for the MemberEmail schema.

func (*MemberEmail) QueryEmailOwner added in v1.0.8

func (me *MemberEmail) QueryEmailOwner() *MemberQuery

QueryEmailOwner queries the "email_owner" edge of the MemberEmail entity.

func (*MemberEmail) String added in v1.0.2

func (me *MemberEmail) String() string

String implements the fmt.Stringer.

func (*MemberEmail) Unwrap added in v1.0.2

func (me *MemberEmail) Unwrap() *MemberEmail

Unwrap unwraps the MemberEmail 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 (*MemberEmail) Update added in v1.0.2

func (me *MemberEmail) Update() *MemberEmailUpdateOne

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

type MemberEmailClient added in v1.0.2

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

MemberEmailClient is a client for the MemberEmail schema.

func NewMemberEmailClient added in v1.0.2

func NewMemberEmailClient(c config) *MemberEmailClient

NewMemberEmailClient returns a client for the MemberEmail from the given config.

func (*MemberEmailClient) Create added in v1.0.2

func (c *MemberEmailClient) Create() *MemberEmailCreate

Create returns a create builder for MemberEmail.

func (*MemberEmailClient) CreateBulk added in v1.0.2

func (c *MemberEmailClient) CreateBulk(builders ...*MemberEmailCreate) *MemberEmailCreateBulk

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

func (*MemberEmailClient) Delete added in v1.0.2

func (c *MemberEmailClient) Delete() *MemberEmailDelete

Delete returns a delete builder for MemberEmail.

func (*MemberEmailClient) DeleteOne added in v1.0.2

DeleteOne returns a delete builder for the given entity.

func (*MemberEmailClient) DeleteOneID added in v1.0.2

func (c *MemberEmailClient) DeleteOneID(id int) *MemberEmailDeleteOne

DeleteOneID returns a delete builder for the given id.

func (*MemberEmailClient) Get added in v1.0.2

func (c *MemberEmailClient) Get(ctx context.Context, id int) (*MemberEmail, error)

Get returns a MemberEmail entity by its id.

func (*MemberEmailClient) GetX added in v1.0.2

func (c *MemberEmailClient) GetX(ctx context.Context, id int) *MemberEmail

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

func (*MemberEmailClient) Hooks added in v1.0.2

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

Hooks returns the client hooks.

func (*MemberEmailClient) Query added in v1.0.2

func (c *MemberEmailClient) Query() *MemberEmailQuery

Query returns a query builder for MemberEmail.

func (*MemberEmailClient) QueryEmailOwner added in v1.0.8

func (c *MemberEmailClient) QueryEmailOwner(me *MemberEmail) *MemberQuery

QueryEmailOwner queries the email_owner edge of a MemberEmail.

func (*MemberEmailClient) Update added in v1.0.2

func (c *MemberEmailClient) Update() *MemberEmailUpdate

Update returns an update builder for MemberEmail.

func (*MemberEmailClient) UpdateOne added in v1.0.2

UpdateOne returns an update builder for the given entity.

func (*MemberEmailClient) UpdateOneID added in v1.0.2

func (c *MemberEmailClient) UpdateOneID(id int) *MemberEmailUpdateOne

UpdateOneID returns an update builder for the given id.

func (*MemberEmailClient) Use added in v1.0.2

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

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

type MemberEmailCreate added in v1.0.2

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

MemberEmailCreate is the builder for creating a MemberEmail entity.

func (*MemberEmailCreate) Exec added in v1.0.8

func (mec *MemberEmailCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*MemberEmailCreate) ExecX added in v1.0.8

func (mec *MemberEmailCreate) ExecX(ctx context.Context)

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

func (*MemberEmailCreate) Mutation added in v1.0.2

func (mec *MemberEmailCreate) Mutation() *MemberEmailMutation

Mutation returns the MemberEmailMutation object of the builder.

func (*MemberEmailCreate) Save added in v1.0.2

func (mec *MemberEmailCreate) Save(ctx context.Context) (*MemberEmail, error)

Save creates the MemberEmail in the database.

func (*MemberEmailCreate) SaveX added in v1.0.2

func (mec *MemberEmailCreate) SaveX(ctx context.Context) *MemberEmail

SaveX calls Save and panics if Save returns an error.

func (*MemberEmailCreate) SetCreateTime added in v1.0.2

func (mec *MemberEmailCreate) SetCreateTime(t time.Time) *MemberEmailCreate

SetCreateTime sets the "create_time" field.

func (*MemberEmailCreate) SetEmail added in v1.0.2

func (mec *MemberEmailCreate) SetEmail(s string) *MemberEmailCreate

SetEmail sets the "email" field.

func (*MemberEmailCreate) SetEmailOwner added in v1.0.8

func (mec *MemberEmailCreate) SetEmailOwner(m *Member) *MemberEmailCreate

SetEmailOwner sets the "email_owner" edge to the Member entity.

func (*MemberEmailCreate) SetEmailOwnerID added in v1.0.8

func (mec *MemberEmailCreate) SetEmailOwnerID(id int) *MemberEmailCreate

SetEmailOwnerID sets the "email_owner" edge to the Member entity by ID.

func (*MemberEmailCreate) SetID added in v1.0.2

func (mec *MemberEmailCreate) SetID(i int) *MemberEmailCreate

SetID sets the "id" field.

func (*MemberEmailCreate) SetIsPrimary added in v1.0.2

func (mec *MemberEmailCreate) SetIsPrimary(b bool) *MemberEmailCreate

SetIsPrimary sets the "is_primary" field.

func (*MemberEmailCreate) SetNillableCreateTime added in v1.0.2

func (mec *MemberEmailCreate) SetNillableCreateTime(t *time.Time) *MemberEmailCreate

SetNillableCreateTime sets the "create_time" field if the given value is not nil.

func (*MemberEmailCreate) SetNillableIsPrimary added in v1.0.2

func (mec *MemberEmailCreate) SetNillableIsPrimary(b *bool) *MemberEmailCreate

SetNillableIsPrimary sets the "is_primary" field if the given value is not nil.

func (*MemberEmailCreate) SetNillableUpdateTime added in v1.0.2

func (mec *MemberEmailCreate) SetNillableUpdateTime(t *time.Time) *MemberEmailCreate

SetNillableUpdateTime sets the "update_time" field if the given value is not nil.

func (*MemberEmailCreate) SetNillableVerify added in v1.0.2

func (mec *MemberEmailCreate) SetNillableVerify(b *bool) *MemberEmailCreate

SetNillableVerify sets the "verify" field if the given value is not nil.

func (*MemberEmailCreate) SetNillableVerifyTicket added in v1.0.6

func (mec *MemberEmailCreate) SetNillableVerifyTicket(s *string) *MemberEmailCreate

SetNillableVerifyTicket sets the "verify_ticket" field if the given value is not nil.

func (*MemberEmailCreate) SetNillableVerifyTime added in v1.0.2

func (mec *MemberEmailCreate) SetNillableVerifyTime(t *time.Time) *MemberEmailCreate

SetNillableVerifyTime sets the "verify_time" field if the given value is not nil.

func (*MemberEmailCreate) SetOwnerID added in v1.0.4

func (mec *MemberEmailCreate) SetOwnerID(i int) *MemberEmailCreate

SetOwnerID sets the "owner_id" field.

func (*MemberEmailCreate) SetUpdateTime added in v1.0.2

func (mec *MemberEmailCreate) SetUpdateTime(t time.Time) *MemberEmailCreate

SetUpdateTime sets the "update_time" field.

func (*MemberEmailCreate) SetVerify added in v1.0.2

func (mec *MemberEmailCreate) SetVerify(b bool) *MemberEmailCreate

SetVerify sets the "verify" field.

func (*MemberEmailCreate) SetVerifyTicket added in v1.0.6

func (mec *MemberEmailCreate) SetVerifyTicket(s string) *MemberEmailCreate

SetVerifyTicket sets the "verify_ticket" field.

func (*MemberEmailCreate) SetVerifyTime added in v1.0.2

func (mec *MemberEmailCreate) SetVerifyTime(t time.Time) *MemberEmailCreate

SetVerifyTime sets the "verify_time" field.

type MemberEmailCreateBulk added in v1.0.2

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

MemberEmailCreateBulk is the builder for creating many MemberEmail entities in bulk.

func (*MemberEmailCreateBulk) Exec added in v1.0.8

func (mecb *MemberEmailCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*MemberEmailCreateBulk) ExecX added in v1.0.8

func (mecb *MemberEmailCreateBulk) ExecX(ctx context.Context)

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

func (*MemberEmailCreateBulk) Save added in v1.0.2

func (mecb *MemberEmailCreateBulk) Save(ctx context.Context) ([]*MemberEmail, error)

Save creates the MemberEmail entities in the database.

func (*MemberEmailCreateBulk) SaveX added in v1.0.2

func (mecb *MemberEmailCreateBulk) SaveX(ctx context.Context) []*MemberEmail

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

type MemberEmailDelete added in v1.0.2

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

MemberEmailDelete is the builder for deleting a MemberEmail entity.

func (*MemberEmailDelete) Exec added in v1.0.2

func (med *MemberEmailDelete) Exec(ctx context.Context) (int, error)

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

func (*MemberEmailDelete) ExecX added in v1.0.2

func (med *MemberEmailDelete) ExecX(ctx context.Context) int

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

func (*MemberEmailDelete) Where added in v1.0.2

Where appends a list predicates to the MemberEmailDelete builder.

type MemberEmailDeleteOne added in v1.0.2

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

MemberEmailDeleteOne is the builder for deleting a single MemberEmail entity.

func (*MemberEmailDeleteOne) Exec added in v1.0.2

func (medo *MemberEmailDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*MemberEmailDeleteOne) ExecX added in v1.0.2

func (medo *MemberEmailDeleteOne) ExecX(ctx context.Context)

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

type MemberEmailEdges added in v1.0.2

type MemberEmailEdges struct {
	// EmailOwner holds the value of the email_owner edge.
	EmailOwner *Member `json:"email_owner,omitempty"`
	// contains filtered or unexported fields
}

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

func (MemberEmailEdges) EmailOwnerOrErr added in v1.0.8

func (e MemberEmailEdges) EmailOwnerOrErr() (*Member, error)

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

type MemberEmailGroupBy added in v1.0.2

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

MemberEmailGroupBy is the group-by builder for MemberEmail entities.

func (*MemberEmailGroupBy) Aggregate added in v1.0.2

func (megb *MemberEmailGroupBy) Aggregate(fns ...AggregateFunc) *MemberEmailGroupBy

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

func (*MemberEmailGroupBy) Bool added in v1.0.2

func (megb *MemberEmailGroupBy) 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 (*MemberEmailGroupBy) BoolX added in v1.0.2

func (megb *MemberEmailGroupBy) BoolX(ctx context.Context) bool

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

func (*MemberEmailGroupBy) Bools added in v1.0.2

func (megb *MemberEmailGroupBy) 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 (*MemberEmailGroupBy) BoolsX added in v1.0.2

func (megb *MemberEmailGroupBy) BoolsX(ctx context.Context) []bool

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

func (*MemberEmailGroupBy) Float64 added in v1.0.2

func (megb *MemberEmailGroupBy) 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 (*MemberEmailGroupBy) Float64X added in v1.0.2

func (megb *MemberEmailGroupBy) Float64X(ctx context.Context) float64

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

func (*MemberEmailGroupBy) Float64s added in v1.0.2

func (megb *MemberEmailGroupBy) 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 (*MemberEmailGroupBy) Float64sX added in v1.0.2

func (megb *MemberEmailGroupBy) Float64sX(ctx context.Context) []float64

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

func (*MemberEmailGroupBy) Int added in v1.0.2

func (megb *MemberEmailGroupBy) 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 (*MemberEmailGroupBy) IntX added in v1.0.2

func (megb *MemberEmailGroupBy) IntX(ctx context.Context) int

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

func (*MemberEmailGroupBy) Ints added in v1.0.2

func (megb *MemberEmailGroupBy) 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 (*MemberEmailGroupBy) IntsX added in v1.0.2

func (megb *MemberEmailGroupBy) IntsX(ctx context.Context) []int

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

func (*MemberEmailGroupBy) Scan added in v1.0.2

func (megb *MemberEmailGroupBy) Scan(ctx context.Context, v interface{}) error

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

func (*MemberEmailGroupBy) ScanX added in v1.0.2

func (megb *MemberEmailGroupBy) ScanX(ctx context.Context, v interface{})

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

func (*MemberEmailGroupBy) String added in v1.0.2

func (megb *MemberEmailGroupBy) 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 (*MemberEmailGroupBy) StringX added in v1.0.2

func (megb *MemberEmailGroupBy) StringX(ctx context.Context) string

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

func (*MemberEmailGroupBy) Strings added in v1.0.2

func (megb *MemberEmailGroupBy) 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 (*MemberEmailGroupBy) StringsX added in v1.0.2

func (megb *MemberEmailGroupBy) StringsX(ctx context.Context) []string

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

type MemberEmailMutation added in v1.0.2

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

MemberEmailMutation represents an operation that mutates the MemberEmail nodes in the graph.

func (*MemberEmailMutation) AddField added in v1.0.2

func (m *MemberEmailMutation) 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 (*MemberEmailMutation) AddedEdges added in v1.0.2

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

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

func (*MemberEmailMutation) AddedField added in v1.0.2

func (m *MemberEmailMutation) 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 (*MemberEmailMutation) AddedFields added in v1.0.2

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

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

func (*MemberEmailMutation) AddedIDs added in v1.0.2

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

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

func (*MemberEmailMutation) ClearEdge added in v1.0.2

func (m *MemberEmailMutation) 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 (*MemberEmailMutation) ClearEmailOwner added in v1.0.8

func (m *MemberEmailMutation) ClearEmailOwner()

ClearEmailOwner clears the "email_owner" edge to the Member entity.

func (*MemberEmailMutation) ClearField added in v1.0.2

func (m *MemberEmailMutation) 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 (*MemberEmailMutation) ClearVerifyTicket added in v1.0.6

func (m *MemberEmailMutation) ClearVerifyTicket()

ClearVerifyTicket clears the value of the "verify_ticket" field.

func (*MemberEmailMutation) ClearVerifyTime added in v1.0.10

func (m *MemberEmailMutation) ClearVerifyTime()

ClearVerifyTime clears the value of the "verify_time" field.

func (*MemberEmailMutation) ClearedEdges added in v1.0.2

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

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

func (*MemberEmailMutation) ClearedFields added in v1.0.2

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

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

func (MemberEmailMutation) Client added in v1.0.2

func (m MemberEmailMutation) 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 (*MemberEmailMutation) CreateTime added in v1.0.2

func (m *MemberEmailMutation) CreateTime() (r time.Time, exists bool)

CreateTime returns the value of the "create_time" field in the mutation.

func (*MemberEmailMutation) EdgeCleared added in v1.0.2

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

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

func (*MemberEmailMutation) Email added in v1.0.2

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

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

func (*MemberEmailMutation) EmailOwnerCleared added in v1.0.8

func (m *MemberEmailMutation) EmailOwnerCleared() bool

EmailOwnerCleared reports if the "email_owner" edge to the Member entity was cleared.

func (*MemberEmailMutation) EmailOwnerID added in v1.0.8

func (m *MemberEmailMutation) EmailOwnerID() (id int, exists bool)

EmailOwnerID returns the "email_owner" edge ID in the mutation.

func (*MemberEmailMutation) EmailOwnerIDs added in v1.0.8

func (m *MemberEmailMutation) EmailOwnerIDs() (ids []int)

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

func (*MemberEmailMutation) Field added in v1.0.2

func (m *MemberEmailMutation) 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 (*MemberEmailMutation) FieldCleared added in v1.0.2

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

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

func (*MemberEmailMutation) Fields added in v1.0.2

func (m *MemberEmailMutation) 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 (*MemberEmailMutation) ID added in v1.0.2

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

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

func (*MemberEmailMutation) IsPrimary added in v1.0.2

func (m *MemberEmailMutation) IsPrimary() (r bool, exists bool)

IsPrimary returns the value of the "is_primary" field in the mutation.

func (*MemberEmailMutation) OldCreateTime added in v1.0.2

func (m *MemberEmailMutation) OldCreateTime(ctx context.Context) (v time.Time, err error)

OldCreateTime returns the old "create_time" field's value of the MemberEmail entity. If the MemberEmail 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 (*MemberEmailMutation) OldEmail added in v1.0.2

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

OldEmail returns the old "email" field's value of the MemberEmail entity. If the MemberEmail 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 (*MemberEmailMutation) OldField added in v1.0.2

func (m *MemberEmailMutation) 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 (*MemberEmailMutation) OldIsPrimary added in v1.0.2

func (m *MemberEmailMutation) OldIsPrimary(ctx context.Context) (v bool, err error)

OldIsPrimary returns the old "is_primary" field's value of the MemberEmail entity. If the MemberEmail 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 (*MemberEmailMutation) OldOwnerID added in v1.0.4

func (m *MemberEmailMutation) OldOwnerID(ctx context.Context) (v int, err error)

OldOwnerID returns the old "owner_id" field's value of the MemberEmail entity. If the MemberEmail 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 (*MemberEmailMutation) OldUpdateTime added in v1.0.2

func (m *MemberEmailMutation) OldUpdateTime(ctx context.Context) (v time.Time, err error)

OldUpdateTime returns the old "update_time" field's value of the MemberEmail entity. If the MemberEmail 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 (*MemberEmailMutation) OldVerify added in v1.0.2

func (m *MemberEmailMutation) OldVerify(ctx context.Context) (v bool, err error)

OldVerify returns the old "verify" field's value of the MemberEmail entity. If the MemberEmail 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 (*MemberEmailMutation) OldVerifyTicket added in v1.0.6

func (m *MemberEmailMutation) OldVerifyTicket(ctx context.Context) (v *string, err error)

OldVerifyTicket returns the old "verify_ticket" field's value of the MemberEmail entity. If the MemberEmail 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 (*MemberEmailMutation) OldVerifyTime added in v1.0.2

func (m *MemberEmailMutation) OldVerifyTime(ctx context.Context) (v *time.Time, err error)

OldVerifyTime returns the old "verify_time" field's value of the MemberEmail entity. If the MemberEmail 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 (*MemberEmailMutation) Op added in v1.0.2

func (m *MemberEmailMutation) Op() Op

Op returns the operation name.

func (*MemberEmailMutation) OwnerID added in v1.0.4

func (m *MemberEmailMutation) OwnerID() (r int, exists bool)

OwnerID returns the value of the "owner_id" field in the mutation.

func (*MemberEmailMutation) RemovedEdges added in v1.0.2

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

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

func (*MemberEmailMutation) RemovedIDs added in v1.0.2

func (m *MemberEmailMutation) 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 (*MemberEmailMutation) ResetCreateTime added in v1.0.2

func (m *MemberEmailMutation) ResetCreateTime()

ResetCreateTime resets all changes to the "create_time" field.

func (*MemberEmailMutation) ResetEdge added in v1.0.2

func (m *MemberEmailMutation) 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 (*MemberEmailMutation) ResetEmail added in v1.0.2

func (m *MemberEmailMutation) ResetEmail()

ResetEmail resets all changes to the "email" field.

func (*MemberEmailMutation) ResetEmailOwner added in v1.0.8

func (m *MemberEmailMutation) ResetEmailOwner()

ResetEmailOwner resets all changes to the "email_owner" edge.

func (*MemberEmailMutation) ResetField added in v1.0.2

func (m *MemberEmailMutation) 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 (*MemberEmailMutation) ResetIsPrimary added in v1.0.2

func (m *MemberEmailMutation) ResetIsPrimary()

ResetIsPrimary resets all changes to the "is_primary" field.

func (*MemberEmailMutation) ResetOwnerID added in v1.0.4

func (m *MemberEmailMutation) ResetOwnerID()

ResetOwnerID resets all changes to the "owner_id" field.

func (*MemberEmailMutation) ResetUpdateTime added in v1.0.2

func (m *MemberEmailMutation) ResetUpdateTime()

ResetUpdateTime resets all changes to the "update_time" field.

func (*MemberEmailMutation) ResetVerify added in v1.0.2

func (m *MemberEmailMutation) ResetVerify()

ResetVerify resets all changes to the "verify" field.

func (*MemberEmailMutation) ResetVerifyTicket added in v1.0.6

func (m *MemberEmailMutation) ResetVerifyTicket()

ResetVerifyTicket resets all changes to the "verify_ticket" field.

func (*MemberEmailMutation) ResetVerifyTime added in v1.0.2

func (m *MemberEmailMutation) ResetVerifyTime()

ResetVerifyTime resets all changes to the "verify_time" field.

func (*MemberEmailMutation) SetCreateTime added in v1.0.2

func (m *MemberEmailMutation) SetCreateTime(t time.Time)

SetCreateTime sets the "create_time" field.

func (*MemberEmailMutation) SetEmail added in v1.0.2

func (m *MemberEmailMutation) SetEmail(s string)

SetEmail sets the "email" field.

func (*MemberEmailMutation) SetEmailOwnerID added in v1.0.8

func (m *MemberEmailMutation) SetEmailOwnerID(id int)

SetEmailOwnerID sets the "email_owner" edge to the Member entity by id.

func (*MemberEmailMutation) SetField added in v1.0.2

func (m *MemberEmailMutation) 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 (*MemberEmailMutation) SetID added in v1.0.2

func (m *MemberEmailMutation) SetID(id int)

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

func (*MemberEmailMutation) SetIsPrimary added in v1.0.2

func (m *MemberEmailMutation) SetIsPrimary(b bool)

SetIsPrimary sets the "is_primary" field.

func (*MemberEmailMutation) SetOwnerID added in v1.0.4

func (m *MemberEmailMutation) SetOwnerID(i int)

SetOwnerID sets the "owner_id" field.

func (*MemberEmailMutation) SetUpdateTime added in v1.0.2

func (m *MemberEmailMutation) SetUpdateTime(t time.Time)

SetUpdateTime sets the "update_time" field.

func (*MemberEmailMutation) SetVerify added in v1.0.2

func (m *MemberEmailMutation) SetVerify(b bool)

SetVerify sets the "verify" field.

func (*MemberEmailMutation) SetVerifyTicket added in v1.0.6

func (m *MemberEmailMutation) SetVerifyTicket(s string)

SetVerifyTicket sets the "verify_ticket" field.

func (*MemberEmailMutation) SetVerifyTime added in v1.0.2

func (m *MemberEmailMutation) SetVerifyTime(t time.Time)

SetVerifyTime sets the "verify_time" field.

func (MemberEmailMutation) Tx added in v1.0.2

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

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

func (*MemberEmailMutation) Type added in v1.0.2

func (m *MemberEmailMutation) Type() string

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

func (*MemberEmailMutation) UpdateTime added in v1.0.2

func (m *MemberEmailMutation) UpdateTime() (r time.Time, exists bool)

UpdateTime returns the value of the "update_time" field in the mutation.

func (*MemberEmailMutation) Verify added in v1.0.2

func (m *MemberEmailMutation) Verify() (r bool, exists bool)

Verify returns the value of the "verify" field in the mutation.

func (*MemberEmailMutation) VerifyTicket added in v1.0.6

func (m *MemberEmailMutation) VerifyTicket() (r string, exists bool)

VerifyTicket returns the value of the "verify_ticket" field in the mutation.

func (*MemberEmailMutation) VerifyTicketCleared added in v1.0.6

func (m *MemberEmailMutation) VerifyTicketCleared() bool

VerifyTicketCleared returns if the "verify_ticket" field was cleared in this mutation.

func (*MemberEmailMutation) VerifyTime added in v1.0.2

func (m *MemberEmailMutation) VerifyTime() (r time.Time, exists bool)

VerifyTime returns the value of the "verify_time" field in the mutation.

func (*MemberEmailMutation) VerifyTimeCleared added in v1.0.10

func (m *MemberEmailMutation) VerifyTimeCleared() bool

VerifyTimeCleared returns if the "verify_time" field was cleared in this mutation.

func (*MemberEmailMutation) Where added in v1.0.8

func (m *MemberEmailMutation) Where(ps ...predicate.MemberEmail)

Where appends a list predicates to the MemberEmailMutation builder.

type MemberEmailQuery added in v1.0.2

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

MemberEmailQuery is the builder for querying MemberEmail entities.

func (*MemberEmailQuery) All added in v1.0.2

func (meq *MemberEmailQuery) All(ctx context.Context) ([]*MemberEmail, error)

All executes the query and returns a list of MemberEmails.

func (*MemberEmailQuery) AllX added in v1.0.2

func (meq *MemberEmailQuery) AllX(ctx context.Context) []*MemberEmail

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

func (*MemberEmailQuery) Clone added in v1.0.2

func (meq *MemberEmailQuery) Clone() *MemberEmailQuery

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

func (*MemberEmailQuery) Count added in v1.0.2

func (meq *MemberEmailQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*MemberEmailQuery) CountX added in v1.0.2

func (meq *MemberEmailQuery) CountX(ctx context.Context) int

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

func (*MemberEmailQuery) Exist added in v1.0.2

func (meq *MemberEmailQuery) Exist(ctx context.Context) (bool, error)

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

func (*MemberEmailQuery) ExistX added in v1.0.2

func (meq *MemberEmailQuery) ExistX(ctx context.Context) bool

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

func (*MemberEmailQuery) First added in v1.0.2

func (meq *MemberEmailQuery) First(ctx context.Context) (*MemberEmail, error)

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

func (*MemberEmailQuery) FirstID added in v1.0.2

func (meq *MemberEmailQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*MemberEmailQuery) FirstIDX added in v1.0.2

func (meq *MemberEmailQuery) FirstIDX(ctx context.Context) int

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

func (*MemberEmailQuery) FirstX added in v1.0.2

func (meq *MemberEmailQuery) FirstX(ctx context.Context) *MemberEmail

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

func (*MemberEmailQuery) GroupBy added in v1.0.2

func (meq *MemberEmailQuery) GroupBy(field string, fields ...string) *MemberEmailGroupBy

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

client.MemberEmail.Query().
	GroupBy(memberemail.FieldOwnerID).
	Aggregate(model.Count()).
	Scan(ctx, &v)

func (*MemberEmailQuery) IDs added in v1.0.2

func (meq *MemberEmailQuery) IDs(ctx context.Context) ([]int, error)

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

func (*MemberEmailQuery) IDsX added in v1.0.2

func (meq *MemberEmailQuery) IDsX(ctx context.Context) []int

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

func (*MemberEmailQuery) Limit added in v1.0.2

func (meq *MemberEmailQuery) Limit(limit int) *MemberEmailQuery

Limit adds a limit step to the query.

func (*MemberEmailQuery) Offset added in v1.0.2

func (meq *MemberEmailQuery) Offset(offset int) *MemberEmailQuery

Offset adds an offset step to the query.

func (*MemberEmailQuery) Only added in v1.0.2

func (meq *MemberEmailQuery) Only(ctx context.Context) (*MemberEmail, error)

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

func (*MemberEmailQuery) OnlyID added in v1.0.2

func (meq *MemberEmailQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*MemberEmailQuery) OnlyIDX added in v1.0.2

func (meq *MemberEmailQuery) OnlyIDX(ctx context.Context) int

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

func (*MemberEmailQuery) OnlyX added in v1.0.2

func (meq *MemberEmailQuery) OnlyX(ctx context.Context) *MemberEmail

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

func (*MemberEmailQuery) Order added in v1.0.2

func (meq *MemberEmailQuery) Order(o ...OrderFunc) *MemberEmailQuery

Order adds an order step to the query.

func (*MemberEmailQuery) QueryEmailOwner added in v1.0.8

func (meq *MemberEmailQuery) QueryEmailOwner() *MemberQuery

QueryEmailOwner chains the current query on the "email_owner" edge.

func (*MemberEmailQuery) Select added in v1.0.2

func (meq *MemberEmailQuery) Select(fields ...string) *MemberEmailSelect

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 {
	OwnerID int `json:"-"`
}

client.MemberEmail.Query().
	Select(memberemail.FieldOwnerID).
	Scan(ctx, &v)

func (*MemberEmailQuery) Unique added in v1.0.2

func (meq *MemberEmailQuery) Unique(unique bool) *MemberEmailQuery

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 (*MemberEmailQuery) Where added in v1.0.2

Where adds a new predicate for the MemberEmailQuery builder.

func (*MemberEmailQuery) WithEmailOwner added in v1.0.8

func (meq *MemberEmailQuery) WithEmailOwner(opts ...func(*MemberQuery)) *MemberEmailQuery

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

type MemberEmailSelect added in v1.0.2

type MemberEmailSelect struct {
	*MemberEmailQuery
	// contains filtered or unexported fields
}

MemberEmailSelect is the builder for selecting fields of MemberEmail entities.

func (*MemberEmailSelect) Bool added in v1.0.2

func (mes *MemberEmailSelect) Bool(ctx context.Context) (_ bool, err error)

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

func (*MemberEmailSelect) BoolX added in v1.0.2

func (mes *MemberEmailSelect) BoolX(ctx context.Context) bool

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

func (*MemberEmailSelect) Bools added in v1.0.2

func (mes *MemberEmailSelect) Bools(ctx context.Context) ([]bool, error)

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

func (*MemberEmailSelect) BoolsX added in v1.0.2

func (mes *MemberEmailSelect) BoolsX(ctx context.Context) []bool

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

func (*MemberEmailSelect) Float64 added in v1.0.2

func (mes *MemberEmailSelect) Float64(ctx context.Context) (_ float64, err error)

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

func (*MemberEmailSelect) Float64X added in v1.0.2

func (mes *MemberEmailSelect) Float64X(ctx context.Context) float64

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

func (*MemberEmailSelect) Float64s added in v1.0.2

func (mes *MemberEmailSelect) Float64s(ctx context.Context) ([]float64, error)

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

func (*MemberEmailSelect) Float64sX added in v1.0.2

func (mes *MemberEmailSelect) Float64sX(ctx context.Context) []float64

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

func (*MemberEmailSelect) Int added in v1.0.2

func (mes *MemberEmailSelect) Int(ctx context.Context) (_ int, err error)

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

func (*MemberEmailSelect) IntX added in v1.0.2

func (mes *MemberEmailSelect) IntX(ctx context.Context) int

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

func (*MemberEmailSelect) Ints added in v1.0.2

func (mes *MemberEmailSelect) Ints(ctx context.Context) ([]int, error)

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

func (*MemberEmailSelect) IntsX added in v1.0.2

func (mes *MemberEmailSelect) IntsX(ctx context.Context) []int

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

func (*MemberEmailSelect) Scan added in v1.0.2

func (mes *MemberEmailSelect) Scan(ctx context.Context, v interface{}) error

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

func (*MemberEmailSelect) ScanX added in v1.0.2

func (mes *MemberEmailSelect) ScanX(ctx context.Context, v interface{})

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

func (*MemberEmailSelect) String added in v1.0.2

func (mes *MemberEmailSelect) String(ctx context.Context) (_ string, err error)

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

func (*MemberEmailSelect) StringX added in v1.0.2

func (mes *MemberEmailSelect) StringX(ctx context.Context) string

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

func (*MemberEmailSelect) Strings added in v1.0.2

func (mes *MemberEmailSelect) Strings(ctx context.Context) ([]string, error)

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

func (*MemberEmailSelect) StringsX added in v1.0.2

func (mes *MemberEmailSelect) StringsX(ctx context.Context) []string

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

type MemberEmailUpdate added in v1.0.2

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

MemberEmailUpdate is the builder for updating MemberEmail entities.

func (*MemberEmailUpdate) ClearEmailOwner added in v1.0.8

func (meu *MemberEmailUpdate) ClearEmailOwner() *MemberEmailUpdate

ClearEmailOwner clears the "email_owner" edge to the Member entity.

func (*MemberEmailUpdate) ClearVerifyTicket added in v1.0.6

func (meu *MemberEmailUpdate) ClearVerifyTicket() *MemberEmailUpdate

ClearVerifyTicket clears the value of the "verify_ticket" field.

func (*MemberEmailUpdate) ClearVerifyTime added in v1.0.10

func (meu *MemberEmailUpdate) ClearVerifyTime() *MemberEmailUpdate

ClearVerifyTime clears the value of the "verify_time" field.

func (*MemberEmailUpdate) Exec added in v1.0.2

func (meu *MemberEmailUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*MemberEmailUpdate) ExecX added in v1.0.2

func (meu *MemberEmailUpdate) ExecX(ctx context.Context)

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

func (*MemberEmailUpdate) Mutation added in v1.0.2

func (meu *MemberEmailUpdate) Mutation() *MemberEmailMutation

Mutation returns the MemberEmailMutation object of the builder.

func (*MemberEmailUpdate) Save added in v1.0.2

func (meu *MemberEmailUpdate) Save(ctx context.Context) (int, error)

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

func (*MemberEmailUpdate) SaveX added in v1.0.2

func (meu *MemberEmailUpdate) SaveX(ctx context.Context) int

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

func (*MemberEmailUpdate) SetEmail added in v1.0.2

func (meu *MemberEmailUpdate) SetEmail(s string) *MemberEmailUpdate

SetEmail sets the "email" field.

func (*MemberEmailUpdate) SetEmailOwner added in v1.0.8

func (meu *MemberEmailUpdate) SetEmailOwner(m *Member) *MemberEmailUpdate

SetEmailOwner sets the "email_owner" edge to the Member entity.

func (*MemberEmailUpdate) SetEmailOwnerID added in v1.0.8

func (meu *MemberEmailUpdate) SetEmailOwnerID(id int) *MemberEmailUpdate

SetEmailOwnerID sets the "email_owner" edge to the Member entity by ID.

func (*MemberEmailUpdate) SetIsPrimary added in v1.0.2

func (meu *MemberEmailUpdate) SetIsPrimary(b bool) *MemberEmailUpdate

SetIsPrimary sets the "is_primary" field.

func (*MemberEmailUpdate) SetNillableIsPrimary added in v1.0.2

func (meu *MemberEmailUpdate) SetNillableIsPrimary(b *bool) *MemberEmailUpdate

SetNillableIsPrimary sets the "is_primary" field if the given value is not nil.

func (*MemberEmailUpdate) SetNillableVerify added in v1.0.2

func (meu *MemberEmailUpdate) SetNillableVerify(b *bool) *MemberEmailUpdate

SetNillableVerify sets the "verify" field if the given value is not nil.

func (*MemberEmailUpdate) SetNillableVerifyTicket added in v1.0.6

func (meu *MemberEmailUpdate) SetNillableVerifyTicket(s *string) *MemberEmailUpdate

SetNillableVerifyTicket sets the "verify_ticket" field if the given value is not nil.

func (*MemberEmailUpdate) SetNillableVerifyTime added in v1.0.10

func (meu *MemberEmailUpdate) SetNillableVerifyTime(t *time.Time) *MemberEmailUpdate

SetNillableVerifyTime sets the "verify_time" field if the given value is not nil.

func (*MemberEmailUpdate) SetOwnerID added in v1.0.4

func (meu *MemberEmailUpdate) SetOwnerID(i int) *MemberEmailUpdate

SetOwnerID sets the "owner_id" field.

func (*MemberEmailUpdate) SetUpdateTime added in v1.0.2

func (meu *MemberEmailUpdate) SetUpdateTime(t time.Time) *MemberEmailUpdate

SetUpdateTime sets the "update_time" field.

func (*MemberEmailUpdate) SetVerify added in v1.0.2

func (meu *MemberEmailUpdate) SetVerify(b bool) *MemberEmailUpdate

SetVerify sets the "verify" field.

func (*MemberEmailUpdate) SetVerifyTicket added in v1.0.6

func (meu *MemberEmailUpdate) SetVerifyTicket(s string) *MemberEmailUpdate

SetVerifyTicket sets the "verify_ticket" field.

func (*MemberEmailUpdate) SetVerifyTime added in v1.0.2

func (meu *MemberEmailUpdate) SetVerifyTime(t time.Time) *MemberEmailUpdate

SetVerifyTime sets the "verify_time" field.

func (*MemberEmailUpdate) Where added in v1.0.2

Where appends a list predicates to the MemberEmailUpdate builder.

type MemberEmailUpdateOne added in v1.0.2

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

MemberEmailUpdateOne is the builder for updating a single MemberEmail entity.

func (*MemberEmailUpdateOne) ClearEmailOwner added in v1.0.8

func (meuo *MemberEmailUpdateOne) ClearEmailOwner() *MemberEmailUpdateOne

ClearEmailOwner clears the "email_owner" edge to the Member entity.

func (*MemberEmailUpdateOne) ClearVerifyTicket added in v1.0.6

func (meuo *MemberEmailUpdateOne) ClearVerifyTicket() *MemberEmailUpdateOne

ClearVerifyTicket clears the value of the "verify_ticket" field.

func (*MemberEmailUpdateOne) ClearVerifyTime added in v1.0.10

func (meuo *MemberEmailUpdateOne) ClearVerifyTime() *MemberEmailUpdateOne

ClearVerifyTime clears the value of the "verify_time" field.

func (*MemberEmailUpdateOne) Exec added in v1.0.2

func (meuo *MemberEmailUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*MemberEmailUpdateOne) ExecX added in v1.0.2

func (meuo *MemberEmailUpdateOne) ExecX(ctx context.Context)

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

func (*MemberEmailUpdateOne) Mutation added in v1.0.2

func (meuo *MemberEmailUpdateOne) Mutation() *MemberEmailMutation

Mutation returns the MemberEmailMutation object of the builder.

func (*MemberEmailUpdateOne) Save added in v1.0.2

Save executes the query and returns the updated MemberEmail entity.

func (*MemberEmailUpdateOne) SaveX added in v1.0.2

func (meuo *MemberEmailUpdateOne) SaveX(ctx context.Context) *MemberEmail

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

func (*MemberEmailUpdateOne) Select added in v1.0.2

func (meuo *MemberEmailUpdateOne) Select(field string, fields ...string) *MemberEmailUpdateOne

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

func (*MemberEmailUpdateOne) SetEmail added in v1.0.2

SetEmail sets the "email" field.

func (*MemberEmailUpdateOne) SetEmailOwner added in v1.0.8

func (meuo *MemberEmailUpdateOne) SetEmailOwner(m *Member) *MemberEmailUpdateOne

SetEmailOwner sets the "email_owner" edge to the Member entity.

func (*MemberEmailUpdateOne) SetEmailOwnerID added in v1.0.8

func (meuo *MemberEmailUpdateOne) SetEmailOwnerID(id int) *MemberEmailUpdateOne

SetEmailOwnerID sets the "email_owner" edge to the Member entity by ID.

func (*MemberEmailUpdateOne) SetIsPrimary added in v1.0.2

func (meuo *MemberEmailUpdateOne) SetIsPrimary(b bool) *MemberEmailUpdateOne

SetIsPrimary sets the "is_primary" field.

func (*MemberEmailUpdateOne) SetNillableIsPrimary added in v1.0.2

func (meuo *MemberEmailUpdateOne) SetNillableIsPrimary(b *bool) *MemberEmailUpdateOne

SetNillableIsPrimary sets the "is_primary" field if the given value is not nil.

func (*MemberEmailUpdateOne) SetNillableVerify added in v1.0.2

func (meuo *MemberEmailUpdateOne) SetNillableVerify(b *bool) *MemberEmailUpdateOne

SetNillableVerify sets the "verify" field if the given value is not nil.

func (*MemberEmailUpdateOne) SetNillableVerifyTicket added in v1.0.6

func (meuo *MemberEmailUpdateOne) SetNillableVerifyTicket(s *string) *MemberEmailUpdateOne

SetNillableVerifyTicket sets the "verify_ticket" field if the given value is not nil.

func (*MemberEmailUpdateOne) SetNillableVerifyTime added in v1.0.10

func (meuo *MemberEmailUpdateOne) SetNillableVerifyTime(t *time.Time) *MemberEmailUpdateOne

SetNillableVerifyTime sets the "verify_time" field if the given value is not nil.

func (*MemberEmailUpdateOne) SetOwnerID added in v1.0.4

func (meuo *MemberEmailUpdateOne) SetOwnerID(i int) *MemberEmailUpdateOne

SetOwnerID sets the "owner_id" field.

func (*MemberEmailUpdateOne) SetUpdateTime added in v1.0.2

func (meuo *MemberEmailUpdateOne) SetUpdateTime(t time.Time) *MemberEmailUpdateOne

SetUpdateTime sets the "update_time" field.

func (*MemberEmailUpdateOne) SetVerify added in v1.0.2

func (meuo *MemberEmailUpdateOne) SetVerify(b bool) *MemberEmailUpdateOne

SetVerify sets the "verify" field.

func (*MemberEmailUpdateOne) SetVerifyTicket added in v1.0.6

func (meuo *MemberEmailUpdateOne) SetVerifyTicket(s string) *MemberEmailUpdateOne

SetVerifyTicket sets the "verify_ticket" field.

func (*MemberEmailUpdateOne) SetVerifyTime added in v1.0.2

func (meuo *MemberEmailUpdateOne) SetVerifyTime(t time.Time) *MemberEmailUpdateOne

SetVerifyTime sets the "verify_time" field.

type MemberEmails added in v1.0.2

type MemberEmails []*MemberEmail

MemberEmails is a parsable slice of MemberEmail.

type MemberGroupBy

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

MemberGroupBy is the group-by builder for Member entities.

func (*MemberGroupBy) Aggregate

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

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

func (*MemberGroupBy) Bool

func (mgb *MemberGroupBy) 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 (*MemberGroupBy) BoolX

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

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

func (*MemberGroupBy) Bools

func (mgb *MemberGroupBy) 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 (*MemberGroupBy) BoolsX

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

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

func (*MemberGroupBy) Float64

func (mgb *MemberGroupBy) 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 (*MemberGroupBy) Float64X

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

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

func (*MemberGroupBy) Float64s

func (mgb *MemberGroupBy) 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 (*MemberGroupBy) Float64sX

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

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

func (*MemberGroupBy) Int

func (mgb *MemberGroupBy) 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 (*MemberGroupBy) IntX

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

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

func (*MemberGroupBy) Ints

func (mgb *MemberGroupBy) 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 (*MemberGroupBy) IntsX

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

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

func (*MemberGroupBy) Scan

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

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

func (*MemberGroupBy) ScanX

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

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

func (*MemberGroupBy) String

func (mgb *MemberGroupBy) 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 (*MemberGroupBy) StringX

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

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

func (*MemberGroupBy) Strings

func (mgb *MemberGroupBy) 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 (*MemberGroupBy) StringsX

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

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

type MemberMutation

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

MemberMutation represents an operation that mutates the Member nodes in the graph.

func (*MemberMutation) AddField

func (m *MemberMutation) 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 (*MemberMutation) AddMemberEmailIDs added in v1.0.8

func (m *MemberMutation) AddMemberEmailIDs(ids ...int)

AddMemberEmailIDs adds the "member_emails" edge to the MemberEmail entity by ids.

func (*MemberMutation) AddMemberSecurityLogIDs added in v1.0.10

func (m *MemberMutation) AddMemberSecurityLogIDs(ids ...int)

AddMemberSecurityLogIDs adds the "member_security_logs" edge to the MemberSecurityLog entity by ids.

func (*MemberMutation) AddMemberSettingIDs added in v1.0.8

func (m *MemberMutation) AddMemberSettingIDs(ids ...int)

AddMemberSettingIDs adds the "member_settings" edge to the MemberSetting entity by ids.

func (*MemberMutation) AddMemberSnippetDocIDs added in v1.0.9

func (m *MemberMutation) AddMemberSnippetDocIDs(ids ...int)

AddMemberSnippetDocIDs adds the "member_snippet_docs" edge to the SnippetDocument entity by ids.

func (*MemberMutation) AddMemberSnippetFolderIDs added in v1.0.9

func (m *MemberMutation) AddMemberSnippetFolderIDs(ids ...int)

AddMemberSnippetFolderIDs adds the "member_snippet_folders" edge to the SnippetFolder entity by ids.

func (*MemberMutation) AddMemberSnippetIDs added in v1.0.9

func (m *MemberMutation) AddMemberSnippetIDs(ids ...int)

AddMemberSnippetIDs adds the "member_snippets" edge to the Snippet entity by ids.

func (*MemberMutation) AddMemberSnippetTagIDs added in v1.0.9

func (m *MemberMutation) AddMemberSnippetTagIDs(ids ...int)

AddMemberSnippetTagIDs adds the "member_snippet_tags" edge to the SnippetTag entity by ids.

func (*MemberMutation) AddedEdges

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

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

func (*MemberMutation) AddedField

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

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

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

func (*MemberMutation) AddedIDs

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

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

func (*MemberMutation) ClearDeleteTime

func (m *MemberMutation) ClearDeleteTime()

ClearDeleteTime clears the value of the "delete_time" field.

func (*MemberMutation) ClearEdge

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

func (m *MemberMutation) 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 (*MemberMutation) ClearGroupID added in v1.0.2

func (m *MemberMutation) ClearGroupID()

ClearGroupID clears the value of the "group_id" field.

func (*MemberMutation) ClearLastPwdAuth

func (m *MemberMutation) ClearLastPwdAuth()

ClearLastPwdAuth clears the value of the "last_pwd_auth" field.

func (*MemberMutation) ClearMemberEmails added in v1.0.8

func (m *MemberMutation) ClearMemberEmails()

ClearMemberEmails clears the "member_emails" edge to the MemberEmail entity.

func (*MemberMutation) ClearMemberGroup added in v1.0.10

func (m *MemberMutation) ClearMemberGroup()

ClearMemberGroup clears the "member_group" edge to the Group entity.

func (*MemberMutation) ClearMemberSecurityLogs added in v1.0.10

func (m *MemberMutation) ClearMemberSecurityLogs()

ClearMemberSecurityLogs clears the "member_security_logs" edge to the MemberSecurityLog entity.

func (*MemberMutation) ClearMemberSettings added in v1.0.8

func (m *MemberMutation) ClearMemberSettings()

ClearMemberSettings clears the "member_settings" edge to the MemberSetting entity.

func (*MemberMutation) ClearMemberSnippetDocs added in v1.0.9

func (m *MemberMutation) ClearMemberSnippetDocs()

ClearMemberSnippetDocs clears the "member_snippet_docs" edge to the SnippetDocument entity.

func (*MemberMutation) ClearMemberSnippetFolders added in v1.0.9

func (m *MemberMutation) ClearMemberSnippetFolders()

ClearMemberSnippetFolders clears the "member_snippet_folders" edge to the SnippetFolder entity.

func (*MemberMutation) ClearMemberSnippetTags added in v1.0.9

func (m *MemberMutation) ClearMemberSnippetTags()

ClearMemberSnippetTags clears the "member_snippet_tags" edge to the SnippetTag entity.

func (*MemberMutation) ClearMemberSnippets added in v1.0.9

func (m *MemberMutation) ClearMemberSnippets()

ClearMemberSnippets clears the "member_snippets" edge to the Snippet entity.

func (*MemberMutation) ClearPassword added in v1.0.4

func (m *MemberMutation) ClearPassword()

ClearPassword clears the value of the "password" field.

func (*MemberMutation) ClearPhone

func (m *MemberMutation) ClearPhone()

ClearPhone clears the value of the "phone" field.

func (*MemberMutation) ClearStatus

func (m *MemberMutation) ClearStatus()

ClearStatus clears the value of the "status" field.

func (*MemberMutation) ClearedEdges

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

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

func (*MemberMutation) ClearedFields

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

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

func (MemberMutation) Client

func (m MemberMutation) 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 (*MemberMutation) CreateTime

func (m *MemberMutation) CreateTime() (r time.Time, exists bool)

CreateTime returns the value of the "create_time" field in the mutation.

func (*MemberMutation) DeleteTime

func (m *MemberMutation) DeleteTime() (r time.Time, exists bool)

DeleteTime returns the value of the "delete_time" field in the mutation.

func (*MemberMutation) DeleteTimeCleared

func (m *MemberMutation) DeleteTimeCleared() bool

DeleteTimeCleared returns if the "delete_time" field was cleared in this mutation.

func (*MemberMutation) EdgeCleared

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

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

func (*MemberMutation) Field

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

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

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

func (*MemberMutation) Fields

func (m *MemberMutation) 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 (*MemberMutation) GroupID added in v1.0.2

func (m *MemberMutation) GroupID() (r int, exists bool)

GroupID returns the value of the "group_id" field in the mutation.

func (*MemberMutation) GroupIDCleared added in v1.0.2

func (m *MemberMutation) GroupIDCleared() bool

GroupIDCleared returns if the "group_id" field was cleared in this mutation.

func (*MemberMutation) ID

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

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

func (*MemberMutation) LastPwdAuth

func (m *MemberMutation) LastPwdAuth() (r time.Time, exists bool)

LastPwdAuth returns the value of the "last_pwd_auth" field in the mutation.

func (*MemberMutation) LastPwdAuthCleared

func (m *MemberMutation) LastPwdAuthCleared() bool

LastPwdAuthCleared returns if the "last_pwd_auth" field was cleared in this mutation.

func (*MemberMutation) MemberEmailsCleared added in v1.0.8

func (m *MemberMutation) MemberEmailsCleared() bool

MemberEmailsCleared reports if the "member_emails" edge to the MemberEmail entity was cleared.

func (*MemberMutation) MemberEmailsIDs added in v1.0.8

func (m *MemberMutation) MemberEmailsIDs() (ids []int)

MemberEmailsIDs returns the "member_emails" edge IDs in the mutation.

func (*MemberMutation) MemberGroupCleared added in v1.0.10

func (m *MemberMutation) MemberGroupCleared() bool

MemberGroupCleared reports if the "member_group" edge to the Group entity was cleared.

func (*MemberMutation) MemberGroupID added in v1.0.10

func (m *MemberMutation) MemberGroupID() (id int, exists bool)

MemberGroupID returns the "member_group" edge ID in the mutation.

func (*MemberMutation) MemberGroupIDs added in v1.0.10

func (m *MemberMutation) MemberGroupIDs() (ids []int)

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

func (*MemberMutation) MemberSecurityLogsCleared added in v1.0.10

func (m *MemberMutation) MemberSecurityLogsCleared() bool

MemberSecurityLogsCleared reports if the "member_security_logs" edge to the MemberSecurityLog entity was cleared.

func (*MemberMutation) MemberSecurityLogsIDs added in v1.0.10

func (m *MemberMutation) MemberSecurityLogsIDs() (ids []int)

MemberSecurityLogsIDs returns the "member_security_logs" edge IDs in the mutation.

func (*MemberMutation) MemberSettingsCleared added in v1.0.8

func (m *MemberMutation) MemberSettingsCleared() bool

MemberSettingsCleared reports if the "member_settings" edge to the MemberSetting entity was cleared.

func (*MemberMutation) MemberSettingsIDs added in v1.0.8

func (m *MemberMutation) MemberSettingsIDs() (ids []int)

MemberSettingsIDs returns the "member_settings" edge IDs in the mutation.

func (*MemberMutation) MemberSnippetDocsCleared added in v1.0.9

func (m *MemberMutation) MemberSnippetDocsCleared() bool

MemberSnippetDocsCleared reports if the "member_snippet_docs" edge to the SnippetDocument entity was cleared.

func (*MemberMutation) MemberSnippetDocsIDs added in v1.0.9

func (m *MemberMutation) MemberSnippetDocsIDs() (ids []int)

MemberSnippetDocsIDs returns the "member_snippet_docs" edge IDs in the mutation.

func (*MemberMutation) MemberSnippetFoldersCleared added in v1.0.9

func (m *MemberMutation) MemberSnippetFoldersCleared() bool

MemberSnippetFoldersCleared reports if the "member_snippet_folders" edge to the SnippetFolder entity was cleared.

func (*MemberMutation) MemberSnippetFoldersIDs added in v1.0.9

func (m *MemberMutation) MemberSnippetFoldersIDs() (ids []int)

MemberSnippetFoldersIDs returns the "member_snippet_folders" edge IDs in the mutation.

func (*MemberMutation) MemberSnippetTagsCleared added in v1.0.9

func (m *MemberMutation) MemberSnippetTagsCleared() bool

MemberSnippetTagsCleared reports if the "member_snippet_tags" edge to the SnippetTag entity was cleared.

func (*MemberMutation) MemberSnippetTagsIDs added in v1.0.9

func (m *MemberMutation) MemberSnippetTagsIDs() (ids []int)

MemberSnippetTagsIDs returns the "member_snippet_tags" edge IDs in the mutation.

func (*MemberMutation) MemberSnippetsCleared added in v1.0.9

func (m *MemberMutation) MemberSnippetsCleared() bool

MemberSnippetsCleared reports if the "member_snippets" edge to the Snippet entity was cleared.

func (*MemberMutation) MemberSnippetsIDs added in v1.0.9

func (m *MemberMutation) MemberSnippetsIDs() (ids []int)

MemberSnippetsIDs returns the "member_snippets" edge IDs in the mutation.

func (*MemberMutation) Nickname

func (m *MemberMutation) Nickname() (r string, exists bool)

Nickname returns the value of the "nickname" field in the mutation.

func (*MemberMutation) OldCreateTime

func (m *MemberMutation) OldCreateTime(ctx context.Context) (v time.Time, err error)

OldCreateTime returns the old "create_time" field's value of the Member entity. If the Member 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 (*MemberMutation) OldDeleteTime

func (m *MemberMutation) OldDeleteTime(ctx context.Context) (v *time.Time, err error)

OldDeleteTime returns the old "delete_time" field's value of the Member entity. If the Member 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 (*MemberMutation) OldField

func (m *MemberMutation) 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 (*MemberMutation) OldGroupID added in v1.0.2

func (m *MemberMutation) OldGroupID(ctx context.Context) (v *int, err error)

OldGroupID returns the old "group_id" field's value of the Member entity. If the Member 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 (*MemberMutation) OldLastPwdAuth

func (m *MemberMutation) OldLastPwdAuth(ctx context.Context) (v *time.Time, err error)

OldLastPwdAuth returns the old "last_pwd_auth" field's value of the Member entity. If the Member 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 (*MemberMutation) OldNickname

func (m *MemberMutation) OldNickname(ctx context.Context) (v string, err error)

OldNickname returns the old "nickname" field's value of the Member entity. If the Member 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 (*MemberMutation) OldPassword

func (m *MemberMutation) OldPassword(ctx context.Context) (v *string, err error)

OldPassword returns the old "password" field's value of the Member entity. If the Member 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 (*MemberMutation) OldPhone

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

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

func (m *MemberMutation) OldSignature(ctx context.Context) (v string, err error)

OldSignature returns the old "signature" field's value of the Member entity. If the Member 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 (*MemberMutation) OldSn added in v1.0.2

func (m *MemberMutation) OldSn(ctx context.Context) (v string, err error)

OldSn returns the old "sn" field's value of the Member entity. If the Member 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 (*MemberMutation) OldStatus

func (m *MemberMutation) OldStatus(ctx context.Context) (v *member.Status, err error)

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

func (m *MemberMutation) OldUpdateTime(ctx context.Context) (v time.Time, err error)

OldUpdateTime returns the old "update_time" field's value of the Member entity. If the Member 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 (*MemberMutation) Op

func (m *MemberMutation) Op() Op

Op returns the operation name.

func (*MemberMutation) Password

func (m *MemberMutation) Password() (r string, exists bool)

Password returns the value of the "password" field in the mutation.

func (*MemberMutation) PasswordCleared added in v1.0.4

func (m *MemberMutation) PasswordCleared() bool

PasswordCleared returns if the "password" field was cleared in this mutation.

func (*MemberMutation) Phone

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

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

func (*MemberMutation) PhoneCleared

func (m *MemberMutation) PhoneCleared() bool

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

func (*MemberMutation) RemoveMemberEmailIDs added in v1.0.8

func (m *MemberMutation) RemoveMemberEmailIDs(ids ...int)

RemoveMemberEmailIDs removes the "member_emails" edge to the MemberEmail entity by IDs.

func (*MemberMutation) RemoveMemberSecurityLogIDs added in v1.0.10

func (m *MemberMutation) RemoveMemberSecurityLogIDs(ids ...int)

RemoveMemberSecurityLogIDs removes the "member_security_logs" edge to the MemberSecurityLog entity by IDs.

func (*MemberMutation) RemoveMemberSettingIDs added in v1.0.8

func (m *MemberMutation) RemoveMemberSettingIDs(ids ...int)

RemoveMemberSettingIDs removes the "member_settings" edge to the MemberSetting entity by IDs.

func (*MemberMutation) RemoveMemberSnippetDocIDs added in v1.0.9

func (m *MemberMutation) RemoveMemberSnippetDocIDs(ids ...int)

RemoveMemberSnippetDocIDs removes the "member_snippet_docs" edge to the SnippetDocument entity by IDs.

func (*MemberMutation) RemoveMemberSnippetFolderIDs added in v1.0.9

func (m *MemberMutation) RemoveMemberSnippetFolderIDs(ids ...int)

RemoveMemberSnippetFolderIDs removes the "member_snippet_folders" edge to the SnippetFolder entity by IDs.

func (*MemberMutation) RemoveMemberSnippetIDs added in v1.0.9

func (m *MemberMutation) RemoveMemberSnippetIDs(ids ...int)

RemoveMemberSnippetIDs removes the "member_snippets" edge to the Snippet entity by IDs.

func (*MemberMutation) RemoveMemberSnippetTagIDs added in v1.0.9

func (m *MemberMutation) RemoveMemberSnippetTagIDs(ids ...int)

RemoveMemberSnippetTagIDs removes the "member_snippet_tags" edge to the SnippetTag entity by IDs.

func (*MemberMutation) RemovedEdges

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

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

func (*MemberMutation) RemovedIDs

func (m *MemberMutation) 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 (*MemberMutation) RemovedMemberEmailsIDs added in v1.0.8

func (m *MemberMutation) RemovedMemberEmailsIDs() (ids []int)

RemovedMemberEmails returns the removed IDs of the "member_emails" edge to the MemberEmail entity.

func (*MemberMutation) RemovedMemberSecurityLogsIDs added in v1.0.10

func (m *MemberMutation) RemovedMemberSecurityLogsIDs() (ids []int)

RemovedMemberSecurityLogs returns the removed IDs of the "member_security_logs" edge to the MemberSecurityLog entity.

func (*MemberMutation) RemovedMemberSettingsIDs added in v1.0.8

func (m *MemberMutation) RemovedMemberSettingsIDs() (ids []int)

RemovedMemberSettings returns the removed IDs of the "member_settings" edge to the MemberSetting entity.

func (*MemberMutation) RemovedMemberSnippetDocsIDs added in v1.0.9

func (m *MemberMutation) RemovedMemberSnippetDocsIDs() (ids []int)

RemovedMemberSnippetDocs returns the removed IDs of the "member_snippet_docs" edge to the SnippetDocument entity.

func (*MemberMutation) RemovedMemberSnippetFoldersIDs added in v1.0.9

func (m *MemberMutation) RemovedMemberSnippetFoldersIDs() (ids []int)

RemovedMemberSnippetFolders returns the removed IDs of the "member_snippet_folders" edge to the SnippetFolder entity.

func (*MemberMutation) RemovedMemberSnippetTagsIDs added in v1.0.9

func (m *MemberMutation) RemovedMemberSnippetTagsIDs() (ids []int)

RemovedMemberSnippetTags returns the removed IDs of the "member_snippet_tags" edge to the SnippetTag entity.

func (*MemberMutation) RemovedMemberSnippetsIDs added in v1.0.9

func (m *MemberMutation) RemovedMemberSnippetsIDs() (ids []int)

RemovedMemberSnippets returns the removed IDs of the "member_snippets" edge to the Snippet entity.

func (*MemberMutation) ResetCreateTime

func (m *MemberMutation) ResetCreateTime()

ResetCreateTime resets all changes to the "create_time" field.

func (*MemberMutation) ResetDeleteTime

func (m *MemberMutation) ResetDeleteTime()

ResetDeleteTime resets all changes to the "delete_time" field.

func (*MemberMutation) ResetEdge

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

func (m *MemberMutation) 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 (*MemberMutation) ResetGroupID added in v1.0.2

func (m *MemberMutation) ResetGroupID()

ResetGroupID resets all changes to the "group_id" field.

func (*MemberMutation) ResetLastPwdAuth

func (m *MemberMutation) ResetLastPwdAuth()

ResetLastPwdAuth resets all changes to the "last_pwd_auth" field.

func (*MemberMutation) ResetMemberEmails added in v1.0.8

func (m *MemberMutation) ResetMemberEmails()

ResetMemberEmails resets all changes to the "member_emails" edge.

func (*MemberMutation) ResetMemberGroup added in v1.0.10

func (m *MemberMutation) ResetMemberGroup()

ResetMemberGroup resets all changes to the "member_group" edge.

func (*MemberMutation) ResetMemberSecurityLogs added in v1.0.10

func (m *MemberMutation) ResetMemberSecurityLogs()

ResetMemberSecurityLogs resets all changes to the "member_security_logs" edge.

func (*MemberMutation) ResetMemberSettings added in v1.0.8

func (m *MemberMutation) ResetMemberSettings()

ResetMemberSettings resets all changes to the "member_settings" edge.

func (*MemberMutation) ResetMemberSnippetDocs added in v1.0.9

func (m *MemberMutation) ResetMemberSnippetDocs()

ResetMemberSnippetDocs resets all changes to the "member_snippet_docs" edge.

func (*MemberMutation) ResetMemberSnippetFolders added in v1.0.9

func (m *MemberMutation) ResetMemberSnippetFolders()

ResetMemberSnippetFolders resets all changes to the "member_snippet_folders" edge.

func (*MemberMutation) ResetMemberSnippetTags added in v1.0.9

func (m *MemberMutation) ResetMemberSnippetTags()

ResetMemberSnippetTags resets all changes to the "member_snippet_tags" edge.

func (*MemberMutation) ResetMemberSnippets added in v1.0.9

func (m *MemberMutation) ResetMemberSnippets()

ResetMemberSnippets resets all changes to the "member_snippets" edge.

func (*MemberMutation) ResetNickname

func (m *MemberMutation) ResetNickname()

ResetNickname resets all changes to the "nickname" field.

func (*MemberMutation) ResetPassword

func (m *MemberMutation) ResetPassword()

ResetPassword resets all changes to the "password" field.

func (*MemberMutation) ResetPhone

func (m *MemberMutation) ResetPhone()

ResetPhone resets all changes to the "phone" field.

func (*MemberMutation) ResetSignature

func (m *MemberMutation) ResetSignature()

ResetSignature resets all changes to the "signature" field.

func (*MemberMutation) ResetSn added in v1.0.2

func (m *MemberMutation) ResetSn()

ResetSn resets all changes to the "sn" field.

func (*MemberMutation) ResetStatus

func (m *MemberMutation) ResetStatus()

ResetStatus resets all changes to the "status" field.

func (*MemberMutation) ResetUpdateTime

func (m *MemberMutation) ResetUpdateTime()

ResetUpdateTime resets all changes to the "update_time" field.

func (*MemberMutation) SetCreateTime

func (m *MemberMutation) SetCreateTime(t time.Time)

SetCreateTime sets the "create_time" field.

func (*MemberMutation) SetDeleteTime

func (m *MemberMutation) SetDeleteTime(t time.Time)

SetDeleteTime sets the "delete_time" field.

func (*MemberMutation) SetField

func (m *MemberMutation) 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 (*MemberMutation) SetGroupID added in v1.0.2

func (m *MemberMutation) SetGroupID(i int)

SetGroupID sets the "group_id" field.

func (*MemberMutation) SetID

func (m *MemberMutation) SetID(id int)

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

func (*MemberMutation) SetLastPwdAuth

func (m *MemberMutation) SetLastPwdAuth(t time.Time)

SetLastPwdAuth sets the "last_pwd_auth" field.

func (*MemberMutation) SetMemberGroupID added in v1.0.10

func (m *MemberMutation) SetMemberGroupID(id int)

SetMemberGroupID sets the "member_group" edge to the Group entity by id.

func (*MemberMutation) SetNickname

func (m *MemberMutation) SetNickname(s string)

SetNickname sets the "nickname" field.

func (*MemberMutation) SetPassword

func (m *MemberMutation) SetPassword(s string)

SetPassword sets the "password" field.

func (*MemberMutation) SetPhone

func (m *MemberMutation) SetPhone(s string)

SetPhone sets the "phone" field.

func (*MemberMutation) SetSignature

func (m *MemberMutation) SetSignature(s string)

SetSignature sets the "signature" field.

func (*MemberMutation) SetSn added in v1.0.2

func (m *MemberMutation) SetSn(s string)

SetSn sets the "sn" field.

func (*MemberMutation) SetStatus

func (m *MemberMutation) SetStatus(value member.Status)

SetStatus sets the "status" field.

func (*MemberMutation) SetUpdateTime

func (m *MemberMutation) SetUpdateTime(t time.Time)

SetUpdateTime sets the "update_time" field.

func (*MemberMutation) Signature

func (m *MemberMutation) Signature() (r string, exists bool)

Signature returns the value of the "signature" field in the mutation.

func (*MemberMutation) Sn added in v1.0.2

func (m *MemberMutation) Sn() (r string, exists bool)

Sn returns the value of the "sn" field in the mutation.

func (*MemberMutation) Status

func (m *MemberMutation) Status() (r member.Status, exists bool)

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

func (*MemberMutation) StatusCleared

func (m *MemberMutation) StatusCleared() bool

StatusCleared returns if the "status" field was cleared in this mutation.

func (MemberMutation) Tx

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

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

func (*MemberMutation) Type

func (m *MemberMutation) Type() string

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

func (*MemberMutation) UpdateTime

func (m *MemberMutation) UpdateTime() (r time.Time, exists bool)

UpdateTime returns the value of the "update_time" field in the mutation.

func (*MemberMutation) Where

func (m *MemberMutation) Where(ps ...predicate.Member)

Where appends a list predicates to the MemberMutation builder.

type MemberQuery

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

MemberQuery is the builder for querying Member entities.

func (*MemberQuery) All

func (mq *MemberQuery) All(ctx context.Context) ([]*Member, error)

All executes the query and returns a list of Members.

func (*MemberQuery) AllX

func (mq *MemberQuery) AllX(ctx context.Context) []*Member

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

func (*MemberQuery) Clone

func (mq *MemberQuery) Clone() *MemberQuery

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

func (*MemberQuery) Count

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

Count returns the count of the given query.

func (*MemberQuery) CountX

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

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

func (*MemberQuery) Exist

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

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

func (*MemberQuery) ExistX

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

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

func (*MemberQuery) First

func (mq *MemberQuery) First(ctx context.Context) (*Member, error)

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

func (*MemberQuery) FirstID

func (mq *MemberQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*MemberQuery) FirstIDX

func (mq *MemberQuery) FirstIDX(ctx context.Context) int

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

func (*MemberQuery) FirstX

func (mq *MemberQuery) FirstX(ctx context.Context) *Member

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

func (*MemberQuery) GroupBy

func (mq *MemberQuery) GroupBy(field string, fields ...string) *MemberGroupBy

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

client.Member.Query().
	GroupBy(member.FieldSn).
	Aggregate(model.Count()).
	Scan(ctx, &v)

func (*MemberQuery) IDs

func (mq *MemberQuery) IDs(ctx context.Context) ([]int, error)

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

func (*MemberQuery) IDsX

func (mq *MemberQuery) IDsX(ctx context.Context) []int

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

func (*MemberQuery) Limit

func (mq *MemberQuery) Limit(limit int) *MemberQuery

Limit adds a limit step to the query.

func (*MemberQuery) Offset

func (mq *MemberQuery) Offset(offset int) *MemberQuery

Offset adds an offset step to the query.

func (*MemberQuery) Only

func (mq *MemberQuery) Only(ctx context.Context) (*Member, error)

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

func (*MemberQuery) OnlyID

func (mq *MemberQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*MemberQuery) OnlyIDX

func (mq *MemberQuery) OnlyIDX(ctx context.Context) int

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

func (*MemberQuery) OnlyX

func (mq *MemberQuery) OnlyX(ctx context.Context) *Member

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

func (*MemberQuery) Order

func (mq *MemberQuery) Order(o ...OrderFunc) *MemberQuery

Order adds an order step to the query.

func (*MemberQuery) QueryMemberEmails added in v1.0.8

func (mq *MemberQuery) QueryMemberEmails() *MemberEmailQuery

QueryMemberEmails chains the current query on the "member_emails" edge.

func (*MemberQuery) QueryMemberGroup added in v1.0.10

func (mq *MemberQuery) QueryMemberGroup() *GroupQuery

QueryMemberGroup chains the current query on the "member_group" edge.

func (*MemberQuery) QueryMemberSecurityLogs added in v1.0.10

func (mq *MemberQuery) QueryMemberSecurityLogs() *MemberSecurityLogQuery

QueryMemberSecurityLogs chains the current query on the "member_security_logs" edge.

func (*MemberQuery) QueryMemberSettings added in v1.0.8

func (mq *MemberQuery) QueryMemberSettings() *MemberSettingQuery

QueryMemberSettings chains the current query on the "member_settings" edge.

func (*MemberQuery) QueryMemberSnippetDocs added in v1.0.9

func (mq *MemberQuery) QueryMemberSnippetDocs() *SnippetDocumentQuery

QueryMemberSnippetDocs chains the current query on the "member_snippet_docs" edge.

func (*MemberQuery) QueryMemberSnippetFolders added in v1.0.9

func (mq *MemberQuery) QueryMemberSnippetFolders() *SnippetFolderQuery

QueryMemberSnippetFolders chains the current query on the "member_snippet_folders" edge.

func (*MemberQuery) QueryMemberSnippetTags added in v1.0.9

func (mq *MemberQuery) QueryMemberSnippetTags() *SnippetTagQuery

QueryMemberSnippetTags chains the current query on the "member_snippet_tags" edge.

func (*MemberQuery) QueryMemberSnippets added in v1.0.9

func (mq *MemberQuery) QueryMemberSnippets() *SnippetQuery

QueryMemberSnippets chains the current query on the "member_snippets" edge.

func (*MemberQuery) Select

func (mq *MemberQuery) Select(fields ...string) *MemberSelect

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 {
	Sn string `json:"-"`
}

client.Member.Query().
	Select(member.FieldSn).
	Scan(ctx, &v)

func (*MemberQuery) Unique

func (mq *MemberQuery) Unique(unique bool) *MemberQuery

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

func (mq *MemberQuery) Where(ps ...predicate.Member) *MemberQuery

Where adds a new predicate for the MemberQuery builder.

func (*MemberQuery) WithMemberEmails added in v1.0.8

func (mq *MemberQuery) WithMemberEmails(opts ...func(*MemberEmailQuery)) *MemberQuery

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

func (*MemberQuery) WithMemberGroup added in v1.0.10

func (mq *MemberQuery) WithMemberGroup(opts ...func(*GroupQuery)) *MemberQuery

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

func (*MemberQuery) WithMemberSecurityLogs added in v1.0.10

func (mq *MemberQuery) WithMemberSecurityLogs(opts ...func(*MemberSecurityLogQuery)) *MemberQuery

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

func (*MemberQuery) WithMemberSettings added in v1.0.8

func (mq *MemberQuery) WithMemberSettings(opts ...func(*MemberSettingQuery)) *MemberQuery

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

func (*MemberQuery) WithMemberSnippetDocs added in v1.0.9

func (mq *MemberQuery) WithMemberSnippetDocs(opts ...func(*SnippetDocumentQuery)) *MemberQuery

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

func (*MemberQuery) WithMemberSnippetFolders added in v1.0.9

func (mq *MemberQuery) WithMemberSnippetFolders(opts ...func(*SnippetFolderQuery)) *MemberQuery

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

func (*MemberQuery) WithMemberSnippetTags added in v1.0.9

func (mq *MemberQuery) WithMemberSnippetTags(opts ...func(*SnippetTagQuery)) *MemberQuery

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

func (*MemberQuery) WithMemberSnippets added in v1.0.9

func (mq *MemberQuery) WithMemberSnippets(opts ...func(*SnippetQuery)) *MemberQuery

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

type MemberSecurityLog

type MemberSecurityLog struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// OwnerID holds the value of the "owner_id" field.
	OwnerID int `json:"-"`
	// Action holds the value of the "action" field.
	Action membersecuritylog.Action `json:"action,omitempty"`
	// IP holds the value of the "ip" field.
	IP *string `json:"ip,omitempty"`
	// RequestID holds the value of the "request_id" field.
	RequestID *string `json:"request_id,omitempty"`
	// ServerVersion holds the value of the "server_version" field.
	ServerVersion *string `json:"server_version,omitempty"`
	// Description holds the value of the "description" field.
	Description *string `json:"description,omitempty"`
	// Remark holds the value of the "remark" field.
	Remark *string `json:"remark,omitempty"`
	// CreateTime holds the value of the "create_time" field.
	CreateTime time.Time `json:"-"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the MemberSecurityLogQuery when eager-loading is set.
	Edges MemberSecurityLogEdges `json:"edges"`
	// contains filtered or unexported fields
}

MemberSecurityLog is the model entity for the MemberSecurityLog schema.

func (*MemberSecurityLog) QuerySecurityLogsOwner added in v1.0.10

func (msl *MemberSecurityLog) QuerySecurityLogsOwner() *MemberQuery

QuerySecurityLogsOwner queries the "security_logs_owner" edge of the MemberSecurityLog entity.

func (*MemberSecurityLog) String

func (msl *MemberSecurityLog) String() string

String implements the fmt.Stringer.

func (*MemberSecurityLog) Unwrap

func (msl *MemberSecurityLog) Unwrap() *MemberSecurityLog

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

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

type MemberSecurityLogClient

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

MemberSecurityLogClient is a client for the MemberSecurityLog schema.

func NewMemberSecurityLogClient

func NewMemberSecurityLogClient(c config) *MemberSecurityLogClient

NewMemberSecurityLogClient returns a client for the MemberSecurityLog from the given config.

func (*MemberSecurityLogClient) Create

Create returns a create builder for MemberSecurityLog.

func (*MemberSecurityLogClient) CreateBulk

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

func (*MemberSecurityLogClient) Delete

Delete returns a delete builder for MemberSecurityLog.

func (*MemberSecurityLogClient) DeleteOne

DeleteOne returns a delete builder for the given entity.

func (*MemberSecurityLogClient) DeleteOneID

DeleteOneID returns a delete builder for the given id.

func (*MemberSecurityLogClient) Get

Get returns a MemberSecurityLog entity by its id.

func (*MemberSecurityLogClient) GetX

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

func (*MemberSecurityLogClient) Hooks

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

Hooks returns the client hooks.

func (*MemberSecurityLogClient) Query

Query returns a query builder for MemberSecurityLog.

func (*MemberSecurityLogClient) QuerySecurityLogsOwner added in v1.0.10

func (c *MemberSecurityLogClient) QuerySecurityLogsOwner(msl *MemberSecurityLog) *MemberQuery

QuerySecurityLogsOwner queries the security_logs_owner edge of a MemberSecurityLog.

func (*MemberSecurityLogClient) Update

Update returns an update builder for MemberSecurityLog.

func (*MemberSecurityLogClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*MemberSecurityLogClient) UpdateOneID

UpdateOneID returns an update builder for the given id.

func (*MemberSecurityLogClient) Use

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

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

type MemberSecurityLogCreate

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

MemberSecurityLogCreate is the builder for creating a MemberSecurityLog entity.

func (*MemberSecurityLogCreate) Exec

func (mslc *MemberSecurityLogCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*MemberSecurityLogCreate) ExecX

func (mslc *MemberSecurityLogCreate) ExecX(ctx context.Context)

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

func (*MemberSecurityLogCreate) Mutation

Mutation returns the MemberSecurityLogMutation object of the builder.

func (*MemberSecurityLogCreate) Save

Save creates the MemberSecurityLog in the database.

func (*MemberSecurityLogCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*MemberSecurityLogCreate) SetAction

SetAction sets the "action" field.

func (*MemberSecurityLogCreate) SetCreateTime

func (mslc *MemberSecurityLogCreate) SetCreateTime(t time.Time) *MemberSecurityLogCreate

SetCreateTime sets the "create_time" field.

func (*MemberSecurityLogCreate) SetDescription

func (mslc *MemberSecurityLogCreate) SetDescription(s string) *MemberSecurityLogCreate

SetDescription sets the "description" field.

func (*MemberSecurityLogCreate) SetID

SetID sets the "id" field.

func (*MemberSecurityLogCreate) SetIP

SetIP sets the "ip" field.

func (*MemberSecurityLogCreate) SetNillableAction

SetNillableAction sets the "action" field if the given value is not nil.

func (*MemberSecurityLogCreate) SetNillableCreateTime

func (mslc *MemberSecurityLogCreate) SetNillableCreateTime(t *time.Time) *MemberSecurityLogCreate

SetNillableCreateTime sets the "create_time" field if the given value is not nil.

func (*MemberSecurityLogCreate) SetNillableDescription

func (mslc *MemberSecurityLogCreate) SetNillableDescription(s *string) *MemberSecurityLogCreate

SetNillableDescription sets the "description" field if the given value is not nil.

func (*MemberSecurityLogCreate) SetNillableIP

func (mslc *MemberSecurityLogCreate) SetNillableIP(s *string) *MemberSecurityLogCreate

SetNillableIP sets the "ip" field if the given value is not nil.

func (*MemberSecurityLogCreate) SetNillableRemark

func (mslc *MemberSecurityLogCreate) SetNillableRemark(s *string) *MemberSecurityLogCreate

SetNillableRemark sets the "remark" field if the given value is not nil.

func (*MemberSecurityLogCreate) SetNillableRequestID

func (mslc *MemberSecurityLogCreate) SetNillableRequestID(s *string) *MemberSecurityLogCreate

SetNillableRequestID sets the "request_id" field if the given value is not nil.

func (*MemberSecurityLogCreate) SetNillableServerVersion

func (mslc *MemberSecurityLogCreate) SetNillableServerVersion(s *string) *MemberSecurityLogCreate

SetNillableServerVersion sets the "server_version" field if the given value is not nil.

func (*MemberSecurityLogCreate) SetOwnerID added in v1.0.10

SetOwnerID sets the "owner_id" field.

func (*MemberSecurityLogCreate) SetRemark

SetRemark sets the "remark" field.

func (*MemberSecurityLogCreate) SetRequestID

SetRequestID sets the "request_id" field.

func (*MemberSecurityLogCreate) SetSecurityLogsOwner added in v1.0.10

func (mslc *MemberSecurityLogCreate) SetSecurityLogsOwner(m *Member) *MemberSecurityLogCreate

SetSecurityLogsOwner sets the "security_logs_owner" edge to the Member entity.

func (*MemberSecurityLogCreate) SetSecurityLogsOwnerID added in v1.0.10

func (mslc *MemberSecurityLogCreate) SetSecurityLogsOwnerID(id int) *MemberSecurityLogCreate

SetSecurityLogsOwnerID sets the "security_logs_owner" edge to the Member entity by ID.

func (*MemberSecurityLogCreate) SetServerVersion

func (mslc *MemberSecurityLogCreate) SetServerVersion(s string) *MemberSecurityLogCreate

SetServerVersion sets the "server_version" field.

type MemberSecurityLogCreateBulk

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

MemberSecurityLogCreateBulk is the builder for creating many MemberSecurityLog entities in bulk.

func (*MemberSecurityLogCreateBulk) Exec

Exec executes the query.

func (*MemberSecurityLogCreateBulk) ExecX

func (mslcb *MemberSecurityLogCreateBulk) ExecX(ctx context.Context)

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

func (*MemberSecurityLogCreateBulk) Save

Save creates the MemberSecurityLog entities in the database.

func (*MemberSecurityLogCreateBulk) SaveX

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

type MemberSecurityLogDelete

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

MemberSecurityLogDelete is the builder for deleting a MemberSecurityLog entity.

func (*MemberSecurityLogDelete) Exec

func (msld *MemberSecurityLogDelete) Exec(ctx context.Context) (int, error)

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

func (*MemberSecurityLogDelete) ExecX

func (msld *MemberSecurityLogDelete) ExecX(ctx context.Context) int

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

func (*MemberSecurityLogDelete) Where

Where appends a list predicates to the MemberSecurityLogDelete builder.

type MemberSecurityLogDeleteOne

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

MemberSecurityLogDeleteOne is the builder for deleting a single MemberSecurityLog entity.

func (*MemberSecurityLogDeleteOne) Exec

Exec executes the deletion query.

func (*MemberSecurityLogDeleteOne) ExecX

func (msldo *MemberSecurityLogDeleteOne) ExecX(ctx context.Context)

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

type MemberSecurityLogEdges added in v1.0.10

type MemberSecurityLogEdges struct {
	// SecurityLogsOwner holds the value of the security_logs_owner edge.
	SecurityLogsOwner *Member `json:"security_logs_owner,omitempty"`
	// contains filtered or unexported fields
}

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

func (MemberSecurityLogEdges) SecurityLogsOwnerOrErr added in v1.0.10

func (e MemberSecurityLogEdges) SecurityLogsOwnerOrErr() (*Member, error)

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

type MemberSecurityLogGroupBy

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

MemberSecurityLogGroupBy is the group-by builder for MemberSecurityLog entities.

func (*MemberSecurityLogGroupBy) Aggregate

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

func (*MemberSecurityLogGroupBy) Bool

func (mslgb *MemberSecurityLogGroupBy) 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 (*MemberSecurityLogGroupBy) BoolX

func (mslgb *MemberSecurityLogGroupBy) BoolX(ctx context.Context) bool

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

func (*MemberSecurityLogGroupBy) Bools

func (mslgb *MemberSecurityLogGroupBy) 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 (*MemberSecurityLogGroupBy) BoolsX

func (mslgb *MemberSecurityLogGroupBy) BoolsX(ctx context.Context) []bool

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

func (*MemberSecurityLogGroupBy) Float64

func (mslgb *MemberSecurityLogGroupBy) 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 (*MemberSecurityLogGroupBy) Float64X

func (mslgb *MemberSecurityLogGroupBy) Float64X(ctx context.Context) float64

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

func (*MemberSecurityLogGroupBy) Float64s

func (mslgb *MemberSecurityLogGroupBy) 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 (*MemberSecurityLogGroupBy) Float64sX

func (mslgb *MemberSecurityLogGroupBy) Float64sX(ctx context.Context) []float64

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

func (*MemberSecurityLogGroupBy) Int

func (mslgb *MemberSecurityLogGroupBy) 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 (*MemberSecurityLogGroupBy) IntX

func (mslgb *MemberSecurityLogGroupBy) IntX(ctx context.Context) int

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

func (*MemberSecurityLogGroupBy) Ints

func (mslgb *MemberSecurityLogGroupBy) 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 (*MemberSecurityLogGroupBy) IntsX

func (mslgb *MemberSecurityLogGroupBy) IntsX(ctx context.Context) []int

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

func (*MemberSecurityLogGroupBy) Scan

func (mslgb *MemberSecurityLogGroupBy) Scan(ctx context.Context, v interface{}) error

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

func (*MemberSecurityLogGroupBy) ScanX

func (mslgb *MemberSecurityLogGroupBy) ScanX(ctx context.Context, v interface{})

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

func (*MemberSecurityLogGroupBy) String

func (mslgb *MemberSecurityLogGroupBy) 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 (*MemberSecurityLogGroupBy) StringX

func (mslgb *MemberSecurityLogGroupBy) StringX(ctx context.Context) string

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

func (*MemberSecurityLogGroupBy) Strings

func (mslgb *MemberSecurityLogGroupBy) 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 (*MemberSecurityLogGroupBy) StringsX

func (mslgb *MemberSecurityLogGroupBy) StringsX(ctx context.Context) []string

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

type MemberSecurityLogMutation

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

MemberSecurityLogMutation represents an operation that mutates the MemberSecurityLog nodes in the graph.

func (*MemberSecurityLogMutation) Action

func (m *MemberSecurityLogMutation) Action() (r membersecuritylog.Action, exists bool)

Action returns the value of the "action" field in the mutation.

func (*MemberSecurityLogMutation) AddField

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

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

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

func (*MemberSecurityLogMutation) AddedField

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

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

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

func (*MemberSecurityLogMutation) AddedIDs

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

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

func (*MemberSecurityLogMutation) ClearDescription

func (m *MemberSecurityLogMutation) ClearDescription()

ClearDescription clears the value of the "description" field.

func (*MemberSecurityLogMutation) ClearEdge

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

func (m *MemberSecurityLogMutation) 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 (*MemberSecurityLogMutation) ClearIP

func (m *MemberSecurityLogMutation) ClearIP()

ClearIP clears the value of the "ip" field.

func (*MemberSecurityLogMutation) ClearRemark

func (m *MemberSecurityLogMutation) ClearRemark()

ClearRemark clears the value of the "remark" field.

func (*MemberSecurityLogMutation) ClearRequestID

func (m *MemberSecurityLogMutation) ClearRequestID()

ClearRequestID clears the value of the "request_id" field.

func (*MemberSecurityLogMutation) ClearSecurityLogsOwner added in v1.0.10

func (m *MemberSecurityLogMutation) ClearSecurityLogsOwner()

ClearSecurityLogsOwner clears the "security_logs_owner" edge to the Member entity.

func (*MemberSecurityLogMutation) ClearServerVersion

func (m *MemberSecurityLogMutation) ClearServerVersion()

ClearServerVersion clears the value of the "server_version" field.

func (*MemberSecurityLogMutation) ClearedEdges

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

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

func (*MemberSecurityLogMutation) ClearedFields

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

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

func (MemberSecurityLogMutation) Client

func (m MemberSecurityLogMutation) 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 (*MemberSecurityLogMutation) CreateTime

func (m *MemberSecurityLogMutation) CreateTime() (r time.Time, exists bool)

CreateTime returns the value of the "create_time" field in the mutation.

func (*MemberSecurityLogMutation) Description

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

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

func (*MemberSecurityLogMutation) DescriptionCleared

func (m *MemberSecurityLogMutation) DescriptionCleared() bool

DescriptionCleared returns if the "description" field was cleared in this mutation.

func (*MemberSecurityLogMutation) EdgeCleared

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

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

func (*MemberSecurityLogMutation) Field

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

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

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

func (*MemberSecurityLogMutation) Fields

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

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

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

func (*MemberSecurityLogMutation) IP

func (m *MemberSecurityLogMutation) IP() (r string, exists bool)

IP returns the value of the "ip" field in the mutation.

func (*MemberSecurityLogMutation) IPCleared

func (m *MemberSecurityLogMutation) IPCleared() bool

IPCleared returns if the "ip" field was cleared in this mutation.

func (*MemberSecurityLogMutation) OldAction

OldAction returns the old "action" field's value of the MemberSecurityLog entity. If the MemberSecurityLog 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 (*MemberSecurityLogMutation) OldCreateTime

func (m *MemberSecurityLogMutation) OldCreateTime(ctx context.Context) (v time.Time, err error)

OldCreateTime returns the old "create_time" field's value of the MemberSecurityLog entity. If the MemberSecurityLog 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 (*MemberSecurityLogMutation) OldDescription

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

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

func (m *MemberSecurityLogMutation) 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 (*MemberSecurityLogMutation) OldIP

func (m *MemberSecurityLogMutation) OldIP(ctx context.Context) (v *string, err error)

OldIP returns the old "ip" field's value of the MemberSecurityLog entity. If the MemberSecurityLog 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 (*MemberSecurityLogMutation) OldOwnerID added in v1.0.10

func (m *MemberSecurityLogMutation) OldOwnerID(ctx context.Context) (v int, err error)

OldOwnerID returns the old "owner_id" field's value of the MemberSecurityLog entity. If the MemberSecurityLog 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 (*MemberSecurityLogMutation) OldRemark

func (m *MemberSecurityLogMutation) OldRemark(ctx context.Context) (v *string, err error)

OldRemark returns the old "remark" field's value of the MemberSecurityLog entity. If the MemberSecurityLog 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 (*MemberSecurityLogMutation) OldRequestID

func (m *MemberSecurityLogMutation) OldRequestID(ctx context.Context) (v *string, err error)

OldRequestID returns the old "request_id" field's value of the MemberSecurityLog entity. If the MemberSecurityLog 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 (*MemberSecurityLogMutation) OldServerVersion

func (m *MemberSecurityLogMutation) OldServerVersion(ctx context.Context) (v *string, err error)

OldServerVersion returns the old "server_version" field's value of the MemberSecurityLog entity. If the MemberSecurityLog 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 (*MemberSecurityLogMutation) Op

func (m *MemberSecurityLogMutation) Op() Op

Op returns the operation name.

func (*MemberSecurityLogMutation) OwnerID added in v1.0.10

func (m *MemberSecurityLogMutation) OwnerID() (r int, exists bool)

OwnerID returns the value of the "owner_id" field in the mutation.

func (*MemberSecurityLogMutation) Remark

func (m *MemberSecurityLogMutation) Remark() (r string, exists bool)

Remark returns the value of the "remark" field in the mutation.

func (*MemberSecurityLogMutation) RemarkCleared

func (m *MemberSecurityLogMutation) RemarkCleared() bool

RemarkCleared returns if the "remark" field was cleared in this mutation.

func (*MemberSecurityLogMutation) RemovedEdges

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

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

func (*MemberSecurityLogMutation) RemovedIDs

func (m *MemberSecurityLogMutation) 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 (*MemberSecurityLogMutation) RequestID

func (m *MemberSecurityLogMutation) RequestID() (r string, exists bool)

RequestID returns the value of the "request_id" field in the mutation.

func (*MemberSecurityLogMutation) RequestIDCleared

func (m *MemberSecurityLogMutation) RequestIDCleared() bool

RequestIDCleared returns if the "request_id" field was cleared in this mutation.

func (*MemberSecurityLogMutation) ResetAction

func (m *MemberSecurityLogMutation) ResetAction()

ResetAction resets all changes to the "action" field.

func (*MemberSecurityLogMutation) ResetCreateTime

func (m *MemberSecurityLogMutation) ResetCreateTime()

ResetCreateTime resets all changes to the "create_time" field.

func (*MemberSecurityLogMutation) ResetDescription

func (m *MemberSecurityLogMutation) ResetDescription()

ResetDescription resets all changes to the "description" field.

func (*MemberSecurityLogMutation) ResetEdge

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

func (m *MemberSecurityLogMutation) 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 (*MemberSecurityLogMutation) ResetIP

func (m *MemberSecurityLogMutation) ResetIP()

ResetIP resets all changes to the "ip" field.

func (*MemberSecurityLogMutation) ResetOwnerID added in v1.0.10

func (m *MemberSecurityLogMutation) ResetOwnerID()

ResetOwnerID resets all changes to the "owner_id" field.

func (*MemberSecurityLogMutation) ResetRemark

func (m *MemberSecurityLogMutation) ResetRemark()

ResetRemark resets all changes to the "remark" field.

func (*MemberSecurityLogMutation) ResetRequestID

func (m *MemberSecurityLogMutation) ResetRequestID()

ResetRequestID resets all changes to the "request_id" field.

func (*MemberSecurityLogMutation) ResetSecurityLogsOwner added in v1.0.10

func (m *MemberSecurityLogMutation) ResetSecurityLogsOwner()

ResetSecurityLogsOwner resets all changes to the "security_logs_owner" edge.

func (*MemberSecurityLogMutation) ResetServerVersion

func (m *MemberSecurityLogMutation) ResetServerVersion()

ResetServerVersion resets all changes to the "server_version" field.

func (*MemberSecurityLogMutation) SecurityLogsOwnerCleared added in v1.0.10

func (m *MemberSecurityLogMutation) SecurityLogsOwnerCleared() bool

SecurityLogsOwnerCleared reports if the "security_logs_owner" edge to the Member entity was cleared.

func (*MemberSecurityLogMutation) SecurityLogsOwnerID added in v1.0.10

func (m *MemberSecurityLogMutation) SecurityLogsOwnerID() (id int, exists bool)

SecurityLogsOwnerID returns the "security_logs_owner" edge ID in the mutation.

func (*MemberSecurityLogMutation) SecurityLogsOwnerIDs added in v1.0.10

func (m *MemberSecurityLogMutation) SecurityLogsOwnerIDs() (ids []int)

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

func (*MemberSecurityLogMutation) ServerVersion

func (m *MemberSecurityLogMutation) ServerVersion() (r string, exists bool)

ServerVersion returns the value of the "server_version" field in the mutation.

func (*MemberSecurityLogMutation) ServerVersionCleared

func (m *MemberSecurityLogMutation) ServerVersionCleared() bool

ServerVersionCleared returns if the "server_version" field was cleared in this mutation.

func (*MemberSecurityLogMutation) SetAction

SetAction sets the "action" field.

func (*MemberSecurityLogMutation) SetCreateTime

func (m *MemberSecurityLogMutation) SetCreateTime(t time.Time)

SetCreateTime sets the "create_time" field.

func (*MemberSecurityLogMutation) SetDescription

func (m *MemberSecurityLogMutation) SetDescription(s string)

SetDescription sets the "description" field.

func (*MemberSecurityLogMutation) SetField

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

func (m *MemberSecurityLogMutation) SetID(id int)

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

func (*MemberSecurityLogMutation) SetIP

func (m *MemberSecurityLogMutation) SetIP(s string)

SetIP sets the "ip" field.

func (*MemberSecurityLogMutation) SetOwnerID added in v1.0.10

func (m *MemberSecurityLogMutation) SetOwnerID(i int)

SetOwnerID sets the "owner_id" field.

func (*MemberSecurityLogMutation) SetRemark

func (m *MemberSecurityLogMutation) SetRemark(s string)

SetRemark sets the "remark" field.

func (*MemberSecurityLogMutation) SetRequestID

func (m *MemberSecurityLogMutation) SetRequestID(s string)

SetRequestID sets the "request_id" field.

func (*MemberSecurityLogMutation) SetSecurityLogsOwnerID added in v1.0.10

func (m *MemberSecurityLogMutation) SetSecurityLogsOwnerID(id int)

SetSecurityLogsOwnerID sets the "security_logs_owner" edge to the Member entity by id.

func (*MemberSecurityLogMutation) SetServerVersion

func (m *MemberSecurityLogMutation) SetServerVersion(s string)

SetServerVersion sets the "server_version" field.

func (MemberSecurityLogMutation) Tx

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

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

func (*MemberSecurityLogMutation) Type

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

func (*MemberSecurityLogMutation) Where

Where appends a list predicates to the MemberSecurityLogMutation builder.

type MemberSecurityLogQuery

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

MemberSecurityLogQuery is the builder for querying MemberSecurityLog entities.

func (*MemberSecurityLogQuery) All

All executes the query and returns a list of MemberSecurityLogs.

func (*MemberSecurityLogQuery) AllX

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

func (*MemberSecurityLogQuery) Clone

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

func (*MemberSecurityLogQuery) Count

func (mslq *MemberSecurityLogQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*MemberSecurityLogQuery) CountX

func (mslq *MemberSecurityLogQuery) CountX(ctx context.Context) int

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

func (*MemberSecurityLogQuery) Exist

func (mslq *MemberSecurityLogQuery) Exist(ctx context.Context) (bool, error)

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

func (*MemberSecurityLogQuery) ExistX

func (mslq *MemberSecurityLogQuery) ExistX(ctx context.Context) bool

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

func (*MemberSecurityLogQuery) First

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

func (*MemberSecurityLogQuery) FirstID

func (mslq *MemberSecurityLogQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*MemberSecurityLogQuery) FirstIDX

func (mslq *MemberSecurityLogQuery) FirstIDX(ctx context.Context) int

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

func (*MemberSecurityLogQuery) FirstX

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

func (*MemberSecurityLogQuery) GroupBy

func (mslq *MemberSecurityLogQuery) GroupBy(field string, fields ...string) *MemberSecurityLogGroupBy

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

client.MemberSecurityLog.Query().
	GroupBy(membersecuritylog.FieldOwnerID).
	Aggregate(model.Count()).
	Scan(ctx, &v)

func (*MemberSecurityLogQuery) IDs

func (mslq *MemberSecurityLogQuery) IDs(ctx context.Context) ([]int, error)

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

func (*MemberSecurityLogQuery) IDsX

func (mslq *MemberSecurityLogQuery) IDsX(ctx context.Context) []int

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

func (*MemberSecurityLogQuery) Limit

Limit adds a limit step to the query.

func (*MemberSecurityLogQuery) Offset

func (mslq *MemberSecurityLogQuery) Offset(offset int) *MemberSecurityLogQuery

Offset adds an offset step to the query.

func (*MemberSecurityLogQuery) Only

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

func (*MemberSecurityLogQuery) OnlyID

func (mslq *MemberSecurityLogQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*MemberSecurityLogQuery) OnlyIDX

func (mslq *MemberSecurityLogQuery) OnlyIDX(ctx context.Context) int

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

func (*MemberSecurityLogQuery) OnlyX

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

func (*MemberSecurityLogQuery) Order

Order adds an order step to the query.

func (*MemberSecurityLogQuery) QuerySecurityLogsOwner added in v1.0.10

func (mslq *MemberSecurityLogQuery) QuerySecurityLogsOwner() *MemberQuery

QuerySecurityLogsOwner chains the current query on the "security_logs_owner" edge.

func (*MemberSecurityLogQuery) Select

func (mslq *MemberSecurityLogQuery) Select(fields ...string) *MemberSecurityLogSelect

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 {
	OwnerID int `json:"-"`
}

client.MemberSecurityLog.Query().
	Select(membersecuritylog.FieldOwnerID).
	Scan(ctx, &v)

func (*MemberSecurityLogQuery) Unique

func (mslq *MemberSecurityLogQuery) Unique(unique bool) *MemberSecurityLogQuery

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

Where adds a new predicate for the MemberSecurityLogQuery builder.

func (*MemberSecurityLogQuery) WithSecurityLogsOwner added in v1.0.10

func (mslq *MemberSecurityLogQuery) WithSecurityLogsOwner(opts ...func(*MemberQuery)) *MemberSecurityLogQuery

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

type MemberSecurityLogSelect

type MemberSecurityLogSelect struct {
	*MemberSecurityLogQuery
	// contains filtered or unexported fields
}

MemberSecurityLogSelect is the builder for selecting fields of MemberSecurityLog entities.

func (*MemberSecurityLogSelect) Bool

func (msls *MemberSecurityLogSelect) Bool(ctx context.Context) (_ bool, err error)

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

func (*MemberSecurityLogSelect) BoolX

func (msls *MemberSecurityLogSelect) BoolX(ctx context.Context) bool

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

func (*MemberSecurityLogSelect) Bools

func (msls *MemberSecurityLogSelect) Bools(ctx context.Context) ([]bool, error)

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

func (*MemberSecurityLogSelect) BoolsX

func (msls *MemberSecurityLogSelect) BoolsX(ctx context.Context) []bool

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

func (*MemberSecurityLogSelect) Float64

func (msls *MemberSecurityLogSelect) Float64(ctx context.Context) (_ float64, err error)

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

func (*MemberSecurityLogSelect) Float64X

func (msls *MemberSecurityLogSelect) Float64X(ctx context.Context) float64

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

func (*MemberSecurityLogSelect) Float64s

func (msls *MemberSecurityLogSelect) Float64s(ctx context.Context) ([]float64, error)

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

func (*MemberSecurityLogSelect) Float64sX

func (msls *MemberSecurityLogSelect) Float64sX(ctx context.Context) []float64

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

func (*MemberSecurityLogSelect) Int

func (msls *MemberSecurityLogSelect) Int(ctx context.Context) (_ int, err error)

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

func (*MemberSecurityLogSelect) IntX

func (msls *MemberSecurityLogSelect) IntX(ctx context.Context) int

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

func (*MemberSecurityLogSelect) Ints

func (msls *MemberSecurityLogSelect) Ints(ctx context.Context) ([]int, error)

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

func (*MemberSecurityLogSelect) IntsX

func (msls *MemberSecurityLogSelect) IntsX(ctx context.Context) []int

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

func (*MemberSecurityLogSelect) Scan

func (msls *MemberSecurityLogSelect) Scan(ctx context.Context, v interface{}) error

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

func (*MemberSecurityLogSelect) ScanX

func (msls *MemberSecurityLogSelect) ScanX(ctx context.Context, v interface{})

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

func (*MemberSecurityLogSelect) String

func (msls *MemberSecurityLogSelect) String(ctx context.Context) (_ string, err error)

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

func (*MemberSecurityLogSelect) StringX

func (msls *MemberSecurityLogSelect) StringX(ctx context.Context) string

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

func (*MemberSecurityLogSelect) Strings

func (msls *MemberSecurityLogSelect) Strings(ctx context.Context) ([]string, error)

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

func (*MemberSecurityLogSelect) StringsX

func (msls *MemberSecurityLogSelect) StringsX(ctx context.Context) []string

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

type MemberSecurityLogUpdate

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

MemberSecurityLogUpdate is the builder for updating MemberSecurityLog entities.

func (*MemberSecurityLogUpdate) ClearDescription

func (mslu *MemberSecurityLogUpdate) ClearDescription() *MemberSecurityLogUpdate

ClearDescription clears the value of the "description" field.

func (*MemberSecurityLogUpdate) ClearIP

ClearIP clears the value of the "ip" field.

func (*MemberSecurityLogUpdate) ClearRemark

func (mslu *MemberSecurityLogUpdate) ClearRemark() *MemberSecurityLogUpdate

ClearRemark clears the value of the "remark" field.

func (*MemberSecurityLogUpdate) ClearRequestID

func (mslu *MemberSecurityLogUpdate) ClearRequestID() *MemberSecurityLogUpdate

ClearRequestID clears the value of the "request_id" field.

func (*MemberSecurityLogUpdate) ClearSecurityLogsOwner added in v1.0.10

func (mslu *MemberSecurityLogUpdate) ClearSecurityLogsOwner() *MemberSecurityLogUpdate

ClearSecurityLogsOwner clears the "security_logs_owner" edge to the Member entity.

func (*MemberSecurityLogUpdate) ClearServerVersion

func (mslu *MemberSecurityLogUpdate) ClearServerVersion() *MemberSecurityLogUpdate

ClearServerVersion clears the value of the "server_version" field.

func (*MemberSecurityLogUpdate) Exec

func (mslu *MemberSecurityLogUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*MemberSecurityLogUpdate) ExecX

func (mslu *MemberSecurityLogUpdate) ExecX(ctx context.Context)

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

func (*MemberSecurityLogUpdate) Mutation

Mutation returns the MemberSecurityLogMutation object of the builder.

func (*MemberSecurityLogUpdate) Save

func (mslu *MemberSecurityLogUpdate) Save(ctx context.Context) (int, error)

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

func (*MemberSecurityLogUpdate) SaveX

func (mslu *MemberSecurityLogUpdate) SaveX(ctx context.Context) int

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

func (*MemberSecurityLogUpdate) SetAction

SetAction sets the "action" field.

func (*MemberSecurityLogUpdate) SetDescription

func (mslu *MemberSecurityLogUpdate) SetDescription(s string) *MemberSecurityLogUpdate

SetDescription sets the "description" field.

func (*MemberSecurityLogUpdate) SetIP

SetIP sets the "ip" field.

func (*MemberSecurityLogUpdate) SetNillableAction

SetNillableAction sets the "action" field if the given value is not nil.

func (*MemberSecurityLogUpdate) SetNillableDescription

func (mslu *MemberSecurityLogUpdate) SetNillableDescription(s *string) *MemberSecurityLogUpdate

SetNillableDescription sets the "description" field if the given value is not nil.

func (*MemberSecurityLogUpdate) SetNillableIP

func (mslu *MemberSecurityLogUpdate) SetNillableIP(s *string) *MemberSecurityLogUpdate

SetNillableIP sets the "ip" field if the given value is not nil.

func (*MemberSecurityLogUpdate) SetNillableRemark

func (mslu *MemberSecurityLogUpdate) SetNillableRemark(s *string) *MemberSecurityLogUpdate

SetNillableRemark sets the "remark" field if the given value is not nil.

func (*MemberSecurityLogUpdate) SetNillableRequestID

func (mslu *MemberSecurityLogUpdate) SetNillableRequestID(s *string) *MemberSecurityLogUpdate

SetNillableRequestID sets the "request_id" field if the given value is not nil.

func (*MemberSecurityLogUpdate) SetNillableServerVersion

func (mslu *MemberSecurityLogUpdate) SetNillableServerVersion(s *string) *MemberSecurityLogUpdate

SetNillableServerVersion sets the "server_version" field if the given value is not nil.

func (*MemberSecurityLogUpdate) SetOwnerID added in v1.0.10

SetOwnerID sets the "owner_id" field.

func (*MemberSecurityLogUpdate) SetRemark

SetRemark sets the "remark" field.

func (*MemberSecurityLogUpdate) SetRequestID

SetRequestID sets the "request_id" field.

func (*MemberSecurityLogUpdate) SetSecurityLogsOwner added in v1.0.10

func (mslu *MemberSecurityLogUpdate) SetSecurityLogsOwner(m *Member) *MemberSecurityLogUpdate

SetSecurityLogsOwner sets the "security_logs_owner" edge to the Member entity.

func (*MemberSecurityLogUpdate) SetSecurityLogsOwnerID added in v1.0.10

func (mslu *MemberSecurityLogUpdate) SetSecurityLogsOwnerID(id int) *MemberSecurityLogUpdate

SetSecurityLogsOwnerID sets the "security_logs_owner" edge to the Member entity by ID.

func (*MemberSecurityLogUpdate) SetServerVersion

func (mslu *MemberSecurityLogUpdate) SetServerVersion(s string) *MemberSecurityLogUpdate

SetServerVersion sets the "server_version" field.

func (*MemberSecurityLogUpdate) Where

Where appends a list predicates to the MemberSecurityLogUpdate builder.

type MemberSecurityLogUpdateOne

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

MemberSecurityLogUpdateOne is the builder for updating a single MemberSecurityLog entity.

func (*MemberSecurityLogUpdateOne) ClearDescription

func (msluo *MemberSecurityLogUpdateOne) ClearDescription() *MemberSecurityLogUpdateOne

ClearDescription clears the value of the "description" field.

func (*MemberSecurityLogUpdateOne) ClearIP

ClearIP clears the value of the "ip" field.

func (*MemberSecurityLogUpdateOne) ClearRemark

ClearRemark clears the value of the "remark" field.

func (*MemberSecurityLogUpdateOne) ClearRequestID

func (msluo *MemberSecurityLogUpdateOne) ClearRequestID() *MemberSecurityLogUpdateOne

ClearRequestID clears the value of the "request_id" field.

func (*MemberSecurityLogUpdateOne) ClearSecurityLogsOwner added in v1.0.10

func (msluo *MemberSecurityLogUpdateOne) ClearSecurityLogsOwner() *MemberSecurityLogUpdateOne

ClearSecurityLogsOwner clears the "security_logs_owner" edge to the Member entity.

func (*MemberSecurityLogUpdateOne) ClearServerVersion

func (msluo *MemberSecurityLogUpdateOne) ClearServerVersion() *MemberSecurityLogUpdateOne

ClearServerVersion clears the value of the "server_version" field.

func (*MemberSecurityLogUpdateOne) Exec

Exec executes the query on the entity.

func (*MemberSecurityLogUpdateOne) ExecX

func (msluo *MemberSecurityLogUpdateOne) ExecX(ctx context.Context)

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

func (*MemberSecurityLogUpdateOne) Mutation

Mutation returns the MemberSecurityLogMutation object of the builder.

func (*MemberSecurityLogUpdateOne) Save

Save executes the query and returns the updated MemberSecurityLog entity.

func (*MemberSecurityLogUpdateOne) SaveX

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

func (*MemberSecurityLogUpdateOne) Select

func (msluo *MemberSecurityLogUpdateOne) Select(field string, fields ...string) *MemberSecurityLogUpdateOne

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

func (*MemberSecurityLogUpdateOne) SetAction

SetAction sets the "action" field.

func (*MemberSecurityLogUpdateOne) SetDescription

SetDescription sets the "description" field.

func (*MemberSecurityLogUpdateOne) SetIP

SetIP sets the "ip" field.

func (*MemberSecurityLogUpdateOne) SetNillableAction

SetNillableAction sets the "action" field if the given value is not nil.

func (*MemberSecurityLogUpdateOne) SetNillableDescription

func (msluo *MemberSecurityLogUpdateOne) SetNillableDescription(s *string) *MemberSecurityLogUpdateOne

SetNillableDescription sets the "description" field if the given value is not nil.

func (*MemberSecurityLogUpdateOne) SetNillableIP

SetNillableIP sets the "ip" field if the given value is not nil.

func (*MemberSecurityLogUpdateOne) SetNillableRemark

func (msluo *MemberSecurityLogUpdateOne) SetNillableRemark(s *string) *MemberSecurityLogUpdateOne

SetNillableRemark sets the "remark" field if the given value is not nil.

func (*MemberSecurityLogUpdateOne) SetNillableRequestID

func (msluo *MemberSecurityLogUpdateOne) SetNillableRequestID(s *string) *MemberSecurityLogUpdateOne

SetNillableRequestID sets the "request_id" field if the given value is not nil.

func (*MemberSecurityLogUpdateOne) SetNillableServerVersion

func (msluo *MemberSecurityLogUpdateOne) SetNillableServerVersion(s *string) *MemberSecurityLogUpdateOne

SetNillableServerVersion sets the "server_version" field if the given value is not nil.

func (*MemberSecurityLogUpdateOne) SetOwnerID added in v1.0.10

SetOwnerID sets the "owner_id" field.

func (*MemberSecurityLogUpdateOne) SetRemark

SetRemark sets the "remark" field.

func (*MemberSecurityLogUpdateOne) SetRequestID

SetRequestID sets the "request_id" field.

func (*MemberSecurityLogUpdateOne) SetSecurityLogsOwner added in v1.0.10

func (msluo *MemberSecurityLogUpdateOne) SetSecurityLogsOwner(m *Member) *MemberSecurityLogUpdateOne

SetSecurityLogsOwner sets the "security_logs_owner" edge to the Member entity.

func (*MemberSecurityLogUpdateOne) SetSecurityLogsOwnerID added in v1.0.10

func (msluo *MemberSecurityLogUpdateOne) SetSecurityLogsOwnerID(id int) *MemberSecurityLogUpdateOne

SetSecurityLogsOwnerID sets the "security_logs_owner" edge to the Member entity by ID.

func (*MemberSecurityLogUpdateOne) SetServerVersion

func (msluo *MemberSecurityLogUpdateOne) SetServerVersion(s string) *MemberSecurityLogUpdateOne

SetServerVersion sets the "server_version" field.

type MemberSecurityLogs

type MemberSecurityLogs []*MemberSecurityLog

MemberSecurityLogs is a parsable slice of MemberSecurityLog.

type MemberSelect

type MemberSelect struct {
	*MemberQuery
	// contains filtered or unexported fields
}

MemberSelect is the builder for selecting fields of Member entities.

func (*MemberSelect) Bool

func (ms *MemberSelect) Bool(ctx context.Context) (_ bool, err error)

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

func (*MemberSelect) BoolX

func (ms *MemberSelect) BoolX(ctx context.Context) bool

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

func (*MemberSelect) Bools

func (ms *MemberSelect) Bools(ctx context.Context) ([]bool, error)

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

func (*MemberSelect) BoolsX

func (ms *MemberSelect) BoolsX(ctx context.Context) []bool

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

func (*MemberSelect) Float64

func (ms *MemberSelect) Float64(ctx context.Context) (_ float64, err error)

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

func (*MemberSelect) Float64X

func (ms *MemberSelect) Float64X(ctx context.Context) float64

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

func (*MemberSelect) Float64s

func (ms *MemberSelect) Float64s(ctx context.Context) ([]float64, error)

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

func (*MemberSelect) Float64sX

func (ms *MemberSelect) Float64sX(ctx context.Context) []float64

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

func (*MemberSelect) Int

func (ms *MemberSelect) Int(ctx context.Context) (_ int, err error)

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

func (*MemberSelect) IntX

func (ms *MemberSelect) IntX(ctx context.Context) int

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

func (*MemberSelect) Ints

func (ms *MemberSelect) Ints(ctx context.Context) ([]int, error)

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

func (*MemberSelect) IntsX

func (ms *MemberSelect) IntsX(ctx context.Context) []int

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

func (*MemberSelect) Scan

func (ms *MemberSelect) Scan(ctx context.Context, v interface{}) error

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

func (*MemberSelect) ScanX

func (ms *MemberSelect) ScanX(ctx context.Context, v interface{})

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

func (*MemberSelect) String

func (ms *MemberSelect) String(ctx context.Context) (_ string, err error)

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

func (*MemberSelect) StringX

func (ms *MemberSelect) StringX(ctx context.Context) string

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

func (*MemberSelect) Strings

func (ms *MemberSelect) Strings(ctx context.Context) ([]string, error)

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

func (*MemberSelect) StringsX

func (ms *MemberSelect) StringsX(ctx context.Context) []string

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

type MemberSetting added in v1.0.2

type MemberSetting struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// OwnerID holds the value of the "owner_id" field.
	OwnerID int `json:"-"`
	// Key holds the value of the "key" field.
	Key string `json:"key,omitempty"`
	// Value holds the value of the "value" field.
	Value string `json:"value,omitempty"`
	// Typeof holds the value of the "typeof" field.
	Typeof membersetting.Typeof `json:"typeof,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the MemberSettingQuery when eager-loading is set.
	Edges MemberSettingEdges `json:"edges"`
	// contains filtered or unexported fields
}

MemberSetting is the model entity for the MemberSetting schema.

func (*MemberSetting) QuerySettingsOwner added in v1.0.8

func (ms *MemberSetting) QuerySettingsOwner() *MemberQuery

QuerySettingsOwner queries the "settings_owner" edge of the MemberSetting entity.

func (*MemberSetting) String added in v1.0.2

func (ms *MemberSetting) String() string

String implements the fmt.Stringer.

func (*MemberSetting) Unwrap added in v1.0.2

func (ms *MemberSetting) Unwrap() *MemberSetting

Unwrap unwraps the MemberSetting 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 (*MemberSetting) Update added in v1.0.2

func (ms *MemberSetting) Update() *MemberSettingUpdateOne

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

type MemberSettingClient added in v1.0.2

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

MemberSettingClient is a client for the MemberSetting schema.

func NewMemberSettingClient added in v1.0.2

func NewMemberSettingClient(c config) *MemberSettingClient

NewMemberSettingClient returns a client for the MemberSetting from the given config.

func (*MemberSettingClient) Create added in v1.0.2

Create returns a create builder for MemberSetting.

func (*MemberSettingClient) CreateBulk added in v1.0.2

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

func (*MemberSettingClient) Delete added in v1.0.2

Delete returns a delete builder for MemberSetting.

func (*MemberSettingClient) DeleteOne added in v1.0.2

DeleteOne returns a delete builder for the given entity.

func (*MemberSettingClient) DeleteOneID added in v1.0.2

func (c *MemberSettingClient) DeleteOneID(id int) *MemberSettingDeleteOne

DeleteOneID returns a delete builder for the given id.

func (*MemberSettingClient) Get added in v1.0.2

Get returns a MemberSetting entity by its id.

func (*MemberSettingClient) GetX added in v1.0.2

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

func (*MemberSettingClient) Hooks added in v1.0.2

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

Hooks returns the client hooks.

func (*MemberSettingClient) Query added in v1.0.2

Query returns a query builder for MemberSetting.

func (*MemberSettingClient) QuerySettingsOwner added in v1.0.8

func (c *MemberSettingClient) QuerySettingsOwner(ms *MemberSetting) *MemberQuery

QuerySettingsOwner queries the settings_owner edge of a MemberSetting.

func (*MemberSettingClient) Update added in v1.0.2

Update returns an update builder for MemberSetting.

func (*MemberSettingClient) UpdateOne added in v1.0.2

UpdateOne returns an update builder for the given entity.

func (*MemberSettingClient) UpdateOneID added in v1.0.2

func (c *MemberSettingClient) UpdateOneID(id int) *MemberSettingUpdateOne

UpdateOneID returns an update builder for the given id.

func (*MemberSettingClient) Use added in v1.0.2

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

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

type MemberSettingCreate added in v1.0.2

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

MemberSettingCreate is the builder for creating a MemberSetting entity.

func (*MemberSettingCreate) Exec added in v1.0.8

func (msc *MemberSettingCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*MemberSettingCreate) ExecX added in v1.0.8

func (msc *MemberSettingCreate) ExecX(ctx context.Context)

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

func (*MemberSettingCreate) Mutation added in v1.0.2

func (msc *MemberSettingCreate) Mutation() *MemberSettingMutation

Mutation returns the MemberSettingMutation object of the builder.

func (*MemberSettingCreate) Save added in v1.0.2

Save creates the MemberSetting in the database.

func (*MemberSettingCreate) SaveX added in v1.0.2

SaveX calls Save and panics if Save returns an error.

func (*MemberSettingCreate) SetID added in v1.0.2

SetID sets the "id" field.

func (*MemberSettingCreate) SetKey added in v1.0.2

SetKey sets the "key" field.

func (*MemberSettingCreate) SetNillableTypeof added in v1.0.2

func (msc *MemberSettingCreate) SetNillableTypeof(m *membersetting.Typeof) *MemberSettingCreate

SetNillableTypeof sets the "typeof" field if the given value is not nil.

func (*MemberSettingCreate) SetOwnerID added in v1.0.8

func (msc *MemberSettingCreate) SetOwnerID(i int) *MemberSettingCreate

SetOwnerID sets the "owner_id" field.

func (*MemberSettingCreate) SetSettingsOwner added in v1.0.8

func (msc *MemberSettingCreate) SetSettingsOwner(m *Member) *MemberSettingCreate

SetSettingsOwner sets the "settings_owner" edge to the Member entity.

func (*MemberSettingCreate) SetSettingsOwnerID added in v1.0.8

func (msc *MemberSettingCreate) SetSettingsOwnerID(id int) *MemberSettingCreate

SetSettingsOwnerID sets the "settings_owner" edge to the Member entity by ID.

func (*MemberSettingCreate) SetTypeof added in v1.0.2

SetTypeof sets the "typeof" field.

func (*MemberSettingCreate) SetValue added in v1.0.2

SetValue sets the "value" field.

type MemberSettingCreateBulk added in v1.0.2

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

MemberSettingCreateBulk is the builder for creating many MemberSetting entities in bulk.

func (*MemberSettingCreateBulk) Exec added in v1.0.8

func (mscb *MemberSettingCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*MemberSettingCreateBulk) ExecX added in v1.0.8

func (mscb *MemberSettingCreateBulk) ExecX(ctx context.Context)

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

func (*MemberSettingCreateBulk) Save added in v1.0.2

Save creates the MemberSetting entities in the database.

func (*MemberSettingCreateBulk) SaveX added in v1.0.2

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

type MemberSettingDelete added in v1.0.2

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

MemberSettingDelete is the builder for deleting a MemberSetting entity.

func (*MemberSettingDelete) Exec added in v1.0.2

func (msd *MemberSettingDelete) Exec(ctx context.Context) (int, error)

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

func (*MemberSettingDelete) ExecX added in v1.0.2

func (msd *MemberSettingDelete) ExecX(ctx context.Context) int

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

func (*MemberSettingDelete) Where added in v1.0.2

Where appends a list predicates to the MemberSettingDelete builder.

type MemberSettingDeleteOne added in v1.0.2

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

MemberSettingDeleteOne is the builder for deleting a single MemberSetting entity.

func (*MemberSettingDeleteOne) Exec added in v1.0.2

func (msdo *MemberSettingDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*MemberSettingDeleteOne) ExecX added in v1.0.2

func (msdo *MemberSettingDeleteOne) ExecX(ctx context.Context)

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

type MemberSettingEdges added in v1.0.2

type MemberSettingEdges struct {
	// SettingsOwner holds the value of the settings_owner edge.
	SettingsOwner *Member `json:"settings_owner,omitempty"`
	// contains filtered or unexported fields
}

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

func (MemberSettingEdges) SettingsOwnerOrErr added in v1.0.8

func (e MemberSettingEdges) SettingsOwnerOrErr() (*Member, error)

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

type MemberSettingGroupBy added in v1.0.2

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

MemberSettingGroupBy is the group-by builder for MemberSetting entities.

func (*MemberSettingGroupBy) Aggregate added in v1.0.2

func (msgb *MemberSettingGroupBy) Aggregate(fns ...AggregateFunc) *MemberSettingGroupBy

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

func (*MemberSettingGroupBy) Bool added in v1.0.2

func (msgb *MemberSettingGroupBy) 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 (*MemberSettingGroupBy) BoolX added in v1.0.2

func (msgb *MemberSettingGroupBy) BoolX(ctx context.Context) bool

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

func (*MemberSettingGroupBy) Bools added in v1.0.2

func (msgb *MemberSettingGroupBy) 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 (*MemberSettingGroupBy) BoolsX added in v1.0.2

func (msgb *MemberSettingGroupBy) BoolsX(ctx context.Context) []bool

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

func (*MemberSettingGroupBy) Float64 added in v1.0.2

func (msgb *MemberSettingGroupBy) 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 (*MemberSettingGroupBy) Float64X added in v1.0.2

func (msgb *MemberSettingGroupBy) Float64X(ctx context.Context) float64

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

func (*MemberSettingGroupBy) Float64s added in v1.0.2

func (msgb *MemberSettingGroupBy) 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 (*MemberSettingGroupBy) Float64sX added in v1.0.2

func (msgb *MemberSettingGroupBy) Float64sX(ctx context.Context) []float64

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

func (*MemberSettingGroupBy) Int added in v1.0.2

func (msgb *MemberSettingGroupBy) 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 (*MemberSettingGroupBy) IntX added in v1.0.2

func (msgb *MemberSettingGroupBy) IntX(ctx context.Context) int

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

func (*MemberSettingGroupBy) Ints added in v1.0.2

func (msgb *MemberSettingGroupBy) 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 (*MemberSettingGroupBy) IntsX added in v1.0.2

func (msgb *MemberSettingGroupBy) IntsX(ctx context.Context) []int

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

func (*MemberSettingGroupBy) Scan added in v1.0.2

func (msgb *MemberSettingGroupBy) Scan(ctx context.Context, v interface{}) error

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

func (*MemberSettingGroupBy) ScanX added in v1.0.2

func (msgb *MemberSettingGroupBy) ScanX(ctx context.Context, v interface{})

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

func (*MemberSettingGroupBy) String added in v1.0.2

func (msgb *MemberSettingGroupBy) 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 (*MemberSettingGroupBy) StringX added in v1.0.2

func (msgb *MemberSettingGroupBy) StringX(ctx context.Context) string

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

func (*MemberSettingGroupBy) Strings added in v1.0.2

func (msgb *MemberSettingGroupBy) 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 (*MemberSettingGroupBy) StringsX added in v1.0.2

func (msgb *MemberSettingGroupBy) StringsX(ctx context.Context) []string

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

type MemberSettingMutation added in v1.0.2

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

MemberSettingMutation represents an operation that mutates the MemberSetting nodes in the graph.

func (*MemberSettingMutation) AddField added in v1.0.2

func (m *MemberSettingMutation) 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 (*MemberSettingMutation) AddedEdges added in v1.0.2

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

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

func (*MemberSettingMutation) AddedField added in v1.0.2

func (m *MemberSettingMutation) 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 (*MemberSettingMutation) AddedFields added in v1.0.2

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

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

func (*MemberSettingMutation) AddedIDs added in v1.0.2

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

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

func (*MemberSettingMutation) ClearEdge added in v1.0.2

func (m *MemberSettingMutation) 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 (*MemberSettingMutation) ClearField added in v1.0.2

func (m *MemberSettingMutation) 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 (*MemberSettingMutation) ClearSettingsOwner added in v1.0.8

func (m *MemberSettingMutation) ClearSettingsOwner()

ClearSettingsOwner clears the "settings_owner" edge to the Member entity.

func (*MemberSettingMutation) ClearedEdges added in v1.0.2

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

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

func (*MemberSettingMutation) ClearedFields added in v1.0.2

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

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

func (MemberSettingMutation) Client added in v1.0.2

func (m MemberSettingMutation) 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 (*MemberSettingMutation) EdgeCleared added in v1.0.2

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

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

func (*MemberSettingMutation) Field added in v1.0.2

func (m *MemberSettingMutation) 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 (*MemberSettingMutation) FieldCleared added in v1.0.2

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

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

func (*MemberSettingMutation) Fields added in v1.0.2

func (m *MemberSettingMutation) 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 (*MemberSettingMutation) ID added in v1.0.2

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

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

func (*MemberSettingMutation) Key added in v1.0.2

func (m *MemberSettingMutation) Key() (r string, exists bool)

Key returns the value of the "key" field in the mutation.

func (*MemberSettingMutation) OldField added in v1.0.2

func (m *MemberSettingMutation) 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 (*MemberSettingMutation) OldKey added in v1.0.2

func (m *MemberSettingMutation) OldKey(ctx context.Context) (v string, err error)

OldKey returns the old "key" field's value of the MemberSetting entity. If the MemberSetting 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 (*MemberSettingMutation) OldOwnerID added in v1.0.8

func (m *MemberSettingMutation) OldOwnerID(ctx context.Context) (v int, err error)

OldOwnerID returns the old "owner_id" field's value of the MemberSetting entity. If the MemberSetting 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 (*MemberSettingMutation) OldTypeof added in v1.0.2

func (m *MemberSettingMutation) OldTypeof(ctx context.Context) (v membersetting.Typeof, err error)

OldTypeof returns the old "typeof" field's value of the MemberSetting entity. If the MemberSetting 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 (*MemberSettingMutation) OldValue added in v1.0.2

func (m *MemberSettingMutation) OldValue(ctx context.Context) (v string, err error)

OldValue returns the old "value" field's value of the MemberSetting entity. If the MemberSetting 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 (*MemberSettingMutation) Op added in v1.0.2

func (m *MemberSettingMutation) Op() Op

Op returns the operation name.

func (*MemberSettingMutation) OwnerID added in v1.0.8

func (m *MemberSettingMutation) OwnerID() (r int, exists bool)

OwnerID returns the value of the "owner_id" field in the mutation.

func (*MemberSettingMutation) RemovedEdges added in v1.0.2

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

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

func (*MemberSettingMutation) RemovedIDs added in v1.0.2

func (m *MemberSettingMutation) 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 (*MemberSettingMutation) ResetEdge added in v1.0.2

func (m *MemberSettingMutation) 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 (*MemberSettingMutation) ResetField added in v1.0.2

func (m *MemberSettingMutation) 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 (*MemberSettingMutation) ResetKey added in v1.0.2

func (m *MemberSettingMutation) ResetKey()

ResetKey resets all changes to the "key" field.

func (*MemberSettingMutation) ResetOwnerID added in v1.0.8

func (m *MemberSettingMutation) ResetOwnerID()

ResetOwnerID resets all changes to the "owner_id" field.

func (*MemberSettingMutation) ResetSettingsOwner added in v1.0.8

func (m *MemberSettingMutation) ResetSettingsOwner()

ResetSettingsOwner resets all changes to the "settings_owner" edge.

func (*MemberSettingMutation) ResetTypeof added in v1.0.2

func (m *MemberSettingMutation) ResetTypeof()

ResetTypeof resets all changes to the "typeof" field.

func (*MemberSettingMutation) ResetValue added in v1.0.2

func (m *MemberSettingMutation) ResetValue()

ResetValue resets all changes to the "value" field.

func (*MemberSettingMutation) SetField added in v1.0.2

func (m *MemberSettingMutation) 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 (*MemberSettingMutation) SetID added in v1.0.2

func (m *MemberSettingMutation) SetID(id int)

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

func (*MemberSettingMutation) SetKey added in v1.0.2

func (m *MemberSettingMutation) SetKey(s string)

SetKey sets the "key" field.

func (*MemberSettingMutation) SetOwnerID added in v1.0.8

func (m *MemberSettingMutation) SetOwnerID(i int)

SetOwnerID sets the "owner_id" field.

func (*MemberSettingMutation) SetSettingsOwnerID added in v1.0.8

func (m *MemberSettingMutation) SetSettingsOwnerID(id int)

SetSettingsOwnerID sets the "settings_owner" edge to the Member entity by id.

func (*MemberSettingMutation) SetTypeof added in v1.0.2

func (m *MemberSettingMutation) SetTypeof(value membersetting.Typeof)

SetTypeof sets the "typeof" field.

func (*MemberSettingMutation) SetValue added in v1.0.2

func (m *MemberSettingMutation) SetValue(s string)

SetValue sets the "value" field.

func (*MemberSettingMutation) SettingsOwnerCleared added in v1.0.8

func (m *MemberSettingMutation) SettingsOwnerCleared() bool

SettingsOwnerCleared reports if the "settings_owner" edge to the Member entity was cleared.

func (*MemberSettingMutation) SettingsOwnerID added in v1.0.8

func (m *MemberSettingMutation) SettingsOwnerID() (id int, exists bool)

SettingsOwnerID returns the "settings_owner" edge ID in the mutation.

func (*MemberSettingMutation) SettingsOwnerIDs added in v1.0.8

func (m *MemberSettingMutation) SettingsOwnerIDs() (ids []int)

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

func (MemberSettingMutation) Tx added in v1.0.2

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

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

func (*MemberSettingMutation) Type added in v1.0.2

func (m *MemberSettingMutation) Type() string

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

func (*MemberSettingMutation) Typeof added in v1.0.2

func (m *MemberSettingMutation) Typeof() (r membersetting.Typeof, exists bool)

Typeof returns the value of the "typeof" field in the mutation.

func (*MemberSettingMutation) Value added in v1.0.2

func (m *MemberSettingMutation) Value() (r string, exists bool)

Value returns the value of the "value" field in the mutation.

func (*MemberSettingMutation) Where added in v1.0.8

Where appends a list predicates to the MemberSettingMutation builder.

type MemberSettingQuery added in v1.0.2

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

MemberSettingQuery is the builder for querying MemberSetting entities.

func (*MemberSettingQuery) All added in v1.0.2

All executes the query and returns a list of MemberSettings.

func (*MemberSettingQuery) AllX added in v1.0.2

func (msq *MemberSettingQuery) AllX(ctx context.Context) []*MemberSetting

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

func (*MemberSettingQuery) Clone added in v1.0.2

func (msq *MemberSettingQuery) Clone() *MemberSettingQuery

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

func (*MemberSettingQuery) Count added in v1.0.2

func (msq *MemberSettingQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*MemberSettingQuery) CountX added in v1.0.2

func (msq *MemberSettingQuery) CountX(ctx context.Context) int

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

func (*MemberSettingQuery) Exist added in v1.0.2

func (msq *MemberSettingQuery) Exist(ctx context.Context) (bool, error)

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

func (*MemberSettingQuery) ExistX added in v1.0.2

func (msq *MemberSettingQuery) ExistX(ctx context.Context) bool

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

func (*MemberSettingQuery) First added in v1.0.2

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

func (*MemberSettingQuery) FirstID added in v1.0.2

func (msq *MemberSettingQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*MemberSettingQuery) FirstIDX added in v1.0.2

func (msq *MemberSettingQuery) FirstIDX(ctx context.Context) int

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

func (*MemberSettingQuery) FirstX added in v1.0.2

func (msq *MemberSettingQuery) FirstX(ctx context.Context) *MemberSetting

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

func (*MemberSettingQuery) GroupBy added in v1.0.2

func (msq *MemberSettingQuery) GroupBy(field string, fields ...string) *MemberSettingGroupBy

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

client.MemberSetting.Query().
	GroupBy(membersetting.FieldOwnerID).
	Aggregate(model.Count()).
	Scan(ctx, &v)

func (*MemberSettingQuery) IDs added in v1.0.2

func (msq *MemberSettingQuery) IDs(ctx context.Context) ([]int, error)

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

func (*MemberSettingQuery) IDsX added in v1.0.2

func (msq *MemberSettingQuery) IDsX(ctx context.Context) []int

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

func (*MemberSettingQuery) Limit added in v1.0.2

func (msq *MemberSettingQuery) Limit(limit int) *MemberSettingQuery

Limit adds a limit step to the query.

func (*MemberSettingQuery) Offset added in v1.0.2

func (msq *MemberSettingQuery) Offset(offset int) *MemberSettingQuery

Offset adds an offset step to the query.

func (*MemberSettingQuery) Only added in v1.0.2

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

func (*MemberSettingQuery) OnlyID added in v1.0.2

func (msq *MemberSettingQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*MemberSettingQuery) OnlyIDX added in v1.0.2

func (msq *MemberSettingQuery) OnlyIDX(ctx context.Context) int

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

func (*MemberSettingQuery) OnlyX added in v1.0.2

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

func (*MemberSettingQuery) Order added in v1.0.2

Order adds an order step to the query.

func (*MemberSettingQuery) QuerySettingsOwner added in v1.0.8

func (msq *MemberSettingQuery) QuerySettingsOwner() *MemberQuery

QuerySettingsOwner chains the current query on the "settings_owner" edge.

func (*MemberSettingQuery) Select added in v1.0.2

func (msq *MemberSettingQuery) Select(fields ...string) *MemberSettingSelect

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 {
	OwnerID int `json:"-"`
}

client.MemberSetting.Query().
	Select(membersetting.FieldOwnerID).
	Scan(ctx, &v)

func (*MemberSettingQuery) Unique added in v1.0.2

func (msq *MemberSettingQuery) Unique(unique bool) *MemberSettingQuery

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 (*MemberSettingQuery) Where added in v1.0.2

Where adds a new predicate for the MemberSettingQuery builder.

func (*MemberSettingQuery) WithSettingsOwner added in v1.0.8

func (msq *MemberSettingQuery) WithSettingsOwner(opts ...func(*MemberQuery)) *MemberSettingQuery

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

type MemberSettingSelect added in v1.0.2

type MemberSettingSelect struct {
	*MemberSettingQuery
	// contains filtered or unexported fields
}

MemberSettingSelect is the builder for selecting fields of MemberSetting entities.

func (*MemberSettingSelect) Bool added in v1.0.2

func (mss *MemberSettingSelect) Bool(ctx context.Context) (_ bool, err error)

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

func (*MemberSettingSelect) BoolX added in v1.0.2

func (mss *MemberSettingSelect) BoolX(ctx context.Context) bool

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

func (*MemberSettingSelect) Bools added in v1.0.2

func (mss *MemberSettingSelect) Bools(ctx context.Context) ([]bool, error)

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

func (*MemberSettingSelect) BoolsX added in v1.0.2

func (mss *MemberSettingSelect) BoolsX(ctx context.Context) []bool

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

func (*MemberSettingSelect) Float64 added in v1.0.2

func (mss *MemberSettingSelect) Float64(ctx context.Context) (_ float64, err error)

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

func (*MemberSettingSelect) Float64X added in v1.0.2

func (mss *MemberSettingSelect) Float64X(ctx context.Context) float64

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

func (*MemberSettingSelect) Float64s added in v1.0.2

func (mss *MemberSettingSelect) Float64s(ctx context.Context) ([]float64, error)

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

func (*MemberSettingSelect) Float64sX added in v1.0.2

func (mss *MemberSettingSelect) Float64sX(ctx context.Context) []float64

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

func (*MemberSettingSelect) Int added in v1.0.2

func (mss *MemberSettingSelect) Int(ctx context.Context) (_ int, err error)

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

func (*MemberSettingSelect) IntX added in v1.0.2

func (mss *MemberSettingSelect) IntX(ctx context.Context) int

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

func (*MemberSettingSelect) Ints added in v1.0.2

func (mss *MemberSettingSelect) Ints(ctx context.Context) ([]int, error)

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

func (*MemberSettingSelect) IntsX added in v1.0.2

func (mss *MemberSettingSelect) IntsX(ctx context.Context) []int

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

func (*MemberSettingSelect) Scan added in v1.0.2

func (mss *MemberSettingSelect) Scan(ctx context.Context, v interface{}) error

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

func (*MemberSettingSelect) ScanX added in v1.0.2

func (mss *MemberSettingSelect) ScanX(ctx context.Context, v interface{})

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

func (*MemberSettingSelect) String added in v1.0.2

func (mss *MemberSettingSelect) String(ctx context.Context) (_ string, err error)

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

func (*MemberSettingSelect) StringX added in v1.0.2

func (mss *MemberSettingSelect) StringX(ctx context.Context) string

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

func (*MemberSettingSelect) Strings added in v1.0.2

func (mss *MemberSettingSelect) Strings(ctx context.Context) ([]string, error)

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

func (*MemberSettingSelect) StringsX added in v1.0.2

func (mss *MemberSettingSelect) StringsX(ctx context.Context) []string

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

type MemberSettingUpdate added in v1.0.2

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

MemberSettingUpdate is the builder for updating MemberSetting entities.

func (*MemberSettingUpdate) ClearSettingsOwner added in v1.0.8

func (msu *MemberSettingUpdate) ClearSettingsOwner() *MemberSettingUpdate

ClearSettingsOwner clears the "settings_owner" edge to the Member entity.

func (*MemberSettingUpdate) Exec added in v1.0.2

func (msu *MemberSettingUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*MemberSettingUpdate) ExecX added in v1.0.2

func (msu *MemberSettingUpdate) ExecX(ctx context.Context)

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

func (*MemberSettingUpdate) Mutation added in v1.0.2

func (msu *MemberSettingUpdate) Mutation() *MemberSettingMutation

Mutation returns the MemberSettingMutation object of the builder.

func (*MemberSettingUpdate) Save added in v1.0.2

func (msu *MemberSettingUpdate) Save(ctx context.Context) (int, error)

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

func (*MemberSettingUpdate) SaveX added in v1.0.2

func (msu *MemberSettingUpdate) SaveX(ctx context.Context) int

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

func (*MemberSettingUpdate) SetKey added in v1.0.2

SetKey sets the "key" field.

func (*MemberSettingUpdate) SetNillableTypeof added in v1.0.2

func (msu *MemberSettingUpdate) SetNillableTypeof(m *membersetting.Typeof) *MemberSettingUpdate

SetNillableTypeof sets the "typeof" field if the given value is not nil.

func (*MemberSettingUpdate) SetOwnerID added in v1.0.8

func (msu *MemberSettingUpdate) SetOwnerID(i int) *MemberSettingUpdate

SetOwnerID sets the "owner_id" field.

func (*MemberSettingUpdate) SetSettingsOwner added in v1.0.8

func (msu *MemberSettingUpdate) SetSettingsOwner(m *Member) *MemberSettingUpdate

SetSettingsOwner sets the "settings_owner" edge to the Member entity.

func (*MemberSettingUpdate) SetSettingsOwnerID added in v1.0.8

func (msu *MemberSettingUpdate) SetSettingsOwnerID(id int) *MemberSettingUpdate

SetSettingsOwnerID sets the "settings_owner" edge to the Member entity by ID.

func (*MemberSettingUpdate) SetTypeof added in v1.0.2

SetTypeof sets the "typeof" field.

func (*MemberSettingUpdate) SetValue added in v1.0.2

SetValue sets the "value" field.

func (*MemberSettingUpdate) Where added in v1.0.2

Where appends a list predicates to the MemberSettingUpdate builder.

type MemberSettingUpdateOne added in v1.0.2

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

MemberSettingUpdateOne is the builder for updating a single MemberSetting entity.

func (*MemberSettingUpdateOne) ClearSettingsOwner added in v1.0.8

func (msuo *MemberSettingUpdateOne) ClearSettingsOwner() *MemberSettingUpdateOne

ClearSettingsOwner clears the "settings_owner" edge to the Member entity.

func (*MemberSettingUpdateOne) Exec added in v1.0.2

func (msuo *MemberSettingUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*MemberSettingUpdateOne) ExecX added in v1.0.2

func (msuo *MemberSettingUpdateOne) ExecX(ctx context.Context)

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

func (*MemberSettingUpdateOne) Mutation added in v1.0.2

Mutation returns the MemberSettingMutation object of the builder.

func (*MemberSettingUpdateOne) Save added in v1.0.2

Save executes the query and returns the updated MemberSetting entity.

func (*MemberSettingUpdateOne) SaveX added in v1.0.2

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

func (*MemberSettingUpdateOne) Select added in v1.0.2

func (msuo *MemberSettingUpdateOne) Select(field string, fields ...string) *MemberSettingUpdateOne

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

func (*MemberSettingUpdateOne) SetKey added in v1.0.2

SetKey sets the "key" field.

func (*MemberSettingUpdateOne) SetNillableTypeof added in v1.0.2

SetNillableTypeof sets the "typeof" field if the given value is not nil.

func (*MemberSettingUpdateOne) SetOwnerID added in v1.0.8

func (msuo *MemberSettingUpdateOne) SetOwnerID(i int) *MemberSettingUpdateOne

SetOwnerID sets the "owner_id" field.

func (*MemberSettingUpdateOne) SetSettingsOwner added in v1.0.8

func (msuo *MemberSettingUpdateOne) SetSettingsOwner(m *Member) *MemberSettingUpdateOne

SetSettingsOwner sets the "settings_owner" edge to the Member entity.

func (*MemberSettingUpdateOne) SetSettingsOwnerID added in v1.0.8

func (msuo *MemberSettingUpdateOne) SetSettingsOwnerID(id int) *MemberSettingUpdateOne

SetSettingsOwnerID sets the "settings_owner" edge to the Member entity by ID.

func (*MemberSettingUpdateOne) SetTypeof added in v1.0.2

SetTypeof sets the "typeof" field.

func (*MemberSettingUpdateOne) SetValue added in v1.0.2

SetValue sets the "value" field.

type MemberSettings added in v1.0.2

type MemberSettings []*MemberSetting

MemberSettings is a parsable slice of MemberSetting.

type MemberUpdate

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

MemberUpdate is the builder for updating Member entities.

func (*MemberUpdate) AddMemberEmailIDs added in v1.0.8

func (mu *MemberUpdate) AddMemberEmailIDs(ids ...int) *MemberUpdate

AddMemberEmailIDs adds the "member_emails" edge to the MemberEmail entity by IDs.

func (*MemberUpdate) AddMemberEmails added in v1.0.8

func (mu *MemberUpdate) AddMemberEmails(m ...*MemberEmail) *MemberUpdate

AddMemberEmails adds the "member_emails" edges to the MemberEmail entity.

func (*MemberUpdate) AddMemberSecurityLogIDs added in v1.0.10

func (mu *MemberUpdate) AddMemberSecurityLogIDs(ids ...int) *MemberUpdate

AddMemberSecurityLogIDs adds the "member_security_logs" edge to the MemberSecurityLog entity by IDs.

func (*MemberUpdate) AddMemberSecurityLogs added in v1.0.10

func (mu *MemberUpdate) AddMemberSecurityLogs(m ...*MemberSecurityLog) *MemberUpdate

AddMemberSecurityLogs adds the "member_security_logs" edges to the MemberSecurityLog entity.

func (*MemberUpdate) AddMemberSettingIDs added in v1.0.8

func (mu *MemberUpdate) AddMemberSettingIDs(ids ...int) *MemberUpdate

AddMemberSettingIDs adds the "member_settings" edge to the MemberSetting entity by IDs.

func (*MemberUpdate) AddMemberSettings added in v1.0.8

func (mu *MemberUpdate) AddMemberSettings(m ...*MemberSetting) *MemberUpdate

AddMemberSettings adds the "member_settings" edges to the MemberSetting entity.

func (*MemberUpdate) AddMemberSnippetDocIDs added in v1.0.9

func (mu *MemberUpdate) AddMemberSnippetDocIDs(ids ...int) *MemberUpdate

AddMemberSnippetDocIDs adds the "member_snippet_docs" edge to the SnippetDocument entity by IDs.

func (*MemberUpdate) AddMemberSnippetDocs added in v1.0.9

func (mu *MemberUpdate) AddMemberSnippetDocs(s ...*SnippetDocument) *MemberUpdate

AddMemberSnippetDocs adds the "member_snippet_docs" edges to the SnippetDocument entity.

func (*MemberUpdate) AddMemberSnippetFolderIDs added in v1.0.9

func (mu *MemberUpdate) AddMemberSnippetFolderIDs(ids ...int) *MemberUpdate

AddMemberSnippetFolderIDs adds the "member_snippet_folders" edge to the SnippetFolder entity by IDs.

func (*MemberUpdate) AddMemberSnippetFolders added in v1.0.9

func (mu *MemberUpdate) AddMemberSnippetFolders(s ...*SnippetFolder) *MemberUpdate

AddMemberSnippetFolders adds the "member_snippet_folders" edges to the SnippetFolder entity.

func (*MemberUpdate) AddMemberSnippetIDs added in v1.0.9

func (mu *MemberUpdate) AddMemberSnippetIDs(ids ...int) *MemberUpdate

AddMemberSnippetIDs adds the "member_snippets" edge to the Snippet entity by IDs.

func (*MemberUpdate) AddMemberSnippetTagIDs added in v1.0.9

func (mu *MemberUpdate) AddMemberSnippetTagIDs(ids ...int) *MemberUpdate

AddMemberSnippetTagIDs adds the "member_snippet_tags" edge to the SnippetTag entity by IDs.

func (*MemberUpdate) AddMemberSnippetTags added in v1.0.9

func (mu *MemberUpdate) AddMemberSnippetTags(s ...*SnippetTag) *MemberUpdate

AddMemberSnippetTags adds the "member_snippet_tags" edges to the SnippetTag entity.

func (*MemberUpdate) AddMemberSnippets added in v1.0.9

func (mu *MemberUpdate) AddMemberSnippets(s ...*Snippet) *MemberUpdate

AddMemberSnippets adds the "member_snippets" edges to the Snippet entity.

func (*MemberUpdate) ClearDeleteTime

func (mu *MemberUpdate) ClearDeleteTime() *MemberUpdate

ClearDeleteTime clears the value of the "delete_time" field.

func (*MemberUpdate) ClearGroupID added in v1.0.2

func (mu *MemberUpdate) ClearGroupID() *MemberUpdate

ClearGroupID clears the value of the "group_id" field.

func (*MemberUpdate) ClearLastPwdAuth

func (mu *MemberUpdate) ClearLastPwdAuth() *MemberUpdate

ClearLastPwdAuth clears the value of the "last_pwd_auth" field.

func (*MemberUpdate) ClearMemberEmails added in v1.0.8

func (mu *MemberUpdate) ClearMemberEmails() *MemberUpdate

ClearMemberEmails clears all "member_emails" edges to the MemberEmail entity.

func (*MemberUpdate) ClearMemberGroup added in v1.0.10

func (mu *MemberUpdate) ClearMemberGroup() *MemberUpdate

ClearMemberGroup clears the "member_group" edge to the Group entity.

func (*MemberUpdate) ClearMemberSecurityLogs added in v1.0.10

func (mu *MemberUpdate) ClearMemberSecurityLogs() *MemberUpdate

ClearMemberSecurityLogs clears all "member_security_logs" edges to the MemberSecurityLog entity.

func (*MemberUpdate) ClearMemberSettings added in v1.0.8

func (mu *MemberUpdate) ClearMemberSettings() *MemberUpdate

ClearMemberSettings clears all "member_settings" edges to the MemberSetting entity.

func (*MemberUpdate) ClearMemberSnippetDocs added in v1.0.9

func (mu *MemberUpdate) ClearMemberSnippetDocs() *MemberUpdate

ClearMemberSnippetDocs clears all "member_snippet_docs" edges to the SnippetDocument entity.

func (*MemberUpdate) ClearMemberSnippetFolders added in v1.0.9

func (mu *MemberUpdate) ClearMemberSnippetFolders() *MemberUpdate

ClearMemberSnippetFolders clears all "member_snippet_folders" edges to the SnippetFolder entity.

func (*MemberUpdate) ClearMemberSnippetTags added in v1.0.9

func (mu *MemberUpdate) ClearMemberSnippetTags() *MemberUpdate

ClearMemberSnippetTags clears all "member_snippet_tags" edges to the SnippetTag entity.

func (*MemberUpdate) ClearMemberSnippets added in v1.0.9

func (mu *MemberUpdate) ClearMemberSnippets() *MemberUpdate

ClearMemberSnippets clears all "member_snippets" edges to the Snippet entity.

func (*MemberUpdate) ClearPassword added in v1.0.4

func (mu *MemberUpdate) ClearPassword() *MemberUpdate

ClearPassword clears the value of the "password" field.

func (*MemberUpdate) ClearPhone

func (mu *MemberUpdate) ClearPhone() *MemberUpdate

ClearPhone clears the value of the "phone" field.

func (*MemberUpdate) ClearStatus

func (mu *MemberUpdate) ClearStatus() *MemberUpdate

ClearStatus clears the value of the "status" field.

func (*MemberUpdate) Exec

func (mu *MemberUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*MemberUpdate) ExecX

func (mu *MemberUpdate) ExecX(ctx context.Context)

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

func (*MemberUpdate) Mutation

func (mu *MemberUpdate) Mutation() *MemberMutation

Mutation returns the MemberMutation object of the builder.

func (*MemberUpdate) RemoveMemberEmailIDs added in v1.0.8

func (mu *MemberUpdate) RemoveMemberEmailIDs(ids ...int) *MemberUpdate

RemoveMemberEmailIDs removes the "member_emails" edge to MemberEmail entities by IDs.

func (*MemberUpdate) RemoveMemberEmails added in v1.0.8

func (mu *MemberUpdate) RemoveMemberEmails(m ...*MemberEmail) *MemberUpdate

RemoveMemberEmails removes "member_emails" edges to MemberEmail entities.

func (*MemberUpdate) RemoveMemberSecurityLogIDs added in v1.0.10

func (mu *MemberUpdate) RemoveMemberSecurityLogIDs(ids ...int) *MemberUpdate

RemoveMemberSecurityLogIDs removes the "member_security_logs" edge to MemberSecurityLog entities by IDs.

func (*MemberUpdate) RemoveMemberSecurityLogs added in v1.0.10

func (mu *MemberUpdate) RemoveMemberSecurityLogs(m ...*MemberSecurityLog) *MemberUpdate

RemoveMemberSecurityLogs removes "member_security_logs" edges to MemberSecurityLog entities.

func (*MemberUpdate) RemoveMemberSettingIDs added in v1.0.8

func (mu *MemberUpdate) RemoveMemberSettingIDs(ids ...int) *MemberUpdate

RemoveMemberSettingIDs removes the "member_settings" edge to MemberSetting entities by IDs.

func (*MemberUpdate) RemoveMemberSettings added in v1.0.8

func (mu *MemberUpdate) RemoveMemberSettings(m ...*MemberSetting) *MemberUpdate

RemoveMemberSettings removes "member_settings" edges to MemberSetting entities.

func (*MemberUpdate) RemoveMemberSnippetDocIDs added in v1.0.9

func (mu *MemberUpdate) RemoveMemberSnippetDocIDs(ids ...int) *MemberUpdate

RemoveMemberSnippetDocIDs removes the "member_snippet_docs" edge to SnippetDocument entities by IDs.

func (*MemberUpdate) RemoveMemberSnippetDocs added in v1.0.9

func (mu *MemberUpdate) RemoveMemberSnippetDocs(s ...*SnippetDocument) *MemberUpdate

RemoveMemberSnippetDocs removes "member_snippet_docs" edges to SnippetDocument entities.

func (*MemberUpdate) RemoveMemberSnippetFolderIDs added in v1.0.9

func (mu *MemberUpdate) RemoveMemberSnippetFolderIDs(ids ...int) *MemberUpdate

RemoveMemberSnippetFolderIDs removes the "member_snippet_folders" edge to SnippetFolder entities by IDs.

func (*MemberUpdate) RemoveMemberSnippetFolders added in v1.0.9

func (mu *MemberUpdate) RemoveMemberSnippetFolders(s ...*SnippetFolder) *MemberUpdate

RemoveMemberSnippetFolders removes "member_snippet_folders" edges to SnippetFolder entities.

func (*MemberUpdate) RemoveMemberSnippetIDs added in v1.0.9

func (mu *MemberUpdate) RemoveMemberSnippetIDs(ids ...int) *MemberUpdate

RemoveMemberSnippetIDs removes the "member_snippets" edge to Snippet entities by IDs.

func (*MemberUpdate) RemoveMemberSnippetTagIDs added in v1.0.9

func (mu *MemberUpdate) RemoveMemberSnippetTagIDs(ids ...int) *MemberUpdate

RemoveMemberSnippetTagIDs removes the "member_snippet_tags" edge to SnippetTag entities by IDs.

func (*MemberUpdate) RemoveMemberSnippetTags added in v1.0.9

func (mu *MemberUpdate) RemoveMemberSnippetTags(s ...*SnippetTag) *MemberUpdate

RemoveMemberSnippetTags removes "member_snippet_tags" edges to SnippetTag entities.

func (*MemberUpdate) RemoveMemberSnippets added in v1.0.9

func (mu *MemberUpdate) RemoveMemberSnippets(s ...*Snippet) *MemberUpdate

RemoveMemberSnippets removes "member_snippets" edges to Snippet entities.

func (*MemberUpdate) Save

func (mu *MemberUpdate) Save(ctx context.Context) (int, error)

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

func (*MemberUpdate) SaveX

func (mu *MemberUpdate) SaveX(ctx context.Context) int

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

func (*MemberUpdate) SetDeleteTime

func (mu *MemberUpdate) SetDeleteTime(t time.Time) *MemberUpdate

SetDeleteTime sets the "delete_time" field.

func (*MemberUpdate) SetGroupID added in v1.0.2

func (mu *MemberUpdate) SetGroupID(i int) *MemberUpdate

SetGroupID sets the "group_id" field.

func (*MemberUpdate) SetLastPwdAuth

func (mu *MemberUpdate) SetLastPwdAuth(t time.Time) *MemberUpdate

SetLastPwdAuth sets the "last_pwd_auth" field.

func (*MemberUpdate) SetMemberGroup added in v1.0.10

func (mu *MemberUpdate) SetMemberGroup(g *Group) *MemberUpdate

SetMemberGroup sets the "member_group" edge to the Group entity.

func (*MemberUpdate) SetMemberGroupID added in v1.0.10

func (mu *MemberUpdate) SetMemberGroupID(id int) *MemberUpdate

SetMemberGroupID sets the "member_group" edge to the Group entity by ID.

func (*MemberUpdate) SetNickname

func (mu *MemberUpdate) SetNickname(s string) *MemberUpdate

SetNickname sets the "nickname" field.

func (*MemberUpdate) SetNillableDeleteTime

func (mu *MemberUpdate) SetNillableDeleteTime(t *time.Time) *MemberUpdate

SetNillableDeleteTime sets the "delete_time" field if the given value is not nil.

func (*MemberUpdate) SetNillableGroupID added in v1.0.2

func (mu *MemberUpdate) SetNillableGroupID(i *int) *MemberUpdate

SetNillableGroupID sets the "group_id" field if the given value is not nil.

func (*MemberUpdate) SetNillableLastPwdAuth

func (mu *MemberUpdate) SetNillableLastPwdAuth(t *time.Time) *MemberUpdate

SetNillableLastPwdAuth sets the "last_pwd_auth" field if the given value is not nil.

func (*MemberUpdate) SetNillableMemberGroupID added in v1.0.10

func (mu *MemberUpdate) SetNillableMemberGroupID(id *int) *MemberUpdate

SetNillableMemberGroupID sets the "member_group" edge to the Group entity by ID if the given value is not nil.

func (*MemberUpdate) SetNillablePassword added in v1.0.4

func (mu *MemberUpdate) SetNillablePassword(s *string) *MemberUpdate

SetNillablePassword sets the "password" field if the given value is not nil.

func (*MemberUpdate) SetNillablePhone

func (mu *MemberUpdate) SetNillablePhone(s *string) *MemberUpdate

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

func (*MemberUpdate) SetNillableStatus

func (mu *MemberUpdate) SetNillableStatus(m *member.Status) *MemberUpdate

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

func (*MemberUpdate) SetPassword

func (mu *MemberUpdate) SetPassword(s string) *MemberUpdate

SetPassword sets the "password" field.

func (*MemberUpdate) SetPhone

func (mu *MemberUpdate) SetPhone(s string) *MemberUpdate

SetPhone sets the "phone" field.

func (*MemberUpdate) SetSignature

func (mu *MemberUpdate) SetSignature(s string) *MemberUpdate

SetSignature sets the "signature" field.

func (*MemberUpdate) SetStatus

func (mu *MemberUpdate) SetStatus(m member.Status) *MemberUpdate

SetStatus sets the "status" field.

func (*MemberUpdate) SetUpdateTime

func (mu *MemberUpdate) SetUpdateTime(t time.Time) *MemberUpdate

SetUpdateTime sets the "update_time" field.

func (*MemberUpdate) Where

func (mu *MemberUpdate) Where(ps ...predicate.Member) *MemberUpdate

Where appends a list predicates to the MemberUpdate builder.

type MemberUpdateOne

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

MemberUpdateOne is the builder for updating a single Member entity.

func (*MemberUpdateOne) AddMemberEmailIDs added in v1.0.8

func (muo *MemberUpdateOne) AddMemberEmailIDs(ids ...int) *MemberUpdateOne

AddMemberEmailIDs adds the "member_emails" edge to the MemberEmail entity by IDs.

func (*MemberUpdateOne) AddMemberEmails added in v1.0.8

func (muo *MemberUpdateOne) AddMemberEmails(m ...*MemberEmail) *MemberUpdateOne

AddMemberEmails adds the "member_emails" edges to the MemberEmail entity.

func (*MemberUpdateOne) AddMemberSecurityLogIDs added in v1.0.10

func (muo *MemberUpdateOne) AddMemberSecurityLogIDs(ids ...int) *MemberUpdateOne

AddMemberSecurityLogIDs adds the "member_security_logs" edge to the MemberSecurityLog entity by IDs.

func (*MemberUpdateOne) AddMemberSecurityLogs added in v1.0.10

func (muo *MemberUpdateOne) AddMemberSecurityLogs(m ...*MemberSecurityLog) *MemberUpdateOne

AddMemberSecurityLogs adds the "member_security_logs" edges to the MemberSecurityLog entity.

func (*MemberUpdateOne) AddMemberSettingIDs added in v1.0.8

func (muo *MemberUpdateOne) AddMemberSettingIDs(ids ...int) *MemberUpdateOne

AddMemberSettingIDs adds the "member_settings" edge to the MemberSetting entity by IDs.

func (*MemberUpdateOne) AddMemberSettings added in v1.0.8

func (muo *MemberUpdateOne) AddMemberSettings(m ...*MemberSetting) *MemberUpdateOne

AddMemberSettings adds the "member_settings" edges to the MemberSetting entity.

func (*MemberUpdateOne) AddMemberSnippetDocIDs added in v1.0.9

func (muo *MemberUpdateOne) AddMemberSnippetDocIDs(ids ...int) *MemberUpdateOne

AddMemberSnippetDocIDs adds the "member_snippet_docs" edge to the SnippetDocument entity by IDs.

func (*MemberUpdateOne) AddMemberSnippetDocs added in v1.0.9

func (muo *MemberUpdateOne) AddMemberSnippetDocs(s ...*SnippetDocument) *MemberUpdateOne

AddMemberSnippetDocs adds the "member_snippet_docs" edges to the SnippetDocument entity.

func (*MemberUpdateOne) AddMemberSnippetFolderIDs added in v1.0.9

func (muo *MemberUpdateOne) AddMemberSnippetFolderIDs(ids ...int) *MemberUpdateOne

AddMemberSnippetFolderIDs adds the "member_snippet_folders" edge to the SnippetFolder entity by IDs.

func (*MemberUpdateOne) AddMemberSnippetFolders added in v1.0.9

func (muo *MemberUpdateOne) AddMemberSnippetFolders(s ...*SnippetFolder) *MemberUpdateOne

AddMemberSnippetFolders adds the "member_snippet_folders" edges to the SnippetFolder entity.

func (*MemberUpdateOne) AddMemberSnippetIDs added in v1.0.9

func (muo *MemberUpdateOne) AddMemberSnippetIDs(ids ...int) *MemberUpdateOne

AddMemberSnippetIDs adds the "member_snippets" edge to the Snippet entity by IDs.

func (*MemberUpdateOne) AddMemberSnippetTagIDs added in v1.0.9

func (muo *MemberUpdateOne) AddMemberSnippetTagIDs(ids ...int) *MemberUpdateOne

AddMemberSnippetTagIDs adds the "member_snippet_tags" edge to the SnippetTag entity by IDs.

func (*MemberUpdateOne) AddMemberSnippetTags added in v1.0.9

func (muo *MemberUpdateOne) AddMemberSnippetTags(s ...*SnippetTag) *MemberUpdateOne

AddMemberSnippetTags adds the "member_snippet_tags" edges to the SnippetTag entity.

func (*MemberUpdateOne) AddMemberSnippets added in v1.0.9

func (muo *MemberUpdateOne) AddMemberSnippets(s ...*Snippet) *MemberUpdateOne

AddMemberSnippets adds the "member_snippets" edges to the Snippet entity.

func (*MemberUpdateOne) ClearDeleteTime

func (muo *MemberUpdateOne) ClearDeleteTime() *MemberUpdateOne

ClearDeleteTime clears the value of the "delete_time" field.

func (*MemberUpdateOne) ClearGroupID added in v1.0.2

func (muo *MemberUpdateOne) ClearGroupID() *MemberUpdateOne

ClearGroupID clears the value of the "group_id" field.

func (*MemberUpdateOne) ClearLastPwdAuth

func (muo *MemberUpdateOne) ClearLastPwdAuth() *MemberUpdateOne

ClearLastPwdAuth clears the value of the "last_pwd_auth" field.

func (*MemberUpdateOne) ClearMemberEmails added in v1.0.8

func (muo *MemberUpdateOne) ClearMemberEmails() *MemberUpdateOne

ClearMemberEmails clears all "member_emails" edges to the MemberEmail entity.

func (*MemberUpdateOne) ClearMemberGroup added in v1.0.10

func (muo *MemberUpdateOne) ClearMemberGroup() *MemberUpdateOne

ClearMemberGroup clears the "member_group" edge to the Group entity.

func (*MemberUpdateOne) ClearMemberSecurityLogs added in v1.0.10

func (muo *MemberUpdateOne) ClearMemberSecurityLogs() *MemberUpdateOne

ClearMemberSecurityLogs clears all "member_security_logs" edges to the MemberSecurityLog entity.

func (*MemberUpdateOne) ClearMemberSettings added in v1.0.8

func (muo *MemberUpdateOne) ClearMemberSettings() *MemberUpdateOne

ClearMemberSettings clears all "member_settings" edges to the MemberSetting entity.

func (*MemberUpdateOne) ClearMemberSnippetDocs added in v1.0.9

func (muo *MemberUpdateOne) ClearMemberSnippetDocs() *MemberUpdateOne

ClearMemberSnippetDocs clears all "member_snippet_docs" edges to the SnippetDocument entity.

func (*MemberUpdateOne) ClearMemberSnippetFolders added in v1.0.9

func (muo *MemberUpdateOne) ClearMemberSnippetFolders() *MemberUpdateOne

ClearMemberSnippetFolders clears all "member_snippet_folders" edges to the SnippetFolder entity.

func (*MemberUpdateOne) ClearMemberSnippetTags added in v1.0.9

func (muo *MemberUpdateOne) ClearMemberSnippetTags() *MemberUpdateOne

ClearMemberSnippetTags clears all "member_snippet_tags" edges to the SnippetTag entity.

func (*MemberUpdateOne) ClearMemberSnippets added in v1.0.9

func (muo *MemberUpdateOne) ClearMemberSnippets() *MemberUpdateOne

ClearMemberSnippets clears all "member_snippets" edges to the Snippet entity.

func (*MemberUpdateOne) ClearPassword added in v1.0.4

func (muo *MemberUpdateOne) ClearPassword() *MemberUpdateOne

ClearPassword clears the value of the "password" field.

func (*MemberUpdateOne) ClearPhone

func (muo *MemberUpdateOne) ClearPhone() *MemberUpdateOne

ClearPhone clears the value of the "phone" field.

func (*MemberUpdateOne) ClearStatus

func (muo *MemberUpdateOne) ClearStatus() *MemberUpdateOne

ClearStatus clears the value of the "status" field.

func (*MemberUpdateOne) Exec

func (muo *MemberUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*MemberUpdateOne) ExecX

func (muo *MemberUpdateOne) ExecX(ctx context.Context)

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

func (*MemberUpdateOne) Mutation

func (muo *MemberUpdateOne) Mutation() *MemberMutation

Mutation returns the MemberMutation object of the builder.

func (*MemberUpdateOne) RemoveMemberEmailIDs added in v1.0.8

func (muo *MemberUpdateOne) RemoveMemberEmailIDs(ids ...int) *MemberUpdateOne

RemoveMemberEmailIDs removes the "member_emails" edge to MemberEmail entities by IDs.

func (*MemberUpdateOne) RemoveMemberEmails added in v1.0.8

func (muo *MemberUpdateOne) RemoveMemberEmails(m ...*MemberEmail) *MemberUpdateOne

RemoveMemberEmails removes "member_emails" edges to MemberEmail entities.

func (*MemberUpdateOne) RemoveMemberSecurityLogIDs added in v1.0.10

func (muo *MemberUpdateOne) RemoveMemberSecurityLogIDs(ids ...int) *MemberUpdateOne

RemoveMemberSecurityLogIDs removes the "member_security_logs" edge to MemberSecurityLog entities by IDs.

func (*MemberUpdateOne) RemoveMemberSecurityLogs added in v1.0.10

func (muo *MemberUpdateOne) RemoveMemberSecurityLogs(m ...*MemberSecurityLog) *MemberUpdateOne

RemoveMemberSecurityLogs removes "member_security_logs" edges to MemberSecurityLog entities.

func (*MemberUpdateOne) RemoveMemberSettingIDs added in v1.0.8

func (muo *MemberUpdateOne) RemoveMemberSettingIDs(ids ...int) *MemberUpdateOne

RemoveMemberSettingIDs removes the "member_settings" edge to MemberSetting entities by IDs.

func (*MemberUpdateOne) RemoveMemberSettings added in v1.0.8

func (muo *MemberUpdateOne) RemoveMemberSettings(m ...*MemberSetting) *MemberUpdateOne

RemoveMemberSettings removes "member_settings" edges to MemberSetting entities.

func (*MemberUpdateOne) RemoveMemberSnippetDocIDs added in v1.0.9

func (muo *MemberUpdateOne) RemoveMemberSnippetDocIDs(ids ...int) *MemberUpdateOne

RemoveMemberSnippetDocIDs removes the "member_snippet_docs" edge to SnippetDocument entities by IDs.

func (*MemberUpdateOne) RemoveMemberSnippetDocs added in v1.0.9

func (muo *MemberUpdateOne) RemoveMemberSnippetDocs(s ...*SnippetDocument) *MemberUpdateOne

RemoveMemberSnippetDocs removes "member_snippet_docs" edges to SnippetDocument entities.

func (*MemberUpdateOne) RemoveMemberSnippetFolderIDs added in v1.0.9

func (muo *MemberUpdateOne) RemoveMemberSnippetFolderIDs(ids ...int) *MemberUpdateOne

RemoveMemberSnippetFolderIDs removes the "member_snippet_folders" edge to SnippetFolder entities by IDs.

func (*MemberUpdateOne) RemoveMemberSnippetFolders added in v1.0.9

func (muo *MemberUpdateOne) RemoveMemberSnippetFolders(s ...*SnippetFolder) *MemberUpdateOne

RemoveMemberSnippetFolders removes "member_snippet_folders" edges to SnippetFolder entities.

func (*MemberUpdateOne) RemoveMemberSnippetIDs added in v1.0.9

func (muo *MemberUpdateOne) RemoveMemberSnippetIDs(ids ...int) *MemberUpdateOne

RemoveMemberSnippetIDs removes the "member_snippets" edge to Snippet entities by IDs.

func (*MemberUpdateOne) RemoveMemberSnippetTagIDs added in v1.0.9

func (muo *MemberUpdateOne) RemoveMemberSnippetTagIDs(ids ...int) *MemberUpdateOne

RemoveMemberSnippetTagIDs removes the "member_snippet_tags" edge to SnippetTag entities by IDs.

func (*MemberUpdateOne) RemoveMemberSnippetTags added in v1.0.9

func (muo *MemberUpdateOne) RemoveMemberSnippetTags(s ...*SnippetTag) *MemberUpdateOne

RemoveMemberSnippetTags removes "member_snippet_tags" edges to SnippetTag entities.

func (*MemberUpdateOne) RemoveMemberSnippets added in v1.0.9

func (muo *MemberUpdateOne) RemoveMemberSnippets(s ...*Snippet) *MemberUpdateOne

RemoveMemberSnippets removes "member_snippets" edges to Snippet entities.

func (*MemberUpdateOne) Save

func (muo *MemberUpdateOne) Save(ctx context.Context) (*Member, error)

Save executes the query and returns the updated Member entity.

func (*MemberUpdateOne) SaveX

func (muo *MemberUpdateOne) SaveX(ctx context.Context) *Member

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

func (*MemberUpdateOne) Select

func (muo *MemberUpdateOne) Select(field string, fields ...string) *MemberUpdateOne

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

func (*MemberUpdateOne) SetDeleteTime

func (muo *MemberUpdateOne) SetDeleteTime(t time.Time) *MemberUpdateOne

SetDeleteTime sets the "delete_time" field.

func (*MemberUpdateOne) SetGroupID added in v1.0.2

func (muo *MemberUpdateOne) SetGroupID(i int) *MemberUpdateOne

SetGroupID sets the "group_id" field.

func (*MemberUpdateOne) SetLastPwdAuth

func (muo *MemberUpdateOne) SetLastPwdAuth(t time.Time) *MemberUpdateOne

SetLastPwdAuth sets the "last_pwd_auth" field.

func (*MemberUpdateOne) SetMemberGroup added in v1.0.10

func (muo *MemberUpdateOne) SetMemberGroup(g *Group) *MemberUpdateOne

SetMemberGroup sets the "member_group" edge to the Group entity.

func (*MemberUpdateOne) SetMemberGroupID added in v1.0.10

func (muo *MemberUpdateOne) SetMemberGroupID(id int) *MemberUpdateOne

SetMemberGroupID sets the "member_group" edge to the Group entity by ID.

func (*MemberUpdateOne) SetNickname

func (muo *MemberUpdateOne) SetNickname(s string) *MemberUpdateOne

SetNickname sets the "nickname" field.

func (*MemberUpdateOne) SetNillableDeleteTime

func (muo *MemberUpdateOne) SetNillableDeleteTime(t *time.Time) *MemberUpdateOne

SetNillableDeleteTime sets the "delete_time" field if the given value is not nil.

func (*MemberUpdateOne) SetNillableGroupID added in v1.0.2

func (muo *MemberUpdateOne) SetNillableGroupID(i *int) *MemberUpdateOne

SetNillableGroupID sets the "group_id" field if the given value is not nil.

func (*MemberUpdateOne) SetNillableLastPwdAuth

func (muo *MemberUpdateOne) SetNillableLastPwdAuth(t *time.Time) *MemberUpdateOne

SetNillableLastPwdAuth sets the "last_pwd_auth" field if the given value is not nil.

func (*MemberUpdateOne) SetNillableMemberGroupID added in v1.0.10

func (muo *MemberUpdateOne) SetNillableMemberGroupID(id *int) *MemberUpdateOne

SetNillableMemberGroupID sets the "member_group" edge to the Group entity by ID if the given value is not nil.

func (*MemberUpdateOne) SetNillablePassword added in v1.0.4

func (muo *MemberUpdateOne) SetNillablePassword(s *string) *MemberUpdateOne

SetNillablePassword sets the "password" field if the given value is not nil.

func (*MemberUpdateOne) SetNillablePhone

func (muo *MemberUpdateOne) SetNillablePhone(s *string) *MemberUpdateOne

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

func (*MemberUpdateOne) SetNillableStatus

func (muo *MemberUpdateOne) SetNillableStatus(m *member.Status) *MemberUpdateOne

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

func (*MemberUpdateOne) SetPassword

func (muo *MemberUpdateOne) SetPassword(s string) *MemberUpdateOne

SetPassword sets the "password" field.

func (*MemberUpdateOne) SetPhone

func (muo *MemberUpdateOne) SetPhone(s string) *MemberUpdateOne

SetPhone sets the "phone" field.

func (*MemberUpdateOne) SetSignature

func (muo *MemberUpdateOne) SetSignature(s string) *MemberUpdateOne

SetSignature sets the "signature" field.

func (*MemberUpdateOne) SetStatus

func (muo *MemberUpdateOne) SetStatus(m member.Status) *MemberUpdateOne

SetStatus sets the "status" field.

func (*MemberUpdateOne) SetUpdateTime

func (muo *MemberUpdateOne) SetUpdateTime(t time.Time) *MemberUpdateOne

SetUpdateTime sets the "update_time" field.

type Members

type Members []*Member

Members is a parsable slice of Member.

type MutateFunc

type MutateFunc = ent.MutateFunc

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

type Mutation

type Mutation = ent.Mutation

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

type Mutator

type Mutator = ent.Mutator

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

type NotFoundError

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

NotFoundError returns when trying to fetch a specific entity and it was not found in the database.

func (*NotFoundError) Error

func (e *NotFoundError) Error() string

Error implements the error interface.

type NotLoadedError

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

NotLoadedError returns when trying to get a node that was not loaded by the query.

func (*NotLoadedError) Error

func (e *NotLoadedError) Error() string

Error implements the error interface.

type NotSingularError

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

NotSingularError returns when trying to fetch a singular entity and more then one was found in the database.

func (*NotSingularError) Error

func (e *NotSingularError) Error() string

Error implements the error interface.

type Op

type Op = ent.Op

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

type Option

type Option func(*config)

Option function to configure the client.

func Debug

func Debug() Option

Debug enables debug logging on the ent.Driver.

func Driver

func Driver(driver dialect.Driver) Option

Driver configures the client driver.

func Log

func Log(fn func(...interface{})) Option

Log sets the logging function for debug mode.

type OrderFunc

type OrderFunc func(*sql.Selector)

OrderFunc applies an ordering on the sql selector.

func Asc

func Asc(fields ...string) OrderFunc

Asc applies the given fields in ASC order.

func Desc

func Desc(fields ...string) OrderFunc

Desc applies the given fields in DESC order.

type Policy

type Policy = ent.Policy

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

type Query

type Query = ent.Query

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

type RollbackFunc

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

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

func (RollbackFunc) Rollback

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

Rollback calls f(ctx, m).

type RollbackHook

type RollbackHook func(Rollbacker) Rollbacker

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

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

type Rollbacker

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

Rollbacker is the interface that wraps the Rollbacker method.

type Snippet added in v1.0.8

type Snippet struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// Sn holds the value of the "sn" field.
	Sn string `json:"-"`
	// OwnerID holds the value of the "owner_id" field.
	OwnerID int `json:"-"`
	// Title holds the value of the "title" field.
	Title *string `json:"title,omitempty"`
	// FolderID holds the value of the "folder_id" field.
	FolderID *int `json:"-"`
	// CreateTime holds the value of the "create_time" field.
	CreateTime time.Time `json:"create_time,omitempty"`
	// UpdateTime holds the value of the "update_time" field.
	UpdateTime time.Time `json:"update_time,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the SnippetQuery when eager-loading is set.
	Edges SnippetEdges `json:"edges"`
	// contains filtered or unexported fields
}

Snippet is the model entity for the Snippet schema.

func (*Snippet) QuerySnippetDocs added in v1.0.8

func (s *Snippet) QuerySnippetDocs() *SnippetDocumentQuery

QuerySnippetDocs queries the "snippet_docs" edge of the Snippet entity.

func (*Snippet) QuerySnippetTags added in v1.0.9

func (s *Snippet) QuerySnippetTags() *SnippetTagQuery

QuerySnippetTags queries the "snippet_tags" edge of the Snippet entity.

func (*Snippet) String added in v1.0.8

func (s *Snippet) String() string

String implements the fmt.Stringer.

func (*Snippet) Unwrap added in v1.0.8

func (s *Snippet) Unwrap() *Snippet

Unwrap unwraps the Snippet 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 (*Snippet) Update added in v1.0.8

func (s *Snippet) Update() *SnippetUpdateOne

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

type SnippetClient added in v1.0.8

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

SnippetClient is a client for the Snippet schema.

func NewSnippetClient added in v1.0.8

func NewSnippetClient(c config) *SnippetClient

NewSnippetClient returns a client for the Snippet from the given config.

func (*SnippetClient) Create added in v1.0.8

func (c *SnippetClient) Create() *SnippetCreate

Create returns a create builder for Snippet.

func (*SnippetClient) CreateBulk added in v1.0.8

func (c *SnippetClient) CreateBulk(builders ...*SnippetCreate) *SnippetCreateBulk

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

func (*SnippetClient) Delete added in v1.0.8

func (c *SnippetClient) Delete() *SnippetDelete

Delete returns a delete builder for Snippet.

func (*SnippetClient) DeleteOne added in v1.0.8

func (c *SnippetClient) DeleteOne(s *Snippet) *SnippetDeleteOne

DeleteOne returns a delete builder for the given entity.

func (*SnippetClient) DeleteOneID added in v1.0.8

func (c *SnippetClient) DeleteOneID(id int) *SnippetDeleteOne

DeleteOneID returns a delete builder for the given id.

func (*SnippetClient) Get added in v1.0.8

func (c *SnippetClient) Get(ctx context.Context, id int) (*Snippet, error)

Get returns a Snippet entity by its id.

func (*SnippetClient) GetX added in v1.0.8

func (c *SnippetClient) GetX(ctx context.Context, id int) *Snippet

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

func (*SnippetClient) Hooks added in v1.0.8

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

Hooks returns the client hooks.

func (*SnippetClient) Query added in v1.0.8

func (c *SnippetClient) Query() *SnippetQuery

Query returns a query builder for Snippet.

func (*SnippetClient) QuerySnippetDocs added in v1.0.8

func (c *SnippetClient) QuerySnippetDocs(s *Snippet) *SnippetDocumentQuery

QuerySnippetDocs queries the snippet_docs edge of a Snippet.

func (*SnippetClient) QuerySnippetTags added in v1.0.9

func (c *SnippetClient) QuerySnippetTags(s *Snippet) *SnippetTagQuery

QuerySnippetTags queries the snippet_tags edge of a Snippet.

func (*SnippetClient) Update added in v1.0.8

func (c *SnippetClient) Update() *SnippetUpdate

Update returns an update builder for Snippet.

func (*SnippetClient) UpdateOne added in v1.0.8

func (c *SnippetClient) UpdateOne(s *Snippet) *SnippetUpdateOne

UpdateOne returns an update builder for the given entity.

func (*SnippetClient) UpdateOneID added in v1.0.8

func (c *SnippetClient) UpdateOneID(id int) *SnippetUpdateOne

UpdateOneID returns an update builder for the given id.

func (*SnippetClient) Use added in v1.0.8

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

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

type SnippetCreate added in v1.0.8

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

SnippetCreate is the builder for creating a Snippet entity.

func (*SnippetCreate) AddSnippetDocIDs added in v1.0.8

func (sc *SnippetCreate) AddSnippetDocIDs(ids ...int) *SnippetCreate

AddSnippetDocIDs adds the "snippet_docs" edge to the SnippetDocument entity by IDs.

func (*SnippetCreate) AddSnippetDocs added in v1.0.8

func (sc *SnippetCreate) AddSnippetDocs(s ...*SnippetDocument) *SnippetCreate

AddSnippetDocs adds the "snippet_docs" edges to the SnippetDocument entity.

func (*SnippetCreate) AddSnippetTagIDs added in v1.0.9

func (sc *SnippetCreate) AddSnippetTagIDs(ids ...int) *SnippetCreate

AddSnippetTagIDs adds the "snippet_tags" edge to the SnippetTag entity by IDs.

func (*SnippetCreate) AddSnippetTags added in v1.0.9

func (sc *SnippetCreate) AddSnippetTags(s ...*SnippetTag) *SnippetCreate

AddSnippetTags adds the "snippet_tags" edges to the SnippetTag entity.

func (*SnippetCreate) Exec added in v1.0.8

func (sc *SnippetCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*SnippetCreate) ExecX added in v1.0.8

func (sc *SnippetCreate) ExecX(ctx context.Context)

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

func (*SnippetCreate) Mutation added in v1.0.8

func (sc *SnippetCreate) Mutation() *SnippetMutation

Mutation returns the SnippetMutation object of the builder.

func (*SnippetCreate) Save added in v1.0.8

func (sc *SnippetCreate) Save(ctx context.Context) (*Snippet, error)

Save creates the Snippet in the database.

func (*SnippetCreate) SaveX added in v1.0.8

func (sc *SnippetCreate) SaveX(ctx context.Context) *Snippet

SaveX calls Save and panics if Save returns an error.

func (*SnippetCreate) SetCreateTime added in v1.0.8

func (sc *SnippetCreate) SetCreateTime(t time.Time) *SnippetCreate

SetCreateTime sets the "create_time" field.

func (*SnippetCreate) SetFolderID added in v1.0.8

func (sc *SnippetCreate) SetFolderID(i int) *SnippetCreate

SetFolderID sets the "folder_id" field.

func (*SnippetCreate) SetID added in v1.0.8

func (sc *SnippetCreate) SetID(i int) *SnippetCreate

SetID sets the "id" field.

func (*SnippetCreate) SetNillableCreateTime added in v1.0.8

func (sc *SnippetCreate) SetNillableCreateTime(t *time.Time) *SnippetCreate

SetNillableCreateTime sets the "create_time" field if the given value is not nil.

func (*SnippetCreate) SetNillableFolderID added in v1.0.8

func (sc *SnippetCreate) SetNillableFolderID(i *int) *SnippetCreate

SetNillableFolderID sets the "folder_id" field if the given value is not nil.

func (*SnippetCreate) SetNillableSn added in v1.0.8

func (sc *SnippetCreate) SetNillableSn(s *string) *SnippetCreate

SetNillableSn sets the "sn" field if the given value is not nil.

func (*SnippetCreate) SetNillableTitle added in v1.0.8

func (sc *SnippetCreate) SetNillableTitle(s *string) *SnippetCreate

SetNillableTitle sets the "title" field if the given value is not nil.

func (*SnippetCreate) SetNillableUpdateTime added in v1.0.8

func (sc *SnippetCreate) SetNillableUpdateTime(t *time.Time) *SnippetCreate

SetNillableUpdateTime sets the "update_time" field if the given value is not nil.

func (*SnippetCreate) SetOwnerID added in v1.0.8

func (sc *SnippetCreate) SetOwnerID(i int) *SnippetCreate

SetOwnerID sets the "owner_id" field.

func (*SnippetCreate) SetSn added in v1.0.8

func (sc *SnippetCreate) SetSn(s string) *SnippetCreate

SetSn sets the "sn" field.

func (*SnippetCreate) SetTitle added in v1.0.8

func (sc *SnippetCreate) SetTitle(s string) *SnippetCreate

SetTitle sets the "title" field.

func (*SnippetCreate) SetUpdateTime added in v1.0.8

func (sc *SnippetCreate) SetUpdateTime(t time.Time) *SnippetCreate

SetUpdateTime sets the "update_time" field.

type SnippetCreateBulk added in v1.0.8

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

SnippetCreateBulk is the builder for creating many Snippet entities in bulk.

func (*SnippetCreateBulk) Exec added in v1.0.8

func (scb *SnippetCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*SnippetCreateBulk) ExecX added in v1.0.8

func (scb *SnippetCreateBulk) ExecX(ctx context.Context)

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

func (*SnippetCreateBulk) Save added in v1.0.8

func (scb *SnippetCreateBulk) Save(ctx context.Context) ([]*Snippet, error)

Save creates the Snippet entities in the database.

func (*SnippetCreateBulk) SaveX added in v1.0.8

func (scb *SnippetCreateBulk) SaveX(ctx context.Context) []*Snippet

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

type SnippetDelete added in v1.0.8

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

SnippetDelete is the builder for deleting a Snippet entity.

func (*SnippetDelete) Exec added in v1.0.8

func (sd *SnippetDelete) Exec(ctx context.Context) (int, error)

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

func (*SnippetDelete) ExecX added in v1.0.8

func (sd *SnippetDelete) ExecX(ctx context.Context) int

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

func (*SnippetDelete) Where added in v1.0.8

func (sd *SnippetDelete) Where(ps ...predicate.Snippet) *SnippetDelete

Where appends a list predicates to the SnippetDelete builder.

type SnippetDeleteOne added in v1.0.8

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

SnippetDeleteOne is the builder for deleting a single Snippet entity.

func (*SnippetDeleteOne) Exec added in v1.0.8

func (sdo *SnippetDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*SnippetDeleteOne) ExecX added in v1.0.8

func (sdo *SnippetDeleteOne) ExecX(ctx context.Context)

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

type SnippetDocument added in v1.0.8

type SnippetDocument struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// SnippetID holds the value of the "snippet_id" field.
	SnippetID int `json:"-"`
	// OwnerID holds the value of the "owner_id" field.
	OwnerID int `json:"-"`
	// Language holds the value of the "language" field.
	Language string `json:"language,omitempty"`
	// Description holds the value of the "description" field.
	Description string `json:"description,omitempty"`
	// Raw holds the value of the "raw" field.
	Raw string `json:"raw,omitempty"`
	// CreateTime holds the value of the "create_time" field.
	CreateTime time.Time `json:"create_time,omitempty"`
	// UpdateTime holds the value of the "update_time" field.
	UpdateTime time.Time `json:"update_time,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the SnippetDocumentQuery when eager-loading is set.
	Edges SnippetDocumentEdges `json:"edges"`
	// contains filtered or unexported fields
}

SnippetDocument is the model entity for the SnippetDocument schema.

func (*SnippetDocument) QueryDocSnippet added in v1.0.8

func (sd *SnippetDocument) QueryDocSnippet() *SnippetQuery

QueryDocSnippet queries the "doc_snippet" edge of the SnippetDocument entity.

func (*SnippetDocument) String added in v1.0.8

func (sd *SnippetDocument) String() string

String implements the fmt.Stringer.

func (*SnippetDocument) Unwrap added in v1.0.8

func (sd *SnippetDocument) Unwrap() *SnippetDocument

Unwrap unwraps the SnippetDocument 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 (*SnippetDocument) Update added in v1.0.8

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

type SnippetDocumentClient added in v1.0.8

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

SnippetDocumentClient is a client for the SnippetDocument schema.

func NewSnippetDocumentClient added in v1.0.8

func NewSnippetDocumentClient(c config) *SnippetDocumentClient

NewSnippetDocumentClient returns a client for the SnippetDocument from the given config.

func (*SnippetDocumentClient) Create added in v1.0.8

Create returns a create builder for SnippetDocument.

func (*SnippetDocumentClient) CreateBulk added in v1.0.8

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

func (*SnippetDocumentClient) Delete added in v1.0.8

Delete returns a delete builder for SnippetDocument.

func (*SnippetDocumentClient) DeleteOne added in v1.0.8

DeleteOne returns a delete builder for the given entity.

func (*SnippetDocumentClient) DeleteOneID added in v1.0.8

DeleteOneID returns a delete builder for the given id.

func (*SnippetDocumentClient) Get added in v1.0.8

Get returns a SnippetDocument entity by its id.

func (*SnippetDocumentClient) GetX added in v1.0.8

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

func (*SnippetDocumentClient) Hooks added in v1.0.8

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

Hooks returns the client hooks.

func (*SnippetDocumentClient) Query added in v1.0.8

Query returns a query builder for SnippetDocument.

func (*SnippetDocumentClient) QueryDocSnippet added in v1.0.8

func (c *SnippetDocumentClient) QueryDocSnippet(sd *SnippetDocument) *SnippetQuery

QueryDocSnippet queries the doc_snippet edge of a SnippetDocument.

func (*SnippetDocumentClient) Update added in v1.0.8

Update returns an update builder for SnippetDocument.

func (*SnippetDocumentClient) UpdateOne added in v1.0.8

UpdateOne returns an update builder for the given entity.

func (*SnippetDocumentClient) UpdateOneID added in v1.0.8

UpdateOneID returns an update builder for the given id.

func (*SnippetDocumentClient) Use added in v1.0.8

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

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

type SnippetDocumentCreate added in v1.0.8

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

SnippetDocumentCreate is the builder for creating a SnippetDocument entity.

func (*SnippetDocumentCreate) Exec added in v1.0.8

func (sdc *SnippetDocumentCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*SnippetDocumentCreate) ExecX added in v1.0.8

func (sdc *SnippetDocumentCreate) ExecX(ctx context.Context)

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

func (*SnippetDocumentCreate) Mutation added in v1.0.8

Mutation returns the SnippetDocumentMutation object of the builder.

func (*SnippetDocumentCreate) Save added in v1.0.8

Save creates the SnippetDocument in the database.

func (*SnippetDocumentCreate) SaveX added in v1.0.8

SaveX calls Save and panics if Save returns an error.

func (*SnippetDocumentCreate) SetCreateTime added in v1.0.8

func (sdc *SnippetDocumentCreate) SetCreateTime(t time.Time) *SnippetDocumentCreate

SetCreateTime sets the "create_time" field.

func (*SnippetDocumentCreate) SetDescription added in v1.0.8

func (sdc *SnippetDocumentCreate) SetDescription(s string) *SnippetDocumentCreate

SetDescription sets the "description" field.

func (*SnippetDocumentCreate) SetDocSnippet added in v1.0.8

func (sdc *SnippetDocumentCreate) SetDocSnippet(s *Snippet) *SnippetDocumentCreate

SetDocSnippet sets the "doc_snippet" edge to the Snippet entity.

func (*SnippetDocumentCreate) SetDocSnippetID added in v1.0.8

func (sdc *SnippetDocumentCreate) SetDocSnippetID(id int) *SnippetDocumentCreate

SetDocSnippetID sets the "doc_snippet" edge to the Snippet entity by ID.

func (*SnippetDocumentCreate) SetID added in v1.0.8

SetID sets the "id" field.

func (*SnippetDocumentCreate) SetLanguage added in v1.0.8

func (sdc *SnippetDocumentCreate) SetLanguage(s string) *SnippetDocumentCreate

SetLanguage sets the "language" field.

func (*SnippetDocumentCreate) SetNillableCreateTime added in v1.0.8

func (sdc *SnippetDocumentCreate) SetNillableCreateTime(t *time.Time) *SnippetDocumentCreate

SetNillableCreateTime sets the "create_time" field if the given value is not nil.

func (*SnippetDocumentCreate) SetNillableLanguage added in v1.0.8

func (sdc *SnippetDocumentCreate) SetNillableLanguage(s *string) *SnippetDocumentCreate

SetNillableLanguage sets the "language" field if the given value is not nil.

func (*SnippetDocumentCreate) SetNillableUpdateTime added in v1.0.8

func (sdc *SnippetDocumentCreate) SetNillableUpdateTime(t *time.Time) *SnippetDocumentCreate

SetNillableUpdateTime sets the "update_time" field if the given value is not nil.

func (*SnippetDocumentCreate) SetOwnerID added in v1.0.8

func (sdc *SnippetDocumentCreate) SetOwnerID(i int) *SnippetDocumentCreate

SetOwnerID sets the "owner_id" field.

func (*SnippetDocumentCreate) SetRaw added in v1.0.8

SetRaw sets the "raw" field.

func (*SnippetDocumentCreate) SetSnippetID added in v1.0.8

func (sdc *SnippetDocumentCreate) SetSnippetID(i int) *SnippetDocumentCreate

SetSnippetID sets the "snippet_id" field.

func (*SnippetDocumentCreate) SetUpdateTime added in v1.0.8

func (sdc *SnippetDocumentCreate) SetUpdateTime(t time.Time) *SnippetDocumentCreate

SetUpdateTime sets the "update_time" field.

type SnippetDocumentCreateBulk added in v1.0.8

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

SnippetDocumentCreateBulk is the builder for creating many SnippetDocument entities in bulk.

func (*SnippetDocumentCreateBulk) Exec added in v1.0.8

Exec executes the query.

func (*SnippetDocumentCreateBulk) ExecX added in v1.0.8

func (sdcb *SnippetDocumentCreateBulk) ExecX(ctx context.Context)

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

func (*SnippetDocumentCreateBulk) Save added in v1.0.8

Save creates the SnippetDocument entities in the database.

func (*SnippetDocumentCreateBulk) SaveX added in v1.0.8

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

type SnippetDocumentDelete added in v1.0.8

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

SnippetDocumentDelete is the builder for deleting a SnippetDocument entity.

func (*SnippetDocumentDelete) Exec added in v1.0.8

func (sdd *SnippetDocumentDelete) Exec(ctx context.Context) (int, error)

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

func (*SnippetDocumentDelete) ExecX added in v1.0.8

func (sdd *SnippetDocumentDelete) ExecX(ctx context.Context) int

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

func (*SnippetDocumentDelete) Where added in v1.0.8

Where appends a list predicates to the SnippetDocumentDelete builder.

type SnippetDocumentDeleteOne added in v1.0.8

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

SnippetDocumentDeleteOne is the builder for deleting a single SnippetDocument entity.

func (*SnippetDocumentDeleteOne) Exec added in v1.0.8

Exec executes the deletion query.

func (*SnippetDocumentDeleteOne) ExecX added in v1.0.8

func (sddo *SnippetDocumentDeleteOne) ExecX(ctx context.Context)

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

type SnippetDocumentEdges added in v1.0.8

type SnippetDocumentEdges struct {
	// DocSnippet holds the value of the doc_snippet edge.
	DocSnippet *Snippet `json:"doc_snippet,omitempty"`
	// contains filtered or unexported fields
}

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

func (SnippetDocumentEdges) DocSnippetOrErr added in v1.0.8

func (e SnippetDocumentEdges) DocSnippetOrErr() (*Snippet, error)

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

type SnippetDocumentGroupBy added in v1.0.8

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

SnippetDocumentGroupBy is the group-by builder for SnippetDocument entities.

func (*SnippetDocumentGroupBy) Aggregate added in v1.0.8

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

func (*SnippetDocumentGroupBy) Bool added in v1.0.8

func (sdgb *SnippetDocumentGroupBy) 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 (*SnippetDocumentGroupBy) BoolX added in v1.0.8

func (sdgb *SnippetDocumentGroupBy) BoolX(ctx context.Context) bool

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

func (*SnippetDocumentGroupBy) Bools added in v1.0.8

func (sdgb *SnippetDocumentGroupBy) 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 (*SnippetDocumentGroupBy) BoolsX added in v1.0.8

func (sdgb *SnippetDocumentGroupBy) BoolsX(ctx context.Context) []bool

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

func (*SnippetDocumentGroupBy) Float64 added in v1.0.8

func (sdgb *SnippetDocumentGroupBy) 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 (*SnippetDocumentGroupBy) Float64X added in v1.0.8

func (sdgb *SnippetDocumentGroupBy) Float64X(ctx context.Context) float64

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

func (*SnippetDocumentGroupBy) Float64s added in v1.0.8

func (sdgb *SnippetDocumentGroupBy) 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 (*SnippetDocumentGroupBy) Float64sX added in v1.0.8

func (sdgb *SnippetDocumentGroupBy) Float64sX(ctx context.Context) []float64

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

func (*SnippetDocumentGroupBy) Int added in v1.0.8

func (sdgb *SnippetDocumentGroupBy) 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 (*SnippetDocumentGroupBy) IntX added in v1.0.8

func (sdgb *SnippetDocumentGroupBy) IntX(ctx context.Context) int

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

func (*SnippetDocumentGroupBy) Ints added in v1.0.8

func (sdgb *SnippetDocumentGroupBy) 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 (*SnippetDocumentGroupBy) IntsX added in v1.0.8

func (sdgb *SnippetDocumentGroupBy) IntsX(ctx context.Context) []int

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

func (*SnippetDocumentGroupBy) Scan added in v1.0.8

func (sdgb *SnippetDocumentGroupBy) Scan(ctx context.Context, v interface{}) error

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

func (*SnippetDocumentGroupBy) ScanX added in v1.0.8

func (sdgb *SnippetDocumentGroupBy) ScanX(ctx context.Context, v interface{})

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

func (*SnippetDocumentGroupBy) String added in v1.0.8

func (sdgb *SnippetDocumentGroupBy) 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 (*SnippetDocumentGroupBy) StringX added in v1.0.8

func (sdgb *SnippetDocumentGroupBy) StringX(ctx context.Context) string

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

func (*SnippetDocumentGroupBy) Strings added in v1.0.8

func (sdgb *SnippetDocumentGroupBy) 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 (*SnippetDocumentGroupBy) StringsX added in v1.0.8

func (sdgb *SnippetDocumentGroupBy) StringsX(ctx context.Context) []string

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

type SnippetDocumentMutation added in v1.0.8

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

SnippetDocumentMutation represents an operation that mutates the SnippetDocument nodes in the graph.

func (*SnippetDocumentMutation) AddField added in v1.0.8

func (m *SnippetDocumentMutation) 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 (*SnippetDocumentMutation) AddOwnerID added in v1.0.10

func (m *SnippetDocumentMutation) AddOwnerID(i int)

AddOwnerID adds i to the "owner_id" field.

func (*SnippetDocumentMutation) AddedEdges added in v1.0.8

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

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

func (*SnippetDocumentMutation) AddedField added in v1.0.8

func (m *SnippetDocumentMutation) 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 (*SnippetDocumentMutation) AddedFields added in v1.0.8

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

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

func (*SnippetDocumentMutation) AddedIDs added in v1.0.8

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

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

func (*SnippetDocumentMutation) AddedOwnerID added in v1.0.10

func (m *SnippetDocumentMutation) AddedOwnerID() (r int, exists bool)

AddedOwnerID returns the value that was added to the "owner_id" field in this mutation.

func (*SnippetDocumentMutation) ClearDocSnippet added in v1.0.8

func (m *SnippetDocumentMutation) ClearDocSnippet()

ClearDocSnippet clears the "doc_snippet" edge to the Snippet entity.

func (*SnippetDocumentMutation) ClearEdge added in v1.0.8

func (m *SnippetDocumentMutation) 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 (*SnippetDocumentMutation) ClearField added in v1.0.8

func (m *SnippetDocumentMutation) 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 (*SnippetDocumentMutation) ClearedEdges added in v1.0.8

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

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

func (*SnippetDocumentMutation) ClearedFields added in v1.0.8

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

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

func (SnippetDocumentMutation) Client added in v1.0.8

func (m SnippetDocumentMutation) 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 (*SnippetDocumentMutation) CreateTime added in v1.0.8

func (m *SnippetDocumentMutation) CreateTime() (r time.Time, exists bool)

CreateTime returns the value of the "create_time" field in the mutation.

func (*SnippetDocumentMutation) Description added in v1.0.8

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

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

func (*SnippetDocumentMutation) DocSnippetCleared added in v1.0.8

func (m *SnippetDocumentMutation) DocSnippetCleared() bool

DocSnippetCleared reports if the "doc_snippet" edge to the Snippet entity was cleared.

func (*SnippetDocumentMutation) DocSnippetID added in v1.0.8

func (m *SnippetDocumentMutation) DocSnippetID() (id int, exists bool)

DocSnippetID returns the "doc_snippet" edge ID in the mutation.

func (*SnippetDocumentMutation) DocSnippetIDs added in v1.0.8

func (m *SnippetDocumentMutation) DocSnippetIDs() (ids []int)

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

func (*SnippetDocumentMutation) EdgeCleared added in v1.0.8

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

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

func (*SnippetDocumentMutation) Field added in v1.0.8

func (m *SnippetDocumentMutation) 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 (*SnippetDocumentMutation) FieldCleared added in v1.0.8

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

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

func (*SnippetDocumentMutation) Fields added in v1.0.8

func (m *SnippetDocumentMutation) 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 (*SnippetDocumentMutation) ID added in v1.0.8

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

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

func (*SnippetDocumentMutation) Language added in v1.0.8

func (m *SnippetDocumentMutation) Language() (r string, exists bool)

Language returns the value of the "language" field in the mutation.

func (*SnippetDocumentMutation) OldCreateTime added in v1.0.8

func (m *SnippetDocumentMutation) OldCreateTime(ctx context.Context) (v time.Time, err error)

OldCreateTime returns the old "create_time" field's value of the SnippetDocument entity. If the SnippetDocument 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 (*SnippetDocumentMutation) OldDescription added in v1.0.8

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

OldDescription returns the old "description" field's value of the SnippetDocument entity. If the SnippetDocument 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 (*SnippetDocumentMutation) OldField added in v1.0.8

func (m *SnippetDocumentMutation) 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 (*SnippetDocumentMutation) OldLanguage added in v1.0.8

func (m *SnippetDocumentMutation) OldLanguage(ctx context.Context) (v string, err error)

OldLanguage returns the old "language" field's value of the SnippetDocument entity. If the SnippetDocument 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 (*SnippetDocumentMutation) OldOwnerID added in v1.0.8

func (m *SnippetDocumentMutation) OldOwnerID(ctx context.Context) (v int, err error)

OldOwnerID returns the old "owner_id" field's value of the SnippetDocument entity. If the SnippetDocument 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 (*SnippetDocumentMutation) OldRaw added in v1.0.8

func (m *SnippetDocumentMutation) OldRaw(ctx context.Context) (v string, err error)

OldRaw returns the old "raw" field's value of the SnippetDocument entity. If the SnippetDocument 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 (*SnippetDocumentMutation) OldSnippetID added in v1.0.8

func (m *SnippetDocumentMutation) OldSnippetID(ctx context.Context) (v int, err error)

OldSnippetID returns the old "snippet_id" field's value of the SnippetDocument entity. If the SnippetDocument 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 (*SnippetDocumentMutation) OldUpdateTime added in v1.0.8

func (m *SnippetDocumentMutation) OldUpdateTime(ctx context.Context) (v time.Time, err error)

OldUpdateTime returns the old "update_time" field's value of the SnippetDocument entity. If the SnippetDocument 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 (*SnippetDocumentMutation) Op added in v1.0.8

func (m *SnippetDocumentMutation) Op() Op

Op returns the operation name.

func (*SnippetDocumentMutation) OwnerID added in v1.0.8

func (m *SnippetDocumentMutation) OwnerID() (r int, exists bool)

OwnerID returns the value of the "owner_id" field in the mutation.

func (*SnippetDocumentMutation) Raw added in v1.0.8

func (m *SnippetDocumentMutation) Raw() (r string, exists bool)

Raw returns the value of the "raw" field in the mutation.

func (*SnippetDocumentMutation) RemovedEdges added in v1.0.8

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

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

func (*SnippetDocumentMutation) RemovedIDs added in v1.0.8

func (m *SnippetDocumentMutation) 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 (*SnippetDocumentMutation) ResetCreateTime added in v1.0.8

func (m *SnippetDocumentMutation) ResetCreateTime()

ResetCreateTime resets all changes to the "create_time" field.

func (*SnippetDocumentMutation) ResetDescription added in v1.0.8

func (m *SnippetDocumentMutation) ResetDescription()

ResetDescription resets all changes to the "description" field.

func (*SnippetDocumentMutation) ResetDocSnippet added in v1.0.8

func (m *SnippetDocumentMutation) ResetDocSnippet()

ResetDocSnippet resets all changes to the "doc_snippet" edge.

func (*SnippetDocumentMutation) ResetEdge added in v1.0.8

func (m *SnippetDocumentMutation) 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 (*SnippetDocumentMutation) ResetField added in v1.0.8

func (m *SnippetDocumentMutation) 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 (*SnippetDocumentMutation) ResetLanguage added in v1.0.8

func (m *SnippetDocumentMutation) ResetLanguage()

ResetLanguage resets all changes to the "language" field.

func (*SnippetDocumentMutation) ResetOwnerID added in v1.0.8

func (m *SnippetDocumentMutation) ResetOwnerID()

ResetOwnerID resets all changes to the "owner_id" field.

func (*SnippetDocumentMutation) ResetRaw added in v1.0.8

func (m *SnippetDocumentMutation) ResetRaw()

ResetRaw resets all changes to the "raw" field.

func (*SnippetDocumentMutation) ResetSnippetID added in v1.0.8

func (m *SnippetDocumentMutation) ResetSnippetID()

ResetSnippetID resets all changes to the "snippet_id" field.

func (*SnippetDocumentMutation) ResetUpdateTime added in v1.0.8

func (m *SnippetDocumentMutation) ResetUpdateTime()

ResetUpdateTime resets all changes to the "update_time" field.

func (*SnippetDocumentMutation) SetCreateTime added in v1.0.8

func (m *SnippetDocumentMutation) SetCreateTime(t time.Time)

SetCreateTime sets the "create_time" field.

func (*SnippetDocumentMutation) SetDescription added in v1.0.8

func (m *SnippetDocumentMutation) SetDescription(s string)

SetDescription sets the "description" field.

func (*SnippetDocumentMutation) SetDocSnippetID added in v1.0.8

func (m *SnippetDocumentMutation) SetDocSnippetID(id int)

SetDocSnippetID sets the "doc_snippet" edge to the Snippet entity by id.

func (*SnippetDocumentMutation) SetField added in v1.0.8

func (m *SnippetDocumentMutation) 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 (*SnippetDocumentMutation) SetID added in v1.0.8

func (m *SnippetDocumentMutation) SetID(id int)

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

func (*SnippetDocumentMutation) SetLanguage added in v1.0.8

func (m *SnippetDocumentMutation) SetLanguage(s string)

SetLanguage sets the "language" field.

func (*SnippetDocumentMutation) SetOwnerID added in v1.0.8

func (m *SnippetDocumentMutation) SetOwnerID(i int)

SetOwnerID sets the "owner_id" field.

func (*SnippetDocumentMutation) SetRaw added in v1.0.8

func (m *SnippetDocumentMutation) SetRaw(s string)

SetRaw sets the "raw" field.

func (*SnippetDocumentMutation) SetSnippetID added in v1.0.8

func (m *SnippetDocumentMutation) SetSnippetID(i int)

SetSnippetID sets the "snippet_id" field.

func (*SnippetDocumentMutation) SetUpdateTime added in v1.0.8

func (m *SnippetDocumentMutation) SetUpdateTime(t time.Time)

SetUpdateTime sets the "update_time" field.

func (*SnippetDocumentMutation) SnippetID added in v1.0.8

func (m *SnippetDocumentMutation) SnippetID() (r int, exists bool)

SnippetID returns the value of the "snippet_id" field in the mutation.

func (SnippetDocumentMutation) Tx added in v1.0.8

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

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

func (*SnippetDocumentMutation) Type added in v1.0.8

func (m *SnippetDocumentMutation) Type() string

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

func (*SnippetDocumentMutation) UpdateTime added in v1.0.8

func (m *SnippetDocumentMutation) UpdateTime() (r time.Time, exists bool)

UpdateTime returns the value of the "update_time" field in the mutation.

func (*SnippetDocumentMutation) Where added in v1.0.8

Where appends a list predicates to the SnippetDocumentMutation builder.

type SnippetDocumentQuery added in v1.0.8

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

SnippetDocumentQuery is the builder for querying SnippetDocument entities.

func (*SnippetDocumentQuery) All added in v1.0.8

All executes the query and returns a list of SnippetDocuments.

func (*SnippetDocumentQuery) AllX added in v1.0.8

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

func (*SnippetDocumentQuery) Clone added in v1.0.8

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

func (*SnippetDocumentQuery) Count added in v1.0.8

func (sdq *SnippetDocumentQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*SnippetDocumentQuery) CountX added in v1.0.8

func (sdq *SnippetDocumentQuery) CountX(ctx context.Context) int

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

func (*SnippetDocumentQuery) Exist added in v1.0.8

func (sdq *SnippetDocumentQuery) Exist(ctx context.Context) (bool, error)

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

func (*SnippetDocumentQuery) ExistX added in v1.0.8

func (sdq *SnippetDocumentQuery) ExistX(ctx context.Context) bool

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

func (*SnippetDocumentQuery) First added in v1.0.8

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

func (*SnippetDocumentQuery) FirstID added in v1.0.8

func (sdq *SnippetDocumentQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*SnippetDocumentQuery) FirstIDX added in v1.0.8

func (sdq *SnippetDocumentQuery) FirstIDX(ctx context.Context) int

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

func (*SnippetDocumentQuery) FirstX added in v1.0.8

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

func (*SnippetDocumentQuery) GroupBy added in v1.0.8

func (sdq *SnippetDocumentQuery) GroupBy(field string, fields ...string) *SnippetDocumentGroupBy

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

client.SnippetDocument.Query().
	GroupBy(snippetdocument.FieldSnippetID).
	Aggregate(model.Count()).
	Scan(ctx, &v)

func (*SnippetDocumentQuery) IDs added in v1.0.8

func (sdq *SnippetDocumentQuery) IDs(ctx context.Context) ([]int, error)

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

func (*SnippetDocumentQuery) IDsX added in v1.0.8

func (sdq *SnippetDocumentQuery) IDsX(ctx context.Context) []int

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

func (*SnippetDocumentQuery) Limit added in v1.0.8

func (sdq *SnippetDocumentQuery) Limit(limit int) *SnippetDocumentQuery

Limit adds a limit step to the query.

func (*SnippetDocumentQuery) Offset added in v1.0.8

func (sdq *SnippetDocumentQuery) Offset(offset int) *SnippetDocumentQuery

Offset adds an offset step to the query.

func (*SnippetDocumentQuery) Only added in v1.0.8

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

func (*SnippetDocumentQuery) OnlyID added in v1.0.8

func (sdq *SnippetDocumentQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*SnippetDocumentQuery) OnlyIDX added in v1.0.8

func (sdq *SnippetDocumentQuery) OnlyIDX(ctx context.Context) int

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

func (*SnippetDocumentQuery) OnlyX added in v1.0.8

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

func (*SnippetDocumentQuery) Order added in v1.0.8

Order adds an order step to the query.

func (*SnippetDocumentQuery) QueryDocSnippet added in v1.0.8

func (sdq *SnippetDocumentQuery) QueryDocSnippet() *SnippetQuery

QueryDocSnippet chains the current query on the "doc_snippet" edge.

func (*SnippetDocumentQuery) Select added in v1.0.8

func (sdq *SnippetDocumentQuery) Select(fields ...string) *SnippetDocumentSelect

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 {
	SnippetID int `json:"-"`
}

client.SnippetDocument.Query().
	Select(snippetdocument.FieldSnippetID).
	Scan(ctx, &v)

func (*SnippetDocumentQuery) Unique added in v1.0.8

func (sdq *SnippetDocumentQuery) Unique(unique bool) *SnippetDocumentQuery

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 (*SnippetDocumentQuery) Where added in v1.0.8

Where adds a new predicate for the SnippetDocumentQuery builder.

func (*SnippetDocumentQuery) WithDocSnippet added in v1.0.8

func (sdq *SnippetDocumentQuery) WithDocSnippet(opts ...func(*SnippetQuery)) *SnippetDocumentQuery

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

type SnippetDocumentSelect added in v1.0.8

type SnippetDocumentSelect struct {
	*SnippetDocumentQuery
	// contains filtered or unexported fields
}

SnippetDocumentSelect is the builder for selecting fields of SnippetDocument entities.

func (*SnippetDocumentSelect) Bool added in v1.0.8

func (sds *SnippetDocumentSelect) Bool(ctx context.Context) (_ bool, err error)

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

func (*SnippetDocumentSelect) BoolX added in v1.0.8

func (sds *SnippetDocumentSelect) BoolX(ctx context.Context) bool

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

func (*SnippetDocumentSelect) Bools added in v1.0.8

func (sds *SnippetDocumentSelect) Bools(ctx context.Context) ([]bool, error)

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

func (*SnippetDocumentSelect) BoolsX added in v1.0.8

func (sds *SnippetDocumentSelect) BoolsX(ctx context.Context) []bool

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

func (*SnippetDocumentSelect) Float64 added in v1.0.8

func (sds *SnippetDocumentSelect) Float64(ctx context.Context) (_ float64, err error)

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

func (*SnippetDocumentSelect) Float64X added in v1.0.8

func (sds *SnippetDocumentSelect) Float64X(ctx context.Context) float64

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

func (*SnippetDocumentSelect) Float64s added in v1.0.8

func (sds *SnippetDocumentSelect) Float64s(ctx context.Context) ([]float64, error)

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

func (*SnippetDocumentSelect) Float64sX added in v1.0.8

func (sds *SnippetDocumentSelect) Float64sX(ctx context.Context) []float64

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

func (*SnippetDocumentSelect) Int added in v1.0.8

func (sds *SnippetDocumentSelect) Int(ctx context.Context) (_ int, err error)

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

func (*SnippetDocumentSelect) IntX added in v1.0.8

func (sds *SnippetDocumentSelect) IntX(ctx context.Context) int

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

func (*SnippetDocumentSelect) Ints added in v1.0.8

func (sds *SnippetDocumentSelect) Ints(ctx context.Context) ([]int, error)

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

func (*SnippetDocumentSelect) IntsX added in v1.0.8

func (sds *SnippetDocumentSelect) IntsX(ctx context.Context) []int

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

func (*SnippetDocumentSelect) Scan added in v1.0.8

func (sds *SnippetDocumentSelect) Scan(ctx context.Context, v interface{}) error

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

func (*SnippetDocumentSelect) ScanX added in v1.0.8

func (sds *SnippetDocumentSelect) ScanX(ctx context.Context, v interface{})

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

func (*SnippetDocumentSelect) String added in v1.0.8

func (sds *SnippetDocumentSelect) String(ctx context.Context) (_ string, err error)

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

func (*SnippetDocumentSelect) StringX added in v1.0.8

func (sds *SnippetDocumentSelect) StringX(ctx context.Context) string

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

func (*SnippetDocumentSelect) Strings added in v1.0.8

func (sds *SnippetDocumentSelect) Strings(ctx context.Context) ([]string, error)

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

func (*SnippetDocumentSelect) StringsX added in v1.0.8

func (sds *SnippetDocumentSelect) StringsX(ctx context.Context) []string

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

type SnippetDocumentUpdate added in v1.0.8

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

SnippetDocumentUpdate is the builder for updating SnippetDocument entities.

func (*SnippetDocumentUpdate) ClearDocSnippet added in v1.0.8

func (sdu *SnippetDocumentUpdate) ClearDocSnippet() *SnippetDocumentUpdate

ClearDocSnippet clears the "doc_snippet" edge to the Snippet entity.

func (*SnippetDocumentUpdate) Exec added in v1.0.8

func (sdu *SnippetDocumentUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*SnippetDocumentUpdate) ExecX added in v1.0.8

func (sdu *SnippetDocumentUpdate) ExecX(ctx context.Context)

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

func (*SnippetDocumentUpdate) Mutation added in v1.0.8

Mutation returns the SnippetDocumentMutation object of the builder.

func (*SnippetDocumentUpdate) Save added in v1.0.8

func (sdu *SnippetDocumentUpdate) Save(ctx context.Context) (int, error)

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

func (*SnippetDocumentUpdate) SaveX added in v1.0.8

func (sdu *SnippetDocumentUpdate) SaveX(ctx context.Context) int

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

func (*SnippetDocumentUpdate) SetDescription added in v1.0.8

func (sdu *SnippetDocumentUpdate) SetDescription(s string) *SnippetDocumentUpdate

SetDescription sets the "description" field.

func (*SnippetDocumentUpdate) SetDocSnippet added in v1.0.8

func (sdu *SnippetDocumentUpdate) SetDocSnippet(s *Snippet) *SnippetDocumentUpdate

SetDocSnippet sets the "doc_snippet" edge to the Snippet entity.

func (*SnippetDocumentUpdate) SetDocSnippetID added in v1.0.8

func (sdu *SnippetDocumentUpdate) SetDocSnippetID(id int) *SnippetDocumentUpdate

SetDocSnippetID sets the "doc_snippet" edge to the Snippet entity by ID.

func (*SnippetDocumentUpdate) SetLanguage added in v1.0.8

func (sdu *SnippetDocumentUpdate) SetLanguage(s string) *SnippetDocumentUpdate

SetLanguage sets the "language" field.

func (*SnippetDocumentUpdate) SetNillableLanguage added in v1.0.8

func (sdu *SnippetDocumentUpdate) SetNillableLanguage(s *string) *SnippetDocumentUpdate

SetNillableLanguage sets the "language" field if the given value is not nil.

func (*SnippetDocumentUpdate) SetRaw added in v1.0.8

SetRaw sets the "raw" field.

func (*SnippetDocumentUpdate) SetSnippetID added in v1.0.8

func (sdu *SnippetDocumentUpdate) SetSnippetID(i int) *SnippetDocumentUpdate

SetSnippetID sets the "snippet_id" field.

func (*SnippetDocumentUpdate) SetUpdateTime added in v1.0.8

func (sdu *SnippetDocumentUpdate) SetUpdateTime(t time.Time) *SnippetDocumentUpdate

SetUpdateTime sets the "update_time" field.

func (*SnippetDocumentUpdate) Where added in v1.0.8

Where appends a list predicates to the SnippetDocumentUpdate builder.

type SnippetDocumentUpdateOne added in v1.0.8

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

SnippetDocumentUpdateOne is the builder for updating a single SnippetDocument entity.

func (*SnippetDocumentUpdateOne) ClearDocSnippet added in v1.0.8

func (sduo *SnippetDocumentUpdateOne) ClearDocSnippet() *SnippetDocumentUpdateOne

ClearDocSnippet clears the "doc_snippet" edge to the Snippet entity.

func (*SnippetDocumentUpdateOne) Exec added in v1.0.8

Exec executes the query on the entity.

func (*SnippetDocumentUpdateOne) ExecX added in v1.0.8

func (sduo *SnippetDocumentUpdateOne) ExecX(ctx context.Context)

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

func (*SnippetDocumentUpdateOne) Mutation added in v1.0.8

Mutation returns the SnippetDocumentMutation object of the builder.

func (*SnippetDocumentUpdateOne) Save added in v1.0.8

Save executes the query and returns the updated SnippetDocument entity.

func (*SnippetDocumentUpdateOne) SaveX added in v1.0.8

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

func (*SnippetDocumentUpdateOne) Select added in v1.0.8

func (sduo *SnippetDocumentUpdateOne) Select(field string, fields ...string) *SnippetDocumentUpdateOne

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

func (*SnippetDocumentUpdateOne) SetDescription added in v1.0.8

func (sduo *SnippetDocumentUpdateOne) SetDescription(s string) *SnippetDocumentUpdateOne

SetDescription sets the "description" field.

func (*SnippetDocumentUpdateOne) SetDocSnippet added in v1.0.8

SetDocSnippet sets the "doc_snippet" edge to the Snippet entity.

func (*SnippetDocumentUpdateOne) SetDocSnippetID added in v1.0.8

func (sduo *SnippetDocumentUpdateOne) SetDocSnippetID(id int) *SnippetDocumentUpdateOne

SetDocSnippetID sets the "doc_snippet" edge to the Snippet entity by ID.

func (*SnippetDocumentUpdateOne) SetLanguage added in v1.0.8

SetLanguage sets the "language" field.

func (*SnippetDocumentUpdateOne) SetNillableLanguage added in v1.0.8

func (sduo *SnippetDocumentUpdateOne) SetNillableLanguage(s *string) *SnippetDocumentUpdateOne

SetNillableLanguage sets the "language" field if the given value is not nil.

func (*SnippetDocumentUpdateOne) SetRaw added in v1.0.8

SetRaw sets the "raw" field.

func (*SnippetDocumentUpdateOne) SetSnippetID added in v1.0.8

func (sduo *SnippetDocumentUpdateOne) SetSnippetID(i int) *SnippetDocumentUpdateOne

SetSnippetID sets the "snippet_id" field.

func (*SnippetDocumentUpdateOne) SetUpdateTime added in v1.0.8

SetUpdateTime sets the "update_time" field.

type SnippetDocuments added in v1.0.8

type SnippetDocuments []*SnippetDocument

SnippetDocuments is a parsable slice of SnippetDocument.

type SnippetEdges added in v1.0.8

type SnippetEdges struct {
	// SnippetDocs holds the value of the snippet_docs edge.
	SnippetDocs []*SnippetDocument `json:"snippet_docs,omitempty"`
	// SnippetTags holds the value of the snippet_tags edge.
	SnippetTags []*SnippetTag `json:"snippet_tags,omitempty"`
	// contains filtered or unexported fields
}

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

func (SnippetEdges) SnippetDocsOrErr added in v1.0.8

func (e SnippetEdges) SnippetDocsOrErr() ([]*SnippetDocument, error)

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

func (SnippetEdges) SnippetTagsOrErr added in v1.0.9

func (e SnippetEdges) SnippetTagsOrErr() ([]*SnippetTag, error)

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

type SnippetFolder added in v1.0.8

type SnippetFolder struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// Pid holds the value of the "pid" field.
	Pid *int `json:"pid,omitempty"`
	// OwnerID holds the value of the "owner_id" field.
	OwnerID int `json:"-"`
	// SnippetID holds the value of the "snippet_id" field.
	SnippetID int `json:"-"`
	// Name holds the value of the "name" field.
	Name string `json:"name,omitempty"`
	// SnippetsTotal holds the value of the "snippets_total" field.
	SnippetsTotal int `json:"snippets_total,omitempty"`
	// Language holds the value of the "language" field.
	Language string `json:"language,omitempty"`
	// CreateTime holds the value of the "create_time" field.
	CreateTime time.Time `json:"create_time,omitempty"`
	// UpdateTime holds the value of the "update_time" field.
	UpdateTime time.Time `json:"update_time,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the SnippetFolderQuery when eager-loading is set.
	Edges SnippetFolderEdges `json:"edges"`
	// contains filtered or unexported fields
}

SnippetFolder is the model entity for the SnippetFolder schema.

func (*SnippetFolder) QuerySnippets added in v1.0.8

func (sf *SnippetFolder) QuerySnippets() *SnippetQuery

QuerySnippets queries the "snippets" edge of the SnippetFolder entity.

func (*SnippetFolder) String added in v1.0.8

func (sf *SnippetFolder) String() string

String implements the fmt.Stringer.

func (*SnippetFolder) Unwrap added in v1.0.8

func (sf *SnippetFolder) Unwrap() *SnippetFolder

Unwrap unwraps the SnippetFolder 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 (*SnippetFolder) Update added in v1.0.8

func (sf *SnippetFolder) Update() *SnippetFolderUpdateOne

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

type SnippetFolderClient added in v1.0.8

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

SnippetFolderClient is a client for the SnippetFolder schema.

func NewSnippetFolderClient added in v1.0.8

func NewSnippetFolderClient(c config) *SnippetFolderClient

NewSnippetFolderClient returns a client for the SnippetFolder from the given config.

func (*SnippetFolderClient) Create added in v1.0.8

Create returns a create builder for SnippetFolder.

func (*SnippetFolderClient) CreateBulk added in v1.0.8

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

func (*SnippetFolderClient) Delete added in v1.0.8

Delete returns a delete builder for SnippetFolder.

func (*SnippetFolderClient) DeleteOne added in v1.0.8

DeleteOne returns a delete builder for the given entity.

func (*SnippetFolderClient) DeleteOneID added in v1.0.8

func (c *SnippetFolderClient) DeleteOneID(id int) *SnippetFolderDeleteOne

DeleteOneID returns a delete builder for the given id.

func (*SnippetFolderClient) Get added in v1.0.8

Get returns a SnippetFolder entity by its id.

func (*SnippetFolderClient) GetX added in v1.0.8

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

func (*SnippetFolderClient) Hooks added in v1.0.8

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

Hooks returns the client hooks.

func (*SnippetFolderClient) Query added in v1.0.8

Query returns a query builder for SnippetFolder.

func (*SnippetFolderClient) QuerySnippets added in v1.0.8

func (c *SnippetFolderClient) QuerySnippets(sf *SnippetFolder) *SnippetQuery

QuerySnippets queries the snippets edge of a SnippetFolder.

func (*SnippetFolderClient) Update added in v1.0.8

Update returns an update builder for SnippetFolder.

func (*SnippetFolderClient) UpdateOne added in v1.0.8

UpdateOne returns an update builder for the given entity.

func (*SnippetFolderClient) UpdateOneID added in v1.0.8

func (c *SnippetFolderClient) UpdateOneID(id int) *SnippetFolderUpdateOne

UpdateOneID returns an update builder for the given id.

func (*SnippetFolderClient) Use added in v1.0.8

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

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

type SnippetFolderCreate added in v1.0.8

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

SnippetFolderCreate is the builder for creating a SnippetFolder entity.

func (*SnippetFolderCreate) AddSnippetIDs added in v1.0.8

func (sfc *SnippetFolderCreate) AddSnippetIDs(ids ...int) *SnippetFolderCreate

AddSnippetIDs adds the "snippets" edge to the Snippet entity by IDs.

func (*SnippetFolderCreate) AddSnippets added in v1.0.8

func (sfc *SnippetFolderCreate) AddSnippets(s ...*Snippet) *SnippetFolderCreate

AddSnippets adds the "snippets" edges to the Snippet entity.

func (*SnippetFolderCreate) Exec added in v1.0.8

func (sfc *SnippetFolderCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*SnippetFolderCreate) ExecX added in v1.0.8

func (sfc *SnippetFolderCreate) ExecX(ctx context.Context)

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

func (*SnippetFolderCreate) Mutation added in v1.0.8

func (sfc *SnippetFolderCreate) Mutation() *SnippetFolderMutation

Mutation returns the SnippetFolderMutation object of the builder.

func (*SnippetFolderCreate) Save added in v1.0.8

Save creates the SnippetFolder in the database.

func (*SnippetFolderCreate) SaveX added in v1.0.8

SaveX calls Save and panics if Save returns an error.

func (*SnippetFolderCreate) SetCreateTime added in v1.0.8

func (sfc *SnippetFolderCreate) SetCreateTime(t time.Time) *SnippetFolderCreate

SetCreateTime sets the "create_time" field.

func (*SnippetFolderCreate) SetID added in v1.0.8

SetID sets the "id" field.

func (*SnippetFolderCreate) SetLanguage added in v1.0.8

func (sfc *SnippetFolderCreate) SetLanguage(s string) *SnippetFolderCreate

SetLanguage sets the "language" field.

func (*SnippetFolderCreate) SetName added in v1.0.8

SetName sets the "name" field.

func (*SnippetFolderCreate) SetNillableCreateTime added in v1.0.8

func (sfc *SnippetFolderCreate) SetNillableCreateTime(t *time.Time) *SnippetFolderCreate

SetNillableCreateTime sets the "create_time" field if the given value is not nil.

func (*SnippetFolderCreate) SetNillableLanguage added in v1.0.8

func (sfc *SnippetFolderCreate) SetNillableLanguage(s *string) *SnippetFolderCreate

SetNillableLanguage sets the "language" field if the given value is not nil.

func (*SnippetFolderCreate) SetNillablePid added in v1.0.8

func (sfc *SnippetFolderCreate) SetNillablePid(i *int) *SnippetFolderCreate

SetNillablePid sets the "pid" field if the given value is not nil.

func (*SnippetFolderCreate) SetNillableSnippetsTotal added in v1.0.8

func (sfc *SnippetFolderCreate) SetNillableSnippetsTotal(i *int) *SnippetFolderCreate

SetNillableSnippetsTotal sets the "snippets_total" field if the given value is not nil.

func (*SnippetFolderCreate) SetNillableUpdateTime added in v1.0.8

func (sfc *SnippetFolderCreate) SetNillableUpdateTime(t *time.Time) *SnippetFolderCreate

SetNillableUpdateTime sets the "update_time" field if the given value is not nil.

func (*SnippetFolderCreate) SetOwnerID added in v1.0.8

func (sfc *SnippetFolderCreate) SetOwnerID(i int) *SnippetFolderCreate

SetOwnerID sets the "owner_id" field.

func (*SnippetFolderCreate) SetPid added in v1.0.8

SetPid sets the "pid" field.

func (*SnippetFolderCreate) SetSnippetID added in v1.0.8

func (sfc *SnippetFolderCreate) SetSnippetID(i int) *SnippetFolderCreate

SetSnippetID sets the "snippet_id" field.

func (*SnippetFolderCreate) SetSnippetsTotal added in v1.0.8

func (sfc *SnippetFolderCreate) SetSnippetsTotal(i int) *SnippetFolderCreate

SetSnippetsTotal sets the "snippets_total" field.

func (*SnippetFolderCreate) SetUpdateTime added in v1.0.8

func (sfc *SnippetFolderCreate) SetUpdateTime(t time.Time) *SnippetFolderCreate

SetUpdateTime sets the "update_time" field.

type SnippetFolderCreateBulk added in v1.0.8

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

SnippetFolderCreateBulk is the builder for creating many SnippetFolder entities in bulk.

func (*SnippetFolderCreateBulk) Exec added in v1.0.8

func (sfcb *SnippetFolderCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*SnippetFolderCreateBulk) ExecX added in v1.0.8

func (sfcb *SnippetFolderCreateBulk) ExecX(ctx context.Context)

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

func (*SnippetFolderCreateBulk) Save added in v1.0.8

Save creates the SnippetFolder entities in the database.

func (*SnippetFolderCreateBulk) SaveX added in v1.0.8

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

type SnippetFolderDelete added in v1.0.8

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

SnippetFolderDelete is the builder for deleting a SnippetFolder entity.

func (*SnippetFolderDelete) Exec added in v1.0.8

func (sfd *SnippetFolderDelete) Exec(ctx context.Context) (int, error)

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

func (*SnippetFolderDelete) ExecX added in v1.0.8

func (sfd *SnippetFolderDelete) ExecX(ctx context.Context) int

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

func (*SnippetFolderDelete) Where added in v1.0.8

Where appends a list predicates to the SnippetFolderDelete builder.

type SnippetFolderDeleteOne added in v1.0.8

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

SnippetFolderDeleteOne is the builder for deleting a single SnippetFolder entity.

func (*SnippetFolderDeleteOne) Exec added in v1.0.8

func (sfdo *SnippetFolderDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*SnippetFolderDeleteOne) ExecX added in v1.0.8

func (sfdo *SnippetFolderDeleteOne) ExecX(ctx context.Context)

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

type SnippetFolderEdges added in v1.0.8

type SnippetFolderEdges struct {
	// Snippets holds the value of the snippets edge.
	Snippets []*Snippet `json:"snippets,omitempty"`
	// contains filtered or unexported fields
}

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

func (SnippetFolderEdges) SnippetsOrErr added in v1.0.8

func (e SnippetFolderEdges) SnippetsOrErr() ([]*Snippet, error)

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

type SnippetFolderGroupBy added in v1.0.8

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

SnippetFolderGroupBy is the group-by builder for SnippetFolder entities.

func (*SnippetFolderGroupBy) Aggregate added in v1.0.8

func (sfgb *SnippetFolderGroupBy) Aggregate(fns ...AggregateFunc) *SnippetFolderGroupBy

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

func (*SnippetFolderGroupBy) Bool added in v1.0.8

func (sfgb *SnippetFolderGroupBy) 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 (*SnippetFolderGroupBy) BoolX added in v1.0.8

func (sfgb *SnippetFolderGroupBy) BoolX(ctx context.Context) bool

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

func (*SnippetFolderGroupBy) Bools added in v1.0.8

func (sfgb *SnippetFolderGroupBy) 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 (*SnippetFolderGroupBy) BoolsX added in v1.0.8

func (sfgb *SnippetFolderGroupBy) BoolsX(ctx context.Context) []bool

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

func (*SnippetFolderGroupBy) Float64 added in v1.0.8

func (sfgb *SnippetFolderGroupBy) 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 (*SnippetFolderGroupBy) Float64X added in v1.0.8

func (sfgb *SnippetFolderGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*SnippetFolderGroupBy) Float64s added in v1.0.8

func (sfgb *SnippetFolderGroupBy) 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 (*SnippetFolderGroupBy) Float64sX added in v1.0.8

func (sfgb *SnippetFolderGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*SnippetFolderGroupBy) Int added in v1.0.8

func (sfgb *SnippetFolderGroupBy) 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 (*SnippetFolderGroupBy) IntX added in v1.0.8

func (sfgb *SnippetFolderGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*SnippetFolderGroupBy) Ints added in v1.0.8

func (sfgb *SnippetFolderGroupBy) 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 (*SnippetFolderGroupBy) IntsX added in v1.0.8

func (sfgb *SnippetFolderGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*SnippetFolderGroupBy) Scan added in v1.0.8

func (sfgb *SnippetFolderGroupBy) Scan(ctx context.Context, v interface{}) error

Scan applies the group-by query and scans the result into the given value.

func (*SnippetFolderGroupBy) ScanX added in v1.0.8

func (sfgb *SnippetFolderGroupBy) ScanX(ctx context.Context, v interface{})

ScanX is like Scan, but panics if an error occurs.

func (*SnippetFolderGroupBy) String added in v1.0.8

func (sfgb *SnippetFolderGroupBy) 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 (*SnippetFolderGroupBy) StringX added in v1.0.8

func (sfgb *SnippetFolderGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*SnippetFolderGroupBy) Strings added in v1.0.8

func (sfgb *SnippetFolderGroupBy) 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 (*SnippetFolderGroupBy) StringsX added in v1.0.8

func (sfgb *SnippetFolderGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type SnippetFolderMutation added in v1.0.8

type SnippetFolderMutation struct {
	// contains filtered or unexported fields
}

SnippetFolderMutation represents an operation that mutates the SnippetFolder nodes in the graph.

func (*SnippetFolderMutation) AddField added in v1.0.8

func (m *SnippetFolderMutation) 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 (*SnippetFolderMutation) AddOwnerID added in v1.0.10

func (m *SnippetFolderMutation) AddOwnerID(i int)

AddOwnerID adds i to the "owner_id" field.

func (*SnippetFolderMutation) AddPid added in v1.0.8

func (m *SnippetFolderMutation) AddPid(i int)

AddPid adds i to the "pid" field.

func (*SnippetFolderMutation) AddSnippetID added in v1.0.8

func (m *SnippetFolderMutation) AddSnippetID(i int)

AddSnippetID adds i to the "snippet_id" field.

func (*SnippetFolderMutation) AddSnippetIDs added in v1.0.8

func (m *SnippetFolderMutation) AddSnippetIDs(ids ...int)

AddSnippetIDs adds the "snippets" edge to the Snippet entity by ids.

func (*SnippetFolderMutation) AddSnippetsTotal added in v1.0.8

func (m *SnippetFolderMutation) AddSnippetsTotal(i int)

AddSnippetsTotal adds i to the "snippets_total" field.

func (*SnippetFolderMutation) AddedEdges added in v1.0.8

func (m *SnippetFolderMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*SnippetFolderMutation) AddedField added in v1.0.8

func (m *SnippetFolderMutation) 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 (*SnippetFolderMutation) AddedFields added in v1.0.8

func (m *SnippetFolderMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*SnippetFolderMutation) AddedIDs added in v1.0.8

func (m *SnippetFolderMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*SnippetFolderMutation) AddedOwnerID added in v1.0.10

func (m *SnippetFolderMutation) AddedOwnerID() (r int, exists bool)

AddedOwnerID returns the value that was added to the "owner_id" field in this mutation.

func (*SnippetFolderMutation) AddedPid added in v1.0.8

func (m *SnippetFolderMutation) AddedPid() (r int, exists bool)

AddedPid returns the value that was added to the "pid" field in this mutation.

func (*SnippetFolderMutation) AddedSnippetID added in v1.0.8

func (m *SnippetFolderMutation) AddedSnippetID() (r int, exists bool)

AddedSnippetID returns the value that was added to the "snippet_id" field in this mutation.

func (*SnippetFolderMutation) AddedSnippetsTotal added in v1.0.8

func (m *SnippetFolderMutation) AddedSnippetsTotal() (r int, exists bool)

AddedSnippetsTotal returns the value that was added to the "snippets_total" field in this mutation.

func (*SnippetFolderMutation) ClearEdge added in v1.0.8

func (m *SnippetFolderMutation) 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 (*SnippetFolderMutation) ClearField added in v1.0.8

func (m *SnippetFolderMutation) 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 (*SnippetFolderMutation) ClearPid added in v1.0.8

func (m *SnippetFolderMutation) ClearPid()

ClearPid clears the value of the "pid" field.

func (*SnippetFolderMutation) ClearSnippets added in v1.0.8

func (m *SnippetFolderMutation) ClearSnippets()

ClearSnippets clears the "snippets" edge to the Snippet entity.

func (*SnippetFolderMutation) ClearedEdges added in v1.0.8

func (m *SnippetFolderMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*SnippetFolderMutation) ClearedFields added in v1.0.8

func (m *SnippetFolderMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (SnippetFolderMutation) Client added in v1.0.8

func (m SnippetFolderMutation) 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 (*SnippetFolderMutation) CreateTime added in v1.0.8

func (m *SnippetFolderMutation) CreateTime() (r time.Time, exists bool)

CreateTime returns the value of the "create_time" field in the mutation.

func (*SnippetFolderMutation) EdgeCleared added in v1.0.8

func (m *SnippetFolderMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*SnippetFolderMutation) Field added in v1.0.8

func (m *SnippetFolderMutation) 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 (*SnippetFolderMutation) FieldCleared added in v1.0.8

func (m *SnippetFolderMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*SnippetFolderMutation) Fields added in v1.0.8

func (m *SnippetFolderMutation) 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 (*SnippetFolderMutation) ID added in v1.0.8

func (m *SnippetFolderMutation) ID() (id int, exists bool)

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.

func (*SnippetFolderMutation) Language added in v1.0.8

func (m *SnippetFolderMutation) Language() (r string, exists bool)

Language returns the value of the "language" field in the mutation.

func (*SnippetFolderMutation) Name added in v1.0.8

func (m *SnippetFolderMutation) Name() (r string, exists bool)

Name returns the value of the "name" field in the mutation.

func (*SnippetFolderMutation) OldCreateTime added in v1.0.8

func (m *SnippetFolderMutation) OldCreateTime(ctx context.Context) (v time.Time, err error)

OldCreateTime returns the old "create_time" field's value of the SnippetFolder entity. If the SnippetFolder 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 (*SnippetFolderMutation) OldField added in v1.0.8

func (m *SnippetFolderMutation) 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 (*SnippetFolderMutation) OldLanguage added in v1.0.8

func (m *SnippetFolderMutation) OldLanguage(ctx context.Context) (v string, err error)

OldLanguage returns the old "language" field's value of the SnippetFolder entity. If the SnippetFolder 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 (*SnippetFolderMutation) OldName added in v1.0.8

func (m *SnippetFolderMutation) OldName(ctx context.Context) (v string, err error)

OldName returns the old "name" field's value of the SnippetFolder entity. If the SnippetFolder 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 (*SnippetFolderMutation) OldOwnerID added in v1.0.8

func (m *SnippetFolderMutation) OldOwnerID(ctx context.Context) (v int, err error)

OldOwnerID returns the old "owner_id" field's value of the SnippetFolder entity. If the SnippetFolder 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 (*SnippetFolderMutation) OldPid added in v1.0.8

func (m *SnippetFolderMutation) OldPid(ctx context.Context) (v *int, err error)

OldPid returns the old "pid" field's value of the SnippetFolder entity. If the SnippetFolder 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 (*SnippetFolderMutation) OldSnippetID added in v1.0.8

func (m *SnippetFolderMutation) OldSnippetID(ctx context.Context) (v int, err error)

OldSnippetID returns the old "snippet_id" field's value of the SnippetFolder entity. If the SnippetFolder 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 (*SnippetFolderMutation) OldSnippetsTotal added in v1.0.8

func (m *SnippetFolderMutation) OldSnippetsTotal(ctx context.Context) (v int, err error)

OldSnippetsTotal returns the old "snippets_total" field's value of the SnippetFolder entity. If the SnippetFolder 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 (*SnippetFolderMutation) OldUpdateTime added in v1.0.8

func (m *SnippetFolderMutation) OldUpdateTime(ctx context.Context) (v time.Time, err error)

OldUpdateTime returns the old "update_time" field's value of the SnippetFolder entity. If the SnippetFolder 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 (*SnippetFolderMutation) Op added in v1.0.8

func (m *SnippetFolderMutation) Op() Op

Op returns the operation name.

func (*SnippetFolderMutation) OwnerID added in v1.0.8

func (m *SnippetFolderMutation) OwnerID() (r int, exists bool)

OwnerID returns the value of the "owner_id" field in the mutation.

func (*SnippetFolderMutation) Pid added in v1.0.8

func (m *SnippetFolderMutation) Pid() (r int, exists bool)

Pid returns the value of the "pid" field in the mutation.

func (*SnippetFolderMutation) PidCleared added in v1.0.8

func (m *SnippetFolderMutation) PidCleared() bool

PidCleared returns if the "pid" field was cleared in this mutation.

func (*SnippetFolderMutation) RemoveSnippetIDs added in v1.0.8

func (m *SnippetFolderMutation) RemoveSnippetIDs(ids ...int)

RemoveSnippetIDs removes the "snippets" edge to the Snippet entity by IDs.

func (*SnippetFolderMutation) RemovedEdges added in v1.0.8

func (m *SnippetFolderMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*SnippetFolderMutation) RemovedIDs added in v1.0.8

func (m *SnippetFolderMutation) 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 (*SnippetFolderMutation) RemovedSnippetsIDs added in v1.0.8

func (m *SnippetFolderMutation) RemovedSnippetsIDs() (ids []int)

RemovedSnippets returns the removed IDs of the "snippets" edge to the Snippet entity.

func (*SnippetFolderMutation) ResetCreateTime added in v1.0.8

func (m *SnippetFolderMutation) ResetCreateTime()

ResetCreateTime resets all changes to the "create_time" field.

func (*SnippetFolderMutation) ResetEdge added in v1.0.8

func (m *SnippetFolderMutation) 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 (*SnippetFolderMutation) ResetField added in v1.0.8

func (m *SnippetFolderMutation) 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 (*SnippetFolderMutation) ResetLanguage added in v1.0.8

func (m *SnippetFolderMutation) ResetLanguage()

ResetLanguage resets all changes to the "language" field.

func (*SnippetFolderMutation) ResetName added in v1.0.8

func (m *SnippetFolderMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*SnippetFolderMutation) ResetOwnerID added in v1.0.8

func (m *SnippetFolderMutation) ResetOwnerID()

ResetOwnerID resets all changes to the "owner_id" field.

func (*SnippetFolderMutation) ResetPid added in v1.0.8

func (m *SnippetFolderMutation) ResetPid()

ResetPid resets all changes to the "pid" field.

func (*SnippetFolderMutation) ResetSnippetID added in v1.0.8

func (m *SnippetFolderMutation) ResetSnippetID()

ResetSnippetID resets all changes to the "snippet_id" field.

func (*SnippetFolderMutation) ResetSnippets added in v1.0.8

func (m *SnippetFolderMutation) ResetSnippets()

ResetSnippets resets all changes to the "snippets" edge.

func (*SnippetFolderMutation) ResetSnippetsTotal added in v1.0.8

func (m *SnippetFolderMutation) ResetSnippetsTotal()

ResetSnippetsTotal resets all changes to the "snippets_total" field.

func (*SnippetFolderMutation) ResetUpdateTime added in v1.0.8

func (m *SnippetFolderMutation) ResetUpdateTime()

ResetUpdateTime resets all changes to the "update_time" field.

func (*SnippetFolderMutation) SetCreateTime added in v1.0.8

func (m *SnippetFolderMutation) SetCreateTime(t time.Time)

SetCreateTime sets the "create_time" field.

func (*SnippetFolderMutation) SetField added in v1.0.8

func (m *SnippetFolderMutation) 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 (*SnippetFolderMutation) SetID added in v1.0.8

func (m *SnippetFolderMutation) SetID(id int)

SetID sets the value of the id field. Note that this operation is only accepted on creation of SnippetFolder entities.

func (*SnippetFolderMutation) SetLanguage added in v1.0.8

func (m *SnippetFolderMutation) SetLanguage(s string)

SetLanguage sets the "language" field.

func (*SnippetFolderMutation) SetName added in v1.0.8

func (m *SnippetFolderMutation) SetName(s string)

SetName sets the "name" field.

func (*SnippetFolderMutation) SetOwnerID added in v1.0.8

func (m *SnippetFolderMutation) SetOwnerID(i int)

SetOwnerID sets the "owner_id" field.

func (*SnippetFolderMutation) SetPid added in v1.0.8

func (m *SnippetFolderMutation) SetPid(i int)

SetPid sets the "pid" field.

func (*SnippetFolderMutation) SetSnippetID added in v1.0.8

func (m *SnippetFolderMutation) SetSnippetID(i int)

SetSnippetID sets the "snippet_id" field.

func (*SnippetFolderMutation) SetSnippetsTotal added in v1.0.8

func (m *SnippetFolderMutation) SetSnippetsTotal(i int)

SetSnippetsTotal sets the "snippets_total" field.

func (*SnippetFolderMutation) SetUpdateTime added in v1.0.8

func (m *SnippetFolderMutation) SetUpdateTime(t time.Time)

SetUpdateTime sets the "update_time" field.

func (*SnippetFolderMutation) SnippetID added in v1.0.8

func (m *SnippetFolderMutation) SnippetID() (r int, exists bool)

SnippetID returns the value of the "snippet_id" field in the mutation.

func (*SnippetFolderMutation) SnippetsCleared added in v1.0.8

func (m *SnippetFolderMutation) SnippetsCleared() bool

SnippetsCleared reports if the "snippets" edge to the Snippet entity was cleared.

func (*SnippetFolderMutation) SnippetsIDs added in v1.0.8

func (m *SnippetFolderMutation) SnippetsIDs() (ids []int)

SnippetsIDs returns the "snippets" edge IDs in the mutation.

func (*SnippetFolderMutation) SnippetsTotal added in v1.0.8

func (m *SnippetFolderMutation) SnippetsTotal() (r int, exists bool)

SnippetsTotal returns the value of the "snippets_total" field in the mutation.

func (SnippetFolderMutation) Tx added in v1.0.8

func (m SnippetFolderMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*SnippetFolderMutation) Type added in v1.0.8

func (m *SnippetFolderMutation) Type() string

Type returns the node type of this mutation (SnippetFolder).

func (*SnippetFolderMutation) UpdateTime added in v1.0.8

func (m *SnippetFolderMutation) UpdateTime() (r time.Time, exists bool)

UpdateTime returns the value of the "update_time" field in the mutation.

func (*SnippetFolderMutation) Where added in v1.0.8

Where appends a list predicates to the SnippetFolderMutation builder.

type SnippetFolderQuery added in v1.0.8

type SnippetFolderQuery struct {
	// contains filtered or unexported fields
}

SnippetFolderQuery is the builder for querying SnippetFolder entities.

func (*SnippetFolderQuery) All added in v1.0.8

All executes the query and returns a list of SnippetFolders.

func (*SnippetFolderQuery) AllX added in v1.0.8

func (sfq *SnippetFolderQuery) AllX(ctx context.Context) []*SnippetFolder

AllX is like All, but panics if an error occurs.

func (*SnippetFolderQuery) Clone added in v1.0.8

func (sfq *SnippetFolderQuery) Clone() *SnippetFolderQuery

Clone returns a duplicate of the SnippetFolderQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*SnippetFolderQuery) Count added in v1.0.8

func (sfq *SnippetFolderQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*SnippetFolderQuery) CountX added in v1.0.8

func (sfq *SnippetFolderQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*SnippetFolderQuery) Exist added in v1.0.8

func (sfq *SnippetFolderQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*SnippetFolderQuery) ExistX added in v1.0.8

func (sfq *SnippetFolderQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*SnippetFolderQuery) First added in v1.0.8

First returns the first SnippetFolder entity from the query. Returns a *NotFoundError when no SnippetFolder was found.

func (*SnippetFolderQuery) FirstID added in v1.0.8

func (sfq *SnippetFolderQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first SnippetFolder ID from the query. Returns a *NotFoundError when no SnippetFolder ID was found.

func (*SnippetFolderQuery) FirstIDX added in v1.0.8

func (sfq *SnippetFolderQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*SnippetFolderQuery) FirstX added in v1.0.8

func (sfq *SnippetFolderQuery) FirstX(ctx context.Context) *SnippetFolder

FirstX is like First, but panics if an error occurs.

func (*SnippetFolderQuery) GroupBy added in v1.0.8

func (sfq *SnippetFolderQuery) GroupBy(field string, fields ...string) *SnippetFolderGroupBy

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 {
	Pid int `json:"pid,omitempty"`
	Count int `json:"count,omitempty"`
}

client.SnippetFolder.Query().
	GroupBy(snippetfolder.FieldPid).
	Aggregate(model.Count()).
	Scan(ctx, &v)

func (*SnippetFolderQuery) IDs added in v1.0.8

func (sfq *SnippetFolderQuery) IDs(ctx context.Context) ([]int, error)

IDs executes the query and returns a list of SnippetFolder IDs.

func (*SnippetFolderQuery) IDsX added in v1.0.8

func (sfq *SnippetFolderQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*SnippetFolderQuery) Limit added in v1.0.8

func (sfq *SnippetFolderQuery) Limit(limit int) *SnippetFolderQuery

Limit adds a limit step to the query.

func (*SnippetFolderQuery) Offset added in v1.0.8

func (sfq *SnippetFolderQuery) Offset(offset int) *SnippetFolderQuery

Offset adds an offset step to the query.

func (*SnippetFolderQuery) Only added in v1.0.8

Only returns a single SnippetFolder entity found by the query, ensuring it only returns one. Returns a *NotSingularError when exactly one SnippetFolder entity is not found. Returns a *NotFoundError when no SnippetFolder entities are found.

func (*SnippetFolderQuery) OnlyID added in v1.0.8

func (sfq *SnippetFolderQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only SnippetFolder ID in the query. Returns a *NotSingularError when exactly one SnippetFolder ID is not found. Returns a *NotFoundError when no entities are found.

func (*SnippetFolderQuery) OnlyIDX added in v1.0.8

func (sfq *SnippetFolderQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*SnippetFolderQuery) OnlyX added in v1.0.8

OnlyX is like Only, but panics if an error occurs.

func (*SnippetFolderQuery) Order added in v1.0.8

Order adds an order step to the query.

func (*SnippetFolderQuery) QuerySnippets added in v1.0.8

func (sfq *SnippetFolderQuery) QuerySnippets() *SnippetQuery

QuerySnippets chains the current query on the "snippets" edge.

func (*SnippetFolderQuery) Select added in v1.0.8

func (sfq *SnippetFolderQuery) Select(fields ...string) *SnippetFolderSelect

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 {
	Pid int `json:"pid,omitempty"`
}

client.SnippetFolder.Query().
	Select(snippetfolder.FieldPid).
	Scan(ctx, &v)

func (*SnippetFolderQuery) Unique added in v1.0.8

func (sfq *SnippetFolderQuery) Unique(unique bool) *SnippetFolderQuery

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 (*SnippetFolderQuery) Where added in v1.0.8

Where adds a new predicate for the SnippetFolderQuery builder.

func (*SnippetFolderQuery) WithSnippets added in v1.0.8

func (sfq *SnippetFolderQuery) WithSnippets(opts ...func(*SnippetQuery)) *SnippetFolderQuery

WithSnippets tells the query-builder to eager-load the nodes that are connected to the "snippets" edge. The optional arguments are used to configure the query builder of the edge.

type SnippetFolderSelect added in v1.0.8

type SnippetFolderSelect struct {
	*SnippetFolderQuery
	// contains filtered or unexported fields
}

SnippetFolderSelect is the builder for selecting fields of SnippetFolder entities.

func (*SnippetFolderSelect) Bool added in v1.0.8

func (sfs *SnippetFolderSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*SnippetFolderSelect) BoolX added in v1.0.8

func (sfs *SnippetFolderSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*SnippetFolderSelect) Bools added in v1.0.8

func (sfs *SnippetFolderSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*SnippetFolderSelect) BoolsX added in v1.0.8

func (sfs *SnippetFolderSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*SnippetFolderSelect) Float64 added in v1.0.8

func (sfs *SnippetFolderSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*SnippetFolderSelect) Float64X added in v1.0.8

func (sfs *SnippetFolderSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*SnippetFolderSelect) Float64s added in v1.0.8

func (sfs *SnippetFolderSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*SnippetFolderSelect) Float64sX added in v1.0.8

func (sfs *SnippetFolderSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*SnippetFolderSelect) Int added in v1.0.8

func (sfs *SnippetFolderSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*SnippetFolderSelect) IntX added in v1.0.8

func (sfs *SnippetFolderSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*SnippetFolderSelect) Ints added in v1.0.8

func (sfs *SnippetFolderSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*SnippetFolderSelect) IntsX added in v1.0.8

func (sfs *SnippetFolderSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*SnippetFolderSelect) Scan added in v1.0.8

func (sfs *SnippetFolderSelect) Scan(ctx context.Context, v interface{}) error

Scan applies the selector query and scans the result into the given value.

func (*SnippetFolderSelect) ScanX added in v1.0.8

func (sfs *SnippetFolderSelect) ScanX(ctx context.Context, v interface{})

ScanX is like Scan, but panics if an error occurs.

func (*SnippetFolderSelect) String added in v1.0.8

func (sfs *SnippetFolderSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*SnippetFolderSelect) StringX added in v1.0.8

func (sfs *SnippetFolderSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*SnippetFolderSelect) Strings added in v1.0.8

func (sfs *SnippetFolderSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*SnippetFolderSelect) StringsX added in v1.0.8

func (sfs *SnippetFolderSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type SnippetFolderUpdate added in v1.0.8

type SnippetFolderUpdate struct {
	// contains filtered or unexported fields
}

SnippetFolderUpdate is the builder for updating SnippetFolder entities.

func (*SnippetFolderUpdate) AddPid added in v1.0.8

AddPid adds i to the "pid" field.

func (*SnippetFolderUpdate) AddSnippetIDs added in v1.0.8

func (sfu *SnippetFolderUpdate) AddSnippetIDs(ids ...int) *SnippetFolderUpdate

AddSnippetIDs adds the "snippets" edge to the Snippet entity by IDs.

func (*SnippetFolderUpdate) AddSnippets added in v1.0.8

func (sfu *SnippetFolderUpdate) AddSnippets(s ...*Snippet) *SnippetFolderUpdate

AddSnippets adds the "snippets" edges to the Snippet entity.

func (*SnippetFolderUpdate) AddSnippetsTotal added in v1.0.8

func (sfu *SnippetFolderUpdate) AddSnippetsTotal(i int) *SnippetFolderUpdate

AddSnippetsTotal adds i to the "snippets_total" field.

func (*SnippetFolderUpdate) ClearPid added in v1.0.8

func (sfu *SnippetFolderUpdate) ClearPid() *SnippetFolderUpdate

ClearPid clears the value of the "pid" field.

func (*SnippetFolderUpdate) ClearSnippets added in v1.0.8

func (sfu *SnippetFolderUpdate) ClearSnippets() *SnippetFolderUpdate

ClearSnippets clears all "snippets" edges to the Snippet entity.

func (*SnippetFolderUpdate) Exec added in v1.0.8

func (sfu *SnippetFolderUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*SnippetFolderUpdate) ExecX added in v1.0.8

func (sfu *SnippetFolderUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*SnippetFolderUpdate) Mutation added in v1.0.8

func (sfu *SnippetFolderUpdate) Mutation() *SnippetFolderMutation

Mutation returns the SnippetFolderMutation object of the builder.

func (*SnippetFolderUpdate) RemoveSnippetIDs added in v1.0.8

func (sfu *SnippetFolderUpdate) RemoveSnippetIDs(ids ...int) *SnippetFolderUpdate

RemoveSnippetIDs removes the "snippets" edge to Snippet entities by IDs.

func (*SnippetFolderUpdate) RemoveSnippets added in v1.0.8

func (sfu *SnippetFolderUpdate) RemoveSnippets(s ...*Snippet) *SnippetFolderUpdate

RemoveSnippets removes "snippets" edges to Snippet entities.

func (*SnippetFolderUpdate) Save added in v1.0.8

func (sfu *SnippetFolderUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*SnippetFolderUpdate) SaveX added in v1.0.8

func (sfu *SnippetFolderUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*SnippetFolderUpdate) SetLanguage added in v1.0.8

func (sfu *SnippetFolderUpdate) SetLanguage(s string) *SnippetFolderUpdate

SetLanguage sets the "language" field.

func (*SnippetFolderUpdate) SetName added in v1.0.8

SetName sets the "name" field.

func (*SnippetFolderUpdate) SetNillableLanguage added in v1.0.8

func (sfu *SnippetFolderUpdate) SetNillableLanguage(s *string) *SnippetFolderUpdate

SetNillableLanguage sets the "language" field if the given value is not nil.

func (*SnippetFolderUpdate) SetNillablePid added in v1.0.8

func (sfu *SnippetFolderUpdate) SetNillablePid(i *int) *SnippetFolderUpdate

SetNillablePid sets the "pid" field if the given value is not nil.

func (*SnippetFolderUpdate) SetNillableSnippetsTotal added in v1.0.8

func (sfu *SnippetFolderUpdate) SetNillableSnippetsTotal(i *int) *SnippetFolderUpdate

SetNillableSnippetsTotal sets the "snippets_total" field if the given value is not nil.

func (*SnippetFolderUpdate) SetPid added in v1.0.8

SetPid sets the "pid" field.

func (*SnippetFolderUpdate) SetSnippetsTotal added in v1.0.8

func (sfu *SnippetFolderUpdate) SetSnippetsTotal(i int) *SnippetFolderUpdate

SetSnippetsTotal sets the "snippets_total" field.

func (*SnippetFolderUpdate) SetUpdateTime added in v1.0.8

func (sfu *SnippetFolderUpdate) SetUpdateTime(t time.Time) *SnippetFolderUpdate

SetUpdateTime sets the "update_time" field.

func (*SnippetFolderUpdate) Where added in v1.0.8

Where appends a list predicates to the SnippetFolderUpdate builder.

type SnippetFolderUpdateOne added in v1.0.8

type SnippetFolderUpdateOne struct {
	// contains filtered or unexported fields
}

SnippetFolderUpdateOne is the builder for updating a single SnippetFolder entity.

func (*SnippetFolderUpdateOne) AddPid added in v1.0.8

AddPid adds i to the "pid" field.

func (*SnippetFolderUpdateOne) AddSnippetIDs added in v1.0.8

func (sfuo *SnippetFolderUpdateOne) AddSnippetIDs(ids ...int) *SnippetFolderUpdateOne

AddSnippetIDs adds the "snippets" edge to the Snippet entity by IDs.

func (*SnippetFolderUpdateOne) AddSnippets added in v1.0.8

func (sfuo *SnippetFolderUpdateOne) AddSnippets(s ...*Snippet) *SnippetFolderUpdateOne

AddSnippets adds the "snippets" edges to the Snippet entity.

func (*SnippetFolderUpdateOne) AddSnippetsTotal added in v1.0.8

func (sfuo *SnippetFolderUpdateOne) AddSnippetsTotal(i int) *SnippetFolderUpdateOne

AddSnippetsTotal adds i to the "snippets_total" field.

func (*SnippetFolderUpdateOne) ClearPid added in v1.0.8

ClearPid clears the value of the "pid" field.

func (*SnippetFolderUpdateOne) ClearSnippets added in v1.0.8

func (sfuo *SnippetFolderUpdateOne) ClearSnippets() *SnippetFolderUpdateOne

ClearSnippets clears all "snippets" edges to the Snippet entity.

func (*SnippetFolderUpdateOne) Exec added in v1.0.8

func (sfuo *SnippetFolderUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*SnippetFolderUpdateOne) ExecX added in v1.0.8

func (sfuo *SnippetFolderUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*SnippetFolderUpdateOne) Mutation added in v1.0.8

Mutation returns the SnippetFolderMutation object of the builder.

func (*SnippetFolderUpdateOne) RemoveSnippetIDs added in v1.0.8

func (sfuo *SnippetFolderUpdateOne) RemoveSnippetIDs(ids ...int) *SnippetFolderUpdateOne

RemoveSnippetIDs removes the "snippets" edge to Snippet entities by IDs.

func (*SnippetFolderUpdateOne) RemoveSnippets added in v1.0.8

func (sfuo *SnippetFolderUpdateOne) RemoveSnippets(s ...*Snippet) *SnippetFolderUpdateOne

RemoveSnippets removes "snippets" edges to Snippet entities.

func (*SnippetFolderUpdateOne) Save added in v1.0.8

Save executes the query and returns the updated SnippetFolder entity.

func (*SnippetFolderUpdateOne) SaveX added in v1.0.8

SaveX is like Save, but panics if an error occurs.

func (*SnippetFolderUpdateOne) Select added in v1.0.8

func (sfuo *SnippetFolderUpdateOne) Select(field string, fields ...string) *SnippetFolderUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*SnippetFolderUpdateOne) SetLanguage added in v1.0.8

SetLanguage sets the "language" field.

func (*SnippetFolderUpdateOne) SetName added in v1.0.8

SetName sets the "name" field.

func (*SnippetFolderUpdateOne) SetNillableLanguage added in v1.0.8

func (sfuo *SnippetFolderUpdateOne) SetNillableLanguage(s *string) *SnippetFolderUpdateOne

SetNillableLanguage sets the "language" field if the given value is not nil.

func (*SnippetFolderUpdateOne) SetNillablePid added in v1.0.8

func (sfuo *SnippetFolderUpdateOne) SetNillablePid(i *int) *SnippetFolderUpdateOne

SetNillablePid sets the "pid" field if the given value is not nil.

func (*SnippetFolderUpdateOne) SetNillableSnippetsTotal added in v1.0.8

func (sfuo *SnippetFolderUpdateOne) SetNillableSnippetsTotal(i *int) *SnippetFolderUpdateOne

SetNillableSnippetsTotal sets the "snippets_total" field if the given value is not nil.

func (*SnippetFolderUpdateOne) SetPid added in v1.0.8

SetPid sets the "pid" field.

func (*SnippetFolderUpdateOne) SetSnippetsTotal added in v1.0.8

func (sfuo *SnippetFolderUpdateOne) SetSnippetsTotal(i int) *SnippetFolderUpdateOne

SetSnippetsTotal sets the "snippets_total" field.

func (*SnippetFolderUpdateOne) SetUpdateTime added in v1.0.8

func (sfuo *SnippetFolderUpdateOne) SetUpdateTime(t time.Time) *SnippetFolderUpdateOne

SetUpdateTime sets the "update_time" field.

type SnippetFolders added in v1.0.8

type SnippetFolders []*SnippetFolder

SnippetFolders is a parsable slice of SnippetFolder.

type SnippetGroupBy added in v1.0.8

type SnippetGroupBy struct {
	// contains filtered or unexported fields
}

SnippetGroupBy is the group-by builder for Snippet entities.

func (*SnippetGroupBy) Aggregate added in v1.0.8

func (sgb *SnippetGroupBy) Aggregate(fns ...AggregateFunc) *SnippetGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*SnippetGroupBy) Bool added in v1.0.8

func (sgb *SnippetGroupBy) 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 (*SnippetGroupBy) BoolX added in v1.0.8

func (sgb *SnippetGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*SnippetGroupBy) Bools added in v1.0.8

func (sgb *SnippetGroupBy) 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 (*SnippetGroupBy) BoolsX added in v1.0.8

func (sgb *SnippetGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*SnippetGroupBy) Float64 added in v1.0.8

func (sgb *SnippetGroupBy) 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 (*SnippetGroupBy) Float64X added in v1.0.8

func (sgb *SnippetGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*SnippetGroupBy) Float64s added in v1.0.8

func (sgb *SnippetGroupBy) 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 (*SnippetGroupBy) Float64sX added in v1.0.8

func (sgb *SnippetGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*SnippetGroupBy) Int added in v1.0.8

func (sgb *SnippetGroupBy) 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 (*SnippetGroupBy) IntX added in v1.0.8

func (sgb *SnippetGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*SnippetGroupBy) Ints added in v1.0.8

func (sgb *SnippetGroupBy) 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 (*SnippetGroupBy) IntsX added in v1.0.8

func (sgb *SnippetGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*SnippetGroupBy) Scan added in v1.0.8

func (sgb *SnippetGroupBy) Scan(ctx context.Context, v interface{}) error

Scan applies the group-by query and scans the result into the given value.

func (*SnippetGroupBy) ScanX added in v1.0.8

func (sgb *SnippetGroupBy) ScanX(ctx context.Context, v interface{})

ScanX is like Scan, but panics if an error occurs.

func (*SnippetGroupBy) String added in v1.0.8

func (sgb *SnippetGroupBy) 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 (*SnippetGroupBy) StringX added in v1.0.8

func (sgb *SnippetGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*SnippetGroupBy) Strings added in v1.0.8

func (sgb *SnippetGroupBy) 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 (*SnippetGroupBy) StringsX added in v1.0.8

func (sgb *SnippetGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type SnippetMutation added in v1.0.8

type SnippetMutation struct {
	// contains filtered or unexported fields
}

SnippetMutation represents an operation that mutates the Snippet nodes in the graph.

func (*SnippetMutation) AddField added in v1.0.8

func (m *SnippetMutation) 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 (*SnippetMutation) AddFolderID added in v1.0.8

func (m *SnippetMutation) AddFolderID(i int)

AddFolderID adds i to the "folder_id" field.

func (*SnippetMutation) AddOwnerID added in v1.0.10

func (m *SnippetMutation) AddOwnerID(i int)

AddOwnerID adds i to the "owner_id" field.

func (*SnippetMutation) AddSnippetDocIDs added in v1.0.8

func (m *SnippetMutation) AddSnippetDocIDs(ids ...int)

AddSnippetDocIDs adds the "snippet_docs" edge to the SnippetDocument entity by ids.

func (*SnippetMutation) AddSnippetTagIDs added in v1.0.9

func (m *SnippetMutation) AddSnippetTagIDs(ids ...int)

AddSnippetTagIDs adds the "snippet_tags" edge to the SnippetTag entity by ids.

func (*SnippetMutation) AddedEdges added in v1.0.8

func (m *SnippetMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*SnippetMutation) AddedField added in v1.0.8

func (m *SnippetMutation) 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 (*SnippetMutation) AddedFields added in v1.0.8

func (m *SnippetMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*SnippetMutation) AddedFolderID added in v1.0.8

func (m *SnippetMutation) AddedFolderID() (r int, exists bool)

AddedFolderID returns the value that was added to the "folder_id" field in this mutation.

func (*SnippetMutation) AddedIDs added in v1.0.8

func (m *SnippetMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*SnippetMutation) AddedOwnerID added in v1.0.10

func (m *SnippetMutation) AddedOwnerID() (r int, exists bool)

AddedOwnerID returns the value that was added to the "owner_id" field in this mutation.

func (*SnippetMutation) ClearEdge added in v1.0.8

func (m *SnippetMutation) 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 (*SnippetMutation) ClearField added in v1.0.8

func (m *SnippetMutation) 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 (*SnippetMutation) ClearFolderID added in v1.0.8

func (m *SnippetMutation) ClearFolderID()

ClearFolderID clears the value of the "folder_id" field.

func (*SnippetMutation) ClearSnippetDocs added in v1.0.8

func (m *SnippetMutation) ClearSnippetDocs()

ClearSnippetDocs clears the "snippet_docs" edge to the SnippetDocument entity.

func (*SnippetMutation) ClearSnippetTags added in v1.0.9

func (m *SnippetMutation) ClearSnippetTags()

ClearSnippetTags clears the "snippet_tags" edge to the SnippetTag entity.

func (*SnippetMutation) ClearTitle added in v1.0.8

func (m *SnippetMutation) ClearTitle()

ClearTitle clears the value of the "title" field.

func (*SnippetMutation) ClearedEdges added in v1.0.8

func (m *SnippetMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*SnippetMutation) ClearedFields added in v1.0.8

func (m *SnippetMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (SnippetMutation) Client added in v1.0.8

func (m SnippetMutation) 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 (*SnippetMutation) CreateTime added in v1.0.8

func (m *SnippetMutation) CreateTime() (r time.Time, exists bool)

CreateTime returns the value of the "create_time" field in the mutation.

func (*SnippetMutation) EdgeCleared added in v1.0.8

func (m *SnippetMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*SnippetMutation) Field added in v1.0.8

func (m *SnippetMutation) 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 (*SnippetMutation) FieldCleared added in v1.0.8

func (m *SnippetMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*SnippetMutation) Fields added in v1.0.8

func (m *SnippetMutation) 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 (*SnippetMutation) FolderID added in v1.0.8

func (m *SnippetMutation) FolderID() (r int, exists bool)

FolderID returns the value of the "folder_id" field in the mutation.

func (*SnippetMutation) FolderIDCleared added in v1.0.8

func (m *SnippetMutation) FolderIDCleared() bool

FolderIDCleared returns if the "folder_id" field was cleared in this mutation.

func (*SnippetMutation) ID added in v1.0.8

func (m *SnippetMutation) ID() (id int, exists bool)

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.

func (*SnippetMutation) OldCreateTime added in v1.0.8

func (m *SnippetMutation) OldCreateTime(ctx context.Context) (v time.Time, err error)

OldCreateTime returns the old "create_time" field's value of the Snippet entity. If the Snippet 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 (*SnippetMutation) OldField added in v1.0.8

func (m *SnippetMutation) 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 (*SnippetMutation) OldFolderID added in v1.0.8

func (m *SnippetMutation) OldFolderID(ctx context.Context) (v *int, err error)

OldFolderID returns the old "folder_id" field's value of the Snippet entity. If the Snippet 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 (*SnippetMutation) OldOwnerID added in v1.0.8

func (m *SnippetMutation) OldOwnerID(ctx context.Context) (v int, err error)

OldOwnerID returns the old "owner_id" field's value of the Snippet entity. If the Snippet 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 (*SnippetMutation) OldSn added in v1.0.8

func (m *SnippetMutation) OldSn(ctx context.Context) (v string, err error)

OldSn returns the old "sn" field's value of the Snippet entity. If the Snippet 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 (*SnippetMutation) OldTitle added in v1.0.8

func (m *SnippetMutation) OldTitle(ctx context.Context) (v *string, err error)

OldTitle returns the old "title" field's value of the Snippet entity. If the Snippet 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 (*SnippetMutation) OldUpdateTime added in v1.0.8

func (m *SnippetMutation) OldUpdateTime(ctx context.Context) (v time.Time, err error)

OldUpdateTime returns the old "update_time" field's value of the Snippet entity. If the Snippet 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 (*SnippetMutation) Op added in v1.0.8

func (m *SnippetMutation) Op() Op

Op returns the operation name.

func (*SnippetMutation) OwnerID added in v1.0.8

func (m *SnippetMutation) OwnerID() (r int, exists bool)

OwnerID returns the value of the "owner_id" field in the mutation.

func (*SnippetMutation) RemoveSnippetDocIDs added in v1.0.8

func (m *SnippetMutation) RemoveSnippetDocIDs(ids ...int)

RemoveSnippetDocIDs removes the "snippet_docs" edge to the SnippetDocument entity by IDs.

func (*SnippetMutation) RemoveSnippetTagIDs added in v1.0.9

func (m *SnippetMutation) RemoveSnippetTagIDs(ids ...int)

RemoveSnippetTagIDs removes the "snippet_tags" edge to the SnippetTag entity by IDs.

func (*SnippetMutation) RemovedEdges added in v1.0.8

func (m *SnippetMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*SnippetMutation) RemovedIDs added in v1.0.8

func (m *SnippetMutation) 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 (*SnippetMutation) RemovedSnippetDocsIDs added in v1.0.8

func (m *SnippetMutation) RemovedSnippetDocsIDs() (ids []int)

RemovedSnippetDocs returns the removed IDs of the "snippet_docs" edge to the SnippetDocument entity.

func (*SnippetMutation) RemovedSnippetTagsIDs added in v1.0.9

func (m *SnippetMutation) RemovedSnippetTagsIDs() (ids []int)

RemovedSnippetTags returns the removed IDs of the "snippet_tags" edge to the SnippetTag entity.

func (*SnippetMutation) ResetCreateTime added in v1.0.8

func (m *SnippetMutation) ResetCreateTime()

ResetCreateTime resets all changes to the "create_time" field.

func (*SnippetMutation) ResetEdge added in v1.0.8

func (m *SnippetMutation) 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 (*SnippetMutation) ResetField added in v1.0.8

func (m *SnippetMutation) 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 (*SnippetMutation) ResetFolderID added in v1.0.8

func (m *SnippetMutation) ResetFolderID()

ResetFolderID resets all changes to the "folder_id" field.

func (*SnippetMutation) ResetOwnerID added in v1.0.8

func (m *SnippetMutation) ResetOwnerID()

ResetOwnerID resets all changes to the "owner_id" field.

func (*SnippetMutation) ResetSn added in v1.0.8

func (m *SnippetMutation) ResetSn()

ResetSn resets all changes to the "sn" field.

func (*SnippetMutation) ResetSnippetDocs added in v1.0.8

func (m *SnippetMutation) ResetSnippetDocs()

ResetSnippetDocs resets all changes to the "snippet_docs" edge.

func (*SnippetMutation) ResetSnippetTags added in v1.0.9

func (m *SnippetMutation) ResetSnippetTags()

ResetSnippetTags resets all changes to the "snippet_tags" edge.

func (*SnippetMutation) ResetTitle added in v1.0.8

func (m *SnippetMutation) ResetTitle()

ResetTitle resets all changes to the "title" field.

func (*SnippetMutation) ResetUpdateTime added in v1.0.8

func (m *SnippetMutation) ResetUpdateTime()

ResetUpdateTime resets all changes to the "update_time" field.

func (*SnippetMutation) SetCreateTime added in v1.0.8

func (m *SnippetMutation) SetCreateTime(t time.Time)

SetCreateTime sets the "create_time" field.

func (*SnippetMutation) SetField added in v1.0.8

func (m *SnippetMutation) 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 (*SnippetMutation) SetFolderID added in v1.0.8

func (m *SnippetMutation) SetFolderID(i int)

SetFolderID sets the "folder_id" field.

func (*SnippetMutation) SetID added in v1.0.8

func (m *SnippetMutation) SetID(id int)

SetID sets the value of the id field. Note that this operation is only accepted on creation of Snippet entities.

func (*SnippetMutation) SetOwnerID added in v1.0.8

func (m *SnippetMutation) SetOwnerID(i int)

SetOwnerID sets the "owner_id" field.

func (*SnippetMutation) SetSn added in v1.0.8

func (m *SnippetMutation) SetSn(s string)

SetSn sets the "sn" field.

func (*SnippetMutation) SetTitle added in v1.0.8

func (m *SnippetMutation) SetTitle(s string)

SetTitle sets the "title" field.

func (*SnippetMutation) SetUpdateTime added in v1.0.8

func (m *SnippetMutation) SetUpdateTime(t time.Time)

SetUpdateTime sets the "update_time" field.

func (*SnippetMutation) Sn added in v1.0.8

func (m *SnippetMutation) Sn() (r string, exists bool)

Sn returns the value of the "sn" field in the mutation.

func (*SnippetMutation) SnippetDocsCleared added in v1.0.8

func (m *SnippetMutation) SnippetDocsCleared() bool

SnippetDocsCleared reports if the "snippet_docs" edge to the SnippetDocument entity was cleared.

func (*SnippetMutation) SnippetDocsIDs added in v1.0.8

func (m *SnippetMutation) SnippetDocsIDs() (ids []int)

SnippetDocsIDs returns the "snippet_docs" edge IDs in the mutation.

func (*SnippetMutation) SnippetTagsCleared added in v1.0.9

func (m *SnippetMutation) SnippetTagsCleared() bool

SnippetTagsCleared reports if the "snippet_tags" edge to the SnippetTag entity was cleared.

func (*SnippetMutation) SnippetTagsIDs added in v1.0.9

func (m *SnippetMutation) SnippetTagsIDs() (ids []int)

SnippetTagsIDs returns the "snippet_tags" edge IDs in the mutation.

func (*SnippetMutation) Title added in v1.0.8

func (m *SnippetMutation) Title() (r string, exists bool)

Title returns the value of the "title" field in the mutation.

func (*SnippetMutation) TitleCleared added in v1.0.8

func (m *SnippetMutation) TitleCleared() bool

TitleCleared returns if the "title" field was cleared in this mutation.

func (SnippetMutation) Tx added in v1.0.8

func (m SnippetMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*SnippetMutation) Type added in v1.0.8

func (m *SnippetMutation) Type() string

Type returns the node type of this mutation (Snippet).

func (*SnippetMutation) UpdateTime added in v1.0.8

func (m *SnippetMutation) UpdateTime() (r time.Time, exists bool)

UpdateTime returns the value of the "update_time" field in the mutation.

func (*SnippetMutation) Where added in v1.0.8

func (m *SnippetMutation) Where(ps ...predicate.Snippet)

Where appends a list predicates to the SnippetMutation builder.

type SnippetQuery added in v1.0.8

type SnippetQuery struct {
	// contains filtered or unexported fields
}

SnippetQuery is the builder for querying Snippet entities.

func (*SnippetQuery) All added in v1.0.8

func (sq *SnippetQuery) All(ctx context.Context) ([]*Snippet, error)

All executes the query and returns a list of Snippets.

func (*SnippetQuery) AllX added in v1.0.8

func (sq *SnippetQuery) AllX(ctx context.Context) []*Snippet

AllX is like All, but panics if an error occurs.

func (*SnippetQuery) Clone added in v1.0.8

func (sq *SnippetQuery) Clone() *SnippetQuery

Clone returns a duplicate of the SnippetQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*SnippetQuery) Count added in v1.0.8

func (sq *SnippetQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*SnippetQuery) CountX added in v1.0.8

func (sq *SnippetQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*SnippetQuery) Exist added in v1.0.8

func (sq *SnippetQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*SnippetQuery) ExistX added in v1.0.8

func (sq *SnippetQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*SnippetQuery) First added in v1.0.8

func (sq *SnippetQuery) First(ctx context.Context) (*Snippet, error)

First returns the first Snippet entity from the query. Returns a *NotFoundError when no Snippet was found.

func (*SnippetQuery) FirstID added in v1.0.8

func (sq *SnippetQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first Snippet ID from the query. Returns a *NotFoundError when no Snippet ID was found.

func (*SnippetQuery) FirstIDX added in v1.0.8

func (sq *SnippetQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*SnippetQuery) FirstX added in v1.0.8

func (sq *SnippetQuery) FirstX(ctx context.Context) *Snippet

FirstX is like First, but panics if an error occurs.

func (*SnippetQuery) GroupBy added in v1.0.8

func (sq *SnippetQuery) GroupBy(field string, fields ...string) *SnippetGroupBy

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 {
	Sn string `json:"-"`
	Count int `json:"count,omitempty"`
}

client.Snippet.Query().
	GroupBy(snippet.FieldSn).
	Aggregate(model.Count()).
	Scan(ctx, &v)

func (*SnippetQuery) IDs added in v1.0.8

func (sq *SnippetQuery) IDs(ctx context.Context) ([]int, error)

IDs executes the query and returns a list of Snippet IDs.

func (*SnippetQuery) IDsX added in v1.0.8

func (sq *SnippetQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*SnippetQuery) Limit added in v1.0.8

func (sq *SnippetQuery) Limit(limit int) *SnippetQuery

Limit adds a limit step to the query.

func (*SnippetQuery) Offset added in v1.0.8

func (sq *SnippetQuery) Offset(offset int) *SnippetQuery

Offset adds an offset step to the query.

func (*SnippetQuery) Only added in v1.0.8

func (sq *SnippetQuery) Only(ctx context.Context) (*Snippet, error)

Only returns a single Snippet entity found by the query, ensuring it only returns one. Returns a *NotSingularError when exactly one Snippet entity is not found. Returns a *NotFoundError when no Snippet entities are found.

func (*SnippetQuery) OnlyID added in v1.0.8

func (sq *SnippetQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only Snippet ID in the query. Returns a *NotSingularError when exactly one Snippet ID is not found. Returns a *NotFoundError when no entities are found.

func (*SnippetQuery) OnlyIDX added in v1.0.8

func (sq *SnippetQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*SnippetQuery) OnlyX added in v1.0.8

func (sq *SnippetQuery) OnlyX(ctx context.Context) *Snippet

OnlyX is like Only, but panics if an error occurs.

func (*SnippetQuery) Order added in v1.0.8

func (sq *SnippetQuery) Order(o ...OrderFunc) *SnippetQuery

Order adds an order step to the query.

func (*SnippetQuery) QuerySnippetDocs added in v1.0.8

func (sq *SnippetQuery) QuerySnippetDocs() *SnippetDocumentQuery

QuerySnippetDocs chains the current query on the "snippet_docs" edge.

func (*SnippetQuery) QuerySnippetTags added in v1.0.9

func (sq *SnippetQuery) QuerySnippetTags() *SnippetTagQuery

QuerySnippetTags chains the current query on the "snippet_tags" edge.

func (*SnippetQuery) Select added in v1.0.8

func (sq *SnippetQuery) Select(fields ...string) *SnippetSelect

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 {
	Sn string `json:"-"`
}

client.Snippet.Query().
	Select(snippet.FieldSn).
	Scan(ctx, &v)

func (*SnippetQuery) Unique added in v1.0.8

func (sq *SnippetQuery) Unique(unique bool) *SnippetQuery

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 (*SnippetQuery) Where added in v1.0.8

func (sq *SnippetQuery) Where(ps ...predicate.Snippet) *SnippetQuery

Where adds a new predicate for the SnippetQuery builder.

func (*SnippetQuery) WithSnippetDocs added in v1.0.8

func (sq *SnippetQuery) WithSnippetDocs(opts ...func(*SnippetDocumentQuery)) *SnippetQuery

WithSnippetDocs tells the query-builder to eager-load the nodes that are connected to the "snippet_docs" edge. The optional arguments are used to configure the query builder of the edge.

func (*SnippetQuery) WithSnippetTags added in v1.0.9

func (sq *SnippetQuery) WithSnippetTags(opts ...func(*SnippetTagQuery)) *SnippetQuery

WithSnippetTags tells the query-builder to eager-load the nodes that are connected to the "snippet_tags" edge. The optional arguments are used to configure the query builder of the edge.

type SnippetSelect added in v1.0.8

type SnippetSelect struct {
	*SnippetQuery
	// contains filtered or unexported fields
}

SnippetSelect is the builder for selecting fields of Snippet entities.

func (*SnippetSelect) Bool added in v1.0.8

func (ss *SnippetSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*SnippetSelect) BoolX added in v1.0.8

func (ss *SnippetSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*SnippetSelect) Bools added in v1.0.8

func (ss *SnippetSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*SnippetSelect) BoolsX added in v1.0.8

func (ss *SnippetSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*SnippetSelect) Float64 added in v1.0.8

func (ss *SnippetSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*SnippetSelect) Float64X added in v1.0.8

func (ss *SnippetSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*SnippetSelect) Float64s added in v1.0.8

func (ss *SnippetSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*SnippetSelect) Float64sX added in v1.0.8

func (ss *SnippetSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*SnippetSelect) Int added in v1.0.8

func (ss *SnippetSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*SnippetSelect) IntX added in v1.0.8

func (ss *SnippetSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*SnippetSelect) Ints added in v1.0.8

func (ss *SnippetSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*SnippetSelect) IntsX added in v1.0.8

func (ss *SnippetSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*SnippetSelect) Scan added in v1.0.8

func (ss *SnippetSelect) Scan(ctx context.Context, v interface{}) error

Scan applies the selector query and scans the result into the given value.

func (*SnippetSelect) ScanX added in v1.0.8

func (ss *SnippetSelect) ScanX(ctx context.Context, v interface{})

ScanX is like Scan, but panics if an error occurs.

func (*SnippetSelect) String added in v1.0.8

func (ss *SnippetSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*SnippetSelect) StringX added in v1.0.8

func (ss *SnippetSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*SnippetSelect) Strings added in v1.0.8

func (ss *SnippetSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*SnippetSelect) StringsX added in v1.0.8

func (ss *SnippetSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type SnippetTag added in v1.0.8

type SnippetTag struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// SnippetID holds the value of the "snippet_id" field.
	SnippetID int `json:"-"`
	// OwnerID holds the value of the "owner_id" field.
	OwnerID int `json:"-"`
	// Name holds the value of the "name" field.
	Name string `json:"name,omitempty"`
	// SnippetsTotal holds the value of the "snippets_total" field.
	SnippetsTotal int `json:"snippets_total,omitempty"`
	// CreateTime holds the value of the "create_time" field.
	CreateTime time.Time `json:"create_time,omitempty"`
	// UpdateTime holds the value of the "update_time" field.
	UpdateTime time.Time `json:"update_time,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the SnippetTagQuery when eager-loading is set.
	Edges SnippetTagEdges `json:"edges"`
	// contains filtered or unexported fields
}

SnippetTag is the model entity for the SnippetTag schema.

func (*SnippetTag) QueryTagSnippet added in v1.0.9

func (st *SnippetTag) QueryTagSnippet() *SnippetQuery

QueryTagSnippet queries the "tag_snippet" edge of the SnippetTag entity.

func (*SnippetTag) String added in v1.0.8

func (st *SnippetTag) String() string

String implements the fmt.Stringer.

func (*SnippetTag) Unwrap added in v1.0.8

func (st *SnippetTag) Unwrap() *SnippetTag

Unwrap unwraps the SnippetTag 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 (*SnippetTag) Update added in v1.0.8

func (st *SnippetTag) Update() *SnippetTagUpdateOne

Update returns a builder for updating this SnippetTag. Note that you need to call SnippetTag.Unwrap() before calling this method if this SnippetTag was returned from a transaction, and the transaction was committed or rolled back.

type SnippetTagClient added in v1.0.8

type SnippetTagClient struct {
	// contains filtered or unexported fields
}

SnippetTagClient is a client for the SnippetTag schema.

func NewSnippetTagClient added in v1.0.8

func NewSnippetTagClient(c config) *SnippetTagClient

NewSnippetTagClient returns a client for the SnippetTag from the given config.

func (*SnippetTagClient) Create added in v1.0.8

func (c *SnippetTagClient) Create() *SnippetTagCreate

Create returns a create builder for SnippetTag.

func (*SnippetTagClient) CreateBulk added in v1.0.8

func (c *SnippetTagClient) CreateBulk(builders ...*SnippetTagCreate) *SnippetTagCreateBulk

CreateBulk returns a builder for creating a bulk of SnippetTag entities.

func (*SnippetTagClient) Delete added in v1.0.8

func (c *SnippetTagClient) Delete() *SnippetTagDelete

Delete returns a delete builder for SnippetTag.

func (*SnippetTagClient) DeleteOne added in v1.0.8

func (c *SnippetTagClient) DeleteOne(st *SnippetTag) *SnippetTagDeleteOne

DeleteOne returns a delete builder for the given entity.

func (*SnippetTagClient) DeleteOneID added in v1.0.8

func (c *SnippetTagClient) DeleteOneID(id int) *SnippetTagDeleteOne

DeleteOneID returns a delete builder for the given id.

func (*SnippetTagClient) Get added in v1.0.8

func (c *SnippetTagClient) Get(ctx context.Context, id int) (*SnippetTag, error)

Get returns a SnippetTag entity by its id.

func (*SnippetTagClient) GetX added in v1.0.8

func (c *SnippetTagClient) GetX(ctx context.Context, id int) *SnippetTag

GetX is like Get, but panics if an error occurs.

func (*SnippetTagClient) Hooks added in v1.0.8

func (c *SnippetTagClient) Hooks() []Hook

Hooks returns the client hooks.

func (*SnippetTagClient) Query added in v1.0.8

func (c *SnippetTagClient) Query() *SnippetTagQuery

Query returns a query builder for SnippetTag.

func (*SnippetTagClient) QueryTagSnippet added in v1.0.9

func (c *SnippetTagClient) QueryTagSnippet(st *SnippetTag) *SnippetQuery

QueryTagSnippet queries the tag_snippet edge of a SnippetTag.

func (*SnippetTagClient) Update added in v1.0.8

func (c *SnippetTagClient) Update() *SnippetTagUpdate

Update returns an update builder for SnippetTag.

func (*SnippetTagClient) UpdateOne added in v1.0.8

func (c *SnippetTagClient) UpdateOne(st *SnippetTag) *SnippetTagUpdateOne

UpdateOne returns an update builder for the given entity.

func (*SnippetTagClient) UpdateOneID added in v1.0.8

func (c *SnippetTagClient) UpdateOneID(id int) *SnippetTagUpdateOne

UpdateOneID returns an update builder for the given id.

func (*SnippetTagClient) Use added in v1.0.8

func (c *SnippetTagClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `snippettag.Hooks(f(g(h())))`.

type SnippetTagCreate added in v1.0.8

type SnippetTagCreate struct {
	// contains filtered or unexported fields
}

SnippetTagCreate is the builder for creating a SnippetTag entity.

func (*SnippetTagCreate) Exec added in v1.0.8

func (stc *SnippetTagCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*SnippetTagCreate) ExecX added in v1.0.8

func (stc *SnippetTagCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*SnippetTagCreate) Mutation added in v1.0.8

func (stc *SnippetTagCreate) Mutation() *SnippetTagMutation

Mutation returns the SnippetTagMutation object of the builder.

func (*SnippetTagCreate) Save added in v1.0.8

func (stc *SnippetTagCreate) Save(ctx context.Context) (*SnippetTag, error)

Save creates the SnippetTag in the database.

func (*SnippetTagCreate) SaveX added in v1.0.8

func (stc *SnippetTagCreate) SaveX(ctx context.Context) *SnippetTag

SaveX calls Save and panics if Save returns an error.

func (*SnippetTagCreate) SetCreateTime added in v1.0.8

func (stc *SnippetTagCreate) SetCreateTime(t time.Time) *SnippetTagCreate

SetCreateTime sets the "create_time" field.

func (*SnippetTagCreate) SetID added in v1.0.8

func (stc *SnippetTagCreate) SetID(i int) *SnippetTagCreate

SetID sets the "id" field.

func (*SnippetTagCreate) SetName added in v1.0.8

func (stc *SnippetTagCreate) SetName(s string) *SnippetTagCreate

SetName sets the "name" field.

func (*SnippetTagCreate) SetNillableCreateTime added in v1.0.8

func (stc *SnippetTagCreate) SetNillableCreateTime(t *time.Time) *SnippetTagCreate

SetNillableCreateTime sets the "create_time" field if the given value is not nil.

func (*SnippetTagCreate) SetNillableSnippetsTotal added in v1.0.8

func (stc *SnippetTagCreate) SetNillableSnippetsTotal(i *int) *SnippetTagCreate

SetNillableSnippetsTotal sets the "snippets_total" field if the given value is not nil.

func (*SnippetTagCreate) SetNillableUpdateTime added in v1.0.8

func (stc *SnippetTagCreate) SetNillableUpdateTime(t *time.Time) *SnippetTagCreate

SetNillableUpdateTime sets the "update_time" field if the given value is not nil.

func (*SnippetTagCreate) SetOwnerID added in v1.0.8

func (stc *SnippetTagCreate) SetOwnerID(i int) *SnippetTagCreate

SetOwnerID sets the "owner_id" field.

func (*SnippetTagCreate) SetSnippetID added in v1.0.9

func (stc *SnippetTagCreate) SetSnippetID(i int) *SnippetTagCreate

SetSnippetID sets the "snippet_id" field.

func (*SnippetTagCreate) SetSnippetsTotal added in v1.0.8

func (stc *SnippetTagCreate) SetSnippetsTotal(i int) *SnippetTagCreate

SetSnippetsTotal sets the "snippets_total" field.

func (*SnippetTagCreate) SetTagSnippet added in v1.0.9

func (stc *SnippetTagCreate) SetTagSnippet(s *Snippet) *SnippetTagCreate

SetTagSnippet sets the "tag_snippet" edge to the Snippet entity.

func (*SnippetTagCreate) SetTagSnippetID added in v1.0.9

func (stc *SnippetTagCreate) SetTagSnippetID(id int) *SnippetTagCreate

SetTagSnippetID sets the "tag_snippet" edge to the Snippet entity by ID.

func (*SnippetTagCreate) SetUpdateTime added in v1.0.8

func (stc *SnippetTagCreate) SetUpdateTime(t time.Time) *SnippetTagCreate

SetUpdateTime sets the "update_time" field.

type SnippetTagCreateBulk added in v1.0.8

type SnippetTagCreateBulk struct {
	// contains filtered or unexported fields
}

SnippetTagCreateBulk is the builder for creating many SnippetTag entities in bulk.

func (*SnippetTagCreateBulk) Exec added in v1.0.8

func (stcb *SnippetTagCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*SnippetTagCreateBulk) ExecX added in v1.0.8

func (stcb *SnippetTagCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*SnippetTagCreateBulk) Save added in v1.0.8

func (stcb *SnippetTagCreateBulk) Save(ctx context.Context) ([]*SnippetTag, error)

Save creates the SnippetTag entities in the database.

func (*SnippetTagCreateBulk) SaveX added in v1.0.8

func (stcb *SnippetTagCreateBulk) SaveX(ctx context.Context) []*SnippetTag

SaveX is like Save, but panics if an error occurs.

type SnippetTagDelete added in v1.0.8

type SnippetTagDelete struct {
	// contains filtered or unexported fields
}

SnippetTagDelete is the builder for deleting a SnippetTag entity.

func (*SnippetTagDelete) Exec added in v1.0.8

func (std *SnippetTagDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*SnippetTagDelete) ExecX added in v1.0.8

func (std *SnippetTagDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*SnippetTagDelete) Where added in v1.0.8

Where appends a list predicates to the SnippetTagDelete builder.

type SnippetTagDeleteOne added in v1.0.8

type SnippetTagDeleteOne struct {
	// contains filtered or unexported fields
}

SnippetTagDeleteOne is the builder for deleting a single SnippetTag entity.

func (*SnippetTagDeleteOne) Exec added in v1.0.8

func (stdo *SnippetTagDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*SnippetTagDeleteOne) ExecX added in v1.0.8

func (stdo *SnippetTagDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

type SnippetTagEdges added in v1.0.8

type SnippetTagEdges struct {
	// TagSnippet holds the value of the tag_snippet edge.
	TagSnippet *Snippet `json:"tag_snippet,omitempty"`
	// contains filtered or unexported fields
}

SnippetTagEdges holds the relations/edges for other nodes in the graph.

func (SnippetTagEdges) TagSnippetOrErr added in v1.0.9

func (e SnippetTagEdges) TagSnippetOrErr() (*Snippet, error)

TagSnippetOrErr returns the TagSnippet value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

type SnippetTagGroupBy added in v1.0.8

type SnippetTagGroupBy struct {
	// contains filtered or unexported fields
}

SnippetTagGroupBy is the group-by builder for SnippetTag entities.

func (*SnippetTagGroupBy) Aggregate added in v1.0.8

func (stgb *SnippetTagGroupBy) Aggregate(fns ...AggregateFunc) *SnippetTagGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*SnippetTagGroupBy) Bool added in v1.0.8

func (stgb *SnippetTagGroupBy) 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 (*SnippetTagGroupBy) BoolX added in v1.0.8

func (stgb *SnippetTagGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*SnippetTagGroupBy) Bools added in v1.0.8

func (stgb *SnippetTagGroupBy) 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 (*SnippetTagGroupBy) BoolsX added in v1.0.8

func (stgb *SnippetTagGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*SnippetTagGroupBy) Float64 added in v1.0.8

func (stgb *SnippetTagGroupBy) 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 (*SnippetTagGroupBy) Float64X added in v1.0.8

func (stgb *SnippetTagGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*SnippetTagGroupBy) Float64s added in v1.0.8

func (stgb *SnippetTagGroupBy) 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 (*SnippetTagGroupBy) Float64sX added in v1.0.8

func (stgb *SnippetTagGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*SnippetTagGroupBy) Int added in v1.0.8

func (stgb *SnippetTagGroupBy) 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 (*SnippetTagGroupBy) IntX added in v1.0.8

func (stgb *SnippetTagGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*SnippetTagGroupBy) Ints added in v1.0.8

func (stgb *SnippetTagGroupBy) 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 (*SnippetTagGroupBy) IntsX added in v1.0.8

func (stgb *SnippetTagGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*SnippetTagGroupBy) Scan added in v1.0.8

func (stgb *SnippetTagGroupBy) Scan(ctx context.Context, v interface{}) error

Scan applies the group-by query and scans the result into the given value.

func (*SnippetTagGroupBy) ScanX added in v1.0.8

func (stgb *SnippetTagGroupBy) ScanX(ctx context.Context, v interface{})

ScanX is like Scan, but panics if an error occurs.

func (*SnippetTagGroupBy) String added in v1.0.8

func (stgb *SnippetTagGroupBy) 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 (*SnippetTagGroupBy) StringX added in v1.0.8

func (stgb *SnippetTagGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*SnippetTagGroupBy) Strings added in v1.0.8

func (stgb *SnippetTagGroupBy) 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 (*SnippetTagGroupBy) StringsX added in v1.0.8

func (stgb *SnippetTagGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type SnippetTagMutation added in v1.0.8

type SnippetTagMutation struct {
	// contains filtered or unexported fields
}

SnippetTagMutation represents an operation that mutates the SnippetTag nodes in the graph.

func (*SnippetTagMutation) AddField added in v1.0.8

func (m *SnippetTagMutation) 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 (*SnippetTagMutation) AddOwnerID added in v1.0.10

func (m *SnippetTagMutation) AddOwnerID(i int)

AddOwnerID adds i to the "owner_id" field.

func (*SnippetTagMutation) AddSnippetsTotal added in v1.0.8

func (m *SnippetTagMutation) AddSnippetsTotal(i int)

AddSnippetsTotal adds i to the "snippets_total" field.

func (*SnippetTagMutation) AddedEdges added in v1.0.8

func (m *SnippetTagMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*SnippetTagMutation) AddedField added in v1.0.8

func (m *SnippetTagMutation) 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 (*SnippetTagMutation) AddedFields added in v1.0.8

func (m *SnippetTagMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*SnippetTagMutation) AddedIDs added in v1.0.8

func (m *SnippetTagMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*SnippetTagMutation) AddedOwnerID added in v1.0.10

func (m *SnippetTagMutation) AddedOwnerID() (r int, exists bool)

AddedOwnerID returns the value that was added to the "owner_id" field in this mutation.

func (*SnippetTagMutation) AddedSnippetsTotal added in v1.0.8

func (m *SnippetTagMutation) AddedSnippetsTotal() (r int, exists bool)

AddedSnippetsTotal returns the value that was added to the "snippets_total" field in this mutation.

func (*SnippetTagMutation) ClearEdge added in v1.0.8

func (m *SnippetTagMutation) 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 (*SnippetTagMutation) ClearField added in v1.0.8

func (m *SnippetTagMutation) 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 (*SnippetTagMutation) ClearTagSnippet added in v1.0.9

func (m *SnippetTagMutation) ClearTagSnippet()

ClearTagSnippet clears the "tag_snippet" edge to the Snippet entity.

func (*SnippetTagMutation) ClearedEdges added in v1.0.8

func (m *SnippetTagMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*SnippetTagMutation) ClearedFields added in v1.0.8

func (m *SnippetTagMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (SnippetTagMutation) Client added in v1.0.8

func (m SnippetTagMutation) 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 (*SnippetTagMutation) CreateTime added in v1.0.8

func (m *SnippetTagMutation) CreateTime() (r time.Time, exists bool)

CreateTime returns the value of the "create_time" field in the mutation.

func (*SnippetTagMutation) EdgeCleared added in v1.0.8

func (m *SnippetTagMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*SnippetTagMutation) Field added in v1.0.8

func (m *SnippetTagMutation) 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 (*SnippetTagMutation) FieldCleared added in v1.0.8

func (m *SnippetTagMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*SnippetTagMutation) Fields added in v1.0.8

func (m *SnippetTagMutation) 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 (*SnippetTagMutation) ID added in v1.0.8

func (m *SnippetTagMutation) ID() (id int, exists bool)

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.

func (*SnippetTagMutation) Name added in v1.0.8

func (m *SnippetTagMutation) Name() (r string, exists bool)

Name returns the value of the "name" field in the mutation.

func (*SnippetTagMutation) OldCreateTime added in v1.0.8

func (m *SnippetTagMutation) OldCreateTime(ctx context.Context) (v time.Time, err error)

OldCreateTime returns the old "create_time" field's value of the SnippetTag entity. If the SnippetTag 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 (*SnippetTagMutation) OldField added in v1.0.8

func (m *SnippetTagMutation) 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 (*SnippetTagMutation) OldName added in v1.0.8

func (m *SnippetTagMutation) OldName(ctx context.Context) (v string, err error)

OldName returns the old "name" field's value of the SnippetTag entity. If the SnippetTag 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 (*SnippetTagMutation) OldOwnerID added in v1.0.8

func (m *SnippetTagMutation) OldOwnerID(ctx context.Context) (v int, err error)

OldOwnerID returns the old "owner_id" field's value of the SnippetTag entity. If the SnippetTag 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 (*SnippetTagMutation) OldSnippetID added in v1.0.9

func (m *SnippetTagMutation) OldSnippetID(ctx context.Context) (v int, err error)

OldSnippetID returns the old "snippet_id" field's value of the SnippetTag entity. If the SnippetTag 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 (*SnippetTagMutation) OldSnippetsTotal added in v1.0.8

func (m *SnippetTagMutation) OldSnippetsTotal(ctx context.Context) (v int, err error)

OldSnippetsTotal returns the old "snippets_total" field's value of the SnippetTag entity. If the SnippetTag 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 (*SnippetTagMutation) OldUpdateTime added in v1.0.8

func (m *SnippetTagMutation) OldUpdateTime(ctx context.Context) (v time.Time, err error)

OldUpdateTime returns the old "update_time" field's value of the SnippetTag entity. If the SnippetTag 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 (*SnippetTagMutation) Op added in v1.0.8

func (m *SnippetTagMutation) Op() Op

Op returns the operation name.

func (*SnippetTagMutation) OwnerID added in v1.0.8

func (m *SnippetTagMutation) OwnerID() (r int, exists bool)

OwnerID returns the value of the "owner_id" field in the mutation.

func (*SnippetTagMutation) RemovedEdges added in v1.0.8

func (m *SnippetTagMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*SnippetTagMutation) RemovedIDs added in v1.0.8

func (m *SnippetTagMutation) 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 (*SnippetTagMutation) ResetCreateTime added in v1.0.8

func (m *SnippetTagMutation) ResetCreateTime()

ResetCreateTime resets all changes to the "create_time" field.

func (*SnippetTagMutation) ResetEdge added in v1.0.8

func (m *SnippetTagMutation) 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 (*SnippetTagMutation) ResetField added in v1.0.8

func (m *SnippetTagMutation) 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 (*SnippetTagMutation) ResetName added in v1.0.8

func (m *SnippetTagMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*SnippetTagMutation) ResetOwnerID added in v1.0.8

func (m *SnippetTagMutation) ResetOwnerID()

ResetOwnerID resets all changes to the "owner_id" field.

func (*SnippetTagMutation) ResetSnippetID added in v1.0.9

func (m *SnippetTagMutation) ResetSnippetID()

ResetSnippetID resets all changes to the "snippet_id" field.

func (*SnippetTagMutation) ResetSnippetsTotal added in v1.0.8

func (m *SnippetTagMutation) ResetSnippetsTotal()

ResetSnippetsTotal resets all changes to the "snippets_total" field.

func (*SnippetTagMutation) ResetTagSnippet added in v1.0.9

func (m *SnippetTagMutation) ResetTagSnippet()

ResetTagSnippet resets all changes to the "tag_snippet" edge.

func (*SnippetTagMutation) ResetUpdateTime added in v1.0.8

func (m *SnippetTagMutation) ResetUpdateTime()

ResetUpdateTime resets all changes to the "update_time" field.

func (*SnippetTagMutation) SetCreateTime added in v1.0.8

func (m *SnippetTagMutation) SetCreateTime(t time.Time)

SetCreateTime sets the "create_time" field.

func (*SnippetTagMutation) SetField added in v1.0.8

func (m *SnippetTagMutation) 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 (*SnippetTagMutation) SetID added in v1.0.8

func (m *SnippetTagMutation) SetID(id int)

SetID sets the value of the id field. Note that this operation is only accepted on creation of SnippetTag entities.

func (*SnippetTagMutation) SetName added in v1.0.8

func (m *SnippetTagMutation) SetName(s string)

SetName sets the "name" field.

func (*SnippetTagMutation) SetOwnerID added in v1.0.8

func (m *SnippetTagMutation) SetOwnerID(i int)

SetOwnerID sets the "owner_id" field.

func (*SnippetTagMutation) SetSnippetID added in v1.0.9

func (m *SnippetTagMutation) SetSnippetID(i int)

SetSnippetID sets the "snippet_id" field.

func (*SnippetTagMutation) SetSnippetsTotal added in v1.0.8

func (m *SnippetTagMutation) SetSnippetsTotal(i int)

SetSnippetsTotal sets the "snippets_total" field.

func (*SnippetTagMutation) SetTagSnippetID added in v1.0.9

func (m *SnippetTagMutation) SetTagSnippetID(id int)

SetTagSnippetID sets the "tag_snippet" edge to the Snippet entity by id.

func (*SnippetTagMutation) SetUpdateTime added in v1.0.8

func (m *SnippetTagMutation) SetUpdateTime(t time.Time)

SetUpdateTime sets the "update_time" field.

func (*SnippetTagMutation) SnippetID added in v1.0.9

func (m *SnippetTagMutation) SnippetID() (r int, exists bool)

SnippetID returns the value of the "snippet_id" field in the mutation.

func (*SnippetTagMutation) SnippetsTotal added in v1.0.8

func (m *SnippetTagMutation) SnippetsTotal() (r int, exists bool)

SnippetsTotal returns the value of the "snippets_total" field in the mutation.

func (*SnippetTagMutation) TagSnippetCleared added in v1.0.9

func (m *SnippetTagMutation) TagSnippetCleared() bool

TagSnippetCleared reports if the "tag_snippet" edge to the Snippet entity was cleared.

func (*SnippetTagMutation) TagSnippetID added in v1.0.9

func (m *SnippetTagMutation) TagSnippetID() (id int, exists bool)

TagSnippetID returns the "tag_snippet" edge ID in the mutation.

func (*SnippetTagMutation) TagSnippetIDs added in v1.0.9

func (m *SnippetTagMutation) TagSnippetIDs() (ids []int)

TagSnippetIDs returns the "tag_snippet" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use TagSnippetID instead. It exists only for internal usage by the builders.

func (SnippetTagMutation) Tx added in v1.0.8

func (m SnippetTagMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*SnippetTagMutation) Type added in v1.0.8

func (m *SnippetTagMutation) Type() string

Type returns the node type of this mutation (SnippetTag).

func (*SnippetTagMutation) UpdateTime added in v1.0.8

func (m *SnippetTagMutation) UpdateTime() (r time.Time, exists bool)

UpdateTime returns the value of the "update_time" field in the mutation.

func (*SnippetTagMutation) Where added in v1.0.8

func (m *SnippetTagMutation) Where(ps ...predicate.SnippetTag)

Where appends a list predicates to the SnippetTagMutation builder.

type SnippetTagQuery added in v1.0.8

type SnippetTagQuery struct {
	// contains filtered or unexported fields
}

SnippetTagQuery is the builder for querying SnippetTag entities.

func (*SnippetTagQuery) All added in v1.0.8

func (stq *SnippetTagQuery) All(ctx context.Context) ([]*SnippetTag, error)

All executes the query and returns a list of SnippetTags.

func (*SnippetTagQuery) AllX added in v1.0.8

func (stq *SnippetTagQuery) AllX(ctx context.Context) []*SnippetTag

AllX is like All, but panics if an error occurs.

func (*SnippetTagQuery) Clone added in v1.0.8

func (stq *SnippetTagQuery) Clone() *SnippetTagQuery

Clone returns a duplicate of the SnippetTagQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*SnippetTagQuery) Count added in v1.0.8

func (stq *SnippetTagQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*SnippetTagQuery) CountX added in v1.0.8

func (stq *SnippetTagQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*SnippetTagQuery) Exist added in v1.0.8

func (stq *SnippetTagQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*SnippetTagQuery) ExistX added in v1.0.8

func (stq *SnippetTagQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*SnippetTagQuery) First added in v1.0.8

func (stq *SnippetTagQuery) First(ctx context.Context) (*SnippetTag, error)

First returns the first SnippetTag entity from the query. Returns a *NotFoundError when no SnippetTag was found.

func (*SnippetTagQuery) FirstID added in v1.0.8

func (stq *SnippetTagQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first SnippetTag ID from the query. Returns a *NotFoundError when no SnippetTag ID was found.

func (*SnippetTagQuery) FirstIDX added in v1.0.8

func (stq *SnippetTagQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*SnippetTagQuery) FirstX added in v1.0.8

func (stq *SnippetTagQuery) FirstX(ctx context.Context) *SnippetTag

FirstX is like First, but panics if an error occurs.

func (*SnippetTagQuery) GroupBy added in v1.0.8

func (stq *SnippetTagQuery) GroupBy(field string, fields ...string) *SnippetTagGroupBy

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 {
	SnippetID int `json:"-"`
	Count int `json:"count,omitempty"`
}

client.SnippetTag.Query().
	GroupBy(snippettag.FieldSnippetID).
	Aggregate(model.Count()).
	Scan(ctx, &v)

func (*SnippetTagQuery) IDs added in v1.0.8

func (stq *SnippetTagQuery) IDs(ctx context.Context) ([]int, error)

IDs executes the query and returns a list of SnippetTag IDs.

func (*SnippetTagQuery) IDsX added in v1.0.8

func (stq *SnippetTagQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*SnippetTagQuery) Limit added in v1.0.8

func (stq *SnippetTagQuery) Limit(limit int) *SnippetTagQuery

Limit adds a limit step to the query.

func (*SnippetTagQuery) Offset added in v1.0.8

func (stq *SnippetTagQuery) Offset(offset int) *SnippetTagQuery

Offset adds an offset step to the query.

func (*SnippetTagQuery) Only added in v1.0.8

func (stq *SnippetTagQuery) Only(ctx context.Context) (*SnippetTag, error)

Only returns a single SnippetTag entity found by the query, ensuring it only returns one. Returns a *NotSingularError when exactly one SnippetTag entity is not found. Returns a *NotFoundError when no SnippetTag entities are found.

func (*SnippetTagQuery) OnlyID added in v1.0.8

func (stq *SnippetTagQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only SnippetTag ID in the query. Returns a *NotSingularError when exactly one SnippetTag ID is not found. Returns a *NotFoundError when no entities are found.

func (*SnippetTagQuery) OnlyIDX added in v1.0.8

func (stq *SnippetTagQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*SnippetTagQuery) OnlyX added in v1.0.8

func (stq *SnippetTagQuery) OnlyX(ctx context.Context) *SnippetTag

OnlyX is like Only, but panics if an error occurs.

func (*SnippetTagQuery) Order added in v1.0.8

func (stq *SnippetTagQuery) Order(o ...OrderFunc) *SnippetTagQuery

Order adds an order step to the query.

func (*SnippetTagQuery) QueryTagSnippet added in v1.0.9

func (stq *SnippetTagQuery) QueryTagSnippet() *SnippetQuery

QueryTagSnippet chains the current query on the "tag_snippet" edge.

func (*SnippetTagQuery) Select added in v1.0.8

func (stq *SnippetTagQuery) Select(fields ...string) *SnippetTagSelect

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 {
	SnippetID int `json:"-"`
}

client.SnippetTag.Query().
	Select(snippettag.FieldSnippetID).
	Scan(ctx, &v)

func (*SnippetTagQuery) Unique added in v1.0.8

func (stq *SnippetTagQuery) Unique(unique bool) *SnippetTagQuery

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 (*SnippetTagQuery) Where added in v1.0.8

Where adds a new predicate for the SnippetTagQuery builder.

func (*SnippetTagQuery) WithTagSnippet added in v1.0.9

func (stq *SnippetTagQuery) WithTagSnippet(opts ...func(*SnippetQuery)) *SnippetTagQuery

WithTagSnippet tells the query-builder to eager-load the nodes that are connected to the "tag_snippet" edge. The optional arguments are used to configure the query builder of the edge.

type SnippetTagSelect added in v1.0.8

type SnippetTagSelect struct {
	*SnippetTagQuery
	// contains filtered or unexported fields
}

SnippetTagSelect is the builder for selecting fields of SnippetTag entities.

func (*SnippetTagSelect) Bool added in v1.0.8

func (sts *SnippetTagSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*SnippetTagSelect) BoolX added in v1.0.8

func (sts *SnippetTagSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*SnippetTagSelect) Bools added in v1.0.8

func (sts *SnippetTagSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*SnippetTagSelect) BoolsX added in v1.0.8

func (sts *SnippetTagSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*SnippetTagSelect) Float64 added in v1.0.8

func (sts *SnippetTagSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*SnippetTagSelect) Float64X added in v1.0.8

func (sts *SnippetTagSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*SnippetTagSelect) Float64s added in v1.0.8

func (sts *SnippetTagSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*SnippetTagSelect) Float64sX added in v1.0.8

func (sts *SnippetTagSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*SnippetTagSelect) Int added in v1.0.8

func (sts *SnippetTagSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*SnippetTagSelect) IntX added in v1.0.8

func (sts *SnippetTagSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*SnippetTagSelect) Ints added in v1.0.8

func (sts *SnippetTagSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*SnippetTagSelect) IntsX added in v1.0.8

func (sts *SnippetTagSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*SnippetTagSelect) Scan added in v1.0.8

func (sts *SnippetTagSelect) Scan(ctx context.Context, v interface{}) error

Scan applies the selector query and scans the result into the given value.

func (*SnippetTagSelect) ScanX added in v1.0.8

func (sts *SnippetTagSelect) ScanX(ctx context.Context, v interface{})

ScanX is like Scan, but panics if an error occurs.

func (*SnippetTagSelect) String added in v1.0.8

func (sts *SnippetTagSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*SnippetTagSelect) StringX added in v1.0.8

func (sts *SnippetTagSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*SnippetTagSelect) Strings added in v1.0.8

func (sts *SnippetTagSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*SnippetTagSelect) StringsX added in v1.0.8

func (sts *SnippetTagSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type SnippetTagUpdate added in v1.0.8

type SnippetTagUpdate struct {
	// contains filtered or unexported fields
}

SnippetTagUpdate is the builder for updating SnippetTag entities.

func (*SnippetTagUpdate) AddSnippetsTotal added in v1.0.8

func (stu *SnippetTagUpdate) AddSnippetsTotal(i int) *SnippetTagUpdate

AddSnippetsTotal adds i to the "snippets_total" field.

func (*SnippetTagUpdate) ClearTagSnippet added in v1.0.9

func (stu *SnippetTagUpdate) ClearTagSnippet() *SnippetTagUpdate

ClearTagSnippet clears the "tag_snippet" edge to the Snippet entity.

func (*SnippetTagUpdate) Exec added in v1.0.8

func (stu *SnippetTagUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*SnippetTagUpdate) ExecX added in v1.0.8

func (stu *SnippetTagUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*SnippetTagUpdate) Mutation added in v1.0.8

func (stu *SnippetTagUpdate) Mutation() *SnippetTagMutation

Mutation returns the SnippetTagMutation object of the builder.

func (*SnippetTagUpdate) Save added in v1.0.8

func (stu *SnippetTagUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*SnippetTagUpdate) SaveX added in v1.0.8

func (stu *SnippetTagUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*SnippetTagUpdate) SetName added in v1.0.8

func (stu *SnippetTagUpdate) SetName(s string) *SnippetTagUpdate

SetName sets the "name" field.

func (*SnippetTagUpdate) SetNillableSnippetsTotal added in v1.0.8

func (stu *SnippetTagUpdate) SetNillableSnippetsTotal(i *int) *SnippetTagUpdate

SetNillableSnippetsTotal sets the "snippets_total" field if the given value is not nil.

func (*SnippetTagUpdate) SetSnippetID added in v1.0.10

func (stu *SnippetTagUpdate) SetSnippetID(i int) *SnippetTagUpdate

SetSnippetID sets the "snippet_id" field.

func (*SnippetTagUpdate) SetSnippetsTotal added in v1.0.8

func (stu *SnippetTagUpdate) SetSnippetsTotal(i int) *SnippetTagUpdate

SetSnippetsTotal sets the "snippets_total" field.

func (*SnippetTagUpdate) SetTagSnippet added in v1.0.9

func (stu *SnippetTagUpdate) SetTagSnippet(s *Snippet) *SnippetTagUpdate

SetTagSnippet sets the "tag_snippet" edge to the Snippet entity.

func (*SnippetTagUpdate) SetTagSnippetID added in v1.0.9

func (stu *SnippetTagUpdate) SetTagSnippetID(id int) *SnippetTagUpdate

SetTagSnippetID sets the "tag_snippet" edge to the Snippet entity by ID.

func (*SnippetTagUpdate) SetUpdateTime added in v1.0.8

func (stu *SnippetTagUpdate) SetUpdateTime(t time.Time) *SnippetTagUpdate

SetUpdateTime sets the "update_time" field.

func (*SnippetTagUpdate) Where added in v1.0.8

Where appends a list predicates to the SnippetTagUpdate builder.

type SnippetTagUpdateOne added in v1.0.8

type SnippetTagUpdateOne struct {
	// contains filtered or unexported fields
}

SnippetTagUpdateOne is the builder for updating a single SnippetTag entity.

func (*SnippetTagUpdateOne) AddSnippetsTotal added in v1.0.8

func (stuo *SnippetTagUpdateOne) AddSnippetsTotal(i int) *SnippetTagUpdateOne

AddSnippetsTotal adds i to the "snippets_total" field.

func (*SnippetTagUpdateOne) ClearTagSnippet added in v1.0.9

func (stuo *SnippetTagUpdateOne) ClearTagSnippet() *SnippetTagUpdateOne

ClearTagSnippet clears the "tag_snippet" edge to the Snippet entity.

func (*SnippetTagUpdateOne) Exec added in v1.0.8

func (stuo *SnippetTagUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*SnippetTagUpdateOne) ExecX added in v1.0.8

func (stuo *SnippetTagUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*SnippetTagUpdateOne) Mutation added in v1.0.8

func (stuo *SnippetTagUpdateOne) Mutation() *SnippetTagMutation

Mutation returns the SnippetTagMutation object of the builder.

func (*SnippetTagUpdateOne) Save added in v1.0.8

func (stuo *SnippetTagUpdateOne) Save(ctx context.Context) (*SnippetTag, error)

Save executes the query and returns the updated SnippetTag entity.

func (*SnippetTagUpdateOne) SaveX added in v1.0.8

func (stuo *SnippetTagUpdateOne) SaveX(ctx context.Context) *SnippetTag

SaveX is like Save, but panics if an error occurs.

func (*SnippetTagUpdateOne) Select added in v1.0.8

func (stuo *SnippetTagUpdateOne) Select(field string, fields ...string) *SnippetTagUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*SnippetTagUpdateOne) SetName added in v1.0.8

SetName sets the "name" field.

func (*SnippetTagUpdateOne) SetNillableSnippetsTotal added in v1.0.8

func (stuo *SnippetTagUpdateOne) SetNillableSnippetsTotal(i *int) *SnippetTagUpdateOne

SetNillableSnippetsTotal sets the "snippets_total" field if the given value is not nil.

func (*SnippetTagUpdateOne) SetSnippetID added in v1.0.10

func (stuo *SnippetTagUpdateOne) SetSnippetID(i int) *SnippetTagUpdateOne

SetSnippetID sets the "snippet_id" field.

func (*SnippetTagUpdateOne) SetSnippetsTotal added in v1.0.8

func (stuo *SnippetTagUpdateOne) SetSnippetsTotal(i int) *SnippetTagUpdateOne

SetSnippetsTotal sets the "snippets_total" field.

func (*SnippetTagUpdateOne) SetTagSnippet added in v1.0.9

func (stuo *SnippetTagUpdateOne) SetTagSnippet(s *Snippet) *SnippetTagUpdateOne

SetTagSnippet sets the "tag_snippet" edge to the Snippet entity.

func (*SnippetTagUpdateOne) SetTagSnippetID added in v1.0.9

func (stuo *SnippetTagUpdateOne) SetTagSnippetID(id int) *SnippetTagUpdateOne

SetTagSnippetID sets the "tag_snippet" edge to the Snippet entity by ID.

func (*SnippetTagUpdateOne) SetUpdateTime added in v1.0.8

func (stuo *SnippetTagUpdateOne) SetUpdateTime(t time.Time) *SnippetTagUpdateOne

SetUpdateTime sets the "update_time" field.

type SnippetTags added in v1.0.8

type SnippetTags []*SnippetTag

SnippetTags is a parsable slice of SnippetTag.

type SnippetUpdate added in v1.0.8

type SnippetUpdate struct {
	// contains filtered or unexported fields
}

SnippetUpdate is the builder for updating Snippet entities.

func (*SnippetUpdate) AddFolderID added in v1.0.8

func (su *SnippetUpdate) AddFolderID(i int) *SnippetUpdate

AddFolderID adds i to the "folder_id" field.

func (*SnippetUpdate) AddSnippetDocIDs added in v1.0.8

func (su *SnippetUpdate) AddSnippetDocIDs(ids ...int) *SnippetUpdate

AddSnippetDocIDs adds the "snippet_docs" edge to the SnippetDocument entity by IDs.

func (*SnippetUpdate) AddSnippetDocs added in v1.0.8

func (su *SnippetUpdate) AddSnippetDocs(s ...*SnippetDocument) *SnippetUpdate

AddSnippetDocs adds the "snippet_docs" edges to the SnippetDocument entity.

func (*SnippetUpdate) AddSnippetTagIDs added in v1.0.9

func (su *SnippetUpdate) AddSnippetTagIDs(ids ...int) *SnippetUpdate

AddSnippetTagIDs adds the "snippet_tags" edge to the SnippetTag entity by IDs.

func (*SnippetUpdate) AddSnippetTags added in v1.0.9

func (su *SnippetUpdate) AddSnippetTags(s ...*SnippetTag) *SnippetUpdate

AddSnippetTags adds the "snippet_tags" edges to the SnippetTag entity.

func (*SnippetUpdate) ClearFolderID added in v1.0.8

func (su *SnippetUpdate) ClearFolderID() *SnippetUpdate

ClearFolderID clears the value of the "folder_id" field.

func (*SnippetUpdate) ClearSnippetDocs added in v1.0.8

func (su *SnippetUpdate) ClearSnippetDocs() *SnippetUpdate

ClearSnippetDocs clears all "snippet_docs" edges to the SnippetDocument entity.

func (*SnippetUpdate) ClearSnippetTags added in v1.0.9

func (su *SnippetUpdate) ClearSnippetTags() *SnippetUpdate

ClearSnippetTags clears all "snippet_tags" edges to the SnippetTag entity.

func (*SnippetUpdate) ClearTitle added in v1.0.8

func (su *SnippetUpdate) ClearTitle() *SnippetUpdate

ClearTitle clears the value of the "title" field.

func (*SnippetUpdate) Exec added in v1.0.8

func (su *SnippetUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*SnippetUpdate) ExecX added in v1.0.8

func (su *SnippetUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*SnippetUpdate) Mutation added in v1.0.8

func (su *SnippetUpdate) Mutation() *SnippetMutation

Mutation returns the SnippetMutation object of the builder.

func (*SnippetUpdate) RemoveSnippetDocIDs added in v1.0.8

func (su *SnippetUpdate) RemoveSnippetDocIDs(ids ...int) *SnippetUpdate

RemoveSnippetDocIDs removes the "snippet_docs" edge to SnippetDocument entities by IDs.

func (*SnippetUpdate) RemoveSnippetDocs added in v1.0.8

func (su *SnippetUpdate) RemoveSnippetDocs(s ...*SnippetDocument) *SnippetUpdate

RemoveSnippetDocs removes "snippet_docs" edges to SnippetDocument entities.

func (*SnippetUpdate) RemoveSnippetTagIDs added in v1.0.9

func (su *SnippetUpdate) RemoveSnippetTagIDs(ids ...int) *SnippetUpdate

RemoveSnippetTagIDs removes the "snippet_tags" edge to SnippetTag entities by IDs.

func (*SnippetUpdate) RemoveSnippetTags added in v1.0.9

func (su *SnippetUpdate) RemoveSnippetTags(s ...*SnippetTag) *SnippetUpdate

RemoveSnippetTags removes "snippet_tags" edges to SnippetTag entities.

func (*SnippetUpdate) Save added in v1.0.8

func (su *SnippetUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*SnippetUpdate) SaveX added in v1.0.8

func (su *SnippetUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*SnippetUpdate) SetFolderID added in v1.0.8

func (su *SnippetUpdate) SetFolderID(i int) *SnippetUpdate

SetFolderID sets the "folder_id" field.

func (*SnippetUpdate) SetNillableFolderID added in v1.0.8

func (su *SnippetUpdate) SetNillableFolderID(i *int) *SnippetUpdate

SetNillableFolderID sets the "folder_id" field if the given value is not nil.

func (*SnippetUpdate) SetNillableTitle added in v1.0.8

func (su *SnippetUpdate) SetNillableTitle(s *string) *SnippetUpdate

SetNillableTitle sets the "title" field if the given value is not nil.

func (*SnippetUpdate) SetTitle added in v1.0.8

func (su *SnippetUpdate) SetTitle(s string) *SnippetUpdate

SetTitle sets the "title" field.

func (*SnippetUpdate) SetUpdateTime added in v1.0.8

func (su *SnippetUpdate) SetUpdateTime(t time.Time) *SnippetUpdate

SetUpdateTime sets the "update_time" field.

func (*SnippetUpdate) Where added in v1.0.8

func (su *SnippetUpdate) Where(ps ...predicate.Snippet) *SnippetUpdate

Where appends a list predicates to the SnippetUpdate builder.

type SnippetUpdateOne added in v1.0.8

type SnippetUpdateOne struct {
	// contains filtered or unexported fields
}

SnippetUpdateOne is the builder for updating a single Snippet entity.

func (*SnippetUpdateOne) AddFolderID added in v1.0.8

func (suo *SnippetUpdateOne) AddFolderID(i int) *SnippetUpdateOne

AddFolderID adds i to the "folder_id" field.

func (*SnippetUpdateOne) AddSnippetDocIDs added in v1.0.8

func (suo *SnippetUpdateOne) AddSnippetDocIDs(ids ...int) *SnippetUpdateOne

AddSnippetDocIDs adds the "snippet_docs" edge to the SnippetDocument entity by IDs.

func (*SnippetUpdateOne) AddSnippetDocs added in v1.0.8

func (suo *SnippetUpdateOne) AddSnippetDocs(s ...*SnippetDocument) *SnippetUpdateOne

AddSnippetDocs adds the "snippet_docs" edges to the SnippetDocument entity.

func (*SnippetUpdateOne) AddSnippetTagIDs added in v1.0.9

func (suo *SnippetUpdateOne) AddSnippetTagIDs(ids ...int) *SnippetUpdateOne

AddSnippetTagIDs adds the "snippet_tags" edge to the SnippetTag entity by IDs.

func (*SnippetUpdateOne) AddSnippetTags added in v1.0.9

func (suo *SnippetUpdateOne) AddSnippetTags(s ...*SnippetTag) *SnippetUpdateOne

AddSnippetTags adds the "snippet_tags" edges to the SnippetTag entity.

func (*SnippetUpdateOne) ClearFolderID added in v1.0.8

func (suo *SnippetUpdateOne) ClearFolderID() *SnippetUpdateOne

ClearFolderID clears the value of the "folder_id" field.

func (*SnippetUpdateOne) ClearSnippetDocs added in v1.0.8

func (suo *SnippetUpdateOne) ClearSnippetDocs() *SnippetUpdateOne

ClearSnippetDocs clears all "snippet_docs" edges to the SnippetDocument entity.

func (*SnippetUpdateOne) ClearSnippetTags added in v1.0.9

func (suo *SnippetUpdateOne) ClearSnippetTags() *SnippetUpdateOne

ClearSnippetTags clears all "snippet_tags" edges to the SnippetTag entity.

func (*SnippetUpdateOne) ClearTitle added in v1.0.8

func (suo *SnippetUpdateOne) ClearTitle() *SnippetUpdateOne

ClearTitle clears the value of the "title" field.

func (*SnippetUpdateOne) Exec added in v1.0.8

func (suo *SnippetUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*SnippetUpdateOne) ExecX added in v1.0.8

func (suo *SnippetUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*SnippetUpdateOne) Mutation added in v1.0.8

func (suo *SnippetUpdateOne) Mutation() *SnippetMutation

Mutation returns the SnippetMutation object of the builder.

func (*SnippetUpdateOne) RemoveSnippetDocIDs added in v1.0.8

func (suo *SnippetUpdateOne) RemoveSnippetDocIDs(ids ...int) *SnippetUpdateOne

RemoveSnippetDocIDs removes the "snippet_docs" edge to SnippetDocument entities by IDs.

func (*SnippetUpdateOne) RemoveSnippetDocs added in v1.0.8

func (suo *SnippetUpdateOne) RemoveSnippetDocs(s ...*SnippetDocument) *SnippetUpdateOne

RemoveSnippetDocs removes "snippet_docs" edges to SnippetDocument entities.

func (*SnippetUpdateOne) RemoveSnippetTagIDs added in v1.0.9

func (suo *SnippetUpdateOne) RemoveSnippetTagIDs(ids ...int) *SnippetUpdateOne

RemoveSnippetTagIDs removes the "snippet_tags" edge to SnippetTag entities by IDs.

func (*SnippetUpdateOne) RemoveSnippetTags added in v1.0.9

func (suo *SnippetUpdateOne) RemoveSnippetTags(s ...*SnippetTag) *SnippetUpdateOne

RemoveSnippetTags removes "snippet_tags" edges to SnippetTag entities.

func (*SnippetUpdateOne) Save added in v1.0.8

func (suo *SnippetUpdateOne) Save(ctx context.Context) (*Snippet, error)

Save executes the query and returns the updated Snippet entity.

func (*SnippetUpdateOne) SaveX added in v1.0.8

func (suo *SnippetUpdateOne) SaveX(ctx context.Context) *Snippet

SaveX is like Save, but panics if an error occurs.

func (*SnippetUpdateOne) Select added in v1.0.8

func (suo *SnippetUpdateOne) Select(field string, fields ...string) *SnippetUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*SnippetUpdateOne) SetFolderID added in v1.0.8

func (suo *SnippetUpdateOne) SetFolderID(i int) *SnippetUpdateOne

SetFolderID sets the "folder_id" field.

func (*SnippetUpdateOne) SetNillableFolderID added in v1.0.8

func (suo *SnippetUpdateOne) SetNillableFolderID(i *int) *SnippetUpdateOne

SetNillableFolderID sets the "folder_id" field if the given value is not nil.

func (*SnippetUpdateOne) SetNillableTitle added in v1.0.8

func (suo *SnippetUpdateOne) SetNillableTitle(s *string) *SnippetUpdateOne

SetNillableTitle sets the "title" field if the given value is not nil.

func (*SnippetUpdateOne) SetTitle added in v1.0.8

func (suo *SnippetUpdateOne) SetTitle(s string) *SnippetUpdateOne

SetTitle sets the "title" field.

func (*SnippetUpdateOne) SetUpdateTime added in v1.0.8

func (suo *SnippetUpdateOne) SetUpdateTime(t time.Time) *SnippetUpdateOne

SetUpdateTime sets the "update_time" field.

type Snippets added in v1.0.8

type Snippets []*Snippet

Snippets is a parsable slice of Snippet.

type SystemSetting added in v1.0.5

type SystemSetting struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// Space holds the value of the "space" field.
	Space *systemsetting.Space `json:"space,omitempty"`
	// Key holds the value of the "key" field.
	Key string `json:"key,omitempty"`
	// Value holds the value of the "value" field.
	Value string `json:"value,omitempty"`
	// Typeof holds the value of the "typeof" field.
	Typeof string `json:"typeof,omitempty"`
	// UpdateTime holds the value of the "update_time" field.
	UpdateTime time.Time `json:"-"`
	// contains filtered or unexported fields
}

SystemSetting is the model entity for the SystemSetting schema.

func (*SystemSetting) String added in v1.0.5

func (ss *SystemSetting) String() string

String implements the fmt.Stringer.

func (*SystemSetting) Unwrap added in v1.0.5

func (ss *SystemSetting) Unwrap() *SystemSetting

Unwrap unwraps the SystemSetting 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 (*SystemSetting) Update added in v1.0.5

func (ss *SystemSetting) Update() *SystemSettingUpdateOne

Update returns a builder for updating this SystemSetting. Note that you need to call SystemSetting.Unwrap() before calling this method if this SystemSetting was returned from a transaction, and the transaction was committed or rolled back.

type SystemSettingClient added in v1.0.5

type SystemSettingClient struct {
	// contains filtered or unexported fields
}

SystemSettingClient is a client for the SystemSetting schema.

func NewSystemSettingClient added in v1.0.5

func NewSystemSettingClient(c config) *SystemSettingClient

NewSystemSettingClient returns a client for the SystemSetting from the given config.

func (*SystemSettingClient) Create added in v1.0.5

Create returns a create builder for SystemSetting.

func (*SystemSettingClient) CreateBulk added in v1.0.5

CreateBulk returns a builder for creating a bulk of SystemSetting entities.

func (*SystemSettingClient) Delete added in v1.0.5

Delete returns a delete builder for SystemSetting.

func (*SystemSettingClient) DeleteOne added in v1.0.5

DeleteOne returns a delete builder for the given entity.

func (*SystemSettingClient) DeleteOneID added in v1.0.5

func (c *SystemSettingClient) DeleteOneID(id int) *SystemSettingDeleteOne

DeleteOneID returns a delete builder for the given id.

func (*SystemSettingClient) Get added in v1.0.5

Get returns a SystemSetting entity by its id.

func (*SystemSettingClient) GetX added in v1.0.5

GetX is like Get, but panics if an error occurs.

func (*SystemSettingClient) Hooks added in v1.0.5

func (c *SystemSettingClient) Hooks() []Hook

Hooks returns the client hooks.

func (*SystemSettingClient) Query added in v1.0.5

Query returns a query builder for SystemSetting.

func (*SystemSettingClient) Update added in v1.0.5

Update returns an update builder for SystemSetting.

func (*SystemSettingClient) UpdateOne added in v1.0.5

UpdateOne returns an update builder for the given entity.

func (*SystemSettingClient) UpdateOneID added in v1.0.5

func (c *SystemSettingClient) UpdateOneID(id int) *SystemSettingUpdateOne

UpdateOneID returns an update builder for the given id.

func (*SystemSettingClient) Use added in v1.0.5

func (c *SystemSettingClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `systemsetting.Hooks(f(g(h())))`.

type SystemSettingCreate added in v1.0.5

type SystemSettingCreate struct {
	// contains filtered or unexported fields
}

SystemSettingCreate is the builder for creating a SystemSetting entity.

func (*SystemSettingCreate) Exec added in v1.0.8

func (ssc *SystemSettingCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*SystemSettingCreate) ExecX added in v1.0.8

func (ssc *SystemSettingCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*SystemSettingCreate) Mutation added in v1.0.5

func (ssc *SystemSettingCreate) Mutation() *SystemSettingMutation

Mutation returns the SystemSettingMutation object of the builder.

func (*SystemSettingCreate) Save added in v1.0.5

Save creates the SystemSetting in the database.

func (*SystemSettingCreate) SaveX added in v1.0.5

SaveX calls Save and panics if Save returns an error.

func (*SystemSettingCreate) SetID added in v1.0.5

SetID sets the "id" field.

func (*SystemSettingCreate) SetKey added in v1.0.5

SetKey sets the "key" field.

func (*SystemSettingCreate) SetNillableSpace added in v1.0.5

func (ssc *SystemSettingCreate) SetNillableSpace(s *systemsetting.Space) *SystemSettingCreate

SetNillableSpace sets the "space" field if the given value is not nil.

func (*SystemSettingCreate) SetNillableTypeof added in v1.0.5

func (ssc *SystemSettingCreate) SetNillableTypeof(s *string) *SystemSettingCreate

SetNillableTypeof sets the "typeof" field if the given value is not nil.

func (*SystemSettingCreate) SetNillableUpdateTime added in v1.0.5

func (ssc *SystemSettingCreate) SetNillableUpdateTime(t *time.Time) *SystemSettingCreate

SetNillableUpdateTime sets the "update_time" field if the given value is not nil.

func (*SystemSettingCreate) SetNillableValue added in v1.0.5

func (ssc *SystemSettingCreate) SetNillableValue(s *string) *SystemSettingCreate

SetNillableValue sets the "value" field if the given value is not nil.

func (*SystemSettingCreate) SetSpace added in v1.0.5

SetSpace sets the "space" field.

func (*SystemSettingCreate) SetTypeof added in v1.0.5

func (ssc *SystemSettingCreate) SetTypeof(s string) *SystemSettingCreate

SetTypeof sets the "typeof" field.

func (*SystemSettingCreate) SetUpdateTime added in v1.0.5

func (ssc *SystemSettingCreate) SetUpdateTime(t time.Time) *SystemSettingCreate

SetUpdateTime sets the "update_time" field.

func (*SystemSettingCreate) SetValue added in v1.0.5

SetValue sets the "value" field.

type SystemSettingCreateBulk added in v1.0.5

type SystemSettingCreateBulk struct {
	// contains filtered or unexported fields
}

SystemSettingCreateBulk is the builder for creating many SystemSetting entities in bulk.

func (*SystemSettingCreateBulk) Exec added in v1.0.8

func (sscb *SystemSettingCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*SystemSettingCreateBulk) ExecX added in v1.0.8

func (sscb *SystemSettingCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*SystemSettingCreateBulk) Save added in v1.0.5

Save creates the SystemSetting entities in the database.

func (*SystemSettingCreateBulk) SaveX added in v1.0.5

SaveX is like Save, but panics if an error occurs.

type SystemSettingDelete added in v1.0.5

type SystemSettingDelete struct {
	// contains filtered or unexported fields
}

SystemSettingDelete is the builder for deleting a SystemSetting entity.

func (*SystemSettingDelete) Exec added in v1.0.5

func (ssd *SystemSettingDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*SystemSettingDelete) ExecX added in v1.0.5

func (ssd *SystemSettingDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*SystemSettingDelete) Where added in v1.0.5

Where appends a list predicates to the SystemSettingDelete builder.

type SystemSettingDeleteOne added in v1.0.5

type SystemSettingDeleteOne struct {
	// contains filtered or unexported fields
}

SystemSettingDeleteOne is the builder for deleting a single SystemSetting entity.

func (*SystemSettingDeleteOne) Exec added in v1.0.5

func (ssdo *SystemSettingDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*SystemSettingDeleteOne) ExecX added in v1.0.5

func (ssdo *SystemSettingDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

type SystemSettingGroupBy added in v1.0.5

type SystemSettingGroupBy struct {
	// contains filtered or unexported fields
}

SystemSettingGroupBy is the group-by builder for SystemSetting entities.

func (*SystemSettingGroupBy) Aggregate added in v1.0.5

func (ssgb *SystemSettingGroupBy) Aggregate(fns ...AggregateFunc) *SystemSettingGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*SystemSettingGroupBy) Bool added in v1.0.5

func (ssgb *SystemSettingGroupBy) 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 (*SystemSettingGroupBy) BoolX added in v1.0.5

func (ssgb *SystemSettingGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*SystemSettingGroupBy) Bools added in v1.0.5

func (ssgb *SystemSettingGroupBy) 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 (*SystemSettingGroupBy) BoolsX added in v1.0.5

func (ssgb *SystemSettingGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*SystemSettingGroupBy) Float64 added in v1.0.5

func (ssgb *SystemSettingGroupBy) 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 (*SystemSettingGroupBy) Float64X added in v1.0.5

func (ssgb *SystemSettingGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*SystemSettingGroupBy) Float64s added in v1.0.5

func (ssgb *SystemSettingGroupBy) 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 (*SystemSettingGroupBy) Float64sX added in v1.0.5

func (ssgb *SystemSettingGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*SystemSettingGroupBy) Int added in v1.0.5

func (ssgb *SystemSettingGroupBy) 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 (*SystemSettingGroupBy) IntX added in v1.0.5

func (ssgb *SystemSettingGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*SystemSettingGroupBy) Ints added in v1.0.5

func (ssgb *SystemSettingGroupBy) 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 (*SystemSettingGroupBy) IntsX added in v1.0.5

func (ssgb *SystemSettingGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*SystemSettingGroupBy) Scan added in v1.0.5

func (ssgb *SystemSettingGroupBy) Scan(ctx context.Context, v interface{}) error

Scan applies the group-by query and scans the result into the given value.

func (*SystemSettingGroupBy) ScanX added in v1.0.5

func (ssgb *SystemSettingGroupBy) ScanX(ctx context.Context, v interface{})

ScanX is like Scan, but panics if an error occurs.

func (*SystemSettingGroupBy) String added in v1.0.5

func (ssgb *SystemSettingGroupBy) 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 (*SystemSettingGroupBy) StringX added in v1.0.5

func (ssgb *SystemSettingGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*SystemSettingGroupBy) Strings added in v1.0.5

func (ssgb *SystemSettingGroupBy) 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 (*SystemSettingGroupBy) StringsX added in v1.0.5

func (ssgb *SystemSettingGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type SystemSettingMutation added in v1.0.5

type SystemSettingMutation struct {
	// contains filtered or unexported fields
}

SystemSettingMutation represents an operation that mutates the SystemSetting nodes in the graph.

func (*SystemSettingMutation) AddField added in v1.0.5

func (m *SystemSettingMutation) 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 (*SystemSettingMutation) AddedEdges added in v1.0.5

func (m *SystemSettingMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*SystemSettingMutation) AddedField added in v1.0.5

func (m *SystemSettingMutation) 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 (*SystemSettingMutation) AddedFields added in v1.0.5

func (m *SystemSettingMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*SystemSettingMutation) AddedIDs added in v1.0.5

func (m *SystemSettingMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*SystemSettingMutation) ClearEdge added in v1.0.5

func (m *SystemSettingMutation) 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 (*SystemSettingMutation) ClearField added in v1.0.5

func (m *SystemSettingMutation) 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 (*SystemSettingMutation) ClearSpace added in v1.0.5

func (m *SystemSettingMutation) ClearSpace()

ClearSpace clears the value of the "space" field.

func (*SystemSettingMutation) ClearValue added in v1.0.5

func (m *SystemSettingMutation) ClearValue()

ClearValue clears the value of the "value" field.

func (*SystemSettingMutation) ClearedEdges added in v1.0.5

func (m *SystemSettingMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*SystemSettingMutation) ClearedFields added in v1.0.5

func (m *SystemSettingMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (SystemSettingMutation) Client added in v1.0.5

func (m SystemSettingMutation) 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 (*SystemSettingMutation) EdgeCleared added in v1.0.5

func (m *SystemSettingMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*SystemSettingMutation) Field added in v1.0.5

func (m *SystemSettingMutation) 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 (*SystemSettingMutation) FieldCleared added in v1.0.5

func (m *SystemSettingMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*SystemSettingMutation) Fields added in v1.0.5

func (m *SystemSettingMutation) 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 (*SystemSettingMutation) ID added in v1.0.5

func (m *SystemSettingMutation) ID() (id int, exists bool)

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.

func (*SystemSettingMutation) Key added in v1.0.5

func (m *SystemSettingMutation) Key() (r string, exists bool)

Key returns the value of the "key" field in the mutation.

func (*SystemSettingMutation) OldField added in v1.0.5

func (m *SystemSettingMutation) 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 (*SystemSettingMutation) OldKey added in v1.0.5

func (m *SystemSettingMutation) OldKey(ctx context.Context) (v string, err error)

OldKey returns the old "key" field's value of the SystemSetting entity. If the SystemSetting 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 (*SystemSettingMutation) OldSpace added in v1.0.5

func (m *SystemSettingMutation) OldSpace(ctx context.Context) (v *systemsetting.Space, err error)

OldSpace returns the old "space" field's value of the SystemSetting entity. If the SystemSetting 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 (*SystemSettingMutation) OldTypeof added in v1.0.5

func (m *SystemSettingMutation) OldTypeof(ctx context.Context) (v string, err error)

OldTypeof returns the old "typeof" field's value of the SystemSetting entity. If the SystemSetting 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 (*SystemSettingMutation) OldUpdateTime added in v1.0.5

func (m *SystemSettingMutation) OldUpdateTime(ctx context.Context) (v time.Time, err error)

OldUpdateTime returns the old "update_time" field's value of the SystemSetting entity. If the SystemSetting 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 (*SystemSettingMutation) OldValue added in v1.0.5

func (m *SystemSettingMutation) OldValue(ctx context.Context) (v string, err error)

OldValue returns the old "value" field's value of the SystemSetting entity. If the SystemSetting 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 (*SystemSettingMutation) Op added in v1.0.5

func (m *SystemSettingMutation) Op() Op

Op returns the operation name.

func (*SystemSettingMutation) RemovedEdges added in v1.0.5

func (m *SystemSettingMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*SystemSettingMutation) RemovedIDs added in v1.0.5

func (m *SystemSettingMutation) 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 (*SystemSettingMutation) ResetEdge added in v1.0.5

func (m *SystemSettingMutation) 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 (*SystemSettingMutation) ResetField added in v1.0.5

func (m *SystemSettingMutation) 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 (*SystemSettingMutation) ResetKey added in v1.0.5

func (m *SystemSettingMutation) ResetKey()

ResetKey resets all changes to the "key" field.

func (*SystemSettingMutation) ResetSpace added in v1.0.5

func (m *SystemSettingMutation) ResetSpace()

ResetSpace resets all changes to the "space" field.

func (*SystemSettingMutation) ResetTypeof added in v1.0.5

func (m *SystemSettingMutation) ResetTypeof()

ResetTypeof resets all changes to the "typeof" field.

func (*SystemSettingMutation) ResetUpdateTime added in v1.0.5

func (m *SystemSettingMutation) ResetUpdateTime()

ResetUpdateTime resets all changes to the "update_time" field.

func (*SystemSettingMutation) ResetValue added in v1.0.5

func (m *SystemSettingMutation) ResetValue()

ResetValue resets all changes to the "value" field.

func (*SystemSettingMutation) SetField added in v1.0.5

func (m *SystemSettingMutation) 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 (*SystemSettingMutation) SetID added in v1.0.5

func (m *SystemSettingMutation) SetID(id int)

SetID sets the value of the id field. Note that this operation is only accepted on creation of SystemSetting entities.

func (*SystemSettingMutation) SetKey added in v1.0.5

func (m *SystemSettingMutation) SetKey(s string)

SetKey sets the "key" field.

func (*SystemSettingMutation) SetSpace added in v1.0.5

func (m *SystemSettingMutation) SetSpace(s systemsetting.Space)

SetSpace sets the "space" field.

func (*SystemSettingMutation) SetTypeof added in v1.0.5

func (m *SystemSettingMutation) SetTypeof(s string)

SetTypeof sets the "typeof" field.

func (*SystemSettingMutation) SetUpdateTime added in v1.0.5

func (m *SystemSettingMutation) SetUpdateTime(t time.Time)

SetUpdateTime sets the "update_time" field.

func (*SystemSettingMutation) SetValue added in v1.0.5

func (m *SystemSettingMutation) SetValue(s string)

SetValue sets the "value" field.

func (*SystemSettingMutation) Space added in v1.0.5

func (m *SystemSettingMutation) Space() (r systemsetting.Space, exists bool)

Space returns the value of the "space" field in the mutation.

func (*SystemSettingMutation) SpaceCleared added in v1.0.5

func (m *SystemSettingMutation) SpaceCleared() bool

SpaceCleared returns if the "space" field was cleared in this mutation.

func (SystemSettingMutation) Tx added in v1.0.5

func (m SystemSettingMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*SystemSettingMutation) Type added in v1.0.5

func (m *SystemSettingMutation) Type() string

Type returns the node type of this mutation (SystemSetting).

func (*SystemSettingMutation) Typeof added in v1.0.5

func (m *SystemSettingMutation) Typeof() (r string, exists bool)

Typeof returns the value of the "typeof" field in the mutation.

func (*SystemSettingMutation) UpdateTime added in v1.0.5

func (m *SystemSettingMutation) UpdateTime() (r time.Time, exists bool)

UpdateTime returns the value of the "update_time" field in the mutation.

func (*SystemSettingMutation) Value added in v1.0.5

func (m *SystemSettingMutation) Value() (r string, exists bool)

Value returns the value of the "value" field in the mutation.

func (*SystemSettingMutation) ValueCleared added in v1.0.5

func (m *SystemSettingMutation) ValueCleared() bool

ValueCleared returns if the "value" field was cleared in this mutation.

func (*SystemSettingMutation) Where added in v1.0.8

Where appends a list predicates to the SystemSettingMutation builder.

type SystemSettingQuery added in v1.0.5

type SystemSettingQuery struct {
	// contains filtered or unexported fields
}

SystemSettingQuery is the builder for querying SystemSetting entities.

func (*SystemSettingQuery) All added in v1.0.5

All executes the query and returns a list of SystemSettings.

func (*SystemSettingQuery) AllX added in v1.0.5

func (ssq *SystemSettingQuery) AllX(ctx context.Context) []*SystemSetting

AllX is like All, but panics if an error occurs.

func (*SystemSettingQuery) Clone added in v1.0.5

func (ssq *SystemSettingQuery) Clone() *SystemSettingQuery

Clone returns a duplicate of the SystemSettingQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*SystemSettingQuery) Count added in v1.0.5

func (ssq *SystemSettingQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*SystemSettingQuery) CountX added in v1.0.5

func (ssq *SystemSettingQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*SystemSettingQuery) Exist added in v1.0.5

func (ssq *SystemSettingQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*SystemSettingQuery) ExistX added in v1.0.5

func (ssq *SystemSettingQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*SystemSettingQuery) First added in v1.0.5

First returns the first SystemSetting entity from the query. Returns a *NotFoundError when no SystemSetting was found.

func (*SystemSettingQuery) FirstID added in v1.0.5

func (ssq *SystemSettingQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first SystemSetting ID from the query. Returns a *NotFoundError when no SystemSetting ID was found.

func (*SystemSettingQuery) FirstIDX added in v1.0.5

func (ssq *SystemSettingQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*SystemSettingQuery) FirstX added in v1.0.5

func (ssq *SystemSettingQuery) FirstX(ctx context.Context) *SystemSetting

FirstX is like First, but panics if an error occurs.

func (*SystemSettingQuery) GroupBy added in v1.0.5

func (ssq *SystemSettingQuery) GroupBy(field string, fields ...string) *SystemSettingGroupBy

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 {
	Space systemsetting.Space `json:"space,omitempty"`
	Count int `json:"count,omitempty"`
}

client.SystemSetting.Query().
	GroupBy(systemsetting.FieldSpace).
	Aggregate(model.Count()).
	Scan(ctx, &v)

func (*SystemSettingQuery) IDs added in v1.0.5

func (ssq *SystemSettingQuery) IDs(ctx context.Context) ([]int, error)

IDs executes the query and returns a list of SystemSetting IDs.

func (*SystemSettingQuery) IDsX added in v1.0.5

func (ssq *SystemSettingQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*SystemSettingQuery) Limit added in v1.0.5

func (ssq *SystemSettingQuery) Limit(limit int) *SystemSettingQuery

Limit adds a limit step to the query.

func (*SystemSettingQuery) Offset added in v1.0.5

func (ssq *SystemSettingQuery) Offset(offset int) *SystemSettingQuery

Offset adds an offset step to the query.

func (*SystemSettingQuery) Only added in v1.0.5

Only returns a single SystemSetting entity found by the query, ensuring it only returns one. Returns a *NotSingularError when exactly one SystemSetting entity is not found. Returns a *NotFoundError when no SystemSetting entities are found.

func (*SystemSettingQuery) OnlyID added in v1.0.5

func (ssq *SystemSettingQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only SystemSetting ID in the query. Returns a *NotSingularError when exactly one SystemSetting ID is not found. Returns a *NotFoundError when no entities are found.

func (*SystemSettingQuery) OnlyIDX added in v1.0.5

func (ssq *SystemSettingQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*SystemSettingQuery) OnlyX added in v1.0.5

OnlyX is like Only, but panics if an error occurs.

func (*SystemSettingQuery) Order added in v1.0.5

Order adds an order step to the query.

func (*SystemSettingQuery) Select added in v1.0.5

func (ssq *SystemSettingQuery) Select(fields ...string) *SystemSettingSelect

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 {
	Space systemsetting.Space `json:"space,omitempty"`
}

client.SystemSetting.Query().
	Select(systemsetting.FieldSpace).
	Scan(ctx, &v)

func (*SystemSettingQuery) Unique added in v1.0.5

func (ssq *SystemSettingQuery) Unique(unique bool) *SystemSettingQuery

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 (*SystemSettingQuery) Where added in v1.0.5

Where adds a new predicate for the SystemSettingQuery builder.

type SystemSettingSelect added in v1.0.5

type SystemSettingSelect struct {
	*SystemSettingQuery
	// contains filtered or unexported fields
}

SystemSettingSelect is the builder for selecting fields of SystemSetting entities.

func (*SystemSettingSelect) Bool added in v1.0.5

func (sss *SystemSettingSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*SystemSettingSelect) BoolX added in v1.0.5

func (sss *SystemSettingSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*SystemSettingSelect) Bools added in v1.0.5

func (sss *SystemSettingSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*SystemSettingSelect) BoolsX added in v1.0.5

func (sss *SystemSettingSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*SystemSettingSelect) Float64 added in v1.0.5

func (sss *SystemSettingSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*SystemSettingSelect) Float64X added in v1.0.5

func (sss *SystemSettingSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*SystemSettingSelect) Float64s added in v1.0.5

func (sss *SystemSettingSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*SystemSettingSelect) Float64sX added in v1.0.5

func (sss *SystemSettingSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*SystemSettingSelect) Int added in v1.0.5

func (sss *SystemSettingSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*SystemSettingSelect) IntX added in v1.0.5

func (sss *SystemSettingSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*SystemSettingSelect) Ints added in v1.0.5

func (sss *SystemSettingSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*SystemSettingSelect) IntsX added in v1.0.5

func (sss *SystemSettingSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*SystemSettingSelect) Scan added in v1.0.5

func (sss *SystemSettingSelect) Scan(ctx context.Context, v interface{}) error

Scan applies the selector query and scans the result into the given value.

func (*SystemSettingSelect) ScanX added in v1.0.5

func (sss *SystemSettingSelect) ScanX(ctx context.Context, v interface{})

ScanX is like Scan, but panics if an error occurs.

func (*SystemSettingSelect) String added in v1.0.5

func (sss *SystemSettingSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*SystemSettingSelect) StringX added in v1.0.5

func (sss *SystemSettingSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*SystemSettingSelect) Strings added in v1.0.5

func (sss *SystemSettingSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*SystemSettingSelect) StringsX added in v1.0.5

func (sss *SystemSettingSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type SystemSettingUpdate added in v1.0.5

type SystemSettingUpdate struct {
	// contains filtered or unexported fields
}

SystemSettingUpdate is the builder for updating SystemSetting entities.

func (*SystemSettingUpdate) ClearSpace added in v1.0.5

func (ssu *SystemSettingUpdate) ClearSpace() *SystemSettingUpdate

ClearSpace clears the value of the "space" field.

func (*SystemSettingUpdate) ClearValue added in v1.0.5

func (ssu *SystemSettingUpdate) ClearValue() *SystemSettingUpdate

ClearValue clears the value of the "value" field.

func (*SystemSettingUpdate) Exec added in v1.0.5

func (ssu *SystemSettingUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*SystemSettingUpdate) ExecX added in v1.0.5

func (ssu *SystemSettingUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*SystemSettingUpdate) Mutation added in v1.0.5

func (ssu *SystemSettingUpdate) Mutation() *SystemSettingMutation

Mutation returns the SystemSettingMutation object of the builder.

func (*SystemSettingUpdate) Save added in v1.0.5

func (ssu *SystemSettingUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*SystemSettingUpdate) SaveX added in v1.0.5

func (ssu *SystemSettingUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*SystemSettingUpdate) SetKey added in v1.0.5

SetKey sets the "key" field.

func (*SystemSettingUpdate) SetNillableSpace added in v1.0.5

func (ssu *SystemSettingUpdate) SetNillableSpace(s *systemsetting.Space) *SystemSettingUpdate

SetNillableSpace sets the "space" field if the given value is not nil.

func (*SystemSettingUpdate) SetNillableTypeof added in v1.0.5

func (ssu *SystemSettingUpdate) SetNillableTypeof(s *string) *SystemSettingUpdate

SetNillableTypeof sets the "typeof" field if the given value is not nil.

func (*SystemSettingUpdate) SetNillableValue added in v1.0.5

func (ssu *SystemSettingUpdate) SetNillableValue(s *string) *SystemSettingUpdate

SetNillableValue sets the "value" field if the given value is not nil.

func (*SystemSettingUpdate) SetSpace added in v1.0.5

SetSpace sets the "space" field.

func (*SystemSettingUpdate) SetTypeof added in v1.0.5

func (ssu *SystemSettingUpdate) SetTypeof(s string) *SystemSettingUpdate

SetTypeof sets the "typeof" field.

func (*SystemSettingUpdate) SetUpdateTime added in v1.0.5

func (ssu *SystemSettingUpdate) SetUpdateTime(t time.Time) *SystemSettingUpdate

SetUpdateTime sets the "update_time" field.

func (*SystemSettingUpdate) SetValue added in v1.0.5

SetValue sets the "value" field.

func (*SystemSettingUpdate) Where added in v1.0.5

Where appends a list predicates to the SystemSettingUpdate builder.

type SystemSettingUpdateOne added in v1.0.5

type SystemSettingUpdateOne struct {
	// contains filtered or unexported fields
}

SystemSettingUpdateOne is the builder for updating a single SystemSetting entity.

func (*SystemSettingUpdateOne) ClearSpace added in v1.0.5

func (ssuo *SystemSettingUpdateOne) ClearSpace() *SystemSettingUpdateOne

ClearSpace clears the value of the "space" field.

func (*SystemSettingUpdateOne) ClearValue added in v1.0.5

func (ssuo *SystemSettingUpdateOne) ClearValue() *SystemSettingUpdateOne

ClearValue clears the value of the "value" field.

func (*SystemSettingUpdateOne) Exec added in v1.0.5

func (ssuo *SystemSettingUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*SystemSettingUpdateOne) ExecX added in v1.0.5

func (ssuo *SystemSettingUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*SystemSettingUpdateOne) Mutation added in v1.0.5

Mutation returns the SystemSettingMutation object of the builder.

func (*SystemSettingUpdateOne) Save added in v1.0.5

Save executes the query and returns the updated SystemSetting entity.

func (*SystemSettingUpdateOne) SaveX added in v1.0.5

SaveX is like Save, but panics if an error occurs.

func (*SystemSettingUpdateOne) Select added in v1.0.5

func (ssuo *SystemSettingUpdateOne) Select(field string, fields ...string) *SystemSettingUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*SystemSettingUpdateOne) SetKey added in v1.0.5

SetKey sets the "key" field.

func (*SystemSettingUpdateOne) SetNillableSpace added in v1.0.5

SetNillableSpace sets the "space" field if the given value is not nil.

func (*SystemSettingUpdateOne) SetNillableTypeof added in v1.0.5

func (ssuo *SystemSettingUpdateOne) SetNillableTypeof(s *string) *SystemSettingUpdateOne

SetNillableTypeof sets the "typeof" field if the given value is not nil.

func (*SystemSettingUpdateOne) SetNillableValue added in v1.0.5

func (ssuo *SystemSettingUpdateOne) SetNillableValue(s *string) *SystemSettingUpdateOne

SetNillableValue sets the "value" field if the given value is not nil.

func (*SystemSettingUpdateOne) SetSpace added in v1.0.5

SetSpace sets the "space" field.

func (*SystemSettingUpdateOne) SetTypeof added in v1.0.5

SetTypeof sets the "typeof" field.

func (*SystemSettingUpdateOne) SetUpdateTime added in v1.0.5

func (ssuo *SystemSettingUpdateOne) SetUpdateTime(t time.Time) *SystemSettingUpdateOne

SetUpdateTime sets the "update_time" field.

func (*SystemSettingUpdateOne) SetValue added in v1.0.5

SetValue sets the "value" field.

type SystemSettings added in v1.0.5

type SystemSettings []*SystemSetting

SystemSettings is a parsable slice of SystemSetting.

type Tx

type Tx struct {

	// Group is the client for interacting with the Group builders.
	Group *GroupClient
	// Member is the client for interacting with the Member builders.
	Member *MemberClient
	// MemberEmail is the client for interacting with the MemberEmail builders.
	MemberEmail *MemberEmailClient
	// MemberSecurityLog is the client for interacting with the MemberSecurityLog builders.
	MemberSecurityLog *MemberSecurityLogClient
	// MemberSetting is the client for interacting with the MemberSetting builders.
	MemberSetting *MemberSettingClient
	// Snippet is the client for interacting with the Snippet builders.
	Snippet *SnippetClient
	// SnippetDocument is the client for interacting with the SnippetDocument builders.
	SnippetDocument *SnippetDocumentClient
	// SnippetFolder is the client for interacting with the SnippetFolder builders.
	SnippetFolder *SnippetFolderClient
	// SnippetTag is the client for interacting with the SnippetTag builders.
	SnippetTag *SnippetTagClient
	// SystemSetting is the client for interacting with the SystemSetting builders.
	SystemSetting *SystemSettingClient
	// contains filtered or unexported fields
}

Tx is a transactional client that is created by calling Client.Tx().

func TxFromContext

func TxFromContext(ctx context.Context) *Tx

TxFromContext returns a Tx stored inside a context, or nil if there isn't one.

func (*Tx) Client

func (tx *Tx) Client() *Client

Client returns a Client that binds to current transaction.

func (*Tx) Commit

func (tx *Tx) Commit() error

Commit commits the transaction.

func (*Tx) OnCommit

func (tx *Tx) OnCommit(f CommitHook)

OnCommit adds a hook to call on commit.

func (*Tx) OnRollback

func (tx *Tx) OnRollback(f RollbackHook)

OnRollback adds a hook to call on rollback.

func (*Tx) Rollback

func (tx *Tx) Rollback() error

Rollback rollbacks the transaction.

type ValidationError

type ValidationError struct {
	Name string // Field or edge name.
	// contains filtered or unexported fields
}

ValidationError returns when validating a field fails.

func (*ValidationError) Error

func (e *ValidationError) Error() string

Error implements the error interface.

func (*ValidationError) Unwrap

func (e *ValidationError) Unwrap() error

Unwrap implements the errors.Wrapper interface.

type Value

type Value = ent.Value

ent aliases to avoid import conflicts in user's code.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL