ent

package module
v0.0.0-...-2fd3d37 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2020 License: Apache-2.0 Imports: 26 Imported by: 0

README

ent

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.
	TypeAdmin          = "Admin"
	TypeAdminLoginLog  = "AdminLoginLog"
	TypeCasbinRule     = "CasbinRule"
	TypeMember         = "Member"
	TypeMemberLoginLog = "MemberLoginLog"
	TypeNoteArticle    = "NoteArticle"
	TypeNoteFilesystem = "NoteFilesystem"
	TypeOptions        = "Options"
)

Variables

This section is empty.

Functions

func IsConstraintError

func IsConstraintError(err error) bool

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

func IsNotFound

func IsNotFound(err error) bool

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

func IsNotLoaded

func IsNotLoaded(err error) bool

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

func IsNotSingular

func IsNotSingular(err error) bool

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

func IsValidationError

func IsValidationError(err error) bool

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

func MaskNotFound

func MaskNotFound(err error) error

MaskNotFound masks nor 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 Client attached.

Types

type Admin

type Admin struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// UpdatedAt holds the value of the "updated_at" field.
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// Username holds the value of the "username" field.
	Username string `json:"username,omitempty"`
	// Nickname holds the value of the "nickname" field.
	Nickname string `json:"nickname,omitempty"`
	// Password holds the value of the "password" field.
	Password string `json:"-"`
	// Gender holds the value of the "gender" field.
	Gender int `json:"gender,omitempty"`
	// Signature holds the value of the "signature" field.
	Signature string `json:"-"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the AdminQuery when eager-loading is set.
	Edges AdminEdges `json:"edges"`
	// contains filtered or unexported fields
}

Admin is the model entity for the Admin schema.

func (*Admin) QueryLoginLogs

func (a *Admin) QueryLoginLogs() *AdminLoginLogQuery

QueryLoginLogs queries the loginLogs edge of the Admin.

func (*Admin) String

func (a *Admin) String() string

String implements the fmt.Stringer.

func (*Admin) Unwrap

func (a *Admin) Unwrap() *Admin

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

func (*Admin) Update

func (a *Admin) Update() *AdminUpdateOne

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

type AdminClient

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

AdminClient is a client for the Admin schema.

func NewAdminClient

func NewAdminClient(c config) *AdminClient

NewAdminClient returns a client for the Admin from the given config.

func (*AdminClient) Create

func (c *AdminClient) Create() *AdminCreate

Create returns a create builder for Admin.

func (*AdminClient) CreateBulk

func (c *AdminClient) CreateBulk(builders ...*AdminCreate) *AdminCreateBulk

BulkCreate returns a builder for creating a bulk of Admin entities.

func (*AdminClient) Delete

func (c *AdminClient) Delete() *AdminDelete

Delete returns a delete builder for Admin.

func (*AdminClient) DeleteOne

func (c *AdminClient) DeleteOne(a *Admin) *AdminDeleteOne

DeleteOne returns a delete builder for the given entity.

func (*AdminClient) DeleteOneID

func (c *AdminClient) DeleteOneID(id int) *AdminDeleteOne

DeleteOneID returns a delete builder for the given id.

func (*AdminClient) Get

func (c *AdminClient) Get(ctx context.Context, id int) (*Admin, error)

Get returns a Admin entity by its id.

func (*AdminClient) GetX

func (c *AdminClient) GetX(ctx context.Context, id int) *Admin

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

func (*AdminClient) Hooks

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

Hooks returns the client hooks.

func (*AdminClient) Query

func (c *AdminClient) Query() *AdminQuery

Query returns a query builder for Admin.

func (*AdminClient) QueryLoginLogs

func (c *AdminClient) QueryLoginLogs(a *Admin) *AdminLoginLogQuery

QueryLoginLogs queries the loginLogs edge of a Admin.

func (*AdminClient) Update

func (c *AdminClient) Update() *AdminUpdate

Update returns an update builder for Admin.

func (*AdminClient) UpdateOne

func (c *AdminClient) UpdateOne(a *Admin) *AdminUpdateOne

UpdateOne returns an update builder for the given entity.

func (*AdminClient) UpdateOneID

func (c *AdminClient) UpdateOneID(id int) *AdminUpdateOne

UpdateOneID returns an update builder for the given id.

func (*AdminClient) Use

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

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

type AdminCreate

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

AdminCreate is the builder for creating a Admin entity.

func (*AdminCreate) AddLoginLogIDs

func (ac *AdminCreate) AddLoginLogIDs(ids ...int) *AdminCreate

AddLoginLogIDs adds the loginLogs edge to AdminLoginLog by ids.

func (*AdminCreate) AddLoginLogs

func (ac *AdminCreate) AddLoginLogs(a ...*AdminLoginLog) *AdminCreate

AddLoginLogs adds the loginLogs edges to AdminLoginLog.

func (*AdminCreate) Mutation

func (ac *AdminCreate) Mutation() *AdminMutation

Mutation returns the AdminMutation object of the builder.

func (*AdminCreate) Save

func (ac *AdminCreate) Save(ctx context.Context) (*Admin, error)

Save creates the Admin in the database.

func (*AdminCreate) SaveX

func (ac *AdminCreate) SaveX(ctx context.Context) *Admin

SaveX calls Save and panics if Save returns an error.

func (*AdminCreate) SetCreatedAt

func (ac *AdminCreate) SetCreatedAt(t time.Time) *AdminCreate

SetCreatedAt sets the created_at field.

func (*AdminCreate) SetGender

func (ac *AdminCreate) SetGender(i int) *AdminCreate

SetGender sets the gender field.

func (*AdminCreate) SetID

func (ac *AdminCreate) SetID(i int) *AdminCreate

SetID sets the id field.

func (*AdminCreate) SetNickname

func (ac *AdminCreate) SetNickname(s string) *AdminCreate

SetNickname sets the nickname field.

func (*AdminCreate) SetNillableCreatedAt

func (ac *AdminCreate) SetNillableCreatedAt(t *time.Time) *AdminCreate

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

func (*AdminCreate) SetNillableGender

func (ac *AdminCreate) SetNillableGender(i *int) *AdminCreate

SetNillableGender sets the gender field if the given value is not nil.

func (*AdminCreate) SetNillableNickname

func (ac *AdminCreate) SetNillableNickname(s *string) *AdminCreate

SetNillableNickname sets the nickname field if the given value is not nil.

func (*AdminCreate) SetNillableUpdatedAt

func (ac *AdminCreate) SetNillableUpdatedAt(t *time.Time) *AdminCreate

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

func (*AdminCreate) SetPassword

func (ac *AdminCreate) SetPassword(s string) *AdminCreate

SetPassword sets the password field.

func (*AdminCreate) SetSignature

func (ac *AdminCreate) SetSignature(s string) *AdminCreate

SetSignature sets the signature field.

func (*AdminCreate) SetUpdatedAt

func (ac *AdminCreate) SetUpdatedAt(t time.Time) *AdminCreate

SetUpdatedAt sets the updated_at field.

func (*AdminCreate) SetUsername

func (ac *AdminCreate) SetUsername(s string) *AdminCreate

SetUsername sets the username field.

type AdminCreateBulk

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

AdminCreateBulk is the builder for creating a bulk of Admin entities.

func (*AdminCreateBulk) Save

func (acb *AdminCreateBulk) Save(ctx context.Context) ([]*Admin, error)

Save creates the Admin entities in the database.

func (*AdminCreateBulk) SaveX

func (acb *AdminCreateBulk) SaveX(ctx context.Context) []*Admin

SaveX calls Save and panics if Save returns an error.

type AdminDelete

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

AdminDelete is the builder for deleting a Admin entity.

func (*AdminDelete) Exec

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

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

func (*AdminDelete) ExecX

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

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

func (*AdminDelete) Where

func (ad *AdminDelete) Where(ps ...predicate.Admin) *AdminDelete

Where adds a new predicate to the delete builder.

type AdminDeleteOne

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

AdminDeleteOne is the builder for deleting a single Admin entity.

func (*AdminDeleteOne) Exec

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

Exec executes the deletion query.

func (*AdminDeleteOne) ExecX

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

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

type AdminEdges

type AdminEdges struct {
	// LoginLogs holds the value of the loginLogs edge.
	LoginLogs []*AdminLoginLog
	// contains filtered or unexported fields
}

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

func (AdminEdges) LoginLogsOrErr

func (e AdminEdges) LoginLogsOrErr() ([]*AdminLoginLog, error)

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

type AdminGroupBy

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

AdminGroupBy is the builder for group-by Admin entities.

func (*AdminGroupBy) Aggregate

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

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

func (*AdminGroupBy) Bool

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

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

func (*AdminGroupBy) BoolX

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

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

func (*AdminGroupBy) Bools

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

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

func (*AdminGroupBy) BoolsX

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

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

func (*AdminGroupBy) Float64

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

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

func (*AdminGroupBy) Float64X

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

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

func (*AdminGroupBy) Float64s

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

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

func (*AdminGroupBy) Float64sX

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

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

func (*AdminGroupBy) Int

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

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

func (*AdminGroupBy) IntX

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

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

func (*AdminGroupBy) Ints

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

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

func (*AdminGroupBy) IntsX

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

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

func (*AdminGroupBy) Scan

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

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

func (*AdminGroupBy) ScanX

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

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

func (*AdminGroupBy) String

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

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

func (*AdminGroupBy) StringX

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

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

func (*AdminGroupBy) Strings

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

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

func (*AdminGroupBy) StringsX

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

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

type AdminLoginLog

type AdminLoginLog struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// CreateTime holds the value of the "create_time" field.
	CreateTime time.Time `json:"create_time,omitempty"`
	// AdminID holds the value of the "admin_id" field.
	AdminID int `json:"admin_id,omitempty"`
	// IP holds the value of the "ip" field.
	IP *string `json:"ip,omitempty"`
	// UserAgent holds the value of the "user_agent" field.
	UserAgent *string `json:"user_agent,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the AdminLoginLogQuery when eager-loading is set.
	Edges AdminLoginLogEdges `json:"edges"`
	// contains filtered or unexported fields
}

AdminLoginLog is the model entity for the AdminLoginLog schema.

func (*AdminLoginLog) QueryOwner

func (all *AdminLoginLog) QueryOwner() *AdminQuery

QueryOwner queries the owner edge of the AdminLoginLog.

func (*AdminLoginLog) String

func (all *AdminLoginLog) String() string

String implements the fmt.Stringer.

func (*AdminLoginLog) Unwrap

func (all *AdminLoginLog) Unwrap() *AdminLoginLog

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

func (*AdminLoginLog) Update

func (all *AdminLoginLog) Update() *AdminLoginLogUpdateOne

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

type AdminLoginLogClient

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

AdminLoginLogClient is a client for the AdminLoginLog schema.

func NewAdminLoginLogClient

func NewAdminLoginLogClient(c config) *AdminLoginLogClient

NewAdminLoginLogClient returns a client for the AdminLoginLog from the given config.

func (*AdminLoginLogClient) Create

Create returns a create builder for AdminLoginLog.

func (*AdminLoginLogClient) CreateBulk

BulkCreate returns a builder for creating a bulk of AdminLoginLog entities.

func (*AdminLoginLogClient) Delete

Delete returns a delete builder for AdminLoginLog.

func (*AdminLoginLogClient) DeleteOne

DeleteOne returns a delete builder for the given entity.

func (*AdminLoginLogClient) DeleteOneID

func (c *AdminLoginLogClient) DeleteOneID(id int) *AdminLoginLogDeleteOne

DeleteOneID returns a delete builder for the given id.

func (*AdminLoginLogClient) Get

Get returns a AdminLoginLog entity by its id.

func (*AdminLoginLogClient) GetX

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

func (*AdminLoginLogClient) Hooks

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

Hooks returns the client hooks.

func (*AdminLoginLogClient) Query

Query returns a query builder for AdminLoginLog.

func (*AdminLoginLogClient) QueryOwner

func (c *AdminLoginLogClient) QueryOwner(all *AdminLoginLog) *AdminQuery

QueryOwner queries the owner edge of a AdminLoginLog.

func (*AdminLoginLogClient) Update

Update returns an update builder for AdminLoginLog.

func (*AdminLoginLogClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*AdminLoginLogClient) UpdateOneID

func (c *AdminLoginLogClient) UpdateOneID(id int) *AdminLoginLogUpdateOne

UpdateOneID returns an update builder for the given id.

func (*AdminLoginLogClient) Use

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

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

type AdminLoginLogCreate

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

AdminLoginLogCreate is the builder for creating a AdminLoginLog entity.

func (*AdminLoginLogCreate) Mutation

func (allc *AdminLoginLogCreate) Mutation() *AdminLoginLogMutation

Mutation returns the AdminLoginLogMutation object of the builder.

func (*AdminLoginLogCreate) Save

Save creates the AdminLoginLog in the database.

func (*AdminLoginLogCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*AdminLoginLogCreate) SetAdminID

func (allc *AdminLoginLogCreate) SetAdminID(i int) *AdminLoginLogCreate

SetAdminID sets the admin_id field.

func (*AdminLoginLogCreate) SetCreateTime

func (allc *AdminLoginLogCreate) SetCreateTime(t time.Time) *AdminLoginLogCreate

SetCreateTime sets the create_time field.

func (*AdminLoginLogCreate) SetID

SetID sets the id field.

func (*AdminLoginLogCreate) SetIP

SetIP sets the ip field.

func (*AdminLoginLogCreate) SetNillableCreateTime

func (allc *AdminLoginLogCreate) SetNillableCreateTime(t *time.Time) *AdminLoginLogCreate

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

func (*AdminLoginLogCreate) SetNillableIP

func (allc *AdminLoginLogCreate) SetNillableIP(s *string) *AdminLoginLogCreate

SetNillableIP sets the ip field if the given value is not nil.

func (*AdminLoginLogCreate) SetNillableOwnerID

func (allc *AdminLoginLogCreate) SetNillableOwnerID(id *int) *AdminLoginLogCreate

SetNillableOwnerID sets the owner edge to Admin by id if the given value is not nil.

func (*AdminLoginLogCreate) SetNillableUserAgent

func (allc *AdminLoginLogCreate) SetNillableUserAgent(s *string) *AdminLoginLogCreate

SetNillableUserAgent sets the user_agent field if the given value is not nil.

func (*AdminLoginLogCreate) SetOwner

func (allc *AdminLoginLogCreate) SetOwner(a *Admin) *AdminLoginLogCreate

SetOwner sets the owner edge to Admin.

func (*AdminLoginLogCreate) SetOwnerID

func (allc *AdminLoginLogCreate) SetOwnerID(id int) *AdminLoginLogCreate

SetOwnerID sets the owner edge to Admin by id.

func (*AdminLoginLogCreate) SetUserAgent

func (allc *AdminLoginLogCreate) SetUserAgent(s string) *AdminLoginLogCreate

SetUserAgent sets the user_agent field.

type AdminLoginLogCreateBulk

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

AdminLoginLogCreateBulk is the builder for creating a bulk of AdminLoginLog entities.

func (*AdminLoginLogCreateBulk) Save

Save creates the AdminLoginLog entities in the database.

func (*AdminLoginLogCreateBulk) SaveX

SaveX calls Save and panics if Save returns an error.

type AdminLoginLogDelete

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

AdminLoginLogDelete is the builder for deleting a AdminLoginLog entity.

func (*AdminLoginLogDelete) Exec

func (alld *AdminLoginLogDelete) Exec(ctx context.Context) (int, error)

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

func (*AdminLoginLogDelete) ExecX

func (alld *AdminLoginLogDelete) ExecX(ctx context.Context) int

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

func (*AdminLoginLogDelete) Where

Where adds a new predicate to the delete builder.

type AdminLoginLogDeleteOne

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

AdminLoginLogDeleteOne is the builder for deleting a single AdminLoginLog entity.

func (*AdminLoginLogDeleteOne) Exec

func (alldo *AdminLoginLogDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*AdminLoginLogDeleteOne) ExecX

func (alldo *AdminLoginLogDeleteOne) ExecX(ctx context.Context)

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

type AdminLoginLogEdges

type AdminLoginLogEdges struct {
	// Owner holds the value of the owner edge.
	Owner *Admin
	// contains filtered or unexported fields
}

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

func (AdminLoginLogEdges) OwnerOrErr

func (e AdminLoginLogEdges) OwnerOrErr() (*Admin, error)

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

type AdminLoginLogGroupBy

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

AdminLoginLogGroupBy is the builder for group-by AdminLoginLog entities.

func (*AdminLoginLogGroupBy) Aggregate

func (allgb *AdminLoginLogGroupBy) Aggregate(fns ...AggregateFunc) *AdminLoginLogGroupBy

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

func (*AdminLoginLogGroupBy) Bool

func (allgb *AdminLoginLogGroupBy) Bool(ctx context.Context) (_ bool, err error)

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

func (*AdminLoginLogGroupBy) BoolX

func (allgb *AdminLoginLogGroupBy) BoolX(ctx context.Context) bool

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

func (*AdminLoginLogGroupBy) Bools

func (allgb *AdminLoginLogGroupBy) Bools(ctx context.Context) ([]bool, error)

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

func (*AdminLoginLogGroupBy) BoolsX

func (allgb *AdminLoginLogGroupBy) BoolsX(ctx context.Context) []bool

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

func (*AdminLoginLogGroupBy) Float64

func (allgb *AdminLoginLogGroupBy) Float64(ctx context.Context) (_ float64, err error)

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

func (*AdminLoginLogGroupBy) Float64X

func (allgb *AdminLoginLogGroupBy) Float64X(ctx context.Context) float64

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

func (*AdminLoginLogGroupBy) Float64s

func (allgb *AdminLoginLogGroupBy) Float64s(ctx context.Context) ([]float64, error)

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

func (*AdminLoginLogGroupBy) Float64sX

func (allgb *AdminLoginLogGroupBy) Float64sX(ctx context.Context) []float64

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

func (*AdminLoginLogGroupBy) Int

func (allgb *AdminLoginLogGroupBy) Int(ctx context.Context) (_ int, err error)

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

func (*AdminLoginLogGroupBy) IntX

func (allgb *AdminLoginLogGroupBy) IntX(ctx context.Context) int

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

func (*AdminLoginLogGroupBy) Ints

func (allgb *AdminLoginLogGroupBy) Ints(ctx context.Context) ([]int, error)

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

func (*AdminLoginLogGroupBy) IntsX

func (allgb *AdminLoginLogGroupBy) IntsX(ctx context.Context) []int

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

func (*AdminLoginLogGroupBy) Scan

func (allgb *AdminLoginLogGroupBy) Scan(ctx context.Context, v interface{}) error

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

func (*AdminLoginLogGroupBy) ScanX

func (allgb *AdminLoginLogGroupBy) ScanX(ctx context.Context, v interface{})

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

func (*AdminLoginLogGroupBy) String

func (allgb *AdminLoginLogGroupBy) String(ctx context.Context) (_ string, err error)

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

func (*AdminLoginLogGroupBy) StringX

func (allgb *AdminLoginLogGroupBy) StringX(ctx context.Context) string

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

func (*AdminLoginLogGroupBy) Strings

func (allgb *AdminLoginLogGroupBy) Strings(ctx context.Context) ([]string, error)

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

func (*AdminLoginLogGroupBy) StringsX

func (allgb *AdminLoginLogGroupBy) StringsX(ctx context.Context) []string

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

type AdminLoginLogMutation

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

AdminLoginLogMutation represents an operation that mutate the AdminLoginLogs nodes in the graph.

func (*AdminLoginLogMutation) AddAdminID

func (m *AdminLoginLogMutation) AddAdminID(i int)

AddAdminID adds i to admin_id.

func (*AdminLoginLogMutation) AddField

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

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

func (*AdminLoginLogMutation) AddedAdminID

func (m *AdminLoginLogMutation) AddedAdminID() (r int, exists bool)

AddedAdminID returns the value that was added to the admin_id field in this mutation.

func (*AdminLoginLogMutation) AddedEdges

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

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

func (*AdminLoginLogMutation) AddedField

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

AddedField returns the numeric value that was in/decremented from a field with the given name. The second value indicates that this field was not set, or was not define in the schema.

func (*AdminLoginLogMutation) AddedFields

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

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

func (*AdminLoginLogMutation) AddedIDs

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

AddedIDs returns all ids (to other nodes) that were added for the given edge name.

func (*AdminLoginLogMutation) AdminID

func (m *AdminLoginLogMutation) AdminID() (r int, exists bool)

AdminID returns the admin_id value in the mutation.

func (*AdminLoginLogMutation) ClearEdge

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

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

func (*AdminLoginLogMutation) ClearField

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

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

func (*AdminLoginLogMutation) ClearIP

func (m *AdminLoginLogMutation) ClearIP()

ClearIP clears the value of ip.

func (*AdminLoginLogMutation) ClearOwner

func (m *AdminLoginLogMutation) ClearOwner()

ClearOwner clears the owner edge to Admin.

func (*AdminLoginLogMutation) ClearUserAgent

func (m *AdminLoginLogMutation) ClearUserAgent()

ClearUserAgent clears the value of user_agent.

func (*AdminLoginLogMutation) ClearedEdges

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

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

func (*AdminLoginLogMutation) ClearedFields

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

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

func (AdminLoginLogMutation) Client

func (m AdminLoginLogMutation) 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 (*AdminLoginLogMutation) CreateTime

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

CreateTime returns the create_time value in the mutation.

func (*AdminLoginLogMutation) EdgeCleared

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

EdgeCleared returns a boolean indicates if this edge was cleared in this mutation.

func (*AdminLoginLogMutation) Field

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

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

func (*AdminLoginLogMutation) FieldCleared

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

FieldCleared returns a boolean indicates if this field was cleared in this mutation.

func (*AdminLoginLogMutation) Fields

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

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

func (*AdminLoginLogMutation) ID

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

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

func (*AdminLoginLogMutation) IP

func (m *AdminLoginLogMutation) IP() (r string, exists bool)

IP returns the ip value in the mutation.

func (*AdminLoginLogMutation) IPCleared

func (m *AdminLoginLogMutation) IPCleared() bool

IPCleared returns if the field ip was cleared in this mutation.

func (*AdminLoginLogMutation) OldAdminID

func (m *AdminLoginLogMutation) OldAdminID(ctx context.Context) (v int, err error)

OldAdminID returns the old admin_id value of the AdminLoginLog. If the AdminLoginLog 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 database query fails.

func (*AdminLoginLogMutation) OldCreateTime

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

OldCreateTime returns the old create_time value of the AdminLoginLog. If the AdminLoginLog 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 database query fails.

func (*AdminLoginLogMutation) OldField

func (m *AdminLoginLogMutation) 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 was failed.

func (*AdminLoginLogMutation) OldIP

func (m *AdminLoginLogMutation) OldIP(ctx context.Context) (v *string, err error)

OldIP returns the old ip value of the AdminLoginLog. If the AdminLoginLog 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 database query fails.

func (*AdminLoginLogMutation) OldUserAgent

func (m *AdminLoginLogMutation) OldUserAgent(ctx context.Context) (v *string, err error)

OldUserAgent returns the old user_agent value of the AdminLoginLog. If the AdminLoginLog 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 database query fails.

func (*AdminLoginLogMutation) Op

func (m *AdminLoginLogMutation) Op() Op

Op returns the operation name.

func (*AdminLoginLogMutation) OwnerCleared

func (m *AdminLoginLogMutation) OwnerCleared() bool

OwnerCleared returns if the edge owner was cleared.

func (*AdminLoginLogMutation) OwnerID

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

OwnerID returns the owner id in the mutation.

func (*AdminLoginLogMutation) OwnerIDs

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

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

func (*AdminLoginLogMutation) RemovedEdges

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

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

func (*AdminLoginLogMutation) RemovedIDs

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

RemovedIDs returns all ids (to other nodes) that were removed for the given edge name.

func (*AdminLoginLogMutation) ResetAdminID

func (m *AdminLoginLogMutation) ResetAdminID()

ResetAdminID reset all changes of the "admin_id" field.

func (*AdminLoginLogMutation) ResetCreateTime

func (m *AdminLoginLogMutation) ResetCreateTime()

ResetCreateTime reset all changes of the "create_time" field.

func (*AdminLoginLogMutation) ResetEdge

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

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

func (*AdminLoginLogMutation) ResetField

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

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

func (*AdminLoginLogMutation) ResetIP

func (m *AdminLoginLogMutation) ResetIP()

ResetIP reset all changes of the "ip" field.

func (*AdminLoginLogMutation) ResetOwner

func (m *AdminLoginLogMutation) ResetOwner()

ResetOwner reset all changes of the "owner" edge.

func (*AdminLoginLogMutation) ResetUserAgent

func (m *AdminLoginLogMutation) ResetUserAgent()

ResetUserAgent reset all changes of the "user_agent" field.

func (*AdminLoginLogMutation) SetAdminID

func (m *AdminLoginLogMutation) SetAdminID(i int)

SetAdminID sets the admin_id field.

func (*AdminLoginLogMutation) SetCreateTime

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

SetCreateTime sets the create_time field.

func (*AdminLoginLogMutation) SetField

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

SetField sets the value for the given name. It returns an error if the field is not defined in the schema, or if the type mismatch the field type.

func (*AdminLoginLogMutation) SetID

func (m *AdminLoginLogMutation) SetID(id int)

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

func (*AdminLoginLogMutation) SetIP

func (m *AdminLoginLogMutation) SetIP(s string)

SetIP sets the ip field.

func (*AdminLoginLogMutation) SetOwnerID

func (m *AdminLoginLogMutation) SetOwnerID(id int)

SetOwnerID sets the owner edge to Admin by id.

func (*AdminLoginLogMutation) SetUserAgent

func (m *AdminLoginLogMutation) SetUserAgent(s string)

SetUserAgent sets the user_agent field.

func (AdminLoginLogMutation) Tx

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

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

func (*AdminLoginLogMutation) Type

func (m *AdminLoginLogMutation) Type() string

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

func (*AdminLoginLogMutation) UserAgent

func (m *AdminLoginLogMutation) UserAgent() (r string, exists bool)

UserAgent returns the user_agent value in the mutation.

func (*AdminLoginLogMutation) UserAgentCleared

func (m *AdminLoginLogMutation) UserAgentCleared() bool

UserAgentCleared returns if the field user_agent was cleared in this mutation.

type AdminLoginLogQuery

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

AdminLoginLogQuery is the builder for querying AdminLoginLog entities.

func (*AdminLoginLogQuery) All

func (allq *AdminLoginLogQuery) All(ctx context.Context) ([]*AdminLoginLog, error)

All executes the query and returns a list of AdminLoginLogs.

func (*AdminLoginLogQuery) AllX

func (allq *AdminLoginLogQuery) AllX(ctx context.Context) []*AdminLoginLog

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

func (*AdminLoginLogQuery) Clone

func (allq *AdminLoginLogQuery) Clone() *AdminLoginLogQuery

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

func (*AdminLoginLogQuery) Count

func (allq *AdminLoginLogQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*AdminLoginLogQuery) CountX

func (allq *AdminLoginLogQuery) CountX(ctx context.Context) int

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

func (*AdminLoginLogQuery) Exist

func (allq *AdminLoginLogQuery) Exist(ctx context.Context) (bool, error)

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

func (*AdminLoginLogQuery) ExistX

func (allq *AdminLoginLogQuery) ExistX(ctx context.Context) bool

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

func (*AdminLoginLogQuery) First

func (allq *AdminLoginLogQuery) First(ctx context.Context) (*AdminLoginLog, error)

First returns the first AdminLoginLog entity in the query. Returns *NotFoundError when no adminloginlog was found.

func (*AdminLoginLogQuery) FirstID

func (allq *AdminLoginLogQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first AdminLoginLog id in the query. Returns *NotFoundError when no id was found.

func (*AdminLoginLogQuery) FirstX

func (allq *AdminLoginLogQuery) FirstX(ctx context.Context) *AdminLoginLog

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

func (*AdminLoginLogQuery) FirstXID

func (allq *AdminLoginLogQuery) FirstXID(ctx context.Context) int

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

func (*AdminLoginLogQuery) GroupBy

func (allq *AdminLoginLogQuery) GroupBy(field string, fields ...string) *AdminLoginLogGroupBy

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

client.AdminLoginLog.Query().
	GroupBy(adminloginlog.FieldCreateTime).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*AdminLoginLogQuery) IDs

func (allq *AdminLoginLogQuery) IDs(ctx context.Context) ([]int, error)

IDs executes the query and returns a list of AdminLoginLog ids.

