ent

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: May 7, 2026 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Overview

Package ent provides generated database code using entgo.io/ent.

Index

Constants

View Source
const (
	// Operation types.
	OpCreate    = ent.OpCreate
	OpDelete    = ent.OpDelete
	OpDeleteOne = ent.OpDeleteOne
	OpUpdate    = ent.OpUpdate
	OpUpdateOne = ent.OpUpdateOne

	// Node types.
	TypeAuditEvent        = "AuditEvent"
	TypeAuditStreamCursor = "AuditStreamCursor"
	TypeEventStreamCursor = "EventStreamCursor"
	TypeSelfAudit         = "SelfAudit"
	TypeSession           = "Session"
)

Variables

View Source
var ErrTxStarted = errors.New("ent: cannot start a transaction within a transaction")

ErrTxStarted is returned when trying to start a new transaction from a transactional client.

Functions

func Asc

func Asc(fields ...string) func(*sql.Selector)

Asc applies the given fields in ASC order.

func Desc

func Desc(fields ...string) func(*sql.Selector)

Desc applies the given fields in DESC order.

func IsConstraintError

func IsConstraintError(err error) bool

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

func IsNotFound

func IsNotFound(err error) bool

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

func IsNotLoaded

func IsNotLoaded(err error) bool

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

func IsNotSingular

func IsNotSingular(err error) bool

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

func IsValidationError

func IsValidationError(err error) bool

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

func MaskNotFound

func MaskNotFound(err error) error

MaskNotFound masks not found error.

func NewContext

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

NewContext returns a new context with the given Client attached.

func NewTxContext

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

NewTxContext returns a new context with the given Tx attached.

Types

type AggregateFunc

type AggregateFunc func(*sql.Selector) string

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

func As

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

