Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
ld
go-codec-dagpb
Commits
07d051e5
Unverified
Commit
07d051e5
authored
Dec 09, 2020
by
Rod Vagg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
betterer codegen invocation
parent
035ab815
Changes
4
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
200 additions
and
288 deletions
+200
-288
gen.go
gen.go
+11
-5
ipldsch_minima.go
ipldsch_minima.go
+12
-13
ipldsch_satisfaction.go
ipldsch_satisfaction.go
+161
-254
ipldsch_types.go
ipldsch_types.go
+16
-16
No files found.
gen
/main
.go
→
gen.go
View file @
07d051e5
// +build ignore
package
main
// based on https://github.com/ipld/go-ipld-prime-proto/blob/master/gen/main.go
import
(
"os/exec"
"fmt"
"os"
"github.com/ipld/go-ipld-prime/schema"
gengo
"github.com/ipld/go-ipld-prime/schema/gen/go"
)
func
main
()
{
ts
:=
schema
.
TypeSystem
{}
ts
.
Init
()
adjCfg
:=
&
gengo
.
AdjunctCfg
{}
...
...
@@ -55,8 +57,12 @@ func main() {
schema
.
SpawnStructRepresentationMap
(
nil
),
))
// note in scope: ts.Accumulate(schema.SpawnBytes("RawNode"))
if
errs
:=
ts
.
ValidateGraph
();
errs
!=
nil
{
for
_
,
err
:=
range
errs
{
fmt
.
Printf
(
"- %s
\n
"
,
err
)
}
os
.
Exit
(
1
)
}
gengo
.
Generate
(
"./"
,
pkgName
,
ts
,
adjCfg
)
exec
.
Command
(
"go"
,
"fmt"
)
.
Run
()
gengo
.
Generate
(
"."
,
pkgName
,
ts
,
adjCfg
)
}
ipldsch_minima.go
View file @
07d051e5
...
...
@@ -31,7 +31,6 @@ const (
laState_midValue
laState_finished
)
type
_ErrorThunkAssembler
struct
{
e
error
}
...
...
ipldsch_satisfaction.go
View file @
07d051e5
This diff is collapsed.
Click to expand it.
ipldsch_types.go
View file @
07d051e5
...
...
@@ -5,7 +5,6 @@ package dagpb
import
(
ipld
"github.com/ipld/go-ipld-prime"
)
var
_
ipld
.
Node
=
nil
// suppress errors when this dependency is not referenced
// Type is a struct embeding a NodePrototype/Type for every Node implementation in this package.
// One of its major uses is to start the construction of a value.
...
...
@@ -74,3 +73,4 @@ type _PBNode struct {
// String matches the IPLD Schema type "String". It has string kind.
type
String
=
*
_String
type
_String
struct
{
x
string
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment