File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,18 @@ import (
9
9
10
10
type NodePublic key.NodePublic
11
11
12
+ func (n NodePublic ) String () string {
13
+ return key .NodePublic (n ).String ()
14
+ }
15
+
16
+ func (n NodePublic ) MarshalJSON () ([]byte , error ) {
17
+ j , err := key .NodePublic (n ).MarshalText ()
18
+ // surround in quotes to make it a JSON string
19
+ j = append ([]byte {'"' }, j ... )
20
+ j = append (j , '"' )
21
+ return j , err
22
+ }
23
+
12
24
func (n NodePublic ) Value () (driver.Value , error ) {
13
25
return key .NodePublic (n ).MarshalText ()
14
26
}
@@ -26,6 +38,18 @@ func (n *NodePublic) Scan(value interface{}) error {
26
38
27
39
type DiscoPublic key.DiscoPublic
28
40
41
+ func (n DiscoPublic ) String () string {
42
+ return key .DiscoPublic (n ).String ()
43
+ }
44
+
45
+ func (n DiscoPublic ) MarshalJSON () ([]byte , error ) {
46
+ j , err := key .DiscoPublic (n ).MarshalText ()
47
+ // surround in quotes to make it a JSON string
48
+ j = append ([]byte {'"' }, j ... )
49
+ j = append (j , '"' )
50
+ return j , err
51
+ }
52
+
29
53
func (n DiscoPublic ) Value () (driver.Value , error ) {
30
54
return key .DiscoPublic (n ).MarshalText ()
31
55
}
You can’t perform that action at this time.
0 commit comments