GroupBy(field1, field2).
Aggregate(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 AuditEvent

type AuditEvent struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// SessionID holds the value of the "session_id" field.
	SessionID uuid.UUID `json:"session_id,omitempty"`
	// Sequence holds the value of the "sequence" field.
	Sequence int `json:"sequence,omitempty"`
	// Timestamp holds the value of the "timestamp" field.
	Timestamp time.Time `json:"timestamp,omitempty"`
	// DurationMs holds the value of the "duration_ms" field.
	DurationMs *int64 `json:"duration_ms,omitempty"`
	// AgentName holds the value of the "agent_name" field.
	AgentName string `json:"agent_name,omitempty"`
	// AgentVersion holds the value of the "agent_version" field.
	AgentVersion string `json:"agent_version,omitempty"`
	// WorkingDirectory holds the value of the "working_directory" field.
	WorkingDirectory string `json:"working_directory,omitempty"`
	// ActionType holds the value of the "action_type" field.
	ActionType auditevent.ActionType `json:"action_type,omitempty"`
	// ToolName holds the value of the "tool_name" field.
	ToolName string `json:"tool_name,omitempty"`
	// ResultStatus holds the value of the "result_status" field.
	ResultStatus auditevent.ResultStatus `json:"result_status,omitempty"`
	// ErrorMessage holds the value of the "error_message" field.
	ErrorMessage string `json:"error_message,omitempty"`
	// Payload holds the value of the "payload" field.
	Payload map[string]interface{} `json:"payload,omitempty"`
	// DiffContent holds the value of the "diff_content" field.
	DiffContent string `json:"diff_content,omitempty"`
	// RawEvent holds the value of the "raw_event" field.
	RawEvent map[string]interface{} `json:"raw_event,omitempty"`
	// ConversationContext holds the value of the "conversation_context" field.
	ConversationContext string `json:"conversation_context,omitempty"`
	// IsSensitive holds the value of the "is_sensitive" field.
	IsSensitive bool `json:"is_sensitive,omitempty"`
	// ID of the subagent that performed this action (empty for main agent)
	SubagentID string `json:"subagent_id,omitempty"`
	// Type of the subagent (e.g., Explore, Plan, general-purpose)
	SubagentType string `json:"subagent_type,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the AuditEventQuery when eager-loading is set.
	Edges AuditEventEdges `json:"edges"`
	// contains filtered or unexported fields
}

AuditEvent is the model entity for the AuditEvent schema.

func (*AuditEvent) QuerySession

func (_m *AuditEvent) QuerySession() *SessionQuery

QuerySession queries the "session" edge of the AuditEvent entity.

func (*AuditEvent) String

func (_m *AuditEvent) String() string

String implements the fmt.Stringer.

func (*AuditEvent) Unwrap

func (_m *AuditEvent) Unwrap() *AuditEvent

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

func (*AuditEvent) Update

func (_m *AuditEvent) Update() *AuditEventUpdateOne

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

func (*AuditEvent) Value

func (_m *AuditEvent) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the AuditEvent. This includes values selected through modifiers, order, etc.

type AuditEventClient

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

AuditEventClient is a client for the AuditEvent schema.

func NewAuditEventClient

func NewAuditEventClient(c config) *AuditEventClient

NewAuditEventClient returns a client for the AuditEvent from the given config.

func (*AuditEventClient) Create

func (c *AuditEventClient) Create() *AuditEventCreate

Create returns a builder for creating a AuditEvent entity.

func (*AuditEventClient) CreateBulk

func (c *AuditEventClient) CreateBulk(builders ...*AuditEventCreate) *AuditEventCreateBulk

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

func (*AuditEventClient) Delete

func (c *AuditEventClient) Delete() *AuditEventDelete

Delete returns a delete builder for AuditEvent.

func (*AuditEventClient) DeleteOne

func (c *AuditEventClient) DeleteOne(_m *AuditEvent) *AuditEventDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*AuditEventClient) DeleteOneID

func (c *AuditEventClient) DeleteOneID(id uuid.UUID) *AuditEventDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*AuditEventClient) Get

Get returns a AuditEvent entity by its id.

func (*AuditEventClient) GetX

func (c *AuditEventClient) GetX(ctx context.Context, id uuid.UUID) *AuditEvent

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

func (*AuditEventClient) Hooks

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

Hooks returns the client hooks.

func (*AuditEventClient) Intercept

func (c *AuditEventClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `auditevent.Intercept(f(g(h())))`.

func (*AuditEventClient) Interceptors

func (c *AuditEventClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*AuditEventClient) MapCreateBulk

func (c *AuditEventClient) MapCreateBulk(slice any, setFunc func(*AuditEventCreate, int)) *AuditEventCreateBulk

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (*AuditEventClient) Query

func (c *AuditEventClient) Query() *AuditEventQuery

Query returns a query builder for AuditEvent.

func (*AuditEventClient) QuerySession

func (c *AuditEventClient) QuerySession(_m *AuditEvent) *SessionQuery

QuerySession queries the session edge of a AuditEvent.

func (*AuditEventClient) Update

func (c *AuditEventClient) Update() *AuditEventUpdate

Update returns an update builder for AuditEvent.

func (*AuditEventClient) UpdateOne

func (c *AuditEventClient) UpdateOne(_m *AuditEvent) *AuditEventUpdateOne

UpdateOne returns an update builder for the given entity.

func (*AuditEventClient) UpdateOneID

func (c *AuditEventClient) UpdateOneID(id uuid.UUID) *AuditEventUpdateOne

UpdateOneID returns an update builder for the given id.

func (*AuditEventClient) Use

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

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

type AuditEventCreate

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

AuditEventCreate is the builder for creating a AuditEvent entity.

func (*AuditEventCreate) Exec

func (_c *AuditEventCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*AuditEventCreate) ExecX

func (_c *AuditEventCreate) ExecX(ctx context.Context)

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

func (*AuditEventCreate) Mutation

func (_c *AuditEventCreate) Mutation() *AuditEventMutation

Mutation returns the AuditEventMutation object of the builder.

func (*AuditEventCreate) Save

func (_c *AuditEventCreate) Save(ctx context.Context) (*AuditEvent, error)

Save creates the AuditEvent in the database.

func (*AuditEventCreate) SaveX

func (_c *AuditEventCreate) SaveX(ctx context.Context) *AuditEvent

SaveX calls Save and panics if Save returns an error.

func (*AuditEventCreate) SetActionType

SetActionType sets the "action_type" field.

func (*AuditEventCreate) SetAgentName

func (_c *AuditEventCreate) SetAgentName(v string) *AuditEventCreate

SetAgentName sets the "agent_name" field.

func (*AuditEventCreate) SetAgentVersion

func (_c *AuditEventCreate) SetAgentVersion(v string) *AuditEventCreate

SetAgentVersion sets the "agent_version" field.

func (*AuditEventCreate) SetConversationContext

func (_c *AuditEventCreate) SetConversationContext(v string) *AuditEventCreate

SetConversationContext sets the "conversation_context" field.

func (*AuditEventCreate) SetDiffContent

func (_c *AuditEventCreate) SetDiffContent(v string) *AuditEventCreate

SetDiffContent sets the "diff_content" field.

func (*AuditEventCreate) SetDurationMs

func (_c *AuditEventCreate) SetDurationMs(v int64) *AuditEventCreate

SetDurationMs sets the "duration_ms" field.

func (*AuditEventCreate) SetErrorMessage

func (_c *AuditEventCreate) SetErrorMessage(v string) *AuditEventCreate

SetErrorMessage sets the "error_message" field.

func (*AuditEventCreate) SetID

SetID sets the "id" field.

func (*AuditEventCreate) SetIsSensitive

func (_c *AuditEventCreate) SetIsSensitive(v bool) *AuditEventCreate

SetIsSensitive sets the "is_sensitive" field.

func (*AuditEventCreate) SetNillableAgentVersion

func (_c *AuditEventCreate) SetNillableAgentVersion(v *string) *AuditEventCreate

SetNillableAgentVersion sets the "agent_version" field if the given value is not nil.

func (*AuditEventCreate) SetNillableConversationContext

func (_c *AuditEventCreate) SetNillableConversationContext(v *string) *AuditEventCreate

SetNillableConversationContext sets the "conversation_context" field if the given value is not nil.

func (*AuditEventCreate) SetNillableDiffContent

func (_c *AuditEventCreate) SetNillableDiffContent(v *string) *AuditEventCreate

SetNillableDiffContent sets the "diff_content" field if the given value is not nil.

func (*AuditEventCreate) SetNillableDurationMs

func (_c *AuditEventCreate) SetNillableDurationMs(v *int64) *AuditEventCreate

SetNillableDurationMs sets the "duration_ms" field if the given value is not nil.

func (*AuditEventCreate) SetNillableErrorMessage

func (_c *AuditEventCreate) SetNillableErrorMessage(v *string) *AuditEventCreate

SetNillableErrorMessage sets the "error_message" field if the given value is not nil.

func (*AuditEventCreate) SetNillableID

func (_c *AuditEventCreate) SetNillableID(v *uuid.UUID) *AuditEventCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*AuditEventCreate) SetNillableIsSensitive

func (_c *AuditEventCreate) SetNillableIsSensitive(v *bool) *AuditEventCreate

SetNillableIsSensitive sets the "is_sensitive" field if the given value is not nil.

func (*AuditEventCreate) SetNillableResultStatus

func (_c *AuditEventCreate) SetNillableResultStatus(v *auditevent.ResultStatus) *AuditEventCreate

SetNillableResultStatus sets the "result_status" field if the given value is not nil.

func (*AuditEventCreate) SetNillableSubagentID added in v0.7.0

func (_c *AuditEventCreate) SetNillableSubagentID(v *string) *AuditEventCreate

SetNillableSubagentID sets the "subagent_id" field if the given value is not nil.

func (*AuditEventCreate) SetNillableSubagentType added in v0.7.0

func (_c *AuditEventCreate) SetNillableSubagentType(v *string) *AuditEventCreate

SetNillableSubagentType sets the "subagent_type" field if the given value is not nil.

func (*AuditEventCreate) SetNillableTimestamp

func (_c *AuditEventCreate) SetNillableTimestamp(v *time.Time) *AuditEventCreate

SetNillableTimestamp sets the "timestamp" field if the given value is not nil.

func (*AuditEventCreate) SetNillableToolName

func (_c *AuditEventCreate) SetNillableToolName(v *string) *AuditEventCreate

SetNillableToolName sets the "tool_name" field if the given value is not nil.

func (*AuditEventCreate) SetNillableWorkingDirectory

func (_c *AuditEventCreate) SetNillableWorkingDirectory(v *string) *AuditEventCreate

SetNillableWorkingDirectory sets the "working_directory" field if the given value is not nil.

func (*AuditEventCreate) SetPayload

func (_c *AuditEventCreate) SetPayload(v map[string]interface{}) *AuditEventCreate

SetPayload sets the "payload" field.

func (*AuditEventCreate) SetRawEvent

func (_c *AuditEventCreate) SetRawEvent(v map[string]interface{}) *AuditEventCreate

SetRawEvent sets the "raw_event" field.

func (*AuditEventCreate) SetResultStatus

func (_c *AuditEventCreate) SetResultStatus(v auditevent.ResultStatus) *AuditEventCreate

SetResultStatus sets the "result_status" field.

func (*AuditEventCreate) SetSequence

func (_c *AuditEventCreate) SetSequence(v int) *AuditEventCreate

SetSequence sets the "sequence" field.

func (*AuditEventCreate) SetSession

func (_c *AuditEventCreate) SetSession(v *Session) *AuditEventCreate

SetSession sets the "session" edge to the Session entity.

func (*AuditEventCreate) SetSessionID

func (_c *AuditEventCreate) SetSessionID(v uuid.UUID) *AuditEventCreate

SetSessionID sets the "session_id" field.

func (*AuditEventCreate) SetSubagentID added in v0.7.0

func (_c *AuditEventCreate) SetSubagentID(v string) *AuditEventCreate

SetSubagentID sets the "subagent_id" field.

func (*AuditEventCreate) SetSubagentType added in v0.7.0

func (_c *AuditEventCreate) SetSubagentType(v string) *AuditEventCreate

SetSubagentType sets the "subagent_type" field.

func (*AuditEventCreate) SetTimestamp

func (_c *AuditEventCreate) SetTimestamp(v time.Time) *AuditEventCreate

SetTimestamp sets the "timestamp" field.

func (*AuditEventCreate) SetToolName

func (_c *AuditEventCreate) SetToolName(v string) *AuditEventCreate

SetToolName sets the "tool_name" field.

func (*AuditEventCreate) SetWorkingDirectory

func (_c *AuditEventCreate) SetWorkingDirectory(v string) *AuditEventCreate

SetWorkingDirectory sets the "working_directory" field.

type AuditEventCreateBulk

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

AuditEventCreateBulk is the builder for creating many AuditEvent entities in bulk.

func (*AuditEventCreateBulk) Exec

func (_c *AuditEventCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*AuditEventCreateBulk) ExecX

func (_c *AuditEventCreateBulk) ExecX(ctx context.Context)

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

func (*AuditEventCreateBulk) Save

func (_c *AuditEventCreateBulk) Save(ctx context.Context) ([]*AuditEvent, error)

Save creates the AuditEvent entities in the database.

func (*AuditEventCreateBulk) SaveX

func (_c *AuditEventCreateBulk) SaveX(ctx context.Context) []*AuditEvent

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

type AuditEventDelete

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

AuditEventDelete is the builder for deleting a AuditEvent entity.

func (*AuditEventDelete) Exec

func (_d *AuditEventDelete) Exec(ctx context.Context) (int, error)

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

func (*AuditEventDelete) ExecX

func (_d *AuditEventDelete) ExecX(ctx context.Context) int

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

func (*AuditEventDelete) Where

Where appends a list predicates to the AuditEventDelete builder.

type AuditEventDeleteOne

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

AuditEventDeleteOne is the builder for deleting a single AuditEvent entity.

func (*AuditEventDeleteOne) Exec

func (_d *AuditEventDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*AuditEventDeleteOne) ExecX

func (_d *AuditEventDeleteOne) ExecX(ctx context.Context)

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

func (*AuditEventDeleteOne) Where

Where appends a list predicates to the AuditEventDelete builder.

type AuditEventEdges

type AuditEventEdges struct {
	// Session holds the value of the session edge.
	Session *Session `json:"session,omitempty"`
	// contains filtered or unexported fields
}

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

func (AuditEventEdges) SessionOrErr

func (e AuditEventEdges) SessionOrErr() (*Session, error)

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

type AuditEventGroupBy

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

AuditEventGroupBy is the group-by builder for AuditEvent entities.

func (*AuditEventGroupBy) Aggregate

func (_g *AuditEventGroupBy) Aggregate(fns ...AggregateFunc) *AuditEventGroupBy

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

func (*AuditEventGroupBy) Bool

func (s *AuditEventGroupBy) Bool(ctx context.Context) (_ bool, err error)

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

func (*AuditEventGroupBy) BoolX

func (s *AuditEventGroupBy) BoolX(ctx context.Context) bool

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

func (*AuditEventGroupBy) Bools

func (s *AuditEventGroupBy) Bools(ctx context.Context) ([]bool, error)

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

func (*AuditEventGroupBy) BoolsX

func (s *AuditEventGroupBy) BoolsX(ctx context.Context) []bool

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

func (*AuditEventGroupBy) Float64

func (s *AuditEventGroupBy) Float64(ctx context.Context) (_ float64, err error)

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

func (*AuditEventGroupBy) Float64X

func (s *AuditEventGroupBy) Float64X(ctx context.Context) float64

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

func (*AuditEventGroupBy) Float64s

func (s *AuditEventGroupBy) Float64s(ctx context.Context) ([]float64, error)

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

func (*AuditEventGroupBy) Float64sX

func (s *AuditEventGroupBy) Float64sX(ctx context.Context) []float64

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

func (*AuditEventGroupBy) Int

func (s *AuditEventGroupBy) Int(ctx context.Context) (_ int, err error)

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

func (*AuditEventGroupBy) IntX

func (s *AuditEventGroupBy) IntX(ctx context.Context) int

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

func (*AuditEventGroupBy) Ints

func (s *AuditEventGroupBy) Ints(ctx context.Context) ([]int, error)

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

func (*AuditEventGroupBy) IntsX

func (s *AuditEventGroupBy) IntsX(ctx context.Context) []int

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

func (*AuditEventGroupBy) Scan

func (_g *AuditEventGroupBy) Scan(ctx context.Context, v any) error

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

func (*AuditEventGroupBy) ScanX

func (s *AuditEventGroupBy) ScanX(ctx context.Context, v any)

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

func (*AuditEventGroupBy) String

func (s *AuditEventGroupBy) String(ctx context.Context) (_ string, err error)

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

func (*AuditEventGroupBy) StringX

func (s *AuditEventGroupBy) StringX(ctx context.Context) string

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

func (*AuditEventGroupBy) Strings

func (s *AuditEventGroupBy) Strings(ctx context.Context) ([]string, error)

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

func (*AuditEventGroupBy) StringsX

func (s *AuditEventGroupBy) StringsX(ctx context.Context) []string

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

type AuditEventMutation

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

AuditEventMutation represents an operation that mutates the AuditEvent nodes in the graph.

func (*AuditEventMutation) ActionType

func (m *AuditEventMutation) ActionType() (r auditevent.ActionType, exists bool)

ActionType returns the value of the "action_type" field in the mutation.

func (*AuditEventMutation) AddDurationMs

func (m *AuditEventMutation) AddDurationMs(i int64)

AddDurationMs adds i to the "duration_ms" field.

func (*AuditEventMutation) AddField

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

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

func (*AuditEventMutation) AddSequence

func (m *AuditEventMutation) AddSequence(i int)

AddSequence adds i to the "sequence" field.

func (*AuditEventMutation) AddedDurationMs

func (m *AuditEventMutation) AddedDurationMs() (r int64, exists bool)

AddedDurationMs returns the value that was added to the "duration_ms" field in this mutation.

func (*AuditEventMutation) AddedEdges

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

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

func (*AuditEventMutation) AddedField

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

AddedField returns the numeric value that was incremented/decremented on a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*AuditEventMutation) AddedFields

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

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

func (*AuditEventMutation) AddedIDs

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

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

func (*AuditEventMutation) AddedSequence

func (m *AuditEventMutation) AddedSequence() (r int, exists bool)

AddedSequence returns the value that was added to the "sequence" field in this mutation.

func (*AuditEventMutation) AgentName

func (m *AuditEventMutation) AgentName() (r string, exists bool)

AgentName returns the value of the "agent_name" field in the mutation.

func (*AuditEventMutation) AgentVersion

func (m *AuditEventMutation) AgentVersion() (r string, exists bool)

AgentVersion returns the value of the "agent_version" field in the mutation.

func (*AuditEventMutation) AgentVersionCleared

func (m *AuditEventMutation) AgentVersionCleared() bool

AgentVersionCleared returns if the "agent_version" field was cleared in this mutation.

func (*AuditEventMutation) ClearAgentVersion

func (m *AuditEventMutation) ClearAgentVersion()

ClearAgentVersion clears the value of the "agent_version" field.

func (*AuditEventMutation) ClearConversationContext

func (m *AuditEventMutation) ClearConversationContext()

ClearConversationContext clears the value of the "conversation_context" field.

func (*AuditEventMutation) ClearDiffContent

func (m *AuditEventMutation) ClearDiffContent()

ClearDiffContent clears the value of the "diff_content" field.

func (*AuditEventMutation) ClearDurationMs

func (m *AuditEventMutation) ClearDurationMs()

ClearDurationMs clears the value of the "duration_ms" field.

func (*AuditEventMutation) ClearEdge

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

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

func (*AuditEventMutation) ClearErrorMessage

func (m *AuditEventMutation) ClearErrorMessage()

ClearErrorMessage clears the value of the "error_message" field.

func (*AuditEventMutation) ClearField

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

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

func (*AuditEventMutation) ClearPayload

func (m *AuditEventMutation) ClearPayload()

ClearPayload clears the value of the "payload" field.

func (*AuditEventMutation) ClearRawEvent

func (m *AuditEventMutation) ClearRawEvent()

ClearRawEvent clears the value of the "raw_event" field.

func (*AuditEventMutation) ClearSession

func (m *AuditEventMutation) ClearSession()

ClearSession clears the "session" edge to the Session entity.

func (*AuditEventMutation) ClearSubagentID added in v0.7.0

func (m *AuditEventMutation) ClearSubagentID()

ClearSubagentID clears the value of the "subagent_id" field.

func (*AuditEventMutation) ClearSubagentType added in v0.7.0

func (m *AuditEventMutation) ClearSubagentType()

ClearSubagentType clears the value of the "subagent_type" field.

func (*AuditEventMutation) ClearToolName

func (m *AuditEventMutation) ClearToolName()

ClearToolName clears the value of the "tool_name" field.

func (*AuditEventMutation) ClearWorkingDirectory

func (m *AuditEventMutation) ClearWorkingDirectory()

ClearWorkingDirectory clears the value of the "working_directory" field.

func (*AuditEventMutation) ClearedEdges

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

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

func (*AuditEventMutation) ClearedFields

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

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

func (AuditEventMutation) Client

func (m AuditEventMutation) 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 (*AuditEventMutation) ConversationContext

func (m *AuditEventMutation) ConversationContext() (r string, exists bool)

ConversationContext returns the value of the "conversation_context" field in the mutation.

func (*AuditEventMutation) ConversationContextCleared

func (m *AuditEventMutation) ConversationContextCleared() bool

ConversationContextCleared returns if the "conversation_context" field was cleared in this mutation.

func (*AuditEventMutation) DiffContent

func (m *AuditEventMutation) DiffContent() (r string, exists bool)

DiffContent returns the value of the "diff_content" field in the mutation.

func (*AuditEventMutation) DiffContentCleared

func (m *AuditEventMutation) DiffContentCleared() bool

DiffContentCleared returns if the "diff_content" field was cleared in this mutation.

func (*AuditEventMutation) DurationMs

func (m *AuditEventMutation) DurationMs() (r int64, exists bool)

DurationMs returns the value of the "duration_ms" field in the mutation.

func (*AuditEventMutation) DurationMsCleared

func (m *AuditEventMutation) DurationMsCleared() bool

DurationMsCleared returns if the "duration_ms" field was cleared in this mutation.

func (*AuditEventMutation) EdgeCleared

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

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

func (*AuditEventMutation) ErrorMessage

func (m *AuditEventMutation) ErrorMessage() (r string, exists bool)

ErrorMessage returns the value of the "error_message" field in the mutation.

func (*AuditEventMutation) ErrorMessageCleared

func (m *AuditEventMutation) ErrorMessageCleared() bool

ErrorMessageCleared returns if the "error_message" field was cleared in this mutation.

func (*AuditEventMutation) Field

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

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

func (*AuditEventMutation) FieldCleared

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

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

func (*AuditEventMutation) Fields

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

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

func (*AuditEventMutation) ID

func (m *AuditEventMutation) ID() (id uuid.UUID, exists bool)

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

func (*AuditEventMutation) IDs

func (m *AuditEventMutation) IDs(ctx context.Context) ([]uuid.UUID, error)

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

func (*AuditEventMutation) IsSensitive

func (m *AuditEventMutation) IsSensitive() (r bool, exists bool)

IsSensitive returns the value of the "is_sensitive" field in the mutation.

func (*AuditEventMutation) OldActionType

func (m *AuditEventMutation) OldActionType(ctx context.Context) (v auditevent.ActionType, err error)

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

func (*AuditEventMutation) OldAgentName

func (m *AuditEventMutation) OldAgentName(ctx context.Context) (v string, err error)

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

func (*AuditEventMutation) OldAgentVersion

func (m *AuditEventMutation) OldAgentVersion(ctx context.Context) (v string, err error)

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

func (*AuditEventMutation) OldConversationContext

func (m *AuditEventMutation) OldConversationContext(ctx context.Context) (v string, err error)

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

func (*AuditEventMutation) OldDiffContent

func (m *AuditEventMutation) OldDiffContent(ctx context.Context) (v string, err error)

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

func (*AuditEventMutation) OldDurationMs

func (m *AuditEventMutation) OldDurationMs(ctx context.Context) (v *int64, err error)

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

func (*AuditEventMutation) OldErrorMessage

func (m *AuditEventMutation) OldErrorMessage(ctx context.Context) (v string, err error)

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

func (*AuditEventMutation) OldField

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

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

func (*AuditEventMutation) OldIsSensitive

func (m *AuditEventMutation) OldIsSensitive(ctx context.Context) (v bool, err error)

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

func (*AuditEventMutation) OldPayload

func (m *AuditEventMutation) OldPayload(ctx context.Context) (v map[string]interface{}, err error)

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

func (*AuditEventMutation) OldRawEvent

func (m *AuditEventMutation) OldRawEvent(ctx context.Context) (v map[string]interface{}, err error)

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

func (*AuditEventMutation) OldResultStatus

func (m *AuditEventMutation) OldResultStatus(ctx context.Context) (v auditevent.ResultStatus, err error)

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

func (*AuditEventMutation) OldSequence

func (m *AuditEventMutation) OldSequence(ctx context.Context) (v int, err error)

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

func (*AuditEventMutation) OldSessionID

func (m *AuditEventMutation) OldSessionID(ctx context.Context) (v uuid.UUID, err error)

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

func (*AuditEventMutation) OldSubagentID added in v0.7.0

func (m *AuditEventMutation) OldSubagentID(ctx context.Context) (v string, err error)

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

func (*AuditEventMutation) OldSubagentType added in v0.7.0

func (m *AuditEventMutation) OldSubagentType(ctx context.Context) (v string, err error)

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

func (*AuditEventMutation) OldTimestamp

func (m *AuditEventMutation) OldTimestamp(ctx context.Context) (v time.Time, err error)

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

func (*AuditEventMutation) OldToolName

func (m *AuditEventMutation) OldToolName(ctx context.Context) (v string, err error)

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

func (*AuditEventMutation) OldWorkingDirectory

func (m *AuditEventMutation) OldWorkingDirectory(ctx context.Context) (v string, err error)

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

func (*AuditEventMutation) Op

func (m *AuditEventMutation) Op() Op

Op returns the operation name.

func (*AuditEventMutation) Payload

func (m *AuditEventMutation) Payload() (r map[string]interface{}, exists bool)

Payload returns the value of the "payload" field in the mutation.

func (*AuditEventMutation) PayloadCleared

func (m *AuditEventMutation) PayloadCleared() bool

PayloadCleared returns if the "payload" field was cleared in this mutation.

func (*AuditEventMutation) RawEvent

func (m *AuditEventMutation) RawEvent() (r map[string]interface{}, exists bool)

RawEvent returns the value of the "raw_event" field in the mutation.

func (*AuditEventMutation) RawEventCleared

func (m *AuditEventMutation) RawEventCleared() bool

RawEventCleared returns if the "raw_event" field was cleared in this mutation.

func (*AuditEventMutation) RemovedEdges

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

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

func (*AuditEventMutation) RemovedIDs

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

RemovedIDs returns all IDs (to other nodes) that were removed for the edge with the given name in this mutation.

func (*AuditEventMutation) ResetActionType

func (m *AuditEventMutation) ResetActionType()

ResetActionType resets all changes to the "action_type" field.

func (*AuditEventMutation) ResetAgentName

func (m *AuditEventMutation) ResetAgentName()

ResetAgentName resets all changes to the "agent_name" field.

func (*AuditEventMutation) ResetAgentVersion

func (m *AuditEventMutation) ResetAgentVersion()

ResetAgentVersion resets all changes to the "agent_version" field.

func (*AuditEventMutation) ResetConversationContext

func (m *AuditEventMutation) ResetConversationContext()

ResetConversationContext resets all changes to the "conversation_context" field.

func (*AuditEventMutation) ResetDiffContent

func (m *AuditEventMutation) ResetDiffContent()

ResetDiffContent resets all changes to the "diff_content" field.

func (*AuditEventMutation) ResetDurationMs

func (m *AuditEventMutation) ResetDurationMs()

ResetDurationMs resets all changes to the "duration_ms" field.

func (*AuditEventMutation) ResetEdge

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

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

func (*AuditEventMutation) ResetErrorMessage

func (m *AuditEventMutation) ResetErrorMessage()

ResetErrorMessage resets all changes to the "error_message" field.

func (*AuditEventMutation) ResetField

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

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

func (*AuditEventMutation) ResetIsSensitive

func (m *AuditEventMutation) ResetIsSensitive()

ResetIsSensitive resets all changes to the "is_sensitive" field.

func (*AuditEventMutation) ResetPayload

func (m *AuditEventMutation) ResetPayload()

ResetPayload resets all changes to the "payload" field.

func (*AuditEventMutation) ResetRawEvent

func (m *AuditEventMutation) ResetRawEvent()

ResetRawEvent resets all changes to the "raw_event" field.

func (*AuditEventMutation) ResetResultStatus

func (m *AuditEventMutation) ResetResultStatus()

ResetResultStatus resets all changes to the "result_status" field.

func (*AuditEventMutation) ResetSequence

func (m *AuditEventMutation) ResetSequence()

ResetSequence resets all changes to the "sequence" field.

func (*AuditEventMutation) ResetSession

func (m *AuditEventMutation) ResetSession()

ResetSession resets all changes to the "session" edge.

func (*AuditEventMutation) ResetSessionID

func (m *AuditEventMutation) ResetSessionID()

ResetSessionID resets all changes to the "session_id" field.

func (*AuditEventMutation) ResetSubagentID added in v0.7.0

func (m *AuditEventMutation) ResetSubagentID()

ResetSubagentID resets all changes to the "subagent_id" field.

func (*AuditEventMutation) ResetSubagentType added in v0.7.0

func (m *AuditEventMutation) ResetSubagentType()

ResetSubagentType resets all changes to the "subagent_type" field.

func (*AuditEventMutation) ResetTimestamp

func (m *AuditEventMutation) ResetTimestamp()

ResetTimestamp resets all changes to the "timestamp" field.

func (*AuditEventMutation) ResetToolName

func (m *AuditEventMutation) ResetToolName()

ResetToolName resets all changes to the "tool_name" field.

func (*AuditEventMutation) ResetWorkingDirectory

func (m *AuditEventMutation) ResetWorkingDirectory()

ResetWorkingDirectory resets all changes to the "working_directory" field.

func (*AuditEventMutation) ResultStatus

func (m *AuditEventMutation) ResultStatus() (r auditevent.ResultStatus, exists bool)

ResultStatus returns the value of the "result_status" field in the mutation.

func (*AuditEventMutation) Sequence

func (m *AuditEventMutation) Sequence() (r int, exists bool)

Sequence returns the value of the "sequence" field in the mutation.

func (*AuditEventMutation) SessionCleared

func (m *AuditEventMutation) SessionCleared() bool

SessionCleared reports if the "session" edge to the Session entity was cleared.

func (*AuditEventMutation) SessionID

func (m *AuditEventMutation) SessionID() (r uuid.UUID, exists bool)

SessionID returns the value of the "session_id" field in the mutation.

func (*AuditEventMutation) SessionIDs

func (m *AuditEventMutation) SessionIDs() (ids []uuid.UUID)

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

func (*AuditEventMutation) SetActionType

func (m *AuditEventMutation) SetActionType(at auditevent.ActionType)

SetActionType sets the "action_type" field.

func (*AuditEventMutation) SetAgentName

func (m *AuditEventMutation) SetAgentName(s string)

SetAgentName sets the "agent_name" field.

func (*AuditEventMutation) SetAgentVersion

func (m *AuditEventMutation) SetAgentVersion(s string)

SetAgentVersion sets the "agent_version" field.

func (*AuditEventMutation) SetConversationContext

func (m *AuditEventMutation) SetConversationContext(s string)

SetConversationContext sets the "conversation_context" field.

func (*AuditEventMutation) SetDiffContent

func (m *AuditEventMutation) SetDiffContent(s string)

SetDiffContent sets the "diff_content" field.

func (*AuditEventMutation) SetDurationMs

func (m *AuditEventMutation) SetDurationMs(i int64)

SetDurationMs sets the "duration_ms" field.

func (*AuditEventMutation) SetErrorMessage

func (m *AuditEventMutation) SetErrorMessage(s string)

SetErrorMessage sets the "error_message" field.

func (*AuditEventMutation) SetField

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

SetField sets the value of a field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*AuditEventMutation) SetID

func (m *AuditEventMutation) SetID(id uuid.UUID)

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

func (*AuditEventMutation) SetIsSensitive

func (m *AuditEventMutation) SetIsSensitive(b bool)

SetIsSensitive sets the "is_sensitive" field.

func (*AuditEventMutation) SetOp

func (m *AuditEventMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*AuditEventMutation) SetPayload

func (m *AuditEventMutation) SetPayload(value map[string]interface{})

SetPayload sets the "payload" field.

func (*AuditEventMutation) SetRawEvent

func (m *AuditEventMutation) SetRawEvent(value map[string]interface{})

SetRawEvent sets the "raw_event" field.

func (*AuditEventMutation) SetResultStatus

func (m *AuditEventMutation) SetResultStatus(as auditevent.ResultStatus)

SetResultStatus sets the "result_status" field.

func (*AuditEventMutation) SetSequence

func (m *AuditEventMutation) SetSequence(i int)

SetSequence sets the "sequence" field.

func (*AuditEventMutation) SetSessionID

func (m *AuditEventMutation) SetSessionID(u uuid.UUID)

SetSessionID sets the "session_id" field.

func (*AuditEventMutation) SetSubagentID added in v0.7.0

func (m *AuditEventMutation) SetSubagentID(s string)

SetSubagentID sets the "subagent_id" field.

func (*AuditEventMutation) SetSubagentType added in v0.7.0

func (m *AuditEventMutation) SetSubagentType(s string)

SetSubagentType sets the "subagent_type" field.

func (*AuditEventMutation) SetTimestamp

func (m *AuditEventMutation) SetTimestamp(t time.Time)

SetTimestamp sets the "timestamp" field.

func (*AuditEventMutation) SetToolName

func (m *AuditEventMutation) SetToolName(s string)

SetToolName sets the "tool_name" field.

func (*AuditEventMutation) SetWorkingDirectory

func (m *AuditEventMutation) SetWorkingDirectory(s string)

SetWorkingDirectory sets the "working_directory" field.

func (*AuditEventMutation) SubagentID added in v0.7.0

func (m *AuditEventMutation) SubagentID() (r string, exists bool)

SubagentID returns the value of the "subagent_id" field in the mutation.

func (*AuditEventMutation) SubagentIDCleared added in v0.7.0

func (m *AuditEventMutation) SubagentIDCleared() bool

SubagentIDCleared returns if the "subagent_id" field was cleared in this mutation.

func (*AuditEventMutation) SubagentType added in v0.7.0

func (m *AuditEventMutation) SubagentType() (r string, exists bool)

SubagentType returns the value of the "subagent_type" field in the mutation.

func (*AuditEventMutation) SubagentTypeCleared added in v0.7.0

func (m *AuditEventMutation) SubagentTypeCleared() bool

SubagentTypeCleared returns if the "subagent_type" field was cleared in this mutation.

func (*AuditEventMutation) Timestamp

func (m *AuditEventMutation) Timestamp() (r time.Time, exists bool)

Timestamp returns the value of the "timestamp" field in the mutation.

func (*AuditEventMutation) ToolName

func (m *AuditEventMutation) ToolName() (r string, exists bool)

ToolName returns the value of the "tool_name" field in the mutation.

func (*AuditEventMutation) ToolNameCleared

func (m *AuditEventMutation) ToolNameCleared() bool

ToolNameCleared returns if the "tool_name" field was cleared in this mutation.

func (AuditEventMutation) Tx

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

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

func (*AuditEventMutation) Type

func (m *AuditEventMutation) Type() string

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

func (*AuditEventMutation) Where

func (m *AuditEventMutation) Where(ps ...predicate.AuditEvent)

Where appends a list predicates to the AuditEventMutation builder.

func (*AuditEventMutation) WhereP

func (m *AuditEventMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the AuditEventMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

func (*AuditEventMutation) WorkingDirectory

func (m *AuditEventMutation) WorkingDirectory() (r string, exists bool)

WorkingDirectory returns the value of the "working_directory" field in the mutation.

func (*AuditEventMutation) WorkingDirectoryCleared

func (m *AuditEventMutation) WorkingDirectoryCleared() bool

WorkingDirectoryCleared returns if the "working_directory" field was cleared in this mutation.

type AuditEventQuery

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

AuditEventQuery is the builder for querying AuditEvent entities.

func (*AuditEventQuery) Aggregate

func (_q *AuditEventQuery) Aggregate(fns ...AggregateFunc) *AuditEventSelect

Aggregate returns a AuditEventSelect configured with the given aggregations.

func (*AuditEventQuery) All

func (_q *AuditEventQuery) All(ctx context.Context) ([]*AuditEvent, error)

All executes the query and returns a list of AuditEvents.

func (*AuditEventQuery) AllX

func (_q *AuditEventQuery) AllX(ctx context.Context) []*AuditEvent

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

func (*AuditEventQuery) Clone

func (_q *AuditEventQuery) Clone() *AuditEventQuery

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

func (*AuditEventQuery) Count

func (_q *AuditEventQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*AuditEventQuery) CountX

func (_q *AuditEventQuery) CountX(ctx context.Context) int

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

func (*AuditEventQuery) Exist

func (_q *AuditEventQuery) Exist(ctx context.Context) (bool, error)

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

func (*AuditEventQuery) ExistX

func (_q *AuditEventQuery) ExistX(ctx context.Context) bool

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

func (*AuditEventQuery) First

func (_q *AuditEventQuery) First(ctx context.Context) (*AuditEvent, error)

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

func (*AuditEventQuery) FirstID

func (_q *AuditEventQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

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

func (*AuditEventQuery) FirstIDX

func (_q *AuditEventQuery) FirstIDX(ctx context.Context) uuid.UUID

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

func (*AuditEventQuery) FirstX

func (_q *AuditEventQuery) FirstX(ctx context.Context) *AuditEvent

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

func (*AuditEventQuery) GroupBy

func (_q *AuditEventQuery) GroupBy(field string, fields ...string) *AuditEventGroupBy

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

Example:

var v []struct {
	SessionID uuid.UUID `json:"session_id,omitempty"`
	Count int `json:"count,omitempty"`
}

client.AuditEvent.Query().
	GroupBy(auditevent.FieldSessionID).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*AuditEventQuery) IDs

func (_q *AuditEventQuery) IDs(ctx context.Context) (ids []uuid.UUID, err error)

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

func (*AuditEventQuery) IDsX

func (_q *AuditEventQuery) IDsX(ctx context.Context) []uuid.UUID

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

func (*AuditEventQuery) Limit

func (_q *AuditEventQuery) Limit(limit int) *AuditEventQuery

Limit the number of records to be returned by this query.

func (*AuditEventQuery) Offset

func (_q *AuditEventQuery) Offset(offset int) *AuditEventQuery

Offset to start from.

func (*AuditEventQuery) Only

func (_q *AuditEventQuery) Only(ctx context.Context) (*AuditEvent, error)

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

func (*AuditEventQuery) OnlyID

func (_q *AuditEventQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

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

func (*AuditEventQuery) OnlyIDX

func (_q *AuditEventQuery) OnlyIDX(ctx context.Context) uuid.UUID

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

func (*AuditEventQuery) OnlyX

func (_q *AuditEventQuery) OnlyX(ctx context.Context) *AuditEvent

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

func (*AuditEventQuery) Order

Order specifies how the records should be ordered.

func (*AuditEventQuery) QuerySession

func (_q *AuditEventQuery) QuerySession() *SessionQuery

QuerySession chains the current query on the "session" edge.

func (*AuditEventQuery) Select

func (_q *AuditEventQuery) Select(fields ...string) *AuditEventSelect

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

Example:

var v []struct {
	SessionID uuid.UUID `json:"session_id,omitempty"`
}

client.AuditEvent.Query().
	Select(auditevent.FieldSessionID).
	Scan(ctx, &v)

func (*AuditEventQuery) Unique

func (_q *AuditEventQuery) Unique(unique bool) *AuditEventQuery

Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.

func (*AuditEventQuery) Where

Where adds a new predicate for the AuditEventQuery builder.

func (*AuditEventQuery) WithSession

func (_q *AuditEventQuery) WithSession(opts ...func(*SessionQuery)) *AuditEventQuery

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

type AuditEventSelect

type AuditEventSelect struct {
	*AuditEventQuery
	// contains filtered or unexported fields
}

AuditEventSelect is the builder for selecting fields of AuditEvent entities.

func (*AuditEventSelect) Aggregate

func (_s *AuditEventSelect) Aggregate(fns ...AggregateFunc) *AuditEventSelect

Aggregate adds the given aggregation functions to the selector query.

func (*AuditEventSelect) Bool

func (s *AuditEventSelect) Bool(ctx context.Context) (_ bool, err error)

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

func (*AuditEventSelect) BoolX

func (s *AuditEventSelect) BoolX(ctx context.Context) bool

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

func (*AuditEventSelect) Bools

func (s *AuditEventSelect) Bools(ctx context.Context) ([]bool, error)

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

func (*AuditEventSelect) BoolsX

func (s *AuditEventSelect) BoolsX(ctx context.Context) []bool

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

func (*AuditEventSelect) Float64

func (s *AuditEventSelect) Float64(ctx context.Context) (_ float64, err error)

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

func (*AuditEventSelect) Float64X

func (s *AuditEventSelect) Float64X(ctx context.Context) float64

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

func (*AuditEventSelect) Float64s

func (s *AuditEventSelect) Float64s(ctx context.Context) ([]float64, error)

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

func (*AuditEventSelect) Float64sX

func (s *AuditEventSelect) Float64sX(ctx context.Context) []float64

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

func (*AuditEventSelect) Int

func (s *AuditEventSelect) Int(ctx context.Context) (_ int, err error)

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

func (*AuditEventSelect) IntX

func (s *AuditEventSelect) IntX(ctx context.Context) int

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

func (*AuditEventSelect) Ints

func (s *AuditEventSelect) Ints(ctx context.Context) ([]int, error)

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

func (*AuditEventSelect) IntsX

func (s *AuditEventSelect) IntsX(ctx context.Context) []int

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

func (*AuditEventSelect) Scan

func (_s *AuditEventSelect) Scan(ctx context.Context, v any) error

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

func (*AuditEventSelect) ScanX

func (s *AuditEventSelect) ScanX(ctx context.Context, v any)

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

func (*AuditEventSelect) String

func (s *AuditEventSelect) String(ctx context.Context) (_ string, err error)

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

func (*AuditEventSelect) StringX

func (s *AuditEventSelect) StringX(ctx context.Context) string

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

func (*AuditEventSelect) Strings

func (s *AuditEventSelect) Strings(ctx context.Context) ([]string, error)

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

func (*AuditEventSelect) StringsX

func (s *AuditEventSelect) StringsX(ctx context.Context) []string

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

type AuditEventUpdate

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

AuditEventUpdate is the builder for updating AuditEvent entities.

func (*AuditEventUpdate) AddDurationMs

func (_u *AuditEventUpdate) AddDurationMs(v int64) *AuditEventUpdate

AddDurationMs adds value to the "duration_ms" field.

func (*AuditEventUpdate) AddSequence

func (_u *AuditEventUpdate) AddSequence(v int) *AuditEventUpdate

AddSequence adds value to the "sequence" field.

func (*AuditEventUpdate) ClearAgentVersion

func (_u *AuditEventUpdate) ClearAgentVersion() *AuditEventUpdate

ClearAgentVersion clears the value of the "agent_version" field.

func (*AuditEventUpdate) ClearConversationContext

func (_u *AuditEventUpdate) ClearConversationContext() *AuditEventUpdate

ClearConversationContext clears the value of the "conversation_context" field.

func (*AuditEventUpdate) ClearDiffContent

func (_u *AuditEventUpdate) ClearDiffContent() *AuditEventUpdate

ClearDiffContent clears the value of the "diff_content" field.

func (*AuditEventUpdate) ClearDurationMs

func (_u *AuditEventUpdate) ClearDurationMs() *AuditEventUpdate

ClearDurationMs clears the value of the "duration_ms" field.

func (*AuditEventUpdate) ClearErrorMessage

func (_u *AuditEventUpdate) ClearErrorMessage() *AuditEventUpdate

ClearErrorMessage clears the value of the "error_message" field.

func (*AuditEventUpdate) ClearPayload

func (_u *AuditEventUpdate) ClearPayload() *AuditEventUpdate

ClearPayload clears the value of the "payload" field.

func (*AuditEventUpdate) ClearRawEvent

func (_u *AuditEventUpdate) ClearRawEvent() *AuditEventUpdate

ClearRawEvent clears the value of the "raw_event" field.

func (*AuditEventUpdate) ClearSession

func (_u *AuditEventUpdate) ClearSession() *AuditEventUpdate

ClearSession clears the "session" edge to the Session entity.

func (*AuditEventUpdate) ClearSubagentID added in v0.7.0

func (_u *AuditEventUpdate) ClearSubagentID() *AuditEventUpdate

ClearSubagentID clears the value of the "subagent_id" field.

func (*AuditEventUpdate) ClearSubagentType added in v0.7.0

func (_u *AuditEventUpdate) ClearSubagentType() *AuditEventUpdate

ClearSubagentType clears the value of the "subagent_type" field.

func (*AuditEventUpdate) ClearToolName

func (_u *AuditEventUpdate) ClearToolName() *AuditEventUpdate

ClearToolName clears the value of the "tool_name" field.

func (*AuditEventUpdate) ClearWorkingDirectory

func (_u *AuditEventUpdate) ClearWorkingDirectory() *AuditEventUpdate

ClearWorkingDirectory clears the value of the "working_directory" field.

func (*AuditEventUpdate) Exec

func (_u *AuditEventUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*AuditEventUpdate) ExecX

func (_u *AuditEventUpdate) ExecX(ctx context.Context)

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

func (*AuditEventUpdate) Mutation

func (_u *AuditEventUpdate) Mutation() *AuditEventMutation

Mutation returns the AuditEventMutation object of the builder.

func (*AuditEventUpdate) Save

func (_u *AuditEventUpdate) Save(ctx context.Context) (int, error)

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

func (*AuditEventUpdate) SaveX

func (_u *AuditEventUpdate) SaveX(ctx context.Context) int

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

func (*AuditEventUpdate) SetActionType

SetActionType sets the "action_type" field.

func (*AuditEventUpdate) SetAgentName

func (_u *AuditEventUpdate) SetAgentName(v string) *AuditEventUpdate

SetAgentName sets the "agent_name" field.

func (*AuditEventUpdate) SetAgentVersion

func (_u *AuditEventUpdate) SetAgentVersion(v string) *AuditEventUpdate

SetAgentVersion sets the "agent_version" field.

func (*AuditEventUpdate) SetConversationContext

func (_u *AuditEventUpdate) SetConversationContext(v string) *AuditEventUpdate

SetConversationContext sets the "conversation_context" field.

func (*AuditEventUpdate) SetDiffContent

func (_u *AuditEventUpdate) SetDiffContent(v string) *AuditEventUpdate

SetDiffContent sets the "diff_content" field.

func (*AuditEventUpdate) SetDurationMs

func (_u *AuditEventUpdate) SetDurationMs(v int64) *AuditEventUpdate

SetDurationMs sets the "duration_ms" field.

func (*AuditEventUpdate) SetErrorMessage

func (_u *AuditEventUpdate) SetErrorMessage(v string) *AuditEventUpdate

SetErrorMessage sets the "error_message" field.

func (*AuditEventUpdate) SetIsSensitive

func (_u *AuditEventUpdate) SetIsSensitive(v bool) *AuditEventUpdate

SetIsSensitive sets the "is_sensitive" field.

func (*AuditEventUpdate) SetNillableActionType

func (_u *AuditEventUpdate) SetNillableActionType(v *auditevent.ActionType) *AuditEventUpdate

SetNillableActionType sets the "action_type" field if the given value is not nil.

func (*AuditEventUpdate) SetNillableAgentName

func (_u *AuditEventUpdate) SetNillableAgentName(v *string) *AuditEventUpdate

SetNillableAgentName sets the "agent_name" field if the given value is not nil.

func (*AuditEventUpdate) SetNillableAgentVersion

func (_u *AuditEventUpdate) SetNillableAgentVersion(v *string) *AuditEventUpdate

SetNillableAgentVersion sets the "agent_version" field if the given value is not nil.

func (*AuditEventUpdate) SetNillableConversationContext

func (_u *AuditEventUpdate) SetNillableConversationContext(v *string) *AuditEventUpdate

SetNillableConversationContext sets the "conversation_context" field if the given value is not nil.

func (*AuditEventUpdate) SetNillableDiffContent

func (_u *AuditEventUpdate) SetNillableDiffContent(v *string) *AuditEventUpdate

SetNillableDiffContent sets the "diff_content" field if the given value is not nil.

func (*AuditEventUpdate) SetNillableDurationMs

func (_u *AuditEventUpdate) SetNillableDurationMs(v *int64) *AuditEventUpdate

SetNillableDurationMs sets the "duration_ms" field if the given value is not nil.

func (*AuditEventUpdate) SetNillableErrorMessage

func (_u *AuditEventUpdate) SetNillableErrorMessage(v *string) *AuditEventUpdate

SetNillableErrorMessage sets the "error_message" field if the given value is not nil.

func (*AuditEventUpdate) SetNillableIsSensitive

func (_u *AuditEventUpdate) SetNillableIsSensitive(v *bool) *AuditEventUpdate

SetNillableIsSensitive sets the "is_sensitive" field if the given value is not nil.

func (*AuditEventUpdate) SetNillableResultStatus

func (_u *AuditEventUpdate) SetNillableResultStatus(v *auditevent.ResultStatus) *AuditEventUpdate

SetNillableResultStatus sets the "result_status" field if the given value is not nil.

func (*AuditEventUpdate) SetNillableSequence

func (_u *AuditEventUpdate) SetNillableSequence(v *int) *AuditEventUpdate

SetNillableSequence sets the "sequence" field if the given value is not nil.

func (*AuditEventUpdate) SetNillableSessionID

func (_u *AuditEventUpdate) SetNillableSessionID(v *uuid.UUID) *AuditEventUpdate

SetNillableSessionID sets the "session_id" field if the given value is not nil.

func (*AuditEventUpdate) SetNillableSubagentID added in v0.7.0

func (_u *AuditEventUpdate) SetNillableSubagentID(v *string) *AuditEventUpdate

SetNillableSubagentID sets the "subagent_id" field if the given value is not nil.

func (*AuditEventUpdate) SetNillableSubagentType added in v0.7.0

func (_u *AuditEventUpdate) SetNillableSubagentType(v *string) *AuditEventUpdate

SetNillableSubagentType sets the "subagent_type" field if the given value is not nil.

func (*AuditEventUpdate) SetNillableToolName

func (_u *AuditEventUpdate) SetNillableToolName(v *string) *AuditEventUpdate

SetNillableToolName sets the "tool_name" field if the given value is not nil.

func (*AuditEventUpdate) SetNillableWorkingDirectory

func (_u *AuditEventUpdate) SetNillableWorkingDirectory(v *string) *AuditEventUpdate

SetNillableWorkingDirectory sets the "working_directory" field if the given value is not nil.

func (*AuditEventUpdate) SetPayload

func (_u *AuditEventUpdate) SetPayload(v map[string]interface{}) *AuditEventUpdate

SetPayload sets the "payload" field.

func (*AuditEventUpdate) SetRawEvent

func (_u *AuditEventUpdate) SetRawEvent(v map[string]interface{}) *AuditEventUpdate

SetRawEvent sets the "raw_event" field.

func (*AuditEventUpdate) SetResultStatus

func (_u *AuditEventUpdate) SetResultStatus(v auditevent.ResultStatus) *AuditEventUpdate

SetResultStatus sets the "result_status" field.

func (*AuditEventUpdate) SetSequence

func (_u *AuditEventUpdate) SetSequence(v int) *AuditEventUpdate

SetSequence sets the "sequence" field.

func (*AuditEventUpdate) SetSession

func (_u *AuditEventUpdate) SetSession(v *Session) *AuditEventUpdate

SetSession sets the "session" edge to the Session entity.

func (*AuditEventUpdate) SetSessionID

func (_u *AuditEventUpdate) SetSessionID(v uuid.UUID) *AuditEventUpdate

SetSessionID sets the "session_id" field.

func (*AuditEventUpdate) SetSubagentID added in v0.7.0

func (_u *AuditEventUpdate) SetSubagentID(v string) *AuditEventUpdate

SetSubagentID sets the "subagent_id" field.

func (*AuditEventUpdate) SetSubagentType added in v0.7.0

func (_u *AuditEventUpdate) SetSubagentType(v string) *AuditEventUpdate

SetSubagentType sets the "subagent_type" field.

func (*AuditEventUpdate) SetToolName

func (_u *AuditEventUpdate) SetToolName(v string) *AuditEventUpdate

SetToolName sets the "tool_name" field.

func (*AuditEventUpdate) SetWorkingDirectory

func (_u *AuditEventUpdate) SetWorkingDirectory(v string) *AuditEventUpdate

SetWorkingDirectory sets the "working_directory" field.

func (*AuditEventUpdate) Where

Where appends a list predicates to the AuditEventUpdate builder.

type AuditEventUpdateOne

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

AuditEventUpdateOne is the builder for updating a single AuditEvent entity.

func (*AuditEventUpdateOne) AddDurationMs

func (_u *AuditEventUpdateOne) AddDurationMs(v int64) *AuditEventUpdateOne

AddDurationMs adds value to the "duration_ms" field.

func (*AuditEventUpdateOne) AddSequence

func (_u *AuditEventUpdateOne) AddSequence(v int) *AuditEventUpdateOne

AddSequence adds value to the "sequence" field.

func (*AuditEventUpdateOne) ClearAgentVersion

func (_u *AuditEventUpdateOne) ClearAgentVersion() *AuditEventUpdateOne

ClearAgentVersion clears the value of the "agent_version" field.

func (*AuditEventUpdateOne) ClearConversationContext

func (_u *AuditEventUpdateOne) ClearConversationContext() *AuditEventUpdateOne

ClearConversationContext clears the value of the "conversation_context" field.

func (*AuditEventUpdateOne) ClearDiffContent

func (_u *AuditEventUpdateOne) ClearDiffContent() *AuditEventUpdateOne

ClearDiffContent clears the value of the "diff_content" field.

func (*AuditEventUpdateOne) ClearDurationMs

func (_u *AuditEventUpdateOne) ClearDurationMs() *AuditEventUpdateOne

ClearDurationMs clears the value of the "duration_ms" field.

func (*AuditEventUpdateOne) ClearErrorMessage

func (_u *AuditEventUpdateOne) ClearErrorMessage() *AuditEventUpdateOne

ClearErrorMessage clears the value of the "error_message" field.

func (*AuditEventUpdateOne) ClearPayload

func (_u *AuditEventUpdateOne) ClearPayload() *AuditEventUpdateOne

ClearPayload clears the value of the "payload" field.

func (*AuditEventUpdateOne) ClearRawEvent

func (_u *AuditEventUpdateOne) ClearRawEvent() *AuditEventUpdateOne

ClearRawEvent clears the value of the "raw_event" field.

func (*AuditEventUpdateOne) ClearSession

func (_u *AuditEventUpdateOne) ClearSession() *AuditEventUpdateOne

ClearSession clears the "session" edge to the Session entity.

func (*AuditEventUpdateOne) ClearSubagentID added in v0.7.0

func (_u *AuditEventUpdateOne) ClearSubagentID() *AuditEventUpdateOne

ClearSubagentID clears the value of the "subagent_id" field.

func (*AuditEventUpdateOne) ClearSubagentType added in v0.7.0

func (_u *AuditEventUpdateOne) ClearSubagentType() *AuditEventUpdateOne

ClearSubagentType clears the value of the "subagent_type" field.

func (*AuditEventUpdateOne) ClearToolName

func (_u *AuditEventUpdateOne) ClearToolName() *AuditEventUpdateOne

ClearToolName clears the value of the "tool_name" field.

func (*AuditEventUpdateOne) ClearWorkingDirectory

func (_u *AuditEventUpdateOne) ClearWorkingDirectory() *AuditEventUpdateOne

ClearWorkingDirectory clears the value of the "working_directory" field.

func (*AuditEventUpdateOne) Exec

func (_u *AuditEventUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*AuditEventUpdateOne) ExecX

func (_u *AuditEventUpdateOne) ExecX(ctx context.Context)

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

func (*AuditEventUpdateOne) Mutation

func (_u *AuditEventUpdateOne) Mutation() *AuditEventMutation

Mutation returns the AuditEventMutation object of the builder.

func (*AuditEventUpdateOne) Save

Save executes the query and returns the updated AuditEvent entity.

func (*AuditEventUpdateOne) SaveX

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

func (*AuditEventUpdateOne) Select

func (_u *AuditEventUpdateOne) Select(field string, fields ...string) *AuditEventUpdateOne

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

func (*AuditEventUpdateOne) SetActionType

SetActionType sets the "action_type" field.

func (*AuditEventUpdateOne) SetAgentName

func (_u *AuditEventUpdateOne) SetAgentName(v string) *AuditEventUpdateOne

SetAgentName sets the "agent_name" field.

func (*AuditEventUpdateOne) SetAgentVersion

func (_u *AuditEventUpdateOne) SetAgentVersion(v string) *AuditEventUpdateOne

SetAgentVersion sets the "agent_version" field.

func (*AuditEventUpdateOne) SetConversationContext

func (_u *AuditEventUpdateOne) SetConversationContext(v string) *AuditEventUpdateOne

SetConversationContext sets the "conversation_context" field.

func (*AuditEventUpdateOne) SetDiffContent

func (_u *AuditEventUpdateOne) SetDiffContent(v string) *AuditEventUpdateOne

SetDiffContent sets the "diff_content" field.

func (*AuditEventUpdateOne) SetDurationMs

func (_u *AuditEventUpdateOne) SetDurationMs(v int64) *AuditEventUpdateOne

SetDurationMs sets the "duration_ms" field.

func (*AuditEventUpdateOne) SetErrorMessage

func (_u *AuditEventUpdateOne) SetErrorMessage(v string) *AuditEventUpdateOne

SetErrorMessage sets the "error_message" field.

func (*AuditEventUpdateOne) SetIsSensitive

func (_u *AuditEventUpdateOne) SetIsSensitive(v bool) *AuditEventUpdateOne

SetIsSensitive sets the "is_sensitive" field.

func (*AuditEventUpdateOne) SetNillableActionType

func (_u *AuditEventUpdateOne) SetNillableActionType(v *auditevent.ActionType) *AuditEventUpdateOne

SetNillableActionType sets the "action_type" field if the given value is not nil.

func (*AuditEventUpdateOne) SetNillableAgentName

func (_u *AuditEventUpdateOne) SetNillableAgentName(v *string) *AuditEventUpdateOne

SetNillableAgentName sets the "agent_name" field if the given value is not nil.

func (*AuditEventUpdateOne) SetNillableAgentVersion

func (_u *AuditEventUpdateOne) SetNillableAgentVersion(v *string) *AuditEventUpdateOne

SetNillableAgentVersion sets the "agent_version" field if the given value is not nil.

func (*AuditEventUpdateOne) SetNillableConversationContext

func (_u *AuditEventUpdateOne) SetNillableConversationContext(v *string) *AuditEventUpdateOne

SetNillableConversationContext sets the "conversation_context" field if the given value is not nil.

func (*AuditEventUpdateOne) SetNillableDiffContent

func (_u *AuditEventUpdateOne) SetNillableDiffContent(v *string) *AuditEventUpdateOne

SetNillableDiffContent sets the "diff_content" field if the given value is not nil.

func (*AuditEventUpdateOne) SetNillableDurationMs

func (_u *AuditEventUpdateOne) SetNillableDurationMs(v *int64) *AuditEventUpdateOne

SetNillableDurationMs sets the "duration_ms" field if the given value is not nil.

func (*AuditEventUpdateOne) SetNillableErrorMessage

func (_u *AuditEventUpdateOne) SetNillableErrorMessage(v *string) *AuditEventUpdateOne

SetNillableErrorMessage sets the "error_message" field if the given value is not nil.

func (*AuditEventUpdateOne) SetNillableIsSensitive

func (_u *AuditEventUpdateOne) SetNillableIsSensitive(v *bool) *AuditEventUpdateOne

SetNillableIsSensitive sets the "is_sensitive" field if the given value is not nil.

func (*AuditEventUpdateOne) SetNillableResultStatus

func (_u *AuditEventUpdateOne) SetNillableResultStatus(v *auditevent.ResultStatus) *AuditEventUpdateOne

SetNillableResultStatus sets the "result_status" field if the given value is not nil.

func (*AuditEventUpdateOne) SetNillableSequence

func (_u *AuditEventUpdateOne) SetNillableSequence(v *int) *AuditEventUpdateOne

SetNillableSequence sets the "sequence" field if the given value is not nil.

func (*AuditEventUpdateOne) SetNillableSessionID

func (_u *AuditEventUpdateOne) SetNillableSessionID(v *uuid.UUID) *AuditEventUpdateOne

SetNillableSessionID sets the "session_id" field if the given value is not nil.

func (*AuditEventUpdateOne) SetNillableSubagentID added in v0.7.0

func (_u *AuditEventUpdateOne) SetNillableSubagentID(v *string) *AuditEventUpdateOne

SetNillableSubagentID sets the "subagent_id" field if the given value is not nil.

func (*AuditEventUpdateOne) SetNillableSubagentType added in v0.7.0

func (_u *AuditEventUpdateOne) SetNillableSubagentType(v *string) *AuditEventUpdateOne

SetNillableSubagentType sets the "subagent_type" field if the given value is not nil.

func (*AuditEventUpdateOne) SetNillableToolName

func (_u *AuditEventUpdateOne) SetNillableToolName(v *string) *AuditEventUpdateOne

SetNillableToolName sets the "tool_name" field if the given value is not nil.

func (*AuditEventUpdateOne) SetNillableWorkingDirectory

func (_u *AuditEventUpdateOne) SetNillableWorkingDirectory(v *string) *AuditEventUpdateOne

SetNillableWorkingDirectory sets the "working_directory" field if the given value is not nil.

func (*AuditEventUpdateOne) SetPayload

func (_u *AuditEventUpdateOne) SetPayload(v map[string]interface{}) *AuditEventUpdateOne

SetPayload sets the "payload" field.

func (*AuditEventUpdateOne) SetRawEvent

func (_u *AuditEventUpdateOne) SetRawEvent(v map[string]interface{}) *AuditEventUpdateOne

SetRawEvent sets the "raw_event" field.

func (*AuditEventUpdateOne) SetResultStatus

SetResultStatus sets the "result_status" field.

func (*AuditEventUpdateOne) SetSequence

func (_u *AuditEventUpdateOne) SetSequence(v int) *AuditEventUpdateOne

SetSequence sets the "sequence" field.

func (*AuditEventUpdateOne) SetSession

func (_u *AuditEventUpdateOne) SetSession(v *Session) *AuditEventUpdateOne

SetSession sets the "session" edge to the Session entity.

func (*AuditEventUpdateOne) SetSessionID

func (_u *AuditEventUpdateOne) SetSessionID(v uuid.UUID) *AuditEventUpdateOne

SetSessionID sets the "session_id" field.

func (*AuditEventUpdateOne) SetSubagentID added in v0.7.0

func (_u *AuditEventUpdateOne) SetSubagentID(v string) *AuditEventUpdateOne

SetSubagentID sets the "subagent_id" field.

func (*AuditEventUpdateOne) SetSubagentType added in v0.7.0

func (_u *AuditEventUpdateOne) SetSubagentType(v string) *AuditEventUpdateOne

SetSubagentType sets the "subagent_type" field.

func (*AuditEventUpdateOne) SetToolName

func (_u *AuditEventUpdateOne) SetToolName(v string) *AuditEventUpdateOne

SetToolName sets the "tool_name" field.

func (*AuditEventUpdateOne) SetWorkingDirectory

func (_u *AuditEventUpdateOne) SetWorkingDirectory(v string) *AuditEventUpdateOne

SetWorkingDirectory sets the "working_directory" field.

func (*AuditEventUpdateOne) Where

Where appends a list predicates to the AuditEventUpdate builder.

type AuditEvents

type AuditEvents []*AuditEvent

AuditEvents is a parsable slice of AuditEvent.

type AuditStreamCursor added in v0.3.2

type AuditStreamCursor struct {

	// ID of the ent.
	// target_name used as primary key
	ID string `json:"id,omitempty"`
	// LastSyncedAt holds the value of the "last_synced_at" field.
	LastSyncedAt time.Time `json:"last_synced_at,omitempty"`
	// LastID holds the value of the "last_id" field.
	LastID string `json:"last_id,omitempty"`
	// contains filtered or unexported fields
}

AuditStreamCursor is the model entity for the AuditStreamCursor schema.

func (*AuditStreamCursor) String added in v0.3.2

func (_m *AuditStreamCursor) String() string

String implements the fmt.Stringer.

func (*AuditStreamCursor) Unwrap added in v0.3.2

func (_m *AuditStreamCursor) Unwrap() *AuditStreamCursor

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

func (*AuditStreamCursor) Update added in v0.3.2

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

func (*AuditStreamCursor) Value added in v0.3.2

func (_m *AuditStreamCursor) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the AuditStreamCursor. This includes values selected through modifiers, order, etc.

type AuditStreamCursorClient added in v0.3.2

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

AuditStreamCursorClient is a client for the AuditStreamCursor schema.

func NewAuditStreamCursorClient added in v0.3.2

func NewAuditStreamCursorClient(c config) *AuditStreamCursorClient

NewAuditStreamCursorClient returns a client for the AuditStreamCursor from the given config.

func (*AuditStreamCursorClient) Create added in v0.3.2

Create returns a builder for creating a AuditStreamCursor entity.

func (*AuditStreamCursorClient) CreateBulk added in v0.3.2

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

func (*AuditStreamCursorClient) Delete added in v0.3.2

Delete returns a delete builder for AuditStreamCursor.

func (*AuditStreamCursorClient) DeleteOne added in v0.3.2

DeleteOne returns a builder for deleting the given entity.

func (*AuditStreamCursorClient) DeleteOneID added in v0.3.2

DeleteOneID returns a builder for deleting the given entity by its id.

func (*AuditStreamCursorClient) Get added in v0.3.2

Get returns a AuditStreamCursor entity by its id.

func (*AuditStreamCursorClient) GetX added in v0.3.2

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

func (*AuditStreamCursorClient) Hooks added in v0.3.2

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

Hooks returns the client hooks.

func (*AuditStreamCursorClient) Intercept added in v0.3.2

func (c *AuditStreamCursorClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `auditstreamcursor.Intercept(f(g(h())))`.

func (*AuditStreamCursorClient) Interceptors added in v0.3.2

func (c *AuditStreamCursorClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*AuditStreamCursorClient) MapCreateBulk added in v0.3.2

func (c *AuditStreamCursorClient) MapCreateBulk(slice any, setFunc func(*AuditStreamCursorCreate, int)) *AuditStreamCursorCreateBulk

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (*AuditStreamCursorClient) Query added in v0.3.2

Query returns a query builder for AuditStreamCursor.

func (*AuditStreamCursorClient) Update added in v0.3.2

Update returns an update builder for AuditStreamCursor.

func (*AuditStreamCursorClient) UpdateOne added in v0.3.2

UpdateOne returns an update builder for the given entity.

func (*AuditStreamCursorClient) UpdateOneID added in v0.3.2

UpdateOneID returns an update builder for the given id.

func (*AuditStreamCursorClient) Use added in v0.3.2

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

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

type AuditStreamCursorCreate added in v0.3.2

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

AuditStreamCursorCreate is the builder for creating a AuditStreamCursor entity.

func (*AuditStreamCursorCreate) Exec added in v0.3.2

Exec executes the query.

func (*AuditStreamCursorCreate) ExecX added in v0.3.2

func (_c *AuditStreamCursorCreate) ExecX(ctx context.Context)

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

func (*AuditStreamCursorCreate) Mutation added in v0.3.2

Mutation returns the AuditStreamCursorMutation object of the builder.

func (*AuditStreamCursorCreate) Save added in v0.3.2

Save creates the AuditStreamCursor in the database.

func (*AuditStreamCursorCreate) SaveX added in v0.3.2

SaveX calls Save and panics if Save returns an error.

func (*AuditStreamCursorCreate) SetID added in v0.3.2

SetID sets the "id" field.

func (*AuditStreamCursorCreate) SetLastID added in v0.3.2

SetLastID sets the "last_id" field.

func (*AuditStreamCursorCreate) SetLastSyncedAt added in v0.3.2

func (_c *AuditStreamCursorCreate) SetLastSyncedAt(v time.Time) *AuditStreamCursorCreate

SetLastSyncedAt sets the "last_synced_at" field.

func (*AuditStreamCursorCreate) SetNillableLastID added in v0.3.2

func (_c *AuditStreamCursorCreate) SetNillableLastID(v *string) *AuditStreamCursorCreate

SetNillableLastID sets the "last_id" field if the given value is not nil.

func (*AuditStreamCursorCreate) SetNillableLastSyncedAt added in v0.3.2

func (_c *AuditStreamCursorCreate) SetNillableLastSyncedAt(v *time.Time) *AuditStreamCursorCreate

SetNillableLastSyncedAt sets the "last_synced_at" field if the given value is not nil.

type AuditStreamCursorCreateBulk added in v0.3.2

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

AuditStreamCursorCreateBulk is the builder for creating many AuditStreamCursor entities in bulk.

func (*AuditStreamCursorCreateBulk) Exec added in v0.3.2

Exec executes the query.

func (*AuditStreamCursorCreateBulk) ExecX added in v0.3.2

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

func (*AuditStreamCursorCreateBulk) Save added in v0.3.2

Save creates the AuditStreamCursor entities in the database.

func (*AuditStreamCursorCreateBulk) SaveX added in v0.3.2

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

type AuditStreamCursorDelete added in v0.3.2

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

AuditStreamCursorDelete is the builder for deleting a AuditStreamCursor entity.

func (*AuditStreamCursorDelete) Exec added in v0.3.2

func (_d *AuditStreamCursorDelete) Exec(ctx context.Context) (int, error)

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

func (*AuditStreamCursorDelete) ExecX added in v0.3.2

func (_d *AuditStreamCursorDelete) ExecX(ctx context.Context) int

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

func (*AuditStreamCursorDelete) Where added in v0.3.2

Where appends a list predicates to the AuditStreamCursorDelete builder.

type AuditStreamCursorDeleteOne added in v0.3.2

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

AuditStreamCursorDeleteOne is the builder for deleting a single AuditStreamCursor entity.

func (*AuditStreamCursorDeleteOne) Exec added in v0.3.2

Exec executes the deletion query.

func (*AuditStreamCursorDeleteOne) ExecX added in v0.3.2

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

func (*AuditStreamCursorDeleteOne) Where added in v0.3.2

Where appends a list predicates to the AuditStreamCursorDelete builder.

type AuditStreamCursorGroupBy added in v0.3.2

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

AuditStreamCursorGroupBy is the group-by builder for AuditStreamCursor entities.

func (*AuditStreamCursorGroupBy) Aggregate added in v0.3.2

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

func (*AuditStreamCursorGroupBy) Bool added in v0.3.2

func (s *AuditStreamCursorGroupBy) Bool(ctx context.Context) (_ bool, err error)

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

func (*AuditStreamCursorGroupBy) BoolX added in v0.3.2

func (s *AuditStreamCursorGroupBy) BoolX(ctx context.Context) bool

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

func (*AuditStreamCursorGroupBy) Bools added in v0.3.2

func (s *AuditStreamCursorGroupBy) Bools(ctx context.Context) ([]bool, error)

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

func (*AuditStreamCursorGroupBy) BoolsX added in v0.3.2

func (s *AuditStreamCursorGroupBy) BoolsX(ctx context.Context) []bool

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

func (*AuditStreamCursorGroupBy) Float64 added in v0.3.2

func (s *AuditStreamCursorGroupBy) Float64(ctx context.Context) (_ float64, err error)

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

func (*AuditStreamCursorGroupBy) Float64X added in v0.3.2

func (s *AuditStreamCursorGroupBy) Float64X(ctx context.Context) float64

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

func (*AuditStreamCursorGroupBy) Float64s added in v0.3.2

func (s *AuditStreamCursorGroupBy) Float64s(ctx context.Context) ([]float64, error)

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

func (*AuditStreamCursorGroupBy) Float64sX added in v0.3.2

func (s *AuditStreamCursorGroupBy) Float64sX(ctx context.Context) []float64

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

func (*AuditStreamCursorGroupBy) Int added in v0.3.2

func (s *AuditStreamCursorGroupBy) Int(ctx context.Context) (_ int, err error)

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

func (*AuditStreamCursorGroupBy) IntX added in v0.3.2

func (s *AuditStreamCursorGroupBy) IntX(ctx context.Context) int

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

func (*AuditStreamCursorGroupBy) Ints added in v0.3.2

func (s *AuditStreamCursorGroupBy) Ints(ctx context.Context) ([]int, error)

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

func (*AuditStreamCursorGroupBy) IntsX added in v0.3.2

func (s *AuditStreamCursorGroupBy) IntsX(ctx context.Context) []int

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

func (*AuditStreamCursorGroupBy) Scan added in v0.3.2

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

func (*AuditStreamCursorGroupBy) ScanX added in v0.3.2

func (s *AuditStreamCursorGroupBy) ScanX(ctx context.Context, v any)

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

func (*AuditStreamCursorGroupBy) String added in v0.3.2

func (s *AuditStreamCursorGroupBy) String(ctx context.Context) (_ string, err error)

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

func (*AuditStreamCursorGroupBy) StringX added in v0.3.2

func (s *AuditStreamCursorGroupBy) StringX(ctx context.Context) string

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

func (*AuditStreamCursorGroupBy) Strings added in v0.3.2

func (s *AuditStreamCursorGroupBy) Strings(ctx context.Context) ([]string, error)

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

func (*AuditStreamCursorGroupBy) StringsX added in v0.3.2

func (s *AuditStreamCursorGroupBy) StringsX(ctx context.Context) []string

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

type AuditStreamCursorMutation added in v0.3.2

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

AuditStreamCursorMutation represents an operation that mutates the AuditStreamCursor nodes in the graph.

func (*AuditStreamCursorMutation) AddField added in v0.3.2

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

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

func (*AuditStreamCursorMutation) AddedEdges added in v0.3.2

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

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

func (*AuditStreamCursorMutation) AddedField added in v0.3.2

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

AddedField returns the numeric value that was incremented/decremented on a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*AuditStreamCursorMutation) AddedFields added in v0.3.2

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

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

func (*AuditStreamCursorMutation) AddedIDs added in v0.3.2

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

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

func (*AuditStreamCursorMutation) ClearEdge added in v0.3.2

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

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

func (*AuditStreamCursorMutation) ClearField added in v0.3.2

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

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

func (*AuditStreamCursorMutation) ClearLastID added in v0.3.2

func (m *AuditStreamCursorMutation) ClearLastID()

ClearLastID clears the value of the "last_id" field.

func (*AuditStreamCursorMutation) ClearedEdges added in v0.3.2

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

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

func (*AuditStreamCursorMutation) ClearedFields added in v0.3.2

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

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

func (AuditStreamCursorMutation) Client added in v0.3.2

func (m AuditStreamCursorMutation) 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 (*AuditStreamCursorMutation) EdgeCleared added in v0.3.2

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

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

func (*AuditStreamCursorMutation) Field added in v0.3.2

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

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

func (*AuditStreamCursorMutation) FieldCleared added in v0.3.2

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

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

func (*AuditStreamCursorMutation) Fields added in v0.3.2

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

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

func (*AuditStreamCursorMutation) ID added in v0.3.2

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

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

func (*AuditStreamCursorMutation) IDs added in v0.3.2

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

func (*AuditStreamCursorMutation) LastID added in v0.3.2

func (m *AuditStreamCursorMutation) LastID() (r string, exists bool)

LastID returns the value of the "last_id" field in the mutation.

func (*AuditStreamCursorMutation) LastIDCleared added in v0.3.2

func (m *AuditStreamCursorMutation) LastIDCleared() bool

LastIDCleared returns if the "last_id" field was cleared in this mutation.

func (*AuditStreamCursorMutation) LastSyncedAt added in v0.3.2

func (m *AuditStreamCursorMutation) LastSyncedAt() (r time.Time, exists bool)

LastSyncedAt returns the value of the "last_synced_at" field in the mutation.

func (*AuditStreamCursorMutation) OldField added in v0.3.2

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

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

func (*AuditStreamCursorMutation) OldLastID added in v0.3.2

func (m *AuditStreamCursorMutation) OldLastID(ctx context.Context) (v string, err error)

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

func (*AuditStreamCursorMutation) OldLastSyncedAt added in v0.3.2

func (m *AuditStreamCursorMutation) OldLastSyncedAt(ctx context.Context) (v time.Time, err error)

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

func (*AuditStreamCursorMutation) Op added in v0.3.2

func (m *AuditStreamCursorMutation) Op() Op

Op returns the operation name.

func (*AuditStreamCursorMutation) RemovedEdges added in v0.3.2

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

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

func (*AuditStreamCursorMutation) RemovedIDs added in v0.3.2

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

RemovedIDs returns all IDs (to other nodes) that were removed for the edge with the given name in this mutation.

func (*AuditStreamCursorMutation) ResetEdge added in v0.3.2

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

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

func (*AuditStreamCursorMutation) ResetField added in v0.3.2

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

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

func (*AuditStreamCursorMutation) ResetLastID added in v0.3.2

func (m *AuditStreamCursorMutation) ResetLastID()

ResetLastID resets all changes to the "last_id" field.

func (*AuditStreamCursorMutation) ResetLastSyncedAt added in v0.3.2

func (m *AuditStreamCursorMutation) ResetLastSyncedAt()

ResetLastSyncedAt resets all changes to the "last_synced_at" field.

func (*AuditStreamCursorMutation) SetField added in v0.3.2

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

SetField sets the value of a field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*AuditStreamCursorMutation) SetID added in v0.3.2

func (m *AuditStreamCursorMutation) SetID(id string)

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

func (*AuditStreamCursorMutation) SetLastID added in v0.3.2

func (m *AuditStreamCursorMutation) SetLastID(s string)

SetLastID sets the "last_id" field.

func (*AuditStreamCursorMutation) SetLastSyncedAt added in v0.3.2

func (m *AuditStreamCursorMutation) SetLastSyncedAt(t time.Time)

SetLastSyncedAt sets the "last_synced_at" field.

func (*AuditStreamCursorMutation) SetOp added in v0.3.2

func (m *AuditStreamCursorMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (AuditStreamCursorMutation) Tx added in v0.3.2

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

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

func (*AuditStreamCursorMutation) Type added in v0.3.2

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

func (*AuditStreamCursorMutation) Where added in v0.3.2

Where appends a list predicates to the AuditStreamCursorMutation builder.

func (*AuditStreamCursorMutation) WhereP added in v0.3.2

func (m *AuditStreamCursorMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the AuditStreamCursorMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type AuditStreamCursorQuery added in v0.3.2

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

AuditStreamCursorQuery is the builder for querying AuditStreamCursor entities.

func (*AuditStreamCursorQuery) Aggregate added in v0.3.2

Aggregate returns a AuditStreamCursorSelect configured with the given aggregations.

func (*AuditStreamCursorQuery) All added in v0.3.2

All executes the query and returns a list of AuditStreamCursors.

func (*AuditStreamCursorQuery) AllX added in v0.3.2

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

func (*AuditStreamCursorQuery) Clone added in v0.3.2

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

func (*AuditStreamCursorQuery) Count added in v0.3.2

func (_q *AuditStreamCursorQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*AuditStreamCursorQuery) CountX added in v0.3.2

func (_q *AuditStreamCursorQuery) CountX(ctx context.Context) int

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

func (*AuditStreamCursorQuery) Exist added in v0.3.2

func (_q *AuditStreamCursorQuery) Exist(ctx context.Context) (bool, error)

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

func (*AuditStreamCursorQuery) ExistX added in v0.3.2

func (_q *AuditStreamCursorQuery) ExistX(ctx context.Context) bool

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

func (*AuditStreamCursorQuery) First added in v0.3.2

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

func (*AuditStreamCursorQuery) FirstID added in v0.3.2

func (_q *AuditStreamCursorQuery) FirstID(ctx context.Context) (id string, err error)

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

func (*AuditStreamCursorQuery) FirstIDX added in v0.3.2

func (_q *AuditStreamCursorQuery) FirstIDX(ctx context.Context) string

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

func (*AuditStreamCursorQuery) FirstX added in v0.3.2

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

func (*AuditStreamCursorQuery) GroupBy added in v0.3.2

func (_q *AuditStreamCursorQuery) GroupBy(field string, fields ...string) *AuditStreamCursorGroupBy

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

Example:

var v []struct {
	LastSyncedAt time.Time `json:"last_synced_at,omitempty"`
	Count int `json:"count,omitempty"`
}

client.AuditStreamCursor.Query().
	GroupBy(auditstreamcursor.FieldLastSyncedAt).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*AuditStreamCursorQuery) IDs added in v0.3.2

func (_q *AuditStreamCursorQuery) IDs(ctx context.Context) (ids []string, err error)

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

func (*AuditStreamCursorQuery) IDsX added in v0.3.2

func (_q *AuditStreamCursorQuery) IDsX(ctx context.Context) []string

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

func (*AuditStreamCursorQuery) Limit added in v0.3.2

Limit the number of records to be returned by this query.

func (*AuditStreamCursorQuery) Offset added in v0.3.2

Offset to start from.

func (*AuditStreamCursorQuery) Only added in v0.3.2

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

func (*AuditStreamCursorQuery) OnlyID added in v0.3.2

func (_q *AuditStreamCursorQuery) OnlyID(ctx context.Context) (id string, err error)

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

func (*AuditStreamCursorQuery) OnlyIDX added in v0.3.2

func (_q *AuditStreamCursorQuery) OnlyIDX(ctx context.Context) string

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

func (*AuditStreamCursorQuery) OnlyX added in v0.3.2

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

func (*AuditStreamCursorQuery) Order added in v0.3.2

Order specifies how the records should be ordered.

func (*AuditStreamCursorQuery) Select added in v0.3.2

func (_q *AuditStreamCursorQuery) Select(fields ...string) *AuditStreamCursorSelect

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

Example:

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

client.AuditStreamCursor.Query().
	Select(auditstreamcursor.FieldLastSyncedAt).
	Scan(ctx, &v)

func (*AuditStreamCursorQuery) Unique added in v0.3.2

Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.

func (*AuditStreamCursorQuery) Where added in v0.3.2

Where adds a new predicate for the AuditStreamCursorQuery builder.

type AuditStreamCursorSelect added in v0.3.2

type AuditStreamCursorSelect struct {
	*AuditStreamCursorQuery
	// contains filtered or unexported fields
}

AuditStreamCursorSelect is the builder for selecting fields of AuditStreamCursor entities.

func (*AuditStreamCursorSelect) Aggregate added in v0.3.2

Aggregate adds the given aggregation functions to the selector query.

func (*AuditStreamCursorSelect) Bool added in v0.3.2

func (s *AuditStreamCursorSelect) Bool(ctx context.Context) (_ bool, err error)

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

func (*AuditStreamCursorSelect) BoolX added in v0.3.2

func (s *AuditStreamCursorSelect) BoolX(ctx context.Context) bool

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

func (*AuditStreamCursorSelect) Bools added in v0.3.2

func (s *AuditStreamCursorSelect) Bools(ctx context.Context) ([]bool, error)

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

func (*AuditStreamCursorSelect) BoolsX added in v0.3.2

func (s *AuditStreamCursorSelect) BoolsX(ctx context.Context) []bool

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

func (*AuditStreamCursorSelect) Float64 added in v0.3.2

func (s *AuditStreamCursorSelect) Float64(ctx context.Context) (_ float64, err error)

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

func (*AuditStreamCursorSelect) Float64X added in v0.3.2

func (s *AuditStreamCursorSelect) Float64X(ctx context.Context) float64

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

func (*AuditStreamCursorSelect) Float64s added in v0.3.2

func (s *AuditStreamCursorSelect) Float64s(ctx context.Context) ([]float64, error)

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

func (*AuditStreamCursorSelect) Float64sX added in v0.3.2

func (s *AuditStreamCursorSelect) Float64sX(ctx context.Context) []float64

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

func (*AuditStreamCursorSelect) Int added in v0.3.2

func (s *AuditStreamCursorSelect) Int(ctx context.Context) (_ int, err error)

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

func (*AuditStreamCursorSelect) IntX added in v0.3.2

func (s *AuditStreamCursorSelect) IntX(ctx context.Context) int

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

func (*AuditStreamCursorSelect) Ints added in v0.3.2

func (s *AuditStreamCursorSelect) Ints(ctx context.Context) ([]int, error)

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

func (*AuditStreamCursorSelect) IntsX added in v0.3.2

func (s *AuditStreamCursorSelect) IntsX(ctx context.Context) []int

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

func (*AuditStreamCursorSelect) Scan added in v0.3.2

func (_s *AuditStreamCursorSelect) Scan(ctx context.Context, v any) error

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

func (*AuditStreamCursorSelect) ScanX added in v0.3.2

func (s *AuditStreamCursorSelect) ScanX(ctx context.Context, v any)

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

func (*AuditStreamCursorSelect) String added in v0.3.2

func (s *AuditStreamCursorSelect) String(ctx context.Context) (_ string, err error)

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

func (*AuditStreamCursorSelect) StringX added in v0.3.2

func (s *AuditStreamCursorSelect) StringX(ctx context.Context) string

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

func (*AuditStreamCursorSelect) Strings added in v0.3.2

func (s *AuditStreamCursorSelect) Strings(ctx context.Context) ([]string, error)

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

func (*AuditStreamCursorSelect) StringsX added in v0.3.2

func (s *AuditStreamCursorSelect) StringsX(ctx context.Context) []string

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

type AuditStreamCursorUpdate added in v0.3.2

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

AuditStreamCursorUpdate is the builder for updating AuditStreamCursor entities.

func (*AuditStreamCursorUpdate) ClearLastID added in v0.3.2

ClearLastID clears the value of the "last_id" field.

func (*AuditStreamCursorUpdate) Exec added in v0.3.2

Exec executes the query.

func (*AuditStreamCursorUpdate) ExecX added in v0.3.2

func (_u *AuditStreamCursorUpdate) ExecX(ctx context.Context)

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

func (*AuditStreamCursorUpdate) Mutation added in v0.3.2

Mutation returns the AuditStreamCursorMutation object of the builder.

func (*AuditStreamCursorUpdate) Save added in v0.3.2

func (_u *AuditStreamCursorUpdate) Save(ctx context.Context) (int, error)

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

func (*AuditStreamCursorUpdate) SaveX added in v0.3.2

func (_u *AuditStreamCursorUpdate) SaveX(ctx context.Context) int

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

func (*AuditStreamCursorUpdate) SetLastID added in v0.3.2

SetLastID sets the "last_id" field.

func (*AuditStreamCursorUpdate) SetLastSyncedAt added in v0.3.2

func (_u *AuditStreamCursorUpdate) SetLastSyncedAt(v time.Time) *AuditStreamCursorUpdate

SetLastSyncedAt sets the "last_synced_at" field.

func (*AuditStreamCursorUpdate) SetNillableLastID added in v0.3.2

func (_u *AuditStreamCursorUpdate) SetNillableLastID(v *string) *AuditStreamCursorUpdate

SetNillableLastID sets the "last_id" field if the given value is not nil.

func (*AuditStreamCursorUpdate) SetNillableLastSyncedAt added in v0.3.2

func (_u *AuditStreamCursorUpdate) SetNillableLastSyncedAt(v *time.Time) *AuditStreamCursorUpdate

SetNillableLastSyncedAt sets the "last_synced_at" field if the given value is not nil.

func (*AuditStreamCursorUpdate) Where added in v0.3.2

Where appends a list predicates to the AuditStreamCursorUpdate builder.

type AuditStreamCursorUpdateOne added in v0.3.2

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

AuditStreamCursorUpdateOne is the builder for updating a single AuditStreamCursor entity.

func (*AuditStreamCursorUpdateOne) ClearLastID added in v0.3.2

ClearLastID clears the value of the "last_id" field.

func (*AuditStreamCursorUpdateOne) Exec added in v0.3.2

Exec executes the query on the entity.

func (*AuditStreamCursorUpdateOne) ExecX added in v0.3.2

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

func (*AuditStreamCursorUpdateOne) Mutation added in v0.3.2

Mutation returns the AuditStreamCursorMutation object of the builder.

func (*AuditStreamCursorUpdateOne) Save added in v0.3.2

Save executes the query and returns the updated AuditStreamCursor entity.

func (*AuditStreamCursorUpdateOne) SaveX added in v0.3.2

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

func (*AuditStreamCursorUpdateOne) Select added in v0.3.2

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

func (*AuditStreamCursorUpdateOne) SetLastID added in v0.3.2

SetLastID sets the "last_id" field.

func (*AuditStreamCursorUpdateOne) SetLastSyncedAt added in v0.3.2

SetLastSyncedAt sets the "last_synced_at" field.

func (*AuditStreamCursorUpdateOne) SetNillableLastID added in v0.3.2

SetNillableLastID sets the "last_id" field if the given value is not nil.

func (*AuditStreamCursorUpdateOne) SetNillableLastSyncedAt added in v0.3.2

func (_u *AuditStreamCursorUpdateOne) SetNillableLastSyncedAt(v *time.Time) *AuditStreamCursorUpdateOne

SetNillableLastSyncedAt sets the "last_synced_at" field if the given value is not nil.

func (*AuditStreamCursorUpdateOne) Where added in v0.3.2

Where appends a list predicates to the AuditStreamCursorUpdate builder.

type AuditStreamCursors added in v0.3.2

type AuditStreamCursors []*AuditStreamCursor

AuditStreamCursors is a parsable slice of AuditStreamCursor.

type Client

type Client struct {

	// Schema is the client for creating, migrating and dropping schema.
	Schema *migrate.Schema
	// AuditEvent is the client for interacting with the AuditEvent builders.
	AuditEvent *AuditEventClient
	// AuditStreamCursor is the client for interacting with the AuditStreamCursor builders.
	AuditStreamCursor *AuditStreamCursorClient
	// EventStreamCursor is the client for interacting with the EventStreamCursor builders.
	EventStreamCursor *EventStreamCursorClient
	// SelfAudit is the client for interacting with the SelfAudit builders.
	SelfAudit *SelfAuditClient
	// Session is the client for interacting with the Session builders.
	Session *SessionClient
	// contains filtered or unexported fields
}

Client is the client that holds all ent builders.

func FromContext

func FromContext(ctx context.Context) *Client

FromContext returns a Client stored inside a context, or nil if there isn't one.

func NewClient

func NewClient(opts ...Option) *Client

NewClient creates a new client configured with the given options.

func Open

func Open(driverName, dataSourceName string, options ...Option) (*Client, error)

Open opens a database/sql.DB specified by the driver name and the data source name, and returns a new client attached to it. Optional parameters can be added for configuring the client.

func (*Client) BeginTx

func (c *Client) BeginTx(ctx context.Context, opts *sql.TxOptions) (*Tx, error)

BeginTx returns a transactional client with specified options.

func (*Client) Close

func (c *Client) Close() error

Close closes the database connection and prevents new queries from starting.

func (*Client) Debug

func (c *Client) Debug() *Client

Debug returns a new debug-client. It's used to get verbose logging on specific operations.

client.Debug().
	AuditEvent.
	Query().
	Count(ctx)

func (*Client) Intercept

func (c *Client) Intercept(interceptors ...Interceptor)

Intercept adds the query interceptors to all the entity clients. In order to add interceptors to a specific client, call: `client.Node.Intercept(...)`.

func (*Client) Mutate

func (c *Client) Mutate(ctx context.Context, m Mutation) (Value, error)

Mutate implements the ent.Mutator interface.

func (*Client) Tx

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

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

func (*Client) Use

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

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

type CommitFunc

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

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

func (CommitFunc) Commit

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

Commit calls f(ctx, m).

type CommitHook

type CommitHook func(Committer) Committer

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

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

type Committer

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

Committer is the interface that wraps the Commit method.

type ConstraintError

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

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

func (ConstraintError) Error

func (e ConstraintError) Error() string

Error implements the error interface.

func (*ConstraintError) Unwrap

func (e *ConstraintError) Unwrap() error

Unwrap implements the errors.Wrapper interface.

type EventStreamCursor added in v0.3.2

type EventStreamCursor struct {

	// ID of the ent.
	// target_name used as primary key
	ID string `json:"id,omitempty"`
	// LastSyncedAt holds the value of the "last_synced_at" field.
	LastSyncedAt time.Time `json:"last_synced_at,omitempty"`
	// LastID holds the value of the "last_id" field.
	LastID string `json:"last_id,omitempty"`
	// contains filtered or unexported fields
}

EventStreamCursor is the model entity for the EventStreamCursor schema.

func (*EventStreamCursor) String added in v0.3.2

func (_m *EventStreamCursor) String() string

String implements the fmt.Stringer.

func (*EventStreamCursor) Unwrap added in v0.3.2

func (_m *EventStreamCursor) Unwrap() *EventStreamCursor

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

func (*EventStreamCursor) Update added in v0.3.2

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

func (*EventStreamCursor) Value added in v0.3.2

func (_m *EventStreamCursor) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the EventStreamCursor. This includes values selected through modifiers, order, etc.

type EventStreamCursorClient added in v0.3.2

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

EventStreamCursorClient is a client for the EventStreamCursor schema.

func NewEventStreamCursorClient added in v0.3.2

func NewEventStreamCursorClient(c config) *EventStreamCursorClient

NewEventStreamCursorClient returns a client for the EventStreamCursor from the given config.

func (*EventStreamCursorClient) Create added in v0.3.2

Create returns a builder for creating a EventStreamCursor entity.

func (*EventStreamCursorClient) CreateBulk added in v0.3.2

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

func (*EventStreamCursorClient) Delete added in v0.3.2

Delete returns a delete builder for EventStreamCursor.

func (*EventStreamCursorClient) DeleteOne added in v0.3.2

DeleteOne returns a builder for deleting the given entity.

func (*EventStreamCursorClient) DeleteOneID added in v0.3.2

DeleteOneID returns a builder for deleting the given entity by its id.

func (*EventStreamCursorClient) Get added in v0.3.2

Get returns a EventStreamCursor entity by its id.

func (*EventStreamCursorClient) GetX added in v0.3.2

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

func (*EventStreamCursorClient) Hooks added in v0.3.2

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

Hooks returns the client hooks.

func (*EventStreamCursorClient) Intercept added in v0.3.2

func (c *EventStreamCursorClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `eventstreamcursor.Intercept(f(g(h())))`.

func (*EventStreamCursorClient) Interceptors added in v0.3.2

func (c *EventStreamCursorClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*EventStreamCursorClient) MapCreateBulk added in v0.3.2

func (c *EventStreamCursorClient) MapCreateBulk(slice any, setFunc func(*EventStreamCursorCreate, int)) *EventStreamCursorCreateBulk

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (*EventStreamCursorClient) Query added in v0.3.2

Query returns a query builder for EventStreamCursor.

func (*EventStreamCursorClient) Update added in v0.3.2

Update returns an update builder for EventStreamCursor.

func (*EventStreamCursorClient) UpdateOne added in v0.3.2

UpdateOne returns an update builder for the given entity.

func (*EventStreamCursorClient) UpdateOneID added in v0.3.2

UpdateOneID returns an update builder for the given id.

func (*EventStreamCursorClient) Use added in v0.3.2

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

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

type EventStreamCursorCreate added in v0.3.2

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

EventStreamCursorCreate is the builder for creating a EventStreamCursor entity.

func (*EventStreamCursorCreate) Exec added in v0.3.2

Exec executes the query.

func (*EventStreamCursorCreate) ExecX added in v0.3.2

func (_c *EventStreamCursorCreate) ExecX(ctx context.Context)

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

func (*EventStreamCursorCreate) Mutation added in v0.3.2

Mutation returns the EventStreamCursorMutation object of the builder.

func (*EventStreamCursorCreate) Save added in v0.3.2

Save creates the EventStreamCursor in the database.

func (*EventStreamCursorCreate) SaveX added in v0.3.2

SaveX calls Save and panics if Save returns an error.

func (*EventStreamCursorCreate) SetID added in v0.3.2

SetID sets the "id" field.

func (*EventStreamCursorCreate) SetLastID added in v0.3.2

SetLastID sets the "last_id" field.

func (*EventStreamCursorCreate) SetLastSyncedAt added in v0.3.2

func (_c *EventStreamCursorCreate) SetLastSyncedAt(v time.Time) *EventStreamCursorCreate

SetLastSyncedAt sets the "last_synced_at" field.

func (*EventStreamCursorCreate) SetNillableLastID added in v0.3.2

func (_c *EventStreamCursorCreate) SetNillableLastID(v *string) *EventStreamCursorCreate

SetNillableLastID sets the "last_id" field if the given value is not nil.

func (*EventStreamCursorCreate) SetNillableLastSyncedAt added in v0.3.2

func (_c *EventStreamCursorCreate) SetNillableLastSyncedAt(v *time.Time) *EventStreamCursorCreate

SetNillableLastSyncedAt sets the "last_synced_at" field if the given value is not nil.

type EventStreamCursorCreateBulk added in v0.3.2

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

EventStreamCursorCreateBulk is the builder for creating many EventStreamCursor entities in bulk.

func (*EventStreamCursorCreateBulk) Exec added in v0.3.2

Exec executes the query.

func (*EventStreamCursorCreateBulk) ExecX added in v0.3.2

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

func (*EventStreamCursorCreateBulk) Save added in v0.3.2

Save creates the EventStreamCursor entities in the database.

func (*EventStreamCursorCreateBulk) SaveX added in v0.3.2

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

type EventStreamCursorDelete added in v0.3.2

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

EventStreamCursorDelete is the builder for deleting a EventStreamCursor entity.

func (*EventStreamCursorDelete) Exec added in v0.3.2

func (_d *EventStreamCursorDelete) Exec(ctx context.Context) (int, error)

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

func (*EventStreamCursorDelete) ExecX added in v0.3.2

func (_d *EventStreamCursorDelete) ExecX(ctx context.Context) int

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

func (*EventStreamCursorDelete) Where added in v0.3.2

Where appends a list predicates to the EventStreamCursorDelete builder.

type EventStreamCursorDeleteOne added in v0.3.2

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

EventStreamCursorDeleteOne is the builder for deleting a single EventStreamCursor entity.

func (*EventStreamCursorDeleteOne) Exec added in v0.3.2

Exec executes the deletion query.

func (*EventStreamCursorDeleteOne) ExecX added in v0.3.2

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

func (*EventStreamCursorDeleteOne) Where added in v0.3.2

Where appends a list predicates to the EventStreamCursorDelete builder.

type EventStreamCursorGroupBy added in v0.3.2

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

EventStreamCursorGroupBy is the group-by builder for EventStreamCursor entities.

func (*EventStreamCursorGroupBy) Aggregate added in v0.3.2

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

func (*EventStreamCursorGroupBy) Bool added in v0.3.2

func (s *EventStreamCursorGroupBy) Bool(ctx context.Context) (_ bool, err error)

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

func (*EventStreamCursorGroupBy) BoolX added in v0.3.2

func (s *EventStreamCursorGroupBy) BoolX(ctx context.Context) bool

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

func (*EventStreamCursorGroupBy) Bools added in v0.3.2

func (s *EventStreamCursorGroupBy) Bools(ctx context.Context) ([]bool, error)

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

func (*EventStreamCursorGroupBy) BoolsX added in v0.3.2

func (s *EventStreamCursorGroupBy) BoolsX(ctx context.Context) []bool

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

func (*EventStreamCursorGroupBy) Float64 added in v0.3.2

func (s *EventStreamCursorGroupBy) Float64(ctx context.Context) (_ float64, err error)

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

func (*EventStreamCursorGroupBy) Float64X added in v0.3.2

func (s *EventStreamCursorGroupBy) Float64X(ctx context.Context) float64

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

func (*EventStreamCursorGroupBy) Float64s added in v0.3.2

func (s *EventStreamCursorGroupBy) Float64s(ctx context.Context) ([]float64, error)

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

func (*EventStreamCursorGroupBy) Float64sX added in v0.3.2

func (s *EventStreamCursorGroupBy) Float64sX(ctx context.Context) []float64

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

func (*EventStreamCursorGroupBy) Int added in v0.3.2

func (s *EventStreamCursorGroupBy) Int(ctx context.Context) (_ int, err error)

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

func (*EventStreamCursorGroupBy) IntX added in v0.3.2

func (s *EventStreamCursorGroupBy) IntX(ctx context.Context) int

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

func (*EventStreamCursorGroupBy) Ints added in v0.3.2

func (s *EventStreamCursorGroupBy) Ints(ctx context.Context) ([]int, error)

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

func (*EventStreamCursorGroupBy) IntsX added in v0.3.2

func (s *EventStreamCursorGroupBy) IntsX(ctx context.Context) []int

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

func (*EventStreamCursorGroupBy) Scan added in v0.3.2

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

func (*EventStreamCursorGroupBy) ScanX added in v0.3.2

func (s *EventStreamCursorGroupBy) ScanX(ctx context.Context, v any)

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

func (*EventStreamCursorGroupBy) String added in v0.3.2

func (s *EventStreamCursorGroupBy) String(ctx context.Context) (_ string, err error)

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

func (*EventStreamCursorGroupBy) StringX added in v0.3.2

func (s *EventStreamCursorGroupBy) StringX(ctx context.Context) string

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

func (*EventStreamCursorGroupBy) Strings added in v0.3.2

func (s *EventStreamCursorGroupBy) Strings(ctx context.Context) ([]string, error)

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

func (*EventStreamCursorGroupBy) StringsX added in v0.3.2

func (s *EventStreamCursorGroupBy) StringsX(ctx context.Context) []string

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

type EventStreamCursorMutation added in v0.3.2

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

EventStreamCursorMutation represents an operation that mutates the EventStreamCursor nodes in the graph.

func (*EventStreamCursorMutation) AddField added in v0.3.2

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

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

func (*EventStreamCursorMutation) AddedEdges added in v0.3.2

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

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

func (*EventStreamCursorMutation) AddedField added in v0.3.2

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

AddedField returns the numeric value that was incremented/decremented on a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*EventStreamCursorMutation) AddedFields added in v0.3.2

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

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

func (*EventStreamCursorMutation) AddedIDs added in v0.3.2

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

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

func (*EventStreamCursorMutation) ClearEdge added in v0.3.2

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

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

func (*EventStreamCursorMutation) ClearField added in v0.3.2

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

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

func (*EventStreamCursorMutation) ClearLastID added in v0.3.2

func (m *EventStreamCursorMutation) ClearLastID()

ClearLastID clears the value of the "last_id" field.

func (*EventStreamCursorMutation) ClearedEdges added in v0.3.2

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

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

func (*EventStreamCursorMutation) ClearedFields added in v0.3.2

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

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

func (EventStreamCursorMutation) Client added in v0.3.2

func (m EventStreamCursorMutation) 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 (*EventStreamCursorMutation) EdgeCleared added in v0.3.2

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

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

func (*EventStreamCursorMutation) Field added in v0.3.2

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

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

func (*EventStreamCursorMutation) FieldCleared added in v0.3.2

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

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

func (*EventStreamCursorMutation) Fields added in v0.3.2

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

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

func (*EventStreamCursorMutation) ID added in v0.3.2

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

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

func (*EventStreamCursorMutation) IDs added in v0.3.2

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

func (*EventStreamCursorMutation) LastID added in v0.3.2

func (m *EventStreamCursorMutation) LastID() (r string, exists bool)

LastID returns the value of the "last_id" field in the mutation.

func (*EventStreamCursorMutation) LastIDCleared added in v0.3.2

func (m *EventStreamCursorMutation) LastIDCleared() bool

LastIDCleared returns if the "last_id" field was cleared in this mutation.

func (*EventStreamCursorMutation) LastSyncedAt added in v0.3.2

func (m *EventStreamCursorMutation) LastSyncedAt() (r time.Time, exists bool)

LastSyncedAt returns the value of the "last_synced_at" field in the mutation.

func (*EventStreamCursorMutation) OldField added in v0.3.2

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

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

func (*EventStreamCursorMutation) OldLastID added in v0.3.2

func (m *EventStreamCursorMutation) OldLastID(ctx context.Context) (v string, err error)

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

func (*EventStreamCursorMutation) OldLastSyncedAt added in v0.3.2

func (m *EventStreamCursorMutation) OldLastSyncedAt(ctx context.Context) (v time.Time, err error)

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

func (*EventStreamCursorMutation) Op added in v0.3.2

func (m *EventStreamCursorMutation) Op() Op

Op returns the operation name.

func (*EventStreamCursorMutation) RemovedEdges added in v0.3.2

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

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

func (*EventStreamCursorMutation) RemovedIDs added in v0.3.2

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

RemovedIDs returns all IDs (to other nodes) that were removed for the edge with the given name in this mutation.

func (*EventStreamCursorMutation) ResetEdge added in v0.3.2

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

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

func (*EventStreamCursorMutation) ResetField added in v0.3.2

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

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

func (*EventStreamCursorMutation) ResetLastID added in v0.3.2

func (m *EventStreamCursorMutation) ResetLastID()

ResetLastID resets all changes to the "last_id" field.

func (*EventStreamCursorMutation) ResetLastSyncedAt added in v0.3.2

func (m *EventStreamCursorMutation) ResetLastSyncedAt()

ResetLastSyncedAt resets all changes to the "last_synced_at" field.

func (*EventStreamCursorMutation) SetField added in v0.3.2

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

SetField sets the value of a field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*EventStreamCursorMutation) SetID added in v0.3.2

func (m *EventStreamCursorMutation) SetID(id string)

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

func (*EventStreamCursorMutation) SetLastID added in v0.3.2

func (m *EventStreamCursorMutation) SetLastID(s string)

SetLastID sets the "last_id" field.

func (*EventStreamCursorMutation) SetLastSyncedAt added in v0.3.2

func (m *EventStreamCursorMutation) SetLastSyncedAt(t time.Time)

SetLastSyncedAt sets the "last_synced_at" field.

func (*EventStreamCursorMutation) SetOp added in v0.3.2

func (m *EventStreamCursorMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (EventStreamCursorMutation) Tx added in v0.3.2

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

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

func (*EventStreamCursorMutation) Type added in v0.3.2

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

func (*EventStreamCursorMutation) Where added in v0.3.2

Where appends a list predicates to the EventStreamCursorMutation builder.

func (*EventStreamCursorMutation) WhereP added in v0.3.2

func (m *EventStreamCursorMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the EventStreamCursorMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type EventStreamCursorQuery added in v0.3.2

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

EventStreamCursorQuery is the builder for querying EventStreamCursor entities.

func (*EventStreamCursorQuery) Aggregate added in v0.3.2

Aggregate returns a EventStreamCursorSelect configured with the given aggregations.

func (*EventStreamCursorQuery) All added in v0.3.2

All executes the query and returns a list of EventStreamCursors.

func (*EventStreamCursorQuery) AllX added in v0.3.2

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

func (*EventStreamCursorQuery) Clone added in v0.3.2

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

func (*EventStreamCursorQuery) Count added in v0.3.2

func (_q *EventStreamCursorQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*EventStreamCursorQuery) CountX added in v0.3.2

func (_q *EventStreamCursorQuery) CountX(ctx context.Context) int

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

func (*EventStreamCursorQuery) Exist added in v0.3.2

func (_q *EventStreamCursorQuery) Exist(ctx context.Context) (bool, error)

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

func (*EventStreamCursorQuery) ExistX added in v0.3.2

func (_q *EventStreamCursorQuery) ExistX(ctx context.Context) bool

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

func (*EventStreamCursorQuery) First added in v0.3.2

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

func (*EventStreamCursorQuery) FirstID added in v0.3.2

func (_q *EventStreamCursorQuery) FirstID(ctx context.Context) (id string, err error)

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

func (*EventStreamCursorQuery) FirstIDX added in v0.3.2

func (_q *EventStreamCursorQuery) FirstIDX(ctx context.Context) string

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

func (*EventStreamCursorQuery) FirstX added in v0.3.2

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

func (*EventStreamCursorQuery) GroupBy added in v0.3.2

func (_q *EventStreamCursorQuery) GroupBy(field string, fields ...string) *EventStreamCursorGroupBy

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

Example:

var v []struct {
	LastSyncedAt time.Time `json:"last_synced_at,omitempty"`
	Count int `json:"count,omitempty"`
}

client.EventStreamCursor.Query().
	GroupBy(eventstreamcursor.FieldLastSyncedAt).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*EventStreamCursorQuery) IDs added in v0.3.2

func (_q *EventStreamCursorQuery) IDs(ctx context.Context) (ids []string, err error)

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

func (*EventStreamCursorQuery) IDsX added in v0.3.2

func (_q *EventStreamCursorQuery) IDsX(ctx context.Context) []string

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

func (*EventStreamCursorQuery) Limit added in v0.3.2

Limit the number of records to be returned by this query.

func (*EventStreamCursorQuery) Offset added in v0.3.2

Offset to start from.

func (*EventStreamCursorQuery) Only added in v0.3.2

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

func (*EventStreamCursorQuery) OnlyID added in v0.3.2

func (_q *EventStreamCursorQuery) OnlyID(ctx context.Context) (id string, err error)

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

func (*EventStreamCursorQuery) OnlyIDX added in v0.3.2

func (_q *EventStreamCursorQuery) OnlyIDX(ctx context.Context) string

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

func (*EventStreamCursorQuery) OnlyX added in v0.3.2

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

func (*EventStreamCursorQuery) Order added in v0.3.2

Order specifies how the records should be ordered.

func (*EventStreamCursorQuery) Select added in v0.3.2

func (_q *EventStreamCursorQuery) Select(fields ...string) *EventStreamCursorSelect

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

Example:

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

client.EventStreamCursor.Query().
	Select(eventstreamcursor.FieldLastSyncedAt).
	Scan(ctx, &v)

func (*EventStreamCursorQuery) Unique added in v0.3.2

Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.

func (*EventStreamCursorQuery) Where added in v0.3.2

Where adds a new predicate for the EventStreamCursorQuery builder.

type EventStreamCursorSelect added in v0.3.2

type EventStreamCursorSelect struct {
	*EventStreamCursorQuery
	// contains filtered or unexported fields
}

EventStreamCursorSelect is the builder for selecting fields of EventStreamCursor entities.

func (*EventStreamCursorSelect) Aggregate added in v0.3.2

Aggregate adds the given aggregation functions to the selector query.

func (*EventStreamCursorSelect) Bool added in v0.3.2

func (s *EventStreamCursorSelect) Bool(ctx context.Context) (_ bool, err error)

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

func (*EventStreamCursorSelect) BoolX added in v0.3.2

func (s *EventStreamCursorSelect) BoolX(ctx context.Context) bool

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

func (*EventStreamCursorSelect) Bools added in v0.3.2

func (s *EventStreamCursorSelect) Bools(ctx context.Context) ([]bool, error)

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

func (*EventStreamCursorSelect) BoolsX added in v0.3.2

func (s *EventStreamCursorSelect) BoolsX(ctx context.Context) []bool

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

func (*EventStreamCursorSelect) Float64 added in v0.3.2

func (s *EventStreamCursorSelect) Float64(ctx context.Context) (_ float64, err error)

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

func (*EventStreamCursorSelect) Float64X added in v0.3.2

func (s *EventStreamCursorSelect) Float64X(ctx context.Context) float64

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

func (*EventStreamCursorSelect) Float64s added in v0.3.2

func (s *EventStreamCursorSelect) Float64s(ctx context.Context) ([]float64, error)

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

func (*EventStreamCursorSelect) Float64sX added in v0.3.2

func (s *EventStreamCursorSelect) Float64sX(ctx context.Context) []float64

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

func (*EventStreamCursorSelect) Int added in v0.3.2

func (s *EventStreamCursorSelect) Int(ctx context.Context) (_ int, err error)

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

func (*EventStreamCursorSelect) IntX added in v0.3.2

func (s *EventStreamCursorSelect) IntX(ctx context.Context) int

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

func (*EventStreamCursorSelect) Ints added in v0.3.2

func (s *EventStreamCursorSelect) Ints(ctx context.Context) ([]int, error)

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

func (*EventStreamCursorSelect) IntsX added in v0.3.2

func (s *EventStreamCursorSelect) IntsX(ctx context.Context) []int

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

func (*EventStreamCursorSelect) Scan added in v0.3.2

func (_s *EventStreamCursorSelect) Scan(ctx context.Context, v any) error

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

func (*EventStreamCursorSelect) ScanX added in v0.3.2

func (s *EventStreamCursorSelect) ScanX(ctx context.Context, v any)

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

func (*EventStreamCursorSelect) String added in v0.3.2

func (s *EventStreamCursorSelect) String(ctx context.Context) (_ string, err error)

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

func (*EventStreamCursorSelect) StringX added in v0.3.2

func (s *EventStreamCursorSelect) StringX(ctx context.Context) string

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

func (*EventStreamCursorSelect) Strings added in v0.3.2

func (s *EventStreamCursorSelect) Strings(ctx context.Context) ([]string, error)

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

func (*EventStreamCursorSelect) StringsX added in v0.3.2

func (s *EventStreamCursorSelect) StringsX(ctx context.Context) []string

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

type EventStreamCursorUpdate added in v0.3.2

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

EventStreamCursorUpdate is the builder for updating EventStreamCursor entities.

func (*EventStreamCursorUpdate) ClearLastID added in v0.3.2

ClearLastID clears the value of the "last_id" field.

func (*EventStreamCursorUpdate) Exec added in v0.3.2

Exec executes the query.

func (*EventStreamCursorUpdate) ExecX added in v0.3.2

func (_u *EventStreamCursorUpdate) ExecX(ctx context.Context)

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

func (*EventStreamCursorUpdate) Mutation added in v0.3.2

Mutation returns the EventStreamCursorMutation object of the builder.

func (*EventStreamCursorUpdate) Save added in v0.3.2

func (_u *EventStreamCursorUpdate) Save(ctx context.Context) (int, error)

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

func (*EventStreamCursorUpdate) SaveX added in v0.3.2

func (_u *EventStreamCursorUpdate) SaveX(ctx context.Context) int

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

func (*EventStreamCursorUpdate) SetLastID added in v0.3.2

SetLastID sets the "last_id" field.

func (*EventStreamCursorUpdate) SetLastSyncedAt added in v0.3.2

func (_u *EventStreamCursorUpdate) SetLastSyncedAt(v time.Time) *EventStreamCursorUpdate

SetLastSyncedAt sets the "last_synced_at" field.

func (*EventStreamCursorUpdate) SetNillableLastID added in v0.3.2

func (_u *EventStreamCursorUpdate) SetNillableLastID(v *string) *EventStreamCursorUpdate

SetNillableLastID sets the "last_id" field if the given value is not nil.

func (*EventStreamCursorUpdate) SetNillableLastSyncedAt added in v0.3.2

func (_u *EventStreamCursorUpdate) SetNillableLastSyncedAt(v *time.Time) *EventStreamCursorUpdate

SetNillableLastSyncedAt sets the "last_synced_at" field if the given value is not nil.

func (*EventStreamCursorUpdate) Where added in v0.3.2

Where appends a list predicates to the EventStreamCursorUpdate builder.

type EventStreamCursorUpdateOne added in v0.3.2

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

EventStreamCursorUpdateOne is the builder for updating a single EventStreamCursor entity.

func (*EventStreamCursorUpdateOne) ClearLastID added in v0.3.2

ClearLastID clears the value of the "last_id" field.

func (*EventStreamCursorUpdateOne) Exec added in v0.3.2

Exec executes the query on the entity.

func (*EventStreamCursorUpdateOne) ExecX added in v0.3.2

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

func (*EventStreamCursorUpdateOne) Mutation added in v0.3.2

Mutation returns the EventStreamCursorMutation object of the builder.

func (*EventStreamCursorUpdateOne) Save added in v0.3.2

Save executes the query and returns the updated EventStreamCursor entity.

func (*EventStreamCursorUpdateOne) SaveX added in v0.3.2

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

func (*EventStreamCursorUpdateOne) Select added in v0.3.2

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

func (*EventStreamCursorUpdateOne) SetLastID added in v0.3.2

SetLastID sets the "last_id" field.

func (*EventStreamCursorUpdateOne) SetLastSyncedAt added in v0.3.2

SetLastSyncedAt sets the "last_synced_at" field.

func (*EventStreamCursorUpdateOne) SetNillableLastID added in v0.3.2

SetNillableLastID sets the "last_id" field if the given value is not nil.

func (*EventStreamCursorUpdateOne) SetNillableLastSyncedAt added in v0.3.2

func (_u *EventStreamCursorUpdateOne) SetNillableLastSyncedAt(v *time.Time) *EventStreamCursorUpdateOne

SetNillableLastSyncedAt sets the "last_synced_at" field if the given value is not nil.

func (*EventStreamCursorUpdateOne) Where added in v0.3.2

Where appends a list predicates to the EventStreamCursorUpdate builder.

type EventStreamCursors added in v0.3.2

type EventStreamCursors []*EventStreamCursor

EventStreamCursors is a parsable slice of EventStreamCursor.

type Hook

type Hook = ent.Hook

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

type InterceptFunc

type InterceptFunc = ent.InterceptFunc

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

type Interceptor

type Interceptor = ent.Interceptor

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

type MutateFunc

type MutateFunc = ent.MutateFunc

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

type Mutation

type Mutation = ent.Mutation

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

type Mutator

type Mutator = ent.Mutator

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

type NotFoundError

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

NotFoundError returns when trying to fetch a specific entity and it was not found in the database.

func (*NotFoundError) Error

func (e *NotFoundError) Error() string

Error implements the error interface.

type NotLoadedError

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

NotLoadedError returns when trying to get a node that was not loaded by the query.

func (*NotLoadedError) Error

func (e *NotLoadedError) Error() string

Error implements the error interface.

type NotSingularError

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

NotSingularError returns when trying to fetch a singular entity and more then one was found in the database.

func (*NotSingularError) Error

func (e *NotSingularError) Error() string

Error implements the error interface.

type Op

type Op = ent.Op

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

type Option

type Option func(*config)

Option function to configure the client.

func Debug

func Debug() Option

Debug enables debug logging on the ent.Driver.

func Driver

func Driver(driver dialect.Driver) Option

Driver configures the client driver.

func Log

func Log(fn func(...any)) Option

Log sets the logging function for debug mode.

type OrderFunc

type OrderFunc func(*sql.Selector)

OrderFunc applies an ordering on the sql selector. Deprecated: Use Asc/Desc functions or the package builders instead.

type Policy

type Policy = ent.Policy

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

type Querier

type Querier = ent.Querier

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

type QuerierFunc

type QuerierFunc = ent.QuerierFunc

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

type Query

type Query = ent.Query

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

type QueryContext

type QueryContext = ent.QueryContext

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

type RollbackFunc

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

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

func (RollbackFunc) Rollback

func (f RollbackFunc) Rollback(ctx context.Context, tx *Tx) error

Rollback calls f(ctx, m).

type RollbackHook

type RollbackHook func(Rollbacker) Rollbacker

RollbackHook defines the "rollback middleware". A function that gets a Rollbacker and returns a Rollbacker. For example:

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

type Rollbacker

type Rollbacker interface {
	Rollback(context.Context, *Tx) error
}

Rollbacker is the interface that wraps the Rollback method.

type SelfAudit

type SelfAudit struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// Timestamp holds the value of the "timestamp" field.
	Timestamp time.Time `json:"timestamp,omitempty"`
	// Action holds the value of the "action" field.
	Action selfaudit.Action `json:"action,omitempty"`
	// AgentName holds the value of the "agent_name" field.
	AgentName string `json:"agent_name,omitempty"`
	// Details holds the value of the "details" field.
	Details map[string]interface{} `json:"details,omitempty"`
	// Result holds the value of the "result" field.
	Result selfaudit.Result `json:"result,omitempty"`
	// ErrorMessage holds the value of the "error_message" field.
	ErrorMessage string `json:"error_message,omitempty"`
	// ToolVersion holds the value of the "tool_version" field.
	ToolVersion string `json:"tool_version,omitempty"`
	// contains filtered or unexported fields
}

SelfAudit is the model entity for the SelfAudit schema.

func (*SelfAudit) String

func (_m *SelfAudit) String() string

String implements the fmt.Stringer.

func (*SelfAudit) Unwrap

func (_m *SelfAudit) Unwrap() *SelfAudit

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

func (*SelfAudit) Update

func (_m *SelfAudit) Update() *SelfAuditUpdateOne

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

func (*SelfAudit) Value

func (_m *SelfAudit) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the SelfAudit. This includes values selected through modifiers, order, etc.

type SelfAuditClient

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

SelfAuditClient is a client for the SelfAudit schema.

func NewSelfAuditClient

func NewSelfAuditClient(c config) *SelfAuditClient

NewSelfAuditClient returns a client for the SelfAudit from the given config.

func (*SelfAuditClient) Create

func (c *SelfAuditClient) Create() *SelfAuditCreate

Create returns a builder for creating a SelfAudit entity.

func (*SelfAuditClient) CreateBulk

func (c *SelfAuditClient) CreateBulk(builders ...*SelfAuditCreate) *SelfAuditCreateBulk

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

func (*SelfAuditClient) Delete

func (c *SelfAuditClient) Delete() *SelfAuditDelete

Delete returns a delete builder for SelfAudit.

func (*SelfAuditClient) DeleteOne

func (c *SelfAuditClient) DeleteOne(_m *SelfAudit) *SelfAuditDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*SelfAuditClient) DeleteOneID

func (c *SelfAuditClient) DeleteOneID(id uuid.UUID) *SelfAuditDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*SelfAuditClient) Get

func (c *SelfAuditClient) Get(ctx context.Context, id uuid.UUID) (*SelfAudit, error)

Get returns a SelfAudit entity by its id.

func (*SelfAuditClient) GetX

func (c *SelfAuditClient) GetX(ctx context.Context, id uuid.UUID) *SelfAudit

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

func (*SelfAuditClient) Hooks

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

Hooks returns the client hooks.

func (*SelfAuditClient) Intercept

func (c *SelfAuditClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `selfaudit.Intercept(f(g(h())))`.

func (*SelfAuditClient) Interceptors

func (c *SelfAuditClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*SelfAuditClient) MapCreateBulk

func (c *SelfAuditClient) MapCreateBulk(slice any, setFunc func(*SelfAuditCreate, int)) *SelfAuditCreateBulk

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (*SelfAuditClient) Query

func (c *SelfAuditClient) Query() *SelfAuditQuery

Query returns a query builder for SelfAudit.

func (*SelfAuditClient) Update

func (c *SelfAuditClient) Update() *SelfAuditUpdate

Update returns an update builder for SelfAudit.

func (*SelfAuditClient) UpdateOne

func (c *SelfAuditClient) UpdateOne(_m *SelfAudit) *SelfAuditUpdateOne

UpdateOne returns an update builder for the given entity.

func (*SelfAuditClient) UpdateOneID

func (c *SelfAuditClient) UpdateOneID(id uuid.UUID) *SelfAuditUpdateOne

UpdateOneID returns an update builder for the given id.

func (*SelfAuditClient) Use

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

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

type SelfAuditCreate

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

SelfAuditCreate is the builder for creating a SelfAudit entity.

func (*SelfAuditCreate) Exec

func (_c *SelfAuditCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*SelfAuditCreate) ExecX

func (_c *SelfAuditCreate) ExecX(ctx context.Context)

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

func (*SelfAuditCreate) Mutation

func (_c *SelfAuditCreate) Mutation() *SelfAuditMutation

Mutation returns the SelfAuditMutation object of the builder.

func (*SelfAuditCreate) Save

func (_c *SelfAuditCreate) Save(ctx context.Context) (*SelfAudit, error)

Save creates the SelfAudit in the database.

func (*SelfAuditCreate) SaveX

func (_c *SelfAuditCreate) SaveX(ctx context.Context) *SelfAudit

SaveX calls Save and panics if Save returns an error.

func (*SelfAuditCreate) SetAction

func (_c *SelfAuditCreate) SetAction(v selfaudit.Action) *SelfAuditCreate

SetAction sets the "action" field.

func (*SelfAuditCreate) SetAgentName

func (_c *SelfAuditCreate) SetAgentName(v string) *SelfAuditCreate

SetAgentName sets the "agent_name" field.

func (*SelfAuditCreate) SetDetails

func (_c *SelfAuditCreate) SetDetails(v map[string]interface{}) *SelfAuditCreate

SetDetails sets the "details" field.

func (*SelfAuditCreate) SetErrorMessage

func (_c *SelfAuditCreate) SetErrorMessage(v string) *SelfAuditCreate

SetErrorMessage sets the "error_message" field.

func (*SelfAuditCreate) SetID

func (_c *SelfAuditCreate) SetID(v uuid.UUID) *SelfAuditCreate

SetID sets the "id" field.

func (*SelfAuditCreate) SetNillableAgentName

func (_c *SelfAuditCreate) SetNillableAgentName(v *string) *SelfAuditCreate

SetNillableAgentName sets the "agent_name" field if the given value is not nil.

func (*SelfAuditCreate) SetNillableErrorMessage

func (_c *SelfAuditCreate) SetNillableErrorMessage(v *string) *SelfAuditCreate

SetNillableErrorMessage sets the "error_message" field if the given value is not nil.

func (*SelfAuditCreate) SetNillableID

func (_c *SelfAuditCreate) SetNillableID(v *uuid.UUID) *SelfAuditCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*SelfAuditCreate) SetNillableResult

func (_c *SelfAuditCreate) SetNillableResult(v *selfaudit.Result) *SelfAuditCreate

SetNillableResult sets the "result" field if the given value is not nil.

func (*SelfAuditCreate) SetNillableTimestamp

func (_c *SelfAuditCreate) SetNillableTimestamp(v *time.Time) *SelfAuditCreate

SetNillableTimestamp sets the "timestamp" field if the given value is not nil.

func (*SelfAuditCreate) SetResult

func (_c *SelfAuditCreate) SetResult(v selfaudit.Result) *SelfAuditCreate

SetResult sets the "result" field.

func (*SelfAuditCreate) SetTimestamp

func (_c *SelfAuditCreate) SetTimestamp(v time.Time) *SelfAuditCreate

SetTimestamp sets the "timestamp" field.

func (*SelfAuditCreate) SetToolVersion

func (_c *SelfAuditCreate) SetToolVersion(v string) *SelfAuditCreate

SetToolVersion sets the "tool_version" field.

type SelfAuditCreateBulk

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

SelfAuditCreateBulk is the builder for creating many SelfAudit entities in bulk.

func (*SelfAuditCreateBulk) Exec

func (_c *SelfAuditCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*SelfAuditCreateBulk) ExecX

func (_c *SelfAuditCreateBulk) ExecX(ctx context.Context)

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

func (*SelfAuditCreateBulk) Save

func (_c *SelfAuditCreateBulk) Save(ctx context.Context) ([]*SelfAudit, error)

Save creates the SelfAudit entities in the database.

func (*SelfAuditCreateBulk) SaveX

func (_c *SelfAuditCreateBulk) SaveX(ctx context.Context) []*SelfAudit

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

type SelfAuditDelete

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

SelfAuditDelete is the builder for deleting a SelfAudit entity.

func (*SelfAuditDelete) Exec

func (_d *SelfAuditDelete) Exec(ctx context.Context) (int, error)

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

func (*SelfAuditDelete) ExecX

func (_d *SelfAuditDelete) ExecX(ctx context.Context) int

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

func (*SelfAuditDelete) Where

Where appends a list predicates to the SelfAuditDelete builder.

type SelfAuditDeleteOne

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

SelfAuditDeleteOne is the builder for deleting a single SelfAudit entity.

func (*SelfAuditDeleteOne) Exec

func (_d *SelfAuditDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*SelfAuditDeleteOne) ExecX

func (_d *SelfAuditDeleteOne) ExecX(ctx context.Context)

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

func (*SelfAuditDeleteOne) Where

Where appends a list predicates to the SelfAuditDelete builder.

type SelfAuditGroupBy

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

SelfAuditGroupBy is the group-by builder for SelfAudit entities.

func (*SelfAuditGroupBy) Aggregate

func (_g *SelfAuditGroupBy) Aggregate(fns ...AggregateFunc) *SelfAuditGroupBy

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

func (*SelfAuditGroupBy) Bool

func (s *SelfAuditGroupBy) Bool(ctx context.Context) (_ bool, err error)

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

func (*SelfAuditGroupBy) BoolX

func (s *SelfAuditGroupBy) BoolX(ctx context.Context) bool

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

func (*SelfAuditGroupBy) Bools

func (s *SelfAuditGroupBy) Bools(ctx context.Context) ([]bool, error)

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

func (*SelfAuditGroupBy) BoolsX

func (s *SelfAuditGroupBy) BoolsX(ctx context.Context) []bool

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

func (*SelfAuditGroupBy) Float64

func (s *SelfAuditGroupBy) Float64(ctx context.Context) (_ float64, err error)

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

func (*SelfAuditGroupBy) Float64X

func (s *SelfAuditGroupBy) Float64X(ctx context.Context) float64

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

func (*SelfAuditGroupBy) Float64s

func (s *SelfAuditGroupBy) Float64s(ctx context.Context) ([]float64, error)

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

func (*SelfAuditGroupBy) Float64sX

func (s *SelfAuditGroupBy) Float64sX(ctx context.Context) []float64

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

func (*SelfAuditGroupBy) Int

func (s *SelfAuditGroupBy) Int(ctx context.Context) (_ int, err error)

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

func (*SelfAuditGroupBy) IntX

func (s *SelfAuditGroupBy) IntX(ctx context.Context) int

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

func (*SelfAuditGroupBy) Ints

func (s *SelfAuditGroupBy) Ints(ctx context.Context) ([]int, error)

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

func (*SelfAuditGroupBy) IntsX

func (s *SelfAuditGroupBy) IntsX(ctx context.Context) []int

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

func (*SelfAuditGroupBy) Scan

func (_g *SelfAuditGroupBy) Scan(ctx context.Context, v any) error

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

func (*SelfAuditGroupBy) ScanX

func (s *SelfAuditGroupBy) ScanX(ctx context.Context, v any)

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

func (*SelfAuditGroupBy) String

func (s *SelfAuditGroupBy) String(ctx context.Context) (_ string, err error)

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

func (*SelfAuditGroupBy) StringX

func (s *SelfAuditGroupBy) StringX(ctx context.Context) string

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

func (*SelfAuditGroupBy) Strings

func (s *SelfAuditGroupBy) Strings(ctx context.Context) ([]string, error)

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

func (*SelfAuditGroupBy) StringsX

func (s *SelfAuditGroupBy) StringsX(ctx context.Context) []string

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

type SelfAuditMutation

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

SelfAuditMutation represents an operation that mutates the SelfAudit nodes in the graph.

func (*SelfAuditMutation) Action

func (m *SelfAuditMutation) Action() (r selfaudit.Action, exists bool)

Action returns the value of the "action" field in the mutation.

func (*SelfAuditMutation) AddField

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

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

func (*SelfAuditMutation) AddedEdges

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

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

func (*SelfAuditMutation) AddedField

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

AddedField returns the numeric value that was incremented/decremented on a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*SelfAuditMutation) AddedFields

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

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

func (*SelfAuditMutation) AddedIDs

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

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

func (*SelfAuditMutation) AgentName

func (m *SelfAuditMutation) AgentName() (r string, exists bool)

AgentName returns the value of the "agent_name" field in the mutation.

func (*SelfAuditMutation) AgentNameCleared

func (m *SelfAuditMutation) AgentNameCleared() bool

AgentNameCleared returns if the "agent_name" field was cleared in this mutation.

func (*SelfAuditMutation) ClearAgentName

func (m *SelfAuditMutation) ClearAgentName()

ClearAgentName clears the value of the "agent_name" field.

func (*SelfAuditMutation) ClearDetails

func (m *SelfAuditMutation) ClearDetails()

ClearDetails clears the value of the "details" field.

func (*SelfAuditMutation) ClearEdge

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

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

func (*SelfAuditMutation) ClearErrorMessage

func (m *SelfAuditMutation) ClearErrorMessage()

ClearErrorMessage clears the value of the "error_message" field.

func (*SelfAuditMutation) ClearField

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

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

func (*SelfAuditMutation) ClearedEdges

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

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

func (*SelfAuditMutation) ClearedFields

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

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

func (SelfAuditMutation) Client

func (m SelfAuditMutation) 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 (*SelfAuditMutation) Details

func (m *SelfAuditMutation) Details() (r map[string]interface{}, exists bool)

Details returns the value of the "details" field in the mutation.

func (*SelfAuditMutation) DetailsCleared

func (m *SelfAuditMutation) DetailsCleared() bool

DetailsCleared returns if the "details" field was cleared in this mutation.

func (*SelfAuditMutation) EdgeCleared

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

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

func (*SelfAuditMutation) ErrorMessage

func (m *SelfAuditMutation) ErrorMessage() (r string, exists bool)

ErrorMessage returns the value of the "error_message" field in the mutation.

func (*SelfAuditMutation) ErrorMessageCleared

func (m *SelfAuditMutation) ErrorMessageCleared() bool

ErrorMessageCleared returns if the "error_message" field was cleared in this mutation.

func (*SelfAuditMutation) Field

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

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

func (*SelfAuditMutation) FieldCleared

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

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

func (*SelfAuditMutation) Fields

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

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

func (*SelfAuditMutation) ID

func (m *SelfAuditMutation) ID() (id uuid.UUID, exists bool)

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

func (*SelfAuditMutation) IDs

func (m *SelfAuditMutation) IDs(ctx context.Context) ([]uuid.UUID, error)

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

func (*SelfAuditMutation) OldAction

func (m *SelfAuditMutation) OldAction(ctx context.Context) (v selfaudit.Action, err error)

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

func (*SelfAuditMutation) OldAgentName

func (m *SelfAuditMutation) OldAgentName(ctx context.Context) (v string, err error)

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

func (*SelfAuditMutation) OldDetails

func (m *SelfAuditMutation) OldDetails(ctx context.Context) (v map[string]interface{}, err error)

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

func (*SelfAuditMutation) OldErrorMessage

func (m *SelfAuditMutation) OldErrorMessage(ctx context.Context) (v string, err error)

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

func (*SelfAuditMutation) OldField

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

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

func (*SelfAuditMutation) OldResult

func (m *SelfAuditMutation) OldResult(ctx context.Context) (v selfaudit.Result, err error)

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

func (*SelfAuditMutation) OldTimestamp

func (m *SelfAuditMutation) OldTimestamp(ctx context.Context) (v time.Time, err error)

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

func (*SelfAuditMutation) OldToolVersion

func (m *SelfAuditMutation) OldToolVersion(ctx context.Context) (v string, err error)

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

func (*SelfAuditMutation) Op

func (m *SelfAuditMutation) Op() Op

Op returns the operation name.

func (*SelfAuditMutation) RemovedEdges

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

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

func (*SelfAuditMutation) RemovedIDs

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

RemovedIDs returns all IDs (to other nodes) that were removed for the edge with the given name in this mutation.

func (*SelfAuditMutation) ResetAction

func (m *SelfAuditMutation) ResetAction()

ResetAction resets all changes to the "action" field.

func (*SelfAuditMutation) ResetAgentName

func (m *SelfAuditMutation) ResetAgentName()

ResetAgentName resets all changes to the "agent_name" field.

func (*SelfAuditMutation) ResetDetails

func (m *SelfAuditMutation) ResetDetails()

ResetDetails resets all changes to the "details" field.

func (*SelfAuditMutation) ResetEdge

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

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

func (*SelfAuditMutation) ResetErrorMessage

func (m *SelfAuditMutation) ResetErrorMessage()

ResetErrorMessage resets all changes to the "error_message" field.

func (*SelfAuditMutation) ResetField

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

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

func (*SelfAuditMutation) ResetResult

func (m *SelfAuditMutation) ResetResult()

ResetResult resets all changes to the "result" field.

func (*SelfAuditMutation) ResetTimestamp

func (m *SelfAuditMutation) ResetTimestamp()

ResetTimestamp resets all changes to the "timestamp" field.

func (*SelfAuditMutation) ResetToolVersion

func (m *SelfAuditMutation) ResetToolVersion()

ResetToolVersion resets all changes to the "tool_version" field.

func (*SelfAuditMutation) Result

func (m *SelfAuditMutation) Result() (r selfaudit.Result, exists bool)

Result returns the value of the "result" field in the mutation.

func (*SelfAuditMutation) SetAction

func (m *SelfAuditMutation) SetAction(s selfaudit.Action)

SetAction sets the "action" field.

func (*SelfAuditMutation) SetAgentName

func (m *SelfAuditMutation) SetAgentName(s string)

SetAgentName sets the "agent_name" field.

func (*SelfAuditMutation) SetDetails

func (m *SelfAuditMutation) SetDetails(value map[string]interface{})

SetDetails sets the "details" field.

func (*SelfAuditMutation) SetErrorMessage

func (m *SelfAuditMutation) SetErrorMessage(s string)

SetErrorMessage sets the "error_message" field.

func (*SelfAuditMutation) SetField

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

SetField sets the value of a field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*SelfAuditMutation) SetID

func (m *SelfAuditMutation) SetID(id uuid.UUID)

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

func (*SelfAuditMutation) SetOp

func (m *SelfAuditMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*SelfAuditMutation) SetResult

func (m *SelfAuditMutation) SetResult(s selfaudit.Result)

SetResult sets the "result" field.

func (*SelfAuditMutation) SetTimestamp

func (m *SelfAuditMutation) SetTimestamp(t time.Time)

SetTimestamp sets the "timestamp" field.

func (*SelfAuditMutation) SetToolVersion

func (m *SelfAuditMutation) SetToolVersion(s string)

SetToolVersion sets the "tool_version" field.

func (*SelfAuditMutation) Timestamp

func (m *SelfAuditMutation) Timestamp() (r time.Time, exists bool)

Timestamp returns the value of the "timestamp" field in the mutation.

func (*SelfAuditMutation) ToolVersion

func (m *SelfAuditMutation) ToolVersion() (r string, exists bool)

ToolVersion returns the value of the "tool_version" field in the mutation.

func (SelfAuditMutation) Tx

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

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

func (*SelfAuditMutation) Type

func (m *SelfAuditMutation) Type() string

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

func (*SelfAuditMutation) Where

func (m *SelfAuditMutation) Where(ps ...predicate.SelfAudit)

Where appends a list predicates to the SelfAuditMutation builder.

func (*SelfAuditMutation) WhereP

func (m *SelfAuditMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the SelfAuditMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type SelfAuditQuery

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

SelfAuditQuery is the builder for querying SelfAudit entities.

func (*SelfAuditQuery) Aggregate

func (_q *SelfAuditQuery) Aggregate(fns ...AggregateFunc) *SelfAuditSelect

Aggregate returns a SelfAuditSelect configured with the given aggregations.

func (*SelfAuditQuery) All

func (_q *SelfAuditQuery) All(ctx context.Context) ([]*SelfAudit, error)

All executes the query and returns a list of SelfAudits.

func (*SelfAuditQuery) AllX

func (_q *SelfAuditQuery) AllX(ctx context.Context) []*SelfAudit

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

func (*SelfAuditQuery) Clone

func (_q *SelfAuditQuery) Clone() *SelfAuditQuery

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

func (*SelfAuditQuery) Count

func (_q *SelfAuditQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*SelfAuditQuery) CountX

func (_q *SelfAuditQuery) CountX(ctx context.Context) int

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

func (*SelfAuditQuery) Exist

func (_q *SelfAuditQuery) Exist(ctx context.Context) (bool, error)

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

func (*SelfAuditQuery) ExistX

func (_q *SelfAuditQuery) ExistX(ctx context.Context) bool

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

func (*SelfAuditQuery) First

func (_q *SelfAuditQuery) First(ctx context.Context) (*SelfAudit, error)

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

func (*SelfAuditQuery) FirstID

func (_q *SelfAuditQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

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

func (*SelfAuditQuery) FirstIDX

func (_q *SelfAuditQuery) FirstIDX(ctx context.Context) uuid.UUID

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

func (*SelfAuditQuery) FirstX

func (_q *SelfAuditQuery) FirstX(ctx context.Context) *SelfAudit

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

func (*SelfAuditQuery) GroupBy

func (_q *SelfAuditQuery) GroupBy(field string, fields ...string) *SelfAuditGroupBy

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

Example:

var v []struct {
	Timestamp time.Time `json:"timestamp,omitempty"`
	Count int `json:"count,omitempty"`
}

client.SelfAudit.Query().
	GroupBy(selfaudit.FieldTimestamp).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*SelfAuditQuery) IDs

func (_q *SelfAuditQuery) IDs(ctx context.Context) (ids []uuid.UUID, err error)

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

func (*SelfAuditQuery) IDsX

func (_q *SelfAuditQuery) IDsX(ctx context.Context) []uuid.UUID

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

func (*SelfAuditQuery) Limit

func (_q *SelfAuditQuery) Limit(limit int) *SelfAuditQuery

Limit the number of records to be returned by this query.

func (*SelfAuditQuery) Offset

func (_q *SelfAuditQuery) Offset(offset int) *SelfAuditQuery

Offset to start from.

func (*SelfAuditQuery) Only

func (_q *SelfAuditQuery) Only(ctx context.Context) (*SelfAudit, error)

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

func (*SelfAuditQuery) OnlyID

func (_q *SelfAuditQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

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

func (*SelfAuditQuery) OnlyIDX

func (_q *SelfAuditQuery) OnlyIDX(ctx context.Context) uuid.UUID

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

func (*SelfAuditQuery) OnlyX

func (_q *SelfAuditQuery) OnlyX(ctx context.Context) *SelfAudit

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

func (*SelfAuditQuery) Order

Order specifies how the records should be ordered.

func (*SelfAuditQuery) Select

func (_q *SelfAuditQuery) Select(fields ...string) *SelfAuditSelect

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

Example:

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

client.SelfAudit.Query().
	Select(selfaudit.FieldTimestamp).
	Scan(ctx, &v)

func (*SelfAuditQuery) Unique

func (_q *SelfAuditQuery) Unique(unique bool) *SelfAuditQuery

Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.

func (*SelfAuditQuery) Where

Where adds a new predicate for the SelfAuditQuery builder.

type SelfAuditSelect

type SelfAuditSelect struct {
	*SelfAuditQuery
	// contains filtered or unexported fields
}

SelfAuditSelect is the builder for selecting fields of SelfAudit entities.

func (*SelfAuditSelect) Aggregate

func (_s *SelfAuditSelect) Aggregate(fns ...AggregateFunc) *SelfAuditSelect

Aggregate adds the given aggregation functions to the selector query.

func (*SelfAuditSelect) Bool

func (s *SelfAuditSelect) Bool(ctx context.Context) (_ bool, err error)

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

func (*SelfAuditSelect) BoolX

func (s *SelfAuditSelect) BoolX(ctx context.Context) bool

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

func (*SelfAuditSelect) Bools

func (s *SelfAuditSelect) Bools(ctx context.Context) ([]bool, error)

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

func (*SelfAuditSelect) BoolsX

func (s *SelfAuditSelect) BoolsX(ctx context.Context) []bool

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

func (*SelfAuditSelect) Float64

func (s *SelfAuditSelect) Float64(ctx context.Context) (_ float64, err error)

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

func (*SelfAuditSelect) Float64X

func (s *SelfAuditSelect) Float64X(ctx context.Context) float64

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

func (*SelfAuditSelect) Float64s

func (s *SelfAuditSelect) Float64s(ctx context.Context) ([]float64, error)

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

func (*SelfAuditSelect) Float64sX

func (s *SelfAuditSelect) Float64sX(ctx context.Context) []float64

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

func (*SelfAuditSelect) Int

func (s *SelfAuditSelect) Int(ctx context.Context) (_ int, err error)

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

func (*SelfAuditSelect) IntX

func (s *SelfAuditSelect) IntX(ctx context.Context) int

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

func (*SelfAuditSelect) Ints

func (s *SelfAuditSelect) Ints(ctx context.Context) ([]int, error)

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

func (*SelfAuditSelect) IntsX

func (s *SelfAuditSelect) IntsX(ctx context.Context) []int

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

func (*SelfAuditSelect) Scan

func (_s *SelfAuditSelect) Scan(ctx context.Context, v any) error

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

func (*SelfAuditSelect) ScanX

func (s *SelfAuditSelect) ScanX(ctx context.Context, v any)

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

func (*SelfAuditSelect) String

func (s *SelfAuditSelect) String(ctx context.Context) (_ string, err error)

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

func (*SelfAuditSelect) StringX

func (s *SelfAuditSelect) StringX(ctx context.Context) string

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

func (*SelfAuditSelect) Strings

func (s *SelfAuditSelect) Strings(ctx context.Context) ([]string, error)

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

func (*SelfAuditSelect) StringsX

func (s *SelfAuditSelect) StringsX(ctx context.Context) []string

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

type SelfAuditUpdate

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

SelfAuditUpdate is the builder for updating SelfAudit entities.

func (*SelfAuditUpdate) ClearAgentName

func (_u *SelfAuditUpdate) ClearAgentName() *SelfAuditUpdate

ClearAgentName clears the value of the "agent_name" field.

func (*SelfAuditUpdate) ClearDetails

func (_u *SelfAuditUpdate) ClearDetails() *SelfAuditUpdate

ClearDetails clears the value of the "details" field.

func (*SelfAuditUpdate) ClearErrorMessage

func (_u *SelfAuditUpdate) ClearErrorMessage() *SelfAuditUpdate

ClearErrorMessage clears the value of the "error_message" field.

func (*SelfAuditUpdate) Exec

func (_u *SelfAuditUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*SelfAuditUpdate) ExecX

func (_u *SelfAuditUpdate) ExecX(ctx context.Context)

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

func (*SelfAuditUpdate) Mutation

func (_u *SelfAuditUpdate) Mutation() *SelfAuditMutation

Mutation returns the SelfAuditMutation object of the builder.

func (*SelfAuditUpdate) Save

func (_u *SelfAuditUpdate) Save(ctx context.Context) (int, error)

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

func (*SelfAuditUpdate) SaveX

func (_u *SelfAuditUpdate) SaveX(ctx context.Context) int

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

func (*SelfAuditUpdate) SetAction

func (_u *SelfAuditUpdate) SetAction(v selfaudit.Action) *SelfAuditUpdate

SetAction sets the "action" field.

func (*SelfAuditUpdate) SetAgentName

func (_u *SelfAuditUpdate) SetAgentName(v string) *SelfAuditUpdate

SetAgentName sets the "agent_name" field.

func (*SelfAuditUpdate) SetDetails

func (_u *SelfAuditUpdate) SetDetails(v map[string]interface{}) *SelfAuditUpdate

SetDetails sets the "details" field.

func (*SelfAuditUpdate) SetErrorMessage

func (_u *SelfAuditUpdate) SetErrorMessage(v string) *SelfAuditUpdate

SetErrorMessage sets the "error_message" field.

func (*SelfAuditUpdate) SetNillableAction

func (_u *SelfAuditUpdate) SetNillableAction(v *selfaudit.Action) *SelfAuditUpdate

SetNillableAction sets the "action" field if the given value is not nil.

func (*SelfAuditUpdate) SetNillableAgentName

func (_u *SelfAuditUpdate) SetNillableAgentName(v *string) *SelfAuditUpdate

SetNillableAgentName sets the "agent_name" field if the given value is not nil.

func (*SelfAuditUpdate) SetNillableErrorMessage

func (_u *SelfAuditUpdate) SetNillableErrorMessage(v *string) *SelfAuditUpdate

SetNillableErrorMessage sets the "error_message" field if the given value is not nil.

func (*SelfAuditUpdate) SetNillableResult

func (_u *SelfAuditUpdate) SetNillableResult(v *selfaudit.Result) *SelfAuditUpdate

SetNillableResult sets the "result" field if the given value is not nil.

func (*SelfAuditUpdate) SetNillableToolVersion

func (_u *SelfAuditUpdate) SetNillableToolVersion(v *string) *SelfAuditUpdate

SetNillableToolVersion sets the "tool_version" field if the given value is not nil.

func (*SelfAuditUpdate) SetResult

func (_u *SelfAuditUpdate) SetResult(v selfaudit.Result) *SelfAuditUpdate

SetResult sets the "result" field.

func (*SelfAuditUpdate) SetToolVersion

func (_u *SelfAuditUpdate) SetToolVersion(v string) *SelfAuditUpdate

SetToolVersion sets the "tool_version" field.

func (*SelfAuditUpdate) Where

Where appends a list predicates to the SelfAuditUpdate builder.

type SelfAuditUpdateOne

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

SelfAuditUpdateOne is the builder for updating a single SelfAudit entity.

func (*SelfAuditUpdateOne) ClearAgentName

func (_u *SelfAuditUpdateOne) ClearAgentName() *SelfAuditUpdateOne

ClearAgentName clears the value of the "agent_name" field.

func (*SelfAuditUpdateOne) ClearDetails

func (_u *SelfAuditUpdateOne) ClearDetails() *SelfAuditUpdateOne

ClearDetails clears the value of the "details" field.

func (*SelfAuditUpdateOne) ClearErrorMessage

func (_u *SelfAuditUpdateOne) ClearErrorMessage() *SelfAuditUpdateOne

ClearErrorMessage clears the value of the "error_message" field.

func (*SelfAuditUpdateOne) Exec

func (_u *SelfAuditUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*SelfAuditUpdateOne) ExecX

func (_u *SelfAuditUpdateOne) ExecX(ctx context.Context)

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

func (*SelfAuditUpdateOne) Mutation

func (_u *SelfAuditUpdateOne) Mutation() *SelfAuditMutation

Mutation returns the SelfAuditMutation object of the builder.

func (*SelfAuditUpdateOne) Save

func (_u *SelfAuditUpdateOne) Save(ctx context.Context) (*SelfAudit, error)

Save executes the query and returns the updated SelfAudit entity.

func (*SelfAuditUpdateOne) SaveX

func (_u *SelfAuditUpdateOne) SaveX(ctx context.Context) *SelfAudit

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

func (*SelfAuditUpdateOne) Select

func (_u *SelfAuditUpdateOne) Select(field string, fields ...string) *SelfAuditUpdateOne

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

func (*SelfAuditUpdateOne) SetAction

SetAction sets the "action" field.

func (*SelfAuditUpdateOne) SetAgentName

func (_u *SelfAuditUpdateOne) SetAgentName(v string) *SelfAuditUpdateOne

SetAgentName sets the "agent_name" field.

func (*SelfAuditUpdateOne) SetDetails

func (_u *SelfAuditUpdateOne) SetDetails(v map[string]interface{}) *SelfAuditUpdateOne

SetDetails sets the "details" field.

func (*SelfAuditUpdateOne) SetErrorMessage

func (_u *SelfAuditUpdateOne) SetErrorMessage(v string) *SelfAuditUpdateOne

SetErrorMessage sets the "error_message" field.

func (*SelfAuditUpdateOne) SetNillableAction

func (_u *SelfAuditUpdateOne) SetNillableAction(v *selfaudit.Action) *SelfAuditUpdateOne

SetNillableAction sets the "action" field if the given value is not nil.

func (*SelfAuditUpdateOne) SetNillableAgentName

func (_u *SelfAuditUpdateOne) SetNillableAgentName(v *string) *SelfAuditUpdateOne

SetNillableAgentName sets the "agent_name" field if the given value is not nil.

func (*SelfAuditUpdateOne) SetNillableErrorMessage

func (_u *SelfAuditUpdateOne) SetNillableErrorMessage(v *string) *SelfAuditUpdateOne

SetNillableErrorMessage sets the "error_message" field if the given value is not nil.

func (*SelfAuditUpdateOne) SetNillableResult

func (_u *SelfAuditUpdateOne) SetNillableResult(v *selfaudit.Result) *SelfAuditUpdateOne

SetNillableResult sets the "result" field if the given value is not nil.

func (*SelfAuditUpdateOne) SetNillableToolVersion

func (_u *SelfAuditUpdateOne) SetNillableToolVersion(v *string) *SelfAuditUpdateOne

SetNillableToolVersion sets the "tool_version" field if the given value is not nil.

func (*SelfAuditUpdateOne) SetResult

SetResult sets the "result" field.

func (*SelfAuditUpdateOne) SetToolVersion

func (_u *SelfAuditUpdateOne) SetToolVersion(v string) *SelfAuditUpdateOne

SetToolVersion sets the "tool_version" field.

func (*SelfAuditUpdateOne) Where

Where appends a list predicates to the SelfAuditUpdate builder.

type SelfAudits

type SelfAudits []*SelfAudit

SelfAudits is a parsable slice of SelfAudit.

type Session

type Session struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// Original session ID from the agent for correlation
	AgentSessionID string `json:"agent_session_id,omitempty"`
	// AgentName holds the value of the "agent_name" field.
	AgentName string `json:"agent_name,omitempty"`
	// AgentVersion holds the value of the "agent_version" field.
	AgentVersion string `json:"agent_version,omitempty"`
	// StartedAt holds the value of the "started_at" field.
	StartedAt time.Time `json:"started_at,omitempty"`
	// EndedAt holds the value of the "ended_at" field.
	EndedAt *time.Time `json:"ended_at,omitempty"`
	// WorkingDirectory holds the value of the "working_directory" field.
	WorkingDirectory string `json:"working_directory,omitempty"`
	// ProjectName holds the value of the "project_name" field.
	ProjectName string `json:"project_name,omitempty"`
	// TotalActions holds the value of the "total_actions" field.
	TotalActions int `json:"total_actions,omitempty"`
	// FilesRead holds the value of the "files_read" field.
	FilesRead int `json:"files_read,omitempty"`
	// FilesWritten holds the value of the "files_written" field.
	FilesWritten int `json:"files_written,omitempty"`
	// CommandsExecuted holds the value of the "commands_executed" field.
	CommandsExecuted int `json:"commands_executed,omitempty"`
	// Errors holds the value of the "errors" field.
	Errors int `json:"errors,omitempty"`
	// SensitiveActions holds the value of the "sensitive_actions" field.
	SensitiveActions int `json:"sensitive_actions,omitempty"`
	// BlockedActions holds the value of the "blocked_actions" field.
	BlockedActions int `json:"blocked_actions,omitempty"`
	// TranscriptPath holds the value of the "transcript_path" field.
	TranscriptPath string `json:"transcript_path,omitempty"`
	// InputTokens holds the value of the "input_tokens" field.
	InputTokens int64 `json:"input_tokens,omitempty"`
	// OutputTokens holds the value of the "output_tokens" field.
	OutputTokens int64 `json:"output_tokens,omitempty"`
	// CacheReadTokens holds the value of the "cache_read_tokens" field.
	CacheReadTokens int64 `json:"cache_read_tokens,omitempty"`
	// CacheWriteTokens holds the value of the "cache_write_tokens" field.
	CacheWriteTokens int64 `json:"cache_write_tokens,omitempty"`
	// EstimatedCostUsd holds the value of the "estimated_cost_usd" field.
	EstimatedCostUsd float64 `json:"estimated_cost_usd,omitempty"`
	// ModelUsage holds the value of the "model_usage" field.
	ModelUsage []map[string]interface{} `json:"model_usage,omitempty"`
	// CostSource holds the value of the "cost_source" field.
	CostSource string `json:"cost_source,omitempty"`
	// CostComputedAt holds the value of the "cost_computed_at" field.
	CostComputedAt *time.Time `json:"cost_computed_at,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the SessionQuery when eager-loading is set.
	Edges SessionEdges `json:"edges"`
	// contains filtered or unexported fields
}

