-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdir-obs.go
58 lines (47 loc) · 1.8 KB
/
dir-obs.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
package entitygraph
import (
"github.com/aperturerobotics/controllerbus/directive"
)
// observeEntityGraph implements ObserveEntityGraph
type observeEntityGraph struct{}
// NewObserveEntityGraph constructs a new ObserveEntityGraph directive.
func NewObserveEntityGraph() ObserveEntityGraph {
return &observeEntityGraph{}
}
// Validate validates the directive.
// This is a cursory validation to see if the values "look correct."
func (g *observeEntityGraph) Validate() error {
return nil
}
// ObserveEntityGraphDirective is a marker function.
func (g *observeEntityGraph) ObserveEntityGraphDirective() {
// noop
}
// GetValueOptions returns options relating to value handling.
func (g *observeEntityGraph) GetValueOptions() directive.ValueOptions {
return directive.ValueOptions{}
}
// IsEquivalent checks if the other directive is equivalent. If two
// directives are equivalent, and the new directive does not superceed the
// old, then the new directive will be merged (de-duplicated) into the old.
func (g *observeEntityGraph) IsEquivalent(other directive.Directive) bool {
_, ok := other.(ObserveEntityGraph)
return ok
}
// Superceeds checks if the directive overrides another.
// The other directive will be canceled if superceded.
func (g *observeEntityGraph) Superceeds(other directive.Directive) bool {
return false
}
// GetName returns the directive's type name.
// This is not necessarily unique, and is primarily intended for display.
func (d *observeEntityGraph) GetName() string {
return "ObserveEntityGraph"
}
// GetDebugVals returns the directive arguments as k/v pairs.
// This is not necessarily unique, and is primarily intended for display.
func (d *observeEntityGraph) GetDebugVals() directive.DebugValues {
return nil
}
// _ is a type assertion
var _ ObserveEntityGraph = ((*observeEntityGraph)(nil))