Help us shape the future of Go! Take the 2026 Go Developer Survey

rule

package
v0.3.5 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2026 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Label holds the string label denoting the rule type in the database.
	Label = "rule"
	// FieldID holds the string denoting the id field in the database.
	FieldID = "id"
	// FieldCreatedAt holds the string denoting the created_at field in the database.
	FieldCreatedAt = "created_at"
	// FieldUpdatedAt holds the string denoting the updated_at field in the database.
	FieldUpdatedAt = "updated_at"
	// FieldWorkspaceID holds the string denoting the workspace_id field in the database.
	FieldWorkspaceID = "workspace_id"
	// FieldDiscardedAt holds the string denoting the discarded_at field in the database.
	FieldDiscardedAt = "discarded_at"
	// FieldName holds the string denoting the name field in the database.
	FieldName = "name"
	// FieldStatus holds the string denoting the status field in the database.
	FieldStatus = "status"
	// FieldActivatedAt holds the string denoting the activated_at field in the database.
	FieldActivatedAt = "activated_at"
	// FieldCondition holds the string denoting the condition field in the database.
	FieldCondition = "condition"
	// FieldActions holds the string denoting the actions field in the database.
	FieldActions = "actions"
	// EdgeWorkspace holds the string denoting the workspace edge name in mutations.
	EdgeWorkspace = "workspace"
	// EdgeTriggers holds the string denoting the triggers edge name in mutations.
	EdgeTriggers = "triggers"
	// EdgeFirings holds the string denoting the firings edge name in mutations.
	EdgeFirings = "firings"
	// Table holds the table name of the rule in the database.
	Table = "rules"
	// WorkspaceTable is the table that holds the workspace relation/edge.
	WorkspaceTable = "rules"
	// WorkspaceInverseTable is the table name for the Workspace entity.
	// It exists in this package in order to avoid circular dependency with the "workspace" package.
	WorkspaceInverseTable = "workspaces"
	// WorkspaceColumn is the table column denoting the workspace relation/edge.
	WorkspaceColumn = "workspace_id"
	// TriggersTable is the table that holds the triggers relation/edge.
	TriggersTable = "rule_triggers"
	// TriggersInverseTable is the table name for the RuleTrigger entity.
	// It exists in this package in order to avoid circular dependency with the "ruletrigger" package.
	TriggersInverseTable = "rule_triggers"
	// TriggersColumn is the table column denoting the triggers relation/edge.
	TriggersColumn = "rule_id"
	// FiringsTable is the table that holds the firings relation/edge.
	FiringsTable = "rule_firings"
	// FiringsInverseTable is the table name for the RuleFiring entity.
	// It exists in this package in order to avoid circular dependency with the "rulefiring" package.
	FiringsInverseTable = "rule_firings"
	// FiringsColumn is the table column denoting the firings relation/edge.
	FiringsColumn = "rule_id"
)
View Source
const DefaultStatus = StatusDraft

StatusDraft is the default value of the Status enum.

Variables

View Source
var (
	// DefaultCreatedAt holds the default value on creation for the "created_at" field.
	DefaultCreatedAt func() time.Time
	// DefaultUpdatedAt holds the default value on creation for the "updated_at" field.
	DefaultUpdatedAt func() time.Time
	// UpdateDefaultUpdatedAt holds the default value on update for the "updated_at" field.
	UpdateDefaultUpdatedAt func() time.Time
	// NameValidator is a validator for the "name" field. It is called by the builders before save.
	NameValidator func(string) error
	// DefaultActions holds the default value on creation for the "actions" field.
	DefaultActions string
)

Columns holds all SQL columns for rule fields.

Functions

func Actions

func Actions(v string) predicate.Rule

Actions applies equality check predicate on the "actions" field. It's identical to ActionsEQ.

func ActionsContains

func ActionsContains(v string) predicate.Rule

ActionsContains applies the Contains predicate on the "actions" field.

func ActionsContainsFold

func ActionsContainsFold(v string) predicate.Rule

ActionsContainsFold applies the ContainsFold predicate on the "actions" field.

func ActionsEQ

func ActionsEQ(v string) predicate.Rule

ActionsEQ applies the EQ predicate on the "actions" field.

func ActionsEqualFold

func ActionsEqualFold(v string) predicate.Rule

ActionsEqualFold applies the EqualFold predicate on the "actions" field.

func ActionsGT

func ActionsGT(v string) predicate.Rule

ActionsGT applies the GT predicate on the "actions" field.

func ActionsGTE

func ActionsGTE(v string) predicate.Rule