func (*AdminLoginLogQuery) IDsX

func (allq *AdminLoginLogQuery) IDsX(ctx context.Context) []int

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

func (*AdminLoginLogQuery) Limit

func (allq *AdminLoginLogQuery) Limit(limit int) *AdminLoginLogQuery

Limit adds a limit step to the query.

func (*AdminLoginLogQuery) Offset

func (allq *AdminLoginLogQuery) Offset(offset int) *AdminLoginLogQuery

Offset adds an offset step to the query.

func (*AdminLoginLogQuery) Only

Only returns the only AdminLoginLog entity in the query, returns an error if not exactly one entity was returned.

func (*AdminLoginLogQuery) OnlyID

func (allq *AdminLoginLogQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID returns the only AdminLoginLog id in the query, returns an error if not exactly one id was returned.

func (*AdminLoginLogQuery) OnlyIDX

func (allq *AdminLoginLogQuery) OnlyIDX(ctx context.Context) int

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

func (*AdminLoginLogQuery) OnlyX

func (allq *AdminLoginLogQuery) OnlyX(ctx context.Context) *AdminLoginLog

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

func (*AdminLoginLogQuery) Order

func (allq *AdminLoginLogQuery) Order(o ...OrderFunc) *AdminLoginLogQuery

Order adds an order step to the query.

func (*AdminLoginLogQuery) QueryOwner

func (allq *AdminLoginLogQuery) QueryOwner() *AdminQuery

QueryOwner chains the current query on the owner edge.

func (*AdminLoginLogQuery) Select

func (allq *AdminLoginLogQuery) Select(field string, fields ...string) *AdminLoginLogSelect

Select one or more fields from the given query.

Example:

var v []struct {
	CreateTime time.Time `json:"create_time,omitempty"`
}

client.AdminLoginLog.Query().
	Select(adminloginlog.FieldCreateTime).
	Scan(ctx, &v)

func (*AdminLoginLogQuery) Where

Where adds a new predicate for the builder.

func (*AdminLoginLogQuery) WithOwner

func (allq *AdminLoginLogQuery) WithOwner(opts ...func(*AdminQuery)) *AdminLoginLogQuery
WithOwner tells the query-builder to eager-loads the nodes that are connected to

the "owner" edge. The optional arguments used to configure the query builder of the edge.

type AdminLoginLogSelect

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

AdminLoginLogSelect is the builder for select fields of AdminLoginLog entities.

func (*AdminLoginLogSelect) Bool

func (alls *AdminLoginLogSelect) Bool(ctx context.Context) (_ bool, err error)

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

func (*AdminLoginLogSelect) BoolX

func (alls *AdminLoginLogSelect) BoolX(ctx context.Context) bool

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

func (*AdminLoginLogSelect) Bools

func (alls *AdminLoginLogSelect) Bools(ctx context.Context) ([]bool, error)

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

func (*AdminLoginLogSelect) BoolsX

func (alls *AdminLoginLogSelect) BoolsX(ctx context.Context) []bool

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

func (*AdminLoginLogSelect) Float64

func (alls *AdminLoginLogSelect) Float64(ctx context.Context) (_ float64, err error)

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

func (*AdminLoginLogSelect) Float64X

func (alls *AdminLoginLogSelect) Float64X(ctx context.Context) float64

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

func (*AdminLoginLogSelect) Float64s

func (alls *AdminLoginLogSelect) Float64s(ctx context.Context) ([]float64, error)

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

func (*AdminLoginLogSelect) Float64sX

func (alls *AdminLoginLogSelect) Float64sX(ctx context.Context) []float64

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

func (*AdminLoginLogSelect) Int

func (alls *AdminLoginLogSelect) Int(ctx context.Context) (_ int, err error)

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

func (*AdminLoginLogSelect) IntX

func (alls *AdminLoginLogSelect) IntX(ctx context.Context) int

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

func (*AdminLoginLogSelect) Ints

func (alls *AdminLoginLogSelect) Ints(ctx context.Context) ([]int, error)

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

func (*AdminLoginLogSelect) IntsX

func (alls *AdminLoginLogSelect) IntsX(ctx context.Context) []int

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

func (*AdminLoginLogSelect) Scan

func (alls *AdminLoginLogSelect) Scan(ctx context.Context, v interface{}) error

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

func (*AdminLoginLogSelect) ScanX

func (alls *AdminLoginLogSelect) ScanX(ctx context.Context, v interface{})

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

func (*AdminLoginLogSelect) String

func (alls *AdminLoginLogSelect) String(ctx context.Context) (_ string, err error)

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

func (*AdminLoginLogSelect) StringX

func (alls *AdminLoginLogSelect) StringX(ctx context.Context) string

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

func (*AdminLoginLogSelect) Strings

func (alls *AdminLoginLogSelect) Strings(ctx context.Context) ([]string, error)

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

func (*AdminLoginLogSelect) StringsX

func (alls *AdminLoginLogSelect) StringsX(ctx context.Context) []string

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

type AdminLoginLogUpdate

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

AdminLoginLogUpdate is the builder for updating AdminLoginLog entities.

func (*AdminLoginLogUpdate) AddAdminID

func (allu *AdminLoginLogUpdate) AddAdminID(i int) *AdminLoginLogUpdate

AddAdminID adds i to admin_id.

func (*AdminLoginLogUpdate) ClearIP

func (allu *AdminLoginLogUpdate) ClearIP() *AdminLoginLogUpdate

ClearIP clears the value of ip.

func (*AdminLoginLogUpdate) ClearOwner

func (allu *AdminLoginLogUpdate) ClearOwner() *AdminLoginLogUpdate

ClearOwner clears the "owner" edge to type Admin.

func (*AdminLoginLogUpdate) ClearUserAgent

func (allu *AdminLoginLogUpdate) ClearUserAgent() *AdminLoginLogUpdate

ClearUserAgent clears the value of user_agent.

func (*AdminLoginLogUpdate) Exec

func (allu *AdminLoginLogUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*AdminLoginLogUpdate) ExecX

func (allu *AdminLoginLogUpdate) ExecX(ctx context.Context)

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

func (*AdminLoginLogUpdate) Mutation

func (allu *AdminLoginLogUpdate) Mutation() *AdminLoginLogMutation

Mutation returns the AdminLoginLogMutation object of the builder.

func (*AdminLoginLogUpdate) Save

func (allu *AdminLoginLogUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of rows/vertices matched by this operation.

func (*AdminLoginLogUpdate) SaveX

func (allu *AdminLoginLogUpdate) SaveX(ctx context.Context) int

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

func (*AdminLoginLogUpdate) SetAdminID

func (allu *AdminLoginLogUpdate) SetAdminID(i int) *AdminLoginLogUpdate

SetAdminID sets the admin_id field.

func (*AdminLoginLogUpdate) SetIP

SetIP sets the ip field.

func (*AdminLoginLogUpdate) SetNillableIP

func (allu *AdminLoginLogUpdate) SetNillableIP(s *string) *AdminLoginLogUpdate

SetNillableIP sets the ip field if the given value is not nil.

func (*AdminLoginLogUpdate) SetNillableOwnerID

func (allu *AdminLoginLogUpdate) SetNillableOwnerID(id *int) *AdminLoginLogUpdate

SetNillableOwnerID sets the owner edge to Admin by id if the given value is not nil.

func (*AdminLoginLogUpdate) SetNillableUserAgent

func (allu *AdminLoginLogUpdate) SetNillableUserAgent(s *string) *AdminLoginLogUpdate

SetNillableUserAgent sets the user_agent field if the given value is not nil.

func (*AdminLoginLogUpdate) SetOwner

func (allu *AdminLoginLogUpdate) SetOwner(a *Admin) *AdminLoginLogUpdate

SetOwner sets the owner edge to Admin.

func (*AdminLoginLogUpdate) SetOwnerID

func (allu *AdminLoginLogUpdate) SetOwnerID(id int) *AdminLoginLogUpdate

SetOwnerID sets the owner edge to Admin by id.

func (*AdminLoginLogUpdate) SetUserAgent

func (allu *AdminLoginLogUpdate) SetUserAgent(s string) *AdminLoginLogUpdate

SetUserAgent sets the user_agent field.

func (*AdminLoginLogUpdate) Where

Where adds a new predicate for the builder.

type AdminLoginLogUpdateOne

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

AdminLoginLogUpdateOne is the builder for updating a single AdminLoginLog entity.

func (*AdminLoginLogUpdateOne) AddAdminID

func (alluo *AdminLoginLogUpdateOne) AddAdminID(i int) *AdminLoginLogUpdateOne

AddAdminID adds i to admin_id.

func (*AdminLoginLogUpdateOne) ClearIP

ClearIP clears the value of ip.

func (*AdminLoginLogUpdateOne) ClearOwner

func (alluo *AdminLoginLogUpdateOne) ClearOwner() *AdminLoginLogUpdateOne

ClearOwner clears the "owner" edge to type Admin.

func (*AdminLoginLogUpdateOne) ClearUserAgent

func (alluo *AdminLoginLogUpdateOne) ClearUserAgent() *AdminLoginLogUpdateOne

ClearUserAgent clears the value of user_agent.

func (*AdminLoginLogUpdateOne) Exec

func (alluo *AdminLoginLogUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*AdminLoginLogUpdateOne) ExecX

func (alluo *AdminLoginLogUpdateOne) ExecX(ctx context.Context)

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

func (*AdminLoginLogUpdateOne) Mutation

func (alluo *AdminLoginLogUpdateOne) Mutation() *AdminLoginLogMutation

Mutation returns the AdminLoginLogMutation object of the builder.

func (*AdminLoginLogUpdateOne) Save

Save executes the query and returns the updated entity.

func (*AdminLoginLogUpdateOne) SaveX

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

func (*AdminLoginLogUpdateOne) SetAdminID

func (alluo *AdminLoginLogUpdateOne) SetAdminID(i int) *AdminLoginLogUpdateOne

SetAdminID sets the admin_id field.

func (*AdminLoginLogUpdateOne) SetIP

SetIP sets the ip field.

func (*AdminLoginLogUpdateOne) SetNillableIP

func (alluo *AdminLoginLogUpdateOne) SetNillableIP(s *string) *AdminLoginLogUpdateOne

SetNillableIP sets the ip field if the given value is not nil.

func (*AdminLoginLogUpdateOne) SetNillableOwnerID

func (alluo *AdminLoginLogUpdateOne) SetNillableOwnerID(id *int) *AdminLoginLogUpdateOne

SetNillableOwnerID sets the owner edge to Admin by id if the given value is not nil.

func (*AdminLoginLogUpdateOne) SetNillableUserAgent

func (alluo *AdminLoginLogUpdateOne) SetNillableUserAgent(s *string) *AdminLoginLogUpdateOne

SetNillableUserAgent sets the user_agent field if the given value is not nil.

func (*AdminLoginLogUpdateOne) SetOwner

SetOwner sets the owner edge to Admin.

func (*AdminLoginLogUpdateOne) SetOwnerID

func (alluo *AdminLoginLogUpdateOne) SetOwnerID(id int) *AdminLoginLogUpdateOne

SetOwnerID sets the owner edge to Admin by id.

func (*AdminLoginLogUpdateOne) SetUserAgent

func (alluo *AdminLoginLogUpdateOne) SetUserAgent(s string) *AdminLoginLogUpdateOne

SetUserAgent sets the user_agent field.

type AdminLoginLogs

type AdminLoginLogs []*AdminLoginLog

AdminLoginLogs is a parsable slice of AdminLoginLog.

type AdminMutation

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

AdminMutation represents an operation that mutate the Admins nodes in the graph.

func (*AdminMutation) AddField

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

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

func (*AdminMutation) AddGender

func (m *AdminMutation) AddGender(i int)

AddGender adds i to gender.

func (*AdminMutation) AddLoginLogIDs

func (m *AdminMutation) AddLoginLogIDs(ids ...int)

AddLoginLogIDs adds the loginLogs edge to AdminLoginLog by ids.

func (*AdminMutation) AddedEdges

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

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

func (*AdminMutation) AddedField

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

AddedField returns the numeric value that was in/decremented from a field with the given name. The second value indicates that this field was not set, or was not define in the schema.

func (*AdminMutation) AddedFields

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

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

func (*AdminMutation) AddedGender

func (m *AdminMutation) AddedGender() (r int, exists bool)

AddedGender returns the value that was added to the gender field in this mutation.

func (*AdminMutation) AddedIDs

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

AddedIDs returns all ids (to other nodes) that were added for the given edge name.

func (*AdminMutation) ClearEdge

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

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

func (*AdminMutation) ClearField

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

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

func (*AdminMutation) ClearGender

func (m *AdminMutation) ClearGender()

ClearGender clears the value of gender.

func (*AdminMutation) ClearLoginLogs

func (m *AdminMutation) ClearLoginLogs()

ClearLoginLogs clears the loginLogs edge to AdminLoginLog.

func (*AdminMutation) ClearNickname

func (m *AdminMutation) ClearNickname()

ClearNickname clears the value of nickname.

func (*AdminMutation) ClearedEdges

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

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

func (*AdminMutation) ClearedFields

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

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

func (AdminMutation) Client

func (m AdminMutation) 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 (*AdminMutation) CreatedAt

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

CreatedAt returns the created_at value in the mutation.

func (*AdminMutation) EdgeCleared

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

EdgeCleared returns a boolean indicates if this edge was cleared in this mutation.

func (*AdminMutation) Field

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

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

func (*AdminMutation) FieldCleared

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

FieldCleared returns a boolean indicates if this field was cleared in this mutation.

func (*AdminMutation) Fields

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

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

func (*AdminMutation) Gender

func (m *AdminMutation) Gender() (r int, exists bool)

Gender returns the gender value in the mutation.

func (*AdminMutation) GenderCleared

func (m *AdminMutation) GenderCleared() bool

GenderCleared returns if the field gender was cleared in this mutation.

func (*AdminMutation) ID

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

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

func (*AdminMutation) LoginLogsCleared

func (m *AdminMutation) LoginLogsCleared() bool

LoginLogsCleared returns if the edge loginLogs was cleared.

func (*AdminMutation) LoginLogsIDs

func (m *AdminMutation) LoginLogsIDs() (ids []int)

LoginLogsIDs returns the loginLogs ids in the mutation.

func (*AdminMutation) Nickname

func (m *AdminMutation) Nickname() (r string, exists bool)

Nickname returns the nickname value in the mutation.

func (*AdminMutation) NicknameCleared

func (m *AdminMutation) NicknameCleared() bool

NicknameCleared returns if the field nickname was cleared in this mutation.

func (*AdminMutation) OldCreatedAt

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

OldCreatedAt returns the old created_at value of the Admin. If the Admin 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 database query fails.

func (*AdminMutation) OldField

func (m *AdminMutation) 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 was failed.

func (*AdminMutation) OldGender

func (m *AdminMutation) OldGender(ctx context.Context) (v int, err error)

OldGender returns the old gender value of the Admin. If the Admin 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 database query fails.

func (*AdminMutation) OldNickname

func (m *AdminMutation) OldNickname(ctx context.Context) (v string, err error)

OldNickname returns the old nickname value of the Admin. If the Admin 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 database query fails.

func (*AdminMutation) OldPassword

func (m *AdminMutation) OldPassword(ctx context.Context) (v string, err error)

OldPassword returns the old password value of the Admin. If the Admin 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 database query fails.

func (*AdminMutation) OldSignature

func (m *AdminMutation) OldSignature(ctx context.Context) (v string, err error)

OldSignature returns the old signature value of the Admin. If the Admin 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 database query fails.

func (*AdminMutation) OldUpdatedAt

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

OldUpdatedAt returns the old updated_at value of the Admin. If the Admin 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 database query fails.

func (*AdminMutation) OldUsername

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

OldUsername returns the old username value of the Admin. If the Admin 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 database query fails.

func (*AdminMutation) Op

func (m *AdminMutation) Op() Op

Op returns the operation name.

func (*AdminMutation) Password

func (m *AdminMutation) Password() (r string, exists bool)

Password returns the password value in the mutation.

func (*AdminMutation) RemoveLoginLogIDs

func (m *AdminMutation) RemoveLoginLogIDs(ids ...int)

RemoveLoginLogIDs removes the loginLogs edge to AdminLoginLog by ids.

func (*AdminMutation) RemovedEdges

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

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

func (*AdminMutation) RemovedIDs

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

RemovedIDs returns all ids (to other nodes) that were removed for the given edge name.

func (*AdminMutation) RemovedLoginLogsIDs

func (m *AdminMutation) RemovedLoginLogsIDs() (ids []int)

RemovedLoginLogs returns the removed ids of loginLogs.

func (*AdminMutation) ResetCreatedAt

func (m *AdminMutation) ResetCreatedAt()

ResetCreatedAt reset all changes of the "created_at" field.

func (*AdminMutation) ResetEdge

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

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

func (*AdminMutation) ResetField

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

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

func (*AdminMutation) ResetGender

func (m *AdminMutation) ResetGender()

ResetGender reset all changes of the "gender" field.

func (*AdminMutation) ResetLoginLogs

func (m *AdminMutation) ResetLoginLogs()

ResetLoginLogs reset all changes of the "loginLogs" edge.

func (*AdminMutation) ResetNickname

func (m *AdminMutation) ResetNickname()

ResetNickname reset all changes of the "nickname" field.

func (*AdminMutation) ResetPassword

func (m *AdminMutation) ResetPassword()

ResetPassword reset all changes of the "password" field.

func (*AdminMutation) ResetSignature

func (m *AdminMutation) ResetSignature()

ResetSignature reset all changes of the "signature" field.

func (*AdminMutation) ResetUpdatedAt

func (m *AdminMutation) ResetUpdatedAt()

ResetUpdatedAt reset all changes of the "updated_at" field.

func (*AdminMutation) ResetUsername

func (m *AdminMutation) ResetUsername()

ResetUsername reset all changes of the "username" field.

func (*AdminMutation) SetCreatedAt

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

SetCreatedAt sets the created_at field.

func (*AdminMutation) SetField

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

SetField sets the value for the given name. It returns an error if the field is not defined in the schema, or if the type mismatch the field type.

func (*AdminMutation) SetGender

func (m *AdminMutation) SetGender(i int)

SetGender sets the gender field.

func (*AdminMutation) SetID

func (m *AdminMutation) SetID(id int)

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

func (*AdminMutation) SetNickname

func (m *AdminMutation) SetNickname(s string)

SetNickname sets the nickname field.

func (*AdminMutation) SetPassword

func (m *AdminMutation) SetPassword(s string)

SetPassword sets the password field.

func (*AdminMutation) SetSignature

func (m *AdminMutation) SetSignature(s string)

SetSignature sets the signature field.

func (*AdminMutation) SetUpdatedAt

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

SetUpdatedAt sets the updated_at field.

func (*AdminMutation) SetUsername

func (m *AdminMutation) SetUsername(s string)

SetUsername sets the username field.

func (*AdminMutation) Signature

func (m *AdminMutation) Signature() (r string, exists bool)

Signature returns the signature value in the mutation.

func (AdminMutation) Tx

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

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

func (*AdminMutation) Type

func (m *AdminMutation) Type() string

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

func (*AdminMutation) UpdatedAt

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

UpdatedAt returns the updated_at value in the mutation.

func (*AdminMutation) Username

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

Username returns the username value in the mutation.

type AdminQuery

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

AdminQuery is the builder for querying Admin entities.

func (*AdminQuery) All

func (aq *AdminQuery) All(ctx context.Context) ([]*Admin, error)

All executes the query and returns a list of Admins.

func (*AdminQuery) AllX

func (aq *AdminQuery) AllX(ctx context.Context) []*Admin

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

func (*AdminQuery) Clone

func (aq *AdminQuery) Clone() *AdminQuery

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

func (*AdminQuery) Count

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

Count returns the count of the given query.

func (*AdminQuery) CountX

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

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

func (*AdminQuery) Exist

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

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

func (*AdminQuery) ExistX

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

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

func (*AdminQuery) First

func (aq *AdminQuery) First(ctx context.Context) (*Admin, error)

First returns the first Admin entity in the query. Returns *NotFoundError when no admin was found.

func (*AdminQuery) FirstID

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

FirstID returns the first Admin id in the query. Returns *NotFoundError when no id was found.

func (*AdminQuery) FirstX

func (aq *AdminQuery) FirstX(ctx context.Context) *Admin

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

func (*AdminQuery) FirstXID

func (aq *AdminQuery) FirstXID(ctx context.Context) int

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

func (*AdminQuery) GroupBy

func (aq *AdminQuery) GroupBy(field string, fields ...string) *AdminGroupBy

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

client.Admin.Query().
	GroupBy(admin.FieldCreatedAt).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*AdminQuery) IDs

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

IDs executes the query and returns a list of Admin ids.

func (*AdminQuery) IDsX

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

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

func (*AdminQuery) Limit

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

Limit adds a limit step to the query.

func (*AdminQuery) Offset

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

Offset adds an offset step to the query.

func (*AdminQuery) Only

func (aq *AdminQuery) Only(ctx context.Context) (*Admin, error)

Only returns the only Admin entity in the query, returns an error if not exactly one entity was returned.

func (*AdminQuery) OnlyID

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

OnlyID returns the only Admin id in the query, returns an error if not exactly one id was returned.

func (*AdminQuery) OnlyIDX

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

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

func (*AdminQuery) OnlyX

func (aq *AdminQuery) OnlyX(ctx context.Context) *Admin

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

func (*AdminQuery) Order

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

Order adds an order step to the query.

func (*AdminQuery) QueryLoginLogs

func (aq *AdminQuery) QueryLoginLogs() *AdminLoginLogQuery

QueryLoginLogs chains the current query on the loginLogs edge.

func (*AdminQuery) Select

func (aq *AdminQuery) Select(field string, fields ...string) *AdminSelect

Select one or more fields from the given query.

Example:

var v []struct {
	CreatedAt time.Time `json:"created_at,omitempty"`
}

client.Admin.Query().
	Select(admin.FieldCreatedAt).
	Scan(ctx, &v)

func (*AdminQuery) Where

func (aq *AdminQuery) Where(ps ...predicate.Admin) *AdminQuery

Where adds a new predicate for the builder.

func (*AdminQuery) WithLoginLogs

func (aq *AdminQuery) WithLoginLogs(opts ...func(*AdminLoginLogQuery)) *AdminQuery
WithLoginLogs tells the query-builder to eager-loads the nodes that are connected to

the "loginLogs" edge. The optional arguments used to configure the query builder of the edge.

type AdminSelect

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

AdminSelect is the builder for select fields of Admin entities.

func (*AdminSelect) Bool

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

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

func (*AdminSelect) BoolX

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

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

func (*AdminSelect) Bools

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

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

func (*AdminSelect) BoolsX

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

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

func (*AdminSelect) Float64

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

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

func (*AdminSelect) Float64X

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

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

func (*AdminSelect) Float64s

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

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

func (*AdminSelect) Float64sX

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

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

func (*AdminSelect) Int

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

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

func (*AdminSelect) IntX

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

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

func (*AdminSelect) Ints

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

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

func (*AdminSelect) IntsX

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

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

func (*AdminSelect) Scan

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

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

func (*AdminSelect) ScanX

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

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

func (*AdminSelect) String

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

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

func (*AdminSelect) StringX

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

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

func (*AdminSelect) Strings

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

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

func (*AdminSelect) StringsX

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

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

type AdminUpdate

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

AdminUpdate is the builder for updating Admin entities.

func (*AdminUpdate) AddGender

func (au *AdminUpdate) AddGender(i int) *AdminUpdate

AddGender adds i to gender.

func (*AdminUpdate) AddLoginLogIDs

func (au *AdminUpdate) AddLoginLogIDs(ids ...int) *AdminUpdate

AddLoginLogIDs adds the loginLogs edge to AdminLoginLog by ids.

func (*AdminUpdate) AddLoginLogs

func (au *AdminUpdate) AddLoginLogs(a ...*AdminLoginLog) *AdminUpdate

AddLoginLogs adds the loginLogs edges to AdminLoginLog.

func (*AdminUpdate) ClearGender

func (au *AdminUpdate) ClearGender() *AdminUpdate

ClearGender clears the value of gender.

func (*AdminUpdate) ClearLoginLogs

func (au *AdminUpdate) ClearLoginLogs() *AdminUpdate

ClearLoginLogs clears all "loginLogs" edges to type AdminLoginLog.

func (*AdminUpdate) ClearNickname

func (au *AdminUpdate) ClearNickname() *AdminUpdate

ClearNickname clears the value of nickname.

func (*AdminUpdate) Exec

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

Exec executes the query.

func (*AdminUpdate) ExecX

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

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

func (*AdminUpdate) Mutation

func (au *AdminUpdate) Mutation() *AdminMutation

Mutation returns the AdminMutation object of the builder.

func (*AdminUpdate) RemoveLoginLogIDs

func (au *AdminUpdate) RemoveLoginLogIDs(ids ...int) *AdminUpdate

RemoveLoginLogIDs removes the loginLogs edge to AdminLoginLog by ids.

func (*AdminUpdate) RemoveLoginLogs

func (au *AdminUpdate) RemoveLoginLogs(a ...*AdminLoginLog) *AdminUpdate

RemoveLoginLogs removes loginLogs edges to AdminLoginLog.

func (*AdminUpdate) Save

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

Save executes the query and returns the number of rows/vertices matched by this operation.

func (*AdminUpdate) SaveX

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

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

func (*AdminUpdate) SetGender

func (au *AdminUpdate) SetGender(i int) *AdminUpdate

SetGender sets the gender field.

func (*AdminUpdate) SetNickname

func (au *AdminUpdate) SetNickname(s string) *AdminUpdate

SetNickname sets the nickname field.

func (*AdminUpdate) SetNillableGender

func (au *AdminUpdate) SetNillableGender(i *int) *AdminUpdate

SetNillableGender sets the gender field if the given value is not nil.

func (*AdminUpdate) SetNillableNickname

func (au *AdminUpdate) SetNillableNickname(s *string) *AdminUpdate

SetNillableNickname sets the nickname field if the given value is not nil.

func (*AdminUpdate) SetPassword

func (au *AdminUpdate) SetPassword(s string) *AdminUpdate

SetPassword sets the password field.

func (*AdminUpdate) SetSignature

func (au *AdminUpdate) SetSignature(s string) *AdminUpdate

SetSignature sets the signature field.

func (*AdminUpdate) SetUpdatedAt

func (au *AdminUpdate) SetUpdatedAt(t time.Time) *AdminUpdate

SetUpdatedAt sets the updated_at field.

func (*AdminUpdate) SetUsername

func (au *AdminUpdate) SetUsername(s string) *AdminUpdate

SetUsername sets the username field.

func (*AdminUpdate) Where

func (au *AdminUpdate) Where(ps ...predicate.Admin) *AdminUpdate

Where adds a new predicate for the builder.

type AdminUpdateOne

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

AdminUpdateOne is the builder for updating a single Admin entity.

func (*AdminUpdateOne) AddGender

func (auo *AdminUpdateOne) AddGender(i int) *AdminUpdateOne

AddGender adds i to gender.

func (*AdminUpdateOne) AddLoginLogIDs

func (auo *AdminUpdateOne) AddLoginLogIDs(ids ...int) *AdminUpdateOne

AddLoginLogIDs adds the loginLogs edge to AdminLoginLog by ids.

func (*AdminUpdateOne) AddLoginLogs

func (auo *AdminUpdateOne) AddLoginLogs(a ...*AdminLoginLog) *AdminUpdateOne

AddLoginLogs adds the loginLogs edges to AdminLoginLog.

func (*AdminUpdateOne) ClearGender

func (auo *AdminUpdateOne) ClearGender() *AdminUpdateOne

ClearGender clears the value of gender.

func (*AdminUpdateOne) ClearLoginLogs

func (auo *AdminUpdateOne) ClearLoginLogs() *AdminUpdateOne

ClearLoginLogs clears all "loginLogs" edges to type AdminLoginLog.

func (*AdminUpdateOne) ClearNickname

func (auo *AdminUpdateOne) ClearNickname() *AdminUpdateOne

ClearNickname clears the value of nickname.

func (*AdminUpdateOne) Exec

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

Exec executes the query on the entity.

func (*AdminUpdateOne) ExecX

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

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

func (*AdminUpdateOne) Mutation

func (auo *AdminUpdateOne) Mutation() *AdminMutation

Mutation returns the AdminMutation object of the builder.

func (*AdminUpdateOne) RemoveLoginLogIDs

func (auo *AdminUpdateOne) RemoveLoginLogIDs(ids ...int) *AdminUpdateOne

RemoveLoginLogIDs removes the loginLogs edge to AdminLoginLog by ids.

func (*AdminUpdateOne) RemoveLoginLogs

func (auo *AdminUpdateOne) RemoveLoginLogs(a ...*AdminLoginLog) *AdminUpdateOne

RemoveLoginLogs removes loginLogs edges to AdminLoginLog.

func (*AdminUpdateOne) Save

func (auo *AdminUpdateOne) Save(ctx context.Context) (*Admin, error)

Save executes the query and returns the updated entity.

func (*AdminUpdateOne) SaveX

func (auo *AdminUpdateOne) SaveX(ctx context.Context) *Admin

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

func (*AdminUpdateOne) SetGender

func (auo *AdminUpdateOne) SetGender(i int) *AdminUpdateOne

SetGender sets the gender field.

func (*AdminUpdateOne) SetNickname

func (auo *AdminUpdateOne) SetNickname(s string) *AdminUpdateOne

SetNickname sets the nickname field.

func (*AdminUpdateOne) SetNillableGender

func (auo *AdminUpdateOne) SetNillableGender(i *int) *AdminUpdateOne

SetNillableGender sets the gender field if the given value is not nil.

func (*AdminUpdateOne) SetNillableNickname

func (auo *AdminUpdateOne) SetNillableNickname(s *string) *AdminUpdateOne

SetNillableNickname sets the nickname field if the given value is not nil.

func (*AdminUpdateOne) SetPassword

func (auo *AdminUpdateOne) SetPassword(s string) *AdminUpdateOne

SetPassword sets the password field.

func (*AdminUpdateOne) SetSignature

func (auo *AdminUpdateOne) SetSignature(s string) *AdminUpdateOne

SetSignature sets the signature field.

func (*AdminUpdateOne) SetUpdatedAt

func (auo *AdminUpdateOne) SetUpdatedAt(t time.Time) *AdminUpdateOne

SetUpdatedAt sets the updated_at field.

func (*AdminUpdateOne) SetUsername

func (auo *AdminUpdateOne) SetUsername(s string) *AdminUpdateOne

SetUsername sets the username field.

type Admins

type Admins []*Admin

Admins is a parsable slice of Admin.

type AggregateFunc

type AggregateFunc func(*sql.Selector, func(string) bool) string

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

func As

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

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

func Count

func Count() AggregateFunc

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

func Max

func Max(field string) AggregateFunc

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

func Mean

func Mean(field string) AggregateFunc

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

func Min

func Min(field string) AggregateFunc

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

func Sum

func Sum(field string) AggregateFunc

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

type CasbinRule

type CasbinRule struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// PType holds the value of the "p_type" field.
	PType string `json:"-"`
	// V0 holds the value of the "v0" field.
	V0 string `json:"-"`
	// V1 holds the value of the "v1" field.
	V1 string `json:"-"`
	// V2 holds the value of the "v2" field.
	V2 string `json:"-"`
	// V3 holds the value of the "v3" field.
	V3 string `json:"-"`
	// V4 holds the value of the "v4" field.
	V4 string `json:"-"`
	// V5 holds the value of the "v5" field.
	V5 string `json:"-"`
	// contains filtered or unexported fields
}