Session is the model entity for the Session schema.

func (*Session) QueryEvents

func (_m *Session) QueryEvents() *AuditEventQuery

QueryEvents queries the "events" edge of the Session entity.

func (*Session) String

func (_m *Session) String() string

String implements the fmt.Stringer.

func (*Session) Unwrap

func (_m *Session) Unwrap() *Session

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

func (*Session) Update

func (_m *Session) Update() *SessionUpdateOne

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

func (*Session) Value

func (_m *Session) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the Session. This includes values selected through modifiers, order, etc.

type SessionClient

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

SessionClient is a client for the Session schema.

func NewSessionClient

func NewSessionClient(c config) *SessionClient

NewSessionClient returns a client for the Session from the given config.

func (*SessionClient) Create

func (c *SessionClient) Create() *SessionCreate

Create returns a builder for creating a Session entity.

func (*SessionClient) CreateBulk

func (c *SessionClient) CreateBulk(builders ...*SessionCreate) *SessionCreateBulk

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

func (*SessionClient) Delete

func (c *SessionClient) Delete() *SessionDelete

Delete returns a delete builder for Session.

func (*SessionClient) DeleteOne

func (c *SessionClient) DeleteOne(_m *Session) *SessionDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*SessionClient) DeleteOneID

func (c *SessionClient) DeleteOneID(id uuid.UUID) *SessionDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*SessionClient) Get