ActionsGTE applies the GTE predicate on the "actions" field.

func ActionsHasPrefix

func ActionsHasPrefix(v string) predicate.Rule

ActionsHasPrefix applies the HasPrefix predicate on the "actions" field.

func ActionsHasSuffix

func ActionsHasSuffix(v string) predicate.Rule

ActionsHasSuffix applies the HasSuffix predicate on the "actions" field.

func ActionsIn

func ActionsIn(vs ...string) predicate.Rule

ActionsIn applies the In predicate on the "actions" field.

func ActionsLT

func ActionsLT(v string) predicate.Rule

ActionsLT applies the LT predicate on the "actions" field.

func ActionsLTE

func ActionsLTE(v string) predicate.Rule

ActionsLTE applies the LTE predicate on the "actions" field.

func ActionsNEQ

func ActionsNEQ(v string) predicate.Rule

ActionsNEQ applies the NEQ predicate on the "actions" field.

func ActionsNotIn

func ActionsNotIn(vs ...string) predicate.Rule

ActionsNotIn applies the NotIn predicate on the "actions" field.

func ActivatedAt

func ActivatedAt(v time.Time) predicate.Rule

ActivatedAt applies equality check predicate on the "activated_at" field. It's identical to ActivatedAtEQ.

func ActivatedAtEQ

func ActivatedAtEQ(v time.Time) predicate.Rule

ActivatedAtEQ applies the EQ predicate on the "activated_at" field.

func ActivatedAtGT

func ActivatedAtGT(v time.Time) predicate.Rule

ActivatedAtGT applies the GT predicate on the "activated_at" field.

func ActivatedAtGTE

func ActivatedAtGTE(v time.Time) predicate.Rule

ActivatedAtGTE applies the GTE predicate on the "activated_at" field.

func ActivatedAtIn

func ActivatedAtIn(vs ...time.Time) predicate.Rule

ActivatedAtIn applies the In predicate on the "activated_at" field.

func ActivatedAtIsNil

func ActivatedAtIsNil() predicate.Rule

ActivatedAtIsNil applies the IsNil predicate on the "activated_at" field.

func ActivatedAtLT

func ActivatedAtLT(v time.Time) predicate.Rule

ActivatedAtLT applies the LT predicate on the "activated_at" field.

func ActivatedAtLTE

func ActivatedAtLTE(v time.Time) predicate.Rule

ActivatedAtLTE applies the LTE predicate on the "activated_at" field.

func ActivatedAtNEQ

func ActivatedAtNEQ(v time.Time) predicate.Rule

ActivatedAtNEQ applies the NEQ predicate on the "activated_at" field.

func ActivatedAtNotIn

func ActivatedAtNotIn(vs ...time.Time) predicate.Rule

ActivatedAtNotIn applies the NotIn predicate on the "activated_at" field.

func ActivatedAtNotNil

func ActivatedAtNotNil() predicate.Rule

ActivatedAtNotNil applies the NotNil predicate on the "activated_at" field.

func And

func And(predicates ...predicate.Rule) predicate.Rule

And groups predicates with the AND operator between them.

func Condition

func Condition(v string) predicate.Rule

Condition applies equality check predicate on the "condition" field. It's identical to ConditionEQ.

func ConditionContains

func ConditionContains(v string) predicate.Rule

ConditionContains applies the Contains predicate on the "condition" field.

func ConditionContainsFold

func ConditionContainsFold(v string) predicate.Rule

ConditionContainsFold applies the ContainsFold predicate on the "condition" field.

func ConditionEQ

func ConditionEQ(v string) predicate.Rule

ConditionEQ applies the EQ predicate on the "condition" field.

func ConditionEqualFold

func ConditionEqualFold(v string) predicate.Rule

ConditionEqualFold applies the EqualFold predicate on the "condition" field.

func ConditionGT

func ConditionGT(v string) predicate.Rule

ConditionGT applies the GT predicate on the "condition" field.

func ConditionGTE

func ConditionGTE(v string) predicate.Rule

ConditionGTE applies the GTE predicate on the "condition" field.

func ConditionHasPrefix

func ConditionHasPrefix(v string) predicate.Rule

ConditionHasPrefix applies the HasPrefix predicate on the "condition" field.

func ConditionHasSuffix

func ConditionHasSuffix(v string) predicate.Rule

ConditionHasSuffix applies the HasSuffix predicate on the "condition" field.

func ConditionIn

func ConditionIn(vs ...string) predicate.Rule

ConditionIn applies the In predicate on the "condition" field.

func ConditionIsNil

func ConditionIsNil() predicate.Rule