CasbinRule is the model entity for the CasbinRule schema.

func (*CasbinRule) String

func (cr *CasbinRule) String() string

String implements the fmt.Stringer.

func (*CasbinRule) Unwrap

func (cr *CasbinRule) Unwrap() *CasbinRule

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

func (*CasbinRule) Update

func (cr *CasbinRule) Update() *CasbinRuleUpdateOne

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

type CasbinRuleClient

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

CasbinRuleClient is a client for the CasbinRule schema.

func NewCasbinRuleClient

func NewCasbinRuleClient(c config) *CasbinRuleClient

NewCasbinRuleClient returns a client for the CasbinRule from the given config.

func (*CasbinRuleClient) Create

func (c *CasbinRuleClient) Create() *CasbinRuleCreate

Create returns a create builder for CasbinRule.

func (*CasbinRuleClient) CreateBulk

func (c *CasbinRuleClient) CreateBulk(builders ...*CasbinRuleCreate) *CasbinRuleCreateBulk

BulkCreate returns a builder for creating a bulk of CasbinRule entities.

func (*CasbinRuleClient) Delete

func (c *CasbinRuleClient) Delete() *CasbinRuleDelete

Delete returns a delete builder for CasbinRule.

func (*CasbinRuleClient) DeleteOne

func (c *CasbinRuleClient) DeleteOne(cr *CasbinRule) *CasbinRuleDeleteOne

DeleteOne returns a delete builder for the given entity.

func (*CasbinRuleClient) DeleteOneID

func (c *CasbinRuleClient) DeleteOneID(id int) *CasbinRuleDeleteOne

DeleteOneID returns a delete builder for the given id.

func (*CasbinRuleClient) Get

func (c *CasbinRuleClient) Get(ctx context.Context, id int) (*CasbinRule, error)

Get returns a CasbinRule entity by its id.

func (*CasbinRuleClient) GetX

func (c *CasbinRuleClient) GetX(ctx context.Context, id int) *CasbinRule

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

func (*CasbinRuleClient) Hooks

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

Hooks returns the client hooks.

func (*CasbinRuleClient) Query

func (c *CasbinRuleClient) Query() *CasbinRuleQuery

Query returns a query builder for CasbinRule.

func (*CasbinRuleClient) Update

func (c *CasbinRuleClient) Update() *CasbinRuleUpdate

Update returns an update builder for CasbinRule.

func (*CasbinRuleClient) UpdateOne

func (c *CasbinRuleClient) UpdateOne(cr *CasbinRule) *CasbinRuleUpdateOne

UpdateOne returns an update builder for the given entity.

func (*CasbinRuleClient) UpdateOneID

func (c *CasbinRuleClient) UpdateOneID(id int) *CasbinRuleUpdateOne

UpdateOneID returns an update builder for the given id.

func (*CasbinRuleClient) Use

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

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

type CasbinRuleCreate

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

CasbinRuleCreate is the builder for creating a CasbinRule entity.

func (*CasbinRuleCreate) Mutation

func (crc *CasbinRuleCreate) Mutation() *CasbinRuleMutation

Mutation returns the CasbinRuleMutation object of the builder.

func (*CasbinRuleCreate) Save

func (crc *CasbinRuleCreate) Save(ctx context.Context) (*CasbinRule, error)

Save creates the CasbinRule in the database.

func (*CasbinRuleCreate) SaveX

func (crc *CasbinRuleCreate) SaveX(ctx context.Context) *CasbinRule

SaveX calls Save and panics if Save returns an error.

func (*CasbinRuleCreate) SetPType

func (crc *CasbinRuleCreate) SetPType(s string) *CasbinRuleCreate

SetPType sets the p_type field.

func (*CasbinRuleCreate) SetV0

func (crc *CasbinRuleCreate) SetV0(s string) *CasbinRuleCreate

SetV0 sets the v0 field.

func (*CasbinRuleCreate) SetV1

func (crc *CasbinRuleCreate) SetV1(s string) *CasbinRuleCreate

SetV1 sets the v1 field.

func (*CasbinRuleCreate) SetV2

func (crc *CasbinRuleCreate) SetV2(s string) *CasbinRuleCreate

SetV2 sets the v2 field.

func (*CasbinRuleCreate) SetV3

func (crc *CasbinRuleCreate) SetV3(s string) *CasbinRuleCreate

SetV3 sets the v3 field.

func (*CasbinRuleCreate) SetV4

func (crc *CasbinRuleCreate) SetV4(s string) *CasbinRuleCreate

SetV4 sets the v4 field.

func (*CasbinRuleCreate) SetV5

func (crc *CasbinRuleCreate) SetV5(s string) *CasbinRuleCreate

SetV5 sets the v5 field.

type CasbinRuleCreateBulk

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

CasbinRuleCreateBulk is the builder for creating a bulk of CasbinRule entities.

func (*CasbinRuleCreateBulk) Save

func (crcb *CasbinRuleCreateBulk) Save(ctx context.Context) ([]*CasbinRule, error)

Save creates the CasbinRule entities in the database.

func (*CasbinRuleCreateBulk) SaveX

func (crcb *CasbinRuleCreateBulk) SaveX(ctx context.Context) []*CasbinRule

SaveX calls Save and panics if Save returns an error.

type CasbinRuleDelete

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

CasbinRuleDelete is the builder for deleting a CasbinRule entity.

func (*CasbinRuleDelete) Exec

func (crd *CasbinRuleDelete) Exec(ctx context.Context) (int, error)

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

func (*CasbinRuleDelete) ExecX

func (crd *CasbinRuleDelete) ExecX(ctx context.Context) int

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

func (*CasbinRuleDelete) Where

Where adds a new predicate to the delete builder.

type CasbinRuleDeleteOne

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

CasbinRuleDeleteOne is the builder for deleting a single CasbinRule entity.

func (*CasbinRuleDeleteOne) Exec

func (crdo *CasbinRuleDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*CasbinRuleDeleteOne) ExecX

func (crdo *CasbinRuleDeleteOne) ExecX(ctx context.Context)

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

type CasbinRuleGroupBy

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

CasbinRuleGroupBy is the builder for group-by CasbinRule entities.

func (*CasbinRuleGroupBy) Aggregate

func (crgb *CasbinRuleGroupBy) Aggregate(fns ...AggregateFunc) *CasbinRuleGroupBy

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

func (*CasbinRuleGroupBy) Bool

func (crgb *CasbinRuleGroupBy) Bool(ctx context.Context) (_ bool, err error)

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

func (*CasbinRuleGroupBy) BoolX

func (crgb *CasbinRuleGroupBy) BoolX(ctx context.Context) bool

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

func (*CasbinRuleGroupBy) Bools

func (crgb *CasbinRuleGroupBy) Bools(ctx context.Context) ([]bool, error)

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

func (*CasbinRuleGroupBy) BoolsX

func (crgb *CasbinRuleGroupBy) BoolsX(ctx context.Context) []bool

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

func (*CasbinRuleGroupBy) Float64

func (crgb *CasbinRuleGroupBy) Float64(ctx context.Context) (_ float64, err error)

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

func (*CasbinRuleGroupBy) Float64X

func (crgb *CasbinRuleGroupBy) Float64X(ctx context.Context) float64

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

func (*CasbinRuleGroupBy) Float64s

func (crgb *CasbinRuleGroupBy) Float64s(ctx context.Context) ([]float64, error)

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

func (*CasbinRuleGroupBy) Float64sX

func (crgb *CasbinRuleGroupBy) Float64sX(ctx context.Context) []float64

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

func (*CasbinRuleGroupBy) Int

func (crgb *CasbinRuleGroupBy) Int(ctx context.Context) (_ int, err error)

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

func (*CasbinRuleGroupBy) IntX

func (crgb *CasbinRuleGroupBy) IntX(ctx context.Context) int

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

func (*CasbinRuleGroupBy) Ints

func (crgb *CasbinRuleGroupBy) Ints(ctx context.Context) ([]int, error)

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

func (*CasbinRuleGroupBy) IntsX

func (crgb *CasbinRuleGroupBy) IntsX(ctx context.Context) []int

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

func (*CasbinRuleGroupBy) Scan

func (crgb *CasbinRuleGroupBy) Scan(ctx context.Context, v interface{}) error

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

func (*CasbinRuleGroupBy) ScanX

func (crgb *CasbinRuleGroupBy) ScanX(ctx context.Context, v interface{})

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

func (*CasbinRuleGroupBy) String

func (crgb *CasbinRuleGroupBy) String(ctx context.Context) (_ string, err error)

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

func (*CasbinRuleGroupBy) StringX

func (crgb *CasbinRuleGroupBy) StringX(ctx context.Context) string

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

func (*CasbinRuleGroupBy) Strings

func (crgb *CasbinRuleGroupBy) Strings(ctx context.Context) ([]string, error)

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

func (*CasbinRuleGroupBy) StringsX

func (crgb *CasbinRuleGroupBy) StringsX(ctx context.Context) []string

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

type CasbinRuleMutation

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

CasbinRuleMutation represents an operation that mutate the CasbinRules nodes in the graph.

func (*CasbinRuleMutation) AddField

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

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

func (*CasbinRuleMutation) AddedEdges

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

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

func (*CasbinRuleMutation) AddedField

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

AddedField returns the numeric value that was in/decremented from a field with the given name. The second value indicates that this field was not set, or was not define in the schema.

func (*CasbinRuleMutation) AddedFields

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

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

func (*CasbinRuleMutation) AddedIDs

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

AddedIDs returns all ids (to other nodes) that were added for the given edge name.

func (*CasbinRuleMutation) ClearEdge

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

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

func (*CasbinRuleMutation) ClearField

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

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

func (*CasbinRuleMutation) ClearedEdges

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

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

func (*CasbinRuleMutation) ClearedFields

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

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

func (CasbinRuleMutation) Client

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

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

EdgeCleared returns a boolean indicates if this edge was cleared in this mutation.

func (*CasbinRuleMutation) Field

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

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

func (*CasbinRuleMutation) FieldCleared

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

FieldCleared returns a boolean indicates if this field was cleared in this mutation.

func (*CasbinRuleMutation) Fields

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

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

func (*CasbinRuleMutation) ID

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

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

func (*CasbinRuleMutation) OldField

func (m *CasbinRuleMutation) 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 was failed.

func (*CasbinRuleMutation) OldPType

func (m *CasbinRuleMutation) OldPType(ctx context.Context) (v string, err error)

OldPType returns the old p_type value of the CasbinRule. If the CasbinRule 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 database query fails.

func (*CasbinRuleMutation) OldV0

func (m *CasbinRuleMutation) OldV0(ctx context.Context) (v string, err error)

OldV0 returns the old v0 value of the CasbinRule. If the CasbinRule 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 database query fails.

func (*CasbinRuleMutation) OldV1

func (m *CasbinRuleMutation) OldV1(ctx context.Context) (v string, err error)

OldV1 returns the old v1 value of the CasbinRule. If the CasbinRule 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 database query fails.

func (*CasbinRuleMutation) OldV2

func (m *CasbinRuleMutation) OldV2(ctx context.Context) (v string, err error)

OldV2 returns the old v2 value of the CasbinRule. If the CasbinRule 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 database query fails.

func (*CasbinRuleMutation) OldV3

func (m *CasbinRuleMutation) OldV3(ctx context.Context) (v string, err error)

OldV3 returns the old v3 value of the CasbinRule. If the CasbinRule 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 database query fails.

func (*CasbinRuleMutation) OldV4

func (m *CasbinRuleMutation) OldV4(ctx context.Context) (v string, err error)

OldV4 returns the old v4 value of the CasbinRule. If the CasbinRule 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 database query fails.

func (*CasbinRuleMutation) OldV5

func (m *CasbinRuleMutation) OldV5(ctx context.Context) (v string, err error)

OldV5 returns the old v5 value of the CasbinRule. If the CasbinRule 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 database query fails.

func (*CasbinRuleMutation) Op

func (m *CasbinRuleMutation) Op() Op

Op returns the operation name.

func (*CasbinRuleMutation) PType

func (m *CasbinRuleMutation) PType() (r string, exists bool)

PType returns the p_type value in the mutation.

func (*CasbinRuleMutation) RemovedEdges

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

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

func (*CasbinRuleMutation) RemovedIDs

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

RemovedIDs returns all ids (to other nodes) that were removed for the given edge name.

func (*CasbinRuleMutation) ResetEdge

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

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

func (*CasbinRuleMutation) ResetField

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

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

func (*CasbinRuleMutation) ResetPType

func (m *CasbinRuleMutation) ResetPType()

ResetPType reset all changes of the "p_type" field.

func (*CasbinRuleMutation) ResetV0

func (m *CasbinRuleMutation) ResetV0()

ResetV0 reset all changes of the "v0" field.

func (*CasbinRuleMutation) ResetV1

func (m *CasbinRuleMutation) ResetV1()

ResetV1 reset all changes of the "v1" field.

func (*CasbinRuleMutation) ResetV2

func (m *CasbinRuleMutation) ResetV2()

ResetV2 reset all changes of the "v2" field.

func (*CasbinRuleMutation) ResetV3

func (m *CasbinRuleMutation) ResetV3()

ResetV3 reset all changes of the "v3" field.

func (*CasbinRuleMutation) ResetV4

func (m *CasbinRuleMutation) ResetV4()

ResetV4 reset all changes of the "v4" field.

func (*CasbinRuleMutation) ResetV5

func (m *CasbinRuleMutation) ResetV5()

ResetV5 reset all changes of the "v5" field.

func (*CasbinRuleMutation) SetField

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

SetField sets the value for the given name. It returns an error if the field is not defined in the schema, or if the type mismatch the field type.

func (*CasbinRuleMutation) SetPType

func (m *CasbinRuleMutation) SetPType(s string)

SetPType sets the p_type field.

func (*CasbinRuleMutation) SetV0

func (m *CasbinRuleMutation) SetV0(s string)

SetV0 sets the v0 field.

func (*CasbinRuleMutation) SetV1

func (m *CasbinRuleMutation) SetV1(s string)

SetV1 sets the v1 field.

func (*CasbinRuleMutation) SetV2

func (m *CasbinRuleMutation) SetV2(s string)

SetV2 sets the v2 field.

func (*CasbinRuleMutation) SetV3

func (m *CasbinRuleMutation) SetV3(s string)

SetV3 sets the v3 field.

func (*CasbinRuleMutation) SetV4

func (m *CasbinRuleMutation) SetV4(s string)

SetV4 sets the v4 field.

func (*CasbinRuleMutation) SetV5

func (m *CasbinRuleMutation) SetV5(s string)

SetV5 sets the v5 field.

func (CasbinRuleMutation) Tx

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

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

func (*CasbinRuleMutation) Type

func (m *CasbinRuleMutation) Type() string

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

func (*CasbinRuleMutation) V0

func (m *CasbinRuleMutation) V0() (r string, exists bool)

V0 returns the v0 value in the mutation.

func (*CasbinRuleMutation) V1

func (m *CasbinRuleMutation) V1() (r string, exists bool)

V1 returns the v1 value in the mutation.

func (*CasbinRuleMutation) V2

func (m *CasbinRuleMutation) V2() (r string, exists bool)

V2 returns the v2 value in the mutation.

func (*CasbinRuleMutation) V3

func (m *CasbinRuleMutation) V3() (r string, exists bool)

V3 returns the v3 value in the mutation.

func (*CasbinRuleMutation) V4

func (m *CasbinRuleMutation) V4() (r string, exists bool)

V4 returns the v4 value in the mutation.

func (*CasbinRuleMutation) V5

func (m *CasbinRuleMutation) V5() (r string, exists bool)

V5 returns the v5 value in the mutation.

type CasbinRuleQuery

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

CasbinRuleQuery is the builder for querying CasbinRule entities.

func (*CasbinRuleQuery) All

func (crq *CasbinRuleQuery) All(ctx context.Context) ([]*CasbinRule, error)

All executes the query and returns a list of CasbinRules.

func (*CasbinRuleQuery) AllX

func (crq *CasbinRuleQuery) AllX(ctx context.Context) []*CasbinRule

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

func (*CasbinRuleQuery) Clone

func (crq *CasbinRuleQuery) Clone() *CasbinRuleQuery

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

func (*CasbinRuleQuery) Count

func (crq *CasbinRuleQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*CasbinRuleQuery) CountX

func (crq *CasbinRuleQuery) CountX(ctx context.Context) int

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

func (*CasbinRuleQuery) Exist

func (crq *CasbinRuleQuery) Exist(ctx context.Context) (bool, error)

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

func (*CasbinRuleQuery) ExistX

func (crq *CasbinRuleQuery) ExistX(ctx context.Context) bool

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

func (*CasbinRuleQuery) First

func (crq *CasbinRuleQuery) First(ctx context.Context) (*CasbinRule, error)

First returns the first CasbinRule entity in the query. Returns *NotFoundError when no casbinrule was found.

func (*CasbinRuleQuery) FirstID

func (crq *CasbinRuleQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first CasbinRule id in the query. Returns *NotFoundError when no id was found.

func (*CasbinRuleQuery) FirstX

func (crq *CasbinRuleQuery) FirstX(ctx context.Context) *CasbinRule

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

func (*CasbinRuleQuery) FirstXID

func (crq *CasbinRuleQuery) FirstXID(ctx context.Context) int

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

func (*CasbinRuleQuery) GroupBy

func (crq *CasbinRuleQuery) GroupBy(field string, fields ...string) *CasbinRuleGroupBy

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

client.CasbinRule.Query().
	GroupBy(casbinrule.FieldPType).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*CasbinRuleQuery) IDs

func (crq *CasbinRuleQuery) IDs(ctx context.Context) ([]int, error)

IDs executes the query and returns a list of CasbinRule ids.

func (*CasbinRuleQuery) IDsX

func (crq *CasbinRuleQuery) IDsX(ctx context.Context) []int

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

func (*CasbinRuleQuery) Limit

func (crq *CasbinRuleQuery) Limit(limit int) *CasbinRuleQuery

Limit adds a limit step to the query.

func (*CasbinRuleQuery) Offset

func (crq *CasbinRuleQuery) Offset(offset int) *CasbinRuleQuery

Offset adds an offset step to the query.

func (*CasbinRuleQuery) Only

func (crq *CasbinRuleQuery) Only(ctx context.Context) (*CasbinRule, error)

Only returns the only CasbinRule entity in the query, returns an error if not exactly one entity was returned.

func (*CasbinRuleQuery) OnlyID

