Skip to content

Commit 82ba9e9

Browse files
committed
refactor: move Value interface to value.go
1 parent 6ccdf00 commit 82ba9e9

File tree

2 files changed

+19
-16
lines changed

2 files changed

+19
-16
lines changed

dsl/types/json.go

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,6 @@ package types
22

33
import "context"
44

5-
// Value is JSON value
6-
type Value interface {
7-
// Invert returns inverted value/operation.
8-
// All type values are invertible.
9-
// Literals like string,number,... return itself as-is.
10-
// If argument type or arity is different, this returns non-nil error.
11-
Invert() (Value, error)
12-
13-
// Eval returns a evaluated value.
14-
// Literals like string,number,... return itself as-is.
15-
Eval(ctx context.Context) (val Value, rollback func(), err error)
16-
17-
// Type returns the type of this value.
18-
Type() Type
19-
}
20-
215
// ================ Null ================
226

237
// Null is JSON null struct

dsl/types/value.go

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
package types
2+
3+
import "context"
4+
5+
// Value is JSON value
6+
type Value interface {
7+
// Invert returns inverted value/operation.
8+
// All type values are invertible.
9+
// Literals like string,number,... return itself as-is.
10+
// If argument type or arity is different, this returns non-nil error.
11+
Invert() (Value, error)
12+
13+
// Eval returns a evaluated value.
14+
// Literals like string,number,... return itself as-is.
15+
Eval(ctx context.Context) (val Value, rollback func(), err error)
16+
17+
// Type returns the type of this value.
18+
Type() Type
19+
}

0 commit comments

Comments
 (0)