func (c *SessionClient) Get(ctx context.Context, id uuid.UUID) (*Session, error)

Get returns a Session entity by its id.

func (*SessionClient) GetX

func (c *SessionClient) GetX(ctx context.Context, id uuid.UUID) *Session

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

func (*SessionClient) Hooks

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

Hooks returns the client hooks.

func (*SessionClient) Intercept

func (c *SessionClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `session.Intercept(f(g(h())))`.

func (*SessionClient) Interceptors

func (c *SessionClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*SessionClient) MapCreateBulk

func (c *SessionClient) MapCreateBulk(slice any, setFunc func(*SessionCreate, int)) *SessionCreateBulk

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (*SessionClient) Query

func (c *SessionClient) Query() *SessionQuery

Query returns a query builder for Session.

func (*SessionClient) QueryEvents

func (c *SessionClient) QueryEvents(_m *Session) *AuditEventQuery

QueryEvents queries the events edge of a Session.

func (*SessionClient) Update

func (c *SessionClient) Update() *SessionUpdate

Update returns an update builder for Session.

func (*SessionClient) UpdateOne

func (c *SessionClient) UpdateOne(_m *Session) *SessionUpdateOne

UpdateOne returns an update builder for the given entity.

func (*SessionClient) UpdateOneID

func (c *SessionClient) UpdateOneID(id uuid.UUID) *SessionUpdateOne

UpdateOneID returns an update builder for the given id.

func (*SessionClient) Use

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

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

type SessionCreate

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

SessionCreate is the builder for creating a Session entity.

func (*SessionCreate) AddEventIDs

func (_c *SessionCreate) AddEventIDs(ids ...uuid.UUID) *SessionCreate

AddEventIDs adds the "events" edge to the AuditEvent entity by IDs.

func (*SessionCreate) AddEvents

func (_c *SessionCreate) AddEvents(v ...*AuditEvent) *SessionCreate

AddEvents adds the "events" edges to the AuditEvent entity.

func (*SessionCreate) Exec

func (_c *SessionCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*SessionCreate) ExecX

func (_c *SessionCreate) ExecX(ctx context.Context)

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

func (*SessionCreate) Mutation

func (_c *SessionCreate) Mutation() *SessionMutation

Mutation returns the SessionMutation object of the builder.

func (*SessionCreate) Save

func (_c *SessionCreate) Save(ctx context.Context) (*Session, error)

Save creates the Session in the database.

func (*SessionCreate) SaveX

func (_c *SessionCreate) SaveX(ctx context.Context) *Session

SaveX calls Save and panics if Save returns an error.

func (*SessionCreate) SetAgentName

func (_c *SessionCreate) SetAgentName(v string) *SessionCreate

SetAgentName sets the "agent_name" field.

func (*SessionCreate) SetAgentSessionID

func (_c *SessionCreate) SetAgentSessionID(v string) *SessionCreate

SetAgentSessionID sets the "agent_session_id" field.

func (*SessionCreate) SetAgentVersion

func (_c *SessionCreate) SetAgentVersion(v string) *SessionCreate

SetAgentVersion sets the "agent_version" field.

func (*SessionCreate) SetBlockedActions added in v0.5.0

func (_c *SessionCreate) SetBlockedActions(v int) *SessionCreate

SetBlockedActions sets the "blocked_actions" field.

func (*SessionCreate) SetCacheReadTokens added in v0.4.0

func (_c *SessionCreate) SetCacheReadTokens(v int64) *SessionCreate

SetCacheReadTokens sets the "cache_read_tokens" field.

func (*SessionCreate) SetCacheWriteTokens added in v0.4.0

func (_c *SessionCreate) SetCacheWriteTokens(v int64) *SessionCreate

SetCacheWriteTokens sets the "cache_write_tokens" field.

func (*SessionCreate) SetCommandsExecuted

func (_c *SessionCreate) SetCommandsExecuted(v int) *SessionCreate

SetCommandsExecuted sets the "commands_executed" field.

func (*SessionCreate) SetCostComputedAt added in v0.4.0

func (_c *SessionCreate) SetCostComputedAt(v time.Time) *SessionCreate

SetCostComputedAt sets the "cost_computed_at" field.

func (*SessionCreate) SetCostSource added in v0.4.0

func (_c *SessionCreate) SetCostSource(v string) *SessionCreate

SetCostSource sets the "cost_source" field.

func (*SessionCreate) SetEndedAt

func (_c *SessionCreate) SetEndedAt(v time.Time) *SessionCreate

SetEndedAt sets the "ended_at" field.

func (*SessionCreate) SetErrors

func (_c *SessionCreate) SetErrors(v int) *SessionCreate

SetErrors sets the "errors" field.

func (*SessionCreate) SetEstimatedCostUsd added in v0.4.0

func (_c *SessionCreate) SetEstimatedCostUsd(v float64) *SessionCreate

SetEstimatedCostUsd sets the "estimated_cost_usd" field.

func (*SessionCreate) SetFilesRead

func (_c *SessionCreate) SetFilesRead(v int) *SessionCreate

SetFilesRead sets the "files_read" field.

func (*SessionCreate) SetFilesWritten

func (_c *SessionCreate) SetFilesWritten(v int) *SessionCreate

SetFilesWritten sets the "files_written" field.

func (*SessionCreate) SetID

func (_c *SessionCreate) SetID(v uuid.UUID) *SessionCreate

SetID sets the "id" field.

func (*SessionCreate) SetInputTokens added in v0.4.0

func (_c *SessionCreate) SetInputTokens(v int64) *SessionCreate

SetInputTokens sets the "input_tokens" field.

func (*SessionCreate) SetModelUsage added in v0.4.0

func (_c *SessionCreate) SetModelUsage(v []map[string]interface{}) *SessionCreate

SetModelUsage sets the "model_usage" field.

func (*SessionCreate) SetNillableAgentSessionID

func (_c *SessionCreate) SetNillableAgentSessionID(v *string) *SessionCreate

SetNillableAgentSessionID sets the "agent_session_id" field if the given value is not nil.

func (*SessionCreate) SetNillableAgentVersion

func (_c *SessionCreate) SetNillableAgentVersion(v *string) *SessionCreate

SetNillableAgentVersion sets the "agent_version" field if the given value is not nil.

func (*SessionCreate) SetNillableBlockedActions added in v0.5.0

func (_c *SessionCreate) SetNillableBlockedActions(v *int) *SessionCreate

SetNillableBlockedActions sets the "blocked_actions" field if the given value is not nil.

func (*SessionCreate) SetNillableCacheReadTokens added in v0.4.0

func (_c *SessionCreate) SetNillableCacheReadTokens(v *int64) *SessionCreate

SetNillableCacheReadTokens sets the "cache_read_tokens" field if the given value is not nil.

func (*SessionCreate) SetNillableCacheWriteTokens added in v0.4.0

func (_c *SessionCreate) SetNillableCacheWriteTokens(v *int64) *SessionCreate

SetNillableCacheWriteTokens sets the "cache_write_tokens" field if the given value is not nil.

func (*SessionCreate) SetNillableCommandsExecuted

func (_c *SessionCreate) SetNillableCommandsExecuted(v *int) *SessionCreate

SetNillableCommandsExecuted sets the "commands_executed" field if the given value is not nil.

func (*SessionCreate) SetNillableCostComputedAt added in v0.4.0

func (_c *SessionCreate) SetNillableCostComputedAt(v *time.Time) *SessionCreate

SetNillableCostComputedAt sets the "cost_computed_at" field if the given value is not nil.

func (*SessionCreate) SetNillableCostSource added in v0.4.0

func (_c *SessionCreate) SetNillableCostSource(v *string) *SessionCreate

SetNillableCostSource sets the "cost_source" field if the given value is not nil.

func (*SessionCreate) SetNillableEndedAt

func (_c *SessionCreate) SetNillableEndedAt(v *time.Time) *SessionCreate

SetNillableEndedAt sets the "ended_at" field if the given value is not nil.

func (*SessionCreate) SetNillableErrors

func (_c *SessionCreate) SetNillableErrors(v *int) *SessionCreate

SetNillableErrors sets the "errors" field if the given value is not nil.

func (*SessionCreate) SetNillableEstimatedCostUsd added in v0.4.0

func (_c *SessionCreate) SetNillableEstimatedCostUsd(v *float64) *SessionCreate

SetNillableEstimatedCostUsd sets the "estimated_cost_usd" field if the given value is not nil.

func (*SessionCreate) SetNillableFilesRead

func (_c *SessionCreate) SetNillableFilesRead(v *int) *SessionCreate

SetNillableFilesRead sets the "files_read" field if the given value is not nil.

func (*SessionCreate) SetNillableFilesWritten

func (_c *SessionCreate) SetNillableFilesWritten(v *int) *SessionCreate

SetNillableFilesWritten sets the "files_written" field if the given value is not nil.

func (*SessionCreate) SetNillableID

func (_c *SessionCreate) SetNillableID(v *uuid.UUID) *SessionCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*SessionCreate) SetNillableInputTokens added in v0.4.0