func (crq *CasbinRuleQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID returns the only CasbinRule id in the query, returns an error if not exactly one id was returned.

func (*CasbinRuleQuery) OnlyIDX

func (crq *CasbinRuleQuery) OnlyIDX(ctx context.Context) int

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

func (*CasbinRuleQuery) OnlyX

func (crq *CasbinRuleQuery) OnlyX(ctx context.Context) *CasbinRule

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

func (*CasbinRuleQuery) Order

func (crq *CasbinRuleQuery) Order(o ...OrderFunc) *CasbinRuleQuery

Order adds an order step to the query.

func (*CasbinRuleQuery) Select

func (crq *CasbinRuleQuery) Select(field string, fields ...string) *CasbinRuleSelect

Select one or more fields from the given query.

Example:

var v []struct {
	PType string `json:"-"`
}

client.CasbinRule.Query().
	Select(casbinrule.FieldPType).
	Scan(ctx, &v)

func (*CasbinRuleQuery) Where

Where adds a new predicate for the builder.

type CasbinRuleSelect

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

CasbinRuleSelect is the builder for select fields of CasbinRule entities.

func (*CasbinRuleSelect) Bool

func (crs *CasbinRuleSelect) Bool(ctx context.Context) (_ bool, err error)

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

func (*CasbinRuleSelect) BoolX

func (crs *CasbinRuleSelect) BoolX(ctx context.Context) bool

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

func (*CasbinRuleSelect) Bools

func (crs *CasbinRuleSelect) Bools(ctx context.Context) ([]bool, error)

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

func (*CasbinRuleSelect) BoolsX

func (crs *CasbinRuleSelect) BoolsX(ctx context.Context) []bool

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

func (*CasbinRuleSelect) Float64

func (crs *CasbinRuleSelect) Float64(ctx context.Context) (_ float64, err error)

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

func (*CasbinRuleSelect) Float64X

func (crs *CasbinRuleSelect) Float64X(ctx context.Context) float64

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

func (*CasbinRuleSelect) Float64s

func (crs *CasbinRuleSelect) Float64s(ctx context.Context) ([]float64, error)

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

func (*CasbinRuleSelect) Float64sX

func (crs *CasbinRuleSelect) Float64sX(ctx context.Context) []float64

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

func (*CasbinRuleSelect) Int

func (crs *CasbinRuleSelect) Int(ctx context.Context) (_ int, err error)

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

func (*CasbinRuleSelect) IntX

func (crs *CasbinRuleSelect) IntX(ctx context.Context) int

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

func (*CasbinRuleSelect) Ints

func (crs *CasbinRuleSelect) Ints(ctx context.Context) ([]int, error)

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

func (*CasbinRuleSelect) IntsX

func (crs *CasbinRuleSelect) IntsX(ctx context.Context) []int

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

func (*CasbinRuleSelect) Scan

func (crs *CasbinRuleSelect) Scan(ctx context.Context, v interface{}) error

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

func (*CasbinRuleSelect) ScanX

func (crs *CasbinRuleSelect) ScanX(ctx context.Context, v interface{})

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

func (*CasbinRuleSelect) String

func (crs *CasbinRuleSelect) String(ctx context.Context) (_ string, err error)

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

func (*CasbinRuleSelect) StringX

func (crs *CasbinRuleSelect) StringX(ctx context.Context) string

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

func (*CasbinRuleSelect) Strings

func (crs *CasbinRuleSelect) Strings(ctx context.Context) ([]string, error)

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

func (*CasbinRuleSelect) StringsX

func (crs *CasbinRuleSelect) StringsX(ctx context.Context) []string

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

type CasbinRuleUpdate

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

CasbinRuleUpdate is the builder for updating CasbinRule entities.

func (*CasbinRuleUpdate) Exec

func (cru *CasbinRuleUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*CasbinRuleUpdate) ExecX

func (cru *CasbinRuleUpdate) ExecX(ctx context.Context)

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

func (*CasbinRuleUpdate) Mutation

func (cru *CasbinRuleUpdate) Mutation() *CasbinRuleMutation

Mutation returns the CasbinRuleMutation object of the builder.

func (*CasbinRuleUpdate) Save

func (cru *CasbinRuleUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of rows/vertices matched by this operation.

func (*CasbinRuleUpdate) SaveX

func (cru *CasbinRuleUpdate) SaveX(ctx context.Context) int

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

func (*CasbinRuleUpdate) SetPType

func (cru *CasbinRuleUpdate) SetPType(s string) *CasbinRuleUpdate

SetPType sets the p_type field.

func (*CasbinRuleUpdate) SetV0

func (cru *CasbinRuleUpdate) SetV0(s string) *CasbinRuleUpdate

SetV0 sets the v0 field.

func (*CasbinRuleUpdate) SetV1

func (cru *CasbinRuleUpdate) SetV1(s string) *CasbinRuleUpdate

SetV1 sets the v1 field.

func (*CasbinRuleUpdate) SetV2

func (cru *CasbinRuleUpdate) SetV2(s string) *CasbinRuleUpdate

SetV2 sets the v2 field.

func (*CasbinRuleUpdate) SetV3

func (cru *CasbinRuleUpdate) SetV3(s string) *CasbinRuleUpdate

SetV3 sets the v3 field.

func (*CasbinRuleUpdate) SetV4

func (cru *CasbinRuleUpdate) SetV4(s string) *CasbinRuleUpdate

SetV4 sets the v4 field.

func (*CasbinRuleUpdate) SetV5

func (cru *CasbinRuleUpdate) SetV5(s string) *CasbinRuleUpdate

SetV5 sets the v5 field.

func (*CasbinRuleUpdate) Where

Where adds a new predicate for the builder.

type CasbinRuleUpdateOne

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

CasbinRuleUpdateOne is the builder for updating a single CasbinRule entity.

func (*CasbinRuleUpdateOne) Exec

func (cruo *CasbinRuleUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*CasbinRuleUpdateOne) ExecX

func (cruo *CasbinRuleUpdateOne) ExecX(ctx context.Context)

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

func (*CasbinRuleUpdateOne) Mutation

func (cruo *CasbinRuleUpdateOne) Mutation() *CasbinRuleMutation

Mutation returns the CasbinRuleMutation object of the builder.

func (*CasbinRuleUpdateOne) Save

func (cruo *CasbinRuleUpdateOne) Save(ctx context.Context) (*CasbinRule, error)

Save executes the query and returns the updated entity.

func (*CasbinRuleUpdateOne) SaveX

func (cruo *CasbinRuleUpdateOne) SaveX(ctx context.Context) *CasbinRule

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

func (*CasbinRuleUpdateOne) SetPType

func (cruo *CasbinRuleUpdateOne) SetPType(s string) *CasbinRuleUpdateOne

SetPType sets the p_type field.

func (*CasbinRuleUpdateOne) SetV0

SetV0 sets the v0 field.

func (*CasbinRuleUpdateOne) SetV1

SetV1 sets the v1 field.

func (*CasbinRuleUpdateOne) SetV2

SetV2 sets the v2 field.

func (*CasbinRuleUpdateOne) SetV3

SetV3 sets the v3 field.

func (*CasbinRuleUpdateOne) SetV4

SetV4 sets the v4 field.

func (*CasbinRuleUpdateOne) SetV5

SetV5 sets the v5 field.

type CasbinRules

type CasbinRules []*CasbinRule

CasbinRules is a parsable slice of CasbinRule.

type Client

type Client struct {

	// Schema is the client for creating, migrating and dropping schema.
	Schema *migrate.Schema
	// Admin is the client for interacting with the Admin builders.
	Admin *AdminClient
	// AdminLoginLog is the client for interacting with the AdminLoginLog builders.
	AdminLoginLog *AdminLoginLogClient
	// CasbinRule is the client for interacting with the CasbinRule builders.
	CasbinRule *CasbinRuleClient
	// Member is the client for interacting with the Member builders.
	Member *MemberClient
	// MemberLoginLog is the client for interacting with the MemberLoginLog builders.
	MemberLoginLog *MemberLoginLogClient
	// NoteArticle is the client for interacting with the NoteArticle builders.
	NoteArticle *NoteArticleClient
	// NoteFilesystem is the client for interacting with the NoteFilesystem builders.
	NoteFilesystem *NoteFilesystemClient
	// Options is the client for interacting with the Options builders.
	Options *OptionsClient
	// contains filtered or unexported fields
}

Client is the client that holds all ent builders.

func FromContext

func FromContext(ctx context.Context) *Client

FromContext returns the Client stored in 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 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().
	Admin.
	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 Hook

type Hook = ent.Hook

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

type Member

type Member struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// UpdatedAt holds the value of the "updated_at" field.
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// Gid holds the value of the "gid" field.
	Gid uuid.UUID `json:"gid,omitempty"`
	// Email holds the value of the "email" field.
	Email string `json:"email,omitempty"`
	// Nickname holds the value of the "nickname" field.
	Nickname string `json:"nickname,omitempty"`
	// Password holds the value of the "password" field.
	Password string `json:"-"`
	// Gender holds the value of the "gender" field.
	Gender int `json:"gender,omitempty"`
	// Signature holds the value of the "signature" field.
	Signature string `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) QueryLoginLogs

func (m *Member) QueryLoginLogs() *MemberLoginLogQuery

QueryLoginLogs queries the loginLogs edge of the Member.

func (*Member) QueryNoteArticles

func (m *Member) QueryNoteArticles() *NoteArticleQuery

QueryNoteArticles queries the noteArticles edge of the Member.

func (*Member) QueryNoteFilesystem

func (m *Member) QueryNoteFilesystem() *NoteFilesystemQuery

QueryNoteFilesystem queries the noteFilesystem edge of the Member.

func (*Member) String

func (m *Member) String() string

String implements the fmt.Stringer.

func (*Member) Unwrap

func (m *Member) Unwrap() *Member

Unwrap unwraps the entity that was returned from a transaction after it was closed, so that all next 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

BulkCreate 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) QueryLoginLogs

func (c *MemberClient) QueryLoginLogs(m *Member) *MemberLoginLogQuery

QueryLoginLogs queries the loginLogs edge of a Member.

func (*MemberClient) QueryNoteArticles

func (c *MemberClient) QueryNoteArticles(m *Member) *NoteArticleQuery

QueryNoteArticles queries the noteArticles edge of a Member.

func (*MemberClient) QueryNoteFilesystem

func (c *MemberClient) QueryNoteFilesystem(m *Member) *NoteFilesystemQuery

QueryNoteFilesystem queries the noteFilesystem 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) AddLoginLogIDs

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

AddLoginLogIDs adds the loginLogs edge to MemberLoginLog by ids.

func (*MemberCreate) AddLoginLogs

func (mc *MemberCreate) AddLoginLogs(m ...*MemberLoginLog) *MemberCreate

AddLoginLogs adds the loginLogs edges to MemberLoginLog.

func (*MemberCreate) AddNoteArticleIDs

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

AddNoteArticleIDs adds the noteArticles edge to NoteArticle by ids.

func (*MemberCreate) AddNoteArticles

func (mc *MemberCreate) AddNoteArticles(n ...*NoteArticle) *MemberCreate

AddNoteArticles adds the noteArticles edges to NoteArticle.

func (*MemberCreate) AddNoteFilesystem

func (mc *MemberCreate) AddNoteFilesystem(n ...*NoteFilesystem) *MemberCreate

AddNoteFilesystem adds the noteFilesystem edges to NoteFilesystem.

func (*MemberCreate) AddNoteFilesystemIDs

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

AddNoteFilesystemIDs adds the noteFilesystem edge to NoteFilesystem by ids.

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) SetCreatedAt

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

SetCreatedAt sets the created_at field.

func (*MemberCreate) SetEmail

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

SetEmail sets the email field.

func (*MemberCreate) SetGender

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

SetGender sets the gender field.

func (*MemberCreate) SetGid

func (mc *MemberCreate) SetGid(u uuid.UUID) *MemberCreate

SetGid sets the gid field.

func (*MemberCreate) SetID

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

SetID sets the id field.

func (*MemberCreate) SetNickname

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

SetNickname sets the nickname field.

func (*MemberCreate) SetNillableCreatedAt

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

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

func (*MemberCreate) SetNillableGender

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

SetNillableGender sets the gender field if the given value is not nil.

func (*MemberCreate) SetNillableUpdatedAt

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

SetNillableUpdatedAt sets the updated_at 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) SetSignature

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

SetSignature sets the signature field.

func (*MemberCreate) SetUpdatedAt

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

SetUpdatedAt sets the updated_at field.

type MemberCreateBulk

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

MemberCreateBulk is the builder for creating a bulk of Member entities.

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 calls Save and panics if Save returns an error.

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 adds a new predicate to the delete 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

type MemberEdges struct {
	// LoginLogs holds the value of the loginLogs edge.
	LoginLogs []*MemberLoginLog
	// NoteArticles holds the value of the noteArticles edge.
	NoteArticles []*NoteArticle
	// NoteFilesystem holds the value of the noteFilesystem edge.
	NoteFilesystem []*NoteFilesystem
	// contains filtered or unexported fields
}

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

func (MemberEdges) LoginLogsOrErr

func (e MemberEdges) LoginLogsOrErr() ([]*MemberLoginLog, error)

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

func (MemberEdges) NoteArticlesOrErr

func (e MemberEdges) NoteArticlesOrErr() ([]*NoteArticle, error)

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

func (MemberEdges) NoteFilesystemOrErr

func (e MemberEdges) NoteFilesystemOrErr() ([]*NoteFilesystem, error)

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

type MemberGroupBy

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

MemberGroupBy is the builder for group-by 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 group-by. It is only allowed when querying group-by 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 querying group-by 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 group-by. It is only allowed when querying group-by 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 querying group-by 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 group-by. It is only allowed when querying group-by 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 querying group-by 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 scan 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 group-by. It is only allowed when querying group-by 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 querying group-by 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 MemberLoginLog

type MemberLoginLog struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// CreateTime holds the value of the "create_time" field.
	CreateTime time.Time `json:"create_time,omitempty"`
	// MemberGid holds the value of the "member_gid" field.
	MemberGid uuid.UUID `json:"member_gid,omitempty"`
	// IP holds the value of the "ip" field.
	IP *string `json:"ip,omitempty"`
	// UserAgent holds the value of the "user_agent" field.
	UserAgent *string `json:"user_agent,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the MemberLoginLogQuery when eager-loading is set.
	Edges MemberLoginLogEdges `json:"edges"`
	// contains filtered or unexported fields
}

MemberLoginLog is the model entity for the MemberLoginLog schema.

func (*MemberLoginLog) QueryOwner

func (mll *MemberLoginLog) QueryOwner() *MemberQuery

QueryOwner queries the owner edge of the MemberLoginLog.

func (*MemberLoginLog) String

func (mll *MemberLoginLog) String() string

String implements the fmt.Stringer.

func (*MemberLoginLog) Unwrap

func (mll *MemberLoginLog) Unwrap() *MemberLoginLog

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

func (*MemberLoginLog) Update

func (mll *MemberLoginLog) Update() *MemberLoginLogUpdateOne

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

type MemberLoginLogClient

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

MemberLoginLogClient is a client for the MemberLoginLog schema.

func NewMemberLoginLogClient

func NewMemberLoginLogClient(c config) *MemberLoginLogClient

NewMemberLoginLogClient returns a client for the MemberLoginLog from the given config.

func (*MemberLoginLogClient) Create

Create returns a create builder for MemberLoginLog.

func (*MemberLoginLogClient) CreateBulk

BulkCreate returns a builder for creating a bulk of MemberLoginLog entities.

func (*MemberLoginLogClient) Delete

Delete returns a delete builder for MemberLoginLog.

func (*MemberLoginLogClient) DeleteOne

DeleteOne returns a delete builder for the given entity.

func (*MemberLoginLogClient) DeleteOneID

func (c *MemberLoginLogClient) DeleteOneID(id int) *MemberLoginLogDeleteOne

DeleteOneID returns a delete builder for the given id.

func (*MemberLoginLogClient) Get

Get returns a MemberLoginLog entity by its id.

func (*MemberLoginLogClient) GetX

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

func (*MemberLoginLogClient) Hooks

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

Hooks returns the client hooks.

func (*MemberLoginLogClient) Query

Query returns a query builder for MemberLoginLog.

func (*MemberLoginLogClient) QueryOwner

func (c *MemberLoginLogClient) QueryOwner(mll *MemberLoginLog) *MemberQuery

QueryOwner queries the owner edge of a MemberLoginLog.

func (*MemberLoginLogClient) Update

Update returns an update builder for MemberLoginLog.

func (*MemberLoginLogClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*MemberLoginLogClient) UpdateOneID

func (c *MemberLoginLogClient) UpdateOneID(id int) *MemberLoginLogUpdateOne

UpdateOneID returns an update builder for the given id.

func (*MemberLoginLogClient) Use

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

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

type MemberLoginLogCreate

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

MemberLoginLogCreate is the builder for creating a MemberLoginLog entity.

func (*MemberLoginLogCreate) Mutation

func (mllc *MemberLoginLogCreate) Mutation() *MemberLoginLogMutation

Mutation returns the MemberLoginLogMutation object of the builder.

func (*MemberLoginLogCreate) Save

Save creates the MemberLoginLog in the database.

func (*MemberLoginLogCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*MemberLoginLogCreate) SetCreateTime

func (mllc *MemberLoginLogCreate) SetCreateTime(t time.Time) *MemberLoginLogCreate

SetCreateTime sets the create_time field.

func (*MemberLoginLogCreate) SetID

SetID sets the id field.

func (*MemberLoginLogCreate) SetIP

SetIP sets the ip field.

func (*MemberLoginLogCreate) SetMemberGid

func (mllc *MemberLoginLogCreate) SetMemberGid(u uuid.UUID) *MemberLoginLogCreate

SetMemberGid sets the member_gid field.

func (*MemberLoginLogCreate) SetNillableCreateTime

func (mllc *MemberLoginLogCreate) SetNillableCreateTime(t *time.Time) *MemberLoginLogCreate

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

func (*MemberLoginLogCreate) SetNillableIP

func (mllc *MemberLoginLogCreate) SetNillableIP(s *string) *MemberLoginLogCreate

SetNillableIP sets the ip field if the given value is not nil.

func (*MemberLoginLogCreate) SetNillableOwnerID

func (mllc *MemberLoginLogCreate) SetNillableOwnerID(id *int) *MemberLoginLogCreate

SetNillableOwnerID sets the owner edge to Member by id if the given value is not nil.

func (*MemberLoginLogCreate) SetNillableUserAgent

func (mllc *MemberLoginLogCreate) SetNillableUserAgent(s *string) *MemberLoginLogCreate

SetNillableUserAgent sets the user_agent field if the given value is not nil.

func (*MemberLoginLogCreate) SetOwner

func (mllc *MemberLoginLogCreate) SetOwner(m *Member) *MemberLoginLogCreate

SetOwner sets the owner edge to Member.

func (*MemberLoginLogCreate) SetOwnerID

func (mllc *MemberLoginLogCreate) SetOwnerID(id int) *MemberLoginLogCreate

SetOwnerID sets the owner edge to Member by id.

func (*MemberLoginLogCreate) SetUserAgent

func (mllc *MemberLoginLogCreate) SetUserAgent(s string) *MemberLoginLogCreate

SetUserAgent sets the user_agent field.

type MemberLoginLogCreateBulk

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

MemberLoginLogCreateBulk is the builder for creating a bulk of MemberLoginLog entities.

func (*MemberLoginLogCreateBulk) Save

Save creates the MemberLoginLog entities in the database.

func (*MemberLoginLogCreateBulk) SaveX

SaveX calls Save and panics if Save returns an error.

type MemberLoginLogDelete

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

MemberLoginLogDelete is the builder for deleting a MemberLoginLog entity.

func (*MemberLoginLogDelete) Exec

func (mlld *MemberLoginLogDelete) Exec(ctx context.Context) (int, error)

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

func (*MemberLoginLogDelete) ExecX

func (mlld *MemberLoginLogDelete) ExecX(ctx context.Context) int

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

func (*MemberLoginLogDelete) Where

Where adds a new predicate to the delete builder.

type MemberLoginLogDeleteOne

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

MemberLoginLogDeleteOne is the builder for deleting a single MemberLoginLog entity.

func (*MemberLoginLogDeleteOne) Exec

func (mlldo *MemberLoginLogDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*MemberLoginLogDeleteOne) ExecX

func (mlldo *MemberLoginLogDeleteOne) ExecX(ctx context.Context)

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

type MemberLoginLogEdges

type MemberLoginLogEdges struct {
	// Owner holds the value of the owner edge.
	Owner *Member
	// contains filtered or unexported fields
}

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

func (MemberLoginLogEdges) OwnerOrErr

func (e MemberLoginLogEdges) OwnerOrErr() (*Member, error)

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

type MemberLoginLogGroupBy

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

MemberLoginLogGroupBy is the builder for group-by MemberLoginLog entities.

func (*MemberLoginLogGroupBy) Aggregate

func (mllgb *MemberLoginLogGroupBy) Aggregate(fns ...AggregateFunc) *MemberLoginLogGroupBy

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

func (*MemberLoginLogGroupBy) Bool

func (mllgb *MemberLoginLogGroupBy) Bool(ctx context.Context) (_ bool, err error)

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

func (*MemberLoginLogGroupBy) BoolX

func (mllgb *MemberLoginLogGroupBy) BoolX(ctx context.Context) bool

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

func (*MemberLoginLogGroupBy) Bools

func (mllgb *MemberLoginLogGroupBy) Bools(ctx context.Context) ([]bool, error)

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

func (*MemberLoginLogGroupBy) BoolsX

func (mllgb *MemberLoginLogGroupBy) BoolsX(ctx context.Context) []bool

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

func (*MemberLoginLogGroupBy) Float64

func (mllgb *MemberLoginLogGroupBy) Float64(ctx context.Context) (_ float64, err error)

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

func (*MemberLoginLogGroupBy) Float64X

func (mllgb *MemberLoginLogGroupBy) Float64X(ctx context.Context) float64

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

func (*MemberLoginLogGroupBy) Float64s

func (mllgb *MemberLoginLogGroupBy) Float64s(ctx context.Context) ([]float64, error)

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

func (*MemberLoginLogGroupBy) Float64sX

func (mllgb *MemberLoginLogGroupBy) Float64sX(ctx context.Context) []float64

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

func (*MemberLoginLogGroupBy) Int

func (mllgb *MemberLoginLogGroupBy) Int(ctx context.Context) (_ int, err error)

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

func (*MemberLoginLogGroupBy) IntX

func (mllgb *MemberLoginLogGroupBy) IntX(ctx context.Context) int

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

func (*MemberLoginLogGroupBy) Ints

func (mllgb *MemberLoginLogGroupBy) Ints(ctx context.Context) ([]int, error)

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

func (*MemberLoginLogGroupBy) IntsX

func (mllgb *MemberLoginLogGroupBy) IntsX(ctx context.Context) []int

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

func (*MemberLoginLogGroupBy) Scan

func (mllgb *MemberLoginLogGroupBy) Scan(ctx context.Context, v interface{}) error

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

func (*MemberLoginLogGroupBy) ScanX

func (mllgb *MemberLoginLogGroupBy) ScanX(ctx context.Context, v interface{})

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

func (*MemberLoginLogGroupBy) String

func (mllgb *MemberLoginLogGroupBy) String(ctx context.Context) (_ string, err error)

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

func (*MemberLoginLogGroupBy) StringX

func (mllgb *MemberLoginLogGroupBy) StringX(ctx context.Context) string

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

func (*MemberLoginLogGroupBy) Strings

func (mllgb *MemberLoginLogGroupBy) Strings(ctx context.Context) ([]string, error)

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

func (*MemberLoginLogGroupBy) StringsX

func (mllgb *MemberLoginLogGroupBy) StringsX(ctx context.Context) []string

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

type MemberLoginLogMutation

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

MemberLoginLogMutation represents an operation that mutate the MemberLoginLogs nodes in the graph.

func (*MemberLoginLogMutation) AddField

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

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

func (*MemberLoginLogMutation) AddedEdges

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

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

func (*MemberLoginLogMutation) AddedField

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

AddedField returns the numeric value that was in/decremented from a field with the given name. The second value indicates that this field was not set, or was not define in the schema.

func (*MemberLoginLogMutation) AddedFields

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

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

func (*MemberLoginLogMutation) AddedIDs

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

AddedIDs returns all ids (to other nodes) that were added for the given edge name.

func (*MemberLoginLogMutation) ClearEdge

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

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

func (*MemberLoginLogMutation) ClearField

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

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

func (*MemberLoginLogMutation) ClearIP

func (m *MemberLoginLogMutation) ClearIP()

ClearIP clears the value of ip.

func (*MemberLoginLogMutation) ClearOwner

func (m *MemberLoginLogMutation) ClearOwner()

ClearOwner clears the owner edge to Member.

func (*MemberLoginLogMutation) ClearUserAgent

func (m *MemberLoginLogMutation) ClearUserAgent()

ClearUserAgent clears the value of user_agent.

func (*MemberLoginLogMutation) ClearedEdges

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

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

func (*MemberLoginLogMutation) ClearedFields

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

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

func (MemberLoginLogMutation) Client

func (m MemberLoginLogMutation) 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 (*MemberLoginLogMutation) CreateTime

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

CreateTime returns the create_time value in the mutation.

func (*MemberLoginLogMutation) EdgeCleared

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

EdgeCleared returns a boolean indicates if this edge was cleared in this mutation.

func (*MemberLoginLogMutation) Field

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

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

func (*MemberLoginLogMutation) FieldCleared

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

FieldCleared returns a boolean indicates if this field was cleared in this mutation.

func (*MemberLoginLogMutation) Fields

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

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

func (*MemberLoginLogMutation) ID

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

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

func (*MemberLoginLogMutation) IP

func (m *MemberLoginLogMutation) IP() (r string, exists bool)

IP returns the ip value in the mutation.

func (*MemberLoginLogMutation) IPCleared

func (m *MemberLoginLogMutation) IPCleared() bool

IPCleared returns if the field ip was cleared in this mutation.

func (*MemberLoginLogMutation) MemberGid

func (m *MemberLoginLogMutation) MemberGid() (r uuid.UUID, exists bool)

MemberGid returns the member_gid value in the mutation.

func (*MemberLoginLogMutation) OldCreateTime

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

OldCreateTime returns the old create_time value of the MemberLoginLog. If the MemberLoginLog 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 database query fails.

func (*MemberLoginLogMutation) OldField

func (m *MemberLoginLogMutation) 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 was failed.

func (*MemberLoginLogMutation) OldIP

func (m *MemberLoginLogMutation) OldIP(ctx context.Context) (v *string, err error)

OldIP returns the old ip value of the MemberLoginLog. If the MemberLoginLog 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 database query fails.

func (*MemberLoginLogMutation) OldMemberGid

func (m *MemberLoginLogMutation) OldMemberGid(ctx context.Context) (v uuid.UUID, err error)

OldMemberGid returns the old member_gid value of the MemberLoginLog. If the MemberLoginLog 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 database query fails.

func (*MemberLoginLogMutation) OldUserAgent

func (m *MemberLoginLogMutation) OldUserAgent(ctx context.Context) (v *string, err error)

OldUserAgent returns the old user_agent value of the MemberLoginLog. If the MemberLoginLog 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 database query fails.

func (*MemberLoginLogMutation) Op

func (m *MemberLoginLogMutation) Op() Op

Op returns the operation name.

func (*MemberLoginLogMutation) OwnerCleared

func (m *MemberLoginLogMutation) OwnerCleared() bool

OwnerCleared returns if the edge owner was cleared.

func (*MemberLoginLogMutation) OwnerID

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

OwnerID returns the owner id in the mutation.

func (*MemberLoginLogMutation) OwnerIDs

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

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

func (*MemberLoginLogMutation) RemovedEdges

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

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

func (*MemberLoginLogMutation) RemovedIDs

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

RemovedIDs returns all ids (to other nodes) that were removed for the given edge name.

func (*MemberLoginLogMutation) ResetCreateTime

func (m *MemberLoginLogMutation) ResetCreateTime()

ResetCreateTime reset all changes of the "create_time" field.

func (*MemberLoginLogMutation) ResetEdge

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

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

func (*MemberLoginLogMutation) ResetField

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

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

func (*MemberLoginLogMutation) ResetIP

func (m *MemberLoginLogMutation) ResetIP()

ResetIP reset all changes of the "ip" field.

func (*MemberLoginLogMutation) ResetMemberGid

func (m *MemberLoginLogMutation) ResetMemberGid()

ResetMemberGid reset all changes of the "member_gid" field.

func (*MemberLoginLogMutation) ResetOwner

func (m *MemberLoginLogMutation) ResetOwner()

ResetOwner reset all changes of the "owner" edge.

func (*MemberLoginLogMutation) ResetUserAgent

func (m *MemberLoginLogMutation) ResetUserAgent()

ResetUserAgent reset all changes of the "user_agent" field.

func (*MemberLoginLogMutation) SetCreateTime

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

SetCreateTime sets the create_time field.

func (*MemberLoginLogMutation) SetField

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

SetField sets the value for the given name. It returns an error if the field is not defined in the schema, or if the type mismatch the field type.

func (*MemberLoginLogMutation) SetID

func (m *MemberLoginLogMutation) SetID(id int)

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

func (*MemberLoginLogMutation) SetIP

func (m *MemberLoginLogMutation) SetIP(s string)

SetIP sets the ip field.

func (*MemberLoginLogMutation) SetMemberGid

func (m *MemberLoginLogMutation) SetMemberGid(u uuid.UUID)

SetMemberGid sets the member_gid field.

func (*MemberLoginLogMutation) SetOwnerID

func (m *MemberLoginLogMutation) SetOwnerID(id int)

SetOwnerID sets the owner edge to Member by id.

func (*MemberLoginLogMutation) SetUserAgent

func (m *MemberLoginLogMutation) SetUserAgent(s string)

SetUserAgent sets the user_agent field.

func (MemberLoginLogMutation) Tx

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

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

func (*MemberLoginLogMutation) Type

func (m *MemberLoginLogMutation) Type() string

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

func (*MemberLoginLogMutation) UserAgent

func (m *MemberLoginLogMutation) UserAgent() (r string, exists bool)

UserAgent returns the user_agent value in the mutation.

func (*MemberLoginLogMutation) UserAgentCleared

func (m *MemberLoginLogMutation) UserAgentCleared() bool

UserAgentCleared returns if the field user_agent was cleared in this mutation.

type MemberLoginLogQuery

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

MemberLoginLogQuery is the builder for querying MemberLoginLog entities.

func (*MemberLoginLogQuery) All

All executes the query and returns a list of MemberLoginLogs.

func (*MemberLoginLogQuery) AllX

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

func (*MemberLoginLogQuery) Clone

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

func (*MemberLoginLogQuery) Count

func (mllq *MemberLoginLogQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*MemberLoginLogQuery) CountX

func (mllq *MemberLoginLogQuery) CountX(ctx context.Context) int

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

func (*MemberLoginLogQuery) Exist

func (mllq *MemberLoginLogQuery) Exist(ctx context.Context) (bool, error)

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

func (*MemberLoginLogQuery) ExistX

func (mllq *MemberLoginLogQuery) ExistX(ctx context.Context) bool

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

func (*MemberLoginLogQuery) First

First returns the first MemberLoginLog entity in the query. Returns *NotFoundError when no memberloginlog was found.

func (*MemberLoginLogQuery) FirstID

func (mllq *MemberLoginLogQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first MemberLoginLog id in the query. Returns *NotFoundError when no id was found.

func (*MemberLoginLogQuery) FirstX

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

func (*MemberLoginLogQuery) FirstXID

func (mllq *MemberLoginLogQuery) FirstXID(ctx context.Context) int

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

func (*MemberLoginLogQuery) GroupBy

func (mllq *MemberLoginLogQuery) GroupBy(field string, fields ...string) *MemberLoginLogGroupBy

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

client.MemberLoginLog.Query().
	GroupBy(memberloginlog.FieldCreateTime).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*MemberLoginLogQuery) IDs

func (mllq *MemberLoginLogQuery) IDs(ctx context.Context) ([]int, error)

IDs executes the query and returns a list of MemberLoginLog ids.

func (*MemberLoginLogQuery) IDsX

func (mllq *MemberLoginLogQuery) IDsX(ctx context.Context) []int

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

func (*MemberLoginLogQuery) Limit

func (mllq *MemberLoginLogQuery) Limit(limit int) *MemberLoginLogQuery

Limit adds a limit step to the query.

func (*MemberLoginLogQuery) Offset

func (mllq *MemberLoginLogQuery) Offset(offset int) *MemberLoginLogQuery

Offset adds an offset step to the query.

func (*MemberLoginLogQuery) Only

Only returns the only MemberLoginLog entity in the query, returns an error if not exactly one entity was returned.

func (*MemberLoginLogQuery) OnlyID

func (mllq *MemberLoginLogQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID returns the only MemberLoginLog id in the query, returns an error if not exactly one id was returned.

func (*MemberLoginLogQuery) OnlyIDX

func (mllq *MemberLoginLogQuery) OnlyIDX(ctx context.Context) int

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

func (*MemberLoginLogQuery) OnlyX

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

func (*MemberLoginLogQuery) Order

Order adds an order step to the query.

func (*MemberLoginLogQuery) QueryOwner

func (mllq *MemberLoginLogQuery) QueryOwner() *MemberQuery

QueryOwner chains the current query on the owner edge.

func (*MemberLoginLogQuery) Select

func (mllq *MemberLoginLogQuery) Select(field string, fields ...string) *MemberLoginLogSelect

Select one or more fields from the given query.

Example:

var v []struct {
	CreateTime time.Time `json:"create_time,omitempty"`
}

client.MemberLoginLog.Query().
	Select(memberloginlog.FieldCreateTime).
	Scan(ctx, &v)

func (*MemberLoginLogQuery) Where

Where adds a new predicate for the builder.

func (*MemberLoginLogQuery) WithOwner

func (mllq *MemberLoginLogQuery) WithOwner(opts ...func(*MemberQuery)) *MemberLoginLogQuery
WithOwner tells the query-builder to eager-loads the nodes that are connected to

the "owner" edge. The optional arguments used to configure the query builder of the edge.

type MemberLoginLogSelect

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

MemberLoginLogSelect is the builder for select fields of MemberLoginLog entities.

func (*MemberLoginLogSelect) Bool

func (mlls *MemberLoginLogSelect) Bool(ctx context.Context) (_ bool, err error)

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

func (*MemberLoginLogSelect) BoolX

func (mlls *MemberLoginLogSelect) BoolX(ctx context.Context) bool

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

func (*MemberLoginLogSelect) Bools

func (mlls *MemberLoginLogSelect) Bools(ctx context.Context) ([]bool, error)

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

func (*MemberLoginLogSelect) BoolsX

func (mlls *MemberLoginLogSelect) BoolsX(ctx context.Context) []bool

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

func (*MemberLoginLogSelect) Float64

func (mlls *MemberLoginLogSelect) Float64(ctx context.Context) (_ float64, err error)

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

func (*MemberLoginLogSelect) Float64X

func (mlls *MemberLoginLogSelect) Float64X(ctx context.Context) float64

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

func (*MemberLoginLogSelect) Float64s

func (mlls *MemberLoginLogSelect) Float64s(ctx context.Context) ([]float64, error)

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

func (*MemberLoginLogSelect) Float64sX

func (mlls *MemberLoginLogSelect) Float64sX(ctx context.Context) []float64

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

func (*MemberLoginLogSelect) Int

func (mlls *MemberLoginLogSelect) Int(ctx context.Context) (_ int, err error)

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

func (*MemberLoginLogSelect) IntX

func (mlls *MemberLoginLogSelect) IntX(ctx context.Context) int

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

func (*MemberLoginLogSelect) Ints

func (mlls *MemberLoginLogSelect) Ints(ctx context.Context) ([]int, error)

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

func (*MemberLoginLogSelect) IntsX

func (mlls *MemberLoginLogSelect) IntsX(ctx context.Context) []int

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

func (*MemberLoginLogSelect) Scan

func (mlls *MemberLoginLogSelect) Scan(ctx context.Context, v interface{}) error

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

func (*MemberLoginLogSelect) ScanX

func (mlls *MemberLoginLogSelect) ScanX(ctx context.Context, v interface{})

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

func (*MemberLoginLogSelect) String

func (mlls *MemberLoginLogSelect) String(ctx context.Context) (_ string, err error)

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

func (*MemberLoginLogSelect) StringX

func (mlls *MemberLoginLogSelect) StringX(ctx context.Context) string

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

func (*MemberLoginLogSelect) Strings

func (mlls *MemberLoginLogSelect) Strings(ctx context.Context) ([]string, error)

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

func (*MemberLoginLogSelect) StringsX

func (mlls *MemberLoginLogSelect) StringsX(ctx context.Context) []string

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

type MemberLoginLogUpdate

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

MemberLoginLogUpdate is the builder for updating MemberLoginLog entities.

func (*MemberLoginLogUpdate) ClearIP

func (mllu *MemberLoginLogUpdate) ClearIP() *MemberLoginLogUpdate

ClearIP clears the value of ip.

func (*MemberLoginLogUpdate) ClearOwner

func (mllu *MemberLoginLogUpdate) ClearOwner() *MemberLoginLogUpdate

ClearOwner clears the "owner" edge to type Member.

func (*MemberLoginLogUpdate) ClearUserAgent

func (mllu *MemberLoginLogUpdate) ClearUserAgent() *MemberLoginLogUpdate

ClearUserAgent clears the value of user_agent.

func (*MemberLoginLogUpdate) Exec

func (mllu *MemberLoginLogUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*MemberLoginLogUpdate) ExecX

func (mllu *MemberLoginLogUpdate) ExecX(ctx context.Context)

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

func (*MemberLoginLogUpdate) Mutation

func (mllu *MemberLoginLogUpdate) Mutation() *MemberLoginLogMutation

Mutation returns the MemberLoginLogMutation object of the builder.

func (*MemberLoginLogUpdate) Save

func (mllu *MemberLoginLogUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of rows/vertices matched by this operation.

func (*MemberLoginLogUpdate) SaveX

func (mllu *MemberLoginLogUpdate) SaveX(ctx context.Context) int

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

func (*MemberLoginLogUpdate) SetIP

SetIP sets the ip field.

func (*MemberLoginLogUpdate) SetMemberGid

func (mllu *MemberLoginLogUpdate) SetMemberGid(u uuid.UUID) *MemberLoginLogUpdate

SetMemberGid sets the member_gid field.

func (*MemberLoginLogUpdate) SetNillableIP

func (mllu *MemberLoginLogUpdate) SetNillableIP(s *string) *MemberLoginLogUpdate

SetNillableIP sets the ip field if the given value is not nil.

func (*MemberLoginLogUpdate) SetNillableOwnerID

func (mllu *MemberLoginLogUpdate) SetNillableOwnerID(id *int) *MemberLoginLogUpdate

SetNillableOwnerID sets the owner edge to Member by id if the given value is not nil.

func (*MemberLoginLogUpdate) SetNillableUserAgent

func (mllu *MemberLoginLogUpdate) SetNillableUserAgent(s *string) *MemberLoginLogUpdate

SetNillableUserAgent sets the user_agent field if the given value is not nil.

func (*MemberLoginLogUpdate) SetOwner

func (mllu *MemberLoginLogUpdate) SetOwner(m *Member) *MemberLoginLogUpdate

SetOwner sets the owner edge to Member.

func (*MemberLoginLogUpdate) SetOwnerID

func (mllu *MemberLoginLogUpdate) SetOwnerID(id int) *MemberLoginLogUpdate

SetOwnerID sets the owner edge to Member by id.

func (*MemberLoginLogUpdate) SetUserAgent

func (mllu *MemberLoginLogUpdate) SetUserAgent(s string) *MemberLoginLogUpdate

SetUserAgent sets the user_agent field.

func (*MemberLoginLogUpdate) Where

Where adds a new predicate for the builder.

type MemberLoginLogUpdateOne

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

MemberLoginLogUpdateOne is the builder for updating a single MemberLoginLog entity.

func (*MemberLoginLogUpdateOne) ClearIP

ClearIP clears the value of ip.

func (*MemberLoginLogUpdateOne) ClearOwner

func (mlluo *MemberLoginLogUpdateOne) ClearOwner() *MemberLoginLogUpdateOne

ClearOwner clears the "owner" edge to type Member.

func (*MemberLoginLogUpdateOne) ClearUserAgent

func (mlluo *MemberLoginLogUpdateOne) ClearUserAgent() *MemberLoginLogUpdateOne

ClearUserAgent clears the value of user_agent.

func (*MemberLoginLogUpdateOne) Exec

func (mlluo *MemberLoginLogUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*MemberLoginLogUpdateOne) ExecX

func (mlluo *MemberLoginLogUpdateOne) ExecX(ctx context.Context)

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

func (*MemberLoginLogUpdateOne) Mutation

Mutation returns the MemberLoginLogMutation object of the builder.

func (*MemberLoginLogUpdateOne) Save

Save executes the query and returns the updated entity.

func (*MemberLoginLogUpdateOne) SaveX

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

func (*MemberLoginLogUpdateOne) SetIP

SetIP sets the ip field.

func (*MemberLoginLogUpdateOne) SetMemberGid

func (mlluo *MemberLoginLogUpdateOne) SetMemberGid(u uuid.UUID) *MemberLoginLogUpdateOne

SetMemberGid sets the member_gid field.

func (*MemberLoginLogUpdateOne) SetNillableIP

func (mlluo *MemberLoginLogUpdateOne) SetNillableIP(s *string) *MemberLoginLogUpdateOne

SetNillableIP sets the ip field if the given value is not nil.

func (*MemberLoginLogUpdateOne) SetNillableOwnerID

func (mlluo *MemberLoginLogUpdateOne) SetNillableOwnerID(id *int) *MemberLoginLogUpdateOne

SetNillableOwnerID sets the owner edge to Member by id if the given value is not nil.

func (*MemberLoginLogUpdateOne) SetNillableUserAgent

func (mlluo *MemberLoginLogUpdateOne) SetNillableUserAgent(s *string) *MemberLoginLogUpdateOne

SetNillableUserAgent sets the user_agent field if the given value is not nil.

func (*MemberLoginLogUpdateOne) SetOwner

SetOwner sets the owner edge to Member.

func (*MemberLoginLogUpdateOne) SetOwnerID

func (mlluo *MemberLoginLogUpdateOne) SetOwnerID(id int) *MemberLoginLogUpdateOne

SetOwnerID sets the owner edge to Member by id.

func (*MemberLoginLogUpdateOne) SetUserAgent

func (mlluo *MemberLoginLogUpdateOne) SetUserAgent(s string) *MemberLoginLogUpdateOne

SetUserAgent sets the user_agent field.

type MemberLoginLogs

type MemberLoginLogs []*MemberLoginLog

MemberLoginLogs is a parsable slice of MemberLoginLog.

type MemberMutation

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

MemberMutation represents an operation that mutate the Members nodes in the graph.

func (*MemberMutation) AddField

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

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

func (*MemberMutation) AddGender

func (m *MemberMutation) AddGender(i int)

AddGender adds i to gender.

func (*MemberMutation) AddLoginLogIDs

func (m *MemberMutation) AddLoginLogIDs(ids ...int)

AddLoginLogIDs adds the loginLogs edge to MemberLoginLog by ids.

func (*MemberMutation) AddNoteArticleIDs

func (m *MemberMutation) AddNoteArticleIDs(ids ...int)

AddNoteArticleIDs adds the noteArticles edge to NoteArticle by ids.

func (*MemberMutation) AddNoteFilesystemIDs

func (m *MemberMutation) AddNoteFilesystemIDs(ids ...int)

AddNoteFilesystemIDs adds the noteFilesystem edge to NoteFilesystem 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 in/decremented from a field with the given name. The second value indicates that this field was not set, or was not define in the schema.

func (*MemberMutation) AddedFields

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

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

func (*MemberMutation) AddedGender

func (m *MemberMutation) AddedGender() (r int, exists bool)

AddedGender returns the value that was added to the gender field in 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.

func (*MemberMutation) ClearEdge

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

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

func (*MemberMutation) ClearField

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

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

func (*MemberMutation) ClearGender

func (m *MemberMutation) ClearGender()

ClearGender clears the value of gender.

func (*MemberMutation) ClearLoginLogs

func (m *MemberMutation) ClearLoginLogs()

ClearLoginLogs clears the loginLogs edge to MemberLoginLog.

func (*MemberMutation) ClearNoteArticles

func (m *MemberMutation) ClearNoteArticles()

ClearNoteArticles clears the noteArticles edge to NoteArticle.

func (*MemberMutation) ClearNoteFilesystem

func (m *MemberMutation) ClearNoteFilesystem()

ClearNoteFilesystem clears the noteFilesystem edge to NoteFilesystem.

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) CreatedAt

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

CreatedAt returns the created_at value in the mutation.

func (*MemberMutation) EdgeCleared

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

EdgeCleared returns a boolean indicates if this edge was cleared in this mutation.

func (*MemberMutation) Email

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

Email returns the email value in the 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 value indicates that this field was not set, or was not define in the schema.

func (*MemberMutation) FieldCleared

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

FieldCleared returns a boolean indicates if this field 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 in/decremented, call AddedFields().

func (*MemberMutation) Gender

func (m *MemberMutation) Gender() (r int, exists bool)

Gender returns the gender value in the mutation.

func (*MemberMutation) GenderCleared

func (m *MemberMutation) GenderCleared() bool

GenderCleared returns if the field gender was cleared in this mutation.

func (*MemberMutation) Gid

func (m *MemberMutation) Gid() (r uuid.UUID, exists bool)

Gid returns the gid value in the 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 available only if it was provided to the builder.

func (*MemberMutation) LoginLogsCleared

func (m *MemberMutation) LoginLogsCleared() bool

LoginLogsCleared returns if the edge loginLogs was cleared.

func (*MemberMutation) LoginLogsIDs

func (m *MemberMutation) LoginLogsIDs() (ids []int)

LoginLogsIDs returns the loginLogs ids in the mutation.

func (*MemberMutation) Nickname

func (m *MemberMutation) Nickname() (r string, exists bool)

Nickname returns the nickname value in the mutation.

func (*MemberMutation) NoteArticlesCleared

func (m *MemberMutation) NoteArticlesCleared() bool

NoteArticlesCleared returns if the edge noteArticles was cleared.

func (*MemberMutation) NoteArticlesIDs

func (m *MemberMutation) NoteArticlesIDs() (ids []int)

NoteArticlesIDs returns the noteArticles ids in the mutation.

func (*MemberMutation) NoteFilesystemCleared

func (m *MemberMutation) NoteFilesystemCleared() bool

NoteFilesystemCleared returns if the edge noteFilesystem was cleared.

func (*MemberMutation) NoteFilesystemIDs

func (m *MemberMutation) NoteFilesystemIDs() (ids []int)

NoteFilesystemIDs returns the noteFilesystem ids in the mutation.

func (*MemberMutation) OldCreatedAt

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

OldCreatedAt returns the old created_at value of the Member. 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 database query fails.

func (*MemberMutation) OldEmail

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

OldEmail returns the old email value of the Member. 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 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 was failed.

func (*MemberMutation) OldGender

func (m *MemberMutation) OldGender(ctx context.Context) (v int, err error)

OldGender returns the old gender value of the Member. 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 database query fails.

func (*MemberMutation) OldGid

func (m *MemberMutation) OldGid(ctx context.Context) (v uuid.UUID, err error)

OldGid returns the old gid value of the Member. 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 database query fails.

func (*MemberMutation) OldNickname

func (m *MemberMutation) OldNickname(ctx context.Context) (v string, err error)

OldNickname returns the old nickname value of the Member. 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 database query fails.

func (*MemberMutation) OldPassword

func (m *MemberMutation) OldPassword(ctx context.Context) (v string, err error)

OldPassword returns the old password value of the Member. 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 database query fails.

func (*MemberMutation) OldSignature

func (m *MemberMutation) OldSignature(ctx context.Context) (v string, err error)

OldSignature returns the old signature value of the Member. 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 database query fails.

func (*MemberMutation) OldUpdatedAt

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

OldUpdatedAt returns the old updated_at value of the Member. 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 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 password value in the mutation.

func (*MemberMutation) RemoveLoginLogIDs

func (m *MemberMutation) RemoveLoginLogIDs(ids ...int)

RemoveLoginLogIDs removes the loginLogs edge to MemberLoginLog by ids.

func (*MemberMutation) RemoveNoteArticleIDs

func (m *MemberMutation) RemoveNoteArticleIDs(ids ...int)

RemoveNoteArticleIDs removes the noteArticles edge to NoteArticle by ids.

func (*MemberMutation) RemoveNoteFilesystemIDs

func (m *MemberMutation) RemoveNoteFilesystemIDs(ids ...int)

RemoveNoteFilesystemIDs removes the noteFilesystem edge to NoteFilesystem 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 given edge name.

func (*MemberMutation) RemovedLoginLogsIDs

func (m *MemberMutation) RemovedLoginLogsIDs() (ids []int)

RemovedLoginLogs returns the removed ids of loginLogs.

func (*MemberMutation) RemovedNoteArticlesIDs

func (m *MemberMutation) RemovedNoteArticlesIDs() (ids []int)

RemovedNoteArticles returns the removed ids of noteArticles.

func (*MemberMutation) RemovedNoteFilesystemIDs

func (m *MemberMutation) RemovedNoteFilesystemIDs() (ids []int)

RemovedNoteFilesystem returns the removed ids of noteFilesystem.

func (*MemberMutation) ResetCreatedAt

func (m *MemberMutation) ResetCreatedAt()

ResetCreatedAt reset all changes of the "created_at" field.

func (*MemberMutation) ResetEdge

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

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

func (*MemberMutation) ResetEmail

func (m *MemberMutation) ResetEmail()

ResetEmail reset all changes of the "email" field.

func (*MemberMutation) ResetField

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

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

func (*MemberMutation) ResetGender

func (m *MemberMutation) ResetGender()

ResetGender reset all changes of the "gender" field.

func (*MemberMutation) ResetGid

func (m *MemberMutation) ResetGid()

ResetGid reset all changes of the "gid" field.

func (*MemberMutation) ResetLoginLogs

func (m *MemberMutation) ResetLoginLogs()

ResetLoginLogs reset all changes of the "loginLogs" edge.

func (*MemberMutation) ResetNickname

func (m *MemberMutation) ResetNickname()

ResetNickname reset all changes of the "nickname" field.

func (*MemberMutation) ResetNoteArticles

func (m *MemberMutation) ResetNoteArticles()

ResetNoteArticles reset all changes of the "noteArticles" edge.

func (*MemberMutation) ResetNoteFilesystem

func (m *MemberMutation) ResetNoteFilesystem()

ResetNoteFilesystem reset all changes of the "noteFilesystem" edge.

func (*MemberMutation) ResetPassword

func (m *MemberMutation) ResetPassword()

ResetPassword reset all changes of the "password" field.

func (*MemberMutation) ResetSignature

func (m *MemberMutation) ResetSignature()

ResetSignature reset all changes of the "signature" field.

func (*MemberMutation) ResetUpdatedAt

func (m *MemberMutation) ResetUpdatedAt()

ResetUpdatedAt reset all changes of the "updated_at" field.

func (*MemberMutation) SetCreatedAt

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

SetCreatedAt sets the created_at field.

func (*MemberMutation) SetEmail

func (m *MemberMutation) SetEmail(s string)

SetEmail sets the email field.

func (*MemberMutation) SetField

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

SetField sets the value for the given name. It returns an error if the field is not defined in the schema, or if the type mismatch the field type.

func (*MemberMutation) SetGender

func (m *MemberMutation) SetGender(i int)

SetGender sets the gender field.

func (*MemberMutation) SetGid

func (m *MemberMutation) SetGid(u uuid.UUID)

SetGid sets the gid field.

func (*MemberMutation) SetID

func (m *MemberMutation) SetID(id int)

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

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) SetSignature

func (m *MemberMutation) SetSignature(s string)

SetSignature sets the signature field.

func (*MemberMutation) SetUpdatedAt

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

SetUpdatedAt sets the updated_at field.

func (*MemberMutation) Signature

func (m *MemberMutation) Signature() (r string, exists bool)

Signature returns the signature value in the 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) UpdatedAt

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

