-
Notifications
You must be signed in to change notification settings - Fork 6
/
interface.go
63 lines (54 loc) · 1.23 KB
/
interface.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
package ast
import (
"fmt"
"github.com/dipdup-net/go-lib/tools/base"
"github.com/dipdup-net/go-lib/tools/types"
)
// Node -
type Node interface {
fmt.Stringer
Type
Value
Base
}
// Type -
type Type interface {
Docs(inferredName string) ([]Typedef, string, error)
EqualType(node Node) bool
FindByName(name string, isEntrypoint bool) Node
GetEntrypoints() []string
GetJSONModel(JSONModel)
GetName() string
GetPrim() string
GetTypeName() string
IsNamed() bool
IsPrim(prim string) bool
ParseType(node *base.Node, id *int) error
Range(handler func(node Node) error) error
ToJSONSchema() (*JSONSchema, error)
}
// Value -
type Value interface {
Comparable
Distinguishable
EnrichBigMap(bmd []*types.BigMapDiff) error
Equal(second Node) bool
FindPointers() map[int64]*BigMap
FromJSONSchema(data map[string]interface{}) error
GetValue() interface{}
ParseValue(node *base.Node) error
ToMiguel() (*MiguelNode, error)
ToParameters() ([]byte, error)
}
// Base -
type Base interface {
ToBaseNode(optimized bool) (*base.Node, error)
}
// Distinguishable -
type Distinguishable interface {
Distinguish(second Distinguishable) (*MiguelNode, error)
}
// Comparable -
type Comparable interface {
Compare(second Comparable) (int, error)
}