func (_c *SessionCreate) SetNillableInputTokens(v *int64) *SessionCreate

SetNillableInputTokens sets the "input_tokens" field if the given value is not nil.

func (*SessionCreate) SetNillableOutputTokens added in v0.4.0

func (_c *SessionCreate) SetNillableOutputTokens(v *int64) *SessionCreate

SetNillableOutputTokens sets the "output_tokens" field if the given value is not nil.

func (*SessionCreate) SetNillableProjectName

func (_c *SessionCreate) SetNillableProjectName(v *string) *SessionCreate

SetNillableProjectName sets the "project_name" field if the given value is not nil.

func (*SessionCreate) SetNillableSensitiveActions added in v0.5.0

func (_c *SessionCreate) SetNillableSensitiveActions(v *int) *SessionCreate

SetNillableSensitiveActions sets the "sensitive_actions" field if the given value is not nil.

func (*SessionCreate) SetNillableStartedAt

func (_c *SessionCreate) SetNillableStartedAt(v *time.Time) *SessionCreate

SetNillableStartedAt sets the "started_at" field if the given value is not nil.

func (*SessionCreate) SetNillableTotalActions

func (_c *SessionCreate) SetNillableTotalActions(v *int) *SessionCreate

SetNillableTotalActions sets the "total_actions" field if the given value is not nil.