UpdatedAt returns the updated_at value in the mutation.

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 query 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 in the query. Returns *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 in the query. Returns *NotFoundError when no id was found.

func (*MemberQuery) FirstX

func (mq *MemberQuery) FirstX(ctx context.Context) *Member

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

func (*MemberQuery) FirstXID

func (mq *MemberQuery) FirstXID(ctx context.Context) int

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

func (*MemberQuery) GroupBy

func (mq *MemberQuery) GroupBy(field string, fields ...string) *MemberGroupBy

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

client.Member.Query().
	GroupBy(member.FieldCreatedAt).
	Aggregate(ent.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 the only Member entity in the query, returns an error if not exactly one entity was returned.

func (*MemberQuery) OnlyID

func (mq *MemberQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID returns the only Member id in the query, returns an error if not exactly one id was returned.

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) QueryLoginLogs

func (mq *MemberQuery) QueryLoginLogs() *MemberLoginLogQuery

QueryLoginLogs chains the current query on the loginLogs edge.

func (*MemberQuery) QueryNoteArticles

func (mq *MemberQuery) QueryNoteArticles() *NoteArticleQuery

QueryNoteArticles chains the current query on the noteArticles edge.

func (*MemberQuery) QueryNoteFilesystem

func (mq *MemberQuery) QueryNoteFilesystem() *NoteFilesystemQuery

QueryNoteFilesystem chains the current query on the noteFilesystem edge.

func (*MemberQuery) Select

func (mq *MemberQuery) Select(field string, fields ...string) *MemberSelect

Select one or more fields from the given query.

Example:

var v []struct {
	CreatedAt time.Time `json:"created_at,omitempty"`
}

client.Member.Query().
	Select(member.FieldCreatedAt).
	Scan(ctx, &v)

func (*MemberQuery) Where

func (mq *MemberQuery) Where(ps ...predicate.Member) *MemberQuery

Where adds a new predicate for the builder.

func (*MemberQuery) WithLoginLogs

func (mq *MemberQuery) WithLoginLogs(opts ...func(*MemberLoginLogQuery)) *MemberQuery
WithLoginLogs tells the query-builder to eager-loads the nodes that are connected to

the "loginLogs" edge. The optional arguments used to configure the query builder of the edge.

func (*MemberQuery) WithNoteArticles

func (mq *MemberQuery) WithNoteArticles(opts ...func(*NoteArticleQuery)) *MemberQuery
WithNoteArticles tells the query-builder to eager-loads the nodes that are connected to

the "noteArticles" edge. The optional arguments used to configure the query builder of the edge.

func (*MemberQuery) WithNoteFilesystem

func (mq *MemberQuery) WithNoteFilesystem(opts ...func(*NoteFilesystemQuery)) *MemberQuery
WithNoteFilesystem tells the query-builder to eager-loads the nodes that are connected to

the "noteFilesystem" edge. The optional arguments used to configure the query builder of the edge.

type MemberSelect

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

MemberSelect is the builder for select fields of Member entities.

func (*MemberSelect) Bool

func (ms *MemberSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from 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 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 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 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 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 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 scan 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 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 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 MemberUpdate

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

MemberUpdate is the builder for updating Member entities.

func (*MemberUpdate) AddGender

func (mu *MemberUpdate) AddGender(i int) *MemberUpdate

AddGender adds i to gender.

func (*MemberUpdate) AddLoginLogIDs

func (mu *MemberUpdate) AddLoginLogIDs(ids ...int) *MemberUpdate

AddLoginLogIDs adds the loginLogs edge to MemberLoginLog by ids.

func (*MemberUpdate) AddLoginLogs

func (mu *MemberUpdate) AddLoginLogs(m ...*MemberLoginLog) *MemberUpdate

AddLoginLogs adds the loginLogs edges to MemberLoginLog.

func (*MemberUpdate) AddNoteArticleIDs

func (mu *MemberUpdate) AddNoteArticleIDs(ids ...int) *MemberUpdate

AddNoteArticleIDs adds the noteArticles edge to NoteArticle by ids.

func (*MemberUpdate) AddNoteArticles

func (mu *MemberUpdate) AddNoteArticles(n ...*NoteArticle) *MemberUpdate

AddNoteArticles adds the noteArticles edges to NoteArticle.

func (*MemberUpdate) AddNoteFilesystem

func (mu *MemberUpdate) AddNoteFilesystem(n ...*NoteFilesystem) *MemberUpdate

AddNoteFilesystem adds the noteFilesystem edges to NoteFilesystem.

func (*MemberUpdate) AddNoteFilesystemIDs

func (mu *MemberUpdate) AddNoteFilesystemIDs(ids ...int) *MemberUpdate

AddNoteFilesystemIDs adds the noteFilesystem edge to NoteFilesystem by ids.

func (*MemberUpdate) ClearGender

func (mu *MemberUpdate) ClearGender() *MemberUpdate

ClearGender clears the value of gender.

func (*MemberUpdate) ClearLoginLogs

func (mu *MemberUpdate) ClearLoginLogs() *MemberUpdate

ClearLoginLogs clears all "loginLogs" edges to type MemberLoginLog.

func (*MemberUpdate) ClearNoteArticles

func (mu *MemberUpdate) ClearNoteArticles() *MemberUpdate

ClearNoteArticles clears all "noteArticles" edges to type NoteArticle.

func (*MemberUpdate) ClearNoteFilesystem

func (mu *MemberUpdate) ClearNoteFilesystem() *MemberUpdate

ClearNoteFilesystem clears all "noteFilesystem" edges to type NoteFilesystem.

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) RemoveLoginLogIDs

func (mu *MemberUpdate) RemoveLoginLogIDs(ids ...int) *MemberUpdate

RemoveLoginLogIDs removes the loginLogs edge to MemberLoginLog by ids.

func (*MemberUpdate) RemoveLoginLogs

func (mu *MemberUpdate) RemoveLoginLogs(m ...*MemberLoginLog) *MemberUpdate

RemoveLoginLogs removes loginLogs edges to MemberLoginLog.

func (*MemberUpdate) RemoveNoteArticleIDs

func (mu *MemberUpdate) RemoveNoteArticleIDs(ids ...int) *MemberUpdate

RemoveNoteArticleIDs removes the noteArticles edge to NoteArticle by ids.

func (*MemberUpdate) RemoveNoteArticles

func (mu *MemberUpdate) RemoveNoteArticles(n ...*NoteArticle) *MemberUpdate

RemoveNoteArticles removes noteArticles edges to NoteArticle.

func (*MemberUpdate) RemoveNoteFilesystem

func (mu *MemberUpdate) RemoveNoteFilesystem(n ...*NoteFilesystem) *MemberUpdate

RemoveNoteFilesystem removes noteFilesystem edges to NoteFilesystem.

func (*MemberUpdate) RemoveNoteFilesystemIDs

func (mu *MemberUpdate) RemoveNoteFilesystemIDs(ids ...int) *MemberUpdate

RemoveNoteFilesystemIDs removes the noteFilesystem edge to NoteFilesystem by ids.

func (*MemberUpdate) Save

func (mu *MemberUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of rows/vertices matched by this operation.

func (*MemberUpdate) SaveX

func (mu *MemberUpdate) SaveX(ctx context.Context) int

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

func (*MemberUpdate) SetEmail

func (mu *MemberUpdate) SetEmail(s string) *MemberUpdate

SetEmail sets the email field.

func (*MemberUpdate) SetGender

func (mu *MemberUpdate) SetGender(i int) *MemberUpdate

SetGender sets the gender field.

func (*MemberUpdate) SetNickname

func (mu *MemberUpdate) SetNickname(s string) *MemberUpdate

SetNickname sets the nickname field.

func (*MemberUpdate) SetNillableGender

func (mu *MemberUpdate) SetNillableGender(i *int) *MemberUpdate

SetNillableGender sets the gender 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) SetSignature

func (mu *MemberUpdate) SetSignature(s string) *MemberUpdate

SetSignature sets the signature field.

func (*MemberUpdate) SetUpdatedAt

func (mu *MemberUpdate) SetUpdatedAt(t time.Time) *MemberUpdate

SetUpdatedAt sets the updated_at field.

func (*MemberUpdate) Where

func (mu *MemberUpdate) Where(ps ...predicate.Member) *MemberUpdate

Where adds a new predicate for the builder.

type MemberUpdateOne

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

MemberUpdateOne is the builder for updating a single Member entity.

func (*MemberUpdateOne) AddGender

func (muo *MemberUpdateOne) AddGender(i int) *MemberUpdateOne

AddGender adds i to gender.

func (*MemberUpdateOne) AddLoginLogIDs

func (muo *MemberUpdateOne) AddLoginLogIDs(ids ...int) *MemberUpdateOne

AddLoginLogIDs adds the loginLogs edge to MemberLoginLog by ids.

func (*MemberUpdateOne) AddLoginLogs

func (muo *MemberUpdateOne) AddLoginLogs(m ...*MemberLoginLog) *MemberUpdateOne

AddLoginLogs adds the loginLogs edges to MemberLoginLog.

func (*MemberUpdateOne) AddNoteArticleIDs

func (muo *MemberUpdateOne) AddNoteArticleIDs(ids ...int) *MemberUpdateOne

AddNoteArticleIDs adds the noteArticles edge to NoteArticle by ids.

func (*MemberUpdateOne) AddNoteArticles

func (muo *MemberUpdateOne) AddNoteArticles(n ...*NoteArticle) *MemberUpdateOne

AddNoteArticles adds the noteArticles edges to NoteArticle.

func (*MemberUpdateOne) AddNoteFilesystem

func (muo *MemberUpdateOne) AddNoteFilesystem(n ...*NoteFilesystem) *MemberUpdateOne

AddNoteFilesystem adds the noteFilesystem edges to NoteFilesystem.

func (*MemberUpdateOne) AddNoteFilesystemIDs

func (muo *MemberUpdateOne) AddNoteFilesystemIDs(ids ...int) *MemberUpdateOne

AddNoteFilesystemIDs adds the noteFilesystem edge to NoteFilesystem by ids.

func (*MemberUpdateOne) ClearGender

func (muo *MemberUpdateOne) ClearGender() *MemberUpdateOne

ClearGender clears the value of gender.

func (*MemberUpdateOne) ClearLoginLogs

func (muo *MemberUpdateOne) ClearLoginLogs() *MemberUpdateOne

ClearLoginLogs clears all "loginLogs" edges to type MemberLoginLog.

func (*MemberUpdateOne) ClearNoteArticles

func (muo *MemberUpdateOne) ClearNoteArticles() *MemberUpdateOne

ClearNoteArticles clears all "noteArticles" edges to type NoteArticle.

func (*MemberUpdateOne) ClearNoteFilesystem

func (muo *MemberUpdateOne) ClearNoteFilesystem() *MemberUpdateOne

ClearNoteFilesystem clears all "noteFilesystem" edges to type NoteFilesystem.

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) RemoveLoginLogIDs

func (muo *MemberUpdateOne) RemoveLoginLogIDs(ids ...int) *MemberUpdateOne

RemoveLoginLogIDs removes the loginLogs edge to MemberLoginLog by ids.

func (*MemberUpdateOne) RemoveLoginLogs

func (muo *MemberUpdateOne) RemoveLoginLogs(m ...*MemberLoginLog) *MemberUpdateOne

RemoveLoginLogs removes loginLogs edges to MemberLoginLog.

func (*MemberUpdateOne) RemoveNoteArticleIDs

func (muo *MemberUpdateOne) RemoveNoteArticleIDs(ids ...int) *MemberUpdateOne