ConditionIsNil applies the IsNil predicate on the "condition" field.

func ConditionLT

func ConditionLT(v string) predicate.Rule

ConditionLT applies the LT predicate on the "condition" field.

func ConditionLTE

func ConditionLTE(v string) predicate.Rule

ConditionLTE applies the LTE predicate on the "condition" field.

func ConditionNEQ

func ConditionNEQ(v string) predicate.Rule

ConditionNEQ applies the NEQ predicate on the "condition" field.

func ConditionNotIn

func ConditionNotIn(vs ...string) predicate.Rule

ConditionNotIn applies the NotIn predicate on the "condition" field.

func ConditionNotNil

func ConditionNotNil() predicate.Rule

ConditionNotNil applies the NotNil predicate on the "condition" field.

func CreatedAt

func CreatedAt(v time.Time) predicate.Rule

CreatedAt applies equality check predicate on the "created_at" field. It's identical to CreatedAtEQ.

func CreatedAtEQ

func CreatedAtEQ(v time.Time) predicate.Rule

CreatedAtEQ applies the EQ predicate on the "created_at" field.

func CreatedAtGT

func CreatedAtGT(v time.Time) predicate.Rule

CreatedAtGT applies the GT predicate on the "created_at" field.

func CreatedAtGTE

func CreatedAtGTE(v time.Time) predicate.Rule

CreatedAtGTE applies the GTE predicate on the "created_at" field.

func CreatedAtIn

func CreatedAtIn(vs ...time.Time) predicate.Rule

CreatedAtIn applies the In predicate on the "created_at" field.

func CreatedAtLT

func CreatedAtLT(v time.Time) predicate.Rule

CreatedAtLT applies the LT predicate on the "created_at" field.

func CreatedAtLTE

func CreatedAtLTE(v time.Time) predicate.Rule

CreatedAtLTE applies the LTE predicate on the "created_at" field.

func CreatedAtNEQ

func CreatedAtNEQ(v time.Time) predicate.Rule

CreatedAtNEQ applies the NEQ predicate on the "created_at" field.

func CreatedAtNotIn

func CreatedAtNotIn(vs ...time.Time) predicate.Rule

CreatedAtNotIn applies the NotIn predicate on the "created_at" field.

func DiscardedAt

func DiscardedAt(v time.Time) predicate.Rule

DiscardedAt applies equality check predicate on the "discarded_at" field. It's identical to DiscardedAtEQ.

func DiscardedAtEQ

func DiscardedAtEQ(v time.Time) predicate.Rule

DiscardedAtEQ applies the EQ predicate on the "discarded_at" field.

func DiscardedAtGT

func DiscardedAtGT(v time.Time) predicate.Rule

DiscardedAtGT applies the GT predicate on the "discarded_at" field.

func DiscardedAtGTE

func DiscardedAtGTE(v time.Time) predicate.Rule

DiscardedAtGTE applies the GTE predicate on the "discarded_at" field.

func DiscardedAtIn

func DiscardedAtIn(vs ...time.Time) predicate.Rule

DiscardedAtIn applies the In predicate on the "discarded_at" field.

func DiscardedAtIsNil

func DiscardedAtIsNil() predicate.Rule

DiscardedAtIsNil applies the IsNil predicate on the "discarded_at" field.

func DiscardedAtLT

func DiscardedAtLT(v time.Time) predicate.Rule

DiscardedAtLT applies the LT predicate on the "discarded_at" field.

func DiscardedAtLTE

func DiscardedAtLTE(v time.Time) predicate.Rule

DiscardedAtLTE applies the LTE predicate on the "discarded_at" field.

func DiscardedAtNEQ

func DiscardedAtNEQ(v time.Time) predicate.Rule

DiscardedAtNEQ applies the NEQ predicate on the "discarded_at" field.

func DiscardedAtNotIn

func DiscardedAtNotIn(vs ...time.Time) predicate.Rule

DiscardedAtNotIn applies the NotIn predicate on the "discarded_at" field.

func DiscardedAtNotNil

func DiscardedAtNotNil() predicate.Rule

DiscardedAtNotNil applies the NotNil predicate on the "discarded_at" field.

func HasFirings

func HasFirings() predicate.Rule

HasFirings applies the HasEdge predicate on the "firings" edge.

func HasFiringsWith

func HasFiringsWith(preds ...predicate.RuleFiring) predicate.Rule

HasFiringsWith applies the HasEdge predicate on the "firings" edge with a given conditions (other predicates).

func HasTriggers

func HasTriggers() predicate.Rule

HasTriggers applies the HasEdge predicate on the "triggers" edge.

func HasTriggersWith

func HasTriggersWith(preds ...predicate.RuleTrigger) predicate.Rule

HasTriggersWith applies the HasEdge predicate on the "triggers" edge with a given conditions (other predicates).

func HasWorkspace

func HasWorkspace() predicate.Rule

HasWorkspace applies the HasEdge predicate on the "workspace" edge.

func HasWorkspaceWith

func HasWorkspaceWith(preds ...predicate.Workspace) predicate.Rule

HasWorkspaceWith applies the HasEdge predicate on the "workspace" edge with a given conditions (other predicates).

func ID

func ID(id int64) predicate.Rule

ID filters vertices based on their ID field.

func IDEQ

func IDEQ(id int64) predicate.Rule

IDEQ applies the EQ predicate on the ID field.

func IDGT

func IDGT(id int64) predicate.Rule

IDGT applies the GT predicate on the ID field.

func IDGTE

func IDGTE(id int64) predicate.Rule

IDGTE applies the GTE predicate on the ID field.

func IDIn

func IDIn(ids ...int64) predicate.Rule

IDIn applies the In predicate on the ID field.

func IDLT

func IDLT(id int64) predicate.Rule

IDLT applies the LT predicate on the ID field.

func IDLTE

func IDLTE(id int64) predicate.Rule

IDLTE applies the LTE predicate on the ID field.

func IDNEQ

func IDNEQ(id int64) predicate.Rule

IDNEQ applies the NEQ predicate on the ID field.

func IDNotIn

func IDNotIn(ids ...int64) predicate.Rule

IDNotIn applies the NotIn predicate on the ID field.

func Name

func Name(v string) predicate.Rule

Name applies equality check predicate on the "name" field. It's identical to NameEQ.

func NameContains

func NameContains(v string) predicate.Rule

NameContains applies the Contains predicate on the "name" field.

func NameContainsFold

func NameContainsFold(v string) predicate.Rule

NameContainsFold applies the ContainsFold predicate on the "name" field.

func NameEQ

func NameEQ(v string) predicate.Rule

NameEQ applies the EQ predicate on the "name" field.

func NameEqualFold

func NameEqualFold(v string) predicate.Rule

NameEqualFold applies the EqualFold predicate on the "name" field.

func NameGT

func NameGT(v string) predicate.Rule

NameGT applies the GT predicate on the "name" field.

func NameGTE

func NameGTE(v string) predicate.Rule

NameGTE applies the GTE predicate on the "name" field.

func NameHasPrefix

func NameHasPrefix(v string) predicate.Rule

NameHasPrefix applies the HasPrefix predicate on the "name" field.

func NameHasSuffix

func NameHasSuffix(v string) predicate.Rule

NameHasSuffix applies the HasSuffix predicate on the "name" field.

func NameIn

func NameIn(vs ...string) predicate.Rule

NameIn applies the In predicate on the "name" field.

func NameLT

func NameLT(v string) predicate.Rule

NameLT applies the LT predicate on the "name" field.

func NameLTE

func NameLTE(v string) predicate.Rule

NameLTE applies the LTE predicate on the "name" field.

func NameNEQ

func NameNEQ(v string) predicate.Rule

NameNEQ applies the NEQ predicate on the "name" field.

func NameNotIn

func NameNotIn(vs ...string) predicate.Rule

NameNotIn applies the NotIn predicate on the "name" field.

func Not

Not applies the not operator on the given predicate.

func Or

func Or(predicates ...predicate.Rule) predicate.Rule

Or groups predicates with the OR operator between them.

func StatusEQ

func StatusEQ(v Status) predicate.Rule

StatusEQ applies the EQ predicate on the "status" field.

func StatusIn

func StatusIn(vs ...Status) predicate.Rule

StatusIn applies the In predicate on the "status" field.

func StatusNEQ

func StatusNEQ(v Status) predicate.Rule

StatusNEQ applies the NEQ predicate on the "status" field.

func StatusNotIn

func StatusNotIn(vs ...Status) predicate.Rule

StatusNotIn applies the NotIn predicate on the "status" field.

func StatusValidator

func StatusValidator(s Status) error

StatusValidator is a validator for the "status" field enum values. It is called by the builders before save.

func UpdatedAt

func UpdatedAt(v time.Time) predicate.Rule

UpdatedAt applies equality check predicate on the "updated_at" field. It's identical to UpdatedAtEQ.

func UpdatedAtEQ

func UpdatedAtEQ(v time.Time) predicate.Rule

UpdatedAtEQ applies the EQ predicate on the "updated_at" field.

