blob: ab8b4307321304224f398bf1069705c1d942128f [file] [log] [blame]
// The vdl.config file for the standard time package configures idiomatic native
// types in each generated language.
config = vdltool.Config{
Go: {
WireToNativeTypes: {
// VDL time.Duration is represented as Go time.Duration.
"Duration": {
Kind: Number,
Type: "time.Duration",
Imports: {{Path: "time", Name: "time"}},
Zero: {Mode: Unique},
},
// VDL time.Time is represented as Go time.Time.
"Time": {
Kind: Struct,
Type: "time.Time",
Imports: {{Path: "time", Name: "time"}},
Zero: {Mode: Canonical, IsZero: ".IsZero()"},
},
// VDL time.WireDeadline is represented as VDL native time.Deadline.
"WireDeadline": {
Kind: Struct,
Type: "time.Deadline",
Imports: {{Path: "v.io/v23/vdlroot/time", Name: "time"}},
Zero: {Mode: Canonical, IsZero: ".Time.IsZero()"},
},
},
},
Java: {
WireToNativeTypes: {
"Duration": "org.joda.time.Duration",
"Time": "org.joda.time.DateTime",
},
},
Swift: {
WireToNativeTypes: {
"Duration": "NSTimeInterval",
"Time": "NSDate",
},
},
// TODO(toddw): Add native type support for Javascript.
}