-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathevents.go
67 lines (53 loc) · 1.41 KB
/
events.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
package openlineage
import (
"github.com/ThijsKoot/openlineage-go/pkg/facets"
)
const (
producer = "openlineage-go"
schemaURL = "foo"
)
var DefaultNamespace = "default"
type BaseEvent struct {
// the time the event occurred at
EventTime string
// URI identifying the producer of this metadata. For example this could be a git url with a; given tag or sha
Producer string
// The JSON Pointer (https://tools.ietf.org/html/rfc6901) URL to the corresponding version; of the schema definition for this RunEvent
SchemaURL string
}
func NewInputElement(name string, namespace string) InputElement {
return InputElement{
Name: name,
Namespace: namespace,
}
}
func (ie InputElement) WithInputFacets(facets ...facets.InputDatasetFacet) InputElement {
for _, f := range facets {
f.Apply(&ie.InputFacets)
}
return ie
}
func (ie InputElement) WithFacets(facets ...facets.DatasetFacet) InputElement {
for _, f := range facets {
f.Apply(&ie.Facets)
}
return ie
}
func NewOutputElement(name string, namespace string) OutputElement {
return OutputElement{
Name: name,
Namespace: namespace,
}
}
func (oe OutputElement) WithOutputFacets(facets ...facets.OutputDatasetFacet) OutputElement {
for _, f := range facets {
f.Apply(&oe.OutputFacets)
}
return oe
}
func (oe OutputElement) WithFacets(facets ...facets.DatasetFacet) OutputElement {
for _, f := range facets {
f.Apply(&oe.Facets)
}
return oe
}