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 Chain
- type CodeSourceFileFunc
- 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 DepsUsageEvidenceFunc
- type ReportDependencyFunc
- type ReportDependencyGraphFunc
- type ReportLicenseFunc
- type ReportMalwareFunc
- type ReportPackageFunc
- type ReportPackageManifestFunc
- type ReportProjectFunc
- type ReportScorecardCheckFunc
- type ReportScorecardFunc
- type ReportSlsaProvenanceFunc
- type ReportVulnerabilityFunc
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 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 CodeSourceFileFunc ¶
The CodeSourceFileFunc type is an adapter to allow the use of ordinary function as CodeSourceFile mutator.
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 DepsUsageEvidenceFunc ¶
The DepsUsageEvidenceFunc type is an adapter to allow the use of ordinary function as DepsUsageEvidence mutator.
type ReportDependencyFunc ¶ added in v1.12.0
The ReportDependencyFunc type is an adapter to allow the use of ordinary function as ReportDependency mutator.
type ReportDependencyGraphFunc ¶ added in v1.12.0
type ReportDependencyGraphFunc func(context.Context, *ent.ReportDependencyGraphMutation) (ent.Value, error)
The ReportDependencyGraphFunc type is an adapter to allow the use of ordinary function as ReportDependencyGraph mutator.
type ReportLicenseFunc ¶ added in v1.12.0
The ReportLicenseFunc type is an adapter to allow the use of ordinary function as ReportLicense mutator.
type ReportMalwareFunc ¶ added in v1.12.0
The ReportMalwareFunc type is an adapter to allow the use of ordinary function as ReportMalware mutator.
type ReportPackageFunc ¶ added in v1.12.0
The ReportPackageFunc type is an adapter to allow the use of ordinary function as ReportPackage mutator.
type ReportPackageManifestFunc ¶ added in v1.12.0
type ReportPackageManifestFunc func(context.Context, *ent.ReportPackageManifestMutation) (ent.Value, error)
The ReportPackageManifestFunc type is an adapter to allow the use of ordinary function as ReportPackageManifest mutator.
type ReportProjectFunc ¶ added in v1.12.0
The ReportProjectFunc type is an adapter to allow the use of ordinary function as ReportProject mutator.
type ReportScorecardCheckFunc ¶ added in v1.12.0
type ReportScorecardCheckFunc func(context.Context, *ent.ReportScorecardCheckMutation) (ent.Value, error)
The ReportScorecardCheckFunc type is an adapter to allow the use of ordinary function as ReportScorecardCheck mutator.
type ReportScorecardFunc ¶ added in v1.12.0
The ReportScorecardFunc type is an adapter to allow the use of ordinary function as ReportScorecard mutator.
type ReportSlsaProvenanceFunc ¶ added in v1.12.0
type ReportSlsaProvenanceFunc func(context.Context, *ent.ReportSlsaProvenanceMutation) (ent.Value, error)
The ReportSlsaProvenanceFunc type is an adapter to allow the use of ordinary function as ReportSlsaProvenance mutator.
type ReportVulnerabilityFunc ¶ added in v1.12.0
type ReportVulnerabilityFunc func(context.Context, *ent.ReportVulnerabilityMutation) (ent.Value, error)
The ReportVulnerabilityFunc type is an adapter to allow the use of ordinary function as ReportVulnerability mutator.