aboutsummaryrefslogtreecommitdiffstats
path: root/cmd
diff options
context:
space:
mode:
authorOndrej Fabry <ofabry@cisco.com>2020-01-20 13:54:36 +0100
committerOndrej Fabry <ofabry@cisco.com>2020-01-27 14:04:19 +0100
commit8c64ee581e9cda9030c79c3d85a5ac76d8fd1bca (patch)
treef549dde543672639a392a8f14353cca5fd84e3d5 /cmd
parente095944d454ba6ff09861d8732ddd8d25a2329de (diff)
Update jsongo dep
Change-Id: I10dfbaa38de67835a84f5112d6b16bbe466c3bfe Signed-off-by: Ondrej Fabry <ofabry@cisco.com>
Diffstat (limited to 'cmd')
-rw-r--r--cmd/binapi-generator/main.go4
-rw-r--r--cmd/binapi-generator/parse.go16
2 files changed, 10 insertions, 10 deletions
diff --git a/cmd/binapi-generator/main.go b/cmd/binapi-generator/main.go
index 7a43875..c66fc4f 100644
--- a/cmd/binapi-generator/main.go
+++ b/cmd/binapi-generator/main.go
@@ -142,8 +142,8 @@ func getInputFiles(inputDir string, deep int) (files []string, err error) {
return files, nil
}
-func parseInputJSON(inputData []byte) (*jsongo.JSONNode, error) {
- jsonRoot := new(jsongo.JSONNode)
+func parseInputJSON(inputData []byte) (*jsongo.Node, error) {
+ jsonRoot := new(jsongo.Node)
if err := json.Unmarshal(inputData, jsonRoot); err != nil {
return nil, fmt.Errorf("unmarshalling JSON failed: %v", err)
}
diff --git a/cmd/binapi-generator/parse.go b/cmd/binapi-generator/parse.go
index 175fe50..9eed08c 100644
--- a/cmd/binapi-generator/parse.go
+++ b/cmd/binapi-generator/parse.go
@@ -73,7 +73,7 @@ const (
)
// parsePackage parses provided JSON data into objects prepared for code generation
-func parsePackage(ctx *context, jsonRoot *jsongo.JSONNode) (*Package, error) {
+func parsePackage(ctx *context, jsonRoot *jsongo.Node) (*Package, error) {
pkg := Package{
Name: ctx.packageName,
RefMap: make(map[string]string),
@@ -241,7 +241,7 @@ func parsePackage(ctx *context, jsonRoot *jsongo.JSONNode) (*Package, error) {
}
// parseEnum parses VPP binary API enum object from JSON node
-func parseEnum(ctx *context, enumNode *jsongo.JSONNode) (*Enum, error) {
+func parseEnum(ctx *context, enumNode *jsongo.Node) (*Enum, error) {
if enumNode.Len() == 0 || enumNode.At(0).GetType() != jsongo.TypeValue {
return nil, errors.New("invalid JSON for enum specified")
}
@@ -286,7 +286,7 @@ func parseEnum(ctx *context, enumNode *jsongo.JSONNode) (*Enum, error) {
}
// parseUnion parses VPP binary API union object from JSON node
-func parseUnion(ctx *context, unionNode *jsongo.JSONNode) (*Union, error) {
+func parseUnion(ctx *context, unionNode *jsongo.Node) (*Union, error) {
if unionNode.Len() == 0 || unionNode.At(0).GetType() != jsongo.TypeValue {
return nil, errors.New("invalid JSON for union specified")
}
@@ -323,7 +323,7 @@ func parseUnion(ctx *context, unionNode *jsongo.JSONNode) (*Union, error) {
}
// parseType parses VPP binary API type object from JSON node
-func parseType(ctx *context, typeNode *jsongo.JSONNode) (*Type, error) {
+func parseType(ctx *context, typeNode *jsongo.Node) (*Type, error) {
if typeNode.Len() == 0 || typeNode.At(0).GetType() != jsongo.TypeValue {
return nil, errors.New("invalid JSON for type specified")
}
@@ -360,7 +360,7 @@ func parseType(ctx *context, typeNode *jsongo.JSONNode) (*Type, error) {
}
// parseAlias parses VPP binary API alias object from JSON node
-func parseAlias(ctx *context, aliasName string, aliasNode *jsongo.JSONNode) (*Alias, error) {
+func parseAlias(ctx *context, aliasName string, aliasNode *jsongo.Node) (*Alias, error) {
if aliasNode.Len() == 0 || aliasNode.At(aliasTypeField).GetType() != jsongo.TypeValue {
return nil, errors.New("invalid JSON for alias specified")
}
@@ -391,7 +391,7 @@ func parseAlias(ctx *context, aliasName string, aliasNode *jsongo.JSONNode) (*Al
}
// parseMessage parses VPP binary API message object from JSON node
-func parseMessage(ctx *context, msgNode *jsongo.JSONNode) (*Message, error) {
+func parseMessage(ctx *context, msgNode *jsongo.Node) (*Message, error) {
if msgNode.Len() == 0 || msgNode.At(0).GetType() != jsongo.TypeValue {
return nil, errors.New("invalid JSON for message specified")
}
@@ -429,7 +429,7 @@ func parseMessage(ctx *context, msgNode *jsongo.JSONNode) (*Message, error) {
}
// parseField parses VPP binary API object field from JSON node
-func parseField(ctx *context, field *jsongo.JSONNode) (*Field, error) {
+func parseField(ctx *context, field *jsongo.Node) (*Field, error) {
if field.Len() < 2 || field.At(0).GetType() != jsongo.TypeValue || field.At(1).GetType() != jsongo.TypeValue {
return nil, errors.New("invalid JSON for field specified")
}
@@ -489,7 +489,7 @@ func parseField(ctx *context, field *jsongo.JSONNode) (*Field, error) {
}
// parseService parses VPP binary API service object from JSON node
-func parseService(ctx *context, svcName string, svcNode *jsongo.JSONNode) (*Service, error) {
+func parseService(ctx *context, svcName string, svcNode *jsongo.Node) (*Service, error) {
if svcNode.Len() == 0 || svcNode.At(replyField).GetType() != jsongo.TypeValue {
return nil, errors.New("invalid JSON for service specified")
}