/
cloudevents.go
79 lines (71 loc) · 2.52 KB
/
cloudevents.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
// Code generated by entc, DO NOT EDIT.
package cloudevents
import (
"time"
"github.com/google/uuid"
)
const (
// Label holds the string label denoting the cloudevents type in the database.
Label = "cloud_events"
// FieldID holds the string denoting the id field in the database.
FieldID = "oid"
// FieldEventId holds the string denoting the eventid field in the database.
FieldEventId = "event_id"
// FieldEvent holds the string denoting the event field in the database.
FieldEvent = "event"
// FieldFire holds the string denoting the fire field in the database.
FieldFire = "fire"
// FieldCreated holds the string denoting the created field in the database.
FieldCreated = "created"
// FieldProcessed holds the string denoting the processed field in the database.
FieldProcessed = "processed"
// EdgeNamespace holds the string denoting the namespace edge name in mutations.
EdgeNamespace = "namespace"
// Table holds the table name of the cloudevents in the database.
Table = "cloud_events"
// NamespaceTable is the table that holds the namespace relation/edge.
NamespaceTable = "cloud_events"
// NamespaceInverseTable is the table name for the Namespace entity.
// It exists in this package in order to avoid circular dependency with the "namespace" package.
NamespaceInverseTable = "namespaces"
// NamespaceColumn is the table column denoting the namespace relation/edge.
NamespaceColumn = "namespace_cloudevents"
)
// Columns holds all SQL columns for cloudevents fields.
var Columns = []string{
FieldID,
FieldEventId,
FieldEvent,
FieldFire,
FieldCreated,
FieldProcessed,
}
// ForeignKeys holds the SQL foreign-keys that are owned by the "cloud_events"
// table and are not defined as standalone fields in the schema.
var ForeignKeys = []string{
"namespace_cloudevents",
}
// ValidColumn reports if the column name is valid (part of the table columns).
func ValidColumn(column string) bool {
for i := range Columns {
if column == Columns[i] {
return true
}
}
for i := range ForeignKeys {
if column == ForeignKeys[i] {
return true
}
}
return false
}
var (
// EventIdValidator is a validator for the "eventId" field. It is called by the builders before save.
EventIdValidator func(string) error
// DefaultFire holds the default value on creation for the "fire" field.
DefaultFire func() time.Time
// DefaultCreated holds the default value on creation for the "created" field.
DefaultCreated func() time.Time
// DefaultID holds the default value on creation for the "id" field.
DefaultID func() uuid.UUID
)