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 list | docstring stringlengths 6 2.61k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 85 252 | partition stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|---|
algolia/algoliasearch-client-go | algolia/search/index.go | Delete | func (i *Index) Delete(opts ...interface{}) (res DeleteTaskRes, err error) {
path := i.path("")
err = i.transport.Request(&res, http.MethodDelete, path, nil, call.Write, opts...)
res.wait = i.WaitTask
return
} | go | func (i *Index) Delete(opts ...interface{}) (res DeleteTaskRes, err error) {
path := i.path("")
err = i.transport.Request(&res, http.MethodDelete, path, nil, call.Write, opts...)
res.wait = i.WaitTask
return
} | [
"func",
"(",
"i",
"*",
"Index",
")",
"Delete",
"(",
"opts",
"...",
"interface",
"{",
"}",
")",
"(",
"res",
"DeleteTaskRes",
",",
"err",
"error",
")",
"{",
"path",
":=",
"i",
".",
"path",
"(",
"\"",
"\"",
")",
"\n",
"err",
"=",
"i",
".",
"transp... | // Delete removes the entire index. After this call, new indexing calls can be
// sent with the same index instance. | [
"Delete",
"removes",
"the",
"entire",
"index",
".",
"After",
"this",
"call",
"new",
"indexing",
"calls",
"can",
"be",
"sent",
"with",
"the",
"same",
"index",
"instance",
"."
] | dc059c0414d8c06e2b2bb47412b2130799bfcc9f | https://github.com/algolia/algoliasearch-client-go/blob/dc059c0414d8c06e2b2bb47412b2130799bfcc9f/algolia/search/index.go#L85-L90 | train |
algolia/algoliasearch-client-go | algolia/search/index.go | GetStatus | func (i *Index) GetStatus(taskID int) (res TaskStatusRes, err error) {
path := i.path("/task/%d", taskID)
err = i.transport.Request(&res, http.MethodGet, path, nil, call.Read)
return
} | go | func (i *Index) GetStatus(taskID int) (res TaskStatusRes, err error) {
path := i.path("/task/%d", taskID)
err = i.transport.Request(&res, http.MethodGet, path, nil, call.Read)
return
} | [
"func",
"(",
"i",
"*",
"Index",
")",
"GetStatus",
"(",
"taskID",
"int",
")",
"(",
"res",
"TaskStatusRes",
",",
"err",
"error",
")",
"{",
"path",
":=",
"i",
".",
"path",
"(",
"\"",
"\"",
",",
"taskID",
")",
"\n",
"err",
"=",
"i",
".",
"transport",... | // GetStatus retrieves the task status according to the Algolia engine for the
// given task. | [
"GetStatus",
"retrieves",
"the",
"task",
"status",
"according",
"to",
"the",
"Algolia",
"engine",
"for",
"the",
"given",
"task",
"."
] | dc059c0414d8c06e2b2bb47412b2130799bfcc9f | https://github.com/algolia/algoliasearch-client-go/blob/dc059c0414d8c06e2b2bb47412b2130799bfcc9f/algolia/search/index.go#L94-L98 | train |
algolia/algoliasearch-client-go | algolia/iterator/iterator.go | New | func New(itf interface{}) Iterator {
// First, if the given interface already is an iterator.Iterator,
// we return it as-is.
if it, ok := itf.(Iterator); ok {
return it
}
value := reflect.ValueOf(itf)
switch value.Kind() {
case reflect.Array, reflect.Slice:
// In case the objects are sent as a slice or an ... | go | func New(itf interface{}) Iterator {
// First, if the given interface already is an iterator.Iterator,
// we return it as-is.
if it, ok := itf.(Iterator); ok {
return it
}
value := reflect.ValueOf(itf)
switch value.Kind() {
case reflect.Array, reflect.Slice:
// In case the objects are sent as a slice or an ... | [
"func",
"New",
"(",
"itf",
"interface",
"{",
"}",
")",
"Iterator",
"{",
"// First, if the given interface already is an iterator.Iterator,",
"// we return it as-is.",
"if",
"it",
",",
"ok",
":=",
"itf",
".",
"(",
"Iterator",
")",
";",
"ok",
"{",
"return",
"it",
... | // New is used to produce an `iterator.Iterator` out of Go arrays or slices or
// any object instance implementing the `iterator.Iterator`. For now, Go
// channels and maps are not supported. | [
"New",
"is",
"used",
"to",
"produce",
"an",
"iterator",
".",
"Iterator",
"out",
"of",
"Go",
"arrays",
"or",
"slices",
"or",
"any",
"object",
"instance",
"implementing",
"the",
"iterator",
".",
"Iterator",
".",
"For",
"now",
"Go",
"channels",
"and",
"maps",... | dc059c0414d8c06e2b2bb47412b2130799bfcc9f | https://github.com/algolia/algoliasearch-client-go/blob/dc059c0414d8c06e2b2bb47412b2130799bfcc9f/algolia/iterator/iterator.go#L18-L42 | train |
algolia/algoliasearch-client-go | algolia/internal/opt/disable_prefix_on_attributes.go | ExtractDisablePrefixOnAttributes | func ExtractDisablePrefixOnAttributes(opts ...interface{}) *opt.DisablePrefixOnAttributesOption {
for _, o := range opts {
if v, ok := o.(*opt.DisablePrefixOnAttributesOption); ok {
return v
}
}
return nil
} | go | func ExtractDisablePrefixOnAttributes(opts ...interface{}) *opt.DisablePrefixOnAttributesOption {
for _, o := range opts {
if v, ok := o.(*opt.DisablePrefixOnAttributesOption); ok {
return v
}
}
return nil
} | [
"func",
"ExtractDisablePrefixOnAttributes",
"(",
"opts",
"...",
"interface",
"{",
"}",
")",
"*",
"opt",
".",
"DisablePrefixOnAttributesOption",
"{",
"for",
"_",
",",
"o",
":=",
"range",
"opts",
"{",
"if",
"v",
",",
"ok",
":=",
"o",
".",
"(",
"*",
"opt",
... | // ExtractDisablePrefixOnAttributes returns the first found DisablePrefixOnAttributesOption from the
// given variadic arguments or nil otherwise. | [
"ExtractDisablePrefixOnAttributes",
"returns",
"the",
"first",
"found",
"DisablePrefixOnAttributesOption",
"from",
"the",
"given",
"variadic",
"arguments",
"or",
"nil",
"otherwise",
"."
] | dc059c0414d8c06e2b2bb47412b2130799bfcc9f | https://github.com/algolia/algoliasearch-client-go/blob/dc059c0414d8c06e2b2bb47412b2130799bfcc9f/algolia/internal/opt/disable_prefix_on_attributes.go#L11-L18 | train |
algolia/algoliasearch-client-go | algolia/internal/opt/min_word_sizefor1_typo.go | ExtractMinWordSizefor1Typo | func ExtractMinWordSizefor1Typo(opts ...interface{}) *opt.MinWordSizefor1TypoOption {
for _, o := range opts {
if v, ok := o.(*opt.MinWordSizefor1TypoOption); ok {
return v
}
}
return nil
} | go | func ExtractMinWordSizefor1Typo(opts ...interface{}) *opt.MinWordSizefor1TypoOption {
for _, o := range opts {
if v, ok := o.(*opt.MinWordSizefor1TypoOption); ok {
return v
}
}
return nil
} | [
"func",
"ExtractMinWordSizefor1Typo",
"(",
"opts",
"...",
"interface",
"{",
"}",
")",
"*",
"opt",
".",
"MinWordSizefor1TypoOption",
"{",
"for",
"_",
",",
"o",
":=",
"range",
"opts",
"{",
"if",
"v",
",",
"ok",
":=",
"o",
".",
"(",
"*",
"opt",
".",
"Mi... | // ExtractMinWordSizefor1Typo returns the first found MinWordSizefor1TypoOption from the
// given variadic arguments or nil otherwise. | [
"ExtractMinWordSizefor1Typo",
"returns",
"the",
"first",
"found",
"MinWordSizefor1TypoOption",
"from",
"the",
"given",
"variadic",
"arguments",
"or",
"nil",
"otherwise",
"."
] | dc059c0414d8c06e2b2bb47412b2130799bfcc9f | https://github.com/algolia/algoliasearch-client-go/blob/dc059c0414d8c06e2b2bb47412b2130799bfcc9f/algolia/internal/opt/min_word_sizefor1_typo.go#L11-L18 | train |
algolia/algoliasearch-client-go | algolia/opt/type.go | TypeEqual | func TypeEqual(o1, o2 *TypeOption) bool {
if o1 != nil {
return o1.Equal(o2)
}
if o2 != nil {
return o2.Equal(o1)
}
return true
} | go | func TypeEqual(o1, o2 *TypeOption) bool {
if o1 != nil {
return o1.Equal(o2)
}
if o2 != nil {
return o2.Equal(o1)
}
return true
} | [
"func",
"TypeEqual",
"(",
"o1",
",",
"o2",
"*",
"TypeOption",
")",
"bool",
"{",
"if",
"o1",
"!=",
"nil",
"{",
"return",
"o1",
".",
"Equal",
"(",
"o2",
")",
"\n",
"}",
"\n",
"if",
"o2",
"!=",
"nil",
"{",
"return",
"o2",
".",
"Equal",
"(",
"o1",
... | // TypeEqual returns true if the two options are equal.
// In case of one option being nil, the value of the other must be nil as well
// or be set to the default value of this option. | [
"TypeEqual",
"returns",
"true",
"if",
"the",
"two",
"options",
"are",
"equal",
".",
"In",
"case",
"of",
"one",
"option",
"being",
"nil",
"the",
"value",
"of",
"the",
"other",
"must",
"be",
"nil",
"as",
"well",
"or",
"be",
"set",
"to",
"the",
"default",... | dc059c0414d8c06e2b2bb47412b2130799bfcc9f | https://github.com/algolia/algoliasearch-client-go/blob/dc059c0414d8c06e2b2bb47412b2130799bfcc9f/algolia/opt/type.go#L55-L63 | train |
algolia/algoliasearch-client-go | algolia/opt/numeric_attributes_for_filtering.go | NumericAttributesForFilteringEqual | func NumericAttributesForFilteringEqual(o1, o2 *NumericAttributesForFilteringOption) bool {
if o1 != nil {
return o1.Equal(o2)
}
if o2 != nil {
return o2.Equal(o1)
}
return true
} | go | func NumericAttributesForFilteringEqual(o1, o2 *NumericAttributesForFilteringOption) bool {
if o1 != nil {
return o1.Equal(o2)
}
if o2 != nil {
return o2.Equal(o1)
}
return true
} | [
"func",
"NumericAttributesForFilteringEqual",
"(",
"o1",
",",
"o2",
"*",
"NumericAttributesForFilteringOption",
")",
"bool",
"{",
"if",
"o1",
"!=",
"nil",
"{",
"return",
"o1",
".",
"Equal",
"(",
"o2",
")",
"\n",
"}",
"\n",
"if",
"o2",
"!=",
"nil",
"{",
"... | // NumericAttributesForFilteringEqual returns true if the two options are equal.
// In case of one option being nil, the value of the other must be nil as well
// or be set to the default value of this option. | [
"NumericAttributesForFilteringEqual",
"returns",
"true",
"if",
"the",
"two",
"options",
"are",
"equal",
".",
"In",
"case",
"of",
"one",
"option",
"being",
"nil",
"the",
"value",
"of",
"the",
"other",
"must",
"be",
"nil",
"as",
"well",
"or",
"be",
"set",
"t... | dc059c0414d8c06e2b2bb47412b2130799bfcc9f | https://github.com/algolia/algoliasearch-client-go/blob/dc059c0414d8c06e2b2bb47412b2130799bfcc9f/algolia/opt/numeric_attributes_for_filtering.go#L58-L66 | train |
algolia/algoliasearch-client-go | algolia/opt/decompounded_attributes.go | DecompoundedAttributesEqual | func DecompoundedAttributesEqual(o1, o2 *DecompoundedAttributesOption) bool {
if o1 != nil {
return o1.Equal(o2)
}
if o2 != nil {
return o2.Equal(o1)
}
return true
} | go | func DecompoundedAttributesEqual(o1, o2 *DecompoundedAttributesOption) bool {
if o1 != nil {
return o1.Equal(o2)
}
if o2 != nil {
return o2.Equal(o1)
}
return true
} | [
"func",
"DecompoundedAttributesEqual",
"(",
"o1",
",",
"o2",
"*",
"DecompoundedAttributesOption",
")",
"bool",
"{",
"if",
"o1",
"!=",
"nil",
"{",
"return",
"o1",
".",
"Equal",
"(",
"o2",
")",
"\n",
"}",
"\n",
"if",
"o2",
"!=",
"nil",
"{",
"return",
"o2... | // DecompoundedAttributesEqual returns true if the two options are equal.
// In case of one option being nil, the value of the other must be nil as well
// or be set to the default value of this option. | [
"DecompoundedAttributesEqual",
"returns",
"true",
"if",
"the",
"two",
"options",
"are",
"equal",
".",
"In",
"case",
"of",
"one",
"option",
"being",
"nil",
"the",
"value",
"of",
"the",
"other",
"must",
"be",
"nil",
"as",
"well",
"or",
"be",
"set",
"to",
"... | dc059c0414d8c06e2b2bb47412b2130799bfcc9f | https://github.com/algolia/algoliasearch-client-go/blob/dc059c0414d8c06e2b2bb47412b2130799bfcc9f/algolia/opt/decompounded_attributes.go#L58-L66 | train |
algolia/algoliasearch-client-go | algolia/opt/replace_synonyms_in_highlight.go | ReplaceSynonymsInHighlightEqual | func ReplaceSynonymsInHighlightEqual(o1, o2 *ReplaceSynonymsInHighlightOption) bool {
if o1 != nil {
return o1.Equal(o2)
}
if o2 != nil {
return o2.Equal(o1)
}
return true
} | go | func ReplaceSynonymsInHighlightEqual(o1, o2 *ReplaceSynonymsInHighlightOption) bool {
if o1 != nil {
return o1.Equal(o2)
}
if o2 != nil {
return o2.Equal(o1)
}
return true
} | [
"func",
"ReplaceSynonymsInHighlightEqual",
"(",
"o1",
",",
"o2",
"*",
"ReplaceSynonymsInHighlightOption",
")",
"bool",
"{",
"if",
"o1",
"!=",
"nil",
"{",
"return",
"o1",
".",
"Equal",
"(",
"o2",
")",
"\n",
"}",
"\n",
"if",
"o2",
"!=",
"nil",
"{",
"return... | // ReplaceSynonymsInHighlightEqual returns true if the two options are equal.
// In case of one option being nil, the value of the other must be nil as well
// or be set to the default value of this option. | [
"ReplaceSynonymsInHighlightEqual",
"returns",
"true",
"if",
"the",
"two",
"options",
"are",
"equal",
".",
"In",
"case",
"of",
"one",
"option",
"being",
"nil",
"the",
"value",
"of",
"the",
"other",
"must",
"be",
"nil",
"as",
"well",
"or",
"be",
"set",
"to",... | dc059c0414d8c06e2b2bb47412b2130799bfcc9f | https://github.com/algolia/algoliasearch-client-go/blob/dc059c0414d8c06e2b2bb47412b2130799bfcc9f/algolia/opt/replace_synonyms_in_highlight.go#L55-L63 | train |
algolia/algoliasearch-client-go | algolia/internal/opt/optional_filters.go | ExtractOptionalFilters | func ExtractOptionalFilters(opts ...interface{}) *opt.OptionalFiltersOption {
for _, o := range opts {
if v, ok := o.(*opt.OptionalFiltersOption); ok {
return v
}
}
return nil
} | go | func ExtractOptionalFilters(opts ...interface{}) *opt.OptionalFiltersOption {
for _, o := range opts {
if v, ok := o.(*opt.OptionalFiltersOption); ok {
return v
}
}
return nil
} | [
"func",
"ExtractOptionalFilters",
"(",
"opts",
"...",
"interface",
"{",
"}",
")",
"*",
"opt",
".",
"OptionalFiltersOption",
"{",
"for",
"_",
",",
"o",
":=",
"range",
"opts",
"{",
"if",
"v",
",",
"ok",
":=",
"o",
".",
"(",
"*",
"opt",
".",
"OptionalFi... | // ExtractOptionalFilters returns the first found OptionalFiltersOption from the
// given variadic arguments or nil otherwise. | [
"ExtractOptionalFilters",
"returns",
"the",
"first",
"found",
"OptionalFiltersOption",
"from",
"the",
"given",
"variadic",
"arguments",
"or",
"nil",
"otherwise",
"."
] | dc059c0414d8c06e2b2bb47412b2130799bfcc9f | https://github.com/algolia/algoliasearch-client-go/blob/dc059c0414d8c06e2b2bb47412b2130799bfcc9f/algolia/internal/opt/optional_filters.go#L11-L18 | train |
algolia/algoliasearch-client-go | algolia/internal/opt/primary.go | ExtractPrimary | func ExtractPrimary(opts ...interface{}) *opt.PrimaryOption {
for _, o := range opts {
if v, ok := o.(*opt.PrimaryOption); ok {
return v
}
}
return nil
} | go | func ExtractPrimary(opts ...interface{}) *opt.PrimaryOption {
for _, o := range opts {
if v, ok := o.(*opt.PrimaryOption); ok {
return v
}
}
return nil
} | [
"func",
"ExtractPrimary",
"(",
"opts",
"...",
"interface",
"{",
"}",
")",
"*",
"opt",
".",
"PrimaryOption",
"{",
"for",
"_",
",",
"o",
":=",
"range",
"opts",
"{",
"if",
"v",
",",
"ok",
":=",
"o",
".",
"(",
"*",
"opt",
".",
"PrimaryOption",
")",
"... | // ExtractPrimary returns the first found PrimaryOption from the
// given variadic arguments or nil otherwise. | [
"ExtractPrimary",
"returns",
"the",
"first",
"found",
"PrimaryOption",
"from",
"the",
"given",
"variadic",
"arguments",
"or",
"nil",
"otherwise",
"."
] | dc059c0414d8c06e2b2bb47412b2130799bfcc9f | https://github.com/algolia/algoliasearch-client-go/blob/dc059c0414d8c06e2b2bb47412b2130799bfcc9f/algolia/internal/opt/primary.go#L11-L18 | train |
algolia/algoliasearch-client-go | algolia/internal/opt/valid_until.go | ExtractValidUntil | func ExtractValidUntil(opts ...interface{}) *opt.ValidUntilOption {
for _, o := range opts {
if v, ok := o.(*opt.ValidUntilOption); ok {
return v
}
}
return nil
} | go | func ExtractValidUntil(opts ...interface{}) *opt.ValidUntilOption {
for _, o := range opts {
if v, ok := o.(*opt.ValidUntilOption); ok {
return v
}
}
return nil
} | [
"func",
"ExtractValidUntil",
"(",
"opts",
"...",
"interface",
"{",
"}",
")",
"*",
"opt",
".",
"ValidUntilOption",
"{",
"for",
"_",
",",
"o",
":=",
"range",
"opts",
"{",
"if",
"v",
",",
"ok",
":=",
"o",
".",
"(",
"*",
"opt",
".",
"ValidUntilOption",
... | // ExtractValidUntil returns the first found ValidUntilOption from the
// given variadic arguments or nil otherwise. | [
"ExtractValidUntil",
"returns",
"the",
"first",
"found",
"ValidUntilOption",
"from",
"the",
"given",
"variadic",
"arguments",
"or",
"nil",
"otherwise",
"."
] | dc059c0414d8c06e2b2bb47412b2130799bfcc9f | https://github.com/algolia/algoliasearch-client-go/blob/dc059c0414d8c06e2b2bb47412b2130799bfcc9f/algolia/internal/opt/valid_until.go#L11-L18 | train |
algolia/algoliasearch-client-go | algolia/internal/opt/minimum_around_radius.go | ExtractMinimumAroundRadius | func ExtractMinimumAroundRadius(opts ...interface{}) *opt.MinimumAroundRadiusOption {
for _, o := range opts {
if v, ok := o.(*opt.MinimumAroundRadiusOption); ok {
return v
}
}
return nil
} | go | func ExtractMinimumAroundRadius(opts ...interface{}) *opt.MinimumAroundRadiusOption {
for _, o := range opts {
if v, ok := o.(*opt.MinimumAroundRadiusOption); ok {
return v
}
}
return nil
} | [
"func",
"ExtractMinimumAroundRadius",
"(",
"opts",
"...",
"interface",
"{",
"}",
")",
"*",
"opt",
".",
"MinimumAroundRadiusOption",
"{",
"for",
"_",
",",
"o",
":=",
"range",
"opts",
"{",
"if",
"v",
",",
"ok",
":=",
"o",
".",
"(",
"*",
"opt",
".",
"Mi... | // ExtractMinimumAroundRadius returns the first found MinimumAroundRadiusOption from the
// given variadic arguments or nil otherwise. | [
"ExtractMinimumAroundRadius",
"returns",
"the",
"first",
"found",
"MinimumAroundRadiusOption",
"from",
"the",
"given",
"variadic",
"arguments",
"or",
"nil",
"otherwise",
"."
] | dc059c0414d8c06e2b2bb47412b2130799bfcc9f | https://github.com/algolia/algoliasearch-client-go/blob/dc059c0414d8c06e2b2bb47412b2130799bfcc9f/algolia/internal/opt/minimum_around_radius.go#L11-L18 | train |
algolia/algoliasearch-client-go | algolia/internal/opt/extra_url_params.go | ExtractExtraURLParams | func ExtractExtraURLParams(opts ...interface{}) *opt.ExtraURLParamsOption {
merged := make(map[string]string)
for _, o := range opts {
if v, ok := o.(*opt.ExtraURLParamsOption); ok {
for key, value := range v.Get() {
merged[key] = value
}
}
}
if len(merged) == 0 {
return nil
}
return opt.ExtraU... | go | func ExtractExtraURLParams(opts ...interface{}) *opt.ExtraURLParamsOption {
merged := make(map[string]string)
for _, o := range opts {
if v, ok := o.(*opt.ExtraURLParamsOption); ok {
for key, value := range v.Get() {
merged[key] = value
}
}
}
if len(merged) == 0 {
return nil
}
return opt.ExtraU... | [
"func",
"ExtractExtraURLParams",
"(",
"opts",
"...",
"interface",
"{",
"}",
")",
"*",
"opt",
".",
"ExtraURLParamsOption",
"{",
"merged",
":=",
"make",
"(",
"map",
"[",
"string",
"]",
"string",
")",
"\n\n",
"for",
"_",
",",
"o",
":=",
"range",
"opts",
"... | // ExtractExtraURLParams returns the first found ExtraURLParamsOption from the
// given variadic arguments or nil otherwise. If multiple options are found, the
// inner maps are merged. | [
"ExtractExtraURLParams",
"returns",
"the",
"first",
"found",
"ExtraURLParamsOption",
"from",
"the",
"given",
"variadic",
"arguments",
"or",
"nil",
"otherwise",
".",
"If",
"multiple",
"options",
"are",
"found",
"the",
"inner",
"maps",
"are",
"merged",
"."
] | dc059c0414d8c06e2b2bb47412b2130799bfcc9f | https://github.com/algolia/algoliasearch-client-go/blob/dc059c0414d8c06e2b2bb47412b2130799bfcc9f/algolia/internal/opt/extra_url_params.go#L12-L28 | train |
algolia/algoliasearch-client-go | algolia/internal/opt/clear_existing_rules.go | ExtractClearExistingRules | func ExtractClearExistingRules(opts ...interface{}) *opt.ClearExistingRulesOption {
for _, o := range opts {
if v, ok := o.(*opt.ClearExistingRulesOption); ok {
return v
}
}
return nil
} | go | func ExtractClearExistingRules(opts ...interface{}) *opt.ClearExistingRulesOption {
for _, o := range opts {
if v, ok := o.(*opt.ClearExistingRulesOption); ok {
return v
}
}
return nil
} | [
"func",
"ExtractClearExistingRules",
"(",
"opts",
"...",
"interface",
"{",
"}",
")",
"*",
"opt",
".",
"ClearExistingRulesOption",
"{",
"for",
"_",
",",
"o",
":=",
"range",
"opts",
"{",
"if",
"v",
",",
"ok",
":=",
"o",
".",
"(",
"*",
"opt",
".",
"Clea... | // ExtractClearExistingRules returns the first found ClearExistingRulesOption from the
// given variadic arguments or nil otherwise. | [
"ExtractClearExistingRules",
"returns",
"the",
"first",
"found",
"ClearExistingRulesOption",
"from",
"the",
"given",
"variadic",
"arguments",
"or",
"nil",
"otherwise",
"."
] | dc059c0414d8c06e2b2bb47412b2130799bfcc9f | https://github.com/algolia/algoliasearch-client-go/blob/dc059c0414d8c06e2b2bb47412b2130799bfcc9f/algolia/internal/opt/clear_existing_rules.go#L11-L18 | train |
algolia/algoliasearch-client-go | algolia/opt/around_radius.go | MarshalJSON | func (o AroundRadiusOption) MarshalJSON() ([]byte, error) {
if o.isAll {
return []byte(`"all"`), nil
}
if o.meters != 0 {
return []byte(fmt.Sprintf("%d", o.meters)), nil
}
return []byte("null"), nil
} | go | func (o AroundRadiusOption) MarshalJSON() ([]byte, error) {
if o.isAll {
return []byte(`"all"`), nil
}
if o.meters != 0 {
return []byte(fmt.Sprintf("%d", o.meters)), nil
}
return []byte("null"), nil
} | [
"func",
"(",
"o",
"AroundRadiusOption",
")",
"MarshalJSON",
"(",
")",
"(",
"[",
"]",
"byte",
",",
"error",
")",
"{",
"if",
"o",
".",
"isAll",
"{",
"return",
"[",
"]",
"byte",
"(",
"`\"all\"`",
")",
",",
"nil",
"\n",
"}",
"\n\n",
"if",
"o",
".",
... | // MarshalJSON implements the json.Marshaler interface for
// AroundRadiusOption. | [
"MarshalJSON",
"implements",
"the",
"json",
".",
"Marshaler",
"interface",
"for",
"AroundRadiusOption",
"."
] | dc059c0414d8c06e2b2bb47412b2130799bfcc9f | https://github.com/algolia/algoliasearch-client-go/blob/dc059c0414d8c06e2b2bb47412b2130799bfcc9f/algolia/opt/around_radius.go#L38-L48 | train |
algolia/algoliasearch-client-go | algolia/opt/around_radius.go | UnmarshalJSON | func (o *AroundRadiusOption) UnmarshalJSON(data []byte) error {
if string(data) == "null" {
return nil
}
var meters int
if err := json.Unmarshal(data, &meters); err == nil {
o.meters = meters
return nil
}
var all string
if err := json.Unmarshal(data, &all); err == nil && all == "all" {
o.isAll = true
... | go | func (o *AroundRadiusOption) UnmarshalJSON(data []byte) error {
if string(data) == "null" {
return nil
}
var meters int
if err := json.Unmarshal(data, &meters); err == nil {
o.meters = meters
return nil
}
var all string
if err := json.Unmarshal(data, &all); err == nil && all == "all" {
o.isAll = true
... | [
"func",
"(",
"o",
"*",
"AroundRadiusOption",
")",
"UnmarshalJSON",
"(",
"data",
"[",
"]",
"byte",
")",
"error",
"{",
"if",
"string",
"(",
"data",
")",
"==",
"\"",
"\"",
"{",
"return",
"nil",
"\n",
"}",
"\n\n",
"var",
"meters",
"int",
"\n",
"if",
"e... | // UnmarshalJSON implements the json.Unmarshaler interface for
// AroundRadiusOption. | [
"UnmarshalJSON",
"implements",
"the",
"json",
".",
"Unmarshaler",
"interface",
"for",
"AroundRadiusOption",
"."
] | dc059c0414d8c06e2b2bb47412b2130799bfcc9f | https://github.com/algolia/algoliasearch-client-go/blob/dc059c0414d8c06e2b2bb47412b2130799bfcc9f/algolia/opt/around_radius.go#L52-L70 | train |
algolia/algoliasearch-client-go | algolia/opt/around_radius.go | AroundRadiusEqual | func AroundRadiusEqual(o1, o2 *AroundRadiusOption) bool {
if o1 != nil {
return o1.Equal(o2)
}
if o2 != nil {
return o2.Equal(o1)
}
return true
} | go | func AroundRadiusEqual(o1, o2 *AroundRadiusOption) bool {
if o1 != nil {
return o1.Equal(o2)
}
if o2 != nil {
return o2.Equal(o1)
}
return true
} | [
"func",
"AroundRadiusEqual",
"(",
"o1",
",",
"o2",
"*",
"AroundRadiusOption",
")",
"bool",
"{",
"if",
"o1",
"!=",
"nil",
"{",
"return",
"o1",
".",
"Equal",
"(",
"o2",
")",
"\n",
"}",
"\n",
"if",
"o2",
"!=",
"nil",
"{",
"return",
"o2",
".",
"Equal",... | // AroundRadiusEqual returns true if the two options are equal.
// In case of one option being nil, the value of the other must be nil as well
// or be set to the default value of this option. | [
"AroundRadiusEqual",
"returns",
"true",
"if",
"the",
"two",
"options",
"are",
"equal",
".",
"In",
"case",
"of",
"one",
"option",
"being",
"nil",
"the",
"value",
"of",
"the",
"other",
"must",
"be",
"nil",
"as",
"well",
"or",
"be",
"set",
"to",
"the",
"d... | dc059c0414d8c06e2b2bb47412b2130799bfcc9f | https://github.com/algolia/algoliasearch-client-go/blob/dc059c0414d8c06e2b2bb47412b2130799bfcc9f/algolia/opt/around_radius.go#L85-L93 | train |
algolia/algoliasearch-client-go | algolia/internal/opt/sum_or_filters_scores.go | ExtractSumOrFiltersScores | func ExtractSumOrFiltersScores(opts ...interface{}) *opt.SumOrFiltersScoresOption {
for _, o := range opts {
if v, ok := o.(*opt.SumOrFiltersScoresOption); ok {
return v
}
}
return nil
} | go | func ExtractSumOrFiltersScores(opts ...interface{}) *opt.SumOrFiltersScoresOption {
for _, o := range opts {
if v, ok := o.(*opt.SumOrFiltersScoresOption); ok {
return v
}
}
return nil
} | [
"func",
"ExtractSumOrFiltersScores",
"(",
"opts",
"...",
"interface",
"{",
"}",
")",
"*",
"opt",
".",
"SumOrFiltersScoresOption",
"{",
"for",
"_",
",",
"o",
":=",
"range",
"opts",
"{",
"if",
"v",
",",
"ok",
":=",
"o",
".",
"(",
"*",
"opt",
".",
"SumO... | // ExtractSumOrFiltersScores returns the first found SumOrFiltersScoresOption from the
// given variadic arguments or nil otherwise. | [
"ExtractSumOrFiltersScores",
"returns",
"the",
"first",
"found",
"SumOrFiltersScoresOption",
"from",
"the",
"given",
"variadic",
"arguments",
"or",
"nil",
"otherwise",
"."
] | dc059c0414d8c06e2b2bb47412b2130799bfcc9f | https://github.com/algolia/algoliasearch-client-go/blob/dc059c0414d8c06e2b2bb47412b2130799bfcc9f/algolia/internal/opt/sum_or_filters_scores.go#L11-L18 | train |
algolia/algoliasearch-client-go | algolia/internal/opt/replace_existing_synonyms.go | ExtractReplaceExistingSynonyms | func ExtractReplaceExistingSynonyms(opts ...interface{}) *opt.ReplaceExistingSynonymsOption {
for _, o := range opts {
if v, ok := o.(*opt.ReplaceExistingSynonymsOption); ok {
return v
}
}
return nil
} | go | func ExtractReplaceExistingSynonyms(opts ...interface{}) *opt.ReplaceExistingSynonymsOption {
for _, o := range opts {
if v, ok := o.(*opt.ReplaceExistingSynonymsOption); ok {
return v
}
}
return nil
} | [
"func",
"ExtractReplaceExistingSynonyms",
"(",
"opts",
"...",
"interface",
"{",
"}",
")",
"*",
"opt",
".",
"ReplaceExistingSynonymsOption",
"{",
"for",
"_",
",",
"o",
":=",
"range",
"opts",
"{",
"if",
"v",
",",
"ok",
":=",
"o",
".",
"(",
"*",
"opt",
".... | // ExtractReplaceExistingSynonyms returns the first found ReplaceExistingSynonymsOption from the
// given variadic arguments or nil otherwise. | [
"ExtractReplaceExistingSynonyms",
"returns",
"the",
"first",
"found",
"ReplaceExistingSynonymsOption",
"from",
"the",
"given",
"variadic",
"arguments",
"or",
"nil",
"otherwise",
"."
] | dc059c0414d8c06e2b2bb47412b2130799bfcc9f | https://github.com/algolia/algoliasearch-client-go/blob/dc059c0414d8c06e2b2bb47412b2130799bfcc9f/algolia/internal/opt/replace_existing_synonyms.go#L11-L18 | train |
algolia/algoliasearch-client-go | algolia/internal/opt/decompounded_attributes.go | ExtractDecompoundedAttributes | func ExtractDecompoundedAttributes(opts ...interface{}) *opt.DecompoundedAttributesOption {
for _, o := range opts {
if v, ok := o.(*opt.DecompoundedAttributesOption); ok {
return v
}
}
return nil
} | go | func ExtractDecompoundedAttributes(opts ...interface{}) *opt.DecompoundedAttributesOption {
for _, o := range opts {
if v, ok := o.(*opt.DecompoundedAttributesOption); ok {
return v
}
}
return nil
} | [
"func",
"ExtractDecompoundedAttributes",
"(",
"opts",
"...",
"interface",
"{",
"}",
")",
"*",
"opt",
".",
"DecompoundedAttributesOption",
"{",
"for",
"_",
",",
"o",
":=",
"range",
"opts",
"{",
"if",
"v",
",",
"ok",
":=",
"o",
".",
"(",
"*",
"opt",
".",... | // ExtractDecompoundedAttributes returns the first found DecompoundedAttributesOption from the
// given variadic arguments or nil otherwise. | [
"ExtractDecompoundedAttributes",
"returns",
"the",
"first",
"found",
"DecompoundedAttributesOption",
"from",
"the",
"given",
"variadic",
"arguments",
"or",
"nil",
"otherwise",
"."
] | dc059c0414d8c06e2b2bb47412b2130799bfcc9f | https://github.com/algolia/algoliasearch-client-go/blob/dc059c0414d8c06e2b2bb47412b2130799bfcc9f/algolia/internal/opt/decompounded_attributes.go#L11-L18 | train |
algolia/algoliasearch-client-go | algolia/opt/sum_or_filters_scores.go | SumOrFiltersScoresEqual | func SumOrFiltersScoresEqual(o1, o2 *SumOrFiltersScoresOption) bool {
if o1 != nil {
return o1.Equal(o2)
}
if o2 != nil {
return o2.Equal(o1)
}
return true
} | go | func SumOrFiltersScoresEqual(o1, o2 *SumOrFiltersScoresOption) bool {
if o1 != nil {
return o1.Equal(o2)
}
if o2 != nil {
return o2.Equal(o1)
}
return true
} | [
"func",
"SumOrFiltersScoresEqual",
"(",
"o1",
",",
"o2",
"*",
"SumOrFiltersScoresOption",
")",
"bool",
"{",
"if",
"o1",
"!=",
"nil",
"{",
"return",
"o1",
".",
"Equal",
"(",
"o2",
")",
"\n",
"}",
"\n",
"if",
"o2",
"!=",
"nil",
"{",
"return",
"o2",
"."... | // SumOrFiltersScoresEqual returns true if the two options are equal.
// In case of one option being nil, the value of the other must be nil as well
// or be set to the default value of this option. | [
"SumOrFiltersScoresEqual",
"returns",
"true",
"if",
"the",
"two",
"options",
"are",
"equal",
".",
"In",
"case",
"of",
"one",
"option",
"being",
"nil",
"the",
"value",
"of",
"the",
"other",
"must",
"be",
"nil",
"as",
"well",
"or",
"be",
"set",
"to",
"the"... | dc059c0414d8c06e2b2bb47412b2130799bfcc9f | https://github.com/algolia/algoliasearch-client-go/blob/dc059c0414d8c06e2b2bb47412b2130799bfcc9f/algolia/opt/sum_or_filters_scores.go#L55-L63 | train |
algolia/algoliasearch-client-go | algolia/opt/query_languages.go | QueryLanguagesEqual | func QueryLanguagesEqual(o1, o2 *QueryLanguagesOption) bool {
if o1 != nil {
return o1.Equal(o2)
}
if o2 != nil {
return o2.Equal(o1)
}
return true
} | go | func QueryLanguagesEqual(o1, o2 *QueryLanguagesOption) bool {
if o1 != nil {
return o1.Equal(o2)
}
if o2 != nil {
return o2.Equal(o1)
}
return true
} | [
"func",
"QueryLanguagesEqual",
"(",
"o1",
",",
"o2",
"*",
"QueryLanguagesOption",
")",
"bool",
"{",
"if",
"o1",
"!=",
"nil",
"{",
"return",
"o1",
".",
"Equal",
"(",
"o2",
")",
"\n",
"}",
"\n",
"if",
"o2",
"!=",
"nil",
"{",
"return",
"o2",
".",
"Equ... | // QueryLanguagesEqual returns true if the two options are equal.
// In case of one option being nil, the value of the other must be nil as well
// or be set to the default value of this option. | [
"QueryLanguagesEqual",
"returns",
"true",
"if",
"the",
"two",
"options",
"are",
"equal",
".",
"In",
"case",
"of",
"one",
"option",
"being",
"nil",
"the",
"value",
"of",
"the",
"other",
"must",
"be",
"nil",
"as",
"well",
"or",
"be",
"set",
"to",
"the",
... | dc059c0414d8c06e2b2bb47412b2130799bfcc9f | https://github.com/algolia/algoliasearch-client-go/blob/dc059c0414d8c06e2b2bb47412b2130799bfcc9f/algolia/opt/query_languages.go#L58-L66 | train |
algolia/algoliasearch-client-go | algolia/opt/highlight_post_tag.go | HighlightPostTagEqual | func HighlightPostTagEqual(o1, o2 *HighlightPostTagOption) bool {
if o1 != nil {
return o1.Equal(o2)
}
if o2 != nil {
return o2.Equal(o1)
}
return true
} | go | func HighlightPostTagEqual(o1, o2 *HighlightPostTagOption) bool {
if o1 != nil {
return o1.Equal(o2)
}
if o2 != nil {
return o2.Equal(o1)
}
return true
} | [
"func",
"HighlightPostTagEqual",
"(",
"o1",
",",
"o2",
"*",
"HighlightPostTagOption",
")",
"bool",
"{",
"if",
"o1",
"!=",
"nil",
"{",
"return",
"o1",
".",
"Equal",
"(",
"o2",
")",
"\n",
"}",
"\n",
"if",
"o2",
"!=",
"nil",
"{",
"return",
"o2",
".",
... | // HighlightPostTagEqual returns true if the two options are equal.
// In case of one option being nil, the value of the other must be nil as well
// or be set to the default value of this option. | [
"HighlightPostTagEqual",
"returns",
"true",
"if",
"the",
"two",
"options",
"are",
"equal",
".",
"In",
"case",
"of",
"one",
"option",
"being",
"nil",
"the",
"value",
"of",
"the",
"other",
"must",
"be",
"nil",
"as",
"well",
"or",
"be",
"set",
"to",
"the",
... | dc059c0414d8c06e2b2bb47412b2130799bfcc9f | https://github.com/algolia/algoliasearch-client-go/blob/dc059c0414d8c06e2b2bb47412b2130799bfcc9f/algolia/opt/highlight_post_tag.go#L55-L63 | train |
algolia/algoliasearch-client-go | algolia/opt/length.go | LengthEqual | func LengthEqual(o1, o2 *LengthOption) bool {
if o1 != nil {
return o1.Equal(o2)
}
if o2 != nil {
return o2.Equal(o1)
}
return true
} | go | func LengthEqual(o1, o2 *LengthOption) bool {
if o1 != nil {
return o1.Equal(o2)
}
if o2 != nil {
return o2.Equal(o1)
}
return true
} | [
"func",
"LengthEqual",
"(",
"o1",
",",
"o2",
"*",
"LengthOption",
")",
"bool",
"{",
"if",
"o1",
"!=",
"nil",
"{",
"return",
"o1",
".",
"Equal",
"(",
"o2",
")",
"\n",
"}",
"\n",
"if",
"o2",
"!=",
"nil",
"{",
"return",
"o2",
".",
"Equal",
"(",
"o... | // LengthEqual returns true if the two options are equal.
// In case of one option being nil, the value of the other must be nil as well
// or be set to the default value of this option. | [
"LengthEqual",
"returns",
"true",
"if",
"the",
"two",
"options",
"are",
"equal",
".",
"In",
"case",
"of",
"one",
"option",
"being",
"nil",
"the",
"value",
"of",
"the",
"other",
"must",
"be",
"nil",
"as",
"well",
"or",
"be",
"set",
"to",
"the",
"default... | dc059c0414d8c06e2b2bb47412b2130799bfcc9f | https://github.com/algolia/algoliasearch-client-go/blob/dc059c0414d8c06e2b2bb47412b2130799bfcc9f/algolia/opt/length.go#L55-L63 | train |
algolia/algoliasearch-client-go | algolia/internal/opt/replicas.go | ExtractReplicas | func ExtractReplicas(opts ...interface{}) *opt.ReplicasOption {
for _, o := range opts {
if v, ok := o.(*opt.ReplicasOption); ok {
return v
}
}
return nil
} | go | func ExtractReplicas(opts ...interface{}) *opt.ReplicasOption {
for _, o := range opts {
if v, ok := o.(*opt.ReplicasOption); ok {
return v
}
}
return nil
} | [
"func",
"ExtractReplicas",
"(",
"opts",
"...",
"interface",
"{",
"}",
")",
"*",
"opt",
".",
"ReplicasOption",
"{",
"for",
"_",
",",
"o",
":=",
"range",
"opts",
"{",
"if",
"v",
",",
"ok",
":=",
"o",
".",
"(",
"*",
"opt",
".",
"ReplicasOption",
")",
... | // ExtractReplicas returns the first found ReplicasOption from the
// given variadic arguments or nil otherwise. | [
"ExtractReplicas",
"returns",
"the",
"first",
"found",
"ReplicasOption",
"from",
"the",
"given",
"variadic",
"arguments",
"or",
"nil",
"otherwise",
"."
] | dc059c0414d8c06e2b2bb47412b2130799bfcc9f | https://github.com/algolia/algoliasearch-client-go/blob/dc059c0414d8c06e2b2bb47412b2130799bfcc9f/algolia/internal/opt/replicas.go#L11-L18 | train |
algolia/algoliasearch-client-go | algolia/opt/auto_generate_object_id_if_not_exist.go | AutoGenerateObjectIDIfNotExistEqual | func AutoGenerateObjectIDIfNotExistEqual(o1, o2 *AutoGenerateObjectIDIfNotExistOption) bool {
if o1 != nil {
return o1.Equal(o2)
}
if o2 != nil {
return o2.Equal(o1)
}
return true
} | go | func AutoGenerateObjectIDIfNotExistEqual(o1, o2 *AutoGenerateObjectIDIfNotExistOption) bool {
if o1 != nil {
return o1.Equal(o2)
}
if o2 != nil {
return o2.Equal(o1)
}
return true
} | [
"func",
"AutoGenerateObjectIDIfNotExistEqual",
"(",
"o1",
",",
"o2",
"*",
"AutoGenerateObjectIDIfNotExistOption",
")",
"bool",
"{",
"if",
"o1",
"!=",
"nil",
"{",
"return",
"o1",
".",
"Equal",
"(",
"o2",
")",
"\n",
"}",
"\n",
"if",
"o2",
"!=",
"nil",
"{",
... | // AutoGenerateObjectIDIfNotExistEqual returns true if the two options are equal.
// In case of one option being nil, the value of the other must be nil as well
// or be set to the default value of this option. | [
"AutoGenerateObjectIDIfNotExistEqual",
"returns",
"true",
"if",
"the",
"two",
"options",
"are",
"equal",
".",
"In",
"case",
"of",
"one",
"option",
"being",
"nil",
"the",
"value",
"of",
"the",
"other",
"must",
"be",
"nil",
"as",
"well",
"or",
"be",
"set",
"... | dc059c0414d8c06e2b2bb47412b2130799bfcc9f | https://github.com/algolia/algoliasearch-client-go/blob/dc059c0414d8c06e2b2bb47412b2130799bfcc9f/algolia/opt/auto_generate_object_id_if_not_exist.go#L55-L63 | train |
algolia/algoliasearch-client-go | algolia/internal/opt/numeric_filters.go | ExtractNumericFilters | func ExtractNumericFilters(opts ...interface{}) *opt.NumericFiltersOption {
for _, o := range opts {
if v, ok := o.(*opt.NumericFiltersOption); ok {
return v
}
}
return nil
} | go | func ExtractNumericFilters(opts ...interface{}) *opt.NumericFiltersOption {
for _, o := range opts {
if v, ok := o.(*opt.NumericFiltersOption); ok {
return v
}
}
return nil
} | [
"func",
"ExtractNumericFilters",
"(",
"opts",
"...",
"interface",
"{",
"}",
")",
"*",
"opt",
".",
"NumericFiltersOption",
"{",
"for",
"_",
",",
"o",
":=",
"range",
"opts",
"{",
"if",
"v",
",",
"ok",
":=",
"o",
".",
"(",
"*",
"opt",
".",
"NumericFilte... | // ExtractNumericFilters returns the first found NumericFiltersOption from the
// given variadic arguments or nil otherwise. | [
"ExtractNumericFilters",
"returns",
"the",
"first",
"found",
"NumericFiltersOption",
"from",
"the",
"given",
"variadic",
"arguments",
"or",
"nil",
"otherwise",
"."
] | dc059c0414d8c06e2b2bb47412b2130799bfcc9f | https://github.com/algolia/algoliasearch-client-go/blob/dc059c0414d8c06e2b2bb47412b2130799bfcc9f/algolia/internal/opt/numeric_filters.go#L11-L18 | train |
algolia/algoliasearch-client-go | algolia/opt/custom_ranking.go | CustomRankingEqual | func CustomRankingEqual(o1, o2 *CustomRankingOption) bool {
if o1 != nil {
return o1.Equal(o2)
}
if o2 != nil {
return o2.Equal(o1)
}
return true
} | go | func CustomRankingEqual(o1, o2 *CustomRankingOption) bool {
if o1 != nil {
return o1.Equal(o2)
}
if o2 != nil {
return o2.Equal(o1)
}
return true
} | [
"func",
"CustomRankingEqual",
"(",
"o1",
",",
"o2",
"*",
"CustomRankingOption",
")",
"bool",
"{",
"if",
"o1",
"!=",
"nil",
"{",
"return",
"o1",
".",
"Equal",
"(",
"o2",
")",
"\n",
"}",
"\n",
"if",
"o2",
"!=",
"nil",
"{",
"return",
"o2",
".",
"Equal... | // CustomRankingEqual returns true if the two options are equal.
// In case of one option being nil, the value of the other must be nil as well
// or be set to the default value of this option. | [
"CustomRankingEqual",
"returns",
"true",
"if",
"the",
"two",
"options",
"are",
"equal",
".",
"In",
"case",
"of",
"one",
"option",
"being",
"nil",
"the",
"value",
"of",
"the",
"other",
"must",
"be",
"nil",
"as",
"well",
"or",
"be",
"set",
"to",
"the",
"... | dc059c0414d8c06e2b2bb47412b2130799bfcc9f | https://github.com/algolia/algoliasearch-client-go/blob/dc059c0414d8c06e2b2bb47412b2130799bfcc9f/algolia/opt/custom_ranking.go#L58-L66 | train |
algolia/algoliasearch-client-go | algolia/internal/opt/analytics.go | ExtractAnalytics | func ExtractAnalytics(opts ...interface{}) *opt.AnalyticsOption {
for _, o := range opts {
if v, ok := o.(*opt.AnalyticsOption); ok {
return v
}
}
return nil
} | go | func ExtractAnalytics(opts ...interface{}) *opt.AnalyticsOption {
for _, o := range opts {
if v, ok := o.(*opt.AnalyticsOption); ok {
return v
}
}
return nil
} | [
"func",
"ExtractAnalytics",
"(",
"opts",
"...",
"interface",
"{",
"}",
")",
"*",
"opt",
".",
"AnalyticsOption",
"{",
"for",
"_",
",",
"o",
":=",
"range",
"opts",
"{",
"if",
"v",
",",
"ok",
":=",
"o",
".",
"(",
"*",
"opt",
".",
"AnalyticsOption",
")... | // ExtractAnalytics returns the first found AnalyticsOption from the
// given variadic arguments or nil otherwise. | [
"ExtractAnalytics",
"returns",
"the",
"first",
"found",
"AnalyticsOption",
"from",
"the",
"given",
"variadic",
"arguments",
"or",
"nil",
"otherwise",
"."
] | dc059c0414d8c06e2b2bb47412b2130799bfcc9f | https://github.com/algolia/algoliasearch-client-go/blob/dc059c0414d8c06e2b2bb47412b2130799bfcc9f/algolia/internal/opt/analytics.go#L11-L18 | train |
algolia/algoliasearch-client-go | algolia/opt/filters.go | FiltersEqual | func FiltersEqual(o1, o2 *FiltersOption) bool {
if o1 != nil {
return o1.Equal(o2)
}
if o2 != nil {
return o2.Equal(o1)
}
return true
} | go | func FiltersEqual(o1, o2 *FiltersOption) bool {
if o1 != nil {
return o1.Equal(o2)
}
if o2 != nil {
return o2.Equal(o1)
}
return true
} | [
"func",
"FiltersEqual",
"(",
"o1",
",",
"o2",
"*",
"FiltersOption",
")",
"bool",
"{",
"if",
"o1",
"!=",
"nil",
"{",
"return",
"o1",
".",
"Equal",
"(",
"o2",
")",
"\n",
"}",
"\n",
"if",
"o2",
"!=",
"nil",
"{",
"return",
"o2",
".",
"Equal",
"(",
... | // FiltersEqual returns true if the two options are equal.
// In case of one option being nil, the value of the other must be nil as well
// or be set to the default value of this option. | [
"FiltersEqual",
"returns",
"true",
"if",
"the",
"two",
"options",
"are",
"equal",
".",
"In",
"case",
"of",
"one",
"option",
"being",
"nil",
"the",
"value",
"of",
"the",
"other",
"must",
"be",
"nil",
"as",
"well",
"or",
"be",
"set",
"to",
"the",
"defaul... | dc059c0414d8c06e2b2bb47412b2130799bfcc9f | https://github.com/algolia/algoliasearch-client-go/blob/dc059c0414d8c06e2b2bb47412b2130799bfcc9f/algolia/opt/filters.go#L55-L63 | train |
algolia/algoliasearch-client-go | algolia/opt/min_word_sizefor1_typo.go | MinWordSizefor1TypoEqual | func MinWordSizefor1TypoEqual(o1, o2 *MinWordSizefor1TypoOption) bool {
if o1 != nil {
return o1.Equal(o2)
}
if o2 != nil {
return o2.Equal(o1)
}
return true
} | go | func MinWordSizefor1TypoEqual(o1, o2 *MinWordSizefor1TypoOption) bool {
if o1 != nil {
return o1.Equal(o2)
}
if o2 != nil {
return o2.Equal(o1)
}
return true
} | [
"func",
"MinWordSizefor1TypoEqual",
"(",
"o1",
",",
"o2",
"*",
"MinWordSizefor1TypoOption",
")",
"bool",
"{",
"if",
"o1",
"!=",
"nil",
"{",
"return",
"o1",
".",
"Equal",
"(",
"o2",
")",
"\n",
"}",
"\n",
"if",
"o2",
"!=",
"nil",
"{",
"return",
"o2",
"... | // MinWordSizefor1TypoEqual returns true if the two options are equal.
// In case of one option being nil, the value of the other must be nil as well
// or be set to the default value of this option. | [
"MinWordSizefor1TypoEqual",
"returns",
"true",
"if",
"the",
"two",
"options",
"are",
"equal",
".",
"In",
"case",
"of",
"one",
"option",
"being",
"nil",
"the",
"value",
"of",
"the",
"other",
"must",
"be",
"nil",
"as",
"well",
"or",
"be",
"set",
"to",
"the... | dc059c0414d8c06e2b2bb47412b2130799bfcc9f | https://github.com/algolia/algoliasearch-client-go/blob/dc059c0414d8c06e2b2bb47412b2130799bfcc9f/algolia/opt/min_word_sizefor1_typo.go#L55-L63 | train |
algolia/algoliasearch-client-go | algolia/opt/distinct.go | UnmarshalJSON | func (o *DistinctOption) UnmarshalJSON(data []byte) error {
if string(data) == "null" {
return nil
}
var i int
if err := json.Unmarshal(data, &i); err == nil {
o.value = i
return nil
}
var b bool
if err := json.Unmarshal(data, &b); err == nil {
if b {
o.value = 1
} else {
o.value = 0
}
retu... | go | func (o *DistinctOption) UnmarshalJSON(data []byte) error {
if string(data) == "null" {
return nil
}
var i int
if err := json.Unmarshal(data, &i); err == nil {
o.value = i
return nil
}
var b bool
if err := json.Unmarshal(data, &b); err == nil {
if b {
o.value = 1
} else {
o.value = 0
}
retu... | [
"func",
"(",
"o",
"*",
"DistinctOption",
")",
"UnmarshalJSON",
"(",
"data",
"[",
"]",
"byte",
")",
"error",
"{",
"if",
"string",
"(",
"data",
")",
"==",
"\"",
"\"",
"{",
"return",
"nil",
"\n",
"}",
"\n\n",
"var",
"i",
"int",
"\n",
"if",
"err",
":... | // UnmarshalJSON implements the json.Unmarshaler interface for
// DistinctOption. | [
"UnmarshalJSON",
"implements",
"the",
"json",
".",
"Unmarshaler",
"interface",
"for",
"DistinctOption",
"."
] | dc059c0414d8c06e2b2bb47412b2130799bfcc9f | https://github.com/algolia/algoliasearch-client-go/blob/dc059c0414d8c06e2b2bb47412b2130799bfcc9f/algolia/opt/distinct.go#L44-L66 | train |
algolia/algoliasearch-client-go | algolia/opt/distinct.go | DistinctEqual | func DistinctEqual(o1, o2 *DistinctOption) bool {
if o1 != nil {
return o1.Equal(o2)
}
if o2 != nil {
return o2.Equal(o1)
}
return true
} | go | func DistinctEqual(o1, o2 *DistinctOption) bool {
if o1 != nil {
return o1.Equal(o2)
}
if o2 != nil {
return o2.Equal(o1)
}
return true
} | [
"func",
"DistinctEqual",
"(",
"o1",
",",
"o2",
"*",
"DistinctOption",
")",
"bool",
"{",
"if",
"o1",
"!=",
"nil",
"{",
"return",
"o1",
".",
"Equal",
"(",
"o2",
")",
"\n",
"}",
"\n",
"if",
"o2",
"!=",
"nil",
"{",
"return",
"o2",
".",
"Equal",
"(",
... | // DistinctEqual returns true if the two options are equal.
// In case of one option being nil, the value of the other must be nil as well
// or be set to the default value of this option. | [
"DistinctEqual",
"returns",
"true",
"if",
"the",
"two",
"options",
"are",
"equal",
".",
"In",
"case",
"of",
"one",
"option",
"being",
"nil",
"the",
"value",
"of",
"the",
"other",
"must",
"be",
"nil",
"as",
"well",
"or",
"be",
"set",
"to",
"the",
"defau... | dc059c0414d8c06e2b2bb47412b2130799bfcc9f | https://github.com/algolia/algoliasearch-client-go/blob/dc059c0414d8c06e2b2bb47412b2130799bfcc9f/algolia/opt/distinct.go#L81-L89 | train |
algolia/algoliasearch-client-go | algolia/opt/attributes_for_faceting.go | AttributesForFacetingEqual | func AttributesForFacetingEqual(o1, o2 *AttributesForFacetingOption) bool {
if o1 != nil {
return o1.Equal(o2)
}
if o2 != nil {
return o2.Equal(o1)
}
return true
} | go | func AttributesForFacetingEqual(o1, o2 *AttributesForFacetingOption) bool {
if o1 != nil {
return o1.Equal(o2)
}
if o2 != nil {
return o2.Equal(o1)
}
return true
} | [
"func",
"AttributesForFacetingEqual",
"(",
"o1",
",",
"o2",
"*",
"AttributesForFacetingOption",
")",
"bool",
"{",
"if",
"o1",
"!=",
"nil",
"{",
"return",
"o1",
".",
"Equal",
"(",
"o2",
")",
"\n",
"}",
"\n",
"if",
"o2",
"!=",
"nil",
"{",
"return",
"o2",... | // AttributesForFacetingEqual returns true if the two options are equal.
// In case of one option being nil, the value of the other must be nil as well
// or be set to the default value of this option. | [
"AttributesForFacetingEqual",
"returns",
"true",
"if",
"the",
"two",
"options",
"are",
"equal",
".",
"In",
"case",
"of",
"one",
"option",
"being",
"nil",
"the",
"value",
"of",
"the",
"other",
"must",
"be",
"nil",
"as",
"well",
"or",
"be",
"set",
"to",
"t... | dc059c0414d8c06e2b2bb47412b2130799bfcc9f | https://github.com/algolia/algoliasearch-client-go/blob/dc059c0414d8c06e2b2bb47412b2130799bfcc9f/algolia/opt/attributes_for_faceting.go#L58-L66 | train |
algolia/algoliasearch-client-go | algolia/internal/opt/camel_case_attributes.go | ExtractCamelCaseAttributes | func ExtractCamelCaseAttributes(opts ...interface{}) *opt.CamelCaseAttributesOption {
for _, o := range opts {
if v, ok := o.(*opt.CamelCaseAttributesOption); ok {
return v
}
}
return nil
} | go | func ExtractCamelCaseAttributes(opts ...interface{}) *opt.CamelCaseAttributesOption {
for _, o := range opts {
if v, ok := o.(*opt.CamelCaseAttributesOption); ok {
return v
}
}
return nil
} | [
"func",
"ExtractCamelCaseAttributes",
"(",
"opts",
"...",
"interface",
"{",
"}",
")",
"*",
"opt",
".",
"CamelCaseAttributesOption",
"{",
"for",
"_",
",",
"o",
":=",
"range",
"opts",
"{",
"if",
"v",
",",
"ok",
":=",
"o",
".",
"(",
"*",
"opt",
".",
"Ca... | // ExtractCamelCaseAttributes returns the first found CamelCaseAttributesOption from the
// given variadic arguments or nil otherwise. | [
"ExtractCamelCaseAttributes",
"returns",
"the",
"first",
"found",
"CamelCaseAttributesOption",
"from",
"the",
"given",
"variadic",
"arguments",
"or",
"nil",
"otherwise",
"."
] | dc059c0414d8c06e2b2bb47412b2130799bfcc9f | https://github.com/algolia/algoliasearch-client-go/blob/dc059c0414d8c06e2b2bb47412b2130799bfcc9f/algolia/internal/opt/camel_case_attributes.go#L11-L18 | train |
algolia/algoliasearch-client-go | algolia/opt/anchoring.go | AnchoringEqual | func AnchoringEqual(o1, o2 *AnchoringOption) bool {
if o1 != nil {
return o1.Equal(o2)
}
if o2 != nil {
return o2.Equal(o1)
}
return true
} | go | func AnchoringEqual(o1, o2 *AnchoringOption) bool {
if o1 != nil {
return o1.Equal(o2)
}
if o2 != nil {
return o2.Equal(o1)
}
return true
} | [
"func",
"AnchoringEqual",
"(",
"o1",
",",
"o2",
"*",
"AnchoringOption",
")",
"bool",
"{",
"if",
"o1",
"!=",
"nil",
"{",
"return",
"o1",
".",
"Equal",
"(",
"o2",
")",
"\n",
"}",
"\n",
"if",
"o2",
"!=",
"nil",
"{",
"return",
"o2",
".",
"Equal",
"("... | // AnchoringEqual returns true if the two options are equal.
// In case of one option being nil, the value of the other must be nil as well
// or be set to the default value of this option. | [
"AnchoringEqual",
"returns",
"true",
"if",
"the",
"two",
"options",
"are",
"equal",
".",
"In",
"case",
"of",
"one",
"option",
"being",
"nil",
"the",
"value",
"of",
"the",
"other",
"must",
"be",
"nil",
"as",
"well",
"or",
"be",
"set",
"to",
"the",
"defa... | dc059c0414d8c06e2b2bb47412b2130799bfcc9f | https://github.com/algolia/algoliasearch-client-go/blob/dc059c0414d8c06e2b2bb47412b2130799bfcc9f/algolia/opt/anchoring.go#L55-L63 | train |
algolia/algoliasearch-client-go | algolia/internal/opt/custom_ranking.go | ExtractCustomRanking | func ExtractCustomRanking(opts ...interface{}) *opt.CustomRankingOption {
for _, o := range opts {
if v, ok := o.(*opt.CustomRankingOption); ok {
return v
}
}
return nil
} | go | func ExtractCustomRanking(opts ...interface{}) *opt.CustomRankingOption {
for _, o := range opts {
if v, ok := o.(*opt.CustomRankingOption); ok {
return v
}
}
return nil
} | [
"func",
"ExtractCustomRanking",
"(",
"opts",
"...",
"interface",
"{",
"}",
")",
"*",
"opt",
".",
"CustomRankingOption",
"{",
"for",
"_",
",",
"o",
":=",
"range",
"opts",
"{",
"if",
"v",
",",
"ok",
":=",
"o",
".",
"(",
"*",
"opt",
".",
"CustomRankingO... | // ExtractCustomRanking returns the first found CustomRankingOption from the
// given variadic arguments or nil otherwise. | [
"ExtractCustomRanking",
"returns",
"the",
"first",
"found",
"CustomRankingOption",
"from",
"the",
"given",
"variadic",
"arguments",
"or",
"nil",
"otherwise",
"."
] | dc059c0414d8c06e2b2bb47412b2130799bfcc9f | https://github.com/algolia/algoliasearch-client-go/blob/dc059c0414d8c06e2b2bb47412b2130799bfcc9f/algolia/internal/opt/custom_ranking.go#L11-L18 | train |
algolia/algoliasearch-client-go | algolia/internal/opt/enable_personalization.go | ExtractEnablePersonalization | func ExtractEnablePersonalization(opts ...interface{}) *opt.EnablePersonalizationOption {
for _, o := range opts {
if v, ok := o.(*opt.EnablePersonalizationOption); ok {
return v
}
}
return nil
} | go | func ExtractEnablePersonalization(opts ...interface{}) *opt.EnablePersonalizationOption {
for _, o := range opts {
if v, ok := o.(*opt.EnablePersonalizationOption); ok {
return v
}
}
return nil
} | [
"func",
"ExtractEnablePersonalization",
"(",
"opts",
"...",
"interface",
"{",
"}",
")",
"*",
"opt",
".",
"EnablePersonalizationOption",
"{",
"for",
"_",
",",
"o",
":=",
"range",
"opts",
"{",
"if",
"v",
",",
"ok",
":=",
"o",
".",
"(",
"*",
"opt",
".",
... | // ExtractEnablePersonalization returns the first found EnablePersonalizationOption from the
// given variadic arguments or nil otherwise. | [
"ExtractEnablePersonalization",
"returns",
"the",
"first",
"found",
"EnablePersonalizationOption",
"from",
"the",
"given",
"variadic",
"arguments",
"or",
"nil",
"otherwise",
"."
] | dc059c0414d8c06e2b2bb47412b2130799bfcc9f | https://github.com/algolia/algoliasearch-client-go/blob/dc059c0414d8c06e2b2bb47412b2130799bfcc9f/algolia/internal/opt/enable_personalization.go#L11-L18 | train |
algolia/algoliasearch-client-go | algolia/opt/ranking.go | RankingEqual | func RankingEqual(o1, o2 *RankingOption) bool {
if o1 != nil {
return o1.Equal(o2)
}
if o2 != nil {
return o2.Equal(o1)
}
return true
} | go | func RankingEqual(o1, o2 *RankingOption) bool {
if o1 != nil {
return o1.Equal(o2)
}
if o2 != nil {
return o2.Equal(o1)
}
return true
} | [
"func",
"RankingEqual",
"(",
"o1",
",",
"o2",
"*",
"RankingOption",
")",
"bool",
"{",
"if",
"o1",
"!=",
"nil",
"{",
"return",
"o1",
".",
"Equal",
"(",
"o2",
")",
"\n",
"}",
"\n",
"if",
"o2",
"!=",
"nil",
"{",
"return",
"o2",
".",
"Equal",
"(",
... | // RankingEqual returns true if the two options are equal.
// In case of one option being nil, the value of the other must be nil as well
// or be set to the default value of this option. | [
"RankingEqual",
"returns",
"true",
"if",
"the",
"two",
"options",
"are",
"equal",
".",
"In",
"case",
"of",
"one",
"option",
"being",
"nil",
"the",
"value",
"of",
"the",
"other",
"must",
"be",
"nil",
"as",
"well",
"or",
"be",
"set",
"to",
"the",
"defaul... | dc059c0414d8c06e2b2bb47412b2130799bfcc9f | https://github.com/algolia/algoliasearch-client-go/blob/dc059c0414d8c06e2b2bb47412b2130799bfcc9f/algolia/opt/ranking.go#L58-L66 | train |
algolia/algoliasearch-client-go | algolia/internal/opt/replace_synonyms_in_highlight.go | ExtractReplaceSynonymsInHighlight | func ExtractReplaceSynonymsInHighlight(opts ...interface{}) *opt.ReplaceSynonymsInHighlightOption {
for _, o := range opts {
if v, ok := o.(*opt.ReplaceSynonymsInHighlightOption); ok {
return v
}
}
return nil
} | go | func ExtractReplaceSynonymsInHighlight(opts ...interface{}) *opt.ReplaceSynonymsInHighlightOption {
for _, o := range opts {
if v, ok := o.(*opt.ReplaceSynonymsInHighlightOption); ok {
return v
}
}
return nil
} | [
"func",
"ExtractReplaceSynonymsInHighlight",
"(",
"opts",
"...",
"interface",
"{",
"}",
")",
"*",
"opt",
".",
"ReplaceSynonymsInHighlightOption",
"{",
"for",
"_",
",",
"o",
":=",
"range",
"opts",
"{",
"if",
"v",
",",
"ok",
":=",
"o",
".",
"(",
"*",
"opt"... | // ExtractReplaceSynonymsInHighlight returns the first found ReplaceSynonymsInHighlightOption from the
// given variadic arguments or nil otherwise. | [
"ExtractReplaceSynonymsInHighlight",
"returns",
"the",
"first",
"found",
"ReplaceSynonymsInHighlightOption",
"from",
"the",
"given",
"variadic",
"arguments",
"or",
"nil",
"otherwise",
"."
] | dc059c0414d8c06e2b2bb47412b2130799bfcc9f | https://github.com/algolia/algoliasearch-client-go/blob/dc059c0414d8c06e2b2bb47412b2130799bfcc9f/algolia/internal/opt/replace_synonyms_in_highlight.go#L11-L18 | train |
algolia/algoliasearch-client-go | algolia/opt/analytics.go | UnmarshalJSON | func (o *AnalyticsOption) UnmarshalJSON(data []byte) error {
if string(data) == "null" {
o.value = true
return nil
}
return json.Unmarshal(data, &o.value)
} | go | func (o *AnalyticsOption) UnmarshalJSON(data []byte) error {
if string(data) == "null" {
o.value = true
return nil
}
return json.Unmarshal(data, &o.value)
} | [
"func",
"(",
"o",
"*",
"AnalyticsOption",
")",
"UnmarshalJSON",
"(",
"data",
"[",
"]",
"byte",
")",
"error",
"{",
"if",
"string",
"(",
"data",
")",
"==",
"\"",
"\"",
"{",
"o",
".",
"value",
"=",
"true",
"\n",
"return",
"nil",
"\n",
"}",
"\n",
"re... | // UnmarshalJSON implements the json.Unmarshaler interface for
// AnalyticsOption. | [
"UnmarshalJSON",
"implements",
"the",
"json",
".",
"Unmarshaler",
"interface",
"for",
"AnalyticsOption",
"."
] | dc059c0414d8c06e2b2bb47412b2130799bfcc9f | https://github.com/algolia/algoliasearch-client-go/blob/dc059c0414d8c06e2b2bb47412b2130799bfcc9f/algolia/opt/analytics.go#L34-L40 | train |
algolia/algoliasearch-client-go | algolia/opt/analytics.go | AnalyticsEqual | func AnalyticsEqual(o1, o2 *AnalyticsOption) bool {
if o1 != nil {
return o1.Equal(o2)
}
if o2 != nil {
return o2.Equal(o1)
}
return true
} | go | func AnalyticsEqual(o1, o2 *AnalyticsOption) bool {
if o1 != nil {
return o1.Equal(o2)
}
if o2 != nil {
return o2.Equal(o1)
}
return true
} | [
"func",
"AnalyticsEqual",
"(",
"o1",
",",
"o2",
"*",
"AnalyticsOption",
")",
"bool",
"{",
"if",
"o1",
"!=",
"nil",
"{",
"return",
"o1",
".",
"Equal",
"(",
"o2",
")",
"\n",
"}",
"\n",
"if",
"o2",
"!=",
"nil",
"{",
"return",
"o2",
".",
"Equal",
"("... | // AnalyticsEqual returns true if the two options are equal.
// In case of one option being nil, the value of the other must be nil as well
// or be set to the default value of this option. | [
"AnalyticsEqual",
"returns",
"true",
"if",
"the",
"two",
"options",
"are",
"equal",
".",
"In",
"case",
"of",
"one",
"option",
"being",
"nil",
"the",
"value",
"of",
"the",
"other",
"must",
"be",
"nil",
"as",
"well",
"or",
"be",
"set",
"to",
"the",
"defa... | dc059c0414d8c06e2b2bb47412b2130799bfcc9f | https://github.com/algolia/algoliasearch-client-go/blob/dc059c0414d8c06e2b2bb47412b2130799bfcc9f/algolia/opt/analytics.go#L55-L63 | train |
algolia/algoliasearch-client-go | algolia/opt/clear_existing_rules.go | UnmarshalJSON | func (o *ClearExistingRulesOption) UnmarshalJSON(data []byte) error {
if string(data) == "null" {
o.value = false
return nil
}
return json.Unmarshal(data, &o.value)
} | go | func (o *ClearExistingRulesOption) UnmarshalJSON(data []byte) error {
if string(data) == "null" {
o.value = false
return nil
}
return json.Unmarshal(data, &o.value)
} | [
"func",
"(",
"o",
"*",
"ClearExistingRulesOption",
")",
"UnmarshalJSON",
"(",
"data",
"[",
"]",
"byte",
")",
"error",
"{",
"if",
"string",
"(",
"data",
")",
"==",
"\"",
"\"",
"{",
"o",
".",
"value",
"=",
"false",
"\n",
"return",
"nil",
"\n",
"}",
"... | // UnmarshalJSON implements the json.Unmarshaler interface for
// ClearExistingRulesOption. | [
"UnmarshalJSON",
"implements",
"the",
"json",
".",
"Unmarshaler",
"interface",
"for",
"ClearExistingRulesOption",
"."
] | dc059c0414d8c06e2b2bb47412b2130799bfcc9f | https://github.com/algolia/algoliasearch-client-go/blob/dc059c0414d8c06e2b2bb47412b2130799bfcc9f/algolia/opt/clear_existing_rules.go#L34-L40 | train |
algolia/algoliasearch-client-go | algolia/opt/clear_existing_rules.go | ClearExistingRulesEqual | func ClearExistingRulesEqual(o1, o2 *ClearExistingRulesOption) bool {
if o1 != nil {
return o1.Equal(o2)
}
if o2 != nil {
return o2.Equal(o1)
}
return true
} | go | func ClearExistingRulesEqual(o1, o2 *ClearExistingRulesOption) bool {
if o1 != nil {
return o1.Equal(o2)
}
if o2 != nil {
return o2.Equal(o1)
}
return true
} | [
"func",
"ClearExistingRulesEqual",
"(",
"o1",
",",
"o2",
"*",
"ClearExistingRulesOption",
")",
"bool",
"{",
"if",
"o1",
"!=",
"nil",
"{",
"return",
"o1",
".",
"Equal",
"(",
"o2",
")",
"\n",
"}",
"\n",
"if",
"o2",
"!=",
"nil",
"{",
"return",
"o2",
"."... | // ClearExistingRulesEqual returns true if the two options are equal.
// In case of one option being nil, the value of the other must be nil as well
// or be set to the default value of this option. | [
"ClearExistingRulesEqual",
"returns",
"true",
"if",
"the",
"two",
"options",
"are",
"equal",
".",
"In",
"case",
"of",
"one",
"option",
"being",
"nil",
"the",
"value",
"of",
"the",
"other",
"must",
"be",
"nil",
"as",
"well",
"or",
"be",
"set",
"to",
"the"... | dc059c0414d8c06e2b2bb47412b2130799bfcc9f | https://github.com/algolia/algoliasearch-client-go/blob/dc059c0414d8c06e2b2bb47412b2130799bfcc9f/algolia/opt/clear_existing_rules.go#L55-L63 | train |
algolia/algoliasearch-client-go | algolia/opt/camel_case_attributes.go | CamelCaseAttributesEqual | func CamelCaseAttributesEqual(o1, o2 *CamelCaseAttributesOption) bool {
if o1 != nil {
return o1.Equal(o2)
}
if o2 != nil {
return o2.Equal(o1)
}
return true
} | go | func CamelCaseAttributesEqual(o1, o2 *CamelCaseAttributesOption) bool {
if o1 != nil {
return o1.Equal(o2)
}
if o2 != nil {
return o2.Equal(o1)
}
return true
} | [
"func",
"CamelCaseAttributesEqual",
"(",
"o1",
",",
"o2",
"*",
"CamelCaseAttributesOption",
")",
"bool",
"{",
"if",
"o1",
"!=",
"nil",
"{",
"return",
"o1",
".",
"Equal",
"(",
"o2",
")",
"\n",
"}",
"\n",
"if",
"o2",
"!=",
"nil",
"{",
"return",
"o2",
"... | // CamelCaseAttributesEqual returns true if the two options are equal.
// In case of one option being nil, the value of the other must be nil as well
// or be set to the default value of this option. | [
"CamelCaseAttributesEqual",
"returns",
"true",
"if",
"the",
"two",
"options",
"are",
"equal",
".",
"In",
"case",
"of",
"one",
"option",
"being",
"nil",
"the",
"value",
"of",
"the",
"other",
"must",
"be",
"nil",
"as",
"well",
"or",
"be",
"set",
"to",
"the... | dc059c0414d8c06e2b2bb47412b2130799bfcc9f | https://github.com/algolia/algoliasearch-client-go/blob/dc059c0414d8c06e2b2bb47412b2130799bfcc9f/algolia/opt/camel_case_attributes.go#L58-L66 | train |
algolia/algoliasearch-client-go | algolia/opt/numeric_filters.go | NumericFiltersEqual | func NumericFiltersEqual(o1, o2 *NumericFiltersOption) bool {
if o1 != nil {
return o1.Equal(o2)
}
if o2 != nil {
return o2.Equal(o1)
}
return true
} | go | func NumericFiltersEqual(o1, o2 *NumericFiltersOption) bool {
if o1 != nil {
return o1.Equal(o2)
}
if o2 != nil {
return o2.Equal(o1)
}
return true
} | [
"func",
"NumericFiltersEqual",
"(",
"o1",
",",
"o2",
"*",
"NumericFiltersOption",
")",
"bool",
"{",
"if",
"o1",
"!=",
"nil",
"{",
"return",
"o1",
".",
"Equal",
"(",
"o2",
")",
"\n",
"}",
"\n",
"if",
"o2",
"!=",
"nil",
"{",
"return",
"o2",
".",
"Equ... | // NumericFiltersEqual returns true if the two options are equal.
// In case of one option being nil, the value of the other must be nil as well
// or be set to the default value of this option. | [
"NumericFiltersEqual",
"returns",
"true",
"if",
"the",
"two",
"options",
"are",
"equal",
".",
"In",
"case",
"of",
"one",
"option",
"being",
"nil",
"the",
"value",
"of",
"the",
"other",
"must",
"be",
"nil",
"as",
"well",
"or",
"be",
"set",
"to",
"the",
... | dc059c0414d8c06e2b2bb47412b2130799bfcc9f | https://github.com/algolia/algoliasearch-client-go/blob/dc059c0414d8c06e2b2bb47412b2130799bfcc9f/algolia/opt/numeric_filters.go#L66-L74 | train |
algolia/algoliasearch-client-go | algolia/internal/opt/sort_facet_values_by.go | ExtractSortFacetValuesBy | func ExtractSortFacetValuesBy(opts ...interface{}) *opt.SortFacetValuesByOption {
for _, o := range opts {
if v, ok := o.(*opt.SortFacetValuesByOption); ok {
return v
}
}
return nil
} | go | func ExtractSortFacetValuesBy(opts ...interface{}) *opt.SortFacetValuesByOption {
for _, o := range opts {
if v, ok := o.(*opt.SortFacetValuesByOption); ok {
return v
}
}
return nil
} | [
"func",
"ExtractSortFacetValuesBy",
"(",
"opts",
"...",
"interface",
"{",
"}",
")",
"*",
"opt",
".",
"SortFacetValuesByOption",
"{",
"for",
"_",
",",
"o",
":=",
"range",
"opts",
"{",
"if",
"v",
",",
"ok",
":=",
"o",
".",
"(",
"*",
"opt",
".",
"SortFa... | // ExtractSortFacetValuesBy returns the first found SortFacetValuesByOption from the
// given variadic arguments or nil otherwise. | [
"ExtractSortFacetValuesBy",
"returns",
"the",
"first",
"found",
"SortFacetValuesByOption",
"from",
"the",
"given",
"variadic",
"arguments",
"or",
"nil",
"otherwise",
"."
] | dc059c0414d8c06e2b2bb47412b2130799bfcc9f | https://github.com/algolia/algoliasearch-client-go/blob/dc059c0414d8c06e2b2bb47412b2130799bfcc9f/algolia/internal/opt/sort_facet_values_by.go#L11-L18 | train |
algolia/algoliasearch-client-go | algolia/search/index_objects.go | GetObject | func (i *Index) GetObject(objectID string, object interface{}, opts ...interface{}) error {
if objectID == "" {
return errs.ErrMissingObjectID
}
opts = opt.InsertExtraURLParam(
opts,
"attributesToRetrieve",
strings.Join(iopt.ExtractAttributesToRetrieve(opts...).Get(), ","),
)
path := i.path("/" + url.Que... | go | func (i *Index) GetObject(objectID string, object interface{}, opts ...interface{}) error {
if objectID == "" {
return errs.ErrMissingObjectID
}
opts = opt.InsertExtraURLParam(
opts,
"attributesToRetrieve",
strings.Join(iopt.ExtractAttributesToRetrieve(opts...).Get(), ","),
)
path := i.path("/" + url.Que... | [
"func",
"(",
"i",
"*",
"Index",
")",
"GetObject",
"(",
"objectID",
"string",
",",
"object",
"interface",
"{",
"}",
",",
"opts",
"...",
"interface",
"{",
"}",
")",
"error",
"{",
"if",
"objectID",
"==",
"\"",
"\"",
"{",
"return",
"errs",
".",
"ErrMissi... | // GetObject retrieves the record identified by the given objectID and
// deserializes it into the object parameter. | [
"GetObject",
"retrieves",
"the",
"record",
"identified",
"by",
"the",
"given",
"objectID",
"and",
"deserializes",
"it",
"into",
"the",
"object",
"parameter",
"."
] | dc059c0414d8c06e2b2bb47412b2130799bfcc9f | https://github.com/algolia/algoliasearch-client-go/blob/dc059c0414d8c06e2b2bb47412b2130799bfcc9f/algolia/search/index_objects.go#L21-L34 | train |
algolia/algoliasearch-client-go | algolia/search/index_objects.go | SaveObject | func (i *Index) SaveObject(object interface{}, opts ...interface{}) (res SaveObjectRes, err error) {
path := i.path("")
err = i.transport.Request(&res, http.MethodPost, path, object, call.Write, opts...)
res.wait = i.WaitTask
return
} | go | func (i *Index) SaveObject(object interface{}, opts ...interface{}) (res SaveObjectRes, err error) {
path := i.path("")
err = i.transport.Request(&res, http.MethodPost, path, object, call.Write, opts...)
res.wait = i.WaitTask
return
} | [
"func",
"(",
"i",
"*",
"Index",
")",
"SaveObject",
"(",
"object",
"interface",
"{",
"}",
",",
"opts",
"...",
"interface",
"{",
"}",
")",
"(",
"res",
"SaveObjectRes",
",",
"err",
"error",
")",
"{",
"path",
":=",
"i",
".",
"path",
"(",
"\"",
"\"",
... | // SaveObject saves the given object to the index. | [
"SaveObject",
"saves",
"the",
"given",
"object",
"to",
"the",
"index",
"."
] | dc059c0414d8c06e2b2bb47412b2130799bfcc9f | https://github.com/algolia/algoliasearch-client-go/blob/dc059c0414d8c06e2b2bb47412b2130799bfcc9f/algolia/search/index_objects.go#L37-L42 | train |
algolia/algoliasearch-client-go | algolia/search/index_objects.go | PartialUpdateObject | func (i *Index) PartialUpdateObject(object interface{}, opts ...interface{}) (res UpdateTaskRes, err error) {
objectID, ok := getObjectID(object)
if !ok {
err = errs.ErrMissingObjectID
res.wait = noWait
return
}
opts = opt.InsertExtraURLParam(
opts,
"createIfNotExists",
iopt.ExtractCreateIfNotExists(op... | go | func (i *Index) PartialUpdateObject(object interface{}, opts ...interface{}) (res UpdateTaskRes, err error) {
objectID, ok := getObjectID(object)
if !ok {
err = errs.ErrMissingObjectID
res.wait = noWait
return
}
opts = opt.InsertExtraURLParam(
opts,
"createIfNotExists",
iopt.ExtractCreateIfNotExists(op... | [
"func",
"(",
"i",
"*",
"Index",
")",
"PartialUpdateObject",
"(",
"object",
"interface",
"{",
"}",
",",
"opts",
"...",
"interface",
"{",
"}",
")",
"(",
"res",
"UpdateTaskRes",
",",
"err",
"error",
")",
"{",
"objectID",
",",
"ok",
":=",
"getObjectID",
"(... | // PartialUpdateObject replaces the object content of the given object according
// to its respective objectID field. | [
"PartialUpdateObject",
"replaces",
"the",
"object",
"content",
"of",
"the",
"given",
"object",
"according",
"to",
"its",
"respective",
"objectID",
"field",
"."
] | dc059c0414d8c06e2b2bb47412b2130799bfcc9f | https://github.com/algolia/algoliasearch-client-go/blob/dc059c0414d8c06e2b2bb47412b2130799bfcc9f/algolia/search/index_objects.go#L46-L64 | train |
algolia/algoliasearch-client-go | algolia/search/index_objects.go | GetObjects | func (i *Index) GetObjects(objectIDs []string, objects interface{}, opts ...interface{}) error {
var (
attributesToRetrieve = iopt.ExtractAttributesToRetrieve(opts...)
requests = make([]getObjectsReq, len(objectIDs))
body = map[string]interface{}{"requests": requests}
res ... | go | func (i *Index) GetObjects(objectIDs []string, objects interface{}, opts ...interface{}) error {
var (
attributesToRetrieve = iopt.ExtractAttributesToRetrieve(opts...)
requests = make([]getObjectsReq, len(objectIDs))
body = map[string]interface{}{"requests": requests}
res ... | [
"func",
"(",
"i",
"*",
"Index",
")",
"GetObjects",
"(",
"objectIDs",
"[",
"]",
"string",
",",
"objects",
"interface",
"{",
"}",
",",
"opts",
"...",
"interface",
"{",
"}",
")",
"error",
"{",
"var",
"(",
"attributesToRetrieve",
"=",
"iopt",
".",
"Extract... | // GetObjects retrieves the records identified by the given objectIDs and
// deserializes them into the objects parameter. | [
"GetObjects",
"retrieves",
"the",
"records",
"identified",
"by",
"the",
"given",
"objectIDs",
"and",
"deserializes",
"them",
"into",
"the",
"objects",
"parameter",
"."
] | dc059c0414d8c06e2b2bb47412b2130799bfcc9f | https://github.com/algolia/algoliasearch-client-go/blob/dc059c0414d8c06e2b2bb47412b2130799bfcc9f/algolia/search/index_objects.go#L82-L100 | train |
algolia/algoliasearch-client-go | algolia/search/index_objects.go | DeleteObjects | func (i *Index) DeleteObjects(objectIDs []string, opts ...interface{}) (res BatchRes, err error) {
objects := make([]interface{}, len(objectIDs))
for j, id := range objectIDs {
objects[j] = map[string]string{"objectID": id}
}
var operations []BatchOperation
if operations, err = newOperationBatch(objects, Delet... | go | func (i *Index) DeleteObjects(objectIDs []string, opts ...interface{}) (res BatchRes, err error) {
objects := make([]interface{}, len(objectIDs))
for j, id := range objectIDs {
objects[j] = map[string]string{"objectID": id}
}
var operations []BatchOperation
if operations, err = newOperationBatch(objects, Delet... | [
"func",
"(",
"i",
"*",
"Index",
")",
"DeleteObjects",
"(",
"objectIDs",
"[",
"]",
"string",
",",
"opts",
"...",
"interface",
"{",
"}",
")",
"(",
"res",
"BatchRes",
",",
"err",
"error",
")",
"{",
"objects",
":=",
"make",
"(",
"[",
"]",
"interface",
... | // DeleteObjects removes the records identified by the given objectIDs. | [
"DeleteObjects",
"removes",
"the",
"records",
"identified",
"by",
"the",
"given",
"objectIDs",
"."
] | dc059c0414d8c06e2b2bb47412b2130799bfcc9f | https://github.com/algolia/algoliasearch-client-go/blob/dc059c0414d8c06e2b2bb47412b2130799bfcc9f/algolia/search/index_objects.go#L137-L151 | train |
algolia/algoliasearch-client-go | algolia/search/index_objects.go | Batch | func (i *Index) Batch(operations []BatchOperation, opts ...interface{}) (res BatchRes, err error) {
body := batchReq{Requests: operations}
path := i.path("/batch")
err = i.transport.Request(&res, http.MethodPost, path, body, call.Write, opts...)
res.wait = i.WaitTask
return
} | go | func (i *Index) Batch(operations []BatchOperation, opts ...interface{}) (res BatchRes, err error) {
body := batchReq{Requests: operations}
path := i.path("/batch")
err = i.transport.Request(&res, http.MethodPost, path, body, call.Write, opts...)
res.wait = i.WaitTask
return
} | [
"func",
"(",
"i",
"*",
"Index",
")",
"Batch",
"(",
"operations",
"[",
"]",
"BatchOperation",
",",
"opts",
"...",
"interface",
"{",
"}",
")",
"(",
"res",
"BatchRes",
",",
"err",
"error",
")",
"{",
"body",
":=",
"batchReq",
"{",
"Requests",
":",
"opera... | // Batch sends all the given indexing operations with a single call. | [
"Batch",
"sends",
"all",
"the",
"given",
"indexing",
"operations",
"with",
"a",
"single",
"call",
"."
] | dc059c0414d8c06e2b2bb47412b2130799bfcc9f | https://github.com/algolia/algoliasearch-client-go/blob/dc059c0414d8c06e2b2bb47412b2130799bfcc9f/algolia/search/index_objects.go#L198-L204 | train |
algolia/algoliasearch-client-go | algolia/search/index_objects.go | Search | func (i *Index) Search(query string, opts ...interface{}) (res QueryRes, err error) {
body := searchReq{Params: transport.URLEncode(newSearchParams(query, opts...))}
path := i.path("/query")
err = i.transport.Request(&res, http.MethodPost, path, body, call.Read, opts...)
return
} | go | func (i *Index) Search(query string, opts ...interface{}) (res QueryRes, err error) {
body := searchReq{Params: transport.URLEncode(newSearchParams(query, opts...))}
path := i.path("/query")
err = i.transport.Request(&res, http.MethodPost, path, body, call.Read, opts...)
return
} | [
"func",
"(",
"i",
"*",
"Index",
")",
"Search",
"(",
"query",
"string",
",",
"opts",
"...",
"interface",
"{",
"}",
")",
"(",
"res",
"QueryRes",
",",
"err",
"error",
")",
"{",
"body",
":=",
"searchReq",
"{",
"Params",
":",
"transport",
".",
"URLEncode"... | // Search performs a search query according to the given query string and any
// given query parameter among all the index records. | [
"Search",
"performs",
"a",
"search",
"query",
"according",
"to",
"the",
"given",
"query",
"string",
"and",
"any",
"given",
"query",
"parameter",
"among",
"all",
"the",
"index",
"records",
"."
] | dc059c0414d8c06e2b2bb47412b2130799bfcc9f | https://github.com/algolia/algoliasearch-client-go/blob/dc059c0414d8c06e2b2bb47412b2130799bfcc9f/algolia/search/index_objects.go#L221-L226 | train |
algolia/algoliasearch-client-go | algolia/search/index_objects.go | SearchForFacetValues | func (i *Index) SearchForFacetValues(facet, query string, opts ...interface{}) (res SearchForFacetValuesRes, err error) {
params := newSearchForFacetValuesParams(query, opts...)
body := map[string]string{
"params": transport.URLEncode(params),
}
path := i.path("/facets/%s/query", facet)
err = i.transport.Request... | go | func (i *Index) SearchForFacetValues(facet, query string, opts ...interface{}) (res SearchForFacetValuesRes, err error) {
params := newSearchForFacetValuesParams(query, opts...)
body := map[string]string{
"params": transport.URLEncode(params),
}
path := i.path("/facets/%s/query", facet)
err = i.transport.Request... | [
"func",
"(",
"i",
"*",
"Index",
")",
"SearchForFacetValues",
"(",
"facet",
",",
"query",
"string",
",",
"opts",
"...",
"interface",
"{",
"}",
")",
"(",
"res",
"SearchForFacetValuesRes",
",",
"err",
"error",
")",
"{",
"params",
":=",
"newSearchForFacetValuesP... | // SearchForFacetValues performs a search query according to the given query
// string and any given parameter among the values of the given facet. | [
"SearchForFacetValues",
"performs",
"a",
"search",
"query",
"according",
"to",
"the",
"given",
"query",
"string",
"and",
"any",
"given",
"parameter",
"among",
"the",
"values",
"of",
"the",
"given",
"facet",
"."
] | dc059c0414d8c06e2b2bb47412b2130799bfcc9f | https://github.com/algolia/algoliasearch-client-go/blob/dc059c0414d8c06e2b2bb47412b2130799bfcc9f/algolia/search/index_objects.go#L230-L238 | train |
algolia/algoliasearch-client-go | algolia/opt/attribute_for_distinct.go | AttributeForDistinctEqual | func AttributeForDistinctEqual(o1, o2 *AttributeForDistinctOption) bool {
if o1 != nil {
return o1.Equal(o2)
}
if o2 != nil {
return o2.Equal(o1)
}
return true
} | go | func AttributeForDistinctEqual(o1, o2 *AttributeForDistinctOption) bool {
if o1 != nil {
return o1.Equal(o2)
}
if o2 != nil {
return o2.Equal(o1)
}
return true
} | [
"func",
"AttributeForDistinctEqual",
"(",
"o1",
",",
"o2",
"*",
"AttributeForDistinctOption",
")",
"bool",
"{",
"if",
"o1",
"!=",
"nil",
"{",
"return",
"o1",
".",
"Equal",
"(",
"o2",
")",
"\n",
"}",
"\n",
"if",
"o2",
"!=",
"nil",
"{",
"return",
"o2",
... | // AttributeForDistinctEqual returns true if the two options are equal.
// In case of one option being nil, the value of the other must be nil as well
// or be set to the default value of this option. | [
"AttributeForDistinctEqual",
"returns",
"true",
"if",
"the",
"two",
"options",
"are",
"equal",
".",
"In",
"case",
"of",
"one",
"option",
"being",
"nil",
"the",
"value",
"of",
"the",
"other",
"must",
"be",
"nil",
"as",
"well",
"or",
"be",
"set",
"to",
"th... | dc059c0414d8c06e2b2bb47412b2130799bfcc9f | https://github.com/algolia/algoliasearch-client-go/blob/dc059c0414d8c06e2b2bb47412b2130799bfcc9f/algolia/opt/attribute_for_distinct.go#L55-L63 | train |
algolia/algoliasearch-client-go | algolia/opt/facet_filters.go | FacetFiltersEqual | func FacetFiltersEqual(o1, o2 *FacetFiltersOption) bool {
if o1 != nil {
return o1.Equal(o2)
}
if o2 != nil {
return o2.Equal(o1)
}
return true
} | go | func FacetFiltersEqual(o1, o2 *FacetFiltersOption) bool {
if o1 != nil {
return o1.Equal(o2)
}
if o2 != nil {
return o2.Equal(o1)
}
return true
} | [
"func",
"FacetFiltersEqual",
"(",
"o1",
",",
"o2",
"*",
"FacetFiltersOption",
")",
"bool",
"{",
"if",
"o1",
"!=",
"nil",
"{",
"return",
"o1",
".",
"Equal",
"(",
"o2",
")",
"\n",
"}",
"\n",
"if",
"o2",
"!=",
"nil",
"{",
"return",
"o2",
".",
"Equal",... | // FacetFiltersEqual returns true if the two options are equal.
// In case of one option being nil, the value of the other must be nil as well
// or be set to the default value of this option. | [
"FacetFiltersEqual",
"returns",
"true",
"if",
"the",
"two",
"options",
"are",
"equal",
".",
"In",
"case",
"of",
"one",
"option",
"being",
"nil",
"the",
"value",
"of",
"the",
"other",
"must",
"be",
"nil",
"as",
"well",
"or",
"be",
"set",
"to",
"the",
"d... | dc059c0414d8c06e2b2bb47412b2130799bfcc9f | https://github.com/algolia/algoliasearch-client-go/blob/dc059c0414d8c06e2b2bb47412b2130799bfcc9f/algolia/opt/facet_filters.go#L66-L74 | train |
algolia/algoliasearch-client-go | algolia/internal/opt/remove_stop_words.go | ExtractRemoveStopWords | func ExtractRemoveStopWords(opts ...interface{}) *opt.RemoveStopWordsOption {
for _, o := range opts {
if v, ok := o.(*opt.RemoveStopWordsOption); ok {
return v
}
}
return nil
} | go | func ExtractRemoveStopWords(opts ...interface{}) *opt.RemoveStopWordsOption {
for _, o := range opts {
if v, ok := o.(*opt.RemoveStopWordsOption); ok {
return v
}
}
return nil
} | [
"func",
"ExtractRemoveStopWords",
"(",
"opts",
"...",
"interface",
"{",
"}",
")",
"*",
"opt",
".",
"RemoveStopWordsOption",
"{",
"for",
"_",
",",
"o",
":=",
"range",
"opts",
"{",
"if",
"v",
",",
"ok",
":=",
"o",
".",
"(",
"*",
"opt",
".",
"RemoveStop... | // ExtractRemoveStopWords returns the first found RemoveStopWordsOption from the
// given variadic arguments or nil otherwise. | [
"ExtractRemoveStopWords",
"returns",
"the",
"first",
"found",
"RemoveStopWordsOption",
"from",
"the",
"given",
"variadic",
"arguments",
"or",
"nil",
"otherwise",
"."
] | dc059c0414d8c06e2b2bb47412b2130799bfcc9f | https://github.com/algolia/algoliasearch-client-go/blob/dc059c0414d8c06e2b2bb47412b2130799bfcc9f/algolia/internal/opt/remove_stop_words.go#L11-L18 | train |
algolia/algoliasearch-client-go | algolia/internal/opt/attribute_for_distinct.go | ExtractAttributeForDistinct | func ExtractAttributeForDistinct(opts ...interface{}) *opt.AttributeForDistinctOption {
for _, o := range opts {
if v, ok := o.(*opt.AttributeForDistinctOption); ok {
return v
}
}
return nil
} | go | func ExtractAttributeForDistinct(opts ...interface{}) *opt.AttributeForDistinctOption {
for _, o := range opts {
if v, ok := o.(*opt.AttributeForDistinctOption); ok {
return v
}
}
return nil
} | [
"func",
"ExtractAttributeForDistinct",
"(",
"opts",
"...",
"interface",
"{",
"}",
")",
"*",
"opt",
".",
"AttributeForDistinctOption",
"{",
"for",
"_",
",",
"o",
":=",
"range",
"opts",
"{",
"if",
"v",
",",
"ok",
":=",
"o",
".",
"(",
"*",
"opt",
".",
"... | // ExtractAttributeForDistinct returns the first found AttributeForDistinctOption from the
// given variadic arguments or nil otherwise. | [
"ExtractAttributeForDistinct",
"returns",
"the",
"first",
"found",
"AttributeForDistinctOption",
"from",
"the",
"given",
"variadic",
"arguments",
"or",
"nil",
"otherwise",
"."
] | dc059c0414d8c06e2b2bb47412b2130799bfcc9f | https://github.com/algolia/algoliasearch-client-go/blob/dc059c0414d8c06e2b2bb47412b2130799bfcc9f/algolia/internal/opt/attribute_for_distinct.go#L11-L18 | train |
algolia/algoliasearch-client-go | algolia/internal/opt/remove_words_if_no_results.go | ExtractRemoveWordsIfNoResults | func ExtractRemoveWordsIfNoResults(opts ...interface{}) *opt.RemoveWordsIfNoResultsOption {
for _, o := range opts {
if v, ok := o.(*opt.RemoveWordsIfNoResultsOption); ok {
return v
}
}
return nil
} | go | func ExtractRemoveWordsIfNoResults(opts ...interface{}) *opt.RemoveWordsIfNoResultsOption {
for _, o := range opts {
if v, ok := o.(*opt.RemoveWordsIfNoResultsOption); ok {
return v
}
}
return nil
} | [
"func",
"ExtractRemoveWordsIfNoResults",
"(",
"opts",
"...",
"interface",
"{",
"}",
")",
"*",
"opt",
".",
"RemoveWordsIfNoResultsOption",
"{",
"for",
"_",
",",
"o",
":=",
"range",
"opts",
"{",
"if",
"v",
",",
"ok",
":=",
"o",
".",
"(",
"*",
"opt",
".",... | // ExtractRemoveWordsIfNoResults returns the first found RemoveWordsIfNoResultsOption from the
// given variadic arguments or nil otherwise. | [
"ExtractRemoveWordsIfNoResults",
"returns",
"the",
"first",
"found",
"RemoveWordsIfNoResultsOption",
"from",
"the",
"given",
"variadic",
"arguments",
"or",
"nil",
"otherwise",
"."
] | dc059c0414d8c06e2b2bb47412b2130799bfcc9f | https://github.com/algolia/algoliasearch-client-go/blob/dc059c0414d8c06e2b2bb47412b2130799bfcc9f/algolia/internal/opt/remove_words_if_no_results.go#L11-L18 | train |
algolia/algoliasearch-client-go | algolia/opt/click_analytics.go | ClickAnalyticsEqual | func ClickAnalyticsEqual(o1, o2 *ClickAnalyticsOption) bool {
if o1 != nil {
return o1.Equal(o2)
}
if o2 != nil {
return o2.Equal(o1)
}
return true
} | go | func ClickAnalyticsEqual(o1, o2 *ClickAnalyticsOption) bool {
if o1 != nil {
return o1.Equal(o2)
}
if o2 != nil {
return o2.Equal(o1)
}
return true
} | [
"func",
"ClickAnalyticsEqual",
"(",
"o1",
",",
"o2",
"*",
"ClickAnalyticsOption",
")",
"bool",
"{",
"if",
"o1",
"!=",
"nil",
"{",
"return",
"o1",
".",
"Equal",
"(",
"o2",
")",
"\n",
"}",
"\n",
"if",
"o2",
"!=",
"nil",
"{",
"return",
"o2",
".",
"Equ... | // ClickAnalyticsEqual returns true if the two options are equal.
// In case of one option being nil, the value of the other must be nil as well
// or be set to the default value of this option. | [
"ClickAnalyticsEqual",
"returns",
"true",
"if",
"the",
"two",
"options",
"are",
"equal",
".",
"In",
"case",
"of",
"one",
"option",
"being",
"nil",
"the",
"value",
"of",
"the",
"other",
"must",
"be",
"nil",
"as",
"well",
"or",
"be",
"set",
"to",
"the",
... | dc059c0414d8c06e2b2bb47412b2130799bfcc9f | https://github.com/algolia/algoliasearch-client-go/blob/dc059c0414d8c06e2b2bb47412b2130799bfcc9f/algolia/opt/click_analytics.go#L55-L63 | train |
algolia/algoliasearch-client-go | algolia/opt/alternatives_as_exact.go | AlternativesAsExactEqual | func AlternativesAsExactEqual(o1, o2 *AlternativesAsExactOption) bool {
if o1 != nil {
return o1.Equal(o2)
}
if o2 != nil {
return o2.Equal(o1)
}
return true
} | go | func AlternativesAsExactEqual(o1, o2 *AlternativesAsExactOption) bool {
if o1 != nil {
return o1.Equal(o2)
}
if o2 != nil {
return o2.Equal(o1)
}
return true
} | [
"func",
"AlternativesAsExactEqual",
"(",
"o1",
",",
"o2",
"*",
"AlternativesAsExactOption",
")",
"bool",
"{",
"if",
"o1",
"!=",
"nil",
"{",
"return",
"o1",
".",
"Equal",
"(",
"o2",
")",
"\n",
"}",
"\n",
"if",
"o2",
"!=",
"nil",
"{",
"return",
"o2",
"... | // AlternativesAsExactEqual returns true if the two options are equal.
// In case of one option being nil, the value of the other must be nil as well
// or be set to the default value of this option. | [
"AlternativesAsExactEqual",
"returns",
"true",
"if",
"the",
"two",
"options",
"are",
"equal",
".",
"In",
"case",
"of",
"one",
"option",
"being",
"nil",
"the",
"value",
"of",
"the",
"other",
"must",
"be",
"nil",
"as",
"well",
"or",
"be",
"set",
"to",
"the... | dc059c0414d8c06e2b2bb47412b2130799bfcc9f | https://github.com/algolia/algoliasearch-client-go/blob/dc059c0414d8c06e2b2bb47412b2130799bfcc9f/algolia/opt/alternatives_as_exact.go#L58-L66 | train |
algolia/algoliasearch-client-go | algolia/internal/opt/rule_contexts.go | ExtractRuleContexts | func ExtractRuleContexts(opts ...interface{}) *opt.RuleContextsOption {
for _, o := range opts {
if v, ok := o.(*opt.RuleContextsOption); ok {
return v
}
}
return nil
} | go | func ExtractRuleContexts(opts ...interface{}) *opt.RuleContextsOption {
for _, o := range opts {
if v, ok := o.(*opt.RuleContextsOption); ok {
return v
}
}
return nil
} | [
"func",
"ExtractRuleContexts",
"(",
"opts",
"...",
"interface",
"{",
"}",
")",
"*",
"opt",
".",
"RuleContextsOption",
"{",
"for",
"_",
",",
"o",
":=",
"range",
"opts",
"{",
"if",
"v",
",",
"ok",
":=",
"o",
".",
"(",
"*",
"opt",
".",
"RuleContextsOpti... | // ExtractRuleContexts returns the first found RuleContextsOption from the
// given variadic arguments or nil otherwise. | [
"ExtractRuleContexts",
"returns",
"the",
"first",
"found",
"RuleContextsOption",
"from",
"the",
"given",
"variadic",
"arguments",
"or",
"nil",
"otherwise",
"."
] | dc059c0414d8c06e2b2bb47412b2130799bfcc9f | https://github.com/algolia/algoliasearch-client-go/blob/dc059c0414d8c06e2b2bb47412b2130799bfcc9f/algolia/internal/opt/rule_contexts.go#L11-L18 | train |
algolia/algoliasearch-client-go | algolia/opt/min_proximity.go | MinProximityEqual | func MinProximityEqual(o1, o2 *MinProximityOption) bool {
if o1 != nil {
return o1.Equal(o2)
}
if o2 != nil {
return o2.Equal(o1)
}
return true
} | go | func MinProximityEqual(o1, o2 *MinProximityOption) bool {
if o1 != nil {
return o1.Equal(o2)
}
if o2 != nil {
return o2.Equal(o1)
}
return true
} | [
"func",
"MinProximityEqual",
"(",
"o1",
",",
"o2",
"*",
"MinProximityOption",
")",
"bool",
"{",
"if",
"o1",
"!=",
"nil",
"{",
"return",
"o1",
".",
"Equal",
"(",
"o2",
")",
"\n",
"}",
"\n",
"if",
"o2",
"!=",
"nil",
"{",
"return",
"o2",
".",
"Equal",... | // MinProximityEqual returns true if the two options are equal.
// In case of one option being nil, the value of the other must be nil as well
// or be set to the default value of this option. | [
"MinProximityEqual",
"returns",
"true",
"if",
"the",
"two",
"options",
"are",
"equal",
".",
"In",
"case",
"of",
"one",
"option",
"being",
"nil",
"the",
"value",
"of",
"the",
"other",
"must",
"be",
"nil",
"as",
"well",
"or",
"be",
"set",
"to",
"the",
"d... | dc059c0414d8c06e2b2bb47412b2130799bfcc9f | https://github.com/algolia/algoliasearch-client-go/blob/dc059c0414d8c06e2b2bb47412b2130799bfcc9f/algolia/opt/min_proximity.go#L55-L63 | train |
algolia/algoliasearch-client-go | algolia/opt/max_facet_hits.go | MaxFacetHitsEqual | func MaxFacetHitsEqual(o1, o2 *MaxFacetHitsOption) bool {
if o1 != nil {
return o1.Equal(o2)
}
if o2 != nil {
return o2.Equal(o1)
}
return true
} | go | func MaxFacetHitsEqual(o1, o2 *MaxFacetHitsOption) bool {
if o1 != nil {
return o1.Equal(o2)
}
if o2 != nil {
return o2.Equal(o1)
}
return true
} | [
"func",
"MaxFacetHitsEqual",
"(",
"o1",
",",
"o2",
"*",
"MaxFacetHitsOption",
")",
"bool",
"{",
"if",
"o1",
"!=",
"nil",
"{",
"return",
"o1",
".",
"Equal",
"(",
"o2",
")",
"\n",
"}",
"\n",
"if",
"o2",
"!=",
"nil",
"{",
"return",
"o2",
".",
"Equal",... | // MaxFacetHitsEqual returns true if the two options are equal.
// In case of one option being nil, the value of the other must be nil as well
// or be set to the default value of this option. | [
"MaxFacetHitsEqual",
"returns",
"true",
"if",
"the",
"two",
"options",
"are",
"equal",
".",
"In",
"case",
"of",
"one",
"option",
"being",
"nil",
"the",
"value",
"of",
"the",
"other",
"must",
"be",
"nil",
"as",
"well",
"or",
"be",
"set",
"to",
"the",
"d... | dc059c0414d8c06e2b2bb47412b2130799bfcc9f | https://github.com/algolia/algoliasearch-client-go/blob/dc059c0414d8c06e2b2bb47412b2130799bfcc9f/algolia/opt/max_facet_hits.go#L55-L63 | train |
algolia/algoliasearch-client-go | algolia/internal/opt/max_values_per_facet.go | ExtractMaxValuesPerFacet | func ExtractMaxValuesPerFacet(opts ...interface{}) *opt.MaxValuesPerFacetOption {
for _, o := range opts {
if v, ok := o.(*opt.MaxValuesPerFacetOption); ok {
return v
}
}
return nil
} | go | func ExtractMaxValuesPerFacet(opts ...interface{}) *opt.MaxValuesPerFacetOption {
for _, o := range opts {
if v, ok := o.(*opt.MaxValuesPerFacetOption); ok {
return v
}
}
return nil
} | [
"func",
"ExtractMaxValuesPerFacet",
"(",
"opts",
"...",
"interface",
"{",
"}",
")",
"*",
"opt",
".",
"MaxValuesPerFacetOption",
"{",
"for",
"_",
",",
"o",
":=",
"range",
"opts",
"{",
"if",
"v",
",",
"ok",
":=",
"o",
".",
"(",
"*",
"opt",
".",
"MaxVal... | // ExtractMaxValuesPerFacet returns the first found MaxValuesPerFacetOption from the
// given variadic arguments or nil otherwise. | [
"ExtractMaxValuesPerFacet",
"returns",
"the",
"first",
"found",
"MaxValuesPerFacetOption",
"from",
"the",
"given",
"variadic",
"arguments",
"or",
"nil",
"otherwise",
"."
] | dc059c0414d8c06e2b2bb47412b2130799bfcc9f | https://github.com/algolia/algoliasearch-client-go/blob/dc059c0414d8c06e2b2bb47412b2130799bfcc9f/algolia/internal/opt/max_values_per_facet.go#L11-L18 | train |
algolia/algoliasearch-client-go | algolia/internal/opt/highlight_post_tag.go | ExtractHighlightPostTag | func ExtractHighlightPostTag(opts ...interface{}) *opt.HighlightPostTagOption {
for _, o := range opts {
if v, ok := o.(*opt.HighlightPostTagOption); ok {
return v
}
}
return nil
} | go | func ExtractHighlightPostTag(opts ...interface{}) *opt.HighlightPostTagOption {
for _, o := range opts {
if v, ok := o.(*opt.HighlightPostTagOption); ok {
return v
}
}
return nil
} | [
"func",
"ExtractHighlightPostTag",
"(",
"opts",
"...",
"interface",
"{",
"}",
")",
"*",
"opt",
".",
"HighlightPostTagOption",
"{",
"for",
"_",
",",
"o",
":=",
"range",
"opts",
"{",
"if",
"v",
",",
"ok",
":=",
"o",
".",
"(",
"*",
"opt",
".",
"Highligh... | // ExtractHighlightPostTag returns the first found HighlightPostTagOption from the
// given variadic arguments or nil otherwise. | [
"ExtractHighlightPostTag",
"returns",
"the",
"first",
"found",
"HighlightPostTagOption",
"from",
"the",
"given",
"variadic",
"arguments",
"or",
"nil",
"otherwise",
"."
] | dc059c0414d8c06e2b2bb47412b2130799bfcc9f | https://github.com/algolia/algoliasearch-client-go/blob/dc059c0414d8c06e2b2bb47412b2130799bfcc9f/algolia/internal/opt/highlight_post_tag.go#L11-L18 | train |
algolia/algoliasearch-client-go | algolia/internal/opt/optional_words.go | ExtractOptionalWords | func ExtractOptionalWords(opts ...interface{}) *opt.OptionalWordsOption {
for _, o := range opts {
if v, ok := o.(*opt.OptionalWordsOption); ok {
return v
}
}
return nil
} | go | func ExtractOptionalWords(opts ...interface{}) *opt.OptionalWordsOption {
for _, o := range opts {
if v, ok := o.(*opt.OptionalWordsOption); ok {
return v
}
}
return nil
} | [
"func",
"ExtractOptionalWords",
"(",
"opts",
"...",
"interface",
"{",
"}",
")",
"*",
"opt",
".",
"OptionalWordsOption",
"{",
"for",
"_",
",",
"o",
":=",
"range",
"opts",
"{",
"if",
"v",
",",
"ok",
":=",
"o",
".",
"(",
"*",
"opt",
".",
"OptionalWordsO... | // ExtractOptionalWords returns the first found OptionalWordsOption from the
// given variadic arguments or nil otherwise. | [
"ExtractOptionalWords",
"returns",
"the",
"first",
"found",
"OptionalWordsOption",
"from",
"the",
"given",
"variadic",
"arguments",
"or",
"nil",
"otherwise",
"."
] | dc059c0414d8c06e2b2bb47412b2130799bfcc9f | https://github.com/algolia/algoliasearch-client-go/blob/dc059c0414d8c06e2b2bb47412b2130799bfcc9f/algolia/internal/opt/optional_words.go#L11-L18 | train |
algolia/algoliasearch-client-go | algolia/internal/opt/analytics_tags.go | ExtractAnalyticsTags | func ExtractAnalyticsTags(opts ...interface{}) *opt.AnalyticsTagsOption {
for _, o := range opts {
if v, ok := o.(*opt.AnalyticsTagsOption); ok {
return v
}
}
return nil
} | go | func ExtractAnalyticsTags(opts ...interface{}) *opt.AnalyticsTagsOption {
for _, o := range opts {
if v, ok := o.(*opt.AnalyticsTagsOption); ok {
return v
}
}
return nil
} | [
"func",
"ExtractAnalyticsTags",
"(",
"opts",
"...",
"interface",
"{",
"}",
")",
"*",
"opt",
".",
"AnalyticsTagsOption",
"{",
"for",
"_",
",",
"o",
":=",
"range",
"opts",
"{",
"if",
"v",
",",
"ok",
":=",
"o",
".",
"(",
"*",
"opt",
".",
"AnalyticsTagsO... | // ExtractAnalyticsTags returns the first found AnalyticsTagsOption from the
// given variadic arguments or nil otherwise. | [
"ExtractAnalyticsTags",
"returns",
"the",
"first",
"found",
"AnalyticsTagsOption",
"from",
"the",
"given",
"variadic",
"arguments",
"or",
"nil",
"otherwise",
"."
] | dc059c0414d8c06e2b2bb47412b2130799bfcc9f | https://github.com/algolia/algoliasearch-client-go/blob/dc059c0414d8c06e2b2bb47412b2130799bfcc9f/algolia/internal/opt/analytics_tags.go#L11-L18 | train |
algolia/algoliasearch-client-go | algolia/opt/get_ranking_info.go | GetRankingInfoEqual | func GetRankingInfoEqual(o1, o2 *GetRankingInfoOption) bool {
if o1 != nil {
return o1.Equal(o2)
}
if o2 != nil {
return o2.Equal(o1)
}
return true
} | go | func GetRankingInfoEqual(o1, o2 *GetRankingInfoOption) bool {
if o1 != nil {
return o1.Equal(o2)
}
if o2 != nil {
return o2.Equal(o1)
}
return true
} | [
"func",
"GetRankingInfoEqual",
"(",
"o1",
",",
"o2",
"*",
"GetRankingInfoOption",
")",
"bool",
"{",
"if",
"o1",
"!=",
"nil",
"{",
"return",
"o1",
".",
"Equal",
"(",
"o2",
")",
"\n",
"}",
"\n",
"if",
"o2",
"!=",
"nil",
"{",
"return",
"o2",
".",
"Equ... | // GetRankingInfoEqual returns true if the two options are equal.
// In case of one option being nil, the value of the other must be nil as well
// or be set to the default value of this option. | [
"GetRankingInfoEqual",
"returns",
"true",
"if",
"the",
"two",
"options",
"are",
"equal",
".",
"In",
"case",
"of",
"one",
"option",
"being",
"nil",
"the",
"value",
"of",
"the",
"other",
"must",
"be",
"nil",
"as",
"well",
"or",
"be",
"set",
"to",
"the",
... | dc059c0414d8c06e2b2bb47412b2130799bfcc9f | https://github.com/algolia/algoliasearch-client-go/blob/dc059c0414d8c06e2b2bb47412b2130799bfcc9f/algolia/opt/get_ranking_info.go#L55-L63 | train |
algolia/algoliasearch-client-go | algolia/internal/opt/query.go | ExtractQuery | func ExtractQuery(opts ...interface{}) *opt.QueryOption {
for _, o := range opts {
if v, ok := o.(*opt.QueryOption); ok {
return v
}
}
return nil
} | go | func ExtractQuery(opts ...interface{}) *opt.QueryOption {
for _, o := range opts {
if v, ok := o.(*opt.QueryOption); ok {
return v
}
}
return nil
} | [
"func",
"ExtractQuery",
"(",
"opts",
"...",
"interface",
"{",
"}",
")",
"*",
"opt",
".",
"QueryOption",
"{",
"for",
"_",
",",
"o",
":=",
"range",
"opts",
"{",
"if",
"v",
",",
"ok",
":=",
"o",
".",
"(",
"*",
"opt",
".",
"QueryOption",
")",
";",
... | // ExtractQuery returns the first found QueryOption from the
// given variadic arguments or nil otherwise. | [
"ExtractQuery",
"returns",
"the",
"first",
"found",
"QueryOption",
"from",
"the",
"given",
"variadic",
"arguments",
"or",
"nil",
"otherwise",
"."
] | dc059c0414d8c06e2b2bb47412b2130799bfcc9f | https://github.com/algolia/algoliasearch-client-go/blob/dc059c0414d8c06e2b2bb47412b2130799bfcc9f/algolia/internal/opt/query.go#L11-L18 | train |
algolia/algoliasearch-client-go | algolia/internal/opt/forward_to_replicas.go | ExtractForwardToReplicas | func ExtractForwardToReplicas(opts ...interface{}) *opt.ForwardToReplicasOption {
for _, o := range opts {
if v, ok := o.(*opt.ForwardToReplicasOption); ok {
return v
}
}
return nil
} | go | func ExtractForwardToReplicas(opts ...interface{}) *opt.ForwardToReplicasOption {
for _, o := range opts {
if v, ok := o.(*opt.ForwardToReplicasOption); ok {
return v
}
}
return nil
} | [
"func",
"ExtractForwardToReplicas",
"(",
"opts",
"...",
"interface",
"{",
"}",
")",
"*",
"opt",
".",
"ForwardToReplicasOption",
"{",
"for",
"_",
",",
"o",
":=",
"range",
"opts",
"{",
"if",
"v",
",",
"ok",
":=",
"o",
".",
"(",
"*",
"opt",
".",
"Forwar... | // ExtractForwardToReplicas returns the first found ForwardToReplicasOption from the
// given variadic arguments or nil otherwise. | [
"ExtractForwardToReplicas",
"returns",
"the",
"first",
"found",
"ForwardToReplicasOption",
"from",
"the",
"given",
"variadic",
"arguments",
"or",
"nil",
"otherwise",
"."
] | dc059c0414d8c06e2b2bb47412b2130799bfcc9f | https://github.com/algolia/algoliasearch-client-go/blob/dc059c0414d8c06e2b2bb47412b2130799bfcc9f/algolia/internal/opt/forward_to_replicas.go#L11-L18 | train |
algolia/algoliasearch-client-go | algolia/opt/advanced.go | AdvancedEqual | func AdvancedEqual(o1, o2 *AdvancedOption) bool {
if o1 != nil {
return o1.Equal(o2)
}
if o2 != nil {
return o2.Equal(o1)
}
return true
} | go | func AdvancedEqual(o1, o2 *AdvancedOption) bool {
if o1 != nil {
return o1.Equal(o2)
}
if o2 != nil {
return o2.Equal(o1)
}
return true
} | [
"func",
"AdvancedEqual",
"(",
"o1",
",",
"o2",
"*",
"AdvancedOption",
")",
"bool",
"{",
"if",
"o1",
"!=",
"nil",
"{",
"return",
"o1",
".",
"Equal",
"(",
"o2",
")",
"\n",
"}",
"\n",
"if",
"o2",
"!=",
"nil",
"{",
"return",
"o2",
".",
"Equal",
"(",
... | // AdvancedEqual returns true if the two options are equal.
// In case of one option being nil, the value of the other must be nil as well
// or be set to the default value of this option. | [
"AdvancedEqual",
"returns",
"true",
"if",
"the",
"two",
"options",
"are",
"equal",
".",
"In",
"case",
"of",
"one",
"option",
"being",
"nil",
"the",
"value",
"of",
"the",
"other",
"must",
"be",
"nil",
"as",
"well",
"or",
"be",
"set",
"to",
"the",
"defau... | dc059c0414d8c06e2b2bb47412b2130799bfcc9f | https://github.com/algolia/algoliasearch-client-go/blob/dc059c0414d8c06e2b2bb47412b2130799bfcc9f/algolia/opt/advanced.go#L55-L63 | train |
algolia/algoliasearch-client-go | algolia/internal/opt/click_analytics.go | ExtractClickAnalytics | func ExtractClickAnalytics(opts ...interface{}) *opt.ClickAnalyticsOption {
for _, o := range opts {
if v, ok := o.(*opt.ClickAnalyticsOption); ok {
return v
}
}
return nil
} | go | func ExtractClickAnalytics(opts ...interface{}) *opt.ClickAnalyticsOption {
for _, o := range opts {
if v, ok := o.(*opt.ClickAnalyticsOption); ok {
return v
}
}
return nil
} | [
"func",
"ExtractClickAnalytics",
"(",
"opts",
"...",
"interface",
"{",
"}",
")",
"*",
"opt",
".",
"ClickAnalyticsOption",
"{",
"for",
"_",
",",
"o",
":=",
"range",
"opts",
"{",
"if",
"v",
",",
"ok",
":=",
"o",
".",
"(",
"*",
"opt",
".",
"ClickAnalyti... | // ExtractClickAnalytics returns the first found ClickAnalyticsOption from the
// given variadic arguments or nil otherwise. | [
"ExtractClickAnalytics",
"returns",
"the",
"first",
"found",
"ClickAnalyticsOption",
"from",
"the",
"given",
"variadic",
"arguments",
"or",
"nil",
"otherwise",
"."
] | dc059c0414d8c06e2b2bb47412b2130799bfcc9f | https://github.com/algolia/algoliasearch-client-go/blob/dc059c0414d8c06e2b2bb47412b2130799bfcc9f/algolia/internal/opt/click_analytics.go#L11-L18 | train |
algolia/algoliasearch-client-go | algolia/internal/opt/unretrievable_attributes.go | ExtractUnretrievableAttributes | func ExtractUnretrievableAttributes(opts ...interface{}) *opt.UnretrievableAttributesOption {
for _, o := range opts {
if v, ok := o.(*opt.UnretrievableAttributesOption); ok {
return v
}
}
return nil
} | go | func ExtractUnretrievableAttributes(opts ...interface{}) *opt.UnretrievableAttributesOption {
for _, o := range opts {
if v, ok := o.(*opt.UnretrievableAttributesOption); ok {
return v
}
}
return nil
} | [
"func",
"ExtractUnretrievableAttributes",
"(",
"opts",
"...",
"interface",
"{",
"}",
")",
"*",
"opt",
".",
"UnretrievableAttributesOption",
"{",
"for",
"_",
",",
"o",
":=",
"range",
"opts",
"{",
"if",
"v",
",",
"ok",
":=",
"o",
".",
"(",
"*",
"opt",
".... | // ExtractUnretrievableAttributes returns the first found UnretrievableAttributesOption from the
// given variadic arguments or nil otherwise. | [
"ExtractUnretrievableAttributes",
"returns",
"the",
"first",
"found",
"UnretrievableAttributesOption",
"from",
"the",
"given",
"variadic",
"arguments",
"or",
"nil",
"otherwise",
"."
] | dc059c0414d8c06e2b2bb47412b2130799bfcc9f | https://github.com/algolia/algoliasearch-client-go/blob/dc059c0414d8c06e2b2bb47412b2130799bfcc9f/algolia/internal/opt/unretrievable_attributes.go#L11-L18 | train |
algolia/algoliasearch-client-go | algolia/internal/opt/searchable_attributes.go | ExtractSearchableAttributes | func ExtractSearchableAttributes(opts ...interface{}) *opt.SearchableAttributesOption {
for _, o := range opts {
if v, ok := o.(*opt.SearchableAttributesOption); ok {
return v
}
}
return nil
} | go | func ExtractSearchableAttributes(opts ...interface{}) *opt.SearchableAttributesOption {
for _, o := range opts {
if v, ok := o.(*opt.SearchableAttributesOption); ok {
return v
}
}
return nil
} | [
"func",
"ExtractSearchableAttributes",
"(",
"opts",
"...",
"interface",
"{",
"}",
")",
"*",
"opt",
".",
"SearchableAttributesOption",
"{",
"for",
"_",
",",
"o",
":=",
"range",
"opts",
"{",
"if",
"v",
",",
"ok",
":=",
"o",
".",
"(",
"*",
"opt",
".",
"... | // ExtractSearchableAttributes returns the first found SearchableAttributesOption from the
// given variadic arguments or nil otherwise. | [
"ExtractSearchableAttributes",
"returns",
"the",
"first",
"found",
"SearchableAttributesOption",
"from",
"the",
"given",
"variadic",
"arguments",
"or",
"nil",
"otherwise",
"."
] | dc059c0414d8c06e2b2bb47412b2130799bfcc9f | https://github.com/algolia/algoliasearch-client-go/blob/dc059c0414d8c06e2b2bb47412b2130799bfcc9f/algolia/internal/opt/searchable_attributes.go#L11-L18 | train |
algolia/algoliasearch-client-go | algolia/internal/opt/advanced.go | ExtractAdvanced | func ExtractAdvanced(opts ...interface{}) *opt.AdvancedOption {
for _, o := range opts {
if v, ok := o.(*opt.AdvancedOption); ok {
return v
}
}
return nil
} | go | func ExtractAdvanced(opts ...interface{}) *opt.AdvancedOption {
for _, o := range opts {
if v, ok := o.(*opt.AdvancedOption); ok {
return v
}
}
return nil
} | [
"func",
"ExtractAdvanced",
"(",
"opts",
"...",
"interface",
"{",
"}",
")",
"*",
"opt",
".",
"AdvancedOption",
"{",
"for",
"_",
",",
"o",
":=",
"range",
"opts",
"{",
"if",
"v",
",",
"ok",
":=",
"o",
".",
"(",
"*",
"opt",
".",
"AdvancedOption",
")",
... | // ExtractAdvanced returns the first found AdvancedOption from the
// given variadic arguments or nil otherwise. | [
"ExtractAdvanced",
"returns",
"the",
"first",
"found",
"AdvancedOption",
"from",
"the",
"given",
"variadic",
"arguments",
"or",
"nil",
"otherwise",
"."
] | dc059c0414d8c06e2b2bb47412b2130799bfcc9f | https://github.com/algolia/algoliasearch-client-go/blob/dc059c0414d8c06e2b2bb47412b2130799bfcc9f/algolia/internal/opt/advanced.go#L11-L18 | train |
algolia/algoliasearch-client-go | algolia/internal/opt/get_ranking_info.go | ExtractGetRankingInfo | func ExtractGetRankingInfo(opts ...interface{}) *opt.GetRankingInfoOption {
for _, o := range opts {
if v, ok := o.(*opt.GetRankingInfoOption); ok {
return v
}
}
return nil
} | go | func ExtractGetRankingInfo(opts ...interface{}) *opt.GetRankingInfoOption {
for _, o := range opts {
if v, ok := o.(*opt.GetRankingInfoOption); ok {
return v
}
}
return nil
} | [
"func",
"ExtractGetRankingInfo",
"(",
"opts",
"...",
"interface",
"{",
"}",
")",
"*",
"opt",
".",
"GetRankingInfoOption",
"{",
"for",
"_",
",",
"o",
":=",
"range",
"opts",
"{",
"if",
"v",
",",
"ok",
":=",
"o",
".",
"(",
"*",
"opt",
".",
"GetRankingIn... | // ExtractGetRankingInfo returns the first found GetRankingInfoOption from the
// given variadic arguments or nil otherwise. | [
"ExtractGetRankingInfo",
"returns",
"the",
"first",
"found",
"GetRankingInfoOption",
"from",
"the",
"given",
"variadic",
"arguments",
"or",
"nil",
"otherwise",
"."
] | dc059c0414d8c06e2b2bb47412b2130799bfcc9f | https://github.com/algolia/algoliasearch-client-go/blob/dc059c0414d8c06e2b2bb47412b2130799bfcc9f/algolia/internal/opt/get_ranking_info.go#L11-L18 | train |
algolia/algoliasearch-client-go | algolia/opt/explain.go | ExplainEqual | func ExplainEqual(o1, o2 *ExplainOption) bool {
if o1 != nil {
return o1.Equal(o2)
}
if o2 != nil {
return o2.Equal(o1)
}
return true
} | go | func ExplainEqual(o1, o2 *ExplainOption) bool {
if o1 != nil {
return o1.Equal(o2)
}
if o2 != nil {
return o2.Equal(o1)
}
return true
} | [
"func",
"ExplainEqual",
"(",
"o1",
",",
"o2",
"*",
"ExplainOption",
")",
"bool",
"{",
"if",
"o1",
"!=",
"nil",
"{",
"return",
"o1",
".",
"Equal",
"(",
"o2",
")",
"\n",
"}",
"\n",
"if",
"o2",
"!=",
"nil",
"{",
"return",
"o2",
".",
"Equal",
"(",
... | // ExplainEqual returns true if the two options are equal.
// In case of one option being nil, the value of the other must be nil as well
// or be set to the default value of this option. | [
"ExplainEqual",
"returns",
"true",
"if",
"the",
"two",
"options",
"are",
"equal",
".",
"In",
"case",
"of",
"one",
"option",
"being",
"nil",
"the",
"value",
"of",
"the",
"other",
"must",
"be",
"nil",
"as",
"well",
"or",
"be",
"set",
"to",
"the",
"defaul... | dc059c0414d8c06e2b2bb47412b2130799bfcc9f | https://github.com/algolia/algoliasearch-client-go/blob/dc059c0414d8c06e2b2bb47412b2130799bfcc9f/algolia/opt/explain.go#L58-L66 | train |
algolia/algoliasearch-client-go | algolia/opt/valid_until.go | UnmarshalJSON | func (o *ValidUntilOption) UnmarshalJSON(data []byte) error {
if string(data) == "null" {
o.value = time.Time{}
return nil
}
return json.Unmarshal(data, &o.value)
} | go | func (o *ValidUntilOption) UnmarshalJSON(data []byte) error {
if string(data) == "null" {
o.value = time.Time{}
return nil
}
return json.Unmarshal(data, &o.value)
} | [
"func",
"(",
"o",
"*",
"ValidUntilOption",
")",
"UnmarshalJSON",
"(",
"data",
"[",
"]",
"byte",
")",
"error",
"{",
"if",
"string",
"(",
"data",
")",
"==",
"\"",
"\"",
"{",
"o",
".",
"value",
"=",
"time",
".",
"Time",
"{",
"}",
"\n",
"return",
"ni... | // UnmarshalJSON implements the json.Unmarshaler interface for
// ValidUntilOption. | [
"UnmarshalJSON",
"implements",
"the",
"json",
".",
"Unmarshaler",
"interface",
"for",
"ValidUntilOption",
"."
] | dc059c0414d8c06e2b2bb47412b2130799bfcc9f | https://github.com/algolia/algoliasearch-client-go/blob/dc059c0414d8c06e2b2bb47412b2130799bfcc9f/algolia/opt/valid_until.go#L35-L41 | train |
algolia/algoliasearch-client-go | algolia/opt/valid_until.go | ValidUntilEqual | func ValidUntilEqual(o1, o2 *ValidUntilOption) bool {
if o1 != nil {
return o1.Equal(o2)
}
if o2 != nil {
return o2.Equal(o1)
}
return true
} | go | func ValidUntilEqual(o1, o2 *ValidUntilOption) bool {
if o1 != nil {
return o1.Equal(o2)
}
if o2 != nil {
return o2.Equal(o1)
}
return true
} | [
"func",
"ValidUntilEqual",
"(",
"o1",
",",
"o2",
"*",
"ValidUntilOption",
")",
"bool",
"{",
"if",
"o1",
"!=",
"nil",
"{",
"return",
"o1",
".",
"Equal",
"(",
"o2",
")",
"\n",
"}",
"\n",
"if",
"o2",
"!=",
"nil",
"{",
"return",
"o2",
".",
"Equal",
"... | // ValidUntilEqual returns true if the two options are equal.
// In case of one option being nil, the value of the other must be nil as well
// or be set to the default value of this option. | [
"ValidUntilEqual",
"returns",
"true",
"if",
"the",
"two",
"options",
"are",
"equal",
".",
"In",
"case",
"of",
"one",
"option",
"being",
"nil",
"the",
"value",
"of",
"the",
"other",
"must",
"be",
"nil",
"as",
"well",
"or",
"be",
"set",
"to",
"the",
"def... | dc059c0414d8c06e2b2bb47412b2130799bfcc9f | https://github.com/algolia/algoliasearch-client-go/blob/dc059c0414d8c06e2b2bb47412b2130799bfcc9f/algolia/opt/valid_until.go#L56-L64 | train |
algolia/algoliasearch-client-go | algolia/debug/debug.go | Display | func Display(itf interface{}) {
if !debug {
return
}
switch v := itf.(type) {
case *http.Request:
printRequest(v)
case *http.Response:
printResponse(v)
default:
fmt.Printf("do not know how to debug-print %#v\n", v)
}
} | go | func Display(itf interface{}) {
if !debug {
return
}
switch v := itf.(type) {
case *http.Request:
printRequest(v)
case *http.Response:
printResponse(v)
default:
fmt.Printf("do not know how to debug-print %#v\n", v)
}
} | [
"func",
"Display",
"(",
"itf",
"interface",
"{",
"}",
")",
"{",
"if",
"!",
"debug",
"{",
"return",
"\n",
"}",
"\n",
"switch",
"v",
":=",
"itf",
".",
"(",
"type",
")",
"{",
"case",
"*",
"http",
".",
"Request",
":",
"printRequest",
"(",
"v",
")",
... | // Display displays the given parameter on the standard output in a custom way,
// depending on the given input type. This function is internally used by the
// Algolia API client to display, for instance, HTTP requests and responses when
// debug logging is enabled. | [
"Display",
"displays",
"the",
"given",
"parameter",
"on",
"the",
"standard",
"output",
"in",
"a",
"custom",
"way",
"depending",
"on",
"the",
"given",
"input",
"type",
".",
"This",
"function",
"is",
"internally",
"used",
"by",
"the",
"Algolia",
"API",
"client... | dc059c0414d8c06e2b2bb47412b2130799bfcc9f | https://github.com/algolia/algoliasearch-client-go/blob/dc059c0414d8c06e2b2bb47412b2130799bfcc9f/algolia/debug/debug.go#L33-L45 | train |
algolia/algoliasearch-client-go | algolia/internal/opt/offset.go | ExtractOffset | func ExtractOffset(opts ...interface{}) *opt.OffsetOption {
for _, o := range opts {
if v, ok := o.(*opt.OffsetOption); ok {
return v
}
}
return nil
} | go | func ExtractOffset(opts ...interface{}) *opt.OffsetOption {
for _, o := range opts {
if v, ok := o.(*opt.OffsetOption); ok {
return v
}
}
return nil
} | [
"func",
"ExtractOffset",
"(",
"opts",
"...",
"interface",
"{",
"}",
")",
"*",
"opt",
".",
"OffsetOption",
"{",
"for",
"_",
",",
"o",
":=",
"range",
"opts",
"{",
"if",
"v",
",",
"ok",
":=",
"o",
".",
"(",
"*",
"opt",
".",
"OffsetOption",
")",
";",... | // ExtractOffset returns the first found OffsetOption from the
// given variadic arguments or nil otherwise. | [
"ExtractOffset",
"returns",
"the",
"first",
"found",
"OffsetOption",
"from",
"the",
"given",
"variadic",
"arguments",
"or",
"nil",
"otherwise",
"."
] | dc059c0414d8c06e2b2bb47412b2130799bfcc9f | https://github.com/algolia/algoliasearch-client-go/blob/dc059c0414d8c06e2b2bb47412b2130799bfcc9f/algolia/internal/opt/offset.go#L11-L18 | train |
grpc-ecosystem/go-grpc-prometheus | client_metrics.go | NewClientMetrics | func NewClientMetrics(counterOpts ...CounterOption) *ClientMetrics {
opts := counterOptions(counterOpts)
return &ClientMetrics{
clientStartedCounter: prom.NewCounterVec(
opts.apply(prom.CounterOpts{
Name: "grpc_client_started_total",
Help: "Total number of RPCs started on the client.",
}), []string{"g... | go | func NewClientMetrics(counterOpts ...CounterOption) *ClientMetrics {
opts := counterOptions(counterOpts)
return &ClientMetrics{
clientStartedCounter: prom.NewCounterVec(
opts.apply(prom.CounterOpts{
Name: "grpc_client_started_total",
Help: "Total number of RPCs started on the client.",
}), []string{"g... | [
"func",
"NewClientMetrics",
"(",
"counterOpts",
"...",
"CounterOption",
")",
"*",
"ClientMetrics",
"{",
"opts",
":=",
"counterOptions",
"(",
"counterOpts",
")",
"\n",
"return",
"&",
"ClientMetrics",
"{",
"clientStartedCounter",
":",
"prom",
".",
"NewCounterVec",
"... | // NewClientMetrics returns a ClientMetrics object. Use a new instance of
// ClientMetrics when not using the default Prometheus metrics registry, for
// example when wanting to control which metrics are added to a registry as
// opposed to automatically adding metrics via init functions. | [
"NewClientMetrics",
"returns",
"a",
"ClientMetrics",
"object",
".",
"Use",
"a",
"new",
"instance",
"of",
"ClientMetrics",
"when",
"not",
"using",
"the",
"default",
"Prometheus",
"metrics",
"registry",
"for",
"example",
"when",
"wanting",
"to",
"control",
"which",
... | ae0d8660c5f2108ca70a3776dbe0fb53cf79f1da | https://github.com/grpc-ecosystem/go-grpc-prometheus/blob/ae0d8660c5f2108ca70a3776dbe0fb53cf79f1da/client_metrics.go#L38-L87 | train |
grpc-ecosystem/go-grpc-prometheus | client_metrics.go | EnableClientHandlingTimeHistogram | func (m *ClientMetrics) EnableClientHandlingTimeHistogram(opts ...HistogramOption) {
for _, o := range opts {
o(&m.clientHandledHistogramOpts)
}
if !m.clientHandledHistogramEnabled {
m.clientHandledHistogram = prom.NewHistogramVec(
m.clientHandledHistogramOpts,
[]string{"grpc_type", "grpc_service", "grpc_m... | go | func (m *ClientMetrics) EnableClientHandlingTimeHistogram(opts ...HistogramOption) {
for _, o := range opts {
o(&m.clientHandledHistogramOpts)
}
if !m.clientHandledHistogramEnabled {
m.clientHandledHistogram = prom.NewHistogramVec(
m.clientHandledHistogramOpts,
[]string{"grpc_type", "grpc_service", "grpc_m... | [
"func",
"(",
"m",
"*",
"ClientMetrics",
")",
"EnableClientHandlingTimeHistogram",
"(",
"opts",
"...",
"HistogramOption",
")",
"{",
"for",
"_",
",",
"o",
":=",
"range",
"opts",
"{",
"o",
"(",
"&",
"m",
".",
"clientHandledHistogramOpts",
")",
"\n",
"}",
"\n"... | // EnableClientHandlingTimeHistogram turns on recording of handling time of RPCs.
// Histogram metrics can be very expensive for Prometheus to retain and query. | [
"EnableClientHandlingTimeHistogram",
"turns",
"on",
"recording",
"of",
"handling",
"time",
"of",
"RPCs",
".",
"Histogram",
"metrics",
"can",
"be",
"very",
"expensive",
"for",
"Prometheus",
"to",
"retain",
"and",
"query",
"."
] | ae0d8660c5f2108ca70a3776dbe0fb53cf79f1da | https://github.com/grpc-ecosystem/go-grpc-prometheus/blob/ae0d8660c5f2108ca70a3776dbe0fb53cf79f1da/client_metrics.go#L129-L140 | train |
grpc-ecosystem/go-grpc-prometheus | client_metrics.go | EnableClientStreamReceiveTimeHistogram | func (m *ClientMetrics) EnableClientStreamReceiveTimeHistogram(opts ...HistogramOption) {
for _, o := range opts {
o(&m.clientStreamRecvHistogramOpts)
}
if !m.clientStreamRecvHistogramEnabled {
m.clientStreamRecvHistogram = prom.NewHistogramVec(
m.clientStreamRecvHistogramOpts,
[]string{"grpc_type", "grpc... | go | func (m *ClientMetrics) EnableClientStreamReceiveTimeHistogram(opts ...HistogramOption) {
for _, o := range opts {
o(&m.clientStreamRecvHistogramOpts)
}
if !m.clientStreamRecvHistogramEnabled {
m.clientStreamRecvHistogram = prom.NewHistogramVec(
m.clientStreamRecvHistogramOpts,
[]string{"grpc_type", "grpc... | [
"func",
"(",
"m",
"*",
"ClientMetrics",
")",
"EnableClientStreamReceiveTimeHistogram",
"(",
"opts",
"...",
"HistogramOption",
")",
"{",
"for",
"_",
",",
"o",
":=",
"range",
"opts",
"{",
"o",
"(",
"&",
"m",
".",
"clientStreamRecvHistogramOpts",
")",
"\n",
"}"... | // EnableClientStreamReceiveTimeHistogram turns on recording of single message receive time of streaming RPCs.
// Histogram metrics can be very expensive for Prometheus to retain and query. | [
"EnableClientStreamReceiveTimeHistogram",
"turns",
"on",
"recording",
"of",
"single",
"message",
"receive",
"time",
"of",
"streaming",
"RPCs",
".",
"Histogram",
"metrics",
"can",
"be",
"very",
"expensive",
"for",
"Prometheus",
"to",
"retain",
"and",
"query",
"."
] | ae0d8660c5f2108ca70a3776dbe0fb53cf79f1da | https://github.com/grpc-ecosystem/go-grpc-prometheus/blob/ae0d8660c5f2108ca70a3776dbe0fb53cf79f1da/client_metrics.go#L144-L157 | train |
grpc-ecosystem/go-grpc-prometheus | client_metrics.go | EnableClientStreamSendTimeHistogram | func (m *ClientMetrics) EnableClientStreamSendTimeHistogram(opts ...HistogramOption) {
for _, o := range opts {
o(&m.clientStreamSendHistogramOpts)
}
if !m.clientStreamSendHistogramEnabled {
m.clientStreamSendHistogram = prom.NewHistogramVec(
m.clientStreamSendHistogramOpts,
[]string{"grpc_type", "grpc_se... | go | func (m *ClientMetrics) EnableClientStreamSendTimeHistogram(opts ...HistogramOption) {
for _, o := range opts {
o(&m.clientStreamSendHistogramOpts)
}
if !m.clientStreamSendHistogramEnabled {
m.clientStreamSendHistogram = prom.NewHistogramVec(
m.clientStreamSendHistogramOpts,
[]string{"grpc_type", "grpc_se... | [
"func",
"(",
"m",
"*",
"ClientMetrics",
")",
"EnableClientStreamSendTimeHistogram",
"(",
"opts",
"...",
"HistogramOption",
")",
"{",
"for",
"_",
",",
"o",
":=",
"range",
"opts",
"{",
"o",
"(",
"&",
"m",
".",
"clientStreamSendHistogramOpts",
")",
"\n",
"}",
... | // EnableClientStreamSendTimeHistogram turns on recording of single message send time of streaming RPCs.
// Histogram metrics can be very expensive for Prometheus to retain and query. | [
"EnableClientStreamSendTimeHistogram",
"turns",
"on",
"recording",
"of",
"single",
"message",
"send",
"time",
"of",
"streaming",
"RPCs",
".",
"Histogram",
"metrics",
"can",
"be",
"very",
"expensive",
"for",
"Prometheus",
"to",
"retain",
"and",
"query",
"."
] | ae0d8660c5f2108ca70a3776dbe0fb53cf79f1da | https://github.com/grpc-ecosystem/go-grpc-prometheus/blob/ae0d8660c5f2108ca70a3776dbe0fb53cf79f1da/client_metrics.go#L161-L174 | train |
grpc-ecosystem/go-grpc-prometheus | client_metrics.go | UnaryClientInterceptor | func (m *ClientMetrics) UnaryClientInterceptor() func(ctx context.Context, method string, req, reply interface{}, cc *grpc.ClientConn, invoker grpc.UnaryInvoker, opts ...grpc.CallOption) error {
return func(ctx context.Context, method string, req, reply interface{}, cc *grpc.ClientConn, invoker grpc.UnaryInvoker, opts... | go | func (m *ClientMetrics) UnaryClientInterceptor() func(ctx context.Context, method string, req, reply interface{}, cc *grpc.ClientConn, invoker grpc.UnaryInvoker, opts ...grpc.CallOption) error {
return func(ctx context.Context, method string, req, reply interface{}, cc *grpc.ClientConn, invoker grpc.UnaryInvoker, opts... | [
"func",
"(",
"m",
"*",
"ClientMetrics",
")",
"UnaryClientInterceptor",
"(",
")",
"func",
"(",
"ctx",
"context",
".",
"Context",
",",
"method",
"string",
",",
"req",
",",
"reply",
"interface",
"{",
"}",
",",
"cc",
"*",
"grpc",
".",
"ClientConn",
",",
"i... | // UnaryClientInterceptor is a gRPC client-side interceptor that provides Prometheus monitoring for Unary RPCs. | [
"UnaryClientInterceptor",
"is",
"a",
"gRPC",
"client",
"-",
"side",
"interceptor",
"that",
"provides",
"Prometheus",
"monitoring",
"for",
"Unary",
"RPCs",
"."
] | ae0d8660c5f2108ca70a3776dbe0fb53cf79f1da | https://github.com/grpc-ecosystem/go-grpc-prometheus/blob/ae0d8660c5f2108ca70a3776dbe0fb53cf79f1da/client_metrics.go#L177-L189 | train |
grpc-ecosystem/go-grpc-prometheus | client_metrics.go | StreamClientInterceptor | func (m *ClientMetrics) StreamClientInterceptor() func(ctx context.Context, desc *grpc.StreamDesc, cc *grpc.ClientConn, method string, streamer grpc.Streamer, opts ...grpc.CallOption) (grpc.ClientStream, error) {
return func(ctx context.Context, desc *grpc.StreamDesc, cc *grpc.ClientConn, method string, streamer grpc.... | go | func (m *ClientMetrics) StreamClientInterceptor() func(ctx context.Context, desc *grpc.StreamDesc, cc *grpc.ClientConn, method string, streamer grpc.Streamer, opts ...grpc.CallOption) (grpc.ClientStream, error) {
return func(ctx context.Context, desc *grpc.StreamDesc, cc *grpc.ClientConn, method string, streamer grpc.... | [
"func",
"(",
"m",
"*",
"ClientMetrics",
")",
"StreamClientInterceptor",
"(",
")",
"func",
"(",
"ctx",
"context",
".",
"Context",
",",
"desc",
"*",
"grpc",
".",
"StreamDesc",
",",
"cc",
"*",
"grpc",
".",
"ClientConn",
",",
"method",
"string",
",",
"stream... | // StreamClientInterceptor is a gRPC client-side interceptor that provides Prometheus monitoring for Streaming RPCs. | [
"StreamClientInterceptor",
"is",
"a",
"gRPC",
"client",
"-",
"side",
"interceptor",
"that",
"provides",
"Prometheus",
"monitoring",
"for",
"Streaming",
"RPCs",
"."
] | ae0d8660c5f2108ca70a3776dbe0fb53cf79f1da | https://github.com/grpc-ecosystem/go-grpc-prometheus/blob/ae0d8660c5f2108ca70a3776dbe0fb53cf79f1da/client_metrics.go#L192-L203 | train |
grpc-ecosystem/go-grpc-prometheus | examples/grpc-server-with-prometheus/server/server.go | SayHello | func (s *DemoServiceServer) SayHello(ctx context.Context, request *pb.HelloRequest) (*pb.HelloResponse, error) {
customizedCounterMetric.WithLabelValues(request.Name).Inc()
return &pb.HelloResponse{Message: fmt.Sprintf("Hello %s", request.Name)}, nil
} | go | func (s *DemoServiceServer) SayHello(ctx context.Context, request *pb.HelloRequest) (*pb.HelloResponse, error) {
customizedCounterMetric.WithLabelValues(request.Name).Inc()
return &pb.HelloResponse{Message: fmt.Sprintf("Hello %s", request.Name)}, nil
} | [
"func",
"(",
"s",
"*",
"DemoServiceServer",
")",
"SayHello",
"(",
"ctx",
"context",
".",
"Context",
",",
"request",
"*",
"pb",
".",
"HelloRequest",
")",
"(",
"*",
"pb",
".",
"HelloResponse",
",",
"error",
")",
"{",
"customizedCounterMetric",
".",
"WithLabe... | // SayHello implements a interface defined by protobuf. | [
"SayHello",
"implements",
"a",
"interface",
"defined",
"by",
"protobuf",
"."
] | ae0d8660c5f2108ca70a3776dbe0fb53cf79f1da | https://github.com/grpc-ecosystem/go-grpc-prometheus/blob/ae0d8660c5f2108ca70a3776dbe0fb53cf79f1da/examples/grpc-server-with-prometheus/server/server.go#L26-L29 | train |
grpc-ecosystem/go-grpc-prometheus | server.go | EnableHandlingTimeHistogram | func EnableHandlingTimeHistogram(opts ...HistogramOption) {
DefaultServerMetrics.EnableHandlingTimeHistogram(opts...)
prom.Register(DefaultServerMetrics.serverHandledHistogram)
} | go | func EnableHandlingTimeHistogram(opts ...HistogramOption) {
DefaultServerMetrics.EnableHandlingTimeHistogram(opts...)
prom.Register(DefaultServerMetrics.serverHandledHistogram)
} | [
"func",
"EnableHandlingTimeHistogram",
"(",
"opts",
"...",
"HistogramOption",
")",
"{",
"DefaultServerMetrics",
".",
"EnableHandlingTimeHistogram",
"(",
"opts",
"...",
")",
"\n",
"prom",
".",
"Register",
"(",
"DefaultServerMetrics",
".",
"serverHandledHistogram",
")",
... | // EnableHandlingTimeHistogram turns on recording of handling time
// of RPCs. Histogram metrics can be very expensive for Prometheus
// to retain and query. This function acts on the DefaultServerMetrics
// variable and the default Prometheus metrics registry. | [
"EnableHandlingTimeHistogram",
"turns",
"on",
"recording",
"of",
"handling",
"time",
"of",
"RPCs",
".",
"Histogram",
"metrics",
"can",
"be",
"very",
"expensive",
"for",
"Prometheus",
"to",
"retain",
"and",
"query",
".",
"This",
"function",
"acts",
"on",
"the",
... | ae0d8660c5f2108ca70a3776dbe0fb53cf79f1da | https://github.com/grpc-ecosystem/go-grpc-prometheus/blob/ae0d8660c5f2108ca70a3776dbe0fb53cf79f1da/server.go#L45-L48 | train |
grpc-ecosystem/go-grpc-prometheus | server_metrics.go | NewServerMetrics | func NewServerMetrics(counterOpts ...CounterOption) *ServerMetrics {
opts := counterOptions(counterOpts)
return &ServerMetrics{
serverStartedCounter: prom.NewCounterVec(
opts.apply(prom.CounterOpts{
Name: "grpc_server_started_total",
Help: "Total number of RPCs started on the server.",
}), []string{"g... | go | func NewServerMetrics(counterOpts ...CounterOption) *ServerMetrics {
opts := counterOptions(counterOpts)
return &ServerMetrics{
serverStartedCounter: prom.NewCounterVec(
opts.apply(prom.CounterOpts{
Name: "grpc_server_started_total",
Help: "Total number of RPCs started on the server.",
}), []string{"g... | [
"func",
"NewServerMetrics",
"(",
"counterOpts",
"...",
"CounterOption",
")",
"*",
"ServerMetrics",
"{",
"opts",
":=",
"counterOptions",
"(",
"counterOpts",
")",
"\n",
"return",
"&",
"ServerMetrics",
"{",
"serverStartedCounter",
":",
"prom",
".",
"NewCounterVec",
"... | // NewServerMetrics returns a ServerMetrics object. Use a new instance of
// ServerMetrics when not using the default Prometheus metrics registry, for
// example when wanting to control which metrics are added to a registry as
// opposed to automatically adding metrics via init functions. | [
"NewServerMetrics",
"returns",
"a",
"ServerMetrics",
"object",
".",
"Use",
"a",
"new",
"instance",
"of",
"ServerMetrics",
"when",
"not",
"using",
"the",
"default",
"Prometheus",
"metrics",
"registry",
"for",
"example",
"when",
"wanting",
"to",
"control",
"which",
... | ae0d8660c5f2108ca70a3776dbe0fb53cf79f1da | https://github.com/grpc-ecosystem/go-grpc-prometheus/blob/ae0d8660c5f2108ca70a3776dbe0fb53cf79f1da/server_metrics.go#L27-L58 | train |
grpc-ecosystem/go-grpc-prometheus | server_metrics.go | EnableHandlingTimeHistogram | func (m *ServerMetrics) EnableHandlingTimeHistogram(opts ...HistogramOption) {
for _, o := range opts {
o(&m.serverHandledHistogramOpts)
}
if !m.serverHandledHistogramEnabled {
m.serverHandledHistogram = prom.NewHistogramVec(
m.serverHandledHistogramOpts,
[]string{"grpc_type", "grpc_service", "grpc_method"... | go | func (m *ServerMetrics) EnableHandlingTimeHistogram(opts ...HistogramOption) {
for _, o := range opts {
o(&m.serverHandledHistogramOpts)
}
if !m.serverHandledHistogramEnabled {
m.serverHandledHistogram = prom.NewHistogramVec(
m.serverHandledHistogramOpts,
[]string{"grpc_type", "grpc_service", "grpc_method"... | [
"func",
"(",
"m",
"*",
"ServerMetrics",
")",
"EnableHandlingTimeHistogram",
"(",
"opts",
"...",
"HistogramOption",
")",
"{",
"for",
"_",
",",
"o",
":=",
"range",
"opts",
"{",
"o",
"(",
"&",
"m",
".",
"serverHandledHistogramOpts",
")",
"\n",
"}",
"\n",
"i... | // EnableHandlingTimeHistogram enables histograms being registered when
// registering the ServerMetrics on a Prometheus registry. Histograms can be
// expensive on Prometheus servers. It takes options to configure histogram
// options such as the defined buckets. | [
"EnableHandlingTimeHistogram",
"enables",
"histograms",
"being",
"registered",
"when",
"registering",
"the",
"ServerMetrics",
"on",
"a",
"Prometheus",
"registry",
".",
"Histograms",
"can",
"be",
"expensive",
"on",
"Prometheus",
"servers",
".",
"It",
"takes",
"options"... | ae0d8660c5f2108ca70a3776dbe0fb53cf79f1da | https://github.com/grpc-ecosystem/go-grpc-prometheus/blob/ae0d8660c5f2108ca70a3776dbe0fb53cf79f1da/server_metrics.go#L64-L75 | train |
grpc-ecosystem/go-grpc-prometheus | server_metrics.go | UnaryServerInterceptor | func (m *ServerMetrics) UnaryServerInterceptor() func(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (interface{}, error) {
return func(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (interface{}, error) {
monitor := newServe... | go | func (m *ServerMetrics) UnaryServerInterceptor() func(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (interface{}, error) {
return func(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (interface{}, error) {
monitor := newServe... | [
"func",
"(",
"m",
"*",
"ServerMetrics",
")",
"UnaryServerInterceptor",
"(",
")",
"func",
"(",
"ctx",
"context",
".",
"Context",
",",
"req",
"interface",
"{",
"}",
",",
"info",
"*",
"grpc",
".",
"UnaryServerInfo",
",",
"handler",
"grpc",
".",
"UnaryHandler"... | // UnaryServerInterceptor is a gRPC server-side interceptor that provides Prometheus monitoring for Unary RPCs. | [
"UnaryServerInterceptor",
"is",
"a",
"gRPC",
"server",
"-",
"side",
"interceptor",
"that",
"provides",
"Prometheus",
"monitoring",
"for",
"Unary",
"RPCs",
"."
] | ae0d8660c5f2108ca70a3776dbe0fb53cf79f1da | https://github.com/grpc-ecosystem/go-grpc-prometheus/blob/ae0d8660c5f2108ca70a3776dbe0fb53cf79f1da/server_metrics.go#L104-L116 | train |
grpc-ecosystem/go-grpc-prometheus | server_metrics.go | StreamServerInterceptor | func (m *ServerMetrics) StreamServerInterceptor() func(srv interface{}, ss grpc.ServerStream, info *grpc.StreamServerInfo, handler grpc.StreamHandler) error {
return func(srv interface{}, ss grpc.ServerStream, info *grpc.StreamServerInfo, handler grpc.StreamHandler) error {
monitor := newServerReporter(m, streamRPCT... | go | func (m *ServerMetrics) StreamServerInterceptor() func(srv interface{}, ss grpc.ServerStream, info *grpc.StreamServerInfo, handler grpc.StreamHandler) error {
return func(srv interface{}, ss grpc.ServerStream, info *grpc.StreamServerInfo, handler grpc.StreamHandler) error {
monitor := newServerReporter(m, streamRPCT... | [
"func",
"(",
"m",
"*",
"ServerMetrics",
")",
"StreamServerInterceptor",
"(",
")",
"func",
"(",
"srv",
"interface",
"{",
"}",
",",
"ss",
"grpc",
".",
"ServerStream",
",",
"info",
"*",
"grpc",
".",
"StreamServerInfo",
",",
"handler",
"grpc",
".",
"StreamHand... | // StreamServerInterceptor is a gRPC server-side interceptor that provides Prometheus monitoring for Streaming RPCs. | [
"StreamServerInterceptor",
"is",
"a",
"gRPC",
"server",
"-",
"side",
"interceptor",
"that",
"provides",
"Prometheus",
"monitoring",
"for",
"Streaming",
"RPCs",
"."
] | ae0d8660c5f2108ca70a3776dbe0fb53cf79f1da | https://github.com/grpc-ecosystem/go-grpc-prometheus/blob/ae0d8660c5f2108ca70a3776dbe0fb53cf79f1da/server_metrics.go#L119-L127 | train |
grpc-ecosystem/go-grpc-prometheus | server_metrics.go | InitializeMetrics | func (m *ServerMetrics) InitializeMetrics(server *grpc.Server) {
serviceInfo := server.GetServiceInfo()
for serviceName, info := range serviceInfo {
for _, mInfo := range info.Methods {
preRegisterMethod(m, serviceName, &mInfo)
}
}
} | go | func (m *ServerMetrics) InitializeMetrics(server *grpc.Server) {
serviceInfo := server.GetServiceInfo()
for serviceName, info := range serviceInfo {
for _, mInfo := range info.Methods {
preRegisterMethod(m, serviceName, &mInfo)
}
}
} | [
"func",
"(",
"m",
"*",
"ServerMetrics",
")",
"InitializeMetrics",
"(",
"server",
"*",
"grpc",
".",
"Server",
")",
"{",
"serviceInfo",
":=",
"server",
".",
"GetServiceInfo",
"(",
")",
"\n",
"for",
"serviceName",
",",
"info",
":=",
"range",
"serviceInfo",
"{... | // InitializeMetrics initializes all metrics, with their appropriate null
// value, for all gRPC methods registered on a gRPC server. This is useful, to
// ensure that all metrics exist when collecting and querying. | [
"InitializeMetrics",
"initializes",
"all",
"metrics",
"with",
"their",
"appropriate",
"null",
"value",
"for",
"all",
"gRPC",
"methods",
"registered",
"on",
"a",
"gRPC",
"server",
".",
"This",
"is",
"useful",
"to",
"ensure",
"that",
"all",
"metrics",
"exist",
"... | ae0d8660c5f2108ca70a3776dbe0fb53cf79f1da | https://github.com/grpc-ecosystem/go-grpc-prometheus/blob/ae0d8660c5f2108ca70a3776dbe0fb53cf79f1da/server_metrics.go#L132-L139 | train |
grpc-ecosystem/go-grpc-prometheus | server_metrics.go | preRegisterMethod | func preRegisterMethod(metrics *ServerMetrics, serviceName string, mInfo *grpc.MethodInfo) {
methodName := mInfo.Name
methodType := string(typeFromMethodInfo(mInfo))
// These are just references (no increments), as just referencing will create the labels but not set values.
metrics.serverStartedCounter.GetMetricWit... | go | func preRegisterMethod(metrics *ServerMetrics, serviceName string, mInfo *grpc.MethodInfo) {
methodName := mInfo.Name
methodType := string(typeFromMethodInfo(mInfo))
// These are just references (no increments), as just referencing will create the labels but not set values.
metrics.serverStartedCounter.GetMetricWit... | [
"func",
"preRegisterMethod",
"(",
"metrics",
"*",
"ServerMetrics",
",",
"serviceName",
"string",
",",
"mInfo",
"*",
"grpc",
".",
"MethodInfo",
")",
"{",
"methodName",
":=",
"mInfo",
".",
"Name",
"\n",
"methodType",
":=",
"string",
"(",
"typeFromMethodInfo",
"(... | // preRegisterMethod is invoked on Register of a Server, allowing all gRPC services labels to be pre-populated. | [
"preRegisterMethod",
"is",
"invoked",
"on",
"Register",
"of",
"a",
"Server",
"allowing",
"all",
"gRPC",
"services",
"labels",
"to",
"be",
"pre",
"-",
"populated",
"."
] | ae0d8660c5f2108ca70a3776dbe0fb53cf79f1da | https://github.com/grpc-ecosystem/go-grpc-prometheus/blob/ae0d8660c5f2108ca70a3776dbe0fb53cf79f1da/server_metrics.go#L173-L186 | train |
grpc-ecosystem/go-grpc-prometheus | client.go | EnableClientHandlingTimeHistogram | func EnableClientHandlingTimeHistogram(opts ...HistogramOption) {
DefaultClientMetrics.EnableClientHandlingTimeHistogram(opts...)
prom.Register(DefaultClientMetrics.clientHandledHistogram)
} | go | func EnableClientHandlingTimeHistogram(opts ...HistogramOption) {
DefaultClientMetrics.EnableClientHandlingTimeHistogram(opts...)
prom.Register(DefaultClientMetrics.clientHandledHistogram)
} | [
"func",
"EnableClientHandlingTimeHistogram",
"(",
"opts",
"...",
"HistogramOption",
")",
"{",
"DefaultClientMetrics",
".",
"EnableClientHandlingTimeHistogram",
"(",
"opts",
"...",
")",
"\n",
"prom",
".",
"Register",
"(",
"DefaultClientMetrics",
".",
"clientHandledHistogra... | // EnableClientHandlingTimeHistogram turns on recording of handling time of
// RPCs. Histogram metrics can be very expensive for Prometheus to retain and
// query. This function acts on the DefaultClientMetrics variable and the
// default Prometheus metrics registry. | [
"EnableClientHandlingTimeHistogram",
"turns",
"on",
"recording",
"of",
"handling",
"time",
"of",
"RPCs",
".",
"Histogram",
"metrics",
"can",
"be",
"very",
"expensive",
"for",
"Prometheus",
"to",
"retain",
"and",
"query",
".",
"This",
"function",
"acts",
"on",
"t... | ae0d8660c5f2108ca70a3776dbe0fb53cf79f1da | https://github.com/grpc-ecosystem/go-grpc-prometheus/blob/ae0d8660c5f2108ca70a3776dbe0fb53cf79f1da/client.go#L36-L39 | train |
grpc-ecosystem/go-grpc-prometheus | client.go | EnableClientStreamReceiveTimeHistogram | func EnableClientStreamReceiveTimeHistogram(opts ...HistogramOption) {
DefaultClientMetrics.EnableClientStreamReceiveTimeHistogram(opts...)
prom.Register(DefaultClientMetrics.clientStreamRecvHistogram)
} | go | func EnableClientStreamReceiveTimeHistogram(opts ...HistogramOption) {
DefaultClientMetrics.EnableClientStreamReceiveTimeHistogram(opts...)
prom.Register(DefaultClientMetrics.clientStreamRecvHistogram)
} | [
"func",
"EnableClientStreamReceiveTimeHistogram",
"(",
"opts",
"...",
"HistogramOption",
")",
"{",
"DefaultClientMetrics",
".",
"EnableClientStreamReceiveTimeHistogram",
"(",
"opts",
"...",
")",
"\n",
"prom",
".",
"Register",
"(",
"DefaultClientMetrics",
".",
"clientStrea... | // EnableClientStreamReceiveTimeHistogram turns on recording of
// single message receive time of streaming RPCs.
// This function acts on the DefaultClientMetrics variable and the
// default Prometheus metrics registry. | [
"EnableClientStreamReceiveTimeHistogram",
"turns",
"on",
"recording",
"of",
"single",
"message",
"receive",
"time",
"of",
"streaming",
"RPCs",
".",
"This",
"function",
"acts",
"on",
"the",
"DefaultClientMetrics",
"variable",
"and",
"the",
"default",
"Prometheus",
"met... | ae0d8660c5f2108ca70a3776dbe0fb53cf79f1da | https://github.com/grpc-ecosystem/go-grpc-prometheus/blob/ae0d8660c5f2108ca70a3776dbe0fb53cf79f1da/client.go#L45-L48 | train |
Subsets and Splits
SQL Console for semeru/code-text-go
Retrieves a limited set of code samples with their languages, with a specific case adjustment for 'Go' language.