id
int32 0
167k
| repo
stringlengths 5
54
| path
stringlengths 4
155
| func_name
stringlengths 1
118
| original_string
stringlengths 52
85.5k
| language
stringclasses 1
value | code
stringlengths 52
85.5k
| code_tokens
listlengths 21
1.41k
| docstring
stringlengths 6
2.61k
| docstring_tokens
listlengths 3
215
| sha
stringlengths 40
40
| url
stringlengths 85
252
|
---|---|---|---|---|---|---|---|---|---|---|---|
10,800 | yarpc/yarpc-go | internal/crossdock/thrift/gauntlet/types.go | MarshalLogObject | func (v *NestedListsI32x3) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
if v == nil {
return nil
}
if v.Integerlist != nil {
err = multierr.Append(err, enc.AddArray("integerlist", (_List_List_List_I32_Zapper)(v.Integerlist)))
}
return err
} | go | func (v *NestedListsI32x3) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
if v == nil {
return nil
}
if v.Integerlist != nil {
err = multierr.Append(err, enc.AddArray("integerlist", (_List_List_List_I32_Zapper)(v.Integerlist)))
}
return err
} | [
"func",
"(",
"v",
"*",
"NestedListsI32x3",
")",
"MarshalLogObject",
"(",
"enc",
"zapcore",
".",
"ObjectEncoder",
")",
"(",
"err",
"error",
")",
"{",
"if",
"v",
"==",
"nil",
"{",
"return",
"nil",
"\n",
"}",
"\n",
"if",
"v",
".",
"Integerlist",
"!=",
"nil",
"{",
"err",
"=",
"multierr",
".",
"Append",
"(",
"err",
",",
"enc",
".",
"AddArray",
"(",
"\"",
"\"",
",",
"(",
"_List_List_List_I32_Zapper",
")",
"(",
"v",
".",
"Integerlist",
")",
")",
")",
"\n",
"}",
"\n",
"return",
"err",
"\n",
"}"
]
| // MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of NestedListsI32x3. | [
"MarshalLogObject",
"implements",
"zapcore",
".",
"ObjectMarshaler",
"enabling",
"fast",
"logging",
"of",
"NestedListsI32x3",
"."
]
| bd70ffbd17e635243988ba62be97eebff738204d | https://github.com/yarpc/yarpc-go/blob/bd70ffbd17e635243988ba62be97eebff738204d/internal/crossdock/thrift/gauntlet/types.go#L4593-L4601 |
10,801 | yarpc/yarpc-go | internal/crossdock/thrift/gauntlet/types.go | String | func (v *NestedMixedx2) String() string {
if v == nil {
return "<nil>"
}
var fields [3]string
i := 0
if v.IntSetList != nil {
fields[i] = fmt.Sprintf("IntSetList: %v", v.IntSetList)
i++
}
if v.MapIntStrset != nil {
fields[i] = fmt.Sprintf("MapIntStrset: %v", v.MapIntStrset)
i++
}
if v.MapIntStrsetList != nil {
fields[i] = fmt.Sprintf("MapIntStrsetList: %v", v.MapIntStrsetList)
i++
}
return fmt.Sprintf("NestedMixedx2{%v}", strings.Join(fields[:i], ", "))
} | go | func (v *NestedMixedx2) String() string {
if v == nil {
return "<nil>"
}
var fields [3]string
i := 0
if v.IntSetList != nil {
fields[i] = fmt.Sprintf("IntSetList: %v", v.IntSetList)
i++
}
if v.MapIntStrset != nil {
fields[i] = fmt.Sprintf("MapIntStrset: %v", v.MapIntStrset)
i++
}
if v.MapIntStrsetList != nil {
fields[i] = fmt.Sprintf("MapIntStrsetList: %v", v.MapIntStrsetList)
i++
}
return fmt.Sprintf("NestedMixedx2{%v}", strings.Join(fields[:i], ", "))
} | [
"func",
"(",
"v",
"*",
"NestedMixedx2",
")",
"String",
"(",
")",
"string",
"{",
"if",
"v",
"==",
"nil",
"{",
"return",
"\"",
"\"",
"\n",
"}",
"\n\n",
"var",
"fields",
"[",
"3",
"]",
"string",
"\n",
"i",
":=",
"0",
"\n",
"if",
"v",
".",
"IntSetList",
"!=",
"nil",
"{",
"fields",
"[",
"i",
"]",
"=",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"v",
".",
"IntSetList",
")",
"\n",
"i",
"++",
"\n",
"}",
"\n",
"if",
"v",
".",
"MapIntStrset",
"!=",
"nil",
"{",
"fields",
"[",
"i",
"]",
"=",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"v",
".",
"MapIntStrset",
")",
"\n",
"i",
"++",
"\n",
"}",
"\n",
"if",
"v",
".",
"MapIntStrsetList",
"!=",
"nil",
"{",
"fields",
"[",
"i",
"]",
"=",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"v",
".",
"MapIntStrsetList",
")",
"\n",
"i",
"++",
"\n",
"}",
"\n\n",
"return",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"strings",
".",
"Join",
"(",
"fields",
"[",
":",
"i",
"]",
",",
"\"",
"\"",
")",
")",
"\n",
"}"
]
| // String returns a readable string representation of a NestedMixedx2
// struct. | [
"String",
"returns",
"a",
"readable",
"string",
"representation",
"of",
"a",
"NestedMixedx2",
"struct",
"."
]
| bd70ffbd17e635243988ba62be97eebff738204d | https://github.com/yarpc/yarpc-go/blob/bd70ffbd17e635243988ba62be97eebff738204d/internal/crossdock/thrift/gauntlet/types.go#L4889-L4910 |
10,802 | yarpc/yarpc-go | internal/crossdock/thrift/gauntlet/types.go | Equals | func (v *NestedMixedx2) Equals(rhs *NestedMixedx2) bool {
if v == nil {
return rhs == nil
} else if rhs == nil {
return false
}
if !((v.IntSetList == nil && rhs.IntSetList == nil) || (v.IntSetList != nil && rhs.IntSetList != nil && _List_Set_I32_Equals(v.IntSetList, rhs.IntSetList))) {
return false
}
if !((v.MapIntStrset == nil && rhs.MapIntStrset == nil) || (v.MapIntStrset != nil && rhs.MapIntStrset != nil && _Map_I32_Set_String_Equals(v.MapIntStrset, rhs.MapIntStrset))) {
return false
}
if !((v.MapIntStrsetList == nil && rhs.MapIntStrsetList == nil) || (v.MapIntStrsetList != nil && rhs.MapIntStrsetList != nil && _List_Map_I32_Set_String_Equals(v.MapIntStrsetList, rhs.MapIntStrsetList))) {
return false
}
return true
} | go | func (v *NestedMixedx2) Equals(rhs *NestedMixedx2) bool {
if v == nil {
return rhs == nil
} else if rhs == nil {
return false
}
if !((v.IntSetList == nil && rhs.IntSetList == nil) || (v.IntSetList != nil && rhs.IntSetList != nil && _List_Set_I32_Equals(v.IntSetList, rhs.IntSetList))) {
return false
}
if !((v.MapIntStrset == nil && rhs.MapIntStrset == nil) || (v.MapIntStrset != nil && rhs.MapIntStrset != nil && _Map_I32_Set_String_Equals(v.MapIntStrset, rhs.MapIntStrset))) {
return false
}
if !((v.MapIntStrsetList == nil && rhs.MapIntStrsetList == nil) || (v.MapIntStrsetList != nil && rhs.MapIntStrsetList != nil && _List_Map_I32_Set_String_Equals(v.MapIntStrsetList, rhs.MapIntStrsetList))) {
return false
}
return true
} | [
"func",
"(",
"v",
"*",
"NestedMixedx2",
")",
"Equals",
"(",
"rhs",
"*",
"NestedMixedx2",
")",
"bool",
"{",
"if",
"v",
"==",
"nil",
"{",
"return",
"rhs",
"==",
"nil",
"\n",
"}",
"else",
"if",
"rhs",
"==",
"nil",
"{",
"return",
"false",
"\n",
"}",
"\n",
"if",
"!",
"(",
"(",
"v",
".",
"IntSetList",
"==",
"nil",
"&&",
"rhs",
".",
"IntSetList",
"==",
"nil",
")",
"||",
"(",
"v",
".",
"IntSetList",
"!=",
"nil",
"&&",
"rhs",
".",
"IntSetList",
"!=",
"nil",
"&&",
"_List_Set_I32_Equals",
"(",
"v",
".",
"IntSetList",
",",
"rhs",
".",
"IntSetList",
")",
")",
")",
"{",
"return",
"false",
"\n",
"}",
"\n",
"if",
"!",
"(",
"(",
"v",
".",
"MapIntStrset",
"==",
"nil",
"&&",
"rhs",
".",
"MapIntStrset",
"==",
"nil",
")",
"||",
"(",
"v",
".",
"MapIntStrset",
"!=",
"nil",
"&&",
"rhs",
".",
"MapIntStrset",
"!=",
"nil",
"&&",
"_Map_I32_Set_String_Equals",
"(",
"v",
".",
"MapIntStrset",
",",
"rhs",
".",
"MapIntStrset",
")",
")",
")",
"{",
"return",
"false",
"\n",
"}",
"\n",
"if",
"!",
"(",
"(",
"v",
".",
"MapIntStrsetList",
"==",
"nil",
"&&",
"rhs",
".",
"MapIntStrsetList",
"==",
"nil",
")",
"||",
"(",
"v",
".",
"MapIntStrsetList",
"!=",
"nil",
"&&",
"rhs",
".",
"MapIntStrsetList",
"!=",
"nil",
"&&",
"_List_Map_I32_Set_String_Equals",
"(",
"v",
".",
"MapIntStrsetList",
",",
"rhs",
".",
"MapIntStrsetList",
")",
")",
")",
"{",
"return",
"false",
"\n",
"}",
"\n\n",
"return",
"true",
"\n",
"}"
]
| // Equals returns true if all the fields of this NestedMixedx2 match the
// provided NestedMixedx2.
//
// This function performs a deep comparison. | [
"Equals",
"returns",
"true",
"if",
"all",
"the",
"fields",
"of",
"this",
"NestedMixedx2",
"match",
"the",
"provided",
"NestedMixedx2",
".",
"This",
"function",
"performs",
"a",
"deep",
"comparison",
"."
]
| bd70ffbd17e635243988ba62be97eebff738204d | https://github.com/yarpc/yarpc-go/blob/bd70ffbd17e635243988ba62be97eebff738204d/internal/crossdock/thrift/gauntlet/types.go#L4963-L4980 |
10,803 | yarpc/yarpc-go | internal/crossdock/thrift/gauntlet/types.go | MarshalLogArray | func (l _List_Set_I32_Zapper) MarshalLogArray(enc zapcore.ArrayEncoder) (err error) {
for _, v := range l {
err = multierr.Append(err, enc.AppendArray((_Set_I32_Zapper)(v)))
}
return err
} | go | func (l _List_Set_I32_Zapper) MarshalLogArray(enc zapcore.ArrayEncoder) (err error) {
for _, v := range l {
err = multierr.Append(err, enc.AppendArray((_Set_I32_Zapper)(v)))
}
return err
} | [
"func",
"(",
"l",
"_List_Set_I32_Zapper",
")",
"MarshalLogArray",
"(",
"enc",
"zapcore",
".",
"ArrayEncoder",
")",
"(",
"err",
"error",
")",
"{",
"for",
"_",
",",
"v",
":=",
"range",
"l",
"{",
"err",
"=",
"multierr",
".",
"Append",
"(",
"err",
",",
"enc",
".",
"AppendArray",
"(",
"(",
"_Set_I32_Zapper",
")",
"(",
"v",
")",
")",
")",
"\n",
"}",
"\n",
"return",
"err",
"\n",
"}"
]
| // MarshalLogArray implements zapcore.ArrayMarshaler, enabling
// fast logging of _List_Set_I32_Zapper. | [
"MarshalLogArray",
"implements",
"zapcore",
".",
"ArrayMarshaler",
"enabling",
"fast",
"logging",
"of",
"_List_Set_I32_Zapper",
"."
]
| bd70ffbd17e635243988ba62be97eebff738204d | https://github.com/yarpc/yarpc-go/blob/bd70ffbd17e635243988ba62be97eebff738204d/internal/crossdock/thrift/gauntlet/types.go#L4986-L4991 |
10,804 | yarpc/yarpc-go | internal/crossdock/thrift/gauntlet/types.go | MarshalLogObject | func (v _Map_I32_Set_String_Item_Zapper) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
enc.AddInt32("key", v.Key)
err = multierr.Append(err, enc.AddArray("value", (_Set_String_Zapper)(v.Value)))
return err
} | go | func (v _Map_I32_Set_String_Item_Zapper) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
enc.AddInt32("key", v.Key)
err = multierr.Append(err, enc.AddArray("value", (_Set_String_Zapper)(v.Value)))
return err
} | [
"func",
"(",
"v",
"_Map_I32_Set_String_Item_Zapper",
")",
"MarshalLogObject",
"(",
"enc",
"zapcore",
".",
"ObjectEncoder",
")",
"(",
"err",
"error",
")",
"{",
"enc",
".",
"AddInt32",
"(",
"\"",
"\"",
",",
"v",
".",
"Key",
")",
"\n",
"err",
"=",
"multierr",
".",
"Append",
"(",
"err",
",",
"enc",
".",
"AddArray",
"(",
"\"",
"\"",
",",
"(",
"_Set_String_Zapper",
")",
"(",
"v",
".",
"Value",
")",
")",
")",
"\n",
"return",
"err",
"\n",
"}"
]
| // MarshalLogArray implements zapcore.ArrayMarshaler, enabling
// fast logging of _Map_I32_Set_String_Item_Zapper. | [
"MarshalLogArray",
"implements",
"zapcore",
".",
"ArrayMarshaler",
"enabling",
"fast",
"logging",
"of",
"_Map_I32_Set_String_Item_Zapper",
"."
]
| bd70ffbd17e635243988ba62be97eebff738204d | https://github.com/yarpc/yarpc-go/blob/bd70ffbd17e635243988ba62be97eebff738204d/internal/crossdock/thrift/gauntlet/types.go#L5000-L5004 |
10,805 | yarpc/yarpc-go | internal/crossdock/thrift/gauntlet/types.go | MarshalLogArray | func (m _Map_I32_Set_String_Zapper) MarshalLogArray(enc zapcore.ArrayEncoder) (err error) {
for k, v := range m {
err = multierr.Append(err, enc.AppendObject(_Map_I32_Set_String_Item_Zapper{Key: k, Value: v}))
}
return err
} | go | func (m _Map_I32_Set_String_Zapper) MarshalLogArray(enc zapcore.ArrayEncoder) (err error) {
for k, v := range m {
err = multierr.Append(err, enc.AppendObject(_Map_I32_Set_String_Item_Zapper{Key: k, Value: v}))
}
return err
} | [
"func",
"(",
"m",
"_Map_I32_Set_String_Zapper",
")",
"MarshalLogArray",
"(",
"enc",
"zapcore",
".",
"ArrayEncoder",
")",
"(",
"err",
"error",
")",
"{",
"for",
"k",
",",
"v",
":=",
"range",
"m",
"{",
"err",
"=",
"multierr",
".",
"Append",
"(",
"err",
",",
"enc",
".",
"AppendObject",
"(",
"_Map_I32_Set_String_Item_Zapper",
"{",
"Key",
":",
"k",
",",
"Value",
":",
"v",
"}",
")",
")",
"\n",
"}",
"\n",
"return",
"err",
"\n",
"}"
]
| // MarshalLogArray implements zapcore.ArrayMarshaler, enabling
// fast logging of _Map_I32_Set_String_Zapper. | [
"MarshalLogArray",
"implements",
"zapcore",
".",
"ArrayMarshaler",
"enabling",
"fast",
"logging",
"of",
"_Map_I32_Set_String_Zapper",
"."
]
| bd70ffbd17e635243988ba62be97eebff738204d | https://github.com/yarpc/yarpc-go/blob/bd70ffbd17e635243988ba62be97eebff738204d/internal/crossdock/thrift/gauntlet/types.go#L5010-L5015 |
10,806 | yarpc/yarpc-go | internal/crossdock/thrift/gauntlet/types.go | MarshalLogArray | func (l _List_Map_I32_Set_String_Zapper) MarshalLogArray(enc zapcore.ArrayEncoder) (err error) {
for _, v := range l {
err = multierr.Append(err, enc.AppendArray((_Map_I32_Set_String_Zapper)(v)))
}
return err
} | go | func (l _List_Map_I32_Set_String_Zapper) MarshalLogArray(enc zapcore.ArrayEncoder) (err error) {
for _, v := range l {
err = multierr.Append(err, enc.AppendArray((_Map_I32_Set_String_Zapper)(v)))
}
return err
} | [
"func",
"(",
"l",
"_List_Map_I32_Set_String_Zapper",
")",
"MarshalLogArray",
"(",
"enc",
"zapcore",
".",
"ArrayEncoder",
")",
"(",
"err",
"error",
")",
"{",
"for",
"_",
",",
"v",
":=",
"range",
"l",
"{",
"err",
"=",
"multierr",
".",
"Append",
"(",
"err",
",",
"enc",
".",
"AppendArray",
"(",
"(",
"_Map_I32_Set_String_Zapper",
")",
"(",
"v",
")",
")",
")",
"\n",
"}",
"\n",
"return",
"err",
"\n",
"}"
]
| // MarshalLogArray implements zapcore.ArrayMarshaler, enabling
// fast logging of _List_Map_I32_Set_String_Zapper. | [
"MarshalLogArray",
"implements",
"zapcore",
".",
"ArrayMarshaler",
"enabling",
"fast",
"logging",
"of",
"_List_Map_I32_Set_String_Zapper",
"."
]
| bd70ffbd17e635243988ba62be97eebff738204d | https://github.com/yarpc/yarpc-go/blob/bd70ffbd17e635243988ba62be97eebff738204d/internal/crossdock/thrift/gauntlet/types.go#L5021-L5026 |
10,807 | yarpc/yarpc-go | internal/crossdock/thrift/gauntlet/types.go | MarshalLogObject | func (v *NestedMixedx2) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
if v == nil {
return nil
}
if v.IntSetList != nil {
err = multierr.Append(err, enc.AddArray("int_set_list", (_List_Set_I32_Zapper)(v.IntSetList)))
}
if v.MapIntStrset != nil {
err = multierr.Append(err, enc.AddArray("map_int_strset", (_Map_I32_Set_String_Zapper)(v.MapIntStrset)))
}
if v.MapIntStrsetList != nil {
err = multierr.Append(err, enc.AddArray("map_int_strset_list", (_List_Map_I32_Set_String_Zapper)(v.MapIntStrsetList)))
}
return err
} | go | func (v *NestedMixedx2) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
if v == nil {
return nil
}
if v.IntSetList != nil {
err = multierr.Append(err, enc.AddArray("int_set_list", (_List_Set_I32_Zapper)(v.IntSetList)))
}
if v.MapIntStrset != nil {
err = multierr.Append(err, enc.AddArray("map_int_strset", (_Map_I32_Set_String_Zapper)(v.MapIntStrset)))
}
if v.MapIntStrsetList != nil {
err = multierr.Append(err, enc.AddArray("map_int_strset_list", (_List_Map_I32_Set_String_Zapper)(v.MapIntStrsetList)))
}
return err
} | [
"func",
"(",
"v",
"*",
"NestedMixedx2",
")",
"MarshalLogObject",
"(",
"enc",
"zapcore",
".",
"ObjectEncoder",
")",
"(",
"err",
"error",
")",
"{",
"if",
"v",
"==",
"nil",
"{",
"return",
"nil",
"\n",
"}",
"\n",
"if",
"v",
".",
"IntSetList",
"!=",
"nil",
"{",
"err",
"=",
"multierr",
".",
"Append",
"(",
"err",
",",
"enc",
".",
"AddArray",
"(",
"\"",
"\"",
",",
"(",
"_List_Set_I32_Zapper",
")",
"(",
"v",
".",
"IntSetList",
")",
")",
")",
"\n",
"}",
"\n",
"if",
"v",
".",
"MapIntStrset",
"!=",
"nil",
"{",
"err",
"=",
"multierr",
".",
"Append",
"(",
"err",
",",
"enc",
".",
"AddArray",
"(",
"\"",
"\"",
",",
"(",
"_Map_I32_Set_String_Zapper",
")",
"(",
"v",
".",
"MapIntStrset",
")",
")",
")",
"\n",
"}",
"\n",
"if",
"v",
".",
"MapIntStrsetList",
"!=",
"nil",
"{",
"err",
"=",
"multierr",
".",
"Append",
"(",
"err",
",",
"enc",
".",
"AddArray",
"(",
"\"",
"\"",
",",
"(",
"_List_Map_I32_Set_String_Zapper",
")",
"(",
"v",
".",
"MapIntStrsetList",
")",
")",
")",
"\n",
"}",
"\n",
"return",
"err",
"\n",
"}"
]
| // MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of NestedMixedx2. | [
"MarshalLogObject",
"implements",
"zapcore",
".",
"ObjectMarshaler",
"enabling",
"fast",
"logging",
"of",
"NestedMixedx2",
"."
]
| bd70ffbd17e635243988ba62be97eebff738204d | https://github.com/yarpc/yarpc-go/blob/bd70ffbd17e635243988ba62be97eebff738204d/internal/crossdock/thrift/gauntlet/types.go#L5030-L5044 |
10,808 | yarpc/yarpc-go | internal/crossdock/thrift/gauntlet/types.go | GetIntSetList | func (v *NestedMixedx2) GetIntSetList() (o []map[int32]struct{}) {
if v != nil && v.IntSetList != nil {
return v.IntSetList
}
return
} | go | func (v *NestedMixedx2) GetIntSetList() (o []map[int32]struct{}) {
if v != nil && v.IntSetList != nil {
return v.IntSetList
}
return
} | [
"func",
"(",
"v",
"*",
"NestedMixedx2",
")",
"GetIntSetList",
"(",
")",
"(",
"o",
"[",
"]",
"map",
"[",
"int32",
"]",
"struct",
"{",
"}",
")",
"{",
"if",
"v",
"!=",
"nil",
"&&",
"v",
".",
"IntSetList",
"!=",
"nil",
"{",
"return",
"v",
".",
"IntSetList",
"\n",
"}",
"\n\n",
"return",
"\n",
"}"
]
| // GetIntSetList returns the value of IntSetList if it is set or its
// zero value if it is unset. | [
"GetIntSetList",
"returns",
"the",
"value",
"of",
"IntSetList",
"if",
"it",
"is",
"set",
"or",
"its",
"zero",
"value",
"if",
"it",
"is",
"unset",
"."
]
| bd70ffbd17e635243988ba62be97eebff738204d | https://github.com/yarpc/yarpc-go/blob/bd70ffbd17e635243988ba62be97eebff738204d/internal/crossdock/thrift/gauntlet/types.go#L5048-L5054 |
10,809 | yarpc/yarpc-go | internal/crossdock/thrift/gauntlet/types.go | GetMapIntStrset | func (v *NestedMixedx2) GetMapIntStrset() (o map[int32]map[string]struct{}) {
if v != nil && v.MapIntStrset != nil {
return v.MapIntStrset
}
return
} | go | func (v *NestedMixedx2) GetMapIntStrset() (o map[int32]map[string]struct{}) {
if v != nil && v.MapIntStrset != nil {
return v.MapIntStrset
}
return
} | [
"func",
"(",
"v",
"*",
"NestedMixedx2",
")",
"GetMapIntStrset",
"(",
")",
"(",
"o",
"map",
"[",
"int32",
"]",
"map",
"[",
"string",
"]",
"struct",
"{",
"}",
")",
"{",
"if",
"v",
"!=",
"nil",
"&&",
"v",
".",
"MapIntStrset",
"!=",
"nil",
"{",
"return",
"v",
".",
"MapIntStrset",
"\n",
"}",
"\n\n",
"return",
"\n",
"}"
]
| // GetMapIntStrset returns the value of MapIntStrset if it is set or its
// zero value if it is unset. | [
"GetMapIntStrset",
"returns",
"the",
"value",
"of",
"MapIntStrset",
"if",
"it",
"is",
"set",
"or",
"its",
"zero",
"value",
"if",
"it",
"is",
"unset",
"."
]
| bd70ffbd17e635243988ba62be97eebff738204d | https://github.com/yarpc/yarpc-go/blob/bd70ffbd17e635243988ba62be97eebff738204d/internal/crossdock/thrift/gauntlet/types.go#L5063-L5069 |
10,810 | yarpc/yarpc-go | internal/crossdock/thrift/gauntlet/types.go | GetMapIntStrsetList | func (v *NestedMixedx2) GetMapIntStrsetList() (o []map[int32]map[string]struct{}) {
if v != nil && v.MapIntStrsetList != nil {
return v.MapIntStrsetList
}
return
} | go | func (v *NestedMixedx2) GetMapIntStrsetList() (o []map[int32]map[string]struct{}) {
if v != nil && v.MapIntStrsetList != nil {
return v.MapIntStrsetList
}
return
} | [
"func",
"(",
"v",
"*",
"NestedMixedx2",
")",
"GetMapIntStrsetList",
"(",
")",
"(",
"o",
"[",
"]",
"map",
"[",
"int32",
"]",
"map",
"[",
"string",
"]",
"struct",
"{",
"}",
")",
"{",
"if",
"v",
"!=",
"nil",
"&&",
"v",
".",
"MapIntStrsetList",
"!=",
"nil",
"{",
"return",
"v",
".",
"MapIntStrsetList",
"\n",
"}",
"\n\n",
"return",
"\n",
"}"
]
| // GetMapIntStrsetList returns the value of MapIntStrsetList if it is set or its
// zero value if it is unset. | [
"GetMapIntStrsetList",
"returns",
"the",
"value",
"of",
"MapIntStrsetList",
"if",
"it",
"is",
"set",
"or",
"its",
"zero",
"value",
"if",
"it",
"is",
"unset",
"."
]
| bd70ffbd17e635243988ba62be97eebff738204d | https://github.com/yarpc/yarpc-go/blob/bd70ffbd17e635243988ba62be97eebff738204d/internal/crossdock/thrift/gauntlet/types.go#L5078-L5084 |
10,811 | yarpc/yarpc-go | internal/crossdock/thrift/gauntlet/types.go | MarshalLogObject | func (v Numberz) MarshalLogObject(enc zapcore.ObjectEncoder) error {
enc.AddInt32("value", int32(v))
switch int32(v) {
case 1:
enc.AddString("name", "ONE")
case 2:
enc.AddString("name", "TWO")
case 3:
enc.AddString("name", "THREE")
case 5:
enc.AddString("name", "FIVE")
case 6:
enc.AddString("name", "SIX")
case 8:
enc.AddString("name", "EIGHT")
}
return nil
} | go | func (v Numberz) MarshalLogObject(enc zapcore.ObjectEncoder) error {
enc.AddInt32("value", int32(v))
switch int32(v) {
case 1:
enc.AddString("name", "ONE")
case 2:
enc.AddString("name", "TWO")
case 3:
enc.AddString("name", "THREE")
case 5:
enc.AddString("name", "FIVE")
case 6:
enc.AddString("name", "SIX")
case 8:
enc.AddString("name", "EIGHT")
}
return nil
} | [
"func",
"(",
"v",
"Numberz",
")",
"MarshalLogObject",
"(",
"enc",
"zapcore",
".",
"ObjectEncoder",
")",
"error",
"{",
"enc",
".",
"AddInt32",
"(",
"\"",
"\"",
",",
"int32",
"(",
"v",
")",
")",
"\n",
"switch",
"int32",
"(",
"v",
")",
"{",
"case",
"1",
":",
"enc",
".",
"AddString",
"(",
"\"",
"\"",
",",
"\"",
"\"",
")",
"\n",
"case",
"2",
":",
"enc",
".",
"AddString",
"(",
"\"",
"\"",
",",
"\"",
"\"",
")",
"\n",
"case",
"3",
":",
"enc",
".",
"AddString",
"(",
"\"",
"\"",
",",
"\"",
"\"",
")",
"\n",
"case",
"5",
":",
"enc",
".",
"AddString",
"(",
"\"",
"\"",
",",
"\"",
"\"",
")",
"\n",
"case",
"6",
":",
"enc",
".",
"AddString",
"(",
"\"",
"\"",
",",
"\"",
"\"",
")",
"\n",
"case",
"8",
":",
"enc",
".",
"AddString",
"(",
"\"",
"\"",
",",
"\"",
"\"",
")",
"\n",
"}",
"\n",
"return",
"nil",
"\n",
"}"
]
| // MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of Numberz.
// Enums are logged as objects, where the value is logged with key "value", and
// if this value's name is known, the name is logged with key "name". | [
"MarshalLogObject",
"implements",
"zapcore",
".",
"ObjectMarshaler",
"enabling",
"fast",
"logging",
"of",
"Numberz",
".",
"Enums",
"are",
"logged",
"as",
"objects",
"where",
"the",
"value",
"is",
"logged",
"with",
"key",
"value",
"and",
"if",
"this",
"value",
"s",
"name",
"is",
"known",
"the",
"name",
"is",
"logged",
"with",
"key",
"name",
"."
]
| bd70ffbd17e635243988ba62be97eebff738204d | https://github.com/yarpc/yarpc-go/blob/bd70ffbd17e635243988ba62be97eebff738204d/internal/crossdock/thrift/gauntlet/types.go#L5178-L5195 |
10,812 | yarpc/yarpc-go | internal/crossdock/thrift/gauntlet/types.go | String | func (v Numberz) String() string {
w := int32(v)
switch w {
case 1:
return "ONE"
case 2:
return "TWO"
case 3:
return "THREE"
case 5:
return "FIVE"
case 6:
return "SIX"
case 8:
return "EIGHT"
}
return fmt.Sprintf("Numberz(%d)", w)
} | go | func (v Numberz) String() string {
w := int32(v)
switch w {
case 1:
return "ONE"
case 2:
return "TWO"
case 3:
return "THREE"
case 5:
return "FIVE"
case 6:
return "SIX"
case 8:
return "EIGHT"
}
return fmt.Sprintf("Numberz(%d)", w)
} | [
"func",
"(",
"v",
"Numberz",
")",
"String",
"(",
")",
"string",
"{",
"w",
":=",
"int32",
"(",
"v",
")",
"\n",
"switch",
"w",
"{",
"case",
"1",
":",
"return",
"\"",
"\"",
"\n",
"case",
"2",
":",
"return",
"\"",
"\"",
"\n",
"case",
"3",
":",
"return",
"\"",
"\"",
"\n",
"case",
"5",
":",
"return",
"\"",
"\"",
"\n",
"case",
"6",
":",
"return",
"\"",
"\"",
"\n",
"case",
"8",
":",
"return",
"\"",
"\"",
"\n",
"}",
"\n",
"return",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"w",
")",
"\n",
"}"
]
| // String returns a readable string representation of Numberz. | [
"String",
"returns",
"a",
"readable",
"string",
"representation",
"of",
"Numberz",
"."
]
| bd70ffbd17e635243988ba62be97eebff738204d | https://github.com/yarpc/yarpc-go/blob/bd70ffbd17e635243988ba62be97eebff738204d/internal/crossdock/thrift/gauntlet/types.go#L5230-L5247 |
10,813 | yarpc/yarpc-go | internal/crossdock/thrift/gauntlet/types.go | UnmarshalJSON | func (v *Numberz) UnmarshalJSON(text []byte) error {
d := json.NewDecoder(bytes.NewReader(text))
d.UseNumber()
t, err := d.Token()
if err != nil {
return err
}
switch w := t.(type) {
case json.Number:
x, err := w.Int64()
if err != nil {
return err
}
if x > math.MaxInt32 {
return fmt.Errorf("enum overflow from JSON %q for %q", text, "Numberz")
}
if x < math.MinInt32 {
return fmt.Errorf("enum underflow from JSON %q for %q", text, "Numberz")
}
*v = (Numberz)(x)
return nil
case string:
return v.UnmarshalText([]byte(w))
default:
return fmt.Errorf("invalid JSON value %q (%T) to unmarshal into %q", t, t, "Numberz")
}
} | go | func (v *Numberz) UnmarshalJSON(text []byte) error {
d := json.NewDecoder(bytes.NewReader(text))
d.UseNumber()
t, err := d.Token()
if err != nil {
return err
}
switch w := t.(type) {
case json.Number:
x, err := w.Int64()
if err != nil {
return err
}
if x > math.MaxInt32 {
return fmt.Errorf("enum overflow from JSON %q for %q", text, "Numberz")
}
if x < math.MinInt32 {
return fmt.Errorf("enum underflow from JSON %q for %q", text, "Numberz")
}
*v = (Numberz)(x)
return nil
case string:
return v.UnmarshalText([]byte(w))
default:
return fmt.Errorf("invalid JSON value %q (%T) to unmarshal into %q", t, t, "Numberz")
}
} | [
"func",
"(",
"v",
"*",
"Numberz",
")",
"UnmarshalJSON",
"(",
"text",
"[",
"]",
"byte",
")",
"error",
"{",
"d",
":=",
"json",
".",
"NewDecoder",
"(",
"bytes",
".",
"NewReader",
"(",
"text",
")",
")",
"\n",
"d",
".",
"UseNumber",
"(",
")",
"\n",
"t",
",",
"err",
":=",
"d",
".",
"Token",
"(",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n\n",
"switch",
"w",
":=",
"t",
".",
"(",
"type",
")",
"{",
"case",
"json",
".",
"Number",
":",
"x",
",",
"err",
":=",
"w",
".",
"Int64",
"(",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n",
"if",
"x",
">",
"math",
".",
"MaxInt32",
"{",
"return",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
",",
"text",
",",
"\"",
"\"",
")",
"\n",
"}",
"\n",
"if",
"x",
"<",
"math",
".",
"MinInt32",
"{",
"return",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
",",
"text",
",",
"\"",
"\"",
")",
"\n",
"}",
"\n",
"*",
"v",
"=",
"(",
"Numberz",
")",
"(",
"x",
")",
"\n",
"return",
"nil",
"\n",
"case",
"string",
":",
"return",
"v",
".",
"UnmarshalText",
"(",
"[",
"]",
"byte",
"(",
"w",
")",
")",
"\n",
"default",
":",
"return",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
",",
"t",
",",
"t",
",",
"\"",
"\"",
")",
"\n",
"}",
"\n",
"}"
]
| // UnmarshalJSON attempts to decode Numberz from its JSON
// representation.
//
// This implementation supports both, numeric and string inputs. If a
// string is provided, it must be a known enum name.
//
// This implements json.Unmarshaler. | [
"UnmarshalJSON",
"attempts",
"to",
"decode",
"Numberz",
"from",
"its",
"JSON",
"representation",
".",
"This",
"implementation",
"supports",
"both",
"numeric",
"and",
"string",
"inputs",
".",
"If",
"a",
"string",
"is",
"provided",
"it",
"must",
"be",
"a",
"known",
"enum",
"name",
".",
"This",
"implements",
"json",
".",
"Unmarshaler",
"."
]
| bd70ffbd17e635243988ba62be97eebff738204d | https://github.com/yarpc/yarpc-go/blob/bd70ffbd17e635243988ba62be97eebff738204d/internal/crossdock/thrift/gauntlet/types.go#L5286-L5313 |
10,814 | yarpc/yarpc-go | internal/crossdock/thrift/gauntlet/types.go | String | func (v *OneField) String() string {
if v == nil {
return "<nil>"
}
var fields [1]string
i := 0
if v.Field != nil {
fields[i] = fmt.Sprintf("Field: %v", v.Field)
i++
}
return fmt.Sprintf("OneField{%v}", strings.Join(fields[:i], ", "))
} | go | func (v *OneField) String() string {
if v == nil {
return "<nil>"
}
var fields [1]string
i := 0
if v.Field != nil {
fields[i] = fmt.Sprintf("Field: %v", v.Field)
i++
}
return fmt.Sprintf("OneField{%v}", strings.Join(fields[:i], ", "))
} | [
"func",
"(",
"v",
"*",
"OneField",
")",
"String",
"(",
")",
"string",
"{",
"if",
"v",
"==",
"nil",
"{",
"return",
"\"",
"\"",
"\n",
"}",
"\n\n",
"var",
"fields",
"[",
"1",
"]",
"string",
"\n",
"i",
":=",
"0",
"\n",
"if",
"v",
".",
"Field",
"!=",
"nil",
"{",
"fields",
"[",
"i",
"]",
"=",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"v",
".",
"Field",
")",
"\n",
"i",
"++",
"\n",
"}",
"\n\n",
"return",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"strings",
".",
"Join",
"(",
"fields",
"[",
":",
"i",
"]",
",",
"\"",
"\"",
")",
")",
"\n",
"}"
]
| // String returns a readable string representation of a OneField
// struct. | [
"String",
"returns",
"a",
"readable",
"string",
"representation",
"of",
"a",
"OneField",
"struct",
"."
]
| bd70ffbd17e635243988ba62be97eebff738204d | https://github.com/yarpc/yarpc-go/blob/bd70ffbd17e635243988ba62be97eebff738204d/internal/crossdock/thrift/gauntlet/types.go#L5398-L5411 |
10,815 | yarpc/yarpc-go | internal/crossdock/thrift/gauntlet/types.go | Equals | func (v *OneField) Equals(rhs *OneField) bool {
if v == nil {
return rhs == nil
} else if rhs == nil {
return false
}
if !((v.Field == nil && rhs.Field == nil) || (v.Field != nil && rhs.Field != nil && v.Field.Equals(rhs.Field))) {
return false
}
return true
} | go | func (v *OneField) Equals(rhs *OneField) bool {
if v == nil {
return rhs == nil
} else if rhs == nil {
return false
}
if !((v.Field == nil && rhs.Field == nil) || (v.Field != nil && rhs.Field != nil && v.Field.Equals(rhs.Field))) {
return false
}
return true
} | [
"func",
"(",
"v",
"*",
"OneField",
")",
"Equals",
"(",
"rhs",
"*",
"OneField",
")",
"bool",
"{",
"if",
"v",
"==",
"nil",
"{",
"return",
"rhs",
"==",
"nil",
"\n",
"}",
"else",
"if",
"rhs",
"==",
"nil",
"{",
"return",
"false",
"\n",
"}",
"\n",
"if",
"!",
"(",
"(",
"v",
".",
"Field",
"==",
"nil",
"&&",
"rhs",
".",
"Field",
"==",
"nil",
")",
"||",
"(",
"v",
".",
"Field",
"!=",
"nil",
"&&",
"rhs",
".",
"Field",
"!=",
"nil",
"&&",
"v",
".",
"Field",
".",
"Equals",
"(",
"rhs",
".",
"Field",
")",
")",
")",
"{",
"return",
"false",
"\n",
"}",
"\n\n",
"return",
"true",
"\n",
"}"
]
| // Equals returns true if all the fields of this OneField match the
// provided OneField.
//
// This function performs a deep comparison. | [
"Equals",
"returns",
"true",
"if",
"all",
"the",
"fields",
"of",
"this",
"OneField",
"match",
"the",
"provided",
"OneField",
".",
"This",
"function",
"performs",
"a",
"deep",
"comparison",
"."
]
| bd70ffbd17e635243988ba62be97eebff738204d | https://github.com/yarpc/yarpc-go/blob/bd70ffbd17e635243988ba62be97eebff738204d/internal/crossdock/thrift/gauntlet/types.go#L5417-L5428 |
10,816 | yarpc/yarpc-go | internal/crossdock/thrift/gauntlet/types.go | MarshalLogObject | func (v *OneField) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
if v == nil {
return nil
}
if v.Field != nil {
err = multierr.Append(err, enc.AddObject("field", v.Field))
}
return err
} | go | func (v *OneField) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
if v == nil {
return nil
}
if v.Field != nil {
err = multierr.Append(err, enc.AddObject("field", v.Field))
}
return err
} | [
"func",
"(",
"v",
"*",
"OneField",
")",
"MarshalLogObject",
"(",
"enc",
"zapcore",
".",
"ObjectEncoder",
")",
"(",
"err",
"error",
")",
"{",
"if",
"v",
"==",
"nil",
"{",
"return",
"nil",
"\n",
"}",
"\n",
"if",
"v",
".",
"Field",
"!=",
"nil",
"{",
"err",
"=",
"multierr",
".",
"Append",
"(",
"err",
",",
"enc",
".",
"AddObject",
"(",
"\"",
"\"",
",",
"v",
".",
"Field",
")",
")",
"\n",
"}",
"\n",
"return",
"err",
"\n",
"}"
]
| // MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of OneField. | [
"MarshalLogObject",
"implements",
"zapcore",
".",
"ObjectMarshaler",
"enabling",
"fast",
"logging",
"of",
"OneField",
"."
]
| bd70ffbd17e635243988ba62be97eebff738204d | https://github.com/yarpc/yarpc-go/blob/bd70ffbd17e635243988ba62be97eebff738204d/internal/crossdock/thrift/gauntlet/types.go#L5432-L5440 |
10,817 | yarpc/yarpc-go | internal/crossdock/thrift/gauntlet/types.go | GetField | func (v *OneField) GetField() (o *EmptyStruct) {
if v != nil && v.Field != nil {
return v.Field
}
return
} | go | func (v *OneField) GetField() (o *EmptyStruct) {
if v != nil && v.Field != nil {
return v.Field
}
return
} | [
"func",
"(",
"v",
"*",
"OneField",
")",
"GetField",
"(",
")",
"(",
"o",
"*",
"EmptyStruct",
")",
"{",
"if",
"v",
"!=",
"nil",
"&&",
"v",
".",
"Field",
"!=",
"nil",
"{",
"return",
"v",
".",
"Field",
"\n",
"}",
"\n\n",
"return",
"\n",
"}"
]
| // GetField returns the value of Field if it is set or its
// zero value if it is unset. | [
"GetField",
"returns",
"the",
"value",
"of",
"Field",
"if",
"it",
"is",
"set",
"or",
"its",
"zero",
"value",
"if",
"it",
"is",
"unset",
"."
]
| bd70ffbd17e635243988ba62be97eebff738204d | https://github.com/yarpc/yarpc-go/blob/bd70ffbd17e635243988ba62be97eebff738204d/internal/crossdock/thrift/gauntlet/types.go#L5444-L5450 |
10,818 | yarpc/yarpc-go | internal/crossdock/thrift/gauntlet/types.go | String | func (v *StructA) String() string {
if v == nil {
return "<nil>"
}
var fields [1]string
i := 0
fields[i] = fmt.Sprintf("S: %v", v.S)
i++
return fmt.Sprintf("StructA{%v}", strings.Join(fields[:i], ", "))
} | go | func (v *StructA) String() string {
if v == nil {
return "<nil>"
}
var fields [1]string
i := 0
fields[i] = fmt.Sprintf("S: %v", v.S)
i++
return fmt.Sprintf("StructA{%v}", strings.Join(fields[:i], ", "))
} | [
"func",
"(",
"v",
"*",
"StructA",
")",
"String",
"(",
")",
"string",
"{",
"if",
"v",
"==",
"nil",
"{",
"return",
"\"",
"\"",
"\n",
"}",
"\n\n",
"var",
"fields",
"[",
"1",
"]",
"string",
"\n",
"i",
":=",
"0",
"\n",
"fields",
"[",
"i",
"]",
"=",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"v",
".",
"S",
")",
"\n",
"i",
"++",
"\n\n",
"return",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"strings",
".",
"Join",
"(",
"fields",
"[",
":",
"i",
"]",
",",
"\"",
"\"",
")",
")",
"\n",
"}"
]
| // String returns a readable string representation of a StructA
// struct. | [
"String",
"returns",
"a",
"readable",
"string",
"representation",
"of",
"a",
"StructA",
"struct",
"."
]
| bd70ffbd17e635243988ba62be97eebff738204d | https://github.com/yarpc/yarpc-go/blob/bd70ffbd17e635243988ba62be97eebff738204d/internal/crossdock/thrift/gauntlet/types.go#L5538-L5549 |
10,819 | yarpc/yarpc-go | internal/crossdock/thrift/gauntlet/types.go | Equals | func (v *StructA) Equals(rhs *StructA) bool {
if v == nil {
return rhs == nil
} else if rhs == nil {
return false
}
if !(v.S == rhs.S) {
return false
}
return true
} | go | func (v *StructA) Equals(rhs *StructA) bool {
if v == nil {
return rhs == nil
} else if rhs == nil {
return false
}
if !(v.S == rhs.S) {
return false
}
return true
} | [
"func",
"(",
"v",
"*",
"StructA",
")",
"Equals",
"(",
"rhs",
"*",
"StructA",
")",
"bool",
"{",
"if",
"v",
"==",
"nil",
"{",
"return",
"rhs",
"==",
"nil",
"\n",
"}",
"else",
"if",
"rhs",
"==",
"nil",
"{",
"return",
"false",
"\n",
"}",
"\n",
"if",
"!",
"(",
"v",
".",
"S",
"==",
"rhs",
".",
"S",
")",
"{",
"return",
"false",
"\n",
"}",
"\n\n",
"return",
"true",
"\n",
"}"
]
| // Equals returns true if all the fields of this StructA match the
// provided StructA.
//
// This function performs a deep comparison. | [
"Equals",
"returns",
"true",
"if",
"all",
"the",
"fields",
"of",
"this",
"StructA",
"match",
"the",
"provided",
"StructA",
".",
"This",
"function",
"performs",
"a",
"deep",
"comparison",
"."
]
| bd70ffbd17e635243988ba62be97eebff738204d | https://github.com/yarpc/yarpc-go/blob/bd70ffbd17e635243988ba62be97eebff738204d/internal/crossdock/thrift/gauntlet/types.go#L5555-L5566 |
10,820 | yarpc/yarpc-go | internal/crossdock/thrift/gauntlet/types.go | MarshalLogObject | func (v *StructA) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
if v == nil {
return nil
}
enc.AddString("s", v.S)
return err
} | go | func (v *StructA) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
if v == nil {
return nil
}
enc.AddString("s", v.S)
return err
} | [
"func",
"(",
"v",
"*",
"StructA",
")",
"MarshalLogObject",
"(",
"enc",
"zapcore",
".",
"ObjectEncoder",
")",
"(",
"err",
"error",
")",
"{",
"if",
"v",
"==",
"nil",
"{",
"return",
"nil",
"\n",
"}",
"\n",
"enc",
".",
"AddString",
"(",
"\"",
"\"",
",",
"v",
".",
"S",
")",
"\n",
"return",
"err",
"\n",
"}"
]
| // MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of StructA. | [
"MarshalLogObject",
"implements",
"zapcore",
".",
"ObjectMarshaler",
"enabling",
"fast",
"logging",
"of",
"StructA",
"."
]
| bd70ffbd17e635243988ba62be97eebff738204d | https://github.com/yarpc/yarpc-go/blob/bd70ffbd17e635243988ba62be97eebff738204d/internal/crossdock/thrift/gauntlet/types.go#L5570-L5576 |
10,821 | yarpc/yarpc-go | internal/crossdock/thrift/gauntlet/types.go | GetS | func (v *StructA) GetS() (o string) {
if v != nil {
o = v.S
}
return
} | go | func (v *StructA) GetS() (o string) {
if v != nil {
o = v.S
}
return
} | [
"func",
"(",
"v",
"*",
"StructA",
")",
"GetS",
"(",
")",
"(",
"o",
"string",
")",
"{",
"if",
"v",
"!=",
"nil",
"{",
"o",
"=",
"v",
".",
"S",
"\n",
"}",
"\n",
"return",
"\n",
"}"
]
| // GetS returns the value of S if it is set or its
// zero value if it is unset. | [
"GetS",
"returns",
"the",
"value",
"of",
"S",
"if",
"it",
"is",
"set",
"or",
"its",
"zero",
"value",
"if",
"it",
"is",
"unset",
"."
]
| bd70ffbd17e635243988ba62be97eebff738204d | https://github.com/yarpc/yarpc-go/blob/bd70ffbd17e635243988ba62be97eebff738204d/internal/crossdock/thrift/gauntlet/types.go#L5580-L5585 |
10,822 | yarpc/yarpc-go | internal/crossdock/thrift/gauntlet/types.go | String | func (v *StructB) String() string {
if v == nil {
return "<nil>"
}
var fields [2]string
i := 0
if v.Aa != nil {
fields[i] = fmt.Sprintf("Aa: %v", v.Aa)
i++
}
fields[i] = fmt.Sprintf("Ab: %v", v.Ab)
i++
return fmt.Sprintf("StructB{%v}", strings.Join(fields[:i], ", "))
} | go | func (v *StructB) String() string {
if v == nil {
return "<nil>"
}
var fields [2]string
i := 0
if v.Aa != nil {
fields[i] = fmt.Sprintf("Aa: %v", v.Aa)
i++
}
fields[i] = fmt.Sprintf("Ab: %v", v.Ab)
i++
return fmt.Sprintf("StructB{%v}", strings.Join(fields[:i], ", "))
} | [
"func",
"(",
"v",
"*",
"StructB",
")",
"String",
"(",
")",
"string",
"{",
"if",
"v",
"==",
"nil",
"{",
"return",
"\"",
"\"",
"\n",
"}",
"\n\n",
"var",
"fields",
"[",
"2",
"]",
"string",
"\n",
"i",
":=",
"0",
"\n",
"if",
"v",
".",
"Aa",
"!=",
"nil",
"{",
"fields",
"[",
"i",
"]",
"=",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"v",
".",
"Aa",
")",
"\n",
"i",
"++",
"\n",
"}",
"\n",
"fields",
"[",
"i",
"]",
"=",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"v",
".",
"Ab",
")",
"\n",
"i",
"++",
"\n\n",
"return",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"strings",
".",
"Join",
"(",
"fields",
"[",
":",
"i",
"]",
",",
"\"",
"\"",
")",
")",
"\n",
"}"
]
| // String returns a readable string representation of a StructB
// struct. | [
"String",
"returns",
"a",
"readable",
"string",
"representation",
"of",
"a",
"StructB",
"struct",
"."
]
| bd70ffbd17e635243988ba62be97eebff738204d | https://github.com/yarpc/yarpc-go/blob/bd70ffbd17e635243988ba62be97eebff738204d/internal/crossdock/thrift/gauntlet/types.go#L5694-L5709 |
10,823 | yarpc/yarpc-go | internal/crossdock/thrift/gauntlet/types.go | Equals | func (v *StructB) Equals(rhs *StructB) bool {
if v == nil {
return rhs == nil
} else if rhs == nil {
return false
}
if !((v.Aa == nil && rhs.Aa == nil) || (v.Aa != nil && rhs.Aa != nil && v.Aa.Equals(rhs.Aa))) {
return false
}
if !v.Ab.Equals(rhs.Ab) {
return false
}
return true
} | go | func (v *StructB) Equals(rhs *StructB) bool {
if v == nil {
return rhs == nil
} else if rhs == nil {
return false
}
if !((v.Aa == nil && rhs.Aa == nil) || (v.Aa != nil && rhs.Aa != nil && v.Aa.Equals(rhs.Aa))) {
return false
}
if !v.Ab.Equals(rhs.Ab) {
return false
}
return true
} | [
"func",
"(",
"v",
"*",
"StructB",
")",
"Equals",
"(",
"rhs",
"*",
"StructB",
")",
"bool",
"{",
"if",
"v",
"==",
"nil",
"{",
"return",
"rhs",
"==",
"nil",
"\n",
"}",
"else",
"if",
"rhs",
"==",
"nil",
"{",
"return",
"false",
"\n",
"}",
"\n",
"if",
"!",
"(",
"(",
"v",
".",
"Aa",
"==",
"nil",
"&&",
"rhs",
".",
"Aa",
"==",
"nil",
")",
"||",
"(",
"v",
".",
"Aa",
"!=",
"nil",
"&&",
"rhs",
".",
"Aa",
"!=",
"nil",
"&&",
"v",
".",
"Aa",
".",
"Equals",
"(",
"rhs",
".",
"Aa",
")",
")",
")",
"{",
"return",
"false",
"\n",
"}",
"\n",
"if",
"!",
"v",
".",
"Ab",
".",
"Equals",
"(",
"rhs",
".",
"Ab",
")",
"{",
"return",
"false",
"\n",
"}",
"\n\n",
"return",
"true",
"\n",
"}"
]
| // Equals returns true if all the fields of this StructB match the
// provided StructB.
//
// This function performs a deep comparison. | [
"Equals",
"returns",
"true",
"if",
"all",
"the",
"fields",
"of",
"this",
"StructB",
"match",
"the",
"provided",
"StructB",
".",
"This",
"function",
"performs",
"a",
"deep",
"comparison",
"."
]
| bd70ffbd17e635243988ba62be97eebff738204d | https://github.com/yarpc/yarpc-go/blob/bd70ffbd17e635243988ba62be97eebff738204d/internal/crossdock/thrift/gauntlet/types.go#L5715-L5729 |
10,824 | yarpc/yarpc-go | internal/crossdock/thrift/gauntlet/types.go | MarshalLogObject | func (v *StructB) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
if v == nil {
return nil
}
if v.Aa != nil {
err = multierr.Append(err, enc.AddObject("aa", v.Aa))
}
err = multierr.Append(err, enc.AddObject("ab", v.Ab))
return err
} | go | func (v *StructB) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
if v == nil {
return nil
}
if v.Aa != nil {
err = multierr.Append(err, enc.AddObject("aa", v.Aa))
}
err = multierr.Append(err, enc.AddObject("ab", v.Ab))
return err
} | [
"func",
"(",
"v",
"*",
"StructB",
")",
"MarshalLogObject",
"(",
"enc",
"zapcore",
".",
"ObjectEncoder",
")",
"(",
"err",
"error",
")",
"{",
"if",
"v",
"==",
"nil",
"{",
"return",
"nil",
"\n",
"}",
"\n",
"if",
"v",
".",
"Aa",
"!=",
"nil",
"{",
"err",
"=",
"multierr",
".",
"Append",
"(",
"err",
",",
"enc",
".",
"AddObject",
"(",
"\"",
"\"",
",",
"v",
".",
"Aa",
")",
")",
"\n",
"}",
"\n",
"err",
"=",
"multierr",
".",
"Append",
"(",
"err",
",",
"enc",
".",
"AddObject",
"(",
"\"",
"\"",
",",
"v",
".",
"Ab",
")",
")",
"\n",
"return",
"err",
"\n",
"}"
]
| // MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of StructB. | [
"MarshalLogObject",
"implements",
"zapcore",
".",
"ObjectMarshaler",
"enabling",
"fast",
"logging",
"of",
"StructB",
"."
]
| bd70ffbd17e635243988ba62be97eebff738204d | https://github.com/yarpc/yarpc-go/blob/bd70ffbd17e635243988ba62be97eebff738204d/internal/crossdock/thrift/gauntlet/types.go#L5733-L5742 |
10,825 | yarpc/yarpc-go | internal/crossdock/thrift/gauntlet/types.go | GetAa | func (v *StructB) GetAa() (o *StructA) {
if v != nil && v.Aa != nil {
return v.Aa
}
return
} | go | func (v *StructB) GetAa() (o *StructA) {
if v != nil && v.Aa != nil {
return v.Aa
}
return
} | [
"func",
"(",
"v",
"*",
"StructB",
")",
"GetAa",
"(",
")",
"(",
"o",
"*",
"StructA",
")",
"{",
"if",
"v",
"!=",
"nil",
"&&",
"v",
".",
"Aa",
"!=",
"nil",
"{",
"return",
"v",
".",
"Aa",
"\n",
"}",
"\n\n",
"return",
"\n",
"}"
]
| // GetAa returns the value of Aa if it is set or its
// zero value if it is unset. | [
"GetAa",
"returns",
"the",
"value",
"of",
"Aa",
"if",
"it",
"is",
"set",
"or",
"its",
"zero",
"value",
"if",
"it",
"is",
"unset",
"."
]
| bd70ffbd17e635243988ba62be97eebff738204d | https://github.com/yarpc/yarpc-go/blob/bd70ffbd17e635243988ba62be97eebff738204d/internal/crossdock/thrift/gauntlet/types.go#L5746-L5752 |
10,826 | yarpc/yarpc-go | internal/crossdock/thrift/gauntlet/types.go | GetAb | func (v *StructB) GetAb() (o *StructA) {
if v != nil {
o = v.Ab
}
return
} | go | func (v *StructB) GetAb() (o *StructA) {
if v != nil {
o = v.Ab
}
return
} | [
"func",
"(",
"v",
"*",
"StructB",
")",
"GetAb",
"(",
")",
"(",
"o",
"*",
"StructA",
")",
"{",
"if",
"v",
"!=",
"nil",
"{",
"o",
"=",
"v",
".",
"Ab",
"\n",
"}",
"\n",
"return",
"\n",
"}"
]
| // GetAb returns the value of Ab if it is set or its
// zero value if it is unset. | [
"GetAb",
"returns",
"the",
"value",
"of",
"Ab",
"if",
"it",
"is",
"set",
"or",
"its",
"zero",
"value",
"if",
"it",
"is",
"unset",
"."
]
| bd70ffbd17e635243988ba62be97eebff738204d | https://github.com/yarpc/yarpc-go/blob/bd70ffbd17e635243988ba62be97eebff738204d/internal/crossdock/thrift/gauntlet/types.go#L5761-L5766 |
10,827 | yarpc/yarpc-go | internal/crossdock/thrift/gauntlet/types.go | ToWire | func (v UserId) ToWire() (wire.Value, error) {
x := (int64)(v)
return wire.NewValueI64(x), error(nil)
} | go | func (v UserId) ToWire() (wire.Value, error) {
x := (int64)(v)
return wire.NewValueI64(x), error(nil)
} | [
"func",
"(",
"v",
"UserId",
")",
"ToWire",
"(",
")",
"(",
"wire",
".",
"Value",
",",
"error",
")",
"{",
"x",
":=",
"(",
"int64",
")",
"(",
"v",
")",
"\n",
"return",
"wire",
".",
"NewValueI64",
"(",
"x",
")",
",",
"error",
"(",
"nil",
")",
"\n",
"}"
]
| // ToWire translates UserId into a Thrift-level intermediate
// representation. This intermediate representation may be serialized
// into bytes using a ThriftRW protocol implementation. | [
"ToWire",
"translates",
"UserId",
"into",
"a",
"Thrift",
"-",
"level",
"intermediate",
"representation",
".",
"This",
"intermediate",
"representation",
"may",
"be",
"serialized",
"into",
"bytes",
"using",
"a",
"ThriftRW",
"protocol",
"implementation",
"."
]
| bd70ffbd17e635243988ba62be97eebff738204d | https://github.com/yarpc/yarpc-go/blob/bd70ffbd17e635243988ba62be97eebff738204d/internal/crossdock/thrift/gauntlet/types.go#L5778-L5781 |
10,828 | yarpc/yarpc-go | internal/crossdock/thrift/gauntlet/types.go | String | func (v UserId) String() string {
x := (int64)(v)
return fmt.Sprint(x)
} | go | func (v UserId) String() string {
x := (int64)(v)
return fmt.Sprint(x)
} | [
"func",
"(",
"v",
"UserId",
")",
"String",
"(",
")",
"string",
"{",
"x",
":=",
"(",
"int64",
")",
"(",
"v",
")",
"\n",
"return",
"fmt",
".",
"Sprint",
"(",
"x",
")",
"\n",
"}"
]
| // String returns a readable string representation of UserId. | [
"String",
"returns",
"a",
"readable",
"string",
"representation",
"of",
"UserId",
"."
]
| bd70ffbd17e635243988ba62be97eebff738204d | https://github.com/yarpc/yarpc-go/blob/bd70ffbd17e635243988ba62be97eebff738204d/internal/crossdock/thrift/gauntlet/types.go#L5784-L5787 |
10,829 | yarpc/yarpc-go | internal/crossdock/thrift/gauntlet/types.go | FromWire | func (v *UserId) FromWire(w wire.Value) error {
x, err := w.GetI64(), error(nil)
*v = (UserId)(x)
return err
} | go | func (v *UserId) FromWire(w wire.Value) error {
x, err := w.GetI64(), error(nil)
*v = (UserId)(x)
return err
} | [
"func",
"(",
"v",
"*",
"UserId",
")",
"FromWire",
"(",
"w",
"wire",
".",
"Value",
")",
"error",
"{",
"x",
",",
"err",
":=",
"w",
".",
"GetI64",
"(",
")",
",",
"error",
"(",
"nil",
")",
"\n",
"*",
"v",
"=",
"(",
"UserId",
")",
"(",
"x",
")",
"\n",
"return",
"err",
"\n",
"}"
]
| // FromWire deserializes UserId from its Thrift-level
// representation. The Thrift-level representation may be obtained
// from a ThriftRW protocol implementation. | [
"FromWire",
"deserializes",
"UserId",
"from",
"its",
"Thrift",
"-",
"level",
"representation",
".",
"The",
"Thrift",
"-",
"level",
"representation",
"may",
"be",
"obtained",
"from",
"a",
"ThriftRW",
"protocol",
"implementation",
"."
]
| bd70ffbd17e635243988ba62be97eebff738204d | https://github.com/yarpc/yarpc-go/blob/bd70ffbd17e635243988ba62be97eebff738204d/internal/crossdock/thrift/gauntlet/types.go#L5792-L5796 |
10,830 | yarpc/yarpc-go | internal/crossdock/thrift/gauntlet/types.go | Equals | func (lhs UserId) Equals(rhs UserId) bool {
return ((int64)(lhs) == (int64)(rhs))
} | go | func (lhs UserId) Equals(rhs UserId) bool {
return ((int64)(lhs) == (int64)(rhs))
} | [
"func",
"(",
"lhs",
"UserId",
")",
"Equals",
"(",
"rhs",
"UserId",
")",
"bool",
"{",
"return",
"(",
"(",
"int64",
")",
"(",
"lhs",
")",
"==",
"(",
"int64",
")",
"(",
"rhs",
")",
")",
"\n",
"}"
]
| // Equals returns true if this UserId is equal to the provided
// UserId. | [
"Equals",
"returns",
"true",
"if",
"this",
"UserId",
"is",
"equal",
"to",
"the",
"provided",
"UserId",
"."
]
| bd70ffbd17e635243988ba62be97eebff738204d | https://github.com/yarpc/yarpc-go/blob/bd70ffbd17e635243988ba62be97eebff738204d/internal/crossdock/thrift/gauntlet/types.go#L5800-L5802 |
10,831 | yarpc/yarpc-go | internal/crossdock/thrift/gauntlet/types.go | String | func (v *VersioningTestV1) String() string {
if v == nil {
return "<nil>"
}
var fields [3]string
i := 0
if v.BeginInBoth != nil {
fields[i] = fmt.Sprintf("BeginInBoth: %v", *(v.BeginInBoth))
i++
}
if v.OldString != nil {
fields[i] = fmt.Sprintf("OldString: %v", *(v.OldString))
i++
}
if v.EndInBoth != nil {
fields[i] = fmt.Sprintf("EndInBoth: %v", *(v.EndInBoth))
i++
}
return fmt.Sprintf("VersioningTestV1{%v}", strings.Join(fields[:i], ", "))
} | go | func (v *VersioningTestV1) String() string {
if v == nil {
return "<nil>"
}
var fields [3]string
i := 0
if v.BeginInBoth != nil {
fields[i] = fmt.Sprintf("BeginInBoth: %v", *(v.BeginInBoth))
i++
}
if v.OldString != nil {
fields[i] = fmt.Sprintf("OldString: %v", *(v.OldString))
i++
}
if v.EndInBoth != nil {
fields[i] = fmt.Sprintf("EndInBoth: %v", *(v.EndInBoth))
i++
}
return fmt.Sprintf("VersioningTestV1{%v}", strings.Join(fields[:i], ", "))
} | [
"func",
"(",
"v",
"*",
"VersioningTestV1",
")",
"String",
"(",
")",
"string",
"{",
"if",
"v",
"==",
"nil",
"{",
"return",
"\"",
"\"",
"\n",
"}",
"\n\n",
"var",
"fields",
"[",
"3",
"]",
"string",
"\n",
"i",
":=",
"0",
"\n",
"if",
"v",
".",
"BeginInBoth",
"!=",
"nil",
"{",
"fields",
"[",
"i",
"]",
"=",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"*",
"(",
"v",
".",
"BeginInBoth",
")",
")",
"\n",
"i",
"++",
"\n",
"}",
"\n",
"if",
"v",
".",
"OldString",
"!=",
"nil",
"{",
"fields",
"[",
"i",
"]",
"=",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"*",
"(",
"v",
".",
"OldString",
")",
")",
"\n",
"i",
"++",
"\n",
"}",
"\n",
"if",
"v",
".",
"EndInBoth",
"!=",
"nil",
"{",
"fields",
"[",
"i",
"]",
"=",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"*",
"(",
"v",
".",
"EndInBoth",
")",
")",
"\n",
"i",
"++",
"\n",
"}",
"\n\n",
"return",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"strings",
".",
"Join",
"(",
"fields",
"[",
":",
"i",
"]",
",",
"\"",
"\"",
")",
")",
"\n",
"}"
]
| // String returns a readable string representation of a VersioningTestV1
// struct. | [
"String",
"returns",
"a",
"readable",
"string",
"representation",
"of",
"a",
"VersioningTestV1",
"struct",
"."
]
| bd70ffbd17e635243988ba62be97eebff738204d | https://github.com/yarpc/yarpc-go/blob/bd70ffbd17e635243988ba62be97eebff738204d/internal/crossdock/thrift/gauntlet/types.go#L5921-L5942 |
10,832 | yarpc/yarpc-go | internal/crossdock/thrift/gauntlet/types.go | Equals | func (v *VersioningTestV1) Equals(rhs *VersioningTestV1) bool {
if v == nil {
return rhs == nil
} else if rhs == nil {
return false
}
if !_I32_EqualsPtr(v.BeginInBoth, rhs.BeginInBoth) {
return false
}
if !_String_EqualsPtr(v.OldString, rhs.OldString) {
return false
}
if !_I32_EqualsPtr(v.EndInBoth, rhs.EndInBoth) {
return false
}
return true
} | go | func (v *VersioningTestV1) Equals(rhs *VersioningTestV1) bool {
if v == nil {
return rhs == nil
} else if rhs == nil {
return false
}
if !_I32_EqualsPtr(v.BeginInBoth, rhs.BeginInBoth) {
return false
}
if !_String_EqualsPtr(v.OldString, rhs.OldString) {
return false
}
if !_I32_EqualsPtr(v.EndInBoth, rhs.EndInBoth) {
return false
}
return true
} | [
"func",
"(",
"v",
"*",
"VersioningTestV1",
")",
"Equals",
"(",
"rhs",
"*",
"VersioningTestV1",
")",
"bool",
"{",
"if",
"v",
"==",
"nil",
"{",
"return",
"rhs",
"==",
"nil",
"\n",
"}",
"else",
"if",
"rhs",
"==",
"nil",
"{",
"return",
"false",
"\n",
"}",
"\n",
"if",
"!",
"_I32_EqualsPtr",
"(",
"v",
".",
"BeginInBoth",
",",
"rhs",
".",
"BeginInBoth",
")",
"{",
"return",
"false",
"\n",
"}",
"\n",
"if",
"!",
"_String_EqualsPtr",
"(",
"v",
".",
"OldString",
",",
"rhs",
".",
"OldString",
")",
"{",
"return",
"false",
"\n",
"}",
"\n",
"if",
"!",
"_I32_EqualsPtr",
"(",
"v",
".",
"EndInBoth",
",",
"rhs",
".",
"EndInBoth",
")",
"{",
"return",
"false",
"\n",
"}",
"\n\n",
"return",
"true",
"\n",
"}"
]
| // Equals returns true if all the fields of this VersioningTestV1 match the
// provided VersioningTestV1.
//
// This function performs a deep comparison. | [
"Equals",
"returns",
"true",
"if",
"all",
"the",
"fields",
"of",
"this",
"VersioningTestV1",
"match",
"the",
"provided",
"VersioningTestV1",
".",
"This",
"function",
"performs",
"a",
"deep",
"comparison",
"."
]
| bd70ffbd17e635243988ba62be97eebff738204d | https://github.com/yarpc/yarpc-go/blob/bd70ffbd17e635243988ba62be97eebff738204d/internal/crossdock/thrift/gauntlet/types.go#L5948-L5965 |
10,833 | yarpc/yarpc-go | internal/crossdock/thrift/gauntlet/types.go | MarshalLogObject | func (v *VersioningTestV1) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
if v == nil {
return nil
}
if v.BeginInBoth != nil {
enc.AddInt32("begin_in_both", *v.BeginInBoth)
}
if v.OldString != nil {
enc.AddString("old_string", *v.OldString)
}
if v.EndInBoth != nil {
enc.AddInt32("end_in_both", *v.EndInBoth)
}
return err
} | go | func (v *VersioningTestV1) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
if v == nil {
return nil
}
if v.BeginInBoth != nil {
enc.AddInt32("begin_in_both", *v.BeginInBoth)
}
if v.OldString != nil {
enc.AddString("old_string", *v.OldString)
}
if v.EndInBoth != nil {
enc.AddInt32("end_in_both", *v.EndInBoth)
}
return err
} | [
"func",
"(",
"v",
"*",
"VersioningTestV1",
")",
"MarshalLogObject",
"(",
"enc",
"zapcore",
".",
"ObjectEncoder",
")",
"(",
"err",
"error",
")",
"{",
"if",
"v",
"==",
"nil",
"{",
"return",
"nil",
"\n",
"}",
"\n",
"if",
"v",
".",
"BeginInBoth",
"!=",
"nil",
"{",
"enc",
".",
"AddInt32",
"(",
"\"",
"\"",
",",
"*",
"v",
".",
"BeginInBoth",
")",
"\n",
"}",
"\n",
"if",
"v",
".",
"OldString",
"!=",
"nil",
"{",
"enc",
".",
"AddString",
"(",
"\"",
"\"",
",",
"*",
"v",
".",
"OldString",
")",
"\n",
"}",
"\n",
"if",
"v",
".",
"EndInBoth",
"!=",
"nil",
"{",
"enc",
".",
"AddInt32",
"(",
"\"",
"\"",
",",
"*",
"v",
".",
"EndInBoth",
")",
"\n",
"}",
"\n",
"return",
"err",
"\n",
"}"
]
| // MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of VersioningTestV1. | [
"MarshalLogObject",
"implements",
"zapcore",
".",
"ObjectMarshaler",
"enabling",
"fast",
"logging",
"of",
"VersioningTestV1",
"."
]
| bd70ffbd17e635243988ba62be97eebff738204d | https://github.com/yarpc/yarpc-go/blob/bd70ffbd17e635243988ba62be97eebff738204d/internal/crossdock/thrift/gauntlet/types.go#L5969-L5983 |
10,834 | yarpc/yarpc-go | internal/crossdock/thrift/gauntlet/types.go | GetOldString | func (v *VersioningTestV1) GetOldString() (o string) {
if v != nil && v.OldString != nil {
return *v.OldString
}
return
} | go | func (v *VersioningTestV1) GetOldString() (o string) {
if v != nil && v.OldString != nil {
return *v.OldString
}
return
} | [
"func",
"(",
"v",
"*",
"VersioningTestV1",
")",
"GetOldString",
"(",
")",
"(",
"o",
"string",
")",
"{",
"if",
"v",
"!=",
"nil",
"&&",
"v",
".",
"OldString",
"!=",
"nil",
"{",
"return",
"*",
"v",
".",
"OldString",
"\n",
"}",
"\n\n",
"return",
"\n",
"}"
]
| // GetOldString returns the value of OldString if it is set or its
// zero value if it is unset. | [
"GetOldString",
"returns",
"the",
"value",
"of",
"OldString",
"if",
"it",
"is",
"set",
"or",
"its",
"zero",
"value",
"if",
"it",
"is",
"unset",
"."
]
| bd70ffbd17e635243988ba62be97eebff738204d | https://github.com/yarpc/yarpc-go/blob/bd70ffbd17e635243988ba62be97eebff738204d/internal/crossdock/thrift/gauntlet/types.go#L6002-L6008 |
10,835 | yarpc/yarpc-go | internal/crossdock/thrift/gauntlet/types.go | String | func (v *VersioningTestV2) String() string {
if v == nil {
return "<nil>"
}
var fields [12]string
i := 0
if v.BeginInBoth != nil {
fields[i] = fmt.Sprintf("BeginInBoth: %v", *(v.BeginInBoth))
i++
}
if v.Newint != nil {
fields[i] = fmt.Sprintf("Newint: %v", *(v.Newint))
i++
}
if v.Newbyte != nil {
fields[i] = fmt.Sprintf("Newbyte: %v", *(v.Newbyte))
i++
}
if v.Newshort != nil {
fields[i] = fmt.Sprintf("Newshort: %v", *(v.Newshort))
i++
}
if v.Newlong != nil {
fields[i] = fmt.Sprintf("Newlong: %v", *(v.Newlong))
i++
}
if v.Newdouble != nil {
fields[i] = fmt.Sprintf("Newdouble: %v", *(v.Newdouble))
i++
}
if v.Newstruct != nil {
fields[i] = fmt.Sprintf("Newstruct: %v", v.Newstruct)
i++
}
if v.Newlist != nil {
fields[i] = fmt.Sprintf("Newlist: %v", v.Newlist)
i++
}
if v.Newset != nil {
fields[i] = fmt.Sprintf("Newset: %v", v.Newset)
i++
}
if v.Newmap != nil {
fields[i] = fmt.Sprintf("Newmap: %v", v.Newmap)
i++
}
if v.Newstring != nil {
fields[i] = fmt.Sprintf("Newstring: %v", *(v.Newstring))
i++
}
if v.EndInBoth != nil {
fields[i] = fmt.Sprintf("EndInBoth: %v", *(v.EndInBoth))
i++
}
return fmt.Sprintf("VersioningTestV2{%v}", strings.Join(fields[:i], ", "))
} | go | func (v *VersioningTestV2) String() string {
if v == nil {
return "<nil>"
}
var fields [12]string
i := 0
if v.BeginInBoth != nil {
fields[i] = fmt.Sprintf("BeginInBoth: %v", *(v.BeginInBoth))
i++
}
if v.Newint != nil {
fields[i] = fmt.Sprintf("Newint: %v", *(v.Newint))
i++
}
if v.Newbyte != nil {
fields[i] = fmt.Sprintf("Newbyte: %v", *(v.Newbyte))
i++
}
if v.Newshort != nil {
fields[i] = fmt.Sprintf("Newshort: %v", *(v.Newshort))
i++
}
if v.Newlong != nil {
fields[i] = fmt.Sprintf("Newlong: %v", *(v.Newlong))
i++
}
if v.Newdouble != nil {
fields[i] = fmt.Sprintf("Newdouble: %v", *(v.Newdouble))
i++
}
if v.Newstruct != nil {
fields[i] = fmt.Sprintf("Newstruct: %v", v.Newstruct)
i++
}
if v.Newlist != nil {
fields[i] = fmt.Sprintf("Newlist: %v", v.Newlist)
i++
}
if v.Newset != nil {
fields[i] = fmt.Sprintf("Newset: %v", v.Newset)
i++
}
if v.Newmap != nil {
fields[i] = fmt.Sprintf("Newmap: %v", v.Newmap)
i++
}
if v.Newstring != nil {
fields[i] = fmt.Sprintf("Newstring: %v", *(v.Newstring))
i++
}
if v.EndInBoth != nil {
fields[i] = fmt.Sprintf("EndInBoth: %v", *(v.EndInBoth))
i++
}
return fmt.Sprintf("VersioningTestV2{%v}", strings.Join(fields[:i], ", "))
} | [
"func",
"(",
"v",
"*",
"VersioningTestV2",
")",
"String",
"(",
")",
"string",
"{",
"if",
"v",
"==",
"nil",
"{",
"return",
"\"",
"\"",
"\n",
"}",
"\n\n",
"var",
"fields",
"[",
"12",
"]",
"string",
"\n",
"i",
":=",
"0",
"\n",
"if",
"v",
".",
"BeginInBoth",
"!=",
"nil",
"{",
"fields",
"[",
"i",
"]",
"=",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"*",
"(",
"v",
".",
"BeginInBoth",
")",
")",
"\n",
"i",
"++",
"\n",
"}",
"\n",
"if",
"v",
".",
"Newint",
"!=",
"nil",
"{",
"fields",
"[",
"i",
"]",
"=",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"*",
"(",
"v",
".",
"Newint",
")",
")",
"\n",
"i",
"++",
"\n",
"}",
"\n",
"if",
"v",
".",
"Newbyte",
"!=",
"nil",
"{",
"fields",
"[",
"i",
"]",
"=",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"*",
"(",
"v",
".",
"Newbyte",
")",
")",
"\n",
"i",
"++",
"\n",
"}",
"\n",
"if",
"v",
".",
"Newshort",
"!=",
"nil",
"{",
"fields",
"[",
"i",
"]",
"=",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"*",
"(",
"v",
".",
"Newshort",
")",
")",
"\n",
"i",
"++",
"\n",
"}",
"\n",
"if",
"v",
".",
"Newlong",
"!=",
"nil",
"{",
"fields",
"[",
"i",
"]",
"=",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"*",
"(",
"v",
".",
"Newlong",
")",
")",
"\n",
"i",
"++",
"\n",
"}",
"\n",
"if",
"v",
".",
"Newdouble",
"!=",
"nil",
"{",
"fields",
"[",
"i",
"]",
"=",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"*",
"(",
"v",
".",
"Newdouble",
")",
")",
"\n",
"i",
"++",
"\n",
"}",
"\n",
"if",
"v",
".",
"Newstruct",
"!=",
"nil",
"{",
"fields",
"[",
"i",
"]",
"=",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"v",
".",
"Newstruct",
")",
"\n",
"i",
"++",
"\n",
"}",
"\n",
"if",
"v",
".",
"Newlist",
"!=",
"nil",
"{",
"fields",
"[",
"i",
"]",
"=",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"v",
".",
"Newlist",
")",
"\n",
"i",
"++",
"\n",
"}",
"\n",
"if",
"v",
".",
"Newset",
"!=",
"nil",
"{",
"fields",
"[",
"i",
"]",
"=",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"v",
".",
"Newset",
")",
"\n",
"i",
"++",
"\n",
"}",
"\n",
"if",
"v",
".",
"Newmap",
"!=",
"nil",
"{",
"fields",
"[",
"i",
"]",
"=",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"v",
".",
"Newmap",
")",
"\n",
"i",
"++",
"\n",
"}",
"\n",
"if",
"v",
".",
"Newstring",
"!=",
"nil",
"{",
"fields",
"[",
"i",
"]",
"=",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"*",
"(",
"v",
".",
"Newstring",
")",
")",
"\n",
"i",
"++",
"\n",
"}",
"\n",
"if",
"v",
".",
"EndInBoth",
"!=",
"nil",
"{",
"fields",
"[",
"i",
"]",
"=",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"*",
"(",
"v",
".",
"EndInBoth",
")",
")",
"\n",
"i",
"++",
"\n",
"}",
"\n\n",
"return",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"strings",
".",
"Join",
"(",
"fields",
"[",
":",
"i",
"]",
",",
"\"",
"\"",
")",
")",
"\n",
"}"
]
| // String returns a readable string representation of a VersioningTestV2
// struct. | [
"String",
"returns",
"a",
"readable",
"string",
"representation",
"of",
"a",
"VersioningTestV2",
"struct",
"."
]
| bd70ffbd17e635243988ba62be97eebff738204d | https://github.com/yarpc/yarpc-go/blob/bd70ffbd17e635243988ba62be97eebff738204d/internal/crossdock/thrift/gauntlet/types.go#L6373-L6430 |
10,836 | yarpc/yarpc-go | internal/crossdock/thrift/gauntlet/types.go | Equals | func (v *VersioningTestV2) Equals(rhs *VersioningTestV2) bool {
if v == nil {
return rhs == nil
} else if rhs == nil {
return false
}
if !_I32_EqualsPtr(v.BeginInBoth, rhs.BeginInBoth) {
return false
}
if !_I32_EqualsPtr(v.Newint, rhs.Newint) {
return false
}
if !_Byte_EqualsPtr(v.Newbyte, rhs.Newbyte) {
return false
}
if !_I16_EqualsPtr(v.Newshort, rhs.Newshort) {
return false
}
if !_I64_EqualsPtr(v.Newlong, rhs.Newlong) {
return false
}
if !_Double_EqualsPtr(v.Newdouble, rhs.Newdouble) {
return false
}
if !((v.Newstruct == nil && rhs.Newstruct == nil) || (v.Newstruct != nil && rhs.Newstruct != nil && v.Newstruct.Equals(rhs.Newstruct))) {
return false
}
if !((v.Newlist == nil && rhs.Newlist == nil) || (v.Newlist != nil && rhs.Newlist != nil && _List_I32_Equals(v.Newlist, rhs.Newlist))) {
return false
}
if !((v.Newset == nil && rhs.Newset == nil) || (v.Newset != nil && rhs.Newset != nil && _Set_I32_Equals(v.Newset, rhs.Newset))) {
return false
}
if !((v.Newmap == nil && rhs.Newmap == nil) || (v.Newmap != nil && rhs.Newmap != nil && _Map_I32_I32_Equals(v.Newmap, rhs.Newmap))) {
return false
}
if !_String_EqualsPtr(v.Newstring, rhs.Newstring) {
return false
}
if !_I32_EqualsPtr(v.EndInBoth, rhs.EndInBoth) {
return false
}
return true
} | go | func (v *VersioningTestV2) Equals(rhs *VersioningTestV2) bool {
if v == nil {
return rhs == nil
} else if rhs == nil {
return false
}
if !_I32_EqualsPtr(v.BeginInBoth, rhs.BeginInBoth) {
return false
}
if !_I32_EqualsPtr(v.Newint, rhs.Newint) {
return false
}
if !_Byte_EqualsPtr(v.Newbyte, rhs.Newbyte) {
return false
}
if !_I16_EqualsPtr(v.Newshort, rhs.Newshort) {
return false
}
if !_I64_EqualsPtr(v.Newlong, rhs.Newlong) {
return false
}
if !_Double_EqualsPtr(v.Newdouble, rhs.Newdouble) {
return false
}
if !((v.Newstruct == nil && rhs.Newstruct == nil) || (v.Newstruct != nil && rhs.Newstruct != nil && v.Newstruct.Equals(rhs.Newstruct))) {
return false
}
if !((v.Newlist == nil && rhs.Newlist == nil) || (v.Newlist != nil && rhs.Newlist != nil && _List_I32_Equals(v.Newlist, rhs.Newlist))) {
return false
}
if !((v.Newset == nil && rhs.Newset == nil) || (v.Newset != nil && rhs.Newset != nil && _Set_I32_Equals(v.Newset, rhs.Newset))) {
return false
}
if !((v.Newmap == nil && rhs.Newmap == nil) || (v.Newmap != nil && rhs.Newmap != nil && _Map_I32_I32_Equals(v.Newmap, rhs.Newmap))) {
return false
}
if !_String_EqualsPtr(v.Newstring, rhs.Newstring) {
return false
}
if !_I32_EqualsPtr(v.EndInBoth, rhs.EndInBoth) {
return false
}
return true
} | [
"func",
"(",
"v",
"*",
"VersioningTestV2",
")",
"Equals",
"(",
"rhs",
"*",
"VersioningTestV2",
")",
"bool",
"{",
"if",
"v",
"==",
"nil",
"{",
"return",
"rhs",
"==",
"nil",
"\n",
"}",
"else",
"if",
"rhs",
"==",
"nil",
"{",
"return",
"false",
"\n",
"}",
"\n",
"if",
"!",
"_I32_EqualsPtr",
"(",
"v",
".",
"BeginInBoth",
",",
"rhs",
".",
"BeginInBoth",
")",
"{",
"return",
"false",
"\n",
"}",
"\n",
"if",
"!",
"_I32_EqualsPtr",
"(",
"v",
".",
"Newint",
",",
"rhs",
".",
"Newint",
")",
"{",
"return",
"false",
"\n",
"}",
"\n",
"if",
"!",
"_Byte_EqualsPtr",
"(",
"v",
".",
"Newbyte",
",",
"rhs",
".",
"Newbyte",
")",
"{",
"return",
"false",
"\n",
"}",
"\n",
"if",
"!",
"_I16_EqualsPtr",
"(",
"v",
".",
"Newshort",
",",
"rhs",
".",
"Newshort",
")",
"{",
"return",
"false",
"\n",
"}",
"\n",
"if",
"!",
"_I64_EqualsPtr",
"(",
"v",
".",
"Newlong",
",",
"rhs",
".",
"Newlong",
")",
"{",
"return",
"false",
"\n",
"}",
"\n",
"if",
"!",
"_Double_EqualsPtr",
"(",
"v",
".",
"Newdouble",
",",
"rhs",
".",
"Newdouble",
")",
"{",
"return",
"false",
"\n",
"}",
"\n",
"if",
"!",
"(",
"(",
"v",
".",
"Newstruct",
"==",
"nil",
"&&",
"rhs",
".",
"Newstruct",
"==",
"nil",
")",
"||",
"(",
"v",
".",
"Newstruct",
"!=",
"nil",
"&&",
"rhs",
".",
"Newstruct",
"!=",
"nil",
"&&",
"v",
".",
"Newstruct",
".",
"Equals",
"(",
"rhs",
".",
"Newstruct",
")",
")",
")",
"{",
"return",
"false",
"\n",
"}",
"\n",
"if",
"!",
"(",
"(",
"v",
".",
"Newlist",
"==",
"nil",
"&&",
"rhs",
".",
"Newlist",
"==",
"nil",
")",
"||",
"(",
"v",
".",
"Newlist",
"!=",
"nil",
"&&",
"rhs",
".",
"Newlist",
"!=",
"nil",
"&&",
"_List_I32_Equals",
"(",
"v",
".",
"Newlist",
",",
"rhs",
".",
"Newlist",
")",
")",
")",
"{",
"return",
"false",
"\n",
"}",
"\n",
"if",
"!",
"(",
"(",
"v",
".",
"Newset",
"==",
"nil",
"&&",
"rhs",
".",
"Newset",
"==",
"nil",
")",
"||",
"(",
"v",
".",
"Newset",
"!=",
"nil",
"&&",
"rhs",
".",
"Newset",
"!=",
"nil",
"&&",
"_Set_I32_Equals",
"(",
"v",
".",
"Newset",
",",
"rhs",
".",
"Newset",
")",
")",
")",
"{",
"return",
"false",
"\n",
"}",
"\n",
"if",
"!",
"(",
"(",
"v",
".",
"Newmap",
"==",
"nil",
"&&",
"rhs",
".",
"Newmap",
"==",
"nil",
")",
"||",
"(",
"v",
".",
"Newmap",
"!=",
"nil",
"&&",
"rhs",
".",
"Newmap",
"!=",
"nil",
"&&",
"_Map_I32_I32_Equals",
"(",
"v",
".",
"Newmap",
",",
"rhs",
".",
"Newmap",
")",
")",
")",
"{",
"return",
"false",
"\n",
"}",
"\n",
"if",
"!",
"_String_EqualsPtr",
"(",
"v",
".",
"Newstring",
",",
"rhs",
".",
"Newstring",
")",
"{",
"return",
"false",
"\n",
"}",
"\n",
"if",
"!",
"_I32_EqualsPtr",
"(",
"v",
".",
"EndInBoth",
",",
"rhs",
".",
"EndInBoth",
")",
"{",
"return",
"false",
"\n",
"}",
"\n\n",
"return",
"true",
"\n",
"}"
]
| // Equals returns true if all the fields of this VersioningTestV2 match the
// provided VersioningTestV2.
//
// This function performs a deep comparison. | [
"Equals",
"returns",
"true",
"if",
"all",
"the",
"fields",
"of",
"this",
"VersioningTestV2",
"match",
"the",
"provided",
"VersioningTestV2",
".",
"This",
"function",
"performs",
"a",
"deep",
"comparison",
"."
]
| bd70ffbd17e635243988ba62be97eebff738204d | https://github.com/yarpc/yarpc-go/blob/bd70ffbd17e635243988ba62be97eebff738204d/internal/crossdock/thrift/gauntlet/types.go#L6493-L6537 |
10,837 | yarpc/yarpc-go | internal/crossdock/thrift/gauntlet/types.go | MarshalLogObject | func (v _Map_I32_I32_Item_Zapper) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
enc.AddInt32("key", v.Key)
enc.AddInt32("value", v.Value)
return err
} | go | func (v _Map_I32_I32_Item_Zapper) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
enc.AddInt32("key", v.Key)
enc.AddInt32("value", v.Value)
return err
} | [
"func",
"(",
"v",
"_Map_I32_I32_Item_Zapper",
")",
"MarshalLogObject",
"(",
"enc",
"zapcore",
".",
"ObjectEncoder",
")",
"(",
"err",
"error",
")",
"{",
"enc",
".",
"AddInt32",
"(",
"\"",
"\"",
",",
"v",
".",
"Key",
")",
"\n",
"enc",
".",
"AddInt32",
"(",
"\"",
"\"",
",",
"v",
".",
"Value",
")",
"\n",
"return",
"err",
"\n",
"}"
]
| // MarshalLogArray implements zapcore.ArrayMarshaler, enabling
// fast logging of _Map_I32_I32_Item_Zapper. | [
"MarshalLogArray",
"implements",
"zapcore",
".",
"ArrayMarshaler",
"enabling",
"fast",
"logging",
"of",
"_Map_I32_I32_Item_Zapper",
"."
]
| bd70ffbd17e635243988ba62be97eebff738204d | https://github.com/yarpc/yarpc-go/blob/bd70ffbd17e635243988ba62be97eebff738204d/internal/crossdock/thrift/gauntlet/types.go#L6546-L6550 |
10,838 | yarpc/yarpc-go | internal/crossdock/thrift/gauntlet/types.go | MarshalLogArray | func (m _Map_I32_I32_Zapper) MarshalLogArray(enc zapcore.ArrayEncoder) (err error) {
for k, v := range m {
err = multierr.Append(err, enc.AppendObject(_Map_I32_I32_Item_Zapper{Key: k, Value: v}))
}
return err
} | go | func (m _Map_I32_I32_Zapper) MarshalLogArray(enc zapcore.ArrayEncoder) (err error) {
for k, v := range m {
err = multierr.Append(err, enc.AppendObject(_Map_I32_I32_Item_Zapper{Key: k, Value: v}))
}
return err
} | [
"func",
"(",
"m",
"_Map_I32_I32_Zapper",
")",
"MarshalLogArray",
"(",
"enc",
"zapcore",
".",
"ArrayEncoder",
")",
"(",
"err",
"error",
")",
"{",
"for",
"k",
",",
"v",
":=",
"range",
"m",
"{",
"err",
"=",
"multierr",
".",
"Append",
"(",
"err",
",",
"enc",
".",
"AppendObject",
"(",
"_Map_I32_I32_Item_Zapper",
"{",
"Key",
":",
"k",
",",
"Value",
":",
"v",
"}",
")",
")",
"\n",
"}",
"\n",
"return",
"err",
"\n",
"}"
]
| // MarshalLogArray implements zapcore.ArrayMarshaler, enabling
// fast logging of _Map_I32_I32_Zapper. | [
"MarshalLogArray",
"implements",
"zapcore",
".",
"ArrayMarshaler",
"enabling",
"fast",
"logging",
"of",
"_Map_I32_I32_Zapper",
"."
]
| bd70ffbd17e635243988ba62be97eebff738204d | https://github.com/yarpc/yarpc-go/blob/bd70ffbd17e635243988ba62be97eebff738204d/internal/crossdock/thrift/gauntlet/types.go#L6556-L6561 |
10,839 | yarpc/yarpc-go | internal/crossdock/thrift/gauntlet/types.go | MarshalLogObject | func (v *VersioningTestV2) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
if v == nil {
return nil
}
if v.BeginInBoth != nil {
enc.AddInt32("begin_in_both", *v.BeginInBoth)
}
if v.Newint != nil {
enc.AddInt32("newint", *v.Newint)
}
if v.Newbyte != nil {
enc.AddInt8("newbyte", *v.Newbyte)
}
if v.Newshort != nil {
enc.AddInt16("newshort", *v.Newshort)
}
if v.Newlong != nil {
enc.AddInt64("newlong", *v.Newlong)
}
if v.Newdouble != nil {
enc.AddFloat64("newdouble", *v.Newdouble)
}
if v.Newstruct != nil {
err = multierr.Append(err, enc.AddObject("newstruct", v.Newstruct))
}
if v.Newlist != nil {
err = multierr.Append(err, enc.AddArray("newlist", (_List_I32_Zapper)(v.Newlist)))
}
if v.Newset != nil {
err = multierr.Append(err, enc.AddArray("newset", (_Set_I32_Zapper)(v.Newset)))
}
if v.Newmap != nil {
err = multierr.Append(err, enc.AddArray("newmap", (_Map_I32_I32_Zapper)(v.Newmap)))
}
if v.Newstring != nil {
enc.AddString("newstring", *v.Newstring)
}
if v.EndInBoth != nil {
enc.AddInt32("end_in_both", *v.EndInBoth)
}
return err
} | go | func (v *VersioningTestV2) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
if v == nil {
return nil
}
if v.BeginInBoth != nil {
enc.AddInt32("begin_in_both", *v.BeginInBoth)
}
if v.Newint != nil {
enc.AddInt32("newint", *v.Newint)
}
if v.Newbyte != nil {
enc.AddInt8("newbyte", *v.Newbyte)
}
if v.Newshort != nil {
enc.AddInt16("newshort", *v.Newshort)
}
if v.Newlong != nil {
enc.AddInt64("newlong", *v.Newlong)
}
if v.Newdouble != nil {
enc.AddFloat64("newdouble", *v.Newdouble)
}
if v.Newstruct != nil {
err = multierr.Append(err, enc.AddObject("newstruct", v.Newstruct))
}
if v.Newlist != nil {
err = multierr.Append(err, enc.AddArray("newlist", (_List_I32_Zapper)(v.Newlist)))
}
if v.Newset != nil {
err = multierr.Append(err, enc.AddArray("newset", (_Set_I32_Zapper)(v.Newset)))
}
if v.Newmap != nil {
err = multierr.Append(err, enc.AddArray("newmap", (_Map_I32_I32_Zapper)(v.Newmap)))
}
if v.Newstring != nil {
enc.AddString("newstring", *v.Newstring)
}
if v.EndInBoth != nil {
enc.AddInt32("end_in_both", *v.EndInBoth)
}
return err
} | [
"func",
"(",
"v",
"*",
"VersioningTestV2",
")",
"MarshalLogObject",
"(",
"enc",
"zapcore",
".",
"ObjectEncoder",
")",
"(",
"err",
"error",
")",
"{",
"if",
"v",
"==",
"nil",
"{",
"return",
"nil",
"\n",
"}",
"\n",
"if",
"v",
".",
"BeginInBoth",
"!=",
"nil",
"{",
"enc",
".",
"AddInt32",
"(",
"\"",
"\"",
",",
"*",
"v",
".",
"BeginInBoth",
")",
"\n",
"}",
"\n",
"if",
"v",
".",
"Newint",
"!=",
"nil",
"{",
"enc",
".",
"AddInt32",
"(",
"\"",
"\"",
",",
"*",
"v",
".",
"Newint",
")",
"\n",
"}",
"\n",
"if",
"v",
".",
"Newbyte",
"!=",
"nil",
"{",
"enc",
".",
"AddInt8",
"(",
"\"",
"\"",
",",
"*",
"v",
".",
"Newbyte",
")",
"\n",
"}",
"\n",
"if",
"v",
".",
"Newshort",
"!=",
"nil",
"{",
"enc",
".",
"AddInt16",
"(",
"\"",
"\"",
",",
"*",
"v",
".",
"Newshort",
")",
"\n",
"}",
"\n",
"if",
"v",
".",
"Newlong",
"!=",
"nil",
"{",
"enc",
".",
"AddInt64",
"(",
"\"",
"\"",
",",
"*",
"v",
".",
"Newlong",
")",
"\n",
"}",
"\n",
"if",
"v",
".",
"Newdouble",
"!=",
"nil",
"{",
"enc",
".",
"AddFloat64",
"(",
"\"",
"\"",
",",
"*",
"v",
".",
"Newdouble",
")",
"\n",
"}",
"\n",
"if",
"v",
".",
"Newstruct",
"!=",
"nil",
"{",
"err",
"=",
"multierr",
".",
"Append",
"(",
"err",
",",
"enc",
".",
"AddObject",
"(",
"\"",
"\"",
",",
"v",
".",
"Newstruct",
")",
")",
"\n",
"}",
"\n",
"if",
"v",
".",
"Newlist",
"!=",
"nil",
"{",
"err",
"=",
"multierr",
".",
"Append",
"(",
"err",
",",
"enc",
".",
"AddArray",
"(",
"\"",
"\"",
",",
"(",
"_List_I32_Zapper",
")",
"(",
"v",
".",
"Newlist",
")",
")",
")",
"\n",
"}",
"\n",
"if",
"v",
".",
"Newset",
"!=",
"nil",
"{",
"err",
"=",
"multierr",
".",
"Append",
"(",
"err",
",",
"enc",
".",
"AddArray",
"(",
"\"",
"\"",
",",
"(",
"_Set_I32_Zapper",
")",
"(",
"v",
".",
"Newset",
")",
")",
")",
"\n",
"}",
"\n",
"if",
"v",
".",
"Newmap",
"!=",
"nil",
"{",
"err",
"=",
"multierr",
".",
"Append",
"(",
"err",
",",
"enc",
".",
"AddArray",
"(",
"\"",
"\"",
",",
"(",
"_Map_I32_I32_Zapper",
")",
"(",
"v",
".",
"Newmap",
")",
")",
")",
"\n",
"}",
"\n",
"if",
"v",
".",
"Newstring",
"!=",
"nil",
"{",
"enc",
".",
"AddString",
"(",
"\"",
"\"",
",",
"*",
"v",
".",
"Newstring",
")",
"\n",
"}",
"\n",
"if",
"v",
".",
"EndInBoth",
"!=",
"nil",
"{",
"enc",
".",
"AddInt32",
"(",
"\"",
"\"",
",",
"*",
"v",
".",
"EndInBoth",
")",
"\n",
"}",
"\n",
"return",
"err",
"\n",
"}"
]
| // MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of VersioningTestV2. | [
"MarshalLogObject",
"implements",
"zapcore",
".",
"ObjectMarshaler",
"enabling",
"fast",
"logging",
"of",
"VersioningTestV2",
"."
]
| bd70ffbd17e635243988ba62be97eebff738204d | https://github.com/yarpc/yarpc-go/blob/bd70ffbd17e635243988ba62be97eebff738204d/internal/crossdock/thrift/gauntlet/types.go#L6565-L6606 |
10,840 | yarpc/yarpc-go | internal/crossdock/thrift/gauntlet/types.go | GetNewint | func (v *VersioningTestV2) GetNewint() (o int32) {
if v != nil && v.Newint != nil {
return *v.Newint
}
return
} | go | func (v *VersioningTestV2) GetNewint() (o int32) {
if v != nil && v.Newint != nil {
return *v.Newint
}
return
} | [
"func",
"(",
"v",
"*",
"VersioningTestV2",
")",
"GetNewint",
"(",
")",
"(",
"o",
"int32",
")",
"{",
"if",
"v",
"!=",
"nil",
"&&",
"v",
".",
"Newint",
"!=",
"nil",
"{",
"return",
"*",
"v",
".",
"Newint",
"\n",
"}",
"\n\n",
"return",
"\n",
"}"
]
| // GetNewint returns the value of Newint if it is set or its
// zero value if it is unset. | [
"GetNewint",
"returns",
"the",
"value",
"of",
"Newint",
"if",
"it",
"is",
"set",
"or",
"its",
"zero",
"value",
"if",
"it",
"is",
"unset",
"."
]
| bd70ffbd17e635243988ba62be97eebff738204d | https://github.com/yarpc/yarpc-go/blob/bd70ffbd17e635243988ba62be97eebff738204d/internal/crossdock/thrift/gauntlet/types.go#L6625-L6631 |
10,841 | yarpc/yarpc-go | internal/crossdock/thrift/gauntlet/types.go | GetNewbyte | func (v *VersioningTestV2) GetNewbyte() (o int8) {
if v != nil && v.Newbyte != nil {
return *v.Newbyte
}
return
} | go | func (v *VersioningTestV2) GetNewbyte() (o int8) {
if v != nil && v.Newbyte != nil {
return *v.Newbyte
}
return
} | [
"func",
"(",
"v",
"*",
"VersioningTestV2",
")",
"GetNewbyte",
"(",
")",
"(",
"o",
"int8",
")",
"{",
"if",
"v",
"!=",
"nil",
"&&",
"v",
".",
"Newbyte",
"!=",
"nil",
"{",
"return",
"*",
"v",
".",
"Newbyte",
"\n",
"}",
"\n\n",
"return",
"\n",
"}"
]
| // GetNewbyte returns the value of Newbyte if it is set or its
// zero value if it is unset. | [
"GetNewbyte",
"returns",
"the",
"value",
"of",
"Newbyte",
"if",
"it",
"is",
"set",
"or",
"its",
"zero",
"value",
"if",
"it",
"is",
"unset",
"."
]
| bd70ffbd17e635243988ba62be97eebff738204d | https://github.com/yarpc/yarpc-go/blob/bd70ffbd17e635243988ba62be97eebff738204d/internal/crossdock/thrift/gauntlet/types.go#L6640-L6646 |
10,842 | yarpc/yarpc-go | internal/crossdock/thrift/gauntlet/types.go | GetNewshort | func (v *VersioningTestV2) GetNewshort() (o int16) {
if v != nil && v.Newshort != nil {
return *v.Newshort
}
return
} | go | func (v *VersioningTestV2) GetNewshort() (o int16) {
if v != nil && v.Newshort != nil {
return *v.Newshort
}
return
} | [
"func",
"(",
"v",
"*",
"VersioningTestV2",
")",
"GetNewshort",
"(",
")",
"(",
"o",
"int16",
")",
"{",
"if",
"v",
"!=",
"nil",
"&&",
"v",
".",
"Newshort",
"!=",
"nil",
"{",
"return",
"*",
"v",
".",
"Newshort",
"\n",
"}",
"\n\n",
"return",
"\n",
"}"
]
| // GetNewshort returns the value of Newshort if it is set or its
// zero value if it is unset. | [
"GetNewshort",
"returns",
"the",
"value",
"of",
"Newshort",
"if",
"it",
"is",
"set",
"or",
"its",
"zero",
"value",
"if",
"it",
"is",
"unset",
"."
]
| bd70ffbd17e635243988ba62be97eebff738204d | https://github.com/yarpc/yarpc-go/blob/bd70ffbd17e635243988ba62be97eebff738204d/internal/crossdock/thrift/gauntlet/types.go#L6655-L6661 |
10,843 | yarpc/yarpc-go | internal/crossdock/thrift/gauntlet/types.go | GetNewlong | func (v *VersioningTestV2) GetNewlong() (o int64) {
if v != nil && v.Newlong != nil {
return *v.Newlong
}
return
} | go | func (v *VersioningTestV2) GetNewlong() (o int64) {
if v != nil && v.Newlong != nil {
return *v.Newlong
}
return
} | [
"func",
"(",
"v",
"*",
"VersioningTestV2",
")",
"GetNewlong",
"(",
")",
"(",
"o",
"int64",
")",
"{",
"if",
"v",
"!=",
"nil",
"&&",
"v",
".",
"Newlong",
"!=",
"nil",
"{",
"return",
"*",
"v",
".",
"Newlong",
"\n",
"}",
"\n\n",
"return",
"\n",
"}"
]
| // GetNewlong returns the value of Newlong if it is set or its
// zero value if it is unset. | [
"GetNewlong",
"returns",
"the",
"value",
"of",
"Newlong",
"if",
"it",
"is",
"set",
"or",
"its",
"zero",
"value",
"if",
"it",
"is",
"unset",
"."
]
| bd70ffbd17e635243988ba62be97eebff738204d | https://github.com/yarpc/yarpc-go/blob/bd70ffbd17e635243988ba62be97eebff738204d/internal/crossdock/thrift/gauntlet/types.go#L6670-L6676 |
10,844 | yarpc/yarpc-go | internal/crossdock/thrift/gauntlet/types.go | GetNewdouble | func (v *VersioningTestV2) GetNewdouble() (o float64) {
if v != nil && v.Newdouble != nil {
return *v.Newdouble
}
return
} | go | func (v *VersioningTestV2) GetNewdouble() (o float64) {
if v != nil && v.Newdouble != nil {
return *v.Newdouble
}
return
} | [
"func",
"(",
"v",
"*",
"VersioningTestV2",
")",
"GetNewdouble",
"(",
")",
"(",
"o",
"float64",
")",
"{",
"if",
"v",
"!=",
"nil",
"&&",
"v",
".",
"Newdouble",
"!=",
"nil",
"{",
"return",
"*",
"v",
".",
"Newdouble",
"\n",
"}",
"\n\n",
"return",
"\n",
"}"
]
| // GetNewdouble returns the value of Newdouble if it is set or its
// zero value if it is unset. | [
"GetNewdouble",
"returns",
"the",
"value",
"of",
"Newdouble",
"if",
"it",
"is",
"set",
"or",
"its",
"zero",
"value",
"if",
"it",
"is",
"unset",
"."
]
| bd70ffbd17e635243988ba62be97eebff738204d | https://github.com/yarpc/yarpc-go/blob/bd70ffbd17e635243988ba62be97eebff738204d/internal/crossdock/thrift/gauntlet/types.go#L6685-L6691 |
10,845 | yarpc/yarpc-go | internal/crossdock/thrift/gauntlet/types.go | GetNewstruct | func (v *VersioningTestV2) GetNewstruct() (o *Bonk) {
if v != nil && v.Newstruct != nil {
return v.Newstruct
}
return
} | go | func (v *VersioningTestV2) GetNewstruct() (o *Bonk) {
if v != nil && v.Newstruct != nil {
return v.Newstruct
}
return
} | [
"func",
"(",
"v",
"*",
"VersioningTestV2",
")",
"GetNewstruct",
"(",
")",
"(",
"o",
"*",
"Bonk",
")",
"{",
"if",
"v",
"!=",
"nil",
"&&",
"v",
".",
"Newstruct",
"!=",
"nil",
"{",
"return",
"v",
".",
"Newstruct",
"\n",
"}",
"\n\n",
"return",
"\n",
"}"
]
| // GetNewstruct returns the value of Newstruct if it is set or its
// zero value if it is unset. | [
"GetNewstruct",
"returns",
"the",
"value",
"of",
"Newstruct",
"if",
"it",
"is",
"set",
"or",
"its",
"zero",
"value",
"if",
"it",
"is",
"unset",
"."
]
| bd70ffbd17e635243988ba62be97eebff738204d | https://github.com/yarpc/yarpc-go/blob/bd70ffbd17e635243988ba62be97eebff738204d/internal/crossdock/thrift/gauntlet/types.go#L6700-L6706 |
10,846 | yarpc/yarpc-go | internal/crossdock/thrift/gauntlet/types.go | GetNewlist | func (v *VersioningTestV2) GetNewlist() (o []int32) {
if v != nil && v.Newlist != nil {
return v.Newlist
}
return
} | go | func (v *VersioningTestV2) GetNewlist() (o []int32) {
if v != nil && v.Newlist != nil {
return v.Newlist
}
return
} | [
"func",
"(",
"v",
"*",
"VersioningTestV2",
")",
"GetNewlist",
"(",
")",
"(",
"o",
"[",
"]",
"int32",
")",
"{",
"if",
"v",
"!=",
"nil",
"&&",
"v",
".",
"Newlist",
"!=",
"nil",
"{",
"return",
"v",
".",
"Newlist",
"\n",
"}",
"\n\n",
"return",
"\n",
"}"
]
| // GetNewlist returns the value of Newlist if it is set or its
// zero value if it is unset. | [
"GetNewlist",
"returns",
"the",
"value",
"of",
"Newlist",
"if",
"it",
"is",
"set",
"or",
"its",
"zero",
"value",
"if",
"it",
"is",
"unset",
"."
]
| bd70ffbd17e635243988ba62be97eebff738204d | https://github.com/yarpc/yarpc-go/blob/bd70ffbd17e635243988ba62be97eebff738204d/internal/crossdock/thrift/gauntlet/types.go#L6715-L6721 |
10,847 | yarpc/yarpc-go | internal/crossdock/thrift/gauntlet/types.go | GetNewset | func (v *VersioningTestV2) GetNewset() (o map[int32]struct{}) {
if v != nil && v.Newset != nil {
return v.Newset
}
return
} | go | func (v *VersioningTestV2) GetNewset() (o map[int32]struct{}) {
if v != nil && v.Newset != nil {
return v.Newset
}
return
} | [
"func",
"(",
"v",
"*",
"VersioningTestV2",
")",
"GetNewset",
"(",
")",
"(",
"o",
"map",
"[",
"int32",
"]",
"struct",
"{",
"}",
")",
"{",
"if",
"v",
"!=",
"nil",
"&&",
"v",
".",
"Newset",
"!=",
"nil",
"{",
"return",
"v",
".",
"Newset",
"\n",
"}",
"\n\n",
"return",
"\n",
"}"
]
| // GetNewset returns the value of Newset if it is set or its
// zero value if it is unset. | [
"GetNewset",
"returns",
"the",
"value",
"of",
"Newset",
"if",
"it",
"is",
"set",
"or",
"its",
"zero",
"value",
"if",
"it",
"is",
"unset",
"."
]
| bd70ffbd17e635243988ba62be97eebff738204d | https://github.com/yarpc/yarpc-go/blob/bd70ffbd17e635243988ba62be97eebff738204d/internal/crossdock/thrift/gauntlet/types.go#L6730-L6736 |
10,848 | yarpc/yarpc-go | internal/crossdock/thrift/gauntlet/types.go | GetNewmap | func (v *VersioningTestV2) GetNewmap() (o map[int32]int32) {
if v != nil && v.Newmap != nil {
return v.Newmap
}
return
} | go | func (v *VersioningTestV2) GetNewmap() (o map[int32]int32) {
if v != nil && v.Newmap != nil {
return v.Newmap
}
return
} | [
"func",
"(",
"v",
"*",
"VersioningTestV2",
")",
"GetNewmap",
"(",
")",
"(",
"o",
"map",
"[",
"int32",
"]",
"int32",
")",
"{",
"if",
"v",
"!=",
"nil",
"&&",
"v",
".",
"Newmap",
"!=",
"nil",
"{",
"return",
"v",
".",
"Newmap",
"\n",
"}",
"\n\n",
"return",
"\n",
"}"
]
| // GetNewmap returns the value of Newmap if it is set or its
// zero value if it is unset. | [
"GetNewmap",
"returns",
"the",
"value",
"of",
"Newmap",
"if",
"it",
"is",
"set",
"or",
"its",
"zero",
"value",
"if",
"it",
"is",
"unset",
"."
]
| bd70ffbd17e635243988ba62be97eebff738204d | https://github.com/yarpc/yarpc-go/blob/bd70ffbd17e635243988ba62be97eebff738204d/internal/crossdock/thrift/gauntlet/types.go#L6745-L6751 |
10,849 | yarpc/yarpc-go | internal/crossdock/thrift/gauntlet/types.go | GetNewstring | func (v *VersioningTestV2) GetNewstring() (o string) {
if v != nil && v.Newstring != nil {
return *v.Newstring
}
return
} | go | func (v *VersioningTestV2) GetNewstring() (o string) {
if v != nil && v.Newstring != nil {
return *v.Newstring
}
return
} | [
"func",
"(",
"v",
"*",
"VersioningTestV2",
")",
"GetNewstring",
"(",
")",
"(",
"o",
"string",
")",
"{",
"if",
"v",
"!=",
"nil",
"&&",
"v",
".",
"Newstring",
"!=",
"nil",
"{",
"return",
"*",
"v",
".",
"Newstring",
"\n",
"}",
"\n\n",
"return",
"\n",
"}"
]
| // GetNewstring returns the value of Newstring if it is set or its
// zero value if it is unset. | [
"GetNewstring",
"returns",
"the",
"value",
"of",
"Newstring",
"if",
"it",
"is",
"set",
"or",
"its",
"zero",
"value",
"if",
"it",
"is",
"unset",
"."
]
| bd70ffbd17e635243988ba62be97eebff738204d | https://github.com/yarpc/yarpc-go/blob/bd70ffbd17e635243988ba62be97eebff738204d/internal/crossdock/thrift/gauntlet/types.go#L6760-L6766 |
10,850 | yarpc/yarpc-go | internal/crossdock/thrift/gauntlet/types.go | String | func (v *Xception) String() string {
if v == nil {
return "<nil>"
}
var fields [2]string
i := 0
if v.ErrorCode != nil {
fields[i] = fmt.Sprintf("ErrorCode: %v", *(v.ErrorCode))
i++
}
if v.Message != nil {
fields[i] = fmt.Sprintf("Message: %v", *(v.Message))
i++
}
return fmt.Sprintf("Xception{%v}", strings.Join(fields[:i], ", "))
} | go | func (v *Xception) String() string {
if v == nil {
return "<nil>"
}
var fields [2]string
i := 0
if v.ErrorCode != nil {
fields[i] = fmt.Sprintf("ErrorCode: %v", *(v.ErrorCode))
i++
}
if v.Message != nil {
fields[i] = fmt.Sprintf("Message: %v", *(v.Message))
i++
}
return fmt.Sprintf("Xception{%v}", strings.Join(fields[:i], ", "))
} | [
"func",
"(",
"v",
"*",
"Xception",
")",
"String",
"(",
")",
"string",
"{",
"if",
"v",
"==",
"nil",
"{",
"return",
"\"",
"\"",
"\n",
"}",
"\n\n",
"var",
"fields",
"[",
"2",
"]",
"string",
"\n",
"i",
":=",
"0",
"\n",
"if",
"v",
".",
"ErrorCode",
"!=",
"nil",
"{",
"fields",
"[",
"i",
"]",
"=",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"*",
"(",
"v",
".",
"ErrorCode",
")",
")",
"\n",
"i",
"++",
"\n",
"}",
"\n",
"if",
"v",
".",
"Message",
"!=",
"nil",
"{",
"fields",
"[",
"i",
"]",
"=",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"*",
"(",
"v",
".",
"Message",
")",
")",
"\n",
"i",
"++",
"\n",
"}",
"\n\n",
"return",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"strings",
".",
"Join",
"(",
"fields",
"[",
":",
"i",
"]",
",",
"\"",
"\"",
")",
")",
"\n",
"}"
]
| // String returns a readable string representation of a Xception
// struct. | [
"String",
"returns",
"a",
"readable",
"string",
"representation",
"of",
"a",
"Xception",
"struct",
"."
]
| bd70ffbd17e635243988ba62be97eebff738204d | https://github.com/yarpc/yarpc-go/blob/bd70ffbd17e635243988ba62be97eebff738204d/internal/crossdock/thrift/gauntlet/types.go#L6886-L6903 |
10,851 | yarpc/yarpc-go | internal/crossdock/thrift/gauntlet/types.go | Equals | func (v *Xception) Equals(rhs *Xception) bool {
if v == nil {
return rhs == nil
} else if rhs == nil {
return false
}
if !_I32_EqualsPtr(v.ErrorCode, rhs.ErrorCode) {
return false
}
if !_String_EqualsPtr(v.Message, rhs.Message) {
return false
}
return true
} | go | func (v *Xception) Equals(rhs *Xception) bool {
if v == nil {
return rhs == nil
} else if rhs == nil {
return false
}
if !_I32_EqualsPtr(v.ErrorCode, rhs.ErrorCode) {
return false
}
if !_String_EqualsPtr(v.Message, rhs.Message) {
return false
}
return true
} | [
"func",
"(",
"v",
"*",
"Xception",
")",
"Equals",
"(",
"rhs",
"*",
"Xception",
")",
"bool",
"{",
"if",
"v",
"==",
"nil",
"{",
"return",
"rhs",
"==",
"nil",
"\n",
"}",
"else",
"if",
"rhs",
"==",
"nil",
"{",
"return",
"false",
"\n",
"}",
"\n",
"if",
"!",
"_I32_EqualsPtr",
"(",
"v",
".",
"ErrorCode",
",",
"rhs",
".",
"ErrorCode",
")",
"{",
"return",
"false",
"\n",
"}",
"\n",
"if",
"!",
"_String_EqualsPtr",
"(",
"v",
".",
"Message",
",",
"rhs",
".",
"Message",
")",
"{",
"return",
"false",
"\n",
"}",
"\n\n",
"return",
"true",
"\n",
"}"
]
| // Equals returns true if all the fields of this Xception match the
// provided Xception.
//
// This function performs a deep comparison. | [
"Equals",
"returns",
"true",
"if",
"all",
"the",
"fields",
"of",
"this",
"Xception",
"match",
"the",
"provided",
"Xception",
".",
"This",
"function",
"performs",
"a",
"deep",
"comparison",
"."
]
| bd70ffbd17e635243988ba62be97eebff738204d | https://github.com/yarpc/yarpc-go/blob/bd70ffbd17e635243988ba62be97eebff738204d/internal/crossdock/thrift/gauntlet/types.go#L6909-L6923 |
10,852 | yarpc/yarpc-go | internal/crossdock/thrift/gauntlet/types.go | MarshalLogObject | func (v *Xception) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
if v == nil {
return nil
}
if v.ErrorCode != nil {
enc.AddInt32("errorCode", *v.ErrorCode)
}
if v.Message != nil {
enc.AddString("message", *v.Message)
}
return err
} | go | func (v *Xception) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
if v == nil {
return nil
}
if v.ErrorCode != nil {
enc.AddInt32("errorCode", *v.ErrorCode)
}
if v.Message != nil {
enc.AddString("message", *v.Message)
}
return err
} | [
"func",
"(",
"v",
"*",
"Xception",
")",
"MarshalLogObject",
"(",
"enc",
"zapcore",
".",
"ObjectEncoder",
")",
"(",
"err",
"error",
")",
"{",
"if",
"v",
"==",
"nil",
"{",
"return",
"nil",
"\n",
"}",
"\n",
"if",
"v",
".",
"ErrorCode",
"!=",
"nil",
"{",
"enc",
".",
"AddInt32",
"(",
"\"",
"\"",
",",
"*",
"v",
".",
"ErrorCode",
")",
"\n",
"}",
"\n",
"if",
"v",
".",
"Message",
"!=",
"nil",
"{",
"enc",
".",
"AddString",
"(",
"\"",
"\"",
",",
"*",
"v",
".",
"Message",
")",
"\n",
"}",
"\n",
"return",
"err",
"\n",
"}"
]
| // MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of Xception. | [
"MarshalLogObject",
"implements",
"zapcore",
".",
"ObjectMarshaler",
"enabling",
"fast",
"logging",
"of",
"Xception",
"."
]
| bd70ffbd17e635243988ba62be97eebff738204d | https://github.com/yarpc/yarpc-go/blob/bd70ffbd17e635243988ba62be97eebff738204d/internal/crossdock/thrift/gauntlet/types.go#L6927-L6938 |
10,853 | yarpc/yarpc-go | internal/crossdock/thrift/gauntlet/types.go | String | func (v *Xception2) String() string {
if v == nil {
return "<nil>"
}
var fields [2]string
i := 0
if v.ErrorCode != nil {
fields[i] = fmt.Sprintf("ErrorCode: %v", *(v.ErrorCode))
i++
}
if v.StructThing != nil {
fields[i] = fmt.Sprintf("StructThing: %v", v.StructThing)
i++
}
return fmt.Sprintf("Xception2{%v}", strings.Join(fields[:i], ", "))
} | go | func (v *Xception2) String() string {
if v == nil {
return "<nil>"
}
var fields [2]string
i := 0
if v.ErrorCode != nil {
fields[i] = fmt.Sprintf("ErrorCode: %v", *(v.ErrorCode))
i++
}
if v.StructThing != nil {
fields[i] = fmt.Sprintf("StructThing: %v", v.StructThing)
i++
}
return fmt.Sprintf("Xception2{%v}", strings.Join(fields[:i], ", "))
} | [
"func",
"(",
"v",
"*",
"Xception2",
")",
"String",
"(",
")",
"string",
"{",
"if",
"v",
"==",
"nil",
"{",
"return",
"\"",
"\"",
"\n",
"}",
"\n\n",
"var",
"fields",
"[",
"2",
"]",
"string",
"\n",
"i",
":=",
"0",
"\n",
"if",
"v",
".",
"ErrorCode",
"!=",
"nil",
"{",
"fields",
"[",
"i",
"]",
"=",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"*",
"(",
"v",
".",
"ErrorCode",
")",
")",
"\n",
"i",
"++",
"\n",
"}",
"\n",
"if",
"v",
".",
"StructThing",
"!=",
"nil",
"{",
"fields",
"[",
"i",
"]",
"=",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"v",
".",
"StructThing",
")",
"\n",
"i",
"++",
"\n",
"}",
"\n\n",
"return",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"strings",
".",
"Join",
"(",
"fields",
"[",
":",
"i",
"]",
",",
"\"",
"\"",
")",
")",
"\n",
"}"
]
| // String returns a readable string representation of a Xception2
// struct. | [
"String",
"returns",
"a",
"readable",
"string",
"representation",
"of",
"a",
"Xception2",
"struct",
"."
]
| bd70ffbd17e635243988ba62be97eebff738204d | https://github.com/yarpc/yarpc-go/blob/bd70ffbd17e635243988ba62be97eebff738204d/internal/crossdock/thrift/gauntlet/types.go#L7070-L7087 |
10,854 | yarpc/yarpc-go | internal/crossdock/thrift/gauntlet/types.go | Equals | func (v *Xception2) Equals(rhs *Xception2) bool {
if v == nil {
return rhs == nil
} else if rhs == nil {
return false
}
if !_I32_EqualsPtr(v.ErrorCode, rhs.ErrorCode) {
return false
}
if !((v.StructThing == nil && rhs.StructThing == nil) || (v.StructThing != nil && rhs.StructThing != nil && v.StructThing.Equals(rhs.StructThing))) {
return false
}
return true
} | go | func (v *Xception2) Equals(rhs *Xception2) bool {
if v == nil {
return rhs == nil
} else if rhs == nil {
return false
}
if !_I32_EqualsPtr(v.ErrorCode, rhs.ErrorCode) {
return false
}
if !((v.StructThing == nil && rhs.StructThing == nil) || (v.StructThing != nil && rhs.StructThing != nil && v.StructThing.Equals(rhs.StructThing))) {
return false
}
return true
} | [
"func",
"(",
"v",
"*",
"Xception2",
")",
"Equals",
"(",
"rhs",
"*",
"Xception2",
")",
"bool",
"{",
"if",
"v",
"==",
"nil",
"{",
"return",
"rhs",
"==",
"nil",
"\n",
"}",
"else",
"if",
"rhs",
"==",
"nil",
"{",
"return",
"false",
"\n",
"}",
"\n",
"if",
"!",
"_I32_EqualsPtr",
"(",
"v",
".",
"ErrorCode",
",",
"rhs",
".",
"ErrorCode",
")",
"{",
"return",
"false",
"\n",
"}",
"\n",
"if",
"!",
"(",
"(",
"v",
".",
"StructThing",
"==",
"nil",
"&&",
"rhs",
".",
"StructThing",
"==",
"nil",
")",
"||",
"(",
"v",
".",
"StructThing",
"!=",
"nil",
"&&",
"rhs",
".",
"StructThing",
"!=",
"nil",
"&&",
"v",
".",
"StructThing",
".",
"Equals",
"(",
"rhs",
".",
"StructThing",
")",
")",
")",
"{",
"return",
"false",
"\n",
"}",
"\n\n",
"return",
"true",
"\n",
"}"
]
| // Equals returns true if all the fields of this Xception2 match the
// provided Xception2.
//
// This function performs a deep comparison. | [
"Equals",
"returns",
"true",
"if",
"all",
"the",
"fields",
"of",
"this",
"Xception2",
"match",
"the",
"provided",
"Xception2",
".",
"This",
"function",
"performs",
"a",
"deep",
"comparison",
"."
]
| bd70ffbd17e635243988ba62be97eebff738204d | https://github.com/yarpc/yarpc-go/blob/bd70ffbd17e635243988ba62be97eebff738204d/internal/crossdock/thrift/gauntlet/types.go#L7093-L7107 |
10,855 | yarpc/yarpc-go | internal/crossdock/thrift/gauntlet/types.go | MarshalLogObject | func (v *Xception2) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
if v == nil {
return nil
}
if v.ErrorCode != nil {
enc.AddInt32("errorCode", *v.ErrorCode)
}
if v.StructThing != nil {
err = multierr.Append(err, enc.AddObject("struct_thing", v.StructThing))
}
return err
} | go | func (v *Xception2) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
if v == nil {
return nil
}
if v.ErrorCode != nil {
enc.AddInt32("errorCode", *v.ErrorCode)
}
if v.StructThing != nil {
err = multierr.Append(err, enc.AddObject("struct_thing", v.StructThing))
}
return err
} | [
"func",
"(",
"v",
"*",
"Xception2",
")",
"MarshalLogObject",
"(",
"enc",
"zapcore",
".",
"ObjectEncoder",
")",
"(",
"err",
"error",
")",
"{",
"if",
"v",
"==",
"nil",
"{",
"return",
"nil",
"\n",
"}",
"\n",
"if",
"v",
".",
"ErrorCode",
"!=",
"nil",
"{",
"enc",
".",
"AddInt32",
"(",
"\"",
"\"",
",",
"*",
"v",
".",
"ErrorCode",
")",
"\n",
"}",
"\n",
"if",
"v",
".",
"StructThing",
"!=",
"nil",
"{",
"err",
"=",
"multierr",
".",
"Append",
"(",
"err",
",",
"enc",
".",
"AddObject",
"(",
"\"",
"\"",
",",
"v",
".",
"StructThing",
")",
")",
"\n",
"}",
"\n",
"return",
"err",
"\n",
"}"
]
| // MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of Xception2. | [
"MarshalLogObject",
"implements",
"zapcore",
".",
"ObjectMarshaler",
"enabling",
"fast",
"logging",
"of",
"Xception2",
"."
]
| bd70ffbd17e635243988ba62be97eebff738204d | https://github.com/yarpc/yarpc-go/blob/bd70ffbd17e635243988ba62be97eebff738204d/internal/crossdock/thrift/gauntlet/types.go#L7111-L7122 |
10,856 | yarpc/yarpc-go | internal/crossdock/thrift/gauntlet/types.go | String | func (v *Xtruct) String() string {
if v == nil {
return "<nil>"
}
var fields [4]string
i := 0
if v.StringThing != nil {
fields[i] = fmt.Sprintf("StringThing: %v", *(v.StringThing))
i++
}
if v.ByteThing != nil {
fields[i] = fmt.Sprintf("ByteThing: %v", *(v.ByteThing))
i++
}
if v.I32Thing != nil {
fields[i] = fmt.Sprintf("I32Thing: %v", *(v.I32Thing))
i++
}
if v.I64Thing != nil {
fields[i] = fmt.Sprintf("I64Thing: %v", *(v.I64Thing))
i++
}
return fmt.Sprintf("Xtruct{%v}", strings.Join(fields[:i], ", "))
} | go | func (v *Xtruct) String() string {
if v == nil {
return "<nil>"
}
var fields [4]string
i := 0
if v.StringThing != nil {
fields[i] = fmt.Sprintf("StringThing: %v", *(v.StringThing))
i++
}
if v.ByteThing != nil {
fields[i] = fmt.Sprintf("ByteThing: %v", *(v.ByteThing))
i++
}
if v.I32Thing != nil {
fields[i] = fmt.Sprintf("I32Thing: %v", *(v.I32Thing))
i++
}
if v.I64Thing != nil {
fields[i] = fmt.Sprintf("I64Thing: %v", *(v.I64Thing))
i++
}
return fmt.Sprintf("Xtruct{%v}", strings.Join(fields[:i], ", "))
} | [
"func",
"(",
"v",
"*",
"Xtruct",
")",
"String",
"(",
")",
"string",
"{",
"if",
"v",
"==",
"nil",
"{",
"return",
"\"",
"\"",
"\n",
"}",
"\n\n",
"var",
"fields",
"[",
"4",
"]",
"string",
"\n",
"i",
":=",
"0",
"\n",
"if",
"v",
".",
"StringThing",
"!=",
"nil",
"{",
"fields",
"[",
"i",
"]",
"=",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"*",
"(",
"v",
".",
"StringThing",
")",
")",
"\n",
"i",
"++",
"\n",
"}",
"\n",
"if",
"v",
".",
"ByteThing",
"!=",
"nil",
"{",
"fields",
"[",
"i",
"]",
"=",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"*",
"(",
"v",
".",
"ByteThing",
")",
")",
"\n",
"i",
"++",
"\n",
"}",
"\n",
"if",
"v",
".",
"I32Thing",
"!=",
"nil",
"{",
"fields",
"[",
"i",
"]",
"=",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"*",
"(",
"v",
".",
"I32Thing",
")",
")",
"\n",
"i",
"++",
"\n",
"}",
"\n",
"if",
"v",
".",
"I64Thing",
"!=",
"nil",
"{",
"fields",
"[",
"i",
"]",
"=",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"*",
"(",
"v",
".",
"I64Thing",
")",
")",
"\n",
"i",
"++",
"\n",
"}",
"\n\n",
"return",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"strings",
".",
"Join",
"(",
"fields",
"[",
":",
"i",
"]",
",",
"\"",
"\"",
")",
")",
"\n",
"}"
]
| // String returns a readable string representation of a Xtruct
// struct. | [
"String",
"returns",
"a",
"readable",
"string",
"representation",
"of",
"a",
"Xtruct",
"struct",
"."
]
| bd70ffbd17e635243988ba62be97eebff738204d | https://github.com/yarpc/yarpc-go/blob/bd70ffbd17e635243988ba62be97eebff738204d/internal/crossdock/thrift/gauntlet/types.go#L7294-L7319 |
10,857 | yarpc/yarpc-go | internal/crossdock/thrift/gauntlet/types.go | Equals | func (v *Xtruct) Equals(rhs *Xtruct) bool {
if v == nil {
return rhs == nil
} else if rhs == nil {
return false
}
if !_String_EqualsPtr(v.StringThing, rhs.StringThing) {
return false
}
if !_Byte_EqualsPtr(v.ByteThing, rhs.ByteThing) {
return false
}
if !_I32_EqualsPtr(v.I32Thing, rhs.I32Thing) {
return false
}
if !_I64_EqualsPtr(v.I64Thing, rhs.I64Thing) {
return false
}
return true
} | go | func (v *Xtruct) Equals(rhs *Xtruct) bool {
if v == nil {
return rhs == nil
} else if rhs == nil {
return false
}
if !_String_EqualsPtr(v.StringThing, rhs.StringThing) {
return false
}
if !_Byte_EqualsPtr(v.ByteThing, rhs.ByteThing) {
return false
}
if !_I32_EqualsPtr(v.I32Thing, rhs.I32Thing) {
return false
}
if !_I64_EqualsPtr(v.I64Thing, rhs.I64Thing) {
return false
}
return true
} | [
"func",
"(",
"v",
"*",
"Xtruct",
")",
"Equals",
"(",
"rhs",
"*",
"Xtruct",
")",
"bool",
"{",
"if",
"v",
"==",
"nil",
"{",
"return",
"rhs",
"==",
"nil",
"\n",
"}",
"else",
"if",
"rhs",
"==",
"nil",
"{",
"return",
"false",
"\n",
"}",
"\n",
"if",
"!",
"_String_EqualsPtr",
"(",
"v",
".",
"StringThing",
",",
"rhs",
".",
"StringThing",
")",
"{",
"return",
"false",
"\n",
"}",
"\n",
"if",
"!",
"_Byte_EqualsPtr",
"(",
"v",
".",
"ByteThing",
",",
"rhs",
".",
"ByteThing",
")",
"{",
"return",
"false",
"\n",
"}",
"\n",
"if",
"!",
"_I32_EqualsPtr",
"(",
"v",
".",
"I32Thing",
",",
"rhs",
".",
"I32Thing",
")",
"{",
"return",
"false",
"\n",
"}",
"\n",
"if",
"!",
"_I64_EqualsPtr",
"(",
"v",
".",
"I64Thing",
",",
"rhs",
".",
"I64Thing",
")",
"{",
"return",
"false",
"\n",
"}",
"\n\n",
"return",
"true",
"\n",
"}"
]
| // Equals returns true if all the fields of this Xtruct match the
// provided Xtruct.
//
// This function performs a deep comparison. | [
"Equals",
"returns",
"true",
"if",
"all",
"the",
"fields",
"of",
"this",
"Xtruct",
"match",
"the",
"provided",
"Xtruct",
".",
"This",
"function",
"performs",
"a",
"deep",
"comparison",
"."
]
| bd70ffbd17e635243988ba62be97eebff738204d | https://github.com/yarpc/yarpc-go/blob/bd70ffbd17e635243988ba62be97eebff738204d/internal/crossdock/thrift/gauntlet/types.go#L7325-L7345 |
10,858 | yarpc/yarpc-go | internal/crossdock/thrift/gauntlet/types.go | MarshalLogObject | func (v *Xtruct) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
if v == nil {
return nil
}
if v.StringThing != nil {
enc.AddString("string_thing", *v.StringThing)
}
if v.ByteThing != nil {
enc.AddInt8("byte_thing", *v.ByteThing)
}
if v.I32Thing != nil {
enc.AddInt32("i32_thing", *v.I32Thing)
}
if v.I64Thing != nil {
enc.AddInt64("i64_thing", *v.I64Thing)
}
return err
} | go | func (v *Xtruct) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
if v == nil {
return nil
}
if v.StringThing != nil {
enc.AddString("string_thing", *v.StringThing)
}
if v.ByteThing != nil {
enc.AddInt8("byte_thing", *v.ByteThing)
}
if v.I32Thing != nil {
enc.AddInt32("i32_thing", *v.I32Thing)
}
if v.I64Thing != nil {
enc.AddInt64("i64_thing", *v.I64Thing)
}
return err
} | [
"func",
"(",
"v",
"*",
"Xtruct",
")",
"MarshalLogObject",
"(",
"enc",
"zapcore",
".",
"ObjectEncoder",
")",
"(",
"err",
"error",
")",
"{",
"if",
"v",
"==",
"nil",
"{",
"return",
"nil",
"\n",
"}",
"\n",
"if",
"v",
".",
"StringThing",
"!=",
"nil",
"{",
"enc",
".",
"AddString",
"(",
"\"",
"\"",
",",
"*",
"v",
".",
"StringThing",
")",
"\n",
"}",
"\n",
"if",
"v",
".",
"ByteThing",
"!=",
"nil",
"{",
"enc",
".",
"AddInt8",
"(",
"\"",
"\"",
",",
"*",
"v",
".",
"ByteThing",
")",
"\n",
"}",
"\n",
"if",
"v",
".",
"I32Thing",
"!=",
"nil",
"{",
"enc",
".",
"AddInt32",
"(",
"\"",
"\"",
",",
"*",
"v",
".",
"I32Thing",
")",
"\n",
"}",
"\n",
"if",
"v",
".",
"I64Thing",
"!=",
"nil",
"{",
"enc",
".",
"AddInt64",
"(",
"\"",
"\"",
",",
"*",
"v",
".",
"I64Thing",
")",
"\n",
"}",
"\n",
"return",
"err",
"\n",
"}"
]
| // MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of Xtruct. | [
"MarshalLogObject",
"implements",
"zapcore",
".",
"ObjectMarshaler",
"enabling",
"fast",
"logging",
"of",
"Xtruct",
"."
]
| bd70ffbd17e635243988ba62be97eebff738204d | https://github.com/yarpc/yarpc-go/blob/bd70ffbd17e635243988ba62be97eebff738204d/internal/crossdock/thrift/gauntlet/types.go#L7349-L7366 |
10,859 | yarpc/yarpc-go | internal/crossdock/thrift/gauntlet/types.go | String | func (v *Xtruct2) String() string {
if v == nil {
return "<nil>"
}
var fields [3]string
i := 0
if v.ByteThing != nil {
fields[i] = fmt.Sprintf("ByteThing: %v", *(v.ByteThing))
i++
}
if v.StructThing != nil {
fields[i] = fmt.Sprintf("StructThing: %v", v.StructThing)
i++
}
if v.I32Thing != nil {
fields[i] = fmt.Sprintf("I32Thing: %v", *(v.I32Thing))
i++
}
return fmt.Sprintf("Xtruct2{%v}", strings.Join(fields[:i], ", "))
} | go | func (v *Xtruct2) String() string {
if v == nil {
return "<nil>"
}
var fields [3]string
i := 0
if v.ByteThing != nil {
fields[i] = fmt.Sprintf("ByteThing: %v", *(v.ByteThing))
i++
}
if v.StructThing != nil {
fields[i] = fmt.Sprintf("StructThing: %v", v.StructThing)
i++
}
if v.I32Thing != nil {
fields[i] = fmt.Sprintf("I32Thing: %v", *(v.I32Thing))
i++
}
return fmt.Sprintf("Xtruct2{%v}", strings.Join(fields[:i], ", "))
} | [
"func",
"(",
"v",
"*",
"Xtruct2",
")",
"String",
"(",
")",
"string",
"{",
"if",
"v",
"==",
"nil",
"{",
"return",
"\"",
"\"",
"\n",
"}",
"\n\n",
"var",
"fields",
"[",
"3",
"]",
"string",
"\n",
"i",
":=",
"0",
"\n",
"if",
"v",
".",
"ByteThing",
"!=",
"nil",
"{",
"fields",
"[",
"i",
"]",
"=",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"*",
"(",
"v",
".",
"ByteThing",
")",
")",
"\n",
"i",
"++",
"\n",
"}",
"\n",
"if",
"v",
".",
"StructThing",
"!=",
"nil",
"{",
"fields",
"[",
"i",
"]",
"=",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"v",
".",
"StructThing",
")",
"\n",
"i",
"++",
"\n",
"}",
"\n",
"if",
"v",
".",
"I32Thing",
"!=",
"nil",
"{",
"fields",
"[",
"i",
"]",
"=",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"*",
"(",
"v",
".",
"I32Thing",
")",
")",
"\n",
"i",
"++",
"\n",
"}",
"\n\n",
"return",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"strings",
".",
"Join",
"(",
"fields",
"[",
":",
"i",
"]",
",",
"\"",
"\"",
")",
")",
"\n",
"}"
]
| // String returns a readable string representation of a Xtruct2
// struct. | [
"String",
"returns",
"a",
"readable",
"string",
"representation",
"of",
"a",
"Xtruct2",
"struct",
"."
]
| bd70ffbd17e635243988ba62be97eebff738204d | https://github.com/yarpc/yarpc-go/blob/bd70ffbd17e635243988ba62be97eebff738204d/internal/crossdock/thrift/gauntlet/types.go#L7543-L7564 |
10,860 | yarpc/yarpc-go | internal/crossdock/thrift/gauntlet/types.go | Equals | func (v *Xtruct2) Equals(rhs *Xtruct2) bool {
if v == nil {
return rhs == nil
} else if rhs == nil {
return false
}
if !_Byte_EqualsPtr(v.ByteThing, rhs.ByteThing) {
return false
}
if !((v.StructThing == nil && rhs.StructThing == nil) || (v.StructThing != nil && rhs.StructThing != nil && v.StructThing.Equals(rhs.StructThing))) {
return false
}
if !_I32_EqualsPtr(v.I32Thing, rhs.I32Thing) {
return false
}
return true
} | go | func (v *Xtruct2) Equals(rhs *Xtruct2) bool {
if v == nil {
return rhs == nil
} else if rhs == nil {
return false
}
if !_Byte_EqualsPtr(v.ByteThing, rhs.ByteThing) {
return false
}
if !((v.StructThing == nil && rhs.StructThing == nil) || (v.StructThing != nil && rhs.StructThing != nil && v.StructThing.Equals(rhs.StructThing))) {
return false
}
if !_I32_EqualsPtr(v.I32Thing, rhs.I32Thing) {
return false
}
return true
} | [
"func",
"(",
"v",
"*",
"Xtruct2",
")",
"Equals",
"(",
"rhs",
"*",
"Xtruct2",
")",
"bool",
"{",
"if",
"v",
"==",
"nil",
"{",
"return",
"rhs",
"==",
"nil",
"\n",
"}",
"else",
"if",
"rhs",
"==",
"nil",
"{",
"return",
"false",
"\n",
"}",
"\n",
"if",
"!",
"_Byte_EqualsPtr",
"(",
"v",
".",
"ByteThing",
",",
"rhs",
".",
"ByteThing",
")",
"{",
"return",
"false",
"\n",
"}",
"\n",
"if",
"!",
"(",
"(",
"v",
".",
"StructThing",
"==",
"nil",
"&&",
"rhs",
".",
"StructThing",
"==",
"nil",
")",
"||",
"(",
"v",
".",
"StructThing",
"!=",
"nil",
"&&",
"rhs",
".",
"StructThing",
"!=",
"nil",
"&&",
"v",
".",
"StructThing",
".",
"Equals",
"(",
"rhs",
".",
"StructThing",
")",
")",
")",
"{",
"return",
"false",
"\n",
"}",
"\n",
"if",
"!",
"_I32_EqualsPtr",
"(",
"v",
".",
"I32Thing",
",",
"rhs",
".",
"I32Thing",
")",
"{",
"return",
"false",
"\n",
"}",
"\n\n",
"return",
"true",
"\n",
"}"
]
| // Equals returns true if all the fields of this Xtruct2 match the
// provided Xtruct2.
//
// This function performs a deep comparison. | [
"Equals",
"returns",
"true",
"if",
"all",
"the",
"fields",
"of",
"this",
"Xtruct2",
"match",
"the",
"provided",
"Xtruct2",
".",
"This",
"function",
"performs",
"a",
"deep",
"comparison",
"."
]
| bd70ffbd17e635243988ba62be97eebff738204d | https://github.com/yarpc/yarpc-go/blob/bd70ffbd17e635243988ba62be97eebff738204d/internal/crossdock/thrift/gauntlet/types.go#L7570-L7587 |
10,861 | yarpc/yarpc-go | internal/crossdock/thrift/gauntlet/types.go | MarshalLogObject | func (v *Xtruct2) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
if v == nil {
return nil
}
if v.ByteThing != nil {
enc.AddInt8("byte_thing", *v.ByteThing)
}
if v.StructThing != nil {
err = multierr.Append(err, enc.AddObject("struct_thing", v.StructThing))
}
if v.I32Thing != nil {
enc.AddInt32("i32_thing", *v.I32Thing)
}
return err
} | go | func (v *Xtruct2) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
if v == nil {
return nil
}
if v.ByteThing != nil {
enc.AddInt8("byte_thing", *v.ByteThing)
}
if v.StructThing != nil {
err = multierr.Append(err, enc.AddObject("struct_thing", v.StructThing))
}
if v.I32Thing != nil {
enc.AddInt32("i32_thing", *v.I32Thing)
}
return err
} | [
"func",
"(",
"v",
"*",
"Xtruct2",
")",
"MarshalLogObject",
"(",
"enc",
"zapcore",
".",
"ObjectEncoder",
")",
"(",
"err",
"error",
")",
"{",
"if",
"v",
"==",
"nil",
"{",
"return",
"nil",
"\n",
"}",
"\n",
"if",
"v",
".",
"ByteThing",
"!=",
"nil",
"{",
"enc",
".",
"AddInt8",
"(",
"\"",
"\"",
",",
"*",
"v",
".",
"ByteThing",
")",
"\n",
"}",
"\n",
"if",
"v",
".",
"StructThing",
"!=",
"nil",
"{",
"err",
"=",
"multierr",
".",
"Append",
"(",
"err",
",",
"enc",
".",
"AddObject",
"(",
"\"",
"\"",
",",
"v",
".",
"StructThing",
")",
")",
"\n",
"}",
"\n",
"if",
"v",
".",
"I32Thing",
"!=",
"nil",
"{",
"enc",
".",
"AddInt32",
"(",
"\"",
"\"",
",",
"*",
"v",
".",
"I32Thing",
")",
"\n",
"}",
"\n",
"return",
"err",
"\n",
"}"
]
| // MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of Xtruct2. | [
"MarshalLogObject",
"implements",
"zapcore",
".",
"ObjectMarshaler",
"enabling",
"fast",
"logging",
"of",
"Xtruct2",
"."
]
| bd70ffbd17e635243988ba62be97eebff738204d | https://github.com/yarpc/yarpc-go/blob/bd70ffbd17e635243988ba62be97eebff738204d/internal/crossdock/thrift/gauntlet/types.go#L7591-L7605 |
10,862 | yarpc/yarpc-go | internal/crossdock/thrift/gauntlet/types.go | String | func (v *Xtruct3) String() string {
if v == nil {
return "<nil>"
}
var fields [4]string
i := 0
if v.StringThing != nil {
fields[i] = fmt.Sprintf("StringThing: %v", *(v.StringThing))
i++
}
if v.Changed != nil {
fields[i] = fmt.Sprintf("Changed: %v", *(v.Changed))
i++
}
if v.I32Thing != nil {
fields[i] = fmt.Sprintf("I32Thing: %v", *(v.I32Thing))
i++
}
if v.I64Thing != nil {
fields[i] = fmt.Sprintf("I64Thing: %v", *(v.I64Thing))
i++
}
return fmt.Sprintf("Xtruct3{%v}", strings.Join(fields[:i], ", "))
} | go | func (v *Xtruct3) String() string {
if v == nil {
return "<nil>"
}
var fields [4]string
i := 0
if v.StringThing != nil {
fields[i] = fmt.Sprintf("StringThing: %v", *(v.StringThing))
i++
}
if v.Changed != nil {
fields[i] = fmt.Sprintf("Changed: %v", *(v.Changed))
i++
}
if v.I32Thing != nil {
fields[i] = fmt.Sprintf("I32Thing: %v", *(v.I32Thing))
i++
}
if v.I64Thing != nil {
fields[i] = fmt.Sprintf("I64Thing: %v", *(v.I64Thing))
i++
}
return fmt.Sprintf("Xtruct3{%v}", strings.Join(fields[:i], ", "))
} | [
"func",
"(",
"v",
"*",
"Xtruct3",
")",
"String",
"(",
")",
"string",
"{",
"if",
"v",
"==",
"nil",
"{",
"return",
"\"",
"\"",
"\n",
"}",
"\n\n",
"var",
"fields",
"[",
"4",
"]",
"string",
"\n",
"i",
":=",
"0",
"\n",
"if",
"v",
".",
"StringThing",
"!=",
"nil",
"{",
"fields",
"[",
"i",
"]",
"=",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"*",
"(",
"v",
".",
"StringThing",
")",
")",
"\n",
"i",
"++",
"\n",
"}",
"\n",
"if",
"v",
".",
"Changed",
"!=",
"nil",
"{",
"fields",
"[",
"i",
"]",
"=",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"*",
"(",
"v",
".",
"Changed",
")",
")",
"\n",
"i",
"++",
"\n",
"}",
"\n",
"if",
"v",
".",
"I32Thing",
"!=",
"nil",
"{",
"fields",
"[",
"i",
"]",
"=",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"*",
"(",
"v",
".",
"I32Thing",
")",
")",
"\n",
"i",
"++",
"\n",
"}",
"\n",
"if",
"v",
".",
"I64Thing",
"!=",
"nil",
"{",
"fields",
"[",
"i",
"]",
"=",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"*",
"(",
"v",
".",
"I64Thing",
")",
")",
"\n",
"i",
"++",
"\n",
"}",
"\n\n",
"return",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"strings",
".",
"Join",
"(",
"fields",
"[",
":",
"i",
"]",
",",
"\"",
"\"",
")",
")",
"\n",
"}"
]
| // String returns a readable string representation of a Xtruct3
// struct. | [
"String",
"returns",
"a",
"readable",
"string",
"representation",
"of",
"a",
"Xtruct3",
"struct",
"."
]
| bd70ffbd17e635243988ba62be97eebff738204d | https://github.com/yarpc/yarpc-go/blob/bd70ffbd17e635243988ba62be97eebff738204d/internal/crossdock/thrift/gauntlet/types.go#L7788-L7813 |
10,863 | yarpc/yarpc-go | internal/crossdock/thrift/gauntlet/types.go | Equals | func (v *Xtruct3) Equals(rhs *Xtruct3) bool {
if v == nil {
return rhs == nil
} else if rhs == nil {
return false
}
if !_String_EqualsPtr(v.StringThing, rhs.StringThing) {
return false
}
if !_I32_EqualsPtr(v.Changed, rhs.Changed) {
return false
}
if !_I32_EqualsPtr(v.I32Thing, rhs.I32Thing) {
return false
}
if !_I64_EqualsPtr(v.I64Thing, rhs.I64Thing) {
return false
}
return true
} | go | func (v *Xtruct3) Equals(rhs *Xtruct3) bool {
if v == nil {
return rhs == nil
} else if rhs == nil {
return false
}
if !_String_EqualsPtr(v.StringThing, rhs.StringThing) {
return false
}
if !_I32_EqualsPtr(v.Changed, rhs.Changed) {
return false
}
if !_I32_EqualsPtr(v.I32Thing, rhs.I32Thing) {
return false
}
if !_I64_EqualsPtr(v.I64Thing, rhs.I64Thing) {
return false
}
return true
} | [
"func",
"(",
"v",
"*",
"Xtruct3",
")",
"Equals",
"(",
"rhs",
"*",
"Xtruct3",
")",
"bool",
"{",
"if",
"v",
"==",
"nil",
"{",
"return",
"rhs",
"==",
"nil",
"\n",
"}",
"else",
"if",
"rhs",
"==",
"nil",
"{",
"return",
"false",
"\n",
"}",
"\n",
"if",
"!",
"_String_EqualsPtr",
"(",
"v",
".",
"StringThing",
",",
"rhs",
".",
"StringThing",
")",
"{",
"return",
"false",
"\n",
"}",
"\n",
"if",
"!",
"_I32_EqualsPtr",
"(",
"v",
".",
"Changed",
",",
"rhs",
".",
"Changed",
")",
"{",
"return",
"false",
"\n",
"}",
"\n",
"if",
"!",
"_I32_EqualsPtr",
"(",
"v",
".",
"I32Thing",
",",
"rhs",
".",
"I32Thing",
")",
"{",
"return",
"false",
"\n",
"}",
"\n",
"if",
"!",
"_I64_EqualsPtr",
"(",
"v",
".",
"I64Thing",
",",
"rhs",
".",
"I64Thing",
")",
"{",
"return",
"false",
"\n",
"}",
"\n\n",
"return",
"true",
"\n",
"}"
]
| // Equals returns true if all the fields of this Xtruct3 match the
// provided Xtruct3.
//
// This function performs a deep comparison. | [
"Equals",
"returns",
"true",
"if",
"all",
"the",
"fields",
"of",
"this",
"Xtruct3",
"match",
"the",
"provided",
"Xtruct3",
".",
"This",
"function",
"performs",
"a",
"deep",
"comparison",
"."
]
| bd70ffbd17e635243988ba62be97eebff738204d | https://github.com/yarpc/yarpc-go/blob/bd70ffbd17e635243988ba62be97eebff738204d/internal/crossdock/thrift/gauntlet/types.go#L7819-L7839 |
10,864 | yarpc/yarpc-go | internal/crossdock/thrift/gauntlet/types.go | MarshalLogObject | func (v *Xtruct3) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
if v == nil {
return nil
}
if v.StringThing != nil {
enc.AddString("string_thing", *v.StringThing)
}
if v.Changed != nil {
enc.AddInt32("changed", *v.Changed)
}
if v.I32Thing != nil {
enc.AddInt32("i32_thing", *v.I32Thing)
}
if v.I64Thing != nil {
enc.AddInt64("i64_thing", *v.I64Thing)
}
return err
} | go | func (v *Xtruct3) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
if v == nil {
return nil
}
if v.StringThing != nil {
enc.AddString("string_thing", *v.StringThing)
}
if v.Changed != nil {
enc.AddInt32("changed", *v.Changed)
}
if v.I32Thing != nil {
enc.AddInt32("i32_thing", *v.I32Thing)
}
if v.I64Thing != nil {
enc.AddInt64("i64_thing", *v.I64Thing)
}
return err
} | [
"func",
"(",
"v",
"*",
"Xtruct3",
")",
"MarshalLogObject",
"(",
"enc",
"zapcore",
".",
"ObjectEncoder",
")",
"(",
"err",
"error",
")",
"{",
"if",
"v",
"==",
"nil",
"{",
"return",
"nil",
"\n",
"}",
"\n",
"if",
"v",
".",
"StringThing",
"!=",
"nil",
"{",
"enc",
".",
"AddString",
"(",
"\"",
"\"",
",",
"*",
"v",
".",
"StringThing",
")",
"\n",
"}",
"\n",
"if",
"v",
".",
"Changed",
"!=",
"nil",
"{",
"enc",
".",
"AddInt32",
"(",
"\"",
"\"",
",",
"*",
"v",
".",
"Changed",
")",
"\n",
"}",
"\n",
"if",
"v",
".",
"I32Thing",
"!=",
"nil",
"{",
"enc",
".",
"AddInt32",
"(",
"\"",
"\"",
",",
"*",
"v",
".",
"I32Thing",
")",
"\n",
"}",
"\n",
"if",
"v",
".",
"I64Thing",
"!=",
"nil",
"{",
"enc",
".",
"AddInt64",
"(",
"\"",
"\"",
",",
"*",
"v",
".",
"I64Thing",
")",
"\n",
"}",
"\n",
"return",
"err",
"\n",
"}"
]
| // MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of Xtruct3. | [
"MarshalLogObject",
"implements",
"zapcore",
".",
"ObjectMarshaler",
"enabling",
"fast",
"logging",
"of",
"Xtruct3",
"."
]
| bd70ffbd17e635243988ba62be97eebff738204d | https://github.com/yarpc/yarpc-go/blob/bd70ffbd17e635243988ba62be97eebff738204d/internal/crossdock/thrift/gauntlet/types.go#L7843-L7860 |
10,865 | yarpc/yarpc-go | internal/crossdock/thrift/gauntlet/types.go | GetChanged | func (v *Xtruct3) GetChanged() (o int32) {
if v != nil && v.Changed != nil {
return *v.Changed
}
return
} | go | func (v *Xtruct3) GetChanged() (o int32) {
if v != nil && v.Changed != nil {
return *v.Changed
}
return
} | [
"func",
"(",
"v",
"*",
"Xtruct3",
")",
"GetChanged",
"(",
")",
"(",
"o",
"int32",
")",
"{",
"if",
"v",
"!=",
"nil",
"&&",
"v",
".",
"Changed",
"!=",
"nil",
"{",
"return",
"*",
"v",
".",
"Changed",
"\n",
"}",
"\n\n",
"return",
"\n",
"}"
]
| // GetChanged returns the value of Changed if it is set or its
// zero value if it is unset. | [
"GetChanged",
"returns",
"the",
"value",
"of",
"Changed",
"if",
"it",
"is",
"set",
"or",
"its",
"zero",
"value",
"if",
"it",
"is",
"unset",
"."
]
| bd70ffbd17e635243988ba62be97eebff738204d | https://github.com/yarpc/yarpc-go/blob/bd70ffbd17e635243988ba62be97eebff738204d/internal/crossdock/thrift/gauntlet/types.go#L7879-L7885 |
10,866 | yarpc/yarpc-go | internal/crossdock/client/googlegrpcserver/googlegrpcserver.go | Run | func Run(t crossdock.T) {
fatals := crossdock.Fatals(t)
server := t.Param(params.Server)
fatals.NotEmpty(server, "server is required")
dispatcher := yarpc.NewDispatcher(yarpc.Config{
Name: "client",
Outbounds: yarpc.Outbounds{
"yarpc-test": {
Unary: grpc.NewTransport().NewSingleOutbound(fmt.Sprintf("%s:8090", server)),
},
},
})
fatals.NoError(dispatcher.Start(), "could not start Dispatcher")
defer dispatcher.Stop()
client := crossdockpb.NewEchoYARPCClient(dispatcher.ClientConfig("yarpc-test"))
ctx, cancel := context.WithTimeout(context.Background(), time.Second)
defer cancel()
token := random.String(5)
pong, err := client.Echo(ctx, &crossdockpb.Ping{Beep: token})
crossdock.Fatals(t).NoError(err, "call to Echo::echo failed: %v", err)
crossdock.Assert(t).Equal(token, pong.Boop, "server said: %v", pong.Boop)
} | go | func Run(t crossdock.T) {
fatals := crossdock.Fatals(t)
server := t.Param(params.Server)
fatals.NotEmpty(server, "server is required")
dispatcher := yarpc.NewDispatcher(yarpc.Config{
Name: "client",
Outbounds: yarpc.Outbounds{
"yarpc-test": {
Unary: grpc.NewTransport().NewSingleOutbound(fmt.Sprintf("%s:8090", server)),
},
},
})
fatals.NoError(dispatcher.Start(), "could not start Dispatcher")
defer dispatcher.Stop()
client := crossdockpb.NewEchoYARPCClient(dispatcher.ClientConfig("yarpc-test"))
ctx, cancel := context.WithTimeout(context.Background(), time.Second)
defer cancel()
token := random.String(5)
pong, err := client.Echo(ctx, &crossdockpb.Ping{Beep: token})
crossdock.Fatals(t).NoError(err, "call to Echo::echo failed: %v", err)
crossdock.Assert(t).Equal(token, pong.Boop, "server said: %v", pong.Boop)
} | [
"func",
"Run",
"(",
"t",
"crossdock",
".",
"T",
")",
"{",
"fatals",
":=",
"crossdock",
".",
"Fatals",
"(",
"t",
")",
"\n\n",
"server",
":=",
"t",
".",
"Param",
"(",
"params",
".",
"Server",
")",
"\n",
"fatals",
".",
"NotEmpty",
"(",
"server",
",",
"\"",
"\"",
")",
"\n\n",
"dispatcher",
":=",
"yarpc",
".",
"NewDispatcher",
"(",
"yarpc",
".",
"Config",
"{",
"Name",
":",
"\"",
"\"",
",",
"Outbounds",
":",
"yarpc",
".",
"Outbounds",
"{",
"\"",
"\"",
":",
"{",
"Unary",
":",
"grpc",
".",
"NewTransport",
"(",
")",
".",
"NewSingleOutbound",
"(",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"server",
")",
")",
",",
"}",
",",
"}",
",",
"}",
")",
"\n",
"fatals",
".",
"NoError",
"(",
"dispatcher",
".",
"Start",
"(",
")",
",",
"\"",
"\"",
")",
"\n",
"defer",
"dispatcher",
".",
"Stop",
"(",
")",
"\n\n",
"client",
":=",
"crossdockpb",
".",
"NewEchoYARPCClient",
"(",
"dispatcher",
".",
"ClientConfig",
"(",
"\"",
"\"",
")",
")",
"\n\n",
"ctx",
",",
"cancel",
":=",
"context",
".",
"WithTimeout",
"(",
"context",
".",
"Background",
"(",
")",
",",
"time",
".",
"Second",
")",
"\n",
"defer",
"cancel",
"(",
")",
"\n\n",
"token",
":=",
"random",
".",
"String",
"(",
"5",
")",
"\n\n",
"pong",
",",
"err",
":=",
"client",
".",
"Echo",
"(",
"ctx",
",",
"&",
"crossdockpb",
".",
"Ping",
"{",
"Beep",
":",
"token",
"}",
")",
"\n\n",
"crossdock",
".",
"Fatals",
"(",
"t",
")",
".",
"NoError",
"(",
"err",
",",
"\"",
"\"",
",",
"err",
")",
"\n",
"crossdock",
".",
"Assert",
"(",
"t",
")",
".",
"Equal",
"(",
"token",
",",
"pong",
".",
"Boop",
",",
"\"",
"\"",
",",
"pong",
".",
"Boop",
")",
"\n",
"}"
]
| // Run tests a yarpc call to the grpc-go server. | [
"Run",
"tests",
"a",
"yarpc",
"call",
"to",
"the",
"grpc",
"-",
"go",
"server",
"."
]
| bd70ffbd17e635243988ba62be97eebff738204d | https://github.com/yarpc/yarpc-go/blob/bd70ffbd17e635243988ba62be97eebff738204d/internal/crossdock/client/googlegrpcserver/googlegrpcserver.go#L37-L65 |
10,867 | yarpc/yarpc-go | transport/grpc/config.go | TransportSpec | func TransportSpec(opts ...Option) yarpcconfig.TransportSpec {
transportSpec, err := newTransportSpec(opts...)
if err != nil {
panic(err.Error())
}
return yarpcconfig.TransportSpec{
Name: transportName,
BuildTransport: transportSpec.buildTransport,
BuildInbound: transportSpec.buildInbound,
BuildUnaryOutbound: transportSpec.buildUnaryOutbound,
BuildStreamOutbound: transportSpec.buildStreamOutbound,
}
} | go | func TransportSpec(opts ...Option) yarpcconfig.TransportSpec {
transportSpec, err := newTransportSpec(opts...)
if err != nil {
panic(err.Error())
}
return yarpcconfig.TransportSpec{
Name: transportName,
BuildTransport: transportSpec.buildTransport,
BuildInbound: transportSpec.buildInbound,
BuildUnaryOutbound: transportSpec.buildUnaryOutbound,
BuildStreamOutbound: transportSpec.buildStreamOutbound,
}
} | [
"func",
"TransportSpec",
"(",
"opts",
"...",
"Option",
")",
"yarpcconfig",
".",
"TransportSpec",
"{",
"transportSpec",
",",
"err",
":=",
"newTransportSpec",
"(",
"opts",
"...",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"panic",
"(",
"err",
".",
"Error",
"(",
")",
")",
"\n",
"}",
"\n",
"return",
"yarpcconfig",
".",
"TransportSpec",
"{",
"Name",
":",
"transportName",
",",
"BuildTransport",
":",
"transportSpec",
".",
"buildTransport",
",",
"BuildInbound",
":",
"transportSpec",
".",
"buildInbound",
",",
"BuildUnaryOutbound",
":",
"transportSpec",
".",
"buildUnaryOutbound",
",",
"BuildStreamOutbound",
":",
"transportSpec",
".",
"buildStreamOutbound",
",",
"}",
"\n",
"}"
]
| // TransportSpec returns a TransportSpec for the gRPC transport.
//
// See TransportConfig, InboundConfig, and OutboundConfig for details on the
// different configuration parameters supported by this Transport.
//
// Any TransportOption, InboundOption, or OutboundOption may be passed to this function.
// These options will be applied BEFORE configuration parameters are
// interpreted. This allows configuration parameters to override Options
// provided to TransportSpec. | [
"TransportSpec",
"returns",
"a",
"TransportSpec",
"for",
"the",
"gRPC",
"transport",
".",
"See",
"TransportConfig",
"InboundConfig",
"and",
"OutboundConfig",
"for",
"details",
"on",
"the",
"different",
"configuration",
"parameters",
"supported",
"by",
"this",
"Transport",
".",
"Any",
"TransportOption",
"InboundOption",
"or",
"OutboundOption",
"may",
"be",
"passed",
"to",
"this",
"function",
".",
"These",
"options",
"will",
"be",
"applied",
"BEFORE",
"configuration",
"parameters",
"are",
"interpreted",
".",
"This",
"allows",
"configuration",
"parameters",
"to",
"override",
"Options",
"provided",
"to",
"TransportSpec",
"."
]
| bd70ffbd17e635243988ba62be97eebff738204d | https://github.com/yarpc/yarpc-go/blob/bd70ffbd17e635243988ba62be97eebff738204d/transport/grpc/config.go#L44-L56 |
10,868 | yarpc/yarpc-go | internal/crossdock/client/oneway/json.go | JSON | func JSON(t crossdock.T, dispatcher *yarpc.Dispatcher, serverCalledBack <-chan []byte, callBackAddr string) {
assert := crossdock.Assert(t)
fatals := crossdock.Fatals(t)
client := json.New(dispatcher.ClientConfig("oneway-server"))
token := getRandomID()
ctx, cancel := context.WithTimeout(context.Background(), time.Second)
defer cancel()
ack, err := client.CallOneway(
ctx,
"echo/json",
&jsonToken{Token: token},
yarpc.WithHeader("callBackAddr", callBackAddr),
)
// ensure channel hasn't been filled yet
select {
case <-serverCalledBack:
fatals.FailNow("oneway json test failed", "client waited for server to fill channel")
default:
}
fatals.NoError(err, "call to oneway/json failed: %v", err)
fatals.NotNil(ack, "ack is nil")
serverToken := <-serverCalledBack
assert.Equal(token, string(serverToken), "JSON token mismatch")
} | go | func JSON(t crossdock.T, dispatcher *yarpc.Dispatcher, serverCalledBack <-chan []byte, callBackAddr string) {
assert := crossdock.Assert(t)
fatals := crossdock.Fatals(t)
client := json.New(dispatcher.ClientConfig("oneway-server"))
token := getRandomID()
ctx, cancel := context.WithTimeout(context.Background(), time.Second)
defer cancel()
ack, err := client.CallOneway(
ctx,
"echo/json",
&jsonToken{Token: token},
yarpc.WithHeader("callBackAddr", callBackAddr),
)
// ensure channel hasn't been filled yet
select {
case <-serverCalledBack:
fatals.FailNow("oneway json test failed", "client waited for server to fill channel")
default:
}
fatals.NoError(err, "call to oneway/json failed: %v", err)
fatals.NotNil(ack, "ack is nil")
serverToken := <-serverCalledBack
assert.Equal(token, string(serverToken), "JSON token mismatch")
} | [
"func",
"JSON",
"(",
"t",
"crossdock",
".",
"T",
",",
"dispatcher",
"*",
"yarpc",
".",
"Dispatcher",
",",
"serverCalledBack",
"<-",
"chan",
"[",
"]",
"byte",
",",
"callBackAddr",
"string",
")",
"{",
"assert",
":=",
"crossdock",
".",
"Assert",
"(",
"t",
")",
"\n",
"fatals",
":=",
"crossdock",
".",
"Fatals",
"(",
"t",
")",
"\n\n",
"client",
":=",
"json",
".",
"New",
"(",
"dispatcher",
".",
"ClientConfig",
"(",
"\"",
"\"",
")",
")",
"\n",
"token",
":=",
"getRandomID",
"(",
")",
"\n\n",
"ctx",
",",
"cancel",
":=",
"context",
".",
"WithTimeout",
"(",
"context",
".",
"Background",
"(",
")",
",",
"time",
".",
"Second",
")",
"\n",
"defer",
"cancel",
"(",
")",
"\n",
"ack",
",",
"err",
":=",
"client",
".",
"CallOneway",
"(",
"ctx",
",",
"\"",
"\"",
",",
"&",
"jsonToken",
"{",
"Token",
":",
"token",
"}",
",",
"yarpc",
".",
"WithHeader",
"(",
"\"",
"\"",
",",
"callBackAddr",
")",
",",
")",
"\n\n",
"// ensure channel hasn't been filled yet",
"select",
"{",
"case",
"<-",
"serverCalledBack",
":",
"fatals",
".",
"FailNow",
"(",
"\"",
"\"",
",",
"\"",
"\"",
")",
"\n",
"default",
":",
"}",
"\n\n",
"fatals",
".",
"NoError",
"(",
"err",
",",
"\"",
"\"",
",",
"err",
")",
"\n",
"fatals",
".",
"NotNil",
"(",
"ack",
",",
"\"",
"\"",
")",
"\n\n",
"serverToken",
":=",
"<-",
"serverCalledBack",
"\n",
"assert",
".",
"Equal",
"(",
"token",
",",
"string",
"(",
"serverToken",
")",
",",
"\"",
"\"",
")",
"\n",
"}"
]
| // JSON starts an http run using JSON encoding | [
"JSON",
"starts",
"an",
"http",
"run",
"using",
"JSON",
"encoding"
]
| bd70ffbd17e635243988ba62be97eebff738204d | https://github.com/yarpc/yarpc-go/blob/bd70ffbd17e635243988ba62be97eebff738204d/internal/crossdock/client/oneway/json.go#L37-L65 |
10,869 | yarpc/yarpc-go | internal/crossdock/client/oneway/oneway.go | Run | func Run(t crossdock.T) {
callBackHandler, serverCalledBack := newCallBackHandler()
dispatcher, callBackAddr := dispatcher.CreateOnewayDispatcher(t, callBackHandler)
defer dispatcher.Stop()
encoding := t.Param(params.Encoding)
switch encoding {
case "raw":
Raw(t, dispatcher, serverCalledBack, callBackAddr)
case "json":
JSON(t, dispatcher, serverCalledBack, callBackAddr)
case "thrift":
Thrift(t, dispatcher, serverCalledBack, callBackAddr)
case "protobuf":
Protobuf(t, dispatcher, serverCalledBack, callBackAddr)
default:
crossdock.Fatals(t).Fail("unknown encoding", "%v", encoding)
}
} | go | func Run(t crossdock.T) {
callBackHandler, serverCalledBack := newCallBackHandler()
dispatcher, callBackAddr := dispatcher.CreateOnewayDispatcher(t, callBackHandler)
defer dispatcher.Stop()
encoding := t.Param(params.Encoding)
switch encoding {
case "raw":
Raw(t, dispatcher, serverCalledBack, callBackAddr)
case "json":
JSON(t, dispatcher, serverCalledBack, callBackAddr)
case "thrift":
Thrift(t, dispatcher, serverCalledBack, callBackAddr)
case "protobuf":
Protobuf(t, dispatcher, serverCalledBack, callBackAddr)
default:
crossdock.Fatals(t).Fail("unknown encoding", "%v", encoding)
}
} | [
"func",
"Run",
"(",
"t",
"crossdock",
".",
"T",
")",
"{",
"callBackHandler",
",",
"serverCalledBack",
":=",
"newCallBackHandler",
"(",
")",
"\n",
"dispatcher",
",",
"callBackAddr",
":=",
"dispatcher",
".",
"CreateOnewayDispatcher",
"(",
"t",
",",
"callBackHandler",
")",
"\n",
"defer",
"dispatcher",
".",
"Stop",
"(",
")",
"\n\n",
"encoding",
":=",
"t",
".",
"Param",
"(",
"params",
".",
"Encoding",
")",
"\n",
"switch",
"encoding",
"{",
"case",
"\"",
"\"",
":",
"Raw",
"(",
"t",
",",
"dispatcher",
",",
"serverCalledBack",
",",
"callBackAddr",
")",
"\n",
"case",
"\"",
"\"",
":",
"JSON",
"(",
"t",
",",
"dispatcher",
",",
"serverCalledBack",
",",
"callBackAddr",
")",
"\n",
"case",
"\"",
"\"",
":",
"Thrift",
"(",
"t",
",",
"dispatcher",
",",
"serverCalledBack",
",",
"callBackAddr",
")",
"\n",
"case",
"\"",
"\"",
":",
"Protobuf",
"(",
"t",
",",
"dispatcher",
",",
"serverCalledBack",
",",
"callBackAddr",
")",
"\n",
"default",
":",
"crossdock",
".",
"Fatals",
"(",
"t",
")",
".",
"Fail",
"(",
"\"",
"\"",
",",
"\"",
"\"",
",",
"encoding",
")",
"\n",
"}",
"\n",
"}"
]
| // Run starts the oneway behavior, testing a combination of encodings and transports | [
"Run",
"starts",
"the",
"oneway",
"behavior",
"testing",
"a",
"combination",
"of",
"encodings",
"and",
"transports"
]
| bd70ffbd17e635243988ba62be97eebff738204d | https://github.com/yarpc/yarpc-go/blob/bd70ffbd17e635243988ba62be97eebff738204d/internal/crossdock/client/oneway/oneway.go#L34-L52 |
10,870 | yarpc/yarpc-go | internal/crossdock/client/oneway/oneway.go | newCallBackHandler | func newCallBackHandler() (raw.OnewayHandler, <-chan []byte) {
serverCalledBack := make(chan []byte)
return func(ctx context.Context, body []byte) error {
serverCalledBack <- body
return nil
}, serverCalledBack
} | go | func newCallBackHandler() (raw.OnewayHandler, <-chan []byte) {
serverCalledBack := make(chan []byte)
return func(ctx context.Context, body []byte) error {
serverCalledBack <- body
return nil
}, serverCalledBack
} | [
"func",
"newCallBackHandler",
"(",
")",
"(",
"raw",
".",
"OnewayHandler",
",",
"<-",
"chan",
"[",
"]",
"byte",
")",
"{",
"serverCalledBack",
":=",
"make",
"(",
"chan",
"[",
"]",
"byte",
")",
"\n",
"return",
"func",
"(",
"ctx",
"context",
".",
"Context",
",",
"body",
"[",
"]",
"byte",
")",
"error",
"{",
"serverCalledBack",
"<-",
"body",
"\n",
"return",
"nil",
"\n",
"}",
",",
"serverCalledBack",
"\n",
"}"
]
| // newCallBackHandler creates a oneway handler that fills a channel with the body | [
"newCallBackHandler",
"creates",
"a",
"oneway",
"handler",
"that",
"fills",
"a",
"channel",
"with",
"the",
"body"
]
| bd70ffbd17e635243988ba62be97eebff738204d | https://github.com/yarpc/yarpc-go/blob/bd70ffbd17e635243988ba62be97eebff738204d/internal/crossdock/client/oneway/oneway.go#L55-L61 |
10,871 | yarpc/yarpc-go | transport/http/header.go | ToHTTPHeaders | func (hm headerMapper) ToHTTPHeaders(from transport.Headers, to http.Header) http.Header {
if to == nil {
to = make(http.Header, from.Len())
}
for k, v := range from.Items() {
to.Add(hm.Prefix+k, v)
}
return to
} | go | func (hm headerMapper) ToHTTPHeaders(from transport.Headers, to http.Header) http.Header {
if to == nil {
to = make(http.Header, from.Len())
}
for k, v := range from.Items() {
to.Add(hm.Prefix+k, v)
}
return to
} | [
"func",
"(",
"hm",
"headerMapper",
")",
"ToHTTPHeaders",
"(",
"from",
"transport",
".",
"Headers",
",",
"to",
"http",
".",
"Header",
")",
"http",
".",
"Header",
"{",
"if",
"to",
"==",
"nil",
"{",
"to",
"=",
"make",
"(",
"http",
".",
"Header",
",",
"from",
".",
"Len",
"(",
")",
")",
"\n",
"}",
"\n",
"for",
"k",
",",
"v",
":=",
"range",
"from",
".",
"Items",
"(",
")",
"{",
"to",
".",
"Add",
"(",
"hm",
".",
"Prefix",
"+",
"k",
",",
"v",
")",
"\n",
"}",
"\n",
"return",
"to",
"\n",
"}"
]
| // toHTTPHeaders converts application headers into transport headers.
//
// Headers are read from 'from' and written to 'to'. The final header collection
// is returned.
//
// If 'to' is nil, a new map will be assigned. | [
"toHTTPHeaders",
"converts",
"application",
"headers",
"into",
"transport",
"headers",
".",
"Headers",
"are",
"read",
"from",
"from",
"and",
"written",
"to",
"to",
".",
"The",
"final",
"header",
"collection",
"is",
"returned",
".",
"If",
"to",
"is",
"nil",
"a",
"new",
"map",
"will",
"be",
"assigned",
"."
]
| bd70ffbd17e635243988ba62be97eebff738204d | https://github.com/yarpc/yarpc-go/blob/bd70ffbd17e635243988ba62be97eebff738204d/transport/http/header.go#L43-L51 |
10,872 | yarpc/yarpc-go | transport/http/header.go | FromHTTPHeaders | func (hm headerMapper) FromHTTPHeaders(from http.Header, to transport.Headers) transport.Headers {
prefixLen := len(hm.Prefix)
for k := range from {
if strings.HasPrefix(k, hm.Prefix) {
key := k[prefixLen:]
to = to.With(key, from.Get(k))
}
// Note: undefined behavior for multiple occurrences of the same header
}
return to
} | go | func (hm headerMapper) FromHTTPHeaders(from http.Header, to transport.Headers) transport.Headers {
prefixLen := len(hm.Prefix)
for k := range from {
if strings.HasPrefix(k, hm.Prefix) {
key := k[prefixLen:]
to = to.With(key, from.Get(k))
}
// Note: undefined behavior for multiple occurrences of the same header
}
return to
} | [
"func",
"(",
"hm",
"headerMapper",
")",
"FromHTTPHeaders",
"(",
"from",
"http",
".",
"Header",
",",
"to",
"transport",
".",
"Headers",
")",
"transport",
".",
"Headers",
"{",
"prefixLen",
":=",
"len",
"(",
"hm",
".",
"Prefix",
")",
"\n",
"for",
"k",
":=",
"range",
"from",
"{",
"if",
"strings",
".",
"HasPrefix",
"(",
"k",
",",
"hm",
".",
"Prefix",
")",
"{",
"key",
":=",
"k",
"[",
"prefixLen",
":",
"]",
"\n",
"to",
"=",
"to",
".",
"With",
"(",
"key",
",",
"from",
".",
"Get",
"(",
"k",
")",
")",
"\n",
"}",
"\n",
"// Note: undefined behavior for multiple occurrences of the same header",
"}",
"\n",
"return",
"to",
"\n",
"}"
]
| // fromHTTPHeaders converts HTTP headers to application headers.
//
// Headers are read from 'from' and written to 'to'. The final header collection
// is returned.
//
// If 'to' is nil, a new map will be assigned. | [
"fromHTTPHeaders",
"converts",
"HTTP",
"headers",
"to",
"application",
"headers",
".",
"Headers",
"are",
"read",
"from",
"from",
"and",
"written",
"to",
"to",
".",
"The",
"final",
"header",
"collection",
"is",
"returned",
".",
"If",
"to",
"is",
"nil",
"a",
"new",
"map",
"will",
"be",
"assigned",
"."
]
| bd70ffbd17e635243988ba62be97eebff738204d | https://github.com/yarpc/yarpc-go/blob/bd70ffbd17e635243988ba62be97eebff738204d/transport/http/header.go#L59-L69 |
10,873 | yarpc/yarpc-go | transport/tchannel/transport.go | ReleasePeer | func (t *Transport) ReleasePeer(pid peer.Identifier, sub peer.Subscriber) error {
t.lock.Lock()
defer t.lock.Unlock()
p, ok := t.peers[pid.Identifier()]
if !ok {
return peer.ErrTransportHasNoReferenceToPeer{
TransportName: "tchannel.Transport",
PeerIdentifier: pid.Identifier(),
}
}
if err := p.Unsubscribe(sub); err != nil {
return err
}
if p.NumSubscribers() == 0 {
// Release the peer so that the connection retention loop stops.
p.Release()
delete(t.peers, pid.Identifier())
}
return nil
} | go | func (t *Transport) ReleasePeer(pid peer.Identifier, sub peer.Subscriber) error {
t.lock.Lock()
defer t.lock.Unlock()
p, ok := t.peers[pid.Identifier()]
if !ok {
return peer.ErrTransportHasNoReferenceToPeer{
TransportName: "tchannel.Transport",
PeerIdentifier: pid.Identifier(),
}
}
if err := p.Unsubscribe(sub); err != nil {
return err
}
if p.NumSubscribers() == 0 {
// Release the peer so that the connection retention loop stops.
p.Release()
delete(t.peers, pid.Identifier())
}
return nil
} | [
"func",
"(",
"t",
"*",
"Transport",
")",
"ReleasePeer",
"(",
"pid",
"peer",
".",
"Identifier",
",",
"sub",
"peer",
".",
"Subscriber",
")",
"error",
"{",
"t",
".",
"lock",
".",
"Lock",
"(",
")",
"\n",
"defer",
"t",
".",
"lock",
".",
"Unlock",
"(",
")",
"\n\n",
"p",
",",
"ok",
":=",
"t",
".",
"peers",
"[",
"pid",
".",
"Identifier",
"(",
")",
"]",
"\n",
"if",
"!",
"ok",
"{",
"return",
"peer",
".",
"ErrTransportHasNoReferenceToPeer",
"{",
"TransportName",
":",
"\"",
"\"",
",",
"PeerIdentifier",
":",
"pid",
".",
"Identifier",
"(",
")",
",",
"}",
"\n",
"}",
"\n\n",
"if",
"err",
":=",
"p",
".",
"Unsubscribe",
"(",
"sub",
")",
";",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n\n",
"if",
"p",
".",
"NumSubscribers",
"(",
")",
"==",
"0",
"{",
"// Release the peer so that the connection retention loop stops.",
"p",
".",
"Release",
"(",
")",
"\n",
"delete",
"(",
"t",
".",
"peers",
",",
"pid",
".",
"Identifier",
"(",
")",
")",
"\n",
"}",
"\n\n",
"return",
"nil",
"\n",
"}"
]
| // ReleasePeer releases a peer from the peer.Subscriber and removes that peer
// from the Transport if nothing is listening to it. | [
"ReleasePeer",
"releases",
"a",
"peer",
"from",
"the",
"peer",
".",
"Subscriber",
"and",
"removes",
"that",
"peer",
"from",
"the",
"Transport",
"if",
"nothing",
"is",
"listening",
"to",
"it",
"."
]
| bd70ffbd17e635243988ba62be97eebff738204d | https://github.com/yarpc/yarpc-go/blob/bd70ffbd17e635243988ba62be97eebff738204d/transport/tchannel/transport.go#L151-L174 |
10,874 | yarpc/yarpc-go | transport/tchannel/transport.go | onPeerStatusChanged | func (t *Transport) onPeerStatusChanged(tp *tchannel.Peer) {
t.lock.Lock()
defer t.lock.Unlock()
p, ok := t.peers[tp.HostPort()]
if !ok {
return
}
p.OnStatusChanged()
} | go | func (t *Transport) onPeerStatusChanged(tp *tchannel.Peer) {
t.lock.Lock()
defer t.lock.Unlock()
p, ok := t.peers[tp.HostPort()]
if !ok {
return
}
p.OnStatusChanged()
} | [
"func",
"(",
"t",
"*",
"Transport",
")",
"onPeerStatusChanged",
"(",
"tp",
"*",
"tchannel",
".",
"Peer",
")",
"{",
"t",
".",
"lock",
".",
"Lock",
"(",
")",
"\n",
"defer",
"t",
".",
"lock",
".",
"Unlock",
"(",
")",
"\n\n",
"p",
",",
"ok",
":=",
"t",
".",
"peers",
"[",
"tp",
".",
"HostPort",
"(",
")",
"]",
"\n",
"if",
"!",
"ok",
"{",
"return",
"\n",
"}",
"\n",
"p",
".",
"OnStatusChanged",
"(",
")",
"\n",
"}"
]
| // onPeerStatusChanged receives notifications from TChannel Channel when any
// peer's status changes. | [
"onPeerStatusChanged",
"receives",
"notifications",
"from",
"TChannel",
"Channel",
"when",
"any",
"peer",
"s",
"status",
"changes",
"."
]
| bd70ffbd17e635243988ba62be97eebff738204d | https://github.com/yarpc/yarpc-go/blob/bd70ffbd17e635243988ba62be97eebff738204d/transport/tchannel/transport.go#L265-L274 |
10,875 | yarpc/yarpc-go | internal/crossdock/thrift/echo/echo_echo.go | Equals | func (v *Echo_Echo_Args) Equals(rhs *Echo_Echo_Args) bool {
if v == nil {
return rhs == nil
} else if rhs == nil {
return false
}
if !((v.Ping == nil && rhs.Ping == nil) || (v.Ping != nil && rhs.Ping != nil && v.Ping.Equals(rhs.Ping))) {
return false
}
return true
} | go | func (v *Echo_Echo_Args) Equals(rhs *Echo_Echo_Args) bool {
if v == nil {
return rhs == nil
} else if rhs == nil {
return false
}
if !((v.Ping == nil && rhs.Ping == nil) || (v.Ping != nil && rhs.Ping != nil && v.Ping.Equals(rhs.Ping))) {
return false
}
return true
} | [
"func",
"(",
"v",
"*",
"Echo_Echo_Args",
")",
"Equals",
"(",
"rhs",
"*",
"Echo_Echo_Args",
")",
"bool",
"{",
"if",
"v",
"==",
"nil",
"{",
"return",
"rhs",
"==",
"nil",
"\n",
"}",
"else",
"if",
"rhs",
"==",
"nil",
"{",
"return",
"false",
"\n",
"}",
"\n",
"if",
"!",
"(",
"(",
"v",
".",
"Ping",
"==",
"nil",
"&&",
"rhs",
".",
"Ping",
"==",
"nil",
")",
"||",
"(",
"v",
".",
"Ping",
"!=",
"nil",
"&&",
"rhs",
".",
"Ping",
"!=",
"nil",
"&&",
"v",
".",
"Ping",
".",
"Equals",
"(",
"rhs",
".",
"Ping",
")",
")",
")",
"{",
"return",
"false",
"\n",
"}",
"\n\n",
"return",
"true",
"\n",
"}"
]
| // Equals returns true if all the fields of this Echo_Echo_Args match the
// provided Echo_Echo_Args.
//
// This function performs a deep comparison. | [
"Equals",
"returns",
"true",
"if",
"all",
"the",
"fields",
"of",
"this",
"Echo_Echo_Args",
"match",
"the",
"provided",
"Echo_Echo_Args",
".",
"This",
"function",
"performs",
"a",
"deep",
"comparison",
"."
]
| bd70ffbd17e635243988ba62be97eebff738204d | https://github.com/yarpc/yarpc-go/blob/bd70ffbd17e635243988ba62be97eebff738204d/internal/crossdock/thrift/echo/echo_echo.go#L140-L151 |
10,876 | yarpc/yarpc-go | internal/crossdock/thrift/echo/echo_echo.go | MarshalLogObject | func (v *Echo_Echo_Args) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
if v == nil {
return nil
}
if v.Ping != nil {
err = multierr.Append(err, enc.AddObject("ping", v.Ping))
}
return err
} | go | func (v *Echo_Echo_Args) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
if v == nil {
return nil
}
if v.Ping != nil {
err = multierr.Append(err, enc.AddObject("ping", v.Ping))
}
return err
} | [
"func",
"(",
"v",
"*",
"Echo_Echo_Args",
")",
"MarshalLogObject",
"(",
"enc",
"zapcore",
".",
"ObjectEncoder",
")",
"(",
"err",
"error",
")",
"{",
"if",
"v",
"==",
"nil",
"{",
"return",
"nil",
"\n",
"}",
"\n",
"if",
"v",
".",
"Ping",
"!=",
"nil",
"{",
"err",
"=",
"multierr",
".",
"Append",
"(",
"err",
",",
"enc",
".",
"AddObject",
"(",
"\"",
"\"",
",",
"v",
".",
"Ping",
")",
")",
"\n",
"}",
"\n",
"return",
"err",
"\n",
"}"
]
| // MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of Echo_Echo_Args. | [
"MarshalLogObject",
"implements",
"zapcore",
".",
"ObjectMarshaler",
"enabling",
"fast",
"logging",
"of",
"Echo_Echo_Args",
"."
]
| bd70ffbd17e635243988ba62be97eebff738204d | https://github.com/yarpc/yarpc-go/blob/bd70ffbd17e635243988ba62be97eebff738204d/internal/crossdock/thrift/echo/echo_echo.go#L155-L163 |
10,877 | yarpc/yarpc-go | internal/crossdock/thrift/echo/echo_echo.go | GetPing | func (v *Echo_Echo_Args) GetPing() (o *Ping) {
if v != nil && v.Ping != nil {
return v.Ping
}
return
} | go | func (v *Echo_Echo_Args) GetPing() (o *Ping) {
if v != nil && v.Ping != nil {
return v.Ping
}
return
} | [
"func",
"(",
"v",
"*",
"Echo_Echo_Args",
")",
"GetPing",
"(",
")",
"(",
"o",
"*",
"Ping",
")",
"{",
"if",
"v",
"!=",
"nil",
"&&",
"v",
".",
"Ping",
"!=",
"nil",
"{",
"return",
"v",
".",
"Ping",
"\n",
"}",
"\n\n",
"return",
"\n",
"}"
]
| // GetPing returns the value of Ping if it is set or its
// zero value if it is unset. | [
"GetPing",
"returns",
"the",
"value",
"of",
"Ping",
"if",
"it",
"is",
"set",
"or",
"its",
"zero",
"value",
"if",
"it",
"is",
"unset",
"."
]
| bd70ffbd17e635243988ba62be97eebff738204d | https://github.com/yarpc/yarpc-go/blob/bd70ffbd17e635243988ba62be97eebff738204d/internal/crossdock/thrift/echo/echo_echo.go#L167-L173 |
10,878 | yarpc/yarpc-go | internal/crossdock/thrift/echo/echo_echo.go | String | func (v *Echo_Echo_Result) String() string {
if v == nil {
return "<nil>"
}
var fields [1]string
i := 0
if v.Success != nil {
fields[i] = fmt.Sprintf("Success: %v", v.Success)
i++
}
return fmt.Sprintf("Echo_Echo_Result{%v}", strings.Join(fields[:i], ", "))
} | go | func (v *Echo_Echo_Result) String() string {
if v == nil {
return "<nil>"
}
var fields [1]string
i := 0
if v.Success != nil {
fields[i] = fmt.Sprintf("Success: %v", v.Success)
i++
}
return fmt.Sprintf("Echo_Echo_Result{%v}", strings.Join(fields[:i], ", "))
} | [
"func",
"(",
"v",
"*",
"Echo_Echo_Result",
")",
"String",
"(",
")",
"string",
"{",
"if",
"v",
"==",
"nil",
"{",
"return",
"\"",
"\"",
"\n",
"}",
"\n\n",
"var",
"fields",
"[",
"1",
"]",
"string",
"\n",
"i",
":=",
"0",
"\n",
"if",
"v",
".",
"Success",
"!=",
"nil",
"{",
"fields",
"[",
"i",
"]",
"=",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"v",
".",
"Success",
")",
"\n",
"i",
"++",
"\n",
"}",
"\n\n",
"return",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"strings",
".",
"Join",
"(",
"fields",
"[",
":",
"i",
"]",
",",
"\"",
"\"",
")",
")",
"\n",
"}"
]
| // String returns a readable string representation of a Echo_Echo_Result
// struct. | [
"String",
"returns",
"a",
"readable",
"string",
"representation",
"of",
"a",
"Echo_Echo_Result",
"struct",
"."
]
| bd70ffbd17e635243988ba62be97eebff738204d | https://github.com/yarpc/yarpc-go/blob/bd70ffbd17e635243988ba62be97eebff738204d/internal/crossdock/thrift/echo/echo_echo.go#L377-L390 |
10,879 | yarpc/yarpc-go | peer/hostport/hostport.go | NewPeer | func NewPeer(pid PeerIdentifier, transport peer.Transport) *Peer {
p := &Peer{
PeerIdentifier: pid,
transport: transport,
subscribers: make(map[peer.Subscriber]struct{}),
}
p.connectionStatus.Store(int32(peer.Unavailable))
return p
} | go | func NewPeer(pid PeerIdentifier, transport peer.Transport) *Peer {
p := &Peer{
PeerIdentifier: pid,
transport: transport,
subscribers: make(map[peer.Subscriber]struct{}),
}
p.connectionStatus.Store(int32(peer.Unavailable))
return p
} | [
"func",
"NewPeer",
"(",
"pid",
"PeerIdentifier",
",",
"transport",
"peer",
".",
"Transport",
")",
"*",
"Peer",
"{",
"p",
":=",
"&",
"Peer",
"{",
"PeerIdentifier",
":",
"pid",
",",
"transport",
":",
"transport",
",",
"subscribers",
":",
"make",
"(",
"map",
"[",
"peer",
".",
"Subscriber",
"]",
"struct",
"{",
"}",
")",
",",
"}",
"\n",
"p",
".",
"connectionStatus",
".",
"Store",
"(",
"int32",
"(",
"peer",
".",
"Unavailable",
")",
")",
"\n",
"return",
"p",
"\n",
"}"
]
| // NewPeer creates a new hostport.Peer from a hostport.PeerIdentifier, peer.Transport, and peer.Subscriber | [
"NewPeer",
"creates",
"a",
"new",
"hostport",
".",
"Peer",
"from",
"a",
"hostport",
".",
"PeerIdentifier",
"peer",
".",
"Transport",
"and",
"peer",
".",
"Subscriber"
]
| bd70ffbd17e635243988ba62be97eebff738204d | https://github.com/yarpc/yarpc-go/blob/bd70ffbd17e635243988ba62be97eebff738204d/peer/hostport/hostport.go#L44-L52 |
10,880 | yarpc/yarpc-go | peer/hostport/hostport.go | Subscribe | func (p *Peer) Subscribe(sub peer.Subscriber) {
p.lock.Lock()
p.subscribers[sub] = struct{}{}
p.lock.Unlock()
} | go | func (p *Peer) Subscribe(sub peer.Subscriber) {
p.lock.Lock()
p.subscribers[sub] = struct{}{}
p.lock.Unlock()
} | [
"func",
"(",
"p",
"*",
"Peer",
")",
"Subscribe",
"(",
"sub",
"peer",
".",
"Subscriber",
")",
"{",
"p",
".",
"lock",
".",
"Lock",
"(",
")",
"\n",
"p",
".",
"subscribers",
"[",
"sub",
"]",
"=",
"struct",
"{",
"}",
"{",
"}",
"\n",
"p",
".",
"lock",
".",
"Unlock",
"(",
")",
"\n",
"}"
]
| // Subscribe adds a subscriber to the peer's subscriber map | [
"Subscribe",
"adds",
"a",
"subscriber",
"to",
"the",
"peer",
"s",
"subscriber",
"map"
]
| bd70ffbd17e635243988ba62be97eebff738204d | https://github.com/yarpc/yarpc-go/blob/bd70ffbd17e635243988ba62be97eebff738204d/peer/hostport/hostport.go#L78-L82 |
10,881 | yarpc/yarpc-go | peer/hostport/hostport.go | Unsubscribe | func (p *Peer) Unsubscribe(sub peer.Subscriber) error {
p.lock.Lock()
defer p.lock.Unlock()
if _, ok := p.subscribers[sub]; !ok {
return peer.ErrPeerHasNoReferenceToSubscriber{
PeerIdentifier: p.PeerIdentifier,
PeerSubscriber: sub,
}
}
delete(p.subscribers, sub)
return nil
} | go | func (p *Peer) Unsubscribe(sub peer.Subscriber) error {
p.lock.Lock()
defer p.lock.Unlock()
if _, ok := p.subscribers[sub]; !ok {
return peer.ErrPeerHasNoReferenceToSubscriber{
PeerIdentifier: p.PeerIdentifier,
PeerSubscriber: sub,
}
}
delete(p.subscribers, sub)
return nil
} | [
"func",
"(",
"p",
"*",
"Peer",
")",
"Unsubscribe",
"(",
"sub",
"peer",
".",
"Subscriber",
")",
"error",
"{",
"p",
".",
"lock",
".",
"Lock",
"(",
")",
"\n",
"defer",
"p",
".",
"lock",
".",
"Unlock",
"(",
")",
"\n",
"if",
"_",
",",
"ok",
":=",
"p",
".",
"subscribers",
"[",
"sub",
"]",
";",
"!",
"ok",
"{",
"return",
"peer",
".",
"ErrPeerHasNoReferenceToSubscriber",
"{",
"PeerIdentifier",
":",
"p",
".",
"PeerIdentifier",
",",
"PeerSubscriber",
":",
"sub",
",",
"}",
"\n",
"}",
"\n\n",
"delete",
"(",
"p",
".",
"subscribers",
",",
"sub",
")",
"\n",
"return",
"nil",
"\n",
"}"
]
| // Unsubscribe removes a subscriber from the peer's subscriber map | [
"Unsubscribe",
"removes",
"a",
"subscriber",
"from",
"the",
"peer",
"s",
"subscriber",
"map"
]
| bd70ffbd17e635243988ba62be97eebff738204d | https://github.com/yarpc/yarpc-go/blob/bd70ffbd17e635243988ba62be97eebff738204d/peer/hostport/hostport.go#L85-L97 |
10,882 | yarpc/yarpc-go | peer/hostport/hostport.go | NumSubscribers | func (p *Peer) NumSubscribers() int {
p.lock.RLock()
subs := len(p.subscribers)
p.lock.RUnlock()
return subs
} | go | func (p *Peer) NumSubscribers() int {
p.lock.RLock()
subs := len(p.subscribers)
p.lock.RUnlock()
return subs
} | [
"func",
"(",
"p",
"*",
"Peer",
")",
"NumSubscribers",
"(",
")",
"int",
"{",
"p",
".",
"lock",
".",
"RLock",
"(",
")",
"\n",
"subs",
":=",
"len",
"(",
"p",
".",
"subscribers",
")",
"\n",
"p",
".",
"lock",
".",
"RUnlock",
"(",
")",
"\n",
"return",
"subs",
"\n",
"}"
]
| // NumSubscribers returns the number of subscriptions attached to the peer | [
"NumSubscribers",
"returns",
"the",
"number",
"of",
"subscriptions",
"attached",
"to",
"the",
"peer"
]
| bd70ffbd17e635243988ba62be97eebff738204d | https://github.com/yarpc/yarpc-go/blob/bd70ffbd17e635243988ba62be97eebff738204d/peer/hostport/hostport.go#L100-L105 |
10,883 | yarpc/yarpc-go | peer/hostport/hostport.go | Status | func (p *Peer) Status() peer.Status {
return peer.Status{
PendingRequestCount: int(p.pending.Load()),
ConnectionStatus: peer.ConnectionStatus(p.connectionStatus.Load()),
}
} | go | func (p *Peer) Status() peer.Status {
return peer.Status{
PendingRequestCount: int(p.pending.Load()),
ConnectionStatus: peer.ConnectionStatus(p.connectionStatus.Load()),
}
} | [
"func",
"(",
"p",
"*",
"Peer",
")",
"Status",
"(",
")",
"peer",
".",
"Status",
"{",
"return",
"peer",
".",
"Status",
"{",
"PendingRequestCount",
":",
"int",
"(",
"p",
".",
"pending",
".",
"Load",
"(",
")",
")",
",",
"ConnectionStatus",
":",
"peer",
".",
"ConnectionStatus",
"(",
"p",
".",
"connectionStatus",
".",
"Load",
"(",
")",
")",
",",
"}",
"\n",
"}"
]
| // Status returns the current status of the hostport.Peer | [
"Status",
"returns",
"the",
"current",
"status",
"of",
"the",
"hostport",
".",
"Peer"
]
| bd70ffbd17e635243988ba62be97eebff738204d | https://github.com/yarpc/yarpc-go/blob/bd70ffbd17e635243988ba62be97eebff738204d/peer/hostport/hostport.go#L108-L113 |
10,884 | yarpc/yarpc-go | internal/crossdock/client/tchserver/behavior.go | Run | func Run(t crossdock.T) {
fatals := crossdock.Fatals(t)
encoding := t.Param(params.Encoding)
server := t.Param(params.Server)
serverHostPort := fmt.Sprintf("%v:%v", server, serverPort)
tchannelTransport, err := tchannel.NewChannelTransport(tchannel.ServiceName("yarpc-client"))
fatals.NoError(err, "Failed to build ChannelTransport")
dispatcher := yarpc.NewDispatcher(yarpc.Config{
Name: "yarpc-client",
Outbounds: yarpc.Outbounds{
serverName: {
Unary: tchannelTransport.NewSingleOutbound(serverHostPort),
},
},
})
fatals.NoError(dispatcher.Start(), "could not start Dispatcher")
defer dispatcher.Stop()
switch encoding {
case "raw":
runRaw(t, dispatcher)
case "json":
runJSON(t, dispatcher)
case "thrift":
runThrift(t, dispatcher)
default:
fatals.Fail("", "unknown encoding %q", encoding)
}
} | go | func Run(t crossdock.T) {
fatals := crossdock.Fatals(t)
encoding := t.Param(params.Encoding)
server := t.Param(params.Server)
serverHostPort := fmt.Sprintf("%v:%v", server, serverPort)
tchannelTransport, err := tchannel.NewChannelTransport(tchannel.ServiceName("yarpc-client"))
fatals.NoError(err, "Failed to build ChannelTransport")
dispatcher := yarpc.NewDispatcher(yarpc.Config{
Name: "yarpc-client",
Outbounds: yarpc.Outbounds{
serverName: {
Unary: tchannelTransport.NewSingleOutbound(serverHostPort),
},
},
})
fatals.NoError(dispatcher.Start(), "could not start Dispatcher")
defer dispatcher.Stop()
switch encoding {
case "raw":
runRaw(t, dispatcher)
case "json":
runJSON(t, dispatcher)
case "thrift":
runThrift(t, dispatcher)
default:
fatals.Fail("", "unknown encoding %q", encoding)
}
} | [
"func",
"Run",
"(",
"t",
"crossdock",
".",
"T",
")",
"{",
"fatals",
":=",
"crossdock",
".",
"Fatals",
"(",
"t",
")",
"\n\n",
"encoding",
":=",
"t",
".",
"Param",
"(",
"params",
".",
"Encoding",
")",
"\n",
"server",
":=",
"t",
".",
"Param",
"(",
"params",
".",
"Server",
")",
"\n",
"serverHostPort",
":=",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"server",
",",
"serverPort",
")",
"\n\n",
"tchannelTransport",
",",
"err",
":=",
"tchannel",
".",
"NewChannelTransport",
"(",
"tchannel",
".",
"ServiceName",
"(",
"\"",
"\"",
")",
")",
"\n",
"fatals",
".",
"NoError",
"(",
"err",
",",
"\"",
"\"",
")",
"\n\n",
"dispatcher",
":=",
"yarpc",
".",
"NewDispatcher",
"(",
"yarpc",
".",
"Config",
"{",
"Name",
":",
"\"",
"\"",
",",
"Outbounds",
":",
"yarpc",
".",
"Outbounds",
"{",
"serverName",
":",
"{",
"Unary",
":",
"tchannelTransport",
".",
"NewSingleOutbound",
"(",
"serverHostPort",
")",
",",
"}",
",",
"}",
",",
"}",
")",
"\n",
"fatals",
".",
"NoError",
"(",
"dispatcher",
".",
"Start",
"(",
")",
",",
"\"",
"\"",
")",
"\n",
"defer",
"dispatcher",
".",
"Stop",
"(",
")",
"\n\n",
"switch",
"encoding",
"{",
"case",
"\"",
"\"",
":",
"runRaw",
"(",
"t",
",",
"dispatcher",
")",
"\n",
"case",
"\"",
"\"",
":",
"runJSON",
"(",
"t",
",",
"dispatcher",
")",
"\n",
"case",
"\"",
"\"",
":",
"runThrift",
"(",
"t",
",",
"dispatcher",
")",
"\n",
"default",
":",
"fatals",
".",
"Fail",
"(",
"\"",
"\"",
",",
"\"",
"\"",
",",
"encoding",
")",
"\n",
"}",
"\n",
"}"
]
| // Run exercises a YARPC client against a tchannel server. | [
"Run",
"exercises",
"a",
"YARPC",
"client",
"against",
"a",
"tchannel",
"server",
"."
]
| bd70ffbd17e635243988ba62be97eebff738204d | https://github.com/yarpc/yarpc-go/blob/bd70ffbd17e635243988ba62be97eebff738204d/internal/crossdock/client/tchserver/behavior.go#L38-L69 |
10,885 | yarpc/yarpc-go | transport/grpc/outbound.go | checkServiceMatch | func checkServiceMatch(reqSvcName string, responseMD metadata.MD) (bool, string) {
if resSvcName, ok := responseMD[ServiceHeader]; ok {
return reqSvcName == resSvcName[0], resSvcName[0]
}
return true, ""
} | go | func checkServiceMatch(reqSvcName string, responseMD metadata.MD) (bool, string) {
if resSvcName, ok := responseMD[ServiceHeader]; ok {
return reqSvcName == resSvcName[0], resSvcName[0]
}
return true, ""
} | [
"func",
"checkServiceMatch",
"(",
"reqSvcName",
"string",
",",
"responseMD",
"metadata",
".",
"MD",
")",
"(",
"bool",
",",
"string",
")",
"{",
"if",
"resSvcName",
",",
"ok",
":=",
"responseMD",
"[",
"ServiceHeader",
"]",
";",
"ok",
"{",
"return",
"reqSvcName",
"==",
"resSvcName",
"[",
"0",
"]",
",",
"resSvcName",
"[",
"0",
"]",
"\n",
"}",
"\n",
"return",
"true",
",",
"\"",
"\"",
"\n",
"}"
]
| // Only does verification when there is a response service header key | [
"Only",
"does",
"verification",
"when",
"there",
"is",
"a",
"response",
"service",
"header",
"key"
]
| bd70ffbd17e635243988ba62be97eebff738204d | https://github.com/yarpc/yarpc-go/blob/bd70ffbd17e635243988ba62be97eebff738204d/transport/grpc/outbound.go#L315-L320 |
10,886 | yarpc/yarpc-go | api/encoding/call.go | CallFromContext | func CallFromContext(ctx context.Context) *Call {
if ic, ok := getInboundCall(ctx); ok {
return &Call{ic}
}
return nil
} | go | func CallFromContext(ctx context.Context) *Call {
if ic, ok := getInboundCall(ctx); ok {
return &Call{ic}
}
return nil
} | [
"func",
"CallFromContext",
"(",
"ctx",
"context",
".",
"Context",
")",
"*",
"Call",
"{",
"if",
"ic",
",",
"ok",
":=",
"getInboundCall",
"(",
"ctx",
")",
";",
"ok",
"{",
"return",
"&",
"Call",
"{",
"ic",
"}",
"\n",
"}",
"\n",
"return",
"nil",
"\n",
"}"
]
| // CallFromContext retrieves information about the current incoming request
// from the given context. Returns nil if the context is not a valid request
// context.
//
// The object is valid only as long as the request is ongoing. | [
"CallFromContext",
"retrieves",
"information",
"about",
"the",
"current",
"incoming",
"request",
"from",
"the",
"given",
"context",
".",
"Returns",
"nil",
"if",
"the",
"context",
"is",
"not",
"a",
"valid",
"request",
"context",
".",
"The",
"object",
"is",
"valid",
"only",
"as",
"long",
"as",
"the",
"request",
"is",
"ongoing",
"."
]
| bd70ffbd17e635243988ba62be97eebff738204d | https://github.com/yarpc/yarpc-go/blob/bd70ffbd17e635243988ba62be97eebff738204d/api/encoding/call.go#L41-L46 |
10,887 | yarpc/yarpc-go | api/encoding/call.go | Caller | func (c *Call) Caller() string {
if c == nil {
return ""
}
return c.ic.req.Caller
} | go | func (c *Call) Caller() string {
if c == nil {
return ""
}
return c.ic.req.Caller
} | [
"func",
"(",
"c",
"*",
"Call",
")",
"Caller",
"(",
")",
"string",
"{",
"if",
"c",
"==",
"nil",
"{",
"return",
"\"",
"\"",
"\n",
"}",
"\n",
"return",
"c",
".",
"ic",
".",
"req",
".",
"Caller",
"\n",
"}"
]
| // Caller returns the name of the service making this request. | [
"Caller",
"returns",
"the",
"name",
"of",
"the",
"service",
"making",
"this",
"request",
"."
]
| bd70ffbd17e635243988ba62be97eebff738204d | https://github.com/yarpc/yarpc-go/blob/bd70ffbd17e635243988ba62be97eebff738204d/api/encoding/call.go#L63-L68 |
10,888 | yarpc/yarpc-go | api/encoding/call.go | Service | func (c *Call) Service() string {
if c == nil {
return ""
}
return c.ic.req.Service
} | go | func (c *Call) Service() string {
if c == nil {
return ""
}
return c.ic.req.Service
} | [
"func",
"(",
"c",
"*",
"Call",
")",
"Service",
"(",
")",
"string",
"{",
"if",
"c",
"==",
"nil",
"{",
"return",
"\"",
"\"",
"\n",
"}",
"\n",
"return",
"c",
".",
"ic",
".",
"req",
".",
"Service",
"\n",
"}"
]
| // Service returns the name of the service being called. | [
"Service",
"returns",
"the",
"name",
"of",
"the",
"service",
"being",
"called",
"."
]
| bd70ffbd17e635243988ba62be97eebff738204d | https://github.com/yarpc/yarpc-go/blob/bd70ffbd17e635243988ba62be97eebff738204d/api/encoding/call.go#L71-L76 |
10,889 | yarpc/yarpc-go | api/encoding/call.go | Transport | func (c *Call) Transport() string {
if c == nil {
return ""
}
return c.ic.req.Transport
} | go | func (c *Call) Transport() string {
if c == nil {
return ""
}
return c.ic.req.Transport
} | [
"func",
"(",
"c",
"*",
"Call",
")",
"Transport",
"(",
")",
"string",
"{",
"if",
"c",
"==",
"nil",
"{",
"return",
"\"",
"\"",
"\n",
"}",
"\n",
"return",
"c",
".",
"ic",
".",
"req",
".",
"Transport",
"\n",
"}"
]
| // Transport returns the name of the transport being called. | [
"Transport",
"returns",
"the",
"name",
"of",
"the",
"transport",
"being",
"called",
"."
]
| bd70ffbd17e635243988ba62be97eebff738204d | https://github.com/yarpc/yarpc-go/blob/bd70ffbd17e635243988ba62be97eebff738204d/api/encoding/call.go#L79-L84 |
10,890 | yarpc/yarpc-go | api/encoding/call.go | Procedure | func (c *Call) Procedure() string {
if c == nil {
return ""
}
return c.ic.req.Procedure
} | go | func (c *Call) Procedure() string {
if c == nil {
return ""
}
return c.ic.req.Procedure
} | [
"func",
"(",
"c",
"*",
"Call",
")",
"Procedure",
"(",
")",
"string",
"{",
"if",
"c",
"==",
"nil",
"{",
"return",
"\"",
"\"",
"\n",
"}",
"\n",
"return",
"c",
".",
"ic",
".",
"req",
".",
"Procedure",
"\n",
"}"
]
| // Procedure returns the name of the procedure being called. | [
"Procedure",
"returns",
"the",
"name",
"of",
"the",
"procedure",
"being",
"called",
"."
]
| bd70ffbd17e635243988ba62be97eebff738204d | https://github.com/yarpc/yarpc-go/blob/bd70ffbd17e635243988ba62be97eebff738204d/api/encoding/call.go#L87-L92 |
10,891 | yarpc/yarpc-go | api/encoding/call.go | Encoding | func (c *Call) Encoding() transport.Encoding {
if c == nil {
return ""
}
return c.ic.req.Encoding
} | go | func (c *Call) Encoding() transport.Encoding {
if c == nil {
return ""
}
return c.ic.req.Encoding
} | [
"func",
"(",
"c",
"*",
"Call",
")",
"Encoding",
"(",
")",
"transport",
".",
"Encoding",
"{",
"if",
"c",
"==",
"nil",
"{",
"return",
"\"",
"\"",
"\n",
"}",
"\n",
"return",
"c",
".",
"ic",
".",
"req",
".",
"Encoding",
"\n",
"}"
]
| // Encoding returns the encoding for this request. | [
"Encoding",
"returns",
"the",
"encoding",
"for",
"this",
"request",
"."
]
| bd70ffbd17e635243988ba62be97eebff738204d | https://github.com/yarpc/yarpc-go/blob/bd70ffbd17e635243988ba62be97eebff738204d/api/encoding/call.go#L95-L100 |
10,892 | yarpc/yarpc-go | api/encoding/call.go | HeaderNames | func (c *Call) HeaderNames() []string {
if c == nil {
return nil
}
var names []string
for k := range c.ic.req.Headers.Items() {
names = append(names, k)
}
sort.Strings(names)
return names
} | go | func (c *Call) HeaderNames() []string {
if c == nil {
return nil
}
var names []string
for k := range c.ic.req.Headers.Items() {
names = append(names, k)
}
sort.Strings(names)
return names
} | [
"func",
"(",
"c",
"*",
"Call",
")",
"HeaderNames",
"(",
")",
"[",
"]",
"string",
"{",
"if",
"c",
"==",
"nil",
"{",
"return",
"nil",
"\n",
"}",
"\n\n",
"var",
"names",
"[",
"]",
"string",
"\n",
"for",
"k",
":=",
"range",
"c",
".",
"ic",
".",
"req",
".",
"Headers",
".",
"Items",
"(",
")",
"{",
"names",
"=",
"append",
"(",
"names",
",",
"k",
")",
"\n",
"}",
"\n",
"sort",
".",
"Strings",
"(",
"names",
")",
"\n",
"return",
"names",
"\n",
"}"
]
| // HeaderNames returns a sorted list of the names of user defined headers
// provided with this request. | [
"HeaderNames",
"returns",
"a",
"sorted",
"list",
"of",
"the",
"names",
"of",
"user",
"defined",
"headers",
"provided",
"with",
"this",
"request",
"."
]
| bd70ffbd17e635243988ba62be97eebff738204d | https://github.com/yarpc/yarpc-go/blob/bd70ffbd17e635243988ba62be97eebff738204d/api/encoding/call.go#L118-L129 |
10,893 | yarpc/yarpc-go | api/encoding/call.go | ShardKey | func (c *Call) ShardKey() string {
if c == nil {
return ""
}
return c.ic.req.ShardKey
} | go | func (c *Call) ShardKey() string {
if c == nil {
return ""
}
return c.ic.req.ShardKey
} | [
"func",
"(",
"c",
"*",
"Call",
")",
"ShardKey",
"(",
")",
"string",
"{",
"if",
"c",
"==",
"nil",
"{",
"return",
"\"",
"\"",
"\n",
"}",
"\n",
"return",
"c",
".",
"ic",
".",
"req",
".",
"ShardKey",
"\n",
"}"
]
| // ShardKey returns the shard key for this request. | [
"ShardKey",
"returns",
"the",
"shard",
"key",
"for",
"this",
"request",
"."
]
| bd70ffbd17e635243988ba62be97eebff738204d | https://github.com/yarpc/yarpc-go/blob/bd70ffbd17e635243988ba62be97eebff738204d/api/encoding/call.go#L132-L137 |
10,894 | yarpc/yarpc-go | api/encoding/call.go | RoutingKey | func (c *Call) RoutingKey() string {
if c == nil {
return ""
}
return c.ic.req.RoutingKey
} | go | func (c *Call) RoutingKey() string {
if c == nil {
return ""
}
return c.ic.req.RoutingKey
} | [
"func",
"(",
"c",
"*",
"Call",
")",
"RoutingKey",
"(",
")",
"string",
"{",
"if",
"c",
"==",
"nil",
"{",
"return",
"\"",
"\"",
"\n",
"}",
"\n",
"return",
"c",
".",
"ic",
".",
"req",
".",
"RoutingKey",
"\n",
"}"
]
| // RoutingKey returns the routing key for this request. | [
"RoutingKey",
"returns",
"the",
"routing",
"key",
"for",
"this",
"request",
"."
]
| bd70ffbd17e635243988ba62be97eebff738204d | https://github.com/yarpc/yarpc-go/blob/bd70ffbd17e635243988ba62be97eebff738204d/api/encoding/call.go#L140-L145 |
10,895 | yarpc/yarpc-go | api/encoding/call.go | RoutingDelegate | func (c *Call) RoutingDelegate() string {
if c == nil {
return ""
}
return c.ic.req.RoutingDelegate
} | go | func (c *Call) RoutingDelegate() string {
if c == nil {
return ""
}
return c.ic.req.RoutingDelegate
} | [
"func",
"(",
"c",
"*",
"Call",
")",
"RoutingDelegate",
"(",
")",
"string",
"{",
"if",
"c",
"==",
"nil",
"{",
"return",
"\"",
"\"",
"\n",
"}",
"\n",
"return",
"c",
".",
"ic",
".",
"req",
".",
"RoutingDelegate",
"\n",
"}"
]
| // RoutingDelegate returns the routing delegate for this request. | [
"RoutingDelegate",
"returns",
"the",
"routing",
"delegate",
"for",
"this",
"request",
"."
]
| bd70ffbd17e635243988ba62be97eebff738204d | https://github.com/yarpc/yarpc-go/blob/bd70ffbd17e635243988ba62be97eebff738204d/api/encoding/call.go#L148-L153 |
10,896 | yarpc/yarpc-go | internal/crossdock/client/timeout/behavior.go | Run | func Run(t crossdock.T) {
assert := crossdock.Assert(t)
fatals := crossdock.Fatals(t)
ctx, cancel := context.WithTimeout(context.Background(), 100*time.Millisecond)
defer cancel()
dispatcher := disp.Create(t)
fatals.NoError(dispatcher.Start(), "could not start Dispatcher")
defer dispatcher.Stop()
client := raw.New(dispatcher.ClientConfig("yarpc-test"))
_, err := client.Call(ctx, "sleep/raw", nil)
fatals.Error(err, "expected a failure for timeout")
if yarpcerrors.FromError(err).Code() == yarpcerrors.CodeInvalidArgument {
t.Skipf("sleep/raw method not implemented: %v", err)
return
}
assert.Equal(yarpcerrors.CodeDeadlineExceeded, yarpcerrors.FromError(err).Code(), "is an error with code CodeDeadlineExceeded: %v", err)
} | go | func Run(t crossdock.T) {
assert := crossdock.Assert(t)
fatals := crossdock.Fatals(t)
ctx, cancel := context.WithTimeout(context.Background(), 100*time.Millisecond)
defer cancel()
dispatcher := disp.Create(t)
fatals.NoError(dispatcher.Start(), "could not start Dispatcher")
defer dispatcher.Stop()
client := raw.New(dispatcher.ClientConfig("yarpc-test"))
_, err := client.Call(ctx, "sleep/raw", nil)
fatals.Error(err, "expected a failure for timeout")
if yarpcerrors.FromError(err).Code() == yarpcerrors.CodeInvalidArgument {
t.Skipf("sleep/raw method not implemented: %v", err)
return
}
assert.Equal(yarpcerrors.CodeDeadlineExceeded, yarpcerrors.FromError(err).Code(), "is an error with code CodeDeadlineExceeded: %v", err)
} | [
"func",
"Run",
"(",
"t",
"crossdock",
".",
"T",
")",
"{",
"assert",
":=",
"crossdock",
".",
"Assert",
"(",
"t",
")",
"\n",
"fatals",
":=",
"crossdock",
".",
"Fatals",
"(",
"t",
")",
"\n\n",
"ctx",
",",
"cancel",
":=",
"context",
".",
"WithTimeout",
"(",
"context",
".",
"Background",
"(",
")",
",",
"100",
"*",
"time",
".",
"Millisecond",
")",
"\n",
"defer",
"cancel",
"(",
")",
"\n\n",
"dispatcher",
":=",
"disp",
".",
"Create",
"(",
"t",
")",
"\n",
"fatals",
".",
"NoError",
"(",
"dispatcher",
".",
"Start",
"(",
")",
",",
"\"",
"\"",
")",
"\n",
"defer",
"dispatcher",
".",
"Stop",
"(",
")",
"\n\n",
"client",
":=",
"raw",
".",
"New",
"(",
"dispatcher",
".",
"ClientConfig",
"(",
"\"",
"\"",
")",
")",
"\n",
"_",
",",
"err",
":=",
"client",
".",
"Call",
"(",
"ctx",
",",
"\"",
"\"",
",",
"nil",
")",
"\n",
"fatals",
".",
"Error",
"(",
"err",
",",
"\"",
"\"",
")",
"\n\n",
"if",
"yarpcerrors",
".",
"FromError",
"(",
"err",
")",
".",
"Code",
"(",
")",
"==",
"yarpcerrors",
".",
"CodeInvalidArgument",
"{",
"t",
".",
"Skipf",
"(",
"\"",
"\"",
",",
"err",
")",
"\n",
"return",
"\n",
"}",
"\n\n",
"assert",
".",
"Equal",
"(",
"yarpcerrors",
".",
"CodeDeadlineExceeded",
",",
"yarpcerrors",
".",
"FromError",
"(",
"err",
")",
".",
"Code",
"(",
")",
",",
"\"",
"\"",
",",
"err",
")",
"\n",
"}"
]
| // Run tests if a yarpc client returns correctly a client timeout error behind
// the TimeoutError interface when the context deadline is reached while the
// server is taking too long to respond. | [
"Run",
"tests",
"if",
"a",
"yarpc",
"client",
"returns",
"correctly",
"a",
"client",
"timeout",
"error",
"behind",
"the",
"TimeoutError",
"interface",
"when",
"the",
"context",
"deadline",
"is",
"reached",
"while",
"the",
"server",
"is",
"taking",
"too",
"long",
"to",
"respond",
"."
]
| bd70ffbd17e635243988ba62be97eebff738204d | https://github.com/yarpc/yarpc-go/blob/bd70ffbd17e635243988ba62be97eebff738204d/internal/crossdock/client/timeout/behavior.go#L36-L57 |
10,897 | yarpc/yarpc-go | transport/http/transport.go | KeepAlive | func KeepAlive(t time.Duration) TransportOption {
return func(options *transportOptions) {
options.keepAlive = t
}
} | go | func KeepAlive(t time.Duration) TransportOption {
return func(options *transportOptions) {
options.keepAlive = t
}
} | [
"func",
"KeepAlive",
"(",
"t",
"time",
".",
"Duration",
")",
"TransportOption",
"{",
"return",
"func",
"(",
"options",
"*",
"transportOptions",
")",
"{",
"options",
".",
"keepAlive",
"=",
"t",
"\n",
"}",
"\n",
"}"
]
| // KeepAlive specifies the keep-alive period for the network connection. If
// zero, keep-alives are disabled.
//
// Defaults to 30 seconds. | [
"KeepAlive",
"specifies",
"the",
"keep",
"-",
"alive",
"period",
"for",
"the",
"network",
"connection",
".",
"If",
"zero",
"keep",
"-",
"alives",
"are",
"disabled",
".",
"Defaults",
"to",
"30",
"seconds",
"."
]
| bd70ffbd17e635243988ba62be97eebff738204d | https://github.com/yarpc/yarpc-go/blob/bd70ffbd17e635243988ba62be97eebff738204d/transport/http/transport.go#L81-L85 |
10,898 | yarpc/yarpc-go | transport/http/transport.go | InnocenceWindow | func InnocenceWindow(d time.Duration) TransportOption {
return func(options *transportOptions) {
options.innocenceWindow = d
}
} | go | func InnocenceWindow(d time.Duration) TransportOption {
return func(options *transportOptions) {
options.innocenceWindow = d
}
} | [
"func",
"InnocenceWindow",
"(",
"d",
"time",
".",
"Duration",
")",
"TransportOption",
"{",
"return",
"func",
"(",
"options",
"*",
"transportOptions",
")",
"{",
"options",
".",
"innocenceWindow",
"=",
"d",
"\n",
"}",
"\n",
"}"
]
| // InnocenceWindow is the duration after the peer connection management loop
// will suspend suspicion for a peer after successfully checking whether the
// peer is live with a fresh TCP connection.
//
// The default innocence window is 5 seconds.
//
// A timeout does not necessarily indicate that a peer is unavailable,
// but it could indicate that the connection is half-open, that the peer died
// without sending a TCP FIN packet.
// In this case, the peer connection management loop attempts to open a TCP
// connection in the background, once per innocence window, while suspicious of
// the connection, leaving the peer available until it fails. | [
"InnocenceWindow",
"is",
"the",
"duration",
"after",
"the",
"peer",
"connection",
"management",
"loop",
"will",
"suspend",
"suspicion",
"for",
"a",
"peer",
"after",
"successfully",
"checking",
"whether",
"the",
"peer",
"is",
"live",
"with",
"a",
"fresh",
"TCP",
"connection",
".",
"The",
"default",
"innocence",
"window",
"is",
"5",
"seconds",
".",
"A",
"timeout",
"does",
"not",
"necessarily",
"indicate",
"that",
"a",
"peer",
"is",
"unavailable",
"but",
"it",
"could",
"indicate",
"that",
"the",
"connection",
"is",
"half",
"-",
"open",
"that",
"the",
"peer",
"died",
"without",
"sending",
"a",
"TCP",
"FIN",
"packet",
".",
"In",
"this",
"case",
"the",
"peer",
"connection",
"management",
"loop",
"attempts",
"to",
"open",
"a",
"TCP",
"connection",
"in",
"the",
"background",
"once",
"per",
"innocence",
"window",
"while",
"suspicious",
"of",
"the",
"connection",
"leaving",
"the",
"peer",
"available",
"until",
"it",
"fails",
"."
]
| bd70ffbd17e635243988ba62be97eebff738204d | https://github.com/yarpc/yarpc-go/blob/bd70ffbd17e635243988ba62be97eebff738204d/transport/http/transport.go#L180-L184 |
10,899 | yarpc/yarpc-go | transport/http/transport.go | Tracer | func Tracer(tracer opentracing.Tracer) TransportOption {
return func(options *transportOptions) {
options.tracer = tracer
}
} | go | func Tracer(tracer opentracing.Tracer) TransportOption {
return func(options *transportOptions) {
options.tracer = tracer
}
} | [
"func",
"Tracer",
"(",
"tracer",
"opentracing",
".",
"Tracer",
")",
"TransportOption",
"{",
"return",
"func",
"(",
"options",
"*",
"transportOptions",
")",
"{",
"options",
".",
"tracer",
"=",
"tracer",
"\n",
"}",
"\n",
"}"
]
| // Tracer configures a tracer for the transport and all its inbounds and
// outbounds. | [
"Tracer",
"configures",
"a",
"tracer",
"for",
"the",
"transport",
"and",
"all",
"its",
"inbounds",
"and",
"outbounds",
"."
]
| bd70ffbd17e635243988ba62be97eebff738204d | https://github.com/yarpc/yarpc-go/blob/bd70ffbd17e635243988ba62be97eebff738204d/transport/http/transport.go#L188-L192 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.