Documentation ¶
Index ¶
- Constants
- func IsConstraintError(err error) bool
- func IsNotFound(err error) bool
- func IsNotLoaded(err error) bool
- func IsNotSingular(err error) bool
- func MaskNotFound(err error) error
- func NewContext(parent context.Context, c *Client) context.Context
- type Aggregate
- type Client
- type ConstraintError
- type Hook
- type MutateFunc
- type Mutation
- type Mutator
- type NotFoundError
- type NotLoadedError
- type NotSingularError
- type Op
- type Option
- type Order
- type Query
- type Robotstxt
- type RobotstxtClient
- func (c *RobotstxtClient) Create() *RobotstxtCreate
- func (c *RobotstxtClient) Delete() *RobotstxtDelete
- func (c *RobotstxtClient) DeleteOne(r *Robotstxt) *RobotstxtDeleteOne
- func (c *RobotstxtClient) DeleteOneID(id int) *RobotstxtDeleteOne
- func (c *RobotstxtClient) Get(ctx context.Context, id int) (*Robotstxt, error)
- func (c *RobotstxtClient) GetX(ctx context.Context, id int) *Robotstxt
- func (c *RobotstxtClient) Hooks() []Hook
- func (c *RobotstxtClient) Query() *RobotstxtQuery
- func (c *RobotstxtClient) Update() *RobotstxtUpdate
- func (c *RobotstxtClient) UpdateOne(r *Robotstxt) *RobotstxtUpdateOne
- func (c *RobotstxtClient) UpdateOneID(id int) *RobotstxtUpdateOne
- func (c *RobotstxtClient) Use(hooks ...Hook)
- type RobotstxtCreate
- func (rc *RobotstxtCreate) Save(ctx context.Context) (*Robotstxt, error)
- func (rc *RobotstxtCreate) SaveX(ctx context.Context) *Robotstxt
- func (rc *RobotstxtCreate) SetBody(b []byte) *RobotstxtCreate
- func (rc *RobotstxtCreate) SetCreatedAt(t time.Time) *RobotstxtCreate
- func (rc *RobotstxtCreate) SetHost(s string) *RobotstxtCreate
- func (rc *RobotstxtCreate) SetNillableCreatedAt(t *time.Time) *RobotstxtCreate
- func (rc *RobotstxtCreate) SetNillableUpdatedAt(t *time.Time) *RobotstxtCreate
- func (rc *RobotstxtCreate) SetResponseTime(i int64) *RobotstxtCreate
- func (rc *RobotstxtCreate) SetResponseURL(s string) *RobotstxtCreate
- func (rc *RobotstxtCreate) SetScheme(s string) *RobotstxtCreate
- func (rc *RobotstxtCreate) SetStatuscode(i int32) *RobotstxtCreate
- func (rc *RobotstxtCreate) SetUpdatedAt(t time.Time) *RobotstxtCreate
- type RobotstxtDelete
- type RobotstxtDeleteOne
- type RobotstxtGroupBy
- func (rgb *RobotstxtGroupBy) Aggregate(fns ...Aggregate) *RobotstxtGroupBy
- func (rgb *RobotstxtGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (rgb *RobotstxtGroupBy) BoolsX(ctx context.Context) []bool
- func (rgb *RobotstxtGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (rgb *RobotstxtGroupBy) Float64sX(ctx context.Context) []float64
- func (rgb *RobotstxtGroupBy) Ints(ctx context.Context) ([]int, error)
- func (rgb *RobotstxtGroupBy) IntsX(ctx context.Context) []int
- func (rgb *RobotstxtGroupBy) Scan(ctx context.Context, v interface{}) error
- func (rgb *RobotstxtGroupBy) ScanX(ctx context.Context, v interface{})
- func (rgb *RobotstxtGroupBy) Strings(ctx context.Context) ([]string, error)
- func (rgb *RobotstxtGroupBy) StringsX(ctx context.Context) []string
- type RobotstxtMutation
- func (m *RobotstxtMutation) AddField(name string, value ent.Value) error
- func (m *RobotstxtMutation) AddResponseTime(i int64)
- func (m *RobotstxtMutation) AddStatuscode(i int32)
- func (m *RobotstxtMutation) AddedEdges() []string
- func (m *RobotstxtMutation) AddedField(name string) (ent.Value, bool)
- func (m *RobotstxtMutation) AddedFields() []string
- func (m *RobotstxtMutation) AddedIDs(name string) []ent.Value
- func (m *RobotstxtMutation) AddedResponseTime() (r int64, exists bool)
- func (m *RobotstxtMutation) AddedStatuscode() (r int32, exists bool)
- func (m *RobotstxtMutation) Body() (r []byte, exists bool)
- func (m *RobotstxtMutation) ClearEdge(name string) error
- func (m *RobotstxtMutation) ClearField(name string) error
- func (m *RobotstxtMutation) ClearedEdges() []string
- func (m *RobotstxtMutation) ClearedFields() []string
- func (m RobotstxtMutation) Client() *Client
- func (m *RobotstxtMutation) CreatedAt() (r time.Time, exists bool)
- func (m *RobotstxtMutation) EdgeCleared(name string) bool
- func (m *RobotstxtMutation) Field(name string) (ent.Value, bool)
- func (m *RobotstxtMutation) FieldCleared(name string) bool
- func (m *RobotstxtMutation) Fields() []string
- func (m *RobotstxtMutation) Host() (r string, exists bool)
- func (m *RobotstxtMutation) ID() (id int, exists bool)
- func (m *RobotstxtMutation) Op() Op
- func (m *RobotstxtMutation) RemovedEdges() []string
- func (m *RobotstxtMutation) RemovedIDs(name string) []ent.Value
- func (m *RobotstxtMutation) ResetBody()
- func (m *RobotstxtMutation) ResetCreatedAt()
- func (m *RobotstxtMutation) ResetEdge(name string) error
- func (m *RobotstxtMutation) ResetField(name string) error
- func (m *RobotstxtMutation) ResetHost()
- func (m *RobotstxtMutation) ResetResponseTime()
- func (m *RobotstxtMutation) ResetResponseURL()
- func (m *RobotstxtMutation) ResetScheme()
- func (m *RobotstxtMutation) ResetStatuscode()
- func (m *RobotstxtMutation) ResetUpdatedAt()
- func (m *RobotstxtMutation) ResponseTime() (r int64, exists bool)
- func (m *RobotstxtMutation) ResponseURL() (r string, exists bool)
- func (m *RobotstxtMutation) Scheme() (r string, exists bool)
- func (m *RobotstxtMutation) SetBody(b []byte)
- func (m *RobotstxtMutation) SetCreatedAt(t time.Time)
- func (m *RobotstxtMutation) SetField(name string, value ent.Value) error
- func (m *RobotstxtMutation) SetHost(s string)
- func (m *RobotstxtMutation) SetResponseTime(i int64)
- func (m *RobotstxtMutation) SetResponseURL(s string)
- func (m *RobotstxtMutation) SetScheme(s string)
- func (m *RobotstxtMutation) SetStatuscode(i int32)
- func (m *RobotstxtMutation) SetUpdatedAt(t time.Time)
- func (m *RobotstxtMutation) Statuscode() (r int32, exists bool)
- func (m RobotstxtMutation) Tx() (*Tx, error)
- func (m *RobotstxtMutation) Type() string
- func (m *RobotstxtMutation) UpdatedAt() (r time.Time, exists bool)
- type RobotstxtQuery
- func (rq *RobotstxtQuery) All(ctx context.Context) ([]*Robotstxt, error)
- func (rq *RobotstxtQuery) AllX(ctx context.Context) []*Robotstxt
- func (rq *RobotstxtQuery) Clone() *RobotstxtQuery
- func (rq *RobotstxtQuery) Count(ctx context.Context) (int, error)
- func (rq *RobotstxtQuery) CountX(ctx context.Context) int
- func (rq *RobotstxtQuery) Exist(ctx context.Context) (bool, error)
- func (rq *RobotstxtQuery) ExistX(ctx context.Context) bool
- func (rq *RobotstxtQuery) First(ctx context.Context) (*Robotstxt, error)
- func (rq *RobotstxtQuery) FirstID(ctx context.Context) (id int, err error)
- func (rq *RobotstxtQuery) FirstX(ctx context.Context) *Robotstxt
- func (rq *RobotstxtQuery) FirstXID(ctx context.Context) int
- func (rq *RobotstxtQuery) GroupBy(field string, fields ...string) *RobotstxtGroupBy
- func (rq *RobotstxtQuery) IDs(ctx context.Context) ([]int, error)
- func (rq *RobotstxtQuery) IDsX(ctx context.Context) []int
- func (rq *RobotstxtQuery) Limit(limit int) *RobotstxtQuery
- func (rq *RobotstxtQuery) Offset(offset int) *RobotstxtQuery
- func (rq *RobotstxtQuery) Only(ctx context.Context) (*Robotstxt, error)
- func (rq *RobotstxtQuery) OnlyID(ctx context.Context) (id int, err error)
- func (rq *RobotstxtQuery) OnlyX(ctx context.Context) *Robotstxt
- func (rq *RobotstxtQuery) OnlyXID(ctx context.Context) int
- func (rq *RobotstxtQuery) Order(o ...Order) *RobotstxtQuery
- func (rq *RobotstxtQuery) Select(field string, fields ...string) *RobotstxtSelect
- func (rq *RobotstxtQuery) Where(ps ...predicate.Robotstxt) *RobotstxtQuery
- type RobotstxtSelect
- func (rs *RobotstxtSelect) Bools(ctx context.Context) ([]bool, error)
- func (rs *RobotstxtSelect) BoolsX(ctx context.Context) []bool
- func (rs *RobotstxtSelect) Float64s(ctx context.Context) ([]float64, error)
- func (rs *RobotstxtSelect) Float64sX(ctx context.Context) []float64
- func (rs *RobotstxtSelect) Ints(ctx context.Context) ([]int, error)
- func (rs *RobotstxtSelect) IntsX(ctx context.Context) []int
- func (rs *RobotstxtSelect) Scan(ctx context.Context, v interface{}) error
- func (rs *RobotstxtSelect) ScanX(ctx context.Context, v interface{})
- func (rs *RobotstxtSelect) Strings(ctx context.Context) ([]string, error)
- func (rs *RobotstxtSelect) StringsX(ctx context.Context) []string
- type RobotstxtUpdate
- func (ru *RobotstxtUpdate) AddResponseTime(i int64) *RobotstxtUpdate
- func (ru *RobotstxtUpdate) AddStatuscode(i int32) *RobotstxtUpdate
- func (ru *RobotstxtUpdate) Exec(ctx context.Context) error
- func (ru *RobotstxtUpdate) ExecX(ctx context.Context)
- func (ru *RobotstxtUpdate) Save(ctx context.Context) (int, error)
- func (ru *RobotstxtUpdate) SaveX(ctx context.Context) int
- func (ru *RobotstxtUpdate) SetBody(b []byte) *RobotstxtUpdate
- func (ru *RobotstxtUpdate) SetHost(s string) *RobotstxtUpdate
- func (ru *RobotstxtUpdate) SetResponseTime(i int64) *RobotstxtUpdate
- func (ru *RobotstxtUpdate) SetResponseURL(s string) *RobotstxtUpdate
- func (ru *RobotstxtUpdate) SetScheme(s string) *RobotstxtUpdate
- func (ru *RobotstxtUpdate) SetStatuscode(i int32) *RobotstxtUpdate
- func (ru *RobotstxtUpdate) SetUpdatedAt(t time.Time) *RobotstxtUpdate
- func (ru *RobotstxtUpdate) Where(ps ...predicate.Robotstxt) *RobotstxtUpdate
- type RobotstxtUpdateOne
- func (ruo *RobotstxtUpdateOne) AddResponseTime(i int64) *RobotstxtUpdateOne
- func (ruo *RobotstxtUpdateOne) AddStatuscode(i int32) *RobotstxtUpdateOne
- func (ruo *RobotstxtUpdateOne) Exec(ctx context.Context) error
- func (ruo *RobotstxtUpdateOne) ExecX(ctx context.Context)
- func (ruo *RobotstxtUpdateOne) Save(ctx context.Context) (*Robotstxt, error)
- func (ruo *RobotstxtUpdateOne) SaveX(ctx context.Context) *Robotstxt
- func (ruo *RobotstxtUpdateOne) SetBody(b []byte) *RobotstxtUpdateOne
- func (ruo *RobotstxtUpdateOne) SetHost(s string) *RobotstxtUpdateOne
- func (ruo *RobotstxtUpdateOne) SetResponseTime(i int64) *RobotstxtUpdateOne
- func (ruo *RobotstxtUpdateOne) SetResponseURL(s string) *RobotstxtUpdateOne
- func (ruo *RobotstxtUpdateOne) SetScheme(s string) *RobotstxtUpdateOne
- func (ruo *RobotstxtUpdateOne) SetStatuscode(i int32) *RobotstxtUpdateOne
- func (ruo *RobotstxtUpdateOne) SetUpdatedAt(t time.Time) *RobotstxtUpdateOne
- type Robotstxts
- type Tx
- type Value
Constants ¶
const ( // Operation types. OpCreate = ent.OpCreate OpDelete = ent.OpDelete OpDeleteOne = ent.OpDeleteOne OpUpdate = ent.OpUpdate OpUpdateOne = ent.OpUpdateOne // Node types. TypeRobotstxt = "Robotstxt" )
Variables ¶
This section is empty.
Functions ¶
func IsConstraintError ¶
IsConstraintError returns a boolean indicating whether the error is a constraint failure.
func IsNotFound ¶
IsNotFound returns a boolean indicating whether the error is a not found error.
func IsNotLoaded ¶
IsNotLoaded returns a boolean indicating whether the error is a not loaded error.
func IsNotSingular ¶
IsNotSingular returns a boolean indicating whether the error is a not singular error.
Types ¶
type Aggregate ¶
Aggregate 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)
type Client ¶
type Client struct { // Schema is the client for creating, migrating and dropping schema. Schema *migrate.Schema // Robotstxt is the client for interacting with the Robotstxt builders. Robotstxt *RobotstxtClient // contains filtered or unexported fields }
Client is the client that holds all ent builders.
func FromContext ¶
FromContext returns the Client stored in a context, or nil if there isn't one.
func Open ¶
Open opens a connection to the database specified by the driver name and a driver-specific data source name, and returns a new client attached to it. Optional parameters can be added for configuring the client.
func (*Client) Debug ¶
Debug returns a new debug-client. It's used to get verbose logging on specific operations.
client.Debug(). Robotstxt. Query(). Count(ctx)
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 MutateFunc ¶
type MutateFunc = ent.MutateFunc
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 Robotstxt ¶
type Robotstxt 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"` // Host holds the value of the "host" field. Host string `json:"host,omitempty"` // Scheme holds the value of the "scheme" field. Scheme string `json:"scheme,omitempty"` // ResponseURL holds the value of the "response_url" field. ResponseURL string `json:"response_url,omitempty"` // Body holds the value of the "body" field. Body []byte `json:"body,omitempty"` // Statuscode holds the value of the "statuscode" field. Statuscode int32 `json:"statuscode,omitempty"` // ResponseTime holds the value of the "response_time" field. ResponseTime int64 `json:"response_time,omitempty"` // contains filtered or unexported fields }
Robotstxt is the model entity for the Robotstxt schema.
func (*Robotstxt) Unwrap ¶
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 (*Robotstxt) Update ¶
func (r *Robotstxt) Update() *RobotstxtUpdateOne
Update returns a builder for updating this Robotstxt. Note that, you need to call Robotstxt.Unwrap() before calling this method, if this Robotstxt was returned from a transaction, and the transaction was committed or rolled back.
type RobotstxtClient ¶
type RobotstxtClient struct {
// contains filtered or unexported fields
}
RobotstxtClient is a client for the Robotstxt schema.
func NewRobotstxtClient ¶
func NewRobotstxtClient(c config) *RobotstxtClient
NewRobotstxtClient returns a client for the Robotstxt from the given config.
func (*RobotstxtClient) Create ¶
func (c *RobotstxtClient) Create() *RobotstxtCreate
Create returns a create builder for Robotstxt.
func (*RobotstxtClient) Delete ¶
func (c *RobotstxtClient) Delete() *RobotstxtDelete
Delete returns a delete builder for Robotstxt.
func (*RobotstxtClient) DeleteOne ¶
func (c *RobotstxtClient) DeleteOne(r *Robotstxt) *RobotstxtDeleteOne
DeleteOne returns a delete builder for the given entity.
func (*RobotstxtClient) DeleteOneID ¶
func (c *RobotstxtClient) DeleteOneID(id int) *RobotstxtDeleteOne
DeleteOneID returns a delete builder for the given id.
func (*RobotstxtClient) GetX ¶
func (c *RobotstxtClient) GetX(ctx context.Context, id int) *Robotstxt
GetX is like Get, but panics if an error occurs.
func (*RobotstxtClient) Hooks ¶
func (c *RobotstxtClient) Hooks() []Hook
Hooks returns the client hooks.
func (*RobotstxtClient) Query ¶
func (c *RobotstxtClient) Query() *RobotstxtQuery
Create returns a query builder for Robotstxt.
func (*RobotstxtClient) Update ¶
func (c *RobotstxtClient) Update() *RobotstxtUpdate
Update returns an update builder for Robotstxt.
func (*RobotstxtClient) UpdateOne ¶
func (c *RobotstxtClient) UpdateOne(r *Robotstxt) *RobotstxtUpdateOne
UpdateOne returns an update builder for the given entity.
func (*RobotstxtClient) UpdateOneID ¶
func (c *RobotstxtClient) UpdateOneID(id int) *RobotstxtUpdateOne
UpdateOneID returns an update builder for the given id.
func (*RobotstxtClient) Use ¶
func (c *RobotstxtClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `robotstxt.Hooks(f(g(h())))`.
type RobotstxtCreate ¶
type RobotstxtCreate struct {
// contains filtered or unexported fields
}
RobotstxtCreate is the builder for creating a Robotstxt entity.
func (*RobotstxtCreate) Save ¶
func (rc *RobotstxtCreate) Save(ctx context.Context) (*Robotstxt, error)
Save creates the Robotstxt in the database.
func (*RobotstxtCreate) SaveX ¶
func (rc *RobotstxtCreate) SaveX(ctx context.Context) *Robotstxt
SaveX calls Save and panics if Save returns an error.
func (*RobotstxtCreate) SetBody ¶
func (rc *RobotstxtCreate) SetBody(b []byte) *RobotstxtCreate
SetBody sets the body field.
func (*RobotstxtCreate) SetCreatedAt ¶
func (rc *RobotstxtCreate) SetCreatedAt(t time.Time) *RobotstxtCreate
SetCreatedAt sets the created_at field.
func (*RobotstxtCreate) SetHost ¶
func (rc *RobotstxtCreate) SetHost(s string) *RobotstxtCreate
SetHost sets the host field.
func (*RobotstxtCreate) SetNillableCreatedAt ¶
func (rc *RobotstxtCreate) SetNillableCreatedAt(t *time.Time) *RobotstxtCreate
SetNillableCreatedAt sets the created_at field if the given value is not nil.
func (*RobotstxtCreate) SetNillableUpdatedAt ¶
func (rc *RobotstxtCreate) SetNillableUpdatedAt(t *time.Time) *RobotstxtCreate
SetNillableUpdatedAt sets the updated_at field if the given value is not nil.
func (*RobotstxtCreate) SetResponseTime ¶
func (rc *RobotstxtCreate) SetResponseTime(i int64) *RobotstxtCreate
SetResponseTime sets the response_time field.
func (*RobotstxtCreate) SetResponseURL ¶
func (rc *RobotstxtCreate) SetResponseURL(s string) *RobotstxtCreate
SetResponseURL sets the response_url field.
func (*RobotstxtCreate) SetScheme ¶
func (rc *RobotstxtCreate) SetScheme(s string) *RobotstxtCreate
SetScheme sets the scheme field.
func (*RobotstxtCreate) SetStatuscode ¶
func (rc *RobotstxtCreate) SetStatuscode(i int32) *RobotstxtCreate
SetStatuscode sets the statuscode field.
func (*RobotstxtCreate) SetUpdatedAt ¶
func (rc *RobotstxtCreate) SetUpdatedAt(t time.Time) *RobotstxtCreate
SetUpdatedAt sets the updated_at field.
type RobotstxtDelete ¶
type RobotstxtDelete struct {
// contains filtered or unexported fields
}
RobotstxtDelete is the builder for deleting a Robotstxt entity.
func (*RobotstxtDelete) Exec ¶
func (rd *RobotstxtDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*RobotstxtDelete) ExecX ¶
func (rd *RobotstxtDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*RobotstxtDelete) Where ¶
func (rd *RobotstxtDelete) Where(ps ...predicate.Robotstxt) *RobotstxtDelete
Where adds a new predicate to the delete builder.
type RobotstxtDeleteOne ¶
type RobotstxtDeleteOne struct {
// contains filtered or unexported fields
}
RobotstxtDeleteOne is the builder for deleting a single Robotstxt entity.
func (*RobotstxtDeleteOne) Exec ¶
func (rdo *RobotstxtDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*RobotstxtDeleteOne) ExecX ¶
func (rdo *RobotstxtDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type RobotstxtGroupBy ¶
type RobotstxtGroupBy struct {
// contains filtered or unexported fields
}
RobotstxtGroupBy is the builder for group-by Robotstxt entities.
func (*RobotstxtGroupBy) Aggregate ¶
func (rgb *RobotstxtGroupBy) Aggregate(fns ...Aggregate) *RobotstxtGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*RobotstxtGroupBy) Bools ¶
func (rgb *RobotstxtGroupBy) 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 (*RobotstxtGroupBy) BoolsX ¶
func (rgb *RobotstxtGroupBy) BoolsX(ctx context.Context) []bool
BoolsX is like Bools, but panics if an error occurs.
func (*RobotstxtGroupBy) Float64s ¶
func (rgb *RobotstxtGroupBy) 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 (*RobotstxtGroupBy) Float64sX ¶
func (rgb *RobotstxtGroupBy) Float64sX(ctx context.Context) []float64
Float64sX is like Float64s, but panics if an error occurs.
func (*RobotstxtGroupBy) Ints ¶
func (rgb *RobotstxtGroupBy) 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 (*RobotstxtGroupBy) IntsX ¶
func (rgb *RobotstxtGroupBy) IntsX(ctx context.Context) []int
IntsX is like Ints, but panics if an error occurs.
func (*RobotstxtGroupBy) Scan ¶
func (rgb *RobotstxtGroupBy) Scan(ctx context.Context, v interface{}) error
Scan applies the group-by query and scan the result into the given value.
func (*RobotstxtGroupBy) ScanX ¶
func (rgb *RobotstxtGroupBy) ScanX(ctx context.Context, v interface{})
ScanX is like Scan, but panics if an error occurs.
type RobotstxtMutation ¶
type RobotstxtMutation struct {
// contains filtered or unexported fields
}
RobotstxtMutation represents an operation that mutate the Robotstxts nodes in the graph.
func (*RobotstxtMutation) AddField ¶
func (m *RobotstxtMutation) 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 (*RobotstxtMutation) AddResponseTime ¶
func (m *RobotstxtMutation) AddResponseTime(i int64)
AddResponseTime adds i to response_time.
func (*RobotstxtMutation) AddStatuscode ¶
func (m *RobotstxtMutation) AddStatuscode(i int32)
AddStatuscode adds i to statuscode.
func (*RobotstxtMutation) AddedEdges ¶
func (m *RobotstxtMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*RobotstxtMutation) AddedField ¶
func (m *RobotstxtMutation) 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 (*RobotstxtMutation) AddedFields ¶
func (m *RobotstxtMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented or decremented during this mutation.
func (*RobotstxtMutation) AddedIDs ¶
func (m *RobotstxtMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all ids (to other nodes) that were added for the given edge name.
func (*RobotstxtMutation) AddedResponseTime ¶
func (m *RobotstxtMutation) AddedResponseTime() (r int64, exists bool)
AddedResponseTime returns the value that was added to the response_time field in this mutation.
func (*RobotstxtMutation) AddedStatuscode ¶
func (m *RobotstxtMutation) AddedStatuscode() (r int32, exists bool)
AddedStatuscode returns the value that was added to the statuscode field in this mutation.
func (*RobotstxtMutation) Body ¶
func (m *RobotstxtMutation) Body() (r []byte, exists bool)
Body returns the body value in the mutation.
func (*RobotstxtMutation) ClearEdge ¶
func (m *RobotstxtMutation) 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 (*RobotstxtMutation) ClearField ¶
func (m *RobotstxtMutation) 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 (*RobotstxtMutation) ClearedEdges ¶
func (m *RobotstxtMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*RobotstxtMutation) ClearedFields ¶
func (m *RobotstxtMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (RobotstxtMutation) Client ¶
func (m RobotstxtMutation) 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 (*RobotstxtMutation) CreatedAt ¶
func (m *RobotstxtMutation) CreatedAt() (r time.Time, exists bool)
CreatedAt returns the created_at value in the mutation.
func (*RobotstxtMutation) EdgeCleared ¶
func (m *RobotstxtMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean indicates if this edge was cleared in this mutation.
func (*RobotstxtMutation) Field ¶
func (m *RobotstxtMutation) 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 (*RobotstxtMutation) FieldCleared ¶
func (m *RobotstxtMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicates if this field was cleared in this mutation.
func (*RobotstxtMutation) Fields ¶
func (m *RobotstxtMutation) 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 (*RobotstxtMutation) Host ¶
func (m *RobotstxtMutation) Host() (r string, exists bool)
Host returns the host value in the mutation.
func (*RobotstxtMutation) ID ¶
func (m *RobotstxtMutation) 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 (*RobotstxtMutation) RemovedEdges ¶
func (m *RobotstxtMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*RobotstxtMutation) RemovedIDs ¶
func (m *RobotstxtMutation) RemovedIDs(name string) []ent.Value
RemovedIDs returns all ids (to other nodes) that were removed for the given edge name.
func (*RobotstxtMutation) ResetBody ¶
func (m *RobotstxtMutation) ResetBody()
ResetBody reset all changes of the body field.
func (*RobotstxtMutation) ResetCreatedAt ¶
func (m *RobotstxtMutation) ResetCreatedAt()
ResetCreatedAt reset all changes of the created_at field.
func (*RobotstxtMutation) ResetEdge ¶
func (m *RobotstxtMutation) 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 (*RobotstxtMutation) ResetField ¶
func (m *RobotstxtMutation) 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 (*RobotstxtMutation) ResetHost ¶
func (m *RobotstxtMutation) ResetHost()
ResetHost reset all changes of the host field.
func (*RobotstxtMutation) ResetResponseTime ¶
func (m *RobotstxtMutation) ResetResponseTime()
ResetResponseTime reset all changes of the response_time field.
func (*RobotstxtMutation) ResetResponseURL ¶
func (m *RobotstxtMutation) ResetResponseURL()
ResetResponseURL reset all changes of the response_url field.
func (*RobotstxtMutation) ResetScheme ¶
func (m *RobotstxtMutation) ResetScheme()
ResetScheme reset all changes of the scheme field.
func (*RobotstxtMutation) ResetStatuscode ¶
func (m *RobotstxtMutation) ResetStatuscode()
ResetStatuscode reset all changes of the statuscode field.
func (*RobotstxtMutation) ResetUpdatedAt ¶
func (m *RobotstxtMutation) ResetUpdatedAt()
ResetUpdatedAt reset all changes of the updated_at field.
func (*RobotstxtMutation) ResponseTime ¶
func (m *RobotstxtMutation) ResponseTime() (r int64, exists bool)
ResponseTime returns the response_time value in the mutation.
func (*RobotstxtMutation) ResponseURL ¶
func (m *RobotstxtMutation) ResponseURL() (r string, exists bool)
ResponseURL returns the response_url value in the mutation.
func (*RobotstxtMutation) Scheme ¶
func (m *RobotstxtMutation) Scheme() (r string, exists bool)
Scheme returns the scheme value in the mutation.
func (*RobotstxtMutation) SetBody ¶
func (m *RobotstxtMutation) SetBody(b []byte)
SetBody sets the body field.
func (*RobotstxtMutation) SetCreatedAt ¶
func (m *RobotstxtMutation) SetCreatedAt(t time.Time)
SetCreatedAt sets the created_at field.
func (*RobotstxtMutation) SetField ¶
func (m *RobotstxtMutation) 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 (*RobotstxtMutation) SetHost ¶
func (m *RobotstxtMutation) SetHost(s string)
SetHost sets the host field.
func (*RobotstxtMutation) SetResponseTime ¶
func (m *RobotstxtMutation) SetResponseTime(i int64)
SetResponseTime sets the response_time field.
func (*RobotstxtMutation) SetResponseURL ¶
func (m *RobotstxtMutation) SetResponseURL(s string)
SetResponseURL sets the response_url field.
func (*RobotstxtMutation) SetScheme ¶
func (m *RobotstxtMutation) SetScheme(s string)
SetScheme sets the scheme field.
func (*RobotstxtMutation) SetStatuscode ¶
func (m *RobotstxtMutation) SetStatuscode(i int32)
SetStatuscode sets the statuscode field.
func (*RobotstxtMutation) SetUpdatedAt ¶
func (m *RobotstxtMutation) SetUpdatedAt(t time.Time)
SetUpdatedAt sets the updated_at field.
func (*RobotstxtMutation) Statuscode ¶
func (m *RobotstxtMutation) Statuscode() (r int32, exists bool)
Statuscode returns the statuscode value in the mutation.
func (RobotstxtMutation) Tx ¶
func (m RobotstxtMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*RobotstxtMutation) Type ¶
func (m *RobotstxtMutation) Type() string
Type returns the node type of this mutation (Robotstxt).
type RobotstxtQuery ¶
type RobotstxtQuery struct {
// contains filtered or unexported fields
}
RobotstxtQuery is the builder for querying Robotstxt entities.
func (*RobotstxtQuery) All ¶
func (rq *RobotstxtQuery) All(ctx context.Context) ([]*Robotstxt, error)
All executes the query and returns a list of Robotstxts.
func (*RobotstxtQuery) AllX ¶
func (rq *RobotstxtQuery) AllX(ctx context.Context) []*Robotstxt
AllX is like All, but panics if an error occurs.
func (*RobotstxtQuery) Clone ¶
func (rq *RobotstxtQuery) Clone() *RobotstxtQuery
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 (*RobotstxtQuery) Count ¶
func (rq *RobotstxtQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*RobotstxtQuery) CountX ¶
func (rq *RobotstxtQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*RobotstxtQuery) Exist ¶
func (rq *RobotstxtQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*RobotstxtQuery) ExistX ¶
func (rq *RobotstxtQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*RobotstxtQuery) First ¶
func (rq *RobotstxtQuery) First(ctx context.Context) (*Robotstxt, error)
First returns the first Robotstxt entity in the query. Returns *NotFoundError when no robotstxt was found.
func (*RobotstxtQuery) FirstID ¶
func (rq *RobotstxtQuery) FirstID(ctx context.Context) (id int, err error)
FirstID returns the first Robotstxt id in the query. Returns *NotFoundError when no id was found.
func (*RobotstxtQuery) FirstX ¶
func (rq *RobotstxtQuery) FirstX(ctx context.Context) *Robotstxt
FirstX is like First, but panics if an error occurs.
func (*RobotstxtQuery) FirstXID ¶
func (rq *RobotstxtQuery) FirstXID(ctx context.Context) int
FirstXID is like FirstID, but panics if an error occurs.
func (*RobotstxtQuery) GroupBy ¶
func (rq *RobotstxtQuery) GroupBy(field string, fields ...string) *RobotstxtGroupBy
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.Robotstxt.Query(). GroupBy(robotstxt.FieldCreatedAt). Aggregate(ent.Count()). Scan(ctx, &v)
func (*RobotstxtQuery) IDs ¶
func (rq *RobotstxtQuery) IDs(ctx context.Context) ([]int, error)
IDs executes the query and returns a list of Robotstxt ids.
func (*RobotstxtQuery) IDsX ¶
func (rq *RobotstxtQuery) IDsX(ctx context.Context) []int
IDsX is like IDs, but panics if an error occurs.
func (*RobotstxtQuery) Limit ¶
func (rq *RobotstxtQuery) Limit(limit int) *RobotstxtQuery
Limit adds a limit step to the query.
func (*RobotstxtQuery) Offset ¶
func (rq *RobotstxtQuery) Offset(offset int) *RobotstxtQuery
Offset adds an offset step to the query.
func (*RobotstxtQuery) Only ¶
func (rq *RobotstxtQuery) Only(ctx context.Context) (*Robotstxt, error)
Only returns the only Robotstxt entity in the query, returns an error if not exactly one entity was returned.
func (*RobotstxtQuery) OnlyID ¶
func (rq *RobotstxtQuery) OnlyID(ctx context.Context) (id int, err error)
OnlyID returns the only Robotstxt id in the query, returns an error if not exactly one id was returned.
func (*RobotstxtQuery) OnlyX ¶
func (rq *RobotstxtQuery) OnlyX(ctx context.Context) *Robotstxt
OnlyX is like Only, but panics if an error occurs.
func (*RobotstxtQuery) OnlyXID ¶
func (rq *RobotstxtQuery) OnlyXID(ctx context.Context) int
OnlyXID is like OnlyID, but panics if an error occurs.
func (*RobotstxtQuery) Order ¶
func (rq *RobotstxtQuery) Order(o ...Order) *RobotstxtQuery
Order adds an order step to the query.
func (*RobotstxtQuery) Select ¶
func (rq *RobotstxtQuery) Select(field string, fields ...string) *RobotstxtSelect
Select one or more fields from the given query.
Example:
var v []struct { CreatedAt time.Time `json:"created_at,omitempty"` } client.Robotstxt.Query(). Select(robotstxt.FieldCreatedAt). Scan(ctx, &v)
func (*RobotstxtQuery) Where ¶
func (rq *RobotstxtQuery) Where(ps ...predicate.Robotstxt) *RobotstxtQuery
Where adds a new predicate for the builder.
type RobotstxtSelect ¶
type RobotstxtSelect struct {
// contains filtered or unexported fields
}
RobotstxtSelect is the builder for select fields of Robotstxt entities.
func (*RobotstxtSelect) Bools ¶
func (rs *RobotstxtSelect) Bools(ctx context.Context) ([]bool, error)
Bools returns list of bools from selector. It is only allowed when selecting one field.
func (*RobotstxtSelect) BoolsX ¶
func (rs *RobotstxtSelect) BoolsX(ctx context.Context) []bool
BoolsX is like Bools, but panics if an error occurs.
func (*RobotstxtSelect) Float64s ¶
func (rs *RobotstxtSelect) Float64s(ctx context.Context) ([]float64, error)
Float64s returns list of float64s from selector. It is only allowed when selecting one field.
func (*RobotstxtSelect) Float64sX ¶
func (rs *RobotstxtSelect) Float64sX(ctx context.Context) []float64
Float64sX is like Float64s, but panics if an error occurs.
func (*RobotstxtSelect) Ints ¶
func (rs *RobotstxtSelect) Ints(ctx context.Context) ([]int, error)
Ints returns list of ints from selector. It is only allowed when selecting one field.
func (*RobotstxtSelect) IntsX ¶
func (rs *RobotstxtSelect) IntsX(ctx context.Context) []int
IntsX is like Ints, but panics if an error occurs.
func (*RobotstxtSelect) Scan ¶
func (rs *RobotstxtSelect) Scan(ctx context.Context, v interface{}) error
Scan applies the selector query and scan the result into the given value.
func (*RobotstxtSelect) ScanX ¶
func (rs *RobotstxtSelect) ScanX(ctx context.Context, v interface{})
ScanX is like Scan, but panics if an error occurs.
type RobotstxtUpdate ¶
type RobotstxtUpdate struct {
// contains filtered or unexported fields
}
RobotstxtUpdate is the builder for updating Robotstxt entities.
func (*RobotstxtUpdate) AddResponseTime ¶
func (ru *RobotstxtUpdate) AddResponseTime(i int64) *RobotstxtUpdate
AddResponseTime adds i to response_time.
func (*RobotstxtUpdate) AddStatuscode ¶
func (ru *RobotstxtUpdate) AddStatuscode(i int32) *RobotstxtUpdate
AddStatuscode adds i to statuscode.
func (*RobotstxtUpdate) Exec ¶
func (ru *RobotstxtUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*RobotstxtUpdate) ExecX ¶
func (ru *RobotstxtUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*RobotstxtUpdate) Save ¶
func (ru *RobotstxtUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of rows/vertices matched by this operation.
func (*RobotstxtUpdate) SaveX ¶
func (ru *RobotstxtUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*RobotstxtUpdate) SetBody ¶
func (ru *RobotstxtUpdate) SetBody(b []byte) *RobotstxtUpdate
SetBody sets the body field.
func (*RobotstxtUpdate) SetHost ¶
func (ru *RobotstxtUpdate) SetHost(s string) *RobotstxtUpdate
SetHost sets the host field.
func (*RobotstxtUpdate) SetResponseTime ¶
func (ru *RobotstxtUpdate) SetResponseTime(i int64) *RobotstxtUpdate
SetResponseTime sets the response_time field.
func (*RobotstxtUpdate) SetResponseURL ¶
func (ru *RobotstxtUpdate) SetResponseURL(s string) *RobotstxtUpdate
SetResponseURL sets the response_url field.
func (*RobotstxtUpdate) SetScheme ¶
func (ru *RobotstxtUpdate) SetScheme(s string) *RobotstxtUpdate
SetScheme sets the scheme field.
func (*RobotstxtUpdate) SetStatuscode ¶
func (ru *RobotstxtUpdate) SetStatuscode(i int32) *RobotstxtUpdate
SetStatuscode sets the statuscode field.
func (*RobotstxtUpdate) SetUpdatedAt ¶
func (ru *RobotstxtUpdate) SetUpdatedAt(t time.Time) *RobotstxtUpdate
SetUpdatedAt sets the updated_at field.
func (*RobotstxtUpdate) Where ¶
func (ru *RobotstxtUpdate) Where(ps ...predicate.Robotstxt) *RobotstxtUpdate
Where adds a new predicate for the builder.
type RobotstxtUpdateOne ¶
type RobotstxtUpdateOne struct {
// contains filtered or unexported fields
}
RobotstxtUpdateOne is the builder for updating a single Robotstxt entity.
func (*RobotstxtUpdateOne) AddResponseTime ¶
func (ruo *RobotstxtUpdateOne) AddResponseTime(i int64) *RobotstxtUpdateOne
AddResponseTime adds i to response_time.
func (*RobotstxtUpdateOne) AddStatuscode ¶
func (ruo *RobotstxtUpdateOne) AddStatuscode(i int32) *RobotstxtUpdateOne
AddStatuscode adds i to statuscode.
func (*RobotstxtUpdateOne) Exec ¶
func (ruo *RobotstxtUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*RobotstxtUpdateOne) ExecX ¶
func (ruo *RobotstxtUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*RobotstxtUpdateOne) Save ¶
func (ruo *RobotstxtUpdateOne) Save(ctx context.Context) (*Robotstxt, error)
Save executes the query and returns the updated entity.
func (*RobotstxtUpdateOne) SaveX ¶
func (ruo *RobotstxtUpdateOne) SaveX(ctx context.Context) *Robotstxt
SaveX is like Save, but panics if an error occurs.
func (*RobotstxtUpdateOne) SetBody ¶
func (ruo *RobotstxtUpdateOne) SetBody(b []byte) *RobotstxtUpdateOne
SetBody sets the body field.
func (*RobotstxtUpdateOne) SetHost ¶
func (ruo *RobotstxtUpdateOne) SetHost(s string) *RobotstxtUpdateOne
SetHost sets the host field.
func (*RobotstxtUpdateOne) SetResponseTime ¶
func (ruo *RobotstxtUpdateOne) SetResponseTime(i int64) *RobotstxtUpdateOne
SetResponseTime sets the response_time field.
func (*RobotstxtUpdateOne) SetResponseURL ¶
func (ruo *RobotstxtUpdateOne) SetResponseURL(s string) *RobotstxtUpdateOne
SetResponseURL sets the response_url field.
func (*RobotstxtUpdateOne) SetScheme ¶
func (ruo *RobotstxtUpdateOne) SetScheme(s string) *RobotstxtUpdateOne
SetScheme sets the scheme field.
func (*RobotstxtUpdateOne) SetStatuscode ¶
func (ruo *RobotstxtUpdateOne) SetStatuscode(i int32) *RobotstxtUpdateOne
SetStatuscode sets the statuscode field.
func (*RobotstxtUpdateOne) SetUpdatedAt ¶
func (ruo *RobotstxtUpdateOne) SetUpdatedAt(t time.Time) *RobotstxtUpdateOne
SetUpdatedAt sets the updated_at field.
type Tx ¶
type Tx struct { // Robotstxt is the client for interacting with the Robotstxt builders. Robotstxt *RobotstxtClient // contains filtered or unexported fields }
Tx is a transactional client that is created by calling Client.Tx().