Documentation
¶
Index ¶
- func FixedError(err error) ent.Hook
- func If(hk ent.Hook, cond Condition) ent.Hook
- func On(hk ent.Hook, op ent.Op) ent.Hook
- func Reject(op ent.Op) ent.Hook
- func Unless(hk ent.Hook, op ent.Op) ent.Hook
- type ActionLogFunc
- type AgentMemoryFunc
- type AuditLogFunc
- type Chain
- type Condition
- func And(first, second Condition, rest ...Condition) Condition
- func HasAddedFields(field string, fields ...string) Condition
- func HasClearedFields(field string, fields ...string) Condition
- func HasFields(field string, fields ...string) Condition
- func HasOp(op ent.Op) Condition
- func Not(cond Condition) Condition
- func Or(first, second Condition, rest ...Condition) Condition
- type ConfigProfileFunc
- type CronJobFunc
- type CronJobHistoryFunc
- type EntityAliasFunc
- type EntityPropertyFunc
- type EscrowDealFunc
- type ExternalRefFunc
- type InquiryFunc
- type KeyFunc
- type KnowledgeFunc
- type LearningFunc
- type MessageFunc
- type ObservationFunc
- type OntologyConflictFunc
- type OntologyPredicateFunc
- type OntologyTypeFunc
- type PaymentTxFunc
- type PeerReputationFunc
- type ProvenanceAttributionFunc
- type ProvenanceCheckpointFunc
- type ReflectionFunc
- type RunJournalFunc
- type RunSnapshotFunc
- type RunStepFunc
- type SecretFunc
- type SessionFunc
- type SessionProvenanceFunc
- type TokenUsageFunc
- type TurnTraceEventFunc
- type TurnTraceFunc
- type WorkflowRunFunc
- type WorkflowStepRunFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func If ¶
If executes the given hook under condition.
hook.If(ComputeAverage, And(HasFields(...), HasAddedFields(...)))
func On ¶
On executes the given hook only for the given operation.
hook.On(Log, ent.Delete|ent.Create)
Types ¶
type ActionLogFunc ¶ added in v0.7.0
The ActionLogFunc type is an adapter to allow the use of ordinary function as ActionLog mutator.
type AgentMemoryFunc ¶ added in v0.7.0
The AgentMemoryFunc type is an adapter to allow the use of ordinary function as AgentMemory mutator.
type AuditLogFunc ¶
The AuditLogFunc type is an adapter to allow the use of ordinary function as AuditLog mutator.
type Chain ¶
type Chain struct {
// contains filtered or unexported fields
}
Chain acts as a list of hooks and is effectively immutable. Once created, it will always hold the same set of hooks in the same order.
func (Chain) Append ¶
Append extends a chain, adding the specified hook as the last ones in the mutation flow.
type Condition ¶
Condition is a hook condition function.
func HasAddedFields ¶
HasAddedFields is a condition validating `.AddedField` on fields.
func HasClearedFields ¶
HasClearedFields is a condition validating `.FieldCleared` on fields.
type ConfigProfileFunc ¶
The ConfigProfileFunc type is an adapter to allow the use of ordinary function as ConfigProfile mutator.
type CronJobFunc ¶
The CronJobFunc type is an adapter to allow the use of ordinary function as CronJob mutator.
type CronJobHistoryFunc ¶
The CronJobHistoryFunc type is an adapter to allow the use of ordinary function as CronJobHistory mutator.
type EntityAliasFunc ¶ added in v0.7.0
The EntityAliasFunc type is an adapter to allow the use of ordinary function as EntityAlias mutator.
type EntityPropertyFunc ¶ added in v0.7.0
The EntityPropertyFunc type is an adapter to allow the use of ordinary function as EntityProperty mutator.
type EscrowDealFunc ¶ added in v0.5.0
The EscrowDealFunc type is an adapter to allow the use of ordinary function as EscrowDeal mutator.
type ExternalRefFunc ¶
The ExternalRefFunc type is an adapter to allow the use of ordinary function as ExternalRef mutator.
type InquiryFunc ¶
The InquiryFunc type is an adapter to allow the use of ordinary function as Inquiry mutator.
type KnowledgeFunc ¶
The KnowledgeFunc type is an adapter to allow the use of ordinary function as Knowledge mutator.
type LearningFunc ¶
The LearningFunc type is an adapter to allow the use of ordinary function as Learning mutator.
type MessageFunc ¶
The MessageFunc type is an adapter to allow the use of ordinary function as Message mutator.
type ObservationFunc ¶
The ObservationFunc type is an adapter to allow the use of ordinary function as Observation mutator.
type OntologyConflictFunc ¶ added in v0.7.0
The OntologyConflictFunc type is an adapter to allow the use of ordinary function as OntologyConflict mutator.
type OntologyPredicateFunc ¶ added in v0.7.0
The OntologyPredicateFunc type is an adapter to allow the use of ordinary function as OntologyPredicate mutator.
type OntologyTypeFunc ¶ added in v0.7.0
The OntologyTypeFunc type is an adapter to allow the use of ordinary function as OntologyType mutator.
type PaymentTxFunc ¶
The PaymentTxFunc type is an adapter to allow the use of ordinary function as PaymentTx mutator.
type PeerReputationFunc ¶
The PeerReputationFunc type is an adapter to allow the use of ordinary function as PeerReputation mutator.
type ProvenanceAttributionFunc ¶ added in v0.7.0
type ProvenanceAttributionFunc func(context.Context, *ent.ProvenanceAttributionMutation) (ent.Value, error)
The ProvenanceAttributionFunc type is an adapter to allow the use of ordinary function as ProvenanceAttribution mutator.
type ProvenanceCheckpointFunc ¶ added in v0.7.0
type ProvenanceCheckpointFunc func(context.Context, *ent.ProvenanceCheckpointMutation) (ent.Value, error)
The ProvenanceCheckpointFunc type is an adapter to allow the use of ordinary function as ProvenanceCheckpoint mutator.
type ReflectionFunc ¶
The ReflectionFunc type is an adapter to allow the use of ordinary function as Reflection mutator.
type RunJournalFunc ¶ added in v0.7.0
The RunJournalFunc type is an adapter to allow the use of ordinary function as RunJournal mutator.
type RunSnapshotFunc ¶ added in v0.7.0
The RunSnapshotFunc type is an adapter to allow the use of ordinary function as RunSnapshot mutator.
type RunStepFunc ¶ added in v0.7.0
The RunStepFunc type is an adapter to allow the use of ordinary function as RunStep mutator.
type SecretFunc ¶
The SecretFunc type is an adapter to allow the use of ordinary function as Secret mutator.
type SessionFunc ¶
The SessionFunc type is an adapter to allow the use of ordinary function as Session mutator.
type SessionProvenanceFunc ¶ added in v0.7.0
The SessionProvenanceFunc type is an adapter to allow the use of ordinary function as SessionProvenance mutator.
type TokenUsageFunc ¶ added in v0.5.0
The TokenUsageFunc type is an adapter to allow the use of ordinary function as TokenUsage mutator.
type TurnTraceEventFunc ¶ added in v0.7.0
The TurnTraceEventFunc type is an adapter to allow the use of ordinary function as TurnTraceEvent mutator.
type TurnTraceFunc ¶ added in v0.7.0
The TurnTraceFunc type is an adapter to allow the use of ordinary function as TurnTrace mutator.
type WorkflowRunFunc ¶
The WorkflowRunFunc type is an adapter to allow the use of ordinary function as WorkflowRun mutator.
type WorkflowStepRunFunc ¶
The WorkflowStepRunFunc type is an adapter to allow the use of ordinary function as WorkflowStepRun mutator.