RemoveNoteArticleIDs removes the noteArticles edge to NoteArticle by ids.

func (*MemberUpdateOne) RemoveNoteArticles

func (muo *MemberUpdateOne) RemoveNoteArticles(n ...*NoteArticle) *MemberUpdateOne

RemoveNoteArticles removes noteArticles edges to NoteArticle.

func (*MemberUpdateOne) RemoveNoteFilesystem

func (muo *MemberUpdateOne) RemoveNoteFilesystem(n ...*NoteFilesystem) *MemberUpdateOne

RemoveNoteFilesystem removes noteFilesystem edges to NoteFilesystem.

func (*MemberUpdateOne) RemoveNoteFilesystemIDs

func (muo *MemberUpdateOne) RemoveNoteFilesystemIDs(ids ...int) *MemberUpdateOne

RemoveNoteFilesystemIDs removes the noteFilesystem edge to NoteFilesystem by ids.

func (*MemberUpdateOne) Save

func (muo *MemberUpdateOne) Save(ctx context.Context) (*Member, error)

Save executes the query and returns the updated entity.

func (*MemberUpdateOne) SaveX

func (muo *MemberUpdateOne) SaveX(ctx context.Context) *Member

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

func (*MemberUpdateOne) SetEmail

func (muo *MemberUpdateOne) SetEmail(s string) *MemberUpdateOne

SetEmail sets the email field.

func (*MemberUpdateOne) SetGender

func (muo *MemberUpdateOne) SetGender(i int) *MemberUpdateOne

SetGender sets the gender field.

func (*MemberUpdateOne) SetNickname

func (muo *MemberUpdateOne) SetNickname(s string) *MemberUpdateOne

SetNickname sets the nickname field.

func (*MemberUpdateOne) SetNillableGender

func (muo *MemberUpdateOne) SetNillableGender(i *int) *MemberUpdateOne

SetNillableGender sets the gender 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) SetSignature

func (muo *MemberUpdateOne) SetSignature(s string) *MemberUpdateOne

SetSignature sets the signature field.

func (*MemberUpdateOne) SetUpdatedAt

func (muo *MemberUpdateOne) SetUpdatedAt(t time.Time) *MemberUpdateOne

SetUpdatedAt sets the updated_at field.

type Members

type Members []*Member

Members is a parsable slice of Member.

type MutateFunc

type MutateFunc = ent.MutateFunc

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

type Mutation

type Mutation = ent.Mutation

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

type Mutator

type Mutator = ent.Mutator

ent aliases to avoid import conflict 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 NoteArticle

type NoteArticle struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// UpdatedAt holds the value of the "updated_at" field.
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// Gid holds the value of the "gid" field.
	Gid uuid.UUID `json:"gid,omitempty"`
	// MemberGid holds the value of the "member_gid" field.
	MemberGid uuid.UUID `json:"member_gid,omitempty"`
	// Mime holds the value of the "mime" field.
	Mime notearticle.Mime `json:"mime,omitempty"`
	// Content holds the value of the "content" field.
	Content string `json:"content,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the NoteArticleQuery when eager-loading is set.
	Edges NoteArticleEdges `json:"edges"`
	// contains filtered or unexported fields
}

NoteArticle is the model entity for the NoteArticle schema.

func (*NoteArticle) QueryOwner

func (na *NoteArticle) QueryOwner() *MemberQuery

QueryOwner queries the owner edge of the NoteArticle.

func (*NoteArticle) String

func (na *NoteArticle) String() string

String implements the fmt.Stringer.

func (*NoteArticle) Unwrap

func (na *NoteArticle) Unwrap() *NoteArticle

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

func (*NoteArticle) Update

func (na *NoteArticle) Update() *NoteArticleUpdateOne

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

type NoteArticleClient

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

NoteArticleClient is a client for the NoteArticle schema.

func NewNoteArticleClient

func NewNoteArticleClient(c config) *NoteArticleClient

NewNoteArticleClient returns a client for the NoteArticle from the given config.

func (*NoteArticleClient) Create

func (c *NoteArticleClient) Create() *NoteArticleCreate

Create returns a create builder for NoteArticle.

func (*NoteArticleClient) CreateBulk

func (c *NoteArticleClient) CreateBulk(builders ...*NoteArticleCreate) *NoteArticleCreateBulk

BulkCreate returns a builder for creating a bulk of NoteArticle entities.

func (*NoteArticleClient) Delete

func (c *NoteArticleClient) Delete() *NoteArticleDelete

Delete returns a delete builder for NoteArticle.

func (*NoteArticleClient) DeleteOne

DeleteOne returns a delete builder for the given entity.

func (*NoteArticleClient) DeleteOneID

func (c *NoteArticleClient) DeleteOneID(id int) *NoteArticleDeleteOne

DeleteOneID returns a delete builder for the given id.

func (*NoteArticleClient) Get

func (c *NoteArticleClient) Get(ctx context.Context, id int) (*NoteArticle, error)

Get returns a NoteArticle entity by its id.

func (*NoteArticleClient) GetX

func (c *NoteArticleClient) GetX(ctx context.Context, id int) *NoteArticle

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

func (*NoteArticleClient) Hooks

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

Hooks returns the client hooks.

func (*NoteArticleClient) Query

func (c *NoteArticleClient) Query() *NoteArticleQuery

Query returns a query builder for NoteArticle.

func (*NoteArticleClient) QueryOwner

func (c *NoteArticleClient) QueryOwner(na *NoteArticle) *MemberQuery

QueryOwner queries the owner edge of a NoteArticle.

func (*NoteArticleClient) Update

func (c *NoteArticleClient) Update() *NoteArticleUpdate

Update returns an update builder for NoteArticle.

func (*NoteArticleClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*NoteArticleClient) UpdateOneID

func (c *NoteArticleClient) UpdateOneID(id int) *NoteArticleUpdateOne

UpdateOneID returns an update builder for the given id.

func (*NoteArticleClient) Use

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

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

type NoteArticleCreate

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

NoteArticleCreate is the builder for creating a NoteArticle entity.

func (*NoteArticleCreate) Mutation

func (nac *NoteArticleCreate) Mutation() *NoteArticleMutation

Mutation returns the NoteArticleMutation object of the builder.

func (*NoteArticleCreate) Save

func (nac *NoteArticleCreate) Save(ctx context.Context) (*NoteArticle, error)

Save creates the NoteArticle in the database.

func (*NoteArticleCreate) SaveX

func (nac *NoteArticleCreate) SaveX(ctx context.Context) *NoteArticle

SaveX calls Save and panics if Save returns an error.

func (*NoteArticleCreate) SetContent

func (nac *NoteArticleCreate) SetContent(s string) *NoteArticleCreate

SetContent sets the content field.

func (*NoteArticleCreate) SetCreatedAt

func (nac *NoteArticleCreate) SetCreatedAt(t time.Time) *NoteArticleCreate

SetCreatedAt sets the created_at field.

func (*NoteArticleCreate) SetGid

func (nac *NoteArticleCreate) SetGid(u uuid.UUID) *NoteArticleCreate

SetGid sets the gid field.

func (*NoteArticleCreate) SetID

func (nac *NoteArticleCreate) SetID(i int) *NoteArticleCreate

SetID sets the id field.

func (*NoteArticleCreate) SetMemberGid

func (nac *NoteArticleCreate) SetMemberGid(u uuid.UUID) *NoteArticleCreate

SetMemberGid sets the member_gid field.

func (*NoteArticleCreate) SetMime

SetMime sets the mime field.

func (*NoteArticleCreate) SetNillableCreatedAt

func (nac *NoteArticleCreate) SetNillableCreatedAt(t *time.Time) *NoteArticleCreate

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

func (*NoteArticleCreate) SetNillableOwnerID

func (nac *NoteArticleCreate) SetNillableOwnerID(id *int) *NoteArticleCreate

SetNillableOwnerID sets the owner edge to Member by id if the given value is not nil.

func (*NoteArticleCreate) SetNillableUpdatedAt

func (nac *NoteArticleCreate) SetNillableUpdatedAt(t *time.Time) *NoteArticleCreate

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

func (*NoteArticleCreate) SetOwner

func (nac *NoteArticleCreate) SetOwner(m *Member) *NoteArticleCreate

SetOwner sets the owner edge to Member.

func (*NoteArticleCreate) SetOwnerID

func (nac *NoteArticleCreate) SetOwnerID(id int) *NoteArticleCreate

SetOwnerID sets the owner edge to Member by id.

func (*NoteArticleCreate) SetUpdatedAt

func (nac *NoteArticleCreate) SetUpdatedAt(t time.Time) *NoteArticleCreate

SetUpdatedAt sets the updated_at field.

type NoteArticleCreateBulk

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

NoteArticleCreateBulk is the builder for creating a bulk of NoteArticle entities.

func (*NoteArticleCreateBulk) Save

func (nacb *NoteArticleCreateBulk) Save(ctx context.Context) ([]*NoteArticle, error)

Save creates the NoteArticle entities in the database.

func (*NoteArticleCreateBulk) SaveX

func (nacb *NoteArticleCreateBulk) SaveX(ctx context.Context) []*NoteArticle

SaveX calls Save and panics if Save returns an error.

type NoteArticleDelete

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

NoteArticleDelete is the builder for deleting a NoteArticle entity.

func (*NoteArticleDelete) Exec

func (nad *NoteArticleDelete) Exec(ctx context.Context) (int, error)

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

func (*NoteArticleDelete) ExecX

func (nad *NoteArticleDelete) ExecX(ctx context.Context) int

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

func (*NoteArticleDelete) Where

Where adds a new predicate to the delete builder.

type NoteArticleDeleteOne

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

NoteArticleDeleteOne is the builder for deleting a single NoteArticle entity.

func (*NoteArticleDeleteOne) Exec

func (nado *NoteArticleDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*NoteArticleDeleteOne) ExecX

func (nado *NoteArticleDeleteOne) ExecX(ctx context.Context)

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

type NoteArticleEdges

type NoteArticleEdges struct {
	// Owner holds the value of the owner edge.
	Owner *Member
	// contains filtered or unexported fields
}

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

func (NoteArticleEdges) OwnerOrErr

func (e NoteArticleEdges) OwnerOrErr() (*Member, error)

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

type NoteArticleGroupBy

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

NoteArticleGroupBy is the builder for group-by NoteArticle entities.

func (*NoteArticleGroupBy) Aggregate

func (nagb *NoteArticleGroupBy) Aggregate(fns ...AggregateFunc) *NoteArticleGroupBy

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

func (*NoteArticleGroupBy) Bool

func (nagb *NoteArticleGroupBy) Bool(ctx context.Context) (_ bool, err error)

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

func (*NoteArticleGroupBy) BoolX

func (nagb *NoteArticleGroupBy) BoolX(ctx context.Context) bool

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

func (*NoteArticleGroupBy) Bools

func (nagb *NoteArticleGroupBy) Bools(ctx context.Context) ([]bool, error)

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

func (*NoteArticleGroupBy) BoolsX

func (nagb *NoteArticleGroupBy) BoolsX(ctx context.Context) []bool

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

func (*NoteArticleGroupBy) Float64

func (nagb *NoteArticleGroupBy) Float64(ctx context.Context) (_ float64, err error)

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

func (*NoteArticleGroupBy) Float64X

func (nagb *NoteArticleGroupBy) Float64X(ctx context.Context) float64

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

func (*NoteArticleGroupBy) Float64s

func (nagb *NoteArticleGroupBy) Float64s(ctx context.Context) ([]float64, error)

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

func (*NoteArticleGroupBy) Float64sX

func (nagb *NoteArticleGroupBy) Float64sX(ctx context.Context) []float64

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

func (*NoteArticleGroupBy) Int

func (nagb *NoteArticleGroupBy) Int(ctx context.Context) (_ int, err error)

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

func (*NoteArticleGroupBy) IntX

func (nagb *NoteArticleGroupBy) IntX(ctx context.Context) int

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

func (*NoteArticleGroupBy) Ints

func (nagb *NoteArticleGroupBy) Ints(ctx context.Context) ([]int, error)

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

func (*NoteArticleGroupBy) IntsX

func (nagb *NoteArticleGroupBy) IntsX(ctx context.Context) []int

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

func (*NoteArticleGroupBy) Scan

func (nagb *NoteArticleGroupBy) Scan(ctx context.Context, v interface{}) error

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

func (*NoteArticleGroupBy) ScanX

func (nagb *NoteArticleGroupBy) ScanX(ctx context.Context, v interface{})

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

func (*NoteArticleGroupBy) String

func (nagb *NoteArticleGroupBy) String(ctx context.Context) (_ string, err error)

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

func (*NoteArticleGroupBy) StringX

func (nagb *NoteArticleGroupBy) StringX(ctx context.Context) string

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

func (*NoteArticleGroupBy) Strings

func (nagb *NoteArticleGroupBy) Strings(ctx context.Context) ([]string, error)

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

func (*NoteArticleGroupBy) StringsX

func (nagb *NoteArticleGroupBy) StringsX(ctx context.Context) []string

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

type NoteArticleMutation

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

NoteArticleMutation represents an operation that mutate the NoteArticles nodes in the graph.

func (*NoteArticleMutation) AddField

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

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

func (*NoteArticleMutation) AddedEdges

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

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

func (*NoteArticleMutation) AddedField

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

AddedField returns the numeric value that was in/decremented from a field with the given name. The second value indicates that this field was not set, or was not define in the schema.

func (*NoteArticleMutation) AddedFields

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

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

func (*NoteArticleMutation) AddedIDs

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

AddedIDs returns all ids (to other nodes) that were added for the given edge name.

func (*NoteArticleMutation) ClearEdge

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

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

func (*NoteArticleMutation) ClearField

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

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

func (*NoteArticleMutation) ClearOwner

func (m *NoteArticleMutation) ClearOwner()

ClearOwner clears the owner edge to Member.

func (*NoteArticleMutation) ClearedEdges

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

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

func (*NoteArticleMutation) ClearedFields

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

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

func (NoteArticleMutation) Client

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

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

Content returns the content value in the mutation.

func (*NoteArticleMutation) CreatedAt

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

CreatedAt returns the created_at value in the mutation.

func (*NoteArticleMutation) EdgeCleared

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

EdgeCleared returns a boolean indicates if this edge was cleared in this mutation.

func (*NoteArticleMutation) Field

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

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

func (*NoteArticleMutation) FieldCleared

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

FieldCleared returns a boolean indicates if this field was cleared in this mutation.

func (*NoteArticleMutation) Fields

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

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

func (*NoteArticleMutation) Gid

func (m *NoteArticleMutation) Gid() (r uuid.UUID, exists bool)

Gid returns the gid value in the mutation.

func (*NoteArticleMutation) ID

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

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

func (*NoteArticleMutation) MemberGid

func (m *NoteArticleMutation) MemberGid() (r uuid.UUID, exists bool)

MemberGid returns the member_gid value in the mutation.

func (*NoteArticleMutation) Mime

func (m *NoteArticleMutation) Mime() (r notearticle.Mime, exists bool)

Mime returns the mime value in the mutation.

func (*NoteArticleMutation) OldContent

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

OldContent returns the old content value of the NoteArticle. If the NoteArticle 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 database query fails.

func (*NoteArticleMutation) OldCreatedAt

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

OldCreatedAt returns the old created_at value of the NoteArticle. If the NoteArticle 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 database query fails.

func (*NoteArticleMutation) OldField

func (m *NoteArticleMutation) 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 was failed.

func (*NoteArticleMutation) OldGid

func (m *NoteArticleMutation) OldGid(ctx context.Context) (v uuid.UUID, err error)

OldGid returns the old gid value of the NoteArticle. If the NoteArticle 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 database query fails.

func (*NoteArticleMutation) OldMemberGid

func (m *NoteArticleMutation) OldMemberGid(ctx context.Context) (v uuid.UUID, err error)

OldMemberGid returns the old member_gid value of the NoteArticle. If the NoteArticle 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 database query fails.

func (*NoteArticleMutation) OldMime

func (m *NoteArticleMutation) OldMime(ctx context.Context) (v notearticle.Mime, err error)

OldMime returns the old mime value of the NoteArticle. If the NoteArticle 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 database query fails.

func (*NoteArticleMutation) OldUpdatedAt

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

OldUpdatedAt returns the old updated_at value of the NoteArticle. If the NoteArticle 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 database query fails.

func (*NoteArticleMutation) Op

func (m *NoteArticleMutation) Op() Op

Op returns the operation name.

func (*NoteArticleMutation) OwnerCleared

func (m *NoteArticleMutation) OwnerCleared() bool

OwnerCleared returns if the edge owner was cleared.

func (*NoteArticleMutation) OwnerID

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

OwnerID returns the owner id in the mutation.

func (*NoteArticleMutation) OwnerIDs

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

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

func (*NoteArticleMutation) RemovedEdges

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

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

func (*NoteArticleMutation) RemovedIDs

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

RemovedIDs returns all ids (to other nodes) that were removed for the given edge name.

func (*NoteArticleMutation) ResetContent

func (m *NoteArticleMutation) ResetContent()

ResetContent reset all changes of the "content" field.

func (*NoteArticleMutation) ResetCreatedAt

func (m *NoteArticleMutation) ResetCreatedAt()

ResetCreatedAt reset all changes of the "created_at" field.

func (*NoteArticleMutation) ResetEdge

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

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

func (*NoteArticleMutation) ResetField

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

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

func (*NoteArticleMutation) ResetGid

func (m *NoteArticleMutation) ResetGid()

ResetGid reset all changes of the "gid" field.

func (*NoteArticleMutation) ResetMemberGid

func (m *NoteArticleMutation) ResetMemberGid()

ResetMemberGid reset all changes of the "member_gid" field.

func (*NoteArticleMutation) ResetMime

func (m *NoteArticleMutation) ResetMime()

ResetMime reset all changes of the "mime" field.

func (*NoteArticleMutation) ResetOwner

func (m *NoteArticleMutation) ResetOwner()

ResetOwner reset all changes of the "owner" edge.

func (*NoteArticleMutation) ResetUpdatedAt

func (m *NoteArticleMutation) ResetUpdatedAt()

ResetUpdatedAt reset all changes of the "updated_at" field.

func (*NoteArticleMutation) SetContent

func (m *NoteArticleMutation) SetContent(s string)

SetContent sets the content field.

func (*NoteArticleMutation) SetCreatedAt

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

SetCreatedAt sets the created_at field.

func (*NoteArticleMutation) SetField

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

SetField sets the value for the given name. It returns an error if the field is not defined in the schema, or if the type mismatch the field type.

func (*NoteArticleMutation) SetGid

func (m *NoteArticleMutation) SetGid(u uuid.UUID)

SetGid sets the gid field.

func (*NoteArticleMutation) SetID

func (m *NoteArticleMutation) SetID(id int)

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

func (*NoteArticleMutation) SetMemberGid

func (m *NoteArticleMutation) SetMemberGid(u uuid.UUID)

SetMemberGid sets the member_gid field.

func (*NoteArticleMutation) SetMime

func (m *NoteArticleMutation) SetMime(n notearticle.Mime)

SetMime sets the mime field.

func (*NoteArticleMutation) SetOwnerID

func (m *NoteArticleMutation) SetOwnerID(id int)

SetOwnerID sets the owner edge to Member by id.

func (*NoteArticleMutation) SetUpdatedAt

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

SetUpdatedAt sets the updated_at field.

func (NoteArticleMutation) Tx

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

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

func (*NoteArticleMutation) Type

func (m *NoteArticleMutation) Type() string

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

func (*NoteArticleMutation) UpdatedAt

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

UpdatedAt returns the updated_at value in the mutation.

type NoteArticleQuery

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

NoteArticleQuery is the builder for querying NoteArticle entities.

func (*NoteArticleQuery) All

func (naq *NoteArticleQuery) All(ctx context.Context) ([]*NoteArticle, error)

All executes the query and returns a list of NoteArticles.

func (*NoteArticleQuery) AllX

func (naq *NoteArticleQuery) AllX(ctx context.Context) []*NoteArticle

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

func (*NoteArticleQuery) Clone

func (naq *NoteArticleQuery) Clone() *NoteArticleQuery

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

func (*NoteArticleQuery) Count

func (naq *NoteArticleQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*NoteArticleQuery) CountX

func (naq *NoteArticleQuery) CountX(ctx context.Context) int

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

func (*NoteArticleQuery) Exist

func (naq *NoteArticleQuery) Exist(ctx context.Context) (bool, error)

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

func (*NoteArticleQuery) ExistX

func (naq *NoteArticleQuery) ExistX(ctx context.Context) bool

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

func (*NoteArticleQuery) First

func (naq *NoteArticleQuery) First(ctx context.Context) (*NoteArticle, error)

First returns the first NoteArticle entity in the query. Returns *NotFoundError when no notearticle was found.

func (*NoteArticleQuery) FirstID

func (naq *NoteArticleQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first NoteArticle id in the query. Returns *NotFoundError when no id was found.

func (*NoteArticleQuery) FirstX

func (naq *NoteArticleQuery) FirstX(ctx context.Context) *NoteArticle

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

func (*NoteArticleQuery) FirstXID

func (naq *NoteArticleQuery) FirstXID(ctx context.Context) int

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

func (*NoteArticleQuery) GroupBy

func (naq *NoteArticleQuery) GroupBy(field string, fields ...string) *NoteArticleGroupBy

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

client.NoteArticle.Query().
	GroupBy(notearticle.FieldCreatedAt).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*NoteArticleQuery) IDs

func (naq *NoteArticleQuery) IDs(ctx context.Context) ([]int, error)

IDs executes the query and returns a list of NoteArticle ids.

func (*NoteArticleQuery) IDsX

func (naq *NoteArticleQuery) IDsX(ctx context.Context) []int

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

func (*NoteArticleQuery) Limit

func (naq *NoteArticleQuery) Limit(limit int) *NoteArticleQuery

Limit adds a limit step to the query.

func (*NoteArticleQuery) Offset

func (naq *NoteArticleQuery) Offset(offset int) *NoteArticleQuery

Offset adds an offset step to the query.

func (*NoteArticleQuery) Only

func (naq *NoteArticleQuery) Only(ctx context.Context) (*NoteArticle, error)

Only returns the only NoteArticle entity in the query, returns an error if not exactly one entity was returned.

func (*NoteArticleQuery) OnlyID

func (naq *NoteArticleQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID returns the only NoteArticle id in the query, returns an error if not exactly one id was returned.

func (*NoteArticleQuery) OnlyIDX

func (naq *NoteArticleQuery) OnlyIDX(ctx context.Context) int

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

func (*NoteArticleQuery) OnlyX

func (naq *NoteArticleQuery) OnlyX(ctx context.Context) *NoteArticle

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

func (*NoteArticleQuery) Order

func (naq *NoteArticleQuery) Order(o ...OrderFunc) *NoteArticleQuery

Order adds an order step to the query.

func (*NoteArticleQuery) QueryOwner

func (naq *NoteArticleQuery) QueryOwner() *MemberQuery

QueryOwner chains the current query on the owner edge.

func (*NoteArticleQuery) Select

func (naq *NoteArticleQuery) Select(field string, fields ...string) *NoteArticleSelect

Select one or more fields from the given query.

Example:

var v []struct {
	CreatedAt time.Time `json:"created_at,omitempty"`
}

client.NoteArticle.Query().
	Select(notearticle.FieldCreatedAt).
	Scan(ctx, &v)

func (*NoteArticleQuery) Where

Where adds a new predicate for the builder.

func (*NoteArticleQuery) WithOwner

func (naq *NoteArticleQuery) WithOwner(opts ...func(*MemberQuery)) *NoteArticleQuery
WithOwner tells the query-builder to eager-loads the nodes that are connected to

the "owner" edge. The optional arguments used to configure the query builder of the edge.

type NoteArticleSelect

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

NoteArticleSelect is the builder for select fields of NoteArticle entities.

func (*NoteArticleSelect) Bool

func (nas *NoteArticleSelect) Bool(ctx context.Context) (_ bool, err error)

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

func (*NoteArticleSelect) BoolX

func (nas *NoteArticleSelect) BoolX(ctx context.Context) bool

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

func (*NoteArticleSelect) Bools

func (nas *NoteArticleSelect) Bools(ctx context.Context) ([]bool, error)

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

func (*NoteArticleSelect) BoolsX

func (nas *NoteArticleSelect) BoolsX(ctx context.Context) []bool

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

func (*NoteArticleSelect) Float64

func (nas *NoteArticleSelect) Float64(ctx context.Context) (_ float64, err error)

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

func (*NoteArticleSelect) Float64X

func (nas *NoteArticleSelect) Float64X(ctx context.Context) float64

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

func (*NoteArticleSelect) Float64s

func (nas *NoteArticleSelect) Float64s(ctx context.Context) ([]float64, error)

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

func (*NoteArticleSelect) Float64sX

func (nas *NoteArticleSelect) Float64sX(ctx context.Context) []float64

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

func (*NoteArticleSelect) Int

func (nas *NoteArticleSelect) Int(ctx context.Context) (_ int, err error)

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

func (*NoteArticleSelect) IntX

func (nas *NoteArticleSelect) IntX(ctx context.Context) int

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

func (*NoteArticleSelect) Ints

func (nas *NoteArticleSelect) Ints(ctx context.Context) ([]int, error)

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

func (*NoteArticleSelect) IntsX

func (nas *NoteArticleSelect) IntsX(ctx context.Context) []int

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

func (*NoteArticleSelect) Scan

func (nas *NoteArticleSelect) Scan(ctx context.Context, v interface{}) error

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

func (*NoteArticleSelect) ScanX

func (nas *NoteArticleSelect) ScanX(ctx context.Context, v interface{})

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

func (*NoteArticleSelect) String

func (nas *NoteArticleSelect) String(ctx context.Context) (_ string, err error)

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

func (*NoteArticleSelect) StringX

func (nas *NoteArticleSelect) StringX(ctx context.Context) string

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

func (*NoteArticleSelect) Strings

func (nas *NoteArticleSelect) Strings(ctx context.Context) ([]string, error)

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

func (*NoteArticleSelect) StringsX

func (nas *NoteArticleSelect) StringsX(ctx context.Context) []string

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

type NoteArticleUpdate

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

NoteArticleUpdate is the builder for updating NoteArticle entities.

func (*NoteArticleUpdate) ClearOwner

func (nau *NoteArticleUpdate) ClearOwner() *NoteArticleUpdate

ClearOwner clears the "owner" edge to type Member.

func (*NoteArticleUpdate) Exec

func (nau *NoteArticleUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*NoteArticleUpdate) ExecX

func (nau *NoteArticleUpdate) ExecX(ctx context.Context)

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

func (*NoteArticleUpdate) Mutation

func (nau *NoteArticleUpdate) Mutation() *NoteArticleMutation

Mutation returns the NoteArticleMutation object of the builder.

func (*NoteArticleUpdate) Save

func (nau *NoteArticleUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of rows/vertices matched by this operation.

func (*NoteArticleUpdate) SaveX

func (nau *NoteArticleUpdate) SaveX(ctx context.Context) int

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

func (*NoteArticleUpdate) SetContent

func (nau *NoteArticleUpdate) SetContent(s string) *NoteArticleUpdate

SetContent sets the content field.

func (*NoteArticleUpdate) SetGid

func (nau *NoteArticleUpdate) SetGid(u uuid.UUID) *NoteArticleUpdate

SetGid sets the gid field.

func (*NoteArticleUpdate) SetMemberGid

func (nau *NoteArticleUpdate) SetMemberGid(u uuid.UUID) *NoteArticleUpdate

SetMemberGid sets the member_gid field.

func (*NoteArticleUpdate) SetNillableOwnerID

func (nau *NoteArticleUpdate) SetNillableOwnerID(id *int) *NoteArticleUpdate

SetNillableOwnerID sets the owner edge to Member by id if the given value is not nil.

func (*NoteArticleUpdate) SetOwner

func (nau *NoteArticleUpdate) SetOwner(m *Member) *NoteArticleUpdate

SetOwner sets the owner edge to Member.

func (*NoteArticleUpdate) SetOwnerID

func (nau *NoteArticleUpdate) SetOwnerID(id int) *NoteArticleUpdate

SetOwnerID sets the owner edge to Member by id.

func (*NoteArticleUpdate) SetUpdatedAt

func (nau *NoteArticleUpdate) SetUpdatedAt(t time.Time) *NoteArticleUpdate

SetUpdatedAt sets the updated_at field.

func (*NoteArticleUpdate) Where

Where adds a new predicate for the builder.

type NoteArticleUpdateOne

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

NoteArticleUpdateOne is the builder for updating a single NoteArticle entity.

func (*NoteArticleUpdateOne) ClearOwner

func (nauo *NoteArticleUpdateOne) ClearOwner() *NoteArticleUpdateOne

ClearOwner clears the "owner" edge to type Member.

func (*NoteArticleUpdateOne) Exec

func (nauo *NoteArticleUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*NoteArticleUpdateOne) ExecX

func (nauo *NoteArticleUpdateOne) ExecX(ctx context.Context)

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

func (*NoteArticleUpdateOne) Mutation

func (nauo *NoteArticleUpdateOne) Mutation() *NoteArticleMutation

Mutation returns the NoteArticleMutation object of the builder.

func (*NoteArticleUpdateOne) Save

Save executes the query and returns the updated entity.

func (*NoteArticleUpdateOne) SaveX

func (nauo *NoteArticleUpdateOne) SaveX(ctx context.Context) *NoteArticle

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

func (*NoteArticleUpdateOne) SetContent

func (nauo *NoteArticleUpdateOne) SetContent(s string) *NoteArticleUpdateOne

SetContent sets the content field.

func (*NoteArticleUpdateOne) SetGid

SetGid sets the gid field.

func (*NoteArticleUpdateOne) SetMemberGid

func (nauo *NoteArticleUpdateOne) SetMemberGid(u uuid.UUID) *NoteArticleUpdateOne

SetMemberGid sets the member_gid field.

func (*NoteArticleUpdateOne) SetNillableOwnerID

func (nauo *NoteArticleUpdateOne) SetNillableOwnerID(id *int) *NoteArticleUpdateOne

SetNillableOwnerID sets the owner edge to Member by id if the given value is not nil.

func (*NoteArticleUpdateOne) SetOwner

func (nauo *NoteArticleUpdateOne) SetOwner(m *Member) *NoteArticleUpdateOne

SetOwner sets the owner edge to Member.

func (*NoteArticleUpdateOne) SetOwnerID

func (nauo *NoteArticleUpdateOne) SetOwnerID(id int) *NoteArticleUpdateOne

SetOwnerID sets the owner edge to Member by id.

func (*NoteArticleUpdateOne) SetUpdatedAt

func (nauo *NoteArticleUpdateOne) SetUpdatedAt(t time.Time) *NoteArticleUpdateOne

SetUpdatedAt sets the updated_at field.

type NoteArticles

type NoteArticles []*NoteArticle

NoteArticles is a parsable slice of NoteArticle.

type NoteFilesystem

type NoteFilesystem struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// UpdatedAt holds the value of the "updated_at" field.
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// MemberGid holds the value of the "member_gid" field.
	MemberGid uuid.UUID `json:"member_gid,omitempty"`
	// ParentID holds the value of the "parent_id" field.
	ParentID int `json:"parent_id,omitempty"`
	// Name holds the value of the "name" field.
	Name string `json:"name,omitempty"`
	// IsDir holds the value of the "is_dir" field.
	IsDir bool `json:"is_dir,omitempty"`
	// Deleted holds the value of the "deleted" field.
	Deleted bool `json:"deleted,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the NoteFilesystemQuery when eager-loading is set.
	Edges NoteFilesystemEdges `json:"edges"`
	// contains filtered or unexported fields
}