func UpdatedAtGT

func UpdatedAtGT(v time.Time) predicate.Rule

UpdatedAtGT applies the GT predicate on the "updated_at" field.

func UpdatedAtGTE

func UpdatedAtGTE(v time.Time) predicate.Rule

UpdatedAtGTE applies the GTE predicate on the "updated_at" field.

func UpdatedAtIn

func UpdatedAtIn(vs ...time.Time) predicate.Rule

UpdatedAtIn applies the In predicate on the "updated_at" field.

func UpdatedAtLT

func UpdatedAtLT(v time.Time) predicate.Rule

UpdatedAtLT applies the LT predicate on the "updated_at" field.

func UpdatedAtLTE

func UpdatedAtLTE(v time.Time) predicate.Rule

UpdatedAtLTE applies the LTE predicate on the "updated_at" field.

func UpdatedAtNEQ

func UpdatedAtNEQ(v time.Time) predicate.Rule

UpdatedAtNEQ applies the NEQ predicate on the "updated_at" field.

func UpdatedAtNotIn

func UpdatedAtNotIn(vs ...time.Time) predicate.Rule

UpdatedAtNotIn applies the NotIn predicate on the "updated_at" field.

func ValidColumn

func ValidColumn(column string) bool

ValidColumn reports if the column name is valid (part of the table columns).

func WorkspaceID

func WorkspaceID(v int64) predicate.Rule

WorkspaceID applies equality check predicate on the "workspace_id" field. It's identical to WorkspaceIDEQ.

func WorkspaceIDEQ

func WorkspaceIDEQ(v int64) predicate.Rule

WorkspaceIDEQ applies the EQ predicate on the "workspace_id" field.

func WorkspaceIDIn

func WorkspaceIDIn(vs ...int64) predicate.Rule

WorkspaceIDIn applies the In predicate on the "workspace_id" field.

func WorkspaceIDNEQ

func WorkspaceIDNEQ(v int64) predicate.Rule

WorkspaceIDNEQ applies the NEQ predicate on the "workspace_id" field.

func WorkspaceIDNotIn

func WorkspaceIDNotIn(vs ...int64) predicate.Rule

WorkspaceIDNotIn applies the NotIn predicate on the "workspace_id" field.

Types

type OrderOption

type OrderOption func(*sql.Selector)

OrderOption defines the ordering options for the Rule queries.

func ByActions

func ByActions(opts ...sql.OrderTermOption) OrderOption

ByActions orders the results by the actions field.

func ByActivatedAt

func ByActivatedAt(opts ...sql.OrderTermOption) OrderOption

ByActivatedAt orders the results by the activated_at field.

func ByCondition

func ByCondition(opts ...sql.OrderTermOption) OrderOption

ByCondition orders the results by the condition field.

func ByCreatedAt

func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption

ByCreatedAt orders the results by the created_at field.

func ByDiscardedAt

func ByDiscardedAt(opts ...sql.OrderTermOption) OrderOption

ByDiscardedAt orders the results by the discarded_at field.

func ByFirings

func ByFirings(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption

ByFirings orders the results by firings terms.

func ByFiringsCount

func ByFiringsCount(opts ...sql.OrderTermOption) OrderOption

ByFiringsCount orders the results by firings count.

func ByID

func ByID(opts ...sql.OrderTermOption) OrderOption

ByID orders the results by the id field.

func ByName

func ByName(opts ...sql.OrderTermOption) OrderOption

ByName orders the results by the name field.

func ByStatus

func ByStatus(opts ...sql.OrderTermOption) OrderOption

ByStatus orders the results by the status field.

func ByTriggers

func ByTriggers(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption

ByTriggers orders the results by triggers terms.

func ByTriggersCount

func ByTriggersCount(opts ...sql.OrderTermOption) OrderOption

ByTriggersCount orders the results by triggers count.

func ByUpdatedAt

func ByUpdatedAt(opts ...sql.OrderTermOption) OrderOption

ByUpdatedAt orders the results by the updated_at field.

func ByWorkspaceField

func ByWorkspaceField(field string, opts ...sql.OrderTermOption) OrderOption

ByWorkspaceField orders the results by workspace field.

func ByWorkspaceID

func ByWorkspaceID(opts ...sql.OrderTermOption) OrderOption

ByWorkspaceID orders the results by the workspace_id field.

type Status

type Status string

Status defines the type for the "status" enum field.

const (
	StatusDraft  Status = "draft"
	StatusActive Status = "active"
)

Status values.

func (Status) String

func (s Status) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL