Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,16 @@ vdlgen:
go run v.io/x/ref/cmd/vdl generate --errors-no-i18n=false --show-warnings=false --lang=go v.io/...
go generate ./v23/vdl/vdltest

VDLROOT ?= $(shell pwd)/v23/vdlroot
export VDLROOT
vdlroot:
cd v23/vdlroot && \
go run v.io/x/ref/cmd/vdl generate --errors-no-i18n=false --show-warnings=false --lang=go \
./vdltool \
./math \
./time \
./signature

.PHONY: test-integration
test-integration:
@echo "VDLPATH" "${VDLPATH}"
Expand Down
6 changes: 4 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ go 1.13
require (
github.com/DATA-DOG/go-sqlmock v1.3.3
github.com/StackExchange/wmi v0.0.0-20190523213315-cbe66965904d // indirect
github.com/cosnicolaou/go-bindata/v3 v3.0.8 // indirect
github.com/go-ole/go-ole v1.2.4 // indirect
github.com/go-sql-driver/mysql v1.4.1
github.com/golang/protobuf v1.3.2
Expand All @@ -18,9 +19,10 @@ require (
github.com/vanadium/go-mdns-sd v0.0.0-20181006014439-f1a1ccd1252e
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9
golang.org/x/mod v0.3.0
golang.org/x/net v0.0.0-20200822124328-c89045814202
golang.org/x/net v0.0.0-20201021035429-f5854403a974
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45
golang.org/x/sync v0.0.0-20190423024810-112230192c58
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9
golang.org/x/tools v0.0.0-20201109182053-3db8fd265862 // indirect
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect
google.golang.org/api v0.9.0
v.io/x/lib v0.1.6
Expand Down
16 changes: 13 additions & 3 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ github.com/DATA-DOG/go-sqlmock v1.3.3/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q
github.com/StackExchange/wmi v0.0.0-20190523213315-cbe66965904d h1:G0m3OIz70MZUWq3EgK3CesDbo8upS2Vm9/P3FtgI+Jk=
github.com/StackExchange/wmi v0.0.0-20190523213315-cbe66965904d/go.mod h1:3eOhrUMpNV+6aFIbp5/iudMxNCF27Vw2OZgy4xEx0Fg=
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
github.com/cosnicolaou/go-bindata/v3 v3.0.8 h1:TFkRvB8gs11F8cTN+txbTQ27uH5/nKmANv9VWjMFFhw=
github.com/cosnicolaou/go-bindata/v3 v3.0.8/go.mod h1:0iCg7gGrUDn2i+XhRcis0RDdNsccqPBLJECyrlpJ21M=
github.com/creack/pty v1.1.7 h1:6pwm8kMQKCmgUg0ZHTm5+/YvRK0s3THD/28+T6/kk4A=
github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY=
github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8=
Expand Down Expand Up @@ -58,6 +60,7 @@ github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/vanadium/go-mdns-sd v0.0.0-20181006014439-f1a1ccd1252e h1:pHSeCN6iUoIWXqaMgi9TeKuESVQY1zThuhVjAHq3GpI=
github.com/vanadium/go-mdns-sd v0.0.0-20181006014439-f1a1ccd1252e/go.mod h1:35fXDjvKtzyf89fHHhyTTNLHaG2CkI7u/GvO59PIjP4=
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
go.opencensus.io v0.21.0 h1:mU6zScU4U1YAFPHEHYk+3JC4SY7JxgkqS10ZOSyksNg=
go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
Expand All @@ -83,8 +86,8 @@ golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200226121028-0de0cce0169b h1:0mm1VjtFUOIlE1SbDlwjYaDxZVDP2S5ou6y0gSgXHu8=
golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200822124328-c89045814202 h1:VvcQYSHwXgi7W+TpUR6A9g6Up98WAHf3f/ulnJ62IyA=
golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
golang.org/x/net v0.0.0-20201021035429-f5854403a974 h1:IX6qOQeG5uLjB/hjjwjedwfjND0hgjPMMyO1RoIXQNI=
golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45 h1:SVwTIAaPC2U/AvvLNZ2a7OVsmBpC8L5BlwK1whH3hm0=
Expand All @@ -95,18 +98,23 @@ golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJ
golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20190423024810-112230192c58 h1:8gQV6CLnAEikrhgkHFbMAEhagSSnXWGV915qUMm9mrU=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9 h1:SQFwaSi55rU7vdNs9Yr0Z324VNlrF+0wMqRXT4St8ck=
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b h1:ag/x1USPSsqHud38I9BAC88qdNLDHHtQ4mlgQIZPPNA=
golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200331124033-c3d80250170d h1:nc5K6ox/4lTFbMVSL9WRR81ixkcwXThoiF6yf+R9scA=
golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f h1:+Nyd8tzPX9R7BWHguqsrbFdRx3WQ/1ib8I44HXV5yTA=
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs=
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
golang.org/x/text v0.3.3 h1:cokOdA+Jmi5PJGXLlLllQSgYigAEfHXJAERHVMaCc2k=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
Expand All @@ -117,6 +125,8 @@ golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c h1:97SnQk1GYRXJgvwZ8fadnxD
golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e h1:aZzprAO9/8oim3qStq3wc1Xuxx4QmAGriC4VU4ojemQ=
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20201109182053-3db8fd265862 h1:LeKnBqBqKuA2WEVPhyr22inXOMgckBKHfUvD0n5kyCg=
golang.org/x/tools v0.0.0-20201109182053-3db8fd265862/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898 h1:/atklqdjdhuosWIl6AIbOeHJjicWYPqR9bpxqxYG2pA=
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
Expand Down
4 changes: 4 additions & 0 deletions v23/security/internal/ecdsaonly/ecdsaonly.vdl.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// Copyright 2020 The Vanadium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

// This file was auto-generated by the vanadium vdl tool.
// Package: ecdsaonly

Expand Down
4 changes: 4 additions & 0 deletions v23/security/internal/ecdsaonly/types.vdl
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// Copyright 2020 The Vanadium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

package ecdsaonly

type Hash string
Expand Down
4 changes: 4 additions & 0 deletions v23/vdl/errors_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// Copyright 2020 The Vanadium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

package vdl_test

import (
Expand Down
35 changes: 35 additions & 0 deletions v23/vdl/vdltest/vdltest.vdl.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import (
"reflect"

"v.io/v23/context"
"v.io/v23/i18n"
"v.io/v23/vdl"
"v.io/v23/verror"
)
Expand Down Expand Up @@ -93079,6 +93080,13 @@ var (
ErrThree = verror.NewIDAction("v.io/v23/vdl/vdltest.Three", verror.NoRetry)
)

// NewErrNone returns an error with the ErrNone ID.
// Deprecated: this function will be removed in the future,
// use ErrorfNone or MessageNone instead.
func NewErrNone(ctx *context.T) error {
return verror.New(ErrNone, ctx)
}

// ErrorfNone calls ErrNone.Errorf with the supplied arguments.
func ErrorfNone(ctx *context.T, format string) error {
return ErrNone.Errorf(ctx, format)
Expand All @@ -93105,6 +93113,13 @@ func ParamsErrNone(argumentError error) (verrorComponent string, verrorOperation
return
}

// NewErrOne returns an error with the ErrOne ID.
// Deprecated: this function will be removed in the future,
// use ErrorfOne or MessageOne instead.
func NewErrOne(ctx *context.T, i int64) error {
return verror.New(ErrOne, ctx, i)
}

// ErrorfOne calls ErrOne.Errorf with the supplied arguments.
func ErrorfOne(ctx *context.T, format string, i int64) error {
return ErrOne.Errorf(ctx, format, i)
Expand Down Expand Up @@ -93144,6 +93159,13 @@ func ParamsErrOne(argumentError error) (verrorComponent string, verrorOperation
return
}

// NewErrTwo returns an error with the ErrTwo ID.
// Deprecated: this function will be removed in the future,
// use ErrorfTwo or MessageTwo instead.
func NewErrTwo(ctx *context.T, a string, err error) error {
return verror.New(ErrTwo, ctx, a, err)
}

// ErrorfTwo calls ErrTwo.Errorf with the supplied arguments.
func ErrorfTwo(ctx *context.T, format string, a string, err error) error {
return ErrTwo.Errorf(ctx, format, a, err)
Expand Down Expand Up @@ -93191,6 +93213,13 @@ func ParamsErrTwo(argumentError error) (verrorComponent string, verrorOperation
return
}

// NewErrThree returns an error with the ErrThree ID.
// Deprecated: this function will be removed in the future,
// use ErrorfThree or MessageThree instead.
func NewErrThree(ctx *context.T, a string, b int64, c float32) error {
return verror.New(ErrThree, ctx, a, b, c)
}

// ErrorfThree calls ErrThree.Errorf with the supplied arguments.
func ErrorfThree(ctx *context.T, format string, a string, b int64, c float32) error {
return ErrThree.Errorf(ctx, format, a, b, c)
Expand Down Expand Up @@ -94398,5 +94427,11 @@ func initializeVDL() struct{} {
vdlTypeUnion283 = vdl.TypeOf((*VWireUnionNIface)(nil))
vdlTypeStruct284 = vdl.TypeOf((*VWireAll)(nil)).Elem()

// Set error format strings.
i18n.Cat().SetWithBase(i18n.LangID("en"), i18n.MsgID(ErrNone.ID), "{1:}{2:} dummy")
i18n.Cat().SetWithBase(i18n.LangID("en"), i18n.MsgID(ErrOne.ID), "{1:}{2:} dummy")
i18n.Cat().SetWithBase(i18n.LangID("en"), i18n.MsgID(ErrTwo.ID), "{1:}{2:} dummy")
i18n.Cat().SetWithBase(i18n.LangID("en"), i18n.MsgID(ErrThree.ID), "{1:}{2:} dummy")

return struct{}{}
}
11 changes: 11 additions & 0 deletions v23/vdlroot/vdltool/config.vdl
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,17 @@ type GoConfig struct {
// func fooToNative(x Foo, n *Native) error
// func fooFromNative(x *Foo, n Native) error
WireToNativeTypes map[string]GoType

// StructTags specifies any go struct tags to be include with the generated
// go code. The StructTags map is keyed by the struct type's name.
StructTags map[string][]GoStructTag
}

// GoStructTag specifies a single go struct tag and the field to which it
// should be applied.
type GoStructTag struct {
Field string
Tag string
}

// GoType describes the Go type information associated with a VDL type.
Expand Down
5 changes: 5 additions & 0 deletions v23/vdlroot/vdltool/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ func TestLoadingVdlConfig(t *testing.T) {
},
},
},
StructTags: map[string][]GoStructTag{
"StructTypeName": {
{Field: "NameOfField", Tag: `json:"name,omitempty" other:"name,,'quoted'"`},
},
},
},
Java: JavaConfig{
WireTypeRenames: map[string]string{
Expand Down
Loading