NoteFilesystem is the model entity for the NoteFilesystem schema.

func (*NoteFilesystem) QueryOwner

func (nf *NoteFilesystem) QueryOwner() *MemberQuery

QueryOwner queries the owner edge of the NoteFilesystem.

func (*NoteFilesystem) String

func (nf *NoteFilesystem) String() string

String implements the fmt.Stringer.

func (*NoteFilesystem) Unwrap

func (nf *NoteFilesystem) Unwrap() *NoteFilesystem

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

func (*NoteFilesystem) Update

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

type NoteFilesystemClient

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

NoteFilesystemClient is a client for the NoteFilesystem schema.

func NewNoteFilesystemClient

func NewNoteFilesystemClient(c config) *NoteFilesystemClient

NewNoteFilesystemClient returns a client for the NoteFilesystem from the given config.

func (*NoteFilesystemClient) Create

Create returns a create builder for NoteFilesystem.

func (*NoteFilesystemClient) CreateBulk

BulkCreate returns a builder for creating a bulk of NoteFilesystem entities.

func (*NoteFilesystemClient) Delete

Delete returns a delete builder for NoteFilesystem.

func (*NoteFilesystemClient) DeleteOne

DeleteOne returns a delete builder for the given entity.

func (*NoteFilesystemClient) DeleteOneID

func (c *NoteFilesystemClient) DeleteOneID(id int) *NoteFilesystemDeleteOne

DeleteOneID returns a delete builder for the given id.

func (*NoteFilesystemClient) Get

Get returns a NoteFilesystem entity by its id.

func (*NoteFilesystemClient) GetX

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

func (*NoteFilesystemClient) Hooks

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

Hooks returns the client hooks.

func (*NoteFilesystemClient) Query

Query returns a query builder for NoteFilesystem.

func (*NoteFilesystemClient) QueryOwner

func (c *NoteFilesystemClient) QueryOwner(nf *NoteFilesystem) *MemberQuery

QueryOwner queries the owner edge of a NoteFilesystem.

func (*NoteFilesystemClient) Update

Update returns an update builder for NoteFilesystem.

func (*NoteFilesystemClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*NoteFilesystemClient) UpdateOneID

func (c *NoteFilesystemClient) UpdateOneID(id int) *NoteFilesystemUpdateOne

UpdateOneID returns an update builder for the given id.

func (*NoteFilesystemClient) Use

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

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

type NoteFilesystemCreate

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

NoteFilesystemCreate is the builder for creating a NoteFilesystem entity.

func (*NoteFilesystemCreate) Mutation

Mutation returns the NoteFilesystemMutation object of the builder.

func (*NoteFilesystemCreate) Save

Save creates the NoteFilesystem in the database.

func (*NoteFilesystemCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*NoteFilesystemCreate) SetCreatedAt

func (nfc *NoteFilesystemCreate) SetCreatedAt(t time.Time) *NoteFilesystemCreate

SetCreatedAt sets the created_at field.

func (*NoteFilesystemCreate) SetDeleted

func (nfc *NoteFilesystemCreate) SetDeleted(b bool) *NoteFilesystemCreate

SetDeleted sets the deleted field.

func (*NoteFilesystemCreate) SetID

SetID sets the id field.

func (*NoteFilesystemCreate) SetIsDir

SetIsDir sets the is_dir field.

func (*NoteFilesystemCreate) SetMemberGid

func (nfc *NoteFilesystemCreate) SetMemberGid(u uuid.UUID) *NoteFilesystemCreate

SetMemberGid sets the member_gid field.

func (*NoteFilesystemCreate) SetName

SetName sets the name field.

func (*NoteFilesystemCreate) SetNillableCreatedAt

func (nfc *NoteFilesystemCreate) SetNillableCreatedAt(t *time.Time) *NoteFilesystemCreate

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

func (*NoteFilesystemCreate) SetNillableDeleted

func (nfc *NoteFilesystemCreate) SetNillableDeleted(b *bool) *NoteFilesystemCreate

SetNillableDeleted sets the deleted field if the given value is not nil.

func (*NoteFilesystemCreate) SetNillableIsDir

func (nfc *NoteFilesystemCreate) SetNillableIsDir(b *bool) *NoteFilesystemCreate

SetNillableIsDir sets the is_dir field if the given value is not nil.

func (*NoteFilesystemCreate) SetNillableOwnerID

func (nfc *NoteFilesystemCreate) SetNillableOwnerID(id *int) *NoteFilesystemCreate

SetNillableOwnerID sets the owner edge to Member by id if the given value is not nil.

func (*NoteFilesystemCreate) SetNillableUpdatedAt

func (nfc *NoteFilesystemCreate) SetNillableUpdatedAt(t *time.Time) *NoteFilesystemCreate

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

func (*NoteFilesystemCreate) SetOwner

SetOwner sets the owner edge to Member.

func (*NoteFilesystemCreate) SetOwnerID

func (nfc *NoteFilesystemCreate) SetOwnerID(id int) *NoteFilesystemCreate

SetOwnerID sets the owner edge to Member by id.

func (*NoteFilesystemCreate) SetParentID

func (nfc *NoteFilesystemCreate) SetParentID(i int) *NoteFilesystemCreate

SetParentID sets the parent_id field.

func (*NoteFilesystemCreate) SetUpdatedAt

func (nfc *NoteFilesystemCreate) SetUpdatedAt(t time.Time) *NoteFilesystemCreate

SetUpdatedAt sets the updated_at field.

type NoteFilesystemCreateBulk

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

NoteFilesystemCreateBulk is the builder for creating a bulk of NoteFilesystem entities.

func (*NoteFilesystemCreateBulk) Save

Save creates the NoteFilesystem entities in the database.

func (*NoteFilesystemCreateBulk) SaveX

SaveX calls Save and panics if Save returns an error.

type NoteFilesystemDelete

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

NoteFilesystemDelete is the builder for deleting a NoteFilesystem entity.

func (*NoteFilesystemDelete) Exec

func (nfd *NoteFilesystemDelete) Exec(ctx context.Context) (int, error)

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

func (*NoteFilesystemDelete) ExecX

func (nfd *NoteFilesystemDelete) ExecX(ctx context.Context) int

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

func (*NoteFilesystemDelete) Where

Where adds a new predicate to the delete builder.

type NoteFilesystemDeleteOne

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

NoteFilesystemDeleteOne is the builder for deleting a single NoteFilesystem entity.

func (*NoteFilesystemDeleteOne) Exec

func (nfdo *NoteFilesystemDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*NoteFilesystemDeleteOne) ExecX

func (nfdo *NoteFilesystemDeleteOne) ExecX(ctx context.Context)

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

type NoteFilesystemEdges

type NoteFilesystemEdges struct {
	// Owner holds the value of the owner edge.
	Owner *Member
	// contains filtered or unexported fields
}

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

func (NoteFilesystemEdges) OwnerOrErr

func (e NoteFilesystemEdges) OwnerOrErr() (*Member, error)

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

type NoteFilesystemGroupBy

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

NoteFilesystemGroupBy is the builder for group-by NoteFilesystem entities.

func (*NoteFilesystemGroupBy) Aggregate

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

func (*NoteFilesystemGroupBy) Bool

func (nfgb *NoteFilesystemGroupBy) Bool(ctx context.Context) (_ bool, err error)

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

func (*NoteFilesystemGroupBy) BoolX

func (nfgb *NoteFilesystemGroupBy) BoolX(ctx context.Context) bool

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

func (*NoteFilesystemGroupBy) Bools

func (nfgb *NoteFilesystemGroupBy) Bools(ctx context.Context) ([]bool, error)

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

func (*NoteFilesystemGroupBy) BoolsX

func (nfgb *NoteFilesystemGroupBy) BoolsX(ctx context.Context) []bool

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

func (*NoteFilesystemGroupBy) Float64

func (nfgb *NoteFilesystemGroupBy) Float64(ctx context.Context) (_ float64, err error)

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

func (*NoteFilesystemGroupBy) Float64X

func (nfgb *NoteFilesystemGroupBy) Float64X(ctx context.Context) float64

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

func (*NoteFilesystemGroupBy) Float64s

func (nfgb *NoteFilesystemGroupBy) Float64s(ctx context.Context) ([]float64, error)

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

func (*NoteFilesystemGroupBy) Float64sX

func (nfgb *NoteFilesystemGroupBy) Float64sX(ctx context.Context) []float64

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

func (*NoteFilesystemGroupBy) Int

func (nfgb *NoteFilesystemGroupBy) Int(ctx context.Context) (_ int, err error)

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

func (*NoteFilesystemGroupBy) IntX

func (nfgb *NoteFilesystemGroupBy) IntX(ctx context.Context) int

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

func (*NoteFilesystemGroupBy) Ints

func (nfgb *NoteFilesystemGroupBy) Ints(ctx context.Context) ([]int, error)

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

func (*NoteFilesystemGroupBy) IntsX

func (nfgb *NoteFilesystemGroupBy) IntsX(ctx context.Context) []int

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

func (*NoteFilesystemGroupBy) Scan

func (nfgb *NoteFilesystemGroupBy) Scan(ctx context.Context, v interface{}) error

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

func (*NoteFilesystemGroupBy) ScanX

func (nfgb *NoteFilesystemGroupBy) ScanX(ctx context.Context, v interface{})

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

func (*NoteFilesystemGroupBy) String

func (nfgb *NoteFilesystemGroupBy) String(ctx context.Context) (_ string, err error)

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

func (*NoteFilesystemGroupBy) StringX

func (nfgb *NoteFilesystemGroupBy) StringX(ctx context.Context) string

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

func (*NoteFilesystemGroupBy) Strings

func (nfgb *NoteFilesystemGroupBy) Strings(ctx context.Context) ([]string, error)

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

func (*NoteFilesystemGroupBy) StringsX

func (nfgb *NoteFilesystemGroupBy) StringsX(ctx context.Context) []string

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

type NoteFilesystemMutation

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

NoteFilesystemMutation represents an operation that mutate the NoteFilesystems nodes in the graph.

func (*NoteFilesystemMutation) AddField

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

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

func (*NoteFilesystemMutation) AddParentID

func (m *NoteFilesystemMutation) AddParentID(i int)

AddParentID adds i to parent_id.

func (*NoteFilesystemMutation) AddedEdges

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

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

func (*NoteFilesystemMutation) AddedField

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

AddedField returns the numeric value that was in/decremented from a field with the given name. The second value indicates that this field was not set, or was not define in the schema.

func (*NoteFilesystemMutation) AddedFields

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

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

func (*NoteFilesystemMutation) AddedIDs

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

AddedIDs returns all ids (to other nodes) that were added for the given edge name.

func (*NoteFilesystemMutation) AddedParentID

func (m *NoteFilesystemMutation) AddedParentID() (r int, exists bool)

AddedParentID returns the value that was added to the parent_id field in this mutation.

func (*NoteFilesystemMutation) ClearEdge

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

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

func (*NoteFilesystemMutation) ClearField

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

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

func (*NoteFilesystemMutation) ClearOwner

func (m *NoteFilesystemMutation) ClearOwner()

ClearOwner clears the owner edge to Member.

func (*NoteFilesystemMutation) ClearedEdges

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

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

func (*NoteFilesystemMutation) ClearedFields

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

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

func (NoteFilesystemMutation) Client

func (m NoteFilesystemMutation) 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 (*NoteFilesystemMutation) CreatedAt

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

CreatedAt returns the created_at value in the mutation.

func (*NoteFilesystemMutation) Deleted

func (m *NoteFilesystemMutation) Deleted() (r bool, exists bool)

Deleted returns the deleted value in the mutation.

func (*NoteFilesystemMutation) EdgeCleared

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

EdgeCleared returns a boolean indicates if this edge was cleared in this mutation.

func (*NoteFilesystemMutation) Field

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

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

func (*NoteFilesystemMutation) FieldCleared

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

FieldCleared returns a boolean indicates if this field was cleared in this mutation.

func (*NoteFilesystemMutation) Fields

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

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

func (*NoteFilesystemMutation) ID

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

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

func (*NoteFilesystemMutation) IsDir

func (m *NoteFilesystemMutation) IsDir() (r bool, exists bool)

IsDir returns the is_dir value in the mutation.

func (*NoteFilesystemMutation) MemberGid

func (m *NoteFilesystemMutation) MemberGid() (r uuid.UUID, exists bool)

MemberGid returns the member_gid value in the mutation.

func (*NoteFilesystemMutation) Name

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

Name returns the name value in the mutation.

func (*NoteFilesystemMutation) OldCreatedAt

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

OldCreatedAt returns the old created_at value of the NoteFilesystem. If the NoteFilesystem 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 database query fails.

func (*NoteFilesystemMutation) OldDeleted

func (m *NoteFilesystemMutation) OldDeleted(ctx context.Context) (v bool, err error)

OldDeleted returns the old deleted value of the NoteFilesystem. If the NoteFilesystem 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 database query fails.

func (*NoteFilesystemMutation) OldField

func (m *NoteFilesystemMutation) 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 was failed.

func (*NoteFilesystemMutation) OldIsDir

func (m *NoteFilesystemMutation) OldIsDir(ctx context.Context) (v bool, err error)

OldIsDir returns the old is_dir value of the NoteFilesystem. If the NoteFilesystem 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 database query fails.

func (*NoteFilesystemMutation) OldMemberGid

func (m *NoteFilesystemMutation) OldMemberGid(ctx context.Context) (v uuid.UUID, err error)

OldMemberGid returns the old member_gid value of the NoteFilesystem. If the NoteFilesystem 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 database query fails.

func (*NoteFilesystemMutation) OldName

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

OldName returns the old name value of the NoteFilesystem. If the NoteFilesystem 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 database query fails.

func (*NoteFilesystemMutation) OldParentID

func (m *NoteFilesystemMutation) OldParentID(ctx context.Context) (v int, err error)

OldParentID returns the old parent_id value of the NoteFilesystem. If the NoteFilesystem 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 database query fails.

func (*NoteFilesystemMutation) OldUpdatedAt

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

OldUpdatedAt returns the old updated_at value of the NoteFilesystem. If the NoteFilesystem 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 database query fails.

func (*NoteFilesystemMutation) Op

func (m *NoteFilesystemMutation) Op() Op

Op returns the operation name.

func (*NoteFilesystemMutation) OwnerCleared

func (m *NoteFilesystemMutation) OwnerCleared() bool

OwnerCleared returns if the edge owner was cleared.

func (*NoteFilesystemMutation) OwnerID

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

OwnerID returns the owner id in the mutation.

func (*NoteFilesystemMutation) OwnerIDs

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

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

func (*NoteFilesystemMutation) ParentID

func (m *NoteFilesystemMutation) ParentID() (r int, exists bool)

ParentID returns the parent_id value in the mutation.

func (*NoteFilesystemMutation) RemovedEdges

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

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

func (*NoteFilesystemMutation) RemovedIDs

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

RemovedIDs returns all ids (to other nodes) that were removed for the given edge name.

func (*NoteFilesystemMutation) ResetCreatedAt

func (m *NoteFilesystemMutation) ResetCreatedAt()

ResetCreatedAt reset all changes of the "created_at" field.

func (*NoteFilesystemMutation) ResetDeleted

func (m *NoteFilesystemMutation) ResetDeleted()

ResetDeleted reset all changes of the "deleted" field.

func (*NoteFilesystemMutation) ResetEdge

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

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

func (*NoteFilesystemMutation) ResetField

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

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

func (*NoteFilesystemMutation) ResetIsDir

func (m *NoteFilesystemMutation) ResetIsDir()

ResetIsDir reset all changes of the "is_dir" field.

func (*NoteFilesystemMutation) ResetMemberGid

func (m *NoteFilesystemMutation) ResetMemberGid()

ResetMemberGid reset all changes of the "member_gid" field.

func (*NoteFilesystemMutation) ResetName

func (m *NoteFilesystemMutation) ResetName()

ResetName reset all changes of the "name" field.

func (*NoteFilesystemMutation) ResetOwner

func (m *NoteFilesystemMutation) ResetOwner()

ResetOwner reset all changes of the "owner" edge.

func (*NoteFilesystemMutation) ResetParentID

func (m *NoteFilesystemMutation) ResetParentID()

ResetParentID reset all changes of the "parent_id" field.

func (*NoteFilesystemMutation) ResetUpdatedAt

func (m *NoteFilesystemMutation) ResetUpdatedAt()

ResetUpdatedAt reset all changes of the "updated_at" field.

func (*NoteFilesystemMutation) SetCreatedAt

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

SetCreatedAt sets the created_at field.

func (*NoteFilesystemMutation) SetDeleted

func (m *NoteFilesystemMutation) SetDeleted(b bool)

SetDeleted sets the deleted field.

func (*NoteFilesystemMutation) SetField

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

SetField sets the value for the given name. It returns an error if the field is not defined in the schema, or if the type mismatch the field type.

func (*NoteFilesystemMutation) SetID

func (m *NoteFilesystemMutation) SetID(id int)

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

func (*NoteFilesystemMutation) SetIsDir

func (m *NoteFilesystemMutation) SetIsDir(b bool)

SetIsDir sets the is_dir field.

func (*NoteFilesystemMutation) SetMemberGid

func (m *NoteFilesystemMutation) SetMemberGid(u uuid.UUID)

SetMemberGid sets the member_gid field.

func (*NoteFilesystemMutation) SetName

func (m *NoteFilesystemMutation) SetName(s string)

SetName sets the name field.

func (*NoteFilesystemMutation) SetOwnerID

func (m *NoteFilesystemMutation) SetOwnerID(id int)

SetOwnerID sets the owner edge to Member by id.

func (*NoteFilesystemMutation) SetParentID

func (m *NoteFilesystemMutation) SetParentID(i int)

SetParentID sets the parent_id field.

func (*NoteFilesystemMutation) SetUpdatedAt

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

SetUpdatedAt sets the updated_at field.

func (NoteFilesystemMutation) Tx

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

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

func (*NoteFilesystemMutation) Type

func (m *NoteFilesystemMutation) Type() string

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

func (*NoteFilesystemMutation) UpdatedAt

func (m *NoteFilesystemMutation) UpdatedAt() (r time.Time, exists bool)

UpdatedAt returns the updated_at value in the mutation.

type NoteFilesystemQuery

type NoteFilesystemQuery struct {
	// contains filtered or unexported fields
}

NoteFilesystemQuery is the builder for querying NoteFilesystem entities.

func (*NoteFilesystemQuery) All

All executes the query and returns a list of NoteFilesystems.

func (*NoteFilesystemQuery) AllX

AllX is like All, but panics if an error occurs.

func (*NoteFilesystemQuery) Clone

Clone returns a duplicate of the query builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*NoteFilesystemQuery) Count

func (nfq *NoteFilesystemQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*NoteFilesystemQuery) CountX

func (nfq *NoteFilesystemQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*NoteFilesystemQuery) Exist

func (nfq *NoteFilesystemQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*NoteFilesystemQuery) ExistX

func (nfq *NoteFilesystemQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*NoteFilesystemQuery) First

First returns the first NoteFilesystem entity in the query. Returns *NotFoundError when no notefilesystem was found.

func (*NoteFilesystemQuery) FirstID

func (nfq *NoteFilesystemQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first NoteFilesystem id in the query. Returns *NotFoundError when no id was found.

func (*NoteFilesystemQuery) FirstX

FirstX is like First, but panics if an error occurs.

func (*NoteFilesystemQuery) FirstXID

func (nfq *NoteFilesystemQuery) FirstXID(ctx context.Context) int

FirstXID is like FirstID, but panics if an error occurs.

func (*NoteFilesystemQuery) GroupBy

func (nfq *NoteFilesystemQuery) GroupBy(field string, fields ...string) *NoteFilesystemGroupBy

GroupBy 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 {
	CreatedAt time.Time `json:"created_at,omitempty"`
	Count int `json:"count,omitempty"`
}

client.NoteFilesystem.Query().
	GroupBy(notefilesystem.FieldCreatedAt).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*NoteFilesystemQuery) IDs

func (nfq *NoteFilesystemQuery) IDs(ctx context.Context) ([]int, error)

IDs executes the query and returns a list of NoteFilesystem ids.

func (*NoteFilesystemQuery) IDsX

func (nfq *NoteFilesystemQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*NoteFilesystemQuery) Limit

func (nfq *NoteFilesystemQuery) Limit(limit int) *NoteFilesystemQuery

Limit adds a limit step to the query.

func (*NoteFilesystemQuery) Offset

func (nfq *NoteFilesystemQuery) Offset(offset int) *NoteFilesystemQuery

Offset adds an offset step to the query.

func (*NoteFilesystemQuery) Only

Only returns the only NoteFilesystem entity in the query, returns an error if not exactly one entity was returned.

func (*NoteFilesystemQuery) OnlyID

