| // Copyright 2015 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. |
| // Source: db_objects.vdl |
| |
| package exectest |
| |
| import ( |
| // VDL system imports |
| "fmt" |
| "v.io/v23/vdl" |
| |
| // VDL user imports |
| "time" |
| _ "v.io/v23/vdlroot/time" |
| ) |
| |
| type AddressInfo struct { |
| Street string |
| City string |
| State string |
| Zip string |
| } |
| |
| func (AddressInfo) __VDLReflect(struct { |
| Name string `vdl:"v.io/syncbase/v23/syncbase/nosql/exec_test.AddressInfo"` |
| }) { |
| } |
| |
| type CreditAgency int |
| |
| const ( |
| CreditAgencyEquifax CreditAgency = iota |
| CreditAgencyExperian |
| CreditAgencyTransUnion |
| ) |
| |
| // CreditAgencyAll holds all labels for CreditAgency. |
| var CreditAgencyAll = [...]CreditAgency{CreditAgencyEquifax, CreditAgencyExperian, CreditAgencyTransUnion} |
| |
| // CreditAgencyFromString creates a CreditAgency from a string label. |
| func CreditAgencyFromString(label string) (x CreditAgency, err error) { |
| err = x.Set(label) |
| return |
| } |
| |
| // Set assigns label to x. |
| func (x *CreditAgency) Set(label string) error { |
| switch label { |
| case "Equifax", "equifax": |
| *x = CreditAgencyEquifax |
| return nil |
| case "Experian", "experian": |
| *x = CreditAgencyExperian |
| return nil |
| case "TransUnion", "transunion": |
| *x = CreditAgencyTransUnion |
| return nil |
| } |
| *x = -1 |
| return fmt.Errorf("unknown label %q in exectest.CreditAgency", label) |
| } |
| |
| // String returns the string label of x. |
| func (x CreditAgency) String() string { |
| switch x { |
| case CreditAgencyEquifax: |
| return "Equifax" |
| case CreditAgencyExperian: |
| return "Experian" |
| case CreditAgencyTransUnion: |
| return "TransUnion" |
| } |
| return "" |
| } |
| |
| func (CreditAgency) __VDLReflect(struct { |
| Name string `vdl:"v.io/syncbase/v23/syncbase/nosql/exec_test.CreditAgency"` |
| Enum struct{ Equifax, Experian, TransUnion string } |
| }) { |
| } |
| |
| type ExperianRating int |
| |
| const ( |
| ExperianRatingGood ExperianRating = iota |
| ExperianRatingBad |
| ) |
| |
| // ExperianRatingAll holds all labels for ExperianRating. |
| var ExperianRatingAll = [...]ExperianRating{ExperianRatingGood, ExperianRatingBad} |
| |
| // ExperianRatingFromString creates a ExperianRating from a string label. |
| func ExperianRatingFromString(label string) (x ExperianRating, err error) { |
| err = x.Set(label) |
| return |
| } |
| |
| // Set assigns label to x. |
| func (x *ExperianRating) Set(label string) error { |
| switch label { |
| case "Good", "good": |
| *x = ExperianRatingGood |
| return nil |
| case "Bad", "bad": |
| *x = ExperianRatingBad |
| return nil |
| } |
| *x = -1 |
| return fmt.Errorf("unknown label %q in exectest.ExperianRating", label) |
| } |
| |
| // String returns the string label of x. |
| func (x ExperianRating) String() string { |
| switch x { |
| case ExperianRatingGood: |
| return "Good" |
| case ExperianRatingBad: |
| return "Bad" |
| } |
| return "" |
| } |
| |
| func (ExperianRating) __VDLReflect(struct { |
| Name string `vdl:"v.io/syncbase/v23/syncbase/nosql/exec_test.ExperianRating"` |
| Enum struct{ Good, Bad string } |
| }) { |
| } |
| |
| type EquifaxCreditReport struct { |
| Rating byte |
| } |
| |
| func (EquifaxCreditReport) __VDLReflect(struct { |
| Name string `vdl:"v.io/syncbase/v23/syncbase/nosql/exec_test.EquifaxCreditReport"` |
| }) { |
| } |
| |
| type ExperianCreditReport struct { |
| Rating ExperianRating |
| } |
| |
| func (ExperianCreditReport) __VDLReflect(struct { |
| Name string `vdl:"v.io/syncbase/v23/syncbase/nosql/exec_test.ExperianCreditReport"` |
| }) { |
| } |
| |
| type TransUnionCreditReport struct { |
| Rating int16 |
| } |
| |
| func (TransUnionCreditReport) __VDLReflect(struct { |
| Name string `vdl:"v.io/syncbase/v23/syncbase/nosql/exec_test.TransUnionCreditReport"` |
| }) { |
| } |
| |
| type ( |
| // AgencyReport represents any single field of the AgencyReport union type. |
| AgencyReport interface { |
| // Index returns the field index. |
| Index() int |
| // Interface returns the field value as an interface. |
| Interface() interface{} |
| // Name returns the field name. |
| Name() string |
| // __VDLReflect describes the AgencyReport union type. |
| __VDLReflect(__AgencyReportReflect) |
| } |
| // AgencyReportEquifaxReport represents field EquifaxReport of the AgencyReport union type. |
| AgencyReportEquifaxReport struct{ Value EquifaxCreditReport } |
| // AgencyReportExperianReport represents field ExperianReport of the AgencyReport union type. |
| AgencyReportExperianReport struct{ Value ExperianCreditReport } |
| // AgencyReportTransUnionReport represents field TransUnionReport of the AgencyReport union type. |
| AgencyReportTransUnionReport struct{ Value TransUnionCreditReport } |
| // __AgencyReportReflect describes the AgencyReport union type. |
| __AgencyReportReflect struct { |
| Name string `vdl:"v.io/syncbase/v23/syncbase/nosql/exec_test.AgencyReport"` |
| Type AgencyReport |
| Union struct { |
| EquifaxReport AgencyReportEquifaxReport |
| ExperianReport AgencyReportExperianReport |
| TransUnionReport AgencyReportTransUnionReport |
| } |
| } |
| ) |
| |
| func (x AgencyReportEquifaxReport) Index() int { return 0 } |
| func (x AgencyReportEquifaxReport) Interface() interface{} { return x.Value } |
| func (x AgencyReportEquifaxReport) Name() string { return "EquifaxReport" } |
| func (x AgencyReportEquifaxReport) __VDLReflect(__AgencyReportReflect) {} |
| |
| func (x AgencyReportExperianReport) Index() int { return 1 } |
| func (x AgencyReportExperianReport) Interface() interface{} { return x.Value } |
| func (x AgencyReportExperianReport) Name() string { return "ExperianReport" } |
| func (x AgencyReportExperianReport) __VDLReflect(__AgencyReportReflect) {} |
| |
| func (x AgencyReportTransUnionReport) Index() int { return 2 } |
| func (x AgencyReportTransUnionReport) Interface() interface{} { return x.Value } |
| func (x AgencyReportTransUnionReport) Name() string { return "TransUnionReport" } |
| func (x AgencyReportTransUnionReport) __VDLReflect(__AgencyReportReflect) {} |
| |
| type CreditReport struct { |
| Agency CreditAgency |
| Report AgencyReport |
| } |
| |
| func (CreditReport) __VDLReflect(struct { |
| Name string `vdl:"v.io/syncbase/v23/syncbase/nosql/exec_test.CreditReport"` |
| }) { |
| } |
| |
| type Customer struct { |
| Name string |
| Id int64 |
| Active bool |
| Address AddressInfo |
| Credit CreditReport |
| } |
| |
| func (Customer) __VDLReflect(struct { |
| Name string `vdl:"v.io/syncbase/v23/syncbase/nosql/exec_test.Customer"` |
| }) { |
| } |
| |
| type Invoice struct { |
| CustId int64 |
| InvoiceNum int64 |
| InvoiceDate time.Time |
| Amount int64 |
| ShipTo AddressInfo |
| } |
| |
| func (Invoice) __VDLReflect(struct { |
| Name string `vdl:"v.io/syncbase/v23/syncbase/nosql/exec_test.Invoice"` |
| }) { |
| } |
| |
| type Numbers struct { |
| B byte |
| Ui16 uint16 |
| Ui32 uint32 |
| Ui64 uint64 |
| I16 int16 |
| I32 int32 |
| I64 int64 |
| F32 float32 |
| F64 float64 |
| C64 complex64 |
| C128 complex128 |
| } |
| |
| func (Numbers) __VDLReflect(struct { |
| Name string `vdl:"v.io/syncbase/v23/syncbase/nosql/exec_test.Numbers"` |
| }) { |
| } |
| |
| type FooType struct { |
| Bar BarType |
| } |
| |
| func (FooType) __VDLReflect(struct { |
| Name string `vdl:"v.io/syncbase/v23/syncbase/nosql/exec_test.FooType"` |
| }) { |
| } |
| |
| type BarType struct { |
| Baz BazType |
| } |
| |
| func (BarType) __VDLReflect(struct { |
| Name string `vdl:"v.io/syncbase/v23/syncbase/nosql/exec_test.BarType"` |
| }) { |
| } |
| |
| type ( |
| // TitleOrValueType represents any single field of the TitleOrValueType union type. |
| TitleOrValueType interface { |
| // Index returns the field index. |
| Index() int |
| // Interface returns the field value as an interface. |
| Interface() interface{} |
| // Name returns the field name. |
| Name() string |
| // __VDLReflect describes the TitleOrValueType union type. |
| __VDLReflect(__TitleOrValueTypeReflect) |
| } |
| // TitleOrValueTypeTitle represents field Title of the TitleOrValueType union type. |
| TitleOrValueTypeTitle struct{ Value string } |
| // TitleOrValueTypeValue represents field Value of the TitleOrValueType union type. |
| TitleOrValueTypeValue struct{ Value int64 } |
| // __TitleOrValueTypeReflect describes the TitleOrValueType union type. |
| __TitleOrValueTypeReflect struct { |
| Name string `vdl:"v.io/syncbase/v23/syncbase/nosql/exec_test.TitleOrValueType"` |
| Type TitleOrValueType |
| Union struct { |
| Title TitleOrValueTypeTitle |
| Value TitleOrValueTypeValue |
| } |
| } |
| ) |
| |
| func (x TitleOrValueTypeTitle) Index() int { return 0 } |
| func (x TitleOrValueTypeTitle) Interface() interface{} { return x.Value } |
| func (x TitleOrValueTypeTitle) Name() string { return "Title" } |
| func (x TitleOrValueTypeTitle) __VDLReflect(__TitleOrValueTypeReflect) {} |
| |
| func (x TitleOrValueTypeValue) Index() int { return 1 } |
| func (x TitleOrValueTypeValue) Interface() interface{} { return x.Value } |
| func (x TitleOrValueTypeValue) Name() string { return "Value" } |
| func (x TitleOrValueTypeValue) __VDLReflect(__TitleOrValueTypeReflect) {} |
| |
| type BazType struct { |
| Name string |
| TitleOrValue TitleOrValueType |
| } |
| |
| func (BazType) __VDLReflect(struct { |
| Name string `vdl:"v.io/syncbase/v23/syncbase/nosql/exec_test.BazType"` |
| }) { |
| } |
| |
| type ArrayOfFour [4]string |
| |
| func (ArrayOfFour) __VDLReflect(struct { |
| Name string `vdl:"v.io/syncbase/v23/syncbase/nosql/exec_test.ArrayOfFour"` |
| }) { |
| } |
| |
| type KeyIndexData struct { |
| A ArrayOfFour |
| L []string |
| M map[complex128]string |
| S map[string]struct{} |
| } |
| |
| func (KeyIndexData) __VDLReflect(struct { |
| Name string `vdl:"v.io/syncbase/v23/syncbase/nosql/exec_test.KeyIndexData"` |
| }) { |
| } |
| |
| func init() { |
| vdl.Register((*AddressInfo)(nil)) |
| vdl.Register((*CreditAgency)(nil)) |
| vdl.Register((*ExperianRating)(nil)) |
| vdl.Register((*EquifaxCreditReport)(nil)) |
| vdl.Register((*ExperianCreditReport)(nil)) |
| vdl.Register((*TransUnionCreditReport)(nil)) |
| vdl.Register((*AgencyReport)(nil)) |
| vdl.Register((*CreditReport)(nil)) |
| vdl.Register((*Customer)(nil)) |
| vdl.Register((*Invoice)(nil)) |
| vdl.Register((*Numbers)(nil)) |
| vdl.Register((*FooType)(nil)) |
| vdl.Register((*BarType)(nil)) |
| vdl.Register((*TitleOrValueType)(nil)) |
| vdl.Register((*BazType)(nil)) |
| vdl.Register((*ArrayOfFour)(nil)) |
| vdl.Register((*KeyIndexData)(nil)) |
| } |