func (*SessionCreate) SetNillableTranscriptPath added in v0.4.0

func (_c *SessionCreate) SetNillableTranscriptPath(v *string) *SessionCreate

SetNillableTranscriptPath sets the "transcript_path" field if the given value is not nil.

func (*SessionCreate) SetNillableWorkingDirectory

func (_c *SessionCreate) SetNillableWorkingDirectory(v *string) *SessionCreate

SetNillableWorkingDirectory sets the "working_directory" field if the given value is not nil.

func (*SessionCreate) SetOutputTokens added in v0.4.0

func (_c *SessionCreate) SetOutputTokens(v int64) *SessionCreate

SetOutputTokens sets the "output_tokens" field.

func (*SessionCreate) SetProjectName

func (_c *SessionCreate) SetProjectName(v string) *SessionCreate

SetProjectName sets the "project_name" field.

func (*SessionCreate) SetSensitiveActions added in v0.5.0

func (_c *SessionCreate) SetSensitiveActions(v int) *SessionCreate

SetSensitiveActions sets the "sensitive_actions" field.

func (*SessionCreate) SetStartedAt

func (_c *SessionCreate) SetStartedAt(v time.Time) *SessionCreate

SetStartedAt sets the "started_at" field.

func (*SessionCreate) SetTotalActions

func (_c *SessionCreate) SetTotalActions(v int) *SessionCreate

SetTotalActions sets the "total_actions" field.

func (*SessionCreate) SetTranscriptPath added in v0.4.0

func (_c *SessionCreate) SetTranscriptPath(v string) *SessionCreate

SetTranscriptPath sets the "transcript_path" field.

func (*SessionCreate) SetWorkingDirectory

func (_c *SessionCreate) SetWorkingDirectory(v string) *SessionCreate

SetWorkingDirectory sets the "working_directory" field.

type SessionCreateBulk

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

SessionCreateBulk is the builder for creating many Session entities in bulk.

func (*SessionCreateBulk) Exec

func (_c *SessionCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*SessionCreateBulk) ExecX

func (_c *SessionCreateBulk) ExecX(ctx context.Context)

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

func (*SessionCreateBulk) Save

func (_c *SessionCreateBulk) Save(ctx context.Context) ([]*Session, error)

Save creates the Session entities in the database.

func (*SessionCreateBulk) SaveX

func (_c *SessionCreateBulk) SaveX(ctx context.Context) []*Session

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

type SessionDelete

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

SessionDelete is the builder for deleting a Session entity.

func (*SessionDelete) Exec

func (_d *SessionDelete) Exec(ctx context.Context) (int, error)

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

func (*SessionDelete) ExecX

func (_d *SessionDelete) ExecX(ctx context.Context) int

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

func (*SessionDelete) Where

func (_d *SessionDelete) Where(ps ...predicate.Session) *SessionDelete

Where appends a list predicates to the SessionDelete builder.

type SessionDeleteOne

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

SessionDeleteOne is the builder for deleting a single Session entity.

func (*SessionDeleteOne) Exec

func (_d *SessionDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*SessionDeleteOne) ExecX

func (_d *SessionDeleteOne) ExecX(ctx context.Context)

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

func (*SessionDeleteOne) Where

Where appends a list predicates to the SessionDelete builder.

type SessionEdges

type SessionEdges struct {
	// Events holds the value of the events edge.
	Events []*AuditEvent `json:"events,omitempty"`
	// contains filtered or unexported fields
}

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

func (SessionEdges) EventsOrErr

func (e SessionEdges) EventsOrErr() ([]*AuditEvent, error)

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

type SessionGroupBy

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

SessionGroupBy is the group-by builder for Session entities.

func (*SessionGroupBy) Aggregate

func (_g *SessionGroupBy) Aggregate(fns ...AggregateFunc) *SessionGroupBy

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

func (*SessionGroupBy) Bool

func (s *SessionGroupBy) Bool(ctx context.Context) (_ bool, err error)

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

func (*SessionGroupBy) BoolX

func (s *SessionGroupBy) BoolX(ctx context.Context) bool

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

func (*SessionGroupBy) Bools

func (s *SessionGroupBy) Bools(ctx context.Context) ([]bool, error)

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

func (*SessionGroupBy) BoolsX

func (s *SessionGroupBy) BoolsX(ctx context.Context) []bool

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

func (*SessionGroupBy) Float64

func (s *SessionGroupBy) Float64(ctx context.Context) (_ float64, err error)

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

func (*SessionGroupBy) Float64X

func (s *SessionGroupBy) Float64X(ctx context.Context) float64

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

func (*SessionGroupBy) Float64s

func (s *SessionGroupBy) Float64s(ctx context.Context) ([]float64, error)

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

func (*SessionGroupBy) Float64sX

func (s *SessionGroupBy) Float64sX(ctx context.Context) []float64

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

func (*SessionGroupBy) Int

func (s *SessionGroupBy) Int(ctx context.Context) (_ int, err error)

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

func (*SessionGroupBy) IntX

func (s *SessionGroupBy) IntX(ctx context.Context) int

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

func (*SessionGroupBy) Ints

func (s *SessionGroupBy) Ints(ctx context.Context) ([]int, error)

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

func (*SessionGroupBy) IntsX

func (s *SessionGroupBy) IntsX(ctx context.Context) []int

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

func (*SessionGroupBy) Scan

func (_g *SessionGroupBy) Scan(ctx context.Context, v any) error

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

func (*SessionGroupBy) ScanX

func (s *SessionGroupBy) ScanX(ctx context.Context, v any)

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

func (*SessionGroupBy) String

func (s *SessionGroupBy) String(ctx context.Context) (_ string, err error)

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

func (*SessionGroupBy) StringX

func (s *SessionGroupBy) StringX(ctx context.Context) string

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

func (*SessionGroupBy) Strings

func (s *SessionGroupBy) Strings(ctx context.Context) ([]string, error)

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

func (*SessionGroupBy) StringsX

func (s *SessionGroupBy) StringsX(ctx context.Context) []string

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

type SessionMutation

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

SessionMutation represents an operation that mutates the Session nodes in the graph.

func (*SessionMutation) AddBlockedActions added in v0.5.0

func (m *SessionMutation) AddBlockedActions(i int)

AddBlockedActions adds i to the "blocked_actions" field.

func (*SessionMutation) AddCacheReadTokens added in v0.4.0

func (m *SessionMutation) AddCacheReadTokens(i int64)

AddCacheReadTokens adds i to the "cache_read_tokens" field.

func (*SessionMutation) AddCacheWriteTokens added in v0.4.0

func (m *SessionMutation) AddCacheWriteTokens(i int64)

AddCacheWriteTokens adds i to the "cache_write_tokens" field.

func (*SessionMutation) AddCommandsExecuted

func (m *SessionMutation) AddCommandsExecuted(i int)

AddCommandsExecuted adds i to the "commands_executed" field.

func (*SessionMutation) AddErrors

func (m *SessionMutation) AddErrors(i int)

AddErrors adds i to the "errors" field.

func (*SessionMutation) AddEstimatedCostUsd added in v0.4.0

func (m *SessionMutation) AddEstimatedCostUsd(f float64)

AddEstimatedCostUsd adds f to the "estimated_cost_usd" field.

func (*SessionMutation) AddEventIDs

func (m *SessionMutation) AddEventIDs(ids ...uuid.UUID)

AddEventIDs adds the "events" edge to the AuditEvent entity by ids.

func (*SessionMutation) AddField

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

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

func (*SessionMutation) AddFilesRead

func (m *SessionMutation) AddFilesRead(i int)

AddFilesRead adds i to the "files_read" field.

func (*SessionMutation) AddFilesWritten

func (m *SessionMutation) AddFilesWritten(i int)

AddFilesWritten adds i to the "files_written" field.

func (*SessionMutation) AddInputTokens added in v0.4.0

func (m *SessionMutation) AddInputTokens(i int64)

AddInputTokens adds i to the "input_tokens" field.

func (*SessionMutation) AddOutputTokens added in v0.4.0

func (m *SessionMutation) AddOutputTokens(i int64)

AddOutputTokens adds i to the "output_tokens" field.

func (*SessionMutation) AddSensitiveActions added in v0.5.0

func (m *SessionMutation) AddSensitiveActions(i int)

AddSensitiveActions adds i to the "sensitive_actions" field.

func (*SessionMutation) AddTotalActions

func (m *SessionMutation) AddTotalActions(i int)

AddTotalActions adds i to the "total_actions" field.

func (*SessionMutation) AddedBlockedActions added in v0.5.0

func (m *SessionMutation) AddedBlockedActions() (r int, exists bool)

AddedBlockedActions returns the value that was added to the "blocked_actions" field in this mutation.

func (*SessionMutation) AddedCacheReadTokens added in v0.4.0

func (m *SessionMutation) AddedCacheReadTokens() (r int64, exists bool)

AddedCacheReadTokens returns the value that was added to the "cache_read_tokens" field in this mutation.

func (*SessionMutation) AddedCacheWriteTokens added in v0.4.0

func (m *SessionMutation) AddedCacheWriteTokens() (r int64, exists bool)

AddedCacheWriteTokens returns the value that was added to the "cache_write_tokens" field in this mutation.

func (*SessionMutation) AddedCommandsExecuted

func (m *SessionMutation) AddedCommandsExecuted() (r int, exists bool)

AddedCommandsExecuted returns the value that was added to the "commands_executed" field in this mutation.

func (*SessionMutation) AddedEdges

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

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

func (*SessionMutation) AddedErrors

func (m *SessionMutation) AddedErrors() (r int, exists bool)

AddedErrors returns the value that was added to the "errors" field in this mutation.

func (*SessionMutation) AddedEstimatedCostUsd added in v0.4.0

func (m *SessionMutation) AddedEstimatedCostUsd() (r float64, exists bool)

AddedEstimatedCostUsd returns the value that was added to the "estimated_cost_usd" field in this mutation.

func (*SessionMutation) AddedField

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

AddedField returns the numeric value that was incremented/decremented on a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*SessionMutation) AddedFields

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

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

func (*SessionMutation) AddedFilesRead

func (m *SessionMutation) AddedFilesRead() (r int, exists bool)

AddedFilesRead returns the value that was added to the "files_read" field in this mutation.

func (*SessionMutation) AddedFilesWritten

func (m *SessionMutation) AddedFilesWritten() (r int, exists bool)

AddedFilesWritten returns the value that was added to the "files_written" field in this mutation.

func (*SessionMutation) AddedIDs

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

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

func (*SessionMutation) AddedInputTokens added in v0.4.0

func (m *SessionMutation) AddedInputTokens() (r int64, exists bool)

AddedInputTokens returns the value that was added to the "input_tokens" field in this mutation.

func (*SessionMutation) AddedOutputTokens added in v0.4.0

func (m *SessionMutation) AddedOutputTokens() (r int64, exists bool)

AddedOutputTokens returns the value that was added to the "output_tokens" field in this mutation.

func (*SessionMutation) AddedSensitiveActions added in v0.5.0

func (m *SessionMutation) AddedSensitiveActions() (r int, exists bool)

AddedSensitiveActions returns the value that was added to the "sensitive_actions" field in this mutation.

func (*SessionMutation) AddedTotalActions

func (m *SessionMutation) AddedTotalActions() (r int, exists bool)

AddedTotalActions returns the value that was added to the "total_actions" field in this mutation.

func (*SessionMutation) AgentName

func (m *SessionMutation) AgentName() (r string, exists bool)

AgentName returns the value of the "agent_name" field in the mutation.

func (*SessionMutation) AgentSessionID

func (m *SessionMutation) AgentSessionID() (r string, exists bool)

AgentSessionID returns the value of the "agent_session_id" field in the mutation.

func (*SessionMutation) AgentSessionIDCleared

func (m *SessionMutation) AgentSessionIDCleared() bool

AgentSessionIDCleared returns if the "agent_session_id" field was cleared in this mutation.

func (*SessionMutation) AgentVersion

func (m *SessionMutation) AgentVersion() (r string, exists bool)

AgentVersion returns the value of the "agent_version" field in the mutation.

func (*SessionMutation) AgentVersionCleared

func (m *SessionMutation) AgentVersionCleared() bool

AgentVersionCleared returns if the "agent_version" field was cleared in this mutation.

func (*SessionMutation) AppendModelUsage added in v0.4.0

func (m *SessionMutation) AppendModelUsage(value []map[string]interface{})

AppendModelUsage adds value to the "model_usage" field.

func (*SessionMutation) AppendedModelUsage added in v0.4.0

func (m *SessionMutation) AppendedModelUsage() ([]map[string]interface{}, bool)

AppendedModelUsage returns the list of values that were appended to the "model_usage" field in this mutation.

func (*SessionMutation) BlockedActions added in v0.5.0

func (m *SessionMutation) BlockedActions() (r int, exists bool)