func (nfq *NoteFilesystemQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID returns the only NoteFilesystem id in the query, returns an error if not exactly one id was returned.

func (*NoteFilesystemQuery) OnlyIDX

func (nfq *NoteFilesystemQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*NoteFilesystemQuery) OnlyX

OnlyX is like Only, but panics if an error occurs.

func (*NoteFilesystemQuery) Order

Order adds an order step to the query.

func (*NoteFilesystemQuery) QueryOwner

func (nfq *NoteFilesystemQuery) QueryOwner() *MemberQuery

QueryOwner chains the current query on the owner edge.

func (*NoteFilesystemQuery) Select

func (nfq *NoteFilesystemQuery) Select(field string, fields ...string) *NoteFilesystemSelect

Select one or more fields from the given query.

Example:

var v []struct {
	CreatedAt time.Time `json:"created_at,omitempty"`
}

client.NoteFilesystem.Query().
	Select(notefilesystem.FieldCreatedAt).
	Scan(ctx, &v)

func (*NoteFilesystemQuery) Where

Where adds a new predicate for the builder.

func (*NoteFilesystemQuery) WithOwner

func (nfq *NoteFilesystemQuery) WithOwner(opts ...func(*MemberQuery)) *NoteFilesystemQuery
WithOwner tells the query-builder to eager-loads the nodes that are connected to

the "owner" edge. The optional arguments used to configure the query builder of the edge.

type NoteFilesystemSelect

type NoteFilesystemSelect struct {
	// contains filtered or unexported fields
}

NoteFilesystemSelect is the builder for select fields of NoteFilesystem entities.

func (*NoteFilesystemSelect) Bool

func (nfs *NoteFilesystemSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from selector. It is only allowed when selecting one field.

func (*NoteFilesystemSelect) BoolX

func (nfs *NoteFilesystemSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*NoteFilesystemSelect) Bools

func (nfs *NoteFilesystemSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from selector. It is only allowed when selecting one field.

func (*NoteFilesystemSelect) BoolsX

func (nfs *NoteFilesystemSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*NoteFilesystemSelect) Float64

func (nfs *NoteFilesystemSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from selector. It is only allowed when selecting one field.

func (*NoteFilesystemSelect) Float64X

func (nfs *NoteFilesystemSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*NoteFilesystemSelect) Float64s

func (nfs *NoteFilesystemSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from selector. It is only allowed when selecting one field.

func (*NoteFilesystemSelect) Float64sX

func (nfs *NoteFilesystemSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*NoteFilesystemSelect) Int

func (nfs *NoteFilesystemSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from selector. It is only allowed when selecting one field.

func (*NoteFilesystemSelect) IntX

func (nfs *NoteFilesystemSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*NoteFilesystemSelect) Ints

func (nfs *NoteFilesystemSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from selector. It is only allowed when selecting one field.

func (*NoteFilesystemSelect) IntsX

func (nfs *NoteFilesystemSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*NoteFilesystemSelect) Scan

func (nfs *NoteFilesystemSelect) Scan(ctx context.Context, v interface{}) error

Scan applies the selector query and scan the result into the given value.

func (*NoteFilesystemSelect) ScanX

func (nfs *NoteFilesystemSelect) ScanX(ctx context.Context, v interface{})

ScanX is like Scan, but panics if an error occurs.

func (*NoteFilesystemSelect) String

func (nfs *NoteFilesystemSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from selector. It is only allowed when selecting one field.

func (*NoteFilesystemSelect) StringX

func (nfs *NoteFilesystemSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*NoteFilesystemSelect) Strings

func (nfs *NoteFilesystemSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from selector. It is only allowed when selecting one field.

func (*NoteFilesystemSelect) StringsX

func (nfs *NoteFilesystemSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type NoteFilesystemUpdate

type NoteFilesystemUpdate struct {
	// contains filtered or unexported fields
}

NoteFilesystemUpdate is the builder for updating NoteFilesystem entities.

func (*NoteFilesystemUpdate) AddParentID

func (nfu *NoteFilesystemUpdate) AddParentID(i int) *NoteFilesystemUpdate

AddParentID adds i to parent_id.

func (*NoteFilesystemUpdate) ClearOwner

func (nfu *NoteFilesystemUpdate) ClearOwner() *NoteFilesystemUpdate

ClearOwner clears the "owner" edge to type Member.

func (*NoteFilesystemUpdate) Exec

func (nfu *NoteFilesystemUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*NoteFilesystemUpdate) ExecX

func (nfu *NoteFilesystemUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*NoteFilesystemUpdate) Mutation

Mutation returns the NoteFilesystemMutation object of the builder.

func (*NoteFilesystemUpdate) Save

func (nfu *NoteFilesystemUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of rows/vertices matched by this operation.

func (*NoteFilesystemUpdate) SaveX

func (nfu *NoteFilesystemUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*NoteFilesystemUpdate) SetDeleted

func (nfu *NoteFilesystemUpdate) SetDeleted(b bool) *NoteFilesystemUpdate

SetDeleted sets the deleted field.

func (*NoteFilesystemUpdate) SetName

SetName sets the name field.

func (*NoteFilesystemUpdate) SetNillableDeleted

func (nfu *NoteFilesystemUpdate) SetNillableDeleted(b *bool) *NoteFilesystemUpdate

SetNillableDeleted sets the deleted field if the given value is not nil.

func (*NoteFilesystemUpdate) SetNillableOwnerID

func (nfu *NoteFilesystemUpdate) SetNillableOwnerID(id *int) *NoteFilesystemUpdate

SetNillableOwnerID sets the owner edge to Member by id if the given value is not nil.

func (*NoteFilesystemUpdate) SetOwner

SetOwner sets the owner edge to Member.

func (*NoteFilesystemUpdate) SetOwnerID

func (nfu *NoteFilesystemUpdate) SetOwnerID(id int) *NoteFilesystemUpdate

SetOwnerID sets the owner edge to Member by id.

func (*NoteFilesystemUpdate) SetParentID

func (nfu *NoteFilesystemUpdate) SetParentID(i int) *NoteFilesystemUpdate

SetParentID sets the parent_id field.

func (*NoteFilesystemUpdate) SetUpdatedAt

func (nfu *NoteFilesystemUpdate) SetUpdatedAt(t time.Time) *NoteFilesystemUpdate

SetUpdatedAt sets the updated_at field.

func (*NoteFilesystemUpdate) Where

Where adds a new predicate for the builder.

type NoteFilesystemUpdateOne

type NoteFilesystemUpdateOne struct {
	// contains filtered or unexported fields
}

NoteFilesystemUpdateOne is the builder for updating a single NoteFilesystem entity.

func (*NoteFilesystemUpdateOne) AddParentID

func (nfuo *NoteFilesystemUpdateOne) AddParentID(i int) *NoteFilesystemUpdateOne

AddParentID adds i to parent_id.

func (*NoteFilesystemUpdateOne) ClearOwner

ClearOwner clears the "owner" edge to type Member.

func (*NoteFilesystemUpdateOne) Exec

func (nfuo *NoteFilesystemUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*NoteFilesystemUpdateOne) ExecX

func (nfuo *NoteFilesystemUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*NoteFilesystemUpdateOne) Mutation

Mutation returns the NoteFilesystemMutation object of the builder.

func (*NoteFilesystemUpdateOne) Save

Save executes the query and returns the updated entity.

func (*NoteFilesystemUpdateOne) SaveX

SaveX is like Save, but panics if an error occurs.

func (*NoteFilesystemUpdateOne) SetDeleted

SetDeleted sets the deleted field.

func (*NoteFilesystemUpdateOne) SetName

SetName sets the name field.

func (*NoteFilesystemUpdateOne) SetNillableDeleted

func (nfuo *NoteFilesystemUpdateOne) SetNillableDeleted(b *bool) *NoteFilesystemUpdateOne

SetNillableDeleted sets the deleted field if the given value is not nil.

func (*NoteFilesystemUpdateOne) SetNillableOwnerID

func (nfuo *NoteFilesystemUpdateOne) SetNillableOwnerID(id *int) *NoteFilesystemUpdateOne

SetNillableOwnerID sets the owner edge to Member by id if the given value is not nil.

func (*NoteFilesystemUpdateOne) SetOwner

SetOwner sets the owner edge to Member.

func (*NoteFilesystemUpdateOne) SetOwnerID

func (nfuo *NoteFilesystemUpdateOne) SetOwnerID(id int) *NoteFilesystemUpdateOne

SetOwnerID sets the owner edge to Member by id.

func (*NoteFilesystemUpdateOne) SetParentID

func (nfuo *NoteFilesystemUpdateOne) SetParentID(i int) *NoteFilesystemUpdateOne

SetParentID sets the parent_id field.

func (*NoteFilesystemUpdateOne) SetUpdatedAt

SetUpdatedAt sets the updated_at field.

type NoteFilesystems

type NoteFilesystems []*NoteFilesystem

NoteFilesystems is a parsable slice of NoteFilesystem.

type Op

type Op = ent.Op

ent aliases to avoid import conflict 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 Options

type Options struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// UpdatedAt holds the value of the "updated_at" field.
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// 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"`
	// contains filtered or unexported fields
}

Options is the model entity for the Options schema.

func (*Options) String

func (o *Options) String() string

String implements the fmt.Stringer.

func (*Options) Unwrap

func (o *Options) Unwrap() *Options

Unwrap unwraps the entity that was returned from a transaction after it was closed, so that all next queries will be executed through the driver which created the transaction.

func (*Options) Update

func (o *Options) Update() *OptionsUpdateOne

Update returns a builder for updating this Options. Note that, you need to call Options.Unwrap() before calling this method, if this Options was returned from a transaction, and the transaction was committed or rolled back.

type OptionsClient

type OptionsClient struct {
	// contains filtered or unexported fields
}

OptionsClient is a client for the Options schema.

func NewOptionsClient

func NewOptionsClient(c config) *OptionsClient

NewOptionsClient returns a client for the Options from the given config.

func (*OptionsClient) Create

func (c *OptionsClient) Create() *OptionsCreate

Create returns a create builder for Options.

func (*OptionsClient) CreateBulk

func (c *OptionsClient) CreateBulk(builders ...*OptionsCreate) *OptionsCreateBulk

BulkCreate returns a builder for creating a bulk of Options entities.

func (*OptionsClient) Delete

func (c *OptionsClient) Delete() *OptionsDelete

Delete returns a delete builder for Options.

func (*OptionsClient) DeleteOne

func (c *OptionsClient) DeleteOne(o *Options) *OptionsDeleteOne

DeleteOne returns a delete builder for the given entity.

func (*OptionsClient) DeleteOneID

func (c *OptionsClient) DeleteOneID(id int) *OptionsDeleteOne

DeleteOneID returns a delete builder for the given id.

func (*OptionsClient) Get

func (c *OptionsClient) Get(ctx context.Context, id int) (*Options, error)

Get returns a Options entity by its id.

func (*OptionsClient) GetX

func (c *OptionsClient) GetX(ctx context.Context, id int) *Options

GetX is like Get, but panics if an error occurs.

func (*OptionsClient) Hooks

func (c *OptionsClient) Hooks() []Hook

Hooks returns the client hooks.

func (*OptionsClient) Query

func (c *OptionsClient) Query() *OptionsQuery

Query returns a query builder for Options.

func (*OptionsClient) Update

func (c *OptionsClient) Update() *OptionsUpdate

Update returns an update builder for Options.

func (*OptionsClient) UpdateOne

func (c *OptionsClient) UpdateOne(o *Options) *OptionsUpdateOne

UpdateOne returns an update builder for the given entity.

func (*OptionsClient) UpdateOneID

func (c *OptionsClient) UpdateOneID(id int) *OptionsUpdateOne

UpdateOneID returns an update builder for the given id.

func (*OptionsClient) Use

func (c *OptionsClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `options.Hooks(f(g(h())))`.

type OptionsCreate

type OptionsCreate struct {
	// contains filtered or unexported fields
}

OptionsCreate is the builder for creating a Options entity.

func (*OptionsCreate) Mutation

func (oc *OptionsCreate) Mutation() *OptionsMutation

Mutation returns the OptionsMutation object of the builder.

func (*OptionsCreate) Save

func (oc *OptionsCreate) Save(ctx context.Context) (*Options, error)

Save creates the Options in the database.

func (*OptionsCreate) SaveX

func (oc *OptionsCreate) SaveX(ctx context.Context) *Options

SaveX calls Save and panics if Save returns an error.

func (*OptionsCreate) SetCreatedAt

func (oc *OptionsCreate) SetCreatedAt(t time.Time) *OptionsCreate

SetCreatedAt sets the created_at field.

func (*OptionsCreate) SetID

func (oc *OptionsCreate) SetID(i int) *OptionsCreate

SetID sets the id field.

func (*OptionsCreate) SetKey

func (oc *OptionsCreate) SetKey(s string) *OptionsCreate

SetKey sets the key field.

func (*OptionsCreate) SetNillableCreatedAt

func (oc *OptionsCreate) SetNillableCreatedAt(t *time.Time) *OptionsCreate

SetNillableCreatedAt sets the created_at field if the given value is not nil.

func (*OptionsCreate) SetNillableUpdatedAt

func (oc *OptionsCreate) SetNillableUpdatedAt(t *time.Time) *OptionsCreate

SetNillableUpdatedAt sets the updated_at field if the given value is not nil.

func (*OptionsCreate) SetUpdatedAt

func (oc *OptionsCreate) SetUpdatedAt(t time.Time) *OptionsCreate

SetUpdatedAt sets the updated_at field.

func (*OptionsCreate) SetValue

func (oc *OptionsCreate) SetValue(s string) *OptionsCreate

SetValue sets the value field.

type OptionsCreateBulk

type OptionsCreateBulk struct {
	// contains filtered or unexported fields
}

OptionsCreateBulk is the builder for creating a bulk of Options entities.

func (*OptionsCreateBulk) Save

func (ocb *OptionsCreateBulk) Save(ctx context.Context) ([]*Options, error)

Save creates the Options entities in the database.

func (*OptionsCreateBulk) SaveX

func (ocb *OptionsCreateBulk) SaveX(ctx context.Context) []*Options

SaveX calls Save and panics if Save returns an error.

type OptionsDelete

type OptionsDelete struct {
	// contains filtered or unexported fields
}

OptionsDelete is the builder for deleting a Options entity.

func (*OptionsDelete) Exec

func (od *OptionsDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*OptionsDelete) ExecX

func (od *OptionsDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*OptionsDelete) Where

func (od *OptionsDelete) Where(ps ...predicate.Options) *OptionsDelete

Where adds a new predicate to the delete builder.

type OptionsDeleteOne

type OptionsDeleteOne struct {
	// contains filtered or unexported fields
}

OptionsDeleteOne is the builder for deleting a single Options entity.

func (*OptionsDeleteOne) Exec

func (odo *OptionsDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*OptionsDeleteOne) ExecX

func (odo *OptionsDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

type OptionsGroupBy

type OptionsGroupBy struct {
	// contains filtered or unexported fields
}

OptionsGroupBy is the builder for group-by Options entities.

func (*OptionsGroupBy) Aggregate

func (ogb *OptionsGroupBy) Aggregate(fns ...AggregateFunc) *OptionsGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*OptionsGroupBy) Bool

func (ogb *OptionsGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from group-by. It is only allowed when querying group-by with one field.

func (*OptionsGroupBy) BoolX

func (ogb *OptionsGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*OptionsGroupBy) Bools

func (ogb *OptionsGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from group-by. It is only allowed when querying group-by with one field.

func (*OptionsGroupBy) BoolsX

func (ogb *OptionsGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*OptionsGroupBy) Float64

func (ogb *OptionsGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from group-by. It is only allowed when querying group-by with one field.

func (*OptionsGroupBy) Float64X

func (ogb *OptionsGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*OptionsGroupBy) Float64s

func (ogb *OptionsGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from group-by. It is only allowed when querying group-by with one field.

func (*OptionsGroupBy) Float64sX

func (ogb *OptionsGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*OptionsGroupBy) Int

func (ogb *OptionsGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from group-by. It is only allowed when querying group-by with one field.

func (*OptionsGroupBy) IntX

func (ogb *OptionsGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*OptionsGroupBy) Ints

func (ogb *OptionsGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from group-by. It is only allowed when querying group-by with one field.

func (*OptionsGroupBy) IntsX

func (ogb *OptionsGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*OptionsGroupBy) Scan

func (ogb *OptionsGroupBy) Scan(ctx context.Context, v interface{}) error

Scan applies the group-by query and scan the result into the given value.

func (*OptionsGroupBy) ScanX

func (ogb *OptionsGroupBy) ScanX(ctx context.Context, v interface{})

ScanX is like Scan, but panics if an error occurs.

func (*OptionsGroupBy) String

func (ogb *OptionsGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from group-by. It is only allowed when querying group-by with one field.

func (*OptionsGroupBy) StringX

func (ogb *OptionsGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*OptionsGroupBy) Strings

func (ogb *OptionsGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from group-by. It is only allowed when querying group-by with one field.

func (*OptionsGroupBy) StringsX

func (ogb *OptionsGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type OptionsMutation

type OptionsMutation struct {
	// contains filtered or unexported fields
}

OptionsMutation represents an operation that mutate the OptionsSlice nodes in the graph.

func (*OptionsMutation) AddField

func (m *OptionsMutation) AddField(name string, value ent.Value) error

AddField adds the value for the given name. It returns an error if the field is not defined in the schema, or if the type mismatch the field type.

func (*OptionsMutation) AddedEdges

func (m *OptionsMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*OptionsMutation) AddedField

func (m *OptionsMutation) AddedField(name string) (ent.Value, bool)

AddedField returns the numeric value that was in/decremented from a field with the given name. The second value indicates that this field was not set, or was not define in the schema.

func (*OptionsMutation) AddedFields

func (m *OptionsMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented or decremented during this mutation.

func (*OptionsMutation) AddedIDs

func (m *OptionsMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all ids (to other nodes) that were added for the given edge name.

func (*OptionsMutation) ClearEdge

func (m *OptionsMutation) ClearEdge(name string) error

ClearEdge clears the value for the given name. It returns an error if the edge name is not defined in the schema.

func (*OptionsMutation) ClearField

func (m *OptionsMutation) ClearField(name string) error

ClearField clears the value for the given name. It returns an error if the field is not defined in the schema.

func (*OptionsMutation) ClearedEdges

func (m *OptionsMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*OptionsMutation) ClearedFields

func (m *OptionsMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (OptionsMutation) Client

func (m OptionsMutation) 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 (*OptionsMutation) CreatedAt

func (m *OptionsMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the created_at value in the mutation.

func (*OptionsMutation) EdgeCleared

func (m *OptionsMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean indicates if this edge was cleared in this mutation.

func (*OptionsMutation) Field

func (m *OptionsMutation) Field(name string) (ent.Value, bool)

Field returns the value of a field with the given name. The second boolean value indicates that this field was not set, or was not define in the schema.

func (*OptionsMutation) FieldCleared

func (m *OptionsMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicates if this field was cleared in this mutation.

func (*OptionsMutation) Fields

func (m *OptionsMutation) Fields() []string

Fields returns all fields that were changed during this mutation. Note that, in order to get all numeric fields that were in/decremented, call AddedFields().

func (*OptionsMutation) ID

func (m *OptionsMutation) ID() (id int, exists bool)

ID returns the id value in the mutation. Note that, the id is available only if it was provided to the builder.

func (*OptionsMutation) Key

func (m *OptionsMutation) Key() (r string, exists bool)

Key returns the key value in the mutation.

func (*OptionsMutation) OldCreatedAt

func (m *OptionsMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

OldCreatedAt returns the old created_at value of the Options. If the Options 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 database query fails.

func (*OptionsMutation) OldField

func (m *OptionsMutation) 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 was failed.

func (*OptionsMutation) OldKey

func (m *OptionsMutation) OldKey(ctx context.Context) (v string, err error)

OldKey returns the old key value of the Options. If the Options 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 database query fails.

func (*OptionsMutation) OldUpdatedAt

func (m *OptionsMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)

OldUpdatedAt returns the old updated_at value of the Options. If the Options 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 database query fails.

func (*OptionsMutation) OldValue

func (m *OptionsMutation) OldValue(ctx context.Context) (v string, err error)

OldValue returns the old value value of the Options. If the Options 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 database query fails.

func (*OptionsMutation) Op

func (m *OptionsMutation) Op() Op

Op returns the operation name.

func (*OptionsMutation) RemovedEdges

func (m *OptionsMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*OptionsMutation) RemovedIDs

func (m *OptionsMutation) RemovedIDs(name string) []ent.Value

RemovedIDs returns all ids (to other nodes) that were removed for the given edge name.

func (*OptionsMutation) ResetCreatedAt

func (m *OptionsMutation) ResetCreatedAt()

ResetCreatedAt reset all changes of the "created_at" field.

func (*OptionsMutation) ResetEdge

func (m *OptionsMutation) ResetEdge(name string) error

ResetEdge resets all changes in the mutation regarding the given edge name. It returns an error if the edge is not defined in the schema.

func (*OptionsMutation) ResetField

func (m *OptionsMutation) ResetField(name string) error

ResetField resets all changes in the mutation regarding the given field name. It returns an error if the field is not defined in the schema.

func (*OptionsMutation) ResetKey

func (m *OptionsMutation) ResetKey()

ResetKey reset all changes of the "key" field.

func (*OptionsMutation) ResetUpdatedAt

func (m *OptionsMutation) ResetUpdatedAt()

ResetUpdatedAt reset all changes of the "updated_at" field.

func (*OptionsMutation) ResetValue

func (m *OptionsMutation) ResetValue()

ResetValue reset all changes of the "value" field.

func (*OptionsMutation) SetCreatedAt

func (m *OptionsMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the created_at field.

func (*OptionsMutation) SetField

func (m *OptionsMutation) SetField(name string, value ent.Value) error

SetField sets the value for the given name. It returns an error if the field is not defined in the schema, or if the type mismatch the field type.

func (*OptionsMutation) SetID

func (m *OptionsMutation) SetID(id int)

SetID sets the value of the id field. Note that, this operation is accepted only on Options creation.

func (*OptionsMutation) SetKey

func (m *OptionsMutation) SetKey(s string)

SetKey sets the key field.

func (*OptionsMutation) SetUpdatedAt

func (m *OptionsMutation) SetUpdatedAt(t time.Time)

SetUpdatedAt sets the updated_at field.

func (*OptionsMutation) SetValue

func (m *OptionsMutation) SetValue(s string)

SetValue sets the value field.

func (OptionsMutation) Tx

func (m OptionsMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*OptionsMutation) Type

func (m *OptionsMutation) Type() string

Type returns the node type of this mutation (Options).

func (*OptionsMutation) UpdatedAt

func (m *OptionsMutation) UpdatedAt() (r time.Time, exists bool)

UpdatedAt returns the updated_at value in the mutation.

func (*OptionsMutation) Value

func (m *OptionsMutation) Value() (r string, exists bool)

Value returns the value value in the mutation.

type OptionsQuery

type OptionsQuery struct {
	// contains filtered or unexported fields
}

OptionsQuery is the builder for querying Options entities.

func (*OptionsQuery) All

func (oq *OptionsQuery) All(ctx context.Context) ([]*Options, error)

All executes the query and returns a list of OptionsSlice.

func (*OptionsQuery) AllX

func (oq *OptionsQuery) AllX(ctx context.Context) []*Options

AllX is like All, but panics if an error occurs.

func (*OptionsQuery) Clone

func (oq *OptionsQuery) Clone() *OptionsQuery

Clone returns a duplicate of the query builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*OptionsQuery) Count

func (oq *OptionsQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*OptionsQuery) CountX

func (oq *OptionsQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*OptionsQuery) Exist

func (oq *OptionsQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*OptionsQuery) ExistX

func (oq *OptionsQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*OptionsQuery) First

func (oq *OptionsQuery) First(ctx context.Context) (*Options, error)

First returns the first Options entity in the query. Returns *NotFoundError when no options was found.

func (*OptionsQuery) FirstID

func (oq *OptionsQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first Options id in the query. Returns *NotFoundError when no id was found.

func (*OptionsQuery) FirstX

func (oq *OptionsQuery) FirstX(ctx context.Context) *Options

FirstX is like First, but panics if an error occurs.

func (*OptionsQuery) FirstXID

func (oq *OptionsQuery) FirstXID(ctx context.Context) int

FirstXID is like FirstID, but panics if an error occurs.

func (*OptionsQuery) GroupBy

func (oq *OptionsQuery) GroupBy(field string, fields ...string) *OptionsGroupBy

GroupBy 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 {
	CreatedAt time.Time `json:"created_at,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Options.Query().
	GroupBy(options.FieldCreatedAt).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*OptionsQuery) IDs

func (oq *OptionsQuery) IDs(ctx context.Context) ([]int, error)

IDs executes the query and returns a list of Options ids.

func (*OptionsQuery) IDsX

func (oq *OptionsQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*OptionsQuery) Limit

func (oq *OptionsQuery) Limit(limit int) *OptionsQuery

Limit adds a limit step to the query.

func (*OptionsQuery) Offset

func (oq *OptionsQuery) Offset(offset int) *OptionsQuery

Offset adds an offset step to the query.

func (*OptionsQuery) Only

func (oq *OptionsQuery) Only(ctx context.Context) (*Options, error)

Only returns the only Options entity in the query, returns an error if not exactly one entity was returned.

func (*OptionsQuery) OnlyID

func (oq *OptionsQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID returns the only Options id in the query, returns an error if not exactly one id was returned.

func (*OptionsQuery) OnlyIDX

func (oq *OptionsQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*OptionsQuery) OnlyX

func (oq *OptionsQuery) OnlyX(ctx context.Context) *Options

OnlyX is like Only, but panics if an error occurs.

func (*OptionsQuery) Order

func (oq *OptionsQuery) Order(o ...OrderFunc) *OptionsQuery

Order adds an order step to the query.

func (*OptionsQuery) Select

func (oq *OptionsQuery) Select(field string, fields ...string) *OptionsSelect

Select one or more fields from the given query.

Example:

var v []struct {
	CreatedAt time.Time `json:"created_at,omitempty"`
}

client.Options.Query().
	Select(options.FieldCreatedAt).
	Scan(ctx, &v)

func (*OptionsQuery) Where

func (oq *OptionsQuery) Where(ps ...predicate.Options) *OptionsQuery

Where adds a new predicate for the builder.

type OptionsSelect

type OptionsSelect struct {
	// contains filtered or unexported fields
}

OptionsSelect is the builder for select fields of Options entities.

func (*OptionsSelect) Bool

func (os *OptionsSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from selector. It is only allowed when selecting one field.

func (*OptionsSelect) BoolX

func (os *OptionsSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*OptionsSelect) Bools

func (os *OptionsSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from selector. It is only allowed when selecting one field.

func (*OptionsSelect) BoolsX

func (os *OptionsSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*OptionsSelect) Float64

func (os *OptionsSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from selector. It is only allowed when selecting one field.

func (*OptionsSelect) Float64X

func (os *OptionsSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*OptionsSelect) Float64s

func (os *OptionsSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from selector. It is only allowed when selecting one field.

func (*OptionsSelect) Float64sX

func (os *OptionsSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*OptionsSelect) Int

func (os *OptionsSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from selector. It is only allowed when selecting one field.

func (*OptionsSelect) IntX

func (os *OptionsSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*OptionsSelect) Ints

func (os *OptionsSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from selector. It is only allowed when selecting one field.

func (*OptionsSelect) IntsX

func (os *OptionsSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*OptionsSelect) Scan

func (os *OptionsSelect) Scan(ctx context.Context, v interface{}) error

Scan applies the selector query and scan the result into the given value.

func (*OptionsSelect) ScanX

func (os *OptionsSelect) ScanX(ctx context.Context, v interface{})

ScanX is like Scan, but panics if an error occurs.

func (*OptionsSelect) String

func (os *OptionsSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from selector. It is only allowed when selecting one field.

func (*OptionsSelect) StringX

func (os *OptionsSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*OptionsSelect) Strings

func (os *OptionsSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from selector. It is only allowed when selecting one field.

func (*OptionsSelect) StringsX

func (os *OptionsSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type OptionsSlice

type OptionsSlice []*Options

OptionsSlice is a parsable slice of Options.

type OptionsUpdate

type OptionsUpdate struct {
	// contains filtered or unexported fields
}

OptionsUpdate is the builder for updating Options entities.

func (*OptionsUpdate) Exec

func (ou *OptionsUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*OptionsUpdate) ExecX

func (ou *OptionsUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*OptionsUpdate) Mutation

func (ou *OptionsUpdate) Mutation() *OptionsMutation

Mutation returns the OptionsMutation object of the builder.

func (*OptionsUpdate) Save

func (ou *OptionsUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of rows/vertices matched by this operation.

func (*OptionsUpdate) SaveX

func (ou *OptionsUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*OptionsUpdate) SetKey

func (ou *OptionsUpdate) SetKey(s string) *OptionsUpdate

SetKey sets the key field.

func (*OptionsUpdate) SetUpdatedAt

func (ou *OptionsUpdate) SetUpdatedAt(t time.Time) *OptionsUpdate

SetUpdatedAt sets the updated_at field.

func (*OptionsUpdate) SetValue

func (ou *OptionsUpdate) SetValue(s string) *OptionsUpdate

SetValue sets the value field.

func (*OptionsUpdate) Where

func (ou *OptionsUpdate) Where(ps ...predicate.Options) *OptionsUpdate

Where adds a new predicate for the builder.

type OptionsUpdateOne

type OptionsUpdateOne struct {
	// contains filtered or unexported fields
}

OptionsUpdateOne is the builder for updating a single Options entity.

func (*OptionsUpdateOne) Exec

func (ouo *OptionsUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*OptionsUpdateOne) ExecX

func (ouo *OptionsUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*OptionsUpdateOne) Mutation

func (ouo *OptionsUpdateOne) Mutation() *OptionsMutation

Mutation returns the OptionsMutation object of the builder.

func (*OptionsUpdateOne) Save

func (ouo *OptionsUpdateOne) Save(ctx context.Context) (*Options, error)

Save executes the query and returns the updated entity.

func (*OptionsUpdateOne) SaveX

func (ouo *OptionsUpdateOne) SaveX(ctx context.Context) *Options

SaveX is like Save, but panics if an error occurs.

func (*OptionsUpdateOne) SetKey

func (ouo *OptionsUpdateOne) SetKey(s string) *OptionsUpdateOne

SetKey sets the key field.

func (*OptionsUpdateOne) SetUpdatedAt

func (ouo *OptionsUpdateOne) SetUpdatedAt(t time.Time) *OptionsUpdateOne

SetUpdatedAt sets the updated_at field.

func (*OptionsUpdateOne) SetValue

func (ouo *OptionsUpdateOne) SetValue(s string) *OptionsUpdateOne

SetValue sets the value field.

type OrderFunc

type OrderFunc func(*sql.Selector, func(string) bool)

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 conflict in user's code.

type Query

type Query = ent.Query

ent aliases to avoid import conflict in user's code.

type RollbackFunc

type RollbackFunc func(context.Context, *Tx) error

The RollbackFunc type is an adapter to allow the use of ordinary function as a Rollbacker. If f is a function with the appropriate signature, RollbackFunc(f) is a Rollbacker that calls f.

func (RollbackFunc) Rollback

func (f RollbackFunc) Rollback(ctx context.Context, tx *Tx) error

Rollback calls f(ctx, m).

type RollbackHook

type RollbackHook func(Rollbacker) Rollbacker

RollbackHook defines the "rollback middleware". A function that gets a Rollbacker and returns a Rollbacker. For example:

hook := func(next ent.Rollbacker) ent.Rollbacker {
	return ent.RollbackFunc(func(context.Context, tx *ent.Tx) error {
		// Do some stuff before.
		if err := next.Rollback(ctx, tx); err != nil {
			return err
		}
		// Do some stuff after.
		return nil
	})
}

type Rollbacker

type Rollbacker interface {
	Rollback(context.Context, *Tx) error
}

Rollbacker is the interface that wraps the Rollbacker method.

type Tx

type Tx struct {

	// Admin is the client for interacting with the Admin builders.
	Admin *AdminClient
	// AdminLoginLog is the client for interacting with the AdminLoginLog builders.
	AdminLoginLog *AdminLoginLogClient
	// CasbinRule is the client for interacting with the CasbinRule builders.
	CasbinRule *CasbinRuleClient
	// Member is the client for interacting with the Member builders.
	Member *MemberClient
	// MemberLoginLog is the client for interacting with the MemberLoginLog builders.
	MemberLoginLog *MemberLoginLogClient
	// NoteArticle is the client for interacting with the NoteArticle builders.
	NoteArticle *NoteArticleClient
	// NoteFilesystem is the client for interacting with the NoteFilesystem builders.
	NoteFilesystem *NoteFilesystemClient
	// Options is the client for interacting with the Options builders.
	Options *OptionsClient
	// 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 the Tx stored in 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 conflict in user's code.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL