-
Notifications
You must be signed in to change notification settings - Fork 153
/
opaque.go
35 lines (26 loc) · 916 Bytes
/
opaque.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
package debug
import (
"github.com/influxdata/flux"
"github.com/influxdata/flux/runtime"
)
const OpaqueKind = "internal/debug.opaque"
type OpaqueOpSpec struct{}
func init() {
opaqueSig := runtime.MustLookupBuiltinType("internal/debug", "opaque")
runtime.RegisterPackageValue("internal/debug", "opaque", flux.MustValue(flux.FunctionValue(OpaqueKind, createOpaqueOpSpec, opaqueSig)))
flux.RegisterOpSpec(OpaqueKind, newOpaqueOp)
// opaque uses the same procedure spec and transformation as pass, so we only need to
// create and register the op spec here.
}
func createOpaqueOpSpec(args flux.Arguments, a *flux.Administration) (flux.OperationSpec, error) {
if err := a.AddParentFromArgs(args); err != nil {
return nil, err
}
return new(OpaqueOpSpec), nil
}
func newOpaqueOp() flux.OperationSpec {
return new(OpaqueOpSpec)
}
func (s *OpaqueOpSpec) Kind() flux.OperationKind {
return OpaqueKind
}