BlockedActions returns the value of the "blocked_actions" field in the mutation.

func (*SessionMutation) CacheReadTokens added in v0.4.0

func (m *SessionMutation) CacheReadTokens() (r int64, exists bool)

CacheReadTokens returns the value of the "cache_read_tokens" field in the mutation.

func (*SessionMutation) CacheWriteTokens added in v0.4.0

func (m *SessionMutation) CacheWriteTokens() (r int64, exists bool)

CacheWriteTokens returns the value of the "cache_write_tokens" field in the mutation.

func (*SessionMutation) ClearAgentSessionID

func (m *SessionMutation) ClearAgentSessionID()

ClearAgentSessionID clears the value of the "agent_session_id" field.

func (*SessionMutation) ClearAgentVersion

func (m *SessionMutation) ClearAgentVersion()

ClearAgentVersion clears the value of the "agent_version" field.

func (*SessionMutation) ClearCostComputedAt added in v0.4.0

func (m *SessionMutation) ClearCostComputedAt()

ClearCostComputedAt clears the value of the "cost_computed_at" field.

func (*SessionMutation) ClearCostSource added in v0.4.0

func (m *SessionMutation) ClearCostSource()

ClearCostSource clears the value of the "cost_source" field.

func (*SessionMutation) ClearEdge

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

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

func (*SessionMutation) ClearEndedAt

func (m *SessionMutation) ClearEndedAt()

ClearEndedAt clears the value of the "ended_at" field.

func (*SessionMutation) ClearEvents

func (m *SessionMutation) ClearEvents()

ClearEvents clears the "events" edge to the AuditEvent entity.

func (*SessionMutation) ClearField

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

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

func (*SessionMutation) ClearModelUsage added in v0.4.0

func (m *SessionMutation) ClearModelUsage()

ClearModelUsage clears the value of the "model_usage" field.

func (*SessionMutation) ClearProjectName

func (m *SessionMutation) ClearProjectName()

ClearProjectName clears the value of the "project_name" field.

func (*SessionMutation) ClearTranscriptPath added in v0.4.0

func (m *SessionMutation) ClearTranscriptPath()

ClearTranscriptPath clears the value of the "transcript_path" field.

func (*SessionMutation) ClearWorkingDirectory

func (m *SessionMutation) ClearWorkingDirectory()

ClearWorkingDirectory clears the value of the "working_directory" field.

func (*SessionMutation) ClearedEdges

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

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

func (*SessionMutation) ClearedFields

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

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

func (SessionMutation) Client

func (m SessionMutation) 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 (*SessionMutation) CommandsExecuted

func (m *SessionMutation) CommandsExecuted() (r int, exists bool)

CommandsExecuted returns the value of the "commands_executed" field in the mutation.

func (*SessionMutation) CostComputedAt added in v0.4.0

func (m *SessionMutation) CostComputedAt() (r time.Time, exists bool)

CostComputedAt returns the value of the "cost_computed_at" field in the mutation.

func (*SessionMutation) CostComputedAtCleared added in v0.4.0

func (m *SessionMutation) CostComputedAtCleared() bool

CostComputedAtCleared returns if the "cost_computed_at" field was cleared in this mutation.

func (*SessionMutation) CostSource added in v0.4.0

func (m *SessionMutation) CostSource() (r string, exists bool)

CostSource returns the value of the "cost_source" field in the mutation.

func (*SessionMutation) CostSourceCleared added in v0.4.0

func (m *SessionMutation) CostSourceCleared() bool

CostSourceCleared returns if the "cost_source" field was cleared in this mutation.

func (*SessionMutation) EdgeCleared

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

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

func (*SessionMutation) EndedAt

func (m *SessionMutation) EndedAt() (r time.Time, exists bool)

EndedAt returns the value of the "ended_at" field in the mutation.

func (*SessionMutation) EndedAtCleared

func (m *SessionMutation) EndedAtCleared() bool

EndedAtCleared returns if the "ended_at" field was cleared in this mutation.

func (*SessionMutation) Errors

func (m *SessionMutation) Errors() (r int, exists bool)

Errors returns the value of the "errors" field in the mutation.

func (*SessionMutation) EstimatedCostUsd added in v0.4.0

func (m *SessionMutation) EstimatedCostUsd() (r float64, exists bool)

EstimatedCostUsd returns the value of the "estimated_cost_usd" field in the mutation.

func (*SessionMutation) EventsCleared

func (m *SessionMutation) EventsCleared() bool

EventsCleared reports if the "events" edge to the AuditEvent entity was cleared.

func (*SessionMutation) EventsIDs

func (m *SessionMutation) EventsIDs() (ids []uuid.UUID)

EventsIDs returns the "events" edge IDs in the mutation.

func (*SessionMutation) Field

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

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

func (*SessionMutation) FieldCleared

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

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

func (*SessionMutation) Fields

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

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

func (*SessionMutation) FilesRead

func (m *SessionMutation) FilesRead() (r int, exists bool)

FilesRead returns the value of the "files_read" field in the mutation.

func (*SessionMutation) FilesWritten

func (m *SessionMutation) FilesWritten() (r int, exists bool)

FilesWritten returns the value of the "files_written" field in the mutation.

func (*SessionMutation) ID

func (m *SessionMutation) ID() (id uuid.UUID, exists bool)

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

func (*SessionMutation) IDs

func (m *SessionMutation) IDs(ctx context.Context) ([]uuid.UUID, error)

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

func (*SessionMutation) InputTokens added in v0.4.0

func (m *SessionMutation) InputTokens() (r int64, exists bool)

InputTokens returns the value of the "input_tokens" field in the mutation.

func (*SessionMutation) ModelUsage added in v0.4.0

func (m *SessionMutation) ModelUsage() (r []map[string]interface{}, exists bool)

ModelUsage returns the value of the "model_usage" field in the mutation.

func (*SessionMutation) ModelUsageCleared added in v0.4.0

func (m *SessionMutation) ModelUsageCleared() bool

ModelUsageCleared returns if the "model_usage" field was cleared in this mutation.

func (*SessionMutation) OldAgentName

func (m *SessionMutation) OldAgentName(ctx context.Context) (v string, err error)

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

func (*SessionMutation) OldAgentSessionID

func (m *SessionMutation) OldAgentSessionID(ctx context.Context) (v string, err error)

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

func (*SessionMutation) OldAgentVersion

func (m *SessionMutation) OldAgentVersion(ctx context.Context) (v string, err error)

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

func (*SessionMutation) OldBlockedActions added in v0.5.0

func (m *SessionMutation) OldBlockedActions(ctx context.Context) (v int, err error)

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

func (*SessionMutation) OldCacheReadTokens added in v0.4.0

func (m *SessionMutation) OldCacheReadTokens(ctx context.Context) (v int64, err error)

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

func (*SessionMutation) OldCacheWriteTokens added in v0.4.0

func (m *SessionMutation) OldCacheWriteTokens(ctx context.Context) (v int64, err error)

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

func (*SessionMutation) OldCommandsExecuted

func (m *SessionMutation) OldCommandsExecuted(ctx context.Context) (v int, err error)

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

func (*SessionMutation) OldCostComputedAt added in v0.4.0

func (m *SessionMutation) OldCostComputedAt(ctx context.Context) (v *time.Time, err error)

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

func (*SessionMutation) OldCostSource added in v0.4.0

func (m *SessionMutation) OldCostSource(ctx context.Context) (v string, err error)

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

func (*SessionMutation) OldEndedAt

func (m *SessionMutation) OldEndedAt(ctx context.Context) (v *time.Time, err error)

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

func (*SessionMutation) OldErrors

func (m *SessionMutation) OldErrors(ctx context.Context) (v int, err error)

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

func (*SessionMutation) OldEstimatedCostUsd added in v0.4.0

func (m *SessionMutation) OldEstimatedCostUsd(ctx context.Context) (v float64, err error)

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

func (*SessionMutation) OldField

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

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

func (*SessionMutation) OldFilesRead

func (m *SessionMutation) OldFilesRead(ctx context.Context) (v int, err error)

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

func (*SessionMutation) OldFilesWritten

func (m *SessionMutation) OldFilesWritten(ctx context.Context) (v int, err error)

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

func (*SessionMutation) OldInputTokens added in v0.4.0

func (m *SessionMutation) OldInputTokens(ctx context.Context) (v int64, err error)

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

func (*SessionMutation) OldModelUsage added in v0.4.0

func (m *SessionMutation) OldModelUsage(ctx context.Context) (v []map[string]interface{}, err error)

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

func (*SessionMutation) OldOutputTokens added in v0.4.0

func (m *SessionMutation) OldOutputTokens(ctx context.Context) (v int64, err error)

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

func (*SessionMutation) OldProjectName

func (m *SessionMutation) OldProjectName(ctx context.Context) (v string, err error)

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

func (*SessionMutation) OldSensitiveActions added in v0.5.0

func (m *SessionMutation) OldSensitiveActions(ctx context.Context) (v int, err error)

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

func (*SessionMutation) OldStartedAt

func (m *SessionMutation) OldStartedAt(ctx context.Context) (v time.Time, err error)

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

func (*SessionMutation) OldTotalActions

func (m *SessionMutation) OldTotalActions(ctx context.Context) (v int, err error)

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

func (*SessionMutation) OldTranscriptPath added in v0.4.0

func (m *SessionMutation) OldTranscriptPath(ctx context.Context) (v string, err error)

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

func (*SessionMutation) OldWorkingDirectory

func (m *SessionMutation) OldWorkingDirectory(ctx context.Context) (v string, err error)

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

func (*SessionMutation) Op

func (m *SessionMutation) Op() Op

Op returns the operation name.

func (*SessionMutation) OutputTokens added in v0.4.0

func (m *SessionMutation) OutputTokens() (r int64, exists bool)

OutputTokens returns the value of the "output_tokens" field in the mutation.

func (*SessionMutation) ProjectName

func (m *SessionMutation) ProjectName() (r string, exists bool)

ProjectName returns the value of the "project_name" field in the mutation.

func (*SessionMutation) ProjectNameCleared

func (m *SessionMutation) ProjectNameCleared() bool

ProjectNameCleared returns if the "project_name" field was cleared in this mutation.

func (*SessionMutation) RemoveEventIDs

func (m *SessionMutation) RemoveEventIDs(ids ...uuid.UUID)

RemoveEventIDs removes the "events" edge to the AuditEvent entity by IDs.

func (*SessionMutation) RemovedEdges

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

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

func (*SessionMutation) RemovedEventsIDs

func (m *SessionMutation) RemovedEventsIDs() (ids []uuid.UUID)

RemovedEvents returns the removed IDs of the "events" edge to the AuditEvent entity.

func (*SessionMutation) RemovedIDs

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

RemovedIDs returns all IDs (to other nodes) that were removed for the edge with the given name in this mutation.

func (*SessionMutation) ResetAgentName

func (m *SessionMutation) ResetAgentName()

ResetAgentName resets all changes to the "agent_name" field.

func (*SessionMutation) ResetAgentSessionID

func (m *SessionMutation) ResetAgentSessionID()

ResetAgentSessionID resets all changes to the "agent_session_id" field.

func (*SessionMutation) ResetAgentVersion

func (m *SessionMutation) ResetAgentVersion()

ResetAgentVersion resets all changes to the "agent_version" field.

func (*SessionMutation) ResetBlockedActions added in v0.5.0

func (m *SessionMutation) ResetBlockedActions()

ResetBlockedActions resets all changes to the "blocked_actions" field.

func (*SessionMutation) ResetCacheReadTokens added in v0.4.0

func (m *SessionMutation) ResetCacheReadTokens()

ResetCacheReadTokens resets all changes to the "cache_read_tokens" field.

func (*SessionMutation) ResetCacheWriteTokens added in v0.4.0

func (m *SessionMutation) ResetCacheWriteTokens()

ResetCacheWriteTokens resets all changes to the "cache_write_tokens" field.

func (*SessionMutation) ResetCommandsExecuted

func (m *SessionMutation) ResetCommandsExecuted()

ResetCommandsExecuted resets all changes to the "commands_executed" field.

func (*SessionMutation) ResetCostComputedAt added in v0.4.0

func (m *SessionMutation) ResetCostComputedAt()

ResetCostComputedAt resets all changes to the "cost_computed_at" field.

func (*SessionMutation) ResetCostSource added in v0.4.0

func (m *SessionMutation) ResetCostSource()

ResetCostSource resets all changes to the "cost_source" field.

func (*SessionMutation) ResetEdge

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

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

func (*SessionMutation) ResetEndedAt

func (m *SessionMutation) ResetEndedAt()

ResetEndedAt resets all changes to the "ended_at" field.

func (*SessionMutation) ResetErrors

func (m *SessionMutation) ResetErrors()

ResetErrors resets all changes to the "errors" field.

func (*SessionMutation) ResetEstimatedCostUsd added in v0.4.0

func (m *SessionMutation) ResetEstimatedCostUsd()

ResetEstimatedCostUsd resets all changes to the "estimated_cost_usd" field.

func (*SessionMutation) ResetEvents

func (m *SessionMutation) ResetEvents()

ResetEvents resets all changes to the "events" edge.

func (*SessionMutation) ResetField

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

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

func (*SessionMutation) ResetFilesRead

func (m *SessionMutation) ResetFilesRead()

ResetFilesRead resets all changes to the "files_read" field.

func (*SessionMutation) ResetFilesWritten

func (m *SessionMutation) ResetFilesWritten()

ResetFilesWritten resets all changes to the "files_written" field.

func (*SessionMutation) ResetInputTokens added in v0.4.0

func (m *SessionMutation) ResetInputTokens()

ResetInputTokens resets all changes to the "input_tokens" field.

func (*SessionMutation) ResetModelUsage added in v0.4.0

func (m *SessionMutation) ResetModelUsage()

ResetModelUsage resets all changes to the "model_usage" field.

func (*SessionMutation) ResetOutputTokens added in v0.4.0

func (m *SessionMutation) ResetOutputTokens()

ResetOutputTokens resets all changes to the "output_tokens" field.

func (*SessionMutation) ResetProjectName

func (m *SessionMutation) ResetProjectName()

ResetProjectName resets all changes to the "project_name" field.

func (*SessionMutation) ResetSensitiveActions added in v0.5.0

func (m *SessionMutation) ResetSensitiveActions()

ResetSensitiveActions resets all changes to the "sensitive_actions" field.

func (*SessionMutation) ResetStartedAt

func (m *SessionMutation) ResetStartedAt()

ResetStartedAt resets all changes to the "started_at" field.

func (*SessionMutation) ResetTotalActions

func (m *SessionMutation) ResetTotalActions()

ResetTotalActions resets all changes to the "total_actions" field.

func (*SessionMutation) ResetTranscriptPath added in v0.4.0

func (m *SessionMutation) ResetTranscriptPath()

ResetTranscriptPath resets all changes to the "transcript_path" field.

func (*SessionMutation) ResetWorkingDirectory

func (m *SessionMutation) ResetWorkingDirectory()

ResetWorkingDirectory resets all changes to the "working_directory" field.

func (*SessionMutation) SensitiveActions added in v0.5.0

func (m *SessionMutation) SensitiveActions() (r int, exists bool)

SensitiveActions returns the value of the "sensitive_actions" field in the mutation.

func (*SessionMutation) SetAgentName

func (m *SessionMutation) SetAgentName(s string)

SetAgentName sets the "agent_name" field.

func (*SessionMutation) SetAgentSessionID

func (m *SessionMutation) SetAgentSessionID(s string)

SetAgentSessionID sets the "agent_session_id" field.

func (*SessionMutation) SetAgentVersion

func (m *SessionMutation) SetAgentVersion(s string)

SetAgentVersion sets the "agent_version" field.

func (*SessionMutation) SetBlockedActions added in v0.5.0

func (m *SessionMutation) SetBlockedActions(i int)

SetBlockedActions sets the "blocked_actions" field.

func (*SessionMutation) SetCacheReadTokens added in v0.4.0

func (m *SessionMutation) SetCacheReadTokens(i int64)

SetCacheReadTokens sets the "cache_read_tokens" field.

func (*SessionMutation) SetCacheWriteTokens added in v0.4.0

func (m *SessionMutation) SetCacheWriteTokens(i int64)

SetCacheWriteTokens sets the "cache_write_tokens" field.

func (*SessionMutation) SetCommandsExecuted

func (m *SessionMutation) SetCommandsExecuted(i int)

SetCommandsExecuted sets the "commands_executed" field.

func (*SessionMutation) SetCostComputedAt added in v0.4.0

func (m *SessionMutation) SetCostComputedAt(t time.Time)

SetCostComputedAt sets the "cost_computed_at" field.

func (*SessionMutation) SetCostSource added in v0.4.0

func (m *SessionMutation) SetCostSource(s string)

SetCostSource sets the "cost_source" field.

func (*SessionMutation) SetEndedAt

func (m *SessionMutation) SetEndedAt(t time.Time)

SetEndedAt sets the "ended_at" field.

func (*SessionMutation) SetErrors

func (m *SessionMutation) SetErrors(i int)

SetErrors sets the "errors" field.

func (*SessionMutation) SetEstimatedCostUsd added in v0.4.0

func (m *SessionMutation) SetEstimatedCostUsd(f float64)

SetEstimatedCostUsd sets the "estimated_cost_usd" field.

func (*SessionMutation) SetField

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

SetField sets the value of a field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*SessionMutation) SetFilesRead

func (m *SessionMutation) SetFilesRead(i int)

SetFilesRead sets the "files_read" field.

func (*SessionMutation) SetFilesWritten

func (m *SessionMutation) SetFilesWritten(i int)

SetFilesWritten sets the "files_written" field.

func (*SessionMutation) SetID

func (m *SessionMutation) SetID(id uuid.UUID)

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

func (*SessionMutation) SetInputTokens added in v0.4.0

func (m *SessionMutation) SetInputTokens(i int64)

SetInputTokens sets the "input_tokens" field.

func (*SessionMutation) SetModelUsage added in v0.4.0

func (m *SessionMutation) SetModelUsage(value []map[string]interface{})

SetModelUsage sets the "model_usage" field.

func (*SessionMutation) SetOp

func (m *SessionMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*SessionMutation) SetOutputTokens added in v0.4.0

func (m *SessionMutation) SetOutputTokens(i int64)

SetOutputTokens sets the "output_tokens" field.

func (*SessionMutation) SetProjectName

func (m *SessionMutation) SetProjectName(s string)

SetProjectName sets the "project_name" field.

func (*SessionMutation) SetSensitiveActions added in v0.5.0

func (m *SessionMutation) SetSensitiveActions(i int)

SetSensitiveActions sets the "sensitive_actions" field.

func (*SessionMutation) SetStartedAt

func (m *SessionMutation) SetStartedAt(t time.Time)

SetStartedAt sets the "started_at" field.

func (*SessionMutation) SetTotalActions

func (m *SessionMutation) SetTotalActions(i int)

SetTotalActions sets the "total_actions" field.

func (*SessionMutation) SetTranscriptPath added in v0.4.0

func (m *SessionMutation) SetTranscriptPath(s string)

SetTranscriptPath sets the "transcript_path" field.

func (*SessionMutation) SetWorkingDirectory

func (m *SessionMutation) SetWorkingDirectory(s string)

SetWorkingDirectory sets the "working_directory" field.

func (*SessionMutation) StartedAt

func (m *SessionMutation) StartedAt() (r time.Time, exists bool)

StartedAt returns the value of the "started_at" field in the mutation.

func (*SessionMutation) TotalActions

func (m *SessionMutation) TotalActions() (r int, exists bool)

TotalActions returns the value of the "total_actions" field in the mutation.

func (*SessionMutation) TranscriptPath added in v0.4.0

func (m *SessionMutation) TranscriptPath() (r string, exists bool)

TranscriptPath returns the value of the "transcript_path" field in the mutation.

func (*SessionMutation) TranscriptPathCleared added in v0.4.0

func (m *SessionMutation) TranscriptPathCleared() bool

TranscriptPathCleared returns if the "transcript_path" field was cleared in this mutation.

func (SessionMutation) Tx

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

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

func (*SessionMutation) Type

func (m *SessionMutation) Type() string

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

func (*SessionMutation) Where

func (m *SessionMutation) Where(ps ...predicate.Session)

Where appends a list predicates to the SessionMutation builder.

func (*SessionMutation) WhereP

