Documentation
¶
Index ¶
- func FixedError(err error) db.Hook
- func If(hk db.Hook, cond Condition) db.Hook
- func On(hk db.Hook, op db.Op) db.Hook
- func Reject(op db.Op) db.Hook
- func Unless(hk db.Hook, op db.Op) db.Hook
- type AIEmployeeFunc
- type AITaskFunc
- type AdminFunc
- type AdminLoginHistoryFunc
- type AdminRoleFunc
- type ApiKeyFunc
- type BillingPlanFunc
- type BillingQuotaFunc
- type BillingRecordFunc
- type BillingUsageFunc
- type Chain
- type CodeSnippetFunc
- 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 db.Op) Condition
- func Not(cond Condition) Condition
- func Or(first, second Condition, rest ...Condition) Condition
- type ExtensionFunc
- type InviteCodeFunc
- type LicenseFunc
- type ModelFunc
- type ModelProviderFunc
- type ModelProviderModelFunc
- type RoleFunc
- type SecurityScanningFunc
- type SecurityScanningResultFunc
- type SettingFunc
- type TaskFunc
- type TaskRecordFunc
- type UserFunc
- type UserGroupAdminFunc
- type UserGroupFunc
- type UserGroupUserFunc
- type UserIdentityFunc
- type UserLoginHistoryFunc
- type WorkspaceFileFunc
- type WorkspaceFunc
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, db.Delete|db.Create)
Types ¶
type AIEmployeeFunc ¶
The AIEmployeeFunc type is an adapter to allow the use of ordinary function as AIEmployee mutator.
type AITaskFunc ¶
The AITaskFunc type is an adapter to allow the use of ordinary function as AITask mutator.
type AdminFunc ¶
The AdminFunc type is an adapter to allow the use of ordinary function as Admin mutator.
type AdminLoginHistoryFunc ¶
The AdminLoginHistoryFunc type is an adapter to allow the use of ordinary function as AdminLoginHistory mutator.
type AdminRoleFunc ¶
The AdminRoleFunc type is an adapter to allow the use of ordinary function as AdminRole mutator.
type ApiKeyFunc ¶
The ApiKeyFunc type is an adapter to allow the use of ordinary function as ApiKey mutator.
type BillingPlanFunc ¶
The BillingPlanFunc type is an adapter to allow the use of ordinary function as BillingPlan mutator.
type BillingQuotaFunc ¶
The BillingQuotaFunc type is an adapter to allow the use of ordinary function as BillingQuota mutator.
type BillingRecordFunc ¶
The BillingRecordFunc type is an adapter to allow the use of ordinary function as BillingRecord mutator.
type BillingUsageFunc ¶
The BillingUsageFunc type is an adapter to allow the use of ordinary function as BillingUsage 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 CodeSnippetFunc ¶
The CodeSnippetFunc type is an adapter to allow the use of ordinary function as CodeSnippet 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 ExtensionFunc ¶
The ExtensionFunc type is an adapter to allow the use of ordinary function as Extension mutator.
type InviteCodeFunc ¶
The InviteCodeFunc type is an adapter to allow the use of ordinary function as InviteCode mutator.
type LicenseFunc ¶
The LicenseFunc type is an adapter to allow the use of ordinary function as License mutator.
type ModelFunc ¶
The ModelFunc type is an adapter to allow the use of ordinary function as Model mutator.
type ModelProviderFunc ¶
The ModelProviderFunc type is an adapter to allow the use of ordinary function as ModelProvider mutator.
type ModelProviderModelFunc ¶
The ModelProviderModelFunc type is an adapter to allow the use of ordinary function as ModelProviderModel mutator.
type RoleFunc ¶
The RoleFunc type is an adapter to allow the use of ordinary function as Role mutator.
type SecurityScanningFunc ¶
The SecurityScanningFunc type is an adapter to allow the use of ordinary function as SecurityScanning mutator.
type SecurityScanningResultFunc ¶
type SecurityScanningResultFunc func(context.Context, *db.SecurityScanningResultMutation) (db.Value, error)
The SecurityScanningResultFunc type is an adapter to allow the use of ordinary function as SecurityScanningResult mutator.
type SettingFunc ¶
The SettingFunc type is an adapter to allow the use of ordinary function as Setting mutator.
type TaskFunc ¶
The TaskFunc type is an adapter to allow the use of ordinary function as Task mutator.
type TaskRecordFunc ¶
The TaskRecordFunc type is an adapter to allow the use of ordinary function as TaskRecord mutator.
type UserFunc ¶
The UserFunc type is an adapter to allow the use of ordinary function as User mutator.
type UserGroupAdminFunc ¶
The UserGroupAdminFunc type is an adapter to allow the use of ordinary function as UserGroupAdmin mutator.
type UserGroupFunc ¶
The UserGroupFunc type is an adapter to allow the use of ordinary function as UserGroup mutator.
type UserGroupUserFunc ¶
The UserGroupUserFunc type is an adapter to allow the use of ordinary function as UserGroupUser mutator.
type UserIdentityFunc ¶
The UserIdentityFunc type is an adapter to allow the use of ordinary function as UserIdentity mutator.
type UserLoginHistoryFunc ¶
The UserLoginHistoryFunc type is an adapter to allow the use of ordinary function as UserLoginHistory mutator.
type WorkspaceFileFunc ¶
The WorkspaceFileFunc type is an adapter to allow the use of ordinary function as WorkspaceFile mutator.
type WorkspaceFunc ¶
The WorkspaceFunc type is an adapter to allow the use of ordinary function as Workspace mutator.