func (m *SessionMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the SessionMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

func (*SessionMutation) WorkingDirectory

func (m *SessionMutation) WorkingDirectory() (r string, exists bool)

WorkingDirectory returns the value of the "working_directory" field in the mutation.

func (*SessionMutation) WorkingDirectoryCleared

func (m *SessionMutation) WorkingDirectoryCleared() bool

WorkingDirectoryCleared returns if the "working_directory" field was cleared in this mutation.

type SessionQuery

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

SessionQuery is the builder for querying Session entities.

func (*SessionQuery) Aggregate

func (_q *SessionQuery) Aggregate(fns ...AggregateFunc) *SessionSelect

Aggregate returns a SessionSelect configured with the given aggregations.

func (*SessionQuery) All

func (_q *SessionQuery) All(ctx context.Context) ([]*Session, error)

All executes the query and returns a list of Sessions.

func (*SessionQuery) AllX

func (_q *SessionQuery) AllX(ctx context.Context) []*Session

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

func (*SessionQuery) Clone

func (_q *SessionQuery) Clone() *SessionQuery

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

func (*SessionQuery) Count

func (_q *SessionQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*SessionQuery) CountX

func (_q *SessionQuery) CountX(ctx context.Context) int

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

func (*SessionQuery) Exist

func (_q *SessionQuery) Exist(ctx context.Context) (bool, error)

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

func (*SessionQuery) ExistX

func (_q *SessionQuery) ExistX(ctx context.Context) bool

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

func (*SessionQuery) First

func (_q *SessionQuery) First(ctx context.Context) (*Session, error)

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

func (*SessionQuery) FirstID

func (_q *SessionQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

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

func (*SessionQuery) FirstIDX

func (_q *SessionQuery) FirstIDX(ctx context.Context) uuid.UUID

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

func (*SessionQuery) FirstX

func (_q *SessionQuery) FirstX(ctx context.Context) *Session

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

func (*SessionQuery) GroupBy

func (_q *SessionQuery) GroupBy(field string, fields ...string) *SessionGroupBy

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

Example:

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

client.Session.Query().
	GroupBy(session.FieldAgentSessionID).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*SessionQuery) IDs

func (_q *SessionQuery) IDs(ctx context.Context) (ids []uuid.UUID, err error)

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

func (*SessionQuery) IDsX

func (_q *SessionQuery) IDsX(ctx context.Context) []uuid.UUID

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

func (*SessionQuery) Limit

func (_q *SessionQuery) Limit(limit int) *SessionQuery

Limit the number of records to be returned by this query.

func (*SessionQuery) Offset

func (_q *SessionQuery) Offset(offset int) *SessionQuery

Offset to start from.

func (*SessionQuery) Only

func (_q *SessionQuery) Only(ctx context.Context) (*Session, error)

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

func (*SessionQuery) OnlyID

func (_q *SessionQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

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

func (*SessionQuery) OnlyIDX

func (_q *SessionQuery) OnlyIDX(ctx context.Context) uuid.UUID

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

func (*SessionQuery) OnlyX

func (_q *SessionQuery) OnlyX(ctx context.Context) *Session

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

func (*SessionQuery) Order

func (_q *SessionQuery) Order(o ...session.OrderOption) *SessionQuery

Order specifies how the records should be ordered.

func (*SessionQuery) QueryEvents

func (_q *SessionQuery) QueryEvents() *AuditEventQuery

QueryEvents chains the current query on the "events" edge.

func (*SessionQuery) Select

func (_q *SessionQuery) Select(fields ...string) *SessionSelect

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

Example:

var v []struct {
	AgentSessionID string `json:"agent_session_id,omitempty"`
}

client.Session.Query().
	Select(session.FieldAgentSessionID).
	Scan(ctx, &v)

func (*SessionQuery) Unique

func (_q *SessionQuery) Unique(unique bool) *SessionQuery

Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.

func (*SessionQuery) Where

func (_q *SessionQuery) Where(ps ...predicate.Session) *SessionQuery

Where adds a new predicate for the SessionQuery builder.

func (*SessionQuery) WithEvents

func (_q *SessionQuery) WithEvents(opts ...func(*AuditEventQuery)) *SessionQuery

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

type SessionSelect

type SessionSelect struct {
	*SessionQuery
	// contains filtered or unexported fields
}

SessionSelect is the builder for selecting fields of Session entities.

func (*SessionSelect) Aggregate

func (_s *SessionSelect) Aggregate(fns ...AggregateFunc) *SessionSelect

Aggregate adds the given aggregation functions to the selector query.

func (*SessionSelect) Bool

func (s *SessionSelect) Bool(ctx context.Context) (_ bool, err error)

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

func (*SessionSelect) BoolX

func (s *SessionSelect) BoolX(ctx context.Context) bool

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

func (*SessionSelect) Bools

func (s *SessionSelect) Bools(ctx context.Context) ([]bool, error)

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

func (*SessionSelect) BoolsX

func (s *SessionSelect) BoolsX(ctx context.Context) []bool

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

func (*SessionSelect) Float64

func (s *SessionSelect) Float64(ctx context.Context) (_ float64, err error)

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

func (*SessionSelect) Float64X

func (s *SessionSelect) Float64X(ctx context.Context) float64

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

func (*SessionSelect) Float64s

func (s *SessionSelect) Float64s(ctx context.Context) ([]float64, error)

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

func (*SessionSelect) Float64sX

func (s *SessionSelect) Float64sX(ctx context.Context) []float64

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

func (*SessionSelect) Int

func (s *SessionSelect) Int(ctx context.Context) (_ int, err error)

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

func (*SessionSelect) IntX

func (s *SessionSelect) IntX(ctx context.Context) int

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

func (*SessionSelect) Ints

func (s *SessionSelect) Ints(ctx context.Context) ([]int, error)

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

func (*SessionSelect) IntsX

func (s *SessionSelect) IntsX(ctx context.Context) []int

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

func (*SessionSelect) Scan

func (_s *SessionSelect) Scan(ctx context.Context, v any) error

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

func (*SessionSelect) ScanX

func (s *SessionSelect) ScanX(ctx context.Context, v any)

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

func (*SessionSelect) String

func (s *SessionSelect) String(ctx context.Context) (_ string, err error)

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

func (*SessionSelect) StringX

func (s *SessionSelect) StringX(ctx context.Context) string

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

func (*SessionSelect) Strings

func (s *SessionSelect) Strings(ctx context.Context) ([]string, error)

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

func (*SessionSelect) StringsX

func (s *SessionSelect) StringsX(ctx context.Context) []string

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

type SessionUpdate

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

SessionUpdate is the builder for updating Session entities.

func (*SessionUpdate) AddBlockedActions added in v0.5.0

func (_u *SessionUpdate) AddBlockedActions(v int) *SessionUpdate

AddBlockedActions adds value to the "blocked_actions" field.

func (*SessionUpdate) AddCacheReadTokens added in v0.4.0

func (_u *SessionUpdate) AddCacheReadTokens(v int64) *SessionUpdate

AddCacheReadTokens adds value to the "cache_read_tokens" field.

func (*SessionUpdate) AddCacheWriteTokens added in v0.4.0

func (_u *SessionUpdate) AddCacheWriteTokens(v int64) *SessionUpdate

AddCacheWriteTokens adds value to the "cache_write_tokens" field.

func (*SessionUpdate) AddCommandsExecuted

func (_u *SessionUpdate) AddCommandsExecuted(v int) *SessionUpdate

AddCommandsExecuted adds value to the "commands_executed" field.

func (*SessionUpdate) AddErrors

func (_u *SessionUpdate) AddErrors(v int) *SessionUpdate

AddErrors adds value to the "errors" field.

func (*SessionUpdate) AddEstimatedCostUsd added in v0.4.0

func (_u *SessionUpdate) AddEstimatedCostUsd(v float64) *SessionUpdate

AddEstimatedCostUsd adds value to the "estimated_cost_usd" field.

func (*SessionUpdate) AddEventIDs

func (_u *SessionUpdate) AddEventIDs(ids ...uuid.UUID) *SessionUpdate

AddEventIDs adds the "events" edge to the AuditEvent entity by IDs.

func (*SessionUpdate) AddEvents

func (_u *SessionUpdate) AddEvents(v ...*AuditEvent) *SessionUpdate

AddEvents adds the "events" edges to the AuditEvent entity.

func (*SessionUpdate) AddFilesRead

func (_u *SessionUpdate) AddFilesRead(v int) *SessionUpdate

AddFilesRead adds value to the "files_read" field.

func (*SessionUpdate) AddFilesWritten

func (_u *SessionUpdate) AddFilesWritten(v int) *SessionUpdate

AddFilesWritten adds value to the "files_written" field.

func (*SessionUpdate) AddInputTokens added in v0.4.0

func (_u *SessionUpdate) AddInputTokens(v int64) *SessionUpdate

AddInputTokens adds value to the "input_tokens" field.

func (*SessionUpdate) AddOutputTokens added in v0.4.0

func (_u *SessionUpdate) AddOutputTokens(v int64) *SessionUpdate

AddOutputTokens adds value to the "output_tokens" field.

func (*SessionUpdate) AddSensitiveActions added in v0.5.0

func (_u *SessionUpdate) AddSensitiveActions(v int) *SessionUpdate

AddSensitiveActions adds value to the "sensitive_actions" field.

func (*SessionUpdate) AddTotalActions

func (_u *SessionUpdate) AddTotalActions(v int) *SessionUpdate

AddTotalActions adds value to the "total_actions" field.

func (*SessionUpdate) AppendModelUsage added in v0.4.0

func (_u *SessionUpdate) AppendModelUsage(v []map[string]interface{}) *SessionUpdate

AppendModelUsage appends value to the "model_usage" field.

func (*SessionUpdate) ClearAgentSessionID

func (_u *SessionUpdate) ClearAgentSessionID() *SessionUpdate

ClearAgentSessionID clears the value of the "agent_session_id" field.

func (*SessionUpdate) ClearAgentVersion

func (_u *SessionUpdate) ClearAgentVersion() *SessionUpdate

ClearAgentVersion clears the value of the "agent_version" field.

func (*SessionUpdate) ClearCostComputedAt added in v0.4.0

func (_u *SessionUpdate) ClearCostComputedAt() *SessionUpdate

ClearCostComputedAt clears the value of the "cost_computed_at" field.

func (*SessionUpdate) ClearCostSource added in v0.4.0

func (_u *SessionUpdate) ClearCostSource() *SessionUpdate

ClearCostSource clears the value of the "cost_source" field.

func (*SessionUpdate) ClearEndedAt

func (_u *SessionUpdate) ClearEndedAt() *SessionUpdate

ClearEndedAt clears the value of the "ended_at" field.

func (*SessionUpdate) ClearEvents

func (_u *SessionUpdate) ClearEvents() *SessionUpdate

ClearEvents clears all "events" edges to the AuditEvent entity.

func (*SessionUpdate) ClearModelUsage added in v0.4.0

func (_u *SessionUpdate) ClearModelUsage() *SessionUpdate

ClearModelUsage clears the value of the "model_usage" field.

func (*SessionUpdate) ClearProjectName

func (_u *SessionUpdate) ClearProjectName() *SessionUpdate

ClearProjectName clears the value of the "project_name" field.

func (*SessionUpdate) ClearTranscriptPath added in v0.4.0

func (_u *SessionUpdate) ClearTranscriptPath() *SessionUpdate

ClearTranscriptPath clears the value of the "transcript_path" field.

func (*SessionUpdate) ClearWorkingDirectory

func (_u *SessionUpdate) ClearWorkingDirectory() *SessionUpdate

ClearWorkingDirectory clears the value of the "working_directory" field.

func (*SessionUpdate) Exec

func (_u *SessionUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*SessionUpdate) ExecX

func (_u *SessionUpdate) ExecX(ctx context.Context)

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

func (*SessionUpdate) Mutation

func (_u *SessionUpdate) Mutation() *SessionMutation

Mutation returns the SessionMutation object of the builder.

func (*SessionUpdate) RemoveEventIDs

func (_u *SessionUpdate) RemoveEventIDs(ids ...uuid.UUID) *SessionUpdate

RemoveEventIDs removes the "events" edge to AuditEvent entities by IDs.

func (*SessionUpdate) RemoveEvents

func (_u *SessionUpdate) RemoveEvents(v ...*AuditEvent) *SessionUpdate

RemoveEvents removes "events" edges to AuditEvent entities.

func (*SessionUpdate) Save

func (_u *SessionUpdate) Save(ctx context.Context) (int, error)

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

func (*SessionUpdate) SaveX

func (_u *SessionUpdate) SaveX(ctx context.Context) int

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

func (*SessionUpdate) SetAgentName

func (_u *SessionUpdate) SetAgentName(v string) *SessionUpdate

SetAgentName sets the "agent_name" field.

func (*SessionUpdate) SetAgentSessionID

func (_u *SessionUpdate) SetAgentSessionID(v string) *SessionUpdate

SetAgentSessionID sets the "agent_session_id" field.

func (*SessionUpdate) SetAgentVersion

func (_u *SessionUpdate) SetAgentVersion(v string) *SessionUpdate

SetAgentVersion sets the "agent_version" field.

func (*SessionUpdate) SetBlockedActions added in v0.5.0

func (_u *SessionUpdate) SetBlockedActions(v int) *SessionUpdate

SetBlockedActions sets the "blocked_actions" field.

func (*SessionUpdate) SetCacheReadTokens added in v0.4.0

func (_u *SessionUpdate) SetCacheReadTokens(v int64) *SessionUpdate

SetCacheReadTokens sets the "cache_read_tokens" field.

func (*SessionUpdate) SetCacheWriteTokens added in v0.4.0

func (_u *SessionUpdate) SetCacheWriteTokens(v int64) *SessionUpdate

SetCacheWriteTokens sets the "cache_write_tokens" field.

func (*SessionUpdate) SetCommandsExecuted

func (_u *SessionUpdate) SetCommandsExecuted(v int) *SessionUpdate

SetCommandsExecuted sets the "commands_executed" field.

func (*SessionUpdate) SetCostComputedAt added in v0.4.0

func (_u *SessionUpdate) SetCostComputedAt(v time.Time) *SessionUpdate

SetCostComputedAt sets the "cost_computed_at" field.

func (*SessionUpdate) SetCostSource added in v0.4.0

func (_u *SessionUpdate) SetCostSource(v string) *SessionUpdate

SetCostSource sets the "cost_source" field.

func (*SessionUpdate) SetEndedAt

func (_u *SessionUpdate) SetEndedAt(v time.Time) *SessionUpdate

SetEndedAt sets the "ended_at" field.

func (*SessionUpdate) SetErrors

func (_u *SessionUpdate) SetErrors(v int) *SessionUpdate

SetErrors sets the "errors" field.

func (*SessionUpdate) SetEstimatedCostUsd added in v0.4.0

func (_u *SessionUpdate) SetEstimatedCostUsd(v float64) *SessionUpdate

SetEstimatedCostUsd sets the "estimated_cost_usd" field.

func (*SessionUpdate) SetFilesRead

func (_u *SessionUpdate) SetFilesRead(v int) *SessionUpdate

SetFilesRead sets the "files_read" field.

func (*SessionUpdate) SetFilesWritten

func (_u *SessionUpdate) SetFilesWritten(v int) *SessionUpdate

SetFilesWritten sets the "files_written" field.

func (*SessionUpdate) SetInputTokens added in v0.4.0

func (_u *SessionUpdate) SetInputTokens(v int64) *SessionUpdate

SetInputTokens sets the "input_tokens" field.

func (*SessionUpdate) SetModelUsage added in v0.4.0

func (_u *SessionUpdate) SetModelUsage(v []map[string]interface{}) *SessionUpdate

SetModelUsage sets the "model_usage" field.

func (*SessionUpdate) SetNillableAgentName

func (_u *SessionUpdate) SetNillableAgentName(v *string) *SessionUpdate

SetNillableAgentName sets the "agent_name" field if the given value is not nil.

func (*SessionUpdate) SetNillableAgentSessionID

func (_u *SessionUpdate) SetNillableAgentSessionID(v *string) *SessionUpdate

SetNillableAgentSessionID sets the "agent_session_id" field if the given value is not nil.

func (*SessionUpdate) SetNillableAgentVersion

func (_u *SessionUpdate) SetNillableAgentVersion(v *string) *SessionUpdate

SetNillableAgentVersion sets the "agent_version" field if the given value is not nil.

func (*SessionUpdate) SetNillableBlockedActions added in v0.5.0

func (_u *SessionUpdate) SetNillableBlockedActions(v *int) *SessionUpdate

SetNillableBlockedActions sets the "blocked_actions" field if the given value is not nil.

func (*SessionUpdate) SetNillableCacheReadTokens added in v0.4.0

func (_u *SessionUpdate) SetNillableCacheReadTokens(v *int64) *SessionUpdate

SetNillableCacheReadTokens sets the "cache_read_tokens" field if the given value is not nil.

func (*SessionUpdate) SetNillableCacheWriteTokens added in v0.4.0

func (_u *SessionUpdate) SetNillableCacheWriteTokens(v *int64) *SessionUpdate

SetNillableCacheWriteTokens sets the "cache_write_tokens" field if the given value is not nil.

func (*SessionUpdate) SetNillableCommandsExecuted

func (_u *SessionUpdate) SetNillableCommandsExecuted(v *int) *SessionUpdate

SetNillableCommandsExecuted sets the "commands_executed" field if the given value is not nil.

func (*SessionUpdate) SetNillableCostComputedAt added in v0.4.0

func (_u *SessionUpdate) SetNillableCostComputedAt(v *time.Time) *SessionUpdate

SetNillableCostComputedAt sets the "cost_computed_at" field if the given value is not nil.

func (*SessionUpdate) SetNillableCostSource added in v0.4.0

func (_u *SessionUpdate) SetNillableCostSource(v *string) *SessionUpdate

SetNillableCostSource sets the "cost_source" field if the given value is not nil.

func (*SessionUpdate) SetNillableEndedAt

func (_u *SessionUpdate) SetNillableEndedAt(v *time.Time) *SessionUpdate

SetNillableEndedAt sets the "ended_at" field if the given value is not nil.

func (*SessionUpdate) SetNillableErrors

func (_u *SessionUpdate) SetNillableErrors(v *int) *SessionUpdate

SetNillableErrors sets the "errors" field if the given value is not nil.

func (*SessionUpdate) SetNillableEstimatedCostUsd added in v0.4.0

func (_u *SessionUpdate) SetNillableEstimatedCostUsd(v *float64) *SessionUpdate

SetNillableEstimatedCostUsd sets the "estimated_cost_usd" field if the given value is not nil.

func (*SessionUpdate) SetNillableFilesRead

func (_u *SessionUpdate) SetNillableFilesRead(v *int) *SessionUpdate

SetNillableFilesRead sets the "files_read" field if the given value is not nil.

func (*SessionUpdate) SetNillableFilesWritten

func (_u *SessionUpdate) SetNillableFilesWritten(v *int) *SessionUpdate

SetNillableFilesWritten sets the "files_written" field if the given value is not nil.

func (*SessionUpdate) SetNillableInputTokens added in v0.4.0

func (_u *SessionUpdate) SetNillableInputTokens(v *int64) *SessionUpdate

SetNillableInputTokens sets the "input_tokens" field if the given value is not nil.

func (*SessionUpdate) SetNillableOutputTokens added in v0.4.0

func (_u *SessionUpdate) SetNillableOutputTokens(v *int64) *SessionUpdate

SetNillableOutputTokens sets the "output_tokens" field if the given value is not nil.

func (*SessionUpdate) SetNillableProjectName

func (_u *SessionUpdate) SetNillableProjectName(v *string) *SessionUpdate

SetNillableProjectName sets the "project_name" field if the given value is not nil.

func (*SessionUpdate) SetNillableSensitiveActions added in v0.5.0

func (_u *SessionUpdate) SetNillableSensitiveActions(v *int) *SessionUpdate

SetNillableSensitiveActions sets the "sensitive_actions" field if the given value is not nil.

func (*SessionUpdate) SetNillableTotalActions

func (_u *SessionUpdate) SetNillableTotalActions(v *int) *SessionUpdate

SetNillableTotalActions sets the "total_actions" field if the given value is not nil.

func (*SessionUpdate) SetNillableTranscriptPath added in v0.4.0

func (_u *SessionUpdate) SetNillableTranscriptPath(v *string) *SessionUpdate

SetNillableTranscriptPath sets the "transcript_path" field if the given value is not nil.

func (*SessionUpdate) SetNillableWorkingDirectory

func (_u *SessionUpdate) SetNillableWorkingDirectory(v *string) *SessionUpdate

SetNillableWorkingDirectory sets the "working_directory" field if the given value is not nil.

func (*SessionUpdate) SetOutputTokens added in v0.4.0

func (_u *SessionUpdate) SetOutputTokens(v int64) *SessionUpdate

SetOutputTokens sets the "output_tokens" field.

func (*SessionUpdate) SetProjectName

func (_u *SessionUpdate) SetProjectName(v string) *SessionUpdate

SetProjectName sets the "project_name" field.

func (*SessionUpdate) SetSensitiveActions added in v0.5.0

func (_u *SessionUpdate) SetSensitiveActions(v int) *SessionUpdate

SetSensitiveActions sets the "sensitive_actions" field.

func (*SessionUpdate) SetTotalActions

func (_u *SessionUpdate) SetTotalActions(v int) *SessionUpdate

SetTotalActions sets the "total_actions" field.

func (*SessionUpdate) SetTranscriptPath added in v0.4.0

func (_u *SessionUpdate) SetTranscriptPath(v string) *SessionUpdate

SetTranscriptPath sets the "transcript_path" field.

func (*SessionUpdate) SetWorkingDirectory

func (_u *SessionUpdate) SetWorkingDirectory(v string) *SessionUpdate

SetWorkingDirectory sets the "working_directory" field.

func (*SessionUpdate) Where

func (_u *SessionUpdate) Where(ps ...predicate.Session) *SessionUpdate

Where appends a list predicates to the SessionUpdate builder.

type SessionUpdateOne

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

SessionUpdateOne is the builder for updating a single Session entity.

func (*SessionUpdateOne) AddBlockedActions added in v0.5.0

func (_u *SessionUpdateOne) AddBlockedActions(v int) *SessionUpdateOne

AddBlockedActions adds value to the "blocked_actions" field.

func (*SessionUpdateOne) AddCacheReadTokens added in v0.4.0

func (_u *SessionUpdateOne) AddCacheReadTokens(v int64) *SessionUpdateOne

AddCacheReadTokens adds value to the "cache_read_tokens" field.

func (*SessionUpdateOne) AddCacheWriteTokens added in v0.4.0

func (_u *SessionUpdateOne) AddCacheWriteTokens(v int64) *SessionUpdateOne

AddCacheWriteTokens adds value to the "cache_write_tokens" field.

func (*SessionUpdateOne) AddCommandsExecuted

func (_u *SessionUpdateOne) AddCommandsExecuted(v int) *SessionUpdateOne

AddCommandsExecuted adds value to the "commands_executed" field.

func (*SessionUpdateOne) AddErrors

func (_u *SessionUpdateOne) AddErrors(v int) *SessionUpdateOne

AddErrors adds value to the "errors" field.

func (*SessionUpdateOne) AddEstimatedCostUsd added in v0.4.0

func (_u *SessionUpdateOne) AddEstimatedCostUsd(v float64) *SessionUpdateOne

AddEstimatedCostUsd adds value to the "estimated_cost_usd" field.

func (*SessionUpdateOne) AddEventIDs

func (_u *SessionUpdateOne) AddEventIDs(ids ...uuid.UUID) *SessionUpdateOne

AddEventIDs adds the "events" edge to the AuditEvent entity by IDs.

func (*SessionUpdateOne) AddEvents

func (_u *SessionUpdateOne) AddEvents(v ...*AuditEvent) *SessionUpdateOne

AddEvents adds the "events" edges to the AuditEvent entity.

func (*SessionUpdateOne) AddFilesRead

func (_u *SessionUpdateOne) AddFilesRead(v int) *SessionUpdateOne

AddFilesRead adds value to the "files_read" field.

func (*SessionUpdateOne) AddFilesWritten

func (_u *SessionUpdateOne) AddFilesWritten(v int) *SessionUpdateOne

AddFilesWritten adds value to the "files_written" field.

func (*SessionUpdateOne) AddInputTokens added in v0.4.0

func (_u *SessionUpdateOne) AddInputTokens(v int64) *SessionUpdateOne

AddInputTokens adds value to the "input_tokens" field.

func (*SessionUpdateOne) AddOutputTokens added in v0.4.0

func (_u *SessionUpdateOne) AddOutputTokens(v int64) *SessionUpdateOne

AddOutputTokens adds value to the "output_tokens" field.

func (*SessionUpdateOne) AddSensitiveActions added in v0.5.0

func (_u *SessionUpdateOne) AddSensitiveActions(v int) *SessionUpdateOne

AddSensitiveActions adds value to the "sensitive_actions" field.

func (*SessionUpdateOne) AddTotalActions

func (_u *SessionUpdateOne) AddTotalActions(v int) *SessionUpdateOne

AddTotalActions adds value to the "total_actions" field.

func (*SessionUpdateOne) AppendModelUsage added in v0.4.0

func (_u *SessionUpdateOne) AppendModelUsage(v []map[string]interface{}) *SessionUpdateOne

AppendModelUsage appends value to the "model_usage" field.

func (*SessionUpdateOne) ClearAgentSessionID

func (_u *SessionUpdateOne) ClearAgentSessionID() *SessionUpdateOne

ClearAgentSessionID clears the value of the "agent_session_id" field.

func (*SessionUpdateOne) ClearAgentVersion

func (_u *SessionUpdateOne) ClearAgentVersion() *SessionUpdateOne

ClearAgentVersion clears the value of the "agent_version" field.

func (*SessionUpdateOne) ClearCostComputedAt added in v0.4.0

func (_u *SessionUpdateOne) ClearCostComputedAt() *SessionUpdateOne

ClearCostComputedAt clears the value of the "cost_computed_at" field.

func (*SessionUpdateOne) ClearCostSource added in v0.4.0

func (_u *SessionUpdateOne) ClearCostSource() *SessionUpdateOne

ClearCostSource clears the value of the "cost_source" field.

func (*SessionUpdateOne) ClearEndedAt

func (_u *SessionUpdateOne) ClearEndedAt() *SessionUpdateOne

ClearEndedAt clears the value of the "ended_at" field.

func (*SessionUpdateOne) ClearEvents

func (_u *SessionUpdateOne) ClearEvents() *SessionUpdateOne

ClearEvents clears all "events" edges to the AuditEvent entity.

func (*SessionUpdateOne) ClearModelUsage added in v0.4.0

func (_u *SessionUpdateOne) ClearModelUsage() *SessionUpdateOne

ClearModelUsage clears the value of the "model_usage" field.

func (*SessionUpdateOne) ClearProjectName

func (_u *SessionUpdateOne) ClearProjectName() *SessionUpdateOne

ClearProjectName clears the value of the "project_name" field.

func (*SessionUpdateOne) ClearTranscriptPath added in v0.4.0

func (_u *SessionUpdateOne) ClearTranscriptPath() *SessionUpdateOne

ClearTranscriptPath clears the value of the "transcript_path" field.

func (*SessionUpdateOne) ClearWorkingDirectory

func (_u *SessionUpdateOne) ClearWorkingDirectory() *SessionUpdateOne

ClearWorkingDirectory clears the value of the "working_directory" field.

func (*SessionUpdateOne) Exec

func (_u *SessionUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*SessionUpdateOne) ExecX

func (_u *SessionUpdateOne) ExecX(ctx context.Context)

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

func (*SessionUpdateOne) Mutation

func (_u *SessionUpdateOne) Mutation() *SessionMutation

Mutation returns the SessionMutation object of the builder.

func (*SessionUpdateOne) RemoveEventIDs

func (_u *SessionUpdateOne) RemoveEventIDs(ids ...uuid.UUID) *SessionUpdateOne

RemoveEventIDs removes the "events" edge to AuditEvent entities by IDs.

func (*SessionUpdateOne) RemoveEvents

func (_u *SessionUpdateOne) RemoveEvents(v ...*AuditEvent) *SessionUpdateOne

RemoveEvents removes "events" edges to AuditEvent entities.

func (*SessionUpdateOne) Save

func (_u *SessionUpdateOne) Save(ctx context.Context) (*Session, error)

Save executes the query and returns the updated Session entity.

func (*SessionUpdateOne) SaveX

func (_u *SessionUpdateOne) SaveX(ctx context.Context) *Session

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

func (*SessionUpdateOne) Select

func (_u *SessionUpdateOne) Select(field string, fields ...string) *SessionUpdateOne

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

func (*SessionUpdateOne) SetAgentName

func (_u *SessionUpdateOne) SetAgentName(v string) *SessionUpdateOne

SetAgentName sets the "agent_name" field.

func (*SessionUpdateOne) SetAgentSessionID

func (_u *SessionUpdateOne) SetAgentSessionID(v string) *SessionUpdateOne

SetAgentSessionID sets the "agent_session_id" field.

func (*SessionUpdateOne) SetAgentVersion

func (_u *SessionUpdateOne) SetAgentVersion(v string) *SessionUpdateOne

SetAgentVersion sets the "agent_version" field.

func (*SessionUpdateOne) SetBlockedActions added in v0.5.0

func (_u *SessionUpdateOne) SetBlockedActions(v int) *SessionUpdateOne

SetBlockedActions sets the "blocked_actions" field.

func (*SessionUpdateOne) SetCacheReadTokens added in v0.4.0

func (_u *SessionUpdateOne) SetCacheReadTokens(v int64) *SessionUpdateOne

SetCacheReadTokens sets the "cache_read_tokens" field.

func (*SessionUpdateOne) SetCacheWriteTokens added in v0.4.0

func (_u *SessionUpdateOne) SetCacheWriteTokens(v int64) *SessionUpdateOne

SetCacheWriteTokens sets the "cache_write_tokens" field.

func (*SessionUpdateOne) SetCommandsExecuted

func (_u *SessionUpdateOne) SetCommandsExecuted(v int) *SessionUpdateOne

SetCommandsExecuted sets the "commands_executed" field.

func (*SessionUpdateOne) SetCostComputedAt added in v0.4.0

func (_u *SessionUpdateOne) SetCostComputedAt(v time.Time) *SessionUpdateOne

SetCostComputedAt sets the "cost_computed_at" field.

func (*SessionUpdateOne) SetCostSource added in v0.4.0

func (_u *SessionUpdateOne) SetCostSource(v string) *SessionUpdateOne

SetCostSource sets the "cost_source" field.

func (*SessionUpdateOne) SetEndedAt

func (_u *SessionUpdateOne) SetEndedAt(v time.Time) *SessionUpdateOne

SetEndedAt sets the "ended_at" field.

func (*SessionUpdateOne) SetErrors

func (_u *SessionUpdateOne) SetErrors(v int) *SessionUpdateOne

SetErrors sets the "errors" field.

func (*SessionUpdateOne) SetEstimatedCostUsd added in v0.4.0

func (_u *SessionUpdateOne) SetEstimatedCostUsd(v float64) *SessionUpdateOne

SetEstimatedCostUsd sets the "estimated_cost_usd" field.

func (*SessionUpdateOne) SetFilesRead

func (_u *SessionUpdateOne) SetFilesRead(v int) *SessionUpdateOne

SetFilesRead sets the "files_read" field.

func (*SessionUpdateOne) SetFilesWritten

func (_u *SessionUpdateOne) SetFilesWritten(v int) *SessionUpdateOne

SetFilesWritten sets the "files_written" field.

func (*SessionUpdateOne) SetInputTokens added in v0.4.0

func (_u *SessionUpdateOne) SetInputTokens(v int64) *SessionUpdateOne

SetInputTokens sets the "input_tokens" field.

func (*SessionUpdateOne) SetModelUsage added in v0.4.0

func (_u *SessionUpdateOne) SetModelUsage(v []map[string]interface{}) *SessionUpdateOne

SetModelUsage sets the "model_usage" field.

func (*SessionUpdateOne) SetNillableAgentName

func (_u *SessionUpdateOne) SetNillableAgentName(v *string) *SessionUpdateOne

SetNillableAgentName sets the "agent_name" field if the given value is not nil.

func (*SessionUpdateOne) SetNillableAgentSessionID

func (_u *SessionUpdateOne) SetNillableAgentSessionID(v *string) *SessionUpdateOne

SetNillableAgentSessionID sets the "agent_session_id" field if the given value is not nil.

func (*SessionUpdateOne) SetNillableAgentVersion

func (_u *SessionUpdateOne) SetNillableAgentVersion(v *string) *SessionUpdateOne

SetNillableAgentVersion sets the "agent_version" field if the given value is not nil.

func (*SessionUpdateOne) SetNillableBlockedActions added in v0.5.0

func (_u *SessionUpdateOne) SetNillableBlockedActions(v *int) *SessionUpdateOne

SetNillableBlockedActions sets the "blocked_actions" field if the given value is not nil.

func (*SessionUpdateOne) SetNillableCacheReadTokens added in v0.4.0

func (_u *SessionUpdateOne) SetNillableCacheReadTokens(v *int64) *SessionUpdateOne

SetNillableCacheReadTokens sets the "cache_read_tokens" field if the given value is not nil.

func (*SessionUpdateOne) SetNillableCacheWriteTokens added in v0.4.0

func (_u *SessionUpdateOne) SetNillableCacheWriteTokens(v *int64) *SessionUpdateOne

SetNillableCacheWriteTokens sets the "cache_write_tokens" field if the given value is not nil.

func (*SessionUpdateOne) SetNillableCommandsExecuted

func (_u *SessionUpdateOne) SetNillableCommandsExecuted(v *int) *SessionUpdateOne

SetNillableCommandsExecuted sets the "commands_executed" field if the given value is not nil.

func (*SessionUpdateOne) SetNillableCostComputedAt added in v0.4.0

func (_u *SessionUpdateOne) SetNillableCostComputedAt(v *time.Time) *SessionUpdateOne

SetNillableCostComputedAt sets the "cost_computed_at" field if the given value is not nil.

func (*SessionUpdateOne) SetNillableCostSource added in v0.4.0

func (_u *SessionUpdateOne) SetNillableCostSource(v *string) *SessionUpdateOne

SetNillableCostSource sets the "cost_source" field if the given value is not nil.

func (*SessionUpdateOne) SetNillableEndedAt

func (_u *SessionUpdateOne) SetNillableEndedAt(v *time.Time) *SessionUpdateOne

SetNillableEndedAt sets the "ended_at" field if the given value is not nil.

func (*SessionUpdateOne) SetNillableErrors

func (_u *SessionUpdateOne) SetNillableErrors(v *int) *SessionUpdateOne

SetNillableErrors sets the "errors" field if the given value is not nil.

func (*SessionUpdateOne) SetNillableEstimatedCostUsd added in v0.4.0

func (_u *SessionUpdateOne) SetNillableEstimatedCostUsd(v *float64) *SessionUpdateOne

SetNillableEstimatedCostUsd sets the "estimated_cost_usd" field if the given value is not nil.

func (*SessionUpdateOne) SetNillableFilesRead

func (_u *SessionUpdateOne) SetNillableFilesRead(v *int) *SessionUpdateOne

SetNillableFilesRead sets the "files_read" field if the given value is not nil.

func (*SessionUpdateOne) SetNillableFilesWritten

func (_u *SessionUpdateOne) SetNillableFilesWritten(v *int) *SessionUpdateOne

SetNillableFilesWritten sets the "files_written" field if the given value is not nil.

func (*SessionUpdateOne) SetNillableInputTokens added in v0.4.0

func (_u *SessionUpdateOne) SetNillableInputTokens(v *int64) *SessionUpdateOne

SetNillableInputTokens sets the "input_tokens" field if the given value is not nil.

func (*SessionUpdateOne) SetNillableOutputTokens added in v0.4.0

func (_u *SessionUpdateOne) SetNillableOutputTokens(v *int64) *SessionUpdateOne

SetNillableOutputTokens sets the "output_tokens" field if the given value is not nil.

func (*SessionUpdateOne) SetNillableProjectName

func (_u *SessionUpdateOne) SetNillableProjectName(v *string) *SessionUpdateOne

SetNillableProjectName sets the "project_name" field if the given value is not nil.

func (*SessionUpdateOne) SetNillableSensitiveActions added in v0.5.0

func (_u *SessionUpdateOne) SetNillableSensitiveActions(v *int) *SessionUpdateOne

SetNillableSensitiveActions sets the "sensitive_actions" field if the given value is not nil.

func (*SessionUpdateOne) SetNillableTotalActions

func (_u *SessionUpdateOne) SetNillableTotalActions(v *int) *SessionUpdateOne

SetNillableTotalActions sets the "total_actions" field if the given value is not nil.

func (*SessionUpdateOne) SetNillableTranscriptPath added in v0.4.0

func (_u *SessionUpdateOne) SetNillableTranscriptPath(v *string) *SessionUpdateOne

SetNillableTranscriptPath sets the "transcript_path" field if the given value is not nil.

func (*SessionUpdateOne) SetNillableWorkingDirectory

func (_u *SessionUpdateOne) SetNillableWorkingDirectory(v *string) *SessionUpdateOne

SetNillableWorkingDirectory sets the "working_directory" field if the given value is not nil.

func (*SessionUpdateOne) SetOutputTokens added in v0.4.0

func (_u *SessionUpdateOne) SetOutputTokens(v int64) *SessionUpdateOne

SetOutputTokens sets the "output_tokens" field.

func (*SessionUpdateOne) SetProjectName

func (_u *SessionUpdateOne) SetProjectName(v string) *SessionUpdateOne

SetProjectName sets the "project_name" field.

func (*SessionUpdateOne) SetSensitiveActions added in v0.5.0

func (_u *SessionUpdateOne) SetSensitiveActions(v int) *SessionUpdateOne

SetSensitiveActions sets the "sensitive_actions" field.

func (*SessionUpdateOne) SetTotalActions

func (_u *SessionUpdateOne) SetTotalActions(v int) *SessionUpdateOne

SetTotalActions sets the "total_actions" field.

func (*SessionUpdateOne) SetTranscriptPath added in v0.4.0

func (_u *SessionUpdateOne) SetTranscriptPath(v string) *SessionUpdateOne

SetTranscriptPath sets the "transcript_path" field.

func (*SessionUpdateOne) SetWorkingDirectory

func (_u *SessionUpdateOne) SetWorkingDirectory(v string) *SessionUpdateOne

SetWorkingDirectory sets the "working_directory" field.

func (*SessionUpdateOne) Where

Where appends a list predicates to the SessionUpdate builder.

type Sessions

type Sessions []*Session

Sessions is a parsable slice of Session.

type TraverseFunc

type TraverseFunc = ent.TraverseFunc

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

type Traverser

type Traverser = ent.Traverser

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

type Tx

type Tx struct {

	// AuditEvent is the client for interacting with the AuditEvent builders.
	AuditEvent *AuditEventClient
	// AuditStreamCursor is the client for interacting with the AuditStreamCursor builders.
	AuditStreamCursor *AuditStreamCursorClient
	// EventStreamCursor is the client for interacting with the EventStreamCursor builders.
	EventStreamCursor *EventStreamCursorClient
	// SelfAudit is the client for interacting with the SelfAudit builders.
	SelfAudit *SelfAuditClient
	// Session is the client for interacting with the Session builders.
	Session *SessionClient
	// contains filtered or unexported fields
}

Tx is a transactional client that is created by calling Client.Tx().

func TxFromContext

func TxFromContext(ctx context.Context) *Tx

TxFromContext returns a Tx stored inside a context, or nil if there isn't one.

func (*Tx) Client

func (tx *Tx) Client() *Client

Client returns a Client that binds to current transaction.

func (*Tx) Commit

func (tx *Tx) Commit() error

Commit commits the transaction.

func (*Tx) OnCommit

func (tx *Tx) OnCommit(f CommitHook)

OnCommit adds a hook to call on commit.

func (*Tx) OnRollback

func (tx *Tx) OnRollback(f RollbackHook)

OnRollback adds a hook to call on rollback.

func (*Tx) Rollback

func (tx *Tx) Rollback() error

Rollback rollbacks the transaction.

type ValidationError

type ValidationError struct {
	Name string // Field or edge name.
	// contains filtered or unexported fields
}

ValidationError returns when validating a field or edge fails.

func (*ValidationError) Error

func (e *ValidationError) Error() string

Error implements the error interface.

func (*ValidationError) Unwrap

func (e *ValidationError) Unwrap() error

Unwrap implements the errors.Wrapper interface.

type Value

type Value = ent.Value

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL